devglide 0.1.1

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 (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +338 -0
  3. package/bin/claude-md-template.js +94 -0
  4. package/bin/devglide.js +387 -0
  5. package/package.json +85 -0
  6. package/pnpm-workspace.yaml +3 -0
  7. package/src/apps/coder/.turbo/turbo-lint.log +5 -0
  8. package/src/apps/coder/package.json +16 -0
  9. package/src/apps/coder/public/favicon.svg +7 -0
  10. package/src/apps/coder/public/page.css +275 -0
  11. package/src/apps/coder/public/page.js +528 -0
  12. package/src/apps/coder/server.js +3 -0
  13. package/src/apps/documentation/public/page.css +597 -0
  14. package/src/apps/documentation/public/page.js +609 -0
  15. package/src/apps/kanban/.turbo/turbo-lint.log +97 -0
  16. package/src/apps/kanban/.turbo/turbo-typecheck.log +5 -0
  17. package/src/apps/kanban/package.json +32 -0
  18. package/src/apps/kanban/public/favicon.svg +7 -0
  19. package/src/apps/kanban/public/page.css +1010 -0
  20. package/src/apps/kanban/public/page.js +1730 -0
  21. package/src/apps/kanban/public/vendor/marked.min.js +6 -0
  22. package/src/apps/kanban/public/vendor/sortable.min.js +2 -0
  23. package/src/apps/kanban/src/db.ts +319 -0
  24. package/src/apps/kanban/src/index.ts +14 -0
  25. package/src/apps/kanban/src/mcp-helpers.test.ts +88 -0
  26. package/src/apps/kanban/src/mcp-helpers.ts +60 -0
  27. package/src/apps/kanban/src/mcp.ts +59 -0
  28. package/src/apps/kanban/src/routes/attachments.ts +161 -0
  29. package/src/apps/kanban/src/routes/features.ts +233 -0
  30. package/src/apps/kanban/src/routes/issues.ts +373 -0
  31. package/src/apps/kanban/src/tools/feature-tools.ts +164 -0
  32. package/src/apps/kanban/src/tools/item-tools.ts +307 -0
  33. package/src/apps/kanban/src/tools/versioned-entry-tools.ts +72 -0
  34. package/src/apps/kanban/tsconfig.check.json +9 -0
  35. package/src/apps/kanban/tsconfig.json +9 -0
  36. package/src/apps/keymap/.turbo/turbo-lint.log +5 -0
  37. package/src/apps/keymap/package.json +16 -0
  38. package/src/apps/keymap/public/page.css +275 -0
  39. package/src/apps/keymap/public/page.js +294 -0
  40. package/src/apps/keymap/server.js +25 -0
  41. package/src/apps/log/.turbo/turbo-build.log +5 -0
  42. package/src/apps/log/.turbo/turbo-lint.log +45 -0
  43. package/src/apps/log/.turbo/turbo-typecheck.log +5 -0
  44. package/src/apps/log/node_modules/.bin/tsc +21 -0
  45. package/src/apps/log/node_modules/.bin/tsserver +21 -0
  46. package/src/apps/log/node_modules/.bin/tsx +21 -0
  47. package/src/apps/log/package.json +36 -0
  48. package/src/apps/log/public/console-sniffer.js +221 -0
  49. package/src/apps/log/public/favicon.svg +7 -0
  50. package/src/apps/log/public/page.css +322 -0
  51. package/src/apps/log/public/page.js +463 -0
  52. package/src/apps/log/src/index.ts +9 -0
  53. package/src/apps/log/src/mcp.ts +122 -0
  54. package/src/apps/log/src/routes/log.ts +333 -0
  55. package/src/apps/log/src/routes/status.ts +25 -0
  56. package/src/apps/log/src/server-sniffer.ts +118 -0
  57. package/src/apps/log/src/services/file-patterns.ts +39 -0
  58. package/src/apps/log/src/services/file-tailer.ts +228 -0
  59. package/src/apps/log/src/services/line-parser.ts +94 -0
  60. package/src/apps/log/src/services/log-writer.ts +39 -0
  61. package/src/apps/log/tsconfig.json +8 -0
  62. package/src/apps/prompts/.turbo/turbo-build.log +5 -0
  63. package/src/apps/prompts/.turbo/turbo-lint.log +24 -0
  64. package/src/apps/prompts/.turbo/turbo-typecheck.log +5 -0
  65. package/src/apps/prompts/mcp.ts +175 -0
  66. package/src/apps/prompts/node_modules/.bin/tsc +21 -0
  67. package/src/apps/prompts/node_modules/.bin/tsserver +21 -0
  68. package/src/apps/prompts/node_modules/.bin/tsx +21 -0
  69. package/src/apps/prompts/package.json +25 -0
  70. package/src/apps/prompts/public/page.css +315 -0
  71. package/src/apps/prompts/public/page.js +541 -0
  72. package/src/apps/prompts/services/prompt-store.ts +212 -0
  73. package/src/apps/prompts/src/index.ts +9 -0
  74. package/src/apps/prompts/tsconfig.json +8 -0
  75. package/src/apps/prompts/types.ts +27 -0
  76. package/src/apps/shell/.turbo/turbo-build.log +5 -0
  77. package/src/apps/shell/.turbo/turbo-lint.log +34 -0
  78. package/src/apps/shell/.turbo/turbo-typecheck.log +5 -0
  79. package/src/apps/shell/package.json +35 -0
  80. package/src/apps/shell/public/favicon.svg +7 -0
  81. package/src/apps/shell/public/page.css +407 -0
  82. package/src/apps/shell/public/page.js +1577 -0
  83. package/src/apps/shell/src/index.ts +150 -0
  84. package/src/apps/shell/src/mcp.ts +398 -0
  85. package/src/apps/shell/src/shell-types.ts +41 -0
  86. package/src/apps/shell/tsconfig.json +8 -0
  87. package/src/apps/test/.turbo/turbo-build.log +5 -0
  88. package/src/apps/test/.turbo/turbo-lint.log +27 -0
  89. package/src/apps/test/.turbo/turbo-typecheck.log +5 -0
  90. package/src/apps/test/node_modules/.bin/tsc +21 -0
  91. package/src/apps/test/node_modules/.bin/tsserver +21 -0
  92. package/src/apps/test/node_modules/.bin/tsx +21 -0
  93. package/src/apps/test/node_modules/.bin/uuid +21 -0
  94. package/src/apps/test/package.json +35 -0
  95. package/src/apps/test/public/favicon.svg +7 -0
  96. package/src/apps/test/public/page.css +499 -0
  97. package/src/apps/test/public/page.js +417 -0
  98. package/src/apps/test/public/scenario-runner.js +450 -0
  99. package/src/apps/test/src/index.ts +9 -0
  100. package/src/apps/test/src/mcp.ts +192 -0
  101. package/src/apps/test/src/routes/trigger.ts +285 -0
  102. package/src/apps/test/src/services/scenario-broadcaster.ts +60 -0
  103. package/src/apps/test/src/services/scenario-manager.ts +361 -0
  104. package/src/apps/test/src/services/scenario-store.ts +145 -0
  105. package/src/apps/test/tsconfig.json +8 -0
  106. package/src/apps/vocabulary/.turbo/turbo-build.log +5 -0
  107. package/src/apps/vocabulary/.turbo/turbo-lint.log +25 -0
  108. package/src/apps/vocabulary/.turbo/turbo-typecheck.log +5 -0
  109. package/src/apps/vocabulary/mcp.ts +173 -0
  110. package/src/apps/vocabulary/node_modules/.bin/tsc +21 -0
  111. package/src/apps/vocabulary/node_modules/.bin/tsserver +21 -0
  112. package/src/apps/vocabulary/node_modules/.bin/tsx +21 -0
  113. package/src/apps/vocabulary/package.json +25 -0
  114. package/src/apps/vocabulary/public/page.css +247 -0
  115. package/src/apps/vocabulary/public/page.js +444 -0
  116. package/src/apps/vocabulary/services/vocabulary-store.ts +179 -0
  117. package/src/apps/vocabulary/src/index.ts +10 -0
  118. package/src/apps/vocabulary/tsconfig.json +8 -0
  119. package/src/apps/vocabulary/types.ts +22 -0
  120. package/src/apps/voice/.turbo/turbo-build.log +5 -0
  121. package/src/apps/voice/.turbo/turbo-lint.log +43 -0
  122. package/src/apps/voice/.turbo/turbo-typecheck.log +5 -0
  123. package/src/apps/voice/node_modules/.bin/openai +21 -0
  124. package/src/apps/voice/node_modules/.bin/tsc +21 -0
  125. package/src/apps/voice/node_modules/.bin/tsserver +21 -0
  126. package/src/apps/voice/node_modules/.bin/tsx +21 -0
  127. package/src/apps/voice/package.json +35 -0
  128. package/src/apps/voice/public/favicon.svg +7 -0
  129. package/src/apps/voice/public/page.css +388 -0
  130. package/src/apps/voice/public/page.js +718 -0
  131. package/src/apps/voice/src/index.ts +10 -0
  132. package/src/apps/voice/src/mcp.ts +70 -0
  133. package/src/apps/voice/src/providers/index.ts +85 -0
  134. package/src/apps/voice/src/providers/openai-compatible.ts +94 -0
  135. package/src/apps/voice/src/providers/types.ts +27 -0
  136. package/src/apps/voice/src/routes/config.ts +118 -0
  137. package/src/apps/voice/src/routes/transcribe.ts +90 -0
  138. package/src/apps/voice/src/services/config-store.ts +129 -0
  139. package/src/apps/voice/src/services/stats.ts +108 -0
  140. package/src/apps/voice/src/transcribe.ts +11 -0
  141. package/src/apps/voice/src/utils/mime.ts +16 -0
  142. package/src/apps/voice/tsconfig.json +8 -0
  143. package/src/apps/workflow/.turbo/turbo-build.log +5 -0
  144. package/src/apps/workflow/.turbo/turbo-lint.log +96 -0
  145. package/src/apps/workflow/.turbo/turbo-typecheck.log +5 -0
  146. package/src/apps/workflow/engine/executors/decision-executor.ts +87 -0
  147. package/src/apps/workflow/engine/executors/file-executor.ts +90 -0
  148. package/src/apps/workflow/engine/executors/git-executor.ts +137 -0
  149. package/src/apps/workflow/engine/executors/http-executor.ts +65 -0
  150. package/src/apps/workflow/engine/executors/index.ts +28 -0
  151. package/src/apps/workflow/engine/executors/kanban-executor.ts +154 -0
  152. package/src/apps/workflow/engine/executors/llm-executor.ts +46 -0
  153. package/src/apps/workflow/engine/executors/log-executor.ts +62 -0
  154. package/src/apps/workflow/engine/executors/loop-executor.ts +14 -0
  155. package/src/apps/workflow/engine/executors/shell-executor.ts +107 -0
  156. package/src/apps/workflow/engine/executors/sub-workflow-executor.ts +61 -0
  157. package/src/apps/workflow/engine/executors/test-executor.ts +73 -0
  158. package/src/apps/workflow/engine/executors/trigger-executor.ts +39 -0
  159. package/src/apps/workflow/engine/expression-evaluator.ts +117 -0
  160. package/src/apps/workflow/engine/graph-runner.ts +438 -0
  161. package/src/apps/workflow/engine/node-executor.ts +104 -0
  162. package/src/apps/workflow/engine/node-registry.ts +15 -0
  163. package/src/apps/workflow/engine/variable-resolver.ts +109 -0
  164. package/src/apps/workflow/mcp.ts +223 -0
  165. package/src/apps/workflow/node_modules/.bin/tsc +21 -0
  166. package/src/apps/workflow/node_modules/.bin/tsserver +21 -0
  167. package/src/apps/workflow/node_modules/.bin/tsx +21 -0
  168. package/src/apps/workflow/package.json +25 -0
  169. package/src/apps/workflow/public/editor/canvas.js +366 -0
  170. package/src/apps/workflow/public/editor/drag-manager.js +326 -0
  171. package/src/apps/workflow/public/editor/edge-renderer.js +235 -0
  172. package/src/apps/workflow/public/editor/history-manager.js +147 -0
  173. package/src/apps/workflow/public/editor/layout-engine.js +159 -0
  174. package/src/apps/workflow/public/editor/node-renderer.js +199 -0
  175. package/src/apps/workflow/public/editor/selection-manager.js +193 -0
  176. package/src/apps/workflow/public/favicon.svg +7 -0
  177. package/src/apps/workflow/public/models/node-types.js +300 -0
  178. package/src/apps/workflow/public/models/workflow-model.js +257 -0
  179. package/src/apps/workflow/public/page.css +406 -0
  180. package/src/apps/workflow/public/page.js +658 -0
  181. package/src/apps/workflow/public/panels/inspector.js +360 -0
  182. package/src/apps/workflow/public/panels/palette.js +106 -0
  183. package/src/apps/workflow/public/panels/run-view.js +275 -0
  184. package/src/apps/workflow/public/panels/toolbar.js +232 -0
  185. package/src/apps/workflow/public/panels/workflow-list.js +237 -0
  186. package/src/apps/workflow/public/state/store.js +47 -0
  187. package/src/apps/workflow/services/custom-node-loader.ts +48 -0
  188. package/src/apps/workflow/services/legacy-converter.ts +72 -0
  189. package/src/apps/workflow/services/run-manager.ts +190 -0
  190. package/src/apps/workflow/services/workflow-store.ts +424 -0
  191. package/src/apps/workflow/services/workflow-validator.test.ts +103 -0
  192. package/src/apps/workflow/services/workflow-validator.ts +98 -0
  193. package/src/apps/workflow/src/index.ts +10 -0
  194. package/src/apps/workflow/templates/ci-pipeline.json +18 -0
  195. package/src/apps/workflow/templates/code-review.json +22 -0
  196. package/src/apps/workflow/templates/kanban-testing.json +24 -0
  197. package/src/apps/workflow/tsconfig.json +8 -0
  198. package/src/apps/workflow/types.ts +268 -0
  199. package/src/packages/auth-middleware.ts +14 -0
  200. package/src/packages/design-tokens/.turbo/turbo-build.log +10 -0
  201. package/src/packages/design-tokens/STYLEGUIDE.md +414 -0
  202. package/src/packages/design-tokens/build.js +413 -0
  203. package/src/packages/design-tokens/demo/index.html +1367 -0
  204. package/src/packages/design-tokens/demo/proposition-a.html +717 -0
  205. package/src/packages/design-tokens/demo/proposition-b.html +1239 -0
  206. package/src/packages/design-tokens/demo/proposition-c.html +1049 -0
  207. package/src/packages/design-tokens/dist/tailwind-preset.js +115 -0
  208. package/src/packages/design-tokens/dist/tokens.css +345 -0
  209. package/src/packages/design-tokens/dist/tokens.d.ts +229 -0
  210. package/src/packages/design-tokens/dist/tokens.js +386 -0
  211. package/src/packages/design-tokens/package.json +25 -0
  212. package/src/packages/design-tokens/tokens.json +228 -0
  213. package/src/packages/devtools-middleware.ts +22 -0
  214. package/src/packages/eslint-config/index.js +63 -0
  215. package/src/packages/eslint-config/node_modules/.bin/eslint +21 -0
  216. package/src/packages/eslint-config/package.json +18 -0
  217. package/src/packages/json-file-store.ts +232 -0
  218. package/src/packages/mcp-utils/.turbo/turbo-build.log +5 -0
  219. package/src/packages/mcp-utils/dist/index.d.ts +33 -0
  220. package/src/packages/mcp-utils/dist/index.d.ts.map +1 -0
  221. package/src/packages/mcp-utils/dist/index.js +126 -0
  222. package/src/packages/mcp-utils/dist/index.js.map +1 -0
  223. package/src/packages/mcp-utils/node_modules/.bin/tsc +21 -0
  224. package/src/packages/mcp-utils/node_modules/.bin/tsserver +21 -0
  225. package/src/packages/mcp-utils/package.json +32 -0
  226. package/src/packages/mcp-utils/src/index.ts +171 -0
  227. package/src/packages/mcp-utils/tsconfig.json +9 -0
  228. package/src/packages/paths.ts +18 -0
  229. package/src/packages/project-context/index.js +55 -0
  230. package/src/packages/project-context/package.json +13 -0
  231. package/src/packages/project-store.ts +127 -0
  232. package/src/packages/server-sniffer.ts +132 -0
  233. package/src/packages/shared-assets/favicon.svg +7 -0
  234. package/src/packages/shared-assets/keymap-registry.js +512 -0
  235. package/src/packages/shared-assets/logo.svg +6 -0
  236. package/src/packages/shared-assets/package.json +11 -0
  237. package/src/packages/shared-assets/ui-utils.js +48 -0
  238. package/src/packages/shared-assets/voice-widget.d.ts +37 -0
  239. package/src/packages/shared-assets/voice-widget.js +695 -0
  240. package/src/packages/shared-types/.turbo/turbo-build.log +5 -0
  241. package/src/packages/shared-types/dist/index.d.ts +39 -0
  242. package/src/packages/shared-types/dist/index.d.ts.map +1 -0
  243. package/src/packages/shared-types/node_modules/.bin/tsc +21 -0
  244. package/src/packages/shared-types/node_modules/.bin/tsserver +21 -0
  245. package/src/packages/shared-types/package.json +25 -0
  246. package/src/packages/shared-types/src/index.ts +41 -0
  247. package/src/packages/shared-types/tsconfig.json +11 -0
  248. package/src/packages/tsconfig/base.json +15 -0
  249. package/src/packages/tsconfig/next.json +14 -0
  250. package/src/packages/tsconfig/node.json +11 -0
  251. package/src/packages/tsconfig/package.json +10 -0
  252. package/turbo.json +25 -0
@@ -0,0 +1,212 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import type { Prompt, PromptSummary } from '../types.js';
4
+ import { getActiveProject } from '../../../project-context.js';
5
+ import { PROMPTS_DIR } from '../../../packages/paths.js';
6
+ import { JsonFileStore } from '../../../packages/json-file-store.js';
7
+
8
+ /** Regex for {{varName}} placeholders — matches word chars, hyphens, and dots. */
9
+ const VAR_PATTERN = /\{\{([\w.-]+)\}\}/g;
10
+
11
+ /** Extract {{varName}} placeholders from prompt content. */
12
+ function detectVariables(content: string): string[] {
13
+ const matches = content.matchAll(VAR_PATTERN);
14
+ const vars = new Set<string>();
15
+ for (const m of matches) vars.add(m[1]);
16
+ return [...vars];
17
+ }
18
+
19
+ export class PromptStore extends JsonFileStore<Prompt> {
20
+ private static instance: PromptStore;
21
+ protected readonly baseDir = PROMPTS_DIR;
22
+
23
+ static getInstance(): PromptStore {
24
+ if (!PromptStore.instance) {
25
+ PromptStore.instance = new PromptStore();
26
+ }
27
+ return PromptStore.instance;
28
+ }
29
+
30
+ async list(filter?: { category?: string; tags?: string[]; search?: string }): Promise<PromptSummary[]> {
31
+ const seen = new Map<string, PromptSummary>();
32
+
33
+ const projectDir = this.getProjectDir();
34
+ if (projectDir) {
35
+ for (const s of await this.scanDir(projectDir, 'project')) {
36
+ seen.set(s.id, s);
37
+ }
38
+ for (const s of await this.scanDir(this.getGlobalDir(), 'global')) {
39
+ if (!seen.has(s.id)) seen.set(s.id, s);
40
+ }
41
+ } else {
42
+ // No active project — scan global + project subdirs with correct scope labels
43
+ for (const s of await this.scanDir(this.getGlobalDir(), 'global')) {
44
+ seen.set(s.id, s);
45
+ }
46
+ for (const s of await this.scanProjectSubdirs()) {
47
+ if (!seen.has(s.id)) seen.set(s.id, s);
48
+ }
49
+ }
50
+
51
+ let results = [...seen.values()];
52
+
53
+ if (filter?.category) {
54
+ results = results.filter((p) => p.category === filter.category);
55
+ }
56
+ if (filter?.tags?.length) {
57
+ results = results.filter((p) => filter.tags!.every((t) => p.tags.includes(t)));
58
+ }
59
+ if (filter?.search) {
60
+ const q = filter.search.toLowerCase();
61
+ results = results.filter((p) =>
62
+ p.title.toLowerCase().includes(q) ||
63
+ (p.description ?? '').toLowerCase().includes(q) ||
64
+ (p.category ?? '').toLowerCase().includes(q) ||
65
+ p.tags.some((t) => t.toLowerCase().includes(q)),
66
+ );
67
+ }
68
+
69
+ return results;
70
+ }
71
+
72
+ async save(
73
+ input: Omit<Prompt, 'id' | 'createdAt' | 'updatedAt'> & { id?: string; scope?: 'project' | 'global' },
74
+ ): Promise<Prompt> {
75
+ const lockKey = input.id ?? this.generateId();
76
+ return this.withLock(lockKey, async () => {
77
+ const now = new Date().toISOString();
78
+ const isUpdate = !!input.id;
79
+
80
+ let existing: Prompt | null = null;
81
+ if (isUpdate) {
82
+ existing = await this.get(input.id!);
83
+ }
84
+
85
+ const prompt: Prompt = {
86
+ id: input.id ?? lockKey,
87
+ title: input.title,
88
+ content: input.content,
89
+ description: input.description,
90
+ category: input.category,
91
+ tags: input.tags ?? [],
92
+ variables: detectVariables(input.content),
93
+ model: input.model,
94
+ temperature: input.temperature,
95
+ rating: input.rating,
96
+ notes: input.notes,
97
+ projectId: input.projectId,
98
+ createdAt: existing?.createdAt ?? now,
99
+ updatedAt: now,
100
+ };
101
+
102
+ let scope = input.scope;
103
+ if (!scope && isUpdate) {
104
+ scope = await this.resolveExistingScope(input.id!);
105
+ }
106
+ scope = scope ?? (getActiveProject() ? 'project' : 'global');
107
+
108
+ await this.writeEntity(prompt, scope, getActiveProject()?.id);
109
+ return prompt;
110
+ });
111
+ }
112
+
113
+ /**
114
+ * Atomically fetch, merge, and write — eliminates TOCTOU race in callers.
115
+ * undefined = keep existing, null = clear field, value = update.
116
+ */
117
+ async update(
118
+ id: string,
119
+ fields: { [K in keyof Omit<Prompt, 'id' | 'createdAt' | 'updatedAt' | 'variables'>]?: Prompt[K] | null },
120
+ ): Promise<Prompt | null> {
121
+ return this.withLock(id, async () => {
122
+ const existing = await this.get(id);
123
+ if (!existing) return null;
124
+
125
+ const merged: Prompt = { ...existing, updatedAt: new Date().toISOString() };
126
+ for (const [key, value] of Object.entries(fields)) {
127
+ if (value === undefined) continue;
128
+ (merged as unknown as Record<string, unknown>)[key] = value === null ? undefined : value;
129
+ }
130
+ merged.variables = detectVariables(merged.content);
131
+
132
+ const scope = await this.resolveExistingScope(id) ?? (getActiveProject() ? 'project' : 'global');
133
+ await this.writeEntity(merged, scope, getActiveProject()?.id);
134
+ return merged;
135
+ });
136
+ }
137
+
138
+ /** Return all prompts as compiled markdown for LLM context injection. */
139
+ async getCompiledContext(): Promise<string> {
140
+ const summaries = await this.list();
141
+ if (summaries.length === 0) return '';
142
+
143
+ const lines: string[] = [
144
+ '# Available Prompts',
145
+ '',
146
+ '> Reusable prompt templates. Use `prompts_render` with the ID to expand variables.',
147
+ '',
148
+ ];
149
+
150
+ const byCategory = new Map<string, PromptSummary[]>();
151
+ for (const s of summaries) {
152
+ const cat = s.category ?? 'General';
153
+ if (!byCategory.has(cat)) byCategory.set(cat, []);
154
+ byCategory.get(cat)!.push(s);
155
+ }
156
+
157
+ for (const [category, entries] of byCategory) {
158
+ lines.push(`## ${category}`, '');
159
+ for (const e of entries) {
160
+ const stars = e.rating ? ' ' + '\u2605'.repeat(e.rating) : '';
161
+ const tags = e.tags.length ? ` [${e.tags.join(', ')}]` : '';
162
+ lines.push(`- **${e.title}** (id: \`${e.id}\`)${stars}${tags}`);
163
+ if (e.description) lines.push(` ${e.description}`);
164
+ }
165
+ lines.push('');
166
+ }
167
+
168
+ return lines.join('\n');
169
+ }
170
+
171
+ async render(id: string, vars: Record<string, string>): Promise<string | null> {
172
+ const prompt = await this.get(id);
173
+ if (!prompt) return null;
174
+ return prompt.content.replace(VAR_PATTERN, (_, name) => vars[name] ?? `{{${name}}}`);
175
+ }
176
+
177
+ private toSummary(entry: Prompt, scope: 'project' | 'global'): PromptSummary {
178
+ return {
179
+ id: entry.id,
180
+ title: entry.title,
181
+ description: entry.description,
182
+ category: entry.category,
183
+ tags: entry.tags,
184
+ rating: entry.rating,
185
+ scope,
186
+ updatedAt: entry.updatedAt,
187
+ };
188
+ }
189
+
190
+ private async scanDir(dir: string, scope: 'project' | 'global'): Promise<PromptSummary[]> {
191
+ const entries = await this.scanDirFull(dir);
192
+ return entries.map((e) => this.toSummary(e, scope));
193
+ }
194
+
195
+ /** Scan all project subdirectories under baseDir, labeling entries as 'project' scope. */
196
+ private async scanProjectSubdirs(): Promise<PromptSummary[]> {
197
+ const results: PromptSummary[] = [];
198
+ let names: string[];
199
+ try {
200
+ names = await fs.readdir(this.baseDir);
201
+ } catch {
202
+ return [];
203
+ }
204
+ for (const name of names) {
205
+ if (name.endsWith('.json')) continue;
206
+ for (const entry of await this.scanDirFull(path.join(this.baseDir, name))) {
207
+ results.push(this.toSummary(entry, 'project'));
208
+ }
209
+ }
210
+ return results;
211
+ }
212
+ }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { createPromptsMcpServer } from "../mcp.js";
3
+ import { runStdio } from "@devglide/mcp-utils";
4
+
5
+ if (process.argv.includes("--stdio")) {
6
+ const server = createPromptsMcpServer();
7
+ await runStdio(server);
8
+ console.error("Devglide Prompts MCP server running on stdio");
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../packages/tsconfig/node.json",
3
+ "compilerOptions": {
4
+ "noEmit": true
5
+ },
6
+ "include": ["src", "mcp.ts", "types.ts", "services"],
7
+ "exclude": ["node_modules", "dist"]
8
+ }
@@ -0,0 +1,27 @@
1
+ export interface Prompt {
2
+ id: string;
3
+ title: string;
4
+ content: string; // Supports {{varName}} placeholders
5
+ description?: string;
6
+ category?: string;
7
+ tags: string[];
8
+ variables?: string[]; // Auto-detected from {{...}} in content
9
+ model?: string; // Preferred model hint
10
+ temperature?: number; // Preferred temperature hint
11
+ rating?: number; // 1–5
12
+ notes?: string; // Evaluation notes
13
+ projectId?: string; // undefined = global
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ }
17
+
18
+ export interface PromptSummary {
19
+ id: string;
20
+ title: string;
21
+ description?: string;
22
+ category?: string;
23
+ tags: string[];
24
+ rating?: number;
25
+ scope: 'project' | 'global';
26
+ updatedAt: string;
27
+ }
@@ -0,0 +1,5 @@
1
+  WARN  Issue while reading "/home/runner/_work/devglide/devglide/.npmrc". Failed to replace env in config: ${NODE_AUTH_TOKEN}
2
+
3
+ > @devglide/shell@0.1.0 build /home/runner/_work/devglide/devglide/src/apps/shell
4
+ > tsc
5
+
@@ -0,0 +1,34 @@
1
+  WARN  Issue while reading "/home/runner/_work/devglide/devglide/.npmrc". Failed to replace env in config: ${NODE_AUTH_TOKEN}
2
+
3
+ > @devglide/shell@0.1.0 lint /home/runner/_work/devglide/devglide/src/apps/shell
4
+ > eslint .
5
+
6
+
7
+ /home/runner/_work/devglide/devglide/src/apps/shell/src/index.ts
8
+ 1:1 warning There should be at least one empty line between import groups import/order
9
+ 2:1 warning There should be at least one empty line between import groups import/order
10
+ 2:1 warning `fs` import should occur before import of `node-pty` import/order
11
+ 3:1 warning There should be at least one empty line between import groups import/order
12
+ 4:1 warning `@devglide/mcp-utils` import should occur before import of `node-pty` import/order
13
+
14
+ /home/runner/_work/devglide/devglide/src/apps/shell/src/mcp.ts
15
+ 1:1 warning There should be at least one empty line between import groups import/order
16
+ 1:1 warning `@modelcontextprotocol/sdk/server/streamableHttp.js` import should occur after import of `path` import/order
17
+ 2:1 warning There should be at least one empty line between import groups import/order
18
+ 3:1 warning There should be at least one empty line between import groups import/order
19
+ 3:1 warning `zod` import should occur after type import of `express` import/order
20
+ 4:1 warning There should be at least one empty line between import groups import/order
21
+ 4:1 warning `../../../packages/mcp-utils/src/index.js` import should occur after type import of `express` import/order
22
+ 5:1 warning There should be at least one empty line between import groups import/order
23
+ 5:1 warning `@modelcontextprotocol/sdk/server/mcp.js` type import should occur after import of `path` import/order
24
+ 7:1 warning There should be at least one empty line between import groups import/order
25
+ 8:1 warning There should be at least one empty line between import groups import/order
26
+ 9:1 warning There should be at least one empty line between import groups import/order
27
+ 9:1 warning `./shell-types.js` type import should occur after import of `../../../project-context.js` import/order
28
+
29
+ /home/runner/_work/devglide/devglide/src/apps/shell/src/shell-types.ts
30
+ 34:7 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
31
+
32
+ ✖ 19 problems (0 errors, 19 warnings)
33
+ 0 errors and 18 warnings potentially fixable with the `--fix` option.
34
+
@@ -0,0 +1,5 @@
1
+  WARN  Issue while reading "/home/runner/_work/devglide/devglide/.npmrc". Failed to replace env in config: ${NODE_AUTH_TOKEN}
2
+
3
+ > @devglide/shell@0.1.0 typecheck /home/runner/_work/devglide/devglide/src/apps/shell
4
+ > tsc --noEmit
5
+
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@devglide/shell",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Multi-terminal dashboard with speech-to-text",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "devglide-shell": "./dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node dist/index.js",
12
+ "dev": "tsx watch src/index.ts",
13
+ "build": "tsc",
14
+ "clean": "rm -rf dist",
15
+ "mcp": "tsx src/index.ts --stdio",
16
+ "typecheck": "tsc --noEmit",
17
+ "lint": "eslint ."
18
+ },
19
+ "private": true,
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.12.1",
22
+ "@puppeteer/browsers": "^2.13.0",
23
+ "express": "^5.2.1",
24
+ "node-pty": "^1.1.0",
25
+ "puppeteer-core": "^24.39.0",
26
+ "@devglide/mcp-utils": "workspace:*",
27
+ "zod": "^3.25.49"
28
+ },
29
+ "devDependencies": {
30
+ "@types/express": "^5.0.0",
31
+ "@types/node": "^22.0.0",
32
+ "tsx": "^4.19.4",
33
+ "typescript": "^5.8.0"
34
+ }
35
+ }
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <rect width="32" height="32" fill="#1c2128"/>
3
+ <rect width="32" height="32" fill="none" stroke="#7ee787" stroke-width="1.5"/>
4
+ <path d="M8 10h6a6 6 0 0 1 0 12H8V10z" fill="#7ee787"/>
5
+ <rect x="18" y="10" width="6" height="4" fill="#7ee787" opacity="0.6"/>
6
+ <rect x="18" y="18" width="6" height="4" fill="#7ee787" opacity="0.6"/>
7
+ </svg>