@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.
@@ -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 into each consumer repo's root (identical everywhere)
28
- .mcp.json ← project-level MCP servers (Sentry, Asana)
29
- .editorconfig ← family-wide editor defaults (tabs, lf, utf-8)
30
- .npmrc ← save-exact=true (enforces the exact-pin convention)
31
- .nvmrc ← family-standard node version (v22.23.1)
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 installed (required for the family knowledge graph) and
3
- // registers its MCP server with the local assistant. Called by drawbridge-agents-sync.
4
- // Set DRAWBRIDGE_SKIP_GRAPHIFY=1 to skip in CI / headless environments.
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 (!has('graphify')) {
22
- console.log('drawbridge-agents-sync: graphify runtime not found, attempting install...')
23
- const attempts = [
24
- [ 'uv', [ 'tool', 'install', 'graphifyy' ] ],
25
- [ 'pipx', [ 'install', 'graphifyy' ] ],
26
- [ 'pip', [ 'install', '--user', 'graphifyy' ] ],
27
- [ 'pip3', [ 'install', '--user', 'graphifyy' ] ]
28
- ]
29
- for (const [ cmd, args ] of attempts) {
30
- if (!has(cmd)) continue
31
- try {
32
- execFileSync(cmd, args, { stdio: 'inherit' })
33
- break
34
- } catch (error) {
35
- // try the next installer
36
- }
37
- }
38
- if (!has('graphify')) {
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
- // Note: we deliberately do NOT run `graphify install` — it writes a graphify section into the
52
- // repo's CLAUDE.md and a PreToolUse hook, which would mutate a committed file and clash with the
53
- // shared CLAUDE.md. Agents use the graphify CLI directly (see conventions/graphify.md).
54
- console.log('drawbridge-agents-sync: graphify runtime ready (run `npx drawbridge-agents-graph` to build the graph)')
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)
@@ -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 + reachable (hard-fails if it can't be).
93
+ // 3. Ensure the graphify runtime is present (best-effort, never blocks sync).
84
94
  const graphifyPreflight = () => {
85
- execFileSync('node', [ path.join(packageRoot, 'bin', 'preflight-graphify.js') ], { stdio: 'inherit' })
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
File without changes
File without changes
File without changes