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,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,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,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,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>
|