prjct-cli 2.23.7 → 2.23.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/CHANGELOG.md +24 -1
- package/README.md +9 -1
- package/dist/bin/prjct-core.mjs +322 -322
- package/dist/daemon/entry.mjs +214 -214
- package/dist/templates.json +1 -1
- package/package.json +3 -1
- package/scripts/ensure-native-deps.js +64 -0
- package/scripts/postinstall.js +16 -12
- package/templates/crew/CLAUDE-leader-mode.md +5 -1
- package/templates/crew/agents/leader.md +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prjct-cli",
|
|
3
|
-
"version": "2.23.
|
|
3
|
+
"version": "2.23.10",
|
|
4
4
|
"description": "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
|
|
5
5
|
"main": "dist/bin/prjct.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"bin/prjct",
|
|
99
99
|
"dist/",
|
|
100
100
|
"templates/",
|
|
101
|
+
"scripts/ensure-native-deps.js",
|
|
101
102
|
"scripts/postinstall.js",
|
|
102
103
|
"scripts/ensure-bun.sh",
|
|
103
104
|
"scripts/install.sh",
|
|
@@ -107,6 +108,7 @@
|
|
|
107
108
|
],
|
|
108
109
|
"prepublishOnly": "node scripts/build.js",
|
|
109
110
|
"trustedDependencies": [
|
|
111
|
+
"better-sqlite3",
|
|
110
112
|
"chalk"
|
|
111
113
|
]
|
|
112
114
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require('node:child_process')
|
|
4
|
+
const path = require('node:path')
|
|
5
|
+
|
|
6
|
+
const ROOT = path.resolve(__dirname, '..')
|
|
7
|
+
|
|
8
|
+
function npmCommand() {
|
|
9
|
+
return process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function hasBetterSqliteBinding() {
|
|
13
|
+
try {
|
|
14
|
+
const Database = require('better-sqlite3')
|
|
15
|
+
new Database(':memory:').close()
|
|
16
|
+
return true
|
|
17
|
+
} catch (error) {
|
|
18
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
19
|
+
if (
|
|
20
|
+
message.includes('Could not locate the bindings file') ||
|
|
21
|
+
message.includes('better_sqlite3.node')
|
|
22
|
+
) {
|
|
23
|
+
return false
|
|
24
|
+
}
|
|
25
|
+
throw error
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function ensureNativeDependencies(options = {}) {
|
|
30
|
+
if (process.env.PRJCT_SKIP_NATIVE_REBUILD === '1') {
|
|
31
|
+
return { rebuilt: false, skipped: true }
|
|
32
|
+
}
|
|
33
|
+
if (hasBetterSqliteBinding()) {
|
|
34
|
+
return { rebuilt: false, skipped: false }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const stdio = options.stdio || 'inherit'
|
|
38
|
+
execFileSync(npmCommand(), ['rebuild', 'better-sqlite3', '--foreground-scripts'], {
|
|
39
|
+
cwd: ROOT,
|
|
40
|
+
stdio,
|
|
41
|
+
timeout: 120000,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
if (!hasBetterSqliteBinding()) {
|
|
45
|
+
throw new Error('better-sqlite3 native binding is still unavailable after rebuild')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return { rebuilt: true, skipped: false }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (require.main === module) {
|
|
52
|
+
try {
|
|
53
|
+
ensureNativeDependencies()
|
|
54
|
+
} catch (error) {
|
|
55
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
56
|
+
console.error(`prjct native dependency install failed: ${message}`)
|
|
57
|
+
process.exit(1)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
ensureNativeDependencies,
|
|
63
|
+
hasBetterSqliteBinding,
|
|
64
|
+
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* NOTE: postinstall often doesn't run (npm quirks, --ignore-scripts, etc.)
|
|
7
7
|
* The reliable setup path is `prjct start` which users run manually.
|
|
8
8
|
*
|
|
9
|
-
* This script
|
|
9
|
+
* This script may repair required native dependencies, but it must never
|
|
10
|
+
* install optional tools, mutate shell config, or configure integrations.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
const fs = require('node:fs')
|
|
13
14
|
const path = require('node:path')
|
|
15
|
+
const { ensureNativeDependencies } = require('./ensure-native-deps')
|
|
14
16
|
|
|
15
17
|
const ROOT = path.resolve(__dirname, '..')
|
|
16
18
|
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf-8'))
|
|
@@ -23,6 +25,19 @@ const DIM = '\x1b[2m'
|
|
|
23
25
|
const BOLD = '\x1b[1m'
|
|
24
26
|
const RESET = '\x1b[0m'
|
|
25
27
|
|
|
28
|
+
try {
|
|
29
|
+
const result = ensureNativeDependencies({ stdio: 'inherit' })
|
|
30
|
+
if (result.rebuilt) {
|
|
31
|
+
console.log(` ${DIM}Built required SQLite native dependency.${RESET}`)
|
|
32
|
+
}
|
|
33
|
+
} catch (error) {
|
|
34
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
35
|
+
console.error(`\n${BOLD}prjct native dependency repair warning:${RESET} ${message}`)
|
|
36
|
+
console.error(
|
|
37
|
+
`${DIM}Install will continue. prjct will retry this repair before starting the daemon.${RESET}`
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
26
41
|
console.log(`
|
|
27
42
|
${CYAN}${BOLD} prjct${RESET} ${DIM}v${VERSION}${RESET}
|
|
28
43
|
|
|
@@ -32,14 +47,3 @@ ${CYAN}${BOLD} prjct${RESET} ${DIM}v${VERSION}${RESET}
|
|
|
32
47
|
|
|
33
48
|
${DIM}Supports: Claude Code, Gemini CLI, or both${RESET}
|
|
34
49
|
`)
|
|
35
|
-
|
|
36
|
-
// Auto-install Bun for optimal performance (best-effort)
|
|
37
|
-
try {
|
|
38
|
-
const { execSync } = require('node:child_process')
|
|
39
|
-
const ensureBun = path.join(__dirname, 'ensure-bun.sh')
|
|
40
|
-
if (fs.existsSync(ensureBun)) {
|
|
41
|
-
execSync(`sh "${ensureBun}"`, { stdio: 'inherit', timeout: 30000 })
|
|
42
|
-
}
|
|
43
|
-
} catch (_err) {
|
|
44
|
-
console.log(` ${DIM}Bun not installed — using Node.js (slower)${RESET}`)
|
|
45
|
-
}
|
|
@@ -21,5 +21,9 @@ If you need durable state that outlives the session, persist via `prjct` CLI ver
|
|
|
21
21
|
### When this role does NOT apply
|
|
22
22
|
|
|
23
23
|
- Pure exploratory / read-only questions about the repo → answer directly.
|
|
24
|
-
- Edits to
|
|
24
|
+
- Edits to docs, configuration files (e.g. `.prjct/prjct.config.json`), or this file → you may edit directly.
|
|
25
|
+
|
|
26
|
+
### Hard persistence rule
|
|
27
|
+
|
|
28
|
+
Never write audit, checkpoint, review, deploy, or report markdown into any new file or subdirectory under the prjct state folder, and no scratch `.md` anywhere else in the worktree. The ONLY hand-editable file in that folder is `.prjct/prjct.config.json`. Everything else — checkpoints, audits, decisions, learnings, deploy notes — lives in SQLite + the regenerated vault, written through `prjct` CLI verbs (`prjct crew checkpoints set`, `prjct remember`, `prjct capture`, `prjct spec record-review`). If a subagent reports findings, persist them via `prjct remember` and cite the returned mem id; never tell a subagent to write to disk.
|
|
25
29
|
<!-- prjct:crew:end - DO NOT REMOVE THIS MARKER -->
|
|
@@ -91,4 +91,8 @@ If the reviewer replies `VERDICT: CHANGES_REQUESTED`, do not call `record-run` f
|
|
|
91
91
|
## When this role does NOT apply
|
|
92
92
|
|
|
93
93
|
- Pure exploration / read-only questions about the repo → answer directly, no subagents.
|
|
94
|
-
- Edits to
|
|
94
|
+
- Edits to docs, configuration files (e.g. `.prjct/prjct.config.json`), or this file itself → you may edit directly.
|
|
95
|
+
|
|
96
|
+
## Hard persistence rule
|
|
97
|
+
|
|
98
|
+
Never write audit, checklist, review, deploy, or report markdown into any new file or subdirectory under the prjct state folder. The ONLY hand-editable file in that folder is `.prjct/prjct.config.json`. Durable state — checkpoints, audits, reviews, decisions, learnings — goes through `prjct` CLI verbs (`prjct crew checkpoints set`, `prjct remember`, `prjct capture`, `prjct spec record-review`). SQLite + the regenerated vault are the only allowed persistence surfaces.
|