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,145 @@
1
+ import fs from "fs/promises";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { v4 as uuidv4 } from "uuid";
5
+
6
+ interface TriggerStep {
7
+ command: string;
8
+ selector?: string;
9
+ text?: string;
10
+ value?: string;
11
+ timeout?: number;
12
+ ms?: number;
13
+ clear?: boolean;
14
+ contains?: boolean;
15
+ path?: string;
16
+ }
17
+
18
+ export interface SavedScenario {
19
+ id: string;
20
+ name: string;
21
+ description?: string;
22
+ target: string;
23
+ steps: TriggerStep[];
24
+ createdAt: string;
25
+ lastRunAt?: string;
26
+ runCount: number;
27
+ }
28
+
29
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
30
+ const DATA_DIR = path.join(__dirname, "..", "..", "data");
31
+ const DATA_FILE = path.join(DATA_DIR, "scenarios.json");
32
+
33
+ /**
34
+ * JSON file-backed store for saved test scenarios.
35
+ */
36
+ export class ScenarioStore {
37
+ private static instance: ScenarioStore;
38
+ private scenarios: SavedScenario[] = [];
39
+ private loaded = false;
40
+ private persistQueue: Promise<void> = Promise.resolve();
41
+
42
+ static getInstance(): ScenarioStore {
43
+ if (!ScenarioStore.instance) {
44
+ ScenarioStore.instance = new ScenarioStore();
45
+ }
46
+ return ScenarioStore.instance;
47
+ }
48
+
49
+ async load(): Promise<void> {
50
+ if (this.loaded) return;
51
+ await this.reload();
52
+ }
53
+
54
+ private async reload(): Promise<void> {
55
+ try {
56
+ const raw = await fs.readFile(DATA_FILE, "utf-8");
57
+ this.scenarios = JSON.parse(raw);
58
+ } catch {
59
+ this.scenarios = [];
60
+ }
61
+ this.loaded = true;
62
+ }
63
+
64
+ private persist(): Promise<void> {
65
+ const write = async () => {
66
+ await fs.mkdir(DATA_DIR, { recursive: true });
67
+ await fs.writeFile(DATA_FILE, JSON.stringify(this.scenarios, null, 2));
68
+ };
69
+ // Serialize writes to prevent concurrent persist() from corrupting the file
70
+ this.persistQueue = this.persistQueue.then(write, write);
71
+ return this.persistQueue;
72
+ }
73
+
74
+ async list(target: string): Promise<SavedScenario[]> {
75
+ await this.reload();
76
+ return this.scenarios.filter((s) => s.target === target);
77
+ }
78
+
79
+ async listAll(): Promise<SavedScenario[]> {
80
+ await this.reload();
81
+ return [...this.scenarios];
82
+ }
83
+
84
+ async get(id: string): Promise<SavedScenario | undefined> {
85
+ await this.reload();
86
+ return this.scenarios.find((s) => s.id === id);
87
+ }
88
+
89
+ async save(input: {
90
+ name: string;
91
+ description?: string;
92
+ target: string;
93
+ steps: TriggerStep[];
94
+ }): Promise<SavedScenario> {
95
+ await this.load();
96
+ const scenario: SavedScenario = {
97
+ id: uuidv4(),
98
+ name: input.name,
99
+ description: input.description,
100
+ target: input.target,
101
+ steps: input.steps,
102
+ createdAt: new Date().toISOString(),
103
+ runCount: 0,
104
+ };
105
+ this.scenarios.push(scenario);
106
+ await this.persist();
107
+ return scenario;
108
+ }
109
+
110
+ async update(id: string, input: {
111
+ name?: string;
112
+ description?: string;
113
+ target?: string;
114
+ steps?: TriggerStep[];
115
+ }): Promise<SavedScenario | undefined> {
116
+ await this.load();
117
+ const scenario = this.scenarios.find((s) => s.id === id);
118
+ if (!scenario) return undefined;
119
+ if (input.name !== undefined) scenario.name = input.name;
120
+ if (input.description !== undefined) scenario.description = input.description;
121
+ if (input.target !== undefined) scenario.target = input.target;
122
+ if (input.steps !== undefined) scenario.steps = input.steps;
123
+ await this.persist();
124
+ return scenario;
125
+ }
126
+
127
+ async delete(id: string): Promise<boolean> {
128
+ await this.load();
129
+ const idx = this.scenarios.findIndex((s) => s.id === id);
130
+ if (idx === -1) return false;
131
+ this.scenarios.splice(idx, 1);
132
+ await this.persist();
133
+ return true;
134
+ }
135
+
136
+ async markRun(id: string): Promise<SavedScenario | undefined> {
137
+ await this.load();
138
+ const scenario = this.scenarios.find((s) => s.id === id);
139
+ if (!scenario) return undefined;
140
+ scenario.lastRunAt = new Date().toISOString();
141
+ scenario.runCount++;
142
+ await this.persist();
143
+ return scenario;
144
+ }
145
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../packages/tsconfig/node.json",
3
+ "compilerOptions": {
4
+ "noEmit": true
5
+ },
6
+ "include": ["src"],
7
+ "exclude": ["node_modules", "dist", "src/routes"]
8
+ }
@@ -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/vocabulary@0.1.0 build /home/runner/_work/devglide/devglide/src/apps/vocabulary
4
+ > tsc
5
+
@@ -0,0 +1,25 @@
1
+  WARN  Issue while reading "/home/runner/_work/devglide/devglide/.npmrc". Failed to replace env in config: ${NODE_AUTH_TOKEN}
2
+
3
+ > @devglide/vocabulary@0.1.0 lint /home/runner/_work/devglide/devglide/src/apps/vocabulary
4
+ > eslint .
5
+
6
+
7
+ /home/runner/_work/devglide/devglide/src/apps/vocabulary/mcp.ts
8
+ 2:1 warning There should be at least one empty line between import groups import/order
9
+ 3:1 warning There should be at least one empty line between import groups import/order
10
+ 4:1 warning `../../packages/mcp-utils/src/index.js` import should occur before import of `./services/vocabulary-store.js` import/order
11
+
12
+ /home/runner/_work/devglide/devglide/src/apps/vocabulary/services/vocabulary-store.ts
13
+ 1:1 warning There should be at least one empty line between import groups import/order
14
+ 1:8 warning 'path' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
15
+ 3:1 warning `../../../project-context.js` import should occur before type import of `../types.js` import/order
16
+ 4:1 warning `../../../packages/paths.js` import should occur before type import of `../types.js` import/order
17
+ 5:1 warning `../../../packages/json-file-store.js` import should occur before type import of `../types.js` import/order
18
+
19
+ /home/runner/_work/devglide/devglide/src/apps/vocabulary/src/index.ts
20
+ 2:1 warning There should be at least one empty line between import groups import/order
21
+ 3:1 warning `@devglide/mcp-utils` import should occur before import of `../mcp.js` import/order
22
+
23
+ ✖ 10 problems (0 errors, 10 warnings)
24
+ 0 errors and 9 warnings potentially fixable with the `--fix` option.
25
+
@@ -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/vocabulary@0.1.0 typecheck /home/runner/_work/devglide/devglide/src/apps/vocabulary
4
+ > tsc --noEmit
5
+
@@ -0,0 +1,173 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { VocabularyStore } from './services/vocabulary-store.js';
4
+ import { jsonResult, errorResult, createDevglideMcpServer } from '../../packages/mcp-utils/src/index.js';
5
+
6
+ export function createVocabularyMcpServer(): McpServer {
7
+ const server = createDevglideMcpServer(
8
+ 'devglide-vocabulary',
9
+ '0.1.0',
10
+ 'Project-scoped domain vocabulary for LLM context enrichment',
11
+ {
12
+ instructions: [
13
+ '## Vocabulary — Usage Conventions',
14
+ '',
15
+ '### Purpose',
16
+ '- Vocabulary entries define domain-specific terms, abbreviations, and jargon.',
17
+ '- The LLM uses these to accurately interpret short or ambiguous user language.',
18
+ '',
19
+ '### Managing vocabulary',
20
+ '- Use `vocabulary_list` to see all terms.',
21
+ '- Use `vocabulary_lookup` to expand a term by name or alias.',
22
+ '- Use `vocabulary_add` to define a new term.',
23
+ '- Use `vocabulary_update` to modify an existing entry.',
24
+ '- Use `vocabulary_remove` to delete a term.',
25
+ '- Use `vocabulary_context` to get all terms as compiled markdown for LLM injection.',
26
+ ],
27
+ },
28
+ );
29
+
30
+ const store = VocabularyStore.getInstance();
31
+
32
+ // ── 1. vocabulary_list ────────────────────────────────────────────────────
33
+
34
+ server.tool(
35
+ 'vocabulary_list',
36
+ 'List all vocabulary entries. Optionally filter by category or tag.',
37
+ {
38
+ category: z.string().optional().describe('Filter by category'),
39
+ tag: z.string().optional().describe('Filter by tag'),
40
+ },
41
+ async ({ category, tag }) => {
42
+ const entries = await store.list({ category, tag });
43
+ return jsonResult(entries);
44
+ },
45
+ );
46
+
47
+ // ── 2. vocabulary_lookup ──────────────────────────────────────────────────
48
+
49
+ server.tool(
50
+ 'vocabulary_lookup',
51
+ 'Look up a term by name or alias. Returns the full entry with definition.',
52
+ {
53
+ term: z.string().describe('Term or alias to look up'),
54
+ },
55
+ async ({ term }) => {
56
+ const entry = await store.lookup(term);
57
+ if (!entry) return errorResult(`Term "${term}" not found`);
58
+ return jsonResult(entry);
59
+ },
60
+ );
61
+
62
+ // ── 3. vocabulary_add ─────────────────────────────────────────────────────
63
+
64
+ server.tool(
65
+ 'vocabulary_add',
66
+ 'Add a new vocabulary entry. Define a domain term with its full definition.',
67
+ {
68
+ term: z.string().describe('The short term or abbreviation'),
69
+ definition: z.string().describe('Full definition or expansion of the term'),
70
+ aliases: z.string().optional().describe('JSON array of alternative names for this term'),
71
+ category: z.string().optional().describe('Category to group the term under (e.g. "API", "Database", "Business")'),
72
+ tags: z.string().optional().describe('JSON array of tag strings'),
73
+ },
74
+ async ({ term, definition, aliases, category, tags }) => {
75
+ const existing = await store.lookup(term);
76
+ if (existing) return errorResult(`Term "${term}" already exists (id: ${existing.id})`);
77
+
78
+ let parsedAliases: string[] | undefined;
79
+ if (aliases) {
80
+ try { parsedAliases = JSON.parse(aliases); } catch { return errorResult('Invalid JSON for aliases'); }
81
+ }
82
+
83
+ let parsedTags: string[] = [];
84
+ if (tags) {
85
+ try { parsedTags = JSON.parse(tags); } catch { return errorResult('Invalid JSON for tags'); }
86
+ }
87
+
88
+ const entry = await store.save({
89
+ term,
90
+ definition,
91
+ aliases: parsedAliases,
92
+ category,
93
+ tags: parsedTags,
94
+ });
95
+
96
+ return jsonResult(entry);
97
+ },
98
+ );
99
+
100
+ // ── 4. vocabulary_update ──────────────────────────────────────────────────
101
+
102
+ server.tool(
103
+ 'vocabulary_update',
104
+ 'Update an existing vocabulary entry by ID.',
105
+ {
106
+ id: z.string().describe('Entry ID'),
107
+ term: z.string().optional().describe('New term'),
108
+ definition: z.string().optional().describe('New definition'),
109
+ aliases: z.string().optional().describe('JSON array of alternative names'),
110
+ category: z.string().optional().describe('New category'),
111
+ tags: z.string().optional().describe('JSON array of tag strings'),
112
+ },
113
+ async ({ id, term, definition, aliases, category, tags }) => {
114
+ const existing = await store.get(id);
115
+ if (!existing) return errorResult('Entry not found');
116
+
117
+ let parsedAliases: string[] | undefined = existing.aliases;
118
+ if (aliases) {
119
+ try { parsedAliases = JSON.parse(aliases); } catch { return errorResult('Invalid JSON for aliases'); }
120
+ }
121
+
122
+ let parsedTags: string[] = existing.tags;
123
+ if (tags) {
124
+ try { parsedTags = JSON.parse(tags); } catch { return errorResult('Invalid JSON for tags'); }
125
+ }
126
+
127
+ const updated = await store.save({
128
+ id,
129
+ term: term ?? existing.term,
130
+ definition: definition ?? existing.definition,
131
+ aliases: parsedAliases,
132
+ category: category ?? existing.category,
133
+ tags: parsedTags,
134
+ projectId: existing.projectId,
135
+ });
136
+
137
+ return jsonResult(updated);
138
+ },
139
+ );
140
+
141
+ // ── 5. vocabulary_remove ──────────────────────────────────────────────────
142
+
143
+ server.tool(
144
+ 'vocabulary_remove',
145
+ 'Remove a vocabulary entry by ID.',
146
+ {
147
+ id: z.string().describe('Entry ID'),
148
+ },
149
+ async ({ id }) => {
150
+ const deleted = await store.delete(id);
151
+ if (!deleted) return errorResult('Entry not found');
152
+ return jsonResult({ ok: true });
153
+ },
154
+ );
155
+
156
+ // ── 6. vocabulary_context ─────────────────────────────────────────────────
157
+
158
+ server.tool(
159
+ 'vocabulary_context',
160
+ 'Get all vocabulary entries compiled as markdown context for LLM injection. Optionally filter by project.',
161
+ {
162
+ projectId: z.string().optional().describe('Optional project ID to filter entries'),
163
+ },
164
+ async ({ projectId }) => {
165
+ const markdown = await store.getCompiledContext(projectId);
166
+ return {
167
+ content: [{ type: 'text' as const, text: markdown || 'No vocabulary entries defined.' }],
168
+ };
169
+ },
170
+ );
171
+
172
+ return server;
173
+ }
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsc" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsserver" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/_work/devglide/devglide/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/_work/devglide/devglide/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
19
+ else
20
+ exec node "$basedir/../tsx/dist/cli.mjs" "$@"
21
+ fi
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@devglide/vocabulary",
3
+ "version": "0.1.0",
4
+ "description": "Project-scoped domain vocabulary for LLM context enrichment",
5
+ "type": "module",
6
+ "main": "dist/src/index.js",
7
+ "scripts": {
8
+ "dev": "tsx watch src/index.ts",
9
+ "build": "tsc",
10
+ "start": "node dist/src/index.js",
11
+ "clean": "rm -rf dist",
12
+ "typecheck": "tsc --noEmit",
13
+ "lint": "eslint ."
14
+ },
15
+ "private": true,
16
+ "dependencies": {
17
+ "@devglide/mcp-utils": "workspace:*",
18
+ "@modelcontextprotocol/sdk": "^1.12.1",
19
+ "zod": "^3.25.49"
20
+ },
21
+ "devDependencies": {
22
+ "tsx": "^4.19.4",
23
+ "typescript": "^5.8.0"
24
+ }
25
+ }