@programinglive/dev-workflow-mcp-server 1.4.0 → 1.4.5
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/.github/workflows/npm-publish.yml +3 -0
- package/CHANGELOG.md +132 -2
- package/README.md +2 -1
- package/docs/PLESK_DEPLOYMENT.md +170 -0
- package/docs/WORKFLOW-BEST-PRACTICES.md +58 -0
- package/docs/product/PRD.md +1 -0
- package/docs/release-notes/RELEASE_NOTES.md +59 -0
- package/package.json +7 -6
- package/release-wrapper.js +68 -33
- package/scripts/update-release-notes.cjs +14 -18
- package/tailwind.config.js +2 -4
- package/tests/build.test.js +16 -3
- package/tests/handlers.test.js +78 -0
- package/tests/release-wrapper.test.js +2 -0
- package/tests/workflowState.test.js +7 -4
- package/tools/definitions.js +2 -2
- package/tools/handlers.js +2 -2
- package/vite.web.config.js +23 -0
- package/web/README.md +36 -0
- package/web/app/api/docs/route.ts +32 -0
- package/web/app/api/history/route.ts +19 -0
- package/web/app/api/npm-downloads/route.ts +21 -0
- package/web/app/api/summary/route.ts +15 -0
- package/web/app/api/version/route.ts +15 -0
- package/web/app/docs/page.tsx +202 -0
- package/web/app/favicon.ico +0 -0
- package/web/app/globals.css +91 -0
- package/web/app/layout.tsx +36 -0
- package/web/app/page.tsx +15 -0
- package/web/components/ApiReference.tsx +20 -0
- package/web/components/Features.tsx +61 -0
- package/web/components/Footer.tsx +9 -0
- package/web/components/Hero.tsx +97 -0
- package/web/components/History.tsx +143 -0
- package/web/components/Navbar.tsx +64 -0
- package/web/components/Terminal.tsx +114 -0
- package/web/eslint.config.mjs +18 -0
- package/web/lib/db.js +131 -0
- package/web/lib/docs.js +73 -0
- package/web/next.config.ts +8 -0
- package/web/package-lock.json +6971 -0
- package/web/package.json +29 -0
- package/web/postcss.config.mjs +9 -0
- package/web/public/assets/android-chrome-192x192.png +0 -0
- package/web/public/assets/android-chrome-512x512.png +0 -0
- package/web/public/assets/apple-touch-icon.png +0 -0
- package/web/public/assets/favicon-16x16.png +0 -0
- package/web/public/assets/favicon-32x32.png +0 -0
- package/web/public/assets/favicon.ico +0 -0
- package/web/public/assets/favicon.png +0 -0
- package/web/public/assets/logo.png +0 -0
- package/web/public/assets/og-preview.png +0 -0
- package/web/public/assets/site.webmanifest +1 -0
- package/web/public/file.svg +1 -0
- package/web/public/globe.svg +1 -0
- package/web/public/next.svg +1 -0
- package/web/public/vercel.svg +1 -0
- package/web/public/window.svg +1 -0
- package/web/server.js +30 -158
- package/web/tailwind.config.ts +19 -0
- package/web/tsconfig.json +42 -0
- package/web-legacy/public/assets/android-chrome-192x192.png +0 -0
- package/web-legacy/public/assets/android-chrome-512x512.png +0 -0
- package/web-legacy/public/assets/apple-touch-icon.png +0 -0
- package/web-legacy/public/assets/favicon-16x16.png +0 -0
- package/web-legacy/public/assets/favicon-32x32.png +0 -0
- package/web-legacy/public/assets/favicon.ico +0 -0
- package/web-legacy/public/assets/favicon.png +0 -0
- package/web-legacy/public/assets/logo.png +0 -0
- package/web-legacy/public/assets/og-preview.png +0 -0
- package/web-legacy/public/assets/site.webmanifest +1 -0
- package/{dist → web-legacy/public}/docs/EXAMPLES.html +87 -2
- package/{dist → web-legacy/public}/docs/GETTING-STARTED.html +87 -2
- package/{dist → web-legacy/public}/docs/README.html +87 -2
- package/web-legacy/public/docs/RELEASE_NOTES.html +275 -0
- package/{dist → web-legacy/public}/docs/TROUBLESHOOTING.html +87 -2
- package/{dist → web-legacy/public}/docs/WORKFLOW-TEMPLATES.html +87 -2
- package/{dist → web-legacy/public}/docs/web-dashboard.html +87 -2
- package/web-legacy/public/index.html +223 -0
- package/web-legacy/public/input.css +80 -0
- package/web-legacy/public/main.js +167 -0
- package/web-legacy/public/output.css +1559 -0
- package/web-legacy/server.js +207 -0
- package/workflow-state.js +11 -25
- package/dist/docs/RELEASE_NOTES.html +0 -167
- package/web/public/index.html +0 -1046
- package/web/public/input.css +0 -3
- package/web/public/output.css +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
|
|
5
|
+
const eslintConfig = defineConfig([
|
|
6
|
+
...nextVitals,
|
|
7
|
+
...nextTs,
|
|
8
|
+
// Override default ignores of eslint-config-next.
|
|
9
|
+
globalIgnores([
|
|
10
|
+
// Default ignores of eslint-config-next:
|
|
11
|
+
".next/**",
|
|
12
|
+
"out/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"next-env.d.ts",
|
|
15
|
+
]),
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
export default eslintConfig;
|
package/web/lib/db.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
const DB_FILENAME = "dev-workflow.db";
|
|
6
|
+
const FREQUENCY_FORMATS = {
|
|
7
|
+
daily: "%Y-%m-%d",
|
|
8
|
+
monthly: "%Y-%m",
|
|
9
|
+
yearly: "%Y",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function getDbPath() {
|
|
13
|
+
const initCwd = process.env.INIT_CWD || process.cwd();
|
|
14
|
+
let projectRoot = initCwd;
|
|
15
|
+
|
|
16
|
+
// Look for .state folder specifically.
|
|
17
|
+
while (projectRoot !== path.dirname(projectRoot)) {
|
|
18
|
+
if (existsSync(path.join(projectRoot, ".state"))) return path.join(projectRoot, ".state", DB_FILENAME);
|
|
19
|
+
projectRoot = path.dirname(projectRoot);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Fallback to relative path from this file if possible
|
|
23
|
+
return path.join(process.cwd(), "..", ".state", DB_FILENAME);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let db;
|
|
27
|
+
export function getDb() {
|
|
28
|
+
if (!db) {
|
|
29
|
+
const dbPath = getDbPath();
|
|
30
|
+
db = new Database(dbPath);
|
|
31
|
+
db.pragma("journal_mode = WAL");
|
|
32
|
+
migrate();
|
|
33
|
+
}
|
|
34
|
+
return db;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function migrate() {
|
|
38
|
+
const createHistory = `
|
|
39
|
+
CREATE TABLE IF NOT EXISTS workflow_history (
|
|
40
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
41
|
+
user_id TEXT NOT NULL,
|
|
42
|
+
task_description TEXT NOT NULL,
|
|
43
|
+
task_type TEXT NOT NULL,
|
|
44
|
+
commit_message TEXT,
|
|
45
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
46
|
+
forced INTEGER DEFAULT 0,
|
|
47
|
+
force_reason TEXT,
|
|
48
|
+
dropped INTEGER DEFAULT 0,
|
|
49
|
+
drop_reason TEXT,
|
|
50
|
+
UNIQUE(user_id, timestamp, task_description)
|
|
51
|
+
)
|
|
52
|
+
`;
|
|
53
|
+
const createSummary = `
|
|
54
|
+
CREATE TABLE IF NOT EXISTS project_summary (
|
|
55
|
+
user_id TEXT PRIMARY KEY,
|
|
56
|
+
total_tasks INTEGER DEFAULT 0,
|
|
57
|
+
task_types TEXT DEFAULT '{}',
|
|
58
|
+
last_active DATETIME,
|
|
59
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
60
|
+
recent_tasks TEXT DEFAULT '[]'
|
|
61
|
+
)
|
|
62
|
+
`;
|
|
63
|
+
const idxHistory = `CREATE INDEX IF NOT EXISTS idx_workflow_history_user ON workflow_history(user_id)`;
|
|
64
|
+
const idxSummary = `CREATE INDEX IF NOT EXISTS idx_project_summary_user ON project_summary(user_id)`;
|
|
65
|
+
|
|
66
|
+
db.exec(createHistory);
|
|
67
|
+
db.exec(createSummary);
|
|
68
|
+
db.exec(idxHistory);
|
|
69
|
+
db.exec(idxSummary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getSummaryForUser(userId) {
|
|
73
|
+
const stmt = getDb().prepare(`
|
|
74
|
+
SELECT * FROM project_summary WHERE user_id = ?
|
|
75
|
+
`);
|
|
76
|
+
const row = stmt.get(userId);
|
|
77
|
+
if (!row) return null;
|
|
78
|
+
return {
|
|
79
|
+
totalTasks: row.total_tasks,
|
|
80
|
+
taskTypes: JSON.parse(row.task_types),
|
|
81
|
+
lastActive: row.last_active,
|
|
82
|
+
recentTasks: JSON.parse(row.recent_tasks),
|
|
83
|
+
updatedAt: row.updated_at,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function buildHistoryFilters({ startDate, endDate }) {
|
|
88
|
+
const clauses = [];
|
|
89
|
+
const params = [];
|
|
90
|
+
if (startDate) {
|
|
91
|
+
clauses.push("DATE(timestamp) >= DATE(?)");
|
|
92
|
+
params.push(startDate);
|
|
93
|
+
}
|
|
94
|
+
if (endDate) {
|
|
95
|
+
clauses.push("DATE(timestamp) <= DATE(?)");
|
|
96
|
+
params.push(endDate);
|
|
97
|
+
}
|
|
98
|
+
return { clauses, params };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getHistoryForUser(userId, options = {}) {
|
|
102
|
+
const { page = 1, pageSize = 20, startDate, endDate } = options;
|
|
103
|
+
const sanitizedPage = Math.max(1, Number.isFinite(Number(page)) ? Math.floor(Number(page)) : 1);
|
|
104
|
+
const sanitizedPageSize = Math.min(100, Math.max(1, Number.isFinite(Number(pageSize)) ? Math.floor(Number(pageSize)) : 20));
|
|
105
|
+
const offset = (sanitizedPage - 1) * sanitizedPageSize;
|
|
106
|
+
|
|
107
|
+
const { clauses, params } = buildHistoryFilters({ startDate, endDate });
|
|
108
|
+
const where = ["user_id = ?", ...clauses].join(" AND ");
|
|
109
|
+
const dbInstance = getDb();
|
|
110
|
+
|
|
111
|
+
const countStmt = dbInstance.prepare(`SELECT COUNT(*) as total FROM workflow_history WHERE ${where}`);
|
|
112
|
+
const total = countStmt.get(userId, ...params).total;
|
|
113
|
+
|
|
114
|
+
const rowsStmt = dbInstance.prepare(`
|
|
115
|
+
SELECT *
|
|
116
|
+
FROM workflow_history
|
|
117
|
+
WHERE ${where}
|
|
118
|
+
ORDER BY timestamp DESC
|
|
119
|
+
LIMIT ?
|
|
120
|
+
OFFSET ?
|
|
121
|
+
`);
|
|
122
|
+
const entries = rowsStmt.all(userId, ...params, sanitizedPageSize, offset);
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
data: entries,
|
|
126
|
+
total,
|
|
127
|
+
page: sanitizedPage,
|
|
128
|
+
pageSize: sanitizedPageSize,
|
|
129
|
+
totalPages: Math.ceil(total / sanitizedPageSize)
|
|
130
|
+
};
|
|
131
|
+
}
|
package/web/lib/docs.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { readFile, access } from "fs/promises";
|
|
2
|
+
import { join, dirname } from "path";
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
import path from "path";
|
|
5
|
+
|
|
6
|
+
function getProjectRoot() {
|
|
7
|
+
const initCwd = process.env.INIT_CWD || process.cwd();
|
|
8
|
+
let projectRoot = initCwd;
|
|
9
|
+
while (projectRoot !== path.dirname(projectRoot)) {
|
|
10
|
+
if (existsSync(path.join(projectRoot, "package.json")) && existsSync(path.join(projectRoot, "docs"))) return projectRoot;
|
|
11
|
+
projectRoot = path.dirname(projectRoot);
|
|
12
|
+
}
|
|
13
|
+
return path.join(process.cwd(), "..");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const projectRoot = getProjectRoot();
|
|
17
|
+
|
|
18
|
+
const docSources = {
|
|
19
|
+
"README.md": {
|
|
20
|
+
markdown: join(projectRoot, "README.md"),
|
|
21
|
+
html: join(projectRoot, "dist", "docs", "README.html"),
|
|
22
|
+
},
|
|
23
|
+
"web-dashboard.md": {
|
|
24
|
+
markdown: join(projectRoot, "docs", "web-dashboard.md"),
|
|
25
|
+
html: join(projectRoot, "dist", "docs", "web-dashboard.html"),
|
|
26
|
+
},
|
|
27
|
+
"GETTING-STARTED.md": {
|
|
28
|
+
markdown: join(projectRoot, "docs", "antigravity", "GETTING-STARTED.md"),
|
|
29
|
+
html: join(projectRoot, "dist", "docs", "GETTING-STARTED.html"),
|
|
30
|
+
},
|
|
31
|
+
"EXAMPLES.md": {
|
|
32
|
+
markdown: join(projectRoot, "docs", "antigravity", "EXAMPLES.md"),
|
|
33
|
+
html: join(projectRoot, "dist", "docs", "EXAMPLES.html"),
|
|
34
|
+
},
|
|
35
|
+
"WORKFLOW-TEMPLATES.md": {
|
|
36
|
+
markdown: join(projectRoot, "docs", "antigravity", "WORKFLOW-TEMPLATES.md"),
|
|
37
|
+
html: join(projectRoot, "dist", "docs", "WORKFLOW-TEMPLATES.html"),
|
|
38
|
+
},
|
|
39
|
+
"TROUBLESHOOTING.md": {
|
|
40
|
+
markdown: join(projectRoot, "docs", "antigravity", "TROUBLESHOOTING.md"),
|
|
41
|
+
html: join(projectRoot, "dist", "docs", "TROUBLESHOOTING.html"),
|
|
42
|
+
},
|
|
43
|
+
"RELEASE_NOTES.md": {
|
|
44
|
+
markdown: join(projectRoot, "docs", "release-notes", "RELEASE_NOTES.md"),
|
|
45
|
+
html: join(projectRoot, "dist", "docs", "RELEASE_NOTES.html"),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export async function resolveDocContent(docKey) {
|
|
50
|
+
const entry = docSources[docKey];
|
|
51
|
+
if (!entry) {
|
|
52
|
+
return { exists: false };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Try HTML first, fall back to Markdown in development or if HTML missing.
|
|
56
|
+
const candidates = [entry.html, entry.markdown];
|
|
57
|
+
for (const candidate of candidates) {
|
|
58
|
+
try {
|
|
59
|
+
await access(candidate);
|
|
60
|
+
const content = await readFile(candidate, "utf-8");
|
|
61
|
+
const format = candidate.endsWith(".html") ? "html" : "markdown";
|
|
62
|
+
return { exists: true, content, format };
|
|
63
|
+
} catch {
|
|
64
|
+
// try next candidate
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return { exists: false };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getAvailableDocs() {
|
|
72
|
+
return Object.keys(docSources);
|
|
73
|
+
}
|