@kelceyp/caw-server 0.0.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.
@@ -0,0 +1,153 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>CAW Server - Test Client</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
16
+ background-color: #f5f5f5;
17
+ color: #333;
18
+ line-height: 1.6;
19
+ }
20
+
21
+ .container {
22
+ max-width: 600px;
23
+ margin: 80px auto;
24
+ padding: 40px;
25
+ background-color: white;
26
+ border-radius: 8px;
27
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
28
+ }
29
+
30
+ h1 {
31
+ font-size: 28px;
32
+ margin-bottom: 12px;
33
+ color: #2c3e50;
34
+ }
35
+
36
+ .subtitle {
37
+ font-size: 14px;
38
+ color: #7f8c8d;
39
+ margin-bottom: 32px;
40
+ }
41
+
42
+ button {
43
+ background-color: #3498db;
44
+ color: white;
45
+ border: none;
46
+ padding: 12px 24px;
47
+ font-size: 16px;
48
+ border-radius: 4px;
49
+ cursor: pointer;
50
+ transition: background-color 0.2s;
51
+ }
52
+
53
+ button:hover {
54
+ background-color: #2980b9;
55
+ }
56
+
57
+ button:disabled {
58
+ background-color: #95a5a6;
59
+ cursor: not-allowed;
60
+ }
61
+
62
+ .response {
63
+ margin-top: 24px;
64
+ padding: 16px;
65
+ border-radius: 4px;
66
+ font-size: 14px;
67
+ display: none;
68
+ }
69
+
70
+ .response.success {
71
+ background-color: #d4edda;
72
+ border: 1px solid #c3e6cb;
73
+ color: #155724;
74
+ display: block;
75
+ }
76
+
77
+ .response.error {
78
+ background-color: #f8d7da;
79
+ border: 1px solid #f5c6cb;
80
+ color: #721c24;
81
+ display: block;
82
+ }
83
+
84
+ .response-label {
85
+ font-weight: 600;
86
+ margin-bottom: 8px;
87
+ }
88
+
89
+ .response-content {
90
+ font-family: 'Courier New', monospace;
91
+ white-space: pre-wrap;
92
+ word-break: break-all;
93
+ }
94
+ </style>
95
+ </head>
96
+ <body>
97
+ <div class="container">
98
+ <h1>CAW Server</h1>
99
+ <p class="subtitle">Test Client - Milestone 1</p>
100
+
101
+ <button id="testButton">Test API</button>
102
+
103
+ <div id="response" class="response">
104
+ <div class="response-label">Response:</div>
105
+ <div id="responseContent" class="response-content"></div>
106
+ </div>
107
+ </div>
108
+
109
+ <script>
110
+ const API_URL = 'http://localhost:3000/api/hello';
111
+ const BEARER_TOKEN = 'test-token-123';
112
+
113
+ const testButton = document.getElementById('testButton');
114
+ const responseDiv = document.getElementById('response');
115
+ const responseContent = document.getElementById('responseContent');
116
+
117
+ testButton.addEventListener('click', async () => {
118
+ testButton.disabled = true;
119
+ testButton.textContent = 'Testing...';
120
+
121
+ responseDiv.classList.remove('success', 'error');
122
+ responseDiv.style.display = 'none';
123
+
124
+ try {
125
+ const response = await fetch(API_URL, {
126
+ method: 'GET',
127
+ headers: {
128
+ 'Authorization': `Bearer ${BEARER_TOKEN}`
129
+ }
130
+ });
131
+
132
+ const data = await response.json();
133
+
134
+ if (response.ok) {
135
+ responseDiv.classList.add('success');
136
+ responseContent.textContent = JSON.stringify(data, null, 2);
137
+ } else {
138
+ responseDiv.classList.add('error');
139
+ responseContent.textContent = `Error ${response.status}: ${JSON.stringify(data, null, 2)}`;
140
+ }
141
+ responseDiv.style.display = 'block';
142
+ } catch (error) {
143
+ responseDiv.classList.add('error');
144
+ responseContent.textContent = `Network error: ${error.message}`;
145
+ responseDiv.style.display = 'block';
146
+ } finally {
147
+ testButton.disabled = false;
148
+ testButton.textContent = 'Test API';
149
+ }
150
+ });
151
+ </script>
152
+ </body>
153
+ </html>
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@kelceyp/caw-server",
3
+ "version": "0.0.1",
4
+ "description": "CAW server - REST API, MCP server, WebSocket bridge, and core features",
5
+ "type": "module",
6
+ "main": "dist/main.js",
7
+ "bin": {
8
+ "caw-server": "dist/main.js"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "README.md",
13
+ "package.json"
14
+ ],
15
+ "scripts": {
16
+ "build": "bun build src/main.js --outdir dist --target node --format esm --sourcemap=external",
17
+ "build:all": "cd ../client && bun run build && cd ../server && bun run build",
18
+ "dev": "STATIC_PATH=../client/src bun run src/main.js",
19
+ "start": "node dist/main.js"
20
+ },
21
+ "keywords": [
22
+ "caw",
23
+ "mcp",
24
+ "workflow",
25
+ "agent"
26
+ ],
27
+ "author": "",
28
+ "license": "ISC",
29
+ "dependencies": {
30
+ "@modelcontextprotocol/sdk": "^1.22.0",
31
+ "cors": "^2.8.5",
32
+ "express": "^4.18.2",
33
+ "zod": "3",
34
+ "zod-to-json-schema": "^3.25.0"
35
+ }
36
+ }