@programinglive/dev-workflow-mcp-server 1.7.13 → 1.7.16

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.
@@ -0,0 +1,123 @@
1
+ // API configuration
2
+ const API_BASE_URL = 'https://hollywood-andrew-cycle-genre.trycloudflare.com';
3
+
4
+ export const apiClient = {
5
+ async login(username: string, password: string) {
6
+ const response = await fetch(`${API_BASE_URL}/api/auth/login`, {
7
+ method: 'POST',
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ credentials: 'include',
12
+ body: JSON.stringify({ username, password }),
13
+ });
14
+
15
+ if (!response.ok) {
16
+ const error = await response.json();
17
+ throw new Error(error.error || 'Login failed');
18
+ }
19
+
20
+ const data = await response.json();
21
+
22
+ // Store JWT token if present
23
+ if (data.token) {
24
+ localStorage.setItem('token', data.token);
25
+ }
26
+
27
+ return data;
28
+ },
29
+
30
+ async logout() {
31
+ const response = await fetch(`${API_BASE_URL}/api/auth/logout`, {
32
+ method: 'POST',
33
+ credentials: 'include',
34
+ });
35
+
36
+ if (!response.ok) {
37
+ throw new Error('Logout failed');
38
+ }
39
+
40
+ // Clear token
41
+ localStorage.removeItem('token');
42
+
43
+ return response.json();
44
+ },
45
+
46
+ async getCurrentUser() {
47
+ try {
48
+ const token = localStorage.getItem('token');
49
+ const headers: Record<string, string> = {};
50
+
51
+ if (token) {
52
+ headers['Authorization'] = `Bearer ${token}`;
53
+ }
54
+
55
+ const response = await fetch(`${API_BASE_URL}/api/auth/me`, {
56
+ headers,
57
+ credentials: 'include',
58
+ });
59
+
60
+ if (!response.ok) {
61
+ return null;
62
+ }
63
+
64
+ return response.json();
65
+ } catch (error) {
66
+ return null;
67
+ }
68
+ },
69
+
70
+ async getHistory() {
71
+ const token = localStorage.getItem('token');
72
+ const headers: Record<string, string> = {
73
+ 'Content-Type': 'application/json',
74
+ };
75
+
76
+ if (token) {
77
+ headers['Authorization'] = `Bearer ${token}`;
78
+ }
79
+
80
+ const response = await fetch(`${API_BASE_URL}/api/history`, {
81
+ headers,
82
+ credentials: 'include',
83
+ });
84
+
85
+ if (!response.ok) {
86
+ const error = await response.json();
87
+ throw new Error(error.error || 'Failed to fetch history');
88
+ }
89
+
90
+ return response.json();
91
+ },
92
+
93
+ async createHistory(data: {
94
+ task_type: string;
95
+ description: string;
96
+ commit_message?: string;
97
+ tests_passed?: boolean;
98
+ documentation_type?: string;
99
+ }) {
100
+ const token = localStorage.getItem('token');
101
+ const headers: Record<string, string> = {
102
+ 'Content-Type': 'application/json',
103
+ };
104
+
105
+ if (token) {
106
+ headers['Authorization'] = `Bearer ${token}`;
107
+ }
108
+
109
+ const response = await fetch(`${API_BASE_URL}/api/history`, {
110
+ method: 'POST',
111
+ headers,
112
+ credentials: 'include',
113
+ body: JSON.stringify(data),
114
+ });
115
+
116
+ if (!response.ok) {
117
+ const error = await response.json();
118
+ throw new Error(error.error || 'Failed to create history entry');
119
+ }
120
+
121
+ return response.json();
122
+ },
123
+ };
package/web/netlify.toml CHANGED
@@ -1,3 +1,8 @@
1
1
  [build]
2
2
  command = "npm run build"
3
3
  publish = "out"
4
+
5
+ [[redirects]]
6
+ from = "/*"
7
+ to = "/index.html"
8
+ status = 200
@@ -2,8 +2,8 @@ import type { NextConfig } from "next";
2
2
 
3
3
  const nextConfig: NextConfig = {
4
4
  // Static export for Netlify deployment
5
- // Static export removed for server-side features
6
- // output: 'export',
5
+ output: 'export',
6
+ trailingSlash: true,
7
7
  // Set turbopack root to silence multi-lockfile warning
8
8
  turbopack: {
9
9
  root: __dirname,