@dashclaw/cli 0.7.4 → 0.7.6
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/claude/install.js +10 -0
- package/lib/up/db.js +14 -0
- package/package.json +1 -1
package/lib/claude/install.js
CHANGED
|
@@ -47,6 +47,12 @@ const HOOK_FILES = [
|
|
|
47
47
|
'dashclaw_stop.py',
|
|
48
48
|
'dashclaw_code_session_reporter.py',
|
|
49
49
|
];
|
|
50
|
+
// Shipped when present in the bundle, skipped otherwise — a newer CLI must
|
|
51
|
+
// keep installing against an older hosted bundle. enforcement_liveness_probe
|
|
52
|
+
// (v8.2) is not wired as a hook here (the CLI does not install the
|
|
53
|
+
// SessionStart digest that auto-spawns it), but travels with the hooks so
|
|
54
|
+
// `python .claude/hooks/enforcement_liveness_probe.py` works out of the box.
|
|
55
|
+
const OPTIONAL_HOOK_FILES = ['enforcement_liveness_probe.py'];
|
|
50
56
|
const HOOK_INTEL_DIR = 'dashclaw_agent_intel';
|
|
51
57
|
const HOOKS_BUNDLE_PATH = '/downloads/dashclaw-claude-code-hooks.zip';
|
|
52
58
|
|
|
@@ -136,6 +142,10 @@ function copyHooksFromRepo(hooksSrc, hooksDst) {
|
|
|
136
142
|
if (!existsSync(sp)) throw new Error(`Required hook script missing: ${sp}`);
|
|
137
143
|
copyFileSync(sp, join(hooksDst, name));
|
|
138
144
|
}
|
|
145
|
+
for (const name of OPTIONAL_HOOK_FILES) {
|
|
146
|
+
const sp = join(hooksSrc, name);
|
|
147
|
+
if (existsSync(sp)) copyFileSync(sp, join(hooksDst, name));
|
|
148
|
+
}
|
|
139
149
|
const intelSrc = join(hooksSrc, HOOK_INTEL_DIR);
|
|
140
150
|
if (!existsSync(intelSrc) || !statSync(intelSrc).isDirectory()) {
|
|
141
151
|
throw new Error(`Required intel module missing: ${intelSrc}`);
|
package/lib/up/db.js
CHANGED
|
@@ -125,6 +125,19 @@ export function embeddedFailureMessage(err) {
|
|
|
125
125
|
return `${base}. Retry with --db docker or --db url.`;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Extra embedded-postgres options when running as root on POSIX (the fresh
|
|
130
|
+
* root-VPS case, caught live by the first `drill:fresh-linux --as-root` run):
|
|
131
|
+
* postgres refuses to run as root, and embedded-postgres's escape hatch is
|
|
132
|
+
* `createPostgresUser: true` (it provisions a `postgres` system user and runs
|
|
133
|
+
* the cluster as that user). No-op everywhere else — including Windows, where
|
|
134
|
+
* the elevated-token case is handled by the pg_ctl lifecycle instead.
|
|
135
|
+
*/
|
|
136
|
+
export function rootPostgresOptions({ platform = process.platform, getuid = process.getuid } = {}) {
|
|
137
|
+
if (platform === 'win32' || typeof getuid !== 'function') return {};
|
|
138
|
+
return getuid() === 0 ? { createPostgresUser: true } : {};
|
|
139
|
+
}
|
|
140
|
+
|
|
128
141
|
export const DEFAULT_DB_PORT = 5433;
|
|
129
142
|
// Scan window when the preferred port is taken: preferred+1 .. preferred+10.
|
|
130
143
|
const PORT_SCAN_SPAN = 10;
|
|
@@ -409,6 +422,7 @@ export async function provisionDatabase({
|
|
|
409
422
|
port,
|
|
410
423
|
persistent: true,
|
|
411
424
|
initdbFlags: INITDB_FLAGS,
|
|
425
|
+
...rootPostgresOptions(),
|
|
412
426
|
});
|
|
413
427
|
try {
|
|
414
428
|
// initdb refuses a non-empty data dir, so only initialise a cluster that
|