@abstractframework/code 0.1.0 → 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/README.md CHANGED
@@ -5,9 +5,13 @@ This is the **web version of AbstractCode** (the Python CLI), designed as a **ga
5
5
  - renders by replaying/streaming the ledger
6
6
  - resumes waits by submitting durable commands
7
7
 
8
+ Status:
9
+ - This app currently consumes shared UI components via Vite path aliases to a sibling `abstractuic/` repo.
10
+ - This repo includes a prebuilt `web/dist/` for convenience.
11
+
8
12
  Docs:
9
- - `docs/web.md`
10
- - `docs/deployment-web.md`
13
+ - Web overview: [`../docs/web.md`](../docs/web.md)
14
+ - Deployment: [`../docs/deployment-web.md`](../docs/deployment-web.md)
11
15
 
12
16
  ## Local dev
13
17
  ```bash
package/bin/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * CLI entry point for AbstractCode
5
- * Serves the built web application on a configurable port
4
+ * CLI entry point for @abstractframework/code
5
+ * Serves the browser-based coding assistant on a configurable port
6
6
  */
7
7
 
8
8
  import { createServer } from 'http';
@@ -54,6 +54,7 @@ function serveFile(res, filePath) {
54
54
  }
55
55
 
56
56
  const server = createServer((req, res) => {
57
+ // Remove query strings and normalize path
57
58
  const url = new URL(req.url, `http://${req.headers.host}`);
58
59
  let pathname = url.pathname;
59
60
 
@@ -64,16 +65,30 @@ const server = createServer((req, res) => {
64
65
  return;
65
66
  }
66
67
 
68
+ // Try to serve the requested file
67
69
  let filePath = join(DIST_DIR, pathname);
68
70
 
69
- if (serveFile(res, filePath)) return;
70
- if (serveFile(res, filePath + '.html')) return;
71
- if (serveFile(res, join(filePath, 'index.html'))) return;
71
+ if (serveFile(res, filePath)) {
72
+ return;
73
+ }
74
+
75
+ // Try with .html extension
76
+ if (serveFile(res, filePath + '.html')) {
77
+ return;
78
+ }
72
79
 
73
- // SPA fallback
80
+ // Try index.html in directory
81
+ if (serveFile(res, join(filePath, 'index.html'))) {
82
+ return;
83
+ }
84
+
85
+ // SPA fallback: serve index.html for all other routes
74
86
  const indexPath = join(DIST_DIR, 'index.html');
75
- if (serveFile(res, indexPath)) return;
87
+ if (serveFile(res, indexPath)) {
88
+ return;
89
+ }
76
90
 
91
+ // If nothing works, return 404
77
92
  res.writeHead(404);
78
93
  res.end('Not Found');
79
94
  });
@@ -81,25 +96,26 @@ const server = createServer((req, res) => {
81
96
  server.listen(PORT, HOST, () => {
82
97
  console.log(`
83
98
  ╔════════════════════════════════════════════════════╗
84
- ║ AbstractCode IDE ║
99
+ ║ AbstractCode Web UI is running! ║
85
100
  ╚════════════════════════════════════════════════════╝
86
101
 
87
102
  🌐 Local: http://localhost:${PORT}
88
103
  🌐 Network: http://${HOST}:${PORT}
89
104
 
90
- 💻 AI-powered coding assistant
91
- 🚀 Connect to AbstractGateway
105
+ 💻 Browser-based coding assistant
106
+ 🔗 Connect to AbstractGateway in settings
107
+ 🚀 Start coding with durable agent sessions
92
108
 
93
109
  Press Ctrl+C to stop
94
110
  `);
95
111
  });
96
112
 
97
113
  process.on('SIGINT', () => {
98
- console.log('\n\n👋 Shutting down AbstractCode...\n');
114
+ console.log('\n\n👋 Shutting down AbstractCode Web...\n');
99
115
  process.exit(0);
100
116
  });
101
117
 
102
118
  process.on('SIGTERM', () => {
103
- console.log('\n\n👋 Shutting down AbstractCode...\n');
119
+ console.log('\n\n👋 Shutting down AbstractCode Web...\n');
104
120
  process.exit(0);
105
121
  });