@cliangdev/conductor 0.1.2

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.
Files changed (130) hide show
  1. package/README.md +141 -0
  2. package/assets/claude/agents/researcher.md +147 -0
  3. package/assets/claude/commands/conductor/implement.md +393 -0
  4. package/assets/claude/commands/conductor/prd.md +291 -0
  5. package/assets/claude/skills/conductor-coder/SKILL.md +214 -0
  6. package/assets/claude/skills/ux-ui-design/SKILL.md +346 -0
  7. package/assets/claude/skills/ux-ui-design/references/design-tokens.md +359 -0
  8. package/dist/commands/config.d.ts +3 -0
  9. package/dist/commands/config.d.ts.map +1 -0
  10. package/dist/commands/config.js +106 -0
  11. package/dist/commands/config.js.map +1 -0
  12. package/dist/commands/dashboard.d.ts +9 -0
  13. package/dist/commands/dashboard.d.ts.map +1 -0
  14. package/dist/commands/dashboard.js +159 -0
  15. package/dist/commands/dashboard.js.map +1 -0
  16. package/dist/commands/doctor.d.ts +6 -0
  17. package/dist/commands/doctor.d.ts.map +1 -0
  18. package/dist/commands/doctor.js +126 -0
  19. package/dist/commands/doctor.js.map +1 -0
  20. package/dist/commands/init.d.ts +19 -0
  21. package/dist/commands/init.d.ts.map +1 -0
  22. package/dist/commands/init.js +276 -0
  23. package/dist/commands/init.js.map +1 -0
  24. package/dist/commands/login.d.ts +3 -0
  25. package/dist/commands/login.d.ts.map +1 -0
  26. package/dist/commands/login.js +161 -0
  27. package/dist/commands/login.js.map +1 -0
  28. package/dist/commands/logout.d.ts +3 -0
  29. package/dist/commands/logout.d.ts.map +1 -0
  30. package/dist/commands/logout.js +14 -0
  31. package/dist/commands/logout.js.map +1 -0
  32. package/dist/commands/mcp.d.ts +3 -0
  33. package/dist/commands/mcp.d.ts.map +1 -0
  34. package/dist/commands/mcp.js +10 -0
  35. package/dist/commands/mcp.js.map +1 -0
  36. package/dist/commands/start.d.ts +7 -0
  37. package/dist/commands/start.d.ts.map +1 -0
  38. package/dist/commands/start.js +74 -0
  39. package/dist/commands/start.js.map +1 -0
  40. package/dist/commands/status.d.ts +9 -0
  41. package/dist/commands/status.d.ts.map +1 -0
  42. package/dist/commands/status.js +126 -0
  43. package/dist/commands/status.js.map +1 -0
  44. package/dist/commands/stop.d.ts +4 -0
  45. package/dist/commands/stop.d.ts.map +1 -0
  46. package/dist/commands/stop.js +30 -0
  47. package/dist/commands/stop.js.map +1 -0
  48. package/dist/daemon/poller.d.ts +18 -0
  49. package/dist/daemon/poller.d.ts.map +1 -0
  50. package/dist/daemon/poller.js +96 -0
  51. package/dist/daemon/poller.js.map +1 -0
  52. package/dist/daemon/run-lifecycle.d.ts +21 -0
  53. package/dist/daemon/run-lifecycle.d.ts.map +1 -0
  54. package/dist/daemon/run-lifecycle.js +53 -0
  55. package/dist/daemon/run-lifecycle.js.map +1 -0
  56. package/dist/daemon/run-queue.d.ts +12 -0
  57. package/dist/daemon/run-queue.d.ts.map +1 -0
  58. package/dist/daemon/run-queue.js +59 -0
  59. package/dist/daemon/run-queue.js.map +1 -0
  60. package/dist/daemon/runner.d.ts +31 -0
  61. package/dist/daemon/runner.d.ts.map +1 -0
  62. package/dist/daemon/runner.js +91 -0
  63. package/dist/daemon/runner.js.map +1 -0
  64. package/dist/daemon/state.d.ts +22 -0
  65. package/dist/daemon/state.d.ts.map +1 -0
  66. package/dist/daemon/state.js +29 -0
  67. package/dist/daemon/state.js.map +1 -0
  68. package/dist/daemon/watcher.d.ts +26 -0
  69. package/dist/daemon/watcher.d.ts.map +1 -0
  70. package/dist/daemon/watcher.js +330 -0
  71. package/dist/daemon/watcher.js.map +1 -0
  72. package/dist/index.d.ts +3 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +44 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/lib/api.d.ts +8 -0
  77. package/dist/lib/api.d.ts.map +1 -0
  78. package/dist/lib/api.js +55 -0
  79. package/dist/lib/api.js.map +1 -0
  80. package/dist/lib/config.d.ts +16 -0
  81. package/dist/lib/config.d.ts.map +1 -0
  82. package/dist/lib/config.js +48 -0
  83. package/dist/lib/config.js.map +1 -0
  84. package/dist/lib/next-steps.d.ts +2 -0
  85. package/dist/lib/next-steps.d.ts.map +1 -0
  86. package/dist/lib/next-steps.js +11 -0
  87. package/dist/lib/next-steps.js.map +1 -0
  88. package/dist/lib/oauth-server.d.ts +10 -0
  89. package/dist/lib/oauth-server.d.ts.map +1 -0
  90. package/dist/lib/oauth-server.js +67 -0
  91. package/dist/lib/oauth-server.js.map +1 -0
  92. package/dist/lib/plugin-assets.d.ts +19 -0
  93. package/dist/lib/plugin-assets.d.ts.map +1 -0
  94. package/dist/lib/plugin-assets.js +121 -0
  95. package/dist/lib/plugin-assets.js.map +1 -0
  96. package/dist/mcp/api.d.ts +7 -0
  97. package/dist/mcp/api.d.ts.map +1 -0
  98. package/dist/mcp/api.js +36 -0
  99. package/dist/mcp/api.js.map +1 -0
  100. package/dist/mcp/config.d.ts +11 -0
  101. package/dist/mcp/config.d.ts.map +1 -0
  102. package/dist/mcp/config.js +31 -0
  103. package/dist/mcp/config.js.map +1 -0
  104. package/dist/mcp/files.d.ts +9 -0
  105. package/dist/mcp/files.d.ts.map +1 -0
  106. package/dist/mcp/files.js +43 -0
  107. package/dist/mcp/files.js.map +1 -0
  108. package/dist/mcp/index.d.ts +3 -0
  109. package/dist/mcp/index.d.ts.map +1 -0
  110. package/dist/mcp/index.js +234 -0
  111. package/dist/mcp/index.js.map +1 -0
  112. package/dist/mcp/queue.d.ts +8 -0
  113. package/dist/mcp/queue.d.ts.map +1 -0
  114. package/dist/mcp/queue.js +19 -0
  115. package/dist/mcp/queue.js.map +1 -0
  116. package/dist/mcp/tools/comments.d.ts +6 -0
  117. package/dist/mcp/tools/comments.d.ts.map +1 -0
  118. package/dist/mcp/tools/comments.js +21 -0
  119. package/dist/mcp/tools/comments.js.map +1 -0
  120. package/dist/mcp/tools/documents.d.ts +11 -0
  121. package/dist/mcp/tools/documents.d.ts.map +1 -0
  122. package/dist/mcp/tools/documents.js +44 -0
  123. package/dist/mcp/tools/documents.js.map +1 -0
  124. package/dist/mcp/tools/issues.d.ts +23 -0
  125. package/dist/mcp/tools/issues.d.ts.map +1 -0
  126. package/dist/mcp/tools/issues.js +141 -0
  127. package/dist/mcp/tools/issues.js.map +1 -0
  128. package/package.json +40 -0
  129. package/scripts/postinstall.js +81 -0
  130. package/scripts/preuninstall.js +175 -0
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+ // Runs after npm install. Only prompts when installed globally with a TTY.
3
+
4
+ import { fileURLToPath } from 'url'
5
+ import * as path from 'path'
6
+ import * as os from 'os'
7
+ import * as readline from 'readline'
8
+
9
+ const isGlobal = process.env['npm_config_global'] === 'true'
10
+ const isTTY = Boolean(process.stdin.isTTY)
11
+
12
+ function printWhatsNext() {
13
+ console.log()
14
+ console.log("What's next:")
15
+ console.log(' Run: conductor login')
16
+ }
17
+
18
+ async function main() {
19
+ try {
20
+ if (!isGlobal || !isTTY) {
21
+ printWhatsNext()
22
+ process.exit(0)
23
+ }
24
+
25
+ const __filename = fileURLToPath(import.meta.url)
26
+ const __dirname = path.dirname(__filename)
27
+
28
+ let pluginModule
29
+ try {
30
+ pluginModule = await import(path.join(__dirname, '..', 'dist', 'lib', 'plugin-assets.js'))
31
+ } catch {
32
+ // dist/ not available (e.g. local dev clone without build) — skip silently
33
+ printWhatsNext()
34
+ process.exit(0)
35
+ }
36
+
37
+ const { installPluginAssets, getAssetSrcDir } = pluginModule
38
+
39
+ function askYesNo(question) {
40
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
41
+ return new Promise(resolve => {
42
+ rl.question(question, answer => {
43
+ rl.close()
44
+ resolve(answer.trim().toLowerCase() !== 'n')
45
+ })
46
+ })
47
+ }
48
+
49
+ console.log()
50
+ const yes = await askYesNo('Install conductor Claude plugin globally? [Y/n] ')
51
+
52
+ if (!yes) {
53
+ console.log(' Run `conductor init` in any project to install locally.')
54
+ printWhatsNext()
55
+ process.exit(0)
56
+ }
57
+
58
+ const targetDir = path.join(os.homedir(), '.claude')
59
+ const assetSrcDir = getAssetSrcDir()
60
+ const mcpJsonPath = path.join(os.homedir(), '.claude', '.mcp.json')
61
+
62
+ const status = installPluginAssets(targetDir, assetSrcDir, mcpJsonPath)
63
+
64
+ if (status === 'installed') {
65
+ console.log('✓ Installed conductor Claude plugin globally')
66
+ } else if (status === 'updated') {
67
+ console.log('✓ Updated conductor Claude plugin globally')
68
+ } else {
69
+ console.log('✓ Conductor Claude plugin up to date')
70
+ }
71
+
72
+ printWhatsNext()
73
+ process.exit(0)
74
+ } catch (err) {
75
+ console.warn('conductor postinstall warning:', err.message)
76
+ printWhatsNext()
77
+ process.exit(0)
78
+ }
79
+ }
80
+
81
+ main()
@@ -0,0 +1,175 @@
1
+ #!/usr/bin/env node
2
+ // Runs before npm uninstall. Cleans up conductor plugin assets and MCP entries.
3
+
4
+ import * as fs from 'fs'
5
+ import * as path from 'path'
6
+ import * as os from 'os'
7
+
8
+ const HOME = os.homedir()
9
+ const CONDUCTOR_DIR = path.join(HOME, '.conductor')
10
+ const PID_FILE = path.join(CONDUCTOR_DIR, 'daemon.pid')
11
+ const CLAUDE_DIR = path.join(HOME, '.claude')
12
+ const SETTINGS_JSON = path.join(CLAUDE_DIR, 'settings.json')
13
+ const MCP_JSON = path.join(process.cwd(), '.mcp.json')
14
+
15
+ const SIGTERM_WAIT_MS = 3000
16
+ const SIGTERM_POLL_MS = 100
17
+
18
+ function isProcessRunning(pid) {
19
+ try {
20
+ process.kill(pid, 0)
21
+ return true
22
+ } catch {
23
+ return false
24
+ }
25
+ }
26
+
27
+ function wait(ms) {
28
+ return new Promise(resolve => setTimeout(resolve, ms))
29
+ }
30
+
31
+ export async function stopDaemon() {
32
+ try {
33
+ let pidStr
34
+ try {
35
+ pidStr = fs.readFileSync(PID_FILE, 'utf8').trim()
36
+ } catch {
37
+ return
38
+ }
39
+
40
+ const pid = parseInt(pidStr, 10)
41
+ if (isNaN(pid)) return
42
+
43
+ try {
44
+ process.kill(pid, 'SIGTERM')
45
+ } catch {
46
+ return
47
+ }
48
+
49
+ const deadline = Date.now() + SIGTERM_WAIT_MS
50
+ while (Date.now() < deadline && isProcessRunning(pid)) {
51
+ await wait(SIGTERM_POLL_MS)
52
+ }
53
+ } catch (err) {
54
+ console.warn('conductor preuninstall warning (stopDaemon):', err.message)
55
+ }
56
+ }
57
+
58
+ export function removeClaudeAssets() {
59
+ const commandsDir = path.join(CLAUDE_DIR, 'commands', 'conductor')
60
+ try {
61
+ if (fs.existsSync(commandsDir)) {
62
+ fs.rmSync(commandsDir, { recursive: true, force: true })
63
+ }
64
+ } catch (err) {
65
+ console.warn('conductor preuninstall warning (commands):', err.message)
66
+ }
67
+
68
+ const agentsDir = path.join(CLAUDE_DIR, 'agents')
69
+ try {
70
+ if (fs.existsSync(agentsDir)) {
71
+ const entries = fs.readdirSync(agentsDir)
72
+ for (const entry of entries) {
73
+ if (entry.startsWith('conductor')) {
74
+ try {
75
+ fs.rmSync(path.join(agentsDir, entry), { recursive: true, force: true })
76
+ } catch (err) {
77
+ console.warn('conductor preuninstall warning (agents):', err.message)
78
+ }
79
+ }
80
+ }
81
+ }
82
+ } catch (err) {
83
+ console.warn('conductor preuninstall warning (agents dir):', err.message)
84
+ }
85
+
86
+ const skillsDir = path.join(CLAUDE_DIR, 'skills')
87
+ try {
88
+ if (fs.existsSync(skillsDir)) {
89
+ const entries = fs.readdirSync(skillsDir)
90
+ for (const entry of entries) {
91
+ if (entry.startsWith('conductor')) {
92
+ try {
93
+ fs.rmSync(path.join(skillsDir, entry), { recursive: true, force: true })
94
+ } catch (err) {
95
+ console.warn('conductor preuninstall warning (skills):', err.message)
96
+ }
97
+ }
98
+ }
99
+ }
100
+ } catch (err) {
101
+ console.warn('conductor preuninstall warning (skills dir):', err.message)
102
+ }
103
+ }
104
+
105
+ export function cleanSettings() {
106
+ try {
107
+ let raw
108
+ try {
109
+ raw = fs.readFileSync(SETTINGS_JSON, 'utf8')
110
+ } catch {
111
+ return
112
+ }
113
+
114
+ let settings
115
+ try {
116
+ settings = JSON.parse(raw)
117
+ } catch {
118
+ return
119
+ }
120
+
121
+ if (Array.isArray(settings.allow)) {
122
+ settings.allow = settings.allow.filter(entry => !String(entry).startsWith('mcp__conductor__'))
123
+ }
124
+
125
+ fs.writeFileSync(SETTINGS_JSON, JSON.stringify(settings, null, 2), 'utf8')
126
+ } catch (err) {
127
+ console.warn('conductor preuninstall warning (settings.json):', err.message)
128
+ }
129
+ }
130
+
131
+ export function cleanMcpJson() {
132
+ try {
133
+ let raw
134
+ try {
135
+ raw = fs.readFileSync(MCP_JSON, 'utf8')
136
+ } catch {
137
+ return
138
+ }
139
+
140
+ let config
141
+ try {
142
+ config = JSON.parse(raw)
143
+ } catch {
144
+ return
145
+ }
146
+
147
+ if (config.mcpServers && 'conductor' in config.mcpServers) {
148
+ delete config.mcpServers.conductor
149
+ }
150
+
151
+ fs.writeFileSync(MCP_JSON, JSON.stringify(config, null, 2), 'utf8')
152
+ } catch (err) {
153
+ console.warn('conductor preuninstall warning (.mcp.json):', err.message)
154
+ }
155
+ }
156
+
157
+ async function main() {
158
+ await stopDaemon()
159
+ removeClaudeAssets()
160
+ cleanSettings()
161
+ cleanMcpJson()
162
+
163
+ console.log('Conductor plugin assets removed from ~/.claude/')
164
+ console.log('Conductor MCP entries removed from settings.json and .mcp.json')
165
+ console.log('Your project data has been kept at ~/.conductor/')
166
+ console.log('To fully remove all data: rm -rf ~/.conductor')
167
+ }
168
+
169
+ // Only run main when executed directly (not imported by tests)
170
+ const isMain = process.argv[1] && path.resolve(process.argv[1]) === path.resolve(new URL(import.meta.url).pathname)
171
+ if (isMain) {
172
+ main().catch(err => {
173
+ console.warn('conductor preuninstall warning:', err.message)
174
+ })
175
+ }