@inkeep/open-knowledge 0.33.0-beta.5 → 0.33.0-beta.6
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/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-DxrhiJEv.mjs +2 -0
- package/dist/{dist-0Mfowk3R.mjs → dist-DFesG7DS.mjs} +3 -3
- package/dist/{dist-ByqNBEyQ.mjs → dist-LzL927dF.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-CUBRtkez.mjs → init-B4vJEG6p.mjs} +3 -3
- package/dist/init-BnjjO_nA.mjs +1 -0
- package/dist/{launch-json-removal--BmJqT87.mjs → launch-json-removal-oDM6gkL1.mjs} +2 -2
- package/dist/loader-D8gAl6hU.mjs +1 -0
- package/dist/{loader-DRR095Jj.mjs → loader-DKb55SxB.mjs} +2 -2
- package/dist/native/native-config.linux-x64-gnu.node +0 -0
- package/dist/{open-browser-CZY2ZKg0.mjs → open-browser-3gSG96ZS.mjs} +2 -2
- package/dist/preview-B2bOO2_6.mjs +1 -0
- package/dist/{preview-BUUT3N0t.mjs → preview-C-zPM3qo.mjs} +2 -2
- package/dist/{repair-launch-json-jpDBAb4m.mjs → repair-launch-json-CrBdZKKa.mjs} +2 -2
- package/dist/{repair-mcp-configs-Bid881e6.mjs → repair-mcp-configs-DCX1eS6S.mjs} +2 -2
- package/dist/repair-skills-DADzcSUt.mjs +1 -0
- package/dist/{repair-skills-g00h1ESt.mjs → repair-skills-wxyzsDDA.mjs} +2 -2
- package/dist/{src-DyEoJGw7.mjs → src-BYGc6Nen.mjs} +2 -2
- package/dist/{start-CC6n9G3S.mjs → start-BjKuLBjR.mjs} +2 -2
- package/dist/start-CvWSkAFO.mjs +1 -0
- package/dist/{write-project-skill-D82uNxGO.mjs → write-project-skill-NLecUmFg.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-DJC5MEix.mjs +0 -2
- package/dist/init-D_2w4_8n.mjs +0 -1
- package/dist/loader-QudPqlKw.mjs +0 -1
- package/dist/preview-eYrC9lP5.mjs +0 -1
- package/dist/repair-skills-BkNgLJzB.mjs +0 -1
- package/dist/start-BZ29iacu.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ei as e,Jn as t,Jt as n,Q as r,Qi as i,Sn as a,Un as o,_ as s,a as c,aa as l,b as u,c as d,f,g as p,gn as m,h,i as g,ka as _,kn as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D,v as O,y as k}from"./server-lock-iLcBw_q0-DK2Tcu84.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,Na as qe,Ni as Je,Nn as Ye,Nr as Xe,Nt as Ze,O as Qe,Oi as $e,On as et,Or as tt,Ot as nt,P as rt,Pa as it,Pi as at,Pn as ot,Pr as st,Pt as ct,Q as lt,Qi as ut,Qn as dt,Qr as ft,Qt as pt,R as mt,Ri as ht,Rn as gt,Rr as _t,Rt as vt,S as yt,Si as bt,Sn as xt,Sr as St,St as Ct,T as wt,Ti as Tt,Tn as Et,Tr as Dt,Tt as Ot,U as kt,Ui as At,Un as jt,Ur as Mt,Ut as Nt,V as Pt,Vi as Ft,Vn as It,Vr as Lt,Vt as Rt,W as zt,Wi as Bt,Wn as Vt,Wr as Ht,Wt as Ut,X as Wt,Xi as Gt,Xn as Kt,Xr as qt,Xt as Jt,Y as Yt,Yi as Xt,Yn as Zt,Yr as Qt,Yt as $t,Z as en,Zi as tn,Zn as nn,Zr as rn,Zt as an,_ as on,_i as sn,_n as cn,_r as ln,_t as un,a as dn,aa as fn,ai as pn,an as mn,ar as hn,at as gn,b as _n,bi as vn,bn as yn,br as bn,bt as xn,c as Sn,ca as Cn,ci as wn,cn as Tn,cr as En,ct as Dn,d as On,da as kn,di as An,dn as jn,dr as Mn,dt as Nn,ea as Pn,ei as Fn,en as In,er as Ln,et as Rn,f as zn,fa as Bn,fi as Vn,fn as Hn,fr as Un,ft as Wn,g as Gn,ga as Kn,gi as qn,gn as Jn,gr as Yn,gt as Xn,h as Zn,ha as Qn,hi as $n,hn as er,hr as tr,ht as nr,i as rr,ia as ir,ii as ar,in as or,ir as sr,it as cr,j as lr,ji as ur,jn as dr,jr as fr,jt as pr,k as mr,ki as hr,kn as gr,kr as _r,kt as vr,l as yr,la as br,li as xr,ln as Sr,lr as Cr,lt as wr,m as Tr,ma as Er,mi as Dr,mn as Or,mr as kr,mt as Ar,n as jr,na as Mr,ni as Nr,nn as Pr,nr as Fr,nt as Ir,o as Lr,oa as Rr,oi as zr,on as Br,or as Vr,ot as Hr,p as Ur,pa as Wr,pi as Gr,pn as Kr,pr as qr,pt as Jr,q as Yr,qi as Xr,qn as Zr,qr as Qr,qt as $r,r as ei,ra as ti,ri as ni,rn as ri,rr as ii,rt as ai,s as oi,sa as si,si as ci,sn as li,sr as ui,st as di,t as fi,ta as pi,ti as mi,tn as hi,tr as gi,tt as _i,u as vi,ua as yi,ui as bi,un as xi,ur as Si,ut as Ci,v as wi,vi as Ti,vn as Ei,vr as Di,vt as Oi,w as ki,wi as Ai,wn as ji,wr as Mi,wt as Ni,x as Pi,xi as Fi,xn as Ii,xr as Li,xt as Ri,y as zi,yi as Bi,yn as Vi,yr as Hi,yt as Ui,z as Wi,zi as Gi,zn as Ki,zr as qi,zt as Ji}from"./dist-0Mfowk3R.mjs";export{fi as AGENT_ID_MAX_LEN,jr as AGENT_ID_RE,ei as AGENT_WRITE_ORIGIN,rr as AgentFocusBroadcaster,dn as AgentPresenceBroadcaster,Lr as AgentSessionCapacityError,oi as AgentSessionManager,Sn as AutoStartDisabledError,yr as BUNDLE_IDS,vi as BUNDLE_SCOPE,On as BUNDLE_SKILL_NAME,zn as BacklinkIndex,Ur as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Tr as CONFIG_FILENAME,Zn as CONFLICT_MARKER_RE,Gn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,on as ConfigSchema,wi as DEFAULT_CHECKPOINT_RETENTION,zi as DEFAULT_EMBEDDINGS_DIMENSIONS,_n as DEFAULT_PACK_ID,Pi as EMBEDDINGS_API_KEY_ENV,yt as FILE_SYSTEM_WRITER,G as FILE_WATCHER_ORIGIN,ki as FileEmbeddingsBackend,wt as GIT_PREFLIGHT_FAIL_SPAN_NAME,te as GIT_UPSTREAM_WRITER,qe as GitDirAccessError,X as GitNotAvailableError,Qe as GitTooOldError,mr as HOCUSPOCUS_AUTH_REJECTION_REASONS,F as HocuspocusAuthRejection,lr as HocuspocusAuthTokenSchema,Ve as INSTALLED_AGENTS_SCHEMES,n as LINEAGE_EPOCH_KEY,Ke as LIVE_DERIVED_INDEX_DEBOUNCE_MS,rt as LOG_MD_TEMPLATE,oe as MANAGED_RENAME_ORIGIN,xe as MAX_AGENT_SESSIONS,Ie as MCP_CONNECTION_ID_HEADER,m as MCP_SERVER_NAME,mt as MIN_GIT_VERSION,Wi as MISSING_OK_CONFIG_MESSAGE,it as MalformedGitPointerError,B as McpLogger,Pt as MissingOkConfigError,ge as OBSERVER_SYNC_ORIGIN,kt as OK_OKIGNORE_TEMPLATE,a as ORPHAN_MODES,v as PROTOCOL_VERSION,zt as PinoLogger,E as ProcessLockCollisionError,de as ProjectGitInitError,je as ROLLBACK_ORIGIN,Yr as ROOT_GITIGNORE_TEMPLATE,x as RUNTIME_VERSION,Ee as SERVICE_WRITER,Yt as SKILL_INSTALL_EVENTS_FILE_REL,o as SKILL_STATE_TARGETS,Wt as STARTER_FOLDERS,en as STARTER_FOLDER_FRONTMATTER_FILENAME,lt as STARTER_PACKS,A as STARTER_PACK_IDS,Rn as STARTER_TEMPLATES,_i as STATE_MANIFEST_FILENAME,w as STATE_SCHEMA_VERSION,t as SYSTEM_DOC_NAME,Ir as SeedPrerequisiteError,ai as SeedRootDirError,g as ServerLockCollisionError,cr as SingleFileNotAFileError,gn as SingleFileNotFoundError,Hr as SingleFileNotMarkdownError,di as StateManifestError,Dn as TagIndex,wr as USER_GLOBAL_BUNDLE_IDS,Ci as UiLockCollisionError,Nn as __getShowAllWalkStatsForTesting,Wn as __resetShowAllWalkStatsForTesting,c as acquireProcessLock,S as acquireServerLock,Jr as acquireUiLock,Ar as applyAgentMarkdownWrite,nr as applyExternalChange,Xn as applySeed,un as assertCompatibleStateManifest,Oi as assertGitAvailable,Ui as assertNeverDiskEvent,xn as attachIdleShutdown,Ri as bootServer,Ct as buildAndOpenSkill,Y as buildConfigYmlContent,Ni as buildExecResult,Ot as buildSkillZip,ae as buildStarterFolderFrontmatterYaml,ee as buildWipTree,nt as bundleSkillMdPath,vr as classifyEvents,z as classifyFsPath,pr as clearContributors,Ge as clearEmbeddingsKeyFromAllBackends,Ze as coercePackId,e as colorFromSeed,ct as commitUpstreamImport,ue as commitWip,Te as commitWipFromTree,Be as compareSemver,vt as composeEffectiveLinterConfig,Ji as containsConflictMarkers,W as contentHash,Rt as contributorCount,be as countShadowObjects,Nt as countStaleAgentWipRefs,Ut as countWipRefs,he as createApiExtension,Fe as createAssetServeMiddleware,$r as createContentFilter,Ae as createContentFilterAsync,$t as createEmbeddingsSecretStore,Jt as createEphemeralProjectDir,an as createExternalChangeHandler,pt as createFileLogger,P as createLiveDerivedIndexExtension,In as createMcpHttpHandler,hi as createOsProbe,Pr as createPersistenceExtension,ri as createServer,or as createServerObserverExtension,mn as createStreamingErrorWriter,Br as createTestLogger,li as describeStoredEmbeddingsKey,Tn as detectClaudeDesktopPresence,Sr as detectGit,xi as detectProjectShape,jn as discoverLockDirs,Hn as discoverMarkdownlintConfig,Kr as emitPreflightFailureSpan,Or as encodeDocName,er as encodeFolderRoute,Jn as encodeSkillRoute,cn as ensureProjectGit,Ei as ensureProjectSkillGitignore,Vi as errorResponse,yn as evictStaleTrackerEntries,Ii as extractOkBinaryPath,xt as extractWikiLinksFromMarkdown,q as fallbackPaths,ji as findEnclosingGitRoot,Et as findEnclosingProjectRoot,re as findNativeMarkdownlintFile,Q as flushFileLogger,et as formatAuthRejectionWire,gr as formatContributors,L as formatContributorsFrom,dr as formatPackRationale,Ue as gcCheckpointRefs,Ye as getCurrentMcpLogger,ot as getLocalDir,ce as getLogFilePath,Ce as getLogger,Re as getLogsDir,T as getMachineId,gt as getMeter,Ki as getMetrics,H as getTracer,It as handleCollabSocketError,ve as handleSpawnCursor,jt as hasGcLogLatch,i as iconFromClientName,Vt as incrementCollabSocketFilteredError,pe as incrementServerObserverFire,Ne as initContent,Zr as initShadowRepo,Oe as initTelemetry,Zt as initToleranceTelemetryWriter,Kt as installPrettyZodErrors,nn as installTestLoggers,dt as installUserSkill,M as isAllowedApiOrigin,Ln as isAllowedWorkspaceHostHeader,gi as isConfigDoc,Fr as isHocuspocusAuthRejectionReason,ii as isKnownPackId,sr as isLinkIndexExcludedDoc,hn as isLoopbackAddress,Vr as isManagedArtifactDoc,l as isOrphanMode,ui as isPairedWriteOrigin,En as isPathWithinDir,d as isProcessAlive,Cr as isProjectRoot,Si as isProjectSkillManaged,Mn as isReservedForUserTree,Un as isSelfWrite,qr as isSystemDoc,kr as isToleranceTelemetryEnabled,y as isValidLockPid,tr as lastKnownHash,Yn as listRescueCheckpoints,ln as listStarterPacks,Di as loadPrincipal,D as lockFilePath,Hi as loggerFactory,bn as logsCurrentPath,Li as logsPreviousPath,St as makeLazyEmbeddingsKeyStore,f as markServerLockDraining,J as mountMcpAndApi,Mi as normalizeFsPath,Dt as originGitHubHost,ie as packageVersionMajorMinor,$ as parseAuthRejectionWire,tt as parseGitVersion,_r as parseHocuspocusAuthToken,R as parseKeepaliveConnectionId,fr as pathToDocName,We as planSeed,Xe as prepareSingleFileOpen,st as processCommand,le as processUsage,we as readAllTargets,ze as readBranchFromHead,_t as readBundleDecision,qi as readOwnNativeRules,C as readProcessLock,b as readProcessLockDetailed,U as readProjectLocalSemanticConfig,h as readServerLock,Lt as readServerPackageVersion,ye as readSkillInstallStateSnapshot,Mt as readSkillManagement,Ht as readStateManifest,me as readTargetRecordedAt,Pe as readTargetVersion,Qr as readUiLock,ke as reconcile,Qt as recordContributor,qt as recordSkillInstallEvent,rn as registerAllTools,ft as registerWrite,p as releaseProcessLock,s as releaseServerLock,N as releaseUiLock,Fn as removeLastKnownHash,mi as resetMetrics,_ as resolveBundleEnabled,Nr as resolveBundledSkillDir,ni as resolveContentDir,ar as resolveCursorBinaryDefault,pn as resolveCursorSpawnInvocation,zr as resolveEffectiveLinterConfig,ci as resolveLockDir,wn as resolveNativeConfigForDoc,xr as resolveNativeMarkdownlintConfig,bi as resolvePack,An as resolvePackageVersion,Vn as resolveUiInfo,Gr as restoreContributors,Dr as restoreLifecycleFromConflictsJson,$n as rewriteMarkdownLinksForDocumentRename,qn as rewriteWikiLinksForDocumentRename,sn as runAuthReposSubprocess,Ti as runAuthStatusSubprocess,Bi as runCloneSubprocess,vn as runDeviceFlowSubprocess,Fi as runWithMcpLogger,bt as safeContentPath,K as safeSubdir,Ai as safetyCheckpoint,Tt as sanitizeClientName,ne as saveInMemoryCheckpoint,Z as saveVersion,$e as seedBasenameIndex,hr as serializeError,I as setActiveSpanAttributes,ur as setupServerObservers,He as shadowGit,Je as shutdownTelemetry,at as skillManagementPath,se as spansCurrentPath,Se as spansPreviousPath,Le as spawnDetached,ht as splitMarkdownBlocks,Gi as startWatcher,V as streamingProblemEvent,Ft as swapContributors,_e as teardownToleranceTelemetryWriter,At as toBroadcasterKey,Bt as tracedAppendFileSync,fe as tracedLinkSync,Me as tracedMkdir,Xr as tracedMkdirSync,De as tracedRename,Xt as tracedRenameSync,Gt as tracedRmSync,tn as tracedRmdirSync,ut as tracedUnlinkSync,j as tracedWriteFile,Pn as tracedWriteFileSync,pi as untrackTrackedProjectSkillProjection,Mr as updateLastKnownHash,O as updateProcessLockPort,k as updateServerLockPort,ti as updateUiLockPort,ir as validateAgentId,fn as validateCloneInputs,Rr as validateSkillZip,u as waitForServerLockDrain,si as withHiddenWindowsConsole,Cn as withSpan,br as withSpanSync,yi as writeBundleDecision,kn as writeMarkdownlintRule,Bn as writeRootGitignoreForNewRepo,Wr as writeSkillManagement,Er as writeStateManifest,Qn as writeTargetVersion,Kn as writeTracker};
|
|
1
|
+
import{Ei as e,Jn as t,Jt as n,Q as r,Qi as i,Sn as a,Un as o,_ as s,a as c,aa as l,b as u,c as d,f,g as p,gn as m,h,i as g,ka as _,kn as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D,v as O,y as k}from"./server-lock-iLcBw_q0-DK2Tcu84.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,Na as qe,Ni as Je,Nn as Ye,Nr as Xe,Nt as Ze,O as Qe,Oi as $e,On as et,Or as tt,Ot as nt,P as rt,Pa as it,Pi as at,Pn as ot,Pr as st,Pt as ct,Q as lt,Qi as ut,Qn as dt,Qr as ft,Qt as pt,R as mt,Ri as ht,Rn as gt,Rr as _t,Rt as vt,S as yt,Si as bt,Sn as xt,Sr as St,St as Ct,T as wt,Ti as Tt,Tn as Et,Tr as Dt,Tt as Ot,U as kt,Ui as At,Un as jt,Ur as Mt,Ut as Nt,V as Pt,Vi as Ft,Vn as It,Vr as Lt,Vt as Rt,W as zt,Wi as Bt,Wn as Vt,Wr as Ht,Wt as Ut,X as Wt,Xi as Gt,Xn as Kt,Xr as qt,Xt as Jt,Y as Yt,Yi as Xt,Yn as Zt,Yr as Qt,Yt as $t,Z as en,Zi as tn,Zn as nn,Zr as rn,Zt as an,_ as on,_i as sn,_n as cn,_r as ln,_t as un,a as dn,aa as fn,ai as pn,an as mn,ar as hn,at as gn,b as _n,bi as vn,bn as yn,br as bn,bt as xn,c as Sn,ca as Cn,ci as wn,cn as Tn,cr as En,ct as Dn,d as On,da as kn,di as An,dn as jn,dr as Mn,dt as Nn,ea as Pn,ei as Fn,en as In,er as Ln,et as Rn,f as zn,fa as Bn,fi as Vn,fn as Hn,fr as Un,ft as Wn,g as Gn,ga as Kn,gi as qn,gn as Jn,gr as Yn,gt as Xn,h as Zn,ha as Qn,hi as $n,hn as er,hr as tr,ht as nr,i as rr,ia as ir,ii as ar,in as or,ir as sr,it as cr,j as lr,ji as ur,jn as dr,jr as fr,jt as pr,k as mr,ki as hr,kn as gr,kr as _r,kt as vr,l as yr,la as br,li as xr,ln as Sr,lr as Cr,lt as wr,m as Tr,ma as Er,mi as Dr,mn as Or,mr as kr,mt as Ar,n as jr,na as Mr,ni as Nr,nn as Pr,nr as Fr,nt as Ir,o as Lr,oa as Rr,oi as zr,on as Br,or as Vr,ot as Hr,p as Ur,pa as Wr,pi as Gr,pn as Kr,pr as qr,pt as Jr,q as Yr,qi as Xr,qn as Zr,qr as Qr,qt as $r,r as ei,ra as ti,ri as ni,rn as ri,rr as ii,rt as ai,s as oi,sa as si,si as ci,sn as li,sr as ui,st as di,t as fi,ta as pi,ti as mi,tn as hi,tr as gi,tt as _i,u as vi,ua as yi,ui as bi,un as xi,ur as Si,ut as Ci,v as wi,vi as Ti,vn as Ei,vr as Di,vt as Oi,w as ki,wi as Ai,wn as ji,wr as Mi,wt as Ni,x as Pi,xi as Fi,xn as Ii,xr as Li,xt as Ri,y as zi,yi as Bi,yn as Vi,yr as Hi,yt as Ui,z as Wi,zi as Gi,zn as Ki,zr as qi,zt as Ji}from"./dist-DFesG7DS.mjs";export{fi as AGENT_ID_MAX_LEN,jr as AGENT_ID_RE,ei as AGENT_WRITE_ORIGIN,rr as AgentFocusBroadcaster,dn as AgentPresenceBroadcaster,Lr as AgentSessionCapacityError,oi as AgentSessionManager,Sn as AutoStartDisabledError,yr as BUNDLE_IDS,vi as BUNDLE_SCOPE,On as BUNDLE_SKILL_NAME,zn as BacklinkIndex,Ur as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Tr as CONFIG_FILENAME,Zn as CONFLICT_MARKER_RE,Gn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,on as ConfigSchema,wi as DEFAULT_CHECKPOINT_RETENTION,zi as DEFAULT_EMBEDDINGS_DIMENSIONS,_n as DEFAULT_PACK_ID,Pi as EMBEDDINGS_API_KEY_ENV,yt as FILE_SYSTEM_WRITER,G as FILE_WATCHER_ORIGIN,ki as FileEmbeddingsBackend,wt as GIT_PREFLIGHT_FAIL_SPAN_NAME,te as GIT_UPSTREAM_WRITER,qe as GitDirAccessError,X as GitNotAvailableError,Qe as GitTooOldError,mr as HOCUSPOCUS_AUTH_REJECTION_REASONS,F as HocuspocusAuthRejection,lr as HocuspocusAuthTokenSchema,Ve as INSTALLED_AGENTS_SCHEMES,n as LINEAGE_EPOCH_KEY,Ke as LIVE_DERIVED_INDEX_DEBOUNCE_MS,rt as LOG_MD_TEMPLATE,oe as MANAGED_RENAME_ORIGIN,xe as MAX_AGENT_SESSIONS,Ie as MCP_CONNECTION_ID_HEADER,m as MCP_SERVER_NAME,mt as MIN_GIT_VERSION,Wi as MISSING_OK_CONFIG_MESSAGE,it as MalformedGitPointerError,B as McpLogger,Pt as MissingOkConfigError,ge as OBSERVER_SYNC_ORIGIN,kt as OK_OKIGNORE_TEMPLATE,a as ORPHAN_MODES,v as PROTOCOL_VERSION,zt as PinoLogger,E as ProcessLockCollisionError,de as ProjectGitInitError,je as ROLLBACK_ORIGIN,Yr as ROOT_GITIGNORE_TEMPLATE,x as RUNTIME_VERSION,Ee as SERVICE_WRITER,Yt as SKILL_INSTALL_EVENTS_FILE_REL,o as SKILL_STATE_TARGETS,Wt as STARTER_FOLDERS,en as STARTER_FOLDER_FRONTMATTER_FILENAME,lt as STARTER_PACKS,A as STARTER_PACK_IDS,Rn as STARTER_TEMPLATES,_i as STATE_MANIFEST_FILENAME,w as STATE_SCHEMA_VERSION,t as SYSTEM_DOC_NAME,Ir as SeedPrerequisiteError,ai as SeedRootDirError,g as ServerLockCollisionError,cr as SingleFileNotAFileError,gn as SingleFileNotFoundError,Hr as SingleFileNotMarkdownError,di as StateManifestError,Dn as TagIndex,wr as USER_GLOBAL_BUNDLE_IDS,Ci as UiLockCollisionError,Nn as __getShowAllWalkStatsForTesting,Wn as __resetShowAllWalkStatsForTesting,c as acquireProcessLock,S as acquireServerLock,Jr as acquireUiLock,Ar as applyAgentMarkdownWrite,nr as applyExternalChange,Xn as applySeed,un as assertCompatibleStateManifest,Oi as assertGitAvailable,Ui as assertNeverDiskEvent,xn as attachIdleShutdown,Ri as bootServer,Ct as buildAndOpenSkill,Y as buildConfigYmlContent,Ni as buildExecResult,Ot as buildSkillZip,ae as buildStarterFolderFrontmatterYaml,ee as buildWipTree,nt as bundleSkillMdPath,vr as classifyEvents,z as classifyFsPath,pr as clearContributors,Ge as clearEmbeddingsKeyFromAllBackends,Ze as coercePackId,e as colorFromSeed,ct as commitUpstreamImport,ue as commitWip,Te as commitWipFromTree,Be as compareSemver,vt as composeEffectiveLinterConfig,Ji as containsConflictMarkers,W as contentHash,Rt as contributorCount,be as countShadowObjects,Nt as countStaleAgentWipRefs,Ut as countWipRefs,he as createApiExtension,Fe as createAssetServeMiddleware,$r as createContentFilter,Ae as createContentFilterAsync,$t as createEmbeddingsSecretStore,Jt as createEphemeralProjectDir,an as createExternalChangeHandler,pt as createFileLogger,P as createLiveDerivedIndexExtension,In as createMcpHttpHandler,hi as createOsProbe,Pr as createPersistenceExtension,ri as createServer,or as createServerObserverExtension,mn as createStreamingErrorWriter,Br as createTestLogger,li as describeStoredEmbeddingsKey,Tn as detectClaudeDesktopPresence,Sr as detectGit,xi as detectProjectShape,jn as discoverLockDirs,Hn as discoverMarkdownlintConfig,Kr as emitPreflightFailureSpan,Or as encodeDocName,er as encodeFolderRoute,Jn as encodeSkillRoute,cn as ensureProjectGit,Ei as ensureProjectSkillGitignore,Vi as errorResponse,yn as evictStaleTrackerEntries,Ii as extractOkBinaryPath,xt as extractWikiLinksFromMarkdown,q as fallbackPaths,ji as findEnclosingGitRoot,Et as findEnclosingProjectRoot,re as findNativeMarkdownlintFile,Q as flushFileLogger,et as formatAuthRejectionWire,gr as formatContributors,L as formatContributorsFrom,dr as formatPackRationale,Ue as gcCheckpointRefs,Ye as getCurrentMcpLogger,ot as getLocalDir,ce as getLogFilePath,Ce as getLogger,Re as getLogsDir,T as getMachineId,gt as getMeter,Ki as getMetrics,H as getTracer,It as handleCollabSocketError,ve as handleSpawnCursor,jt as hasGcLogLatch,i as iconFromClientName,Vt as incrementCollabSocketFilteredError,pe as incrementServerObserverFire,Ne as initContent,Zr as initShadowRepo,Oe as initTelemetry,Zt as initToleranceTelemetryWriter,Kt as installPrettyZodErrors,nn as installTestLoggers,dt as installUserSkill,M as isAllowedApiOrigin,Ln as isAllowedWorkspaceHostHeader,gi as isConfigDoc,Fr as isHocuspocusAuthRejectionReason,ii as isKnownPackId,sr as isLinkIndexExcludedDoc,hn as isLoopbackAddress,Vr as isManagedArtifactDoc,l as isOrphanMode,ui as isPairedWriteOrigin,En as isPathWithinDir,d as isProcessAlive,Cr as isProjectRoot,Si as isProjectSkillManaged,Mn as isReservedForUserTree,Un as isSelfWrite,qr as isSystemDoc,kr as isToleranceTelemetryEnabled,y as isValidLockPid,tr as lastKnownHash,Yn as listRescueCheckpoints,ln as listStarterPacks,Di as loadPrincipal,D as lockFilePath,Hi as loggerFactory,bn as logsCurrentPath,Li as logsPreviousPath,St as makeLazyEmbeddingsKeyStore,f as markServerLockDraining,J as mountMcpAndApi,Mi as normalizeFsPath,Dt as originGitHubHost,ie as packageVersionMajorMinor,$ as parseAuthRejectionWire,tt as parseGitVersion,_r as parseHocuspocusAuthToken,R as parseKeepaliveConnectionId,fr as pathToDocName,We as planSeed,Xe as prepareSingleFileOpen,st as processCommand,le as processUsage,we as readAllTargets,ze as readBranchFromHead,_t as readBundleDecision,qi as readOwnNativeRules,C as readProcessLock,b as readProcessLockDetailed,U as readProjectLocalSemanticConfig,h as readServerLock,Lt as readServerPackageVersion,ye as readSkillInstallStateSnapshot,Mt as readSkillManagement,Ht as readStateManifest,me as readTargetRecordedAt,Pe as readTargetVersion,Qr as readUiLock,ke as reconcile,Qt as recordContributor,qt as recordSkillInstallEvent,rn as registerAllTools,ft as registerWrite,p as releaseProcessLock,s as releaseServerLock,N as releaseUiLock,Fn as removeLastKnownHash,mi as resetMetrics,_ as resolveBundleEnabled,Nr as resolveBundledSkillDir,ni as resolveContentDir,ar as resolveCursorBinaryDefault,pn as resolveCursorSpawnInvocation,zr as resolveEffectiveLinterConfig,ci as resolveLockDir,wn as resolveNativeConfigForDoc,xr as resolveNativeMarkdownlintConfig,bi as resolvePack,An as resolvePackageVersion,Vn as resolveUiInfo,Gr as restoreContributors,Dr as restoreLifecycleFromConflictsJson,$n as rewriteMarkdownLinksForDocumentRename,qn as rewriteWikiLinksForDocumentRename,sn as runAuthReposSubprocess,Ti as runAuthStatusSubprocess,Bi as runCloneSubprocess,vn as runDeviceFlowSubprocess,Fi as runWithMcpLogger,bt as safeContentPath,K as safeSubdir,Ai as safetyCheckpoint,Tt as sanitizeClientName,ne as saveInMemoryCheckpoint,Z as saveVersion,$e as seedBasenameIndex,hr as serializeError,I as setActiveSpanAttributes,ur as setupServerObservers,He as shadowGit,Je as shutdownTelemetry,at as skillManagementPath,se as spansCurrentPath,Se as spansPreviousPath,Le as spawnDetached,ht as splitMarkdownBlocks,Gi as startWatcher,V as streamingProblemEvent,Ft as swapContributors,_e as teardownToleranceTelemetryWriter,At as toBroadcasterKey,Bt as tracedAppendFileSync,fe as tracedLinkSync,Me as tracedMkdir,Xr as tracedMkdirSync,De as tracedRename,Xt as tracedRenameSync,Gt as tracedRmSync,tn as tracedRmdirSync,ut as tracedUnlinkSync,j as tracedWriteFile,Pn as tracedWriteFileSync,pi as untrackTrackedProjectSkillProjection,Mr as updateLastKnownHash,O as updateProcessLockPort,k as updateServerLockPort,ti as updateUiLockPort,ir as validateAgentId,fn as validateCloneInputs,Rr as validateSkillZip,u as waitForServerLockDrain,si as withHiddenWindowsConsole,Cn as withSpan,br as withSpanSync,yi as writeBundleDecision,kn as writeMarkdownlintRule,Bn as writeRootGitignoreForNewRepo,Wr as writeSkillManagement,Er as writeStateManifest,Qn as writeTargetVersion,Kn as writeTracker};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./gh-detect-DDO0PYTq.mjs";import{A as r,D as i,M as a,N as o,O as s,d as c,j as l,k as u,n as d,o as f,s as p,v as m,x as h,y as g}from"./init-
|
|
1
|
+
import{i as e,r as t,t as n}from"./gh-detect-DDO0PYTq.mjs";import{A as r,D as i,M as a,N as o,O as s,d as c,j as l,k as u,n as d,o as f,s as p,v as m,x as h,y as g}from"./init-B4vJEG6p.mjs";import{C as _,D as v,E as y,b,d as x,f as S,h as C,i as w,n as T,p as E,r as D,t as O,u as k,v as A,x as j,y as M}from"./src-BYGc6Nen.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-NLecUmFg.mjs";import{n as G}from"./loader-DKb55SxB.mjs";import{n as K}from"./preview-C-zPM3qo.mjs";import{n as q,t as J}from"./mcp-migrate-event-BNoOQpLB.mjs";export{V as ALL_EDITOR_IDS,U as EDITOR_LABELS,F as EDITOR_TARGETS,I as HOSTS_WITH_USER_SKILL_DIR,d as LAUNCH_CONFIG_NAME,x as PATH_SHIM_BEGIN,S as PATH_SHIM_BLOCK_RE,E as PATH_SHIM_END,i as addOkPathsToGitExclude,H as assertProjectPathSafe,L as buildManagedServerEntry,D as buildMcpConfigDeclineEvent,J as buildMcpConfigMigrateEvent,f as classifyExistingMcpEntry,_ as collectReportBundle,t as createTokenStore,y as defaultBugReportZipPath,n as detectGh,p as detectInstalledEditors,s as formatTrackedRemediation,u as getExcludedOkPaths,r as getOkArtifactPaths,N as isEntryUpToDate,W as isOwnManagedEntry,G as loadConfig,e as makeLazyProbeTokenStore,A as parseGitHubBlobUrl,M as parseGitHubShareUrl,b as parseGitHubTreeUrl,j as parseGitUrl,C as pathInstallMarkerPath,K as previewContent,l as probeTrackedOkPaths,c as readExistingMcpEntry,a as readSharingMode,v as redactContent,o as removeOkPathsFromGitExclude,k as removeOwnMcpEntry,B as removeProjectSkill,P as removeUserGlobalSkillBundle,h as resolveProjectRoot,w as runStop,q as truncatePriorEntry,z as userGlobalSkillBundleTargets,T as validateLocalFolderForShare,m as writeEditorMcpConfig,O as writeProjectAiIntegrations,R as writeProjectSkill,g as writeUserMcpConfigs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Ht as r,Ot as i,ha as a,ps as o}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Ca as s,D as c,Da as l,G as u,Ia as d,Kn as f,O as p,Oa as m,Qn as h,Ta as g,_n as _,d as v,fa as y,ja as b,lr as x,lt as S,sa as C,ta as ee,ua as te,vn as ne,wa as w}from"./dist-0Mfowk3R.mjs";import{r as re,t as ie}from"./esm-BNIW0EH8.mjs";import{t as ae}from"./constants-DJC5MEix.mjs";import{t as T}from"./is-object-DAC-mmwo.mjs";import{a as oe,b as se,d as E,g as ce,h as le,i as ue,m as de,p as fe,s as pe,t as me}from"./write-project-skill-D82uNxGO.mjs";import{i as D,n as he,o as O,r as ge,s as k,t as A}from"./colors-DugpbXz6.mjs";import{t as _e}from"./preview-BUUT3N0t.mjs";import{createRequire as ve}from"node:module";import{execFileSync as ye}from"node:child_process";import be,{dirname as j,isAbsolute as M,join as N,relative as P,resolve as F,sep as xe}from"node:path";import I from"node:process";import{fileURLToPath as Se}from"node:url";import{existsSync as L,lstatSync as Ce,mkdirSync as we,readFileSync as R,readlinkSync as Te,realpathSync as Ee,statSync as De,writeFileSync as Oe}from"node:fs";import{homedir as ke}from"node:os";import{inspect as Ae,stripVTControlCharacters as je,styleText as z}from"node:util";import{AsyncLocalStorage as Me,AsyncResource as Ne}from"node:async_hooks";import*as Pe from"node:readline";const Fe=new Set([`emacs`,`vim`]);function Ie(e){return Fe.has(e)}function Le(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ie))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Re=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,ze=e=>e.name===`space`,Be=e=>e.name===`backspace`,Ve=e=>`1234567890`.includes(e.name),He=e=>e.name===`enter`||e.name===`return`;var Ue=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},We=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ge=class extends Error{name=`ExitPromptError`},Ke=class extends Error{name=`HookError`},qe=class extends Error{name=`ValidationError`};const Je=new Me;function Ye(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Xe(e,t){let n=Ye(e);return Je.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Je.getStore();if(!e)throw new Ke(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ze(){return V().rl}function Qe(e){return Ne.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function $e(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function et(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ze());if(r!=null&&typeof r!=`function`)throw new qe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();Qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function tt(e){return typeof e==`function`}function U(e){return $e(t=>{let n=Ne.bind(function(e){t.get()!==e&&(t.set(e),et())});if(t.initialized)return[t.get(),n];let r=tt(e)?e():e;return t.set(r),[r,n]})}function nt(e,t){$e(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function rt(){return I.platform.startsWith(`win`)?!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask===`{cmd::Cmder}`||I.env.TERM_PROGRAM===`Terminus-Sublime`||I.env.TERM_PROGRAM===`vscode`||I.env.TERM===`xterm-256color`||I.env.TERM===`alacritty`||I.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:I.env.TERM!==`linux`}const it={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:`╱`},at={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:`⅒`},ot={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`},st={...it,...at},ct={...it,...ot},W=rt()?st:ct;Object.entries(at);const lt={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function ut(){return{...lt,keybindings:Le()}}function dt(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 ft(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=dt(n)&&dt(r)?ft(n,r):r}return t}function pt(...e){return ft(ut(),...e.filter(e=>e!=null))}function mt({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=pt(t);return nt(()=>{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 ht(e,t){return $e(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 gt(e){return U({current:e})[0]}function _t(e){let t=gt(e);t.current=e,nt(e=>{let n=!1,r=Qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var vt=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 yt=(()=>{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}})(),bt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,xt=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,St=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ct=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Tt=/\t{1,1000}/y,Et=/[\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,Dt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ot=/\p{M}+/gu,kt={limit:1/0,ellipsis:``},At=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?At(i,kt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Dt,l],[St,0],[Ct,o],[Tt,s],[Et,c],[wt,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(Ot,``)){let t=e.codePointAt(0)||0;if(S=bt(t)?2:xt(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===wt?yt(e.slice(p,n.lastIndex)):n===Et?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}},jt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>At(e,jt,t).width,Mt=`]8;;`,Nt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Mt}(?<uri>.*))`,`y`),Pt=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},Ft=e=>`[${e}m`,It=e=>`${Mt}${e}`,Lt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Mt,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())},Rt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},zt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Lt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Lt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Lt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Rt(e)));let l=s.join(`
|
|
1
|
+
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{Ht as r,Ot as i,ha as a,ps as o}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Ca as s,D as c,Da as l,G as u,Ia as d,Kn as f,O as p,Oa as m,Qn as h,Ta as g,_n as _,d as v,fa as y,ja as b,lr as x,lt as S,sa as C,ta as ee,ua as te,vn as ne,wa as w}from"./dist-DFesG7DS.mjs";import{r as re,t as ie}from"./esm-BNIW0EH8.mjs";import{t as ae}from"./constants-DxrhiJEv.mjs";import{t as T}from"./is-object-DAC-mmwo.mjs";import{a as oe,b as se,d as E,g as ce,h as le,i as ue,m as de,p as fe,s as pe,t as me}from"./write-project-skill-NLecUmFg.mjs";import{i as D,n as he,o as O,r as ge,s as k,t as A}from"./colors-DugpbXz6.mjs";import{t as _e}from"./preview-C-zPM3qo.mjs";import{createRequire as ve}from"node:module";import{execFileSync as ye}from"node:child_process";import be,{dirname as j,isAbsolute as M,join as N,relative as P,resolve as F,sep as xe}from"node:path";import I from"node:process";import{fileURLToPath as Se}from"node:url";import{existsSync as L,lstatSync as Ce,mkdirSync as we,readFileSync as R,readlinkSync as Te,realpathSync as Ee,statSync as De,writeFileSync as Oe}from"node:fs";import{homedir as ke}from"node:os";import{inspect as Ae,stripVTControlCharacters as je,styleText as z}from"node:util";import{AsyncLocalStorage as Me,AsyncResource as Ne}from"node:async_hooks";import*as Pe from"node:readline";const Fe=new Set([`emacs`,`vim`]);function Ie(e){return Fe.has(e)}function Le(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ie))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Re=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,ze=e=>e.name===`space`,Be=e=>e.name===`backspace`,Ve=e=>`1234567890`.includes(e.name),He=e=>e.name===`enter`||e.name===`return`;var Ue=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},We=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ge=class extends Error{name=`ExitPromptError`},Ke=class extends Error{name=`HookError`},qe=class extends Error{name=`ValidationError`};const Je=new Me;function Ye(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Xe(e,t){let n=Ye(e);return Je.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Je.getStore();if(!e)throw new Ke(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ze(){return V().rl}function Qe(e){return Ne.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function $e(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function et(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ze());if(r!=null&&typeof r!=`function`)throw new qe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();Qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function tt(e){return typeof e==`function`}function U(e){return $e(t=>{let n=Ne.bind(function(e){t.get()!==e&&(t.set(e),et())});if(t.initialized)return[t.get(),n];let r=tt(e)?e():e;return t.set(r),[r,n]})}function nt(e,t){$e(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function rt(){return I.platform.startsWith(`win`)?!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask===`{cmd::Cmder}`||I.env.TERM_PROGRAM===`Terminus-Sublime`||I.env.TERM_PROGRAM===`vscode`||I.env.TERM===`xterm-256color`||I.env.TERM===`alacritty`||I.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:I.env.TERM!==`linux`}const it={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:`╱`},at={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:`⅒`},ot={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`},st={...it,...at},ct={...it,...ot},W=rt()?st:ct;Object.entries(at);const lt={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function ut(){return{...lt,keybindings:Le()}}function dt(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 ft(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=dt(n)&&dt(r)?ft(n,r):r}return t}function pt(...e){return ft(ut(),...e.filter(e=>e!=null))}function mt({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=pt(t);return nt(()=>{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 ht(e,t){return $e(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 gt(e){return U({current:e})[0]}function _t(e){let t=gt(e);t.current=e,nt(e=>{let n=!1,r=Qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var vt=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 yt=(()=>{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}})(),bt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,xt=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,St=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ct=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Tt=/\t{1,1000}/y,Et=/[\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,Dt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ot=/\p{M}+/gu,kt={limit:1/0,ellipsis:``},At=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?At(i,kt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Dt,l],[St,0],[Ct,o],[Tt,s],[Et,c],[wt,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(Ot,``)){let t=e.codePointAt(0)||0;if(S=bt(t)?2:xt(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===wt?yt(e.slice(p,n.lastIndex)):n===Et?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}},jt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>At(e,jt,t).width,Mt=`]8;;`,Nt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Mt}(?<uri>.*))`,`y`),Pt=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},Ft=e=>`[${e}m`,It=e=>`${Mt}${e}`,Lt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Mt,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())},Rt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},zt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Lt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Lt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Lt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Rt(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===``){Nt.lastIndex=e+1;let t=Nt.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+=It(``));let e=i?Pt(i):void 0;i&&e&&(r+=Ft(e))}else t===`
|
|
4
4
|
`&&(i&&Pt(i)&&(r+=Ft(i)),a&&(r+=It(a)))}return r},Bt=/\r?\n/;function Vt(e,t,n){return String(e).normalize().split(Bt).map(e=>zt(e,t,n)).join(`
|
|
@@ -634,6 +634,6 @@ export default function okBridge(pi: {
|
|
|
634
634
|
`));let f=`${a?``:``}${u}`;return f!==i&&m(e,f,{mode:J(e)}),{kind:l?`overwritten`:`written`}}const vi=e=>e!==`project`,yi=e=>e!==`user`;async function bi(){let e=await Kn({message:`Where should the MCP server be configured?
|
|
635
635
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function xi(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??bi)():`both`}async function Si(e){return Zn({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Ci(e){if(e.sharing!==void 0)return e.sharing;let t=Tn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Si)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function wi(e){if(e===void 0||e===!0)return new Set(S);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(S.filter(e=>t.includes(e)))}function Ti(e,t,n){let r=F(n,e),i;try{i=De(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=P(Ei(t),Ei(r));if(a.startsWith(`..`)||M(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Ei(e){try{return Ee(e)}catch{return e}}const Di=`open-knowledge-ui`;function Oi(e,t,n){try{return L(e.detectPath?.(t,n)??j(e.configPath(t,n)))}catch{return!1}}function ki(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&&!Oi(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{me(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 ji(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{we(j(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{b(`${o}.lock`,()=>{let t=Kr(o).writePath;if(we(j(t),{recursive:!0}),e.format===`toml`){let n=gi(ei(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=_i(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=hi(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 Ai={pi:Fr};function ji(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=Ai[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{we(j(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{b(`${t}.lock`,()=>{let e=null;try{e=R(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}m(t,c,e===null?void 0:{mode:J(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 Mi(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!L(n)))return{editorId:e.id,label:e.label,path:n}}async function Ni(e){let t=se(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>ki(t,``,n,e.home))}function Pi(e,t,n,r){let i=Ii(e,t,n,r);return i.kind===`present`?i.entry:null}function Fi(e,t,n,r){let i=mi(e,t,r);if(!T(i))return{kind:`no-entry`};let a=i[n];return T(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Ii(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!L(i))return{kind:`absent`};try{if(De(i).size>li)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=R(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Pr(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ei().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Fi(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,ti.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Fi(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ii(a);return s?ai(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Fi(w(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Li(e={}){let t=F(e.cwd??process.cwd()),n=Rr(t,{homeDir:e.home}),r=n.projectRoot,i=!L(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Ti(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${k(`[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 _(r),l;try{l=f(r,{contentDir:o})}catch(t){let i=E.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(ae),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)}`)}try{ne(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let p=await ee(r);p.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${p.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let m=await xi({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),g=e.editors??Ui(r,e.home),b=e.editors??pe.filter(e=>E[e].projectConfigPath!==void 0||E[e].projectSkillPath!==void 0),x=se(g),C=se(b),w=e.mcp===!1||m===null,re=Array.from(new Map([...x,...w?[]:C].map(e=>[e.id,e])).values()),ie=x.filter(t=>Oi(t,r,e.home)),T=[],ce=[],le=new Set;for(let t of re){if(w){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(vi(m)&&x.includes(t)&&t.scope===`global`&&T.push(ki(t,r,s,e.home)),yi(m)&&C.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ki(t,r,s,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&le.add(n)}}let de=new Set;for(let t of C){let n=t.projectSkillPath?.(r);!n||de.has(n)||(de.add(n),ce.push(ue(t,r,{home:e.home})))}let fe=!w&&m!==null&&yi(m)?C.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,me=w?[]:ie.map(e=>Mi(e,r)).filter(e=>e!==void 0).filter(e=>!le.has(e.path)),D=e.installUserSkill??h,he=e.home??ke(),O=wi(e.skills),ge=!1,A=!1,_e=!1,ve=!1;for(let t of S){let n=O.has(t);if(await te(he,v[t],n).catch(()=>{}),n){ge=!0;let n=await D({home:e.home,bundleId:t,force:!0});n===`installed`?A=!0:n===`failed`?_e=!0:ve=!0}else try{oe(he,t)}catch{}}let ye=_e?`failed`:A?`installed`:ge&&ve?`skip-current`:`declined`,be=w?`skipped-flag`:`skipped-missing`,j=T.find(e=>e.editorId===`claude`)??T[0]??{action:be,configPath:E.claude.configPath(r,e.home)},M=await Ri({projectRoot:r,desiredMode:await Ci({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:ce,legacyProjectConfigs:me,skillInstall:ye,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:j.action,mcpPath:j.configPath,mcpError:`error`in j?j.error:void 0,projectScopeUnsupportedLabels:fe,sharing:M}}async function Ri(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Tn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=Sn(t);if(n===`local-only`){let e=Cn(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`}:zi(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=wn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:zi(t,o,`remove`)}function zi(e,t,n){let r=Tn(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 Bi(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 Vi(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(A(`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(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?P(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${O(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${O(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${ge(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${Bi(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(A(`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?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${ge(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${P(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(A(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${O(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${O(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${he(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${k(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${k(` 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(k(`⚠ --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(k(`⚠ 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(_e(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ki(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(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${D(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${D(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${D(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${D(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${D(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${D(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
636
636
|
`)}function Hi(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 Ui(e,t){let n=[];for(let r of pe)Oi(E[r],e,t)&&n.push(r);return n}function Wi(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Ae(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 Gi(){return new ie(`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 re(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new re(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new re(`--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?Wi():null;try{let r;try{r=await Li({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof c||e instanceof p){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof u){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.
|
|
637
|
-
`),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-
|
|
637
|
+
`),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-D8gAl6hU.mjs`),{resolveContentDir:s}=await import(`./dist-LzL927dF.mjs`),l;try{l=o(r.projectRoot).config,i=l.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(l)try{let{previewContent:e}=await import(`./preview-B2bOO2_6.mjs`),t=s(l,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(Hi(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Vi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Ki(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
638
638
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${D(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${D(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${D(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Sn as A,He as B,Kn as C,Cn as D,Rn as E,cn as F,_t as I,mt as L,Tn as M,wn as N,On as O,xn as P,pt as R,Nr as S,Ln as T,fi as _,Hi as a,ei as b,Vi as c,Pi as d,wi as f,Li as g,Ci as h,Ri as i,Dn as j,En as k,Ki as l,Ti as m,Di as n,Ii as o,xi as p,Ai as r,Ui as s,$ as t,Gi as u,ki as v,J as w,Rr as x,Ni as y,U as z};
|
|
639
|
-
//# sourceMappingURL=init-
|
|
639
|
+
//# sourceMappingURL=init-B4vJEG6p.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./init-B4vJEG6p.mjs";export{e as runInit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Da as e,Oa as t,wa as n}from"./dist-
|
|
2
|
-
//# sourceMappingURL=launch-json-removal
|
|
1
|
+
import{Da as e,Oa as t,wa as n}from"./dist-DFesG7DS.mjs";import{E as r,w as i}from"./init-B4vJEG6p.mjs";import{t as a}from"./is-object-DAC-mmwo.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=e(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=n(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(t(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
|
|
2
|
+
//# sourceMappingURL=launch-json-removal-oDM6gkL1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DKb55SxB.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{So as e,_o as t,ps as n,vo as r}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Aa as i,_ as a,ka as o}from"./dist-
|
|
1
|
+
import{So as e,_o as t,ps as n,vo as r}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Aa as i,_ as a,ka as o}from"./dist-DFesG7DS.mjs";import{t as s}from"./constants-DxrhiJEv.mjs";import{t as c}from"./is-object-DAC-mmwo.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=n();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 _(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function v(e){let n=e??process.cwd(),c=[],u=i(`user`,n),d=o({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(n,`.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(r).join(`
|
|
2
2
|
|
|
3
3
|
`));f=h(f,m.value),c.push(p)}let v=a.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(r(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-DKb55SxB.mjs.map
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{sa as e}from"./dist-
|
|
2
|
-
//# sourceMappingURL=open-browser-
|
|
1
|
+
import{sa as e}from"./dist-DFesG7DS.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-3gSG96ZS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-C-zPM3qo.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{qt as e}from"./dist-
|
|
1
|
+
import{qt as e}from"./dist-DFesG7DS.mjs";import"./constants-DxrhiJEv.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-C-zPM3qo.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{t as e}from"./launch-json-removal-oDM6gkL1.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:s?1:0}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
|
|
2
|
+
//# sourceMappingURL=repair-launch-json-CrBdZKKa.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,v as t}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{d as e,v as t}from"./init-B4vJEG6p.mjs";import{_ as n,d as r,s as i}from"./write-project-skill-NLecUmFg.mjs";import{t as a}from"./mcp-migrate-event-BNoOQpLB.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return s.action===`declined`?(r.logger({event:`mcp-config-repair-declined`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,reason:s.declineReason}),{...i,outcome:`declined`}):{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-DCX1eS6S.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-wxyzsDDA.mjs";export{e as repairSkills};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ka as e}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Kr as t,Rr as n,Vr as r,Xr as i,d as a,ha as o,lt as s,ni as c,ua as l}from"./dist-
|
|
1
|
+
import{ka as e}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Kr as t,Rr as n,Vr as r,Xr as i,d as a,ha as o,lt as s,ni as c,ua as l}from"./dist-DFesG7DS.mjs";import{t as u}from"./esm-BNIW0EH8.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-NLecUmFg.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,rmSync as S,statSync as C,writeFileSync as w}from"node:fs";import{homedir as T}from"node:os";const E={existsSync:e=>v(e),isDirectory:e=>{try{return C(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>x(e),readFileSync:e=>b(e),writeFileSync:(e,t)=>{w(e,t)},mkdirSync:(e,t)=>{y(e,t)},rmSync:(e,t)=>{S(e,t)}},D={resolveProjectBundledSkillDir:()=>c(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>c(e,{checkDesktop:!1}),readBundledVersion:()=>r(),readRecordedVersion:e=>t(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>i(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=g(e,c.hostDir),u=g(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function P(t,n,r,i){let o=e=>{n.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await n.readRecordedVersion(t)}catch(e){i({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of s)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return i({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=a[o.id],c=r.existsSync(g(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,o.id),i({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){i({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){i({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(g(t,`.agents`,`skills`,a[e.id])));if(u!==null&&u===l&&m)return i({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===s.length,v=!0;for(let{id:e,sourceDir:n}of p){let o=j(t,a[e],n,r,i,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await n.writeRecordedVersion(t,l),i({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),i({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??T(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function L(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
|
|
2
2
|
`)}function R(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").action(async()=>{let e=await F({projectDir:_(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null});process.stdout.write(`${L(e)}\n`),process.exitCode=I(e)})}export{R as n,F as t};
|
|
3
|
-
//# sourceMappingURL=repair-skills-
|
|
3
|
+
//# sourceMappingURL=repair-skills-wxyzsDDA.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as e}from"./chunk-C94x7I9S.mjs";import{c as t,l as n,ps as r,s as i,u as a}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Aa as o,Fr as s,Oa as c,Pr as l,Tn as u,dn as d,sa as f,si as p,xn as m}from"./dist-
|
|
1
|
+
import{s as e}from"./chunk-C94x7I9S.mjs";import{c as t,l as n,ps as r,s as i,u as a}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Aa as o,Fr as s,Oa as c,Pr as l,Tn as u,dn as d,sa as f,si as p,xn as m}from"./dist-DFesG7DS.mjs";import{t as h}from"./yazl-Docqgl6q.mjs";import{t as g}from"./esm-BNIW0EH8.mjs";import"./gh-detect-DDO0PYTq.mjs";import{E as _,S as v,T as y,_ as ee,b as te,o as b,v as x,w as S}from"./init-B4vJEG6p.mjs";import{n as C}from"./constants-DxrhiJEv.mjs";import{t as w}from"./is-object-DAC-mmwo.mjs";import{_ as ne,d as re,i as ie,v as T}from"./write-project-skill-NLecUmFg.mjs";import"./loader-DKb55SxB.mjs";import{c as ae}from"./colors-DugpbXz6.mjs";import"./preview-C-zPM3qo.mjs";import{execSync as oe,spawnSync as E}from"node:child_process";import{basename as D,dirname as O,isAbsolute as k,join as A,relative as se,resolve as j,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as M,lstatSync as de,mkdirSync as N,mkdtempSync as fe,readFileSync as P,readdirSync as F,readlinkSync as pe,rmSync as I,statSync as me,writeFileSync as L}from"node:fs";import{arch as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{createHash as R}from"node:crypto";import{readFile as z,realpath as B}from"node:fs/promises";const Te=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Ee=Te.map(e=>e.name);function V(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
2
|
`).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Te)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
|
|
3
3
|
`),patterns:[...t],lineCount:n}}function De(){return A(_e(),`.ok`,`bug-reports`)}function Oe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`);return A(De(),`${t}-bugreport.zip`)}function ke(e,t){let n=A(e,`.ok`,`config.yml`);if(M(n))try{let e=P(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e instanceof Error?e.message:String(e)},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return M(A(e,`.ok`))?R(`sha256`).update(j(e)).digest(`hex`).slice(0,12):null}function Ae(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:ge(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=oe(`sw_vers -productVersion 2>/dev/null`,f({encoding:`utf8`})).trim()}catch{}try{let t=A(__dirname,`..`,`..`,`package.json`);M(t)&&(e.okVersion=JSON.parse(P(t,`utf8`)).version)}catch{}return e}function je(e,t){if(!M(t))return{files:[]};let n=F(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>A(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return P(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Me(e){let t=A(e,`.ok`,`local`);return M(t)?{files:[`server.lock`,`last-spawn-error.log`].map(e=>A(t,e)).filter(e=>M(e))}:{files:[]}}function Ne(e){let t=A(e,`.ok`,`local`,`logs`);return M(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>A(t,e)).filter(e=>M(e))}:{files:[]}}function Pe(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=V(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function H(e){for(let t of e.files)try{Pe({zipfile:e.zipfile,name:`${e.prefix}/${D(t)}`,content:P(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n instanceof Error?n.message:String(n)},`bug-report: skipped unreadable file`)}}async function Fe(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??A(_e(),`.ok`,`logs`),o=t.projectDir?ke(t.projectDir,i):null;N(O(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ae();s.desktop=t.desktop??null;let{files:c}=je(o,a),{files:l}=t.projectDir?Me(t.projectDir):{files:[]},{files:u}=t.projectDir?Ne(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-CQSNnbvt.mjs`).then(t=>e(t.default,1)),m=new p;H({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),H({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),H({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=P(e.sourcePath),n=`extra/${e.zipName??D(e.sourcePath)}`;m.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Pe({zipfile:m,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let h=JSON.stringify(s,null,2);m.addBuffer(Buffer.from(h,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let g={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};m.addBuffer(Buffer.from(JSON.stringify(g,null,2),`utf8`),`MANIFEST.json`);let _=d.reduce((e,t)=>e+t.lineCount,0),v=[`# Bug Report Bundle`,``,`Generated: ${g.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${g.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${Ee.join(`, `)}`,_>0?`${_} line(s) were scrubbed across ${d.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
4
4
|
`);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=ue(r);return m.outputStream.pipe(y),await new Promise((e,t)=>{y.on(`close`,e),y.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:_},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:_,generatedAt:g.generatedAt}}}const Ie=new Set([`doc.name`]);function Le(e){return`doc:${R(`blake2b512`,{outputLength:32}).update(e).digest(`hex`).slice(0,8)}`}function Re(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function ze(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=Le(e);return t.originalToHashed.set(e,r),Re(t,e,r),r}function U(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function W(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G(e,t){if(typeof e==`string`)return U(e,t.contentDir);if(Array.isArray(e))return e.map(e=>G(e,t));if(!W(e))return e;let n=typeof e.key==`string`&&Ie.has(e.key)&&W(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&W(a)){let e=ze(n,t);r[i]={...a,stringValue:e}}else Ie.has(i)&&typeof a==`string`?r[i]=ze(a,t):r[i]=G(a,t);return r}function Be(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Ve(e,t){let n=P(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
@@ -18,4 +18,4 @@ import{s as e}from"./chunk-C94x7I9S.mjs";import{c as t,l as n,ps as r,s as i,u a
|
|
|
18
18
|
`).replace(/\n/g,`\r
|
|
19
19
|
`));let d=`${i?``:``}${u}`;return d!==r&&c(e,d,{mode:S(e)}),{kind:`removed`}}const qt=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Jt(e,t,n=u){if(e!==void 0&&!qt.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Yt=null;function Xt(e){Yt=e}function Zt(){return Yt??process.cwd()}var Z=e(ae(),1);function Qt(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function $t(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function en(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:m(r),command:r,isDesktop:Qt(r)}}function tn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&tn(e)?`ui-orphan`:`stale`}const nn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function rn(e){switch(e){case`running`:return Z.default.green(e);case`desktop`:return Z.default.blue(e);case`foreign`:return Z.default.cyan(e);case`ui-orphan`:return Z.default.magenta(e);case`stale`:return Z.default.yellow(e)}}function an(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function on(e){return`${an(e.server.usage)} | ${an(e.ui?.usage??null)}`}function sn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function cn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,sn(e),on(e),t,String(n),$t(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=rn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=Z.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
20
20
|
`)}async function ln(e={}){let t=e.discover??d,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??l,a=e.resolveUsage??s,o=await t(),c=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=en(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&c.push(o)}if(e.json){let e=c.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(cn(e.all?c:c.filter(e=>nn.has(Q(e)))))}function un(){return new g(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await ln({all:t.all===!0||e===`all`,json:t.json===!0})})}function dn(e,n,r={}){let i=r.isAlive??t,a=[];for(let[t,r]of[[`server`,e],[`ui`,n]])(r.status===`alive`||r.status===`foreign-host`&&i(r.lock.pid))&&a.push({name:t,pid:r.lock.pid,port:r.lock.port});return{targets:a}}function fn(e){let t=e.inspect??(t=>X(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=dn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function pn(e,n=t){let r=await d(),i=null;for(let t of r){let r=X(t,`server`),a=X(t,`ui`);if($(r,n)&&r.lock.port===e||$(a,n)&&a.lock.port===e)return t;i===null&&($(r,n)&&r.lock.pid===e||$(a,n)&&a.lock.pid===e)&&(i=t)}return i}function mn(e){let t=fn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function hn(e){return new g(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async n=>{let r=n.length===0?void 0:n.join(` `);if(r===void 0){e();let t=fn({lockDir:p(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await ln({});return}if(r===`all`){let e=await d();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let n=0;for(let r of e){let e=X(r,`server`),i=X(r,`ui`);!$(e,t)&&!$(i,t)||(mn(r),n++)}n===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(r)){let e=Number.parseInt(r,10),t=await pn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}mn(t);return}mn(p(j(Zt(),r)))})}function gn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function _n(e,t){let n,r;try{n=await B(j(e)),r=await B(j(O(e)))}catch{return{kind:`not-git`}}if(!yn(n,r))return{kind:`symlink-escape`};let i=A(n,`.git`),a;try{a=me(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await B(i)}catch{return{kind:`not-git`}}if(!yn(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await z(i,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),a=k(r)?r:j(n,r);try{o=await B(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=A(await vn(o),`config`),c;try{c=await z(s,`utf-8`)}catch{return{kind:`not-git`}}let l=xn(c);if(l===null)return{kind:`no-origin`};let u=kt(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function vn(e){let t;try{t=(await z(A(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=k(t)?t:j(e,t);try{return await B(n)}catch{return n}}function yn(e,t){if(e===t)return!0;let n=se(t,e);return n.length>0&&!n.startsWith(`..`)&&!k(n)}function bn(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function xn(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=bn(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return Sn(r[1])}return null}function Sn(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const Cn=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=x(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=ie(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function wn(e,t,n={},r=Cn){let i=[];for(let a of t){let t=re[a];for(let a of r)i.push(a.write(t,e,n))}return i}function Tn(e,t,n={}){return{integrations:wn(e,t,n)}}export{Dt as C,V as D,Oe as E,X as S,wt as T,zt as _,hn as a,jt as b,Xt as c,Nt as d,Ft as f,Rt as g,It as h,fn as i,Jt as l,Bt as m,_n as n,un as o,Pt as p,gn as r,Zt as s,Tn as t,Ut as u,At as v,Ct as w,kt as x,Mt as y};
|
|
21
|
-
//# sourceMappingURL=src-
|
|
21
|
+
//# sourceMappingURL=src-BYGc6Nen.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Kn as e,_t as t}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Nr as n,Sr as r,lr as i}from"./dist-0Mfowk3R.mjs";import{n as a,t as o}from"./esm-BNIW0EH8.mjs";import{i as s,t as c}from"./gh-detect-DDO0PYTq.mjs";import{n as l}from"./constants-DJC5MEix.mjs";import{spawn as u}from"node:child_process";import{basename as d,dirname as f,join as p}from"node:path";import{closeSync as m,existsSync as h,mkdirSync as g,openSync as _,statSync as v}from"node:fs";import{homedir as y}from"node:os";import{rm as b}from"node:fs/promises";import{setTimeout as x}from"node:timers/promises";const S=`OpenKnowledge.app`,C=`/Applications/${S}`;function w(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return v(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function T(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(E(e,C))return C;let t=p(e.homeDir??y(),`Applications`,S);return E(e,t)?t:null}function E(e,t){try{let n=p(t,`Contents`,`MacOS`,`OpenKnowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function D(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`)return{available:!1,reason:`darwin-only`};let t;try{t=T(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:e.isTTY!==!0||e.env.SSH_CONNECTION||e.env.SSH_TTY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function O(e){(e.log??(e=>console.error(e)))("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let t={...process.env};delete t.ELECTRON_RUN_AS_NODE,e.spawn(`open`,[`-b`,`com.inkeep.open-knowledge`],{detached:!0,stdio:`ignore`,env:t}).unref()}function k(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${C}. Install via DMG, or omit --mode for browser mode.`;case`darwin-only`:return`Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect desktop bundle at ${C} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${C} but launch dispatch did not fire (caller bug).`}}function A(e){return p(f(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const j=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function M(e){if(e.platform!==`darwin`||!j.test(e.execPath))return null;let t=A(e.execPath);return e.exists(t)?t:null}function N(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??h,a=r[1];return a?{command:M({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function P(e,t){return e.host??t.HOST??`127.0.0.1`}function F(e){let t=d(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var I=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function L(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function R(t){h(t.lockDir)||g(t.lockDir,{recursive:!0});let n=_(p(t.lockDir,e),`w`),r=t.spawn??u,{PORT:i,...a}=process.env,o=N();try{let e=r(o.command,[...o.prefixArgs,...t.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,n],windowsHide:!0,cwd:t.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return e.unref(),e}finally{try{m(n)}catch{}}}function z(e,t,n){return e??(n===void 0?t:void 0)}function B(e,t){return e!==void 0&&t!==null&&t.port>0&&t.draining!==!0}function V(e,t,n){return e??(t!=null&&!n?1:0)}async function H(e){let t=e.spawn??u,n=N(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,windowsHide:!0,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=V(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function U(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const W=t;function G(e,t,n=e=>b(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function K(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:i?1:0,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(i?1:0)}}}function q(e){let t=e.sigtermGraceMs??W,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>x(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function J(e){let{config:t,cwd:a,host:o}=e,l=e.skipAutoInit??!1,u=e.skipUiAutoSpawn??!1,d=e.idleThresholdMs??18e5,{existsSync:f,mkdirSync:p}=await import(`node:fs`),{basename:m,dirname:h}=await import(`node:path`),{bootServer:g,getLogger:_,isProcessAlive:v,readUiLock:y,resolveContentDir:b,resolveLockDir:S,waitForServerLockDrain:C}=await import(`./dist-ByqNBEyQ.mjs`),w=e.log??_(`start`),T=e.singleFile!==void 0,E=e.projectDir??a,D=T?n(e.singleFile).canonicalFilePath:void 0,O=D?h(D):void 0,k=D?m(D):void 0;if(!T){if(!l&&!i(a))throw new I(a);let t=process.env.OK_RECLAIM_DISABLE??null,n=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&w.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-Bid881e6.mjs`)).repairMcpConfigs)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-jpDBAb4m.mjs`)).repairLaunchJson)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-BkNgLJzB.mjs`)).repairSkills)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let A=O??b(t,a);!T&&!f(A)&&(p(A,{recursive:!0}),w.info({contentDir:A},`Created content directory`));let j=null,M=async({lockDir:t})=>{if(j=L({uiLock:y(t),isAlive:v}),j.action===`spawn`&&!u)try{let n=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];R({lockDir:t,cwd:a,spawn:e.spawn,args:n}),w.info({reason:j.reason,uiPort:e.uiPort},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else j.action===`skip`&&w.info({port:j.port,pid:j.pid},`UI already running at port ${j.port}`)},N=e.reactShellDistDir===void 0,P=s(),F=r();{let e=S(T?E:a),t=Date.now(),n=await C(e);n!==`no-drain`&&w.info({event:`start-waited-for-draining-predecessor`,outcome:n,waitedMs:Date.now()-t,drainLockDir:e},n===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let z=await g({config:t,contentDir:A,projectDir:T?E:a,contentRoot:T?void 0:t.content.dir,port:e.port,host:o,quiet:!1,detectGh:c,tokenStore:P,embeddingsKeyStore:F,...T?{ephemeral:!0,singleDocRelPath:k,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:N,idleShutdownMs:d,skipAutoInit:!0,...N?{spawnUiSiblingFn:M}:{},idleShutdownHandler:t=>{let n=q({readUiLock:()=>y(z.lockDir),isAlive:v,killPid:(e,t)=>{process.kill(e,t)},destroy:t,log:w});return K(T?G(n,E):n,{log:w,exit:e.idleExit})},log:w,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});j||={action:`skip`,reason:`alive`,pid:0,port:0};let B=j,V=null;if(B.action===`skip`)V=B.port>0?B.port:null;else if(!u){let t=e.uiBindTimeoutMs??3e3;V=await U({readUiLock:()=>y(z.lockDir),now:Date.now,sleep:e=>x(e),timeoutMs:t,pollIntervalMs:50}),V===null&&w.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:z.httpServer,destroy:z.destroy,lockDir:z.lockDir,contentDir:A,port:z.port,ready:z.ready,degraded:z.degraded,uiSpawnDecision:j,resolvedUiPort:V}}function ee(e){if(e===`browser`||e===`app`)return e;throw new a(`--mode must be 'browser' or 'app'`)}function te(e){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<1||t>65535)throw new a(`--ui-port must be a port number between 1 and 65535`);return t}function Y(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function X(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Z(e,t){let n=Y(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner-BeBA-IMp.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-C2Tw16G0.mjs`),c=process.cwd(),u=e;process.title=F(c);let d=P(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=z(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./dist-ByqNBEyQ.mjs`);if(B(m,e(t(c)))){await H({cwd:c,uiPort:m});return}}let g;try{g=await J({config:u,cwd:c,host:d,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets===void 0?{}:{serveContentAssets:t.serveContentAssets},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof I&&(console.error(o(e.message)),process.exit(1));let t=await import(`./dist-ByqNBEyQ.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&Q(e,t)){await H({cwd:c,uiPort:m});return}let n=$(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=X(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${d}:${g.port}`,b=d===`0.0.0.0`||d===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${d}:${x}`:y;console.log(r({name:`open-knowledge`,version:l,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-CZY2ZKg0.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function Q(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function $(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=p(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function ne(e){return new o(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,te).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,ee).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
1
|
+
import{Kn as e,_t as t}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Nr as n,Sr as r,lr as i}from"./dist-DFesG7DS.mjs";import{n as a,t as o}from"./esm-BNIW0EH8.mjs";import{i as s,t as c}from"./gh-detect-DDO0PYTq.mjs";import{n as l}from"./constants-DxrhiJEv.mjs";import{spawn as u}from"node:child_process";import{basename as d,dirname as f,join as p}from"node:path";import{closeSync as m,existsSync as h,mkdirSync as g,openSync as _,statSync as v}from"node:fs";import{homedir as y}from"node:os";import{rm as b}from"node:fs/promises";import{setTimeout as x}from"node:timers/promises";const S=`OpenKnowledge.app`,C=`/Applications/${S}`;function w(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return v(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function T(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(E(e,C))return C;let t=p(e.homeDir??y(),`Applications`,S);return E(e,t)?t:null}function E(e,t){try{let n=p(t,`Contents`,`MacOS`,`OpenKnowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function D(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`)return{available:!1,reason:`darwin-only`};let t;try{t=T(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:e.isTTY!==!0||e.env.SSH_CONNECTION||e.env.SSH_TTY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function O(e){(e.log??(e=>console.error(e)))("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let t={...process.env};delete t.ELECTRON_RUN_AS_NODE,e.spawn(`open`,[`-b`,`com.inkeep.open-knowledge`],{detached:!0,stdio:`ignore`,env:t}).unref()}function k(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${C}. Install via DMG, or omit --mode for browser mode.`;case`darwin-only`:return`Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect desktop bundle at ${C} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${C} but launch dispatch did not fire (caller bug).`}}function A(e){return p(f(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const j=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function M(e){if(e.platform!==`darwin`||!j.test(e.execPath))return null;let t=A(e.execPath);return e.exists(t)?t:null}function N(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??h,a=r[1];return a?{command:M({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function P(e,t){return e.host??t.HOST??`127.0.0.1`}function F(e){let t=d(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var I=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function L(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function R(t){h(t.lockDir)||g(t.lockDir,{recursive:!0});let n=_(p(t.lockDir,e),`w`),r=t.spawn??u,{PORT:i,...a}=process.env,o=N();try{let e=r(o.command,[...o.prefixArgs,...t.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,n],windowsHide:!0,cwd:t.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return e.unref(),e}finally{try{m(n)}catch{}}}function z(e,t,n){return e??(n===void 0?t:void 0)}function B(e,t){return e!==void 0&&t!==null&&t.port>0&&t.draining!==!0}function V(e,t,n){return e??(t!=null&&!n?1:0)}async function H(e){let t=e.spawn??u,n=N(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,windowsHide:!0,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=V(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function U(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const W=t;function G(e,t,n=e=>b(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function K(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:i?1:0,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(i?1:0)}}}function q(e){let t=e.sigtermGraceMs??W,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>x(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function J(e){let{config:t,cwd:a,host:o}=e,l=e.skipAutoInit??!1,u=e.skipUiAutoSpawn??!1,d=e.idleThresholdMs??18e5,{existsSync:f,mkdirSync:p}=await import(`node:fs`),{basename:m,dirname:h}=await import(`node:path`),{bootServer:g,getLogger:_,isProcessAlive:v,readUiLock:y,resolveContentDir:b,resolveLockDir:S,waitForServerLockDrain:C}=await import(`./dist-LzL927dF.mjs`),w=e.log??_(`start`),T=e.singleFile!==void 0,E=e.projectDir??a,D=T?n(e.singleFile).canonicalFilePath:void 0,O=D?h(D):void 0,k=D?m(D):void 0;if(!T){if(!l&&!i(a))throw new I(a);let t=process.env.OK_RECLAIM_DISABLE??null,n=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&w.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-DCX1eS6S.mjs`)).repairMcpConfigs)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-CrBdZKKa.mjs`)).repairLaunchJson)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-DADzcSUt.mjs`)).repairSkills)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){w.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let A=O??b(t,a);!T&&!f(A)&&(p(A,{recursive:!0}),w.info({contentDir:A},`Created content directory`));let j=null,M=async({lockDir:t})=>{if(j=L({uiLock:y(t),isAlive:v}),j.action===`spawn`&&!u)try{let n=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];R({lockDir:t,cwd:a,spawn:e.spawn,args:n}),w.info({reason:j.reason,uiPort:e.uiPort},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else j.action===`skip`&&w.info({port:j.port,pid:j.pid},`UI already running at port ${j.port}`)},N=e.reactShellDistDir===void 0,P=s(),F=r();{let e=S(T?E:a),t=Date.now(),n=await C(e);n!==`no-drain`&&w.info({event:`start-waited-for-draining-predecessor`,outcome:n,waitedMs:Date.now()-t,drainLockDir:e},n===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let z=await g({config:t,contentDir:A,projectDir:T?E:a,contentRoot:T?void 0:t.content.dir,port:e.port,host:o,quiet:!1,detectGh:c,tokenStore:P,embeddingsKeyStore:F,...T?{ephemeral:!0,singleDocRelPath:k,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:N,idleShutdownMs:d,skipAutoInit:!0,...N?{spawnUiSiblingFn:M}:{},idleShutdownHandler:t=>{let n=q({readUiLock:()=>y(z.lockDir),isAlive:v,killPid:(e,t)=>{process.kill(e,t)},destroy:t,log:w});return K(T?G(n,E):n,{log:w,exit:e.idleExit})},log:w,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});j||={action:`skip`,reason:`alive`,pid:0,port:0};let B=j,V=null;if(B.action===`skip`)V=B.port>0?B.port:null;else if(!u){let t=e.uiBindTimeoutMs??3e3;V=await U({readUiLock:()=>y(z.lockDir),now:Date.now,sleep:e=>x(e),timeoutMs:t,pollIntervalMs:50}),V===null&&w.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:z.httpServer,destroy:z.destroy,lockDir:z.lockDir,contentDir:A,port:z.port,ready:z.ready,degraded:z.degraded,uiSpawnDecision:j,resolvedUiPort:V}}function ee(e){if(e===`browser`||e===`app`)return e;throw new a(`--mode must be 'browser' or 'app'`)}function te(e){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<1||t>65535)throw new a(`--ui-port must be a port number between 1 and 65535`);return t}function Y(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function X(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Z(e,t){let n=Y(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner-BeBA-IMp.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-C2Tw16G0.mjs`),c=process.cwd(),u=e;process.title=F(c);let d=P(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=z(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./dist-LzL927dF.mjs`);if(B(m,e(t(c)))){await H({cwd:c,uiPort:m});return}}let g;try{g=await J({config:u,cwd:c,host:d,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets===void 0?{}:{serveContentAssets:t.serveContentAssets},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof I&&(console.error(o(e.message)),process.exit(1));let t=await import(`./dist-LzL927dF.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&Q(e,t)){await H({cwd:c,uiPort:m});return}let n=$(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=X(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${d}:${g.port}`,b=d===`0.0.0.0`||d===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${d}:${x}`:y;console.log(r({name:`open-knowledge`,version:l,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-3gSG96ZS.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function Q(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function $(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=p(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function ne(e){return new o(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,te).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,ee).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
2
2
|
`),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.uiPort!==void 0&&e.push(`--ui-port`),t.host!==void 0&&e.push(`--host`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=D(w());if(n.available){O({spawn:u});return}console.error(k(n.reason)),process.exit(1)}await Z(n,t)})}export{D as C,w as S,ne as _,V as a,K as b,F as c,z as d,P as f,R as g,B as h,q as i,X as l,Z as m,U as n,H as o,Y as p,J as r,L as s,I as t,Q as u,$ as v,O as w,N as x,G as y};
|
|
3
|
-
//# sourceMappingURL=start-
|
|
3
|
+
//# sourceMappingURL=start-BjKuLBjR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,f as t,r as n}from"./start-BjKuLBjR.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Et as e,Rt as t,S as n,gn as r}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Ea as i,d as a,lt as o,ni as s}from"./dist-
|
|
1
|
+
import{Et as e,Rt as t,S as n,gn as r}from"./server-lock-iLcBw_q0-DK2Tcu84.mjs";import{Ea as i,d as a,lt as o,ni as s}from"./dist-DFesG7DS.mjs";import{basename as c,dirname as l,isAbsolute as u,join as d,posix as f,relative as ee,resolve as p,sep as m,win32 as h}from"node:path";import{cpSync as te,existsSync as g,lstatSync as _,mkdirSync as ne,readFileSync as re,realpathSync as v,rmSync as y,statSync as b}from"node:fs";import{homedir as x}from"node:os";const S=n,C=e,w=t,T=`node`,E={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`},D=`# ok-mcp-v1`,O=`# ok-mcp-v1
|
|
2
2
|
USER_BUNDLE="$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
3
3
|
[ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
|
|
4
4
|
BUNDLE="/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
@@ -33,4 +33,4 @@ foreach ($d in $dirs) {
|
|
|
33
33
|
}
|
|
34
34
|
[Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
|
|
35
35
|
exit 127`,A=`// ok-pi-bridge`,j=`${A}-v1`,M=`ok-pi-managed-extension`;function N(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(j)}return!1}function P(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=p(e);if(c(t)===`cli.mjs`&&c(l(t))===`dist`)return t;let n=t.split(m),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return d(i.length===0?m:i.join(m),`packages`,`cli`,`dist`,`cli.mjs`)}function F(e={}){return e.mode===`dev`?{command:T,args:[P(),`mcp`],env:{...E}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,k]}:{command:`/bin/sh`,args:[`-l`,`-c`,O]}}function ae(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[T,P(),`mcp`],environment:{...E}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,k]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,O]}}function oe(e){if(typeof e!=`object`||!e)return!1;let t=e;return I(t,F({mode:`published`,platformName:`darwin`}))||I(t,F({mode:`published`,platformName:`win32`}))}function I(e,t){if(Object.keys(e).length!==Object.keys(t).length||e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function L(e){return e===`win32`?h:f}function R(e={}){let t=e.platformName??process.platform,n=e.home??x(),r=e.env??process.env,i=L(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function z(e={}){let t=e.platformName??process.platform,n=e.home??x();return L(t).join(n,`.claude.json`)}function B(e={}){let t=e.platformName??process.platform,n=e.home??x(),r=e.env??process.env;if(t===`darwin`)return f.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??h.join(n,`AppData`,`Roaming`);return h.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function V(e={}){let t=e.platformName??process.platform,n=e.home??x();return L(t).join(n,`.cursor`,`mcp.json`)}function H(e={}){let t=e.platformName??process.platform,n=e.home??x();return(e.env??process.env).CODEX_HOME??L(t).join(n,`.codex`)}function U(e={}){return L(e.platformName??process.platform).join(H(e),`config.toml`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??x(),r=(e.env??process.env).COPILOT_HOME??L(t).join(n,`.copilot`);return L(t).join(r,`mcp-config.json`)}function G(e={}){let t=e.platformName??process.platform,n=e.home??x(),r=e.env??process.env,i=L(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function K(e={}){return L(e.platformName??process.platform).join(G(e),`opencode.json`)}function se(e={}){let t=e.platformName??process.platform,n=e.home??x();return L(t).join(n,`.openclaw`,`openclaw.json`)}function ce(e={}){let t=e.platformName??process.platform,n=e.home??x();return L(t).join(n,`.hermes`,`config.yaml`)}function le(e={}){let t=e.platformName??process.platform,n=e.home??x();return(e.env??process.env).PI_CODING_AGENT_DIR??L(t).join(n,`.pi`,`agent`)}function ue(e={}){let t=e.platformName??process.platform,n=e.home??x();return L(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function de(e,t){let n=L(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function q(e={}){let t=e.platformName??process.platform,n=de(e.home??x(),t);return n.find(e=>g(e))||n.find(e=>g(l(e)))||n[0]}const J={claude:{id:`claude`,label:C.claude,configPath:(e,t)=>z({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>d(t??x(),`.claude`),projectConfigPath:e=>d(e,`.mcp.json`),projectSkillPath:e=>d(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:C[`claude-desktop`],configPath:(e,t)=>B({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>l(B({home:t}))},cursor:{id:`cursor`,label:C.cursor,configPath:(e,t)=>V({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>l(V({home:t})),projectConfigPath:e=>d(e,`.cursor`,`mcp.json`),projectSkillPath:e=>d(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:C.codex,configPath:(e,t)=>U({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>l(U({home:t})),projectConfigPath:e=>d(e,`.codex`,`config.toml`),projectSkillPath:e=>d(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:C.copilot,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>l(W({home:t})),projectSkillPath:e=>d(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:C.opencode,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>r,buildEntry:(e,t)=>ae(t),scope:`global`,detectPath:(e,t)=>l(K({home:t})),projectConfigPath:e=>d(e,`opencode.json`),projectSkillPath:e=>d(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:C.openclaw,configPath:(e,t)=>se({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>d(t??x(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:C.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>le({home:t}),projectConfigPath:e=>d(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>d(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:C.antigravity,configPath:(e,t)=>ue({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>d(t??x(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:C[`lm-studio`],configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>l(q({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:C.hermes,configPath:(e,t)=>ce({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>r,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>d(t??x(),`.hermes`),offerOnlyWhenDetected:!0}};function fe(e){let t=e.filter(e=>!Object.hasOwn(J,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${S.join(`, `)}`);return e.map(e=>J[e])}function Y(e){let t=[];for(let n of o){let r=a[n];t.push({path:d(e,`.agents`,`skills`,r),bundleId:n,scope:`central`});for(let i of w)t.push({path:d(e,i.hostDir,`skills`,r),bundleId:n,scope:`host`,hostDir:i.hostDir})}return t}function pe(e,t){let n=[];for(let r of Y(e))if(r.bundleId===t)try{y(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}function X(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Z(e,t){Q(e,t)}function Q(e,t){let n;try{n=v(t)}catch{n=p(t)}let r=l(e);for(;r.length>1&&r!==m;){let t;try{t=v(r)}catch(e){if(e.code===`ENOENT`){r=l(r);continue}throw e}let i=ee(n,t);if(i===``||!i.startsWith(`..`)&&!u(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function me(e,t,n){try{if(b(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let a=[],o=i(r.charCodeAt(0)===65279?r.slice(1):r,a,{allowTrailingComma:!0,disallowComments:!1});if(a.length>0||!$(o))return!1;let s=o[e.topLevelKey];if(!$(s))return!1;let c=e.serverMapSubKey?s[e.serverMapSubKey]:s;return $(c)?$(c[e.serverName(t)]):!1}function he(e,t,n={}){if(e.id!==`copilot`)return!0;try{return me(e,t,e.configPath(t,n.home))}catch{return!1}}function ge(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!he(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=s(`project`,{checkDesktop:!0}),i=l(r);X(i,t);let a=g(r)?`overwritten`:`written`;return y(i,{recursive:!0,force:!0}),ne(l(i),{recursive:!0}),te(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function _e(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=l(n);return g(n)?(Z(r,t),y(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}export{N as _,pe as a,fe as b,D as c,J as d,w as f,F as g,M as h,ge as i,ie as l,j as m,Z as n,Y as o,A as p,_e as r,S as s,X as t,C as u,oe as v,R as y};
|
|
36
|
-
//# sourceMappingURL=write-project-skill-
|
|
36
|
+
//# sourceMappingURL=write-project-skill-NLecUmFg.mjs.map
|
package/package.json
CHANGED
package/dist/init-D_2w4_8n.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./init-CUBRtkez.mjs";export{e as runInit};
|
package/dist/loader-QudPqlKw.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-DRR095Jj.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-BUUT3N0t.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./repair-skills-g00h1ESt.mjs";export{e as repairSkills};
|
package/dist/start-BZ29iacu.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,r as n}from"./start-CC6n9G3S.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|