@agent-spaces/server 0.1.1 → 0.1.2

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/dist/app.js CHANGED
@@ -26,7 +26,6 @@ import { recoverRunningWorkOnStartup } from './services/issue-retry.js';
26
26
  import { startPersistedNotificationServices } from './services/notification-hub/index.js';
27
27
  const __dirname = dirname(fileURLToPath(import.meta.url));
28
28
  const PORT = parseInt(process.env.PORT || '3100', 10);
29
- const IS_PROD = process.env.NODE_ENV === 'production';
30
29
  const resolveRuntimeDir = (name) => {
31
30
  const currentDir = join(__dirname, name);
32
31
  if (existsSync(currentDir))
@@ -77,31 +76,29 @@ app.use('/api/agents', agentRouter);
77
76
  app.use('/api', llmRouter);
78
77
  app.use('/api/folder', folderRouter);
79
78
  // Serve static web frontend in production (after API routes, before catch-all)
80
- if (IS_PROD) {
81
- const webDir = resolveRuntimeDir('web');
82
- if (existsSync(webDir)) {
83
- // /static/* -> public/* (avatar URLs etc.)
84
- app.use('/static', express.static(publicDir));
85
- // web static assets (_next, monaco, etc.)
86
- app.use(express.static(webDir));
87
- // SPA fallback: serve correct HTML for each route
88
- const indexHtml = join(webDir, 'index.html');
89
- const workspaceHtml = join(webDir, 'workspace', '_.html');
90
- // /workspace/* -> workspace SPA page
91
- if (existsSync(workspaceHtml)) {
92
- app.get('/workspace/:id', (_req, res) => {
93
- res.sendFile(workspaceHtml);
94
- });
95
- }
96
- // Everything else -> root index.html
97
- app.use((_req, res) => {
98
- res.sendFile(indexHtml);
79
+ const webDir = resolveRuntimeDir('web');
80
+ if (existsSync(webDir)) {
81
+ // /static/* -> public/* (avatar URLs etc.)
82
+ app.use('/static', express.static(publicDir));
83
+ // web static assets (_next, monaco, etc.)
84
+ app.use(express.static(webDir));
85
+ // SPA fallback: serve correct HTML for each route
86
+ const indexHtml = join(webDir, 'index.html');
87
+ const workspaceHtml = join(webDir, 'workspace', '_.html');
88
+ // /workspace/* -> workspace SPA page
89
+ if (existsSync(workspaceHtml)) {
90
+ app.get('/workspace/:id', (_req, res) => {
91
+ res.sendFile(workspaceHtml);
99
92
  });
100
- console.log(`[server] serving web frontend from ${webDir}`);
101
- }
102
- else {
103
- console.warn('[server] web frontend not found at', webDir, '- run \`pnpm build\` first');
104
93
  }
94
+ // Everything else -> root index.html
95
+ app.use((_req, res) => {
96
+ res.sendFile(indexHtml);
97
+ });
98
+ console.log(`[server] serving web frontend from ${webDir}`);
99
+ }
100
+ else {
101
+ console.warn('[server] web frontend not found at', webDir, '- run \`pnpm build\` first');
105
102
  }
106
103
  const server = createServer(app);
107
104
  const wss = new WebSocketServer({ server, path: '/ws' });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-spaces/server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "app.js",
6
6
  "packageManager": "pnpm@10.17.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-spaces/server",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "agent-spaces-server": "./dist/app.js"