agentstudio 0.1.0

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.
Files changed (115) hide show
  1. package/.env +15 -0
  2. package/README.md +85 -0
  3. package/dist/bin/agentstudio.d.ts +3 -0
  4. package/dist/bin/agentstudio.d.ts.map +1 -0
  5. package/dist/bin/agentstudio.js +141 -0
  6. package/dist/bin/agentstudio.js.map +1 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +87 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/middleware/auth.d.ts +7 -0
  12. package/dist/middleware/auth.d.ts.map +1 -0
  13. package/dist/middleware/auth.js +21 -0
  14. package/dist/middleware/auth.js.map +1 -0
  15. package/dist/routes/agents.d.ts +4 -0
  16. package/dist/routes/agents.d.ts.map +1 -0
  17. package/dist/routes/agents.js +804 -0
  18. package/dist/routes/agents.js.map +1 -0
  19. package/dist/routes/auth.d.ts +4 -0
  20. package/dist/routes/auth.d.ts.map +1 -0
  21. package/dist/routes/auth.js +60 -0
  22. package/dist/routes/auth.js.map +1 -0
  23. package/dist/routes/files.d.ts +4 -0
  24. package/dist/routes/files.d.ts.map +1 -0
  25. package/dist/routes/files.js +301 -0
  26. package/dist/routes/files.js.map +1 -0
  27. package/dist/routes/mcp.d.ts +4 -0
  28. package/dist/routes/mcp.d.ts.map +1 -0
  29. package/dist/routes/mcp.js +652 -0
  30. package/dist/routes/mcp.js.map +1 -0
  31. package/dist/routes/media.d.ts +5 -0
  32. package/dist/routes/media.d.ts.map +1 -0
  33. package/dist/routes/media.js +117 -0
  34. package/dist/routes/media.js.map +1 -0
  35. package/dist/routes/slides.d.ts +4 -0
  36. package/dist/routes/slides.d.ts.map +1 -0
  37. package/dist/routes/slides.js +146 -0
  38. package/dist/routes/slides.js.map +1 -0
  39. package/dist/services/claudeSession.d.ts +83 -0
  40. package/dist/services/claudeSession.d.ts.map +1 -0
  41. package/dist/services/claudeSession.js +255 -0
  42. package/dist/services/claudeSession.js.map +1 -0
  43. package/dist/services/messageQueue.d.ts +31 -0
  44. package/dist/services/messageQueue.d.ts.map +1 -0
  45. package/dist/services/messageQueue.js +67 -0
  46. package/dist/services/messageQueue.js.map +1 -0
  47. package/dist/services/sessionManager.d.ts +132 -0
  48. package/dist/services/sessionManager.d.ts.map +1 -0
  49. package/dist/services/sessionManager.js +439 -0
  50. package/dist/services/sessionManager.js.map +1 -0
  51. package/dist/types/claude-history.d.ts +48 -0
  52. package/dist/types/claude-history.d.ts.map +1 -0
  53. package/dist/types/claude-history.js +2 -0
  54. package/dist/types/claude-history.js.map +1 -0
  55. package/dist/types/claude-versions.d.ts +31 -0
  56. package/dist/types/claude-versions.d.ts.map +1 -0
  57. package/dist/types/claude-versions.js +2 -0
  58. package/dist/types/claude-versions.js.map +1 -0
  59. package/dist/types/commands.d.ts +32 -0
  60. package/dist/types/commands.d.ts.map +1 -0
  61. package/dist/types/commands.js +2 -0
  62. package/dist/types/commands.js.map +1 -0
  63. package/dist/types/index.d.ts +81 -0
  64. package/dist/types/index.d.ts.map +1 -0
  65. package/dist/types/index.js +150 -0
  66. package/dist/types/index.js.map +1 -0
  67. package/dist/types/subagents.d.ts +88 -0
  68. package/dist/types/subagents.d.ts.map +1 -0
  69. package/dist/types/subagents.js +2 -0
  70. package/dist/types/subagents.js.map +1 -0
  71. package/dist/utils/agentStorage.d.ts +19 -0
  72. package/dist/utils/agentStorage.d.ts.map +1 -0
  73. package/dist/utils/agentStorage.js +110 -0
  74. package/dist/utils/agentStorage.js.map +1 -0
  75. package/dist/utils/claudeVersionStorage.d.ts +33 -0
  76. package/dist/utils/claudeVersionStorage.d.ts.map +1 -0
  77. package/dist/utils/claudeVersionStorage.js +168 -0
  78. package/dist/utils/claudeVersionStorage.js.map +1 -0
  79. package/dist/utils/jwt.d.ts +15 -0
  80. package/dist/utils/jwt.d.ts.map +1 -0
  81. package/dist/utils/jwt.js +28 -0
  82. package/dist/utils/jwt.js.map +1 -0
  83. package/dist/utils/projectMetadataStorage.d.ts +21 -0
  84. package/dist/utils/projectMetadataStorage.d.ts.map +1 -0
  85. package/dist/utils/projectMetadataStorage.js +68 -0
  86. package/dist/utils/projectMetadataStorage.js.map +1 -0
  87. package/frontend/dist/index.html +86 -0
  88. package/package.json +66 -0
  89. package/src/bin/agentstudio.ts +161 -0
  90. package/src/index.ts +100 -0
  91. package/src/middleware/auth.ts +26 -0
  92. package/src/routes/agents.ts +885 -0
  93. package/src/routes/auth.ts +73 -0
  94. package/src/routes/commands.ts.bak +441 -0
  95. package/src/routes/files.ts +352 -0
  96. package/src/routes/mcp.ts +751 -0
  97. package/src/routes/media.ts +140 -0
  98. package/src/routes/projects.ts.bak +601 -0
  99. package/src/routes/sessions.ts.bak +809 -0
  100. package/src/routes/settings.ts.bak +718 -0
  101. package/src/routes/slides.ts +170 -0
  102. package/src/routes/subagents.ts.bak +364 -0
  103. package/src/services/claudeSession.ts +293 -0
  104. package/src/services/messageQueue.ts +71 -0
  105. package/src/services/sessionManager.ts +532 -0
  106. package/src/types/claude-history.ts +50 -0
  107. package/src/types/claude-versions.ts +33 -0
  108. package/src/types/commands.ts +35 -0
  109. package/src/types/index.ts +248 -0
  110. package/src/types/subagents.ts +106 -0
  111. package/src/utils/agentStorage.ts +126 -0
  112. package/src/utils/claudeVersionStorage.ts +199 -0
  113. package/src/utils/jwt.ts +36 -0
  114. package/src/utils/projectMetadataStorage.ts +86 -0
  115. package/tsconfig.json +26 -0
package/.env ADDED
@@ -0,0 +1,15 @@
1
+ # AgentStudio Configuration
2
+ # AI Provider (choose one)
3
+ OPENAI_API_KEY=your_openai_api_key_here
4
+ ANTHROPIC_API_KEY=your_anthropic_api_key_here
5
+
6
+ # Server Configuration
7
+ PORT=4936
8
+ NODE_ENV=production
9
+
10
+ # File System
11
+ SLIDES_DIR=./slides
12
+
13
+ # CORS Configuration (optional)
14
+ # Add custom origins for production deployments
15
+ CORS_ORIGINS=https://your-frontend.vercel.app,https://custom-domain.com
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # AgentStudio
2
+
3
+ Claude-powered AgentStudio - AI-powered presentation editor with Claude integration
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g agentstudio
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Start the full application
14
+ ```bash
15
+ agentstudio start
16
+ ```
17
+
18
+ ### Start backend only
19
+ ```bash
20
+ agentstudio backend
21
+ ```
22
+
23
+ ### Start frontend development server (requires full source)
24
+ ```bash
25
+ agentstudio frontend
26
+ ```
27
+
28
+ ### Initialize configuration
29
+ ```bash
30
+ agentstudio init
31
+ ```
32
+
33
+ ## Configuration
34
+
35
+ Create a `.env` file in your working directory:
36
+
37
+ ```env
38
+ # AI Provider (choose one)
39
+ OPENAI_API_KEY=your_openai_api_key_here
40
+ ANTHROPIC_API_KEY=your_anthropic_api_key_here
41
+
42
+ # Server Configuration
43
+ PORT=4936
44
+ NODE_ENV=production
45
+
46
+ # File System
47
+ SLIDES_DIR=./slides
48
+
49
+ # CORS Configuration (optional)
50
+ CORS_ORIGINS=https://your-frontend.vercel.app,https://custom-domain.com
51
+ ```
52
+
53
+ ## Features
54
+
55
+ - 🤖 **AI-Powered Agents**: Built-in agents for presentations, code, and documents
56
+ - 🎨 **Real-time Editing**: Live collaboration with AI agents
57
+ - 📊 **Project Management**: Organize and manage multiple projects
58
+ - 🔧 **Custom Tools**: Extensible tool system for agent interactions
59
+ - 🌐 **Web Interface**: Modern React-based user interface
60
+ - 🚀 **Easy Deployment**: Simple CLI for quick setup and deployment
61
+
62
+ ## API Endpoints
63
+
64
+ - `GET /api/health` - Health check
65
+ - `GET /api/agents` - List available agents
66
+ - `POST /api/agents/:id/chat` - Chat with an agent
67
+ - `GET /api/projects` - List projects
68
+ - `POST /api/projects` - Create a project
69
+ - `GET /api/sessions` - List chat sessions
70
+ - `POST /api/sessions` - Create a new session
71
+
72
+ ## Development
73
+
74
+ For full development environment with hot reloading, clone the full repository:
75
+
76
+ ```bash
77
+ git clone https://github.com/jeffkit/agentstudio.git
78
+ cd agentstudio
79
+ npm install
80
+ npm run dev
81
+ ```
82
+
83
+ ## License
84
+
85
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=agentstudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentstudio.d.ts","sourceRoot":"","sources":["../../src/bin/agentstudio.ts"],"names":[],"mappings":""}
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env node
2
+ import { program } from 'commander';
3
+ import { startServer } from '../index.js';
4
+ import { spawn } from 'child_process';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ program
10
+ .name('agentstudio')
11
+ .description('AgentStudio - AI-powered presentation editor with Claude integration')
12
+ .version('0.1.0');
13
+ // Start both frontend and backend
14
+ program
15
+ .command('start')
16
+ .description('Start both frontend and backend servers')
17
+ .option('-p, --port <port>', 'backend server port', '4936')
18
+ .option('-f, --frontend-port <port>', 'frontend server port', '3000')
19
+ .option('-h, --host <host>', 'server host', 'localhost')
20
+ .option('-c, --config <path>', 'path to config file')
21
+ .option('--env <path>', 'path to .env file')
22
+ .option('--no-auth', 'disable authentication (development only)')
23
+ .action(async (options) => {
24
+ console.log('🚀 Starting AgentStudio...');
25
+ // Start backend
26
+ process.env.PORT = options.port;
27
+ process.env.HOST = options.host;
28
+ if (options.env) {
29
+ process.env.ENV_PATH = options.env;
30
+ }
31
+ if (options.config) {
32
+ process.env.CONFIG_PATH = options.config;
33
+ }
34
+ if (options.noAuth) {
35
+ process.env.NO_AUTH = 'true';
36
+ }
37
+ try {
38
+ await startServer();
39
+ console.log(`✅ Backend running on http://${options.host}:${options.port}`);
40
+ console.log(`✅ Frontend running on http://${options.host}:${options.frontendPort}`);
41
+ console.log('📖 Open your browser to http://localhost:3000 to start using AgentStudio');
42
+ }
43
+ catch (error) {
44
+ console.error('❌ Failed to start AgentStudio:', error);
45
+ process.exit(1);
46
+ }
47
+ });
48
+ // Start backend only
49
+ program
50
+ .command('backend')
51
+ .description('Start backend server only')
52
+ .option('-p, --port <port>', 'server port', '4936')
53
+ .option('-h, --host <host>', 'server host', 'localhost')
54
+ .option('-c, --config <path>', 'path to config file')
55
+ .option('--env <path>', 'path to .env file')
56
+ .option('--no-auth', 'disable authentication (development only)')
57
+ .action(async (options) => {
58
+ console.log('🚀 Starting AgentStudio Backend...');
59
+ process.env.PORT = options.port;
60
+ process.env.HOST = options.host;
61
+ if (options.env) {
62
+ process.env.ENV_PATH = options.env;
63
+ }
64
+ if (options.config) {
65
+ process.env.CONFIG_PATH = options.config;
66
+ }
67
+ if (options.noAuth) {
68
+ process.env.NO_AUTH = 'true';
69
+ }
70
+ try {
71
+ await startServer();
72
+ console.log(`✅ Backend running on http://${options.host}:${options.port}`);
73
+ }
74
+ catch (error) {
75
+ console.error('❌ Failed to start backend:', error);
76
+ process.exit(1);
77
+ }
78
+ });
79
+ // Start frontend only (development mode)
80
+ program
81
+ .command('frontend')
82
+ .description('Start frontend development server only')
83
+ .option('-p, --port <port>', 'frontend server port', '3000')
84
+ .option('-h, --host <host>', 'server host', 'localhost')
85
+ .action((options) => {
86
+ console.log('🚀 Starting AgentStudio Frontend...');
87
+ const frontendDir = path.join(__dirname, '../../frontend');
88
+ const frontendProcess = spawn('npm', ['run', 'dev'], {
89
+ cwd: frontendDir,
90
+ stdio: 'inherit',
91
+ shell: true,
92
+ env: {
93
+ ...process.env,
94
+ PORT: options.port,
95
+ HOST: options.host
96
+ }
97
+ });
98
+ frontendProcess.on('error', (error) => {
99
+ console.error('❌ Failed to start frontend:', error);
100
+ process.exit(1);
101
+ });
102
+ });
103
+ // Initialize configuration
104
+ program
105
+ .command('init')
106
+ .description('Initialize AgentStudio configuration')
107
+ .option('--env <path>', 'path to create .env file', '.env')
108
+ .action(async (options) => {
109
+ console.log('🔧 Initializing AgentStudio configuration...');
110
+ const fs = await import('fs-extra');
111
+ const path = await import('path');
112
+ const envPath = path.default.resolve(options.env);
113
+ const envContent = `# AgentStudio Configuration
114
+ # AI Provider (choose one)
115
+ OPENAI_API_KEY=your_openai_api_key_here
116
+ ANTHROPIC_API_KEY=your_anthropic_api_key_here
117
+
118
+ # Server Configuration
119
+ PORT=4936
120
+ NODE_ENV=production
121
+
122
+ # File System
123
+ SLIDES_DIR=./slides
124
+
125
+ # CORS Configuration (optional)
126
+ # Add custom origins for production deployments
127
+ CORS_ORIGINS=https://your-frontend.vercel.app,https://custom-domain.com
128
+ `;
129
+ try {
130
+ await fs.default.ensureFile(envPath);
131
+ await fs.default.writeFile(envPath, envContent);
132
+ console.log(`✅ Configuration file created: ${envPath}`);
133
+ console.log('📝 Please edit the .env file with your API keys and settings');
134
+ }
135
+ catch (error) {
136
+ console.error('❌ Failed to create configuration file:', error);
137
+ process.exit(1);
138
+ }
139
+ });
140
+ program.parse();
141
+ //# sourceMappingURL=agentstudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentstudio.js","sourceRoot":"","sources":["../../src/bin/agentstudio.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,sEAAsE,CAAC;KACnF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,kCAA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AAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,cAAc,EAAE,0BAA0B,EAAE,MAAM,CAAC;KAC1D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAE5D,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;CAetB,CAAC;IAEE,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function startServer(): Promise<void>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoFA,wBAAgB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3C"}
package/dist/index.js ADDED
@@ -0,0 +1,87 @@
1
+ import express from 'express';
2
+ import cors from 'cors';
3
+ import helmet from 'helmet';
4
+ import dotenv from 'dotenv';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ // Import routes
8
+ import agentsRouter from './routes/agents.js';
9
+ import authRouter from './routes/auth.js';
10
+ import filesRouter from './routes/files.js';
11
+ import mcpRouter from './routes/mcp.js';
12
+ import mediaRouter from './routes/media.js';
13
+ import slidesRouter from './routes/slides.js';
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = path.dirname(__filename);
16
+ // Load environment variables
17
+ const envPath = process.env.ENV_PATH || '.env';
18
+ dotenv.config({ path: envPath });
19
+ const app = express();
20
+ const PORT = process.env.PORT || 4936;
21
+ const HOST = process.env.HOST || 'localhost';
22
+ // Security middleware
23
+ app.use(helmet({
24
+ crossOriginEmbedderPolicy: false,
25
+ contentSecurityPolicy: {
26
+ directives: {
27
+ defaultSrc: ["'self'"],
28
+ scriptSrc: ["'self'", "'unsafe-inline'"],
29
+ styleSrc: ["'self'", "'unsafe-inline'"],
30
+ imgSrc: ["'self'", "data:", "blob:"],
31
+ connectSrc: ["'self'", "ws:", "wss:"],
32
+ },
33
+ },
34
+ }));
35
+ // CORS configuration
36
+ const corsOrigins = process.env.CORS_ORIGINS ?
37
+ process.env.CORS_ORIGINS.split(',').map(origin => origin.trim()) :
38
+ [
39
+ 'http://localhost:3000',
40
+ 'http://127.0.0.1:3000',
41
+ 'https://*.vercel.app'
42
+ ];
43
+ app.use(cors({
44
+ origin: corsOrigins,
45
+ credentials: true
46
+ }));
47
+ // Body parsing middleware
48
+ app.use(express.json({ limit: '50mb' }));
49
+ app.use(express.urlencoded({ extended: true, limit: '50mb' }));
50
+ // Serve static files
51
+ const frontendDistPath = path.join(__dirname, '../frontend/dist');
52
+ app.use(express.static(frontendDistPath));
53
+ // API routes
54
+ app.use('/api/agents', agentsRouter);
55
+ app.use('/api/auth', authRouter);
56
+ app.use('/api/files', filesRouter);
57
+ app.use('/api/mcp', mcpRouter);
58
+ app.use('/api/media', mediaRouter);
59
+ app.use('/api/slides', slidesRouter);
60
+ // Health check endpoint
61
+ app.get('/api/health', (req, res) => {
62
+ res.json({
63
+ status: 'ok',
64
+ timestamp: new Date().toISOString(),
65
+ version: '0.1.0'
66
+ });
67
+ });
68
+ // Serve frontend for all other routes (SPA routing)
69
+ app.get('*', (req, res) => {
70
+ res.sendFile(path.join(frontendDistPath, 'index.html'));
71
+ });
72
+ export function startServer() {
73
+ return new Promise((resolve) => {
74
+ const port = parseInt(process.env.PORT || PORT.toString());
75
+ const host = process.env.HOST || HOST;
76
+ const server = app.listen(port, host, () => {
77
+ console.log(`🚀 AgentStudio running on http://${host}:${port}`);
78
+ console.log('📖 Open your browser to start using AgentStudio');
79
+ resolve();
80
+ });
81
+ });
82
+ }
83
+ // Only start server if this file is run directly
84
+ if (import.meta.url === `file://${process.argv[1]}`) {
85
+ startServer().catch(console.error);
86
+ }
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,gBAAgB;AAChB,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG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C,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;QACtC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;YACzC,OAAO,CAAC,GAAG,CAAC,oCAAoC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;YAC/D,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iDAAiD;AACjD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,WAAW,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Request, Response, NextFunction } from 'express';
2
+ /**
3
+ * Middleware to authenticate requests using JWT token
4
+ * Expects token in Authorization header as "Bearer <token>"
5
+ */
6
+ export declare function authMiddleware(req: Request, res: Response, next: NextFunction): void;
7
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG1D;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAkBpF"}
@@ -0,0 +1,21 @@
1
+ import { verifyToken } from '../utils/jwt.js';
2
+ /**
3
+ * Middleware to authenticate requests using JWT token
4
+ * Expects token in Authorization header as "Bearer <token>"
5
+ */
6
+ export function authMiddleware(req, res, next) {
7
+ const authHeader = req.headers.authorization;
8
+ if (!authHeader || !authHeader.startsWith('Bearer ')) {
9
+ res.status(401).json({ error: 'Unauthorized: No token provided' });
10
+ return;
11
+ }
12
+ const token = authHeader.substring(7); // Remove "Bearer " prefix
13
+ const payload = verifyToken(token);
14
+ if (!payload) {
15
+ res.status(401).json({ error: 'Unauthorized: Invalid or expired token' });
16
+ return;
17
+ }
18
+ // Token is valid, proceed to next middleware
19
+ next();
20
+ }
21
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;IAC5E,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;IAE7C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAC,CAAC;QACnE,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B;IACjE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,wCAAwC,EAAE,CAAC,CAAC;QAC1E,OAAO;IACT,CAAC;IAED,6CAA6C;IAC7C,IAAI,EAAE,CAAC;AACT,CAAC"}
@@ -0,0 +1,4 @@
1
+ import express from 'express';
2
+ declare const router: express.Router;
3
+ export default router;
4
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAe9B,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAyB,CAAC;AAq2BhD,eAAe,MAAM,CAAC"}