create-claude-cabinet 0.33.0 → 0.33.1
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/lib/cli.js +4 -1
- package/lib/engagement-setup.js +61 -0
- package/package.json +1 -1
- package/templates/engagement/pib-db-patches/pib-db-lib.mjs +685 -0
- package/templates/engagement/pib-db-patches/pib-db-mcp-server.mjs +443 -0
- package/templates/engagement/pib-db-patches/pib-db-schema.sql +129 -0
- package/templates/engagement/pib-db-patches/pib-db.mjs +239 -0
package/lib/cli.js
CHANGED
|
@@ -9,6 +9,7 @@ const { create: createMetadata, read: readMetadata } = require('./metadata');
|
|
|
9
9
|
const { setupDb } = require('./db-setup');
|
|
10
10
|
const { setupVerifyRuntime } = require('./verify-setup');
|
|
11
11
|
const { setupSiteAuditRuntime } = require('./site-audit-setup');
|
|
12
|
+
const { setupEngagement } = require('./engagement-setup');
|
|
12
13
|
const { reset } = require('./reset');
|
|
13
14
|
|
|
14
15
|
const VERSION = require('../package.json').version;
|
|
@@ -599,6 +600,7 @@ const MODULES = {
|
|
|
599
600
|
default: false,
|
|
600
601
|
lean: false,
|
|
601
602
|
requires: ['work-tracking'],
|
|
603
|
+
postInstall: 'engagement-setup',
|
|
602
604
|
templates: [
|
|
603
605
|
'skills/engagement',
|
|
604
606
|
'skills/engagement-progress',
|
|
@@ -1269,6 +1271,7 @@ async function run() {
|
|
|
1269
1271
|
const POST_INSTALL_HANDLERS = {
|
|
1270
1272
|
'verify-setup': setupVerifyRuntime,
|
|
1271
1273
|
'site-audit-setup': setupSiteAuditRuntime,
|
|
1274
|
+
'engagement-setup': setupEngagement,
|
|
1272
1275
|
};
|
|
1273
1276
|
for (const moduleKey of selectedModules) {
|
|
1274
1277
|
const mod = MODULES[moduleKey];
|
|
@@ -1280,7 +1283,7 @@ async function run() {
|
|
|
1280
1283
|
}
|
|
1281
1284
|
try {
|
|
1282
1285
|
console.log('');
|
|
1283
|
-
const result = handler({ dryRun: !!flags.dryRun });
|
|
1286
|
+
const result = handler({ dryRun: !!flags.dryRun, projectDir });
|
|
1284
1287
|
for (const r of result.results || []) console.log(` 📋 ${r}`);
|
|
1285
1288
|
} catch (err) {
|
|
1286
1289
|
console.log(` ⚠ ${mod.postInstall} failed: ${err.message}`);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* engagement-setup.js — extend pib-db files with engagement schema v5
|
|
3
|
+
* when the engagement module is installed.
|
|
4
|
+
*
|
|
5
|
+
* Dispatched from cli.js's postInstall pipeline. Idempotent: skips
|
|
6
|
+
* files that already contain the engagement code (detected by marker).
|
|
7
|
+
*
|
|
8
|
+
* The base pib-db templates (owned by work-tracking) ship schema v1-v4.
|
|
9
|
+
* The engagement module stores the complete engagement-inclusive versions
|
|
10
|
+
* of the pib-db files in templates/engagement/pib-db-patches/. When
|
|
11
|
+
* engagement is selected, this handler copies those over the base
|
|
12
|
+
* versions, keeping the base templates clean for consumers who don't
|
|
13
|
+
* opt into engagement.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const MARKER = 'ENGAGEMENT_EVENT_KINDS';
|
|
20
|
+
const FILES = ['pib-db-lib.mjs', 'pib-db-mcp-server.mjs', 'pib-db-schema.sql', 'pib-db.mjs'];
|
|
21
|
+
|
|
22
|
+
function setupEngagement({ dryRun, projectDir } = {}) {
|
|
23
|
+
const results = [];
|
|
24
|
+
const scriptsDir = path.join(projectDir, 'scripts');
|
|
25
|
+
const patchDir = path.join(projectDir, '.claude', 'engagement', 'pib-db-patches');
|
|
26
|
+
|
|
27
|
+
if (!fs.existsSync(patchDir)) {
|
|
28
|
+
results.push('engagement-setup: patch dir not found — skipping (templates not yet copied)');
|
|
29
|
+
return { results };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (const file of FILES) {
|
|
33
|
+
const target = path.join(scriptsDir, file);
|
|
34
|
+
const source = path.join(patchDir, file);
|
|
35
|
+
|
|
36
|
+
if (!fs.existsSync(source)) {
|
|
37
|
+
results.push(`${file}: engagement patch not found — skipped`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!fs.existsSync(target)) {
|
|
42
|
+
results.push(`${file}: target not found (work-tracking not installed?) — skipped`);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const existing = fs.readFileSync(target, 'utf8');
|
|
47
|
+
if (existing.includes(MARKER)) {
|
|
48
|
+
results.push(`${file}: already has engagement code — skipped`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!dryRun) {
|
|
53
|
+
fs.copyFileSync(source, target);
|
|
54
|
+
}
|
|
55
|
+
results.push(`${file}: applied engagement-inclusive version`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return { results };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = { setupEngagement };
|
package/package.json
CHANGED