@inkeep/open-knowledge 0.88.0 → 0.88.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/project/references/conflict-resolution.md +5 -1
- package/dist/cli.mjs +77 -77
- package/dist/constants-J_2c-D3U.mjs +1 -0
- package/dist/dist-BSRU0yxj.mjs +1 -0
- package/dist/dist-Dcmwb25g.mjs +2231 -0
- package/dist/index.mjs +183 -183
- package/dist/init-C91Labje.mjs +1 -0
- package/dist/{init-BFRpuF0Z.mjs → init-DmY5yyav.mjs} +61 -61
- package/dist/{launch-json-removal-BfVm86jq.mjs → launch-json-removal-BhCxyDgy.mjs} +1 -1
- package/dist/{lib-CLRUBb2o.mjs → lib-CxwDRGVJ.mjs} +3 -3
- package/dist/{loader-C-U8IQ2E.mjs → loader-BQnZkdE-.mjs} +1 -1
- package/dist/loader-C1uKGeXQ.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-CAY3I0ul.mjs → md-manager-BGnqyqi1-QGJ-q9Qx.mjs} +2 -2
- package/dist/{open-browser-DYDl2MPM.mjs → open-browser-Dh_3itA4.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BLzm1gNw.mjs +1 -0
- package/dist/{preview-3Hsys4mQ.mjs → preview-BmbvsohB.mjs} +1 -1
- package/dist/public/assets/{AccountSection-Df9opXYb.js → AccountSection-CBx20rOt.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-BqNsXfT4.js → ActivityModeContent-xTdhODwb.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-COJAHiNO.js → AddPropertiesButton-BS5sfWmg.js} +2 -2
- package/dist/public/assets/{AgentConnectionsSection-CbKU194h.js → AgentConnectionsSection-C43l2mJy.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Bxsscd4F.js → AgentDiffPane-WtCKfNKM.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-DIHxUmql.js → AttachmentsSection-DFya3yNP.js} +1 -1
- package/dist/public/assets/{AuthModal-DsmG3Tvf.js → AuthModal-C6TUfJLf.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-YSigWxek.js → CodeMirrorPropInput-Cpqe9F2H.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-W8YrIYgB.js → ContentRulesSection-LyNZMcPU.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-C58eMqyu.js → DiffViewBoundary-j9Bn81JI.js} +1 -1
- package/dist/public/assets/{DocumentContext-Dhs9Bgpy.js → DocumentContext-CxRsF0t3.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CyO097Zh.js → EditorModeToggle-CnKlWOie.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-6_WxAYZn.js → ExcalidrawDocEditor-DFJHJmtM.js} +1 -1
- package/dist/public/assets/FeedbackForm-DJFCZkBc.js +1 -0
- package/dist/public/assets/{GraphPanel-DOx9UNvO.js → GraphPanel-DuJ2YWw4.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BmbpyG9X.js → ImportSkillDialog-BnOQ_ju0.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-D43dGSt1.js → LinkPreviewsSection-OOvYTWJU.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-B1A5Al4i.js → LintConfigEditor-CtSietcm.js} +1 -1
- package/dist/public/assets/{LintingSection-5SVYzsWm.js → LintingSection-CIr2a4tS.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BABTWRcL.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-BuefhPEE.js → ManagedArtifactProperties-Na40pjPs.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-4gAbORTO.js → MermaidDocEditor-BUMm9Iwk.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-CpHDvqgy.js → NetworkAccessSection-DajjaZXs.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-BgNT0K8r.js → ProjectTemplatesSection-BpE9Lmvi.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CetTVIgB.js → PropertyDisplayRow-C-uYXWiI.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-BI5hqYxN.js → PublishToGitHubDialog-Dpaiv1Kj.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-BsD-s4ln.js → RegisteredAgentIcon-D-MeVkiO.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-V1-vXIzF.js → SchemaConfigEditor-AJWYxOwG.js} +1 -1
- package/dist/public/assets/{SearchSection-lMgT00iG.js → SearchSection-DGqeGTeg.js} +1 -1
- package/dist/public/assets/{SessionsHost-BNcTj5fv.js → SessionsHost-BhcS2B8R.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-JxdL2CXl.js → SettingsDialogBody-G-FBFq9K.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-DxCINO9Q.js → ShareReceiveMissDialog-D4jCgpt9.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CfttVYIg.js → SkillCostValue-BeGV1AHZ.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-Bh1ENNhm.js → SkillForkDialog-BJ1PNDyY.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BNOJ1gOq.js → SkillInstallMenu-DoFpn_i9.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-CbftHWN_.js → SkillOriginInline-jAGOTBhd.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-BZidbHAz.js → SkillPluginBundleDialog-COmssCF-.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-D7_BcqhS.js → SkillToolbarControls-BAdBtwlv.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-8kamzhJv.js → SkillsManagerSection-DBG_uiBY.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-DGY8OW-e.js → SlidesPluginSection-o1AAv2gw.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-iMBibqX8.js → SlidesToolbarControls-CI8t13V0.js} +1 -1
- package/dist/public/assets/{SourceEditor-D1DTKvNj.js → SourceEditor-PuTEPurq.js} +1 -1
- package/dist/public/assets/{SpellingSettings-ucYYz478.js → SpellingSettings-C0gidatW.js} +1 -1
- package/dist/public/assets/{SyncSection-CWLMt61q.js → SyncSection-DBG-g73Q.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-D4XfyHvU.js → SyncStatusBadge-BOQqzGQf.js} +1 -1
- package/dist/public/assets/{TemplateRow-3gYh359C.js → TemplateRow-CDGoaqY2.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-8-tVdZR6.js → TerminalLaunchContext-QHAEcBor.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Bl1RiE6k.js → TerminalPanel-9hEgdMJq.js} +1 -1
- package/dist/public/assets/{TerminalSection-is-FaOji.js → TerminalSection-D7BgWf9p.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DCmVnc91.js → TerminalWindowApp-YJV1cprU.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CU9E3apE.js → TextDocEditor-DZRuCjqW.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-DJWSYu1B.js → ThemePluginSection-CnljF-zY.js} +1 -1
- package/dist/public/assets/{ThreadView-8S31lclo.js → ThreadView-ifWyWlde.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-9Q0GIo8J.js → TimelineDiffPane-B1-nYdp0.js} +1 -1
- package/dist/public/assets/{_envelope-eL1L23Tr-B0_VTKOS.js → _envelope-BjFOILGI-BHu_Fgux.js} +1 -1
- package/dist/public/assets/{agent-connections-qusR8JdV.js → agent-connections-2s8pWp2V.js} +1 -1
- package/dist/public/assets/{agent-registry-E4-YX-C7.js → agent-registry-B5GJuQIb.js} +1 -1
- package/dist/public/assets/{bridge-BC8zoeJp.js → bridge-uRUTEbTH.js} +1 -1
- package/dist/public/assets/{catalog-BLHq__9W.js → catalog-CPyYGl1U.js} +1 -1
- package/dist/public/assets/{client-version-CoZXEZeY.js → client-version-DdaKu-EC.js} +1 -1
- package/dist/public/assets/{comment-chips-nIzHBg7Z.js → comment-chips-CelQzR0D.js} +1 -1
- package/dist/public/assets/{config-provider-Bxrf0VFY.js → config-provider-CCKmhkNf.js} +1 -1
- package/dist/public/assets/config-schema-TP14Ln7J.js +1 -0
- package/dist/public/assets/{css-color-to-hex-BxZMOPR2.js → css-color-to-hex-BqyOnwSQ.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-B7shHUXa.js → doc-undo-manager-B8dIdSPP.js} +1 -1
- package/dist/public/assets/field-controls-BBwpwI6T.js +1 -0
- package/dist/public/assets/{field-controls-VYlM-zuI.js → field-controls-C_cFYlPg.js} +1 -1
- package/dist/public/assets/{handoff-DfyrwqdH.js → handoff-dsJx3fmu.js} +1 -1
- package/dist/public/assets/{ime-composition-82-FXhge.js → ime-composition-BdK2XKJN.js} +1 -1
- package/dist/public/assets/{index-Dn014Uc_.js → index-D6QRd24r.js} +7 -7
- package/dist/public/assets/{lint-config-client-44sBu7BY.js → lint-config-client-B9TDClQk.js} +1 -1
- package/dist/public/assets/{lint-plugins-CcZ6qDxp.js → lint-plugins-CFRKtX1P.js} +1 -1
- package/dist/public/assets/{markdown-lint-DuEyV_QZ.js → markdown-lint-hq7LEFYG.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-eM3Qv7kg.js → markdownlint-rule-browser-BT_QJrPv.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-mZ6RA3P5.js → pending-receive-nav-store-B3eFqrN0.js} +1 -1
- package/dist/public/assets/{preferred-session-events-DHiO3Auf.js → preferred-session-events-BB6WGaX5.js} +1 -1
- package/dist/public/assets/{progress-CY0lyFVC.js → progress-vTDT3BN9.js} +1 -1
- package/dist/public/assets/{saved-themes-client-BKoVNUUS.js → saved-themes-client-CyrzqPhC.js} +1 -1
- package/dist/public/assets/{schema-section-QBDszEOo.js → schema-section-DUx17rqG.js} +1 -1
- package/dist/public/assets/{schemas-api-Bfr5hz6Y.js → schemas-api-SZDu_YyA.js} +1 -1
- package/dist/public/assets/{selection-context-DG5K4cJb.js → selection-context-D41UPhfK.js} +1 -1
- package/dist/public/assets/{skills-api-K7ohwTHC.js → skills-api-DOR7jsOr.js} +1 -1
- package/dist/public/assets/{src-CW4ggZDd.js → src-tUR-f_46.js} +1 -1
- package/dist/public/assets/storage-scope-CCzi5i_K.js +1 -0
- package/dist/public/assets/{tag-pill-input-CuM3KvPL.js → tag-pill-input-B2VRyJ6a.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Iss1II_b.js → telemetry-impl-VTNE1WyD.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BoZ03oES.js → telemetry-startup-CubQ69x2.js} +1 -1
- package/dist/public/assets/terminal-cli-display-BAuHoUP9.js +1 -0
- package/dist/public/assets/{terminal-command-events-WwmIH6_2.js → terminal-command-events-CxfMZsn9.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BZhihNCW.js → terminal-launch-events-zMqQcfPZ.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DsQJ99H5.js → typing-burst-detector-ZCJlhyzI.js} +1 -1
- package/dist/public/assets/{use-activity-panel-kXobfF-I.js → use-activity-panel-usWxv2Jb.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-CX_Lat5F.js → use-apply-config-color-theme-B2-UX2_r.js} +1 -1
- package/dist/public/assets/{use-conflicts-8HzsEqZ0.js → use-conflicts-BynxNVIR.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-TpVKyL9M.js → use-live-xterm-theme-LQGQWK3o.js} +1 -1
- package/dist/public/assets/{use-open-skill-nl3yM9Tn.js → use-open-skill-DkI9xqC5.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-t6poTntV.js → use-semantic-search-status-ChCXifhi.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Bn6DLUoJ.js → use-skill-origin-BnCsWoWi.js} +1 -1
- package/dist/public/assets/{use-skill-targets-BGy2OH1p.js → use-skill-targets-BUjtaAEb.js} +1 -1
- package/dist/public/assets/{use-skills-zxVtcQ4J.js → use-skills-Dwg_D8aJ.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BUq2QceX.js → use-terminal-enabled-DFGR9dVE.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Etq8AxNh.js → use-timeline-entry-diff-BIkd4hmY.js} +1 -1
- package/dist/public/assets/{use-workspace-C24MYxZb.js → use-workspace-CfDXcTRo.js} +1 -1
- package/dist/public/index.html +51 -51
- package/dist/{registry-probes-DhxnLEWK.mjs → registry-probes-Cef-Pb6A.mjs} +10 -10
- package/dist/{removal-file-path-DE9Ph5Jy.mjs → removal-file-path-aw74M53z.mjs} +1 -1
- package/dist/{repair-launch-json-CeLf37MW.mjs → repair-launch-json-B8J_kVu8.mjs} +1 -1
- package/dist/{repair-mcp-configs-DZa24eFR.mjs → repair-mcp-configs-BcaWNIs5.mjs} +1 -1
- package/dist/src-8zw4fVGF.mjs +1 -0
- package/dist/src-DkeQDeWc.mjs +16 -0
- package/dist/start-67rpN-q-.mjs +1 -0
- package/dist/start-IGluF4th.mjs +5 -0
- package/package.json +4 -4
- package/dist/constants-cJMG3_pP.mjs +0 -1
- package/dist/dist-B2Ob9aIQ.mjs +0 -1
- package/dist/dist-DHzxlDC1.mjs +0 -2230
- package/dist/init-BqTZwEdT.mjs +0 -1
- package/dist/loader-Cj5KBBUv.mjs +0 -1
- package/dist/preview-BfLHcmrO.mjs +0 -1
- package/dist/public/assets/FeedbackForm-B6FqvR6O.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Bk91H2yx.js +0 -1
- package/dist/public/assets/config-schema-XNMCu6AJ.js +0 -1
- package/dist/public/assets/field-controls-mTFxITM4.js +0 -1
- package/dist/public/assets/storage-scope-BMJUnURI.js +0 -1
- package/dist/public/assets/terminal-cli-display-CnNZPRHq.js +0 -1
- package/dist/src-CbCJ3kkW.mjs +0 -16
- package/dist/src-DiIPiMP3.mjs +0 -1
- package/dist/start-BLHeOum4.mjs +0 -1
- package/dist/start-BnGFOCpu.mjs +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Yc as e,_l as t,fd as n,hl as r,k as i,qc as a,xl as o}from"./md-manager-BGnqyqi1-QGJ-q9Qx.mjs";import{x as s,xs as c,ys as l}from"./dist-Dcmwb25g.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-J_2c-D3U.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=n();async function _(e){let t=f(e);try{return await h(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(e,n){return e.map(e=>{let r=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:e.message,issueCode:e.code};if(n.doc!==null&&n.source!==null){let e=t({file:n.path,source:n.source,doc:n.doc,path:r});if(e!==void 0)return{...i,source:e}}return i})}function b(t){let n=t??process.cwd(),u=[],p=[],m=[],h=[],g=c(`user`,n),_=l({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&u.push(g);let b=(e,t=!1)=>{let n=v(e);if(n.diagnostic!==void 0&&p.push(n.diagnostic),n.value===null)return{};let a=r({value:n.value,file:n.path,source:n.source,doc:n.doc});p.push(...a),u.push(e);let s=a.length>0?o(n.value):n.value;return t&&h.push(...i({value:s,file:n.path,source:n.source,doc:n.doc})),s},x=f(n,`.ok`,d),S=b(x,!0),C=b(c(`project-local`,n)),w=a(_.value,S,C),T=s.safeParse(w);if(!T.success){let t=v(x),n={code:`SCHEMA_INVALID`,issues:y(T.error.issues,t)};throw Error(e(n))}return{config:T.data,sources:u,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-BQnZkdE-.mjs";export{e as loadConfig};
|
|
@@ -259,7 +259,7 @@ $2`).split(`
|
|
|
259
259
|
`)].join(`
|
|
260
260
|
`);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
|
|
261
261
|
`))n.push(` ${t}`);return n.join(`
|
|
262
|
-
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`SAVE_HELD`:return`${e.file} was not saved (${e.cause}); saving is tried again.`;case`UNKNOWN`:return e.message??`Unknown error.`}}function Qg(e,t,n){return $g([e,t,n],[])}function $g(e,t){if(t.length>0){let n=Kh(Uh,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=e_(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>t_(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=$g(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function e_(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function t_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const n_=`__system__`,r_=1,i_=`__config__/project`,a_=`__user__/config.yml`,o_=`__local__/project`,s_=`__config__/okignore`,c_=Object.freeze([i_,o_,a_,s_]),l_=`__skill__/`,u_=`__template__/`,d_=`__extskill__/`,f_=[`project`,`global`];function p_(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}function m_(e){return`${d_}${e}`}function h_(e){if(!e.startsWith(`__extskill__/`))return null;let t=e.slice(13),n=t.indexOf(`/`),r=n<0?t:t.slice(0,n),i=n<0?null:t.slice(n+1);return/^[a-z0-9-]+$/.test(r)?{name:r,rel:i&&i.length>0?i:null}:null}function g_(e){return e.replace(/\.mdx?$/i,``)}const __=`.ok/skills`;function v_(e){return`${__}/${e}/SKILL`}const y_=[`references`,`scripts`];function b_(e,t){let n=e.trim();if(!n.startsWith(`/`))return null;let r=n.slice(1);if(r===``||r.includes(`/`))return null;let i=/^(\.[A-Za-z0-9_-]+\/skills)\/[^/]+\/(?:SKILL|references\/.+)$/.exec(t);return i?`${i[1]}/${r}/SKILL`:/^__skill__\/(global)\/[^/]+(?:\/references\/.+)?$/.exec(t)?w_(`global`,r):null}function x_(e,t){let n=/^(\.[A-Za-z0-9_-]+\/skills\/[^/]+)\/(?:SKILL|references\/.+)$/.exec(t)??/^(__skill__\/global\/[^/]+)(?:\/references\/.+)?$/.exec(t)??/^(__extskill__\/[^/]+)(?:\/.+)?$/.exec(t);if(!n)return null;let r=n[1],i=g_(e.trim()).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!y_.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}const S_=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function C_(e){let t=S_.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===`SKILL`?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}const Rne=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function zne(e){let t=Rne.exec(e);if(!t)return null;let{name:n,host:r}=T_(t[1]),i=t[2];return i===void 0?{name:n,kind:`skill`,rel:null,host:r}:{name:n,kind:`reference`,rel:i.slice(11),host:r}}function w_(e,t,n){return e===`project`?v_(t):`${l_}${e}/${t}${n?`@${n}`:``}`}function T_(e){let t=e.indexOf(`@`);if(t<0)return{name:e,host:null};let n=e.slice(t+1);return{name:e.slice(0,t),host:n===``?null:n}}function Bne(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function Vne(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);if(!i)return null;let a=Bne(i),o=a.indexOf(`/`),s=o<0?a:a.slice(0,o);if(!s)return null;let c=o<0?null:a.slice(o+1),{name:l,host:u}=T_(s);return l?{kind:`skill`,scope:r,name:l,host:u,rel:c}:null}return null}function Hne(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/.ok/templates/${t}`:`.ok/templates/${t}`}const E_=[`.mdx`,`.md`],Une=v.stable.mcpServerName,Wne=`Server unreachable:`,Gne=`Server timed out:`,Kne=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`],qne=`OK_HOSTED_AGENT`;function Jne(e){return e.OK_DESKTOP_TERMINAL===`1`||e.OK_HOSTED_AGENT===`1`}function D_(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Yne=new Set([`opencode.json`]),Xne=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function O_(e){return Xne.test(e)}function k_(e){return O_(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:Yne.has(e.slice(e.lastIndexOf(`/`)+1))}const A_=P(j().min(1)).max(50),Zne=I([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Qne=F({label:j().min(1),webUrl:Co().nullable(),transport:I([`https`,`http`,`ssh`,`git`]).optional()}).loose(),$ne=Io(`checkStatus`,[F({checkStatus:L(`allowed`)}).loose(),F({checkStatus:L(`denied`),deniedReason:I([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:j().optional(),declaredLogin:j().optional(),declaredSource:j().optional()}).loose(),F({checkStatus:L(`unknown`),unknownError:I([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),j_=I([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),ere=I(Bp),tre=I([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),nre=F({state:Zne,lastSyncUtc:j().nullable(),lastRunUtc:j().nullable().optional(),lastPullOkUtc:j().nullable().optional(),lastPushOkUtc:j().nullable().optional(),lastFetchUtc:j().nullable(),lastPushedSha:j().nullable(),ahead:M().int().min(0),behind:M().int().min(0),consecutiveFailures:M().int().min(0),consecutivePushFailures:M().int().min(0).optional(),conflictCount:M().int().min(0),hasRemote:N(),syncEnabled:N(),identityUnresolved:N(),remote:Qne.nullable().optional(),pushError:j().optional(),pushErrorCode:j_.optional(),pullError:j().optional(),pullErrorCode:j_.optional(),pausedReason:j().optional(),blockingPaths:P(j().min(1)).optional(),refusedSymlinkPaths:A_.optional(),pushPermission:$ne.optional(),syncMode:ere.optional(),lastPullUtc:j().nullable().optional(),lastPullOutcome:tre.nullable().optional()}).loose(),rre=F({action:I([`commit`]),paths:P(j().min(1)),commitSha:j().optional()}).loose(),ire=F({action:I([`commit`])}).loose(),are=F({op:I([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),ore=F({op:I([`sync`,`push`,`pull`,`fetch`])}).loose(),M_=[`merge-native`,`working-tree`,`reconcile`],N_=I(M_),P_=[`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`],F_=I(P_),sre=I([`mine`,`theirs`,`content`,`delete`]),cre=F({conflicts:P(F({file:j().min(1),detectedAt:j().min(1),conflict:N_,reason:F_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),docName:j().nullable(),theirsSha:j().optional(),baseSha:j().optional()}).loose())}).loose(),lre=F({file:j().min(1),strategy:I([`mine`,`theirs`,`content`,`delete`]),content:j().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),ure=F({}).loose(),dre=F({file:j().min(1),base:j(),ours:j(),theirs:j(),kind:I([`both-modified`,`delete-modify`,`modify-delete`]),conflict:N_,reason:F_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),resolutionOptions:P(sre)}).loose(),fre=F({plan:_s(e=>e!==void 0,{message:`plan is required`})}).loose(),pre=F({plan:_s(e=>e!==void 0,{message:`plan is required`})}).loose(),mre=F({result:_s(e=>e!==void 0,{message:`result is required`})}).loose(),hre=F({packId:j().min(1)}).strict(),gre=F({installedHosts:P(j()),skills:P(F({name:j().min(1),created:N()}).strict())}).strict(),_re=F({path:j().min(1),summary:j().min(1)}).loose(),vre=F({files:M().int().nonnegative(),folders:M().int().nonnegative()}).loose(),yre=F({packs:P(F({id:j().min(1),name:j().min(1),description:j().min(1),defaultSubfolder:j().optional(),folders:P(_re),entryCounts:vre}).loose())}).loose(),bre=F({noOpen:N().optional(),out:j().min(1).optional()}).loose(),xre=F({reason:I([`unsupported-platform`,`spawn-error`]),message:j()}).loose(),Sre=Io(`status`,[F({status:L(`installed`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j()}).loose(),F({status:L(`built`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j(),handoffError:xre.optional()}).loose(),F({status:L(`failed`),buildError:j()}).loose(),F({status:L(`skip-current`),skillVersion:j(),recordedAt:j().optional()}).loose()]),Cre=Io(`kind`,[F({kind:L(`doc`),docPath:j().min(1)}).loose(),F({kind:L(`folder`),folderPath:j()}).loose()]),I_=I([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),L_=I([`current`,`stale`,`absent`,`empty`]),wre=Io(`ok`,[F({ok:L(!0),shareUrl:j().min(1),sharedUrl:j().min(1),branch:j().min(1),freshness:L_.optional().catch(void 0)}).loose(),F({ok:L(!1),error:I_,branch:j().min(1).optional()}).loose()]),Tre=I([`user`,`org`]),Ere=F({login:j().min(1),kind:Tre,avatarUrl:j().optional()}).loose(),R_=I([`auth-required`,`network`]),Dre=Io(`ok`,[F({ok:L(!0),owners:P(Ere)}).loose(),F({ok:L(!1),error:R_}).loose()]),Ore=Io(`ok`,[F({ok:L(!0),available:N()}).loose(),F({ok:L(!1),error:R_}).loose()]),kre=I([`public`,`private`]),Are=F({owner:j().min(1),name:j().min(1),visibility:kre,description:j().optional()}).loose(),jre=I([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),z_=Io(`ok`,[F({ok:L(!0),ownerLogin:j().min(1),repoName:j().min(1),cloneUrl:j().min(1),defaultBranch:j().min(1)}).loose(),F({ok:L(!1),error:jre}).loose()]);function B_(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const V_=e=>e.refine(B_,`invalid branch name`);function H_(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const U_=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],W_=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],G_=[/permission denied.*\(publickey\)/i,/host key verification failed/i],K_=/fatal:.*repository.*not found/i,q_=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,K_];function J_(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function Y_(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${J_(e)}`;return U_.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:W_.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:G_.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:q_.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:K_.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function X_(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const Z_={shareTargetExists:N(),dirtyConflicts:F({conflicts:N(),files:P(j().min(1))}).loose(),branchIsLocal:N(),shareTargetOnOriginBranch:N().optional()},Q_=Io(`detached`,[F({detached:L(!1),currentBranch:j().min(1).nullable(),currentHeadSha:Eo(),...Z_}).loose(),F({detached:L(!0),currentBranch:Eo(),currentHeadSha:j().min(1),...Z_}).loose()]),$_=F({branch:V_(j().min(1)),principalId:j().optional(),fastForward:N().optional()}).loose(),ev=I([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]),tv=Io(`ok`,[F({ok:L(!0)}).loose(),F({ok:L(!1),reason:ev,files:P(j().min(1)).optional(),otherWorktreePath:j().min(1).optional(),refusedSymlinkPaths:A_.optional()}).loose()]);I([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const nv=F({branch:V_(j().min(1)),path:j(),kind:I([`doc`,`folder`]),contentRootDepth:M().int().min(1).max(65535).optional()}).loose(),rv=Io(`verdict`,[F({verdict:L(`on-origin`)}).loose(),F({verdict:L(`renamed`),renamedTo:j().min(1)}).loose(),F({verdict:L(`deleted`)}).loose(),F({verdict:L(`never-on-branch`)}).loose(),F({verdict:L(`changed-locally`)}).loose(),F({verdict:L(`unknown`)}).loose()]).catch({verdict:`unknown`});function iv(e){return e>=0&&e<=31&&e!==9&&e!==10&&e!==13}function av(e,t,n=[]){for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(iv(i)){t.addIssue({code:`custom`,path:n,params:{contentControlAdmission:!0},message:`Disallowed content control U+${i.toString(16).toUpperCase().padStart(4,`0`)} at zero-based UTF-16 offset ${r}. C0 controls allow only TAB, LF and CR. Remove the character or replace it with a printable escape such as \\u0000.`});return}}}const ov=j().superRefine(av);function sv(e,t){let n=D_(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const cv=j().superRefine(sv).optional(),lv=j().superRefine(sv),uv={agentId:j().optional(),agentName:j().optional(),colorSeed:j().optional(),clientName:j().optional(),clientVersion:j().optional(),label:j().optional()},dv=j().optional(),fv=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,pv=F({startedAt:j().min(1),httpListenMs:M().nonnegative().optional(),seedWalkMs:M().nonnegative().optional(),indexesMs:M().nonnegative().optional(),readyMs:M().nonnegative().optional(),fileCount:M().nonnegative().optional()}),mv=F({serverInstanceId:j().min(1),currentBranch:j().min(1).optional(),currentDiskAckSVs:Ho(j().min(1),j().min(1)).optional(),boot:pv.optional(),collabClients:M().int().nonnegative().optional(),runtimeVersion:j().min(1).optional(),protocolVersion:M().int().positive().optional()}).loose(),hv=F({id:j().min(1),display_name:j().min(1),display_email:j(),source:I([`git-config`,`synthesized`]),created_at:j().min(1)}).loose(),gv=F({collabUrl:j().nullable(),previewUrl:j().nullable(),port:M(),singleFile:N().default(!1)}).loose(),_v=I(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:save-held.urn:ok:error:doc-removed.urn:ok:error:branch-switched.urn:ok:error:doc-moved.urn:ok:error:server-stopped.urn:ok:error:both-kept.urn:ok:error:write-replaced.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function vv(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const yv=F({type:_v,title:j().min(1),status:M().int().min(400).max(599),instance:j().regex(fv,`instance must be urn:uuid:<uuid>`).optional(),detail:j().optional()}).loose(),bv=F({parentDocName:j().min(1),placement:I([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:j().min(1).optional(),agentName:j().min(1).optional()}).loose(),xv=F({src:j().min(1),path:j().min(1).optional(),deduped:N().optional()}).loose(),Sv=F({url:j().min(1),dir:j().min(1),branch:j().min(1).refine(B_,`invalid branch name`).optional()}).loose(),Cv=F({type:L(`error`),problem:yv}).loose(),wv=[`applied`,`merged-first`,`both-kept`,`refused`,`projection-held`],Tv=[`retry`,`re-read`,`none`],Ev={applied:`the write landed and is saved to the file; carry on, or re-read first when nextStep says re-read (the stored text differs from what was sent)`,"merged-first":`an outside change to the file was handled before the write was saved (merged in, or saved to the document history when it could not be merged); the write landed; re-read before the next edit`,"both-kept":`the write landed and is saved, and for a block changed both here and outside both versions are in the document, this side first; never retry it; re-read and tidy the duplicate with an ordinary edit if the task calls for it`,refused:`not saved; OpenKnowledge saves it only after someone acts: the agent, as nextStep says, or the user; follow nextStep`,"projection-held":`the write is in the document but not yet in its file, and OpenKnowledge saves it on its own (on either runtime: a held local save or a held cloud projection); never retry it; re-read before the next edit`},Dv={retry:`the write did not land; send it again, corrected the way the detail says or after the wait it names`,"re-read":`re-read the document before doing anything further with it`,none:`nothing more to do on this document: with applied, carry on; with refused, nothing the agent sends changes it, so tell the user what the detail says`};function Ov(e){return wv.includes(e)}function kv(e){return Tv.includes(e)}const Av={outcome:j().optional(),saved:N().optional(),nextStep:j().optional()};function jv(e){return e===void 0?{}:kv(e)?{nextStep:e}:{nextStep:`re-read`,unknownNextStep:String(e)}}function Mv(e){if(e.outcome===void 0)return;let t=typeof e.saved==`boolean`?{saved:e.saved}:{};return Ov(e.outcome)?{outcome:e.outcome,...t,...jv(e.nextStep)}:{outcome:e.saved===!0?`merged-first`:`refused`,...t,...jv(e.nextStep),nextStep:`re-read`,unknownOutcome:String(e.outcome)}}const Nv=F({docName:cv,summary:dv,content:ov.optional(),...uv}).loose(),Pv=F({docName:cv,summary:dv,markdown:ov,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(E_).optional(),...uv}).loose(),Fv=F({docName:cv,summary:dv,find:j().min(1),replace:ov,offset:M().int().nonnegative().optional(),...uv}).loose(),Iv=F({docName:cv,connectionId:j().min(1),scope:I([`last`,`session`,`file`,`count`]).optional(),count:M().int().positive().optional(),...uv}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),Lv=F({value:j(),truncatedFrom:M().int().nonnegative().optional(),hint:j().optional()}).loose(),Rv=Io(`kind`,[F({kind:L(`inline`),content:j()}),F({kind:L(`truncated`),byteLength:M().int().nonnegative(),hint:j()})]),zv=F({kind:L(`content-divergence`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),divergenceType:j().optional(),currentState:Rv.optional(),hint:j().optional()}).loose(),Bv=F({type:L(`orphan`),parentCandidates:P(j()),message:j()}).loose(),Vv=[`clean`,`merged`,`both-kept`,`kept-live`];function Hv(e){return Vv.includes(e)}const Uv=F({kind:L(`disk-edit-reconciled`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),mergeOutcome:j().optional(),duplicatedBlocks:M().int().nonnegative().optional(),restoredDeletedHere:M().int().nonnegative().optional(),restoredDeletedOutside:M().int().nonnegative().optional(),nextStep:j().optional().meta({deprecated:!0}),hint:j().optional()}).loose();Io(`kind`,[zv,Uv]);const Wv=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function Gv(e){return Wv.includes(e)}function Kv(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const qv=F({kind:L(`mermaid-parse-error`),fenceIndex:M().int().positive(),fenceFirstLine:j(),message:j(),line:M().int().positive().optional()}).loose(),Jv=F({href:j(),targetKind:j(),role:j(),sourceForm:j(),resolvedTarget:j().nullable(),reason:j(),resolutionMethod:j(),fallbackTarget:j().nullable().optional(),definition:F({line:M().int().nonnegative(),label:j()}).loose().optional()}).loose(),Yv=Io(`kind`,[zv,Uv,qv,F({kind:L(`lint-violation`),source:j(),code:j(),message:j(),severity:I([`error`,`warning`,`info`,`hint`]),line:M().int().positive(),column:M().int().positive(),linkTarget:j().optional(),localTarget:Jv.optional()}).loose(),F({kind:L(`link-check-deferred`),message:j()}).loose()]),Xv=P(Yv).min(1),Zv=F({href:j(),resolvedTo:j().nullable(),reason:I([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:Jv.optional()}).loose(),Qv=P(Zv),$v=[`reserved-log-policy`],ey=F({reason:j().min(1),count:M().int().positive()}).loose(),ty=F({...Av,timestamp:j().min(1),summary:Lv.optional(),warnings:Xv.optional()}).loose(),ny=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),hints:P(Bv).optional(),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),ry=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),iy=F({...Av,docName:j().min(1),scope:I([`last`,`session`,`count`]),undone:N()}).loose(),ay=F({docs:P(F({docName:lv,markdown:ov,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(E_).optional(),summary:dv}).loose()).min(1).max(100),...uv}).loose(),oy=F({type:_v,title:j(),detail:j().optional()}).loose(),sy=Io(`status`,[F({status:L(`written`),docName:j().min(1),...Av,summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),F({status:L(`error`),docName:j().min(1),...Av,error:oy}).loose()]),cy=F({timestamp:j().min(1),results:P(sy),written:M().int().nonnegative(),failed:M().int().nonnegative()}).loose(),ly=F({docName:cv,patch:Ho(j(),Po([au,Eo()])),types:Ho(j(),I(nu)).optional(),summary:dv,...uv}).loose(),uy=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),appliedKeys:P(j()),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose();function dy(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const fy=Cy(/[A-Za-z]/),py=Cy(/[\dA-Za-z]/),my=Cy(/[#-'*+\--9=?A-Z^-~]/);function hy(e){return e!==null&&(e<32||e===127)}const gy=Cy(/\d/),_y=Cy(/[\dA-Fa-f]/),vy=Cy(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function yy(e){return e!==null&&(e<0||e===32)}function by(e){return e===-2||e===-1||e===32}const xy=Cy(/\p{P}|\p{S}/u),Sy=Cy(/\s/);function Cy(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function wy(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}const Ty=(function(e,t,n,r,i){let a=Ey(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!Ty(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return My(e)?a.call(i,e,n,r):!1}),Ey=(function(e){if(e==null)return jy;if(typeof e==`function`)return Ay(e);if(typeof e==`object`)return Array.isArray(e)?Dy(e):Oy(e);if(typeof e==`string`)return ky(e);throw Error(`Expected function, string, or object as test`)});function Dy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ey(e[n]);return Ay(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Oy(e){let t=e;return Ay(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ky(e){return Ay(t);function t(t){return t&&t.type===e}}function Ay(e){return t;function t(t,n,r){return!!(My(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function jy(){return!0}function My(e){return typeof e==`object`&&!!e&&`type`in e}function Ny(e){return`\x1B[33m`+e+`\x1B[39m`}const Py=[],Fy=`skip`;function Iy(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ey(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Ny(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Py,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ly(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ly(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Py:[e]}function Ry(e,t,n){let r=Ey((n||{}).ignore||[]),i=zy(t),a=-1;for(;++a<i.length;)Iy(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function zy(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([By(e[0]),Vy(e[1])])}return t}function By(e){return typeof e==`string`?new RegExp(wy(e),`g`):e}function Vy(e){return typeof e==`function`?e:function(){return e}}const Hy=`phrasing`,Uy=[`autolink`,`link`,`image`,`label`];function Wy(){return{transforms:[Qy],enter:{literalAutolink:Ky,literalAutolinkEmail:qy,literalAutolinkHttp:qy,literalAutolinkWww:qy},exit:{literalAutolink:Zy,literalAutolinkEmail:Xy,literalAutolinkHttp:Jy,literalAutolinkWww:Yy}}}function Gy(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Hy,notInConstruct:Uy},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Hy,notInConstruct:Uy},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Hy,notInConstruct:Uy}]}}function Ky(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function qy(e){this.config.enter.autolinkProtocol.call(this,e)}function Jy(e){this.config.exit.autolinkProtocol.call(this,e)}function Yy(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Xy(e){this.config.exit.autolinkEmail.call(this,e)}function Zy(e){this.exit(e)}function Qy(e){Ry(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$y],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,eb]],{ignore:[`link`,`linkReference`]})}function $y(e,t,n,r,i){let a=``;if(!rb(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!tb(n)))return!1;let o=nb(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function eb(e,t,n,r){return!rb(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function tb(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function nb(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=dy(e,`(`),a=dy(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rb(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Sy(n)||xy(n))&&(!t||n!==47)}function ib(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}mb.peek=pb;function ab(){this.buffer()}function ob(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function sb(){this.buffer()}function cb(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function lb(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ib(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ub(e){this.exit(e)}function db(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ib(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fb(e){this.exit(e)}function pb(){return`[`}function mb(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function hb(){return{enter:{gfmFootnoteCallString:ab,gfmFootnoteCall:ob,gfmFootnoteDefinitionLabelString:sb,gfmFootnoteDefinition:cb},exit:{gfmFootnoteCallString:lb,gfmFootnoteCall:ub,gfmFootnoteDefinitionLabelString:db,gfmFootnoteDefinition:fb}}}function gb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:mb},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
262
|
+
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`SAVE_HELD`:return`${e.file} was not saved (${e.cause}); saving is tried again.`;case`UNKNOWN`:return e.message??`Unknown error.`}}function Qg(e,t,n){return $g([e,t,n],[])}function $g(e,t){if(t.length>0){let n=Kh(Uh,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=e_(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>t_(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=$g(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function e_(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function t_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const n_=`__system__`,r_=1,i_=`__config__/project`,a_=`__user__/config.yml`,o_=`__local__/project`,s_=`__config__/okignore`,c_=Object.freeze([i_,o_,a_,s_]),l_=`__skill__/`,u_=`__template__/`,d_=`__extskill__/`,f_=[`project`,`global`];function p_(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}function m_(e){return`${d_}${e}`}function h_(e){if(!e.startsWith(`__extskill__/`))return null;let t=e.slice(13),n=t.indexOf(`/`),r=n<0?t:t.slice(0,n),i=n<0?null:t.slice(n+1);return/^[a-z0-9-]+$/.test(r)?{name:r,rel:i&&i.length>0?i:null}:null}function g_(e){return e.replace(/\.mdx?$/i,``)}const __=`.ok/skills`;function v_(e){return`${__}/${e}/SKILL`}const y_=[`references`,`scripts`];function b_(e,t){let n=e.trim();if(!n.startsWith(`/`))return null;let r=n.slice(1);if(r===``||r.includes(`/`))return null;let i=/^(\.[A-Za-z0-9_-]+\/skills)\/[^/]+\/(?:SKILL|references\/.+)$/.exec(t);return i?`${i[1]}/${r}/SKILL`:/^__skill__\/(global)\/[^/]+(?:\/references\/.+)?$/.exec(t)?w_(`global`,r):null}function x_(e,t){let n=/^(\.[A-Za-z0-9_-]+\/skills\/[^/]+)\/(?:SKILL|references\/.+)$/.exec(t)??/^(__skill__\/global\/[^/]+)(?:\/references\/.+)?$/.exec(t)??/^(__extskill__\/[^/]+)(?:\/.+)?$/.exec(t);if(!n)return null;let r=n[1],i=g_(e.trim()).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!y_.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}const S_=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function C_(e){let t=S_.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===`SKILL`?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}const Rne=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function zne(e){let t=Rne.exec(e);if(!t)return null;let{name:n,host:r}=T_(t[1]),i=t[2];return i===void 0?{name:n,kind:`skill`,rel:null,host:r}:{name:n,kind:`reference`,rel:i.slice(11),host:r}}function w_(e,t,n){return e===`project`?v_(t):`${l_}${e}/${t}${n?`@${n}`:``}`}function T_(e){let t=e.indexOf(`@`);if(t<0)return{name:e,host:null};let n=e.slice(t+1);return{name:e.slice(0,t),host:n===``?null:n}}function Bne(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function Vne(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);if(!i)return null;let a=Bne(i),o=a.indexOf(`/`),s=o<0?a:a.slice(0,o);if(!s)return null;let c=o<0?null:a.slice(o+1),{name:l,host:u}=T_(s);return l?{kind:`skill`,scope:r,name:l,host:u,rel:c}:null}return null}function Hne(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/.ok/templates/${t}`:`.ok/templates/${t}`}const E_=[`.mdx`,`.md`],Une=v.stable.mcpServerName,Wne=`Server unreachable:`,Gne=`Server timed out:`,Kne=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`],qne=`OK_HOSTED_AGENT`;function Jne(e){return e.OK_DESKTOP_TERMINAL===`1`||e.OK_HOSTED_AGENT===`1`}function D_(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Yne=new Set([`opencode.json`]),Xne=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function O_(e){return Xne.test(e)}function k_(e){return O_(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:Yne.has(e.slice(e.lastIndexOf(`/`)+1))}const A_=P(j().min(1)).max(50),Zne=I([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Qne=F({label:j().min(1),webUrl:Co().nullable(),transport:I([`https`,`http`,`ssh`,`git`]).optional()}).loose(),$ne=Io(`checkStatus`,[F({checkStatus:L(`allowed`)}).loose(),F({checkStatus:L(`denied`),deniedReason:I([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:j().optional(),declaredLogin:j().optional(),declaredSource:j().optional()}).loose(),F({checkStatus:L(`unknown`),unknownError:I([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),j_=I([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),ere=I(Bp),tre=I([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),nre=F({state:Zne,lastSyncUtc:j().nullable(),lastRunUtc:j().nullable().optional(),lastPullOkUtc:j().nullable().optional(),lastPushOkUtc:j().nullable().optional(),lastFetchUtc:j().nullable(),lastPushedSha:j().nullable(),ahead:M().int().min(0),behind:M().int().min(0),consecutiveFailures:M().int().min(0),consecutivePushFailures:M().int().min(0).optional(),conflictCount:M().int().min(0),hasRemote:N(),syncEnabled:N(),identityUnresolved:N(),remote:Qne.nullable().optional(),pushError:j().optional(),pushErrorCode:j_.optional(),pullError:j().optional(),pullErrorCode:j_.optional(),pausedReason:j().optional(),blockingPaths:P(j().min(1)).optional(),refusedSymlinkPaths:A_.optional(),pushPermission:$ne.optional(),syncMode:ere.optional(),lastPullUtc:j().nullable().optional(),lastPullOutcome:tre.nullable().optional()}).loose(),rre=F({action:I([`commit`]),paths:P(j().min(1)),commitSha:j().optional()}).loose(),ire=F({action:I([`commit`])}).loose(),are=F({op:I([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),ore=F({op:I([`sync`,`push`,`pull`,`fetch`])}).loose(),M_=[`merge-native`,`working-tree`,`reconcile`],N_=I(M_),P_=[`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`],F_=I(P_),sre=I([`mine`,`theirs`,`content`,`delete`]),cre=F({conflicts:P(F({file:j().min(1),detectedAt:j().min(1),conflict:N_,reason:F_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),docName:j().nullable(),theirsSha:j().optional(),baseSha:j().optional()}).loose())}).loose(),lre=F({file:j().min(1),strategy:I([`mine`,`theirs`,`content`,`delete`]),content:j().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),ure=F({}).loose(),dre=F({file:j().min(1),base:j(),ours:j(),theirs:j(),kind:I([`both-modified`,`delete-modify`,`modify-delete`]),conflict:N_,reason:F_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),resolutionOptions:P(sre)}).loose(),fre=F({plan:_s(e=>e!==void 0,{message:`plan is required`})}).loose(),pre=F({plan:_s(e=>e!==void 0,{message:`plan is required`})}).loose(),mre=F({result:_s(e=>e!==void 0,{message:`result is required`})}).loose(),hre=F({packId:j().min(1)}).strict(),gre=F({installedHosts:P(j()),skills:P(F({name:j().min(1),created:N()}).strict())}).strict(),_re=F({path:j().min(1),summary:j().min(1)}).loose(),vre=F({files:M().int().nonnegative(),folders:M().int().nonnegative()}).loose(),yre=F({packs:P(F({id:j().min(1),name:j().min(1),description:j().min(1),defaultSubfolder:j().optional(),folders:P(_re),entryCounts:vre}).loose())}).loose(),bre=F({noOpen:N().optional(),out:j().min(1).optional()}).loose(),xre=F({reason:I([`unsupported-platform`,`spawn-error`]),message:j()}).loose(),Sre=Io(`status`,[F({status:L(`installed`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j()}).loose(),F({status:L(`built`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j(),handoffError:xre.optional()}).loose(),F({status:L(`failed`),buildError:j()}).loose(),F({status:L(`skip-current`),skillVersion:j(),recordedAt:j().optional()}).loose()]),Cre=Io(`kind`,[F({kind:L(`doc`),docPath:j().min(1)}).loose(),F({kind:L(`folder`),folderPath:j()}).loose()]),I_=I([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),L_=I([`current`,`stale`,`absent`,`empty`]),wre=Io(`ok`,[F({ok:L(!0),shareUrl:j().min(1),sharedUrl:j().min(1),branch:j().min(1),freshness:L_.optional().catch(void 0)}).loose(),F({ok:L(!1),error:I_,branch:j().min(1).optional()}).loose()]),Tre=I([`user`,`org`]),Ere=F({login:j().min(1),kind:Tre,avatarUrl:j().optional()}).loose(),R_=I([`auth-required`,`network`]),Dre=Io(`ok`,[F({ok:L(!0),owners:P(Ere)}).loose(),F({ok:L(!1),error:R_}).loose()]),Ore=Io(`ok`,[F({ok:L(!0),available:N()}).loose(),F({ok:L(!1),error:R_}).loose()]),kre=I([`public`,`private`]),Are=F({owner:j().min(1),name:j().min(1),visibility:kre,description:j().optional()}).loose(),jre=I([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),z_=Io(`ok`,[F({ok:L(!0),ownerLogin:j().min(1),repoName:j().min(1),cloneUrl:j().min(1),defaultBranch:j().min(1)}).loose(),F({ok:L(!1),error:jre}).loose()]);function B_(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const V_=e=>e.refine(B_,`invalid branch name`);function H_(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const U_=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],W_=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],G_=[/permission denied.*\(publickey\)/i,/host key verification failed/i],K_=/fatal:.*repository.*not found/i,q_=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,K_];function J_(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function Y_(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${J_(e)}`;return U_.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:W_.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:G_.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:q_.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:K_.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function X_(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const Z_={shareTargetExists:N(),dirtyConflicts:F({conflicts:N(),files:P(j().min(1))}).loose(),branchIsLocal:N(),shareTargetOnOriginBranch:N().optional()},Q_=Io(`detached`,[F({detached:L(!1),currentBranch:j().min(1).nullable(),currentHeadSha:Eo(),...Z_}).loose(),F({detached:L(!0),currentBranch:Eo(),currentHeadSha:j().min(1),...Z_}).loose()]),$_=F({branch:V_(j().min(1)),principalId:j().optional(),fastForward:N().optional()}).loose(),ev=I([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]),tv=Io(`ok`,[F({ok:L(!0)}).loose(),F({ok:L(!1),reason:ev,files:P(j().min(1)).optional(),otherWorktreePath:j().min(1).optional(),refusedSymlinkPaths:A_.optional()}).loose()]);I([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const nv=F({branch:V_(j().min(1)),path:j(),kind:I([`doc`,`folder`]),contentRootDepth:M().int().min(1).max(65535).optional()}).loose(),rv=Io(`verdict`,[F({verdict:L(`on-origin`)}).loose(),F({verdict:L(`renamed`),renamedTo:j().min(1)}).loose(),F({verdict:L(`deleted`)}).loose(),F({verdict:L(`never-on-branch`)}).loose(),F({verdict:L(`changed-locally`)}).loose(),F({verdict:L(`unknown`)}).loose()]).catch({verdict:`unknown`});function iv(e){return e>=0&&e<=31&&e!==9&&e!==10&&e!==13}function av(e,t,n=[]){for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(iv(i)){t.addIssue({code:`custom`,path:n,params:{contentControlAdmission:!0},message:`Disallowed content control U+${i.toString(16).toUpperCase().padStart(4,`0`)} at zero-based UTF-16 offset ${r}. C0 controls allow only TAB, LF and CR. Remove the character or replace it with a printable escape such as \\u0000.`});return}}}const ov=j().superRefine(av);function sv(e,t){let n=D_(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const cv=j().superRefine(sv).optional(),lv=j().superRefine(sv),uv={agentId:j().optional(),agentName:j().optional(),colorSeed:j().optional(),clientName:j().optional(),clientVersion:j().optional(),label:j().optional()},dv=j().optional(),fv=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,pv=F({startedAt:j().min(1),httpListenMs:M().nonnegative().optional(),seedWalkMs:M().nonnegative().optional(),indexesMs:M().nonnegative().optional(),readyMs:M().nonnegative().optional(),fileCount:M().nonnegative().optional()}),mv=F({serverInstanceId:j().min(1),currentBranch:j().min(1).optional(),currentDiskAckSVs:Ho(j().min(1),j().min(1)).optional(),boot:pv.optional(),collabClients:M().int().nonnegative().optional(),runtimeVersion:j().min(1).optional(),protocolVersion:M().int().positive().optional()}).loose(),hv=F({id:j().min(1),display_name:j().min(1),display_email:j(),source:I([`git-config`,`synthesized`]),created_at:j().min(1)}).loose(),gv=F({collabUrl:j().nullable(),previewUrl:j().nullable(),port:M(),singleFile:N().default(!1)}).loose(),_v=I(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:save-held.urn:ok:error:doc-removed.urn:ok:error:branch-switched.urn:ok:error:doc-moved.urn:ok:error:server-stopped.urn:ok:error:both-kept.urn:ok:error:write-replaced.urn:ok:error:write-dropped.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function vv(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const yv=F({type:_v,title:j().min(1),status:M().int().min(400).max(599),instance:j().regex(fv,`instance must be urn:uuid:<uuid>`).optional(),detail:j().optional()}).loose(),bv=F({parentDocName:j().min(1),placement:I([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:j().min(1).optional(),agentName:j().min(1).optional()}).loose(),xv=F({src:j().min(1),path:j().min(1).optional(),deduped:N().optional()}).loose(),Sv=F({url:j().min(1),dir:j().min(1),branch:j().min(1).refine(B_,`invalid branch name`).optional()}).loose(),Cv=F({type:L(`error`),problem:yv}).loose(),wv=[`applied`,`merged-first`,`both-kept`,`refused`,`projection-held`],Tv=[`retry`,`re-read`,`none`],Ev={applied:`the write landed and is saved to the file; carry on, or re-read first when nextStep says re-read (the stored text differs from what was sent)`,"merged-first":`an outside change to the file was handled before the write was saved (merged in, or saved to the document history when it could not be merged); the write landed; re-read before the next edit`,"both-kept":`the write landed and is saved, and for a block changed both here and outside both versions are in the document, this side first; never retry it; re-read and tidy the duplicate with an ordinary edit if the task calls for it`,refused:`not saved; OpenKnowledge saves it only after someone acts: the agent, as nextStep says, or the user; follow nextStep`,"projection-held":`the write is in the document but not yet in its file, and OpenKnowledge saves it on its own (on either runtime: a held local save or a held cloud projection); never retry it; re-read before the next edit`},Dv={retry:`the write did not land; send it again, corrected the way the detail says or after the wait it names`,"re-read":`re-read the document before doing anything further with it`,none:`nothing more to do on this document: with applied, carry on; with refused, nothing the agent sends changes it, so tell the user what the detail says`};function Ov(e){return wv.includes(e)}function kv(e){return Tv.includes(e)}const Av={outcome:j().optional(),saved:N().optional(),nextStep:j().optional()};function jv(e){return e===void 0?{}:kv(e)?{nextStep:e}:{nextStep:`re-read`,unknownNextStep:String(e)}}function Mv(e){if(e.outcome===void 0)return;let t=typeof e.saved==`boolean`?{saved:e.saved}:{};return Ov(e.outcome)?{outcome:e.outcome,...t,...jv(e.nextStep)}:{outcome:e.saved===!0?`merged-first`:`refused`,...t,...jv(e.nextStep),nextStep:`re-read`,unknownOutcome:String(e.outcome)}}const Nv=F({docName:cv,summary:dv,content:ov.optional(),...uv}).loose(),Pv=F({docName:cv,summary:dv,markdown:ov,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(E_).optional(),...uv}).loose(),Fv=F({docName:cv,summary:dv,find:j().min(1),replace:ov,offset:M().int().nonnegative().optional(),...uv}).loose(),Iv=F({docName:cv,connectionId:j().min(1),scope:I([`last`,`session`,`file`,`count`]).optional(),count:M().int().positive().optional(),...uv}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),Lv=F({value:j(),truncatedFrom:M().int().nonnegative().optional(),hint:j().optional()}).loose(),Rv=Io(`kind`,[F({kind:L(`inline`),content:j()}),F({kind:L(`truncated`),byteLength:M().int().nonnegative(),hint:j()})]),zv=F({kind:L(`content-divergence`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),divergenceType:j().optional(),currentState:Rv.optional(),hint:j().optional()}).loose(),Bv=F({type:L(`orphan`),parentCandidates:P(j()),message:j()}).loose(),Vv=[`clean`,`merged`,`both-kept`,`kept-live`];function Hv(e){return Vv.includes(e)}const Uv=F({kind:L(`disk-edit-reconciled`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),mergeOutcome:j().optional(),duplicatedBlocks:M().int().nonnegative().optional(),restoredDeletedHere:M().int().nonnegative().optional(),restoredDeletedOutside:M().int().nonnegative().optional(),nextStep:j().optional().meta({deprecated:!0}),hint:j().optional()}).loose();Io(`kind`,[zv,Uv]);const Wv=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function Gv(e){return Wv.includes(e)}function Kv(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const qv=F({kind:L(`mermaid-parse-error`),fenceIndex:M().int().positive(),fenceFirstLine:j(),message:j(),line:M().int().positive().optional()}).loose(),Jv=F({href:j(),targetKind:j(),role:j(),sourceForm:j(),resolvedTarget:j().nullable(),reason:j(),resolutionMethod:j(),fallbackTarget:j().nullable().optional(),definition:F({line:M().int().nonnegative(),label:j()}).loose().optional()}).loose(),Yv=Io(`kind`,[zv,Uv,qv,F({kind:L(`lint-violation`),source:j(),code:j(),message:j(),severity:I([`error`,`warning`,`info`,`hint`]),line:M().int().positive(),column:M().int().positive(),linkTarget:j().optional(),localTarget:Jv.optional()}).loose(),F({kind:L(`link-check-deferred`),message:j()}).loose()]),Xv=P(Yv).min(1),Zv=F({href:j(),resolvedTo:j().nullable(),reason:I([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:Jv.optional()}).loose(),Qv=P(Zv),$v=[`reserved-log-policy`],ey=F({reason:j().min(1),count:M().int().positive()}).loose(),ty=F({...Av,timestamp:j().min(1),summary:Lv.optional(),warnings:Xv.optional()}).loose(),ny=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),hints:P(Bv).optional(),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),ry=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),iy=F({...Av,docName:j().min(1),scope:I([`last`,`session`,`count`]),undone:N()}).loose(),ay=F({docs:P(F({docName:lv,markdown:ov,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(E_).optional(),summary:dv}).loose()).min(1).max(100),...uv}).loose(),oy=F({type:_v,title:j(),detail:j().optional()}).loose(),sy=Io(`status`,[F({status:L(`written`),docName:j().min(1),...Av,summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose(),F({status:L(`error`),docName:j().min(1),...Av,error:oy}).loose()]),cy=F({timestamp:j().min(1),results:P(sy),written:M().int().nonnegative(),failed:M().int().nonnegative()}).loose(),ly=F({docName:cv,patch:Ho(j(),Po([au,Eo()])),types:Ho(j(),I(nu)).optional(),summary:dv,...uv}).loose(),uy=F({...Av,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),appliedKeys:P(j()),summary:Lv.optional(),warnings:Xv.optional(),brokenLinks:Qv,brokenLinkSuppression:ey.optional()}).loose();function dy(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const fy=Cy(/[A-Za-z]/),py=Cy(/[\dA-Za-z]/),my=Cy(/[#-'*+\--9=?A-Z^-~]/);function hy(e){return e!==null&&(e<32||e===127)}const gy=Cy(/\d/),_y=Cy(/[\dA-Fa-f]/),vy=Cy(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function yy(e){return e!==null&&(e<0||e===32)}function by(e){return e===-2||e===-1||e===32}const xy=Cy(/\p{P}|\p{S}/u),Sy=Cy(/\s/);function Cy(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function wy(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}const Ty=(function(e,t,n,r,i){let a=Ey(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!Ty(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return My(e)?a.call(i,e,n,r):!1}),Ey=(function(e){if(e==null)return jy;if(typeof e==`function`)return Ay(e);if(typeof e==`object`)return Array.isArray(e)?Dy(e):Oy(e);if(typeof e==`string`)return ky(e);throw Error(`Expected function, string, or object as test`)});function Dy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ey(e[n]);return Ay(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Oy(e){let t=e;return Ay(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ky(e){return Ay(t);function t(t){return t&&t.type===e}}function Ay(e){return t;function t(t,n,r){return!!(My(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function jy(){return!0}function My(e){return typeof e==`object`&&!!e&&`type`in e}function Ny(e){return`\x1B[33m`+e+`\x1B[39m`}const Py=[],Fy=`skip`;function Iy(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ey(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Ny(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Py,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ly(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ly(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Py:[e]}function Ry(e,t,n){let r=Ey((n||{}).ignore||[]),i=zy(t),a=-1;for(;++a<i.length;)Iy(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function zy(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([By(e[0]),Vy(e[1])])}return t}function By(e){return typeof e==`string`?new RegExp(wy(e),`g`):e}function Vy(e){return typeof e==`function`?e:function(){return e}}const Hy=`phrasing`,Uy=[`autolink`,`link`,`image`,`label`];function Wy(){return{transforms:[Qy],enter:{literalAutolink:Ky,literalAutolinkEmail:qy,literalAutolinkHttp:qy,literalAutolinkWww:qy},exit:{literalAutolink:Zy,literalAutolinkEmail:Xy,literalAutolinkHttp:Jy,literalAutolinkWww:Yy}}}function Gy(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Hy,notInConstruct:Uy},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Hy,notInConstruct:Uy},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Hy,notInConstruct:Uy}]}}function Ky(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function qy(e){this.config.enter.autolinkProtocol.call(this,e)}function Jy(e){this.config.exit.autolinkProtocol.call(this,e)}function Yy(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Xy(e){this.config.exit.autolinkEmail.call(this,e)}function Zy(e){this.exit(e)}function Qy(e){Ry(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$y],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,eb]],{ignore:[`link`,`linkReference`]})}function $y(e,t,n,r,i){let a=``;if(!rb(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!tb(n)))return!1;let o=nb(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function eb(e,t,n,r){return!rb(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function tb(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function nb(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=dy(e,`(`),a=dy(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rb(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Sy(n)||xy(n))&&(!t||n!==47)}function ib(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}mb.peek=pb;function ab(){this.buffer()}function ob(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function sb(){this.buffer()}function cb(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function lb(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ib(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ub(e){this.exit(e)}function db(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ib(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fb(e){this.exit(e)}function pb(){return`[`}function mb(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function hb(){return{enter:{gfmFootnoteCallString:ab,gfmFootnoteCall:ob,gfmFootnoteDefinitionLabelString:sb,gfmFootnoteDefinition:cb},exit:{gfmFootnoteCallString:lb,gfmFootnoteCall:ub,gfmFootnoteDefinitionLabelString:db,gfmFootnoteDefinition:fb}}}function gb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:mb},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
263
263
|
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?vb:_b))),s(),o}}function _b(e,t,n){return t===0?e:vb(e,t,n)}function vb(e,t,n){return(n?``:` `)+e}const yb=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];wb.peek=Tb;function bb(){return{canContainEols:[`delete`],enter:{strikethrough:Sb},exit:{strikethrough:Cb}}}function xb(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:yb}],handlers:{delete:wb}}}function Sb(e){this.enter({type:`delete`,children:[]},e)}function Cb(e){this.exit(e)}function wb(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Tb(){return`~`}function Eb(e){return e.length}function Db(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Eb,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ob(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=kb(r[d]);else{let e=kb(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
264
264
|
`)}function Ob(e){return e==null?``:String(e)}function kb(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const Ab={}.hasOwnProperty;function jb(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Ab.call(t,e)){let n=String(t[e]);i=Ab.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Mb={}.hasOwnProperty;function Nb(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Nb(e,t.extensions[n]);for(r in t)if(Mb.call(t,r))switch(r){case`extensions`:break;case`unsafe`:Pb(e[r],t[r]);break;case`join`:Pb(e[r],t[r]);break;case`handlers`:Fb(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Pb(e,t){t&&e.push(...t)}function Fb(e,t){t&&Object.assign(e,t)}function Ib(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Lb);return i(),o}function Lb(e,t,n){return`>`+(n?``:` `)+e}function Rb(e,t){return zb(e,t.inConstruct,!0)&&!zb(e,t.notInConstruct,!1)}function zb(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Bb(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
265
265
|
`&&Rb(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
@@ -508,4 +508,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
508
508
|
A --> B`};else{let r=zxe(e),i=t===`jsx-block`?Bxe(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return oS({type:`root`,children:[n]},{extensions:[Nxe]}).trimEnd()}function Hxe(e){let t=[];for(let n of e.props){if(n.hidden===!0)continue;let e={name:n.name,type:n.type,required:n.required};n.description!==void 0&&(e.description=n.description),n.advanced===!0&&(e.advanced=!0),n.omitOnDefault===!0&&(e.omitOnDefault=!0),n.type===`enum`&&(e.values=n.enumValues,n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue)),n.type===`string`&&(n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.language!==void 0&&(e.language=n.language),n.accept!==void 0&&(e.accept=n.accept)),n.type===`boolean`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.type===`number`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),t.push(e)}return t}function Uxe(e){return{...Ixe(e),example:Vxe(e),params:Hxe(e)}}const L9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),R9=globalThis;R9[L9]===void 0&&(R9[L9]=Qr());const z9=R9[L9],Wxe=`skill-state.yml`,Gxe=[`claude-cowork`,`cli-hosts`],Kxe=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],B9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,V9=Mo({version:j().regex(B9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(z9,{description:`Recorded skill version for this target.`}),recordedAt:Wa().register(z9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:I(Kxe).register(z9,{description:`Install-source surface that recorded this entry.`}).optional()}),qxe=Mo({enabled:N().register(z9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Wa().register(z9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Jxe=Mo({schema:L(1).register(z9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Mo({"claude-cowork":V9.optional(),"cli-hosts":V9.optional()}).register(z9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Ho(j(),qxe).register(z9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:P(j()).register(z9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Yxe(e,t){return e??t.installedOnDisk}function Xxe(){return{schema:1,targets:{}}}const H9=`template`;function U9(e){if(e.trim()===``)return{};let t;try{t=(0,Md.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function W9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function Zxe(e){let{frontmatter:t,body:n}=du(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:pu(t),markdown:n}}function Qxe(e){let t=e.split(`
|
|
509
509
|
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=U9(n.join(`
|
|
510
510
|
`))[H9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
511
|
-
`).replace(/\n+$/,``)}}function G9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=du(t);if(n===``)return{identity:{},starterContent:t};let i=pu(n),a=Qxe(i);if(a)return{identity:a.identity,starterContent:W9(a.docFrontmatterText,r)};let{frontmatter:o}=du(r);if(o!==``)return{identity:U9(i),starterContent:r};let s=U9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:W9(i,r)}}function $xe(e,t){let{docFrontmatterText:n,markdown:r}=Zxe(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Md.stringify)({[H9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function eSe(e){return G9(e).starterContent}const tSe=`core-base`;function K9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function q9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function J9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Y9(e){return e.split(`/`).filter(e=>e!==``)}function nSe(e,t){let n=J9(t);return e===``||n===e||n.startsWith(`${e}/`)}function X9(e,t){let n=J9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:Y9(r).length}function Z9(e,t){let n=Y9(e),r=Y9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function rSe(){let e=new Map;function t(t){let n=K9(t);if(n===``)return;let r=q9(n);if(r===``)return;let i=$7(`file`,r),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=K9(t),r=$7(`file`,q9(n)),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=$7(`file`,t),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=J9(K9(n)),o=[],s=[];for(let e of i)nSe(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=X9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=X9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=Z9(a,J9(t));for(let r=1;r<e.length;r++){let i=e[r],o=Z9(a,J9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function iSe(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function aSe(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Q9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function oSe(e){return e.reason!==void 0||Q9(e.note)!==void 0||Q9(e.email)!==void 0}function sSe(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol===`https:`)return t;let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`;return t.protocol===`http:`&&n?t:null}function cSe(){return sSe((typeof process>`u`?void 0:Q9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function lSe(e){let t=Q9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function $9(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(n)});if(r.ok){let e=await r.json().catch(()=>null);return{ok:!0,reference:typeof e?.reference==`string`?e.reference:``}}return r.status===400||r.status===413?{ok:!1,reason:`invalid`}:r.status===503?{ok:!1,reason:`unavailable`}:{ok:!1,reason:`error`}}catch(e){return{ok:!1,reason:e instanceof Error&&(e.name===`TimeoutError`||e.name===`AbortError`)?`timeout`:`error`}}}async function uSe(e,t={}){let n=cSe();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=Q9(e.note),a=lSe(e.email),o={kind:`uninstall`,reasons:e.reason===void 0?[]:[e.reason],...i===void 0?{}:{message:i},appVersion:e.appVersion,platform:e.platform,source:e.source},s=Date.now()+(t.timeoutMs??4e3),c=()=>s-Date.now();if(a===void 0)return $9(r,o,c());let l=await $9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:$9(r,o,c())}const dSe=new Rfe({extensions:iX,deriveStructuralFreshness:!0}),fSe=FH(iX);export{Axe as $,hM as $a,Tg as $c,Do as $d,vpe as $i,Cm as $l,Dme as $n,Dv as $o,bge as $r,nv as $s,z8 as $t,fp as $u,Sxe as A,BX as Aa,__ as Ac,Yc as Ad,Ae as Af,Yge as Ai,Ah as Al,Zme as An,Jj as Ao,tme as Ar,bv as As,ibe as At,Ite as Au,Txe as B,vM as Ba,Vne as Bc,Io as Bd,de as Bf,Ihe as Bi,Bh as Bl,ime as Bn,zk as Bo,Wge as Br,mre as Bs,Cye as Bt,gte as Bu,g9 as C,l3 as Ca,E_ as Cc,Bl as Cd,me as Cf,jge as Ci,Jh as Cl,jpe as Cn,mj as Co,hhe as Cr,gv as Cs,J7 as Ct,Mp as Cu,$xe as D,Ose as Da,i_ as Dc,Vc as Dd,ye as Df,Ege as Di,kh as Dl,nhe as Dn,Yj as Do,zhe as Dr,mv as Ds,xbe as Dt,Kte as Du,pxe as E,o3 as Ea,s_ as Ec,Hc as Ed,ge as Ef,Yhe as Ei,Uh as El,Upe as En,Ak as Eo,C8 as Er,yv as Es,vbe as Et,Yte as Eu,oSe as F,WW as Fa,n_ as Fc,Eo as Fd,De as Ff,mme as Fi,Lh as Fl,c8 as Fn,Ej as Fo,bhe as Fr,tv as Fs,rbe as Ft,Yf as Fu,hxe as G,TM as Ga,Hne as Gc,M as Gd,ae as Gf,Rhe as Gi,yh as Gl,d8 as Gn,Vj as Go,mge as Gr,I_ as Gs,a_e as Gt,Bte as Gu,G9 as H,AM as Ha,v_ as Hc,Ro as Hd,S as Hf,Phe as Hi,Hh as Hl,dme as Hn,Fj as Ho,L8 as Hr,gre as Hs,Dye as Ht,Ste as Hu,cxe as I,KW as Ia,m_ as Ic,Jee as Id,ve as If,Hhe as Ii,Fh as Il,u8 as In,cA as Io,xhe as Ir,bre as Is,N7 as It,ote as Iu,Uxe as J,EM as Ja,Zg as Jc,bs as Jd,b as Jf,jhe as Ji,Lne as Jl,kme as Jn,QA as Jo,_ge as Jr,L_ as Js,t_e as Jt,Nte as Ju,kxe as K,SM as Ka,Qg as Kc,F as Kd,ee as Kf,Mhe as Ki,lh as Kl,cme as Kn,ZA as Ko,hge as Kr,Cre as Ks,r_e as Kt,tte as Ku,eSe as L,EF as La,p_ as Lc,P as Ld,se as Lf,Uhe as Li,Ph as Ll,$pe as Ln,yj as Lo,Che as Lr,Sre as Ls,Wye as Lt,Vte as Lu,iSe as M,kX as Ma,l_ as Mc,wo as Md,we as Mf,Xge as Mi,Eh as Ml,Ohe as Mn,tM as Mo,She as Mr,Q_ as Ms,ube as Mt,Rf as Mu,ixe as N,CX as Na,u_ as Nc,Jo as Nd,ke as Nf,Zge as Ni,Th as Nl,khe as Nn,qk as No,vhe as Nr,M_ as Ns,obe as Nt,Lf as Nu,rSe as O,RX as Oa,o_ as Oc,Fc as Od,Se as Of,Dge as Oi,Mh as Ol,rhe as On,Xj as Oo,E8 as Or,Cv as Os,W7 as Ot,Zf as Ou,Fxe as P,$W as Pa,f_ as Pc,I as Pd,Ee as Pf,Jme as Pi,_h as Pl,Rpe as Pn,Qj as Po,yhe as Pr,$_ as Ps,nbe as Pt,Jf as Pu,lxe as Q,cM as Qa,Ag as Qc,Po as Qd,re as Qf,Ime as Qi,Tm as Ql,bme as Qn,Tv as Qo,yge as Qr,z_ as Qs,V8 as Qt,Qee as Qu,y9 as R,U as Ra,h_ as Rc,N as Rd,v as Rf,Ehe as Ri,Nh as Rl,eme as Rn,xj as Ro,Ige as Rr,P_ as Rs,P7 as Rt,Fte as Ru,tSe as S,g6 as Sa,Jne as Sc,rl as Sd,pe as Sf,Oge as Si,Qh as Sl,Epe as Sn,gj as So,mhe as Sr,Mv as Ss,K7 as St,Jte as Su,Exe as T,s3 as Ta,c_ as Tc,Uc as Td,Ce as Tf,Jhe as Ti,xh as Tl,Hpe as Tn,qj as To,M8 as Tr,hv as Ts,hbe as Tt,Xte as Tu,gxe as U,xM as Ua,x_ as Uc,L as Ud,oe as Uf,Fhe as Ui,Vh as Ul,qme as Un,Ij as Uo,I8 as Ur,yre as Us,n_e as Ut,Cte as Uu,Cxe as V,kM as Va,C_ as Vc,To as Vd,y as Vf,Ahe as Vi,zh as Vl,ame as Vn,eM as Vo,Hge as Vr,hre as Vs,Bye as Vt,$ee as Vu,_xe as W,OM as Wa,w_ as Wc,Mo as Wd,ie as Wf,Lhe as Wi,fh as Wl,Vpe as Wn,Lj as Wo,rge as Wr,fre as Ws,o_e as Wt,pte as Wu,Yxe as X,iM as Xa,Sg as Xc,j as Xd,D as Xf,Lme as Xi,Ym as Xl,vme as Xn,AD as Xo,Sge as Xr,Dre as Xs,U8 as Xt,mte as Xu,sxe as Y,CM as Ya,Jg as Yc,Ho as Yd,x as Yf,zme as Yi,Jm as Yl,Ame as Yn,$j as Yo,Cge as Yr,Ore as Ys,B8 as Yt,fte as Yu,txe as Z,lM as Za,Mg as Zc,Bo as Zd,E as Zf,Rme as Zi,km as Zl,yme as Zn,wD as Zo,vge as Zr,Are as Zs,H8 as Zt,_te as Zu,Wxe as _,tpe as _a,Une as _c,ll as _d,Le as _f,Pge as _i,bg as _l,dhe as _n,yA as _o,xpe as _r,uy as _s,Q7 as _t,Jp as _u,yxe as a,v8 as aa,lre as ac,Jd as ad,yi as af,wge as ai,Cg as al,Npe as an,YA as ao,Eme as ar,Iv as as,Ube as at,im as au,Jxe as b,pfe as ba,Gne as bc,Kl as bd,je as bf,nge as bi,lg as bl,Ope as bn,Sj as bo,lhe as br,Hv as bs,q7 as bt,ane as bu,T9 as c,Whe as ca,are as cc,Pd as cd,At as cf,j8 as ci,ug as cl,Fpe as cn,Dj as co,Gme as cr,cy as cs,o9 as ct,vm as cu,A9 as d,Uge as da,H_ as dc,jd as dd,It as df,pge as di,yg as dl,ehe as dn,fj as do,Bme as dr,Nv as ds,Dbe as dt,sne as du,fhe as ea,rv as ec,op as ed,Co as ef,xge as ei,xg as el,Pme as en,aM as eo,Ome as er,wv as es,aSe as et,rm as eu,k9 as f,T8 as fa,X_ as fc,fu as fd,Ot as ff,age as fi,vg as fl,the as fn,ej as fo,Kme as fr,ty as fs,n9 as ft,fne as fu,D9 as g,ape as ga,D_ as gc,cu as gd,A as gf,ege as gi,ng as gl,uhe as gn,ij as go,Spe as gr,ly as gs,wbe as gt,pne as gu,O9 as h,m8 as ha,O_ as hc,au as hd,ct as hf,$he as hi,gg as hl,pme as hn,Cj as ho,ihe as hr,ey as hs,Cbe as ht,Kp as hu,f9 as i,Vge as ia,rre as ic,Yd as id,Ha as if,$ge as ii,wg as il,Ppe as in,Nk as io,Cme as ir,ry as is,d9 as it,xm as iu,Xxe as j,MX as ja,d_ as jc,Xs as jd,be as jf,Xhe as ji,Dh as jl,Dhe as jn,jk as jo,nme as jr,vv as js,abe as jt,Pte as ju,rxe as k,zX as ka,a_ as kc,Wc as kd,xe as kf,Jge as ki,jh as kl,Kpe as kn,wj as ko,w8 as kr,xv as ks,mbe as kt,mp as ku,qbe as l,dge as la,ore as lc,Fd as ld,Mt as lf,ige as li,dg as ll,e8 as ln,aj as lo,Ume as lr,Pv as ls,i9 as lt,Sm as lu,E9 as m,Bge as ma,k_ as mc,pu as md,Ye as mf,Qhe as mi,sg as ml,$me as mn,_j as mo,ohe as mr,Zv as ms,e9 as mt,qp as mu,fSe as n,D8 as na,cre as nc,bte as nd,Qa as nf,Ghe as ni,Og as nl,ope as nn,gM as no,Sme as nr,Yv as ns,Fbe as nt,Tne as nu,w9 as o,Rge as oa,ure as oc,Bd as od,xr as of,Kge as oi,Ng as ol,fpe as on,Dk as oo,hme as or,iy as os,l9 as ot,Ene as ou,wxe as p,fge as pa,B_ as pc,du as pd,st as pf,Zhe as pi,fg as pl,Qme as pn,dj as po,ume as pr,$v as ps,$7 as pt,mne as pu,uSe as q,jM as qa,Gg as qc,Yo as qd,te as qf,Nhe as qi,Ine as ql,lme as qn,Wj as qo,gge as qr,wre as qs,i_e as qt,vte as qu,vxe as r,ome as ra,ire as rc,yf as rd,Wa as rf,qge as ri,Dg as rl,dpe as rn,Zj as ro,wme as rr,Fv as rs,Pbe as rt,am as ru,F9 as s,Vhe as sa,nre as sc,Ud as sd,Pn as sf,Tge as si,mg as sl,ppe as sn,Fk as so,_me as sr,ay as ss,kbe as st,bm as su,dSe as t,phe as ta,dre as tc,Xf as td,Oee as tf,Age as ti,Eg as tl,Fme as tn,uM as to,xme as tr,Ev as ts,P9 as tt,Dne as tu,Wbe as u,h8 as ua,Y_ as uc,Rd as ud,Pt as uf,oge as ui,ig as ul,Cpe as un,oj as uo,Vme as ur,ny as us,a9 as ut,bne as uu,Gxe as v,Qfe as va,qne as vc,eu as vd,Pe as vf,Fge as vi,_g as vl,bpe as vn,lA as vo,ype as vr,Wv as vs,Z7 as vt,ine as vu,Oxe as w,c3 as wa,r_ as wc,Ol as wd,he as wf,Nge as wi,Yh as wl,Ape as wn,Aj as wo,b8 as wr,Sv as ws,_be as wt,qte as wu,H9 as x,_6 as xa,Wne as xc,cl as xd,k as xf,_8 as xi,Xh as xl,s8 as xn,Pk as xo,sme as xr,Gv as xs,Sbe as xt,Lp as xu,B9 as y,X6 as ya,Kne as yc,El as yd,Ne as yf,tge as yi,hg as yl,Dpe as yn,vj as yo,che as yr,Kv as ys,Tbe as yt,one as yu,x9 as z,MM as za,zne as zc,_s as zd,C as zf,whe as zi,dh as zl,qpe as zn,Ek as zo,R8 as zr,pre as zs,w7 as zt,ute as zu};
|
|
511
|
+
`).replace(/\n+$/,``)}}function G9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=du(t);if(n===``)return{identity:{},starterContent:t};let i=pu(n),a=Qxe(i);if(a)return{identity:a.identity,starterContent:W9(a.docFrontmatterText,r)};let{frontmatter:o}=du(r);if(o!==``)return{identity:U9(i),starterContent:r};let s=U9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:W9(i,r)}}function $xe(e,t){let{docFrontmatterText:n,markdown:r}=Zxe(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Md.stringify)({[H9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function eSe(e){return G9(e).starterContent}const tSe=`core-base`;function K9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function q9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function J9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Y9(e){return e.split(`/`).filter(e=>e!==``)}function nSe(e,t){let n=J9(t);return e===``||n===e||n.startsWith(`${e}/`)}function X9(e,t){let n=J9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:Y9(r).length}function Z9(e,t){let n=Y9(e),r=Y9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function rSe(){let e=new Map;function t(t){let n=K9(t);if(n===``)return;let r=q9(n);if(r===``)return;let i=$7(`file`,r),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=K9(t),r=$7(`file`,q9(n)),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=$7(`file`,t),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=J9(K9(n)),o=[],s=[];for(let e of i)nSe(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=X9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=X9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=Z9(a,J9(t));for(let r=1;r<e.length;r++){let i=e[r],o=Z9(a,J9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function iSe(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function aSe(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Q9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function oSe(e){return e.reason!==void 0||Q9(e.note)!==void 0||Q9(e.email)!==void 0}function sSe(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol===`https:`)return t;let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`;return t.protocol===`http:`&&n?t:null}function cSe(){return sSe((typeof process>`u`?void 0:Q9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function lSe(e){let t=Q9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function $9(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(n)});if(r.ok){let e=await r.json().catch(()=>null);return{ok:!0,reference:typeof e?.reference==`string`?e.reference:``}}return r.status===400||r.status===413?{ok:!1,reason:`invalid`}:r.status===503?{ok:!1,reason:`unavailable`}:{ok:!1,reason:`error`}}catch(e){return{ok:!1,reason:e instanceof Error&&(e.name===`TimeoutError`||e.name===`AbortError`)?`timeout`:`error`}}}async function uSe(e,t={}){let n=cSe();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=Q9(e.note),a=lSe(e.email),o={kind:`uninstall`,reasons:e.reason===void 0?[]:[e.reason],...i===void 0?{}:{message:i},appVersion:e.appVersion,platform:e.platform,source:e.source},s=Date.now()+(t.timeoutMs??4e3),c=()=>s-Date.now();if(a===void 0)return $9(r,o,c());let l=await $9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:$9(r,o,c())}const dSe=new Rfe({extensions:iX,deriveStructuralFreshness:!0}),fSe=FH(iX);export{Axe as $,hM as $a,Ag as $c,Po as $d,re as $f,vpe as $i,Tm as $l,Dme as $n,Dv as $o,bge as $r,z_ as $s,z8 as $t,Qee as $u,Sxe as A,BX as Aa,a_ as Ac,Wc as Ad,xe as Af,Yge as Ai,jh as Al,Zme as An,Jj as Ao,tme as Ar,xv as As,ibe as At,mp as Au,Txe as B,vM as Ba,zne as Bc,_s as Bd,C as Bf,Ihe as Bi,dh as Bl,ime as Bn,zk as Bo,Wge as Br,pre as Bs,Cye as Bt,ute as Bu,g9 as C,l3 as Ca,Jne as Cc,rl as Cd,pe as Cf,jge as Ci,Qh as Cl,jpe as Cn,mj as Co,hhe as Cr,Mv as Cs,J7 as Ct,Jte as Cu,$xe as D,Ose as Da,s_ as Dc,Hc as Dd,ge as Df,Ege as Di,Uh as Dl,nhe as Dn,Yj as Do,zhe as Dr,yv as Ds,xbe as Dt,Yte as Du,pxe as E,o3 as Ea,c_ as Ec,Uc as Ed,Ce as Ef,Yhe as Ei,xh as El,Upe as En,Ak as Eo,C8 as Er,hv as Es,vbe as Et,Xte as Eu,oSe as F,WW as Fa,f_ as Fc,I as Fd,Ee as Ff,mme as Fi,_h as Fl,c8 as Fn,Ej as Fo,bhe as Fr,$_ as Fs,rbe as Ft,Jf as Fu,hxe as G,TM as Ga,w_ as Gc,Mo as Gd,ie as Gf,Rhe as Gi,fh as Gl,d8 as Gn,Vj as Go,mge as Gr,fre as Gs,a_e as Gt,pte as Gu,G9 as H,AM as Ha,C_ as Hc,To as Hd,y as Hf,Phe as Hi,zh as Hl,dme as Hn,Fj as Ho,L8 as Hr,hre as Hs,Dye as Ht,$ee as Hu,cxe as I,KW as Ia,n_ as Ic,Eo as Id,De as If,Hhe as Ii,Lh as Il,u8 as In,cA as Io,xhe as Ir,tv as Is,N7 as It,Yf as Iu,Uxe as J,EM as Ja,Gg as Jc,Yo as Jd,te as Jf,jhe as Ji,Ine as Jl,kme as Jn,QA as Jo,_ge as Jr,wre as Js,t_e as Jt,vte as Ju,kxe as K,SM as Ka,Hne as Kc,M as Kd,ae as Kf,Mhe as Ki,yh as Kl,cme as Kn,ZA as Ko,hge as Kr,I_ as Ks,r_e as Kt,Bte as Ku,eSe as L,EF as La,m_ as Lc,Jee as Ld,ve as Lf,Uhe as Li,Fh as Ll,$pe as Ln,yj as Lo,Che as Lr,bre as Ls,Wye as Lt,ote as Lu,iSe as M,kX as Ma,d_ as Mc,Xs as Md,be as Mf,Xge as Mi,Dh as Ml,Ohe as Mn,tM as Mo,She as Mr,vv as Ms,ube as Mt,Pte as Mu,ixe as N,CX as Na,l_ as Nc,wo as Nd,we as Nf,Zge as Ni,Eh as Nl,khe as Nn,qk as No,vhe as Nr,Q_ as Ns,obe as Nt,Rf as Nu,rSe as O,RX as Oa,i_ as Oc,Vc as Od,ye as Of,Dge as Oi,kh as Ol,rhe as On,Xj as Oo,E8 as Or,mv as Os,W7 as Ot,Kte as Ou,Fxe as P,$W as Pa,u_ as Pc,Jo as Pd,ke as Pf,Jme as Pi,Th as Pl,Rpe as Pn,Qj as Po,yhe as Pr,M_ as Ps,nbe as Pt,Lf as Pu,lxe as Q,cM as Qa,Mg as Qc,Bo as Qd,E as Qf,Ime as Qi,km as Ql,bme as Qn,Tv as Qo,yge as Qr,Are as Qs,V8 as Qt,_te as Qu,y9 as R,U as Ra,p_ as Rc,P as Rd,se as Rf,Ehe as Ri,Ph as Rl,eme as Rn,xj as Ro,Ige as Rr,Sre as Rs,P7 as Rt,Vte as Ru,tSe as S,g6 as Sa,Wne as Sc,cl as Sd,k as Sf,Oge as Si,Xh as Sl,Epe as Sn,gj as So,mhe as Sr,Gv as Ss,K7 as St,Lp as Su,Exe as T,s3 as Ta,r_ as Tc,Ol as Td,he as Tf,Jhe as Ti,Yh as Tl,Hpe as Tn,qj as To,M8 as Tr,Sv as Ts,hbe as Tt,qte as Tu,gxe as U,xM as Ua,v_ as Uc,Ro as Ud,S as Uf,Fhe as Ui,Hh as Ul,qme as Un,Ij as Uo,I8 as Ur,gre as Us,n_e as Ut,Ste as Uu,Cxe as V,kM as Va,Vne as Vc,Io as Vd,de as Vf,Ahe as Vi,Bh as Vl,ame as Vn,eM as Vo,Hge as Vr,mre as Vs,Bye as Vt,gte as Vu,_xe as W,OM as Wa,x_ as Wc,L as Wd,oe as Wf,Lhe as Wi,Vh as Wl,Vpe as Wn,Lj as Wo,rge as Wr,yre as Ws,o_e as Wt,Cte as Wu,Yxe as X,iM as Xa,Jg as Xc,Ho as Xd,x as Xf,Lme as Xi,Jm as Xl,vme as Xn,AD as Xo,Sge as Xr,Ore as Xs,U8 as Xt,fte as Xu,sxe as Y,CM as Ya,Zg as Yc,bs as Yd,b as Yf,zme as Yi,Lne as Yl,Ame as Yn,$j as Yo,Cge as Yr,L_ as Ys,B8 as Yt,Nte as Yu,txe as Z,lM as Za,Sg as Zc,j as Zd,D as Zf,Rme as Zi,Ym as Zl,yme as Zn,wD as Zo,vge as Zr,Dre as Zs,H8 as Zt,mte as Zu,Wxe as _,tpe as _a,D_ as _c,cu as _d,A as _f,Pge as _i,ng as _l,dhe as _n,yA as _o,xpe as _r,uy as _s,Q7 as _t,pne as _u,yxe as a,v8 as aa,rre as ac,Yd as ad,Ha as af,wge as ai,wg as al,Npe as an,YA as ao,Eme as ar,Iv as as,Ube as at,xm as au,Jxe as b,pfe as ba,Kne as bc,El as bd,Ne as bf,nge as bi,hg as bl,Ope as bn,Sj as bo,lhe as br,Kv as bs,q7 as bt,one as bu,T9 as c,Whe as ca,nre as cc,Ud as cd,Pn as cf,j8 as ci,mg as cl,Fpe as cn,Dj as co,Gme as cr,cy as cs,o9 as ct,bm as cu,A9 as d,Uge as da,Y_ as dc,Rd as dd,Pt as df,pge as di,ig as dl,ehe as dn,fj as do,Bme as dr,Nv as ds,Dbe as dt,bne as du,fhe as ea,nv as ec,fp as ed,Do as ef,xge as ei,Tg as el,Pme as en,aM as eo,Ome as er,wv as es,aSe as et,Cm as eu,k9 as f,T8 as fa,H_ as fc,jd as fd,It as ff,age as fi,yg as fl,the as fn,ej as fo,Kme as fr,ty as fs,n9 as ft,sne as fu,D9 as g,ape as ga,O_ as gc,au as gd,ct as gf,ege as gi,gg as gl,uhe as gn,ij as go,Spe as gr,ly as gs,wbe as gt,Kp as gu,O9 as h,m8 as ha,k_ as hc,pu as hd,Ye as hf,$he as hi,sg as hl,pme as hn,Cj as ho,ihe as hr,ey as hs,Cbe as ht,qp as hu,f9 as i,Vge as ia,ire as ic,yf as id,Wa as if,$ge as ii,Dg as il,Ppe as in,Nk as io,Cme as ir,ry as is,d9 as it,am as iu,Xxe as j,MX as ja,__ as jc,Yc as jd,Ae as jf,Xhe as ji,Ah as jl,Dhe as jn,jk as jo,nme as jr,bv as js,abe as jt,Ite as ju,rxe as k,zX as ka,o_ as kc,Fc as kd,Se as kf,Jge as ki,Mh as kl,Kpe as kn,wj as ko,w8 as kr,Cv as ks,mbe as kt,Zf as ku,qbe as l,dge as la,are as lc,Pd as ld,At as lf,ige as li,ug as ll,e8 as ln,aj as lo,Ume as lr,Pv as ls,i9 as lt,vm as lu,E9 as m,Bge as ma,B_ as mc,du as md,st as mf,Qhe as mi,fg as ml,$me as mn,_j as mo,ohe as mr,Zv as ms,e9 as mt,mne as mu,fSe as n,D8 as na,dre as nc,Xf as nd,Oee as nf,Ghe as ni,Eg as nl,ope as nn,gM as no,Sme as nr,Yv as ns,Fbe as nt,Dne as nu,w9 as o,Rge as oa,lre as oc,Jd as od,yi as of,Kge as oi,Cg as ol,fpe as on,Dk as oo,hme as or,iy as os,l9 as ot,im as ou,wxe as p,fge as pa,X_ as pc,fu as pd,Ot as pf,Zhe as pi,vg as pl,Qme as pn,dj as po,ume as pr,$v as ps,$7 as pt,fne as pu,uSe as q,jM as qa,Qg as qc,F as qd,ee as qf,Nhe as qi,lh as ql,lme as qn,Wj as qo,gge as qr,Cre as qs,i_e as qt,tte as qu,vxe as r,ome as ra,cre as rc,bte as rd,Qa as rf,qge as ri,Og as rl,dpe as rn,Zj as ro,wme as rr,Fv as rs,Pbe as rt,Tne as ru,F9 as s,Vhe as sa,ure as sc,Bd as sd,xr as sf,Tge as si,Ng as sl,ppe as sn,Fk as so,_me as sr,ay as ss,kbe as st,Ene as su,dSe as t,phe as ta,rv as tc,op as td,Co as tf,Age as ti,xg as tl,Fme as tn,uM as to,xme as tr,Ev as ts,P9 as tt,rm as tu,Wbe as u,h8 as ua,ore as uc,Fd as ud,Mt as uf,oge as ui,dg as ul,Cpe as un,oj as uo,Vme as ur,ny as us,a9 as ut,Sm as uu,Gxe as v,Qfe as va,Une as vc,ll as vd,Le as vf,Fge as vi,bg as vl,bpe as vn,lA as vo,ype as vr,Wv as vs,Z7 as vt,Jp as vu,Oxe as w,c3 as wa,E_ as wc,Bl as wd,me as wf,Nge as wi,Jh as wl,Ape as wn,Aj as wo,b8 as wr,gv as ws,_be as wt,Mp as wu,H9 as x,_6 as xa,Gne as xc,Kl as xd,je as xf,_8 as xi,lg as xl,s8 as xn,Pk as xo,sme as xr,Hv as xs,Sbe as xt,ane as xu,B9 as y,X6 as ya,qne as yc,eu as yd,Pe as yf,tge as yi,_g as yl,Dpe as yn,vj as yo,che as yr,Av as ys,Tbe as yt,ine as yu,x9 as z,MM as za,h_ as zc,N as zd,v as zf,whe as zi,Nh as zl,qpe as zn,Ek as zo,R8 as zr,P_ as zs,w7 as zt,Fte as zu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Wo as e}from"./dist-Dcmwb25g.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}let s=process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,c=process.platform===`win32`?[`/c`,`start`,``,a]:[a];t(s,c,e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
package/dist/parse-worker.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{t as e}from"./md-manager-BGnqyqi1-QGJ-q9Qx.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-BmbvsohB.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gf as e}from"./md-manager-BGnqyqi1-QGJ-q9Qx.mjs";import{Ln as t}from"./dist-Dcmwb25g.mjs";import"./constants-J_2c-D3U.mjs";import{join as n,relative as r}from"node:path";import{existsSync as i,lstatSync as a,readdirSync as o,realpathSync as s,statSync as c}from"node:fs";function l(e){let{projectDir:i,contentDir:l,sampleCap:u=5}=e,d=[],f=[];try{a(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=t({projectDir:i,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let t;try{t=o(e,{withFileTypes:!0})}catch(t){let n=t instanceof Error?t.message:String(t);d.push(`could not read directory ${r(l,e)||`.`}: ${n}`);return}for(let i of t){let t=n(e,i.name);if(i.isSymbolicLink()){let e;try{e=s(t)}catch(e){let n=e.code;n===`ENOENT`||n===`ELOOP`?d.push(`broken or cyclic symlink: ${r(l,t)}`):d.push(`cannot resolve symlink ${r(l,t)}: ${n??`unknown error`}`);continue}let n;try{n=c(e)}catch{continue}if(n.isDirectory()){let e=r(l,t);if(p.isDirExcluded(e))continue;m(t)}else if(n.isFile()){let e=r(l,t);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=r(l,t);if(p.isDirExcluded(e))continue;m(t)}else if(i.isFile()){let e=r(l,t);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function u(t,a){let o=[],s=r(a,t.contentDir),c=s===``?`./`:`./${s}`;if(o.push(`Content:`),o.push(` Found ${t.totalCount} markdown files in ${c}`),t.sample.length>0){let e=t.sample.join(`, `),n=t.totalCount>t.sample.length?`, …`:``;o.push(` Sample: ${e}${n}`)}if(t.warnings.length>0)for(let e of t.warnings)o.push(` Warning: ${e}`);o.push(``);let l=n(a,`.ok`,`config.yml`);return i(l)?(o.push(` To adjust scope, add patterns to .okignore at the project root.`),o.push(` To change the content root, edit .ok/config.yml → content.dir.`)):o.push(` Run \`${e().cliCommandNames[1]} init\` to scaffold config + .okignore.`),o.push(``),o.push(` Re-check anytime: ${e().cliCommandNames[1]} preview`),o.join(`
|
|
2
2
|
`)}export{l as n,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./label-CvMpFFbN.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./config-errors-CHiUH8-1.js";import{n as l,r as u}from"./constants-github-B7yhDvQc.js";import{f as d,l as f}from"./SyncStatusBadge-D4XfyHvU.js";import{t as p}from"./trash-2-CchZ0T47.js";import{t as m}from"./use-git-sync-status-D3gofteT.js";import{t as h}from"./input-BsFOyzfK.js";import{t as g}from"./skeleton-izVZCkjV.js";import{a as _,n as v,t as y}from"./AuthModal-DsmG3Tvf.js";import{t as b}from"./channel-cli-copy-BySq87hR.js";import{n as x}from"./auth-state-cache-CkEMY7L2.js";import{t as ee}from"./SettingsSectionHeader-ByMUJ5dN.js";var S=e(n(),1),C=a(),w=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,T=RegExp(`^${w}(?:\\.${w})*$`),E=/^[a-z][a-z0-9+.-]*:\/\//i;function D(e){if(E.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function O(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=D(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=u(r);return T.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function k(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}var A=t();function te(e){let t=(0,C.c)(59),{binding:n}=e,{_:a}=i(),o=(0,S.useId)(),l=(0,S.useId)(),u;t[0]===n?u=t[1]:(u=()=>k(n.current()),t[0]=n,t[1]=u);let[d,f]=(0,S.useState)(u),[m,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(!1),[x,ee]=(0,S.useState)(null),w;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Map,t[2]=w):w=t[2];let T=(0,S.useRef)(w),E=(0,S.useRef)(null),D,te;t[3]===x?(D=t[4],te=t[5]):(D=()=>{x!==null&&(((x.host===null?null:T.current.get(x.host))??E.current)?.focus(),ee(null))},te=[x],t[3]=x,t[4]=D,t[5]=te),(0,S.useEffect)(D,te);let M,N;t[6]===n?(M=t[7],N=t[8]):(M=()=>n.subscribe(e=>f(k(e))),N=[n],t[6]=n,t[7]=M,t[8]=N),(0,S.useEffect)(M,N);let P;t[9]===a?P=t[10]:(P=function(e){switch(e){case`empty`:return a({id:`cFONFy`});case`invalid`:return a({id:`QsnBxE`});case`github-com`:return a({id:`UK3GW4`});case`duplicate`:return a({id:`DEkRZA`})}},t[9]=a,t[10]=P);let F=P,I;t[11]!==n||t[12]!==m||t[13]!==d||t[14]!==F?(I=function(e){e.preventDefault();let t=O(m,new Set(d.map(j)));if(!t.ok){v(F(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){v(c(r.error));return}f(k(r.effective)),g(``),v(null),b(!0)},t[11]=n,t[12]=m,t[13]=d,t[14]=F,t[15]=I):I=t[15];let ne=I,L;t[16]!==n||t[17]!==d?(L=function(e){let t=d.indexOf(e),r=d[t+1]??d[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){v(c(i.error));return}f(k(i.effective)),ee({host:r}),v(null),b(!0)},t[16]=n,t[17]=d,t[18]=L):L=t[18];let R=L,z;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,A.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`J2-D_a`})}),t[19]=z):z=t[19];let B;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,A.jsx)(r,{id:`PgY2nN`}),t[20]=B):B=t[20];let V;t[21]===o?V=t[22]:(V=(0,A.jsxs)(`div`,{children:[z,(0,A.jsx)(`p`,{id:o,className:`text-1sm text-muted-foreground`,children:B})]}),t[21]=o,t[22]=V);let H;t[23]!==a||t[24]!==R||t[25]!==d?(H=d.length>0?(0,A.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:d.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,A.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":a({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?T.current.set(e,t):T.current.delete(e)},onClick:()=>R(e),children:(0,A.jsx)(p,{"aria-hidden":`true`})})]},e))}):(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,A.jsx)(r,{id:`HK2eIK`})}),t[23]=a,t[24]=R,t[25]=d,t[26]=H):H=t[26];let U;t[27]===a?U=t[28]:(U=a({id:`Qbf7Q4`}),t[27]=a,t[28]=U);let W=_!==null,G=_===null?o:`${o} ${l}`,K;t[29]===_?K=t[30]:(K=e=>{g(e.target.value),_!==null&&v(null)},t[29]=_,t[30]=K);let q;t[31]!==m||t[32]!==U||t[33]!==W||t[34]!==G||t[35]!==K?(q=(0,A.jsx)(h,{ref:E,value:m,"aria-label":U,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":W,"aria-describedby":G,onChange:K}),t[31]=m,t[32]=U,t[33]=W,t[34]=G,t[35]=K,t[36]=q):q=t[36];let re;t[37]===m?re=t[38]:(re=m.trim(),t[37]=m,t[38]=re);let ie=re===``,J;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,A.jsx)(r,{id:`ALFlyF`}),t[39]=J):J=t[39];let Y;t[40]===ie?Y=t[41]:(Y=(0,A.jsx)(s,{type:`submit`,size:`sm`,variant:`secondary`,disabled:ie,className:`h-7 px-2 font-normal text-xs`,children:J}),t[40]=ie,t[41]=Y);let X;t[42]!==ne||t[43]!==q||t[44]!==Y?(X=(0,A.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:ne,noValidate:!0,children:[q,Y]}),t[42]=ne,t[43]=q,t[44]=Y,t[45]=X):X=t[45];let Z;t[46]!==_||t[47]!==l?(Z=_===null?null:(0,A.jsx)(`p`,{id:l,role:`alert`,className:`text-1sm text-destructive`,children:_}),t[46]=_,t[47]=l,t[48]=Z):Z=t[48];let Q;t[49]===y?Q=t[50]:(Q=y?(0,A.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`3LuFP-`})}):null,t[49]=y,t[50]=Q);let $;t[51]!==H||t[52]!==X||t[53]!==Z||t[54]!==Q?($=(0,A.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[H,X,Z,Q]}),t[51]=H,t[52]=X,t[53]=Z,t[54]=Q,t[55]=$):$=t[55];let ae;return t[56]!==V||t[57]!==$?(ae=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[V,$]}),t[56]=V,t[57]=$,t[58]=ae):ae=t[58],ae}function j(e){return u(e)}function M(e){let t=(0,C.c)(43),{authQueryTransport:n,authTransport:a,userBinding:o}=e,{_:s}=i(),c;t[0]===n?c=t[1]:(c=n??_(),t[0]=n,t[1]=c);let l=c,u=m()?.remote??null,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={phase:`loading`},t[2]=d):d=t[2];let[f,p]=(0,S.useState)(d),[h,g]=(0,S.useState)(!1),[v,b]=(0,S.useState)(!1),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(!1),D;t[3]===l?D=t[4]:(D=async function(){p({phase:`loading`});try{let e=await l.status();p({phase:`loaded`,result:e}),x(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),p({phase:`check-failed`})}},t[3]=l,t[4]=D);let O=D,k;t[5]===O?k=t[6]:(k=()=>{O()},t[5]=O,t[6]=k);let j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=[],t[7]=j):j=t[7],(0,S.useEffect)(k,j);let M;t[8]!==s||t[9]!==O||t[10]!==l?(M=async function(){if(E.current)return;E.current=!0,g(!1),b(!0),T(null);let e=null;try{let t=l.signout?await l.signout():{ok:!1,error:s({id:`8cpOa8`})};t.ok||(e=t.error??s({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=s({id:`8cpOa8`})}await O(),e&&T(e),b(!1),E.current=!1},t[8]=s,t[9]=O,t[10]=l,t[11]=M):M=t[11];let P=M,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,A.jsx)(r,{id:`MpZRQy`}),t[12]=F):F=t[12];let I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,A.jsx)(ee,{titleId:`settings-account-title`,title:F,scope:`user`,children:(0,A.jsx)(r,{id:`pd6t3G`})}),t[13]=I):I=t[13];let L;t[14]!==w||t[15]!==v||t[16]!==P||t[17]!==O||t[18]!==f?(L=f.phase===`loaded`&&f.result.unsupportedOrigin!==void 0?null:(0,A.jsxs)(`section`,{"aria-labelledby":`settings-github-account-title`,className:`space-y-4`,"data-field":`section:github-account`,children:[(0,A.jsx)(`h4`,{id:`settings-github-account-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`RkXlPZ`})}),(0,A.jsx)(N,{status:f,disconnecting:v,disconnectError:w,onRetry:()=>void O(),onConnect:()=>g(!0),onDisconnect:()=>void P()})]}),t[14]=w,t[15]=v,t[16]=P,t[17]=O,t[18]=f,t[19]=L):L=t[19];let R;t[20]===o?R=t[21]:(R=(0,A.jsx)(te,{binding:o}),t[20]=o,t[21]=R);let z;t[22]!==a||t[23]!==u?(z=(0,A.jsx)(ne,{authTransport:a,remote:u}),t[22]=a,t[23]=u,t[24]=z):z=t[24];let B;t[25]!==R||t[26]!==z||t[27]!==L?(B=(0,A.jsxs)(`div`,{className:`space-y-8`,children:[L,R,z]}),t[25]=R,t[26]=z,t[27]=L,t[28]=B):B=t[28];let V;t[29]===O?V=t[30]:(V=e=>{g(e),e||O()},t[29]=O,t[30]=V);let H=f.phase===`loaded`?f.result.host:void 0,U=f.phase===`loaded`?f.result.ghAvailable:void 0,W;t[31]===O?W=t[32]:(W=()=>{O()},t[31]=O,t[32]=W);let G;t[33]!==h||t[34]!==a||t[35]!==V||t[36]!==H||t[37]!==U||t[38]!==W?(G=(0,A.jsx)(y,{open:h,onOpenChange:V,transport:a,host:H,ghAvailable:U,onSuccess:W}),t[33]=h,t[34]=a,t[35]=V,t[36]=H,t[37]=U,t[38]=W,t[39]=G):G=t[39];let K;return t[40]!==B||t[41]!==G?(K=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-5`,"data-testid":`settings-account`,children:[I,B,G]}),t[40]=B,t[41]=G,t[42]=K):K=t[42],K}function N(e){let t=(0,C.c)(8),{status:n,disconnecting:i,disconnectError:a,onRetry:o,onConnect:c,onDisconnect:l}=e,u;return t[0]!==a||t[1]!==i||t[2]!==c||t[3]!==l||t[4]!==o||t[5]!==n.phase||t[6]!==n.result?(u=n.phase===`loading`?(0,A.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:(0,A.jsx)(r,{id:`IWGfGF`})}),(0,A.jsx)(g,{className:`h-4 w-40`}),(0,A.jsx)(g,{className:`h-8 w-32`})]}):n.phase===`check-failed`?(0,A.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`T_wG4n`})}),(0,A.jsx)(s,{variant:`outline`,size:`sm`,onClick:o,children:(0,A.jsx)(r,{id:`KDw4GX`})})]}):n.result.authenticated?n.result.tier===`A`?(0,A.jsx)(R,{login:n.result.login,host:n.result.host}):(0,A.jsx)(L,{login:n.result.login,host:n.result.host,disconnecting:i,error:a,onDisconnect:l}):(0,A.jsx)(z,{onConnect:c}),t[0]=a,t[1]=i,t[2]=c,t[3]=l,t[4]=o,t[5]=n.phase,t[6]=n.result,t[7]=u):u=t[7],u}function P(e){let t=e.split(`/`)[0]??``;return l(t)?t:``}function F(e){let t=(0,C.c)(7),{login:n,host:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=b(),t[0]=a):a=t[0];let o=a,s;t[1]!==i||t[2]!==n?(s={login:n,host:i,cliCommand:o},t[1]=i,t[2]=n,t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,A.jsx)(`code`,{translate:`no`})},t[4]=c):c=t[4];let l;return t[5]===s?l=t[6]:(l=(0,A.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-success`,children:(0,A.jsx)(r,{id:`o8OY2K`,values:s,components:c})}),t[5]=s,t[6]=l),l}var I={"data-1p-ignore":!0,"data-lpignore":`true`,"data-bwignore":!0,"data-form-type":`other`};function ne(e){let t=(0,C.c)(89),{authTransport:n,remote:a}=e,{_:c}=i(),u;t[0]===n?u=t[1]:(u=n??v(),t[0]=n,t[1]=u);let p=u,m=a?.label??null,g;t[2]===a?g=t[3]:(g=a?f(a):!1,t[2]=a,t[3]=g);let _=g,y;t[4]===a?y=t[5]:(y=d(a),t[4]=a,t[5]=y);let b=y,x=(0,S.useId)(),ee=(0,S.useId)(),w=(0,S.useId)(),T=(0,S.useId)(),E=(0,S.useId)(),[D,O]=(0,S.useState)(``),[k,te]=(0,S.useState)(``),[j,M]=(0,S.useState)(``),[N,ne]=(0,S.useState)(!1),[L,R]=(0,S.useState)(null),[z,B]=(0,S.useState)(!1),[V,H]=(0,S.useState)(null),U=(0,S.useRef)(!1),W=(0,S.useRef)(!1),G,K;t[6]!==_||t[7]!==m||t[8]!==b?(G=()=>{if(W.current||m===null||_||!b)return;let e=P(m);e&&(W.current=!0,O(e))},K=[m,_,b],t[6]=_,t[7]=m,t[8]=b,t[9]=G,t[10]=K):(G=t[9],K=t[10]),(0,S.useEffect)(G,K);let q;t[11]!==c||t[12]!==D||t[13]!==p||t[14]!==j||t[15]!==k?(q=async function(){if(U.current)return;let e=D.trim(),t=k.trim(),n=j.trim();if(!e||!t||!n)return;if(!l(e)){H(null),B(!0),R(c({id:`rZFxkH`}));return}if(B(!1),!p.hostToken){R(c({id:`iMYFJM`}));return}U.current=!0,ne(!0),R(null),H(null);let r=await p.hostToken(e,t,n).catch(e=>(console.warn(`[AccountSection] storing a host token failed`,e),{ok:!1,login:void 0,error:c({id:`Q5fqMz`})}));ne(!1),U.current=!1,r.ok?(M(``),H({login:r.login||t,host:e})):R(r.error??c({id:`sNeKjP`}))},t[11]=c,t[12]=D,t[13]=p,t[14]=j,t[15]=k,t[16]=q):q=t[16];let re=q,ie;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,A.jsx)(`h4`,{id:`settings-host-tokens-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`jbhCDS`})}),t[17]=ie):ie=t[17];let J;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,A.jsxs)(`div`,{children:[ie,(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`-nA68n`})})]}),t[18]=J):J=t[18];let Y;t[19]===re?Y=t[20]:(Y=e=>{e.preventDefault(),re()},t[19]=re,t[20]=Y);let X;t[21]!==_||t[22]!==m||t[23]!==b?(X=m!==null&&!_&&!b?(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-not-https`,children:(0,A.jsx)(r,{id:`OWs-8P`})}):null,t[21]=_,t[22]=m,t[23]=b,t[24]=X):X=t[24];let Z;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,A.jsx)(r,{id:`Ai2U7L`}),t[25]=Z):Z=t[25];let Q;t[26]===x?Q=t[27]:(Q=(0,A.jsx)(o,{htmlFor:x,children:Z}),t[26]=x,t[27]=Q);let $=z||void 0,ae=z&&L?ee:void 0,oe;t[28]===z?oe=t[29]:(oe=e=>{W.current=!0,O(e.target.value),z&&(B(!1),R(null))},t[28]=z,t[29]=oe);let se;t[30]!==D||t[31]!==x||t[32]!==$||t[33]!==ae||t[34]!==oe?(se=(0,A.jsx)(h,{id:x,type:`text`,placeholder:`git.example.com`,autoComplete:`off`,...I,"aria-invalid":$,"aria-describedby":ae,value:D,onChange:oe}),t[30]=D,t[31]=x,t[32]=$,t[33]=ae,t[34]=oe,t[35]=se):se=t[35];let ce;t[36]!==Q||t[37]!==se?(ce=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[Q,se]}),t[36]=Q,t[37]=se,t[38]=ce):ce=t[38];let le;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,A.jsx)(r,{id:`7sNhEz`}),t[39]=le):le=t[39];let ue;t[40]===w?ue=t[41]:(ue=(0,A.jsx)(o,{htmlFor:w,children:le}),t[40]=w,t[41]=ue);let de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>te(e.target.value),t[42]=de):de=t[42];let fe;t[43]!==k||t[44]!==T||t[45]!==w?(fe=(0,A.jsx)(h,{id:w,type:`text`,autoComplete:`off`,...I,"aria-describedby":T,value:k,onChange:de}),t[43]=k,t[44]=T,t[45]=w,t[46]=fe):fe=t[46];let pe;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,A.jsx)(r,{id:`azrR7I`,components:{0:(0,A.jsx)(`code`,{translate:`no`}),1:(0,A.jsx)(`code`,{translate:`no`}),2:(0,A.jsx)(`code`,{translate:`no`})}}),t[47]=pe):pe=t[47];let me;t[48]===T?me=t[49]:(me=(0,A.jsx)(`p`,{id:T,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-username-hint`,children:pe}),t[48]=T,t[49]=me);let he;t[50]!==ue||t[51]!==fe||t[52]!==me?(he=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[ue,fe,me]}),t[50]=ue,t[51]=fe,t[52]=me,t[53]=he):he=t[53];let ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,A.jsx)(r,{id:`SkUcEr`}),t[54]=ge):ge=t[54];let _e;t[55]===E?_e=t[56]:(_e=(0,A.jsx)(o,{htmlFor:E,children:ge}),t[55]=E,t[56]=_e);let ve;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>M(e.target.value),t[57]=ve):ve=t[57];let ye;t[58]!==j||t[59]!==E?(ye=(0,A.jsx)(h,{id:E,type:`password`,autoComplete:`off`,...I,value:j,onChange:ve}),t[58]=j,t[59]=E,t[60]=ye):ye=t[60];let be;t[61]!==_e||t[62]!==ye?(be=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[_e,ye]}),t[61]=_e,t[62]=ye,t[63]=be):be=t[63];let xe;t[64]!==D||t[65]!==N||t[66]!==j||t[67]!==k?(xe=N||!D.trim()||!k.trim()||!j.trim(),t[64]=D,t[65]=N,t[66]=j,t[67]=k,t[68]=xe):xe=t[68];let Se;t[69]===N?Se=t[70]:(Se=N?(0,A.jsx)(r,{id:`1yHVE-`}):(0,A.jsx)(r,{id:`zXZJoN`}),t[69]=N,t[70]=Se);let Ce;t[71]!==xe||t[72]!==Se?(Ce=(0,A.jsx)(s,{type:`submit`,"data-testid":`settings-account-host-token-submit`,disabled:xe,children:Se}),t[71]=xe,t[72]=Se,t[73]=Ce):Ce=t[73];let we;t[74]===V?we=t[75]:(we=V?(0,A.jsx)(F,{login:V.login,host:V.host}):null,t[74]=V,t[75]=we);let Te;t[76]!==L||t[77]!==ee||t[78]!==z?(Te=L?(0,A.jsx)(`p`,{id:z?ee:void 0,role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-host-token-error`,children:L}):null,t[76]=L,t[77]=ee,t[78]=z,t[79]=Te):Te=t[79];let Ee;return t[80]!==X||t[81]!==ce||t[82]!==he||t[83]!==be||t[84]!==Ce||t[85]!==we||t[86]!==Te||t[87]!==Y?(Ee=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-host-tokens-title`,className:`space-y-4`,"data-field":`section:host-tokens`,children:[J,(0,A.jsxs)(`form`,{className:`space-y-3 rounded-lg border bg-card p-3`,"data-testid":`settings-account-host-token`,"aria-labelledby":`settings-host-tokens-title`,autoComplete:`off`,onSubmit:Y,children:[X,ce,he,be,Ce,we,Te]})]}),t[80]=X,t[81]=ce,t[82]=he,t[83]=be,t[84]=Ce,t[85]=we,t[86]=Te,t[87]=Y,t[88]=Ee):Ee=t[88],Ee}function L(e){let t=(0,C.c)(21),{login:n,host:i,disconnecting:a,error:o,onDisconnect:c}=e,l;t[0]!==i||t[1]!==n?(l=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`bc7aCh`,values:{host:i,login:n}})}),t[0]=i,t[1]=n,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`nxlOpL`})}),t[3]=u):u=t[3];let d;t[4]===l?d=t[5]:(d=(0,A.jsxs)(`div`,{className:`min-w-0`,children:[l,u]}),t[4]=l,t[5]=d);let f;t[6]===a?f=t[7]:(f=a?(0,A.jsx)(r,{id:`rppgXF`}):(0,A.jsx)(r,{id:`-K0AvT`}),t[6]=a,t[7]=f);let p;t[8]!==a||t[9]!==c||t[10]!==f?(p=(0,A.jsx)(s,{variant:`outline`,onClick:c,disabled:a,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:f}),t[8]=a,t[9]=c,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,A.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,A.jsx)(r,{id:`msOK6I`})}),t[15]=h):h=t[15];let g;t[16]===o?g=t[17]:(g=o?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:o}):null,t[16]=o,t[17]=g);let _;return t[18]!==m||t[19]!==g?(_=(0,A.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[m,h,g]}),t[18]=m,t[19]=g,t[20]=_):_=t[20],_}function R(e){let t=(0,C.c)(6),{login:n,host:i}=e,a;t[0]!==i||t[1]!==n?(a=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`bc7aCh`,values:{host:i,login:n}})}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`UcTm1A`,components:{0:(0,A.jsx)(`code`,{translate:`no`}),1:(0,A.jsx)(`code`,{translate:`no`})}})}),t[3]=o):o=t[3];let s;return t[4]===a?s=t[5]:(s=(0,A.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,A.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[a,o]})}),t[4]=a,t[5]=s),s}function z(e){let t=(0,C.c)(5),{onConnect:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`S33tz3`})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,A.jsxs)(`div`,{className:`min-w-0`,children:[i,(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`9djC8C`})})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(r,{id:`5lWFkC`}),t[2]=o):o=t[2];let c;return t[3]===n?c=t[4]:(c=(0,A.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,(0,A.jsx)(s,{onClick:n,"data-testid":`settings-account-connect`,children:o})]})}),t[3]=n,t[4]=c),c}export{M as AccountSection};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./label-CvMpFFbN.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./config-errors-CHiUH8-1.js";import{n as l,r as u}from"./constants-github-B7yhDvQc.js";import{f as d,l as f}from"./SyncStatusBadge-BOQqzGQf.js";import{t as p}from"./trash-2-CchZ0T47.js";import{t as m}from"./use-git-sync-status-D3gofteT.js";import{t as h}from"./input-BsFOyzfK.js";import{t as g}from"./skeleton-izVZCkjV.js";import{a as _,n as v,t as y}from"./AuthModal-C6TUfJLf.js";import{t as b}from"./channel-cli-copy-BySq87hR.js";import{n as x}from"./auth-state-cache-CkEMY7L2.js";import{t as ee}from"./SettingsSectionHeader-ByMUJ5dN.js";var S=e(n(),1),C=a(),w=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,T=RegExp(`^${w}(?:\\.${w})*$`),E=/^[a-z][a-z0-9+.-]*:\/\//i;function D(e){if(E.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function O(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=D(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=u(r);return T.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function k(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}var A=t();function te(e){let t=(0,C.c)(59),{binding:n}=e,{_:a}=i(),o=(0,S.useId)(),l=(0,S.useId)(),u;t[0]===n?u=t[1]:(u=()=>k(n.current()),t[0]=n,t[1]=u);let[d,f]=(0,S.useState)(u),[m,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(!1),[x,ee]=(0,S.useState)(null),w;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Map,t[2]=w):w=t[2];let T=(0,S.useRef)(w),E=(0,S.useRef)(null),D,te;t[3]===x?(D=t[4],te=t[5]):(D=()=>{x!==null&&(((x.host===null?null:T.current.get(x.host))??E.current)?.focus(),ee(null))},te=[x],t[3]=x,t[4]=D,t[5]=te),(0,S.useEffect)(D,te);let M,N;t[6]===n?(M=t[7],N=t[8]):(M=()=>n.subscribe(e=>f(k(e))),N=[n],t[6]=n,t[7]=M,t[8]=N),(0,S.useEffect)(M,N);let P;t[9]===a?P=t[10]:(P=function(e){switch(e){case`empty`:return a({id:`cFONFy`});case`invalid`:return a({id:`QsnBxE`});case`github-com`:return a({id:`UK3GW4`});case`duplicate`:return a({id:`DEkRZA`})}},t[9]=a,t[10]=P);let F=P,I;t[11]!==n||t[12]!==m||t[13]!==d||t[14]!==F?(I=function(e){e.preventDefault();let t=O(m,new Set(d.map(j)));if(!t.ok){v(F(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){v(c(r.error));return}f(k(r.effective)),g(``),v(null),b(!0)},t[11]=n,t[12]=m,t[13]=d,t[14]=F,t[15]=I):I=t[15];let ne=I,L;t[16]!==n||t[17]!==d?(L=function(e){let t=d.indexOf(e),r=d[t+1]??d[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){v(c(i.error));return}f(k(i.effective)),ee({host:r}),v(null),b(!0)},t[16]=n,t[17]=d,t[18]=L):L=t[18];let R=L,z;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,A.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`J2-D_a`})}),t[19]=z):z=t[19];let B;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,A.jsx)(r,{id:`PgY2nN`}),t[20]=B):B=t[20];let V;t[21]===o?V=t[22]:(V=(0,A.jsxs)(`div`,{children:[z,(0,A.jsx)(`p`,{id:o,className:`text-1sm text-muted-foreground`,children:B})]}),t[21]=o,t[22]=V);let H;t[23]!==a||t[24]!==R||t[25]!==d?(H=d.length>0?(0,A.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:d.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,A.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":a({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?T.current.set(e,t):T.current.delete(e)},onClick:()=>R(e),children:(0,A.jsx)(p,{"aria-hidden":`true`})})]},e))}):(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,A.jsx)(r,{id:`HK2eIK`})}),t[23]=a,t[24]=R,t[25]=d,t[26]=H):H=t[26];let U;t[27]===a?U=t[28]:(U=a({id:`Qbf7Q4`}),t[27]=a,t[28]=U);let W=_!==null,G=_===null?o:`${o} ${l}`,K;t[29]===_?K=t[30]:(K=e=>{g(e.target.value),_!==null&&v(null)},t[29]=_,t[30]=K);let q;t[31]!==m||t[32]!==U||t[33]!==W||t[34]!==G||t[35]!==K?(q=(0,A.jsx)(h,{ref:E,value:m,"aria-label":U,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":W,"aria-describedby":G,onChange:K}),t[31]=m,t[32]=U,t[33]=W,t[34]=G,t[35]=K,t[36]=q):q=t[36];let re;t[37]===m?re=t[38]:(re=m.trim(),t[37]=m,t[38]=re);let ie=re===``,J;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,A.jsx)(r,{id:`ALFlyF`}),t[39]=J):J=t[39];let Y;t[40]===ie?Y=t[41]:(Y=(0,A.jsx)(s,{type:`submit`,size:`sm`,variant:`secondary`,disabled:ie,className:`h-7 px-2 font-normal text-xs`,children:J}),t[40]=ie,t[41]=Y);let X;t[42]!==ne||t[43]!==q||t[44]!==Y?(X=(0,A.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:ne,noValidate:!0,children:[q,Y]}),t[42]=ne,t[43]=q,t[44]=Y,t[45]=X):X=t[45];let Z;t[46]!==_||t[47]!==l?(Z=_===null?null:(0,A.jsx)(`p`,{id:l,role:`alert`,className:`text-1sm text-destructive`,children:_}),t[46]=_,t[47]=l,t[48]=Z):Z=t[48];let Q;t[49]===y?Q=t[50]:(Q=y?(0,A.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`3LuFP-`})}):null,t[49]=y,t[50]=Q);let $;t[51]!==H||t[52]!==X||t[53]!==Z||t[54]!==Q?($=(0,A.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[H,X,Z,Q]}),t[51]=H,t[52]=X,t[53]=Z,t[54]=Q,t[55]=$):$=t[55];let ae;return t[56]!==V||t[57]!==$?(ae=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[V,$]}),t[56]=V,t[57]=$,t[58]=ae):ae=t[58],ae}function j(e){return u(e)}function M(e){let t=(0,C.c)(43),{authQueryTransport:n,authTransport:a,userBinding:o}=e,{_:s}=i(),c;t[0]===n?c=t[1]:(c=n??_(),t[0]=n,t[1]=c);let l=c,u=m()?.remote??null,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={phase:`loading`},t[2]=d):d=t[2];let[f,p]=(0,S.useState)(d),[h,g]=(0,S.useState)(!1),[v,b]=(0,S.useState)(!1),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(!1),D;t[3]===l?D=t[4]:(D=async function(){p({phase:`loading`});try{let e=await l.status();p({phase:`loaded`,result:e}),x(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),p({phase:`check-failed`})}},t[3]=l,t[4]=D);let O=D,k;t[5]===O?k=t[6]:(k=()=>{O()},t[5]=O,t[6]=k);let j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=[],t[7]=j):j=t[7],(0,S.useEffect)(k,j);let M;t[8]!==s||t[9]!==O||t[10]!==l?(M=async function(){if(E.current)return;E.current=!0,g(!1),b(!0),T(null);let e=null;try{let t=l.signout?await l.signout():{ok:!1,error:s({id:`8cpOa8`})};t.ok||(e=t.error??s({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=s({id:`8cpOa8`})}await O(),e&&T(e),b(!1),E.current=!1},t[8]=s,t[9]=O,t[10]=l,t[11]=M):M=t[11];let P=M,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,A.jsx)(r,{id:`MpZRQy`}),t[12]=F):F=t[12];let I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,A.jsx)(ee,{titleId:`settings-account-title`,title:F,scope:`user`,children:(0,A.jsx)(r,{id:`pd6t3G`})}),t[13]=I):I=t[13];let L;t[14]!==w||t[15]!==v||t[16]!==P||t[17]!==O||t[18]!==f?(L=f.phase===`loaded`&&f.result.unsupportedOrigin!==void 0?null:(0,A.jsxs)(`section`,{"aria-labelledby":`settings-github-account-title`,className:`space-y-4`,"data-field":`section:github-account`,children:[(0,A.jsx)(`h4`,{id:`settings-github-account-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`RkXlPZ`})}),(0,A.jsx)(N,{status:f,disconnecting:v,disconnectError:w,onRetry:()=>void O(),onConnect:()=>g(!0),onDisconnect:()=>void P()})]}),t[14]=w,t[15]=v,t[16]=P,t[17]=O,t[18]=f,t[19]=L):L=t[19];let R;t[20]===o?R=t[21]:(R=(0,A.jsx)(te,{binding:o}),t[20]=o,t[21]=R);let z;t[22]!==a||t[23]!==u?(z=(0,A.jsx)(ne,{authTransport:a,remote:u}),t[22]=a,t[23]=u,t[24]=z):z=t[24];let B;t[25]!==R||t[26]!==z||t[27]!==L?(B=(0,A.jsxs)(`div`,{className:`space-y-8`,children:[L,R,z]}),t[25]=R,t[26]=z,t[27]=L,t[28]=B):B=t[28];let V;t[29]===O?V=t[30]:(V=e=>{g(e),e||O()},t[29]=O,t[30]=V);let H=f.phase===`loaded`?f.result.host:void 0,U=f.phase===`loaded`?f.result.ghAvailable:void 0,W;t[31]===O?W=t[32]:(W=()=>{O()},t[31]=O,t[32]=W);let G;t[33]!==h||t[34]!==a||t[35]!==V||t[36]!==H||t[37]!==U||t[38]!==W?(G=(0,A.jsx)(y,{open:h,onOpenChange:V,transport:a,host:H,ghAvailable:U,onSuccess:W}),t[33]=h,t[34]=a,t[35]=V,t[36]=H,t[37]=U,t[38]=W,t[39]=G):G=t[39];let K;return t[40]!==B||t[41]!==G?(K=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-5`,"data-testid":`settings-account`,children:[I,B,G]}),t[40]=B,t[41]=G,t[42]=K):K=t[42],K}function N(e){let t=(0,C.c)(8),{status:n,disconnecting:i,disconnectError:a,onRetry:o,onConnect:c,onDisconnect:l}=e,u;return t[0]!==a||t[1]!==i||t[2]!==c||t[3]!==l||t[4]!==o||t[5]!==n.phase||t[6]!==n.result?(u=n.phase===`loading`?(0,A.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:(0,A.jsx)(r,{id:`IWGfGF`})}),(0,A.jsx)(g,{className:`h-4 w-40`}),(0,A.jsx)(g,{className:`h-8 w-32`})]}):n.phase===`check-failed`?(0,A.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`T_wG4n`})}),(0,A.jsx)(s,{variant:`outline`,size:`sm`,onClick:o,children:(0,A.jsx)(r,{id:`KDw4GX`})})]}):n.result.authenticated?n.result.tier===`A`?(0,A.jsx)(R,{login:n.result.login,host:n.result.host}):(0,A.jsx)(L,{login:n.result.login,host:n.result.host,disconnecting:i,error:a,onDisconnect:l}):(0,A.jsx)(z,{onConnect:c}),t[0]=a,t[1]=i,t[2]=c,t[3]=l,t[4]=o,t[5]=n.phase,t[6]=n.result,t[7]=u):u=t[7],u}function P(e){let t=e.split(`/`)[0]??``;return l(t)?t:``}function F(e){let t=(0,C.c)(7),{login:n,host:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=b(),t[0]=a):a=t[0];let o=a,s;t[1]!==i||t[2]!==n?(s={login:n,host:i,cliCommand:o},t[1]=i,t[2]=n,t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,A.jsx)(`code`,{translate:`no`})},t[4]=c):c=t[4];let l;return t[5]===s?l=t[6]:(l=(0,A.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-success`,children:(0,A.jsx)(r,{id:`o8OY2K`,values:s,components:c})}),t[5]=s,t[6]=l),l}var I={"data-1p-ignore":!0,"data-lpignore":`true`,"data-bwignore":!0,"data-form-type":`other`};function ne(e){let t=(0,C.c)(89),{authTransport:n,remote:a}=e,{_:c}=i(),u;t[0]===n?u=t[1]:(u=n??v(),t[0]=n,t[1]=u);let p=u,m=a?.label??null,g;t[2]===a?g=t[3]:(g=a?f(a):!1,t[2]=a,t[3]=g);let _=g,y;t[4]===a?y=t[5]:(y=d(a),t[4]=a,t[5]=y);let b=y,x=(0,S.useId)(),ee=(0,S.useId)(),w=(0,S.useId)(),T=(0,S.useId)(),E=(0,S.useId)(),[D,O]=(0,S.useState)(``),[k,te]=(0,S.useState)(``),[j,M]=(0,S.useState)(``),[N,ne]=(0,S.useState)(!1),[L,R]=(0,S.useState)(null),[z,B]=(0,S.useState)(!1),[V,H]=(0,S.useState)(null),U=(0,S.useRef)(!1),W=(0,S.useRef)(!1),G,K;t[6]!==_||t[7]!==m||t[8]!==b?(G=()=>{if(W.current||m===null||_||!b)return;let e=P(m);e&&(W.current=!0,O(e))},K=[m,_,b],t[6]=_,t[7]=m,t[8]=b,t[9]=G,t[10]=K):(G=t[9],K=t[10]),(0,S.useEffect)(G,K);let q;t[11]!==c||t[12]!==D||t[13]!==p||t[14]!==j||t[15]!==k?(q=async function(){if(U.current)return;let e=D.trim(),t=k.trim(),n=j.trim();if(!e||!t||!n)return;if(!l(e)){H(null),B(!0),R(c({id:`rZFxkH`}));return}if(B(!1),!p.hostToken){R(c({id:`iMYFJM`}));return}U.current=!0,ne(!0),R(null),H(null);let r=await p.hostToken(e,t,n).catch(e=>(console.warn(`[AccountSection] storing a host token failed`,e),{ok:!1,login:void 0,error:c({id:`Q5fqMz`})}));ne(!1),U.current=!1,r.ok?(M(``),H({login:r.login||t,host:e})):R(r.error??c({id:`sNeKjP`}))},t[11]=c,t[12]=D,t[13]=p,t[14]=j,t[15]=k,t[16]=q):q=t[16];let re=q,ie;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,A.jsx)(`h4`,{id:`settings-host-tokens-title`,className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`jbhCDS`})}),t[17]=ie):ie=t[17];let J;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,A.jsxs)(`div`,{children:[ie,(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,A.jsx)(r,{id:`-nA68n`})})]}),t[18]=J):J=t[18];let Y;t[19]===re?Y=t[20]:(Y=e=>{e.preventDefault(),re()},t[19]=re,t[20]=Y);let X;t[21]!==_||t[22]!==m||t[23]!==b?(X=m!==null&&!_&&!b?(0,A.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-not-https`,children:(0,A.jsx)(r,{id:`OWs-8P`})}):null,t[21]=_,t[22]=m,t[23]=b,t[24]=X):X=t[24];let Z;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,A.jsx)(r,{id:`Ai2U7L`}),t[25]=Z):Z=t[25];let Q;t[26]===x?Q=t[27]:(Q=(0,A.jsx)(o,{htmlFor:x,children:Z}),t[26]=x,t[27]=Q);let $=z||void 0,ae=z&&L?ee:void 0,oe;t[28]===z?oe=t[29]:(oe=e=>{W.current=!0,O(e.target.value),z&&(B(!1),R(null))},t[28]=z,t[29]=oe);let se;t[30]!==D||t[31]!==x||t[32]!==$||t[33]!==ae||t[34]!==oe?(se=(0,A.jsx)(h,{id:x,type:`text`,placeholder:`git.example.com`,autoComplete:`off`,...I,"aria-invalid":$,"aria-describedby":ae,value:D,onChange:oe}),t[30]=D,t[31]=x,t[32]=$,t[33]=ae,t[34]=oe,t[35]=se):se=t[35];let ce;t[36]!==Q||t[37]!==se?(ce=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[Q,se]}),t[36]=Q,t[37]=se,t[38]=ce):ce=t[38];let le;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,A.jsx)(r,{id:`7sNhEz`}),t[39]=le):le=t[39];let ue;t[40]===w?ue=t[41]:(ue=(0,A.jsx)(o,{htmlFor:w,children:le}),t[40]=w,t[41]=ue);let de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>te(e.target.value),t[42]=de):de=t[42];let fe;t[43]!==k||t[44]!==T||t[45]!==w?(fe=(0,A.jsx)(h,{id:w,type:`text`,autoComplete:`off`,...I,"aria-describedby":T,value:k,onChange:de}),t[43]=k,t[44]=T,t[45]=w,t[46]=fe):fe=t[46];let pe;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,A.jsx)(r,{id:`azrR7I`,components:{0:(0,A.jsx)(`code`,{translate:`no`}),1:(0,A.jsx)(`code`,{translate:`no`}),2:(0,A.jsx)(`code`,{translate:`no`})}}),t[47]=pe):pe=t[47];let me;t[48]===T?me=t[49]:(me=(0,A.jsx)(`p`,{id:T,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-username-hint`,children:pe}),t[48]=T,t[49]=me);let he;t[50]!==ue||t[51]!==fe||t[52]!==me?(he=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[ue,fe,me]}),t[50]=ue,t[51]=fe,t[52]=me,t[53]=he):he=t[53];let ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,A.jsx)(r,{id:`SkUcEr`}),t[54]=ge):ge=t[54];let _e;t[55]===E?_e=t[56]:(_e=(0,A.jsx)(o,{htmlFor:E,children:ge}),t[55]=E,t[56]=_e);let ve;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>M(e.target.value),t[57]=ve):ve=t[57];let ye;t[58]!==j||t[59]!==E?(ye=(0,A.jsx)(h,{id:E,type:`password`,autoComplete:`off`,...I,value:j,onChange:ve}),t[58]=j,t[59]=E,t[60]=ye):ye=t[60];let be;t[61]!==_e||t[62]!==ye?(be=(0,A.jsxs)(`div`,{className:`space-y-1`,children:[_e,ye]}),t[61]=_e,t[62]=ye,t[63]=be):be=t[63];let xe;t[64]!==D||t[65]!==N||t[66]!==j||t[67]!==k?(xe=N||!D.trim()||!k.trim()||!j.trim(),t[64]=D,t[65]=N,t[66]=j,t[67]=k,t[68]=xe):xe=t[68];let Se;t[69]===N?Se=t[70]:(Se=N?(0,A.jsx)(r,{id:`1yHVE-`}):(0,A.jsx)(r,{id:`zXZJoN`}),t[69]=N,t[70]=Se);let Ce;t[71]!==xe||t[72]!==Se?(Ce=(0,A.jsx)(s,{type:`submit`,"data-testid":`settings-account-host-token-submit`,disabled:xe,children:Se}),t[71]=xe,t[72]=Se,t[73]=Ce):Ce=t[73];let we;t[74]===V?we=t[75]:(we=V?(0,A.jsx)(F,{login:V.login,host:V.host}):null,t[74]=V,t[75]=we);let Te;t[76]!==L||t[77]!==ee||t[78]!==z?(Te=L?(0,A.jsx)(`p`,{id:z?ee:void 0,role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-host-token-error`,children:L}):null,t[76]=L,t[77]=ee,t[78]=z,t[79]=Te):Te=t[79];let Ee;return t[80]!==X||t[81]!==ce||t[82]!==he||t[83]!==be||t[84]!==Ce||t[85]!==we||t[86]!==Te||t[87]!==Y?(Ee=(0,A.jsxs)(`section`,{"aria-labelledby":`settings-host-tokens-title`,className:`space-y-4`,"data-field":`section:host-tokens`,children:[J,(0,A.jsxs)(`form`,{className:`space-y-3 rounded-lg border bg-card p-3`,"data-testid":`settings-account-host-token`,"aria-labelledby":`settings-host-tokens-title`,autoComplete:`off`,onSubmit:Y,children:[X,ce,he,be,Ce,we,Te]})]}),t[80]=X,t[81]=ce,t[82]=he,t[83]=be,t[84]=Ce,t[85]=we,t[86]=Te,t[87]=Y,t[88]=Ee):Ee=t[88],Ee}function L(e){let t=(0,C.c)(21),{login:n,host:i,disconnecting:a,error:o,onDisconnect:c}=e,l;t[0]!==i||t[1]!==n?(l=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`bc7aCh`,values:{host:i,login:n}})}),t[0]=i,t[1]=n,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`nxlOpL`})}),t[3]=u):u=t[3];let d;t[4]===l?d=t[5]:(d=(0,A.jsxs)(`div`,{className:`min-w-0`,children:[l,u]}),t[4]=l,t[5]=d);let f;t[6]===a?f=t[7]:(f=a?(0,A.jsx)(r,{id:`rppgXF`}):(0,A.jsx)(r,{id:`-K0AvT`}),t[6]=a,t[7]=f);let p;t[8]!==a||t[9]!==c||t[10]!==f?(p=(0,A.jsx)(s,{variant:`outline`,onClick:c,disabled:a,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:f}),t[8]=a,t[9]=c,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,A.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,A.jsx)(r,{id:`msOK6I`})}),t[15]=h):h=t[15];let g;t[16]===o?g=t[17]:(g=o?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:o}):null,t[16]=o,t[17]=g);let _;return t[18]!==m||t[19]!==g?(_=(0,A.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[m,h,g]}),t[18]=m,t[19]=g,t[20]=_):_=t[20],_}function R(e){let t=(0,C.c)(6),{login:n,host:i}=e,a;t[0]!==i||t[1]!==n?(a=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`bc7aCh`,values:{host:i,login:n}})}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`UcTm1A`,components:{0:(0,A.jsx)(`code`,{translate:`no`}),1:(0,A.jsx)(`code`,{translate:`no`})}})}),t[3]=o):o=t[3];let s;return t[4]===a?s=t[5]:(s=(0,A.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,A.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[a,o]})}),t[4]=a,t[5]=s),s}function z(e){let t=(0,C.c)(5),{onConnect:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`div`,{className:`text-sm font-medium`,children:(0,A.jsx)(r,{id:`S33tz3`})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,A.jsxs)(`div`,{className:`min-w-0`,children:[i,(0,A.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,A.jsx)(r,{id:`9djC8C`})})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(r,{id:`5lWFkC`}),t[2]=o):o=t[2];let c;return t[3]===n?c=t[4]:(c=(0,A.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,(0,A.jsx)(s,{onClick:n,"data-testid":`settings-account-connect`,children:o})]})}),t[3]=n,t[4]=c),c}export{M as AccountSection};
|
package/dist/public/assets/{ActivityModeContent-BqNsXfT4.js → ActivityModeContent-xTdhODwb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-Dhs9Bgpy.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{i as c,n as l,t as u}from"./tooltip-Bz6z4_se.js";import{t as d}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{t as p}from"./dist-C_FzPxEX2.js";import{f as m}from"./Mermaid-DEkpWJB8.js";import{t as h}from"./circle-alert-eBm4JPxY.js";import{t as g}from"./spinner-Bx8xD6f8.js";import{t as _}from"./undo-2-xEF_s_Io.js";import{a as v,c as y,i as b,o as x,s as S,t as C}from"./dialog-BJEjKJjL.js";import{l as w}from"./doc-hash-BJkweiX9.js";import{s as T}from"./navigation-targets-wIVrXum1.js";import{r as E}from"./PageListContext-BpuGcUaJ.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-B_PHpjoM.js";import{t as M}from"./timeline-diff-store-COsBPeIl.js";import{n as N}from"./use-activity-panel-kXobfF-I.js";var P=s(),F=e(i(),1),I=t();function ee(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function L(e){let t=(0,P.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:f,onOpenDiff:p,onRestore:m}=e,{_:h}=o(),[w,T]=(0,F.useState)(te),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,F.useEffect)(E,O);let[k,A]=(0,F.useState)(!1),j=D(),M=n.stackIndex+1,N=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||f||L<=0,re;t[2]!==L||t[3]!==m?(re=function(){A(!1),m(L)},t[2]=L,t[3]=m,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==p?(R=()=>p(n),t[5]=n,t[6]=p,t[7]=R):R=t[7];let z;t[8]!==h||t[9]!==M||t[10]!==r?(z=h({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=h,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=N?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=ee(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,I.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,I.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,I.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,I.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==N||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,I.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":N,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=N,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==h||t[35]!==M||t[36]!==r?(K=h({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=h,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===f?q=t[40]:(q=f?(0,I.jsx)(g,{className:`size-3`,"aria-hidden":`true`}):(0,I.jsx)(_,{className:`size-3`,"aria-hidden":`true`}),t[39]=f,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,I.jsx)(c,{asChild:!0,children:(0,I.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==h||t[46]!==L||t[47]!==s?(Y=h(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=h,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,I.jsx)(l,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,I.jsxs)(u,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,I.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===f?ue=t[58]:(ue=e=>{!e&&!f?A(!1):e&&A(!0)},t[57]=f,t[58]=ue);let de;t[59]===h?de=t[60]:(de=h({id:`a4FRQv`}),t[59]=h,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,I.jsx)(y,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,I.jsx)(v,{children:(0,I.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,I.jsxs)(S,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,I.jsx)(d,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,I.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===f?he=t[70]:(he=f?(0,I.jsx)(g,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=f,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,I.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==f||t[74]!==he?(_e=(0,I.jsxs)(x,{children:[me,(0,I.jsxs)(d,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:f,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=f,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,I.jsxs)(b,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,I.jsx)(C,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,I.jsxs)(I.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function ne(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return p._({id:`nYeBmY`,values:{hours:r}})}function re(e){let t=(0,P.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(ie),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,F.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),j()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,I.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,I.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,I.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=ne(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,I.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,I.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=A):A=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,I.jsx)(L,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let N;t[51]===M?N=t[52]:(N=(0,I.jsx)(`div`,{children:M}),t[51]=M,t[52]=N);let ee;return t[53]!==A||t[54]!==N?(ee=(0,I.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,N]}),t[53]=A,t[54]=N,t[55]=ee):ee=t[55],ee}function ie(){return Date.now()}async function R(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function z(e){typeof window>`u`||(window.location.hash=w(e))}function ae(){let e=(0,P.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(g,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,I.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,I.jsx)(`span`,{className:`text-sm`,children:(0,I.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,P.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,I.jsx)(h,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:(0,I.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,I.jsx)(a,{id:`KDw4GX`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,I.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:c}),t[5]=r,t[6]=l);let u;return t[7]!==s||t[8]!==l?(u=(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,l]}),t[7]=s,t[8]=l,t[9]=u):u=t[9],u}function se(){let e=(0,P.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,I.jsx)(`p`,{className:`text-sm italic`,children:(0,I.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,P.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,I.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,I.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,I.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,I.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,I.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,I.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,P.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(m,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,I.jsx)(c,{asChild:!0,children:(0,I.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsx)(l,{side:`bottom`,children:(0,I.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let h;return t[7]===f?h=t[8]:(h=(0,I.jsxs)(u,{children:[f,p]}),t[7]=f,t[8]=h),h}function H(e){let t=(0,P.c)(9),{lastTs:n}=e,[r]=(0,F.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(`span`,{className:`font-medium`,children:(0,I.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,I.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,I.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,I.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return p._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,P.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,I.jsx)(A,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,I.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,P.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,I.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(G,{agent:n.agent}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,I.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,I.jsx)(a,{id:`F6pfE9`}):m===null?(0,I.jsx)(a,{id:`PMyJ9C`}):(0,I.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,I.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,I.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,I.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,I.jsx)(ae,{}):r===`error`&&i?(0,I.jsx)(oe,{error:i,onRetry:s}):n===null?(0,I.jsx)(se,{}):(0,I.jsxs)(I.Fragment,{children:[!n.sessionAlive&&m!==null?(0,I.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,I.jsx)(se,{}):n.files.map(e=>(0,I.jsx)(re,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,I.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,P.c)(31),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a,onDestinationRequested:s}=i,c=a===void 0?!0:a,{_:l}=o(),{docPanelAgentId:u,closeActivityPanel:d}=r(),{openTargetTransition:p}=n(),{pageMeta:m}=E(),{data:h,status:g,error:_,reload:v}=N(u),y,b;if(t[2]!==h||t[3]!==u?(y=()=>{if(!(!h||u===null))for(let e of h.files)O(u,e.docName,e.bursts.length)},b=[h,u],t[2]=h,t[3]=u,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,F.useEffect)(y,b),u===null){let e;return t[6]!==d||t[7]!==c?(e=(0,I.jsx)(B,{onExit:d,showBackButton:c}),t[6]=d,t[7]=c,t[8]=e):e=t[8],e}let x;t[9]!==s||t[10]!==p||t[11]!==m?(x=e=>{s?.(e),p(T({kind:`doc`,target:e,docName:e},m),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=s,t[10]=p,t[11]=m,t[12]=x):x=t[12];let S=x,C;t[13]!==h||t[14]!==u?(C=(e,t)=>{if(!h?.agent||u===null)return;M();let n=e.bursts.length;k({agentId:u,agentName:h.agent.displayName,agentColor:h.agent.color,agentIcon:h.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[13]=h,t[14]=u,t[15]=C):C=t[15];let w=C,D;t[16]!==l||t[17]!==h||t[18]!==u||t[19]!==v?(D=async(e,t)=>{if(!(t<=0))try{await R({connectionId:u,docName:e,scope:`count`,count:t,agentName:h?.agent?.displayName}),f.success(l(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),v()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);f.error(l({id:`EqrC_R`,values:{message:n}})),v()}},t[16]=l,t[17]=h,t[18]=u,t[19]=v,t[20]=D):D=t[20];let A=D,j;return t[21]!==d||t[22]!==h||t[23]!==_||t[24]!==S||t[25]!==w||t[26]!==A||t[27]!==v||t[28]!==c||t[29]!==g?(j=(0,I.jsx)(ce,{data:h,status:g,error:_,reload:v,onExit:d,onNavigate:S,onUndoDrop:A,onSetVersion:w,showBackButton:c}),t[21]=d,t[22]=h,t[23]=_,t[24]=S,t[25]=w,t[26]=A,t[27]=v,t[28]=c,t[29]=g,t[30]=j):j=t[30],j}export{K as ActivityModeContent};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-CxRsF0t3.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{i as c,n as l,t as u}from"./tooltip-Bz6z4_se.js";import{t as d}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{t as p}from"./dist-C_FzPxEX2.js";import{f as m}from"./Mermaid-DEkpWJB8.js";import{t as h}from"./circle-alert-eBm4JPxY.js";import{t as g}from"./spinner-Bx8xD6f8.js";import{t as _}from"./undo-2-xEF_s_Io.js";import{a as v,c as y,i as b,o as x,s as S,t as C}from"./dialog-BJEjKJjL.js";import{l as w}from"./doc-hash-BJkweiX9.js";import{s as T}from"./navigation-targets-wIVrXum1.js";import{r as E}from"./PageListContext-BpuGcUaJ.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-B_PHpjoM.js";import{t as M}from"./timeline-diff-store-COsBPeIl.js";import{n as N}from"./use-activity-panel-usWxv2Jb.js";var P=s(),F=e(i(),1),I=t();function ee(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function L(e){let t=(0,P.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:f,onOpenDiff:p,onRestore:m}=e,{_:h}=o(),[w,T]=(0,F.useState)(te),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,F.useEffect)(E,O);let[k,A]=(0,F.useState)(!1),j=D(),M=n.stackIndex+1,N=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||f||L<=0,re;t[2]!==L||t[3]!==m?(re=function(){A(!1),m(L)},t[2]=L,t[3]=m,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==p?(R=()=>p(n),t[5]=n,t[6]=p,t[7]=R):R=t[7];let z;t[8]!==h||t[9]!==M||t[10]!==r?(z=h({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=h,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=N?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=ee(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,I.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,I.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,I.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,I.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==N||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,I.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":N,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=N,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==h||t[35]!==M||t[36]!==r?(K=h({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=h,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===f?q=t[40]:(q=f?(0,I.jsx)(g,{className:`size-3`,"aria-hidden":`true`}):(0,I.jsx)(_,{className:`size-3`,"aria-hidden":`true`}),t[39]=f,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,I.jsx)(c,{asChild:!0,children:(0,I.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==h||t[46]!==L||t[47]!==s?(Y=h(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=h,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,I.jsx)(l,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,I.jsxs)(u,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,I.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===f?ue=t[58]:(ue=e=>{!e&&!f?A(!1):e&&A(!0)},t[57]=f,t[58]=ue);let de;t[59]===h?de=t[60]:(de=h({id:`a4FRQv`}),t[59]=h,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,I.jsx)(y,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,I.jsx)(v,{children:(0,I.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,I.jsxs)(S,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,I.jsx)(d,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,I.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===f?he=t[70]:(he=f?(0,I.jsx)(g,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=f,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,I.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==f||t[74]!==he?(_e=(0,I.jsxs)(x,{children:[me,(0,I.jsxs)(d,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:f,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=f,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,I.jsxs)(b,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,I.jsx)(C,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,I.jsxs)(I.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function ne(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return p._({id:`nYeBmY`,values:{hours:r}})}function re(e){let t=(0,P.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(ie),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,F.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),j()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,I.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,I.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,I.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=ne(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,I.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,I.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=A):A=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,I.jsx)(L,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let N;t[51]===M?N=t[52]:(N=(0,I.jsx)(`div`,{children:M}),t[51]=M,t[52]=N);let ee;return t[53]!==A||t[54]!==N?(ee=(0,I.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,N]}),t[53]=A,t[54]=N,t[55]=ee):ee=t[55],ee}function ie(){return Date.now()}async function R(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function z(e){typeof window>`u`||(window.location.hash=w(e))}function ae(){let e=(0,P.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(g,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,I.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,I.jsx)(`span`,{className:`text-sm`,children:(0,I.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,P.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,I.jsx)(h,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:(0,I.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,I.jsx)(a,{id:`KDw4GX`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,I.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:c}),t[5]=r,t[6]=l);let u;return t[7]!==s||t[8]!==l?(u=(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,l]}),t[7]=s,t[8]=l,t[9]=u):u=t[9],u}function se(){let e=(0,P.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,I.jsx)(`p`,{className:`text-sm italic`,children:(0,I.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,P.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,I.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,I.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,I.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,I.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,I.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,I.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,P.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(m,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,I.jsx)(c,{asChild:!0,children:(0,I.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsx)(l,{side:`bottom`,children:(0,I.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let h;return t[7]===f?h=t[8]:(h=(0,I.jsxs)(u,{children:[f,p]}),t[7]=f,t[8]=h),h}function H(e){let t=(0,P.c)(9),{lastTs:n}=e,[r]=(0,F.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(`span`,{className:`font-medium`,children:(0,I.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,I.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,I.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,I.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return p._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return p._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return p._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,P.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,I.jsx)(A,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,I.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,P.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,I.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(G,{agent:n.agent}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,I.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,I.jsx)(a,{id:`F6pfE9`}):m===null?(0,I.jsx)(a,{id:`PMyJ9C`}):(0,I.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,I.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,I.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,I.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,I.jsx)(ae,{}):r===`error`&&i?(0,I.jsx)(oe,{error:i,onRetry:s}):n===null?(0,I.jsx)(se,{}):(0,I.jsxs)(I.Fragment,{children:[!n.sessionAlive&&m!==null?(0,I.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,I.jsx)(se,{}):n.files.map(e=>(0,I.jsx)(re,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,I.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,P.c)(31),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a,onDestinationRequested:s}=i,c=a===void 0?!0:a,{_:l}=o(),{docPanelAgentId:u,closeActivityPanel:d}=r(),{openTargetTransition:p}=n(),{pageMeta:m}=E(),{data:h,status:g,error:_,reload:v}=N(u),y,b;if(t[2]!==h||t[3]!==u?(y=()=>{if(!(!h||u===null))for(let e of h.files)O(u,e.docName,e.bursts.length)},b=[h,u],t[2]=h,t[3]=u,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,F.useEffect)(y,b),u===null){let e;return t[6]!==d||t[7]!==c?(e=(0,I.jsx)(B,{onExit:d,showBackButton:c}),t[6]=d,t[7]=c,t[8]=e):e=t[8],e}let x;t[9]!==s||t[10]!==p||t[11]!==m?(x=e=>{s?.(e),p(T({kind:`doc`,target:e,docName:e},m),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=s,t[10]=p,t[11]=m,t[12]=x):x=t[12];let S=x,C;t[13]!==h||t[14]!==u?(C=(e,t)=>{if(!h?.agent||u===null)return;M();let n=e.bursts.length;k({agentId:u,agentName:h.agent.displayName,agentColor:h.agent.color,agentIcon:h.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[13]=h,t[14]=u,t[15]=C):C=t[15];let w=C,D;t[16]!==l||t[17]!==h||t[18]!==u||t[19]!==v?(D=async(e,t)=>{if(!(t<=0))try{await R({connectionId:u,docName:e,scope:`count`,count:t,agentName:h?.agent?.displayName}),f.success(l(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),v()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);f.error(l({id:`EqrC_R`,values:{message:n}})),v()}},t[16]=l,t[17]=h,t[18]=u,t[19]=v,t[20]=D):D=t[20];let A=D,j;return t[21]!==d||t[22]!==h||t[23]!==_||t[24]!==S||t[25]!==w||t[26]!==A||t[27]!==v||t[28]!==c||t[29]!==g?(j=(0,I.jsx)(ce,{data:h,status:g,error:_,reload:v,onExit:d,onNavigate:S,onUndoDrop:A,onSetVersion:w,showBackButton:c}),t[21]=d,t[22]=h,t[23]=_,t[24]=S,t[25]=w,t[26]=A,t[27]=v,t[28]=c,t[29]=g,t[30]=j):j=t[30],j}export{K as ActivityModeContent};
|