@de-otio/chaoskb-client 0.2.4 → 0.2.5
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* npm postinstall: auto-register ChaosKB with detected MCP-compatible agents.
|
|
4
|
+
*
|
|
5
|
+
* Runs silently — writes to stderr only on success so the user knows it worked.
|
|
6
|
+
* Never fails the install (all errors are swallowed).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=postinstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../cli/postinstall.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* npm postinstall: auto-register ChaosKB with detected MCP-compatible agents.
|
|
4
|
+
*
|
|
5
|
+
* Runs silently — writes to stderr only on success so the user knows it worked.
|
|
6
|
+
* Never fails the install (all errors are swallowed).
|
|
7
|
+
*/
|
|
8
|
+
import { detectAgents } from './agent-registry/detector.js';
|
|
9
|
+
import { mergeAgentConfig } from './agent-registry/config-merger.js';
|
|
10
|
+
async function main() {
|
|
11
|
+
const agents = await detectAgents();
|
|
12
|
+
const installed = agents.filter((a) => a.installed);
|
|
13
|
+
if (installed.length === 0)
|
|
14
|
+
return;
|
|
15
|
+
const registered = [];
|
|
16
|
+
for (const agent of installed) {
|
|
17
|
+
try {
|
|
18
|
+
// Skip if already registered with current paths
|
|
19
|
+
if (agent.registered) {
|
|
20
|
+
registered.push(`${agent.config.displayName} (already registered)`);
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
await mergeAgentConfig(agent.configFilePath);
|
|
24
|
+
registered.push(agent.config.displayName);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// Never fail the install — registration is best-effort
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (registered.length > 0) {
|
|
31
|
+
process.stderr.write(`\n ChaosKB registered with: ${registered.join(', ')}\n` +
|
|
32
|
+
` Restart your agent to activate.\n\n`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
main().catch(() => {
|
|
36
|
+
// Silently ignore — postinstall must never fail
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=postinstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../cli/postinstall.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;IACpC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEpD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEnC,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,gDAAgD;YAChD,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBACrB,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,uBAAuB,CAAC,CAAC;gBACpE,SAAS;YACX,CAAC;YAED,MAAM,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7C,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACP,uDAAuD;QACzD,CAAC;IACH,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gCAAgC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACzD,uCAAuC,CACxC,CAAC;IACJ,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;IAChB,gDAAgD;AAClD,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@de-otio/chaoskb-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "ChaosKB - E2E encrypted personal knowledge base with MCP integration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"build": "tsc && cp cli/agent-registry/registry.json dist/cli/agent-registry/registry.json && cp cli/guide-hashes.json dist/cli/guide-hashes.json",
|
|
35
35
|
"prepublishOnly": "npm run build",
|
|
36
36
|
"prepack": "chmod +x dist/cli/index.js 2>/dev/null || true",
|
|
37
|
+
"postinstall": "node dist/cli/postinstall.js 2>/dev/null || true",
|
|
37
38
|
"test": "vitest run",
|
|
38
39
|
"test:watch": "vitest",
|
|
39
40
|
"test:coverage": "vitest run --coverage",
|