@inkeep/open-knowledge 0.77.8-beta.4 → 0.77.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-1-jHpFdP.mjs +1 -0
- package/dist/{dist-gqMlO9g5.mjs → dist-BRmQARr7.mjs} +411 -411
- package/dist/{dist-DeiwO3MR.mjs → dist-DGV6rhfK.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-CFf-vzns.mjs → init-CRhBH-xN.mjs} +2 -2
- package/dist/init-LrcmaMcR.mjs +1 -0
- package/dist/{launch-json-removal-D9mgGj4R.mjs → launch-json-removal-hlZNB90A.mjs} +1 -1
- package/dist/loader-B71GIjWF.mjs +1 -0
- package/dist/{loader-C8ungxA-.mjs → loader-lnI-1rAM.mjs} +1 -1
- package/dist/{open-browser-Dz6ZNMx3.mjs → open-browser-bOzBzOZ6.mjs} +1 -1
- package/dist/{preview-BmhqER23.mjs → preview-NwxcqmPs.mjs} +1 -1
- package/dist/preview-_z9VMNyT.mjs +1 -0
- package/dist/public/assets/FeedbackForm-BlFN1t8r.js +1 -0
- package/dist/public/assets/{SettingsDialogBody-PkAF1NWq.js → SettingsDialogBody-DwmjT0E6.js} +3 -3
- package/dist/public/assets/auth-state-cache-Bbm6ItZO.js +11 -0
- package/dist/public/assets/{index-CmZaF1ZN.js → index-BBx8twze.js} +4 -4
- package/dist/public/index.html +2 -2
- package/dist/{registry-probes-DHmK7jds.mjs → registry-probes-C42YMvXs.mjs} +1 -1
- package/dist/{removal-file-path-C7XpTQRM.mjs → removal-file-path-BXAPQUp8.mjs} +1 -1
- package/dist/{repair-launch-json-Cb8wDT6u.mjs → repair-launch-json-C06HfMzF.mjs} +1 -1
- package/dist/{repair-mcp-configs-CZZ3fR_M.mjs → repair-mcp-configs-BPrFDUSa.mjs} +1 -1
- package/dist/src-BT4chHsx.mjs +1 -0
- package/dist/{src-D3KPuz63.mjs → src-FuPtVCbU.mjs} +1 -1
- package/dist/{start-aZzUOJ6v.mjs → start-CaFW4TBq.mjs} +3 -3
- package/dist/start-DmkEIG7F.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-CSW6t2yy.mjs +0 -1
- package/dist/init-BCwWiNSj.mjs +0 -1
- package/dist/loader-C43Fdp6B.mjs +0 -1
- package/dist/preview-DESRsUSK.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DJIDBxTU.js +0 -1
- package/dist/public/assets/auth-state-cache-WR_DCUgj.js +0 -11
- package/dist/src-DAcA5iRb.mjs +0 -1
- package/dist/start-1vyehNc4.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bt as e,Fa as t,Iu as n,Mo as r,Pl as i,Ps as a,Sn as o,Wo as s,Yl as c,Yn as l,_n as u}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{$ as d,$a as f,$i as p,$n as m,$r as h,$t as g,A as _,Aa as v,Ai as y,An as b,Ar as x,At as S,B as C,Ba as w,Bi as T,Bn as E,Bo as D,Br as O,Bt as k,C as A,Ca as j,Ci as M,Cn as N,Cr as P,Ct as F,D as I,Da as L,Di as R,Dn as z,Dr as B,Dt as V,E as H,Ea as U,Ei as W,En as G,Er as K,Et as q,F as J,Fa as Y,Fi as X,Fn as Z,Fr as Q,Ft as $,G as ee,Ga as te,Gi as ne,Gn as re,Go as ie,Gr as ae,Gt as oe,H as se,Ha as ce,Hi as le,Hn as ue,Hr as de,Ht as fe,I as pe,Ia as me,Ii as he,In as ge,Ir as _e,It as ve,J as ye,Ja as be,Ji as xe,Jn as Se,Jo as Ce,Jr as we,Jt as Te,K as Ee,Ka as De,Ki as Oe,Kn as ke,Ko as Ae,Kr as je,Kt as Me,L as Ne,La as Pe,Li as Fe,Ln as Ie,Lr as Le,Lt as Re,M as ze,Ma as Be,Mi as Ve,Mn as He,Mr as Ue,Mt as We,N as Ge,Na as Ke,Ni as qe,Nn as Je,Nr as Ye,Nt as Xe,O as Ze,Oa 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,Qa as ut,Qi as dt,Qn as ft,Qo as pt,Qr as mt,Qt as ht,R as gt,Ra as _t,Ri as vt,Rn as yt,Rr as bt,Rt as xt,S as St,Sa as Ct,Si as wt,Sn as Tt,Sr as Et,St as Dt,T as Ot,Ta as kt,Ti as At,Tn as jt,Tr as Mt,Tt as Nt,U as Pt,Ua as Ft,Ui as It,Un as Lt,Ur as Rt,Ut as zt,V as Bt,Va as Vt,Vi as Ht,Vn as Ut,Vr as Wt,Vt as Gt,W as Kt,Wa as qt,Wi as Jt,Wn as Yt,Wo as Xt,Wr as Zt,Wt as Qt,X as $t,Xa as en,Xi as tn,Xn as nn,Xo as rn,Xr as an,Xt as on,Y as sn,Ya as cn,Yi as ln,Yn as un,Yo as dn,Yr as fn,Yt as pn,Z as mn,Za as hn,Zi as gn,Zn as _n,Zo as vn,Zr as yn,Zt as bn,_ as xn,_a as Sn,_i as Cn,_n as wn,_r as Tn,_t as En,a as Dn,aa as On,ai as kn,an as An,ao as jn,ar as Mn,at as Nn,b as Pn,ba as Fn,bi as In,bn as Ln,br as Rn,bt as zn,c as Bn,ca as Vn,ci as Hn,cn as Un,co as Wn,cr as Gn,ct as Kn,d as qn,da as Jn,di as Yn,dn as Xn,do as Zn,dr as Qn,dt as $n,ea as er,ei as tr,en as nr,eo as rr,er as ir,et as ar,f as or,fa as sr,fi as cr,fn as lr,fo as ur,fr as dr,ft as fr,g as pr,ga as mr,gi as hr,gn as gr,gr as _r,gt as vr,h as yr,ha as br,hi as xr,hn as Sr,ho as Cr,hr as wr,ht as Tr,i as Er,ia as Dr,ii as Or,in as kr,io as Ar,ir as jr,it as Mr,j as Nr,ja as Pr,ji as Fr,jn as Ir,jr as Lr,jt as Rr,k as zr,ka as Br,ki as Vr,kn as Hr,kr as Ur,kt as Wr,l as Gr,la as Kr,li as qr,ln as Jr,lo as Yr,lr as Xr,lt as Zr,m as Qr,ma as $r,mi as ei,mn as ti,mo as ni,mr as ri,mt as ii,n as ai,na as oi,ni as si,nn as ci,no as li,nr as ui,nt as di,o as fi,oa as pi,oi as mi,on as hi,oo as gi,or as _i,ot as vi,p as yi,pa as bi,pi as xi,pn as Si,po as Ci,pr as wi,pt as Ti,q as Ei,qa as Di,qi as Oi,qn as ki,qo as Ai,qr as ji,qt as Mi,r as Ni,ra as Pi,ri as Fi,rn as Ii,ro as Li,rr as Ri,rt as zi,s as Bi,sa as Vi,si as Hi,sn as Ui,so as Wi,sr as Gi,st as Ki,t as qi,ta as Ji,ti as Yi,tn as Xi,to as Zi,tr as Qi,tt as $i,u as ea,ua as ta,ui as na,un as ra,uo as ia,ur as aa,ut as oa,v as sa,va as ca,vi as la,vn as ua,vr as da,vt as fa,w as pa,wa as ma,wi as ha,wn as ga,wr as _a,wt as va,x as ya,xa as ba,xi as xa,xn as Sa,xr as Ca,xt as wa,y as Ta,ya as Ea,yi as Da,yn as Oa,yr as ka,yt as Aa,z as ja,za as Ma,zi as Na,zn as Pa,zo as Fa,zr as Ia,zt as La}from"./dist-gqMlO9g5.mjs";export{qi as AGENT_ID_MAX_LEN,ai as AGENT_ID_RE,Ni as AGENT_WRITE_ORIGIN,Er as AcpPermissionStore,Dn as AcpRegistry,fi as AcpThreadManager,Bi as AgentFocusBroadcaster,Bn as AgentPresenceBroadcaster,Gr as AgentSessionCapacityError,ea as AgentSessionManager,qn as AutoStartDisabledError,or as BUNDLE_IDS,yi as BUNDLE_SCOPE,Qr as BUNDLE_SKILL_NAME,yr as BacklinkIndex,pr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,xn as CONCURRENT_REPLACE_WINDOW_MS,sa as CONFIG_FILENAME,Ta as CONFLICT_MARKER_RE,Pn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,ya as ConfigSchema,St as ConflictAuthority,A as DEFAULT_CHECKPOINT_RETENTION,pa as DEFAULT_EMBEDDINGS_DIMENSIONS,Ot as DEFAULT_PACK_ID,H as DocumentDurabilityState,I as DocumentDurabilityStateError,Ze as EMBEDDINGS_API_KEY_ENV,zr as EPHEMERAL_PROJECT_DIR_PREFIX,_ as ExposureConsentError,Nr as FEATURED_AGENT_IDS,ze as FILE_SYSTEM_WRITER,Ge as FILE_WATCHER_ORIGIN,rt as FileEmbeddingsBackend,J as GIT_PREFLIGHT_FAIL_SPAN_NAME,pe as GIT_UPSTREAM_WRITER,Fa as GitDirAccessError,Ne as GitNotAvailableError,gt as GitTooOldError,ja as HOCUSPOCUS_AUTH_REJECTION_REASONS,C as HocuspocusAuthRejection,Bt as HocuspocusAuthTokenSchema,se as HomeProjectRootError,Pt as INSTALLED_AGENTS_SCHEMES,Kt as JSON_SCHEMA_DIALECT_2020_12,e as LINEAGE_EPOCH_KEY,ee as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ee as MANAGED_RENAME_ORIGIN,Ei as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,sn as MCP_CONNECTION_ID_HEADER,n as MCP_SERVER_NAME,$t as MIN_EVICTABLE_IDLE_MS,mn as MIN_GIT_VERSION,lt as MISSING_OK_CONFIG_MESSAGE,D as MalformedGitPointerError,d as McpLogger,ar as MissingOkConfigError,$i as OBSERVER_SYNC_ORIGIN,di as OK_OKIGNORE_TEMPLATE,zi as ONBOARDING_BUNDLE_IDS,u as ORPHAN_MODES,o as PROTOCOL_VERSION,Xt as PinoLogger,Mr as ProcessLockCollisionError,Nn as ProjectGitInitError,vi as ROLLBACK_ORIGIN,Ki as ROOT_GITIGNORE_TEMPLATE,Kn as RUNTIME_VERSION,Zr as SERVICE_WRITER,oa as SKILL_INSTALL_EVENTS_FILE_REL,l as SKILL_STATE_TARGETS,$n as STARTER_FOLDER_FRONTMATTER_FILENAME,fr as STARTER_PACKS,Ti as STARTER_PACK_IDS,ii as STATE_MANIFEST_FILENAME,Tr as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,vr as SeedPrerequisiteError,En as SeedRootDirError,fa as ServerLockCollisionError,Aa as SingleFileNotAFileError,zn as SingleFileNotFoundError,wa as SingleFileNotMarkdownError,Dt as SingleFileProjectOverrideError,F as StateManifestError,va as TagIndex,Nt as USER_GLOBAL_BUNDLE_IDS,q as __getShowAllWalkStatsForTesting,V as __resetShowAllWalkStatsForTesting,nt as acquireProcessLock,Wr as acquireServerLock,S as applyAgentMarkdownWrite,Rr as applyExternalChange,We as applySeed,Xe as assertCompatibleStateManifest,ct as assertGitAvailable,$ as assertNeverDiskEvent,ve as assertNotHomeProjectRoot,Re as attachAcpThreadSocket,xt as attachCollabClientCounter,La as attachIdleShutdown,k as bindConflictAuthority,Gt as bootServer,fe as buildAndOpenSkill,zt as buildConfigYmlContent,Qt as buildExecResult,oe as buildIngressPolicy,Me as buildOkMcpStdioCommand,Mi as buildSkillZip,Te as buildStarterFolderFrontmatterYaml,pn as buildWipTree,on as bundleSkillMdPath,bn as canonicalProjectKey,ht as canonicalizeForCompare,g as classifyEvents,nr as classifyFsPath,Xi as clearAllEmbeddingsKeys,ci as coercePackId,Ii as collectServerHostSnapshot,t as colorFromSeed,kr as commitUpstreamImport,An as commitWip,hi as commitWipFromTree,Ui as compareSemver,Un as composeEffectiveLinterConfig,Jr as composeFrontmatterSchemasConfig,ra as containsConflictMarkers,Xn as contentHash,lr as contributorCount,Si as countShadowObjects,ti as countStaleAgentWipRefs,Sr as countWipRefs,gr as createApiExtension,wn as createAssetServeMiddleware,ua as createCollaborationHost,Oa as createContentFilter,Ln as createContentFilterAsync,Sa as createEmbeddingsSecretStore,Tt as createEphemeralProjectDir,N as createExternalChangeHandler,ga as createFileLogger,jt as createLiveDerivedIndexExtension,G as createMcpHttpHandler,z as createOsProbe,et as createPersistenceExtension,Hr as createProbeFailureReporter,b as createServer,Ir as createServerObserverExtension,He as createServerProbeResolver,Je as createStreamingErrorWriter,ie as createTestLogger,ot as describeStoredEmbeddingsKey,Z as detectClaudeDesktopPresence,ge as detectGit,Ie as detectProjectShape,yt as detectUserSkillHosts,Pa as discoverLockDirs,E as discoverMarkdownlintConfig,Ut as emitPreflightFailureSpan,ue as encodeDocName,Lt as encodeFolderRoute,Yt as encodeSkillRoute,re as ensureProjectGit,ke as errorResponse,ki as evictStaleTrackerEntries,Se as extractHeadings,un as extractOkBinaryPath,nn as extractWikiLinksFromMarkdown,_n as fallbackPaths,ft as findEnclosingGitRoot,m as findEnclosingProjectRoot,ir as findNativeMarkdownlintFile,Qi as flushFileLogger,ui as formatAuditBrokenLinkSuppressionLine,Ri as formatAuthRejectionWire,jr as formatContributorsFrom,Mn as formatPackRationale,_i as gcCheckpointRefs,Gi as getCurrentMcpLogger,Gn as getIngressContext,Xr as getLocalDir,aa as getLogFilePath,Ae as getLogger,Qn as getLogsDir,dr as getMachineId,wi as getMeter,ri as getMetrics,wr as getTracer,_r as handleCollabSocketError,Tn as handleSpawnCursor,da as hasForwardingHeaders,ka as hasGcLogLatch,r as iconFromClientName,Rn as incrementCollabSocketFilteredError,Ca as incrementServerObserverFire,Et as initContent,P as initShadowRepo,_a as initTelemetry,Mt as initToleranceTelemetryWriter,K as installJsonSchemaDialect,B as installPrettyZodErrors,Ai as installTestLoggers,tt as installUserSkill,Ur as isAllowedApiOrigin,x as isAllowedWorkspaceHostHeader,Lr as isConfigDoc,Ue as isDefunctProcess,Ye as isDocInConflict,st as isHocuspocusAuthRejectionReason,Q as isHomeDir,_e as isHostAdmitted,Le as isKnownPackId,bt as isLinkIndexExcludedDoc,Ia as isLockProcessRunning,O as isLoopbackAddress,Wt as isManagedArtifactDoc,de as isOriginAdmitted,s as isOrphanMode,Rt as isPairedWriteOrigin,Zt as isPathWithinDir,ae as isPeerAdmitted,je as isProcessAlive,ji as isProjectRoot,we as isReservedForUserTree,fn as isSelfWrite,an as isSystemDoc,yn as isToleranceTelemetryEnabled,mt as isValidLockPid,h as lastKnownHash,tr as listRescueCheckpoints,Yi as listStarterPacks,si as loadCustomAgents,Fi as loadPrincipal,Or as lockAdvertisesUi,kn as lockBaseUrl,mi as lockFilePath,Ce as loggerFactory,Hi as loginShapedUserinfoUser,dn as logsCurrentPath,rn as logsPreviousPath,Hn as makeLazyEmbeddingsKeyStore,qr as markServerLockDraining,na as mountMcpAndApi,Yn as normalizeFsPath,cr as observeReadiness,xi as originGitHubHost,ei as packageVersionMajorMinor,xr as parseAuthRejectionWire,hr as parseGitVersion,Cn as parseHocuspocusAuthToken,la as parseKeepaliveConnectionId,Da as pathToDocName,In as planSeed,xa as prepareSingleFileOpen,wt as processCommand,M as processUsage,ha as readAllTargets,At as readBundleDecision,W as readOwnNativeRules,R as readProcessLock,$e as readProcessLockDetailed,Vr as readProcessState,y as readProjectHeadState,Fr as readProjectLocalSemanticConfig,Ve as readServerLock,qe as readServerPackageVersion,at as readSkillInstallStateSnapshot,X as readStateManifest,he as readTargetRecordedAt,Fe as readTargetVersion,vt as reconcile,Na as recordContributor,T as recordSkillInstallEvent,Ht as redactShareSubprocessStderr,le as registerAllTools,It as registerWrite,Jt as releaseProcessLock,ne as releaseServerLock,Oe as removeLastKnownHash,Oi as removeProjectSkillGitignoreBlock,xe as reportSkillInstall,ln as resetMetrics,tn as resolveBuiltinSkillHosts,a as resolveBundleEnabled,gn as resolveBundledSkillDir,dt as resolveContentDir,p as resolveCursorBinaryDefault,er as resolveCursorSpawnInvocation,Ji as resolveEffectiveLinterConfig,oi as resolveEmbeddingsCredential,Pi as resolveGitHubAccountFromUrl,Dr as resolveLockDir,On as resolveNativeConfigForDoc,pi as resolveNativeMarkdownlintConfig,Vi as resolvePack,Vn as resolvePackageVersion,Kr as resolveSkillInstallReportSettings,ta as resolveUiInfo,Jn as restoreContributors,sr as rewriteMarkdownLinksForDocumentRename,bi as rewriteWikiLinksForDocumentRename,$r as runAuthReposSubprocess,br as runAuthStatusSubprocess,mr as runCloneSubprocess,Sn as runDeviceFlowSubprocess,ca as runWithMcpLogger,Ea as safeContentPath,Fn as safeSubdir,ba as safetyCheckpoint,Ct as sameGitHubLogin,j as sanitizeClientName,ma as saveInMemoryCheckpoint,kt as saveVersion,U as scanLockProcesses,L as seedBasenameIndex,Qe as seedEphemeralProjectDir,Br as serializeError,v as setActiveSpanAttributes,Pr as setupServerObservers,Be as shadowGit,Ke as shutdownTelemetry,vn as spansCurrentPath,pt as spansPreviousPath,it as spawnDetached,Y as splitMarkdownBlocks,me as startWatcher,Pe as strategiesFor,_t as streamingProblemEvent,Ma as swapContributors,w as teardownToleranceTelemetryWriter,Vt as toBroadcasterKey,ce as tracedAppendFileSync,Ft as tracedLinkSync,qt as tracedMkdir,te as tracedMkdirSync,De as tracedRename,Di as tracedRenameSync,be as tracedRmSync,cn as tracedRmdirSync,en as tracedUnlinkSync,hn as tracedWriteFile,ut as tracedWriteFileSync,f as trustSystemCertificates,rr as updateLastKnownHash,Zi as updateProcessLockPort,li as updateServerLockPort,Li as validateAgentId,Ar as validateCloneInputs,jn as validateSkillZip,gi as waitForServerLockDrain,Wi as withHiddenWindowsConsole,Wn as withSpan,Yr as withSpanSync,ia as writeBundleDecision,Zn as writeMarkdownlintRule,ur as writeRootGitignoreForNewRepo,Ci as writeStateManifest,ni as writeTargetVersion,Cr as writeTracker};
|
|
1
|
+
import{Bt as e,Fa as t,Iu as n,Mo as r,Pl as i,Ps as a,Sn as o,Wo as s,Yl as c,Yn as l,_n as u}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{$ as d,$a as f,$i as p,$n as m,$r as h,$t as g,A as _,Aa as v,Ai as y,An as b,Ar as x,At as S,B as C,Ba as w,Bi as T,Bn as E,Bo as D,Br as O,Bt as k,C as A,Ca as j,Ci as M,Cn as N,Cr as P,Ct as F,D as I,Da as L,Di as R,Dn as z,Dr as B,Dt as V,E as H,Ea as U,Ei as W,En as G,Er as K,Et as q,F as J,Fa as Y,Fi as X,Fn as Z,Fr as Q,Ft as $,G as ee,Ga as te,Gi as ne,Gn as re,Go as ie,Gr as ae,Gt as oe,H as se,Ha as ce,Hi as le,Hn as ue,Hr as de,Ht as fe,I as pe,Ia as me,Ii as he,In as ge,Ir as _e,It as ve,J as ye,Ja as be,Ji as xe,Jn as Se,Jo as Ce,Jr as we,Jt as Te,K as Ee,Ka as De,Ki as Oe,Kn as ke,Ko as Ae,Kr as je,Kt as Me,L as Ne,La as Pe,Li as Fe,Ln as Ie,Lr as Le,Lt as Re,M as ze,Ma as Be,Mi as Ve,Mn as He,Mr as Ue,Mt as We,N as Ge,Na as Ke,Ni as qe,Nn as Je,Nr as Ye,Nt as Xe,O as Ze,Oa 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,Qa as ut,Qi as dt,Qn as ft,Qo as pt,Qr as mt,Qt as ht,R as gt,Ra as _t,Ri as vt,Rn as yt,Rr as bt,Rt as xt,S as St,Sa as Ct,Si as wt,Sn as Tt,Sr as Et,St as Dt,T as Ot,Ta as kt,Ti as At,Tn as jt,Tr as Mt,Tt as Nt,U as Pt,Ua as Ft,Ui as It,Un as Lt,Ur as Rt,Ut as zt,V as Bt,Va as Vt,Vi as Ht,Vn as Ut,Vr as Wt,Vt as Gt,W as Kt,Wa as qt,Wi as Jt,Wn as Yt,Wo as Xt,Wr as Zt,Wt as Qt,X as $t,Xa as en,Xi as tn,Xn as nn,Xo as rn,Xr as an,Xt as on,Y as sn,Ya as cn,Yi as ln,Yn as un,Yo as dn,Yr as fn,Yt as pn,Z as mn,Za as hn,Zi as gn,Zn as _n,Zo as vn,Zr as yn,Zt as bn,_ as xn,_a as Sn,_i as Cn,_n as wn,_r as Tn,_t as En,a as Dn,aa as On,ai as kn,an as An,ao as jn,ar as Mn,at as Nn,b as Pn,ba as Fn,bi as In,bn as Ln,br as Rn,bt as zn,c as Bn,ca as Vn,ci as Hn,cn as Un,co as Wn,cr as Gn,ct as Kn,d as qn,da as Jn,di as Yn,dn as Xn,do as Zn,dr as Qn,dt as $n,ea as er,ei as tr,en as nr,eo as rr,er as ir,et as ar,f as or,fa as sr,fi as cr,fn as lr,fo as ur,fr as dr,ft as fr,g as pr,ga as mr,gi as hr,gn as gr,gr as _r,gt as vr,h as yr,ha as br,hi as xr,hn as Sr,ho as Cr,hr as wr,ht as Tr,i as Er,ia as Dr,ii as Or,in as kr,io as Ar,ir as jr,it as Mr,j as Nr,ja as Pr,ji as Fr,jn as Ir,jr as Lr,jt as Rr,k as zr,ka as Br,ki as Vr,kn as Hr,kr as Ur,kt as Wr,l as Gr,la as Kr,li as qr,ln as Jr,lo as Yr,lr as Xr,lt as Zr,m as Qr,ma as $r,mi as ei,mn as ti,mo as ni,mr as ri,mt as ii,n as ai,na as oi,ni as si,nn as ci,no as li,nr as ui,nt as di,o as fi,oa as pi,oi as mi,on as hi,oo as gi,or as _i,ot as vi,p as yi,pa as bi,pi as xi,pn as Si,po as Ci,pr as wi,pt as Ti,q as Ei,qa as Di,qi as Oi,qn as ki,qo as Ai,qr as ji,qt as Mi,r as Ni,ra as Pi,ri as Fi,rn as Ii,ro as Li,rr as Ri,rt as zi,s as Bi,sa as Vi,si as Hi,sn as Ui,so as Wi,sr as Gi,st as Ki,t as qi,ta as Ji,ti as Yi,tn as Xi,to as Zi,tr as Qi,tt as $i,u as ea,ua as ta,ui as na,un as ra,uo as ia,ur as aa,ut as oa,v as sa,va as ca,vi as la,vn as ua,vr as da,vt as fa,w as pa,wa as ma,wi as ha,wn as ga,wr as _a,wt as va,x as ya,xa as ba,xi as xa,xn as Sa,xr as Ca,xt as wa,y as Ta,ya as Ea,yi as Da,yn as Oa,yr as ka,yt as Aa,z as ja,za as Ma,zi as Na,zn as Pa,zo as Fa,zr as Ia,zt as La}from"./dist-BRmQARr7.mjs";export{qi as AGENT_ID_MAX_LEN,ai as AGENT_ID_RE,Ni as AGENT_WRITE_ORIGIN,Er as AcpPermissionStore,Dn as AcpRegistry,fi as AcpThreadManager,Bi as AgentFocusBroadcaster,Bn as AgentPresenceBroadcaster,Gr as AgentSessionCapacityError,ea as AgentSessionManager,qn as AutoStartDisabledError,or as BUNDLE_IDS,yi as BUNDLE_SCOPE,Qr as BUNDLE_SKILL_NAME,yr as BacklinkIndex,pr as CC1Broadcaster,i as CC1_CONTRACT_VERSION,xn as CONCURRENT_REPLACE_WINDOW_MS,sa as CONFIG_FILENAME,Ta as CONFLICT_MARKER_RE,Pn as CURSOR_BUNDLE_PATHS_BY_PLATFORM,ya as ConfigSchema,St as ConflictAuthority,A as DEFAULT_CHECKPOINT_RETENTION,pa as DEFAULT_EMBEDDINGS_DIMENSIONS,Ot as DEFAULT_PACK_ID,H as DocumentDurabilityState,I as DocumentDurabilityStateError,Ze as EMBEDDINGS_API_KEY_ENV,zr as EPHEMERAL_PROJECT_DIR_PREFIX,_ as ExposureConsentError,Nr as FEATURED_AGENT_IDS,ze as FILE_SYSTEM_WRITER,Ge as FILE_WATCHER_ORIGIN,rt as FileEmbeddingsBackend,J as GIT_PREFLIGHT_FAIL_SPAN_NAME,pe as GIT_UPSTREAM_WRITER,Fa as GitDirAccessError,Ne as GitNotAvailableError,gt as GitTooOldError,ja as HOCUSPOCUS_AUTH_REJECTION_REASONS,C as HocuspocusAuthRejection,Bt as HocuspocusAuthTokenSchema,se as HomeProjectRootError,Pt as INSTALLED_AGENTS_SCHEMES,Kt as JSON_SCHEMA_DIALECT_2020_12,e as LINEAGE_EPOCH_KEY,ee as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ee as MANAGED_RENAME_ORIGIN,Ei as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,sn as MCP_CONNECTION_ID_HEADER,n as MCP_SERVER_NAME,$t as MIN_EVICTABLE_IDLE_MS,mn as MIN_GIT_VERSION,lt as MISSING_OK_CONFIG_MESSAGE,D as MalformedGitPointerError,d as McpLogger,ar as MissingOkConfigError,$i as OBSERVER_SYNC_ORIGIN,di as OK_OKIGNORE_TEMPLATE,zi as ONBOARDING_BUNDLE_IDS,u as ORPHAN_MODES,o as PROTOCOL_VERSION,Xt as PinoLogger,Mr as ProcessLockCollisionError,Nn as ProjectGitInitError,vi as ROLLBACK_ORIGIN,Ki as ROOT_GITIGNORE_TEMPLATE,Kn as RUNTIME_VERSION,Zr as SERVICE_WRITER,oa as SKILL_INSTALL_EVENTS_FILE_REL,l as SKILL_STATE_TARGETS,$n as STARTER_FOLDER_FRONTMATTER_FILENAME,fr as STARTER_PACKS,Ti as STARTER_PACK_IDS,ii as STATE_MANIFEST_FILENAME,Tr as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,vr as SeedPrerequisiteError,En as SeedRootDirError,fa as ServerLockCollisionError,Aa as SingleFileNotAFileError,zn as SingleFileNotFoundError,wa as SingleFileNotMarkdownError,Dt as SingleFileProjectOverrideError,F as StateManifestError,va as TagIndex,Nt as USER_GLOBAL_BUNDLE_IDS,q as __getShowAllWalkStatsForTesting,V as __resetShowAllWalkStatsForTesting,nt as acquireProcessLock,Wr as acquireServerLock,S as applyAgentMarkdownWrite,Rr as applyExternalChange,We as applySeed,Xe as assertCompatibleStateManifest,ct as assertGitAvailable,$ as assertNeverDiskEvent,ve as assertNotHomeProjectRoot,Re as attachAcpThreadSocket,xt as attachCollabClientCounter,La as attachIdleShutdown,k as bindConflictAuthority,Gt as bootServer,fe as buildAndOpenSkill,zt as buildConfigYmlContent,Qt as buildExecResult,oe as buildIngressPolicy,Me as buildOkMcpStdioCommand,Mi as buildSkillZip,Te as buildStarterFolderFrontmatterYaml,pn as buildWipTree,on as bundleSkillMdPath,bn as canonicalProjectKey,ht as canonicalizeForCompare,g as classifyEvents,nr as classifyFsPath,Xi as clearAllEmbeddingsKeys,ci as coercePackId,Ii as collectServerHostSnapshot,t as colorFromSeed,kr as commitUpstreamImport,An as commitWip,hi as commitWipFromTree,Ui as compareSemver,Un as composeEffectiveLinterConfig,Jr as composeFrontmatterSchemasConfig,ra as containsConflictMarkers,Xn as contentHash,lr as contributorCount,Si as countShadowObjects,ti as countStaleAgentWipRefs,Sr as countWipRefs,gr as createApiExtension,wn as createAssetServeMiddleware,ua as createCollaborationHost,Oa as createContentFilter,Ln as createContentFilterAsync,Sa as createEmbeddingsSecretStore,Tt as createEphemeralProjectDir,N as createExternalChangeHandler,ga as createFileLogger,jt as createLiveDerivedIndexExtension,G as createMcpHttpHandler,z as createOsProbe,et as createPersistenceExtension,Hr as createProbeFailureReporter,b as createServer,Ir as createServerObserverExtension,He as createServerProbeResolver,Je as createStreamingErrorWriter,ie as createTestLogger,ot as describeStoredEmbeddingsKey,Z as detectClaudeDesktopPresence,ge as detectGit,Ie as detectProjectShape,yt as detectUserSkillHosts,Pa as discoverLockDirs,E as discoverMarkdownlintConfig,Ut as emitPreflightFailureSpan,ue as encodeDocName,Lt as encodeFolderRoute,Yt as encodeSkillRoute,re as ensureProjectGit,ke as errorResponse,ki as evictStaleTrackerEntries,Se as extractHeadings,un as extractOkBinaryPath,nn as extractWikiLinksFromMarkdown,_n as fallbackPaths,ft as findEnclosingGitRoot,m as findEnclosingProjectRoot,ir as findNativeMarkdownlintFile,Qi as flushFileLogger,ui as formatAuditBrokenLinkSuppressionLine,Ri as formatAuthRejectionWire,jr as formatContributorsFrom,Mn as formatPackRationale,_i as gcCheckpointRefs,Gi as getCurrentMcpLogger,Gn as getIngressContext,Xr as getLocalDir,aa as getLogFilePath,Ae as getLogger,Qn as getLogsDir,dr as getMachineId,wi as getMeter,ri as getMetrics,wr as getTracer,_r as handleCollabSocketError,Tn as handleSpawnCursor,da as hasForwardingHeaders,ka as hasGcLogLatch,r as iconFromClientName,Rn as incrementCollabSocketFilteredError,Ca as incrementServerObserverFire,Et as initContent,P as initShadowRepo,_a as initTelemetry,Mt as initToleranceTelemetryWriter,K as installJsonSchemaDialect,B as installPrettyZodErrors,Ai as installTestLoggers,tt as installUserSkill,Ur as isAllowedApiOrigin,x as isAllowedWorkspaceHostHeader,Lr as isConfigDoc,Ue as isDefunctProcess,Ye as isDocInConflict,st as isHocuspocusAuthRejectionReason,Q as isHomeDir,_e as isHostAdmitted,Le as isKnownPackId,bt as isLinkIndexExcludedDoc,Ia as isLockProcessRunning,O as isLoopbackAddress,Wt as isManagedArtifactDoc,de as isOriginAdmitted,s as isOrphanMode,Rt as isPairedWriteOrigin,Zt as isPathWithinDir,ae as isPeerAdmitted,je as isProcessAlive,ji as isProjectRoot,we as isReservedForUserTree,fn as isSelfWrite,an as isSystemDoc,yn as isToleranceTelemetryEnabled,mt as isValidLockPid,h as lastKnownHash,tr as listRescueCheckpoints,Yi as listStarterPacks,si as loadCustomAgents,Fi as loadPrincipal,Or as lockAdvertisesUi,kn as lockBaseUrl,mi as lockFilePath,Ce as loggerFactory,Hi as loginShapedUserinfoUser,dn as logsCurrentPath,rn as logsPreviousPath,Hn as makeLazyEmbeddingsKeyStore,qr as markServerLockDraining,na as mountMcpAndApi,Yn as normalizeFsPath,cr as observeReadiness,xi as originGitHubHost,ei as packageVersionMajorMinor,xr as parseAuthRejectionWire,hr as parseGitVersion,Cn as parseHocuspocusAuthToken,la as parseKeepaliveConnectionId,Da as pathToDocName,In as planSeed,xa as prepareSingleFileOpen,wt as processCommand,M as processUsage,ha as readAllTargets,At as readBundleDecision,W as readOwnNativeRules,R as readProcessLock,$e as readProcessLockDetailed,Vr as readProcessState,y as readProjectHeadState,Fr as readProjectLocalSemanticConfig,Ve as readServerLock,qe as readServerPackageVersion,at as readSkillInstallStateSnapshot,X as readStateManifest,he as readTargetRecordedAt,Fe as readTargetVersion,vt as reconcile,Na as recordContributor,T as recordSkillInstallEvent,Ht as redactShareSubprocessStderr,le as registerAllTools,It as registerWrite,Jt as releaseProcessLock,ne as releaseServerLock,Oe as removeLastKnownHash,Oi as removeProjectSkillGitignoreBlock,xe as reportSkillInstall,ln as resetMetrics,tn as resolveBuiltinSkillHosts,a as resolveBundleEnabled,gn as resolveBundledSkillDir,dt as resolveContentDir,p as resolveCursorBinaryDefault,er as resolveCursorSpawnInvocation,Ji as resolveEffectiveLinterConfig,oi as resolveEmbeddingsCredential,Pi as resolveGitHubAccountFromUrl,Dr as resolveLockDir,On as resolveNativeConfigForDoc,pi as resolveNativeMarkdownlintConfig,Vi as resolvePack,Vn as resolvePackageVersion,Kr as resolveSkillInstallReportSettings,ta as resolveUiInfo,Jn as restoreContributors,sr as rewriteMarkdownLinksForDocumentRename,bi as rewriteWikiLinksForDocumentRename,$r as runAuthReposSubprocess,br as runAuthStatusSubprocess,mr as runCloneSubprocess,Sn as runDeviceFlowSubprocess,ca as runWithMcpLogger,Ea as safeContentPath,Fn as safeSubdir,ba as safetyCheckpoint,Ct as sameGitHubLogin,j as sanitizeClientName,ma as saveInMemoryCheckpoint,kt as saveVersion,U as scanLockProcesses,L as seedBasenameIndex,Qe as seedEphemeralProjectDir,Br as serializeError,v as setActiveSpanAttributes,Pr as setupServerObservers,Be as shadowGit,Ke as shutdownTelemetry,vn as spansCurrentPath,pt as spansPreviousPath,it as spawnDetached,Y as splitMarkdownBlocks,me as startWatcher,Pe as strategiesFor,_t as streamingProblemEvent,Ma as swapContributors,w as teardownToleranceTelemetryWriter,Vt as toBroadcasterKey,ce as tracedAppendFileSync,Ft as tracedLinkSync,qt as tracedMkdir,te as tracedMkdirSync,De as tracedRename,Di as tracedRenameSync,be as tracedRmSync,cn as tracedRmdirSync,en as tracedUnlinkSync,hn as tracedWriteFile,ut as tracedWriteFileSync,f as trustSystemCertificates,rr as updateLastKnownHash,Zi as updateProcessLockPort,li as updateServerLockPort,Li as validateAgentId,Ar as validateCloneInputs,jn as validateSkillZip,gi as waitForServerLockDrain,Wi as withHiddenWindowsConsole,Wn as withSpan,Yr as withSpanSync,ia as writeBundleDecision,Zn as writeMarkdownlintRule,ur as writeRootGitignoreForNewRepo,Ci as writeStateManifest,ni as writeTargetVersion,Cr as writeTracker};
|
package/dist/index.mjs
CHANGED
|
@@ -1535,6 +1535,6 @@ GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){funct
|
|
|
1535
1535
|
`);re(e,o)}function M9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=A9(JSON.parse(n),t),i=n.endsWith(`
|
|
1536
1536
|
`)?`
|
|
1537
1537
|
`:``;re(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=k9(n,t.contentDir);r!==n&&re(e,r)}}function N9(e,t){let n=S(e,`utf-8`),r=k9(n,t.contentDir);r!==n&&re(e,r)}function P9(e){try{return w(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const rje=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function F9(e){return/\.log\.\d+$/.test(e)}function ije(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||F9(e)}const aje=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function oje(e){let t={contentDir:e.contentDir};for(let n of aje)for(let r of P9(N(e.stagingDir,n)))ije(r)?j9(r,t):r.endsWith(`.json`)?M9(r,t):N9(r,t);for(let n of P9(N(e.stagingDir,`state`))){let e=me(n);n.endsWith(`.jsonl`)?j9(n,t):rje.has(e)?M9(n,t):N9(n,t)}}const I9=[`.ok`,`local`,`telemetry`],L9=[`.ok`,`local`,`logs`],R9=[`.ok`,`local`,`loss-capture`],z9=`spans-current.jsonl`,B9=`spans-prev.jsonl`,V9=`server-current.jsonl`,H9=`server-prev.jsonl`,U9=`loss-current.jsonl`,W9=`loss-prev.jsonl`;function sje(e){return N(e,...I9,z9)}function cje(e){return N(e,...I9,B9)}function lje(e){return N(e,...L9,V9)}function uje(e){return N(e,...L9,H9)}function dje(e){return N(e,...R9,U9)}function fje(e){return N(e,...R9,W9)}const G9=1e3;async function pje(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function mje(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function hje(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}function gje(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
1538
|
-
`)}\n`:null}catch{return null}}function _je(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],W6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vje(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],W6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function yje(){return{nodeVersion:process.version,platform:le(),arch:ae()}}function bje(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,tn.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xje(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xje(e.maxBytes)}function Sje(e){let t=J9(LQ(`project`,e)),n=J9(LQ(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function Cje(e){return Ne(`sha256`).update(e).digest(`hex`)}function wje(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const Tje=[`"doc.name"`,`"docName"`];function Eje(e){let t=S(e,`utf-8`),n=0;for(let e of Tje){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(M(t),{recursive:!0}),e.endsWith(`.ips`)?re(t,w7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Dje=new Set([`.jsonl`]);function Oje(e){let t=e.lastIndexOf(`.`);return t!==-1&&Dje.has(e.slice(t))}const kje=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function Aje(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kje.has(e.slice(t))}function jje(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!Aje(r))continue;let{redacted:i,patterns:a,lineCount:o}=CB(S(n,`utf-8`));a.length!==0&&(re(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return ye(e,t).split(xe).join(`/`)}async function Mje(e){let t=be(e.contentDir),n=be(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pje,a=r.fetchAgentEffects??mje,o=r.fetchWatcherRecent??hje,s=r.readShadowHead??_je,c=r.readCheckpointRefs??vje,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.77.8
|
|
1538
|
+
`)}\n`:null}catch{return null}}function _je(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],W6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vje(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],W6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function yje(){return{nodeVersion:process.version,platform:le(),arch:ae()}}function bje(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,tn.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xje(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xje(e.maxBytes)}function Sje(e){let t=J9(LQ(`project`,e)),n=J9(LQ(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function Cje(e){return Ne(`sha256`).update(e).digest(`hex`)}function wje(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const Tje=[`"doc.name"`,`"docName"`];function Eje(e){let t=S(e,`utf-8`),n=0;for(let e of Tje){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(M(t),{recursive:!0}),e.endsWith(`.ips`)?re(t,w7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Dje=new Set([`.jsonl`]);function Oje(e){let t=e.lastIndexOf(`.`);return t!==-1&&Dje.has(e.slice(t))}const kje=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function Aje(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kje.has(e.slice(t))}function jje(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!Aje(r))continue;let{redacted:i,patterns:a,lineCount:o}=CB(S(n,`utf-8`));a.length!==0&&(re(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return ye(e,t).split(xe).join(`/`)}async function Mje(e){let t=be(e.contentDir),n=be(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pje,a=r.fetchAgentEffects??mje,o=r.fetchWatcherRecent??hje,s=r.readShadowHead??_je,c=r.readCheckpointRefs??vje,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.77.8`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,p=r.readRuntime??yje,h=r.isOtlpPushEnabled??bje,_=y(N(A(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),Z9(sje(n),N(_,`telemetry`,z9)),Z9(cje(n),N(_,`telemetry`,B9)),Z9(lje(n),N(_,`logs`,V9)),Z9(uje(n),N(_,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,N(_,`logs`,me(t)));for(let t of e.userStateFiles??[])Z9(t,N(_,qL,me(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,N(_,`diagnostic-reports`,me(t)))&&(y+=1);let b=N(n,`.ok`,`local`),x=N(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,N(_,`state`,`server.lock`));try{let e=S(x,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?T=t.port:w=`lock present but no port`}catch{w=`lock present but unparseable`}}if(T!==null){let e=await i(T);e===null?w=`agent-presence endpoint at :${T} unreachable`:(re(N(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&re(N(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=gje(n);e!==null&&re(N(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&re(N(_,`state`,`shadow-head.txt`),E);let D=c(t);D!==null&&re(N(_,`state`,`checkpoint-refs.txt`),D),Z9(dje(n),N(_,`state`,U9)),Z9(fje(n),N(_,`state`,W9)),Z9(N(b,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),Z9(N(b,Pu),N(_,`state`,Pu)),Z9(N(b,Fu),N(_,`state`,Fu));let ee=p(),ne=d(),ie=f(),ae={ok:{version:u(),nodeVersion:ee.nodeVersion,platform:ee.platform,arch:ee.arch},host:{desktop:ne,language:ie}};re(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=C===`running`?`running
|
|
1539
1539
|
`:`not-running (${w})\n`;re(N(_,`state`,`server-status.txt`),oe);let se=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:C7(e.diagnosticReports,y);if(re(N(_,`state`,`diagnostic-reports-status.txt`),`${se}\n`),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let k=e.redact===!0;k&&oje({stagingDir:_,contentDir:t}),e.note&&re(N(_,`note.txt`),e.note);let ce=null;e.scrubSecrets===!0&&(ce=jje(_));for(let t of e.extraFiles??[])Z9(t.sourcePath,N(_,`extra`,t.zipName??me(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let le=Sje(n),ue=Q9(_),A=[],j=0,de=0;for(let e of ue){let t=$9(_,e),n=te(e).size,r=Oje(t)?wje(e):0;A.push({path:t,bytes:n,lines:r}),j+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(de+=Eje(e))}let fe={applied:k};ce!==null&&(fe.secretScrub=ce);let pe={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:ee.nodeVersion,platform:ee.platform,arch:ee.arch},host:{desktop:ne,language:ie},contentDir:{pathSha256:Cje(t),absolutePath:k?`<CONTENT_DIR>`:t},telemetry:{localSink:le,otlpPushEnabled:h()},redaction:fe,serverStatus:C,files:A};re(N(_,`manifest.json`),`${JSON.stringify(pe,null,2)}\n`);let M=ue.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),he={stagedDiagnosticReports:y,totalBytes:j,fileCount:A.length,docNameCount:de,contentDirVisible:M,redacted:k},ge=!1;return{stagingDir:_,manifest:pe,summary:he,cleanup:()=>{ge||(ge=!0,O(_,{recursive:!0,force:!0}))}}}catch(e){throw O(_,{recursive:!0,force:!0}),e}}async function Nje(e){let{collected:t,outputPath:n}=e,r=M(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new FCe.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Pje(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,tn.parse)(S(n,`utf-8`)),r=q8(t)?t.content:void 0,i=q8(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return be(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return be(e)}async function Fje(e,t,n,r,i){let a=E7(t,e.logger),o=await Mje({contentDir:Pje(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...Gke(a,e.userLogsDir??N(k(),`.ok`,`logs`)),...O7(e.cachesDir??N(k(),`Library`,`Caches`))],userStateFiles:k7(e.bugReportsDir??T7()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(M(e.outputPath),{recursive:!0}),await Nje({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function Ije(e){let{projectDir:t}=e,n=e.readDesktopEnv??K9,r=e.readLanguage??O9,i=()=>Vke(e.diagnosticReportsDir??N(k(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return Fje(e,t,n,r,i());let{zipPath:a,summary:o}=await Xke({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:O7(e.cachesDir??N(k(),`Library`,`Caches`)),bugReportLedgerFiles:k7(e.bugReportsDir??T7()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}export{e5 as ALL_EDITOR_IDS,t5 as EDITOR_LABELS,j5 as EDITOR_TARGETS,sOe as HOSTS_WITH_USER_SKILL_DIR,Dke as LAUNCH_CONFIG_NAME,zAe as PATH_SHIM_BEGIN,VAe as PATH_SHIM_BLOCK_RE,BAe as PATH_SHIM_END,ake as addOkPathsToGitExclude,R5 as assertProjectPathSafe,p5 as buildManagedServerEntry,kAe as buildMcpConfigDeclineEvent,AAe as buildMcpConfigMigrateEvent,b7 as classifyExistingMcpEntry,Ije as collectReportBundle,KAe as createCliProbeResolver,on as createTokenStore,Hke as defaultBugReportZipPath,We as detectGh,qe as detectGhAccounts,jke as detectInstalledEditors,S5 as droppedManagedKeys,OOe as editorConfigPathDisplay,DOe as editorEntryLocator,vAe as ensurePiBridge,Q5 as formatTrackedRemediation,cke as getExcludedOkPaths,X5 as getInstalledSkillProjectionPaths,oOe as getNativeTomlMcpEditor,Y5 as getOkArtifactPaths,d5 as isEntryUpToDate,m5 as isOwnManagedEntry,IAe as loadConfig,bee as makeLazyProbeTokenStore,T7 as okBugReportsDir,b9 as parseGitHubBlobUrl,LAe as parseGitHubShareUrl,x9 as parseGitHubTreeUrl,y9 as parseGitUrl,HAe as pathInstallMarkerPath,UOe as previewContent,Mke as probeOwnManagedEditorMcpEntry,gAe as probePiBridgeState,Z5 as probeTrackedOkPaths,v7 as readExistingMcpEntry,ske as readSharingMode,CB as redactContent,oke as removeOkPathsFromGitExclude,TAe as removeOwnMcpEntry,tke as removeProjectSkill,JAe as removeUserGlobalSkillBundle,eje as removeUserSkill,YOe as resolveProjectRoot,NAe as runStop,h9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,$Ae as userSkillPresentAnywhere,RAe as validateLocalFolderForShare,_7 as writeEditorMcpConfig,ZAe as writeProjectAiIntegrations,W5 as writeProjectSkill,Ake as writeUserMcpConfigs,QAe as writeUserSkill};
|
|
1540
1540
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Ad as r,Bd as i,Fd as a,Fu as o,Gl as s,Hu as c,Id as l,Iu as u,Mt as d,Nd as f,Nl as p,Vl as m,_s as h,hs as g,jd as _,ju as v,rc as y,zd as b}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{Co as x,Do as S,Eo as ee,Fr as te,Gn as ne,H as re,Ji as ie,L as ae,Lo as oe,Or as se,Qt as ce,R as le,Rn as ue,Sr as de,To as fe,Tt as pe,Uo as me,Zi as he,at as ge,fo as _e,jo as C,la as ve,m as ye,qi as be,qr as xe,rt as Se,so as Ce,uo as we,wo as Te}from"./dist-
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Ad as r,Bd as i,Fd as a,Fu as o,Gl as s,Hu as c,Id as l,Iu as u,Mt as d,Nd as f,Nl as p,Vl as m,_s as h,hs as g,jd as _,ju as v,rc as y,zd as b}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{Co as x,Do as S,Eo as ee,Fr as te,Gn as ne,H as re,Ji as ie,L as ae,Lo as oe,Or as se,Qt as ce,R as le,Rn as ue,Sr as de,To as fe,Tt as pe,Uo as me,Zi as he,at as ge,fo as _e,jo as C,la as ve,m as ye,qi as be,qr as xe,rt as Se,so as Ce,uo as we,wo as Te}from"./dist-BRmQARr7.mjs";import{i as w,n as T,o as E,r as Ee,s as D,t as O}from"./colors-r_owlCuY.mjs";import{t as k}from"./is-object-BGze3w87.mjs";import{t as De}from"./constants-1-jHpFdP.mjs";import{t as Oe}from"./preview-NwxcqmPs.mjs";import{createRequire as ke}from"node:module";import{execFileSync as Ae}from"node:child_process";import je,{basename as Me,dirname as A,isAbsolute as Ne,join as j,posix as Pe,relative as M,resolve as N,sep as P,win32 as Fe}from"node:path";import F from"node:process";import{fileURLToPath as Ie}from"node:url";import{cpSync as Le,existsSync as I,lstatSync as Re,mkdirSync as ze,readFileSync as L,readdirSync as Be,readlinkSync as Ve,realpathSync as He,rmSync as Ue,statSync as We,writeFileSync as Ge}from"node:fs";import{homedir as R}from"node:os";import{inspect as Ke,stripVTControlCharacters as qe,styleText as z}from"node:util";import*as Je from"node:readline";import{AsyncLocalStorage as Ye,AsyncResource as Xe}from"node:async_hooks";var Ze=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Qe=n((e=>{let{InvalidArgumentError:t}=Ze();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),$e=n((e=>{let{humanReadableArgName:t}=Qe();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),et=n((e=>{let{InvalidArgumentError:t}=Ze();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -689,5 +689,5 @@ export default function okBridge(pi: {
|
|
|
689
689
|
`));let g=`${s?``:``}${m}`;return g!==o&&C(e,g,{mode:Sa(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const go=e=>e!==`project`,_o=e=>e!==`user`;async function vo(){let e=await ja({message:`Where should the MCP server be configured?
|
|
690
690
|
`,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 yo(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??vo)():`both`}async function bo(e){return Ia({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json)?`,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 xo(e){if(e.sharing!==void 0)return e.sharing;let t=Ki(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??bo)(t):t}var So=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Co(e){if(e===void 0||e===!0)return new Set(Se);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(pe.filter(e=>t.includes(e)))}function wo(e,t,n){let r=N(n,e),i;try{i=We(r)}catch(e){let t=e.code;throw t===`ENOENT`?new So(`--content-dir path does not exist: ${r}`):new So(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new So(`--content-dir must be a directory: ${r}`);let a=To(t),o=To(r),s=M(a,o);if(s.startsWith(`..`)||Ne(s))throw new So(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function To(e){try{return He(e)}catch{return e}}const Eo=`open-knowledge-ui`;function Do(e,t,n){try{let r=e.detectPath?.(t,n)??A(e.configPath(t,n));return I(r)}catch{return!1}}function Oo(e,t,n){try{let r=N(A(e.configPath(t,n))),i=N(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+P)}catch{return!1}}function ko(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.pruneOnly===!0;if(s&&(e.format===`file`||!I(o)))return{editorId:e.id,label:e.label,action:`skipped-flag`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}};let c=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0||Oo(e,t,r);if(!i&&c&&!Do(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{aa(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 jo(e,o,a,n,{isProjectScope:i!==void 0});let l;try{l=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{s||ze(A(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 u={action:`written`},d;try{oe(`${o}.lock`,()=>{let t=Ya(o).writePath;if(s||ze(A(t),{recursive:!0}),e.format===`toml`){let r=fo(Hr(),t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}if(e.format===`yaml`){let r=ho(t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}let r=uo(t,e.topLevelKey,a,l,e.serverMapSubKey,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){d=e instanceof Error?e:Error(String(e))}return d?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:d.message,...i===void 0?{}:{configScope:`project`}}:u.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:u.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:u.action===`unchanged`?`skipped-flag`:u.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const Ao={pi:Va};function jo(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=Ao[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{ze(A(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{oe(`${t}.lock`,()=>{let e=null;try{e=L(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}C(t,c,e===null?void 0:{mode:Sa(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 Mo(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!I(n)))return{editorId:e.id,label:e.label,path:n}}async function No(e){let t=zi(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>ko(t,``,n,e.home))}function Po(e,t,n,r){let i=Io(e,t,n,r);return i.kind===`present`?i.entry:null}function Fo(e,t,n,r){let i=lo(e,t,r);if(!k(i))return{kind:`no-entry`};let a=i[n];return k(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Io(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!I(i))return{kind:`absent`};try{if(We(i).size>ro)return{kind:`decline`,reason:`oversize`}}catch(e){return{kind:`decline`,reason:va(e)}}let a;try{a=L(i,`utf-8`)}catch(e){return{kind:`decline`,reason:va(e)}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Ba(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=Hr().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Fo(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,kr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Fo(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=Qa(a);return s?$a(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Fo(Te(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Lo(e={}){let t=N(e.cwd??process.cwd()),n=Wa(t,{homeDir:e.home}),r=n.projectRoot;if(te(r,e.home??R()))throw new re(r);let i=!I(j(r,`.ok`)),a=n.gitRootPromoted?M(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:wo(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${D(`[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 c={mode:e.devMcp?`dev`:`published`},l=await ne(r),u;try{u=de(r,{contentDir:o})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:l.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 d=u.created.includes(De),f=!1;if(l.didInit)try{f=_e(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{be(r)===`removed`&&console.warn(`[ok] Removed the OpenKnowledge project-skill lines from .gitignore. The skill is ordinary project content now — commit it if your team wants it on clone.`)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore cleanup at ${r}: ${e instanceof Error?e.message:String(e)}`)}let p=await yo({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),m=e.editors??Uo(r,e.home),h=e.editors??m,g=zi(m),_=zi(h),v=e.mcp===!1||p===null,y=Array.from(new Map([...g,...v?[]:_].map(e=>[e.id,e])).values()),b=g.filter(t=>Do(t,r,e.home)),x=[],S=[],ee=new Set;for(let t of y){if(v){let n=``;try{n=t.configPath(r,e.home)}catch{}x.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(go(p)&&g.includes(t)&&t.scope===`global`&&x.push(ko(t,r,c,e.home)),_o(p)&&_.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ko(t,r,c,e.home,n);x.push(i),(i.action===`written`||i.action===`overwritten`)&&ee.add(n)}}let ae=new Set;for(let t of _){let n=t.projectSkillPath?.(r);!n||ae.has(n)||(ae.add(n),S.push(ga(t,r,{home:e.home})))}let oe=ha(r,_.map(e=>e.id));oe&&S.push(oe);let ce=S.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ce.length>0){let t=e.home??R();ie({source:s,skills:[ye.project],agents:ce,scope:r},{home:t,enabled:ve(t).enabled})}let le=!v&&p!==null&&_o(p)?_.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,fe=v?[]:b.map(e=>Mo(e,r)).filter(e=>e!==void 0).filter(e=>!ee.has(e.path)),me=e.installUserSkill??se,he=e.home??R(),ge=Co(e.skills),C=!1,xe=!1,Se=!1,Ce=!1,Te=!1;for(let t of pe){if(!ge.has(t))continue;await we(he,ye[t],!0).catch(()=>{}),C=!0;let n=await me({home:e.home,bundleId:t,force:!0});n===`installed`?xe=!0:n===`failed`?Se=!0:n===`no-hosts`?Te=!0:Ce=!0}let w=Se?`failed`:xe?`installed`:C&&Ce?`skip-current`:C&&Te?`no-hosts`:`declined`,T=xe?ue(he).map(e=>e.editorId):[],E=v?`skipped-flag`:`skipped-missing`,Ee=x.find(e=>e.editorId===`claude`)??x[0]??{action:E,configPath:$.claude.configPath(r,e.home)},O=await Ro({projectRoot:r,desiredMode:await xo({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:u.created,contentUpdated:u.updated,contentSkipped:u.skipped,editors:x,projectSkills:S,legacyProjectConfigs:fe,skillInstall:w,skillHosts:T,didGitInit:l.didInit,rootGitignoreCreated:f,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:d?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:Ee.action,mcpPath:Ee.configPath,mcpError:`error`in Ee?Ee.error:void 0,projectScopeUnsupportedLabels:le,sharing:O}}async function Ro(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Ki(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=Hi(t);if(n===`local-only`){let e=Wi(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`}:zo(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=Gi(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:zo(t,o,`remove`)}function zo(e,t,n){let r=Ki(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:t.removed.length>0?`cleaned`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:t.removed}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Bo(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions`;case`unresolved-symlink`:return`could not resolve the path or symlink; check permissions and symlink cycles`;case`not-a-file`:return`config path is not a regular file`;case`disappeared`:return`config disappeared while being read; retry to check its current state`;case`unreadable`:return`could not read the config file; check that the path is accessible`;case`unparseable`:return`config could not be parsed`;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`;case void 0:return`config not readable`;default:throw Error(`unhandled MCP decline reason: ${e}`)}}function Vo(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=j(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(O(`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(O(`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(O(`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(O(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(O(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?M(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} ${E(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${E(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${Ee(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${Bo(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(O(`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?M(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${E(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${E(`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} ${Ee(`FAILED`)}: ${r.error}`)}}}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} ${M(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(O(`User-global skill:`)),e.skillInstall){case`installed`:{let t=(e.skillHosts??[]).map(e=>X[e]??e),r=t.length>0?t.join(`, `):`the shared ~/.agents store`;n.push(` open-knowledge ${E(`installed for ${r}`)}`),n.push(` ${T(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${T(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`);break}case`skip-current`:n.push(` open-knowledge ${E(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${T(`skipped for this run (--no-skills)`)}`),n.push(` ${T(`Nothing was installed or removed. Any built-in skills already on this`)}`),n.push(` ${T(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${T(` ok init`)}`);break;case`no-hosts`:n.push(` open-knowledge ${T(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${D(`open-knowledge install failed — MCP still configured; retry with:`)}`),n.push(` ${D(` ok repair-skills`)}`)}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(D(`⚠ --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(D(`⚠ 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(Oe(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ko(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(`${E(`✓`)} ${O(`Next steps:`)}`),n.push(` 1. Open your editor (${w(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${w(`ok seed --list-packs`)} — browse the starter packs`),n.push(` - ${w(`ok seed`)} — scaffold an empty repo`),n.push(` 4. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}return n.join(`
|
|
691
691
|
`)}function Ho(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 Uo(e,t){let n=[];for(let r of Wr)r!==`claude-desktop`&&Do($[r],e,t)&&n.push(r);return n}function Wo(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Ke(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function Go(){return new ut(`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 ft(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new ft(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new ft(`--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?Wo():null;try{let r;try{r=await Lo({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof So||e instanceof re){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ae||e instanceof le){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof ge){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.
|
|
692
|
-
`),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-
|
|
692
|
+
`),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-B71GIjWF.mjs`),{resolveContentDir:s}=await import(`./dist-DGV6rhfK.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-_z9VMNyT.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Ho(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Vo(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Ko(e,t){let n=[];switch(e.kind){case`applied`:return n.push(O(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${E(`local-only`)} — appended ${e.appended.length} path(s) to ${O(`${t}/.git/info/exclude`)} (per-clone, not committed).`),e.removed.length>0&&n.push(` cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`)):e.action===`cleaned`?n.push(` ${E(`local-only`)} — already excluded; cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${E(`local-only`)} — already excluded; nothing to do.`):n.push(` ${E(`local-only`)}`):e.action===`removed`?n.push(` ${E(`shared`)} — removed OK paths from ${O(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${E(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(D(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
693
693
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${w(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(D(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${w(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${w(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(D(`Sharing mode unavailable: ${e.reason}.`));return n}}export{vi as $,Ca as A,Qi as B,Wa as C,ct as Ct,ja as D,Ia as E,oa as F,Ki as G,Ui as H,_a as I,X as J,Gi as K,la as L,va as M,ca as N,Sa as O,aa as P,yi as Q,ga as R,Ya as S,ut as St,za as T,Hi as U,qi as V,Ji as W,Gr as X,$ as Y,Z,Lo as _,Zt as _t,Ho as a,Q as at,No as b,H as bt,Vo as c,ci as ct,Do as d,Y as dt,bi as et,Po as f,Mr as ft,xo as g,Vn as gt,wo as h,Qn as ht,Ro as i,Si as it,ya as j,xa as k,Ko as l,Ur as lt,yo as m,Pr as mt,Eo as n,ti as nt,Io as o,Ci as ot,Co as p,jr as pt,Wr as q,Ao as r,ii as rt,Uo as s,Pi as st,So as t,xi as tt,Go as u,Hr as ut,so as v,Jt as vt,Va as w,ft as wt,Oo as x,xt,ko as y,qt as yt,Wi as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-BRmQARr7.mjs";import{_ as e}from"./init-CRhBH-xN.mjs";export{e as runInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Do as e,jo as t,wo as n}from"./dist-
|
|
1
|
+
import{Do as e,jo as t,wo as n}from"./dist-BRmQARr7.mjs";import{A as r,M as i,O as a}from"./init-CRhBH-xN.mjs";import{t as o}from"./is-object-BGze3w87.mjs";import{t as s}from"./removal-file-path-BXAPQUp8.mjs";import{join as c}from"node:path";import{readFileSync 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(o){let f=s(c(o,`.claude`,`launch.json`));if(f.kind!==`ready`)return f;let m=f.path,h;try{h=l(m,`utf-8`)}catch(e){return{kind:`declined`,reason:i(e)}}let g=[],_=e(h,g,u)??void 0;if(g.some(e=>!d(e,h))||_?.type!==`object`)return{kind:`declined`,reason:`unparseable`};let v=n(_).configurations;if(!Array.isArray(v))return{kind:`not-present`};let y=v.findIndex(p);if(y===-1)return{kind:`not-present`};let{text:b,changed:x}=r(h,[`configurations`,y]);return x?(t(m,b,{mode:a(m)}),{kind:`removed`}):{kind:`not-present`}}function p(e){if(!o(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?m.some(e=>h(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const m=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function h(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-lnI-1rAM.mjs";export{e as loadConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{as as e,ju as t,rl as n,tl as r,to as i,ul as a,xl as o}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{Fo as s,No as c,x as l}from"./dist-
|
|
1
|
+
import{as as e,ju as t,rl as n,tl as r,to as i,ul as a,xl as o}from"./md-manager-BGnqyqi1-DKflYxqj.mjs";import{Fo as s,No as c,x as l}from"./dist-BRmQARr7.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-1-jHpFdP.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=t();async function _(e){let t=f(e);try{return await h(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=a({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function b(t){let a=t??process.cwd(),u=[],p=[],m=[],h=[],g=s(`user`,a),_=c({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&u.push(g);let b=(e,t=!1)=>{let n=v(e);if(n.diagnostic!==void 0&&p.push(n.diagnostic),n.value===null)return{};let a=r({value:n.value,file:n.path,source:n.source,doc:n.doc});p.push(...a),u.push(e);let s=a.length>0?o(n.value):n.value;return t&&h.push(...i({value:s,file:n.path,source:n.source,doc:n.doc})),s},x=f(a,`.ok`,d),S=b(x,!0),C=b(s(`project-local`,a)),w=e(_.value,S,C),T=l.safeParse(w);if(!T.success){let e=v(x),t={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(n(t))}return{config:T.data,sources:u,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(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{b as n,x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{so as e}from"./dist-
|
|
1
|
+
import{so as e}from"./dist-BRmQARr7.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}let s=process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,c=process.platform===`win32`?[`/c`,`start`,``,a]:[a];t(s,c,e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{yn as e}from"./dist-
|
|
1
|
+
import{yn as e}from"./dist-BRmQARr7.mjs";import"./constants-1-jHpFdP.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}`);a.push(``);let c=t(i,`.ok`,`config.yml`);return r(c)?(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-NwxcqmPs.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./index-BBx8twze.js";export{e as FeedbackForm};
|