@inkeep/open-knowledge 0.59.0-beta.0 → 0.59.0-beta.10
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/README.md +43 -0
- package/dist/acp-harness-probe-B-zYNbKH.mjs +3 -0
- package/dist/cli.mjs +63 -63
- package/dist/constants-CuvKewzN.mjs +2 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.mjs +8 -8
- package/dist/init-B5gPgKmk.mjs +1 -0
- package/dist/init-BzZZQKjK.mjs +638 -0
- package/dist/{launch-json-removal-fKVW2mlM.mjs → launch-json-removal-BFc1Zjdt.mjs} +2 -2
- package/dist/loader-Bowldk_b.mjs +1 -0
- package/dist/{loader-BC8MURYY.mjs → loader-gs03Z0wR.mjs} +2 -2
- package/dist/{open-browser-CsDN5cE2.mjs → open-browser-00vuZ49B.mjs} +2 -2
- package/dist/{preview-jkxKg0Rj.mjs → preview-D-cqfvmS.mjs} +2 -2
- package/dist/preview-DrxJEWLx.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BEuFDUx5.js → ActivityModeContent-7I3FAqNa.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BPddgp8s.js → AgentDiffPane-BQC85Rn1.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DoFc7NfG.js → AgentThreadClientBinder-q7HjbS_V.js} +1 -1
- package/dist/public/assets/{BugReportHistory-Dj4DWBsG.js → BugReportHistory-DnmaPA_t.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DNOoF0sF.js → BugReportHistoryDialog-BjRpH89b.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-iHb4w4ct.js → CodeMirrorPropInput-Bf5PV704.js} +3 -3
- package/dist/public/assets/{DiffView-BuSYMH4e.js → DiffView-B-B3fi5F.js} +1 -1
- package/dist/public/assets/DocumentContext-YI07j2yc.js +38 -0
- package/dist/public/assets/{EditorModeToggle-BQu5FzCp.js → EditorModeToggle-B3XSSPCP.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CGA4F8oQ.js → EnableSyncConfirmDialog-DrBUTfFU.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-B4rG4QmA.js → ExcalidrawDocEditor-T3TL3VQu.js} +1 -1
- package/dist/public/assets/FeedbackForm-bekuqqT1.js +1 -0
- package/dist/public/assets/{GraphPanel-BioJjRJE.js → GraphPanel-B_Mg9p1O.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BUZMQHL6.js → ImportSkillDialog-B5zHicwe.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BYVWFNKC.js → LintConfigEditor-D5Dg5HLZ.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DXXsE5wd.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-WOaAexG2.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-CQXH8Lp7.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DBEys0U7.js → MermaidDocEditor-CwD8mOHB.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-DLfJZzf_.js → PropertyDisplayRow-CKXJ3p74.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BTwtPNzB.js → ReportBugDialogBody-CVQgnZSP.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BWnOc6tg.js → SchemaConfigEditor-kvdPUUAX.js} +1 -1
- package/dist/public/assets/SessionsHost-x_FfXVKL.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-BZ7-w9pD.js → SettingsDialogBody-CgHSjRrN.js} +4 -4
- package/dist/public/assets/{ShareReceiveMissDialog-CmFBB-v-.js → ShareReceiveMissDialog-DBLKwZ22.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-COcXR6wM.js → SkillInstallMenu-BXOomxqv.js} +2 -2
- package/dist/public/assets/{SkillOriginInline-9ArgS7v6.js → SkillOriginInline-B1B3kTSz.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CDErckyY.js → SkillToolbarControls-NUcxAczC.js} +1 -1
- package/dist/public/assets/{SourceEditor-DZOVZlIw.js → SourceEditor-DYdjbyzp.js} +1 -1
- package/dist/public/assets/{TerminalPanel-B4u8CA0m.js → TerminalPanel-DkxYnA6s.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp--HTFmSQ8.js → TerminalWindowApp-CEKKfG52.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CYG6le30.js → TextDocEditor-CaNNKmLz.js} +1 -1
- package/dist/public/assets/ThreadView-Bt_MQTAE.js +14 -0
- package/dist/public/assets/{TimelineDiffPane-nz9W9uDs.js → TimelineDiffPane-yi7kMXSo.js} +1 -1
- package/dist/public/assets/{agent-diff-store-B-OJikOE.js → agent-diff-store-SkFUI7rS.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DZcASGeJ.js → auth-state-cache-DbD6wjBD.js} +1 -1
- package/dist/public/assets/{client-version-Bn6NN1ZQ.js → client-version-p4OJ2Mf5.js} +1 -1
- package/dist/public/assets/{cm-theme-Da-a0GOT.js → cm-theme-Bi-g5j8J.js} +1 -1
- package/dist/public/assets/{comment-chips-geNKcpFl.js → comment-chips-DiZPWTPl.js} +1 -1
- package/dist/public/assets/{config-provider-B7zPG6Il.js → config-provider-USxiO_wH.js} +3 -3
- package/dist/public/assets/{dist-BpbQP0nJ.js → dist-8oXszleg.js} +1 -1
- package/dist/public/assets/{dist-DJO8o4ls2.js → dist-BJNERzM02.js} +1 -1
- package/dist/public/assets/{dist-DAvyu-Pu.js → dist-BLe6Laue.js} +1 -1
- package/dist/public/assets/{dist-DV5JQxhA.js → dist-BOvI9R-K.js} +1 -1
- package/dist/public/assets/{dist-RIwmEtSi.js → dist-CB_NMgy4.js} +1 -1
- package/dist/public/assets/{dist-9jLm2WMy.js → dist-CuMGVsog.js} +1 -1
- package/dist/public/assets/{dist-j8YNkBWX.js → dist-CyQvb_hJ.js} +1 -1
- package/dist/public/assets/{dist-CrpG6qZF.js → dist-DMk7rHfk.js} +1 -1
- package/dist/public/assets/{dist-DtBd-emT.js → dist-DpwTwWzy.js} +1 -1
- package/dist/public/assets/{dist-83_CVK0Y.js → dist-RP9GkCTw.js} +1 -1
- package/dist/public/assets/{dist-CIfqGNU5.js → dist-THE2PCU5.js} +1 -1
- package/dist/public/assets/{dist-CmZSQ_Dr.js → dist-TdeurvvU.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BAEEzFBR.js → file-tree-adapter-Bo3rGytc.js} +1 -1
- package/dist/public/assets/{follow-file-By2TskXF.js → follow-file-DWqYp0pE.js} +1 -1
- package/dist/public/assets/{globals-DMVk7DOF.css → globals-CStTfhCT.css} +1 -1
- package/dist/public/assets/i18n-DLbGfWG4.js +1 -0
- package/dist/public/assets/{index-FQpQQxYf.js → index-C6Xk875v.js} +7 -7
- package/dist/public/assets/known-skill-dirs-toPil01C.js +1 -0
- package/dist/public/assets/{markdownlint-rule-browser-B4O09K7a.js → markdownlint-rule-browser-T68WxSIo.js} +1 -1
- package/dist/public/assets/messages-BFlTGREq.js +1 -0
- package/dist/public/assets/messages-BN7zDSVo.js +1 -0
- package/dist/public/assets/messages-BP5GGrRC.js +1 -0
- package/dist/public/assets/messages-Cdv9hd10.js +1 -0
- package/dist/public/assets/messages-CgyRKo5g.js +1 -0
- package/dist/public/assets/messages-D13EOsYw.js +1 -0
- package/dist/public/assets/messages-D2-S61MT.js +1 -0
- package/dist/public/assets/messages-DQkd1f5c.js +1 -0
- package/dist/public/assets/messages-D_5Iek_V.js +1 -0
- package/dist/public/assets/messages-Daexf5KZ.js +1 -0
- package/dist/public/assets/messages-DvC9XHhc.js +1 -0
- package/dist/public/assets/messages-Fy0K5qZm.js +1 -0
- package/dist/public/assets/navigation-targets-D6rHX3Pq.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-Cf871Z_k.js → pending-receive-nav-store-BaBTyiLf.js} +1 -1
- package/dist/public/assets/{prop-types-efgXxLQK.js → prop-types-CizsurD0.js} +1 -1
- package/dist/public/assets/{selection-context-DduX1a9e.js → selection-context-DV36ssJQ.js} +1 -1
- package/dist/public/assets/skill-actions-ayyLVAw5.js +1 -0
- package/dist/public/assets/skills-api-DO54o34O.js +1 -0
- package/dist/public/assets/{src-CrWE55qv.js → src-B3OD2BqU.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BbNgNG5U.js → tag-pill-input-D2qVy9HA.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CQRrvMAa.js → target-navigation-intent-BqElNT05.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BonWK_yo.js → telemetry-impl-DhefnhPq.js} +1 -1
- package/dist/public/assets/{telemetry-startup-8GtYsWN_.js → telemetry-startup--1E51CEj.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-w0URjEKX.js → terminal-cli-display-BTQdEy1j.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CLm4Tujb.js → terminal-launch-events-DNmxO4ft.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-Bwit7Ew2.js → terminal-telemetry-BC3JNC05.js} +1 -1
- package/dist/public/assets/{text-viewer-languages-BTH8XtqT.js → text-viewer-languages-CF6DiXgT.js} +2 -2
- package/dist/public/assets/{typing-burst-detector-BsBHDVMQ.js → typing-burst-detector-cZASYUag.js} +1 -1
- package/dist/public/assets/{uninstall-DjCmbDes.js → uninstall-D9_hPyyW.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BEZoTKp3.js → use-activity-panel-Drw3hRT0.js} +1 -1
- package/dist/public/assets/use-open-skill-C-OW-Q9z.js +1 -0
- package/dist/public/assets/use-popular-skills-BIvBkMNA.js +1 -0
- package/dist/public/assets/use-skill-origin-FTbTIS5Y.js +1 -0
- package/dist/public/assets/{use-terminal-enabled-BkVTRHtC.js → use-terminal-enabled-CSNDVdz8.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-izxsCAaR.js → use-timeline-entry-diff-DGCq_9Hl.js} +1 -1
- package/dist/public/index.html +53 -53
- package/dist/public/uninstall.html +6 -6
- package/dist/{repair-launch-json-CEYkUnFM.mjs → repair-launch-json-TrmFTJtM.mjs} +2 -2
- package/dist/repair-mcp-configs-D3EO32iD.mjs +2 -0
- package/dist/repair-skills-CTJ78v6_.mjs +4 -0
- package/dist/repair-skills-lEisdlv1.mjs +1 -0
- package/dist/{write-project-skill-Dx5URYrZ.mjs → resolve-project-root-CAzm4bRw.mjs} +7 -7
- package/dist/{skill-teardown-v6hvkG1K.mjs → skill-teardown-CwUORgAd.mjs} +2 -2
- package/dist/{src-C9i4ShN8.mjs → src-BEA-yn6c.mjs} +349 -343
- package/dist/src-BNK2WY-u.mjs +20 -0
- package/dist/{src-B8XCBdBS.mjs → src-Bz8L1kRK.mjs} +1 -1
- package/dist/src-Dhp-cFHN.mjs +1 -0
- package/dist/start-BgU8qitb.mjs +1 -0
- package/dist/{start-Dvp4c5OC.mjs → start-sc9lI5yb.mjs} +5 -5
- package/dist/{ui-Dasu2qV2.mjs → ui-BxBKs2IM.mjs} +3 -3
- package/package.json +16 -5
- package/scripts/verify-package-surface.mjs +57 -0
- package/dist/acp-harness-probe-BJzYpsw3.mjs +0 -3
- package/dist/constants-DUyeYVIA.mjs +0 -2
- package/dist/init-Cbs8z4hN.mjs +0 -1
- package/dist/init-dyoXLDJe.mjs +0 -638
- package/dist/loader-CcToduAY.mjs +0 -1
- package/dist/preview-C27B34AD.mjs +0 -1
- package/dist/public/assets/DocumentContext-DbGPUqq8.js +0 -38
- package/dist/public/assets/FeedbackForm-DcE2LfBd.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Cu_s8c5r.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DHpVizZA.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-5ojAKZte.js +0 -1
- package/dist/public/assets/SessionsHost-Cip5UxYO.js +0 -2
- package/dist/public/assets/ThreadView-h53Mk2UN.js +0 -14
- package/dist/public/assets/i18n-BzFVw6me.js +0 -1
- package/dist/public/assets/messages-7TQ4p_5e.js +0 -1
- package/dist/public/assets/messages-BAyOSOzR.js +0 -1
- package/dist/public/assets/messages-BLbXONgk.js +0 -1
- package/dist/public/assets/messages-BjIH4q0G.js +0 -1
- package/dist/public/assets/messages-BzRqDtdz.js +0 -1
- package/dist/public/assets/messages-Cimiq3nE.js +0 -1
- package/dist/public/assets/messages-Cn23SiIt.js +0 -1
- package/dist/public/assets/messages-Cpdcajhh.js +0 -1
- package/dist/public/assets/messages-DEperCf5.js +0 -1
- package/dist/public/assets/messages-Vju40UVv.js +0 -1
- package/dist/public/assets/messages-agMQw_WX.js +0 -1
- package/dist/public/assets/messages-pwWS2IL9.js +0 -1
- package/dist/public/assets/navigation-targets-saCskzOA.js +0 -1
- package/dist/public/assets/skill-actions-DkCHi4ZZ.js +0 -1
- package/dist/public/assets/skills-api-DriOKSSy.js +0 -1
- package/dist/public/assets/use-open-skill-xXTpeStI.js +0 -1
- package/dist/public/assets/use-popular-skills-CETjiK4b.js +0 -1
- package/dist/public/assets/use-skill-origin-Bpi6sqBq.js +0 -1
- package/dist/public/assets/use-skills-DJ009sMa.js +0 -1
- package/dist/repair-mcp-configs-BQB6jh4T.mjs +0 -2
- package/dist/repair-skills-CE-cFHgC.mjs +0 -4
- package/dist/repair-skills-CfNnIkaz.mjs +0 -1
- package/dist/src-D8n3k_FG.mjs +0 -1
- package/dist/src-LD12wA3I.mjs +0 -20
- package/dist/start-s6j381el.mjs +0 -1
- /package/dist/public/assets/{asset-dispatch-KsnhYIM1.js → asset-dispatch-CdZ_--jl.js} +0 -0
- /package/dist/public/assets/{badge-BHNK6NBf.js → badge-BG5JKjNK.js} +0 -0
- /package/dist/public/assets/{dist-D9pOpWzq.js → dist-ZfIywMZM.js} +0 -0
- /package/dist/public/assets/{external-link-B0bVg1hn.js → external-link-B4qPZwve.js} +0 -0
- /package/dist/public/assets/{globals--kx1ORbr.js → globals-tNjN0wSq.js} +0 -0
- /package/dist/public/assets/{stex-BUFg5G8g.js → stex-Bh4EH31F.js} +0 -0
- /package/dist/public/assets/{use-collab-url-cmMNtL6Q.js → use-collab-url-B7oEo69p.js} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -13473,6 +13473,15 @@ declare const LAUNCH_CONFIG_NAME = "open-knowledge-ui";
|
|
|
13473
13473
|
* empty config dirs for editors they haven't installed; the consent flow
|
|
13474
13474
|
* bypasses the check because the user explicitly toggled the editor
|
|
13475
13475
|
* checkbox in the dialog.
|
|
13476
|
+
*
|
|
13477
|
+
* The bypass does NOT extend to editors whose config dir doubles as their
|
|
13478
|
+
* detection probe — see `writeWouldFabricateDetection`. Those resolve to
|
|
13479
|
+
* `skipped-missing`, which BOTH consumers of this outcome handle:
|
|
13480
|
+
* the first-launch consent flow ignores it (only `failed` surfaces an error),
|
|
13481
|
+
* and Settings → AI tools maps it to an explicit "not found on this machine"
|
|
13482
|
+
* message in `integrations-settings.ts`'s `setEditor`. Settings is the
|
|
13483
|
+
* reachable path — its rows keep a live checkbox regardless of detection,
|
|
13484
|
+
* whereas the consent dialog only ever offers detected editors.
|
|
13476
13485
|
*/
|
|
13477
13486
|
declare function writeEditorMcpConfig(target: EditorMcpTarget, cwd: string, installOptions: McpInstallOptions, home?: string, configPathOverride?: string): EditorMcpResult;
|
|
13478
13487
|
interface UserMcpConfigsOptions {
|
|
@@ -13505,6 +13514,11 @@ interface UserMcpConfigsOptions {
|
|
|
13505
13514
|
* Bypasses `isEditorTargetAvailable` via `skipAvailabilityCheck: true` — the
|
|
13506
13515
|
* user explicitly toggled the editor checkbox; their click IS the consent,
|
|
13507
13516
|
* so skip-on-missing would silently drop their selection.
|
|
13517
|
+
*
|
|
13518
|
+
* Consent is consent to WIRE a tool, never to invent one: the bypass stops at
|
|
13519
|
+
* editors whose config dir is also their detection probe, where writing would
|
|
13520
|
+
* make OK detect a tool it only detects because it wrote there. Those come
|
|
13521
|
+
* back `skipped-missing` instead.
|
|
13508
13522
|
*/
|
|
13509
13523
|
declare function writeUserMcpConfigs(opts: UserMcpConfigsOptions): Promise<EditorMcpResult[]>;
|
|
13510
13524
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -430,7 +430,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
430
430
|
`){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function A1(e,t){return k1(e,!0).map(e=>t(e))}function j1(e){return(0,r1.exists)(e,r1.FOLDER)}function M1(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Bhe(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function N1(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function P1(e){return Array.isArray(e)?e:[e]}function F1(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function I1(e){return P1(e).map(e=>e instanceof String?e:String(e))}function L1(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function R1(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function z1(e){return(Array.isArray(e)?Buffer.concat(e):e).toString(`utf-8`)}function Vhe(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function Hhe(e=0){return new Promise(t=>setTimeout(t,e))}function B1(e){if(e!==!1)return e}var V1,H1,U1,W1=m1({"src/lib/utils/util.ts"(){e0(),V1=`\0`,H1=()=>{},U1=Object.prototype.toString.call.bind(Object.prototype.toString)}});function G1(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function K1(e,t){let n=o1(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function q1(e){return!!e&&U1(e)===`[object Object]`}function J1(e){return typeof e==`function`}var Y1,X1,Z1,Q1,$1,e0=m1({"src/lib/utils/argument-filters.ts"(){W1(),Y1=e=>Array.isArray(e),X1=e=>typeof e==`number`,Z1=e=>typeof e==`string`||o1(e),Q1=e=>Z1(e)||Array.isArray(e)&&e.every(Z1),$1=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),t0,Uhe=m1({"src/lib/utils/exit-codes.ts"(){t0=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(t0||{})}}),n0,Whe=m1({"src/lib/utils/git-output-streams.ts"(){n0=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function Ghe(){throw Error(`LineParser:useMatches not implemented`)}var r0,i0,Khe=m1({"src/lib/utils/line-parser.ts"(){r0=class{constructor(e,t){this.matches=[],this.useMatches=Ghe,this.parse=(e,t)=>(this.resetMatches(),this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))?this.useMatches(t,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},i0=class extends r0{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function qhe(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...a0},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var a0,Jhe=m1({"src/lib/utils/simple-git-options.ts"(){a0={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function o0(e,t=[]){return q1(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(o1(r))t.push(r);else if(K1(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)K1(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function s0(e,t=0,n=!1){let r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)`string|number`.includes(typeof e[n])&&r.push(String(e[n]));return o0(c0(e),r),n||r.push(...Yhe(e)),r}function Yhe(e){return I1(G1(D1(e,+(typeof D1(e)==`function`)),Y1,[]))}function c0(e){return G1(D1(e,+!!J1(D1(e))),q1)}function l0(e,t=!0){let n=C1(D1(e));return t||w1(n)?n:void 0}var Xhe=m1({"src/lib/utils/task-options.ts"(){e0(),W1()}});function u0(e,t){return e(t.stdOut,t.stdErr)}function d0(e,t,n,r=!0){return P1(n).forEach(n=>{for(let i=k1(n,r),a=0,o=i.length;a<o;a++){let n=(e=0)=>{if(!(a+e>=o))return i[a+e]};t.some(({parse:t})=>t(n,e))}}),e}var Zhe=m1({"src/lib/utils/task-parser.ts"(){W1()}}),f0={};h1(f0,{ExitCodes:()=>t0,GitOutputStreams:()=>n0,LineParser:()=>r0,NOOP:()=>H1,NULL:()=>V1,RemoteLineParser:()=>i0,append:()=>M1,appendTaskOptions:()=>o0,asArray:()=>P1,asCamelCase:()=>F1,asFunction:()=>C1,asNumber:()=>L1,asStringArray:()=>I1,bufferToString:()=>z1,callTaskParser:()=>u0,createInstanceConfig:()=>qhe,delay:()=>Hhe,filterArray:()=>Y1,filterFunction:()=>J1,filterHasLength:()=>$1,filterNumber:()=>X1,filterPlainObject:()=>q1,filterPrimitives:()=>K1,filterString:()=>Z1,filterStringOrStringArray:()=>Q1,filterType:()=>G1,first:()=>E1,folderExists:()=>j1,forEachLineWithContent:()=>A1,getTrailingOptions:()=>s0,including:()=>Bhe,isUserFunction:()=>w1,last:()=>D1,objectToString:()=>U1,orVoid:()=>B1,parseStringResponse:()=>d0,pick:()=>Vhe,prefixedArray:()=>R1,remove:()=>N1,splitOn:()=>T1,toLinesWithContent:()=>k1,trailingFunctionArgument:()=>l0,trailingOptionsArgument:()=>c0});var p0=m1({"src/lib/utils/index.ts"(){e0(),Uhe(),Whe(),Khe(),Jhe(),Xhe(),Zhe(),W1()}}),m0={};h1(m0,{CheckRepoActions:()=>_0,checkIsBareRepoTask:()=>g0,checkIsRepoRootTask:()=>h0,checkIsRepoTask:()=>Qhe});function Qhe(e){switch(e){case`bare`:return g0();case`root`:return h0()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:v0,parser:y0}}function h0(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:v0,parser(e){return/^\.(git)?$/.test(e.trim())}}}function g0(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:v0,parser:y0}}function $he(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var _0,v0,y0,b0=m1({"src/lib/tasks/check-is-repo.ts"(){p0(),_0=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(_0||{}),v0=({exitCode:e},t,n,r)=>{if(e===128&&$he(t))return n(Buffer.from(`false`));r(t)},y0=e=>e.trim()===`true`}});function ege(e,t){let n=new x0(e),r=e?C0:S0;return k1(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(w0.test(t)?n.folders:n.files).push(t)}),n}var x0,S0,C0,w0,tge=m1({"src/lib/responses/CleanSummary.ts"(){p0(),x0=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},S0=/^[a-z]+\s*/i,C0=/^[a-z]+\s+[a-z]+\s*/i,w0=/\/$/}}),T0={};h1(T0,{EMPTY_COMMANDS:()=>M0,adhocExecTask:()=>E0,configurationErrorTask:()=>D0,isBufferTask:()=>A0,isEmptyTask:()=>j0,straightThroughBufferTask:()=>k0,straightThroughStringTask:()=>O0});function E0(e){return{commands:M0,format:`empty`,parser:e}}function D0(e){return{commands:M0,format:`empty`,parser(){throw typeof e==`string`?new x1(e):e}}}function O0(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function k0(e){return{commands:e,format:`buffer`,parser(e){return e}}}function A0(e){return e.format===`buffer`}function j0(e){return e.format===`empty`||!e.commands.length}var M0,N0=m1({"src/lib/tasks/task.ts"(){S1(),M0=[]}}),P0={};h1(P0,{CONFIG_ERROR_INTERACTIVE_MODE:()=>I0,CONFIG_ERROR_MODE_REQUIRED:()=>L0,CONFIG_ERROR_UNKNOWN_OPTION:()=>R0,CleanOptions:()=>z0,cleanTask:()=>F0,cleanWithOptionsTask:()=>nge,isCleanOptionsArray:()=>rge});function nge(e,t){let{cleanMode:n,options:r,valid:i}=ige(e);return n?i.options?(r.push(...t),r.some(sge)?D0(I0):F0(n,r)):D0(R0+JSON.stringify(e)):D0(L0)}function F0(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return ege(e===`n`,t)}}}function rge(e){return Array.isArray(e)&&e.every(e=>B0.has(e))}function ige(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{age(e)?(t=e,r.cleanMode=!0):r.options=r.options&&oge(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function age(e){return e===`f`||e===`n`}function oge(e){return/^-[a-z]$/i.test(e)&&B0.has(e.charAt(1))}function sge(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var I0,L0,R0,z0,B0,V0=m1({"src/lib/tasks/clean.ts"(){tge(),p0(),N0(),I0=`Git clean interactive mode is not supported`,L0=`Git clean mode parameter ("n" or "f") is required`,R0=`Git clean unknown option found in: `,z0=(e=>(e.DRY_RUN=`n`,e.FORCE=`f`,e.IGNORED_INCLUDED=`x`,e.IGNORED_ONLY=`X`,e.EXCLUDING=`e`,e.QUIET=`q`,e.RECURSIVE=`d`,e))(z0||{}),B0=new Set([`i`,...I1(Object.values(z0))])}});function cge(e){let t=new U0;for(let n of H0(e))t.addValue(n.file,String(n.key),n.value);return t}function lge(e,t){let n=null,r=[],i=new Map;for(let a of H0(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function uge(e){return e.replace(/^(file):/,``)}function*H0(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=uge(n[e++]),i=n[e++],a=t;if(i.includes(`
|
|
431
431
|
`)){let e=T1(i,`
|
|
432
432
|
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var U0,dge=m1({"src/lib/responses/ConfigList.ts"(){p0(),U0=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=D1(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 W0(e,t){return typeof e==`string`&&Object.hasOwn(G0,e)?e:t}function fge(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 pge(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 lge(t,e)}}}function mge(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return cge(e)}}}function hge(){return{addConfig(e,t,...n){return this._runTask(fge(e,t,n[0]===!0,W0(n[1],`local`)),l0(arguments))},getConfig(e,t){return this._runTask(pge(e,W0(t,void 0)),l0(arguments))},listConfig(...e){return this._runTask(mge(W0(e[0],void 0)),l0(arguments))}}}var G0,K0=m1({"src/lib/tasks/config.ts"(){dge(),p0(),G0=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(G0||{})}});function gge(e){return J0.has(e)}var q0,J0,Y0=m1({"src/lib/tasks/diff-name-status.ts"(){q0=(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))(q0||{}),J0=new Set(Object.values(q0))}});function _ge(...e){return new $0().param(...e)}function vge(e){let t=new Set,n={};return A1(e,e=>{let[r,i,a]=e.split(V1);t.add(r),(n[r]=n[r]||[]).push({line:L1(i),path:r,preview:a})}),{paths:t,results:n}}function yge(){return{grep(e){let t=l0(arguments),n=s0(arguments);for(let e of X0)if(n.includes(e))return this._runTask(D0(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=_ge().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return vge(e)}},t)}}}var X0,Z0,Q0,$0,e2=m1({"src/lib/tasks/grep.ts"(){p0(),N0(),X0=[`-h`],Z0=Symbol(`grepQuery`),$0=class{constructor(){this[Q0]=[]}*[(Q0=Z0,Symbol.iterator)](){for(let e of this[Z0])yield e}and(...e){return e.length&&this[Z0].push(`--and`,`(`,...R1(e,`-e`),`)`),this}param(...e){return this[Z0].push(...R1(e,`-e`)),this}}}}),t2={};h1(t2,{ResetMode:()=>r2,getResetMode:()=>xge,resetTask:()=>bge});function bge(e,t){let n=[`reset`];return n2(e)&&n.push(`--${e}`),n.push(...t),O0(n)}function xge(e){if(n2(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function n2(e){return typeof e==`string`&&i2.includes(e)}var r2,i2,a2=m1({"src/lib/tasks/reset.ts"(){p0(),N0(),r2=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(r2||{}),i2=I1(Object.values(r2))}});function Sge(){return(0,s1.default)(`simple-git`)}function o2(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 Cge(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 s2(e,t,n,r=Sge()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=Cge(G1(t,Z1),o,r);return l(n);function c(t,n){return M1(a,s2(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&o2(o,n)||H1,s=o2(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var c2=m1({"src/lib/git-logger.ts"(){p0(),s1.default.formatters.L=e=>String($1(e)?e.length:`-`),s1.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):U1(e)}}),l2,wge=m1({"src/lib/runners/tasks-pending-queue.ts"(){v1(),c2(),l2=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:s2(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 _1(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 u2(e,t){return{method:E1(e.commands)||``,commands:t}}function Tge(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function d2(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var f2,Ege=m1({"src/lib/runners/git-executor-chain.ts"(){v1(),N0(),p0(),wge(),f2=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new l2}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(j0(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 _1?Object.assign(t,{task:e}):new _1(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`,``,u2(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...u2(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),A0(e)?u0(e.parser,a):u0(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},{...u2(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`,U1(e)),c(new n0(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 n0(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},u2(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,{...u2(e,n),kill(e){u=e||u}});let d=Pe(t,n,o);d.stdout.on(`data`,d2(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,d2(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,Tge(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...u2(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...u2(e,t),kill(e){n=e||n}}),n}}}}),p2={};h1(p2,{GitExecutor:()=>m2});var m2,Dge=m1({"src/lib/runners/git-executor.ts"(){Ege(),m2=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new f2(this,this._scheduler,this._plugins)}chain(){return new f2(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function Oge(e,t,n=H1){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof y1?kge(t):t,void 0)})}function kge(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=H1};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 Age=m1({"src/lib/task-callback.ts"(){b1(),p0()}});function h2(e,t){return E0(n=>{if(!j1(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var jge=m1({"src/lib/tasks/change-working-directory.ts"(){p0(),N0()}});function g2(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=N1(t,`-B`)),O0(t)}function Mge(){return{checkout(){return this._runTask(g2(s0(arguments,1)),l0(arguments))},checkoutBranch(e,t){return this._runTask(g2([`-b`,e,t,...s0(arguments)]),l0(arguments))},checkoutLocalBranch(e){return this._runTask(g2([`-b`,e,...s0(arguments)]),l0(arguments))}}}var Nge=m1({"src/lib/tasks/checkout.ts"(){p0(),N0()}});function Pge(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Fge(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return d0(Pge(),[_2],e)}})}}}var _2,Ige=m1({"src/lib/tasks/count-objects.ts"(){p0(),_2=new r0(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=F1(t);Object.hasOwn(e,r)&&(e[r]=L1(n))})}});function Lge(e){return d0({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},v2,e)}var v2,Rge=m1({"src/lib/parsers/parse-commit.ts"(){p0(),v2=[new r0(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new r0(/\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 r0(/(\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 r0(/^(\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 zge(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...R1(e,`-m`),...t,...n],format:`utf-8`,parser:Lge}}function Bge(){return{commit(t,...n){let r=l0(arguments),i=e(t)||zge(P1(t),P1(G1(n[0],Q1,[])),[...I1(G1(n[1],Y1,[])),...s0(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!Q1(e)&&D0(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Vge=m1({"src/lib/tasks/commit.ts"(){Rge(),p0(),N0()}});function Hge(){return{firstCommit(){return this._runTask(O0([`rev-list`,`--max-parents=0`,`HEAD`],!0),l0(arguments))}}}var Uge=m1({"src/lib/tasks/first-commit.ts"(){p0(),N0()}});function Wge(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),O0(n,!0)}var Gge=m1({"src/lib/tasks/hash-object.ts"(){N0()}});function Kge(e,t,n){let r=String(n).trim(),i;if(i=b2.exec(r))return new y2(e,t,!1,i[1]);if(i=x2.exec(r))return new y2(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new y2(e,t,/^re/i.test(r),a)}var y2,b2,x2,qge=m1({"src/lib/responses/InitSummary.ts"(){y2=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},b2=/^Init.+ repository in (.+)$/,x2=/^Rein.+ in (.+)$/}});function Jge(e){return e.includes(S2)}function Yge(e=!1,t,n){let r=[`init`,...n];return e&&!Jge(r)&&r.splice(1,0,S2),{commands:r,format:`utf-8`,parser(e){return Kge(r.includes(`--bare`),t,e)}}}var S2,Xge=m1({"src/lib/tasks/init.ts"(){qge(),S2=`--bare`}});function C2(e){for(let t=0;t<e.length;t++){let n=w2.exec(e[t]);if(n)return`--${n[1]}`}return``}function Zge(e){return w2.test(e)}var w2,T2=m1({"src/lib/args/log-format.ts"(){w2=/^--(stat|numstat|name-only|name-status)(=|$)/}}),E2,Qge=m1({"src/lib/responses/DiffSummary.ts"(){E2=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function D2(e=``){let t=M2[e];return e=>d0(new E2,t,e,!1)}var O2,k2,A2,j2,M2,N2=m1({"src/lib/parsers/parse-diff-summary.ts"(){T2(),Qge(),Y0(),p0(),O2=[new r0(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:L1(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new r0(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:L1(n),after:L1(r),binary:!0})}),new r0(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=L1(t),e.insertions=L1(r?.[1]),e.deletions=L1(i?.[1])})],k2=[new r0(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=L1(t),a=L1(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new r0(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],A2=[new r0(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],j2=[new r0(/([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:B1(gge(t)&&t),from:B1(!!a&&r!==a&&r),similarity:L1(n)})})],M2={"":O2,"--stat":O2,"--numstat":k2,"--name-status":j2,"--name-only":A2}}});function $ge(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function P2(e=L2,t=R2,n=``){let r=D2(n);return function(n){let i=k1(n.trim(),!1,F2).map(function(n){let i=n.split(I2),a=$ge(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 F2,I2,L2,R2,z2=m1({"src/lib/parsers/parse-list-log-summary.ts"(){p0(),N2(),T2(),F2=`òòòòòò `,I2=` òò`,L2=` ò `,R2=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),B2={};h1(B2,{diffSummaryTask:()=>e_e,validateLogFormatConfig:()=>V2});function e_e(e){let t=C2(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),V2(n)||{commands:n,format:`utf-8`,parser:D2(t)}}function V2(e){let t=e.filter(Zge);if(t.length>1)return D0(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return D0(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var H2=m1({"src/lib/tasks/diff.ts"(){T2(),N2(),N0()}});function t_e(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function n_e(e){return Object.keys(e).reduce((t,n)=>(n in W2||(t[n]=e[n]),t),{})}function U2(e={},t=[]){let n=G1(e.splitter,Z1,L2),[r,i]=t_e(q1(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:${F2}${i}${I2}`,...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 Z1(e.file)&&o.push(`--follow`,a1(e.file)),o0(n_e(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function r_e(e,t,n){let r=P2(e,t,C2(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function i_e(){return{log(...n){let r=l0(arguments),i=U2(c0(arguments),I1(G1(arguments[0],Y1,[]))),a=t(...n)||V2(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return r_e(e.splitter,e.fields,e.commands)}function t(e,t){return Z1(e)&&Z1(t)&&D0(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var W2,G2=m1({"src/lib/tasks/log.ts"(){T2(),z2(),p0(),N0(),H2(),W2=(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))(W2||{})}}),K2,q2,a_e=m1({"src/lib/responses/MergeSummary.ts"(){K2=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},q2=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`}}}}),J2,Y2,o_e=m1({"src/lib/responses/PullSummary.ts"(){J2=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Y2=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function X2(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 Z2(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:L1(t&&t[1]||`0`),delta:L1(n&&n[1]||`0`)}}var Q2,s_e=m1({"src/lib/parsers/parse-remote-objects.ts"(){p0(),Q2=[new i0(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=X2(e.remoteMessages);Object.assign(i,{[r]:L1(n)})}),new i0(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=X2(e.remoteMessages);Object.assign(i,{[r]:L1(n)})}),new i0(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=X2(e.remoteMessages);i.total=Z2(t),i.reused=Z2(n),i.packReused=L1(r)})]}});function $2(e,t){return d0({remoteMessages:new t4},e4,t)}var e4,t4,n4=m1({"src/lib/parsers/parse-remote-messages.ts"(){p0(),s_e(),e4=[new i0(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Q2,new i0([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new i0([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:L1(t),summary:n,url:r}})],t4=class{constructor(){this.all=[]}}}});function c_e(e,t){let n=d0(new Y2,s4,[e,t]);return n.message&&n}var r4,i4,a4,o4,s4,c4,l4,u4=m1({"src/lib/parsers/parse-pull.ts"(){o_e(),p0(),n4(),r4=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,i4=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,a4=/^(create|delete) mode \d+ (.+)/,o4=[new r0(r4,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new r0(i4,(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 r0(a4,(e,[t,n])=>{M1(e.files,n),M1(t===`create`?e.created:e.deleted,n)})],s4=[new r0(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new r0(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new r0(/([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})],c4=(e,t)=>d0(new J2,o4,[e,t]),l4=(e,t)=>Object.assign(new J2,c4(e,t),$2(e,t))}}),d4,f4,p4,l_e=m1({"src/lib/parsers/parse-merge.ts"(){a_e(),p0(),u4(),d4=[new r0(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new r0(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new K2(t,n))}),new r0(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new K2(t,n,{deleteRef:r}))}),new r0(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new K2(t,null))}),new r0(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],f4=(e,t)=>Object.assign(p4(e,t),l4(e,t)),p4=e=>d0(new q2,d4,e)}});function m4(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=f4(e,t);if(n.failed)throw new y1(n);return n}}:D0(`Git.merge requires at least one option`)}var u_e=m1({"src/lib/tasks/merge.ts"(){b1(),l_e(),N0()}});function d_e(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 h4,g4,_4,f_e=m1({"src/lib/parsers/parse-push.ts"(){p0(),n4(),h4=[new r0(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new r0(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new r0(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(d_e(t,n,r))}),new r0(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new r0(/^([^:]+):(\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}}})],g4=(e,t)=>{let n=_4(e,t),r=$2(e,t);return{...n,...r}},_4=(e,t)=>d0({pushed:[]},h4,[e,t])}}),v4={};h1(v4,{pushTagsTask:()=>p_e,pushTask:()=>y4});function p_e(e={},t){return M1(t,`--tags`),y4(e,t)}function y4(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),N1(n,`-v`),M1(n,`--verbose`),M1(n,`--porcelain`),{commands:n,format:`utf-8`,parser:g4}}var b4=m1({"src/lib/tasks/push.ts"(){f_e(),p0()}});function m_e(){return{showBuffer(){let e=[`show`,...s0(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(k0(e),l0(arguments))},show(){let e=[`show`,...s0(arguments,1)];return this._runTask(O0(e),l0(arguments))}}}var h_e=m1({"src/lib/tasks/show.ts"(){p0(),N0()}}),x4,S4,g_e=m1({"src/lib/responses/FileStatusSummary.ts"(){x4=/^(.+)\0(.+)$/,S4=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=x4.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function C4(e){let[t,n]=e.split(V1);return{from:n||t,to:t}}function w4(e,t,n){return[`${e}${t}`,n]}function T4(e,...t){return t.map(t=>w4(e,t,(e,t)=>e.conflicted.push(t)))}function __e(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=D4.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new S4(r,t,n))}}var E4,D4,O4,v_e=m1({"src/lib/responses/StatusSummary.ts"(){p0(),g_e(),E4=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}},D4=new Map([w4(` `,`A`,(e,t)=>e.created.push(t)),w4(` `,`D`,(e,t)=>e.deleted.push(t)),w4(` `,`M`,(e,t)=>e.modified.push(t)),w4(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),w4(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),w4(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),w4(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),w4(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),w4(`R`,` `,(e,t)=>{e.renamed.push(C4(t))}),w4(`R`,`M`,(e,t)=>{let n=C4(t);e.renamed.push(n),e.modified.push(n.to)}),w4(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),w4(`?`,`?`,(e,t)=>e.not_added.push(t)),...T4(`A`,`A`,`U`),...T4(`D`,`D`,`U`),...T4(`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=G1(s?.[1],Z1,null),s=a.exec(t),e.tracking=G1(s?.[1],Z1,null),s=o.exec(t),s&&(e.current=G1(s?.[1],Z1,e.current)),e.detached=/\(no branch\)/.test(t)}]]),O4=function(e){let t=e.split(V1),n=new E4;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=V1+(t[e++]||``)),__e(n,r))}return n}}});function y_e(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!k4.includes(e))],parser(e){return O4(e)}}}var k4,b_e=m1({"src/lib/tasks/status.ts"(){v_e(),k4=[`--null`,`-z`]}});function A4(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 x_e(){return A4(0,0,0,``,!1)}function S_e(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:C_e,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(j4));r(t)}})}}}function C_e(e){return e===j4?x_e():d0(A4(0,0,0,e),M4,e)}var j4,M4,w_e=m1({"src/lib/tasks/version.ts"(){p0(),j4=`installed=false`,M4=[new r0(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,A4(L1(t),L1(n),L1(r),i))}),new r0(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,A4(L1(t),L1(n),r,i))})]}});function N4(e,t,n,...r){return Z1(n)?t(n,G1(r[0],Z1),s0(arguments)):D0(`git.${e}() requires a string 'repoPath'`)}function T_e(){return{clone(e,...t){return this._runTask(N4(`clone`,P4,G1(e,Z1),...t),l0(arguments))},mirror(e,...t){return this._runTask(N4(`mirror`,F4,G1(e,Z1),...t),l0(arguments))}}}var P4,F4,E_e=m1({"src/lib/tasks/clone.ts"(){N0(),p0(),P4=(e,t,n)=>{let r=[`clone`,...n];return Z1(e)&&r.push(a1(e)),Z1(t)&&r.push(a1(t)),O0(r)},F4=(e,t,n)=>(M1(n,`--mirror`),P4(e,t,n))}}),I4={};h1(I4,{SimpleGitApi:()=>L4});var L4,D_e=m1({"src/lib/simple-git-api.ts"(){Age(),jge(),Nge(),Ige(),Vge(),K0(),Uge(),e2(),Gge(),Xge(),G2(),u_e(),b4(),h_e(),b_e(),N0(),w_e(),p0(),E_e(),L4=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&Oge(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(O0([`add`,...P1(e)]),l0(arguments))}cwd(e){let t=l0(arguments);return typeof e==`string`?this._runTask(h2(e,this._executor),t):typeof e?.path==`string`?this._runTask(h2(e.path,e.root&&this._executor||void 0),t):this._runTask(D0(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Wge(e,t===!0),l0(arguments))}init(e){return this._runTask(Yge(e===!0,this._executor.cwd,s0(arguments)),l0(arguments))}merge(){return this._runTask(m4(s0(arguments)),l0(arguments))}mergeFromTo(e,t){return Z1(e)&&Z1(t)?this._runTask(m4([e,t,...s0(arguments)]),l0(arguments,!1)):this._runTask(D0(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=y4({remote:G1(arguments[0],Z1),branch:G1(arguments[1],Z1)},s0(arguments));return this._runTask(e,l0(arguments))}stash(){return this._runTask(O0([`stash`,...s0(arguments)]),l0(arguments))}status(){return this._runTask(y_e(s0(arguments)),l0(arguments))}},Object.assign(L4.prototype,Mge(),T_e(),Bge(),hge(),Fge(),Hge(),yge(),i_e(),m_e(),S_e())}}),R4={};h1(R4,{Scheduler:()=>B4});var z4,B4,O_e=m1({"src/lib/runners/scheduler.ts"(){p0(),c2(),z4=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,c1.createDeferred)();return{promise:t,done:n,id:e}}})(),B4=class{constructor(e=2){this.concurrency=e,this.logger=s2(``,`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=M1(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),N1(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=M1(this.pending,z4());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),V4={};h1(V4,{applyPatchTask:()=>k_e});function k_e(e,t){return O0([`apply`,...t,...e])}var A_e=m1({"src/lib/tasks/apply-patch.ts"(){N0()}});function j_e(e,t){return{branch:e,hash:t,success:!0}}function M_e(e){return{branch:e,hash:null,success:!1}}var H4,N_e=m1({"src/lib/responses/BranchDeleteSummary.ts"(){H4=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function U4(e,t){return t===1&&G4.test(e)}var W4,G4,K4,q4,P_e=m1({"src/lib/parsers/parse-branch-delete.ts"(){N_e(),p0(),W4=/(\S+)\s+\(\S+\s([^)]+)\)/,G4=/^error[^']+'([^']+)'/m,K4=[new r0(W4,(e,[t,n])=>{let r=j_e(t,n);e.all.push(r),e.branches[t]=r}),new r0(G4,(e,[t])=>{let n=M_e(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],q4=(e,t)=>d0(new H4,K4,[e,t])}}),J4,F_e=m1({"src/lib/responses/BranchSummary.ts"(){J4=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 Y4(e){return e?e.charAt(0):``}function X4(e,t=!1){return d0(new J4,t?[Q4]:Z4,e)}var Z4,Q4,I_e=m1({"src/lib/parsers/parse-branch.ts"(){F_e(),p0(),Z4=[new r0(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(Y4(t),!0,n,r,i)}),new r0(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(Y4(t),!1,n,r,i)})],Q4=new r0(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),$4={};h1($4,{branchLocalTask:()=>R_e,branchTask:()=>L_e,containsDeleteBranchCommand:()=>e3,deleteBranchTask:()=>B_e,deleteBranchesTask:()=>z_e});function e3(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function L_e(e){let t=e3(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?q4(e,r).all[0]:X4(e,n)}}}function R_e(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return X4(e)}}}function z_e(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return q4(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!U4(String(n),e))return i(n);r(t)}}}function B_e(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return q4(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!U4(String(i),e))return o(i);throw new y1(n.parser(z1(r),z1(t)),String(i))}};return n}var V_e=m1({"src/lib/tasks/branch.ts"(){b1(),P_e(),I_e(),p0()}});function H_e(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&he(t)}var t3,U_e=m1({"src/lib/responses/CheckIgnore.ts"(){t3=e=>e.split(/\n/g).map(H_e).filter(Boolean)}}),n3={};h1(n3,{checkIgnoreTask:()=>W_e});function W_e(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:t3}}var G_e=m1({"src/lib/tasks/check-ignore.ts"(){U_e()}});function K_e(e,t){return d0({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},r3,[e,t])}var r3,q_e=m1({"src/lib/parsers/parse-fetch.ts"(){p0(),r3=[new r0(/From (.+)$/,(e,[t])=>{e.remote=t}),new r0(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new r0(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new r0(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new r0(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),i3={};h1(i3,{fetchTask:()=>Y_e});function J_e(e){return/^--upload-pack(=|$)/.test(e)}function Y_e(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(J_e)?D0(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:K_e}}var X_e=m1({"src/lib/tasks/fetch.ts"(){q_e(),N0()}});function Z_e(e){return d0({moves:[]},a3,e)}var a3,Q_e=m1({"src/lib/parsers/parse-move.ts"(){p0(),a3=[new r0(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),o3={};h1(o3,{moveTask:()=>$_e});function $_e(e,t){return{commands:[`mv`,`-v`,...P1(e),t],format:`utf-8`,parser:Z_e}}var eve=m1({"src/lib/tasks/move.ts"(){Q_e(),p0()}}),s3={};h1(s3,{pullTask:()=>tve});function tve(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 l4(e,t)},onError(e,t,n,r){let i=c_e(z1(e.stdOut),z1(e.stdErr));if(i)return r(new y1(i));r(t)}}}var nve=m1({"src/lib/tasks/pull.ts"(){b1(),u4(),p0()}});function rve(e){let t={};return c3(e,([e])=>t[e]={name:e}),Object.values(t)}function ive(e){let t={};return c3(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 c3(e,t){A1(e,e=>t(e.split(/\s+/)))}var ave=m1({"src/lib/responses/GetRemoteSummary.ts"(){p0()}}),l3={};h1(l3,{addRemoteTask:()=>ove,getRemotesTask:()=>sve,listRemotesTask:()=>cve,remoteTask:()=>lve,removeRemoteTask:()=>uve});function ove(e,t,n){return O0([`remote`,`add`,...n,e,t])}function sve(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?ive:rve}}function cve(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),O0(t)}function lve(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),O0(t)}function uve(e){return O0([`remote`,`remove`,e])}var dve=m1({"src/lib/tasks/remote.ts"(){ave(),N0()}}),u3={};h1(u3,{stashListTask:()=>fve});function fve(e={},t){let n=U2(e),r=[`stash`,`list`,...n.commands,...t],i=P2(n.splitter,n.fields,C2(r));return V2(r)||{commands:r,format:`utf-8`,parser:i}}var pve=m1({"src/lib/tasks/stash-list.ts"(){T2(),z2(),H2(),G2()}}),d3={};h1(d3,{addSubModuleTask:()=>mve,initSubModuleTask:()=>hve,subModuleTask:()=>f3,updateSubModuleTask:()=>gve});function mve(e,t){return f3([`add`,e,t])}function hve(e){return f3([`init`,...e])}function f3(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),O0(t)}function gve(e){return f3([`update`,...e])}var _ve=m1({"src/lib/tasks/sub-module.ts"(){N0()}});function vve(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?p3(e,t):0:n?1:-1}function p3(e,t){return e===t?0:e>t?1:-1}function yve(e){return e.trim()}function m3(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var h3,g3,bve=m1({"src/lib/responses/TagList.ts"(){h3=class{constructor(e,t){this.all=e,this.latest=t}},g3=function(e,t=!1){let n=e.split(`
|
|
433
|
-
`).map(yve).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return vve(m3(n[0]),m3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=p3(m3(n[e]),m3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new h3(n,r)}}}),_3={};h1(_3,{addAnnotatedTagTask:()=>Cve,addTagTask:()=>Sve,tagListTask:()=>xve});function xve(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return g3(e,t)}}}function Sve(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function Cve(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var wve=m1({"src/lib/tasks/tag.ts"(){bve()}}),Tve=Rhe({"src/git.js"(e,t){var{GitExecutor:n}=(Dge(),g1(p2)),{SimpleGitApi:r}=(D_e(),g1(I4)),{Scheduler:i}=(O_e(),g1(R4)),{adhocExecTask:a,configurationErrorTask:o}=(N0(),g1(T0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(p0(),g1(f0)),{applyPatchTask:g}=(A_e(),g1(V4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(V_e(),g1($4)),{checkIgnoreTask:x}=(G_e(),g1(n3)),{checkIsRepoTask:S}=(b0(),g1(m0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(V0(),g1(P0)),{diffSummaryTask:T}=(H2(),g1(B2)),{fetchTask:E}=(X_e(),g1(i3)),{moveTask:D}=(eve(),g1(o3)),{pullTask:ee}=(nve(),g1(s3)),{pushTagsTask:te}=(b4(),g1(v4)),{addRemoteTask:ne,getRemotesTask:re,listRemotesTask:ie,remoteTask:ae,removeRemoteTask:oe}=(dve(),g1(l3)),{getResetMode:O,resetTask:se}=(a2(),g1(t2)),{stashListTask:k}=(pve(),g1(u3)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(_ve(),g1(d3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(wve(),g1(_3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(N0(),g1(T0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.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},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(ee(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.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.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(O(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.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(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(ne(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(oe(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(re(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ae(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=te({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.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`?pe(r):me(r);return this._runTask(a,n)},M.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`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(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))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.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.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});v1(),v1(),v1(),b1(),S1(),b0(),V0(),K0(),Y0(),e2(),a2(),p0(),p0(),(0,c1.deferred)().promise,p0(),v1(),p0(),p0(),p0(),p0(),Tve(),b1(),$$(`checkpoint-chain`);function v3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function Eve(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}$$(`shadow-lock`),$$(`shadow-op-gate`),$$(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),MX.fileSystem,MX.gitUpstream,MX.service,MX.generator,$$(`bridge-loss-detector`),$$(`checkpoint`);function y3(e){let t=me(e).toLowerCase();return Tl.includes(t)}function Dve(e){let t=e.toLowerCase();for(let n of Tl)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Ove(e){return e===`__system__`}const kve=new Set(xl);function Ave(e){return kve.has(e)}function jve(e){return Cl(e)}function Mve(e){return Ove(e)||Ave(e)||jve(e)}$$(`parse-pool`),Math.max(1,Math.min(4,ae()-1)),e1(()=>{}),$$(`bridge-watchdog`),e1(()=>{}),$$(`server-observers`),$$(`server-observers`),$$(`agent-sessions`);function Nve(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}Nve(),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Pve=Za({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:ia(),autoUpdate:L().optional()});Za({schema:U(1),skills:V(F(),Pve).default({})}),new Set(Object.values(Vl)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const b3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var Fve=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),Ive=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=Fve(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),Lve=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);Ive();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:Lve();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});const x3={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...x3,propertyKey:F().min(1).optional(),propertyPath:z($a([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const S3=Sa();to(`action`,[B({action:U(`edit`),id:S3,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:S3,summary:F().optional()}),B({action:U(`reopen`),id:S3,summary:F().optional()}),B({action:U(`replace`),id:S3,...x3,summary:F().optional()}),B({action:U(`queue`),id:S3,summary:F().optional()}),B({action:U(`unqueue`),id:S3,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:S3,summary:F().optional()}),B({action:U(`dispatch-complete`),id:S3,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(S3).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(S3).min(1).max(200),summary:F().optional()})]);const C3="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const Rve=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),zve=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(AJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),Rve.optional(),z(OJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Bve=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function w3(e){return{text:Bve,...e}}new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Fl.cursor,Fl.codex,Fl[`claude-desktop`],$$(`embeddings`),$$(`embeddings`);function Vve(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Vve(rs),$$(`embeddings`),$$(`embeddings`);const Hve=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Uve=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,T3=String.raw`([^\]\n]*)`,E3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,D3=e=>RegExp(`(!?)${Hve}`,e),O3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Uve}`,t);D3(`y`),D3(`g`),O3(T3,`y`),O3(E3,`y`),O3(T3,`g`),O3(E3,`g`);const Wve=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(Wve,`y`);function k3(e){return e.replace(/\\/g,`/`)}function A3(e){return{...e,windowsHide:!0}}B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),$$(`installed-skills-marker`);var j3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);const M3=$$(`content-filter`);Fe(s);const N3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],P3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...N3,`Library`,`Applications`,`.Trash`]),Gve=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...N3]),F3=new Set([`worktrees`,`local`]);function I3(e){let t=ls(e);if(!us(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function Kve(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function qve(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Bo.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return Kve(t)}function L3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(Gve.has(i)&&!(t&&i===`.ok`&&!F3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function R3(e){return e.startsWith(`${wl}/`)}function Jve(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const z3=new Set([`.ok`,...N3]),Yve=new Set([...P3].filter(e=>!z3.has(e))),Xve=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function Zve(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Yve.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&F3.has((t[n+1]??``).toLowerCase()))}const Qve=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...N3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function $ve(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if(Zve(t))return!1;if(n.some(e=>z3.has(e)))return!0;try{let e=(0,j3.default)().add(t);return Qve.some(t=>e.ignores(t))}catch{return!0}}function eye(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!$ve(e));return[...new Set([...t,...Xve])]}function B3(e,t){for(let n=0;n<t;n++)if(P3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function V3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!B3(t,n-3)}function H3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!B3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!B3(t,n-2):!1}function tye(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||V3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!B3(t,n-2):!1}function nye(e){return e===`.ok`||e===`.ok/schemas`?!0:H3(e)}function rye(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function U3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function iye(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const aye=new Set([`.DS_Store`,`.localized`]);function W3(e){return aye.has(e.slice(e.lastIndexOf(`/`)+1))}const oye=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function G3(e){for(let t of e.split(`/`))if(oye.has(t.toLowerCase()))return!0;return!1}const sye=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),cye=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function K3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||sye.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of cye)if(t.endsWith(e))return!0;return!1}function lye(e,t){return t===e||t.startsWith(`${e}/`)}const q3=[`.gitignore`,`.okignore`];function uye(e,t){let n=dye(e);if(n===null)return[];let r=[];J3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=fye(e);return i&&J3(i,t,r,`global excludesfile`),r}function dye(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],A3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function fye(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],A3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return pye()}function pye(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(O(),`.config`),`git`,`ignore`)}function J3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...X3(r))}catch(t){M3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function mye(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=I3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=k3(_e(t,n)),l=c.startsWith(`..`),u,d,f,p,m=0,h=0,_=0;function v(){let e=(0,j3.default)(),r=(0,j3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of q3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=X3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){M3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(c&&!l)for(let t of q3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=X3(n).map(e=>Z3(e,c));e.add(s),t===`.okignore`&&r.add(s)}catch(e){M3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=Q3(n,t,e,r,s),a=s.value;let v=uye(t,s);a=s.value,v.length>0&&(i.push(...v),e.add(v));let y=eye(i);return u=e,d=r,f=i,p=y,m=i.length,h=o,_=a,{patternCount:m,nestedFileCount:h,bytes:_}}v();let y=new Map;function b(e,t){if(l&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!c?e:`${c}/${e}`;return n.startsWith(`..`)?!1:u.ignores(n)}function x(e,t){return t.pathBase===`project`||!c?e:`${c}/${e}`}function C(e){if(l)return!1;let t=c?`${c}/${e}`:e;return d.ignores(t)}let w=()=>{i===void 0&&Y3(n,``,b,y)};w();function T(e){return Mve(Dve(e))}function E(e){for(let t of e.split(`/`))if(P3.has(t))return!0;return l?!1:b(e)}return{isExcluded(e,t){if(T(e)||K3(e)||G3(e)||!t?.bypassFilters&&rye(e,s)&&!U3(e,a))return!0;if(!t?.bypassFilters&&(R3(e)||U3(e,a)&&!b(e))){if(i!==void 0)return e!==i;if(y3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Bo.has(t)}if(!t?.bypassFilters&&V3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&tye(x(e,t.syncScope))&&!b(e,t.syncScope))return i===void 0?!1:e!==i;if(L3(e,t?.showOk)||W3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&C(e);if(E(e))return!0;if(y3(e)||qve(e,o,e=>(y.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Bo.has(n)){let t=pe(e),n=t===`.`?``:t;if((y.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(G3(e))return!0;if(!t?.bypassFilters&&(Jve(e)||H3(e)||t?.syncScope!==void 0&&nye(x(e,t.syncScope))||iye(e,a)))return!1;if(L3(e,t?.showOk))return!0;if(i!==void 0)return!lye(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(C(e)||C(`${e}/`));for(let t of e.split(`/`))if(P3.has(t))return!0;return l?!1:b(e,t?.syncScope)||b(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return T(e)||K3(e)||G3(e)?!0:R3(e)||U3(e,a)&&!b(e)||V3(e)?!1:L3(e)||W3(e)?!0:t?.bypassFilters?!1:E(e)},getWatcherIgnoreGlobs(){return p},incrementMdDir(e){let t=e===`.`?``:e;y.set(t,(y.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=y.get(t)??0;n<=1?y.delete(t):y.set(t,n-1)},rebuildDirCount(){let e=new Map(y);y.clear();try{w()}catch(t){for(let[t,n]of e)y.set(t,n);M3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=I3(e)},async rebuildIgnorePatterns(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){M3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=u,n=d,i=f,o=p,s=m,c=h,l=_,g=Date.now();return Ohe(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=v();y.clear(),w();let n=Date.now()-g;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),M3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n},`content-filter rebuild succeeded`),r)try{r()}catch(e){M3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n}}catch(e){u=t,d=n,f=i,p=o,m=s,h=c,_=l,y.clear();try{w()}catch(e){M3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let r=e instanceof Error?e.message:String(e);return M3.warn({err:e instanceof Error?e:Error(r)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:r}}}})}}}function Y3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){M3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(P3.has(a.name)||n(i)||n(`${i}/`))continue;Y3(N(e,a.name),i,n,r)}else a.isFile()&&y3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function X3(e){return e.split(`
|
|
433
|
+
`).map(yve).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return vve(m3(n[0]),m3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=p3(m3(n[e]),m3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new h3(n,r)}}}),_3={};h1(_3,{addAnnotatedTagTask:()=>Cve,addTagTask:()=>Sve,tagListTask:()=>xve});function xve(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return g3(e,t)}}}function Sve(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function Cve(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var wve=m1({"src/lib/tasks/tag.ts"(){bve()}}),Tve=Rhe({"src/git.js"(e,t){var{GitExecutor:n}=(Dge(),g1(p2)),{SimpleGitApi:r}=(D_e(),g1(I4)),{Scheduler:i}=(O_e(),g1(R4)),{adhocExecTask:a,configurationErrorTask:o}=(N0(),g1(T0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(p0(),g1(f0)),{applyPatchTask:g}=(A_e(),g1(V4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(V_e(),g1($4)),{checkIgnoreTask:x}=(G_e(),g1(n3)),{checkIsRepoTask:S}=(b0(),g1(m0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(V0(),g1(P0)),{diffSummaryTask:T}=(H2(),g1(B2)),{fetchTask:E}=(X_e(),g1(i3)),{moveTask:D}=(eve(),g1(o3)),{pullTask:ee}=(nve(),g1(s3)),{pushTagsTask:te}=(b4(),g1(v4)),{addRemoteTask:ne,getRemotesTask:re,listRemotesTask:ie,remoteTask:ae,removeRemoteTask:oe}=(dve(),g1(l3)),{getResetMode:O,resetTask:se}=(a2(),g1(t2)),{stashListTask:k}=(pve(),g1(u3)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(_ve(),g1(d3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(wve(),g1(_3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(N0(),g1(T0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.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},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(ee(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.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.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(O(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.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(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(ne(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(oe(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(re(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ae(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=te({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.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`?pe(r):me(r);return this._runTask(a,n)},M.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`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(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))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.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.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});v1(),v1(),v1(),b1(),S1(),b0(),V0(),K0(),Y0(),e2(),a2(),p0(),p0(),(0,c1.deferred)().promise,p0(),v1(),p0(),p0(),p0(),p0(),Tve(),b1(),$$(`checkpoint-chain`);function v3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function Eve(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}$$(`shadow-lock`),$$(`shadow-op-gate`),$$(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),MX.fileSystem,MX.gitUpstream,MX.service,MX.generator,$$(`bridge-loss-detector`),$$(`checkpoint`);function y3(e){let t=me(e).toLowerCase();return Tl.includes(t)}function Dve(e){let t=e.toLowerCase();for(let n of Tl)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Ove(e){return e===`__system__`}const kve=new Set(xl);function Ave(e){return kve.has(e)}function jve(e){return Cl(e)}function Mve(e){return Ove(e)||Ave(e)||jve(e)}$$(`parse-pool`),Math.max(1,Math.min(4,ae()-1)),e1(()=>{}),$$(`bridge-watchdog`),e1(()=>{}),$$(`server-observers`),$$(`server-observers`),$$(`agent-sessions`);function Nve(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}Nve(),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Pve=Za({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:ia(),autoUpdate:L().optional()});Za({schema:U(1),skills:V(F(),Pve).default({})}),new Set(Object.values(Vl)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const b3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var Fve=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),Ive=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=Fve(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),Lve=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);Ive();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:Lve();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});const x3={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...x3,propertyKey:F().min(1).optional(),propertyPath:z($a([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const S3=Sa();to(`action`,[B({action:U(`edit`),id:S3,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:S3,summary:F().optional()}),B({action:U(`reopen`),id:S3,summary:F().optional()}),B({action:U(`replace`),id:S3,...x3,summary:F().optional()}),B({action:U(`queue`),id:S3,summary:F().optional()}),B({action:U(`unqueue`),id:S3,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:S3,summary:F().optional()}),B({action:U(`dispatch-complete`),id:S3,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(S3).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(S3).min(1).max(200),summary:F().optional()})]);const C3="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const Rve=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),zve=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(AJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),Rve.optional(),z(OJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Bve=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function w3(e){return{text:Bve,...e}}new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Fl.cursor,Fl.codex,Fl[`claude-desktop`],$$(`embeddings`),$$(`embeddings`);function Vve(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Vve(rs),$$(`embeddings`),$$(`embeddings`);const Hve=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Uve=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,T3=String.raw`([^\]\n]*)`,E3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,D3=e=>RegExp(`(!?)${Hve}`,e),O3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Uve}`,t);D3(`y`),D3(`g`),O3(T3,`y`),O3(E3,`y`),O3(T3,`g`),O3(E3,`g`);const Wve=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(Wve,`y`);function k3(e){return e.replace(/\\/g,`/`)}function A3(e){return{...e,windowsHide:!0}}B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),$$(`installed-skills-marker`);var j3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);const M3=$$(`content-filter`);Fe(s);const N3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],P3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...N3,`Library`,`Applications`,`.Trash`]),Gve=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...N3]),F3=new Set([`worktrees`,`local`]);function I3(e){let t=ls(e);if(!us(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function Kve(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function qve(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Bo.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return Kve(t)}function L3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(Gve.has(i)&&!(t&&i===`.ok`&&!F3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function R3(e){return e.startsWith(`${wl}/`)}function Jve(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const z3=new Set([`.ok`,...N3]),Yve=new Set([...P3].filter(e=>!z3.has(e))),Xve=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function Zve(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Yve.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&F3.has((t[n+1]??``).toLowerCase()))}const Qve=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...N3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function $ve(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if(Zve(t))return!1;if(n.some(e=>z3.has(e)))return!0;try{let e=(0,j3.default)().add(t);return Qve.some(t=>e.ignores(t))}catch{return!0}}function eye(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!$ve(e));return[...new Set([...t,...Xve])]}function B3(e,t){for(let n=0;n<t;n++)if(P3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function V3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!B3(t,n-3)}function H3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!B3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!B3(t,n-2):!1}function tye(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||V3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!B3(t,n-2):!1}function nye(e){return e===`.ok`||e===`.ok/schemas`?!0:H3(e)}function rye(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function U3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function iye(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const aye=new Set([`.ds_store`,`.localized`,`thumbs.db`,`desktop.ini`,`.directory`]);function W3(e){return aye.has(e.slice(e.lastIndexOf(`/`)+1).toLowerCase())}const oye=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function G3(e){for(let t of e.split(`/`))if(oye.has(t.toLowerCase()))return!0;return!1}const sye=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),cye=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function K3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||sye.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of cye)if(t.endsWith(e))return!0;return!1}function lye(e,t){return t===e||t.startsWith(`${e}/`)}const q3=[`.gitignore`,`.okignore`];function uye(e,t){let n=dye(e);if(n===null)return[];let r=[];J3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=fye(e);return i&&J3(i,t,r,`global excludesfile`),r}function dye(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],A3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function fye(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],A3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return pye()}function pye(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(O(),`.config`),`git`,`ignore`)}function J3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...X3(r))}catch(t){M3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function mye(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=I3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=k3(_e(t,n)),l=c.startsWith(`..`),u,d,f,p,m=0,h=0,_=0;function v(){let e=(0,j3.default)(),r=(0,j3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of q3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=X3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){M3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(c&&!l)for(let t of q3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=X3(n).map(e=>Z3(e,c));e.add(s),t===`.okignore`&&r.add(s)}catch(e){M3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=Q3(n,t,e,r,s),a=s.value;let v=uye(t,s);a=s.value,v.length>0&&(i.push(...v),e.add(v));let y=eye(i);return u=e,d=r,f=i,p=y,m=i.length,h=o,_=a,{patternCount:m,nestedFileCount:h,bytes:_}}v();let y=new Map;function b(e,t){if(l&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!c?e:`${c}/${e}`;return n.startsWith(`..`)?!1:u.ignores(n)}function x(e,t){return t.pathBase===`project`||!c?e:`${c}/${e}`}function C(e){if(l)return!1;let t=c?`${c}/${e}`:e;return d.ignores(t)}let w=()=>{i===void 0&&Y3(n,``,b,y)};w();function T(e){return Mve(Dve(e))}function E(e){for(let t of e.split(`/`))if(P3.has(t))return!0;return l?!1:b(e)}return{isExcluded(e,t){if(T(e)||K3(e)||G3(e)||!t?.bypassFilters&&rye(e,s)&&!U3(e,a))return!0;if(!t?.bypassFilters&&(R3(e)||U3(e,a)&&!b(e))){if(i!==void 0)return e!==i;if(y3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Bo.has(t)}if(!t?.bypassFilters&&V3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&tye(x(e,t.syncScope))&&!b(e,t.syncScope))return i===void 0?!1:e!==i;if(L3(e,t?.showOk)||W3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&C(e);if(E(e))return!0;if(y3(e)||qve(e,o,e=>(y.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Bo.has(n)){let t=pe(e),n=t===`.`?``:t;if((y.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(G3(e))return!0;if(!t?.bypassFilters&&(Jve(e)||H3(e)||t?.syncScope!==void 0&&nye(x(e,t.syncScope))||iye(e,a)))return!1;if(L3(e,t?.showOk))return!0;if(i!==void 0)return!lye(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(C(e)||C(`${e}/`));for(let t of e.split(`/`))if(P3.has(t))return!0;return l?!1:b(e,t?.syncScope)||b(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return T(e)||K3(e)||G3(e)?!0:R3(e)||U3(e,a)&&!b(e)||V3(e)?!1:L3(e)||W3(e)?!0:t?.bypassFilters?!1:E(e)},getWatcherIgnoreGlobs(){return p},incrementMdDir(e){let t=e===`.`?``:e;y.set(t,(y.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=y.get(t)??0;n<=1?y.delete(t):y.set(t,n-1)},rebuildDirCount(){let e=new Map(y);y.clear();try{w()}catch(t){for(let[t,n]of e)y.set(t,n);M3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=I3(e)},async rebuildIgnorePatterns(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){M3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=u,n=d,i=f,o=p,s=m,c=h,l=_,g=Date.now();return Ohe(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=v();y.clear(),w();let n=Date.now()-g;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),M3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n},`content-filter rebuild succeeded`),r)try{r()}catch(e){M3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n}}catch(e){u=t,d=n,f=i,p=o,m=s,h=c,_=l,y.clear();try{w()}catch(e){M3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let r=e instanceof Error?e.message:String(e);return M3.warn({err:e instanceof Error?e:Error(r)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:r}}}})}}}function Y3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){M3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(P3.has(a.name)||n(i)||n(`${i}/`))continue;Y3(N(e,a.name),i,n,r)}else a.isFile()&&y3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function X3(e){return e.split(`
|
|
434
434
|
`).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`))}function Z3(e,t){let n=e.startsWith(`!`),r=n?e.slice(1):e,i=r.startsWith(`/`)?r.slice(1):r,a=i.endsWith(`/`)?i.slice(0,-1):i,o=r.startsWith(`/`)||a.includes(`/`)?`${t}/${i}`:`${t}/**/${i}`;return n?`!${o}`:o}function Q3(e,t,n,r,i){let a;try{a=C(e,{withFileTypes:!0})}catch(t){return M3.warn({dir:e,err:t},`Failed to read directory ${e}`),0}let o=0;for(let s of a){if(!s.isDirectory()||P3.has(s.name))continue;let a=N(e,s.name),c=k3(_e(t,a));if(!c.startsWith(`..`)&&!(n.ignores(c)||n.ignores(`${c}/`))){for(let e of q3){let t=N(a,e);if(g(t))try{let a=S(t,`utf-8`);i.value+=a.length;let s=X3(a).map(e=>Z3(e,c));n.add(s),e===`.okignore`&&r.add(s),o++}catch(n){M3.warn({path:t,err:n},`Failed to read nested ${e} at ${t}`)}}o+=Q3(a,t,n,r,i)}}return o}function $3(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&n6(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&n6(e.charCodeAt(r)))for(r++;r<e.length&&n6(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&n6(e.charCodeAt(r))){for(r++;r<e.length&&n6(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
435
435
|
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(t6(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(e6(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(e6(t));return o=15}if(t6(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
436
436
|
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!t6(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,t6(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!n6(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(e6(e)||t6(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function e6(e){return e===32||e===9}function t6(e){return e===10||e===13}function n6(e){return e>=48&&e<=57}var hye;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(hye||={});const r6=Array(20).fill(0).map((e,t)=>` `.repeat(t)),i6={" ":{"\n":Array(200).fill(0).map((e,t)=>`
|
|
@@ -1504,22 +1504,22 @@ export default function okBridge(pi: {
|
|
|
1504
1504
|
`)?d.endsWith(`
|
|
1505
1505
|
`)||(d=`${d}\n`):d=d.replace(/\n+$/,``),f&&(d=d.replace(/\r\n/g,`
|
|
1506
1506
|
`).replace(/\n/g,`\r
|
|
1507
|
-
`));let p=`${a?``:``}${d}`;return p!==i&&n$(e,p,{mode:X7(e)}),{kind:l?`overwritten`:`written`}}const JCe=`open-knowledge-ui`;function o9(e,t,n){try{return g(e.detectPath?.(t,n)??pe(e.configPath(t,n)))}catch{return!1}}function s9(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&&!o9(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{D7(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 XCe(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{v(pe(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{r$(`${o}.lock`,()=>{let t=bCe(o).writePath;if(v(pe(t),{recursive:!0}),e.format===`toml`){let n=KCe(R7(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=qCe(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=GCe(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 YCe={pi:cCe};function XCe(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=YCe[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{v(pe(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{r$(`${t}.lock`,()=>{let e=null;try{e=S(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}n$(t,c,e===null?void 0:{mode:X7(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}}async function ZCe(e){let t=wSe(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>s9(t,``,n,e.home))}function c9(e,t,n,r){let i=u9(e,t,n,r);return i.kind===`present`?i.entry:null}function l9(e,t,n,r){let i=a9(e,t,r);if(!F7(i))return{kind:`no-entry`};let a=i[n];return F7(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function u9(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!g(i))return{kind:`absent`};try{if(ee(i).size>e9)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=S(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:sCe(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=R7().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return l9(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Kt.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:l9(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=Z7(a);return s?Q7(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:l9(m6(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}function QCe(e,t){let n=[];for(let r of V5)o9(c7[r],e,t)&&n.push(r);return n}function $Ce(e,t,n){let r=c7[e],i=e===`opencode`?pSe:fSe,a=[],o=r.projectConfigPath?.(t);o!==void 0&&a.push({scope:`project`,configPath:o});try{a.push({scope:`user`,configPath:r.configPath(t,n)})}catch{}for(let o of a){let a=c9(r,t,n,o.configPath);if(a!==null&&i(a))return{editorId:e,scope:o.scope,configPath:o.configPath}}return null}function d9(){return N(O(),`.ok`,`bug-reports`)}function ewe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=d9(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;g(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function f9(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let e=S(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return g(N(e,`.ok`))?Ae(`sha256`).update(ve(e)).digest(`hex`).slice(0,12):null}function twe(){let e={timestamp:new Date().toISOString(),platform:k(),osType:A(),osRelease:ce(),hostname:`[redacted]`,uptime:j(),freeMem:oe(),totalMem:ue(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=l(`sw_vers -productVersion 2>/dev/null`,A3({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);g(t)&&(e.okVersion=JSON.parse(S(t,`utf8`)).version)}catch{}return e}const nwe=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function p9(e){let t=fe(e);return nwe.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function rwe(e,t){return h9(e,t).files}const iwe=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function m9(e,t=`com.inkeep.open-knowledge`){let n=N(e,`${t}.ShipIt`);return g(n)?iwe.map(e=>N(n,e)).filter(e=>g(e)):[]}function h9(e,t){if(!g(t))return{files:[],excludedByProjectSlug:0};let n=C(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(p9),i=[],a=r.filter(t=>{try{return S(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!p9(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function awe(e){let t=N(e,`.ok`,`local`);return g(t)?{files:[`server.lock`,`last-spawn-error.log`,fX].map(e=>N(t,e)).filter(e=>g(e))}:{files:[]}}function owe(e){let t=N(e,`.ok`,`local`,`logs`);return g(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>N(t,e)).filter(e=>g(e))}:{files:[]}}function g9(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=yo(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function _9(e){for(let t of e.files)try{g9({zipfile:e.zipfile,name:`${e.prefix}/${fe(t)}`,content:S(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function swe(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??N(O(),`.ok`,`logs`),o=t.projectDir?f9(t.projectDir,i):null;v(pe(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=twe();s.desktop=t.desktop??null,s.language=t.language??null;let{files:c,excludedByProjectSlug:l}=h9(o,a),{files:u}=t.projectDir?awe(t.projectDir):{files:[]},{files:d}=t.projectDir?owe(t.projectDir):{files:[]},f=t.shipItLogFiles??[];i?.info({logFileCount:c.length,logFilesExcludedByProjectSlug:l,lockFileCount:u.length,localSinkFileCount:d.length,shipItLogFileCount:f.length},`files collected`);let p=[],m=[],{ZipFile:g}=await import(`./yazl-BlMyAOcT.mjs`).then(t=>e(t.t(),1)),_=new g;_9({zipfile:_,files:[...c,...f],prefix:`logs`,redact:n,bundleFiles:m,redactions:p,logger:i}),_9({zipfile:_,files:u,prefix:`lockdir`,redact:n,bundleFiles:m,redactions:p,logger:i}),_9({zipfile:_,files:d,prefix:`local-logs`,redact:n,bundleFiles:m,redactions:p,logger:i});for(let e of t.extraFiles??[])try{let t=S(e.sourcePath),n=`extra/${e.zipName??fe(e.sourcePath)}`;_.addBuffer(t,n),m.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&g9({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:m,redactions:p});let y=JSON.stringify(s,null,2);_.addBuffer(Buffer.from(y,`utf8`),`sysinfo.json`),m.push(`sysinfo.json`);let b={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:m,redactions:p,sysinfo:s};_.addBuffer(Buffer.from(JSON.stringify(b,null,2),`utf8`),`MANIFEST.json`);let x=p.reduce((e,t)=>e+t.lineCount,0),C=new Set(f.map(e=>`logs/${fe(e)}`)),w=m.filter(e=>C.has(e)),T=o?m.filter(e=>e.startsWith(`logs/`)&&!p9(e)&&!C.has(e)):[],E=[`# Bug Report Bundle`,``,`Generated: ${b.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${b.disciplineVersion}`,``,`## Contents`,``,...m.map(e=>`- ${e}`),``,`## Privacy`,``,...T.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...T.map(e=>`- ${e}`),``]:[],...w.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...w.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${qne.join(`, `)}`,x>0?`${x} line(s) were scrubbed across ${p.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
1508
|
-
`);_.addBuffer(Buffer.from(E,`utf8`),`README.md`),_.end();let D=h(r);return _.outputStream.pipe(D),await new Promise((e,t)=>{D.on(`close`,e),D.on(`error`,t)}),i?.info({bundlePath:r,fileCount:m.length,redactionCount:x},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:m,redactions:p,redactedLineCount:x,generatedAt:b.generatedAt}}}function
|
|
1507
|
+
`));let p=`${a?``:``}${d}`;return p!==i&&n$(e,p,{mode:X7(e)}),{kind:l?`overwritten`:`written`}}const JCe=`open-knowledge-ui`;function o9(e,t,n){try{return g(e.detectPath?.(t,n)??pe(e.configPath(t,n)))}catch{return!1}}function YCe(e,t,n){try{let r=ve(pe(e.configPath(t,n))),i=ve(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+ye)}catch{return!1}}function s9(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||YCe(e,t,r);if(!i&&s&&!o9(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{D7(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 ZCe(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{v(pe(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{r$(`${o}.lock`,()=>{let t=bCe(o).writePath;if(v(pe(t),{recursive:!0}),e.format===`toml`){let n=KCe(R7(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=qCe(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=GCe(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 XCe={pi:cCe};function ZCe(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=XCe[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{v(pe(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{r$(`${t}.lock`,()=>{let e=null;try{e=S(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}n$(t,c,e===null?void 0:{mode:X7(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}}async function QCe(e){let t=wSe(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>s9(t,``,n,e.home))}function c9(e,t,n,r){let i=u9(e,t,n,r);return i.kind===`present`?i.entry:null}function l9(e,t,n,r){let i=a9(e,t,r);if(!F7(i))return{kind:`no-entry`};let a=i[n];return F7(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function u9(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!g(i))return{kind:`absent`};try{if(ee(i).size>e9)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=S(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:sCe(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=R7().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return l9(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Kt.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:l9(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=Z7(a);return s?Q7(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:l9(m6(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}function $Ce(e,t){let n=[];for(let r of V5)o9(c7[r],e,t)&&n.push(r);return n}function ewe(e,t,n){let r=c7[e],i=e===`opencode`?pSe:fSe,a=[],o=r.projectConfigPath?.(t);o!==void 0&&a.push({scope:`project`,configPath:o});try{a.push({scope:`user`,configPath:r.configPath(t,n)})}catch{}for(let o of a){let a=c9(r,t,n,o.configPath);if(a!==null&&i(a))return{editorId:e,scope:o.scope,configPath:o.configPath}}return null}function d9(){return N(O(),`.ok`,`bug-reports`)}function twe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=d9(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;g(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function f9(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let e=S(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return g(N(e,`.ok`))?Ae(`sha256`).update(ve(e)).digest(`hex`).slice(0,12):null}function nwe(){let e={timestamp:new Date().toISOString(),platform:k(),osType:A(),osRelease:ce(),hostname:`[redacted]`,uptime:j(),freeMem:oe(),totalMem:ue(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=l(`sw_vers -productVersion 2>/dev/null`,A3({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);g(t)&&(e.okVersion=JSON.parse(S(t,`utf8`)).version)}catch{}return e}const rwe=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function p9(e){let t=fe(e);return rwe.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function iwe(e,t){return h9(e,t).files}const awe=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function m9(e,t=`com.inkeep.open-knowledge`){let n=N(e,`${t}.ShipIt`);return g(n)?awe.map(e=>N(n,e)).filter(e=>g(e)):[]}function h9(e,t){if(!g(t))return{files:[],excludedByProjectSlug:0};let n=C(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(p9),i=[],a=r.filter(t=>{try{return S(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!p9(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function owe(e){let t=N(e,`.ok`,`local`);return g(t)?{files:[`server.lock`,`last-spawn-error.log`,fX].map(e=>N(t,e)).filter(e=>g(e))}:{files:[]}}function swe(e){let t=N(e,`.ok`,`local`,`logs`);return g(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>N(t,e)).filter(e=>g(e))}:{files:[]}}function g9(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=yo(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function _9(e){for(let t of e.files)try{g9({zipfile:e.zipfile,name:`${e.prefix}/${fe(t)}`,content:S(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function cwe(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??N(O(),`.ok`,`logs`),o=t.projectDir?f9(t.projectDir,i):null;v(pe(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=nwe();s.desktop=t.desktop??null,s.language=t.language??null;let{files:c,excludedByProjectSlug:l}=h9(o,a),{files:u}=t.projectDir?owe(t.projectDir):{files:[]},{files:d}=t.projectDir?swe(t.projectDir):{files:[]},f=t.shipItLogFiles??[];i?.info({logFileCount:c.length,logFilesExcludedByProjectSlug:l,lockFileCount:u.length,localSinkFileCount:d.length,shipItLogFileCount:f.length},`files collected`);let p=[],m=[],{ZipFile:g}=await import(`./yazl-BlMyAOcT.mjs`).then(t=>e(t.t(),1)),_=new g;_9({zipfile:_,files:[...c,...f],prefix:`logs`,redact:n,bundleFiles:m,redactions:p,logger:i}),_9({zipfile:_,files:u,prefix:`lockdir`,redact:n,bundleFiles:m,redactions:p,logger:i}),_9({zipfile:_,files:d,prefix:`local-logs`,redact:n,bundleFiles:m,redactions:p,logger:i});for(let e of t.extraFiles??[])try{let t=S(e.sourcePath),n=`extra/${e.zipName??fe(e.sourcePath)}`;_.addBuffer(t,n),m.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&g9({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:m,redactions:p});let y=JSON.stringify(s,null,2);_.addBuffer(Buffer.from(y,`utf8`),`sysinfo.json`),m.push(`sysinfo.json`);let b={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:m,redactions:p,sysinfo:s};_.addBuffer(Buffer.from(JSON.stringify(b,null,2),`utf8`),`MANIFEST.json`);let x=p.reduce((e,t)=>e+t.lineCount,0),C=new Set(f.map(e=>`logs/${fe(e)}`)),w=m.filter(e=>C.has(e)),T=o?m.filter(e=>e.startsWith(`logs/`)&&!p9(e)&&!C.has(e)):[],E=[`# Bug Report Bundle`,``,`Generated: ${b.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${b.disciplineVersion}`,``,`## Contents`,``,...m.map(e=>`- ${e}`),``,`## Privacy`,``,...T.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...T.map(e=>`- ${e}`),``]:[],...w.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...w.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${qne.join(`, `)}`,x>0?`${x} line(s) were scrubbed across ${p.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
1508
|
+
`);_.addBuffer(Buffer.from(E,`utf8`),`README.md`),_.end();let D=h(r);return _.outputStream.pipe(D),await new Promise((e,t)=>{D.on(`close`,e),D.on(`error`,t)}),i?.info({bundlePath:r,fileCount:m.length,redactionCount:x},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:m,redactions:p,redactedLineCount:x,generatedAt:b.generatedAt}}}function lwe(e){return Y5(e)||Q5(e)||oCe(e)}const v9=10*1024*1024;function uwe(e,t,n,r){let i=u9(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!lwe(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(D(a,{force:!0}),{kind:`removed`}):e.format===`toml`?pwe(a,o):e.format===`yaml`?fwe(a,e.topLevelKey,o):dwe(a,e.topLevelKey,e.serverMapSubKey,o)}function dwe(e,t,n,r){let i;try{i=S(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>v9)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=ICe(i,r9(t,n,r));return o?(n$(e,a,{mode:X7(e)}),{kind:`removed`}):{kind:`not-present`}}function fwe(e,t,n){let r;try{r=S(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>v9)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,Kt.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=Y7(a);a.trim()===``||a.endsWith(`
|
|
1509
1509
|
`)?c.endsWith(`
|
|
1510
1510
|
`)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
|
|
1511
1511
|
`).replace(/\n/g,`\r
|
|
1512
|
-
`));let u=`${i?``:``}${c}`;return u!==r&&n$(e,u,{mode:X7(e)}),{kind:`removed`}}function
|
|
1512
|
+
`));let u=`${i?``:``}${c}`;return u!==r&&n$(e,u,{mode:X7(e)}),{kind:`removed`}}function pwe(e,t){let n=R7();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=S(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=Y7(a),s=a.trim()===``||a.endsWith(`
|
|
1513
1513
|
`),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
|
|
1514
1514
|
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
1515
1515
|
`).replace(/\n/g,`\r
|
|
1516
|
-
`));let u=`${i?``:``}${l}`;return u!==r&&n$(e,u,{mode:X7(e)}),{kind:`removed`}}function pwe(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function mwe(e){let{priorCommand:t,priorArgs:n}=y9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function y9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function hwe(e,t,n={}){let r=jye(e,t);if(!g(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(S(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!Eve(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??v3)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??Aye())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??se();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function gwe(e,t,n={}){let r=n.isAlive??v3,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function _we(e){let t=e.inspect??(t=>hwe(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=gwe(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function b9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(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,Kt.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 F7(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function vwe(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=Gc({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function ywe(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=a$(`user`,t),s=t$({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=b9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=_l({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?yl(i.value):i.value;return t&&a.push(...qc({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=ve(t,`.ok`,`config.yml`),u=c(l,!0),d=c(a$(`project-local`,t)),f=ll(s.value,u,d),p=cSe.safeParse(f);if(!p.success){let e=b9(l),t={code:`SCHEMA_INVALID`,issues:vwe(p.error.issues,e)};throw Error(cl(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function x9(e){return e.replace(/:\d+$/,``)}function S9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function C9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Ll(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function w9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Ll(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function bwe(e){let t=C9(e);if(t)return{kind:`doc`,...t};let n=w9(e);return n?{kind:`folder`,...n}:null}async function xwe(e,t){let n,r;try{n=await Te(ve(e)),r=await Te(ve(pe(e)))}catch{return{kind:`not-git`}}if(!T9(n,r))return{kind:`symlink-escape`};let i=N(n,`.git`),a;try{a=ee(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await Te(i)}catch{return{kind:`not-git`}}if(!T9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=PX(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=S9(c);if(l===null)return{kind:`non-github`};let u=Ll(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function T9(e,t){if(e===t)return!0;let n=_e(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const Swe=`# >>> open-knowledge cli >>>`,Cwe=`# <<< open-knowledge cli <<<`,wwe=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Twe(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}[...y6.map(e=>v6[e])];function Ewe(e){if(!M(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=ve(e);if(t===ye||pe(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=Ewe(e),n=[];for(let e of y6){let r=v6[e];n.push({path:N(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of Nl)n.push({path:N(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function Dwe(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{D(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}const Owe=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=s9(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=A7(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function kwe(e,t,n={},r=Owe){let i=[];for(let a of t){let t=c7[a];for(let a of r)i.push(a.write(t,e,n))}return i}function Awe(e,t,n={}){return{integrations:kwe(e,t,n)}}function jwe(e){return t$({absPath:a$(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function D9({home:e=O(),env:t=process.env}={}){let n=jwe(e),{override:r,preferenceList:i}=Vme(t),{locale:a,source:o}=bw({override:r,storedPreference:n,supportedLocales:Vo,preferenceList:i,autoDetectableLocales:sre});return{preference:n,locale:a,source:o,systemLanguages:i}}function O9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Mwe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k9(e,t){if(typeof e==`string`)return O9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>k9(e,t));if(!Mwe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=k9(i,t);return n}function A9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
1516
|
+
`));let u=`${i?``:``}${l}`;return u!==r&&n$(e,u,{mode:X7(e)}),{kind:`removed`}}function mwe(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function hwe(e){let{priorCommand:t,priorArgs:n}=y9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function y9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function gwe(e,t,n={}){let r=jye(e,t);if(!g(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(S(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!Eve(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??v3)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??Aye())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??se();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function _we(e,t,n={}){let r=n.isAlive??v3,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function vwe(e){let t=e.inspect??(t=>gwe(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=_we(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function b9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(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,Kt.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 F7(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function ywe(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=Gc({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function bwe(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=a$(`user`,t),s=t$({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=b9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=_l({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?yl(i.value):i.value;return t&&a.push(...qc({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=ve(t,`.ok`,`config.yml`),u=c(l,!0),d=c(a$(`project-local`,t)),f=ll(s.value,u,d),p=cSe.safeParse(f);if(!p.success){let e=b9(l),t={code:`SCHEMA_INVALID`,issues:ywe(p.error.issues,e)};throw Error(cl(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function x9(e){return e.replace(/:\d+$/,``)}function S9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function C9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Ll(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function w9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Ll(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function xwe(e){let t=C9(e);if(t)return{kind:`doc`,...t};let n=w9(e);return n?{kind:`folder`,...n}:null}async function Swe(e,t){let n,r;try{n=await Te(ve(e)),r=await Te(ve(pe(e)))}catch{return{kind:`not-git`}}if(!T9(n,r))return{kind:`symlink-escape`};let i=N(n,`.git`),a;try{a=ee(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await Te(i)}catch{return{kind:`not-git`}}if(!T9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=PX(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=S9(c);if(l===null)return{kind:`non-github`};let u=Ll(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function T9(e,t){if(e===t)return!0;let n=_e(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const Cwe=`# >>> open-knowledge cli >>>`,wwe=`# <<< open-knowledge cli <<<`,Twe=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Ewe(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}[...y6.map(e=>v6[e])];function Dwe(e){if(!M(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=ve(e);if(t===ye||pe(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=Dwe(e),n=[];for(let e of y6){let r=v6[e];n.push({path:N(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of Nl)n.push({path:N(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function Owe(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{D(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}const kwe=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=s9(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=A7(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function Awe(e,t,n={},r=kwe){let i=[];for(let a of t){let t=c7[a];for(let a of r)i.push(a.write(t,e,n))}return i}function jwe(e,t,n={}){return{integrations:Awe(e,t,n)}}function Mwe(e){return t$({absPath:a$(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function D9({home:e=O(),env:t=process.env}={}){let n=Mwe(e),{override:r,preferenceList:i}=Vme(t),{locale:a,source:o}=bw({override:r,storedPreference:n,supportedLocales:Vo,preferenceList:i,autoDetectableLocales:sre});return{preference:n,locale:a,source:o,systemLanguages:i}}function O9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Nwe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k9(e,t){if(typeof e==`string`)return O9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>k9(e,t));if(!Nwe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=k9(i,t);return n}function A9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
1517
1517
|
`),i=n.split(`
|
|
1518
1518
|
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=k9(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}ne(e,r?`${a.join(`
|
|
1519
1519
|
`)}\n`:a.join(`
|
|
1520
1520
|
`))}function j9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=k9(JSON.parse(n),t),i=n.endsWith(`
|
|
1521
1521
|
`)?`
|
|
1522
|
-
`:``;ne(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=O9(n,t.contentDir);r!==n&&ne(e,r)}}function M9(e,t){let n=S(e,`utf-8`),r=O9(n,t.contentDir);r!==n&&ne(e,r)}function N9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const
|
|
1523
|
-
`)}\n`:null}catch{return null}}function
|
|
1524
|
-
`:`not-running (${C})\n`;if(ne(N(_,`state`,`server-status.txt`),oe),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&
|
|
1522
|
+
`:``;ne(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=O9(n,t.contentDir);r!==n&&ne(e,r)}}function M9(e,t){let n=S(e,`utf-8`),r=O9(n,t.contentDir);r!==n&&ne(e,r)}function N9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const Pwe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function P9(e){return/\.log\.\d+$/.test(e)}function Fwe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||P9(e)}function Iwe(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of N9(N(e.stagingDir,n)))Fwe(r)?A9(r,t):r.endsWith(`.json`)?j9(r,t):M9(r,t);for(let n of N9(N(e.stagingDir,`state`))){let e=fe(n);n.endsWith(`.jsonl`)?A9(n,t):Pwe.has(e)?j9(n,t):M9(n,t)}}const F9=[`.ok`,`local`,`telemetry`],I9=[`.ok`,`local`,`logs`],L9=[`.ok`,`local`,`loss-capture`],R9=`spans-current.jsonl`,z9=`spans-prev.jsonl`,B9=`server-current.jsonl`,V9=`server-prev.jsonl`,H9=`loss-current.jsonl`,U9=`loss-prev.jsonl`;function Lwe(e){return N(e,...F9,R9)}function Rwe(e){return N(e,...F9,z9)}function zwe(e){return N(e,...I9,B9)}function Bwe(e){return N(e,...I9,V9)}function Vwe(e){return N(e,...L9,H9)}function Hwe(e){return N(e,...L9,U9)}const W9=1e3;async function Uwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function Wwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function Gwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}function Kwe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
1523
|
+
`)}\n`:null}catch{return null}}function qwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Jwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Ywe(){return{nodeVersion:process.version,platform:k(),arch:ie()}}function Xwe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,Kt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function Zwe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return Zwe(e.maxBytes)}function Qwe(e){let t=q9(a$(`project`,e)),n=q9(a$(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function $we(e){return Ae(`sha256`).update(e).digest(`hex`)}function eTe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function tTe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const nTe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:nTe.has(e.slice(t))}const rTe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function iTe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:rTe.has(e.slice(t))}function aTe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!iTe(r))continue;let{redacted:i,patterns:a,lineCount:o}=yo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function oTe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??Uwe,a=r.fetchAgentEffects??Wwe,o=r.fetchWatcherRecent??Gwe,s=r.readShadowHead??qwe,c=r.readCheckpointRefs??Jwe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.59.0-beta.10`),d=r.readDesktopEnv??G9,f=r.readLanguage??D9,p=r.readRuntime??Ywe,h=r.isOtlpPushEnabled??Xwe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),X9(Lwe(n),N(_,`telemetry`,R9)),X9(Rwe(n),N(_,`telemetry`,z9)),X9(zwe(n),N(_,`logs`,B9)),X9(Bwe(n),N(_,`logs`,V9));for(let t of e.userLogFiles??[])X9(t,N(_,`logs`,fe(t)));let y=N(n,`.ok`,`local`),b=N(y,`server.lock`),x=`not-running`,C=`no server.lock`,w=null;if(g(b)){X9(b,N(_,`state`,`server.lock`));try{let e=S(b,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?w=t.port:C=`lock present but no port`}catch{C=`lock present but unparseable`}}if(w!==null){let e=await i(w);e===null?C=`agent-presence endpoint at :${w} unreachable`:(ne(N(_,`state`,`agent-presence.json`),e),x=`running`,C=``);let t=await a(w);t!==null&&ne(N(_,`state`,`agent-effects.json`),t);let n=await o(w);if(n!==null){let e=Kwe(n);e!==null&&ne(N(_,`state`,`watcher-recent.jsonl`),e)}}let T=s(t);T!==null&&ne(N(_,`state`,`shadow-head.txt`),T);let E=c(t);E!==null&&ne(N(_,`state`,`checkpoint-refs.txt`),E),X9(Vwe(n),N(_,`state`,H9)),X9(Hwe(n),N(_,`state`,U9)),X9(N(y,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),X9(N(y,dX),N(_,`state`,dX)),X9(N(y,fX),N(_,`state`,fX));let te=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie}};ne(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=x===`running`?`running
|
|
1524
|
+
`:`not-running (${C})\n`;if(ne(N(_,`state`,`server-status.txt`),oe),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&Iwe({stagingDir:_,contentDir:t}),e.note&&ne(N(_,`note.txt`),e.note);let se=null;e.scrubSecrets===!0&&(se=aTe(_));for(let t of e.extraFiles??[])X9(t.sourcePath,N(_,`extra`,t.zipName??fe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let k=Qwe(n),ce=Z9(_),le=[],ue=0,A=0;for(let e of ce){let t=$9(_,e),n=ee(e).size,r=Q9(t)?eTe(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n,t.startsWith(`telemetry/`)&&Q9(t)&&(A+=tTe(e))}let j={applied:O};se!==null&&(j.secretScrub=se);let de={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie},contentDir:{pathSha256:$we(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:k,otlpPushEnabled:h()},redaction:j,serverStatus:x,files:le};ne(N(_,`manifest.json`),`${JSON.stringify(de,null,2)}\n`);let pe=ce.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),me={totalBytes:ue,fileCount:le.length,docNameCount:A,contentDirVisible:pe,redacted:O},M=!1;return{stagingDir:_,manifest:de,summary:me,cleanup:()=>{M||(M=!0,D(_,{recursive:!0,force:!0}))}}}catch(e){throw D(_,{recursive:!0,force:!0}),e}}async function sTe(e){let{collected:t,outputPath:n}=e,r=pe(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Pye.ZipFile,a=Z9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function cTe(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,Kt.parse)(S(n,`utf-8`)),r=F7(t)?t.content:void 0,i=F7(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ve(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return ve(e)}async function lTe(e,t,n,r){let i=f9(t,e.logger),a=await oTe({contentDir:cTe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...iwe(i,e.userLogsDir??N(O(),`.ok`,`logs`)),...m9(e.cachesDir??N(O(),`Library`,`Caches`))],deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(pe(e.outputPath),{recursive:!0}),await sTe({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function uTe(e){let{projectDir:t}=e,n=e.readDesktopEnv??G9,r=e.readLanguage??D9;if(e.level===`full`&&t!==void 0)return lTe(e,t,n,r);let{zipPath:i,summary:a}=await cwe({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:m9(e.cachesDir??N(O(),`Library`,`Caches`)),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}export{V5 as ALL_EDITOR_IDS,H5 as EDITOR_LABELS,c7 as EDITOR_TARGETS,lSe as HOSTS_WITH_USER_SKILL_DIR,JCe as LAUNCH_CONFIG_NAME,Cwe as PATH_SHIM_BEGIN,Twe as PATH_SHIM_BLOCK_RE,wwe as PATH_SHIM_END,DCe as addOkPathsToGitExclude,D7 as assertProjectPathSafe,Z5 as buildManagedServerEntry,mwe as buildMcpConfigDeclineEvent,hwe as buildMcpConfigMigrateEvent,u9 as classifyExistingMcpEntry,uTe as collectReportBundle,Xt as createTokenStore,twe as defaultBugReportZipPath,Be as detectGh,$Ce as detectInstalledEditors,CSe as editorConfigPathDisplay,SSe as editorEntryLocator,W7 as formatTrackedRemediation,ACe as getExcludedOkPaths,ECe as getNativeTomlMcpEditor,H7 as getOkArtifactPaths,Y5 as isEntryUpToDate,Q5 as isOwnManagedEntry,bwe as loadConfig,Qt as makeLazyProbeTokenStore,d9 as okBugReportsDir,C9 as parseGitHubBlobUrl,xwe as parseGitHubShareUrl,w9 as parseGitHubTreeUrl,S9 as parseGitUrl,Ewe as pathInstallMarkerPath,rCe as previewContent,ewe as probeOwnManagedEditorMcpEntry,U7 as probeTrackedOkPaths,c9 as readExistingMcpEntry,kCe as readSharingMode,jCe as readSkillsShared,yo as redactContent,OCe as removeOkPathsFromGitExclude,uwe as removeOwnMcpEntry,hCe as removeProjectSkill,Owe as removeUserGlobalSkillBundle,dCe as resolveProjectRoot,vwe as runStop,MCe as setSkillsShared,y9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,Swe as validateLocalFolderForShare,s9 as writeEditorMcpConfig,jwe as writeProjectAiIntegrations,A7 as writeProjectSkill,QCe as writeUserMcpConfigs};
|
|
1525
1525
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./init-BzZZQKjK.mjs";export{e as runInit};
|