@inkeep/open-knowledge 0.47.4 → 0.47.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/{acp-harness-probe-B1Hzf1SD.mjs → acp-harness-probe-inKMbnTO.mjs} +2 -2
- package/dist/cli.mjs +57 -57
- package/dist/constants-iJqy8Hia.mjs +2 -0
- package/dist/{git-handle-CllEzrX4.mjs → git-handle-BKNpWc-0.mjs} +2 -2
- package/dist/git-handle-vAOkZizz.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-Bp0b6aXB.mjs +1 -0
- package/dist/{init-CB3lq_i9.mjs → init-D0r4e25M.mjs} +3 -3
- package/dist/{launch-json-removal-DfaHcfms.mjs → launch-json-removal-p9WHQkrd.mjs} +2 -2
- package/dist/loader-C6qDEjnp.mjs +1 -0
- package/dist/{loader-7y3WQNVR.mjs → loader-DI6RYqwy.mjs} +2 -2
- package/dist/md-manager-BuZAb56s.mjs +2 -0
- package/dist/{open-browser-BXJKGvZF.mjs → open-browser-BGPHwSRQ.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-CcFBEKQd.mjs → preview-B-2W99IX.mjs} +2 -2
- package/dist/preview-CITNy9Et.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-2l8BA531.js → ActivityModeContent-Cs_G4A2z.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-wqdF9lpR.js → AgentDiffPane-CWfs6hRd.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-56IhVeqo.js → AgentThreadClientBinder-GaJMQpHN.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-eT1ODdAD.js → ChangedOutsideBadge-DhOK_p1U.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-L7fbBlLy.js → CodeMirrorPropInput-DvoNWmdR.js} +1 -1
- package/dist/public/assets/{DocumentContext-DD95gIt4.js → DocumentContext-BaYg4CBg.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CR5jA0YM.js → EditorModeToggle-C9I-Efpm.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-C5fNw26t.js → EnableSyncConfirmDialog-DCen-fKk.js} +1 -1
- package/dist/public/assets/FeedbackForm-EBcXu2CA.js +1 -0
- package/dist/public/assets/{GraphPanel-BDGxPSvY.js → GraphPanel-B9HMPssx.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-B2ilfqxe.js → ImportSkillDialog-BjLITatU.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-ByUOzhaw.js → LintConfigEditor-D6dnss9h.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-CVGjtd3P.js → ManagedArtifactProperties-BO70pd59.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BkBzFhn7.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-B3ubISnW.js → McpConsentDialogBody-CZC9r_Ug.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CftVeU4U.js → MermaidDocEditor-C6SV6GjT.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CWbkwdNL.js → ReportBugDialogBody-BZrgGB1Z.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-UkvF3UAn.js → SchemaConfigEditor-BYBjMHsb.js} +1 -1
- package/dist/public/assets/{SessionsHost-Pa6hY3sI.js → SessionsHost-llsZYWbP.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Be8P3Vqa.js → SettingsDialogBody-DXaeMFz_.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BmGWQCY6.js → ShareBranchSwitchDialog-DUzjoGVJ.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BoqZXYhT.js → ShareReceiveDialog-BQhhG70Y.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-B_DT1dz2.js → ShareReceiveMissDialog-CaI0eq9C.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-hcLaEQ2F.js → SkillEditBanner-WG0cwpb-.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-CtSdZ4_j.js → SkillOriginInline-8KJ3qbz8.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DQYbvJTe.js → SkillToolbarControls-LDRTNFTx.js} +1 -1
- package/dist/public/assets/{SourceEditor-DX9L1Mci.js → SourceEditor-nYPGo8QU.js} +1 -1
- package/dist/public/assets/{TerminalPanel-WTiFd3Z6.js → TerminalPanel-CkcArSmy.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CnhrK_tv.js → TerminalWindowApp-COjq6Uas.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BGlQEeBq.js → TextDocEditor-eS5P-G2H.js} +1 -1
- package/dist/public/assets/{ThreadView-CExveDEV.js → ThreadView-v9Y3Ih_a.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DDFvXSlv.js → TimelineDiffPane-3nkpH5uW.js} +1 -1
- package/dist/public/assets/{agent-diff-store-jazihC28.js → agent-diff-store-PJFwSxS1.js} +1 -1
- package/dist/public/assets/{agent-visibility-Ch0XQMkJ.js → agent-visibility-Cieocxzz.js} +1 -1
- package/dist/public/assets/{auth-state-cache-D47fide1.js → auth-state-cache-B8KE-_17.js} +1 -1
- package/dist/public/assets/{client-version-CHRlMl4l.js → client-version-uMlMQx33.js} +1 -1
- package/dist/public/assets/{config-context-B2fceTMP.js → config-context-BIynQsCe.js} +1 -1
- package/dist/public/assets/{config-provider-Cb43FIW2.js → config-provider-DKj_NBqh.js} +1 -1
- package/dist/public/assets/{dist-5ovMzVKN2.js → dist-CrqBb5y32.js} +175 -175
- package/dist/public/assets/{doc-paths-BFNbv2er.js → doc-paths-CCYuGvJq.js} +1 -1
- package/dist/public/assets/{documents-events-BM8xyAJz.js → documents-events-CdU1iFH9.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-C1zJK1Gk.js → file-tree-adapter-a1hBKu8z.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Dma5c4k_.js → file-tree-utils-CClHAhYa.js} +1 -1
- package/dist/public/assets/{folder-config-api-BxuLFuqM.js → folder-config-api-6QhNU0oa.js} +1 -1
- package/dist/public/assets/{index-DlH6tzhG.js → index-kaTVsIsC.js} +108 -108
- package/dist/public/assets/{lint-config-client-DDxBMTZk.js → lint-config-client-B0H2okzr.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-c2Uv_5Ry.js → markdownlint-rule-browser-BXGIkBuD.js} +1 -1
- package/dist/public/assets/{navigation-targets-D9VW9WdW.js → navigation-targets-BwmQHp3k.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-CLwVAGCD.js → open-managed-artifact-tab-BzW5kLR0.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BmcjNZOu.js → pending-receive-nav-store-B1W7hvut.js} +1 -1
- package/dist/public/assets/{prop-types-BPmLSxhG.js → prop-types-DIaGyPZM.js} +1 -1
- package/dist/public/assets/{receive-store-BlAqmJZT.js → receive-store-DlIsfkuF.js} +1 -1
- package/dist/public/assets/{selection-context-DJvv-kK_.js → selection-context-DS--IqEv.js} +1 -1
- package/dist/public/assets/{skill-actions-CfQkZqK6.js → skill-actions-DCISbh85.js} +2 -2
- package/dist/public/assets/skill-scope-7fBhGcjl.js +1 -0
- package/dist/public/assets/{skills-api-BTy9LAk0.js → skills-api-wUsPYcxD.js} +1 -1
- package/dist/public/assets/{src-hNXjwMT1.js → src-ScxRfF8q.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DVdwNfBT.js → tag-pill-input-Bx_oWl-2.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-C6AhTsfc.js → target-navigation-intent-D2TXEip5.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-B1DGOVIv.js → terminal-launch-events-B3gBFWc1.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CviFLmIq.js → terminal-telemetry-Bv3GE2Aw.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B4AQIJp7.js → typing-burst-detector-lX1cLLkC.js} +2 -2
- package/dist/public/assets/{uninstall-CfW-qETg.js → uninstall-BILpXTW1.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D8pDT3xu.js → use-activity-panel-CxtCUEYv.js} +1 -1
- package/dist/public/assets/{use-collab-url-CUHlgRv5.js → use-collab-url-BjRhUqsT.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-CLCjRdjJ.js → use-live-xterm-theme-Cvtrg0j6.js} +1 -1
- package/dist/public/assets/{use-open-skill-akwbVkG4.js → use-open-skill-BHdzD0v1.js} +1 -1
- package/dist/public/assets/{use-settings-route-BnOIfxuB.js → use-settings-route-aXWIMVRt.js} +1 -1
- package/dist/public/assets/{use-skill-directory-CSx9txvQ.js → use-skill-directory-BV092Gnw.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DvSOmIz_.js → use-skill-origin-DMt7ay7U.js} +1 -1
- package/dist/public/assets/{use-skills-DcLUuUJ9.js → use-skills-C7huRzJa.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CgG0yd-l.js → use-terminal-enabled-C5zv0ln-.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DD-1OHsM.js → use-timeline-entry-diff-EbqHCjsV.js} +1 -1
- package/dist/public/assets/{use-workspace-J5QvjwOx.js → use-workspace-D80aSSBD.js} +1 -1
- package/dist/public/index.html +41 -41
- package/dist/public/uninstall.html +2 -2
- package/dist/{repair-launch-json-C-n2O-Po.mjs → repair-launch-json-CSPeJG-m.mjs} +2 -2
- package/dist/{repair-mcp-configs-BOlWztB-.mjs → repair-mcp-configs-Basw3obQ.mjs} +2 -2
- package/dist/{repair-skills-IlcXRdDC.mjs → repair-skills-CXOdNyyU.mjs} +2 -2
- package/dist/repair-skills-CdFjRSeM.mjs +1 -0
- package/dist/{server-lock-CmYdHyX7.mjs → server-lock-9wk8At58.mjs} +2 -2
- package/dist/server-lock-DxjYF04b.mjs +1 -0
- package/dist/src-7fluFHtm.mjs +1 -0
- package/dist/{src-BS7drzIV.mjs → src-BA6UmYHS.mjs} +318 -318
- package/dist/{src-C-GJXht_.mjs → src-D81OiBLA.mjs} +2 -2
- package/dist/{src-CHSJwcpc.mjs → src-Dkrbi5Bh.mjs} +87 -87
- package/dist/start-B5xwD4lL.mjs +1 -0
- package/dist/{start-BITNJysu.mjs → start-DUP_Th9B.mjs} +3 -3
- package/dist/{write-project-skill-CzrMSTf3.mjs → write-project-skill-D_i5y_ki.mjs} +4 -4
- package/package.json +5 -5
- package/dist/constants-BpeoO1T6.mjs +0 -2
- package/dist/git-handle-DJPLRe3o.mjs +0 -1
- package/dist/init-BGPGjp1S.mjs +0 -1
- package/dist/loader-BeuP5hjg.mjs +0 -1
- package/dist/md-manager-DqRVEVmJ.mjs +0 -2
- package/dist/preview-lBskg3BM.mjs +0 -1
- package/dist/public/assets/FeedbackForm-macxQS8x.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-m1GRSrIt.js +0 -1
- package/dist/public/assets/skill-scope-DwJ84s_r.js +0 -1
- package/dist/repair-skills-3_7Dtv4E.mjs +0 -1
- package/dist/server-lock-D61z37T2.mjs +0 -1
- package/dist/src-BWFntIGk.mjs +0 -1
- package/dist/start-DPqozQkA.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{fo as r}from"./src-Dkrbi5Bh.mjs";import{delimiter as i,normalize as a,resolve as o}from"node:path";import{existsSync as s,statSync as c}from"node:fs";import{homedir as l}from"node:os";import{EventEmitter as u}from"node:events";import{spawn as d}from"child_process";var f=n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),p=n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=f(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),m=n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=p()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),ee=n(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),te=n(((t,n)=>{let r=e(`os`),i=e(`tty`),a=ee(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION);if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}n.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}})),ne=n(((t,n)=>{let r=e(`tty`),i=e(`util`);t.init=d,t.log=c,t.formatArgs=o,t.save=l,t.load=u,t.useColors=a,t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=te();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in t.inspectOpts?!!t.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+t+` `+e[0]}function s(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...e){return process.stderr.write(i.formatWithOptions(t.inspectOpts,...e)+`
|
|
4
4
|
`)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}n.exports=p()(t);let{formatters:f}=n.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(`
|
|
@@ -7,4 +7,4 @@ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{mo as r}from"./src
|
|
|
7
7
|
`)){let e=it(i,`
|
|
8
8
|
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var Tn,En=S({"src/lib/responses/ConfigList.ts"(){q(),Tn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=O(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Dn(e,t){return typeof e==`string`&&Object.hasOwn(Mn,e)?e:t}function On(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function kn(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return Sn(t,e)}}}function An(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return xn(e)}}}function jn(){return{addConfig(e,t,...n){return this._runTask(On(e,t,n[0]===!0,Dn(n[1],`local`)),G(arguments))},getConfig(e,t){return this._runTask(kn(e,Dn(t,void 0)),G(arguments))},listConfig(...e){return this._runTask(An(Dn(e[0],void 0)),G(arguments))}}}var Mn,Nn=S({"src/lib/tasks/config.ts"(){En(),q(),Mn=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(Mn||{})}});function Pn(e){return In.has(e)}var Fn,In,Ln=S({"src/lib/tasks/diff-name-status.ts"(){Fn=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(Fn||{}),In=new Set(Object.values(Fn))}});function Rn(...e){return new Wn().param(...e)}function zn(e){let t=new Set,n={};return st(e,e=>{let[r,i,a]=e.split(I);t.add(r),(n[r]=n[r]||[]).push({line:N(i),path:r,preview:a})}),{paths:t,results:n}}function Bn(){return{grep(e){let t=G(arguments),n=W(arguments);for(let e of Vn)if(n.includes(e))return this._runTask(J(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=Rn().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return zn(e)}},t)}}}var Vn,Hn,Un,Wn,Gn=S({"src/lib/tasks/grep.ts"(){q(),X(),Vn=[`-h`],Hn=Symbol(`grepQuery`),Wn=class{constructor(){this[Un]=[]}*[(Un=Hn,Symbol.iterator)](){for(let e of this[Hn])yield e}and(...e){return e.length&&this[Hn].push(`--and`,`(`,...P(e,`-e`),`)`),this}param(...e){return this[Hn].push(...P(e,`-e`)),this}}}}),Kn={};C(Kn,{ResetMode:()=>Xn,getResetMode:()=>Jn,resetTask:()=>qn});function qn(e,t){let n=[`reset`];return Yn(e)&&n.push(`--${e}`),n.push(...t),Y(n)}function Jn(e){if(Yn(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function Yn(e){return typeof e==`string`&&Zn.includes(e)}var Xn,Zn,Qn=S({"src/lib/tasks/reset.ts"(){q(),X(),Xn=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(Xn||{}),Zn=M(Object.values(Xn))}});function $n(){return(0,ue.default)(`simple-git`)}function er(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function tr(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function nr(e,t,n,r=$n()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=tr(z(t,V),o,r);return l(n);function c(t,n){return A(a,nr(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&er(o,n)||L,s=er(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var rr=S({"src/lib/git-logger.ts"(){q(),ue.default.formatters.L=e=>String(xt(e)?e.length:`-`),ue.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):R(e)}}),ir,ar=S({"src/lib/runners/tasks-pending-queue.ts"(){E(),rr(),ir=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:nr(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new T(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function Z(e,t){return{method:at(e.commands)||``,commands:t}}function or(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function sr(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var cr,lr=S({"src/lib/runners/git-executor-chain.ts"(){E(),X(),q(),ar(),cr=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new ir}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(an(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof T?Object.assign(t,{task:e}):new T(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,Z(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...Z(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),rn(e)?It(e.parser,a):It(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...Z(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,R(e)),c(new Tt(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new Tt(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},Z(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...Z(e,n),kill(e){u=e||u}});let f=d(t,n,o);f.stdout.on(`data`,sr(c,`stdOut`,i,a.step(`stdOut`))),f.stderr.on(`data`,sr(l,`stdErr`,i,a.step(`stdErr`))),f.on(`error`,or(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,f.stdout,f.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...Z(e,n),spawned:f,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){f.killed||(u=e,f.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...Z(e,t),kill(e){n=e||n}}),n}}}}),ur={};C(ur,{GitExecutor:()=>dr});var dr,fr=S({"src/lib/runners/git-executor.ts"(){lr(),dr=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new cr(this,this._scheduler,this._plugins)}chain(){return new cr(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function pr(e,t,n=L){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof $e?mr(t):t,void 0)})}function mr(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=L};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var hr=S({"src/lib/task-callback.ts"(){D(),q()}});function gr(e,t){return tn(n=>{if(!ct(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var _r=S({"src/lib/tasks/change-working-directory.ts"(){q(),X()}});function vr(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=ut(t,`-B`)),Y(t)}function yr(){return{checkout(){return this._runTask(vr(W(arguments,1)),G(arguments))},checkoutBranch(e,t){return this._runTask(vr([`-b`,e,t,...W(arguments)]),G(arguments))},checkoutLocalBranch(e){return this._runTask(vr([`-b`,e,...W(arguments)]),G(arguments))}}}var br=S({"src/lib/tasks/checkout.ts"(){q(),X()}});function xr(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Sr(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return K(xr(),[Cr],e)}})}}}var Cr,wr=S({"src/lib/tasks/count-objects.ts"(){q(),Cr=new H(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=dt(t);Object.hasOwn(e,r)&&(e[r]=N(n))})}});function Tr(e){return K({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Er,e)}var Er,Dr=S({"src/lib/parsers/parse-commit.ts"(){q(),Er=[new H(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new H(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new H(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new H(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Or(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...P(e,`-m`),...t,...n],format:`utf-8`,parser:Tr}}function kr(){return{commit(t,...n){let r=G(arguments),i=e(t)||Or(j(t),j(z(n[0],bt,[])),[...M(z(n[1],B,[])),...W(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!bt(e)&&J(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Ar=S({"src/lib/tasks/commit.ts"(){Dr(),q(),X()}});function jr(){return{firstCommit(){return this._runTask(Y([`rev-list`,`--max-parents=0`,`HEAD`],!0),G(arguments))}}}var Mr=S({"src/lib/tasks/first-commit.ts"(){q(),X()}});function Nr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),Y(n,!0)}var Pr=S({"src/lib/tasks/hash-object.ts"(){X()}});function Fr(e,t,n){let r=String(n).trim(),i;if(i=Lr.exec(r))return new Ir(e,t,!1,i[1]);if(i=Rr.exec(r))return new Ir(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new Ir(e,t,/^re/i.test(r),a)}var Ir,Lr,Rr,zr=S({"src/lib/responses/InitSummary.ts"(){Ir=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Lr=/^Init.+ repository in (.+)$/,Rr=/^Rein.+ in (.+)$/}});function Br(e){return e.includes(Hr)}function Vr(e=!1,t,n){let r=[`init`,...n];return e&&!Br(r)&&r.splice(1,0,Hr),{commands:r,format:`utf-8`,parser(e){return Fr(r.includes(`--bare`),t,e)}}}var Hr,Ur=S({"src/lib/tasks/init.ts"(){zr(),Hr=`--bare`}});function Wr(e){for(let t=0;t<e.length;t++){let n=Kr.exec(e[t]);if(n)return`--${n[1]}`}return``}function Gr(e){return Kr.test(e)}var Kr,qr=S({"src/lib/args/log-format.ts"(){Kr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Jr,Yr=S({"src/lib/responses/DiffSummary.ts"(){Jr=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Xr(e=``){let t=ti[e];return e=>K(new Jr,t,e,!1)}var Zr,Qr,$r,ei,ti,ni=S({"src/lib/parsers/parse-diff-summary.ts"(){qr(),Yr(),Ln(),q(),Zr=[new H(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:N(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new H(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:N(n),after:N(r),binary:!0})}),new H(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=N(t),e.insertions=N(r?.[1]),e.deletions=N(i?.[1])})],Qr=[new H(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=N(t),a=N(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new H(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],$r=[new H(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ei=[new H(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:mt(Pn(t)&&t),from:mt(!!a&&r!==a&&r),similarity:N(n)})})],ti={"":Zr,"--stat":Zr,"--numstat":Qr,"--name-status":ei,"--name-only":$r}}});function ri(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function ii(e=si,t=ci,n=``){let r=Xr(n);return function(n){let i=k(n.trim(),!1,ai).map(function(n){let i=n.split(oi),a=ri(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var ai,oi,si,ci,li=S({"src/lib/parsers/parse-list-log-summary.ts"(){q(),ni(),qr(),ai=`òòòòòò `,oi=` òò`,si=` ò `,ci=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),ui={};C(ui,{diffSummaryTask:()=>di,validateLogFormatConfig:()=>fi});function di(e){let t=Wr(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),fi(n)||{commands:n,format:`utf-8`,parser:Xr(t)}}function fi(e){let t=e.filter(Gr);if(t.length>1)return J(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return J(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var pi=S({"src/lib/tasks/diff.ts"(){qr(),ni(),X()}});function mi(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function hi(e){return Object.keys(e).reduce((t,n)=>(n in yi||(t[n]=e[n]),t),{})}function gi(e={},t=[]){let n=z(e.splitter,V,si),[r,i]=mi(_t(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${ai}${i}${oi}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return V(e.file)&&o.push(`--follow`,se(e.file)),Mt(hi(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function _i(e,t,n){let r=ii(e,t,Wr(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function vi(){return{log(...n){let r=G(arguments),i=gi(Pt(arguments),M(z(arguments[0],B,[]))),a=t(...n)||fi(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return _i(e.splitter,e.fields,e.commands)}function t(e,t){return V(e)&&V(t)&&J(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var yi,bi=S({"src/lib/tasks/log.ts"(){qr(),li(),q(),X(),pi(),yi=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(yi||{})}}),xi,Si,Ci=S({"src/lib/responses/MergeSummary.ts"(){xi=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Si=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),wi,Ti,Ei=S({"src/lib/responses/PullSummary.ts"(){wi=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ti=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Di(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Oi(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:N(t&&t[1]||`0`),delta:N(n&&n[1]||`0`)}}var ki,Ai=S({"src/lib/parsers/parse-remote-objects.ts"(){q(),ki=[new U(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Di(e.remoteMessages);Object.assign(i,{[r]:N(n)})}),new U(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Di(e.remoteMessages);Object.assign(i,{[r]:N(n)})}),new U(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Di(e.remoteMessages);i.total=Oi(t),i.reused=Oi(n),i.packReused=N(r)})]}});function ji(e,t){return K({remoteMessages:new Ni},Mi,t)}var Mi,Ni,Pi=S({"src/lib/parsers/parse-remote-messages.ts"(){q(),Ai(),Mi=[new U(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...ki,new U([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new U([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:N(t),summary:n,url:r}})],Ni=class{constructor(){this.all=[]}}}});function Fi(e,t){let n=K(new Ti,Bi,[e,t]);return n.message&&n}var Ii,Li,Ri,zi,Bi,Vi,Hi,Ui=S({"src/lib/parsers/parse-pull.ts"(){Ei(),q(),Pi(),Ii=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Li=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ri=/^(create|delete) mode \d+ (.+)/,zi=[new H(Ii,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new H(Li,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new H(Ri,(e,[t,n])=>{A(e.files,n),A(t===`create`?e.created:e.deleted,n)})],Bi=[new H(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new H(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new H(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Vi=(e,t)=>K(new wi,zi,[e,t]),Hi=(e,t)=>Object.assign(new wi,Vi(e,t),ji(e,t))}}),Wi,Gi,Ki,qi=S({"src/lib/parsers/parse-merge.ts"(){Ci(),q(),Ui(),Wi=[new H(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new H(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new xi(t,n))}),new H(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new xi(t,n,{deleteRef:r}))}),new H(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new xi(t,null))}),new H(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Gi=(e,t)=>Object.assign(Ki(e,t),Hi(e,t)),Ki=e=>K(new Si,Wi,e)}});function Ji(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=Gi(e,t);if(n.failed)throw new $e(n);return n}}:J(`Git.merge requires at least one option`)}var Yi=S({"src/lib/tasks/merge.ts"(){D(),qi(),X()}});function Xi(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var Zi,Qi,$i,ea=S({"src/lib/parsers/parse-push.ts"(){q(),Pi(),Zi=[new H(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new H(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new H(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(Xi(t,n,r))}),new H(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new H(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],Qi=(e,t)=>{let n=$i(e,t),r=ji(e,t);return{...n,...r}},$i=(e,t)=>K({pushed:[]},Zi,[e,t])}}),ta={};C(ta,{pushTagsTask:()=>na,pushTask:()=>ra});function na(e={},t){return A(t,`--tags`),ra(e,t)}function ra(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),ut(n,`-v`),A(n,`--verbose`),A(n,`--porcelain`),{commands:n,format:`utf-8`,parser:Qi}}var ia=S({"src/lib/tasks/push.ts"(){ea(),q()}});function aa(){return{showBuffer(){let e=[`show`,...W(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(nn(e),G(arguments))},show(){let e=[`show`,...W(arguments,1)];return this._runTask(Y(e),G(arguments))}}}var oa=S({"src/lib/tasks/show.ts"(){q(),X()}}),sa,ca,la=S({"src/lib/responses/FileStatusSummary.ts"(){sa=/^(.+)\0(.+)$/,ca=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=sa.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function ua(e){let[t,n]=e.split(I);return{from:n||t,to:t}}function Q(e,t,n){return[`${e}${t}`,n]}function da(e,...t){return t.map(t=>Q(e,t,(e,t)=>e.conflicted.push(t)))}function fa(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=ma.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ca(r,t,n))}}var pa,ma,ha,ga=S({"src/lib/responses/StatusSummary.ts"(){q(),la(),pa=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},ma=new Map([Q(` `,`A`,(e,t)=>e.created.push(t)),Q(` `,`D`,(e,t)=>e.deleted.push(t)),Q(` `,`M`,(e,t)=>e.modified.push(t)),Q(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),Q(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Q(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Q(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`R`,` `,(e,t)=>{e.renamed.push(ua(t))}),Q(`R`,`M`,(e,t)=>{let n=ua(t);e.renamed.push(n),e.modified.push(n.to)}),Q(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Q(`?`,`?`,(e,t)=>e.not_added.push(t)),...da(`A`,`A`,`U`),...da(`D`,`D`,`U`),...da(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=z(s?.[1],V,null),s=a.exec(t),e.tracking=z(s?.[1],V,null),s=o.exec(t),s&&(e.current=z(s?.[1],V,e.current)),e.detached=/\(no branch\)/.test(t)}]]),ha=function(e){let t=e.split(I),n=new pa;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=I+(t[e++]||``)),fa(n,r))}return n}}});function _a(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!va.includes(e))],parser(e){return ha(e)}}}var va,ya=S({"src/lib/tasks/status.ts"(){ga(),va=[`--null`,`-z`]}});function ba(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function xa(){return ba(0,0,0,``,!1)}function Sa(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:Ca,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(wa));r(t)}})}}}function Ca(e){return e===wa?xa():K(ba(0,0,0,e),Ta,e)}var wa,Ta,Ea=S({"src/lib/tasks/version.ts"(){q(),wa=`installed=false`,Ta=[new H(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,ba(N(t),N(n),N(r),i))}),new H(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,ba(N(t),N(n),r,i))})]}});function Da(e,t,n,...r){return V(n)?t(n,z(r[0],V),W(arguments)):J(`git.${e}() requires a string 'repoPath'`)}function Oa(){return{clone(e,...t){return this._runTask(Da(`clone`,ka,z(e,V),...t),G(arguments))},mirror(e,...t){return this._runTask(Da(`mirror`,Aa,z(e,V),...t),G(arguments))}}}var ka,Aa,ja=S({"src/lib/tasks/clone.ts"(){X(),q(),ka=(e,t,n)=>{let r=[`clone`,...n];return V(e)&&r.push(se(e)),V(t)&&r.push(se(t)),Y(r)},Aa=(e,t,n)=>(A(n,`--mirror`),ka(e,t,n))}}),Ma={};C(Ma,{SimpleGitApi:()=>Na});var Na,Pa=S({"src/lib/simple-git-api.ts"(){hr(),_r(),br(),wr(),Ar(),Nn(),Mr(),Gn(),Pr(),Ur(),bi(),Yi(),ia(),oa(),ya(),X(),Ea(),q(),ja(),Na=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&pr(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(Y([`add`,...j(e)]),G(arguments))}cwd(e){let t=G(arguments);return typeof e==`string`?this._runTask(gr(e,this._executor),t):typeof e?.path==`string`?this._runTask(gr(e.path,e.root&&this._executor||void 0),t):this._runTask(J(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Nr(e,t===!0),G(arguments))}init(e){return this._runTask(Vr(e===!0,this._executor.cwd,W(arguments)),G(arguments))}merge(){return this._runTask(Ji(W(arguments)),G(arguments))}mergeFromTo(e,t){return V(e)&&V(t)?this._runTask(Ji([e,t,...W(arguments)]),G(arguments,!1)):this._runTask(J(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=ra({remote:z(arguments[0],V),branch:z(arguments[1],V)},W(arguments));return this._runTask(e,G(arguments))}stash(){return this._runTask(Y([`stash`,...W(arguments)]),G(arguments))}status(){return this._runTask(_a(W(arguments)),G(arguments))}},Object.assign(Na.prototype,yr(),Oa(),kr(),jn(),Sr(),jr(),Bn(),vi(),aa(),Sa())}}),Fa={};C(Fa,{Scheduler:()=>La});var Ia,La,Ra=S({"src/lib/runners/scheduler.ts"(){q(),rr(),Ia=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,g.createDeferred)();return{promise:t,done:n,id:e}}})(),La=class{constructor(e=2){this.concurrency=e,this.logger=nr(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=A(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),ut(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=A(this.pending,Ia());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),za={};C(za,{applyPatchTask:()=>Ba});function Ba(e,t){return Y([`apply`,...t,...e])}var Va=S({"src/lib/tasks/apply-patch.ts"(){X()}});function Ha(e,t){return{branch:e,hash:t,success:!0}}function Ua(e){return{branch:e,hash:null,success:!1}}var Wa,Ga=S({"src/lib/responses/BranchDeleteSummary.ts"(){Wa=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Ka(e,t){return t===1&&Ja.test(e)}var qa,Ja,Ya,Xa,Za=S({"src/lib/parsers/parse-branch-delete.ts"(){Ga(),q(),qa=/(\S+)\s+\(\S+\s([^)]+)\)/,Ja=/^error[^']+'([^']+)'/m,Ya=[new H(qa,(e,[t,n])=>{let r=Ha(t,n);e.all.push(r),e.branches[t]=r}),new H(Ja,(e,[t])=>{let n=Ua(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],Xa=(e,t)=>K(new Wa,Ya,[e,t])}}),Qa,$a=S({"src/lib/responses/BranchSummary.ts"(){Qa=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function eo(e){return e?e.charAt(0):``}function to(e,t=!1){return K(new Qa,t?[ro]:no,e)}var no,ro,io=S({"src/lib/parsers/parse-branch.ts"(){$a(),q(),no=[new H(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(eo(t),!0,n,r,i)}),new H(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(eo(t),!1,n,r,i)})],ro=new H(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),ao={};C(ao,{branchLocalTask:()=>co,branchTask:()=>so,containsDeleteBranchCommand:()=>oo,deleteBranchTask:()=>uo,deleteBranchesTask:()=>lo});function oo(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function so(e){let t=oo(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?Xa(e,r).all[0]:to(e,n)}}}function co(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return to(e)}}}function lo(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return Xa(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!Ka(String(n),e))return i(n);r(t)}}}function uo(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return Xa(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!Ka(String(i),e))return o(i);throw new $e(n.parser(F(r),F(t)),String(i))}};return n}var fo=S({"src/lib/tasks/branch.ts"(){D(),Za(),io(),q()}});function po(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&a(t)}var mo,ho=S({"src/lib/responses/CheckIgnore.ts"(){mo=e=>e.split(/\n/g).map(po).filter(Boolean)}}),go={};C(go,{checkIgnoreTask:()=>_o});function _o(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:mo}}var vo=S({"src/lib/tasks/check-ignore.ts"(){ho()}});function yo(e,t){return K({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},bo,[e,t])}var bo,xo=S({"src/lib/parsers/parse-fetch.ts"(){q(),bo=[new H(/From (.+)$/,(e,[t])=>{e.remote=t}),new H(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new H(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new H(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new H(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),So={};C(So,{fetchTask:()=>wo});function Co(e){return/^--upload-pack(=|$)/.test(e)}function wo(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(Co)?J(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:yo}}var To=S({"src/lib/tasks/fetch.ts"(){xo(),X()}});function Eo(e){return K({moves:[]},Do,e)}var Do,Oo=S({"src/lib/parsers/parse-move.ts"(){q(),Do=[new H(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),ko={};C(ko,{moveTask:()=>Ao});function Ao(e,t){return{commands:[`mv`,`-v`,...j(e),t],format:`utf-8`,parser:Eo}}var jo=S({"src/lib/tasks/move.ts"(){Oo(),q()}}),Mo={};C(Mo,{pullTask:()=>No});function No(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return Hi(e,t)},onError(e,t,n,r){let i=Fi(F(e.stdOut),F(e.stdErr));if(i)return r(new $e(i));r(t)}}}var Po=S({"src/lib/tasks/pull.ts"(){D(),Ui(),q()}});function Fo(e){let t={};return Lo(e,([e])=>t[e]={name:e}),Object.values(t)}function Io(e){let t={};return Lo(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function Lo(e,t){st(e,e=>t(e.split(/\s+/)))}var Ro=S({"src/lib/responses/GetRemoteSummary.ts"(){q()}}),zo={};C(zo,{addRemoteTask:()=>Bo,getRemotesTask:()=>Vo,listRemotesTask:()=>Ho,remoteTask:()=>Uo,removeRemoteTask:()=>Wo});function Bo(e,t,n){return Y([`remote`,`add`,...n,e,t])}function Vo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Io:Fo}}function Ho(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),Y(t)}function Uo(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),Y(t)}function Wo(e){return Y([`remote`,`remove`,e])}var Go=S({"src/lib/tasks/remote.ts"(){Ro(),X()}}),Ko={};C(Ko,{stashListTask:()=>qo});function qo(e={},t){let n=gi(e),r=[`stash`,`list`,...n.commands,...t],i=ii(n.splitter,n.fields,Wr(r));return fi(r)||{commands:r,format:`utf-8`,parser:i}}var Jo=S({"src/lib/tasks/stash-list.ts"(){qr(),li(),pi(),bi()}}),Yo={};C(Yo,{addSubModuleTask:()=>Xo,initSubModuleTask:()=>Zo,subModuleTask:()=>Qo,updateSubModuleTask:()=>$o});function Xo(e,t){return Qo([`add`,e,t])}function Zo(e){return Qo([`init`,...e])}function Qo(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),Y(t)}function $o(e){return Qo([`update`,...e])}var es=S({"src/lib/tasks/sub-module.ts"(){X()}});function ts(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?ns(e,t):0:n?1:-1}function ns(e,t){return e===t?0:e>t?1:-1}function rs(e){return e.trim()}function is(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var as,os,ss=S({"src/lib/responses/TagList.ts"(){as=class{constructor(e,t){this.all=e,this.latest=t}},os=function(e,t=!1){let n=e.split(`
|
|
9
9
|
`).map(rs).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return ts(is(n[0]),is(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=ns(is(n[e]),is(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new as(n,r)}}}),cs={};C(cs,{addAnnotatedTagTask:()=>ds,addTagTask:()=>us,tagListTask:()=>ls});function ls(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return os(e,t)}}}function us(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ds(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var fs=S({"src/lib/tasks/tag.ts"(){ss()}}),ps=Ze({"src/git.js"(e,t){var{GitExecutor:n}=(fr(),w(ur)),{SimpleGitApi:r}=(Pa(),w(Ma)),{Scheduler:i}=(Ra(),w(Fa)),{adhocExecTask:a,configurationErrorTask:o}=(X(),w(en)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:ee}=(q(),w(Rt)),{applyPatchTask:te}=(Va(),w(za)),{branchTask:ne,branchLocalTask:re,deleteBranchesTask:ie,deleteBranchTask:ae}=(fo(),w(ao)),{checkIgnoreTask:oe}=(vo(),w(go)),{checkIsRepoTask:se}=(qt(),w(zt)),{cleanWithOptionsTask:h,isCleanOptionsArray:ce}=(bn(),w(sn)),{diffSummaryTask:le}=(pi(),w(ui)),{fetchTask:ue}=(To(),w(So)),{moveTask:g}=(jo(),w(ko)),{pullTask:de}=(Po(),w(Mo)),{pushTagsTask:fe}=(ia(),w(ta)),{addRemoteTask:pe,getRemotesTask:me,listRemotesTask:he,remoteTask:ge,removeRemoteTask:_}=(Go(),w(zo)),{getResetMode:_e,resetTask:ve}=(Qn(),w(Kn)),{stashListTask:ye}=(Jo(),w(Ko)),{addSubModuleTask:be,initSubModuleTask:xe,subModuleTask:Se,updateSubModuleTask:Ce}=(es(),w(Yo)),{addAnnotatedTagTask:we,addTagTask:Te,tagListTask:Ee}=(fs(),w(cs)),{straightThroughBufferTask:De,straightThroughStringTask:v}=(X(),w(en));function y(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(y.prototype=Object.create(r.prototype)).constructor=y,y.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},y.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},y.prototype.stashList=function(e){return this._runTask(ye(ee(arguments)||{},c(e)&&e||[]),m(arguments))},y.prototype.mv=function(e,t){return this._runTask(g(e,t),m(arguments))},y.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},y.prototype.pull=function(e,t,n,r){return this._runTask(de(f(e,u),f(t,u),p(arguments)),m(arguments))},y.prototype.fetch=function(e,t){return this._runTask(ue(f(e,u),f(t,u),p(arguments)),m(arguments))},y.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},y.prototype.tags=function(e,t){return this._runTask(Ee(p(arguments)),m(arguments))},y.prototype.rebase=function(){return this._runTask(v([`rebase`,...p(arguments)]),m(arguments))},y.prototype.reset=function(e){return this._runTask(ve(_e(e),p(arguments)),m(arguments))},y.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(v([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},y.prototype.addTag=function(e){let t=typeof e==`string`?Te(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},y.prototype.addAnnotatedTag=function(e,t){return this._runTask(we(e,t),m(arguments))},y.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(ae(e,typeof t==`boolean`?t:!1),m(arguments))},y.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(ie(e,typeof t==`boolean`?t:!1),m(arguments))},y.prototype.branch=function(e,t){return this._runTask(ne(p(arguments)),m(arguments))},y.prototype.branchLocal=function(e){return this._runTask(re(),m(arguments))},y.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(v(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},y.prototype.submoduleAdd=function(e,t,n){return this._runTask(be(e,t),m(arguments))},y.prototype.submoduleUpdate=function(e,t){return this._runTask(Ce(p(arguments,!0)),m(arguments))},y.prototype.submoduleInit=function(e,t){return this._runTask(xe(p(arguments,!0)),m(arguments))},y.prototype.subModule=function(e,t){return this._runTask(Se(p(arguments)),m(arguments))},y.prototype.listRemote=function(){return this._runTask(he(p(arguments)),m(arguments))},y.prototype.addRemote=function(e,t,n){return this._runTask(pe(e,t,p(arguments)),m(arguments))},y.prototype.removeRemote=function(e,t){return this._runTask(_(e),m(arguments))},y.prototype.getRemotes=function(e,t){return this._runTask(me(e===!0),m(arguments))},y.prototype.remote=function(e,t){return this._runTask(ge(p(arguments)),m(arguments))},y.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(v(n),m(arguments))},y.prototype.updateServerInfo=function(e){return this._runTask(v([`update-server-info`]),m(arguments))},y.prototype.pushTags=function(e,t){let n=fe({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},y.prototype.rm=function(e){return this._runTask(v([`rm`,`-f`,...s(e)]),m(arguments))},y.prototype.rmKeepLocal=function(e){return this._runTask(v([`rm`,`--cached`,...s(e)]),m(arguments))},y.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},y.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},y.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?De(r):v(r);return this._runTask(a,n)},y.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):v([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},y.prototype.diffSummary=function(){return this._runTask(le(p(arguments,1)),m(arguments))},y.prototype.applyPatch=function(e){let t=d(e)?te(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},y.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(v(e,!0),m(arguments))},y.prototype.clean=function(e,t,n){let r=ce(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(h(i,a),m(arguments))},y.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},y.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},y.prototype.checkIgnore=function(e,t){return this._runTask(oe(s(f(e,d,[]))),m(arguments))},y.prototype.checkIsRepo=function(e,t){return this._runTask(se(f(e,u)),m(arguments))},t.exports=y}});E();var ms=class extends T{constructor(e,t){super(void 0,t),this.config=e}};E(),E();var $=class extends T{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};D(),tt(),qt(),bn(),Nn(),Ln(),Gn(),Qn();function hs(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new $(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new $(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function gs(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Ke(t,n))if(e[r.category]!==!0)throw new $(void 0,`unsafe`,r.message);return t}}}q();function _s(e){let t=P(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}q();var vs=(0,g.deferred)().promise;function ys({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,g.deferred)(),closeTimeout:(0,g.deferred)(),exit:(0,g.deferred)(),exitTimeout:(0,g.deferred)()},a=Promise.race([e===!1?vs:i.closeTimeout.promise,t===!1?vs:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>pt(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await pt(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}q();var bs=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,xs=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function Ss(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Cs(e,t){if(e.length<1||e.length>2)throw new $(void 0,`binary`,bs);if(e.some(Ss))if(t)console.warn(xs);else throw new $(void 0,`binary`,xs);let[n,r]=e;return{binary:n,prefix:r}}function ws(e,t=[`git`],n=!1){let r=Cs(j(t),n);e.on(`binary`,e=>{r=Cs(j(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}E();function Ts(e){return!!(e.exitCode&&e.stdErr.length)}function Es(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ds(e=!1,t=Ts,n=Es){return(r,i)=>!e&&r||!t(i)?r:n(i)}function Os(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new T(void 0,r.toString(`utf-8`))}:{error:r}}}}q();var ks=class{constructor(){this.plugins=new Set,this.events=new u}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=A(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return j(e).forEach(e=>e&&this.plugins.add(A(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};q();function As(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?lt(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:js(n[1]),progress:N(n[2]),processed:N(n[3]),total:N(n[4])})})}}]}function js(e){return String(e.toLowerCase().split(` `,1))||`unknown`}q();function Ms(e){let t=ft(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function Ns({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new $(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function Ps(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(h(i)){r(ce(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>h(e)&&ce(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}q();var Fs=ps();function Is(e,t){let n=new ks,r=kt(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!ct(r.baseDir))throw new ms(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(_s(r.config)),n.add(gs(r.unsafe)),n.add(ys(r.completion)),r.abort&&n.add(hs(r.abort)),r.progress&&n.add(As(r.progress)),r.timeout&&n.add(Ns(r.timeout)),r.spawnOptions&&n.add(Ms(r.spawnOptions)),n.add(Ps()),n.add(Os(Ds(!0))),r.errors&&n.add(Os(r.errors)),ws(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new Fs(r,n)}D();var Ls=Is,Rs=Is;const zs=new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};function Bs(e){return zs.enqueue(e)}function Vs(e){try{return s(e)&&c(e).isDirectory()}catch{return!1}}const Hs=[`HOME`,`USERPROFILE`,`HOMEDRIVE`,`HOMEPATH`,`APPDATA`,`LOCALAPPDATA`,`ProgramData`,`ALLUSERSPROFILE`,`SystemRoot`,`WINDIR`,`windir`,`ComSpec`,`TEMP`,`TMP`,`USERNAME`,`USERDOMAIN`,`PATHEXT`,`SSH_AUTH_SOCK`,`ELECTRON_RUN_AS_NODE`];function Us(e){let t={LANG:`C`,LC_ALL:`C`,GIT_TERMINAL_PROMPT:`0`,GIT_MERGE_AUTOEDIT:`no`};t.PATH=r(process.env.PATH??process.env.Path,{platform:process.platform,homeDir:l(),isDir:Vs,delimiter:i});for(let e of Hs){let n=process.env[e];n!==void 0&&(t[e]=n)}return e&&(t.OK_GH_TOKEN=e.token,t.OK_GH_TOKEN_HOST=e.host),t}function Ws(e,t){let n={...e.env};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return e.git.env(n)}function Gs(e,t={}){let{credentialArgs:n=[],gitIndexFile:r,ghToken:i,timeoutMs:a}=t,s=Us(i);return r&&(s.GIT_INDEX_FILE=o(e,r)),{git:Rs({baseDir:e,config:[`commit.gpgsign=false`,`core.autocrlf=false`,`credential.interactive=false`,...n.length>=2?[n[1]]:[]],unsafe:{allowUnsafeCredentialHelper:!0},...a===void 0?{}:{timeout:{block:a}}}).env(s),projectDir:e,credentialArgs:n,env:s}}export{Rs as a,Bs as i,Us as n,Ls as o,Gs as r,re as s,Ws as t};
|
|
10
|
-
//# sourceMappingURL=git-handle-
|
|
10
|
+
//# sourceMappingURL=git-handle-BKNpWc-0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./git-handle-BKNpWc-0.mjs";export{e as createGitInstance};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ys as e}from"./src-Dkrbi5Bh.mjs";import{_ as t,b as n,c as r,d as i,f as a,g as o,i as s,l as c,r as l,s as u,t as d,u as f,v as p,x as m}from"./write-project-skill-D_i5y_ki.mjs";import{C as h,_ as g,b as _,c as v,f as y,g as b,h as x,i as S,l as C,n as w,r as T,s as E,t as D,u as O,v as k,w as A}from"./src-D81OiBLA.mjs";import{a as j,i as M,n as N,t as P}from"./acp-harness-probe-inKMbnTO.mjs";import{A as F,F as I,I as L,M as R,N as z,O as B,P as V,d as H,j as U,k as W,n as G,o as K,s as q,v as J,x as Y,y as X}from"./init-D0r4e25M.mjs";import{n as Z}from"./loader-DI6RYqwy.mjs";import{n as Q}from"./preview-B-2W99IX.mjs";import{n as $,t as ee}from"./mcp-migrate-event-CWx0WLdE.mjs";export{c as ALL_EDITOR_IDS,f as EDITOR_LABELS,i as EDITOR_TARGETS,a as HOSTS_WITH_USER_SKILL_DIR,G as LAUNCH_CONFIG_NAME,v as PATH_SHIM_BEGIN,C as PATH_SHIM_BLOCK_RE,O as PATH_SHIM_END,B as addOkPathsToGitExclude,d as assertProjectPathSafe,o as buildManagedServerEntry,T as buildMcpConfigDeclineEvent,ee as buildMcpConfigMigrateEvent,K as classifyExistingMcpEntry,_ as collectReportBundle,M as createTokenStore,h as defaultBugReportZipPath,N as detectGh,q as detectInstalledEditors,t as editorConfigPathDisplay,p as editorEntryLocator,W as formatTrackedRemediation,F as getExcludedOkPaths,U as getOkArtifactPaths,n as isEntryUpToDate,m as isOwnManagedEntry,Z as loadConfig,j as makeLazyProbeTokenStore,A as okBugReportsDir,x as parseGitHubBlobUrl,b as parseGitHubShareUrl,g as parseGitHubTreeUrl,k as parseGitUrl,y as pathInstallMarkerPath,Q as previewContent,P as probeOwnManagedEditorMcpEntry,R as probeTrackedOkPaths,H as readExistingMcpEntry,z as readSharingMode,V as readSkillsShared,e as redactContent,I as removeOkPathsFromGitExclude,E as removeOwnMcpEntry,l as removeProjectSkill,u as removeUserGlobalSkillBundle,Y as resolveProjectRoot,S as runStop,L as setSkillsShared,$ as truncatePriorEntry,r as userGlobalSkillBundleTargets,w as validateLocalFolderForShare,J as writeEditorMcpConfig,D as writeProjectAiIntegrations,s as writeProjectSkill,X as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./init-D0r4e25M.mjs";export{e as runInit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Y as r}from"./sleep-jUpHbV7f.mjs";import{Ho as i,K as a,U as o,rs as s}from"./src-CHSJwcpc.mjs";import{Dr as c,Er as l,Hr as u,Tr as d,Xn as f,Yn as p,bn as m,c as h,en as g,fr as _,gn as v,hn as y,kr as b,l as x,pr as S,rr as ee,tn as te,u as ne,vn as re,xa as ie}from"./src-BS7drzIV.mjs";import{M as C,P as w}from"./fs-traced-D12ehU8a.mjs";import{D as ae,T,d as E,g as oe,h as se,i as ce,l as le,m as ue,p as de,s as fe,t as pe,u as me,w as he}from"./write-project-skill-CzrMSTf3.mjs";import{i as D,n as O,o as k,r as ge,s as A,t as j}from"./colors-BsmVIwfM.mjs";import{t as _e}from"./constants-BpeoO1T6.mjs";import{t as M}from"./is-object-ByG7RnjH.mjs";import{t as ve}from"./preview-CcFBEKQd.mjs";import{createRequire as ye}from"node:module";import{execFileSync as be}from"node:child_process";import xe,{dirname as N,isAbsolute as Se,join as P,relative as F,resolve as Ce,sep as we}from"node:path";import I from"node:process";import{fileURLToPath as Te}from"node:url";import{existsSync as L,lstatSync as Ee,mkdirSync as De,readFileSync as R,readlinkSync as Oe,realpathSync as ke,statSync as Ae,writeFileSync as je}from"node:fs";import{homedir as Me}from"node:os";import*as Ne from"node:readline";import{inspect as Pe,stripVTControlCharacters as Fe,styleText as z}from"node:util";import{AsyncLocalStorage as Ie,AsyncResource as Le}from"node:async_hooks";const Re=new Set([`emacs`,`vim`]);function ze(e){return Re.has(e)}function Be(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(ze))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ve=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,He=e=>e.name===`space`,Ue=e=>e.name===`backspace`,We=e=>`1234567890`.includes(e.name),Ge=e=>e.name===`enter`||e.name===`return`;var Ke=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},qe=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Je=class extends Error{name=`ExitPromptError`},Ye=class extends Error{name=`HookError`},Xe=class extends Error{name=`ValidationError`};const Ze=new Ie;function Qe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function $e(e,t){let n=Qe(e);return Ze.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Ze.getStore();if(!e)throw new Ye(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function et(){return V().rl}function tt(e){return Le.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function nt(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function rt(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(et());if(r!=null&&typeof r!=`function`)throw new Xe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();tt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function it(e){return typeof e==`function`}function U(e){return nt(t=>{let n=Le.bind(function(e){t.get()!==e&&(t.set(e),rt())});if(t.initialized)return[t.get(),n];let r=it(e)?e():e;return t.set(r),[r,n]})}function at(e,t){nt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function ot(){return I.platform.startsWith(`win`)?!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask===`{cmd::Cmder}`||I.env.TERM_PROGRAM===`Terminus-Sublime`||I.env.TERM_PROGRAM===`vscode`||I.env.TERM===`xterm-256color`||I.env.TERM===`alacritty`||I.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:I.env.TERM!==`linux`}const st={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ct={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},lt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ut={...st,...ct},dt={...st,...lt},W=ot()?ut:dt;Object.entries(ct);const ft={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function pt(){return{...ft,keybindings:Be()}}function mt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ht(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=mt(n)&&mt(r)?ht(n,r):r}return t}function gt(...e){return ht(pt(),...e.filter(e=>e!=null))}function _t({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=gt(t);return at(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function vt(e,t){return nt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function yt(e){return U({current:e})[0]}function bt(e){let t=yt(e);t.current=e,at(e=>{let n=!1,r=tt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var xt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const St=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ct=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,wt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Tt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Et=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ot=/\t{1,1000}/y,kt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,At=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,jt=/\p{M}+/gu,Mt={limit:1/0,ellipsis:``},Nt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Nt(i,Mt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[At,l],[Tt,0],[Et,o],[Ot,s],[kt,c],[Dt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(jt,``)){let t=e.codePointAt(0)||0;if(S=Ct(t)?2:wt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Dt?St(e.slice(p,n.lastIndex)):n===kt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>Nt(e,Pt,t).width,Ft=`]8;;`,It=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ft}(?<uri>.*))`,`y`),Lt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Rt=e=>`[${e}m`,zt=e=>`${Ft}${e}`,Bt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Ft,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Vt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ht=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Bt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Bt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Bt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Vt(e)));let l=s.join(`
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Y as r}from"./sleep-jUpHbV7f.mjs";import{Bo as i,K as a,U as o,ts as s}from"./src-Dkrbi5Bh.mjs";import{Dr as c,Er as l,Hr as u,Tr as d,Xn as f,Yn as p,bn as m,c as h,en as g,fr as _,gn as v,hn as y,kr as b,l as x,pr as S,rr as ee,tn as te,u as ne,vn as re,xa as ie}from"./src-BA6UmYHS.mjs";import{M as C,P as w}from"./fs-traced-D12ehU8a.mjs";import{D as ae,T,d as E,g as oe,h as se,i as ce,l as le,m as ue,p as de,s as fe,t as pe,u as me,w as he}from"./write-project-skill-D_i5y_ki.mjs";import{i as D,n as O,o as k,r as ge,s as A,t as j}from"./colors-BsmVIwfM.mjs";import{t as _e}from"./constants-iJqy8Hia.mjs";import{t as M}from"./is-object-ByG7RnjH.mjs";import{t as ve}from"./preview-B-2W99IX.mjs";import{createRequire as ye}from"node:module";import{execFileSync as be}from"node:child_process";import xe,{dirname as N,isAbsolute as Se,join as P,relative as F,resolve as Ce,sep as we}from"node:path";import I from"node:process";import{fileURLToPath as Te}from"node:url";import{existsSync as L,lstatSync as Ee,mkdirSync as De,readFileSync as R,readlinkSync as Oe,realpathSync as ke,statSync as Ae,writeFileSync as je}from"node:fs";import{homedir as Me}from"node:os";import*as Ne from"node:readline";import{inspect as Pe,stripVTControlCharacters as Fe,styleText as z}from"node:util";import{AsyncLocalStorage as Ie,AsyncResource as Le}from"node:async_hooks";const Re=new Set([`emacs`,`vim`]);function ze(e){return Re.has(e)}function Be(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(ze))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ve=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,He=e=>e.name===`space`,Ue=e=>e.name===`backspace`,We=e=>`1234567890`.includes(e.name),Ge=e=>e.name===`enter`||e.name===`return`;var Ke=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},qe=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Je=class extends Error{name=`ExitPromptError`},Ye=class extends Error{name=`HookError`},Xe=class extends Error{name=`ValidationError`};const Ze=new Ie;function Qe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function $e(e,t){let n=Qe(e);return Ze.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Ze.getStore();if(!e)throw new Ye(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function et(){return V().rl}function tt(e){return Le.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function nt(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function rt(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(et());if(r!=null&&typeof r!=`function`)throw new Xe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();tt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function it(e){return typeof e==`function`}function U(e){return nt(t=>{let n=Le.bind(function(e){t.get()!==e&&(t.set(e),rt())});if(t.initialized)return[t.get(),n];let r=it(e)?e():e;return t.set(r),[r,n]})}function at(e,t){nt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function ot(){return I.platform.startsWith(`win`)?!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask===`{cmd::Cmder}`||I.env.TERM_PROGRAM===`Terminus-Sublime`||I.env.TERM_PROGRAM===`vscode`||I.env.TERM===`xterm-256color`||I.env.TERM===`alacritty`||I.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:I.env.TERM!==`linux`}const st={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ct={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},lt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ut={...st,...ct},dt={...st,...lt},W=ot()?ut:dt;Object.entries(ct);const ft={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function pt(){return{...ft,keybindings:Be()}}function mt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ht(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=mt(n)&&mt(r)?ht(n,r):r}return t}function gt(...e){return ht(pt(),...e.filter(e=>e!=null))}function _t({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=gt(t);return at(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function vt(e,t){return nt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function yt(e){return U({current:e})[0]}function bt(e){let t=yt(e);t.current=e,at(e=>{let n=!1,r=tt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var xt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const St=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ct=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,wt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Tt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Et=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ot=/\t{1,1000}/y,kt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,At=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,jt=/\p{M}+/gu,Mt={limit:1/0,ellipsis:``},Nt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Nt(i,Mt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[At,l],[Tt,0],[Et,o],[Ot,s],[kt,c],[Dt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(jt,``)){let t=e.codePointAt(0)||0;if(S=Ct(t)?2:wt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Dt?St(e.slice(p,n.lastIndex)):n===kt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>Nt(e,Pt,t).width,Ft=`]8;;`,It=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ft}(?<uri>.*))`,`y`),Lt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Rt=e=>`[${e}m`,zt=e=>`${Ft}${e}`,Bt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Ft,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Vt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ht=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Bt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Bt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Bt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Vt(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){It.lastIndex=e+1;let t=It.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=zt(``));let e=i?Lt(i):void 0;i&&e&&(r+=Rt(e))}else t===`
|
|
4
4
|
`&&(i&&Lt(i)&&(r+=Rt(i)),a&&(r+=zt(a)))}return r},Ut=/\r?\n/;function Wt(e,t,n){return String(e).normalize().split(Ut).map(e=>Ht(e,t,n)).join(`
|
|
@@ -638,6 +638,6 @@ export default function okBridge(pi: {
|
|
|
638
638
|
`));let f=`${a?``:``}${u}`;return f!==i&&w(e,f,{mode:Hn(e)}),{kind:l?`overwritten`:`written`}}const bi=e=>e!==`project`,xi=e=>e!==`user`;async function Si(){let e=await Zn({message:`Where should the MCP server be configured?
|
|
639
639
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function Ci(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??Si)():`both`}async function wi(e){return nr({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Ti(e){if(e.sharing!==void 0)return e.sharing;let t=kn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??wi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Ei(e){if(e===void 0||e===!0)return new Set(S);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(S.filter(e=>t.includes(e)))}function Di(e,t,n){let r=Ce(n,e),i;try{i=Ae(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=F(Oi(t),Oi(r));if(a.startsWith(`..`)||Se(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Oi(e){try{return ke(e)}catch{return e}}const ki=`open-knowledge-ui`;function Ai(e,t,n){try{return L(e.detectPath?.(t,n)??N(e.configPath(t,n)))}catch{return!1}}function ji(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!Ai(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{pe(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return Ni(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{De(N(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{C(`${o}.lock`,()=>{let t=Yr(o).writePath;if(De(N(t),{recursive:!0}),e.format===`toml`){let n=vi(ri(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=yi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=_i(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const Mi={pi:Lr};function Ni(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=Mi[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{De(N(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{C(`${t}.lock`,()=>{let e=null;try{e=R(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}w(t,c,e===null?void 0:{mode:Hn(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function Pi(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!L(n)))return{editorId:e.id,label:e.label,path:n}}async function Fi(e){let t=he(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>ji(t,``,n,e.home))}function Ii(e,t,n,r){let i=Ri(e,t,n,r);return i.kind===`present`?i.entry:null}function Li(e,t,n,r){let i=gi(e,t,r);if(!M(i))return{kind:`no-entry`};let a=i[n];return M(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Ri(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!L(i))return{kind:`absent`};try{if(Ae(i).size>di)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=R(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Ir(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ri().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Li(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Cn.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Li(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=oi(a);return s?si(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Li(l(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function zi(e={}){let t=Ce(e.cwd??process.cwd()),n=Vr(t,{homeDir:e.home}),r=n.projectRoot,i=!L(P(r,`.ok`)),a=n.gitRootPromoted?F(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Di(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${A(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await ne(r),l;try{l=v(r,{contentDir:o})}catch(t){let i=E.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(_e),d=!1;if(c.didInit)try{d=re(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{y(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let m=await h(r);m.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${m.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let g=await Ci({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),b=e.editors??Gi(r,e.home),x=e.editors??le.filter(e=>E[e].projectConfigPath!==void 0||E[e].projectSkillPath!==void 0),te=he(b),ie=he(x),C=e.mcp===!1||g===null,w=Array.from(new Map([...te,...C?[]:ie].map(e=>[e.id,e])).values()),ae=te.filter(t=>Ai(t,r,e.home)),T=[],oe=[],se=new Set;for(let t of w){if(C){let n=``;try{n=t.configPath(r,e.home)}catch{}T.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(bi(g)&&te.includes(t)&&t.scope===`global`&&T.push(ji(t,r,s,e.home)),xi(g)&&ie.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ji(t,r,s,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&se.add(n)}}let ue=new Set;for(let t of ie){let n=t.projectSkillPath?.(r);!n||ue.has(n)||(ue.add(n),oe.push(ce(t,r,{home:e.home})))}let de=!C&&g!==null&&xi(g)?ie.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,pe=C?[]:ae.map(e=>Pi(e,r)).filter(e=>e!==void 0).filter(e=>!se.has(e.path)),me=e.installUserSkill??f,D=e.home??Me(),O=Ei(e.skills),k=!1,ge=!1,j=!1,M=!1,ve=!1;for(let t of S){let n=O.has(t);if(await ee(D,_[t],n).catch(()=>{}),n){k=!0;let n=await me({home:e.home,bundleId:t,force:!0});n===`installed`?ge=!0:n===`failed`?j=!0:n===`no-hosts`?ve=!0:M=!0}else try{fe(D,t)}catch{}}let ye=j?`failed`:ge?`installed`:k&&M?`skip-current`:k&&ve?`no-hosts`:`declined`,be=ge?p(D).map(e=>e.editorId):[],xe=C?`skipped-flag`:`skipped-missing`,N=T.find(e=>e.editorId===`claude`)??T[0]??{action:xe,configPath:E.claude.configPath(r,e.home)},Se=await Bi({projectRoot:r,desiredMode:await Ti({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:l.created,contentUpdated:l.updated,contentSkipped:l.skipped,editors:T,projectSkills:oe,legacyProjectConfigs:pe,skillInstall:ye,skillHosts:be,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:N.action,mcpPath:N.configPath,mcpError:`error`in N?N.error:void 0,projectScopeUnsupportedLabels:de,sharing:Se}}async function Bi(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=kn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=En(t);if(n===`local-only`){let e=Dn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Vi(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=On(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Vi(t,o,`remove`)}function Vi(e,t,n){let r=kn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Hi(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Ui(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=P(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(j(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(j(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(j(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(j(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(j(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?F(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${k(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${k(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${ge(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${Hi(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(j(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?F(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${k(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${k(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${ge(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${F(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(j(`User-global skill:`)),e.skillInstall){case`installed`:{let t=(e.skillHosts??[]).map(e=>me[e]??e),r=t.length>0?t.join(`, `):`the shared ~/.agents store`;n.push(` open-knowledge ${k(`installed for ${r}`)}`),n.push(` ${O(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${O(`Opt out: DO_NOT_TRACK=1, or Settings → Preferences.`)}`);break}case`skip-current`:n.push(` open-knowledge ${k(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${O(`opted out via --no-skills`)}`),n.push(` ${O(`This is a machine-wide choice: the built-in skills are removed from your`)}`),n.push(` ${O(`user-global skill directories and stay off for every project until you`)}`),n.push(` ${O(`re-enable them by running init again without the flag:`)}`),n.push(` ${O(` ok init`)}`);break;case`no-hosts`:n.push(` open-knowledge ${O(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${A(`open-knowledge install failed — MCP still configured; retry with:`)}`),n.push(` ${A(` ok repair-skills`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(A(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(A(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(ve(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ji(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${k(`✓`)} ${j(`Next steps:`)}`),n.push(` 1. Open your editor (${D(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${D(`ok seed --list-packs`)} — browse the starter packs`),n.push(` - ${D(`ok seed`)} — scaffold an empty repo`),n.push(` 4. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}return n.join(`
|
|
640
640
|
`)}function Wi(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Gi(e,t){let n=[];for(let r of le)Ai(E[r],e,t)&&n.push(r);return n}function Ki(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Pe(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function qi(){return new T(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new ae(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new ae(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new ae(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Ki():null;try{let r;try{r=await zi({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof g||e instanceof te){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof x){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
641
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
641
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-C6qDEjnp.mjs`),{resolveContentDir:s}=await import(`./src-7fluFHtm.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-CITNy9Et.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Wi(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Ui(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Ji(e,t){let n=[];switch(e.kind){case`applied`:return n.push(j(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${k(`local-only`)} — appended ${e.appended.length} path(s) to ${j(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${k(`local-only`)} — already excluded; nothing to do.`):n.push(` ${k(`local-only`)}`):e.action===`removed`?n.push(` ${k(`shared`)} — removed OK paths from ${j(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${k(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(A(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
642
642
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${D(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(A(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${D(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${D(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(A(`Sharing mode unavailable: ${e.reason}.`));return n}}export{An as A,_t as B,nr as C,Un as D,Vn as E,On as F,U as H,Mn as I,Sn as L,Nn as M,kn as N,Dn as O,jn as P,un as R,Fr as S,Hn as T,Ge as U,gt as V,mi as _,Wi as a,ri as b,Ui as c,Ii as d,Ei as f,zi as g,Ti as h,Bi as i,En as j,Pn as k,Ji as l,Di as m,ki as n,Ri as o,Ci as p,Mi as r,Gi as s,$ as t,qi as u,ji as v,Zn as w,Vr as x,Fi as y,bt as z};
|
|
643
|
-
//# sourceMappingURL=init-
|
|
643
|
+
//# sourceMappingURL=init-D0r4e25M.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Er as e,kr as t}from"./src-
|
|
2
|
-
//# sourceMappingURL=launch-json-removal-
|
|
1
|
+
import{Er as e,kr as t}from"./src-BA6UmYHS.mjs";import{P as n}from"./fs-traced-D12ehU8a.mjs";import{D as r,T as i}from"./init-D0r4e25M.mjs";import{t as a}from"./is-object-ByG7RnjH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=t(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=e(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
|
|
2
|
+
//# sourceMappingURL=launch-json-removal-p9WHQkrd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DI6RYqwy.mjs";export{e as loadConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Y as e,c as t,d as n,o as r,s as i}from"./sleep-jUpHbV7f.mjs";import"./src-
|
|
2
|
-
//# sourceMappingURL=loader-
|
|
1
|
+
import{Y as e,c as t,d as n,o as r,s as i}from"./sleep-jUpHbV7f.mjs";import"./src-Dkrbi5Bh.mjs";import{_ as a}from"./src-BA6UmYHS.mjs";import{F as o,O as s}from"./fs-traced-D12ehU8a.mjs";import{t as c}from"./constants-iJqy8Hia.mjs";import{t as l}from"./is-object-ByG7RnjH.mjs";import{resolve as u}from"node:path";import{existsSync as d,readFileSync as f}from"node:fs";import{realpath as p}from"node:fs/promises";var m=e();async function h(e){let t=u(e);try{return await p(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function g(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];l(a)&&l(i)?n[r]=g(i,a):a!==void 0&&(n[r]=a)}return n}function _(e){if(!d(e))return{value:null,path:e,source:null,doc:null};let t;try{t=f(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,m.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return l(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function v(e,n){return e.map(e=>{let r=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:e.message,issueCode:e.code};if(n.doc!==null&&n.source!==null){let e=t({file:n.path,source:n.source,doc:n.doc,path:r});if(e!==void 0)return{...i,source:e}}return i})}function y(e){let t=e??process.cwd(),l=[],d=[],f=[],p=s(`user`,t),m=o({absPath:p});d.push(...m.diagnostics),!m.valid&&m.sidelinedTo!==void 0&&f.push({from:p,to:m.sidelinedTo});let h={};m.valid&&m.source!==void 0?(h=g(h,m.value),l.push(p)):m.valid;let y=u(t,`.ok`,c),b=_(y);if(b.diagnostic!==void 0&&d.push(b.diagnostic),b.value!==null){let e=r({value:b.value,file:b.path,source:b.source,doc:b.doc});d.push(...e);let t=e.length>0?i(b.value):b.value;h=g(h,t),l.push(y)}let x=a.safeParse(h);if(!x.success){let e={code:`SCHEMA_INVALID`,issues:v(x.error.issues,b)};throw Error(n(e))}return{config:x.data,sources:l,diagnostics:d,sidelined:f}}function b(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??y,r=new Map,i=new Map,a=h(e.startupCwd);return async o=>{let s=await h(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{y as n,b as t};
|
|
2
|
+
//# sourceMappingURL=loader-DI6RYqwy.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Hr as e}from"./src-
|
|
2
|
-
//# sourceMappingURL=open-browser-
|
|
1
|
+
import{Hr as e}from"./src-BA6UmYHS.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
|
2
|
+
//# sourceMappingURL=open-browser-BGPHwSRQ.mjs.map
|
package/dist/parse-worker.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./md-manager-
|
|
1
|
+
import{t as e}from"./md-manager-BuZAb56s.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
|
|
2
2
|
//# sourceMappingURL=parse-worker.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Ar as e}from"./src-
|
|
1
|
+
import{Ar as e}from"./src-BA6UmYHS.mjs";import"./constants-iJqy8Hia.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-B-2W99IX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-B-2W99IX.mjs";export{t as formatPreviewBlock,e as previewContent};
|
package/dist/public/assets/{ActivityModeContent-2l8BA531.js → ActivityModeContent-Cs_G4A2z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-DD95gIt4.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-FGMqkFjm.js";import{c as v}from"./Mermaid-BePjlqwg.js";import{r as y}from"./CopyButton-D6N3opvE.js";import{i as b}from"./prop-types-BPmLSxhG.js";import{t as x}from"./loader-circle-DJ1nzSAL.js";import{t as S}from"./undo-2-DlBBaLMR.js";import{n as C}from"./dist-uN7pEWl0.js";import{t as w}from"./dist-CzC3AWOn.js";import{c as T}from"./navigation-targets-D9VW9WdW.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-jazihC28.js";import{t as j}from"./timeline-diff-store-B-Ea84Rl.js";import{n as M}from"./use-activity-panel-D8pDT3xu.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===C?de=t[60]:(de=C({id:`a4FRQv`}),t[59]=C,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return w._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return w._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(T({kind:`doc`,target:e,docName:e},f)),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let w=S,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),C.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);C.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,i as r}from"./DocumentContext-BaYg4CBg.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-FGMqkFjm.js";import{c as v}from"./Mermaid-BePjlqwg.js";import{r as y}from"./CopyButton-D6N3opvE.js";import{i as b}from"./prop-types-DIaGyPZM.js";import{t as x}from"./loader-circle-DJ1nzSAL.js";import{t as S}from"./undo-2-DlBBaLMR.js";import{n as C}from"./dist-uN7pEWl0.js";import{t as w}from"./dist-CzC3AWOn.js";import{c as T}from"./navigation-targets-BwmQHp3k.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-PJFwSxS1.js";import{t as j}from"./timeline-diff-store-B-Ea84Rl.js";import{n as M}from"./use-activity-panel-CxtCUEYv.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===C?de=t[60]:(de=C({id:`a4FRQv`}),t[59]=C,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return w._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return w._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return w._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return w._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(T({kind:`doc`,target:e,docName:e},f)),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let w=S,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),C.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);C.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-BXFg3amj.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-RQ5o7P7w.js";import{i as te,n as ne,t as re}from"./tooltip-x7BNUa3s.js";import{n as s,t as c}from"./toggle-group-Cnezoq-B.js";import{t as l}from"./loader-circle-DJ1nzSAL.js";import{n as u,t as d}from"./panel-right-open-ypUBRt7V.js";import{t as ie}from"./x-xV4a4mi6.js";import{t as ae}from"./overlay-layers-Bzzqy8A3.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-RQ5o7P7w.js";import{i as te,n as ne,t as re}from"./tooltip-x7BNUa3s.js";import{n as s,t as c}from"./toggle-group-Cnezoq-B.js";import{t as l}from"./loader-circle-DJ1nzSAL.js";import{n as u,t as d}from"./panel-right-open-ypUBRt7V.js";import{t as ie}from"./x-xV4a4mi6.js";import{t as ae}from"./overlay-layers-Bzzqy8A3.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-PJFwSxS1.js";import{t as f}from"./lru-string-cache-Dvzy2WTu.js";import{t as le}from"./use-activity-panel-CxtCUEYv.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-EbqHCjsV.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-BXFg3amj.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||ae())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ie,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(s,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(s,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(d,{className:`size-4`}):(0,m.jsx)(u,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-BjRhUqsT.js";import{i,r as a}from"./thread-client-Boy5ZhFJ.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
|