@justestif/pk 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17709,6 +17709,48 @@ var {
|
|
|
17709
17709
|
Option,
|
|
17710
17710
|
Help
|
|
17711
17711
|
} = import__.default;
|
|
17712
|
+
// package.json
|
|
17713
|
+
var package_default = {
|
|
17714
|
+
name: "@justestif/pk",
|
|
17715
|
+
type: "module",
|
|
17716
|
+
version: "0.1.10",
|
|
17717
|
+
description: "Project knowledge \u2014 structured intake, search, and recall",
|
|
17718
|
+
bin: {
|
|
17719
|
+
pk: "dist/index.js"
|
|
17720
|
+
},
|
|
17721
|
+
files: [
|
|
17722
|
+
"dist/",
|
|
17723
|
+
"skill/",
|
|
17724
|
+
"README.md"
|
|
17725
|
+
],
|
|
17726
|
+
scripts: {
|
|
17727
|
+
build: `bun build src/index.ts --outfile dist/index.js --target bun && printf '#!/usr/bin/env bun
|
|
17728
|
+
' | cat - dist/index.js > dist/tmp.js && mv dist/tmp.js dist/index.js && chmod +x dist/index.js`,
|
|
17729
|
+
check: "bun run typecheck && bun run lint && bun test",
|
|
17730
|
+
typecheck: "bunx tsc --noEmit",
|
|
17731
|
+
lint: "xo",
|
|
17732
|
+
test: "bun test",
|
|
17733
|
+
prepublishOnly: "bun run build"
|
|
17734
|
+
},
|
|
17735
|
+
dependencies: {
|
|
17736
|
+
"@clack/prompts": "^1.3.0",
|
|
17737
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
17738
|
+
commander: "^14.0.0",
|
|
17739
|
+
"gray-matter": "^4.0.3",
|
|
17740
|
+
markdownlint: "^0.40.0",
|
|
17741
|
+
zod: "^4"
|
|
17742
|
+
},
|
|
17743
|
+
repository: {
|
|
17744
|
+
type: "git",
|
|
17745
|
+
url: "git+https://github.com/justEstif/pk.git"
|
|
17746
|
+
},
|
|
17747
|
+
devDependencies: {
|
|
17748
|
+
"@types/bun": "latest",
|
|
17749
|
+
ajv: "6",
|
|
17750
|
+
typescript: "latest",
|
|
17751
|
+
xo: "^2.0.2"
|
|
17752
|
+
}
|
|
17753
|
+
};
|
|
17712
17754
|
|
|
17713
17755
|
// src/lib/notes.ts
|
|
17714
17756
|
var import_gray_matter = __toESM(require_gray_matter(), 1);
|
|
@@ -34091,6 +34133,27 @@ var HARNESSES = [
|
|
|
34091
34133
|
{ hint: ".codex/config.toml in project root", label: "Codex CLI", value: "codex" }
|
|
34092
34134
|
];
|
|
34093
34135
|
var HARNESS_VALUES = new Set(HARNESSES.map((h2) => h2.value));
|
|
34136
|
+
var HARNESS_ACTIVATION = {
|
|
34137
|
+
claude: "start a new Claude Code session in this project",
|
|
34138
|
+
"claude-desktop": "quit and restart Claude Desktop",
|
|
34139
|
+
codex: "restart the Codex CLI",
|
|
34140
|
+
cursor: "reload the Cursor window (Cmd+Shift+P \u2192 Reload Window)",
|
|
34141
|
+
omp: "restart your Oh My Pi session",
|
|
34142
|
+
opencode: "restart opencode"
|
|
34143
|
+
};
|
|
34144
|
+
function buildOutro(created, knowledgeDir, harnesses, skillPaths) {
|
|
34145
|
+
const lines = [
|
|
34146
|
+
created ? `Created project: ${knowledgeDir}` : `Connected to existing project: ${knowledgeDir}`
|
|
34147
|
+
];
|
|
34148
|
+
for (const h2 of harnesses) {
|
|
34149
|
+
lines.push(` ${h2}: MCP config written \u2192 ${HARNESS_ACTIVATION[h2]}`);
|
|
34150
|
+
}
|
|
34151
|
+
for (const sp of skillPaths) {
|
|
34152
|
+
lines.push(` skill installed to ${sp}`);
|
|
34153
|
+
}
|
|
34154
|
+
lines.push("", "MCP is ready \u2014 no env export needed.", "To verify: ask your agent to list its tools \u2014 pk_search should appear.", "", "For CLI commands (pk search, pk new, pk lint, \u2026):", ` export PK_KNOWLEDGE_DIR="${knowledgeDir}"`);
|
|
34155
|
+
return lines;
|
|
34156
|
+
}
|
|
34094
34157
|
function parseHarnesses(raw) {
|
|
34095
34158
|
const parts = raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
34096
34159
|
const invalid = parts.filter((s) => !HARNESS_VALUES.has(s));
|
|
@@ -34099,10 +34162,13 @@ function parseHarnesses(raw) {
|
|
|
34099
34162
|
}
|
|
34100
34163
|
return [...new Set(parts)];
|
|
34101
34164
|
}
|
|
34165
|
+
function resolvePkCommand() {
|
|
34166
|
+
return Bun.which("pk") ?? "pk";
|
|
34167
|
+
}
|
|
34102
34168
|
function pkMcpEntry(knowledgeDir) {
|
|
34103
34169
|
return {
|
|
34104
34170
|
args: ["mcp"],
|
|
34105
|
-
command:
|
|
34171
|
+
command: resolvePkCommand(),
|
|
34106
34172
|
env: { PK_KNOWLEDGE_DIR: knowledgeDir }
|
|
34107
34173
|
};
|
|
34108
34174
|
}
|
|
@@ -34165,7 +34231,7 @@ function writeCodexConfig(projectRoot, _name, knowledgeDir) {
|
|
|
34165
34231
|
const cfgPath = path7.join(projectRoot, ".codex", "config.toml");
|
|
34166
34232
|
const toml = [
|
|
34167
34233
|
"[mcp_servers.pk]",
|
|
34168
|
-
|
|
34234
|
+
`command = "${resolvePkCommand()}"`,
|
|
34169
34235
|
'args = ["mcp"]',
|
|
34170
34236
|
"",
|
|
34171
34237
|
"[mcp_servers.pk.env]",
|
|
@@ -34303,15 +34369,8 @@ function registerInit(program2) {
|
|
|
34303
34369
|
projectRoot
|
|
34304
34370
|
};
|
|
34305
34371
|
const skillPaths2 = applyHarnesses(flagHarnesses, ctx2);
|
|
34306
|
-
console.log(created2
|
|
34307
|
-
|
|
34308
|
-
console.log(` ${h2}: MCP config written`);
|
|
34309
|
-
}
|
|
34310
|
-
for (const sp of skillPaths2) {
|
|
34311
|
-
console.log(` skill installed to ${sp}`);
|
|
34312
|
-
}
|
|
34313
|
-
console.log(`
|
|
34314
|
-
Done. Set: export PK_KNOWLEDGE_DIR="${knowledgeDir2}"`);
|
|
34372
|
+
console.log(buildOutro(created2, knowledgeDir2, flagHarnesses, skillPaths2).join(`
|
|
34373
|
+
`));
|
|
34315
34374
|
return;
|
|
34316
34375
|
}
|
|
34317
34376
|
ge("pk init");
|
|
@@ -34373,13 +34432,7 @@ Done. Set: export PK_KNOWLEDGE_DIR="${knowledgeDir2}"`);
|
|
|
34373
34432
|
projectRoot
|
|
34374
34433
|
};
|
|
34375
34434
|
const skillPaths = applyHarnesses(harnesses, ctx);
|
|
34376
|
-
ye(
|
|
34377
|
-
created ? `Created project: ${knowledgeDir}` : `Connected to existing project: ${knowledgeDir}`,
|
|
34378
|
-
...harnesses.map((h2) => ` ${h2}: MCP config written`),
|
|
34379
|
-
...skillPaths.map((sp) => ` skill installed to ${sp}`),
|
|
34380
|
-
"",
|
|
34381
|
-
`Next: export PK_KNOWLEDGE_DIR="${knowledgeDir}"`
|
|
34382
|
-
].join(`
|
|
34435
|
+
ye(buildOutro(created, knowledgeDir, harnesses, skillPaths).join(`
|
|
34383
34436
|
`));
|
|
34384
34437
|
});
|
|
34385
34438
|
}
|
|
@@ -42906,7 +42959,7 @@ function registerMcp(program2) {
|
|
|
42906
42959
|
}
|
|
42907
42960
|
|
|
42908
42961
|
// src/index.ts
|
|
42909
|
-
var program2 = new Command().name("pk").description("Project knowledge \u2014 structured intake, search, and recall").version(
|
|
42962
|
+
var program2 = new Command().name("pk").description("Project knowledge \u2014 structured intake, search, and recall").version(package_default.version);
|
|
42910
42963
|
registerNew(program2);
|
|
42911
42964
|
registerSearch(program2);
|
|
42912
42965
|
registerSynthesize(program2);
|