@inkeep/open-knowledge 0.9.0-beta.20 → 0.9.0-beta.21
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 +45 -50
- package/dist/constants-B1pl96wf.mjs +2 -0
- package/dist/{dist-MR5-nxHn.mjs → dist-BmBWLfZh.mjs} +1 -1
- package/dist/{dist-CMnModoh.mjs → dist-DMBX1lBa.mjs} +4 -4
- package/dist/{gh-detect-BxE0UVa4.mjs → gh-detect-C-S1OcWk.mjs} +2 -2
- package/dist/index.d.mts +48 -1
- package/dist/index.mjs +1 -1
- package/dist/init-BkOqRoAY.mjs +315 -0
- package/dist/init-CC-n0gDD.mjs +1 -0
- package/dist/{loader-BntjT0Up.mjs → loader-Bf_NzSYN.mjs} +2 -2
- package/dist/loader-Bm2w83xy.mjs +1 -0
- package/dist/{preview-DGO0ydfe.mjs → preview-CTNz7VTY.mjs} +2 -2
- package/dist/preview-qqST0WKT.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BBlv7xrp.js → ActivityModeContent-z7qnx0as.js} +1 -1
- package/dist/public/assets/{DocumentContext-URa7yGGf.js → DocumentContext-CUcw7vUM.js} +1 -1
- package/dist/public/assets/{GraphPanel-DJ0vyS8e.js → GraphPanel-DAc4xPw0.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-BaLn6E02.js → SettingsDialogBody-BHP5PkCn.js} +1 -1
- package/dist/public/assets/{SourceEditor-DjifwOtp.js → SourceEditor-DiQAAFgk.js} +1 -1
- package/dist/public/assets/{config-validation-events-6Lm8NqhP.js → config-validation-events-BJsdd79E.js} +1 -1
- package/dist/public/assets/{index-DbrgiVfz.js → index-JUgtW7sc.js} +82 -82
- package/dist/public/assets/{prop-types-CYuYIr-C.js → prop-types-DSYTAtcj.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-XBDKgDbp.js → target-navigation-intent-DTbwAnlO.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DWD2uCIq.js → typing-burst-detector-Ct_PpA3e.js} +1 -1
- package/dist/public/index.html +6 -6
- package/dist/repair-launch-json-CqPN-Ocu.mjs +2 -0
- package/dist/repair-mcp-configs-Bfn2ymIS.mjs +2 -0
- package/dist/{repair-skills-D0D3oBhe.mjs → repair-skills-CUeJOyT7.mjs} +2 -2
- package/dist/repair-skills-D9p2WcuH.mjs +1 -0
- package/dist/{server-lock-BpjJj3OD-o3F9MyhJ.mjs → server-lock-BpjJj3OD-CrLAtHjJ.mjs} +2 -2
- package/dist/server-lock-CyhBidkz-Cz7mn2y3.mjs +1 -0
- package/dist/src-BT54djM0.mjs +7 -0
- package/dist/start-B3dKqBZ7.mjs +3 -0
- package/dist/start-D1O0G7p6.mjs +1 -0
- package/dist/{write-project-skill-DHPcTx2Z.mjs → write-project-skill-CKCq7dDX.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-BeVSpw7c.mjs +0 -2
- package/dist/init-CQBsDCX-.mjs +0 -1
- package/dist/init-DyY1oO91.mjs +0 -300
- package/dist/loader-C7zfSEEa.mjs +0 -1
- package/dist/preview-Up-PoGaR.mjs +0 -1
- package/dist/repair-launch-json-BmKjEiqt.mjs +0 -2
- package/dist/repair-mcp-configs-BmeJ_uVZ.mjs +0 -2
- package/dist/repair-skills-B1vaqhvb.mjs +0 -1
- package/dist/server-lock-CyhBidkz-JwOoqbN0.mjs +0 -1
- package/dist/src-BdtpLJUd.mjs +0 -2
- package/dist/start-Byr5dC0M.mjs +0 -3
- package/dist/start-C21UX5wb.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{fa as e}from"./server-lock-BpjJj3OD-
|
|
1
|
+
import{fa as e}from"./server-lock-BpjJj3OD-CrLAtHjJ.mjs";import{execFileSync as t}from"node:child_process";import{dirname as n,join as r}from"node:path";import{existsSync as i,mkdirSync as a,readFileSync as o,writeFileSync as s}from"node:fs";import{homedir as c}from"node:os";var l=e();const u=`open-knowledge`;var d=class{backend=`keyring`;async get(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{let n=new t(u,e).getPassword();return n==null?null:JSON.parse(n)}catch{return null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(u,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(u,e).deletePassword()}catch{}}},f=class{backend=`file`;authFile;constructor(e){this.authFile=e??r(c(),`.ok`,`auth.yml`)}read(){if(!i(this.authFile))return{};try{return(0,l.parse)(o(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=n(this.authFile);i(t)||a(t,{recursive:!0,mode:448}),s(this.authFile,(0,l.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}};async function p(e){try{let{Entry:e}=await import(`@napi-rs/keyring`);return new e(u,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
2
2
|
`),new d}catch{return process.stderr.write(`[auth] token storage: file (~/.ok/auth.yml)
|
|
3
3
|
`),new f(e)}}function m(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (~/.ok/auth.yml)\n`),r(new f(e))},n)});try{return await Promise.race([p(e),r])}catch{return new f(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function h(e){let t=m(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token}}}}function g(e){let t=m(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function _(e,t){let n=[],r=new f(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(u,`__probe__`);let r=new d;await r.get(e)!=null&&(await r.clear(e),n.push(`keychain`))}catch{}return{touched:n}}const v=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`];function y(e,n={}){let r=n._exec??t,a=n._fileExists??i,o=[`auth`,`token`,...e?[`--hostname`,e]:[]],s=[`gh`,...v.filter(a)];for(let e of s)try{let t=r(e,o,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3}).toString().trim();if(t.length>0)return{available:!0,token:t}}catch{}return{available:!1}}export{g as a,h as i,_ as n,p as r,y as t};
|
|
4
|
-
//# sourceMappingURL=gh-detect-
|
|
4
|
+
//# sourceMappingURL=gh-detect-C-S1OcWk.mjs.map
|
package/dist/index.d.mts
CHANGED
|
@@ -111,6 +111,8 @@ interface EditorMcpResult {
|
|
|
111
111
|
configScope?: 'project';
|
|
112
112
|
}
|
|
113
113
|
declare const LAUNCH_CONFIG_NAME = "open-knowledge-ui";
|
|
114
|
+
declare const LAUNCH_UI_CHAIN_SENTINEL = "# ok-ui-v1";
|
|
115
|
+
declare const LAUNCH_UI_CHAIN_V1 = "# ok-ui-v1\nUIPORT=\"${PORT:-39848}\"\nunset PORT\nUSER_BUNDLE=\"$HOME/Applications/Open Knowledge.app/Contents/Resources/cli/bin/ok.sh\"\n[ -f \"$USER_BUNDLE\" ] && [ -x \"$USER_BUNDLE\" ] && exec \"$USER_BUNDLE\" start --ui-port \"$UIPORT\"\nBUNDLE=\"/Applications/Open Knowledge.app/Contents/Resources/cli/bin/ok.sh\"\n[ -f \"$BUNDLE\" ] && [ -x \"$BUNDLE\" ] && exec \"$BUNDLE\" start --ui-port \"$UIPORT\"\ncommand -v npx >/dev/null 2>&1 && exec npx -y @inkeep/open-knowledge@latest start --ui-port \"$UIPORT\"\nfor d in \"$HOME/.nvm/versions/node\"/*/bin \"$HOME/.fnm/node-versions\"/*/installation/bin \"$HOME/.asdf/installs/nodejs\"/*/bin /opt/homebrew/bin /usr/local/bin \"$HOME/.local/bin\" \"$HOME/.volta/bin\"; do\n [ -f \"$d/npx\" ] && [ -x \"$d/npx\" ] && exec \"$d/npx\" -y @inkeep/open-knowledge@latest start --ui-port \"$UIPORT\"\ndone\necho \"Open Knowledge: install OK Desktop or Node.js 24+, then restart your editor\" >&2\nexit 127";
|
|
114
116
|
type LaunchJsonAction = 'created' | 'merged' | 'failed';
|
|
115
117
|
interface LaunchJsonResult {
|
|
116
118
|
action: LaunchJsonAction;
|
|
@@ -164,6 +166,51 @@ declare function truncatePriorEntry(entry: Record<string, unknown>): {
|
|
|
164
166
|
priorArgs: unknown[] | null;
|
|
165
167
|
};
|
|
166
168
|
//#endregion
|
|
169
|
+
//#region src/commands/lock-state.d.ts
|
|
170
|
+
type LockState = {
|
|
171
|
+
status: 'missing';
|
|
172
|
+
lockPath: string;
|
|
173
|
+
} | {
|
|
174
|
+
status: 'corrupt';
|
|
175
|
+
lockPath: string;
|
|
176
|
+
} | {
|
|
177
|
+
status: 'foreign-host';
|
|
178
|
+
lockPath: string;
|
|
179
|
+
lock: ProcessLockMetadata;
|
|
180
|
+
} | {
|
|
181
|
+
status: 'dead-pid';
|
|
182
|
+
lockPath: string;
|
|
183
|
+
lock: ProcessLockMetadata;
|
|
184
|
+
} | {
|
|
185
|
+
status: 'alive';
|
|
186
|
+
lockPath: string;
|
|
187
|
+
lock: ProcessLockMetadata;
|
|
188
|
+
};
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/commands/stop.d.ts
|
|
191
|
+
interface StopTargetPlan {
|
|
192
|
+
name: 'server' | 'ui';
|
|
193
|
+
pid: number;
|
|
194
|
+
port: number;
|
|
195
|
+
}
|
|
196
|
+
interface RunStopDeps {
|
|
197
|
+
lockDir: string;
|
|
198
|
+
inspect?: (name: 'server' | 'ui') => LockState;
|
|
199
|
+
kill?: (pid: number, signal: NodeJS.Signals) => void;
|
|
200
|
+
isAlive?: (pid: number) => boolean;
|
|
201
|
+
log?: (msg: string) => void;
|
|
202
|
+
error?: (msg: string) => void;
|
|
203
|
+
}
|
|
204
|
+
interface StopOutcome {
|
|
205
|
+
stopped: StopTargetPlan[];
|
|
206
|
+
failed: Array<{
|
|
207
|
+
target: StopTargetPlan;
|
|
208
|
+
error: string;
|
|
209
|
+
}>;
|
|
210
|
+
hadTargets: boolean;
|
|
211
|
+
}
|
|
212
|
+
declare function runStop(deps: RunStopDeps): StopOutcome;
|
|
213
|
+
//#endregion
|
|
167
214
|
//#region src/config/loader.d.ts
|
|
168
215
|
interface LoadConfigResult {
|
|
169
216
|
config: Config;
|
|
@@ -259,5 +306,5 @@ interface ProjectAiIntegrationsResult {
|
|
|
259
306
|
}
|
|
260
307
|
declare function writeProjectAiIntegrations(projectDir: string, selectedEditorIds: readonly EditorId[], installOptions?: McpInstallOptions): ProjectAiIntegrationsResult;
|
|
261
308
|
//#endregion
|
|
262
|
-
export { ALL_EDITOR_IDS, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, type LaunchJsonResult, type LoadConfigResult, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpEntryClassification, type McpInstallOptions, type ParsedGitHubBlobUrl, type PreviewResult, type ProjectAiIntegrationsResult, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, buildManagedServerEntry, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, createTokenStore, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitUrl, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, removeOkPathsFromGitExclude, resolveProjectRoot, scaffoldLaunchJson, truncatePriorEntry, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeUserMcpConfigs };
|
|
309
|
+
export { ALL_EDITOR_IDS, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, LAUNCH_UI_CHAIN_SENTINEL, LAUNCH_UI_CHAIN_V1, type LaunchJsonResult, type LoadConfigResult, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpEntryClassification, type McpInstallOptions, type ParsedGitHubBlobUrl, type PreviewResult, type ProjectAiIntegrationsResult, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, buildManagedServerEntry, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, createTokenStore, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitUrl, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, removeOkPathsFromGitExclude, resolveProjectRoot, runStop, scaffoldLaunchJson, truncatePriorEntry, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeUserMcpConfigs };
|
|
263
310
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./gh-detect-
|
|
1
|
+
import{i as e,r as t,t as n}from"./gh-detect-C-S1OcWk.mjs";import{A as r,C as i,D as a,E as o,O as s,S as c,T as l,_ as u,b as d,d as f,g as p,h as m,i as h,j as g,k as _,o as v,r as y,s as b,t as x,w as S,x as C,y as w}from"./init-BkOqRoAY.mjs";import{l as T,n as E,r as D,t as O,u as k}from"./src-BT54djM0.mjs";import{n as A}from"./loader-Bf_NzSYN.mjs";import{n as j}from"./preview-CTNz7VTY.mjs";import{n as M,t as N}from"./mcp-migrate-event-BF8ILHwp.mjs";export{a as ALL_EDITOR_IDS,s as EDITOR_LABELS,_ as EDITOR_TARGETS,x as LAUNCH_CONFIG_NAME,y as LAUNCH_UI_CHAIN_SENTINEL,h as LAUNCH_UI_CHAIN_V1,d as addOkPathsToGitExclude,r as buildManagedServerEntry,N as buildMcpConfigMigrateEvent,v as classifyExistingMcpEntry,t as createTokenStore,n as detectGh,b as detectInstalledEditors,C as formatTrackedRemediation,c as getExcludedOkPaths,i as getOkArtifactPaths,g as isEntryUpToDate,A as loadConfig,e as makeLazyProbeTokenStore,T as parseGitHubBlobUrl,k as parseGitUrl,j as previewContent,S as probeTrackedOkPaths,f as readExistingMcpEntry,l as readSharingMode,o as removeOkPathsFromGitExclude,w as resolveProjectRoot,D as runStop,m as scaffoldLaunchJson,M as truncatePriorEntry,E as validateLocalFolderForShare,p as writeEditorMcpConfig,O as writeProjectAiIntegrations,u as writeUserMcpConfigs};
|