@inkeep/open-knowledge 0.28.2 → 0.28.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/packs/entity-vault/SKILL.md +2 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-KGjHbPVT.mjs +2 -0
- package/dist/{dist-AMcKbNor.mjs → dist-C5-CAALs.mjs} +11 -5
- package/dist/{dist-B3w6eOOV.mjs → dist-Dovb2Y8A.mjs} +1 -1
- package/dist/git-handle-BMLM1Bxa-Dc3Lq9P5.mjs +1 -0
- package/dist/{git-handle-B4hCEi7c-CXOP12Ds.mjs → git-handle-XXj9bu6B-B4fXubq8.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-BGAkmr8T.mjs +1 -0
- package/dist/{init-gfjsyIYB.mjs → init-_gsMrA9E.mjs} +4 -4
- package/dist/{loader-DglCaNtQ.mjs → loader-BIDmV6nB.mjs} +2 -2
- package/dist/loader-BvVnU_Yq.mjs +1 -0
- package/dist/{open-browser-D9No9V7u.mjs → open-browser-DsUKCX2k.mjs} +2 -2
- package/dist/preview-ByfE8Z7y.mjs +1 -0
- package/dist/{preview-CVMx2nNA.mjs → preview-C5qa70B1.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-BIR18aLa.js → ActivityModeContent-BAYdjZuv.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B3dbz9bv.js → CodeMirrorPropInput-DCRAs5QF.js} +1 -1
- package/dist/public/assets/{DocumentContext-DhO_lJHL.js → DocumentContext-4LoWVX6a.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CVSKYEbW.js → EnableSyncConfirmDialog-BAn4HLBE.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-UDC39TwZ.js → ManagedArtifactProperties-DiwlvR-i.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DLPHffhy.js → MermaidDocEditor-D-KWi_oQ.js} +1 -1
- package/dist/public/assets/{PropertyPanel-C0B0ULET.js → PropertyPanel-BIo71wnL.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-DoNSyAEE.js → SettingsDialogBody-DFVfSeGr.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DeXWQY9a.js → ShareReceiveMissDialog-CEdvRkzl.js} +1 -1
- package/dist/public/assets/{SourceEditor-Dm_b_rhG.js → SourceEditor-BNOhVAgE.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CncOiEpv.js → auth-state-cache-BZTq5BNY.js} +1 -1
- package/dist/public/assets/{config-provider-BTSTuiu_.js → config-provider-BWb73zbu.js} +1 -1
- package/dist/public/assets/{dist-Bj62aeaf.js → dist-CPN2_D7r.js} +1 -1
- package/dist/public/assets/{index-C9zQWSQP.js → index-Cib7ZHDq.js} +7 -7
- package/dist/public/assets/{pending-receive-nav-store-VbxK4qhM.js → pending-receive-nav-store-BjQLDTHU.js} +1 -1
- package/dist/public/assets/{selection-context-CoA6Nn_C.js → selection-context-C4wC-Ghg.js} +1 -1
- package/dist/public/assets/{src-CWbLVNKS.js → src-CznLk2iY.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BQX1csjU.js → telemetry-impl-Ba-VbTNc.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DX8bwSf2.js → telemetry-startup-DNaRc3no.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-AMvvbBad.js → typing-burst-detector-Dgtw-3rX.js} +1 -1
- package/dist/public/index.html +11 -11
- package/dist/{repair-launch-json-BXcID4fT.mjs → repair-launch-json-uYLLfiiZ.mjs} +2 -2
- package/dist/{repair-mcp-configs-BUblf8y6.mjs → repair-mcp-configs-BWkPeg38.mjs} +2 -2
- package/dist/{repair-skills-oX4aXhcO.mjs → repair-skills-2C-BzNy8.mjs} +2 -2
- package/dist/repair-skills-Bs__ORRR.mjs +1 -0
- package/dist/{src-BOlpZYXP.mjs → src-C4Asr6cU.mjs} +2 -2
- package/dist/start-BuL_hB3J.mjs +1 -0
- package/dist/{start-CQ5WKopr.mjs → start-Cdu39pNg.mjs} +2 -2
- package/dist/{write-project-skill-Dw9Did_1.mjs → write-project-skill-CpL-pVrC.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-Br0O5zjA.mjs +0 -2
- package/dist/git-handle-DG8d2xCi-C_CAAChL.mjs +0 -1
- package/dist/init-CdmFBgOe.mjs +0 -1
- package/dist/loader-LMMChOMd.mjs +0 -1
- package/dist/preview-CP53jEdN.mjs +0 -1
- package/dist/repair-skills-0DLicwIy.mjs +0 -1
- package/dist/start-CX_XR9zV.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fi as e,Gt as t,Hi as n,Pn as r,Q as i,_ as a,a as o,an as s,b as c,c as l,di as u,f as d,g as f,gn as p,h as m,i as h,kn as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,ua as E,un as D,v as O,y as k}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{$ as A,$i as j,$n as M,$r as N,$t as P,A as F,Ai as I,An as L,Ar as R,At as z,B,Bi as V,Bn as H,Br as U,Bt as W,C as G,Ci as K,Cn as q,Cr as J,Ct as Y,D as X,Di as Z,Dn as Q,Dr as $,Dt as ee,E as te,Ei as ne,En as re,Er as ie,Et as ae,F as oe,Fi as se,Fn as ce,Fr as le,Ft as ue,G as de,Gi as fe,Gn as pe,Gr as me,Gt as he,H as ge,Hi as _e,Hn as ve,Hr as ye,Ht as be,I as xe,Ii as Se,In as Ce,Ir as we,It as Te,J as Ee,Ji as De,Jn as Oe,Jr as ke,Jt as Ae,K as je,Ki as Me,Kn as Ne,Kr as Pe,Kt as Fe,L as Ie,Li as Le,Ln as Re,Lr as ze,Lt as Be,M as Ve,Mi as He,Mn as Ue,Mr as We,Mt as Ge,N as Ke,Ni as qe,Nn as Je,Nr as Ye,Nt as Xe,O as Ze,Oi as Qe,On as $e,Or as et,Ot as tt,P as nt,Pi as rt,Pn as it,Pr as at,Pt as ot,Q as st,Qi as ct,Qn as lt,Qr as ut,Qt as dt,R as ft,Ri as pt,Rn as mt,Rr as ht,Rt as gt,S as _t,Sa as vt,Si as yt,Sn as bt,Sr as xt,St,T as Ct,Ti as wt,Tn as Tt,Tr as Et,Tt as Dt,U as Ot,Ui as kt,Un as At,Ur as jt,Ut as Mt,V as Nt,Vi as Pt,Vn as Ft,Vr as It,Vt as Lt,W as Rt,Wi as zt,Wn as Bt,Wr as Vt,Wt as Ht,X as Ut,Xi as Wt,Xn as Gt,Xr as Kt,Xt as qt,Y as Jt,Yi as Yt,Yn as Xt,Yr as Zt,Yt as Qt,Z as $t,Zi as en,Zn as tn,Zr as nn,Zt as rn,_ as an,_i as on,_n as sn,_r as cn,_t as ln,a as un,aa as dn,ai as fn,an as pn,ar as mn,at as hn,b as gn,bi as _n,bn as vn,br as yn,bt as bn,c as xn,ca as Sn,ci as Cn,cn as wn,cr as Tn,ct as En,d as Dn,di as On,dn as kn,dr as An,dt as jn,ea as Mn,ei as Nn,en as Pn,er as Fn,et as In,f as Ln,fi as Rn,fn as zn,fr as Bn,ft as Vn,g as Hn,gi as Un,gn as Wn,gr as Gn,gt as Kn,h as qn,hi as Jn,hn as Yn,hr as Xn,ht as Zn,i as Qn,ia as $n,ii as er,in as tr,ir as nr,it as rr,j as ir,ji as ar,jn as or,jr as sr,jt as cr,k as lr,ki as ur,kn as dr,kr as fr,kt as pr,l as mr,la as hr,li as gr,ln as _r,lr as vr,lt as yr,m as br,mi as xr,mn as Sr,mr as Cr,mt as wr,n as Tr,na as Er,ni as Dr,nn as Or,nr as kr,nt as Ar,o as jr,oa as Mr,oi as Nr,on as Pr,or as Fr,ot as Ir,p as Lr,pi as Rr,pn as zr,pr as Br,pt as Vr,q as Hr,qi as Ur,qn as Wr,qr as Gr,qt as Kr,r as qr,ra as Jr,ri as Yr,rn as Xr,rr as Zr,rt as Qr,s as $r,sa as ei,si as ti,sn as ni,sr as ri,st as ii,t as ai,ta as oi,ti as si,tn as ci,tr as li,tt as ui,u as di,ui as fi,un as pi,ur as mi,ut as hi,v as gi,vi as _i,vn as vi,vr as yi,vt as bi,w as xi,wi as Si,wn as Ci,wr as wi,wt as Ti,x as Ei,xa as Di,xi as Oi,xn as ki,xr as Ai,xt as ji,y as Mi,yi as Ni,yn as Pi,yr as Fi,yt as Ii,z as Li,zi as Ri,zn as zi,zr as Bi,zt as Vi}from"./dist-AMcKbNor.mjs";export{ai as AGENT_ID_MAX_LEN,Tr as AGENT_ID_RE,qr as AGENT_WRITE_ORIGIN,Qn as AgentFocusBroadcaster,un as AgentPresenceBroadcaster,jr as AgentSessionCapacityError,$r as AgentSessionManager,xn as AutoStartDisabledError,mr as BUNDLE_IDS,di as BUNDLE_SCOPE,Dn as BUNDLE_SKILL_NAME,Ln as BacklinkIndex,Lr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,br as CONFIG_FILENAME,qn as CONFLICT_MARKER_RE,Hn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,an as ConfigSchema,gi as DEFAULT_CHECKPOINT_RETENTION,Mi as DEFAULT_EMBEDDINGS_DIMENSIONS,gn as DEFAULT_PACK_ID,Ei as EMBEDDINGS_API_KEY_ENV,_t as FILE_SYSTEM_WRITER,G as FILE_WATCHER_ORIGIN,xi as FileEmbeddingsBackend,Ct as GIT_PREFLIGHT_FAIL_SPAN_NAME,te as GIT_UPSTREAM_WRITER,Di as GitDirAccessError,X as GitNotAvailableError,Ze as GitTooOldError,lr as HOCUSPOCUS_AUTH_REJECTION_REASONS,F as HocuspocusAuthRejection,ir as HocuspocusAuthTokenSchema,Ve as INSTALLED_AGENTS_SCHEMES,t as LINEAGE_EPOCH_KEY,Ke as LIVE_DERIVED_INDEX_DEBOUNCE_MS,nt as LOG_MD_TEMPLATE,oe as MANAGED_RENAME_ORIGIN,xe as MAX_AGENT_SESSIONS,Ie as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,ft as MIN_GIT_VERSION,Li as MISSING_OK_CONFIG_MESSAGE,vt as MalformedGitPointerError,B as McpLogger,Nt as MissingOkConfigError,ge as OBSERVER_SYNC_ORIGIN,Ot as OK_OKIGNORE_TEMPLATE,D as ORPHAN_MODES,Rt as PANE_TARGET_TTL_MS,p as PROTOCOL_VERSION,de as PinoLogger,w as ProcessLockCollisionError,je as ProjectGitInitError,Hr as ROLLBACK_ORIGIN,Ee as ROOT_GITIGNORE_TEMPLATE,y as RUNTIME_VERSION,Jt as SERVICE_WRITER,Ut as SKILL_INSTALL_EVENTS_FILE_REL,g as SKILL_STATE_TARGETS,$t as STARTER_FOLDERS,st as STARTER_FOLDER_FRONTMATTER_FILENAME,A as STARTER_PACKS,In as STARTER_PACK_IDS,ui as STARTER_TEMPLATES,Ar as STATE_MANIFEST_FILENAME,S as STATE_SCHEMA_VERSION,r as SYSTEM_DOC_NAME,Qr as SeedPrerequisiteError,rr as SeedRootDirError,h as ServerLockCollisionError,hn as SingleFileNotAFileError,Ir as SingleFileNotFoundError,ii as SingleFileNotMarkdownError,En as StateManifestError,yr as TagIndex,hi as USER_GLOBAL_BUNDLE_IDS,jn as UiLockCollisionError,Vn as __getShowAllWalkStatsForTesting,Vr as __resetShowAllWalkStatsForTesting,o as acquireProcessLock,b as acquireServerLock,wr as acquireUiLock,Zn as applyAgentMarkdownWrite,Kn as applyExternalChange,ln as applySeed,bi as armPaneTarget,Ii as assertCompatibleStateManifest,bn as assertGitAvailable,ji as assertNeverDiskEvent,St as attachIdleShutdown,Y as bootServer,Ti as buildAndOpenSkill,Dt as buildConfigYmlContent,ae as buildExecResult,ee as buildSkillZip,tt as buildStarterFolderFrontmatterYaml,pr as buildWipTree,z as bundleSkillMdPath,cr as classifyEvents,Ge as classifyFsPath,Xe as clearArmedPaneTarget,ot as clearContributors,ue as clearEmbeddingsKeyFromAllBackends,Te as coercePackId,u as colorFromSeed,Be as commitUpstreamImport,gt as commitWip,Vi as commitWipFromTree,W as compareSemver,Lt as containsConflictMarkers,be as contentHash,Mt as contributorCount,Ht as countShadowObjects,he as countStaleAgentWipRefs,Fe as countWipRefs,Kr as createApiExtension,Ae as createAssetServeMiddleware,Qt as createContentFilter,qt as createContentFilterAsync,rn as createEmbeddingsSecretStore,dt as createEphemeralProjectDir,P as createExternalChangeHandler,Pn as createFileLogger,ci as createLiveDerivedIndexExtension,Or as createMcpHttpHandler,Xr as createOsProbe,tr as createPersistenceExtension,pn as createServer,Pr as createServerObserverExtension,ni as createStreamingErrorWriter,wn as createTestLogger,_r as describeStoredEmbeddingsKey,pi as detectClaudeDesktopPresence,kn as detectGit,zn as detectProjectShape,zr as discoverLockDirs,Sr as emitPreflightFailureSpan,Yn as encodeDocName,Wn as encodeFolderRoute,sn as encodeSkillRoute,vi as ensureProjectGit,Pi as errorResponse,vn as evictStaleTrackerEntries,ki as extractOkBinaryPath,bt as extractWikiLinksFromMarkdown,q as fallbackPaths,Ci as findEnclosingGitRoot,Tt as findEnclosingProjectRoot,re as flushFileLogger,Q as formatAuthRejectionWire,$e as formatContributors,dr as formatContributorsFrom,L as formatPackRationale,or as gcCheckpointRefs,Ue as getCurrentMcpLogger,Je as getLocalDir,it as getLogFilePath,ce as getLogger,Ce as getLogsDir,C as getMachineId,Re as getMeter,mt as getMetrics,zi as getTracer,H as handleCollabSocketError,Ft as handleSpawnCursor,ve as hasGcLogLatch,e as iconFromClientName,At as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,pe as initContent,Ne as initShadowRepo,Wr as initTelemetry,Oe as initToleranceTelemetryWriter,Xt as installPrettyZodErrors,Gt as installTestLoggers,tn as installUserSkill,lt as isAllowedApiOrigin,M as isAllowedWorkspaceHostHeader,Fn as isConfigDoc,li as isHocuspocusAuthRejectionReason,kr as isKnownPackId,Zr as isLinkIndexExcludedDoc,nr as isLoopbackAddress,mn as isManagedArtifactDoc,n as isOrphanMode,Fr as isPairedWriteOrigin,ri as isPathWithinDir,l as isProcessAlive,Tn as isProjectRoot,vr as isProjectSkillManaged,mi as isReservedForUserTree,An as isSelfWrite,Bn as isSystemDoc,Br as isToleranceTelemetryEnabled,_ as isValidLockPid,Cr as lastKnownHash,Xn as listRescueCheckpoints,Gn as listStarterPacks,cn as loadPrincipal,T as lockFilePath,yi as loggerFactory,Fi as logsCurrentPath,yn as logsPreviousPath,Ai as makeLazyEmbeddingsKeyStore,d as markServerLockDraining,xt as mountMcpAndApi,J as normalizeFsPath,wi as packageVersionMajorMinor,Et as parseAuthRejectionWire,ie as parseGitVersion,$ as parseHocuspocusAuthToken,et as parseKeepaliveConnectionId,fr as pathToDocName,R as planSeed,sr as prepareSingleFileOpen,We as processCommand,Ye as processUsage,at as readAllTargets,le as readArmedPaneTarget,we as readBranchFromHead,ze as readBundleDecision,x as readProcessLock,v as readProcessLockDetailed,ht as readProjectLocalSemanticConfig,m as readServerLock,Bi as readServerPackageVersion,U as readSkillInstallStateSnapshot,It as readSkillManagement,ye as readStateManifest,jt as readTargetRecordedAt,Vt as readTargetVersion,me as readUiLock,Pe as reconcile,Gr as recordContributor,ke as recordSkillInstallEvent,Zt as registerAllTools,Kt as registerWrite,f as releaseProcessLock,a as releaseServerLock,nn as releaseUiLock,ut as removeLastKnownHash,N as resetMetrics,E as resolveBundleEnabled,Nn as resolveBundledSkillDir,si as resolveContentDir,Dr as resolveCursorBinaryDefault,Yr as resolveCursorSpawnInvocation,er as resolveLockDir,fn as resolvePack,Nr as resolvePackageVersion,ti as resolveUiInfo,Cn as restoreContributors,gr as restoreLifecycleFromConflictsJson,fi as rewriteMarkdownLinksForDocumentRename,On as rewriteWikiLinksForDocumentRename,Rn as runAuthReposSubprocess,Rr as runAuthStatusSubprocess,xr as runCloneSubprocess,Jn as runDeviceFlowSubprocess,Un as runWithMcpLogger,on as safeContentPath,_i as safeSubdir,Ni as safetyCheckpoint,_n as sanitizeClientName,Oi as saveInMemoryCheckpoint,yt as saveVersion,K as seedBasenameIndex,Si as serializeError,wt as setActiveSpanAttributes,ne as setupServerObservers,Z as shadowGit,Qe as shutdownTelemetry,ur as skillManagementPath,I as spansCurrentPath,ar as spansPreviousPath,He as spawnDetached,qe as splitMarkdownBlocks,rt as startWatcher,se as streamingProblemEvent,Se as swapContributors,Le as teardownToleranceTelemetryWriter,pt as toBroadcasterKey,Ri as tracedAppendFileSync,V as tracedLinkSync,Pt as tracedMkdir,_e as tracedMkdirSync,kt as tracedRename,zt as tracedRenameSync,fe as tracedRmSync,Me as tracedRmdirSync,Ur as tracedUnlinkSync,De as tracedWriteFile,Yt as tracedWriteFileSync,Wt as updateLastKnownHash,O as updateProcessLockPort,k as updateServerLockPort,en as updateUiLockPort,ct as validateAgentId,j as validateCloneInputs,Mn as validateSkillZip,c as waitForServerLockDrain,oi as withHiddenWindowsConsole,Er as withSpan,Jr as withSpanSync,$n as writeBundleDecision,dn as writeRootGitignoreForNewRepo,Mr as writeSkillManagement,ei as writeStateManifest,Sn as writeTargetVersion,hr as writeTracker};
|
|
1
|
+
import{Fi as e,Gt as t,Hi as n,Pn as r,Q as i,_ as a,a as o,an as s,b as c,c as l,di as u,f as d,g as f,gn as p,h as m,i as h,kn as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,ua as E,un as D,v as O,y as k}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{$ as A,$i as j,$n as M,$r as N,$t as P,A as F,Ai as I,An as L,Ar as R,At as z,B,Bi as V,Bn as H,Br as U,Bt as W,C as G,Ci as K,Cn as q,Cr as J,Ct as Y,D as X,Di as Z,Dn as Q,Dr as $,Dt as ee,E as te,Ei as ne,En as re,Er as ie,Et as ae,F as oe,Fi as se,Fn as ce,Fr as le,Ft as ue,G as de,Gi as fe,Gn as pe,Gr as me,Gt as he,H as ge,Hi as _e,Hn as ve,Hr as ye,Ht as be,I as xe,Ii as Se,In as Ce,Ir as we,It as Te,J as Ee,Ji as De,Jn as Oe,Jr as ke,Jt as Ae,K as je,Ki as Me,Kn as Ne,Kr as Pe,Kt as Fe,L as Ie,Li as Le,Ln as Re,Lr as ze,Lt as Be,M as Ve,Mi as He,Mn as Ue,Mr as We,Mt as Ge,N as Ke,Ni as qe,Nn as Je,Nr as Ye,Nt as Xe,O as Ze,Oi as Qe,On as $e,Or as et,Ot as tt,P as nt,Pi as rt,Pn as it,Pr as at,Pt as ot,Q as st,Qi as ct,Qn as lt,Qr as ut,Qt as dt,R as ft,Ri as pt,Rn as mt,Rr as ht,Rt as gt,S as _t,Sa as vt,Si as yt,Sn as bt,Sr as xt,St,T as Ct,Ti as wt,Tn as Tt,Tr as Et,Tt as Dt,U as Ot,Ui as kt,Un as At,Ur as jt,Ut as Mt,V as Nt,Vi as Pt,Vn as Ft,Vr as It,Vt as Lt,W as Rt,Wi as zt,Wn as Bt,Wr as Vt,Wt as Ht,X as Ut,Xi as Wt,Xn as Gt,Xr as Kt,Xt as qt,Y as Jt,Yi as Yt,Yn as Xt,Yr as Zt,Yt as Qt,Z as $t,Zi as en,Zn as tn,Zr as nn,Zt as rn,_ as an,_i as on,_n as sn,_r as cn,_t as ln,a as un,aa as dn,ai as fn,an as pn,ar as mn,at as hn,b as gn,bi as _n,bn as vn,br as yn,bt as bn,c as xn,ca as Sn,ci as Cn,cn as wn,cr as Tn,ct as En,d as Dn,di as On,dn as kn,dr as An,dt as jn,ea as Mn,ei as Nn,en as Pn,er as Fn,et as In,f as Ln,fi as Rn,fn as zn,fr as Bn,ft as Vn,g as Hn,gi as Un,gn as Wn,gr as Gn,gt as Kn,h as qn,hi as Jn,hn as Yn,hr as Xn,ht as Zn,i as Qn,ia as $n,ii as er,in as tr,ir as nr,it as rr,j as ir,ji as ar,jn as or,jr as sr,jt as cr,k as lr,ki as ur,kn as dr,kr as fr,kt as pr,l as mr,la as hr,li as gr,ln as _r,lr as vr,lt as yr,m as br,mi as xr,mn as Sr,mr as Cr,mt as wr,n as Tr,na as Er,ni as Dr,nn as Or,nr as kr,nt as Ar,o as jr,oa as Mr,oi as Nr,on as Pr,or as Fr,ot as Ir,p as Lr,pi as Rr,pn as zr,pr as Br,pt as Vr,q as Hr,qi as Ur,qn as Wr,qr as Gr,qt as Kr,r as qr,ra as Jr,ri as Yr,rn as Xr,rr as Zr,rt as Qr,s as $r,sa as ei,si as ti,sn as ni,sr as ri,st as ii,t as ai,ta as oi,ti as si,tn as ci,tr as li,tt as ui,u as di,ui as fi,un as pi,ur as mi,ut as hi,v as gi,vi as _i,vn as vi,vr as yi,vt as bi,w as xi,wi as Si,wn as Ci,wr as wi,wt as Ti,x as Ei,xa as Di,xi as Oi,xn as ki,xr as Ai,xt as ji,y as Mi,yi as Ni,yn as Pi,yr as Fi,yt as Ii,z as Li,zi as Ri,zn as zi,zr as Bi,zt as Vi}from"./dist-C5-CAALs.mjs";export{ai as AGENT_ID_MAX_LEN,Tr as AGENT_ID_RE,qr as AGENT_WRITE_ORIGIN,Qn as AgentFocusBroadcaster,un as AgentPresenceBroadcaster,jr as AgentSessionCapacityError,$r as AgentSessionManager,xn as AutoStartDisabledError,mr as BUNDLE_IDS,di as BUNDLE_SCOPE,Dn as BUNDLE_SKILL_NAME,Ln as BacklinkIndex,Lr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,br as CONFIG_FILENAME,qn as CONFLICT_MARKER_RE,Hn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,an as ConfigSchema,gi as DEFAULT_CHECKPOINT_RETENTION,Mi as DEFAULT_EMBEDDINGS_DIMENSIONS,gn as DEFAULT_PACK_ID,Ei as EMBEDDINGS_API_KEY_ENV,_t as FILE_SYSTEM_WRITER,G as FILE_WATCHER_ORIGIN,xi as FileEmbeddingsBackend,Ct as GIT_PREFLIGHT_FAIL_SPAN_NAME,te as GIT_UPSTREAM_WRITER,Di as GitDirAccessError,X as GitNotAvailableError,Ze as GitTooOldError,lr as HOCUSPOCUS_AUTH_REJECTION_REASONS,F as HocuspocusAuthRejection,ir as HocuspocusAuthTokenSchema,Ve as INSTALLED_AGENTS_SCHEMES,t as LINEAGE_EPOCH_KEY,Ke as LIVE_DERIVED_INDEX_DEBOUNCE_MS,nt as LOG_MD_TEMPLATE,oe as MANAGED_RENAME_ORIGIN,xe as MAX_AGENT_SESSIONS,Ie as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,ft as MIN_GIT_VERSION,Li as MISSING_OK_CONFIG_MESSAGE,vt as MalformedGitPointerError,B as McpLogger,Nt as MissingOkConfigError,ge as OBSERVER_SYNC_ORIGIN,Ot as OK_OKIGNORE_TEMPLATE,D as ORPHAN_MODES,Rt as PANE_TARGET_TTL_MS,p as PROTOCOL_VERSION,de as PinoLogger,w as ProcessLockCollisionError,je as ProjectGitInitError,Hr as ROLLBACK_ORIGIN,Ee as ROOT_GITIGNORE_TEMPLATE,y as RUNTIME_VERSION,Jt as SERVICE_WRITER,Ut as SKILL_INSTALL_EVENTS_FILE_REL,g as SKILL_STATE_TARGETS,$t as STARTER_FOLDERS,st as STARTER_FOLDER_FRONTMATTER_FILENAME,A as STARTER_PACKS,In as STARTER_PACK_IDS,ui as STARTER_TEMPLATES,Ar as STATE_MANIFEST_FILENAME,S as STATE_SCHEMA_VERSION,r as SYSTEM_DOC_NAME,Qr as SeedPrerequisiteError,rr as SeedRootDirError,h as ServerLockCollisionError,hn as SingleFileNotAFileError,Ir as SingleFileNotFoundError,ii as SingleFileNotMarkdownError,En as StateManifestError,yr as TagIndex,hi as USER_GLOBAL_BUNDLE_IDS,jn as UiLockCollisionError,Vn as __getShowAllWalkStatsForTesting,Vr as __resetShowAllWalkStatsForTesting,o as acquireProcessLock,b as acquireServerLock,wr as acquireUiLock,Zn as applyAgentMarkdownWrite,Kn as applyExternalChange,ln as applySeed,bi as armPaneTarget,Ii as assertCompatibleStateManifest,bn as assertGitAvailable,ji as assertNeverDiskEvent,St as attachIdleShutdown,Y as bootServer,Ti as buildAndOpenSkill,Dt as buildConfigYmlContent,ae as buildExecResult,ee as buildSkillZip,tt as buildStarterFolderFrontmatterYaml,pr as buildWipTree,z as bundleSkillMdPath,cr as classifyEvents,Ge as classifyFsPath,Xe as clearArmedPaneTarget,ot as clearContributors,ue as clearEmbeddingsKeyFromAllBackends,Te as coercePackId,u as colorFromSeed,Be as commitUpstreamImport,gt as commitWip,Vi as commitWipFromTree,W as compareSemver,Lt as containsConflictMarkers,be as contentHash,Mt as contributorCount,Ht as countShadowObjects,he as countStaleAgentWipRefs,Fe as countWipRefs,Kr as createApiExtension,Ae as createAssetServeMiddleware,Qt as createContentFilter,qt as createContentFilterAsync,rn as createEmbeddingsSecretStore,dt as createEphemeralProjectDir,P as createExternalChangeHandler,Pn as createFileLogger,ci as createLiveDerivedIndexExtension,Or as createMcpHttpHandler,Xr as createOsProbe,tr as createPersistenceExtension,pn as createServer,Pr as createServerObserverExtension,ni as createStreamingErrorWriter,wn as createTestLogger,_r as describeStoredEmbeddingsKey,pi as detectClaudeDesktopPresence,kn as detectGit,zn as detectProjectShape,zr as discoverLockDirs,Sr as emitPreflightFailureSpan,Yn as encodeDocName,Wn as encodeFolderRoute,sn as encodeSkillRoute,vi as ensureProjectGit,Pi as errorResponse,vn as evictStaleTrackerEntries,ki as extractOkBinaryPath,bt as extractWikiLinksFromMarkdown,q as fallbackPaths,Ci as findEnclosingGitRoot,Tt as findEnclosingProjectRoot,re as flushFileLogger,Q as formatAuthRejectionWire,$e as formatContributors,dr as formatContributorsFrom,L as formatPackRationale,or as gcCheckpointRefs,Ue as getCurrentMcpLogger,Je as getLocalDir,it as getLogFilePath,ce as getLogger,Ce as getLogsDir,C as getMachineId,Re as getMeter,mt as getMetrics,zi as getTracer,H as handleCollabSocketError,Ft as handleSpawnCursor,ve as hasGcLogLatch,e as iconFromClientName,At as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,pe as initContent,Ne as initShadowRepo,Wr as initTelemetry,Oe as initToleranceTelemetryWriter,Xt as installPrettyZodErrors,Gt as installTestLoggers,tn as installUserSkill,lt as isAllowedApiOrigin,M as isAllowedWorkspaceHostHeader,Fn as isConfigDoc,li as isHocuspocusAuthRejectionReason,kr as isKnownPackId,Zr as isLinkIndexExcludedDoc,nr as isLoopbackAddress,mn as isManagedArtifactDoc,n as isOrphanMode,Fr as isPairedWriteOrigin,ri as isPathWithinDir,l as isProcessAlive,Tn as isProjectRoot,vr as isProjectSkillManaged,mi as isReservedForUserTree,An as isSelfWrite,Bn as isSystemDoc,Br as isToleranceTelemetryEnabled,_ as isValidLockPid,Cr as lastKnownHash,Xn as listRescueCheckpoints,Gn as listStarterPacks,cn as loadPrincipal,T as lockFilePath,yi as loggerFactory,Fi as logsCurrentPath,yn as logsPreviousPath,Ai as makeLazyEmbeddingsKeyStore,d as markServerLockDraining,xt as mountMcpAndApi,J as normalizeFsPath,wi as packageVersionMajorMinor,Et as parseAuthRejectionWire,ie as parseGitVersion,$ as parseHocuspocusAuthToken,et as parseKeepaliveConnectionId,fr as pathToDocName,R as planSeed,sr as prepareSingleFileOpen,We as processCommand,Ye as processUsage,at as readAllTargets,le as readArmedPaneTarget,we as readBranchFromHead,ze as readBundleDecision,x as readProcessLock,v as readProcessLockDetailed,ht as readProjectLocalSemanticConfig,m as readServerLock,Bi as readServerPackageVersion,U as readSkillInstallStateSnapshot,It as readSkillManagement,ye as readStateManifest,jt as readTargetRecordedAt,Vt as readTargetVersion,me as readUiLock,Pe as reconcile,Gr as recordContributor,ke as recordSkillInstallEvent,Zt as registerAllTools,Kt as registerWrite,f as releaseProcessLock,a as releaseServerLock,nn as releaseUiLock,ut as removeLastKnownHash,N as resetMetrics,E as resolveBundleEnabled,Nn as resolveBundledSkillDir,si as resolveContentDir,Dr as resolveCursorBinaryDefault,Yr as resolveCursorSpawnInvocation,er as resolveLockDir,fn as resolvePack,Nr as resolvePackageVersion,ti as resolveUiInfo,Cn as restoreContributors,gr as restoreLifecycleFromConflictsJson,fi as rewriteMarkdownLinksForDocumentRename,On as rewriteWikiLinksForDocumentRename,Rn as runAuthReposSubprocess,Rr as runAuthStatusSubprocess,xr as runCloneSubprocess,Jn as runDeviceFlowSubprocess,Un as runWithMcpLogger,on as safeContentPath,_i as safeSubdir,Ni as safetyCheckpoint,_n as sanitizeClientName,Oi as saveInMemoryCheckpoint,yt as saveVersion,K as seedBasenameIndex,Si as serializeError,wt as setActiveSpanAttributes,ne as setupServerObservers,Z as shadowGit,Qe as shutdownTelemetry,ur as skillManagementPath,I as spansCurrentPath,ar as spansPreviousPath,He as spawnDetached,qe as splitMarkdownBlocks,rt as startWatcher,se as streamingProblemEvent,Se as swapContributors,Le as teardownToleranceTelemetryWriter,pt as toBroadcasterKey,Ri as tracedAppendFileSync,V as tracedLinkSync,Pt as tracedMkdir,_e as tracedMkdirSync,kt as tracedRename,zt as tracedRenameSync,fe as tracedRmSync,Me as tracedRmdirSync,Ur as tracedUnlinkSync,De as tracedWriteFile,Yt as tracedWriteFileSync,Wt as updateLastKnownHash,O as updateProcessLockPort,k as updateServerLockPort,en as updateUiLockPort,ct as validateAgentId,j as validateCloneInputs,Mn as validateSkillZip,c as waitForServerLockDrain,oi as withHiddenWindowsConsole,Er as withSpan,Jr as withSpanSync,$n as writeBundleDecision,dn as writeRootGitignoreForNewRepo,Mr as writeSkillManagement,ei as writeStateManifest,Sn as writeTargetVersion,hr as writeTracker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./git-handle-XXj9bu6B-B4fXubq8.mjs";export{e as createGitInstance};
|
|
@@ -6,5 +6,5 @@ import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{normalize as r,res
|
|
|
6
6
|
`){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function nt(e,t){return A(e,!0).map(e=>t(e))}function rt(e){return(0,Ve.exists)(e,Ve.FOLDER)}function j(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function it(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function at(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function M(e){return Array.isArray(e)?e:[e]}function ot(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function N(e){return M(e).map(e=>e instanceof String?e:String(e))}function P(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function F(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function I(e){return(Array.isArray(e)?Buffer.concat(e):e).toString(`utf-8`)}function st(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function ct(e=0){return new Promise(t=>setTimeout(t,e))}function lt(e){if(e!==!1)return e}var L,R,z,ut=S({"src/lib/utils/util.ts"(){vt(),L=`\0`,R=()=>{},z=Object.prototype.toString.call.bind(Object.prototype.toString)}});function B(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function dt(e,t){let n=h(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function ft(e){return!!e&&z(e)===`[object Object]`}function pt(e){return typeof e==`function`}var mt,ht,V,gt,_t,vt=S({"src/lib/utils/argument-filters.ts"(){ut(),mt=e=>Array.isArray(e),ht=e=>typeof e==`number`,V=e=>typeof e==`string`||h(e),gt=e=>V(e)||Array.isArray(e)&&e.every(V),_t=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),yt,bt=S({"src/lib/utils/exit-codes.ts"(){yt=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(yt||{})}}),xt,St=S({"src/lib/utils/git-output-streams.ts"(){xt=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function Ct(){throw Error(`LineParser:useMatches not implemented`)}var H,U,wt=S({"src/lib/utils/line-parser.ts"(){H=class{constructor(e,t){this.matches=[],this.useMatches=Ct,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))}},U=class extends H{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 Tt(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...Et},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var Et,Dt=S({"src/lib/utils/simple-git-options.ts"(){Et={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ot(e,t=[]){return ft(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(h(r))t.push(r);else if(dt(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)dt(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function W(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 Ot(At(e),r),n||r.push(...kt(e)),r}function kt(e){return N(B(k(e,typeof k(e)==`function`?1:0),mt,[]))}function At(e){return B(k(e,pt(k(e))?1:0),ft)}function G(e,t=!0){let n=Ze(k(e));return t||Qe(n)?n:void 0}var jt=S({"src/lib/utils/task-options.ts"(){vt(),ut()}});function Mt(e,t){return e(t.stdOut,t.stdErr)}function K(e,t,n,r=!0){return M(n).forEach(n=>{for(let i=A(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 Nt=S({"src/lib/utils/task-parser.ts"(){ut()}}),Pt={};C(Pt,{ExitCodes:()=>yt,GitOutputStreams:()=>xt,LineParser:()=>H,NOOP:()=>R,NULL:()=>L,RemoteLineParser:()=>U,append:()=>j,appendTaskOptions:()=>Ot,asArray:()=>M,asCamelCase:()=>ot,asFunction:()=>Ze,asNumber:()=>P,asStringArray:()=>N,bufferToString:()=>I,callTaskParser:()=>Mt,createInstanceConfig:()=>Tt,delay:()=>ct,filterArray:()=>mt,filterFunction:()=>pt,filterHasLength:()=>_t,filterNumber:()=>ht,filterPlainObject:()=>ft,filterPrimitives:()=>dt,filterString:()=>V,filterStringOrStringArray:()=>gt,filterType:()=>B,first:()=>et,folderExists:()=>rt,forEachLineWithContent:()=>nt,getTrailingOptions:()=>W,including:()=>it,isUserFunction:()=>Qe,last:()=>k,objectToString:()=>z,orVoid:()=>lt,parseStringResponse:()=>K,pick:()=>st,prefixedArray:()=>F,remove:()=>at,splitOn:()=>$e,toLinesWithContent:()=>A,trailingFunctionArgument:()=>G,trailingOptionsArgument:()=>At});var q=S({"src/lib/utils/index.ts"(){vt(),bt(),St(),wt(),Dt(),jt(),Nt(),ut()}}),Ft={};C(Ft,{CheckRepoActions:()=>Bt,checkIsBareRepoTask:()=>Rt,checkIsRepoRootTask:()=>Lt,checkIsRepoTask:()=>It});function It(e){switch(e){case`bare`:return Rt();case`root`:return Lt()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:Vt,parser:Ht}}function Lt(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:Vt,parser(e){return/^\.(git)?$/.test(e.trim())}}}function Rt(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:Vt,parser:Ht}}function zt(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Bt,Vt,Ht,Ut=S({"src/lib/tasks/check-is-repo.ts"(){q(),Bt=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(Bt||{}),Vt=({exitCode:e},t,n,r)=>{if(e===128&&zt(t))return n(Buffer.from(`false`));r(t)},Ht=e=>e.trim()===`true`}});function Wt(e,t){let n=new Gt(e),r=e?qt:Kt;return A(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(Jt.test(t)?n.folders:n.files).push(t)}),n}var Gt,Kt,qt,Jt,Yt=S({"src/lib/responses/CleanSummary.ts"(){q(),Gt=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Kt=/^[a-z]+\s*/i,qt=/^[a-z]+\s+[a-z]+\s*/i,Jt=/\/$/}}),Xt={};C(Xt,{EMPTY_COMMANDS:()=>tn,adhocExecTask:()=>Zt,configurationErrorTask:()=>J,isBufferTask:()=>$t,isEmptyTask:()=>en,straightThroughBufferTask:()=>Qt,straightThroughStringTask:()=>Y});function Zt(e){return{commands:tn,format:`empty`,parser:e}}function J(e){return{commands:tn,format:`empty`,parser(){throw typeof e==`string`?new Ye(e):e}}}function Y(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function Qt(e){return{commands:e,format:`buffer`,parser(e){return e}}}function $t(e){return e.format===`buffer`}function en(e){return e.format===`empty`||!e.commands.length}var tn,X=S({"src/lib/tasks/task.ts"(){Xe(),tn=[]}}),nn={};C(nn,{CONFIG_ERROR_INTERACTIVE_MODE:()=>dn,CONFIG_ERROR_MODE_REQUIRED:()=>fn,CONFIG_ERROR_UNKNOWN_OPTION:()=>pn,CleanOptions:()=>mn,cleanTask:()=>an,cleanWithOptionsTask:()=>rn,isCleanOptionsArray:()=>on});function rn(e,t){let{cleanMode:n,options:r,valid:i}=sn(e);return n?i.options?(r.push(...t),r.some(un)?J(dn):an(n,r)):J(pn+JSON.stringify(e)):J(fn)}function an(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return Wt(e===`n`,t)}}}function on(e){return Array.isArray(e)&&e.every(e=>hn.has(e))}function sn(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{cn(e)?(t=e,r.cleanMode=!0):r.options=r.options&&ln(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function cn(e){return e===`f`||e===`n`}function ln(e){return/^-[a-z]$/i.test(e)&&hn.has(e.charAt(1))}function un(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var dn,fn,pn,mn,hn,gn=S({"src/lib/tasks/clean.ts"(){Yt(),q(),X(),dn=`Git clean interactive mode is not supported`,fn=`Git clean mode parameter ("n" or "f") is required`,pn=`Git clean unknown option found in: `,mn=(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))(mn||{}),hn=new Set([`i`,...N(Object.values(mn))])}});function _n(e){let t=new xn;for(let n of bn(e))t.addValue(n.file,String(n.key),n.value);return t}function vn(e,t){let n=null,r=[],i=new Map;for(let a of bn(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 yn(e){return e.replace(/^(file):/,``)}function*bn(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=yn(n[e++]),i=n[e++],a=t;if(i.includes(`
|
|
7
7
|
`)){let e=$e(i,`
|
|
8
8
|
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var xn,Sn=S({"src/lib/responses/ConfigList.ts"(){q(),xn=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=k(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 Cn(e,t){return typeof e==`string`&&Object.hasOwn(On,e)?e:t}function wn(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 Tn(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 vn(t,e)}}}function En(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return _n(e)}}}function Dn(){return{addConfig(e,t,...n){return this._runTask(wn(e,t,n[0]===!0,Cn(n[1],`local`)),G(arguments))},getConfig(e,t){return this._runTask(Tn(e,Cn(t,void 0)),G(arguments))},listConfig(...e){return this._runTask(En(Cn(e[0],void 0)),G(arguments))}}}var On,kn=S({"src/lib/tasks/config.ts"(){Sn(),q(),On=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(On||{})}});function An(e){return Mn.has(e)}var jn,Mn,Nn=S({"src/lib/tasks/diff-name-status.ts"(){jn=(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))(jn||{}),Mn=new Set(Object.values(jn))}});function Pn(...e){return new Bn().param(...e)}function Fn(e){let t=new Set,n={};return nt(e,e=>{let[r,i,a]=e.split(L);t.add(r),(n[r]=n[r]||[]).push({line:P(i),path:r,preview:a})}),{paths:t,results:n}}function In(){return{grep(e){let t=G(arguments),n=W(arguments);for(let e of Ln)if(n.includes(e))return this._runTask(J(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=Pn().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return Fn(e)}},t)}}}var Ln,Rn,zn,Bn,Vn=S({"src/lib/tasks/grep.ts"(){q(),X(),Ln=[`-h`],Rn=Symbol(`grepQuery`),Bn=class{constructor(){this[zn]=[]}*[(zn=Rn,Symbol.iterator)](){for(let e of this[Rn])yield e}and(...e){return e.length&&this[Rn].push(`--and`,`(`,...F(e,`-e`),`)`),this}param(...e){return this[Rn].push(...F(e,`-e`)),this}}}}),Hn={};C(Hn,{ResetMode:()=>Kn,getResetMode:()=>Wn,resetTask:()=>Un});function Un(e,t){let n=[`reset`];return Gn(e)&&n.push(`--${e}`),n.push(...t),Y(n)}function Wn(e){if(Gn(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function Gn(e){return typeof e==`string`&&qn.includes(e)}var Kn,qn,Jn=S({"src/lib/tasks/reset.ts"(){q(),X(),Kn=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(Kn||{}),qn=N(Object.values(Kn))}});function Yn(){return(0,He.default)(`simple-git`)}function Xn(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 Zn(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 Qn(e,t,n,r=Yn()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=Zn(B(t,V),o,r);return l(n);function c(t,n){return j(a,Qn(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&Xn(o,n)||R,s=Xn(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var $n=S({"src/lib/git-logger.ts"(){q(),He.default.formatters.L=e=>String(_t(e)?e.length:`-`),He.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):z(e)}}),er,tr=S({"src/lib/runners/tasks-pending-queue.ts"(){E(),$n(),er=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:Qn(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new T(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function Z(e,t){return{method:et(e.commands)||``,commands:t}}function nr(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function rr(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var ir,ar=S({"src/lib/runners/git-executor-chain.ts"(){E(),X(),q(),tr(),ir=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new er}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(en(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof T?Object.assign(t,{task:e}):new T(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,Z(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...Z(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),$t(e)?Mt(e.parser,a):Mt(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...Z(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,z(e)),c(new xt(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 xt(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let o=i.sibling(`output`),s=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},Z(e,e.commands));return new Promise(c=>{let l=[],u=[];i.info(`%s %o`,t,n),i(`%O`,s);let d=this._beforeSpawn(e,n);if(d)return c({stdOut:l,stdErr:u,exitCode:9901,rejection:d});this._plugins.exec(`spawn.before`,void 0,{...Z(e,n),kill(e){d=e||d}});let f=a(t,n,s);f.stdout.on(`data`,rr(l,`stdOut`,i,o.step(`stdOut`))),f.stderr.on(`data`,rr(u,`stdErr`,i,o.step(`stdErr`))),f.on(`error`,nr(u,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,f.stdout,f.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...Z(e,n),spawned:f,close(e,t){c({stdOut:l,stdErr:u,exitCode:e,rejection:d||t})},kill(e){f.killed||(d=e,f.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...Z(e,t),kill(e){n=e||n}}),n}}}}),or={};C(or,{GitExecutor:()=>sr});var sr,cr=S({"src/lib/runners/git-executor.ts"(){ar(),sr=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new ir(this,this._scheduler,this._plugins)}chain(){return new ir(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function lr(e,t,n=R){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof D?ur(t):t,void 0)})}function ur(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=R};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 dr=S({"src/lib/task-callback.ts"(){O(),q()}});function fr(e,t){return Zt(n=>{if(!rt(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var pr=S({"src/lib/tasks/change-working-directory.ts"(){q(),X()}});function mr(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=at(t,`-B`)),Y(t)}function hr(){return{checkout(){return this._runTask(mr(W(arguments,1)),G(arguments))},checkoutBranch(e,t){return this._runTask(mr([`-b`,e,t,...W(arguments)]),G(arguments))},checkoutLocalBranch(e){return this._runTask(mr([`-b`,e,...W(arguments)]),G(arguments))}}}var gr=S({"src/lib/tasks/checkout.ts"(){q(),X()}});function _r(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function vr(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return K(_r(),[yr],e)}})}}}var yr,br=S({"src/lib/tasks/count-objects.ts"(){q(),yr=new H(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=ot(t);Object.hasOwn(e,r)&&(e[r]=P(n))})}});function xr(e){return K({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Sr,e)}var Sr,Cr=S({"src/lib/parsers/parse-commit.ts"(){q(),Sr=[new H(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new H(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new H(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new H(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function wr(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...F(e,`-m`),...t,...n],format:`utf-8`,parser:xr}}function Tr(){return{commit(t,...n){let r=G(arguments),i=e(t)||wr(M(t),M(B(n[0],gt,[])),[...N(B(n[1],mt,[])),...W(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!gt(e)&&J(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Er=S({"src/lib/tasks/commit.ts"(){Cr(),q(),X()}});function Dr(){return{firstCommit(){return this._runTask(Y([`rev-list`,`--max-parents=0`,`HEAD`],!0),G(arguments))}}}var Or=S({"src/lib/tasks/first-commit.ts"(){q(),X()}});function kr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),Y(n,!0)}var Ar=S({"src/lib/tasks/hash-object.ts"(){X()}});function jr(e,t,n){let r=String(n).trim(),i;if(i=Nr.exec(r))return new Mr(e,t,!1,i[1]);if(i=Pr.exec(r))return new Mr(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new Mr(e,t,/^re/i.test(r),a)}var Mr,Nr,Pr,Fr=S({"src/lib/responses/InitSummary.ts"(){Mr=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Nr=/^Init.+ repository in (.+)$/,Pr=/^Rein.+ in (.+)$/}});function Ir(e){return e.includes(Rr)}function Lr(e=!1,t,n){let r=[`init`,...n];return e&&!Ir(r)&&r.splice(1,0,Rr),{commands:r,format:`utf-8`,parser(e){return jr(r.includes(`--bare`),t,e)}}}var Rr,zr=S({"src/lib/tasks/init.ts"(){Fr(),Rr=`--bare`}});function Br(e){for(let t=0;t<e.length;t++){let n=Hr.exec(e[t]);if(n)return`--${n[1]}`}return``}function Vr(e){return Hr.test(e)}var Hr,Ur=S({"src/lib/args/log-format.ts"(){Hr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Wr,Gr=S({"src/lib/responses/DiffSummary.ts"(){Wr=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Kr(e=``){let t=Zr[e];return e=>K(new Wr,t,e,!1)}var qr,Jr,Yr,Xr,Zr,Qr=S({"src/lib/parsers/parse-diff-summary.ts"(){Ur(),Gr(),Nn(),q(),qr=[new H(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:P(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new H(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:P(n),after:P(r),binary:!0})}),new H(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=P(t),e.insertions=P(r?.[1]),e.deletions=P(i?.[1])})],Jr=[new H(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=P(t),a=P(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new H(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Yr=[new H(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Xr=[new H(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:lt(An(t)&&t),from:lt(!!a&&r!==a&&r),similarity:P(n)})})],Zr={"":qr,"--stat":qr,"--numstat":Jr,"--name-status":Xr,"--name-only":Yr}}});function $r(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function ei(e=ri,t=ii,n=``){let r=Kr(n);return function(n){let i=A(n.trim(),!1,ti).map(function(n){let i=n.split(ni),a=$r(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 ti,ni,ri,ii,ai=S({"src/lib/parsers/parse-list-log-summary.ts"(){q(),Qr(),Ur(),ti=`òòòòòò `,ni=` òò`,ri=` ò `,ii=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),oi={};C(oi,{diffSummaryTask:()=>si,validateLogFormatConfig:()=>ci});function si(e){let t=Br(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),ci(n)||{commands:n,format:`utf-8`,parser:Kr(t)}}function ci(e){let t=e.filter(Vr);if(t.length>1)return J(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return J(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var li=S({"src/lib/tasks/diff.ts"(){Ur(),Qr(),X()}});function ui(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function di(e){return Object.keys(e).reduce((t,n)=>(n in hi||(t[n]=e[n]),t),{})}function fi(e={},t=[]){let n=B(e.splitter,V,ri),[r,i]=ui(ft(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:${ti}${i}${ni}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return V(e.file)&&o.push(`--follow`,ne(e.file)),Ot(di(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function pi(e,t,n){let r=ei(e,t,Br(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function mi(){return{log(...n){let r=G(arguments),i=fi(At(arguments),N(B(arguments[0],mt,[]))),a=t(...n)||ci(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return pi(e.splitter,e.fields,e.commands)}function t(e,t){return V(e)&&V(t)&&J(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var hi,gi=S({"src/lib/tasks/log.ts"(){Ur(),ai(),q(),X(),li(),hi=(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))(hi||{})}}),_i,vi,yi=S({"src/lib/responses/MergeSummary.ts"(){_i=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},vi=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`}}}}),bi,xi,Si=S({"src/lib/responses/PullSummary.ts"(){bi=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},xi=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Ci(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 wi(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:P(t&&t[1]||`0`),delta:P(n&&n[1]||`0`)}}var Ti,Ei=S({"src/lib/parsers/parse-remote-objects.ts"(){q(),Ti=[new U(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Ci(e.remoteMessages);Object.assign(i,{[r]:P(n)})}),new U(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Ci(e.remoteMessages);Object.assign(i,{[r]:P(n)})}),new U(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Ci(e.remoteMessages);i.total=wi(t),i.reused=wi(n),i.packReused=P(r)})]}});function Di(e,t){return K({remoteMessages:new ki},Oi,t)}var Oi,ki,Ai=S({"src/lib/parsers/parse-remote-messages.ts"(){q(),Ei(),Oi=[new U(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Ti,new U([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new U([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:P(t),summary:n,url:r}})],ki=class{constructor(){this.all=[]}}}});function ji(e,t){let n=K(new xi,Ii,[e,t]);return n.message&&n}var Mi,Ni,Pi,Fi,Ii,Li,Ri,zi=S({"src/lib/parsers/parse-pull.ts"(){Si(),q(),Ai(),Mi=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Ni=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Pi=/^(create|delete) mode \d+ (.+)/,Fi=[new H(Mi,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new H(Ni,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new H(Pi,(e,[t,n])=>{j(e.files,n),j(t===`create`?e.created:e.deleted,n)})],Ii=[new H(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new H(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new H(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Li=(e,t)=>K(new bi,Fi,[e,t]),Ri=(e,t)=>Object.assign(new bi,Li(e,t),Di(e,t))}}),Bi,Vi,Hi,Ui=S({"src/lib/parsers/parse-merge.ts"(){yi(),q(),zi(),Bi=[new H(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new H(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new _i(t,n))}),new H(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new _i(t,n,{deleteRef:r}))}),new H(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new _i(t,null))}),new H(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Vi=(e,t)=>Object.assign(Hi(e,t),Ri(e,t)),Hi=e=>K(new vi,Bi,e)}});function Wi(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=Vi(e,t);if(n.failed)throw new D(n);return n}}:J(`Git.merge requires at least one option`)}var Gi=S({"src/lib/tasks/merge.ts"(){O(),Ui(),X()}});function Ki(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 qi,Ji,Yi,Xi=S({"src/lib/parsers/parse-push.ts"(){q(),Ai(),qi=[new H(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new H(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new H(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(Ki(t,n,r))}),new H(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new H(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],Ji=(e,t)=>{let n=Yi(e,t),r=Di(e,t);return{...n,...r}},Yi=(e,t)=>K({pushed:[]},qi,[e,t])}}),Zi={};C(Zi,{pushTagsTask:()=>Qi,pushTask:()=>$i});function Qi(e={},t){return j(t,`--tags`),$i(e,t)}function $i(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),at(n,`-v`),j(n,`--verbose`),j(n,`--porcelain`),{commands:n,format:`utf-8`,parser:Ji}}var ea=S({"src/lib/tasks/push.ts"(){Xi(),q()}});function ta(){return{showBuffer(){let e=[`show`,...W(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(Qt(e),G(arguments))},show(){let e=[`show`,...W(arguments,1)];return this._runTask(Y(e),G(arguments))}}}var na=S({"src/lib/tasks/show.ts"(){q(),X()}}),ra,ia,aa=S({"src/lib/responses/FileStatusSummary.ts"(){ra=/^(.+)\0(.+)$/,ia=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=ra.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function oa(e){let[t,n]=e.split(L);return{from:n||t,to:t}}function Q(e,t,n){return[`${e}${t}`,n]}function sa(e,...t){return t.map(t=>Q(e,t,(e,t)=>e.conflicted.push(t)))}function ca(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=ua.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ia(r,t,n))}}var la,ua,da,fa=S({"src/lib/responses/StatusSummary.ts"(){q(),aa(),la=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}},ua=new Map([Q(` `,`A`,(e,t)=>e.created.push(t)),Q(` `,`D`,(e,t)=>e.deleted.push(t)),Q(` `,`M`,(e,t)=>e.modified.push(t)),Q(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),Q(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Q(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Q(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`R`,` `,(e,t)=>{e.renamed.push(oa(t))}),Q(`R`,`M`,(e,t)=>{let n=oa(t);e.renamed.push(n),e.modified.push(n.to)}),Q(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Q(`?`,`?`,(e,t)=>e.not_added.push(t)),...sa(`A`,`A`,`U`),...sa(`D`,`D`,`U`),...sa(`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=B(s?.[1],V,null),s=a.exec(t),e.tracking=B(s?.[1],V,null),s=o.exec(t),s&&(e.current=B(s?.[1],V,e.current)),e.detached=/\(no branch\)/.test(t)}]]),da=function(e){let t=e.split(L),n=new la;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=L+(t[e++]||``)),ca(n,r))}return n}}});function pa(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!ma.includes(e))],parser(e){return da(e)}}}var ma,ha=S({"src/lib/tasks/status.ts"(){fa(),ma=[`--null`,`-z`]}});function ga(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 _a(){return ga(0,0,0,``,!1)}function va(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:ya,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(ba));r(t)}})}}}function ya(e){return e===ba?_a():K(ga(0,0,0,e),xa,e)}var ba,xa,Sa=S({"src/lib/tasks/version.ts"(){q(),ba=`installed=false`,xa=[new H(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,ga(P(t),P(n),P(r),i))}),new H(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,ga(P(t),P(n),r,i))})]}});function Ca(e,t,n,...r){return V(n)?t(n,B(r[0],V),W(arguments)):J(`git.${e}() requires a string 'repoPath'`)}function wa(){return{clone(e,...t){return this._runTask(Ca(`clone`,Ta,B(e,V),...t),G(arguments))},mirror(e,...t){return this._runTask(Ca(`mirror`,Ea,B(e,V),...t),G(arguments))}}}var Ta,Ea,Da=S({"src/lib/tasks/clone.ts"(){X(),q(),Ta=(e,t,n)=>{let r=[`clone`,...n];return V(e)&&r.push(ne(e)),V(t)&&r.push(ne(t)),Y(r)},Ea=(e,t,n)=>(j(n,`--mirror`),Ta(e,t,n))}}),Oa={};C(Oa,{SimpleGitApi:()=>ka});var ka,Aa=S({"src/lib/simple-git-api.ts"(){dr(),pr(),gr(),br(),Er(),kn(),Or(),Vn(),Ar(),zr(),gi(),Gi(),ea(),na(),ha(),X(),Sa(),q(),Da(),ka=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&lr(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(Y([`add`,...M(e)]),G(arguments))}cwd(e){let t=G(arguments);return typeof e==`string`?this._runTask(fr(e,this._executor),t):typeof e?.path==`string`?this._runTask(fr(e.path,e.root&&this._executor||void 0),t):this._runTask(J(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(kr(e,t===!0),G(arguments))}init(e){return this._runTask(Lr(e===!0,this._executor.cwd,W(arguments)),G(arguments))}merge(){return this._runTask(Wi(W(arguments)),G(arguments))}mergeFromTo(e,t){return V(e)&&V(t)?this._runTask(Wi([e,t,...W(arguments)]),G(arguments,!1)):this._runTask(J(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=$i({remote:B(arguments[0],V),branch:B(arguments[1],V)},W(arguments));return this._runTask(e,G(arguments))}stash(){return this._runTask(Y([`stash`,...W(arguments)]),G(arguments))}status(){return this._runTask(pa(W(arguments)),G(arguments))}},Object.assign(ka.prototype,hr(),wa(),Tr(),Dn(),vr(),Dr(),In(),mi(),ta(),va())}}),ja={};C(ja,{Scheduler:()=>Na});var Ma,Na,Pa=S({"src/lib/runners/scheduler.ts"(){q(),$n(),Ma=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,x.createDeferred)();return{promise:t,done:n,id:e}}})(),Na=class{constructor(e=2){this.concurrency=e,this.logger=Qn(``,`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=j(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),at(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=j(this.pending,Ma());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),Fa={};C(Fa,{applyPatchTask:()=>Ia});function Ia(e,t){return Y([`apply`,...t,...e])}var La=S({"src/lib/tasks/apply-patch.ts"(){X()}});function Ra(e,t){return{branch:e,hash:t,success:!0}}function za(e){return{branch:e,hash:null,success:!1}}var Ba,Va=S({"src/lib/responses/BranchDeleteSummary.ts"(){Ba=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Ha(e,t){return t===1&&Wa.test(e)}var Ua,Wa,Ga,Ka,qa=S({"src/lib/parsers/parse-branch-delete.ts"(){Va(),q(),Ua=/(\S+)\s+\(\S+\s([^)]+)\)/,Wa=/^error[^']+'([^']+)'/m,Ga=[new H(Ua,(e,[t,n])=>{let r=Ra(t,n);e.all.push(r),e.branches[t]=r}),new H(Wa,(e,[t])=>{let n=za(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],Ka=(e,t)=>K(new Ba,Ga,[e,t])}}),Ja,Ya=S({"src/lib/responses/BranchSummary.ts"(){Ja=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 Xa(e){return e?e.charAt(0):``}function Za(e,t=!1){return K(new Ja,t?[$a]:Qa,e)}var Qa,$a,eo=S({"src/lib/parsers/parse-branch.ts"(){Ya(),q(),Qa=[new H(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(Xa(t),!0,n,r,i)}),new H(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(Xa(t),!1,n,r,i)})],$a=new H(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),to={};C(to,{branchLocalTask:()=>io,branchTask:()=>ro,containsDeleteBranchCommand:()=>no,deleteBranchTask:()=>oo,deleteBranchesTask:()=>ao});function no(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function ro(e){let t=no(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?Ka(e,r).all[0]:Za(e,n)}}}function io(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return Za(e)}}}function ao(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return Ka(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!Ha(String(n),e))return i(n);r(t)}}}function oo(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return Ka(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!Ha(String(i),e))return o(i);throw new D(n.parser(I(r),I(t)),String(i))}};return n}var so=S({"src/lib/tasks/branch.ts"(){O(),qa(),eo(),q()}});function co(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&r(t)}var lo,uo=S({"src/lib/responses/CheckIgnore.ts"(){lo=e=>e.split(/\n/g).map(co).filter(Boolean)}}),fo={};C(fo,{checkIgnoreTask:()=>po});function po(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:lo}}var mo=S({"src/lib/tasks/check-ignore.ts"(){uo()}});function ho(e,t){return K({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},go,[e,t])}var go,_o=S({"src/lib/parsers/parse-fetch.ts"(){q(),go=[new H(/From (.+)$/,(e,[t])=>{e.remote=t}),new H(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new H(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new H(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new H(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),vo={};C(vo,{fetchTask:()=>bo});function yo(e){return/^--upload-pack(=|$)/.test(e)}function bo(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(yo)?J(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:ho}}var xo=S({"src/lib/tasks/fetch.ts"(){_o(),X()}});function So(e){return K({moves:[]},Co,e)}var Co,wo=S({"src/lib/parsers/parse-move.ts"(){q(),Co=[new H(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),To={};C(To,{moveTask:()=>Eo});function Eo(e,t){return{commands:[`mv`,`-v`,...M(e),t],format:`utf-8`,parser:So}}var Do=S({"src/lib/tasks/move.ts"(){wo(),q()}}),Oo={};C(Oo,{pullTask:()=>ko});function ko(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 Ri(e,t)},onError(e,t,n,r){let i=ji(I(e.stdOut),I(e.stdErr));if(i)return r(new D(i));r(t)}}}var Ao=S({"src/lib/tasks/pull.ts"(){O(),zi(),q()}});function jo(e){let t={};return No(e,([e])=>t[e]={name:e}),Object.values(t)}function Mo(e){let t={};return No(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 No(e,t){nt(e,e=>t(e.split(/\s+/)))}var Po=S({"src/lib/responses/GetRemoteSummary.ts"(){q()}}),Fo={};C(Fo,{addRemoteTask:()=>Io,getRemotesTask:()=>Lo,listRemotesTask:()=>Ro,remoteTask:()=>zo,removeRemoteTask:()=>Bo});function Io(e,t,n){return Y([`remote`,`add`,...n,e,t])}function Lo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Mo:jo}}function Ro(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),Y(t)}function zo(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),Y(t)}function Bo(e){return Y([`remote`,`remove`,e])}var Vo=S({"src/lib/tasks/remote.ts"(){Po(),X()}}),Ho={};C(Ho,{stashListTask:()=>Uo});function Uo(e={},t){let n=fi(e),r=[`stash`,`list`,...n.commands,...t],i=ei(n.splitter,n.fields,Br(r));return ci(r)||{commands:r,format:`utf-8`,parser:i}}var Wo=S({"src/lib/tasks/stash-list.ts"(){Ur(),ai(),li(),gi()}}),Go={};C(Go,{addSubModuleTask:()=>Ko,initSubModuleTask:()=>qo,subModuleTask:()=>Jo,updateSubModuleTask:()=>Yo});function Ko(e,t){return Jo([`add`,e,t])}function qo(e){return Jo([`init`,...e])}function Jo(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),Y(t)}function Yo(e){return Jo([`update`,...e])}var Xo=S({"src/lib/tasks/sub-module.ts"(){X()}});function Zo(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?Qo(e,t):0:n?1:-1}function Qo(e,t){return e===t?0:e>t?1:-1}function $o(e){return e.trim()}function es(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var ts,ns,rs=S({"src/lib/responses/TagList.ts"(){ts=class{constructor(e,t){this.all=e,this.latest=t}},ns=function(e,t=!1){let n=e.split(`
|
|
9
|
-
`).map($o).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return Zo(es(n[0]),es(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=Qo(es(n[e]),es(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ts(n,r)}}}),is={};C(is,{addAnnotatedTagTask:()=>ss,addTagTask:()=>os,tagListTask:()=>as});function as(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return ns(e,t)}}}function os(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ss(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var cs=S({"src/lib/tasks/tag.ts"(){rs()}}),ls=qe({"src/git.js"(e,t){var{GitExecutor:n}=(cr(),w(or)),{SimpleGitApi:r}=(Aa(),w(Oa)),{Scheduler:i}=(Pa(),w(ja)),{adhocExecTask:a,configurationErrorTask:o}=(X(),w(Xt)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:ee}=(q(),w(Pt)),{applyPatchTask:te}=(La(),w(Fa)),{branchTask:ne,branchLocalTask:h,deleteBranchesTask:g,deleteBranchTask:re}=(so(),w(to)),{checkIgnoreTask:ie}=(mo(),w(fo)),{checkIsRepoTask:ae}=(Ut(),w(Ft)),{cleanWithOptionsTask:oe,isCleanOptionsArray:se}=(gn(),w(nn)),{diffSummaryTask:ce}=(li(),w(oi)),{fetchTask:le}=(xo(),w(vo)),{moveTask:_}=(Do(),w(To)),{pullTask:ue}=(Ao(),w(Oo)),{pushTagsTask:de}=(ea(),w(Zi)),{addRemoteTask:fe,getRemotesTask:pe,listRemotesTask:me,remoteTask:he,removeRemoteTask:ge}=(Vo(),w(Fo)),{getResetMode:_e,resetTask:ve}=(Jn(),w(Hn)),{stashListTask:ye}=(Wo(),w(Ho)),{addSubModuleTask:be,initSubModuleTask:xe,subModuleTask:Se,updateSubModuleTask:Ce}=(Xo(),w(Go)),{addAnnotatedTagTask:we,addTagTask:Te,tagListTask:Ee}=(cs(),w(is)),{straightThroughBufferTask:v,straightThroughStringTask:y}=(X(),w(Xt));function b(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(b.prototype=Object.create(r.prototype)).constructor=b,b.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},b.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},b.prototype.stashList=function(e){return this._runTask(ye(ee(arguments)||{},c(e)&&e||[]),m(arguments))},b.prototype.mv=function(e,t){return this._runTask(_(e,t),m(arguments))},b.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},b.prototype.pull=function(e,t,n,r){return this._runTask(ue(f(e,u),f(t,u),p(arguments)),m(arguments))},b.prototype.fetch=function(e,t){return this._runTask(le(f(e,u),f(t,u),p(arguments)),m(arguments))},b.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.")))},b.prototype.tags=function(e,t){return this._runTask(Ee(p(arguments)),m(arguments))},b.prototype.rebase=function(){return this._runTask(y([`rebase`,...p(arguments)]),m(arguments))},b.prototype.reset=function(e){return this._runTask(ve(_e(e),p(arguments)),m(arguments))},b.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(y([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},b.prototype.addTag=function(e){let t=typeof e==`string`?Te(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},b.prototype.addAnnotatedTag=function(e,t){return this._runTask(we(e,t),m(arguments))},b.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(re(e,typeof t==`boolean`?t:!1),m(arguments))},b.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(g(e,typeof t==`boolean`?t:!1),m(arguments))},b.prototype.branch=function(e,t){return this._runTask(ne(p(arguments)),m(arguments))},b.prototype.branchLocal=function(e){return this._runTask(h(),m(arguments))},b.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(y(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},b.prototype.submoduleAdd=function(e,t,n){return this._runTask(be(e,t),m(arguments))},b.prototype.submoduleUpdate=function(e,t){return this._runTask(Ce(p(arguments,!0)),m(arguments))},b.prototype.submoduleInit=function(e,t){return this._runTask(xe(p(arguments,!0)),m(arguments))},b.prototype.subModule=function(e,t){return this._runTask(Se(p(arguments)),m(arguments))},b.prototype.listRemote=function(){return this._runTask(me(p(arguments)),m(arguments))},b.prototype.addRemote=function(e,t,n){return this._runTask(fe(e,t,p(arguments)),m(arguments))},b.prototype.removeRemote=function(e,t){return this._runTask(ge(e),m(arguments))},b.prototype.getRemotes=function(e,t){return this._runTask(pe(e===!0),m(arguments))},b.prototype.remote=function(e,t){return this._runTask(he(p(arguments)),m(arguments))},b.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(y(n),m(arguments))},b.prototype.updateServerInfo=function(e){return this._runTask(y([`update-server-info`]),m(arguments))},b.prototype.pushTags=function(e,t){let n=de({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},b.prototype.rm=function(e){return this._runTask(y([`rm`,`-f`,...s(e)]),m(arguments))},b.prototype.rmKeepLocal=function(e){return this._runTask(y([`rm`,`--cached`,...s(e)]),m(arguments))},b.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},b.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},b.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`?v(r):y(r);return this._runTask(a,n)},b.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`):y([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},b.prototype.diffSummary=function(){return this._runTask(ce(p(arguments,1)),m(arguments))},b.prototype.applyPatch=function(e){let t=d(e)?te(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},b.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(y(e,!0),m(arguments))},b.prototype.clean=function(e,t,n){let r=se(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,r?1:0));return this._runTask(oe(i,a),m(arguments))},b.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},b.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.`)))},b.prototype.checkIgnore=function(e,t){return this._runTask(ie(s(f(e,d,[]))),m(arguments))},b.prototype.checkIsRepo=function(e,t){return this._runTask(ae(f(e,u)),m(arguments))},t.exports=b}});E();var us=class extends T{constructor(e,t){super(void 0,t),this.config=e}};E(),E();var $=class extends T{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};O(),Xe(),Ut(),gn(),kn(),Nn(),Vn(),Jn();function ds(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new $(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new $(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function fs(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Be(t,n))if(e[r.category]!==!0)throw new $(void 0,`unsafe`,r.message);return t}}}q();function ps(e){let t=F(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}q();var ms=(0,x.deferred)().promise;function hs({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,x.deferred)(),closeTimeout:(0,x.deferred)(),exit:(0,x.deferred)(),exitTimeout:(0,x.deferred)()},a=Promise.race([e===!1?ms:i.closeTimeout.promise,t===!1?ms:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>ct(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await ct(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}q();var gs=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,_s=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function vs(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ys(e,t){if(e.length<1||e.length>2)throw new $(void 0,`binary`,gs);if(e.some(vs))if(t)console.warn(_s);else throw new $(void 0,`binary`,_s);let[n,r]=e;return{binary:n,prefix:r}}function bs(e,t=[`git`],n=!1){let r=ys(M(t),n);e.on(`binary`,e=>{r=ys(M(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}E();function xs(e){return!!(e.exitCode&&e.stdErr.length)}function Ss(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Cs(e=!1,t=xs,n=Ss){return(r,i)=>!e&&r||!t(i)?r:n(i)}function ws(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new T(void 0,r.toString(`utf-8`))}:{error:r}}}}q();var Ts=class{constructor(){this.plugins=new Set,this.events=new o}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=j(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return M(e).forEach(e=>e&&this.plugins.add(j(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};q();function Es(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?it(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:Ds(n[1]),progress:P(n[2]),processed:P(n[3]),total:P(n[4])})})}}]}function Ds(e){return String(e.toLowerCase().split(` `,1))||`unknown`}q();function Os(e){let t=st(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function ks({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new $(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function As(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(h(i)){r(g(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>h(e)&&g(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}q();var js=ls();function Ms(e,t){let n=new Ts,r=Tt(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!rt(r.baseDir))throw new us(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(ps(r.config)),n.add(fs(r.unsafe)),n.add(hs(r.completion)),r.abort&&n.add(ds(r.abort)),r.progress&&n.add(Es(r.progress)),r.timeout&&n.add(ks(r.timeout)),r.spawnOptions&&n.add(Os(r.spawnOptions)),n.add(As()),n.add(ws(Cs(!0))),r.errors&&n.add(ws(r.errors)),bs(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new js(r,n)}O();var Ns=Ms,Ps=Ms;const Fs=new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};function Is(e){return Fs.enqueue(e)}const Ls=[`HOME`,`USERPROFILE`,`HOMEDRIVE`,`HOMEPATH`,`APPDATA`,`LOCALAPPDATA`,`ProgramData`,`ALLUSERSPROFILE`,`SystemRoot`,`WINDIR`,`windir`,`ComSpec`,`TEMP`,`TMP`,`USERNAME`,`USERDOMAIN`,`PATHEXT`,`SSH_AUTH_SOCK`,`ELECTRON_RUN_AS_NODE`];function Rs(e){let t={LANG:`C`,LC_ALL:`C`,GIT_TERMINAL_PROMPT:`0`},n=process.env.PATH??process.env.Path;n!==void 0&&(t.PATH=n);for(let e of Ls){let n=process.env[e];n!==void 0&&(t[e]=n)}return e&&(t.OK_GH_TOKEN=e.token,t.OK_GH_TOKEN_HOST=e.host),t}function zs(e,t){let n={...e.env};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return e.git.env(n)}function Bs(e,t={}){let{credentialArgs:n=[],gitIndexFile:r,ghToken:a,timeoutMs:o}=t,s=Rs(a);return r&&(s.GIT_INDEX_FILE=i(e,r)),{git:Ps({baseDir:e,config:[`commit.gpgsign=false`,`core.autocrlf=false`,...n.length>=2?[n[1]]:[]],unsafe:{allowUnsafeCredentialHelper:!0},...o===void 0?{}:{timeout:{block:o}}}).env(s),projectDir:e,credentialArgs:n,env:s}}export{Ns as a,Ps as i,Bs as n,p as o,Is as r,zs as t};
|
|
10
|
-
//# sourceMappingURL=git-handle-
|
|
9
|
+
`).map($o).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return Zo(es(n[0]),es(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=Qo(es(n[e]),es(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ts(n,r)}}}),is={};C(is,{addAnnotatedTagTask:()=>ss,addTagTask:()=>os,tagListTask:()=>as});function as(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return ns(e,t)}}}function os(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ss(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var cs=S({"src/lib/tasks/tag.ts"(){rs()}}),ls=qe({"src/git.js"(e,t){var{GitExecutor:n}=(cr(),w(or)),{SimpleGitApi:r}=(Aa(),w(Oa)),{Scheduler:i}=(Pa(),w(ja)),{adhocExecTask:a,configurationErrorTask:o}=(X(),w(Xt)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:ee}=(q(),w(Pt)),{applyPatchTask:te}=(La(),w(Fa)),{branchTask:ne,branchLocalTask:h,deleteBranchesTask:g,deleteBranchTask:re}=(so(),w(to)),{checkIgnoreTask:ie}=(mo(),w(fo)),{checkIsRepoTask:ae}=(Ut(),w(Ft)),{cleanWithOptionsTask:oe,isCleanOptionsArray:se}=(gn(),w(nn)),{diffSummaryTask:ce}=(li(),w(oi)),{fetchTask:le}=(xo(),w(vo)),{moveTask:_}=(Do(),w(To)),{pullTask:ue}=(Ao(),w(Oo)),{pushTagsTask:de}=(ea(),w(Zi)),{addRemoteTask:fe,getRemotesTask:pe,listRemotesTask:me,remoteTask:he,removeRemoteTask:ge}=(Vo(),w(Fo)),{getResetMode:_e,resetTask:ve}=(Jn(),w(Hn)),{stashListTask:ye}=(Wo(),w(Ho)),{addSubModuleTask:be,initSubModuleTask:xe,subModuleTask:Se,updateSubModuleTask:Ce}=(Xo(),w(Go)),{addAnnotatedTagTask:we,addTagTask:Te,tagListTask:Ee}=(cs(),w(is)),{straightThroughBufferTask:v,straightThroughStringTask:y}=(X(),w(Xt));function b(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(b.prototype=Object.create(r.prototype)).constructor=b,b.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},b.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},b.prototype.stashList=function(e){return this._runTask(ye(ee(arguments)||{},c(e)&&e||[]),m(arguments))},b.prototype.mv=function(e,t){return this._runTask(_(e,t),m(arguments))},b.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},b.prototype.pull=function(e,t,n,r){return this._runTask(ue(f(e,u),f(t,u),p(arguments)),m(arguments))},b.prototype.fetch=function(e,t){return this._runTask(le(f(e,u),f(t,u),p(arguments)),m(arguments))},b.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.")))},b.prototype.tags=function(e,t){return this._runTask(Ee(p(arguments)),m(arguments))},b.prototype.rebase=function(){return this._runTask(y([`rebase`,...p(arguments)]),m(arguments))},b.prototype.reset=function(e){return this._runTask(ve(_e(e),p(arguments)),m(arguments))},b.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(y([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},b.prototype.addTag=function(e){let t=typeof e==`string`?Te(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},b.prototype.addAnnotatedTag=function(e,t){return this._runTask(we(e,t),m(arguments))},b.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(re(e,typeof t==`boolean`?t:!1),m(arguments))},b.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(g(e,typeof t==`boolean`?t:!1),m(arguments))},b.prototype.branch=function(e,t){return this._runTask(ne(p(arguments)),m(arguments))},b.prototype.branchLocal=function(e){return this._runTask(h(),m(arguments))},b.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(y(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},b.prototype.submoduleAdd=function(e,t,n){return this._runTask(be(e,t),m(arguments))},b.prototype.submoduleUpdate=function(e,t){return this._runTask(Ce(p(arguments,!0)),m(arguments))},b.prototype.submoduleInit=function(e,t){return this._runTask(xe(p(arguments,!0)),m(arguments))},b.prototype.subModule=function(e,t){return this._runTask(Se(p(arguments)),m(arguments))},b.prototype.listRemote=function(){return this._runTask(me(p(arguments)),m(arguments))},b.prototype.addRemote=function(e,t,n){return this._runTask(fe(e,t,p(arguments)),m(arguments))},b.prototype.removeRemote=function(e,t){return this._runTask(ge(e),m(arguments))},b.prototype.getRemotes=function(e,t){return this._runTask(pe(e===!0),m(arguments))},b.prototype.remote=function(e,t){return this._runTask(he(p(arguments)),m(arguments))},b.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(y(n),m(arguments))},b.prototype.updateServerInfo=function(e){return this._runTask(y([`update-server-info`]),m(arguments))},b.prototype.pushTags=function(e,t){let n=de({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},b.prototype.rm=function(e){return this._runTask(y([`rm`,`-f`,...s(e)]),m(arguments))},b.prototype.rmKeepLocal=function(e){return this._runTask(y([`rm`,`--cached`,...s(e)]),m(arguments))},b.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},b.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},b.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`?v(r):y(r);return this._runTask(a,n)},b.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`):y([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},b.prototype.diffSummary=function(){return this._runTask(ce(p(arguments,1)),m(arguments))},b.prototype.applyPatch=function(e){let t=d(e)?te(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},b.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(y(e,!0),m(arguments))},b.prototype.clean=function(e,t,n){let r=se(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,r?1:0));return this._runTask(oe(i,a),m(arguments))},b.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},b.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.`)))},b.prototype.checkIgnore=function(e,t){return this._runTask(ie(s(f(e,d,[]))),m(arguments))},b.prototype.checkIsRepo=function(e,t){return this._runTask(ae(f(e,u)),m(arguments))},t.exports=b}});E();var us=class extends T{constructor(e,t){super(void 0,t),this.config=e}};E(),E();var $=class extends T{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};O(),Xe(),Ut(),gn(),kn(),Nn(),Vn(),Jn();function ds(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new $(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new $(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function fs(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Be(t,n))if(e[r.category]!==!0)throw new $(void 0,`unsafe`,r.message);return t}}}q();function ps(e){let t=F(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}q();var ms=(0,x.deferred)().promise;function hs({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,x.deferred)(),closeTimeout:(0,x.deferred)(),exit:(0,x.deferred)(),exitTimeout:(0,x.deferred)()},a=Promise.race([e===!1?ms:i.closeTimeout.promise,t===!1?ms:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>ct(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await ct(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}q();var gs=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,_s=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function vs(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ys(e,t){if(e.length<1||e.length>2)throw new $(void 0,`binary`,gs);if(e.some(vs))if(t)console.warn(_s);else throw new $(void 0,`binary`,_s);let[n,r]=e;return{binary:n,prefix:r}}function bs(e,t=[`git`],n=!1){let r=ys(M(t),n);e.on(`binary`,e=>{r=ys(M(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}E();function xs(e){return!!(e.exitCode&&e.stdErr.length)}function Ss(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Cs(e=!1,t=xs,n=Ss){return(r,i)=>!e&&r||!t(i)?r:n(i)}function ws(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new T(void 0,r.toString(`utf-8`))}:{error:r}}}}q();var Ts=class{constructor(){this.plugins=new Set,this.events=new o}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=j(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return M(e).forEach(e=>e&&this.plugins.add(j(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};q();function Es(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?it(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:Ds(n[1]),progress:P(n[2]),processed:P(n[3]),total:P(n[4])})})}}]}function Ds(e){return String(e.toLowerCase().split(` `,1))||`unknown`}q();function Os(e){let t=st(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function ks({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new $(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function As(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(h(i)){r(g(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>h(e)&&g(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}q();var js=ls();function Ms(e,t){let n=new Ts,r=Tt(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!rt(r.baseDir))throw new us(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(ps(r.config)),n.add(fs(r.unsafe)),n.add(hs(r.completion)),r.abort&&n.add(ds(r.abort)),r.progress&&n.add(Es(r.progress)),r.timeout&&n.add(ks(r.timeout)),r.spawnOptions&&n.add(Os(r.spawnOptions)),n.add(As()),n.add(ws(Cs(!0))),r.errors&&n.add(ws(r.errors)),bs(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new js(r,n)}O();var Ns=Ms,Ps=Ms;const Fs=new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};function Is(e){return Fs.enqueue(e)}const Ls=[`HOME`,`USERPROFILE`,`HOMEDRIVE`,`HOMEPATH`,`APPDATA`,`LOCALAPPDATA`,`ProgramData`,`ALLUSERSPROFILE`,`SystemRoot`,`WINDIR`,`windir`,`ComSpec`,`TEMP`,`TMP`,`USERNAME`,`USERDOMAIN`,`PATHEXT`,`SSH_AUTH_SOCK`,`ELECTRON_RUN_AS_NODE`];function Rs(e){let t={LANG:`C`,LC_ALL:`C`,GIT_TERMINAL_PROMPT:`0`,GIT_MERGE_AUTOEDIT:`no`},n=process.env.PATH??process.env.Path;n!==void 0&&(t.PATH=n);for(let e of Ls){let n=process.env[e];n!==void 0&&(t[e]=n)}return e&&(t.OK_GH_TOKEN=e.token,t.OK_GH_TOKEN_HOST=e.host),t}function zs(e,t){let n={...e.env};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return e.git.env(n)}function Bs(e,t={}){let{credentialArgs:n=[],gitIndexFile:r,ghToken:a,timeoutMs:o}=t,s=Rs(a);return r&&(s.GIT_INDEX_FILE=i(e,r)),{git:Ps({baseDir:e,config:[`commit.gpgsign=false`,`core.autocrlf=false`,...n.length>=2?[n[1]]:[]],unsafe:{allowUnsafeCredentialHelper:!0},...o===void 0?{}:{timeout:{block:o}}}).env(s),projectDir:e,credentialArgs:n,env:s}}export{Ns as a,Ps as i,Bs as n,p as o,Is as r,zs as t};
|
|
10
|
+
//# sourceMappingURL=git-handle-XXj9bu6B-B4fXubq8.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./gh-detect-RYp8nY6_.mjs";import{B as r,H as i,I as a,L as o,O as s,R as c,S as l,T as u,V as d,a as f,d as p,f as m,g as h,i as g,n as _,w as v,z as y}from"./init-
|
|
1
|
+
import{i as e,r as t,t as n}from"./gh-detect-RYp8nY6_.mjs";import{B as r,H as i,I as a,L as o,O as s,R as c,S as l,T as u,V as d,a as f,d as p,f as m,g as h,i as g,n as _,w as v,z as y}from"./init-_gsMrA9E.mjs";import{_ as b,b as x,d as S,f as C,i as w,l as T,m as E,n as D,r as O,t as k,u as A,v as j,y as M}from"./src-C4Asr6cU.mjs";import{_ as N,a as P,d as F,f as I,g as L,i as R,o as z,r as B,s as V,t as H,u as U,v as W}from"./write-project-skill-CpL-pVrC.mjs";import{n as G}from"./loader-BIDmV6nB.mjs";import{n as K}from"./preview-C5qa70B1.mjs";import{n as q,t as J}from"./mcp-migrate-event-D0NrGjvc.mjs";export{V as ALL_EDITOR_IDS,U as EDITOR_LABELS,F as EDITOR_TARGETS,I as HOSTS_WITH_USER_SKILL_DIR,_ as LAUNCH_CONFIG_NAME,g as LAUNCH_UI_CHAIN_SENTINEL,f as LAUNCH_UI_CHAIN_V1,A as PATH_SHIM_BEGIN,S as PATH_SHIM_BLOCK_RE,C as PATH_SHIM_END,a as addOkPathsToGitExclude,H as assertProjectPathSafe,L as buildManagedServerEntry,O as buildMcpConfigDeclineEvent,J as buildMcpConfigMigrateEvent,p as classifyExistingMcpEntry,t as createTokenStore,n as detectGh,m as detectInstalledEditors,o as formatTrackedRemediation,c as getExcludedOkPaths,y as getOkArtifactPaths,N as isEntryUpToDate,W as isOwnManagedEntry,G as loadConfig,e as makeLazyProbeTokenStore,b as parseGitHubBlobUrl,j as parseGitHubShareUrl,M as parseGitHubTreeUrl,x as parseGitUrl,E as pathInstallMarkerPath,K as previewContent,r as probeTrackedOkPaths,h as readExistingMcpEntry,d as readSharingMode,i as removeOkPathsFromGitExclude,T as removeOwnMcpEntry,B as removeProjectSkill,P as removeUserGlobalSkillBundle,s as resolveProjectRoot,w as runStop,l as scaffoldLaunchJson,q as truncatePriorEntry,z as userGlobalSkillBundleTargets,D as validateLocalFolderForShare,v as writeEditorMcpConfig,k as writeProjectAiIntegrations,R as writeProjectSkill,u as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as e}from"./init-_gsMrA9E.mjs";export{e as runInit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Ba as r,Bt as i,Et as a,Va as o,Xi as s,bi as c,bn as l,ja as u,mt as d}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{$n as f,D as p,Gn as m,K as h,O as g,Qn as _,Zn as v,aa as y,cr as b,d as x,ga as S,ia as C,ir as w,ta as T,ut as E,vn as ee,wa as D,ya as O}from"./dist-AMcKbNor.mjs";import{r as k,t as te}from"./esm-CsQUg9js.mjs";import{t as ne}from"./constants-Br0O5zjA.mjs";import{a as re,b as ie,d as A,g as ae,h as oe,i as se,m as ce,p as le,s as ue,t as j,x as M}from"./write-project-skill-Dw9Did_1.mjs";import{t as N}from"./is-object-Cg453afR.mjs";import{i as P,n as de,o as F,r as fe,s as I,t as L}from"./colors-8SzMRIVy.mjs";import{t as pe}from"./preview-CVMx2nNA.mjs";import{createRequire as me}from"node:module";import{execFileSync as he}from"node:child_process";import ge,{dirname as R,isAbsolute as _e,join as z,relative as B,resolve as ve,sep as ye}from"node:path";import V from"node:process";import{fileURLToPath as be}from"node:url";import{homedir as xe}from"node:os";import{existsSync as H,lstatSync as Se,mkdirSync as Ce,readFileSync as U,readlinkSync as we,realpathSync as Te,statSync as Ee,writeFileSync as De}from"node:fs";import{randomUUID as Oe}from"node:crypto";import{inspect as ke,stripVTControlCharacters as Ae,styleText as W}from"node:util";import{AsyncLocalStorage as je,AsyncResource as Me}from"node:async_hooks";import{createServer as Ne,request as Pe}from"node:http";import*as Fe from"node:readline";import{connect as Ie}from"node:net";const Le=new Set([`emacs`,`vim`]);function Re(e){return Le.has(e)}function ze(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Re))):[]}const Be=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ve=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,He=e=>e.name===`space`,Ue=e=>e.name===`backspace`,We=e=>`1234567890`.includes(e.name),Ge=e=>e.name===`enter`||e.name===`return`;var Ke=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},qe=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Je=class extends Error{name=`ExitPromptError`},Ye=class extends Error{name=`HookError`},Xe=class extends Error{name=`ValidationError`};const Ze=new je;function Qe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function $e(e,t){let n=Qe(e);return Ze.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function G(){let e=Ze.getStore();if(!e)throw new Ye(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function et(){return G().rl}function tt(e){return Me.bind((...t)=>{let n=G(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function nt(e){let t=G(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function rt(){G().handleChange()}const it={queue(e){let t=G(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(et());if(r!=null&&typeof r!=`function`)throw new Xe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=G();tt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=G();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function at(e){return typeof e==`function`}function K(e){return nt(t=>{let n=Me.bind(function(e){t.get()!==e&&(t.set(e),rt())});if(t.initialized)return[t.get(),n];let r=at(e)?e():e;return t.set(r),[r,n]})}function ot(e,t){nt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&it.queue(e),n.set(t)})}function st(){return V.platform.startsWith(`win`)?!!V.env.CI||!!V.env.WT_SESSION||!!V.env.TERMINUS_SUBLIME||V.env.ConEmuTask===`{cmd::Cmder}`||V.env.TERM_PROGRAM===`Terminus-Sublime`||V.env.TERM_PROGRAM===`vscode`||V.env.TERM===`xterm-256color`||V.env.TERM===`alacritty`||V.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:V.env.TERM!==`linux`}const ct={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},lt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ut={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},dt={...ct,...lt},ft={...ct,...ut},q=st()?dt:ft;Object.entries(lt);const pt={prefix:{idle:W(`blue`,`?`),done:W(`green`,q.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>W(`yellow`,e))},keybindings:[],style:{answer:e=>W(`cyan`,e),message:e=>W(`bold`,e),error:e=>W(`red`,`> ${e}`),defaultAnswer:e=>W(`dim`,`(${e})`),help:e=>W(`dim`,e),highlight:e=>W(`cyan`,e),key:e=>W(`cyan`,W(`bold`,`<${e}>`))}};function mt(){return{...pt,keybindings:ze()}}function ht(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function gt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ht(n)&&ht(r)?gt(n,r):r}return t}function _t(...e){return gt(mt(),...e.filter(e=>e!=null))}function vt({status:e=`idle`,theme:t}){let[n,r]=K(!1),[i,a]=K(0),{prefix:o,spinner:s}=_t(t);return ot(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function yt(e,t){return nt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function bt(e){return K({current:e})[0]}function xt(e){let t=bt(e);t.current=e,ot(e=>{let n=!1,r=tt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var St=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Ct=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),wt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Tt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Et=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ot=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,kt=/\t{1,1000}/y,At=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,jt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Mt=/\p{M}+/gu,Nt={limit:1/0,ellipsis:``},Pt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Pt(i,Nt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[jt,l],[Et,0],[Dt,o],[kt,s],[At,c],[Ot,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Mt,``)){let t=e.codePointAt(0)||0;if(S=wt(t)?2:Tt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Ot?Ct(e.slice(p,n.lastIndex)):n===At?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Ft={limit:1/0,ellipsis:``,ellipsisWidth:0},J=(e,t={})=>Pt(e,Ft,t).width,It=`]8;;`,Lt=RegExp(`(?:\\[(?<code>\\d+)m|\\${It}(?<uri>.*))`,`y`),Rt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},zt=e=>`[${e}m`,Bt=e=>`${It}${e}`,Vt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:J(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=J(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(It,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ht=e=>{let t=e.split(` `),n=t.length;for(;n&&!J(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ut=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=J(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=J(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Vt(s,r,t),c=J(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Vt(s,r,t),c=J(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Vt(s,r,t),c=J(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ht(e)));let l=s.join(`
|
|
1
|
+
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Ba as r,Bt as i,Et as a,Va as o,Xi as s,bi as c,bn as l,ja as u,mt as d}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{$n as f,D as p,Gn as m,K as h,O as g,Qn as _,Zn as v,aa as y,cr as b,d as x,ga as S,ia as C,ir as w,ta as T,ut as E,vn as ee,wa as D,ya as O}from"./dist-C5-CAALs.mjs";import{r as k,t as te}from"./esm-CsQUg9js.mjs";import{t as ne}from"./constants-KGjHbPVT.mjs";import{a as re,b as ie,d as A,g as ae,h as oe,i as se,m as ce,p as le,s as ue,t as j,x as M}from"./write-project-skill-CpL-pVrC.mjs";import{t as N}from"./is-object-Cg453afR.mjs";import{i as P,n as de,o as F,r as fe,s as I,t as L}from"./colors-8SzMRIVy.mjs";import{t as pe}from"./preview-C5qa70B1.mjs";import{createRequire as me}from"node:module";import{execFileSync as he}from"node:child_process";import ge,{dirname as R,isAbsolute as _e,join as z,relative as B,resolve as ve,sep as ye}from"node:path";import V from"node:process";import{fileURLToPath as be}from"node:url";import{homedir as xe}from"node:os";import{existsSync as H,lstatSync as Se,mkdirSync as Ce,readFileSync as U,readlinkSync as we,realpathSync as Te,statSync as Ee,writeFileSync as De}from"node:fs";import{randomUUID as Oe}from"node:crypto";import{inspect as ke,stripVTControlCharacters as Ae,styleText as W}from"node:util";import{AsyncLocalStorage as je,AsyncResource as Me}from"node:async_hooks";import{createServer as Ne,request as Pe}from"node:http";import*as Fe from"node:readline";import{connect as Ie}from"node:net";const Le=new Set([`emacs`,`vim`]);function Re(e){return Le.has(e)}function ze(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Re))):[]}const Be=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Ve=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,He=e=>e.name===`space`,Ue=e=>e.name===`backspace`,We=e=>`1234567890`.includes(e.name),Ge=e=>e.name===`enter`||e.name===`return`;var Ke=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},qe=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Je=class extends Error{name=`ExitPromptError`},Ye=class extends Error{name=`HookError`},Xe=class extends Error{name=`ValidationError`};const Ze=new je;function Qe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function $e(e,t){let n=Qe(e);return Ze.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function G(){let e=Ze.getStore();if(!e)throw new Ye(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function et(){return G().rl}function tt(e){return Me.bind((...t)=>{let n=G(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function nt(e){let t=G(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function rt(){G().handleChange()}const it={queue(e){let t=G(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(et());if(r!=null&&typeof r!=`function`)throw new Xe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=G();tt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=G();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function at(e){return typeof e==`function`}function K(e){return nt(t=>{let n=Me.bind(function(e){t.get()!==e&&(t.set(e),rt())});if(t.initialized)return[t.get(),n];let r=at(e)?e():e;return t.set(r),[r,n]})}function ot(e,t){nt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&it.queue(e),n.set(t)})}function st(){return V.platform.startsWith(`win`)?!!V.env.CI||!!V.env.WT_SESSION||!!V.env.TERMINUS_SUBLIME||V.env.ConEmuTask===`{cmd::Cmder}`||V.env.TERM_PROGRAM===`Terminus-Sublime`||V.env.TERM_PROGRAM===`vscode`||V.env.TERM===`xterm-256color`||V.env.TERM===`alacritty`||V.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:V.env.TERM!==`linux`}const ct={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},lt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ut={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},dt={...ct,...lt},ft={...ct,...ut},q=st()?dt:ft;Object.entries(lt);const pt={prefix:{idle:W(`blue`,`?`),done:W(`green`,q.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>W(`yellow`,e))},keybindings:[],style:{answer:e=>W(`cyan`,e),message:e=>W(`bold`,e),error:e=>W(`red`,`> ${e}`),defaultAnswer:e=>W(`dim`,`(${e})`),help:e=>W(`dim`,e),highlight:e=>W(`cyan`,e),key:e=>W(`cyan`,W(`bold`,`<${e}>`))}};function mt(){return{...pt,keybindings:ze()}}function ht(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function gt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ht(n)&&ht(r)?gt(n,r):r}return t}function _t(...e){return gt(mt(),...e.filter(e=>e!=null))}function vt({status:e=`idle`,theme:t}){let[n,r]=K(!1),[i,a]=K(0),{prefix:o,spinner:s}=_t(t);return ot(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function yt(e,t){return nt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function bt(e){return K({current:e})[0]}function xt(e){let t=bt(e);t.current=e,ot(e=>{let n=!1,r=tt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var St=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Ct=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),wt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Tt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Et=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ot=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,kt=/\t{1,1000}/y,At=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,jt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Mt=/\p{M}+/gu,Nt={limit:1/0,ellipsis:``},Pt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Pt(i,Nt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[jt,l],[Et,0],[Dt,o],[kt,s],[At,c],[Ot,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Mt,``)){let t=e.codePointAt(0)||0;if(S=wt(t)?2:Tt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Ot?Ct(e.slice(p,n.lastIndex)):n===At?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Ft={limit:1/0,ellipsis:``,ellipsisWidth:0},J=(e,t={})=>Pt(e,Ft,t).width,It=`]8;;`,Lt=RegExp(`(?:\\[(?<code>\\d+)m|\\${It}(?<uri>.*))`,`y`),Rt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},zt=e=>`[${e}m`,Bt=e=>`${It}${e}`,Vt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:J(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=J(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(It,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ht=e=>{let t=e.split(` `),n=t.length;for(;n&&!J(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ut=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=J(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=J(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Vt(s,r,t),c=J(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Vt(s,r,t),c=J(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Vt(s,r,t),c=J(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ht(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){Lt.lastIndex=e+1;let t=Lt.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=Bt(``));let e=i?Rt(i):void 0;i&&e&&(r+=zt(e))}else t===`
|
|
4
4
|
`&&(i&&Rt(i)&&(r+=zt(i)),a&&(r+=Bt(a)))}return r},Wt=/\r?\n/;function Gt(e,t,n){return String(e).normalize().split(Wt).map(e=>Ut(e,t,n)).join(`
|
|
@@ -632,7 +632,7 @@ export default function okBridge(pi: {
|
|
|
632
632
|
});
|
|
633
633
|
}
|
|
634
634
|
`}function xi(e,t){let n=B(t,e);return n.length>0&&!n.startsWith(`..`)&&!_e(n)}const Si=e=>{try{let t=he(`git`,[`rev-parse`,`--show-toplevel`],T({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function Ci(e,t={}){let n=t.homeDir??xe(),r=t.gitTopLevel??Si,i=ve(e),a;try{a=Te(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(b(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=R(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&xi(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function wi(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function $(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const Ti=[`native`,`index.js`];function Ei(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??me(t);try{return n(z(R(be(t)),...Ti))}catch(e){wi(e)||$(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return wi(e)||$(`workspace addon failed to load`,e),null}}function Di(){let e=Ei();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function Oi(e){let t=e,n=new Set;for(;;){let r;try{r=Se(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=we(t)}catch(t){return $(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=_e(i)?i:z(R(t),i)}}let ki;function Ai(){return ki===void 0&&(ki=Di()),ki}function ji(e,t=Ai){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){$(`resolveSymlinkWritePath threw`,e)}return Oi(e)}function Mi(){let e=Ei();return e&&typeof e.parseTomlToJson==`function`?e:null}function Ni(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return $(`addon loaded but probe failed`,e),!1}}function Pi(e){if(!N(e))throw Error(`TOML root is not a table`);return e}function Fi(e){return{backend:`native`,parseToObject(t){return Pi(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function Ii(){return{backend:`fallback`,parseToObject(e){return Pi(ai(e))}}}function Li(e=Mi){let t=e();return t&&Ni(t)?Fi(t):Ii()}let Ri=null;function zi(){return Ri===null&&(Ri=Li()),Ri}function Bi(e,t,n,r,i){let a=`urn:uuid:${Oe()}`;if(e.headersSent||e.writableEnded||e.destroyed){console.error(`[ok ui] emitProblem called after headers sent — suppressed`,{type:n,status:t,instance:a});return}let o={type:n,title:r,status:t,instance:a,...i===void 0?{}:{detail:i}},s=l.safeParse(o);if(!s.success){console.error(`[ok ui] emitProblem produced an invalid ProblemDetails body:`,{issues:s.error.issues,originalStatus:t,body:o}),e.writeHead(500,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify({type:`urn:ok:error:internal-server-error`,title:`Internal server error.`,status:500,instance:a}));return}e.writeHead(t,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify(o))}const Vi=1e4;function Hi(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!w(n))return Bi(t,403,`urn:ok:error:loopback-required`,`Request must originate from a loopback address.`),!0;if(!f(e.headers.host))return Bi(t,403,`urn:ok:error:host-not-allowed`,`Host header is not in the loopback allowlist.`),!0;let r=e.headers.origin;return r!==void 0&&!_(r)?(Bi(t,403,`urn:ok:error:invalid-origin`,`Origin header is not in the loopback allowlist.`),!0):!1}const Ui=3e4;function Wi(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!w(n)||!f(e.headers.host))return t.destroy(),!0;let r=e.headers.origin;return typeof r==`string`&&!_(r)?(t.destroy(),!0):!1}function Gi(e,t,n,r,i,a){a.add(t),t.once(`close`,()=>a.delete(t));let o=Ie({host:r,port:i,timeout:Vi});a.add(o),o.once(`close`,()=>a.delete(o));let s=!1,c=n=>{if(!s){if(s=!0,n!==void 0){let t=n.err;console.warn(JSON.stringify({event:n.event,upstreamHost:r,upstreamPort:i,url:e.url,code:t instanceof Error?t.code:void 0,message:t instanceof Error?t.message:void 0}))}try{o.destroy()}catch{}try{t.destroy()}catch{}}};o.once(`connect`,()=>{o.setTimeout(0);let a=[`${e.method??`GET`} ${e.url??`/`} HTTP/1.1`,`host: ${r}:${i}`];for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()!==`host`&&n!==void 0)if(Array.isArray(n))for(let e of n)a.push(`${t}: ${e}`);else a.push(`${t}: ${n}`);try{o.write(`${a.join(`\r
|
|
635
|
-
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ki=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function qi(e){let t=e.upstreamTimeoutMs??Vi,n=new Set,r=Ne((n,r)=>{Hi(n,r)||Yi(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{Wi(t,r)||Gi(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Ji(e,t,n){Yi(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??Vi)}function Yi(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ki)delete a[e];e.setTimeout(Ui,()=>{if(t.headersSent)try{t.end()}catch{}else try{Bi(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Ui/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=Pe({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ki)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)Bi(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)Bi(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Xi=39847,Zi=39848;async function Qi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function $i(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:i}=await import(`node:path`),{acquireUiLock:a,clearArmedPaneTarget:s,createAssetServeMiddleware:l,createContentFilter:f,readArmedPaneTarget:p,readServerLock:m,releaseUiLock:h,updateUiLockPort:g}=await import(`./dist-B3w6eOOV.mjs`),{default:_}=await import(`./build-gfyDk62R.mjs`),{resolveContentDir:v,resolveLockDir:y}=await import(`./dist-B3w6eOOV.mjs`),b=v(e.config,e.cwd),x=y(e.cwd);a(x,{port:0,worktreeRoot:e.cwd});let S=import.meta.dirname??new URL(`.`,import.meta.url).pathname,C=[i(S,`public`),i(S,`../../app/dist`),i(S,`../../../app/dist`)],w=e.assetDir??C.find(e=>t(e)),T=w?_(w,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,E=t(b)?l({contentFilter:f({projectDir:e.cwd,contentDir:b}),contentSirv:_(b,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:o,assetExtensions:u,blocklistExtensions:r}):null,ee=e.port,D=null,O=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=p(x);if(e&&!/[\r\n]/.test(e)){s(x),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Hi(e,t))){if(n===`/api/config`&&e.method===`DELETE`){s(x),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){D?.();let n=m(x),r=e.headers.host??`localhost:${ee}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=p(x),o=JSON.stringify({collabUrl:i,previewUrl:null,port:ee,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){D?.();let r=m(x);if(!r||r.port<=0){Bi(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Ji(e,t,{upstreamHost:d,upstreamPort:r.port});return}if(T&&n?.startsWith(`/assets/`)){T(e,t,()=>{E?E(e,t,()=>ea(t)):ea(t)});return}if(E){E(e,t,()=>{T?T(e,t):ea(t)});return}if(T){T(e,t);return}ea(t)}},k=new Set,te=(e,t,n)=>{if(Wi(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=m(x);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Gi(e,t,n,d,i.port,k)},ne=()=>{for(let e of k)try{e.destroy()}catch{}k.clear()},re=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],ie=[],A=e.port,ae=e=>e instanceof Error&&e.code===`EADDRINUSE`,oe=async()=>{await Promise.all(ie.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},se=async e=>{A=e;for(let e of re){let t=n(O);t.on(`upgrade`,te),ie.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(A,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(A=e.port),n()})})}};try{try{await se(e.port)}catch(t){if(e.fallbackToKernel===!0&&ae(t))await oe(),await se(0);else throw t}}catch(e){await oe();try{h(x)}catch{}throw e}let ce=A;ee=ce,g(x,ce);let le=e.scheduler??c,ue=e.safetyNetMs??432e5,j=null,M=!1,N=!1,P=()=>{M||(M=!0,j!==null&&(le.clearTimeout(j),j=null))},de=()=>{if(P(),!N){N=!0;try{h(x)}catch{}}},F=()=>{M||ue<=0||(j!==null&&(le.clearTimeout(j),j=null),j=le.setTimeout(()=>{j=null,console.warn(`[ui] safety-net (${ue}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}ne();for(let e of ie)try{e.close()}catch{}de()},ue))},fe=()=>{M||ue<=0||F()};return D=fe,F(),{httpServers:ie,port:ce,release:de,detachSafetyNet:P,nudgeSafetyNet:fe,drainUpgradeSockets:ne}}function ea(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function ta(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Xi,fallbackToKernel:!0}}async function na(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-B3w6eOOV.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await qi({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function ra(e){return new te(`ui`).description(`Serve the OpenKnowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Xi}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-CmkIIbww.mjs`),{UiLockCollisionError:r}=await import(`./dist-B3w6eOOV.mjs`),{resolveLockDir:i}=await import(`./dist-B3w6eOOV.mjs`),a=e(),o=t.host,s;try{s=ta(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await $i({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Qi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await na({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),ia(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function ia(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}const aa={allowTrailingComma:!0,disallowComments:!1};function oa(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function sa(e){let t=[],n=mr(e,t,aa);return t.some(t=>!oa(t,e))||!n||n.type!==`object`?null:n}function ca(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&hr(e)===t&&(n+=1)}return n}function la(e,t){S(e,`${JSON.stringify(t,null,2)}\n`)}function ua(e,t){let n=hi(t);S(e,n.endsWith(`
|
|
635
|
+
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ki=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function qi(e){let t=e.upstreamTimeoutMs??Vi,n=new Set,r=Ne((n,r)=>{Hi(n,r)||Yi(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{Wi(t,r)||Gi(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Ji(e,t,n){Yi(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??Vi)}function Yi(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ki)delete a[e];e.setTimeout(Ui,()=>{if(t.headersSent)try{t.end()}catch{}else try{Bi(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Ui/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=Pe({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ki)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)Bi(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)Bi(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Xi=39847,Zi=39848;async function Qi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function $i(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:i}=await import(`node:path`),{acquireUiLock:a,clearArmedPaneTarget:s,createAssetServeMiddleware:l,createContentFilter:f,readArmedPaneTarget:p,readServerLock:m,releaseUiLock:h,updateUiLockPort:g}=await import(`./dist-Dovb2Y8A.mjs`),{default:_}=await import(`./build-gfyDk62R.mjs`),{resolveContentDir:v,resolveLockDir:y}=await import(`./dist-Dovb2Y8A.mjs`),b=v(e.config,e.cwd),x=y(e.cwd);a(x,{port:0,worktreeRoot:e.cwd});let S=import.meta.dirname??new URL(`.`,import.meta.url).pathname,C=[i(S,`public`),i(S,`../../app/dist`),i(S,`../../../app/dist`)],w=e.assetDir??C.find(e=>t(e)),T=w?_(w,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,E=t(b)?l({contentFilter:f({projectDir:e.cwd,contentDir:b}),contentSirv:_(b,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:o,assetExtensions:u,blocklistExtensions:r}):null,ee=e.port,D=null,O=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=p(x);if(e&&!/[\r\n]/.test(e)){s(x),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Hi(e,t))){if(n===`/api/config`&&e.method===`DELETE`){s(x),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){D?.();let n=m(x),r=e.headers.host??`localhost:${ee}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=p(x),o=JSON.stringify({collabUrl:i,previewUrl:null,port:ee,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){D?.();let r=m(x);if(!r||r.port<=0){Bi(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Ji(e,t,{upstreamHost:d,upstreamPort:r.port});return}if(T&&n?.startsWith(`/assets/`)){T(e,t,()=>{E?E(e,t,()=>ea(t)):ea(t)});return}if(E){E(e,t,()=>{T?T(e,t):ea(t)});return}if(T){T(e,t);return}ea(t)}},k=new Set,te=(e,t,n)=>{if(Wi(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=m(x);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Gi(e,t,n,d,i.port,k)},ne=()=>{for(let e of k)try{e.destroy()}catch{}k.clear()},re=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],ie=[],A=e.port,ae=e=>e instanceof Error&&e.code===`EADDRINUSE`,oe=async()=>{await Promise.all(ie.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},se=async e=>{A=e;for(let e of re){let t=n(O);t.on(`upgrade`,te),ie.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(A,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(A=e.port),n()})})}};try{try{await se(e.port)}catch(t){if(e.fallbackToKernel===!0&&ae(t))await oe(),await se(0);else throw t}}catch(e){await oe();try{h(x)}catch{}throw e}let ce=A;ee=ce,g(x,ce);let le=e.scheduler??c,ue=e.safetyNetMs??432e5,j=null,M=!1,N=!1,P=()=>{M||(M=!0,j!==null&&(le.clearTimeout(j),j=null))},de=()=>{if(P(),!N){N=!0;try{h(x)}catch{}}},F=()=>{M||ue<=0||(j!==null&&(le.clearTimeout(j),j=null),j=le.setTimeout(()=>{j=null,console.warn(`[ui] safety-net (${ue}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}ne();for(let e of ie)try{e.close()}catch{}de()},ue))},fe=()=>{M||ue<=0||F()};return D=fe,F(),{httpServers:ie,port:ce,release:de,detachSafetyNet:P,nudgeSafetyNet:fe,drainUpgradeSockets:ne}}function ea(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function ta(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Xi,fallbackToKernel:!0}}async function na(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-Dovb2Y8A.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await qi({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function ra(e){return new te(`ui`).description(`Serve the OpenKnowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Xi}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-CmkIIbww.mjs`),{UiLockCollisionError:r}=await import(`./dist-Dovb2Y8A.mjs`),{resolveLockDir:i}=await import(`./dist-Dovb2Y8A.mjs`),a=e(),o=t.host,s;try{s=ta(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await $i({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Qi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await na({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),ia(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function ia(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}const aa={allowTrailingComma:!0,disallowComments:!1};function oa(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function sa(e){let t=[],n=mr(e,t,aa);return t.some(t=>!oa(t,e))||!n||n.type!==`object`?null:n}function ca(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&hr(e)===t&&(n+=1)}return n}function la(e,t){S(e,`${JSON.stringify(t,null,2)}\n`)}function ua(e,t){let n=hi(t);S(e,n.endsWith(`
|
|
636
636
|
`)?n:`${n}\n`)}const da=10*1024*1024;function fa(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>fa(e,t[n]));if(N(e)&&N(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&fa(e[n],t[n])):!1}return!1}function pa(e){for(let t of e.split(`
|
|
637
637
|
`)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function ma(e,t,n){return t===void 0?[e,n]:[e,t,n]}function ha(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function ga(e,t,n){let r=e[t];return n===void 0?r:N(r)?r[n]:void 0}function _a(e,t,n,r,i){if(!H(e))return la(e,ha(t,i,n,r)),{kind:`written`};let a;try{a=U(e,`utf-8`)}catch(e){return $(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return la(e,ha(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>da)return{kind:`declined`,reason:`oversize`};let o=sa(a);if(!o)return{kind:`declined`,reason:`unparseable`};if(ca(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=ga(hr(o),t,i),c=N(s)?s[n]:void 0,l=c!==void 0;if(l&&fa(c,r))return{kind:`overwritten`};let u=a.charCodeAt(0)===65279,d=u?a.slice(1):a,f=d.includes(`\r
|
|
638
638
|
`)?`\r
|
|
@@ -685,6 +685,6 @@ UIPORT="\${PORT:-${Zi}}"
|
|
|
685
685
|
unset PORT
|
|
686
686
|
exec node "${ie()}" start --ui-port "$UIPORT"`,i=t.platformName??process.platform,a=t.mode===`dev`?{name:Aa,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,r()],port:Zi,autoPort:!0}:i===`win32`?{name:Aa,runtimeExecutable:`powershell`,runtimeArgs:[`-NoProfile`,`-NonInteractive`,`-Command`,Fa],port:Zi,autoPort:!0}:{name:Aa,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,Na],port:Zi,autoPort:!0};try{if(j(n,e),!H(n))return Ce(R(n),{recursive:!0}),De(n,`${JSON.stringify({version:ka,configurations:[a]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=U(n,`utf-8`).trim(),r=t?JSON.parse(t):{};if(!N(r))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let i=Array.isArray(r.configurations)?r.configurations:[],o=i.findIndex(e=>N(e)&&e.name===`open-knowledge-ui`);o>=0?i[o]=a:i.push(a);let s={...r,version:r.version??ka,configurations:i};return De(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function La(e,t,n){try{return H(e.detectPath?.(t,n)??R(e.configPath(t,n)))}catch{return!1}}function Ra(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&&!La(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{j(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 Ba(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{Ce(R(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{O(`${o}.lock`,()=>{let t=ji(o).writePath;if(Ce(R(t),{recursive:!0}),e.format===`toml`){let n=va(zi(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=_a(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 za={pi:bi};function Ba(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=za[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{Ce(R(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{O(`${t}.lock`,()=>{let e=null;try{e=U(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}S(t,c,e===null?void 0:{mode:xr(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function Va(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!H(n)))return{editorId:e.id,label:e.label,path:n}}async function Ha(e){let t=M(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>Ra(t,``,n,e.home))}function Ua(e,t,n,r){let i=Ga(e,t,n,r);return i.kind===`present`?i.entry:null}function Wa(e,t,n,r){let i=ga(e,t,r);if(!N(i))return{kind:`no-entry`};let a=i[n];return N(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Ga(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!H(i))return{kind:`absent`};try{if(Ee(i).size>da)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=U(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:yi(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=zi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Wa(t,e.topLevelKey,o,e.serverMapSubKey)}let s=sa(a);return s?ca(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Wa(hr(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ka(e={}){let t=ve(e.cwd??process.cwd()),n=Ci(t,{homeDir:e.home}),r=n.projectRoot,i=!H(z(r,`.ok`)),a=n.gitRootPromoted?B(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Da(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${I(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await ee(r),l;try{l=m(r,{contentDir:o})}catch(t){let i=A.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(ne),d=!1;if(c.didInit)try{d=y(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let f=await Sa({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),p=e.editors??Qa(r,e.home),h=e.editors??ue.filter(e=>A[e].projectConfigPath!==void 0),g=M(p),_=M(h),b=e.mcp===!1||f===null,S=Array.from(new Map([...g,...b?[]:_].map(e=>[e.id,e])).values()),w=g.filter(t=>La(t,r,e.home)),T=[],D=[],O=new Set;for(let t of S){if(b){let n=``;try{n=t.configPath(r,e.home)}catch{}T.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(ya(f)&&g.includes(t)&&t.scope===`global`&&T.push(Ra(t,r,s,e.home)),ba(f)&&_.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=Ra(t,r,s,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&O.add(n)}}let k=new Set;for(let e of _){let t=e.projectSkillPath?.(r);!t||k.has(t)||(k.add(t),D.push(se(e,r)))}let te=!b&&f!==null&&ba(f)?_.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,ie=b?[]:w.map(e=>Va(e,r)).filter(e=>e!==void 0).filter(e=>!O.has(e.path)),ae=w.some(e=>e.id===`claude`)&&!b?Ia(r,s):void 0,oe=e.installUserSkill??v,ce=e.home??xe(),le=Ea(e.skills),j=!1,N=!1,P=!1,de=!1;for(let t of E){let n=le.has(t);if(await C(ce,x[t],n).catch(()=>{}),n){j=!0;let n=await oe({home:e.home,bundleId:t,force:!0});n===`installed`?N=!0:n===`failed`?P=!0:de=!0}else try{re(ce,t)}catch{}}let F=P?`failed`:N?`installed`:j&&de?`skip-current`:`declined`,fe=b?`skipped-flag`:`skipped-missing`,L=T.find(e=>e.editorId===`claude`)??T[0]??{action:fe,configPath:A.claude.configPath(r,e.home)},pe=await qa({projectRoot:r,desiredMode:await wa({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:l.created,contentUpdated:l.updated,contentSkipped:l.skipped,editors:T,projectSkills:D,legacyProjectConfigs:ie,launchJson:ae,skillInstall:F,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:L.action,mcpPath:L.configPath,mcpError:`error`in L?L.error:void 0,projectScopeUnsupportedLabels:te,sharing:pe}}async function qa(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=An(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=Dn(t);if(n===`local-only`){let e=On(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Ja(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=kn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Ja(t,o,`remove`)}function Ja(e,t,n){let r=An(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Ya(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Xa(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?B(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=z(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(L(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(L(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(L(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(L(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(L(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?B(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${F(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${F(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${fe(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${c}${l}${i} left unchanged (${Ya(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(L(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?B(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${F(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${F(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${fe(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${B(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(L(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${F(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${F(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${de(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${I(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${I(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(I(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(I(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(pe(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...to(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${F(`✓`)} ${L(`Next steps:`)}`),n.push(` 1. Open your editor (${P(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${P(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${P(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${P(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${P(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${P(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
687
687
|
`)}function Za(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Qa(e,t){let n=[];for(let r of ue)La(A[r],e,t)&&n.push(r);return n}function $a(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:ke(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function eo(){return new te(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new k(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new k(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new k(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?$a():null;try{let r;try{r=await Ka({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof Ta){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof p||e instanceof g){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof h){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
688
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
688
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-BvVnU_Yq.mjs`),{resolveContentDir:s}=await import(`./dist-Dovb2Y8A.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-ByfE8Z7y.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Za(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Xa(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function to(e,t){let n=[];switch(e.kind){case`applied`:return n.push(L(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${F(`local-only`)} — appended ${e.appended.length} path(s) to ${L(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${F(`local-only`)} — already excluded; nothing to do.`):n.push(` ${F(`local-only`)}`):e.action===`removed`?n.push(` ${F(`shared`)} — removed OK paths from ${L(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${F(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(I(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
689
689
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${P(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(I(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${P(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${P(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(I(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Ar as A,Mn as B,ma as C,zi as D,ra as E,mr as F,xt as G,kn as H,On as I,K as J,vt as K,Nn as L,br as M,Sr as N,Ci as O,hr as P,jn as R,Ia as S,Ha as T,En as U,An as V,pn as W,Ge as Y,Ea as _,Na as a,wa as b,za as c,Ga as d,Qa as f,Ua as g,eo as h,Ma as i,xr as j,vi as k,qa as l,to as m,Aa as n,Pa as o,Xa as p,_t as q,ja as r,Fa as s,Ta as t,Za as u,Sa as v,Ra as w,Ka as x,Da as y,Dn as z};
|
|
690
|
-
//# sourceMappingURL=init-
|
|
690
|
+
//# sourceMappingURL=init-_gsMrA9E.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ko as e,Xa as t,Za as n,to as r}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{_ as i,_a as a,va as o}from"./dist-
|
|
1
|
+
import{Ko as e,Xa as t,Za as n,to as r}from"./server-lock-iLcBw_q0-pnLGEjec.mjs";import{_ as i,_a as a,va as o}from"./dist-C5-CAALs.mjs";import{t as s}from"./constants-KGjHbPVT.mjs";import{t as c}from"./is-object-Cg453afR.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";async function p(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}var m=e();function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,m.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=r({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...i,source:e}}return i})}function v(e){let r=e??process.cwd(),c=[],u=o(`user`,r),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(r,`.ok`,s),m=g(p);if(m.value!==null){let e=t({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
|
|
2
2
|
|
|
3
3
|
`));f=h(f,m.value),c.push(p)}let v=i.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=p(e.startupCwd);return async o=>{let s=await p(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
4
|
+
//# sourceMappingURL=loader-BIDmV6nB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-BIDmV6nB.mjs";export{e as loadConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ta as e}from"./dist-
|
|
2
|
-
//# sourceMappingURL=open-browser-
|
|
1
|
+
import{ta as e}from"./dist-C5-CAALs.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
|
2
|
+
//# sourceMappingURL=open-browser-DsUKCX2k.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-C5qa70B1.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Yt as e}from"./dist-
|
|
1
|
+
import{Yt as e}from"./dist-C5-CAALs.mjs";import"./constants-KGjHbPVT.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-C5qa70B1.mjs.map
|