@inkeep/open-knowledge 0.82.0-beta.3 → 0.82.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +70 -70
- package/dist/constants-ChfpQjIj.mjs +1 -0
- package/dist/{dist-TAcrANM7.mjs → dist-BKMK4uhh.mjs} +496 -496
- package/dist/dist-DX-OB6FC.mjs +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +15 -15
- package/dist/{init-DQVtFZSr.mjs → init-Bvmrrn6M.mjs} +63 -63
- package/dist/init-kMgqplOQ.mjs +1 -0
- package/dist/{launch-json-removal-C5wtVwU_.mjs → launch-json-removal-DGgpI_Jz.mjs} +1 -1
- package/dist/loader-DgBlR4_N.mjs +1 -0
- package/dist/{loader-XJNah9bm.mjs → loader-DyhgFxyu.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-D77IwxHB.mjs → md-manager-BGnqyqi1-CnT_8Ivp.mjs} +2 -2
- package/dist/{open-browser-CJaJbExe.mjs → open-browser-CuuJWVs1.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-3fHrsz6g.mjs +1 -0
- package/dist/{preview-DFRLvckr.mjs → preview-CS-ZP7yP.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-BqpVsK8l.js → ActivityModeContent-CVkgwfSl.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CAW5QCX8.js → AddPropertiesButton-D16oCS_N.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-Bg5A5RO2.js → AgentDiffPane-HH8jeegf.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-18BD6ihn.js → AgentThreadClientBinder-BeRtMFJl.js} +1 -1
- package/dist/public/assets/{BugReportHistory-C2kxTgHh.js → BugReportHistory-B-6LLHxx.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DgtiL-NP.js → BugReportHistoryDialog-CNK92-ge.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-lnPRDMaW.js → CodeMirrorPropInput-DF3sY_TW.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-CD7KM28d.js → ConsentDialogBody-c59kzsDd.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-C1zIx9Bd.js → DeleteConfirmationDialog-CW-EDwBk.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DGNf5H84.js → DiffViewBoundary-BCeCuRF4.js} +1 -1
- package/dist/public/assets/{DocumentContext-CiI7-kAU.js → DocumentContext-Be48_bAF.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-BJidPutF.js → EditorModeToggle-DtMDf2MQ.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-BL56x7EQ.js → ExcalidrawDocEditor-BJ2A3QGa.js} +1 -1
- package/dist/public/assets/FeedbackForm-Ap-gvcmO.js +1 -0
- package/dist/public/assets/{GraphPanel-nDzxbZwr.js → GraphPanel-BCNpJurX.js} +1 -1
- package/dist/public/assets/{ImageAttachments-Dob2zdX6.js → ImageAttachments-DaSjleMs.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-UbeDdBTn.js → ImportSkillDialog-BldGupBv.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BY8qPMlW.js → LintConfigEditor-DnD5pFzI.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BsdnBIW1.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-B4Mp4oZQ.js → ManagedArtifactProperties-BtTz8dwV.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DJeha_H0.js → MermaidDocEditor-CkwkPZvu.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-BMo7aLCS.js → OpenInAgentMenuItem-tMDoc20x.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-D9_d1KsK.js → PropertyDisplayRow-FgvNazvo.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DbL9sShX.js → RegisteredAgentIcon-XDCjRE4q.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DEETk9Jo.js → ReportBugDialogBody-bsGBQfHH.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-B1WREGjA.js → ReportBugMenuTrigger-BAbnNfBU.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DAagpi8v.js → SchemaConfigEditor-BU8wFtDN.js} +1 -1
- package/dist/public/assets/{SessionsHost-mg9fx7DH.js → SessionsHost-BdpjIit2.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DwNVEA39.js → SettingsDialogBody-DmPhthSq.js} +1 -1
- package/dist/public/assets/ShareBranchSwitchDialog-CPn3XsGL.js +1 -0
- package/dist/public/assets/{ShareReceiveDialog-BKgD7Duc.js → ShareReceiveDialog-CavmNNtc.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DShK8007.js → ShareReceiveMissDialog-C6Yv1L_L.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CmCcSYjJ.js → SkillCostValue-CxnOdbgc.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DFdS9BhL.js → SkillEditBanner-DFTQUggR.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-D5Aha7ke.js → SkillForkDialog-Bl0Maun5.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-8-VCWJg_.js → SkillInstallMenu-BW2fj8iT.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DPQ0UfdG.js → SkillOriginInline-Bo9-sZlU.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Ca_jnifx.js → SkillToolbarControls-xd9ybWt3.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-8Tu4pV-S.js → SlidesToolbarControls-CDqPA4DN.js} +1 -1
- package/dist/public/assets/{SourceEditor-CyVTEVVa.js → SourceEditor-xUkiBN-x.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CRsuOziY.js → SyncStatusBadge-CMEBaJDA.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Db-Lo-iL.js → TerminalPanel-BAdFCbjj.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Dv3QBZej.js → TerminalWindowApp-D8Gswz-L.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CLZRQrgg.js → TextDocEditor-CjRA_0cY.js} +1 -1
- package/dist/public/assets/{ThreadView-DGLAO83T.js → ThreadView-CKZltO5Y.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-ErzMzIn_.js → TimelineDiffPane-BxiAJgWC.js} +1 -1
- package/dist/public/assets/{agent-connections-iuaYc-Gk.js → agent-connections-B2xlqiAt.js} +1 -1
- package/dist/public/assets/{auth-state-cache-Bz3EsxBR.js → auth-state-cache-DkvW2mTJ.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-0DIkaLj0.js → bug-report-send-manager-Ep6NupAy.js} +1 -1
- package/dist/public/assets/{client-version-DJFCNOKL.js → client-version-aG92qoP2.js} +1 -1
- package/dist/public/assets/{comment-chips-u8dnjbXP.js → comment-chips-C8z94Yh3.js} +1 -1
- package/dist/public/assets/{config-provider-krmD4VSt.js → config-provider-myFxAeZJ.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-oO6GoCcb.js → css-color-to-hex-B1w0Vq2i.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-DK-Cqae0.js → diagnostic-breadcrumb-YcMRmDMq.js} +1 -1
- package/dist/public/assets/{dist-CUgbgEDy.js → dist-DmvVdMAc.js} +2 -2
- package/dist/public/assets/{doc-paths-DaHerw67.js → doc-paths-CU5xFEmw.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-Dgsedc5E.js → doc-undo-manager-Bb2wXN7B.js} +1 -1
- package/dist/public/assets/{documents-events-AGLgPGQa.js → documents-events-DChefUoE.js} +1 -1
- package/dist/public/assets/{file-tree-adapter--GNP_kR2.js → file-tree-adapter-CrwKZd5V.js} +1 -1
- package/dist/public/assets/{file-tree-utils-lPpxK5Yq.js → file-tree-utils-B-KHAA0w.js} +1 -1
- package/dist/public/assets/{folder-config-api-DDOXhGdo.js → folder-config-api-y_2lDcJg.js} +1 -1
- package/dist/public/assets/{index-7RGg47Tt.js → index-Xs-rHCdv.js} +8 -8
- package/dist/public/assets/{lint-config-client-B_xNfTBy.js → lint-config-client-kGMpwF3X.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DzjG_qoM.js → markdownlint-rule-browser-BZlDsCDj.js} +1 -1
- package/dist/public/assets/{messages-DCLxtq5E.js → messages-15pqM65e.js} +1 -1
- package/dist/public/assets/{messages-s1kQ0F_h.js → messages-9WOa9KUm.js} +1 -1
- package/dist/public/assets/{messages-AFVdD964.js → messages-B_Wv5APO.js} +1 -1
- package/dist/public/assets/{messages-BcWRA-nI.js → messages-C7pSlTmA.js} +1 -1
- package/dist/public/assets/{messages-CbN1r9yA.js → messages-CAYad86H.js} +1 -1
- package/dist/public/assets/{messages-OBzrmAFm.js → messages-CQ1vIgoS.js} +1 -1
- package/dist/public/assets/{messages-C0Gd4qNa.js → messages-CciFZ7sP.js} +1 -1
- package/dist/public/assets/messages-CibA1WyZ.js +1 -0
- package/dist/public/assets/{messages-DM9zlCjV.js → messages-Dd9VKFx-.js} +1 -1
- package/dist/public/assets/{messages-BCP_tUaH.js → messages-DsNN544W.js} +1 -1
- package/dist/public/assets/{messages-hoIRV_jf.js → messages-KKn5PQmE.js} +1 -1
- package/dist/public/assets/{messages-C2ZTIk86.js → messages-WxVoyVTt.js} +1 -1
- package/dist/public/assets/{messages-l5K8pww3.js → messages-spfa9ZpO.js} +1 -1
- package/dist/public/assets/{navigation-targets-DV1dMVAb.js → navigation-targets-BX0D_UPk.js} +1 -1
- package/dist/public/assets/{page-list-cache-BaKlIcC-.js → page-list-cache-DRXLxcuB.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DPCjeW6k.js → pending-receive-nav-store-C6LJ2Kzv.js} +1 -1
- package/dist/public/assets/{preferred-session-events-CeCXvWmc.js → preferred-session-events-B7RLIJvY.js} +1 -1
- package/dist/public/assets/{progress-Ft463XK1.js → progress-Dutcigeg.js} +1 -1
- package/dist/public/assets/{project-paths-Cs2SPmYR.js → project-paths-Rt7fORWq.js} +1 -1
- package/dist/public/assets/{prop-types-Dv_cZRA5.js → prop-types-B2w_fFJW.js} +1 -1
- package/dist/public/assets/{receive-store-CvglCO2B.js → receive-store-VACJKx3F.js} +1 -1
- package/dist/public/assets/{selection-context-Bk3yAvWZ.js → selection-context-Cq2VCQBg.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-BigKQgqQ.js → sign-in-terminal-events-DXTC0inU.js} +1 -1
- package/dist/public/assets/{skill-scope-BGcfBWlz.js → skill-scope-DX2Q9lzh.js} +1 -1
- package/dist/public/assets/{skills-api-mYKB0zDh.js → skills-api-Cpwwq_FO.js} +1 -1
- package/dist/public/assets/{src-XXqnTiU6.js → src-CGPFfpcu.js} +1 -1
- package/dist/public/assets/{startup-marks-yQqTMBm5.js → startup-marks-CJJqLRKP.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BQLv6DZ1.js → tag-pill-input-DLQqKzbN.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BIFEl4OT.js → target-navigation-intent-BwAGdOsi.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DyEWsvUO.js → telemetry-startup-CMJw54MN.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CoTkNESn.js → terminal-command-events-CoI7bIgQ.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BBjjknBw.js → terminal-launch-events-BMFqKHQ8.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CGR3Wr8L.js → terminal-telemetry-C0nwSvRH.js} +1 -1
- package/dist/public/assets/{thread-client-V2_Sw10t.js → thread-client-2zOGI06i.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BuHBn_6z.js → typing-burst-detector-SGbZpXed.js} +1 -1
- package/dist/public/assets/{uninstall-D_93vcTI.js → uninstall-Bqv6A4OL.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DwWmPc8H.js → use-activity-panel-D3mCupUz.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-COH3Pg2u.js → use-apply-config-language--jTlcFWU.js} +2 -2
- package/dist/public/assets/{use-collab-url-D3j3svaH.js → use-collab-url-Bs4wUHQ8.js} +1 -1
- package/dist/public/assets/{use-conflicts-8sSRJ_Uy.js → use-conflicts-Due_s21R.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-CBlTkWfK.js → use-git-sync-status-CLv7EZOq.js} +1 -1
- package/dist/public/assets/{use-installed-clis-ClKL7RtP.js → use-installed-clis-L2RDjEtc.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-bJiLIpxd.js → use-live-xterm-theme-XZgq5LKh.js} +1 -1
- package/dist/public/assets/{use-open-skill-H_tjyNt-.js → use-open-skill-DV5hhMVO.js} +1 -1
- package/dist/public/assets/{use-settings-route-DL25HSeL.js → use-settings-route-DI6YfB7r.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Cts8svd2.js → use-skill-origin-ChIkNH5y.js} +1 -1
- package/dist/public/assets/{use-skills-DXlhkRBq.js → use-skills-B1b-aZeu.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BXYM2yvn.js → use-terminal-enabled-Djcq-lbC.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-8pKiL5Sa.js → use-timeline-entry-diff-BGpMCJkj.js} +1 -1
- package/dist/public/assets/{use-workspace-DtyUPSZ4.js → use-workspace-Byr5yIN5.js} +1 -1
- package/dist/public/index.html +60 -60
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-C8t0beB6.mjs → registry-probes-BqQhP0ax.mjs} +8 -8
- package/dist/{removal-file-path-vGqtuN6p.mjs → removal-file-path-BeRPeEws.mjs} +1 -1
- package/dist/{repair-launch-json-C2M3QJCU.mjs → repair-launch-json-CzMEUN6E.mjs} +1 -1
- package/dist/{repair-mcp-configs-DV7hcTRV.mjs → repair-mcp-configs-DiEzfN1-.mjs} +1 -1
- package/dist/src-C_P2wuNq.mjs +1 -0
- package/dist/src-DwoFHSWS.mjs +11 -0
- package/dist/start-Ct8veQKD.mjs +1 -0
- package/dist/start-jgWvvxuy.mjs +5 -0
- package/package.json +4 -4
- package/dist/constants-BZCC7yS1.mjs +0 -1
- package/dist/dist-DttP19KX.mjs +0 -1
- package/dist/init-D6Fi9suH.mjs +0 -1
- package/dist/loader-DeHi6YRp.mjs +0 -1
- package/dist/preview-y_qYI633.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DQYT8_7L.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-s6BAlOXR.js +0 -1
- package/dist/public/assets/ShareBranchSwitchDialog-DpxzT0qX.js +0 -1
- package/dist/public/assets/messages-fT_Mlcyb.js +0 -1
- package/dist/src-B4ZXvtQf.mjs +0 -1
- package/dist/src-D1k-b-_e.mjs +0 -11
- package/dist/start-C-MwllNx.mjs +0 -1
- package/dist/start-t8aEZijL.mjs +0 -5
|
@@ -515,7 +515,7 @@ $2`).split(`
|
|
|
515
515
|
`)}function Z2(e,t,n,r,i,a,o){if(e.kind===`lines`)return q2(e.startLine,e.endLine,n);if(e.kind===`anchor`)return K2(e.markdown,n);let s=G2(e.markdown);return S2(X2(t,``,s,r,i),a,o)<=C2(o,y2)?s:K2(e.markdown,n)}function Q2(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=s2(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=Z2(t,s,o,n,r,i,a);return X2(s,z2(e.instruction,i,e=>X2(s,e,c,n,r),a),c,n,r)}function $2(e){let{target:t}=e,n=e.autoOpen?U2:``,r=J2(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return Q2(e,e.selection,r,n);let i=Y2(e);return X2(i,z2(e.instruction,t,e=>X2(i,e,``,r,n),e.transport??`url`),``,r,n)}function e4(e){let t=s2(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,W2(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=O2(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
|
|
516
516
|
`)}function t4(e){if(e===null)return[`Fix every problem across this project's documents using OpenKnowledge.`,``,"Run the `audit` tool for the current list of lint violations and broken links, then work file by file — the `lint` tool with `fix: true` clears one document's mechanically-fixable problems at a time — and re-audit until it reports no problems."].join(`
|
|
517
517
|
`);let t=s2(e);return[`Fix every problem in @${t} using OpenKnowledge.`,``,`Run the \`audit\` tool scoped to it for the current list of lint violations and broken links, then fix each one — the \`lint\` tool with \`fix: true\` clears the mechanically-fixable ones — and re-audit @${t} until it reports no problems.`].join(`
|
|
518
|
-
`)}function n4(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}}var r4=new Set([`opencode.json`]),i4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function a4(e){return i4.test(e)}function o4(e){return a4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:r4.has(e.slice(e.lastIndexOf(`/`)+1))}function s4(e,t){let n=n4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var c4=M().superRefine(s4).optional(),l4=M().superRefine(s4),u4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},d4=M().optional(),f4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,p4=F(M().min(1)).max(50),m4=R([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),h4=I({label:M().min(1),webUrl:ha().nullable()}).loose(),g4=Ka(`checkStatus`,[I({checkStatus:z(`allowed`)}).loose(),I({checkStatus:z(`denied`),deniedReason:R([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:z(`unknown`),unknownError:R([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),_4=R([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),v4=R(_p),y4=R([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);I({state:m4,lastSyncUtc:M().nullable(),lastRunUtc:M().nullable().optional(),lastPullOkUtc:M().nullable().optional(),lastPushOkUtc:M().nullable().optional(),lastFetchUtc:M().nullable(),lastPushedSha:M().nullable(),ahead:N().int().min(0),behind:N().int().min(0),consecutiveFailures:N().int().min(0),consecutivePushFailures:N().int().min(0).optional(),conflictCount:N().int().min(0),hasRemote:P(),syncEnabled:P(),identityUnresolved:P(),remote:h4.nullable().optional(),pushError:M().optional(),pushErrorCode:_4.optional(),pullError:M().optional(),pullErrorCode:_4.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),refusedSymlinkPaths:p4.optional(),pushPermission:g4.optional(),syncMode:v4.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:y4.nullable().optional()}).loose(),I({action:R([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),I({action:R([`commit`])}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`])}).loose();var b4=R([`merge-native`,`working-tree`,`reconcile`]),x4=R([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),S4=R([`mine`,`theirs`,`content`,`delete`]),C4=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:b4,reason:x4.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose();I({file:M().min(1),strategy:R([`mine`,`theirs`,`content`,`delete`]),content:M().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`]}),I({}).loose();var w4=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:R([`both-modified`,`delete-modify`,`modify-delete`]),conflict:b4,reason:x4.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),resolutionOptions:F(S4)}).loose();I({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),I({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),I({result:_o(e=>e!==void 0,{message:`result is required`})}).loose(),I({packId:M().min(1)}).strict(),I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict();var T4=I({path:M().min(1),summary:M().min(1)}).loose(),E4=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose();I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(T4),entryCounts:E4}).loose())}).loose(),I({noOpen:P().optional(),out:M().min(1).optional()}).loose();var D4=I({reason:R([`unsupported-platform`,`spawn-error`]),message:M()}).loose();Ka(`status`,[I({status:z(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:z(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:D4.optional()}).loose(),I({status:z(`failed`),buildError:M()}).loose(),I({status:z(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),Ka(`kind`,[I({kind:z(`doc`),docPath:M().min(1)}).loose(),I({kind:z(`folder`),folderPath:M()}).loose()]);var O4=R([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),k4=R([`current`,`stale`,`absent`,`empty`]),A4=Ka(`ok`,[I({ok:z(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:k4.optional().catch(void 0)}).loose(),I({ok:z(!1),error:O4,branch:M().min(1).optional()}).loose()]),j4=R([`user`,`org`]),M4=I({login:M().min(1),kind:j4,avatarUrl:M().optional()}).loose(),N4=R([`auth-required`,`network`]),P4=Ka(`ok`,[I({ok:z(!0),owners:F(M4)}).loose(),I({ok:z(!1),error:N4}).loose()]),F4=Ka(`ok`,[I({ok:z(!0),available:P()}).loose(),I({ok:z(!1),error:N4}).loose()]),I4=R([`public`,`private`]);I({owner:M().min(1),name:M().min(1),visibility:I4,description:M().optional()}).loose();var L4=R([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),R4=Ka(`ok`,[I({ok:z(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:z(!1),error:L4}).loose()]);function z4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var B4=e=>e.refine(z4,`invalid branch name`),V4={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()};Ka(`detached`,[I({detached:z(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Ia(),...V4}).loose(),I({detached:z(!0),currentBranch:Ia(),currentHeadSha:M().min(1),...V4}).loose()]),I({branch:B4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose();var moe=R([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Ka(`ok`,[I({ok:z(!0)}).loose(),I({ok:z(!1),reason:moe,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional(),refusedSymlinkPaths:p4.optional()}).loose()]),R([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),I({branch:B4(M().min(1)),path:M(),kind:R([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),Ka(`verdict`,[I({verdict:z(`on-origin`)}).loose(),I({verdict:z(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:z(`deleted`)}).loose(),I({verdict:z(`never-on-branch`)}).loose(),I({verdict:z(`changed-locally`)}).loose(),I({verdict:z(`unknown`)}).loose()]).catch({verdict:`unknown`});var hoe=I({startedAt:M().min(1),httpListenMs:N().nonnegative().optional(),seedWalkMs:N().nonnegative().optional(),indexesMs:N().nonnegative().optional(),readyMs:N().nonnegative().optional(),fileCount:N().nonnegative().optional()}),goe=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:Ja(M().min(1),M().min(1)).optional(),boot:hoe.optional(),collabClients:N().int().nonnegative().optional()}).loose(),_oe=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:R([`git-config`,`synthesized`]),created_at:M().min(1)}).loose();I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose();var H4=R(`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: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:doc-removed.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(`.`)),U4=I({type:H4,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(f4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose();I({parentDocName:M().min(1),placement:R([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose();var voe=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose();I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(z4,`invalid branch name`).optional()}).loose(),I({type:z(`error`),problem:U4}).loose();function yoe(e){let t=e??(typeof navigator>`u`?void 0:navigator);return t===void 0?[]:t.languages!==void 0&&t.languages.length>0?Wh(t.languages):t.language===void 0?[]:Wh([t.language])}var boe={en:`ltr`,"zh-Hans":`ltr`,"zh-Hant":`ltr`,hi:`ltr`,es:`ltr`,ar:`rtl`,fr:`ltr`,bn:`ltr`,"pt-BR":`ltr`,id:`ltr`,ur:`rtl`,ko:`ltr`,pl:`ltr`};function xoe(e){let t=new Intl.Locale(e).getTextInfo?.().direction;return t===`rtl`||t===`ltr`?t:boe[e]}function W4(e,t){let n=t.map(e=>[Gh(e),e]);for(let t of e){let e=Gh(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function Soe(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=W4([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=W4(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}var Coe=`extra/screenshot.png`,woe=`extra/attachments/`,Toe=3145728,Eoe=[`image/png`,`image/jpeg`,`image/webp`],Doe={"image/png":`png`,"image/jpeg":`jpg`,"image/webp":`webp`};function Ooe(e){return e.startsWith(woe)}var koe=`extra/agent-chat/`;function Aoe(e){return e.startsWith(koe)}var joe=`extra/`;function Moe(e){return!e.startsWith(joe)||!e.endsWith(`.dmp`)?!1:!e.slice(6).includes(`/`)}function G4(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}var Noe=8,K4=`eyJ`;function Poe(e){if(!e.includes(K4))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(G4(e.charCodeAt(r))){for(t.push(r);r<e.length&&G4(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(K4);t!==-1;t=e.indexOf(K4,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(K4,d)||f-d<11||p<Noe)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}var Foe=/(?:\b|(?<=(?:\[|\u009b)[0-?]*[ -/]*[@-~]))/.source;function q4(e){return RegExp(`${Foe}${e.source}`,`g`)}var J4=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:q4(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:q4(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:Poe},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:q4(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:q4(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}];J4.map(e=>e.name);function Ioe(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
518
|
+
`)}function n4(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}}var r4=new Set([`opencode.json`]),i4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function a4(e){return i4.test(e)}function o4(e){return a4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:r4.has(e.slice(e.lastIndexOf(`/`)+1))}function s4(e,t){let n=n4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var c4=M().superRefine(s4).optional(),l4=M().superRefine(s4),u4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},d4=M().optional(),f4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,p4=F(M().min(1)).max(50),m4=R([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),h4=I({label:M().min(1),webUrl:ha().nullable()}).loose(),g4=Ka(`checkStatus`,[I({checkStatus:z(`allowed`)}).loose(),I({checkStatus:z(`denied`),deniedReason:R([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:z(`unknown`),unknownError:R([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),_4=R([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),v4=R(_p),y4=R([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);I({state:m4,lastSyncUtc:M().nullable(),lastRunUtc:M().nullable().optional(),lastPullOkUtc:M().nullable().optional(),lastPushOkUtc:M().nullable().optional(),lastFetchUtc:M().nullable(),lastPushedSha:M().nullable(),ahead:N().int().min(0),behind:N().int().min(0),consecutiveFailures:N().int().min(0),consecutivePushFailures:N().int().min(0).optional(),conflictCount:N().int().min(0),hasRemote:P(),syncEnabled:P(),identityUnresolved:P(),remote:h4.nullable().optional(),pushError:M().optional(),pushErrorCode:_4.optional(),pullError:M().optional(),pullErrorCode:_4.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),refusedSymlinkPaths:p4.optional(),pushPermission:g4.optional(),syncMode:v4.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:y4.nullable().optional()}).loose(),I({action:R([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),I({action:R([`commit`])}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`])}).loose();var b4=R([`merge-native`,`working-tree`,`reconcile`]),x4=R([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),S4=R([`mine`,`theirs`,`content`,`delete`]),C4=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:b4,reason:x4.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose();I({file:M().min(1),strategy:R([`mine`,`theirs`,`content`,`delete`]),content:M().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`]}),I({}).loose();var w4=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:R([`both-modified`,`delete-modify`,`modify-delete`]),conflict:b4,reason:x4.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),resolutionOptions:F(S4)}).loose();I({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),I({plan:_o(e=>e!==void 0,{message:`plan is required`})}).loose(),I({result:_o(e=>e!==void 0,{message:`result is required`})}).loose(),I({packId:M().min(1)}).strict(),I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict();var T4=I({path:M().min(1),summary:M().min(1)}).loose(),E4=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose();I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(T4),entryCounts:E4}).loose())}).loose(),I({noOpen:P().optional(),out:M().min(1).optional()}).loose();var D4=I({reason:R([`unsupported-platform`,`spawn-error`]),message:M()}).loose();Ka(`status`,[I({status:z(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:z(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:D4.optional()}).loose(),I({status:z(`failed`),buildError:M()}).loose(),I({status:z(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),Ka(`kind`,[I({kind:z(`doc`),docPath:M().min(1)}).loose(),I({kind:z(`folder`),folderPath:M()}).loose()]);var O4=R([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),k4=R([`current`,`stale`,`absent`,`empty`]),A4=Ka(`ok`,[I({ok:z(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:k4.optional().catch(void 0)}).loose(),I({ok:z(!1),error:O4,branch:M().min(1).optional()}).loose()]),j4=R([`user`,`org`]),M4=I({login:M().min(1),kind:j4,avatarUrl:M().optional()}).loose(),N4=R([`auth-required`,`network`]),P4=Ka(`ok`,[I({ok:z(!0),owners:F(M4)}).loose(),I({ok:z(!1),error:N4}).loose()]),F4=Ka(`ok`,[I({ok:z(!0),available:P()}).loose(),I({ok:z(!1),error:N4}).loose()]),I4=R([`public`,`private`]);I({owner:M().min(1),name:M().min(1),visibility:I4,description:M().optional()}).loose();var L4=R([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),R4=Ka(`ok`,[I({ok:z(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:z(!1),error:L4}).loose()]);function z4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var B4=e=>e.refine(z4,`invalid branch name`),V4={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()};Ka(`detached`,[I({detached:z(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Ia(),...V4}).loose(),I({detached:z(!0),currentBranch:Ia(),currentHeadSha:M().min(1),...V4}).loose()]),I({branch:B4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose();var moe=R([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Ka(`ok`,[I({ok:z(!0)}).loose(),I({ok:z(!1),reason:moe,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional(),refusedSymlinkPaths:p4.optional()}).loose()]),R([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),I({branch:B4(M().min(1)),path:M(),kind:R([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),Ka(`verdict`,[I({verdict:z(`on-origin`)}).loose(),I({verdict:z(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:z(`deleted`)}).loose(),I({verdict:z(`never-on-branch`)}).loose(),I({verdict:z(`changed-locally`)}).loose(),I({verdict:z(`unknown`)}).loose()]).catch({verdict:`unknown`});var hoe=I({startedAt:M().min(1),httpListenMs:N().nonnegative().optional(),seedWalkMs:N().nonnegative().optional(),indexesMs:N().nonnegative().optional(),readyMs:N().nonnegative().optional(),fileCount:N().nonnegative().optional()}),goe=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:Ja(M().min(1),M().min(1)).optional(),boot:hoe.optional(),collabClients:N().int().nonnegative().optional()}).loose(),_oe=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:R([`git-config`,`synthesized`]),created_at:M().min(1)}).loose();I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose();var H4=R(`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:doc-removed.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(`.`)),U4=I({type:H4,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(f4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose();I({parentDocName:M().min(1),placement:R([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose();var voe=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose();I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(z4,`invalid branch name`).optional()}).loose(),I({type:z(`error`),problem:U4}).loose();function yoe(e){let t=e??(typeof navigator>`u`?void 0:navigator);return t===void 0?[]:t.languages!==void 0&&t.languages.length>0?Wh(t.languages):t.language===void 0?[]:Wh([t.language])}var boe={en:`ltr`,"zh-Hans":`ltr`,"zh-Hant":`ltr`,hi:`ltr`,es:`ltr`,ar:`rtl`,fr:`ltr`,bn:`ltr`,"pt-BR":`ltr`,id:`ltr`,ur:`rtl`,ko:`ltr`,pl:`ltr`};function xoe(e){let t=new Intl.Locale(e).getTextInfo?.().direction;return t===`rtl`||t===`ltr`?t:boe[e]}function W4(e,t){let n=t.map(e=>[Gh(e),e]);for(let t of e){let e=Gh(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function Soe(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=W4([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=W4(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}var Coe=`extra/screenshot.png`,woe=`extra/attachments/`,Toe=3145728,Eoe=[`image/png`,`image/jpeg`,`image/webp`],Doe={"image/png":`png`,"image/jpeg":`jpg`,"image/webp":`webp`};function Ooe(e){return e.startsWith(woe)}var koe=`extra/agent-chat/`;function Aoe(e){return e.startsWith(koe)}var joe=`extra/`;function Moe(e){return!e.startsWith(joe)||!e.endsWith(`.dmp`)?!1:!e.slice(6).includes(`/`)}function G4(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}var Noe=8,K4=`eyJ`;function Poe(e){if(!e.includes(K4))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(G4(e.charCodeAt(r))){for(t.push(r);r<e.length&&G4(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(K4);t!==-1;t=e.indexOf(K4,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(K4,d)||f-d<11||p<Noe)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}var Foe=/(?:\b|(?<=(?:\[|\u009b)[0-?]*[ -/]*[@-~]))/.source;function q4(e){return RegExp(`${Foe}${e.source}`,`g`)}var J4=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:q4(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:q4(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:Poe},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:q4(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:q4(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}];J4.map(e=>e.name);function Ioe(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
519
519
|
`).map(e=>{let r=e,i=!1;for(let e of J4){if(`redact`in e){let n=e.redact(r);if(n===null)continue;t.add(e.name),i=!0,r=n;continue}let{name:n,regex:a,replacement:o}=e;a.lastIndex=0,a.test(r)&&(t.add(n),i=!0,a.lastIndex=0,r=r.replace(a,o))}return i&&n++,r}).join(`
|
|
520
520
|
`),patterns:[...t],lineCount:n}}function Y4(e){return Ioe(e).redacted}var X4=8192,Loe=32768,Roe=`…[truncated]`,Z4=[`level`,`time`,`pid`,`hostname`,`msg`,`name`,`runtime`,`subsystem`,`trace_id`,`span_id`,`trace_flags`];function zoe(e){let t=Y4(e).trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;for(let e of Z4)delete r[e];return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function Boe(e){return e.length<=8192?e:`${e.slice(0,8180)}${Roe}`}function Voe(e){return e.includes("`")?`~`:"`"}function Q4(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
521
521
|
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var $4=/notionvc:/i,Hoe=()=>e=>{e3(e)&&(t3(e),n3(e))};function e3(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if($4.test(e))return!0}if(t.type===`element`&&e3(t))return!0}return!1}function t3(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&t3(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
|
|
@@ -601,4 +601,4 @@ $2`).split(`
|
|
|
601
601
|
`:e.type===`html`?``:e.type===`image`?e.alt??``:`value`in e?e.value:`children`in e?e.children.map(N7).join(lme[e.type]??`
|
|
602
602
|
`):``}function ume(e){try{return N7(cme.parse(Se(e,{katex:!1}))).split(`
|
|
603
603
|
`).map(e=>e.replace(/\s+/g,` `).trim()).join(`
|
|
604
|
-
`)}catch(t){return console.warn(`[markdown-plain-text] markdown parse failed, falling back to raw text`,t),e}}for(let e of[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}]){let t=W3.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}HI(),sI(),cI(),I({intents:F(I({satisfierId:M().min(1),desired:R([`present`,`absent`])}).loose()),...u4,summary:d4}).loose();var dme=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:R([`present`,`absent`]),action:R(es),errorId:M().optional()}).loose(),fme=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),pme=I({state:M(),strictness:F(R(Xo)).optional()}).loose(),mme=I({probes:I({env:R([`desktop`,`local-web`,`remote-web`]),satisfiers:Ja(M(),pme)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),hme=I({actions:F(dme),conflicts:F(fme),withheld:F(M()),snapshot:mme}).loose();I({entries:F(I({level:R([`info`,`warn`,`error`]),message:M().max(X4),event:M().optional(),fields:Ja(M(),Ra()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),I({accepted:N().int().min(0)}).loose();var gme=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),_me=F(Ga([M(),N().int().nonnegative()])),vme=Ka(`kind`,[I({kind:z(`body`)}),I({kind:z(`property`),key:M().min(1),path:_me.default([])})]).default({kind:`body`}),yme=R([`anchored`,`orphaned`,`resolved`]),P7=I({threadId:M().min(1),docName:M().min(1),target:vme,anchor:gme.nullable(),state:yme,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),F7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),I7=I({threadId:M(),ok:z(!0)}),L7=I({threadId:M(),ok:z(!1),error:z(`not-found`)});I({threads:F(P7)}).loose();var bme=I({meta:P7,orphaned:P()}).loose(),xme=I({threadId:M()}).loose();I({meta:P7,payload:F7}).loose();var Sme=I({results:F(Ga([I7.extend({meta:P7,payload:F7}),L7]))}).loose(),Cme=I({results:F(Ga([I7.extend({meta:P7}),L7]))}).loose(),wme=I({status:M().min(1),reason:M()}).loose(),Tme=I({docName:M().min(1),content:M(),lifecycle:wme.nullable()}).loose(),R7=I({kind:R([`document`,`asset`,`folder`,`file`]).default(`document`),docName:M().min(1).optional(),docExt:M().min(1).default(`.md`),size:N().int().nonnegative(),modified:M().min(1),isSymlink:P().default(!1),canonicalDocName:M().nullable().default(null),targetPath:M().nullable().default(null),path:M().min(1).optional(),assetExt:M().min(1).optional(),mediaKind:R([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:F(M().min(1)).optional(),hasChildren:P().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Eme=I({documents:F(R7),truncated:P().optional()}).loose(),Dme=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Ome=I({docName:M().min(1),backlinks:F(Dme)}).loose(),kme=I({counts:Ja(M().min(1),N().int().nonnegative())}).loose();I({counts:Ja(M().min(1),N().int().nonnegative())}).loose();var Ame=Ka(`kind`,[I({kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:z(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),jme=I({role:M().min(1),sourceForm:M().min(1),targetKind:M().min(1),href:M(),resolvedTarget:M().nullable(),status:M().min(1),reason:M().nullable(),resolutionMethod:M().min(1),fallbackTarget:M().nullable().default(null),range:I({start:N().int().nonnegative(),end:N().int().nonnegative()}),line:N().int().nonnegative(),column:N().int().nonnegative(),definition:I({label:M(),line:N().int().nonnegative()}).nullable().default(null)}).loose(),Mme=I({docName:M().min(1),forwardLinks:F(Ame),localTargets:F(jme).optional()}).loose(),Nme=Ka(`kind`,[I({id:M().min(1),kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:z(`external`),url:M().min(1),label:M()}).loose()]),Pme=I({source:M().min(1),target:M().min(1)}).loose(),Fme=I({nodes:F(Nme),links:F(Pme)}).loose(),Ime=I({ts:N().int().min(0),url:M(),method:M(),ua:M().optional(),origin:M().optional(),referer:M().optional(),host:M().optional(),remote:M().optional(),secChUa:M().optional(),secChUaMobile:M().optional(),secChUaPlatform:M().optional(),secFetchSite:M().optional(),secFetchDest:M().optional(),secFetchMode:M().optional(),secFetchUser:M().optional()}).loose(),Lme=I({app:Ga([z(`cursor`),z(`codex`),z(`claude`),Ia()]),signals_fired:F(M())}).loose();I({entries:F(Ime),count:N().int().min(0),detection:Lme}).loose();var z7=I({path:M().min(1),code:R([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:M().min(1).optional(),syncScoped:P(),open:Ka(`kind`,[I({kind:z(`doc`),docName:M().min(1)}),I({kind:z(`asset`),path:M().min(1)})]).optional()}).loose();I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(z7),notStaged:F(z7),untracked:F(z7),incoming:F(z7),truncated:P(),readable:P().default(!0)}).loose();var Rme=R([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),zme=R([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Bme=R([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),Vme=R([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Hme=I({mergeQueue:I({position:N().int().nonnegative(),state:Rme.nullable().catch(null)}).nullable().catch(null),autoMerge:P(),mergeState:zme.nullable().catch(null),reviewDecision:Bme.nullable().catch(null),checks:Vme.nullable().catch(null)}).loose(),Ume=I({kind:R([`pull`,`issue`]),repo:M().min(1),number:N().int().positive(),title:M(),author:M().nullable(),createdAt:M(),lifecycle:R([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional(),status:Hme.optional()}).loose();I({url:M()}).loose();var Wme=Ka(`ok`,[I({ok:z(!0),preview:Ume}).loose(),I({ok:z(!1),reason:M()}).loose()]);I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:d4,...u4}).loose(),I({checkpointRef:M().min(1)}).loose();var Gme=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose();I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:R([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(Gme),checkpoint:Ra().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose();var Kme=I({contentDir:M().min(1),pathSeparator:R([`/`,`\\`]),symlinkResolved:P()}).loose();F(Ka(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:z(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:z(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var qme=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose();I({url:M()}).loose();var Jme=Ka(`ok`,[I({ok:z(!0),metadata:qme}).loose(),I({ok:z(!1),reason:M()}).loose()]),Yme=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Xme=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Zme=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose();I({deadLinks:F(I({target:M().min(1),sources:F(Zme)}).loose())}).loose(),I({target:I({docName:M().min(1),title:M(),aliases:F(M())}).loose(),mentions:F(I({source:M().min(1),excerpt:M(),offset:N().int().nonnegative()}).loose()),truncated:P()}).loose(),I({projectPath:M().min(1)}).loose();var Qme=R([`not-a-git-worktree`,`init-failed`]);Ka(`ok`,[I({ok:z(!0),projectPath:M().min(1)}).loose(),I({ok:z(!1),reason:Qme,message:M().min(1)}).loose()]),I({host:M().min(1).optional()}).loose(),I({host:M().min(1).optional(),token:M().min(1)}).loose(),I({host:M(),login:M()}).loose(),I({key:M().min(1)}).loose(),I({keyPresent:P()}).loose();var $me=R([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),ehe=Ka(`ok`,[I({ok:z(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:z(!1),endpoint:M().min(1),model:M().min(1),reason:$me,status:N().int().optional()}).loose()]);I({name:M().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:M().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),I({authenticated:P()}).loose(),I({channel:R([`login`,`gh-login`]).default(`login`)}).loose(),I({}).loose();var the=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),nhe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(the)}).loose(),rhe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),ihe=I({sessionAlive:P(),agent:rhe.nullable(),files:F(nhe)}).loose(),ahe=I({diff:M(),before:M(),after:M(),properties:X0,generatedAt:N().int().min(0)}).loose();I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose();var ohe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:R([`idle`,`writing`]),ts:N().int().min(0)}).loose();I({presence:Ja(M().min(1),ohe)}).loose();var she=I({sessionId:M().min(1),agentType:M().min(1),ts:N().int().min(0),insertedChars:N().int().min(0),deletedChars:N().int().min(0)}).loose();I({effects:F(I({"doc.name":M().min(1),entries:F(she)}).loose())}).loose(),I({decisions:F(I({ts:N().int().min(0),decision:M().min(1),kind:M().min(1),"doc.name":M().min(1),pathRole:M().min(1)}).loose())}).loose(),Ja(M().min(1),P()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),I({path:M().min(1,`path must be non-empty`)}).loose(),I({}).loose();var che=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),lhe=I({fromPath:M().min(1),toPath:M().min(1)}).loose();I({}).loose(),I({path:M().min(1),...u4,summary:d4}).loose();var uhe=I({docName:M().min(1)}).loose();I({path:M().min(1),...u4,summary:d4}).loose();var dhe=I({path:M().min(1)}).loose();I({kind:R([`file`,`folder`]),path:M().min(1),...u4,summary:d4}).loose();var fhe=I({kind:R([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),phe=I({pages:F(I({docName:M().min(1),title:M(),docExt:M().min(1),size:N().int().nonnegative(),modified:M().min(1),icon:M().min(1).max(2048).optional()}).loose())}).loose(),mhe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),hhe=I({docName:M().min(1),headings:F(mhe)}).loose(),ghe=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose();I({kind:R([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...u4,summary:d4}).loose();var _he=I({renamed:F(che),renamedAssets:F(lhe),rewrittenDocs:F(ghe).optional(),summary:n7.optional()}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...u4}).loose();var vhe=I({deletedDocNames:F(M().min(1))}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...u4,summary:d4}).loose();var yhe=I({deletedDocNames:F(M().min(1))}).loose();I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:d4,...u4}).loose(),I({restoredFrom:M().min(1),timestamp:M().min(1),summary:n7.optional(),warnings:o7.optional()}).loose();var bhe=/^#[0-9a-fA-F]{6}$/,xhe=I(Object.fromEntries(Bm.map(e=>[e,M().regex(bhe,`must be a #rrggbb hex color`)]))),B7=M().min(1).refine(Gm,{message:`must contain a non-whitespace character`}),V7=I({name:B7,author:B7.optional(),variant:R([`dark`,`light`]),palette:xhe}).loose(),She=I({name:M().min(1),scheme:V7,stem:M().min(1).optional(),extension:R([`.yaml`,`.yml`]).optional()}).loose(),Che=I({id:M().min(1),filename:M().min(1)}).loose(),whe=I({id:M().min(1),scheme:V7}).loose(),The=I({id:M().min(1),filename:M().min(1)}).loose(),Ehe=Ka(`existed`,[I({existed:z(!1)}).loose(),I({existed:z(!0),filename:M().min(1),scheme:V7}).loose()]),Dhe=I({themes:F(Ka(`ok`,[I({ok:z(!0),id:M().min(1),filename:M().min(1),scheme:V7}),I({ok:z(!1),filename:M().min(1),id:M().min(1).optional(),code:M().min(1),conflictingFilenames:F(M().min(1)).min(2).optional()})])),truncated:P()}).loose(),H7=R(Je),U7=R(Ye);function Ohe(e){return e===`agents`||Ye.includes(e)}var khe=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),Ahe=[`.md`,`.mdx`,`.txt`],jhe=5e3,Mhe=4;function W7(e){return Math.round(e/Mhe)}function Nhe(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Ahe.includes(e.slice(t).toLowerCase())}function Phe(e){let t=W7((e.name??``).length+(e.description??``).length),n=W7(nf(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Nhe(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:W7(i)}}I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose();var Fhe=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose();I({name:M().min(1),docs:F(Fhe)}).loose(),I({folder:Ra(),frontmatter_local:Ja(M(),Ra()).nullable(),warnings:F(M()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:F(R([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),I({path:M(),frontmatter:Ja(M(),Ra()).optional()}).loose(),I({applied:Ra()}).loose();var G7=Ja(M(),Ra()).meta({description:`Free-form frontmatter map embedded in template payloads.`});I({template:I({name:M().min(1),folder:M(),scope:R([`local`,`inherited`]),path:M().min(1),frontmatter:G7,body:M()}).strict()}).strict();var Ihe=I({templates:F(I({name:M().min(1),title:M().optional(),description:M().optional(),path:M().min(1),source_folder:M()}).strict()),truncated:P()}).strict();I({folder:M(),name:M(),body:M().optional(),frontmatter:G7.optional(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({existed:P(),path:M().min(1)}).strict(),I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:G7.optional(),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),committed:P()}).strict();var K7=R(bf),Lhe=/^[a-z0-9-]+$/,Rhe=/^[A-Za-z0-9_-]+$/,q7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict();I({skill:I({name:M().min(1),scope:K7,path:M().min(1),frontmatter:q7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict();var zhe=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Bhe=I({name:M().min(1),description:M().optional(),scope:K7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:F(M()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:Ja(M(),M()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:F(M()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:F(M()).optional(),installableEditors:F(M()).optional(),hubOffered:P().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:P().optional(),customPlacements:F(I({path:M(),mode:R([`copy`,`link`])}).strict()).optional(),plugin:I({name:M().min(1),marketplace:M().min(1),provider:M().min(1),url:M().optional()}).strict().optional(),managed:P().optional(),origin:zhe.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:khe.optional()}).strict();I({name:M().min(1),scope:K7,apply:P().optional()}).strict(),I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict();var Vhe=I({skills:F(Bhe),truncated:P()}).strict();I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:q7,...u4,summary:d4}).strict();var J7=F(R([`skill-name-vendor-word`,`skill-body-too-long`])).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...u4,summary:d4}).strict(),I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),...u4,summary:d4}).strict(),I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict();var Y7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Y7}`})}).strict(),I({scope:K7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:q7.optional(),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Y7}`})}).strict(),I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:K7,toScope:K7,...u4,summary:d4}).strict();var Hhe=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Uhe(e){return typeof e==`string`&&Hhe.includes(e)}var Whe=[`intact`,`lossy`,`unknown`];function Ghe(e){return typeof e==`string`&&Whe.includes(e)}var Khe=[`unreadable`,`occupant-unverifiable`];function qhe(e){return typeof e==`string`&&Khe.includes(e)}var Jhe={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function X7(e){return Jhe[e]}function Yhe(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Uhe(n)?n:void 0,o=Ghe(r)?r:void 0,s=qhe(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(X7(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}var Xhe=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function Zhe(e){if(e===void 0)return[];let t=Xhe;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}I({scope:K7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Y7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),I({scope:K7,name:M(),toName:M(),...u4,summary:d4}).strict(),I({name:M().min(1)}).strict(),I({name:M(),home:M().min(1)}).strict(),I({docName:M().min(1)}).strict();var Z7=R([`reference`,`script`,`file`]);I({scope:K7.default(`project`),name:M(),path:M().min(1),content:M(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),kind:Z7,content:P()}).strict(),I({scope:K7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),I({path:M().min(1),kind:Z7,text:M()}).strict(),I({path:M().min(1),existed:P(),kind:Z7}).strict();var Q7=Ga([U7,z(`agents`)]),$7=M().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),e9=Ga([Q7,$7]);I({scope:K7.default(`project`),name:M(),targets:F(Q7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:F(e9).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:F(e9).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:R([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:e9.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:R([`copy`,`link`])}).strict().optional(),convert:I({target:e9.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:R([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...u4,summary:d4,fork:I({editor:M().min(1),action:R([`align`,`make-source`,`rename`]),toName:M().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(R([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),I({name:M().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:P().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Qhe=I({targets:F(H7),configured:P(),folders:F(I({scope:K7,host:M(),root:M(),state:R([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:z(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),t9=I({action:z(`link`),scope:K7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),n9=I({action:z(`unlink`),scope:K7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),r9=I({action:z(`add-root`),scope:K7,root:$7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),$he=Ka(`action`,[t9.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),n9,r9]);Ka(`action`,[t9.strict(),n9,r9]),I({folderAction:$he}).strict();var i9=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict();I({targets:F(H7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:i9.optional()}).strict(),I({scope:K7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...u4,summary:d4}).strict(),I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),I({query:M().optional(),intent:R([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:R([`navigation`,`relevance`]).optional(),scopes:F(R([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:R([`omnibar`,`mcp`,`http`]).optional()}).loose();var ege=I({kind:R([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:Ja(M(),Ra()),snippet:M().optional()}).loose(),tge=R([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),a9=R([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function nge(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function rge(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function ige(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return rge(n)}}function age(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}var o9=I({capable:P(),applied:P(),outcome:tge,providerErrorReason:a9.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),oge=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:R([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:a9.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function sge(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}I({query:M(),intent:R([`autocomplete`,`full_text`,`omnibar`]),results:F(ege),elapsedMs:N().nonnegative(),semantic:o9.optional(),truncated:P().optional(),ready:P().optional()}).loose();var cge=I({version:M().min(1),recordedAt:M().min(1)}).loose();I({currentVersion:M().min(1),targets:Ja(M(),cge.nullable())}).loose(),I({scope:K7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...u4,summary:d4}).strict(),I({scope:K7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...u4,summary:d4}).strict(),I({results:F(I({requested:M(),status:R([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),I({scope:K7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...u4,summary:d4}).strict(),I({results:F(I({requested:M(),status:R([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose();var lge=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose();I({name:M().min(1).meta({description:`Managed skill name created or matched.`}),path:M().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:P().meta({description:`True when this request created new source files.`}),alreadyImported:P().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:M().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:lge,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:J7}).loose();var uge=`server-info`,dge=`branch-switched`,fge=`disk-ack`,pge=`config-validation-rejected`,mge=`config-ignore-nested-error`,s9=R([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),hge=I({v:z(1),ch:z(uge),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),gge=I({v:z(1),ch:z(dge),seq:N(),branch:M().min(1)}).loose(),_ge=I({v:z(1),ch:s9,seq:N()}).loose(),vge=I({v:z(1),ch:z(fge),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),yge=I({v:z(1),ch:z(pge),seq:N(),docName:M().min(1),error:Rne}).loose(),bge=I({v:z(1),ch:z(mge),seq:N(),path:M().min(1),error:M().min(1)}).loose(),xge=100,Sge=500,Cge=450,wge={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function Tge(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var Ege=/\.(?:md|mdx)$/;function Dge(e,t){if(t!==`page`)return e;let n=e.replace(Ege,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Oge(e){let t=u9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function kge(){let e=hJ({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=kJ({schema:wge,components:{tokenizer:kge()}});return e.length>0&&BJ(t,e),t}function Age(e){let t={documents:e};return c9.set(t,p9(e)),t}function jge(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function Mge(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Nge(e,t){let n=l9(t);if(!n)return 0;let r=Dge(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var Pge=.5;function h9(e,t){let n=Nge(e,t);return n<=0?n:o4(e.path)?n*Pge:n}function Fge(e){return e===`file`?-60:0}var Ige=1e3,Lge=50,Rge=1,zge=1;function Bge(e,t,n,r,i){let a=i>0?t/i:0,o=n/Lge,s=r===`file`?-.001:0,c=Rge*a+zge*o+s;return e*Ige+c}function g9(e,t,n,r){return e+t*20+n+Fge(r)}function _9(e,t,n,r,i,a){return e===`relevance`?g9(t,n,r,i):Bge(t,n,r,i,a)}function Vge(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function v9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Hge(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function Uge(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Wge(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}var Gge=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function Kge(e,t){let n=l9(t);return n.length<4||Gge.test(n)?0:+(e===`full_text`)}function qge(e){let{lexical:t,fullText:n}=e.signals;return t>=Sge?`lexical`:t===Cge&&n<=0?`pathOnly`:`body`}function Jge(e){let t=[],n=[],r=[];for(let i of e){let e=qge(i);e===`lexical`?t.length<xge&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function y9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Jge(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Yge(e,t,n={}){let r=n.intent??`omnibar`,i=Vge(r,n.ranking),a=Tge(n.limit),o=new Set(n.scopes??Mge(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=gY(jge(e),{term:c,properties:Uge(r),boost:Wge(r),tolerance:Kge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=Hge(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=v9(f.values(),u);return y9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:_9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return y9(Xge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function b9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Xge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=v9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?_9(o,t,n,s,e.kind,m):g9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=b9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=b9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Zge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function Qge(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function $ge(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=Fr());var C9=S9[x9],w9=L({version:M().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:Zi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:R([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),e_e=L({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Zi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});L({schema:z(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:L({"claude-cowork":w9.optional(),"cli-hosts":w9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Ja(M(),e_e).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var T9=`bottom`,E9=e=>e*8+4,D9=E9(92),O9=E9(40);function t_e(e){return e===`right`||e===`bottom`?e:T9}function n_e(e){return typeof e!=`number`||!Number.isFinite(e)?D9:Math.max(O9,Math.round(e))}var r_e=new Set([`(connected)`,`(agent thread)`]);function i_e(e){return e!=null&&r_e.has(e)}var a_e=6e5,k9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function o_e(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??s_e,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new k9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function s_e(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function c_e(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function l_e(e){if(typeof e!=`string`||e.length===0)return e;let t=D3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(T3(e)){let t=c_e(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=C3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var u_e=`https://api.github.com/repos/inkeep/open-knowledge`;async function d_e(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(u_e,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}var f_e=/^(#{1,6})\s+(.+)$/;function p_e(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(f_e);if(!n)return null;let r=n[2].trim(),i=b7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var m_e=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function A9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=m_e;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var h_e={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},g_e=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],__e={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},v_e={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},j9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function y_e(e,t=g_e){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function b_e(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function x_e(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var S_e={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function C_e(e){return e?S_e[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function w_e(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function T_e(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function E_e(e){let[t]=w_e(e);return T_e(t,45,32)}var D_e=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],O_e=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],M9=`ok-user-name-v3`,N9=`ok-user-color-v3`;function P9(e){return e[Math.floor(Math.random()*e.length)]}function k_e(){return`${P9(D_e)} ${P9(O_e)}`}function A_e(){return P9(j9)}function F9(e){try{return localStorage.getItem(e)}catch{return null}}function I9(e,t){try{localStorage.setItem(e,t)}catch{}}function j_e(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=A9(),n=F9(M9),r=F9(N9);return n||(n=k_e(),I9(M9,n)),r||(r=A_e(),I9(N9,r)),{name:n,color:r,coeditor:e,tabId:t}}function L9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function M_e(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function N_e(e){return e.split(`/`).map(M_e).join(`/`)}function R9(e){return e.split(`/`).map(L9).join(`/`)}function z9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=L9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!G$.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=L9(d[e]??``);if(e===f&&(t=Ef(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function P_e(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var B9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function V9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function H9(e){return e.split(`/`).filter(Boolean)}function U9(e){let t=e.trim();return B9.test(t)||t.startsWith(`//`)}function F_e(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(U9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=R9(r<0?n:n.slice(0,r)),a=jf(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Af(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=z9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=V9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function I_e(e,t){let n=e.trim();if(!n)return null;if(U9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=V9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function L_e(e,t,n){let r=e.trim();if(!r||B9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:L9(e));return c.length===0?null:c.join(`/`)}function R_e(e,t,n=null,r=`.md`){let i=H9(e);i.pop();let a=H9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${N_e(l)}${r}${n?`#${n}`:``}`}function z_e(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var B_e=`unknown`;function V_e(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return B_e;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function H_e(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function W9(e){return`pagesBySlug`in e}function G9(e){return W9(e)?e.pages:e}function K9(e,t){return W9(e)?e.assetPaths??new Set:t??new Set}function q9(e,t){return W9(e)?e.filePaths??new Set:t??new Set}function J9(e,t){return e<t?-1:+(e>t)}function U_e(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);e&&(i===void 0||J9(r,i)<0)&&n.set(e,r)}return n}function W_e(e,t){let n=new Map,r=[...e].sort(J9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function G_e(e,t){let n=y7(e);if(!n)return;if(W9(t))return t.pagesBySlug.get(n);let r;for(let e of t)y7(e)===n&&(r===void 0||J9(e,r)<0)&&(r=e);return r}function K_e(e,t){if(e.includes(`/`))return;let n=y7(e);if(!n)return;if(W9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);y7(t===-1?e:e.slice(t+1))===n&&(r===void 0||J9(e,r)<0)&&(r=e)}return r}function Y9(e){let t=e.trim();if(!t)return[];let n=y7(t);return n.length>0&&n!==t?[n]:[]}function X9(e,t){let n=e.trim();if(!n)return;if(G9(t).has(n))return n;let r=n.replace(/\.(md|mdx)$/i,``);if(r!==n){let e=Z9(r,t);if(e!==void 0)return e}return Z9(n,t)}function Z9(e,t){let n=e.trim();if(!n)return;let r=G9(t);if(r.has(n))return n;let i=G_e(n,t);if(i)return i;for(let e of Y9(n))if(r.has(e))return e;return q_e(n,r)||K_e(n,t)}function q_e(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function Q9(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=Q9(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(J9)[0]??null}function J_e(...e){let t=new Set;for(let n of e)for(let e of n){let n=e.toLowerCase();t.add(`path:${n}`),t.add(`basename:${n.slice(n.lastIndexOf(`/`)+1)}`)}return t}function Y_e(e,t,n,r){let i=e.trim();if(!i)return!1;let a=Q9(i).toLowerCase(),o=W9(t)?t.assetTargetKeys:void 0;if(o!==void 0){if(o.has(`path:${a}`)||!a.includes(`/`)&&o.has(`basename:${a}`))return!0}else if($9(i,K9(t,n),q9(t,r)))return!0;return X9(i,t)!==void 0}function X_e(e,t,n){let r=I_e(e,t);return r===null||r.kind!==`asset`||$9(r.url,K9(n),q9(n))!==null||X9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{t7 as $,_T as $a,M as $c,DX as $i,_2 as $n,Dne as $o,rce as $r,Kf as $s,i9 as $t,q$ as A,wj as Aa,Hs as Ac,_Q as Ai,e2 as An,Yg as Ao,v1 as Ar,Eh as As,Loe as At,W0 as B,Mie as Ba,Vo as Bc,I0 as Bi,vQ as Bn,sm as Bo,R0 as Br,xne as Bs,She as Bt,u1 as C,gpe as Ca,fp as Cc,sge as Ci,Efe as Cn,g_ as Co,TQ as Cr,Vh as Cs,r1 as Ct,uhe as D,x7 as Da,af as Dc,T3 as Di,D$ as Dn,b_ as Do,Y0 as Dr,km as Ds,_oe as Dt,dhe as E,Q4 as Ea,Hf as Ec,G0 as Ei,YY as En,x_ as Eo,V9 as Er,Sp as Es,Sme as Et,Eme as F,Uk as Fa,$s as Fc,P$ as Fi,U_e as Fn,Gne as Fo,V_e as Fr,Sne as Fs,O1 as Ft,v3 as G,sD as Ga,Uo as Gc,z_e as Gi,wQ as Gn,Dh as Go,nce as Gr,_f as Gs,Dhe as Gt,xpe as H,CE as Ha,xs as Hc,t_e as Hi,F_e as Hn,Nm as Ho,Ese as Hr,mp as Hs,V7 as Ht,Tme as I,Mk as Ia,nc as Ic,g1 as Ii,R_e as In,Kne as Io,d_e as Ir,kp as Is,A1 as It,C1 as J,Lw as Ja,F as Jc,D3 as Ji,jQ as Jn,xh as Jo,tce as Jr,hf as Js,goe as Jt,Xme as K,cD as Ka,R as Kc,zoe as Ki,_1 as Kn,um as Ko,dce as Kr,gf as Ks,o9 as Kt,fhe as L,qk as La,ic as Lc,Zhe as Li,J_e as Ln,Wne as Lo,b7 as Lr,bne as Ls,Lhe as Lt,xme as M,yj as Ma,Zs as Mc,ume as Mi,zY as Mn,mg as Mo,efe as Mr,ih as Ms,jpe as Mt,s9 as N,vj as Na,zo as Nc,ime as Ni,r2 as Nn,G as No,C5 as Nr,_ne as Ns,t0 as Nt,ape as O,l2 as Oa,Js as Oc,Lpe as Oi,sZ as On,iv as Oo,fX as Or,oh as Os,U4 as Ot,R7 as P,ej as Pa,Bo as Pc,Dse as Pi,W_e as Pn,Hne as Po,x_e as Pr,sh as Ps,_he as Pt,K$ as Q,gT as Qa,I as Qc,OX as Qi,v2 as Qn,Rm as Qo,sce as Qr,Jf as Qs,R4 as Qt,z$ as R,Jk as Ra,Ho as Rc,MZ as Ri,Qge as Rn,Une as Ro,j_e as Rr,Ah as Rs,h_e as Rt,k9 as S,w1 as Sa,If as Sc,j1 as Si,P_e as Sn,q as So,Phe as Sr,Im as Ss,n1 as St,Cme as T,Boe as Ta,Ef as Tc,X7 as Ti,age as Tn,__ as To,B0 as Tr,Tm as Ts,phe as Tt,Wme as U,oE as Ua,Eo as Uc,n_e as Ui,nge as Un,Bm as Uo,C_e as Ur,gp as Us,whe as Ut,Mme as V,RE as Va,Us as Vc,y8 as Vi,$ge as Vn,am as Vo,V$ as Vr,yne as Vs,Che as Vt,j9 as W,AT as Wa,So as Wc,C3 as Wi,CQ as Wn,Vm as Wo,uce as Wr,Gf as Ws,The as Wt,E1 as X,zw as Xa,da as Xc,A9 as Xi,M5 as Xn,yh as Xo,cce as Xr,tf as Xs,F4 as Xt,T1 as Y,KE as Ya,P as Yc,Zge as Yi,MQ as Yn,bh as Yo,lce as Yr,mf as Ys,A4 as Yt,D1 as Z,Bw as Za,z as Zc,yoe as Zi,H2 as Zn,lm as Zo,ice as Zr,bf as Zs,P4 as Zt,U$ as _,U0 as _a,Nf as _c,$$ as _i,z0 as _n,J as _o,R9 as _r,Pp as _s,jhe as _t,hme as a,X_e as aa,Sf as ac,F1 as ai,qe as al,C4 as an,qE as ao,h2 as ar,Sh as as,Epe as at,EQ as b,rfe as ba,Of as bc,M1 as bi,PZ as bn,K as bo,Q0 as br,Zp as bs,Yme as bt,Coe as c,l_e as ca,wf as cc,Ooe as ci,iee as cl,S0 as cn,Qw as co,xX as cr,Dp as cs,h7 as ct,gge as d,Y4 as da,xf as dc,U9 as di,Ue as dl,l1 as dn,VE as do,y$ as dr,dm as ds,qde as dt,kY as ea,Vd as ec,$se as ei,pee as el,H7 as en,$w as eo,m2 as er,Xp as es,Z4 as et,bge as f,Yge as fa,Zf as fc,Ope as fi,c1 as fn,yC as fo,Ppe as fr,Zm as fs,e0 as ft,hge as g,ige as ga,Bf as gc,G5 as gi,Cpe as gn,uv as go,Oge as gr,hne as gs,d2 as gt,vge as h,spe as ha,Wf as hc,upe as hi,wpe as hn,oC as ho,Age as hr,qp as hs,u2 as ht,ahe as i,$9 as ia,Cf as ic,TY as ii,Ke as il,w4 as in,jT as io,B2 as ir,Ch as is,vpe as it,vhe as j,gj as ja,ec as jc,sme as ji,t2 as jn,W as jo,Ape as jr,jp as js,X4 as jt,T9 as k,u9 as ka,Ys as kc,xoe as ki,N$ as kn,G_ as ko,p$ as kr,wp as ks,bme as kt,kme as l,H_e as la,Qd as lc,Moe as li,$e as ll,Ihe as ln,NT as lo,b_e as lr,uh as ls,Toe as lt,_ge as m,cpe as ma,Ff as mc,w3 as mi,voe as mn,ES as mo,G3 as mr,kne as ms,W5 as mt,v_e as n,z9 as na,ff as nc,oce as ni,Lt as nl,U7 as nn,uT as no,g2 as nr,nm as ns,Fme as nt,Eoe as o,X9 as oa,$d as oc,Ipe as oi,Xe as ol,Rhe as on,gw as oo,p2 as or,jm as os,ehe as ot,yge as p,Voe as pa,Tf as pc,o4 as pi,a_e as pn,CS as po,E8 as pr,rh as ps,wfe as pt,bue as q,aD as qa,bo as qc,L0 as qi,y_e as qn,vh as qo,ece as qr,pf as qs,oge as qt,ihe as r,Soe as ra,cp as rc,Yhe as ri,nee as rl,Vhe as rn,dT as ro,e4 as rr,wh as rs,Jme as rt,Doe as s,x$ as sa,Jd as sc,Aoe as si,Qe as sl,Y$ as sn,qC as so,f2 as sr,Am as ss,e1 as st,__e as t,L_e as ta,Yf as tc,ace as ti,Vt as tl,Qhe as tn,cT as to,t4 as tr,om as ts,L1 as tt,Ome as u,p_e as ua,pp as uc,J$ as ui,ze as ul,yhe as un,iD as uo,b$ as ur,rm as us,O9 as ut,H$ as v,gQ as va,dp as vc,i_e as vi,H0 as vn,Sv as vo,E_e as vr,Bne as vs,t1 as vt,P7 as w,y7 as wa,nf as wc,Ohe as wi,Tfe as wn,d_ as wo,B$ as wr,Om as ws,hhe as wt,W$ as x,pQ as xa,Rf as xc,Y_e as xi,$2 as xn,ov as xo,Npe as xr,Dm as xs,D9 as xt,xQ as y,$0 as ya,Uf as yc,a4 as yi,Kme as yn,Tv as yo,Z$ as yr,Km as ys,Q$ as yt,K0 as z,Fk as za,Wo as zc,S5 as zi,o_e as zn,Qp as zo,Y9 as zr,Tp as zs,Ehe as zt};
|
|
604
|
+
`)}catch(t){return console.warn(`[markdown-plain-text] markdown parse failed, falling back to raw text`,t),e}}for(let e of[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}]){let t=W3.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}HI(),sI(),cI(),I({intents:F(I({satisfierId:M().min(1),desired:R([`present`,`absent`])}).loose()),...u4,summary:d4}).loose();var dme=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:R([`present`,`absent`]),action:R(es),errorId:M().optional()}).loose(),fme=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),pme=I({state:M(),strictness:F(R(Xo)).optional()}).loose(),mme=I({probes:I({env:R([`desktop`,`local-web`,`remote-web`]),satisfiers:Ja(M(),pme)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),hme=I({actions:F(dme),conflicts:F(fme),withheld:F(M()),snapshot:mme}).loose();I({entries:F(I({level:R([`info`,`warn`,`error`]),message:M().max(X4),event:M().optional(),fields:Ja(M(),Ra()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),I({accepted:N().int().min(0)}).loose();var gme=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),_me=F(Ga([M(),N().int().nonnegative()])),vme=Ka(`kind`,[I({kind:z(`body`)}),I({kind:z(`property`),key:M().min(1),path:_me.default([])})]).default({kind:`body`}),yme=R([`anchored`,`orphaned`,`resolved`]),P7=I({threadId:M().min(1),docName:M().min(1),target:vme,anchor:gme.nullable(),state:yme,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),F7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),I7=I({threadId:M(),ok:z(!0)}),L7=I({threadId:M(),ok:z(!1),error:z(`not-found`)});I({threads:F(P7)}).loose();var bme=I({meta:P7,orphaned:P()}).loose(),xme=I({threadId:M()}).loose();I({meta:P7,payload:F7}).loose();var Sme=I({results:F(Ga([I7.extend({meta:P7,payload:F7}),L7]))}).loose(),Cme=I({results:F(Ga([I7.extend({meta:P7}),L7]))}).loose(),wme=I({status:M().min(1),reason:M()}).loose(),Tme=I({docName:M().min(1),content:M(),lifecycle:wme.nullable()}).loose(),R7=I({kind:R([`document`,`asset`,`folder`,`file`]).default(`document`),docName:M().min(1).optional(),docExt:M().min(1).default(`.md`),size:N().int().nonnegative(),modified:M().min(1),isSymlink:P().default(!1),canonicalDocName:M().nullable().default(null),targetPath:M().nullable().default(null),path:M().min(1).optional(),assetExt:M().min(1).optional(),mediaKind:R([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:F(M().min(1)).optional(),hasChildren:P().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Eme=I({documents:F(R7),truncated:P().optional()}).loose(),Dme=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Ome=I({docName:M().min(1),backlinks:F(Dme)}).loose(),kme=I({counts:Ja(M().min(1),N().int().nonnegative())}).loose();I({counts:Ja(M().min(1),N().int().nonnegative())}).loose();var Ame=Ka(`kind`,[I({kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:z(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),jme=I({role:M().min(1),sourceForm:M().min(1),targetKind:M().min(1),href:M(),resolvedTarget:M().nullable(),status:M().min(1),reason:M().nullable(),resolutionMethod:M().min(1),fallbackTarget:M().nullable().default(null),range:I({start:N().int().nonnegative(),end:N().int().nonnegative()}),line:N().int().nonnegative(),column:N().int().nonnegative(),definition:I({label:M(),line:N().int().nonnegative()}).nullable().default(null)}).loose(),Mme=I({docName:M().min(1),forwardLinks:F(Ame),localTargets:F(jme).optional()}).loose(),Nme=Ka(`kind`,[I({id:M().min(1),kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:z(`external`),url:M().min(1),label:M()}).loose()]),Pme=I({source:M().min(1),target:M().min(1)}).loose(),Fme=I({nodes:F(Nme),links:F(Pme)}).loose(),Ime=I({ts:N().int().min(0),url:M(),method:M(),ua:M().optional(),origin:M().optional(),referer:M().optional(),host:M().optional(),remote:M().optional(),secChUa:M().optional(),secChUaMobile:M().optional(),secChUaPlatform:M().optional(),secFetchSite:M().optional(),secFetchDest:M().optional(),secFetchMode:M().optional(),secFetchUser:M().optional()}).loose(),Lme=I({app:Ga([z(`cursor`),z(`codex`),z(`claude`),Ia()]),signals_fired:F(M())}).loose();I({entries:F(Ime),count:N().int().min(0),detection:Lme}).loose();var z7=I({path:M().min(1),code:R([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:M().min(1).optional(),syncScoped:P(),open:Ka(`kind`,[I({kind:z(`doc`),docName:M().min(1)}),I({kind:z(`asset`),path:M().min(1)})]).optional()}).loose();I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(z7),notStaged:F(z7),untracked:F(z7),incoming:F(z7),truncated:P(),readable:P().default(!0)}).loose();var Rme=R([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),zme=R([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Bme=R([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),Vme=R([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Hme=I({mergeQueue:I({position:N().int().nonnegative(),state:Rme.nullable().catch(null)}).nullable().catch(null),autoMerge:P(),mergeState:zme.nullable().catch(null),reviewDecision:Bme.nullable().catch(null),checks:Vme.nullable().catch(null)}).loose(),Ume=I({kind:R([`pull`,`issue`]),repo:M().min(1),number:N().int().positive(),title:M(),author:M().nullable(),createdAt:M(),lifecycle:R([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional(),status:Hme.optional()}).loose();I({url:M()}).loose();var Wme=Ka(`ok`,[I({ok:z(!0),preview:Ume}).loose(),I({ok:z(!1),reason:M()}).loose()]);I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:d4,...u4}).loose(),I({checkpointRef:M().min(1)}).loose();var Gme=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose();I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:R([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(Gme),checkpoint:Ra().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose();var Kme=I({contentDir:M().min(1),pathSeparator:R([`/`,`\\`]),symlinkResolved:P()}).loose();F(Ka(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:z(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:z(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var qme=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose();I({url:M()}).loose();var Jme=Ka(`ok`,[I({ok:z(!0),metadata:qme}).loose(),I({ok:z(!1),reason:M()}).loose()]),Yme=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Xme=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Zme=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose();I({deadLinks:F(I({target:M().min(1),sources:F(Zme)}).loose())}).loose(),I({target:I({docName:M().min(1),title:M(),aliases:F(M())}).loose(),mentions:F(I({source:M().min(1),excerpt:M(),offset:N().int().nonnegative()}).loose()),truncated:P()}).loose(),I({projectPath:M().min(1)}).loose();var Qme=R([`not-a-git-worktree`,`init-failed`]);Ka(`ok`,[I({ok:z(!0),projectPath:M().min(1)}).loose(),I({ok:z(!1),reason:Qme,message:M().min(1)}).loose()]),I({host:M().min(1).optional()}).loose(),I({host:M().min(1).optional(),token:M().min(1)}).loose(),I({host:M(),login:M()}).loose(),I({key:M().min(1)}).loose(),I({keyPresent:P()}).loose();var $me=R([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),ehe=Ka(`ok`,[I({ok:z(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:z(!1),endpoint:M().min(1),model:M().min(1),reason:$me,status:N().int().optional()}).loose()]);I({name:M().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:M().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),I({authenticated:P()}).loose(),I({channel:R([`login`,`gh-login`]).default(`login`)}).loose(),I({}).loose();var the=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),nhe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(the)}).loose(),rhe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),ihe=I({sessionAlive:P(),agent:rhe.nullable(),files:F(nhe)}).loose(),ahe=I({diff:M(),before:M(),after:M(),properties:X0,generatedAt:N().int().min(0)}).loose();I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose();var ohe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:R([`idle`,`writing`]),ts:N().int().min(0)}).loose();I({presence:Ja(M().min(1),ohe)}).loose();var she=I({sessionId:M().min(1),agentType:M().min(1),ts:N().int().min(0),insertedChars:N().int().min(0),deletedChars:N().int().min(0)}).loose();I({effects:F(I({"doc.name":M().min(1),entries:F(she)}).loose())}).loose(),I({decisions:F(I({ts:N().int().min(0),decision:M().min(1),kind:M().min(1),"doc.name":M().min(1),pathRole:M().min(1)}).loose())}).loose(),Ja(M().min(1),P()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),I({path:M().min(1,`path must be non-empty`)}).loose(),I({}).loose();var che=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),lhe=I({fromPath:M().min(1),toPath:M().min(1)}).loose();I({}).loose(),I({path:M().min(1),...u4,summary:d4}).loose();var uhe=I({docName:M().min(1)}).loose();I({path:M().min(1),...u4,summary:d4}).loose();var dhe=I({path:M().min(1)}).loose();I({kind:R([`file`,`folder`]),path:M().min(1),...u4,summary:d4}).loose();var fhe=I({kind:R([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),phe=I({pages:F(I({docName:M().min(1),title:M(),docExt:M().min(1),size:N().int().nonnegative(),modified:M().min(1),icon:M().min(1).max(2048).optional()}).loose())}).loose(),mhe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),hhe=I({docName:M().min(1),headings:F(mhe)}).loose(),ghe=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose();I({kind:R([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...u4,summary:d4}).loose();var _he=I({renamed:F(che),renamedAssets:F(lhe),rewrittenDocs:F(ghe).optional(),summary:n7.optional()}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...u4}).loose();var vhe=I({deletedDocNames:F(M().min(1))}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...u4,summary:d4}).loose();var yhe=I({deletedDocNames:F(M().min(1))}).loose();I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:d4,...u4}).loose(),I({restoredFrom:M().min(1),timestamp:M().min(1),summary:n7.optional(),warnings:o7.optional()}).loose();var bhe=/^#[0-9a-fA-F]{6}$/,xhe=I(Object.fromEntries(Bm.map(e=>[e,M().regex(bhe,`must be a #rrggbb hex color`)]))),B7=M().min(1).refine(Gm,{message:`must contain a non-whitespace character`}),V7=I({name:B7,author:B7.optional(),variant:R([`dark`,`light`]),palette:xhe}).loose(),She=I({name:M().min(1),scheme:V7,stem:M().min(1).optional(),extension:R([`.yaml`,`.yml`]).optional()}).loose(),Che=I({id:M().min(1),filename:M().min(1)}).loose(),whe=I({id:M().min(1),scheme:V7}).loose(),The=I({id:M().min(1),filename:M().min(1)}).loose(),Ehe=Ka(`existed`,[I({existed:z(!1)}).loose(),I({existed:z(!0),filename:M().min(1),scheme:V7}).loose()]),Dhe=I({themes:F(Ka(`ok`,[I({ok:z(!0),id:M().min(1),filename:M().min(1),scheme:V7}),I({ok:z(!1),filename:M().min(1),id:M().min(1).optional(),code:M().min(1),conflictingFilenames:F(M().min(1)).min(2).optional()})])),truncated:P()}).loose(),H7=R(Je),U7=R(Ye);function Ohe(e){return e===`agents`||Ye.includes(e)}var khe=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),Ahe=[`.md`,`.mdx`,`.txt`],jhe=5e3,Mhe=4;function W7(e){return Math.round(e/Mhe)}function Nhe(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Ahe.includes(e.slice(t).toLowerCase())}function Phe(e){let t=W7((e.name??``).length+(e.description??``).length),n=W7(nf(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Nhe(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:W7(i)}}I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose();var Fhe=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose();I({name:M().min(1),docs:F(Fhe)}).loose(),I({folder:Ra(),frontmatter_local:Ja(M(),Ra()).nullable(),warnings:F(M()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:F(R([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),I({path:M(),frontmatter:Ja(M(),Ra()).optional()}).loose(),I({applied:Ra()}).loose();var G7=Ja(M(),Ra()).meta({description:`Free-form frontmatter map embedded in template payloads.`});I({template:I({name:M().min(1),folder:M(),scope:R([`local`,`inherited`]),path:M().min(1),frontmatter:G7,body:M()}).strict()}).strict();var Ihe=I({templates:F(I({name:M().min(1),title:M().optional(),description:M().optional(),path:M().min(1),source_folder:M()}).strict()),truncated:P()}).strict();I({folder:M(),name:M(),body:M().optional(),frontmatter:G7.optional(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({existed:P(),path:M().min(1)}).strict(),I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:G7.optional(),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),committed:P()}).strict();var K7=R(bf),Lhe=/^[a-z0-9-]+$/,Rhe=/^[A-Za-z0-9_-]+$/,q7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict();I({skill:I({name:M().min(1),scope:K7,path:M().min(1),frontmatter:q7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict();var zhe=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Bhe=I({name:M().min(1),description:M().optional(),scope:K7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:F(M()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:Ja(M(),M()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:F(M()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:F(M()).optional(),installableEditors:F(M()).optional(),hubOffered:P().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:P().optional(),customPlacements:F(I({path:M(),mode:R([`copy`,`link`])}).strict()).optional(),plugin:I({name:M().min(1),marketplace:M().min(1),provider:M().min(1),url:M().optional()}).strict().optional(),managed:P().optional(),origin:zhe.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:khe.optional()}).strict();I({name:M().min(1),scope:K7,apply:P().optional()}).strict(),I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict();var Vhe=I({skills:F(Bhe),truncated:P()}).strict();I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:q7,...u4,summary:d4}).strict();var J7=F(R([`skill-name-vendor-word`,`skill-body-too-long`])).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...u4,summary:d4}).strict(),I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),...u4,summary:d4}).strict(),I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict();var Y7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Y7}`})}).strict(),I({scope:K7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:q7.optional(),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Y7}`})}).strict(),I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:K7,toScope:K7,...u4,summary:d4}).strict();var Hhe=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Uhe(e){return typeof e==`string`&&Hhe.includes(e)}var Whe=[`intact`,`lossy`,`unknown`];function Ghe(e){return typeof e==`string`&&Whe.includes(e)}var Khe=[`unreadable`,`occupant-unverifiable`];function qhe(e){return typeof e==`string`&&Khe.includes(e)}var Jhe={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function X7(e){return Jhe[e]}function Yhe(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Uhe(n)?n:void 0,o=Ghe(r)?r:void 0,s=qhe(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(X7(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}var Xhe=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function Zhe(e){if(e===void 0)return[];let t=Xhe;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}I({scope:K7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Y7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),I({scope:K7,name:M(),toName:M(),...u4,summary:d4}).strict(),I({name:M().min(1)}).strict(),I({name:M(),home:M().min(1)}).strict(),I({docName:M().min(1)}).strict();var Z7=R([`reference`,`script`,`file`]);I({scope:K7.default(`project`),name:M(),path:M().min(1),content:M(),...u4,summary:d4}).strict(),I({path:M().min(1),created:P(),kind:Z7,content:P()}).strict(),I({scope:K7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...u4,summary:d4}).strict(),I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),I({path:M().min(1),kind:Z7,text:M()}).strict(),I({path:M().min(1),existed:P(),kind:Z7}).strict();var Q7=Ga([U7,z(`agents`)]),$7=M().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),e9=Ga([Q7,$7]);I({scope:K7.default(`project`),name:M(),targets:F(Q7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:F(e9).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:F(e9).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:R([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:e9.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:R([`copy`,`link`])}).strict().optional(),convert:I({target:e9.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:R([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...u4,summary:d4,fork:I({editor:M().min(1),action:R([`align`,`make-source`,`rename`]),toName:M().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(R([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),I({name:M().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:P().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Qhe=I({targets:F(H7),configured:P(),folders:F(I({scope:K7,host:M(),root:M(),state:R([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:z(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),t9=I({action:z(`link`),scope:K7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),n9=I({action:z(`unlink`),scope:K7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),r9=I({action:z(`add-root`),scope:K7,root:$7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),$he=Ka(`action`,[t9.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),n9,r9]);Ka(`action`,[t9.strict(),n9,r9]),I({folderAction:$he}).strict();var i9=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict();I({targets:F(H7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:i9.optional()}).strict(),I({scope:K7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...u4,summary:d4}).strict(),I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),I({query:M().optional(),intent:R([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:R([`navigation`,`relevance`]).optional(),scopes:F(R([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:R([`omnibar`,`mcp`,`http`]).optional()}).loose();var ege=I({kind:R([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:Ja(M(),Ra()),snippet:M().optional()}).loose(),tge=R([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),a9=R([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function nge(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function rge(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function ige(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return rge(n)}}function age(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}var o9=I({capable:P(),applied:P(),outcome:tge,providerErrorReason:a9.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),oge=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:R([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:a9.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function sge(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}I({query:M(),intent:R([`autocomplete`,`full_text`,`omnibar`]),results:F(ege),elapsedMs:N().nonnegative(),semantic:o9.optional(),truncated:P().optional(),ready:P().optional()}).loose();var cge=I({version:M().min(1),recordedAt:M().min(1)}).loose();I({currentVersion:M().min(1),targets:Ja(M(),cge.nullable())}).loose(),I({scope:K7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...u4,summary:d4}).strict(),I({scope:K7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...u4,summary:d4}).strict(),I({results:F(I({requested:M(),status:R([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),I({scope:K7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...u4,summary:d4}).strict(),I({results:F(I({requested:M(),status:R([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose();var lge=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose();I({name:M().min(1).meta({description:`Managed skill name created or matched.`}),path:M().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:P().meta({description:`True when this request created new source files.`}),alreadyImported:P().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:M().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:lge,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:J7}).loose();var uge=`server-info`,dge=`branch-switched`,fge=`disk-ack`,pge=`config-validation-rejected`,mge=`config-ignore-nested-error`,s9=R([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),hge=I({v:z(1),ch:z(uge),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),gge=I({v:z(1),ch:z(dge),seq:N(),branch:M().min(1)}).loose(),_ge=I({v:z(1),ch:s9,seq:N()}).loose(),vge=I({v:z(1),ch:z(fge),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),yge=I({v:z(1),ch:z(pge),seq:N(),docName:M().min(1),error:Rne}).loose(),bge=I({v:z(1),ch:z(mge),seq:N(),path:M().min(1),error:M().min(1)}).loose(),xge=100,Sge=500,Cge=450,wge={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function Tge(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var Ege=/\.(?:md|mdx)$/;function Dge(e,t){if(t!==`page`)return e;let n=e.replace(Ege,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Oge(e){let t=u9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function kge(){let e=hJ({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=kJ({schema:wge,components:{tokenizer:kge()}});return e.length>0&&BJ(t,e),t}function Age(e){let t={documents:e};return c9.set(t,p9(e)),t}function jge(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function Mge(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Nge(e,t){let n=l9(t);if(!n)return 0;let r=Dge(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var Pge=.5;function h9(e,t){let n=Nge(e,t);return n<=0?n:o4(e.path)?n*Pge:n}function Fge(e){return e===`file`?-60:0}var Ige=1e3,Lge=50,Rge=1,zge=1;function Bge(e,t,n,r,i){let a=i>0?t/i:0,o=n/Lge,s=r===`file`?-.001:0,c=Rge*a+zge*o+s;return e*Ige+c}function g9(e,t,n,r){return e+t*20+n+Fge(r)}function _9(e,t,n,r,i,a){return e===`relevance`?g9(t,n,r,i):Bge(t,n,r,i,a)}function Vge(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function v9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Hge(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function Uge(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Wge(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}var Gge=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function Kge(e,t){let n=l9(t);return n.length<4||Gge.test(n)?0:+(e===`full_text`)}function qge(e){let{lexical:t,fullText:n}=e.signals;return t>=Sge?`lexical`:t===Cge&&n<=0?`pathOnly`:`body`}function Jge(e){let t=[],n=[],r=[];for(let i of e){let e=qge(i);e===`lexical`?t.length<xge&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function y9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Jge(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Yge(e,t,n={}){let r=n.intent??`omnibar`,i=Vge(r,n.ranking),a=Tge(n.limit),o=new Set(n.scopes??Mge(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=gY(jge(e),{term:c,properties:Uge(r),boost:Wge(r),tolerance:Kge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=Hge(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=v9(f.values(),u);return y9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:_9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return y9(Xge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function b9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Xge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=v9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?_9(o,t,n,s,e.kind,m):g9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=b9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=b9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Zge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function Qge(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function $ge(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=Fr());var C9=S9[x9],w9=L({version:M().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:Zi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:R([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),e_e=L({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Zi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});L({schema:z(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:L({"claude-cowork":w9.optional(),"cli-hosts":w9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Ja(M(),e_e).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var T9=`bottom`,E9=e=>e*8+4,D9=E9(92),O9=E9(40);function t_e(e){return e===`right`||e===`bottom`?e:T9}function n_e(e){return typeof e!=`number`||!Number.isFinite(e)?D9:Math.max(O9,Math.round(e))}var r_e=new Set([`(connected)`,`(agent thread)`]);function i_e(e){return e!=null&&r_e.has(e)}var a_e=6e5,k9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function o_e(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??s_e,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new k9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function s_e(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function c_e(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function l_e(e){if(typeof e!=`string`||e.length===0)return e;let t=D3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(T3(e)){let t=c_e(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=C3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var u_e=`https://api.github.com/repos/inkeep/open-knowledge`;async function d_e(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(u_e,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}var f_e=/^(#{1,6})\s+(.+)$/;function p_e(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(f_e);if(!n)return null;let r=n[2].trim(),i=b7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var m_e=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function A9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=m_e;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var h_e={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},g_e=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],__e={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},v_e={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},j9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function y_e(e,t=g_e){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function b_e(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function x_e(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var S_e={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function C_e(e){return e?S_e[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function w_e(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function T_e(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function E_e(e){let[t]=w_e(e);return T_e(t,45,32)}var D_e=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],O_e=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],M9=`ok-user-name-v3`,N9=`ok-user-color-v3`;function P9(e){return e[Math.floor(Math.random()*e.length)]}function k_e(){return`${P9(D_e)} ${P9(O_e)}`}function A_e(){return P9(j9)}function F9(e){try{return localStorage.getItem(e)}catch{return null}}function I9(e,t){try{localStorage.setItem(e,t)}catch{}}function j_e(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=A9(),n=F9(M9),r=F9(N9);return n||(n=k_e(),I9(M9,n)),r||(r=A_e(),I9(N9,r)),{name:n,color:r,coeditor:e,tabId:t}}function L9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function M_e(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function N_e(e){return e.split(`/`).map(M_e).join(`/`)}function R9(e){return e.split(`/`).map(L9).join(`/`)}function z9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=L9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!G$.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=L9(d[e]??``);if(e===f&&(t=Ef(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function P_e(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var B9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function V9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function H9(e){return e.split(`/`).filter(Boolean)}function U9(e){let t=e.trim();return B9.test(t)||t.startsWith(`//`)}function F_e(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(U9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=R9(r<0?n:n.slice(0,r)),a=jf(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Af(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=z9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=V9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function I_e(e,t){let n=e.trim();if(!n)return null;if(U9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=V9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function L_e(e,t,n){let r=e.trim();if(!r||B9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:L9(e));return c.length===0?null:c.join(`/`)}function R_e(e,t,n=null,r=`.md`){let i=H9(e);i.pop();let a=H9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${N_e(l)}${r}${n?`#${n}`:``}`}function z_e(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var B_e=`unknown`;function V_e(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return B_e;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function H_e(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function W9(e){return`pagesBySlug`in e}function G9(e){return W9(e)?e.pages:e}function K9(e,t){return W9(e)?e.assetPaths??new Set:t??new Set}function q9(e,t){return W9(e)?e.filePaths??new Set:t??new Set}function J9(e,t){return e<t?-1:+(e>t)}function U_e(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);e&&(i===void 0||J9(r,i)<0)&&n.set(e,r)}return n}function W_e(e,t){let n=new Map,r=[...e].sort(J9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function G_e(e,t){let n=y7(e);if(!n)return;if(W9(t))return t.pagesBySlug.get(n);let r;for(let e of t)y7(e)===n&&(r===void 0||J9(e,r)<0)&&(r=e);return r}function K_e(e,t){if(e.includes(`/`))return;let n=y7(e);if(!n)return;if(W9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);y7(t===-1?e:e.slice(t+1))===n&&(r===void 0||J9(e,r)<0)&&(r=e)}return r}function Y9(e){let t=e.trim();if(!t)return[];let n=y7(t);return n.length>0&&n!==t?[n]:[]}function X9(e,t){let n=e.trim();if(!n)return;if(G9(t).has(n))return n;let r=n.replace(/\.(md|mdx)$/i,``);if(r!==n){let e=Z9(r,t);if(e!==void 0)return e}return Z9(n,t)}function Z9(e,t){let n=e.trim();if(!n)return;let r=G9(t);if(r.has(n))return n;let i=G_e(n,t);if(i)return i;for(let e of Y9(n))if(r.has(e))return e;return q_e(n,r)||K_e(n,t)}function q_e(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function Q9(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=Q9(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(J9)[0]??null}function J_e(...e){let t=new Set;for(let n of e)for(let e of n){let n=e.toLowerCase();t.add(`path:${n}`),t.add(`basename:${n.slice(n.lastIndexOf(`/`)+1)}`)}return t}function Y_e(e,t,n,r){let i=e.trim();if(!i)return!1;let a=Q9(i).toLowerCase(),o=W9(t)?t.assetTargetKeys:void 0;if(o!==void 0){if(o.has(`path:${a}`)||!a.includes(`/`)&&o.has(`basename:${a}`))return!0}else if($9(i,K9(t,n),q9(t,r)))return!0;return X9(i,t)!==void 0}function X_e(e,t,n){let r=I_e(e,t);return r===null||r.kind!==`asset`||$9(r.url,K9(n),q9(n))!==null||X9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{t7 as $,_T as $a,M as $c,DX as $i,_2 as $n,Dne as $o,rce as $r,Kf as $s,i9 as $t,q$ as A,wj as Aa,Hs as Ac,_Q as Ai,e2 as An,Yg as Ao,v1 as Ar,Eh as As,Loe as At,W0 as B,Mie as Ba,Vo as Bc,I0 as Bi,vQ as Bn,sm as Bo,R0 as Br,xne as Bs,She as Bt,u1 as C,gpe as Ca,fp as Cc,sge as Ci,Efe as Cn,g_ as Co,TQ as Cr,Vh as Cs,r1 as Ct,uhe as D,x7 as Da,af as Dc,T3 as Di,D$ as Dn,b_ as Do,Y0 as Dr,km as Ds,_oe as Dt,dhe as E,Q4 as Ea,Hf as Ec,G0 as Ei,YY as En,x_ as Eo,V9 as Er,Sp as Es,Sme as Et,Eme as F,Uk as Fa,$s as Fc,P$ as Fi,U_e as Fn,Gne as Fo,V_e as Fr,Sne as Fs,O1 as Ft,v3 as G,sD as Ga,Uo as Gc,z_e as Gi,wQ as Gn,Dh as Go,nce as Gr,_f as Gs,Dhe as Gt,xpe as H,CE as Ha,xs as Hc,t_e as Hi,F_e as Hn,Nm as Ho,Ese as Hr,mp as Hs,V7 as Ht,Tme as I,Mk as Ia,nc as Ic,g1 as Ii,R_e as In,Kne as Io,d_e as Ir,kp as Is,A1 as It,C1 as J,Lw as Ja,F as Jc,D3 as Ji,jQ as Jn,xh as Jo,tce as Jr,hf as Js,goe as Jt,Xme as K,cD as Ka,R as Kc,zoe as Ki,_1 as Kn,um as Ko,dce as Kr,gf as Ks,o9 as Kt,fhe as L,qk as La,ic as Lc,Zhe as Li,J_e as Ln,Wne as Lo,b7 as Lr,bne as Ls,Lhe as Lt,xme as M,yj as Ma,Zs as Mc,ume as Mi,zY as Mn,mg as Mo,efe as Mr,ih as Ms,jpe as Mt,s9 as N,vj as Na,zo as Nc,ime as Ni,r2 as Nn,G as No,C5 as Nr,_ne as Ns,t0 as Nt,ape as O,l2 as Oa,Js as Oc,Lpe as Oi,sZ as On,iv as Oo,fX as Or,oh as Os,U4 as Ot,R7 as P,ej as Pa,Bo as Pc,Dse as Pi,W_e as Pn,Hne as Po,x_e as Pr,sh as Ps,_he as Pt,K$ as Q,gT as Qa,I as Qc,OX as Qi,v2 as Qn,Rm as Qo,sce as Qr,Jf as Qs,R4 as Qt,z$ as R,Jk as Ra,Ho as Rc,MZ as Ri,Qge as Rn,Une as Ro,j_e as Rr,Ah as Rs,h_e as Rt,k9 as S,w1 as Sa,If as Sc,j1 as Si,P_e as Sn,q as So,Phe as Sr,Im as Ss,n1 as St,Cme as T,Boe as Ta,Ef as Tc,X7 as Ti,age as Tn,__ as To,B0 as Tr,Tm as Ts,phe as Tt,Wme as U,oE as Ua,Eo as Uc,n_e as Ui,nge as Un,Bm as Uo,C_e as Ur,gp as Us,whe as Ut,Mme as V,RE as Va,Us as Vc,y8 as Vi,$ge as Vn,am as Vo,V$ as Vr,yne as Vs,Che as Vt,j9 as W,AT as Wa,So as Wc,C3 as Wi,CQ as Wn,Vm as Wo,uce as Wr,Gf as Ws,The as Wt,E1 as X,zw as Xa,da as Xc,A9 as Xi,M5 as Xn,yh as Xo,cce as Xr,tf as Xs,F4 as Xt,T1 as Y,KE as Ya,P as Yc,Zge as Yi,MQ as Yn,bh as Yo,lce as Yr,mf as Ys,A4 as Yt,D1 as Z,Bw as Za,z as Zc,yoe as Zi,H2 as Zn,lm as Zo,ice as Zr,bf as Zs,P4 as Zt,U$ as _,U0 as _a,Nf as _c,$$ as _i,z0 as _n,J as _o,R9 as _r,Pp as _s,jhe as _t,hme as a,X_e as aa,Sf as ac,F1 as ai,qe as al,C4 as an,qE as ao,h2 as ar,Sh as as,Epe as at,EQ as b,rfe as ba,Of as bc,M1 as bi,PZ as bn,K as bo,Q0 as br,Zp as bs,Yme as bt,Coe as c,l_e as ca,wf as cc,Ooe as ci,iee as cl,S0 as cn,Qw as co,xX as cr,Dp as cs,h7 as ct,gge as d,Y4 as da,xf as dc,U9 as di,Ue as dl,l1 as dn,VE as do,y$ as dr,dm as ds,qde as dt,kY as ea,Vd as ec,$se as ei,pee as el,H7 as en,$w as eo,m2 as er,Xp as es,Z4 as et,bge as f,Yge as fa,Zf as fc,Ope as fi,c1 as fn,yC as fo,Ppe as fr,Zm as fs,e0 as ft,hge as g,ige as ga,Bf as gc,G5 as gi,Cpe as gn,uv as go,Oge as gr,hne as gs,d2 as gt,vge as h,spe as ha,Wf as hc,upe as hi,wpe as hn,oC as ho,Age as hr,qp as hs,u2 as ht,ahe as i,$9 as ia,Cf as ic,TY as ii,Ke as il,w4 as in,jT as io,B2 as ir,Ch as is,vpe as it,vhe as j,gj as ja,ec as jc,sme as ji,t2 as jn,W as jo,Ape as jr,jp as js,X4 as jt,T9 as k,u9 as ka,Ys as kc,xoe as ki,N$ as kn,G_ as ko,p$ as kr,wp as ks,bme as kt,kme as l,H_e as la,Qd as lc,Moe as li,$e as ll,Ihe as ln,NT as lo,b_e as lr,uh as ls,Toe as lt,_ge as m,cpe as ma,Ff as mc,w3 as mi,voe as mn,ES as mo,G3 as mr,kne as ms,W5 as mt,v_e as n,z9 as na,ff as nc,oce as ni,Lt as nl,U7 as nn,uT as no,g2 as nr,nm as ns,Fme as nt,Eoe as o,X9 as oa,$d as oc,Ipe as oi,Xe as ol,Rhe as on,gw as oo,p2 as or,jm as os,ehe as ot,yge as p,Voe as pa,Tf as pc,o4 as pi,a_e as pn,CS as po,E8 as pr,rh as ps,wfe as pt,bue as q,aD as qa,bo as qc,L0 as qi,y_e as qn,vh as qo,ece as qr,pf as qs,oge as qt,ihe as r,Soe as ra,cp as rc,Yhe as ri,nee as rl,Vhe as rn,dT as ro,e4 as rr,wh as rs,Jme as rt,Doe as s,x$ as sa,Jd as sc,Aoe as si,Qe as sl,Y$ as sn,qC as so,f2 as sr,Am as ss,e1 as st,__e as t,L_e as ta,Yf as tc,ace as ti,Vt as tl,Qhe as tn,cT as to,t4 as tr,om as ts,L1 as tt,Ome as u,p_e as ua,pp as uc,J$ as ui,ze as ul,yhe as un,iD as uo,b$ as ur,rm as us,O9 as ut,H$ as v,gQ as va,dp as vc,i_e as vi,H0 as vn,Sv as vo,E_e as vr,Bne as vs,t1 as vt,P7 as w,y7 as wa,nf as wc,Ohe as wi,Tfe as wn,d_ as wo,B$ as wr,Om as ws,hhe as wt,W$ as x,pQ as xa,Rf as xc,Y_e as xi,$2 as xn,ov as xo,Npe as xr,Dm as xs,D9 as xt,xQ as y,$0 as ya,Uf as yc,a4 as yi,Kme as yn,Tv as yo,Z$ as yr,Km as ys,Q$ as yt,K0 as z,Fk as za,Wo as zc,S5 as zi,o_e as zn,Qp as zo,Y9 as zr,Tp as zs,Ehe as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Zs as e}from"./dist-
|
|
1
|
+
import{Zs as e}from"./dist-DmvVdMAc.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(b)||e.startsWith(w)||e.startsWith(T)||e.startsWith(D)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=x(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function r(e){if(e.startsWith(b)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}var i=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;function a(e){return encodeURIComponent(e.replace(i,`�`))}function o(e){return e.split(`/`).map(a).join(`/`)}function s(e,t){let n=`#/${o(e)}`;return t?`${n}#${a(t)}`:n}function c(e,t){return e===t||l(e)===l(t)}function l(e){try{return decodeURIComponent(e)}catch{return e}}var u=`__okHashHistoryEntry`;function d(e){return{...typeof e==`object`&&e?e:{},[u]:!0}}function f(e){return typeof e==`object`&&!!e&&e[u]===!0}function p(){f(window.history.state)||window.history.replaceState(d(window.history.state),``)}function m(e){let{pathname:t,search:n}=window.location;window.history.replaceState(d(window.history.state),``,`${t}${n}${e}`)}function h(e){if(c(window.location.hash,e))return;let{pathname:t,search:n}=window.location;window.history.pushState(d(window.history.state),``,`${t}${n}${e}`)}function g(e){let t=e.toLowerCase();return t.endsWith(`.mdx`)?e.slice(0,-4):t.endsWith(`.md`)?e.slice(0,-3):e}function _(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${o(n)}/`:`#/`;return t?`${r}#${a(t)}`:r}function v(e,t,n){if(e===`folder`)return _(t);let r=`#/${a(t)}`;return n==null||n===``?r:`${r}?branch=${a(n)}`}function y(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var b=`#/__asset__/`;function x(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function S(e){if(!e.startsWith(b))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function C(e){return`${b}${o(e)}`}var w=`#/__skill-file__/`,T=`#/__skills__`;function E(e){return e===T||e.startsWith(`${T}/`)}var D=`#/__skill-preview__/`,O=[`explore`,`detected`,`builtin`,`foreign`,`linked`];function k(e){return e!==void 0&&O.includes(e)}var A=`project`;function j(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??A].map(a).join(`/`)}function M(e){if(!e)return null;let n;try{n=e.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<4||n.length>6)return null;let[r,i,a,o,s,c]=n;return!k(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function N(e){let t=j(e);return e.path&&(t+=`/${a(e.path)}`),`${D}${t}`}function P(e){return e.startsWith(D)?M(e.slice(20)):null}var F=`:`;function I(e){let t=e.host===void 0?e.name:`${e.name}${F}${e.host}`;return`${w}${[e.scope,t].map(a).join(`/`)}/${o(e.path)}`}function L(e){if(!e.startsWith(w))return null;let n=e.slice(17);if(!n)return null;let r;try{r=n.split(`/`).map(decodeURIComponent)}catch{return null}if(r.length<3)return null;let[i,a,...o]=r,s=o.join(`/`);if(!i||!a||!s||!t(i))return null;let c=a.indexOf(F),l=c===-1?a:a.slice(0,c),u=c===-1?void 0:a.slice(c+1);return l?{scope:i,name:l,path:s,...u?{host:u}:{}}:null}var R=/\.(md|mdx)$/i;function z(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function B(e){return z(e).replace(R,``)}function V(e){let t=z(e);return t?R.test(t)?t:`${t}.md`:`untitled.md`}function H(e){let t=B(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{P as C,L as S,f as _,S as a,h as b,v as c,C as d,s as f,y as g,N as h,r as i,j as l,I as m,V as n,M as o,_ as p,B as r,n as s,H as t,g as u,c as v,E as w,m as x,p as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./config-provider-
|
|
1
|
+
import{p as e}from"./config-provider-myFxAeZJ.js";var t=new WeakMap;function n(n,r){let i=t.get(r);if(i)return i;let a=new e(r);t.set(r,a);let o=r.doc,s=!1,c=()=>{s||(s=!0,n.off(`destroy`,c),o?.off(`destroy`,c),t.get(r)===a&&t.delete(r),a.clear(),a.destroy())};return n.on(`destroy`,c),o?.on(`destroy`,c),a}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e}from"./dist-
|
|
1
|
+
import{N as e}from"./dist-DmvVdMAc.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}function o(e){return e.includes(`local-targets`)||e.includes(`files`)}var s=`open-knowledge:doc-persisted`;function c(e){window.dispatchEvent(new CustomEvent(s,{detail:{docName:e}}))}function l(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail?.docName;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}var u=`open-knowledge:branch-changed`;function d(e){window.dispatchEvent(new CustomEvent(u,{detail:{branch:e}}))}function f(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}var p=`open-knowledge:templates-changed`;function m(){window.dispatchEvent(new CustomEvent(p))}function h(e){let t=()=>e();return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}var g=`open-knowledge:skills-changed`;function _(){window.dispatchEvent(new CustomEvent(g))}function v(e){let t=()=>e();return window.addEventListener(g,t),()=>window.removeEventListener(g,t)}var y=`open-knowledge:skill-scope-moved`;function b(e){window.dispatchEvent(new CustomEvent(y,{detail:e}))}function x(e){let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}var S=new Set,C=(e,t)=>`${e}\u0000${t}`;function w(e,t){S.add(C(e,t)),_()}function T(e,t){S.delete(C(e,t))&&_()}var E=new Map;function D(e,t){let n=C(e,t);E.set(n,(E.get(n)??0)+1),_()}function O(e,t){let n=C(e,t),r=E.get(n);r!==void 0&&(r<=1?E.delete(n):E.set(n,r-1),_())}function k(e,t){return E.has(C(e,t))}function A(){return[...E.keys()].sort().join(``)}function j(e,t){return S.has(C(e,t))}function M(e){return S.size===0?e:e.filter(e=>!S.has(C(e.scope,e.name)))}export{l as _,c as a,v as b,_ as c,O as d,o as f,f as g,A as h,d as i,m as l,k as m,w as n,i as o,j as p,D as r,b as s,M as t,T as u,a as v,h as x,x as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ds as e,Ts as t,bs as n,xs as r}from"./dist-
|
|
1
|
+
import{Ds as e,Ts as t,bs as n,xs as r}from"./dist-DmvVdMAc.js";import{d as i,f as a,p as o}from"./doc-paths-CU5xFEmw.js";import{i as s}from"./navigation-targets-BX0D_UPk.js";import{c,l,s as u}from"./file-tree-utils-B-KHAA0w.js";import{t as d}from"./file-tree-rename-validation-yP35dKA0.js";var f=`application/x-open-knowledge-sidebar-item+json`,p={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0,excalidraw:!0};function m(e){return JSON.stringify(e)}function h(e){return e?Array.from(e.types).includes(f):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:o(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:i(e.assetPath)}:{target:s(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:a(e.docName)}}function g(e){if(!e||!h(e))return null;let t=e.getData(f);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!v(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`&&Object.hasOwn(p,e)}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,i=y){return b.test(e)||t(e)||r(e)||n(e)?e:`${e}${i}`}function S(e){return $(e).replace(b,``)}function C(e,t){let n=$(e),r=k(t),i=t.find(e=>c(e)&&A(e,r)===n)??t.find(e=>c(e)&&T(e)===n);if(i)return i.docName;let a=S(n);return t.find(e=>{let t=T(e);return t!==n&&b.test(t)&&S(t)===a})&&b.test(n)?n:a}function w(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>T(t)===e)}function T(e){return l(e)?O(e.path):u(e)?e.path:x(e.docName,e.docExt)}function E(e){let t=$(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return $(e)}function O(e){let t=$(e.trim());return t?`${t}/`:``}function te(e){return e.endsWith(`/`)?D(e):S(e)}function k(e){let t=new Map;for(let n of e){if(!c(n))continue;let e=n.docName.match(b);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=T(e);if(!c(e))return n;let r=e.docName.match(b);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??y}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(l(r)||u(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(l(r)){let e=O(r.path);e&&n.add(e)}let i=l(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>c(e)&&e.docName===t);return i?i.docExt??y:Q(e).includes(`.`)?void 0:y}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!u(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(E(e))return null;let r=n.find(e=>u(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?D(e.path):C(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?D(e.path):e.path}function V(e,t){return t?O(e):b.test(e)?e:`${e}${y}`}function H(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${D(t)}/index${y}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return D(O(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(t,n){let r=d(t).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:S(t),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:t,assetExt:a,mediaKind:e(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{g as A,z as C,f as D,J as E,h as O,C as S,te as T,G as _,U as a,D as b,j as c,T as d,X as f,V as g,Y as h,W as i,m as j,ee as k,N as l,O as m,P as n,H as o,w as p,F as r,x as s,q as t,Z as u,B as v,M as w,S as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dc as e,pi as t,yi as n}from"./dist-
|
|
1
|
+
import{dc as e,pi as t,yi as n}from"./dist-DmvVdMAc.js";function r(e){return e.kind===`asset`}function i(e){return e.kind===`document`}function a(e){return e.kind===`folder`}function o(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??s(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function s(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function c(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function l(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function u(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function d(e,t){return t&&e!==`document`&&e!==`folder`}function f(e,n){return!n&&t(e)}function p(e,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return e.filter(e=>{let r=e.docName??e.path??``;if(r===``||d(e.kind,a))return!1;let s=r.split(`/`),c=s.indexOf(`.ok`);if(c!==-1){if(!o)return!1;let e=s.slice(0,c).join(`/`);return i||e===``||!t(e)}return n(r)?!1:!f(r,i)})}function m(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=t.docName??t.path??``;return o===``||e(o)||n(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(t.kind,a)}}function h(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{p as a,i as c,o as d,l as i,a as l,h as n,u as o,c as r,r as s,m as t,s as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./documents-events-
|
|
1
|
+
import{l as e}from"./documents-events-DChefUoE.js";import{t}from"./parse-api-error-BtEdpaFC.js";import{t as n}from"./createLucideIcon-B6ULg5PN.js";var r=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(t){try{let n=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(t,n){try{let r=`?folder=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return e(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(t){try{let n=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(t){try{let n=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
|