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.
- package/LICENSE +21 -0
- package/README.md +338 -0
- package/bin/claude-md-template.js +94 -0
- package/bin/devglide.js +387 -0
- package/package.json +85 -0
- package/pnpm-workspace.yaml +3 -0
- package/src/apps/coder/.turbo/turbo-lint.log +5 -0
- package/src/apps/coder/package.json +16 -0
- package/src/apps/coder/public/favicon.svg +7 -0
- package/src/apps/coder/public/page.css +275 -0
- package/src/apps/coder/public/page.js +528 -0
- package/src/apps/coder/server.js +3 -0
- package/src/apps/documentation/public/page.css +597 -0
- package/src/apps/documentation/public/page.js +609 -0
- package/src/apps/kanban/.turbo/turbo-lint.log +97 -0
- package/src/apps/kanban/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/kanban/package.json +32 -0
- package/src/apps/kanban/public/favicon.svg +7 -0
- package/src/apps/kanban/public/page.css +1010 -0
- package/src/apps/kanban/public/page.js +1730 -0
- package/src/apps/kanban/public/vendor/marked.min.js +6 -0
- package/src/apps/kanban/public/vendor/sortable.min.js +2 -0
- package/src/apps/kanban/src/db.ts +319 -0
- package/src/apps/kanban/src/index.ts +14 -0
- package/src/apps/kanban/src/mcp-helpers.test.ts +88 -0
- package/src/apps/kanban/src/mcp-helpers.ts +60 -0
- package/src/apps/kanban/src/mcp.ts +59 -0
- package/src/apps/kanban/src/routes/attachments.ts +161 -0
- package/src/apps/kanban/src/routes/features.ts +233 -0
- package/src/apps/kanban/src/routes/issues.ts +373 -0
- package/src/apps/kanban/src/tools/feature-tools.ts +164 -0
- package/src/apps/kanban/src/tools/item-tools.ts +307 -0
- package/src/apps/kanban/src/tools/versioned-entry-tools.ts +72 -0
- package/src/apps/kanban/tsconfig.check.json +9 -0
- package/src/apps/kanban/tsconfig.json +9 -0
- package/src/apps/keymap/.turbo/turbo-lint.log +5 -0
- package/src/apps/keymap/package.json +16 -0
- package/src/apps/keymap/public/page.css +275 -0
- package/src/apps/keymap/public/page.js +294 -0
- package/src/apps/keymap/server.js +25 -0
- package/src/apps/log/.turbo/turbo-build.log +5 -0
- package/src/apps/log/.turbo/turbo-lint.log +45 -0
- package/src/apps/log/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/log/node_modules/.bin/tsc +21 -0
- package/src/apps/log/node_modules/.bin/tsserver +21 -0
- package/src/apps/log/node_modules/.bin/tsx +21 -0
- package/src/apps/log/package.json +36 -0
- package/src/apps/log/public/console-sniffer.js +221 -0
- package/src/apps/log/public/favicon.svg +7 -0
- package/src/apps/log/public/page.css +322 -0
- package/src/apps/log/public/page.js +463 -0
- package/src/apps/log/src/index.ts +9 -0
- package/src/apps/log/src/mcp.ts +122 -0
- package/src/apps/log/src/routes/log.ts +333 -0
- package/src/apps/log/src/routes/status.ts +25 -0
- package/src/apps/log/src/server-sniffer.ts +118 -0
- package/src/apps/log/src/services/file-patterns.ts +39 -0
- package/src/apps/log/src/services/file-tailer.ts +228 -0
- package/src/apps/log/src/services/line-parser.ts +94 -0
- package/src/apps/log/src/services/log-writer.ts +39 -0
- package/src/apps/log/tsconfig.json +8 -0
- package/src/apps/prompts/.turbo/turbo-build.log +5 -0
- package/src/apps/prompts/.turbo/turbo-lint.log +24 -0
- package/src/apps/prompts/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/prompts/mcp.ts +175 -0
- package/src/apps/prompts/node_modules/.bin/tsc +21 -0
- package/src/apps/prompts/node_modules/.bin/tsserver +21 -0
- package/src/apps/prompts/node_modules/.bin/tsx +21 -0
- package/src/apps/prompts/package.json +25 -0
- package/src/apps/prompts/public/page.css +315 -0
- package/src/apps/prompts/public/page.js +541 -0
- package/src/apps/prompts/services/prompt-store.ts +212 -0
- package/src/apps/prompts/src/index.ts +9 -0
- package/src/apps/prompts/tsconfig.json +8 -0
- package/src/apps/prompts/types.ts +27 -0
- package/src/apps/shell/.turbo/turbo-build.log +5 -0
- package/src/apps/shell/.turbo/turbo-lint.log +34 -0
- package/src/apps/shell/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/shell/package.json +35 -0
- package/src/apps/shell/public/favicon.svg +7 -0
- package/src/apps/shell/public/page.css +407 -0
- package/src/apps/shell/public/page.js +1577 -0
- package/src/apps/shell/src/index.ts +150 -0
- package/src/apps/shell/src/mcp.ts +398 -0
- package/src/apps/shell/src/shell-types.ts +41 -0
- package/src/apps/shell/tsconfig.json +8 -0
- package/src/apps/test/.turbo/turbo-build.log +5 -0
- package/src/apps/test/.turbo/turbo-lint.log +27 -0
- package/src/apps/test/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/test/node_modules/.bin/tsc +21 -0
- package/src/apps/test/node_modules/.bin/tsserver +21 -0
- package/src/apps/test/node_modules/.bin/tsx +21 -0
- package/src/apps/test/node_modules/.bin/uuid +21 -0
- package/src/apps/test/package.json +35 -0
- package/src/apps/test/public/favicon.svg +7 -0
- package/src/apps/test/public/page.css +499 -0
- package/src/apps/test/public/page.js +417 -0
- package/src/apps/test/public/scenario-runner.js +450 -0
- package/src/apps/test/src/index.ts +9 -0
- package/src/apps/test/src/mcp.ts +192 -0
- package/src/apps/test/src/routes/trigger.ts +285 -0
- package/src/apps/test/src/services/scenario-broadcaster.ts +60 -0
- package/src/apps/test/src/services/scenario-manager.ts +361 -0
- package/src/apps/test/src/services/scenario-store.ts +145 -0
- package/src/apps/test/tsconfig.json +8 -0
- package/src/apps/vocabulary/.turbo/turbo-build.log +5 -0
- package/src/apps/vocabulary/.turbo/turbo-lint.log +25 -0
- package/src/apps/vocabulary/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/vocabulary/mcp.ts +173 -0
- package/src/apps/vocabulary/node_modules/.bin/tsc +21 -0
- package/src/apps/vocabulary/node_modules/.bin/tsserver +21 -0
- package/src/apps/vocabulary/node_modules/.bin/tsx +21 -0
- package/src/apps/vocabulary/package.json +25 -0
- package/src/apps/vocabulary/public/page.css +247 -0
- package/src/apps/vocabulary/public/page.js +444 -0
- package/src/apps/vocabulary/services/vocabulary-store.ts +179 -0
- package/src/apps/vocabulary/src/index.ts +10 -0
- package/src/apps/vocabulary/tsconfig.json +8 -0
- package/src/apps/vocabulary/types.ts +22 -0
- package/src/apps/voice/.turbo/turbo-build.log +5 -0
- package/src/apps/voice/.turbo/turbo-lint.log +43 -0
- package/src/apps/voice/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/voice/node_modules/.bin/openai +21 -0
- package/src/apps/voice/node_modules/.bin/tsc +21 -0
- package/src/apps/voice/node_modules/.bin/tsserver +21 -0
- package/src/apps/voice/node_modules/.bin/tsx +21 -0
- package/src/apps/voice/package.json +35 -0
- package/src/apps/voice/public/favicon.svg +7 -0
- package/src/apps/voice/public/page.css +388 -0
- package/src/apps/voice/public/page.js +718 -0
- package/src/apps/voice/src/index.ts +10 -0
- package/src/apps/voice/src/mcp.ts +70 -0
- package/src/apps/voice/src/providers/index.ts +85 -0
- package/src/apps/voice/src/providers/openai-compatible.ts +94 -0
- package/src/apps/voice/src/providers/types.ts +27 -0
- package/src/apps/voice/src/routes/config.ts +118 -0
- package/src/apps/voice/src/routes/transcribe.ts +90 -0
- package/src/apps/voice/src/services/config-store.ts +129 -0
- package/src/apps/voice/src/services/stats.ts +108 -0
- package/src/apps/voice/src/transcribe.ts +11 -0
- package/src/apps/voice/src/utils/mime.ts +16 -0
- package/src/apps/voice/tsconfig.json +8 -0
- package/src/apps/workflow/.turbo/turbo-build.log +5 -0
- package/src/apps/workflow/.turbo/turbo-lint.log +96 -0
- package/src/apps/workflow/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/workflow/engine/executors/decision-executor.ts +87 -0
- package/src/apps/workflow/engine/executors/file-executor.ts +90 -0
- package/src/apps/workflow/engine/executors/git-executor.ts +137 -0
- package/src/apps/workflow/engine/executors/http-executor.ts +65 -0
- package/src/apps/workflow/engine/executors/index.ts +28 -0
- package/src/apps/workflow/engine/executors/kanban-executor.ts +154 -0
- package/src/apps/workflow/engine/executors/llm-executor.ts +46 -0
- package/src/apps/workflow/engine/executors/log-executor.ts +62 -0
- package/src/apps/workflow/engine/executors/loop-executor.ts +14 -0
- package/src/apps/workflow/engine/executors/shell-executor.ts +107 -0
- package/src/apps/workflow/engine/executors/sub-workflow-executor.ts +61 -0
- package/src/apps/workflow/engine/executors/test-executor.ts +73 -0
- package/src/apps/workflow/engine/executors/trigger-executor.ts +39 -0
- package/src/apps/workflow/engine/expression-evaluator.ts +117 -0
- package/src/apps/workflow/engine/graph-runner.ts +438 -0
- package/src/apps/workflow/engine/node-executor.ts +104 -0
- package/src/apps/workflow/engine/node-registry.ts +15 -0
- package/src/apps/workflow/engine/variable-resolver.ts +109 -0
- package/src/apps/workflow/mcp.ts +223 -0
- package/src/apps/workflow/node_modules/.bin/tsc +21 -0
- package/src/apps/workflow/node_modules/.bin/tsserver +21 -0
- package/src/apps/workflow/node_modules/.bin/tsx +21 -0
- package/src/apps/workflow/package.json +25 -0
- package/src/apps/workflow/public/editor/canvas.js +366 -0
- package/src/apps/workflow/public/editor/drag-manager.js +326 -0
- package/src/apps/workflow/public/editor/edge-renderer.js +235 -0
- package/src/apps/workflow/public/editor/history-manager.js +147 -0
- package/src/apps/workflow/public/editor/layout-engine.js +159 -0
- package/src/apps/workflow/public/editor/node-renderer.js +199 -0
- package/src/apps/workflow/public/editor/selection-manager.js +193 -0
- package/src/apps/workflow/public/favicon.svg +7 -0
- package/src/apps/workflow/public/models/node-types.js +300 -0
- package/src/apps/workflow/public/models/workflow-model.js +257 -0
- package/src/apps/workflow/public/page.css +406 -0
- package/src/apps/workflow/public/page.js +658 -0
- package/src/apps/workflow/public/panels/inspector.js +360 -0
- package/src/apps/workflow/public/panels/palette.js +106 -0
- package/src/apps/workflow/public/panels/run-view.js +275 -0
- package/src/apps/workflow/public/panels/toolbar.js +232 -0
- package/src/apps/workflow/public/panels/workflow-list.js +237 -0
- package/src/apps/workflow/public/state/store.js +47 -0
- package/src/apps/workflow/services/custom-node-loader.ts +48 -0
- package/src/apps/workflow/services/legacy-converter.ts +72 -0
- package/src/apps/workflow/services/run-manager.ts +190 -0
- package/src/apps/workflow/services/workflow-store.ts +424 -0
- package/src/apps/workflow/services/workflow-validator.test.ts +103 -0
- package/src/apps/workflow/services/workflow-validator.ts +98 -0
- package/src/apps/workflow/src/index.ts +10 -0
- package/src/apps/workflow/templates/ci-pipeline.json +18 -0
- package/src/apps/workflow/templates/code-review.json +22 -0
- package/src/apps/workflow/templates/kanban-testing.json +24 -0
- package/src/apps/workflow/tsconfig.json +8 -0
- package/src/apps/workflow/types.ts +268 -0
- package/src/packages/auth-middleware.ts +14 -0
- package/src/packages/design-tokens/.turbo/turbo-build.log +10 -0
- package/src/packages/design-tokens/STYLEGUIDE.md +414 -0
- package/src/packages/design-tokens/build.js +413 -0
- package/src/packages/design-tokens/demo/index.html +1367 -0
- package/src/packages/design-tokens/demo/proposition-a.html +717 -0
- package/src/packages/design-tokens/demo/proposition-b.html +1239 -0
- package/src/packages/design-tokens/demo/proposition-c.html +1049 -0
- package/src/packages/design-tokens/dist/tailwind-preset.js +115 -0
- package/src/packages/design-tokens/dist/tokens.css +345 -0
- package/src/packages/design-tokens/dist/tokens.d.ts +229 -0
- package/src/packages/design-tokens/dist/tokens.js +386 -0
- package/src/packages/design-tokens/package.json +25 -0
- package/src/packages/design-tokens/tokens.json +228 -0
- package/src/packages/devtools-middleware.ts +22 -0
- package/src/packages/eslint-config/index.js +63 -0
- package/src/packages/eslint-config/node_modules/.bin/eslint +21 -0
- package/src/packages/eslint-config/package.json +18 -0
- package/src/packages/json-file-store.ts +232 -0
- package/src/packages/mcp-utils/.turbo/turbo-build.log +5 -0
- package/src/packages/mcp-utils/dist/index.d.ts +33 -0
- package/src/packages/mcp-utils/dist/index.d.ts.map +1 -0
- package/src/packages/mcp-utils/dist/index.js +126 -0
- package/src/packages/mcp-utils/dist/index.js.map +1 -0
- package/src/packages/mcp-utils/node_modules/.bin/tsc +21 -0
- package/src/packages/mcp-utils/node_modules/.bin/tsserver +21 -0
- package/src/packages/mcp-utils/package.json +32 -0
- package/src/packages/mcp-utils/src/index.ts +171 -0
- package/src/packages/mcp-utils/tsconfig.json +9 -0
- package/src/packages/paths.ts +18 -0
- package/src/packages/project-context/index.js +55 -0
- package/src/packages/project-context/package.json +13 -0
- package/src/packages/project-store.ts +127 -0
- package/src/packages/server-sniffer.ts +132 -0
- package/src/packages/shared-assets/favicon.svg +7 -0
- package/src/packages/shared-assets/keymap-registry.js +512 -0
- package/src/packages/shared-assets/logo.svg +6 -0
- package/src/packages/shared-assets/package.json +11 -0
- package/src/packages/shared-assets/ui-utils.js +48 -0
- package/src/packages/shared-assets/voice-widget.d.ts +37 -0
- package/src/packages/shared-assets/voice-widget.js +695 -0
- package/src/packages/shared-types/.turbo/turbo-build.log +5 -0
- package/src/packages/shared-types/dist/index.d.ts +39 -0
- package/src/packages/shared-types/dist/index.d.ts.map +1 -0
- package/src/packages/shared-types/node_modules/.bin/tsc +21 -0
- package/src/packages/shared-types/node_modules/.bin/tsserver +21 -0
- package/src/packages/shared-types/package.json +25 -0
- package/src/packages/shared-types/src/index.ts +41 -0
- package/src/packages/shared-types/tsconfig.json +11 -0
- package/src/packages/tsconfig/base.json +15 -0
- package/src/packages/tsconfig/next.json +14 -0
- package/src/packages/tsconfig/node.json +11 -0
- package/src/packages/tsconfig/package.json +10 -0
- 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,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,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
|
+
}
|