@drawbridge/drawbridge-agents 0.1.5 → 0.1.7
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/.root-template/npmrc +1 -0
- package/README.md +7 -5
- package/bin/preflight-graphify.js +35 -34
- package/bin/sync-claude.js +17 -3
- package/package.json +1 -1
- /package/.root-template/{.editorconfig → editorconfig} +0 -0
- /package/.root-template/{.mcp.json → mcp.json} +0 -0
- /package/.root-template/{.nvmrc → nvmrc} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
save-exact=true
|
package/README.md
CHANGED
|
@@ -24,11 +24,13 @@ claude/
|
|
|
24
24
|
skills/ ← shared skills (drawbridge-ship-feature, -asana-ship-handoff, ...)
|
|
25
25
|
hooks/ agents/ commands/
|
|
26
26
|
|
|
27
|
-
.root-template/ ← mirrored
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.
|
|
31
|
-
.
|
|
27
|
+
.root-template/ ← mirrored to each consumer repo's root; files are stored DOTLESS
|
|
28
|
+
and the mirror restores the leading dot (one rule; also required
|
|
29
|
+
for npmrc since npm strips a literal .npmrc from tarballs)
|
|
30
|
+
mcp.json → .mcp.json project-level MCP servers (Sentry, Asana)
|
|
31
|
+
editorconfig → .editorconfig family-wide editor defaults (tabs, lf, utf-8)
|
|
32
|
+
npmrc → .npmrc save-exact=true (exact-pin convention)
|
|
33
|
+
nvmrc → .nvmrc family-standard node version (v22.23.1)
|
|
32
34
|
|
|
33
35
|
bin/
|
|
34
36
|
sync-claude.js ← drawbridge-agents-sync — mirrors templates + graphify preflight
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Ensures the graphify runtime is
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// Ensures the graphify runtime is available for the family knowledge graph. NON-FATAL by design:
|
|
3
|
+
// if graphify can't be found or installed, warn and continue — `npm run sync` must never be
|
|
4
|
+
// blocked by it (the drift hook nudges separately, and the graph is built on demand).
|
|
5
|
+
// Set DRAWBRIDGE_SKIP_GRAPHIFY=1 to skip silently.
|
|
5
6
|
const { execFileSync } = require('child_process')
|
|
7
|
+
const os = require('os')
|
|
8
|
+
const path = require('path')
|
|
6
9
|
|
|
7
10
|
if (process.env.DRAWBRIDGE_SKIP_GRAPHIFY === '1') {
|
|
8
11
|
console.log('drawbridge-agents-sync: DRAWBRIDGE_SKIP_GRAPHIFY set — skipping graphify preflight')
|
|
9
12
|
process.exit(0)
|
|
10
13
|
}
|
|
11
14
|
|
|
15
|
+
// npm runs scripts under a minimal shell (sh), so tools installed by uv/pipx into ~/.local/bin
|
|
16
|
+
// are often not on PATH. Add common user-bin dirs so an installed graphify is still found.
|
|
17
|
+
const extra = [ path.join(os.homedir(), '.local', 'bin'), '/opt/homebrew/bin' ]
|
|
18
|
+
process.env.PATH = [ ...extra, process.env.PATH || '' ].join(path.delimiter)
|
|
19
|
+
|
|
12
20
|
const has = (cmd) => {
|
|
13
21
|
try {
|
|
14
22
|
execFileSync(cmd, [ '--version' ], { stdio: 'ignore' })
|
|
@@ -18,37 +26,30 @@ const has = (cmd) => {
|
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
28
|
|
|
21
|
-
if (
|
|
22
|
-
console.log('drawbridge-agents-sync: graphify runtime
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
console.error([
|
|
40
|
-
'drawbridge-agents-sync: could not install the graphify runtime automatically.',
|
|
41
|
-
'Install it, then re-run npm run sync:',
|
|
42
|
-
' uv tool install graphifyy (recommended)',
|
|
43
|
-
' pipx install graphifyy',
|
|
44
|
-
' pip install --user graphifyy',
|
|
45
|
-
'Or set DRAWBRIDGE_SKIP_GRAPHIFY=1 to skip (CI / headless only).'
|
|
46
|
-
].join('\n'))
|
|
47
|
-
process.exit(1)
|
|
29
|
+
if (has('graphify')) {
|
|
30
|
+
console.log('drawbridge-agents-sync: graphify runtime ready')
|
|
31
|
+
process.exit(0)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Best-effort install if a Python tool installer is available; never fail if none is.
|
|
35
|
+
for (const [ cmd, args ] of [
|
|
36
|
+
[ 'uv', [ 'tool', 'install', 'graphifyy' ] ],
|
|
37
|
+
[ 'pipx', [ 'install', 'graphifyy' ] ],
|
|
38
|
+
[ 'pip', [ 'install', '--user', 'graphifyy' ] ],
|
|
39
|
+
[ 'pip3', [ 'install', '--user', 'graphifyy' ] ]
|
|
40
|
+
]) {
|
|
41
|
+
if (!has(cmd)) continue
|
|
42
|
+
try {
|
|
43
|
+
execFileSync(cmd, args, { stdio: 'inherit' })
|
|
44
|
+
break
|
|
45
|
+
} catch (error) {
|
|
46
|
+
// try the next installer
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
console.
|
|
50
|
+
if (has('graphify')) {
|
|
51
|
+
console.log('drawbridge-agents-sync: graphify runtime installed')
|
|
52
|
+
} else {
|
|
53
|
+
console.warn('drawbridge-agents-sync: graphify not found (optional) — install with `uv tool install graphifyy` to enable the family knowledge graph. Continuing.')
|
|
54
|
+
}
|
|
55
|
+
process.exit(0)
|
package/bin/sync-claude.js
CHANGED
|
@@ -16,11 +16,21 @@ const rmrf = (p) => {
|
|
|
16
16
|
|
|
17
17
|
const copied = []
|
|
18
18
|
|
|
19
|
+
// Root-template files are stored dotless and the leading dot is restored on mirror. This is
|
|
20
|
+
// required for `npmrc` (npm strips a literal `.npmrc` from published tarballs) and applied to
|
|
21
|
+
// the rest for one consistent rule: template files never start with a dot.
|
|
22
|
+
const RENAME = {
|
|
23
|
+
editorconfig: '.editorconfig',
|
|
24
|
+
'mcp.json': '.mcp.json',
|
|
25
|
+
nvmrc: '.nvmrc',
|
|
26
|
+
npmrc: '.npmrc'
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
const mirror = (src, dst) => {
|
|
20
30
|
fs.mkdirSync(dst, { recursive: true })
|
|
21
31
|
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
22
32
|
const s = path.join(src, entry.name)
|
|
23
|
-
const d = path.join(dst, entry.name)
|
|
33
|
+
const d = path.join(dst, RENAME[entry.name] || entry.name)
|
|
24
34
|
if (entry.isDirectory()) {
|
|
25
35
|
mirror(s, d)
|
|
26
36
|
} else {
|
|
@@ -80,9 +90,13 @@ const migrateOldDelivery = () => {
|
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
92
|
|
|
83
|
-
// 3. Ensure the graphify runtime is present
|
|
93
|
+
// 3. Ensure the graphify runtime is present (best-effort, never blocks sync).
|
|
84
94
|
const graphifyPreflight = () => {
|
|
85
|
-
|
|
95
|
+
try {
|
|
96
|
+
execFileSync('node', [ path.join(packageRoot, 'bin', 'preflight-graphify.js') ], { stdio: 'inherit' })
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.warn('drawbridge-agents-sync: graphify preflight skipped (' + error.message + ')')
|
|
99
|
+
}
|
|
86
100
|
}
|
|
87
101
|
|
|
88
102
|
mirrorTemplates()
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|