mastra 0.1.57-unstable.56 → 0.1.57-unstable.88
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/commands/create/create.d.ts +8 -0
- package/dist/commands/create/create.d.ts.map +1 -0
- package/dist/commands/create/create.js +35 -0
- package/dist/commands/create/utils.d.ts +4 -0
- package/dist/commands/create/utils.d.ts.map +1 -0
- package/dist/commands/create/utils.js +58 -0
- package/dist/commands/deploy/cloudflare/index.d.ts.map +1 -1
- package/dist/commands/deploy/cloudflare/index.js +2 -0
- package/dist/commands/deploy/deployer.d.ts +4 -2
- package/dist/commands/deploy/deployer.d.ts.map +1 -1
- package/dist/commands/deploy/deployer.js +4 -4
- package/dist/commands/deploy/index.d.ts +2 -1
- package/dist/commands/deploy/index.d.ts.map +1 -1
- package/dist/commands/deploy/index.js +2 -2
- package/dist/commands/deploy/netlify/index.d.ts.map +1 -1
- package/dist/commands/deploy/netlify/index.js +2 -0
- package/dist/commands/deploy/vercel/index.d.ts +2 -1
- package/dist/commands/deploy/vercel/index.d.ts.map +1 -1
- package/dist/commands/deploy/vercel/index.js +4 -1
- package/dist/commands/dev.d.ts +1 -7
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +117 -12
- package/dist/commands/engine/down.d.ts +1 -1
- package/dist/commands/engine/down.d.ts.map +1 -1
- package/dist/commands/engine/down.js +3 -2
- package/dist/commands/engine/up.d.ts +1 -1
- package/dist/commands/engine/up.d.ts.map +1 -1
- package/dist/commands/engine/up.js +3 -2
- package/dist/commands/init/init.d.ts +2 -2
- package/dist/commands/init/init.d.ts.map +1 -1
- package/dist/commands/init/init.js +33 -9
- package/dist/commands/init/utils.d.ts +21 -9
- package/dist/commands/init/utils.d.ts.map +1 -1
- package/dist/commands/init/utils.js +64 -74
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -57
- package/dist/services/service.deps.d.ts +1 -0
- package/dist/services/service.deps.d.ts.map +1 -1
- package/dist/services/service.deps.js +8 -0
- package/dist/services/service.docker.d.ts +1 -0
- package/dist/services/service.docker.d.ts.map +1 -1
- package/dist/services/service.docker.js +20 -0
- package/dist/src/starter-files/config.ts +28 -0
- package/dist/src/starter-files/mastra-pg.docker-compose.yaml +15 -0
- package/dist/src/starter-files/tools.ts +95 -0
- package/dist/src/starter-files/workflow.ts +173 -0
- package/dist/templates/express-server.d.ts.map +1 -1
- package/dist/templates/express-server.js +70 -43
- package/dist/templates/netlify.d.ts.map +1 -1
- package/dist/templates/netlify.js +199 -34
- package/dist/templates/worker.d.ts.map +1 -1
- package/dist/templates/worker.js +255 -35
- package/dist/utils/bundle.d.ts +4 -1
- package/dist/utils/bundle.d.ts.map +1 -1
- package/dist/utils/bundle.js +28 -13
- package/package.json +7 -3
- package/src/playground/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/src/playground/dist/assets/erb-BgreK6rt.js +1 -0
- package/src/playground/dist/assets/{gdresource-D_y5yz_M.js → gdresource-NFcQ0Q3Z.js} +1 -1
- package/src/playground/dist/assets/gdscript-BVlVXSjx.js +1 -0
- package/src/playground/dist/assets/{hcl-Cztwc-HH.js → hcl-_Zu0RE-q.js} +1 -1
- package/src/playground/dist/assets/index-BiEU7Tmg.js +389 -0
- package/src/playground/dist/assets/index-Cke4BidO.js +13 -0
- package/src/playground/dist/assets/light-plus-B7mTdjB0.js +1 -0
- package/src/playground/dist/assets/{monokai-CQWsIgnU.js → monokai-D4h5O-jR.js} +1 -1
- package/src/playground/dist/assets/prisma-CZzQMiei.js +1 -0
- package/src/playground/dist/assets/red-bN70gL4F.js +1 -0
- package/src/playground/dist/assets/rst-BCmapc_q.js +1 -0
- package/src/playground/dist/assets/ruby-DsC6krmi.js +1 -0
- package/src/playground/dist/assets/{solarized-dark-CmY0Y6Yh.js → solarized-dark-DXbdFlpD.js} +1 -1
- package/src/playground/dist/assets/{solarized-light-DZQMDcrx.js → solarized-light-L9t79GZl.js} +1 -1
- package/src/playground/dist/assets/style-7CS44jOg.css +1 -0
- package/src/playground/dist/assets/twig-CvAdjvFj.js +1 -0
- package/src/playground/dist/assets/{vue-html-x3hEOujm.js → vue-html-59TQSa_j.js} +1 -1
- package/src/playground/dist/assets/vue-srE0XGv_.js +1 -0
- package/src/playground/dist/index.html +2 -2
- package/src/starter-files/tools.ts +88 -14
- package/src/starter-files/workflow.ts +160 -21
- package/src/playground/dist/assets/dark-plus-B74Y8nHz.js +0 -1
- package/src/playground/dist/assets/erb-DuefeV9w.js +0 -1
- package/src/playground/dist/assets/gdscript-BIguuW30.js +0 -1
- package/src/playground/dist/assets/index-CzqDlQul.js +0 -13
- package/src/playground/dist/assets/index-qFy09kRJ.js +0 -360
- package/src/playground/dist/assets/light-plus-w1el_4yc.js +0 -1
- package/src/playground/dist/assets/prisma-DFIOpqzz.js +0 -1
- package/src/playground/dist/assets/red-2pWuV6-S.js +0 -1
- package/src/playground/dist/assets/rst-BtGMdPX_.js +0 -1
- package/src/playground/dist/assets/ruby-C8Yez0Ov.js +0 -1
- package/src/playground/dist/assets/style-x_8NJ6Q9.css +0 -1
- package/src/playground/dist/assets/twig-DN6YEzOP.js +0 -1
- package/src/playground/dist/assets/vue-xldAUJov.js +0 -1
- package/src/starter-files/api.ts +0 -11
- package/src/starter-files/framework-utils.ts +0 -33
package/dist/templates/worker.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { AutoRouter } from 'itty-router';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { stringify } from 'superjson';
|
|
4
|
+
import { pathToFileURL } from 'url';
|
|
4
5
|
import zodToJsonSchema from 'zod-to-json-schema';
|
|
5
6
|
const { mastra } = await import(join(process.cwd(), 'mastra.mjs'));
|
|
7
|
+
const mastraToolsPaths = process.env.MASTRA_TOOLS_PATH;
|
|
8
|
+
const toolImports = mastraToolsPaths
|
|
9
|
+
? await Promise.all(mastraToolsPaths.split(',').map(async (toolPath) => {
|
|
10
|
+
return import(pathToFileURL(toolPath).href);
|
|
11
|
+
}))
|
|
12
|
+
: [];
|
|
13
|
+
const tools = toolImports.reduce((acc, toolModule) => {
|
|
14
|
+
Object.entries(toolModule).forEach(([key, tool]) => {
|
|
15
|
+
acc[key] = tool;
|
|
16
|
+
});
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
6
19
|
const router = AutoRouter();
|
|
7
20
|
const validateBody = async (body) => {
|
|
8
21
|
const errorResponse = Object.entries(body).reduce((acc, [key, value]) => {
|
|
@@ -24,7 +37,24 @@ router.get('/', () => {
|
|
|
24
37
|
router.get('/api/agents', async () => {
|
|
25
38
|
try {
|
|
26
39
|
const agents = mastra.getAgents();
|
|
27
|
-
|
|
40
|
+
const serializedAgents = Object.entries(agents).reduce((acc, [_id, _agent]) => {
|
|
41
|
+
const agent = _agent;
|
|
42
|
+
const serializedAgentTools = Object.entries(agent?.tools || {}).reduce((acc, [key, tool]) => {
|
|
43
|
+
const _tool = tool;
|
|
44
|
+
acc[key] = {
|
|
45
|
+
..._tool,
|
|
46
|
+
inputSchema: _tool.inputSchema ? stringify(zodToJsonSchema(_tool.inputSchema)) : undefined,
|
|
47
|
+
outputSchema: _tool.outputSchema ? stringify(zodToJsonSchema(_tool.outputSchema)) : undefined,
|
|
48
|
+
};
|
|
49
|
+
return acc;
|
|
50
|
+
}, {});
|
|
51
|
+
acc[_id] = {
|
|
52
|
+
...agent,
|
|
53
|
+
tools: serializedAgentTools,
|
|
54
|
+
};
|
|
55
|
+
return acc;
|
|
56
|
+
}, {});
|
|
57
|
+
return new Response(JSON.stringify(serializedAgents), {
|
|
28
58
|
headers: {
|
|
29
59
|
'Content-Type': 'application/json',
|
|
30
60
|
},
|
|
@@ -45,8 +75,18 @@ router.get('/api/agents/:agentId', ({ params }) => {
|
|
|
45
75
|
try {
|
|
46
76
|
const agentId = decodeURIComponent(params.agentId);
|
|
47
77
|
const agent = mastra.getAgent(agentId);
|
|
78
|
+
const serializedAgentTools = Object.entries(agent?.tools || {}).reduce((acc, [key, tool]) => {
|
|
79
|
+
const _tool = tool;
|
|
80
|
+
acc[key] = {
|
|
81
|
+
..._tool,
|
|
82
|
+
inputSchema: _tool.inputSchema ? stringify(zodToJsonSchema(_tool.inputSchema)) : undefined,
|
|
83
|
+
outputSchema: _tool.outputSchema ? stringify(zodToJsonSchema(_tool.outputSchema)) : undefined,
|
|
84
|
+
};
|
|
85
|
+
return acc;
|
|
86
|
+
}, {});
|
|
48
87
|
return new Response(JSON.stringify({
|
|
49
88
|
...agent,
|
|
89
|
+
tools: serializedAgentTools,
|
|
50
90
|
}), {
|
|
51
91
|
headers: {
|
|
52
92
|
'Content-Type': 'application/json',
|
|
@@ -64,12 +104,11 @@ router.get('/api/agents/:agentId', ({ params }) => {
|
|
|
64
104
|
});
|
|
65
105
|
}
|
|
66
106
|
});
|
|
67
|
-
router.post('/api/agents/:agentId/
|
|
107
|
+
router.post('/api/agents/:agentId/generate', async ({ params, json }) => {
|
|
68
108
|
try {
|
|
69
109
|
const agentId = decodeURIComponent(params.agentId);
|
|
70
110
|
const agent = mastra.getAgent(agentId);
|
|
71
|
-
const
|
|
72
|
-
const messages = body.messages;
|
|
111
|
+
const { messages, threadId, resourceid } = await json();
|
|
73
112
|
const { ok, errorResponse } = await validateBody({ messages });
|
|
74
113
|
if (!ok) {
|
|
75
114
|
return new Response(JSON.stringify({ error: errorResponse }), {
|
|
@@ -87,7 +126,7 @@ router.post('/api/agents/:agentId/text', async ({ params, json }) => {
|
|
|
87
126
|
},
|
|
88
127
|
});
|
|
89
128
|
}
|
|
90
|
-
const result = await agent.generate(messages);
|
|
129
|
+
const result = await agent.generate(messages, { threadId, resourceid });
|
|
91
130
|
return new Response(JSON.stringify(result), {
|
|
92
131
|
headers: {
|
|
93
132
|
'Content-Type': 'application/json',
|
|
@@ -109,8 +148,7 @@ router.post('/api/agents/:agentId/stream', async ({ params, json }) => {
|
|
|
109
148
|
try {
|
|
110
149
|
const agentId = decodeURIComponent(params.agentId);
|
|
111
150
|
const agent = mastra.getAgent(agentId);
|
|
112
|
-
const
|
|
113
|
-
const messages = body.messages;
|
|
151
|
+
const { messages, threadId, resourceid } = await json();
|
|
114
152
|
const { ok, errorResponse } = await validateBody({ messages });
|
|
115
153
|
if (!ok) {
|
|
116
154
|
return new Response(JSON.stringify({ error: errorResponse }), {
|
|
@@ -128,7 +166,7 @@ router.post('/api/agents/:agentId/stream', async ({ params, json }) => {
|
|
|
128
166
|
},
|
|
129
167
|
});
|
|
130
168
|
}
|
|
131
|
-
const streamResult = await agent.
|
|
169
|
+
const streamResult = await agent.stream(messages, { threadId, resourceid });
|
|
132
170
|
return streamResult.toDataStreamResponse({
|
|
133
171
|
headers: {
|
|
134
172
|
'Content-Type': 'text/x-unknown',
|
|
@@ -152,9 +190,7 @@ router.post('/api/agents/:agentId/text-object', async ({ params, json }) => {
|
|
|
152
190
|
try {
|
|
153
191
|
const agentId = decodeURIComponent(params.agentId);
|
|
154
192
|
const agent = mastra.getAgent(agentId);
|
|
155
|
-
const
|
|
156
|
-
const messages = body.messages;
|
|
157
|
-
const schema = body.schema;
|
|
193
|
+
const { messages, schema, threadId, resourceid } = await json();
|
|
158
194
|
const { ok, errorResponse } = await validateBody({
|
|
159
195
|
messages,
|
|
160
196
|
schema,
|
|
@@ -175,7 +211,7 @@ router.post('/api/agents/:agentId/text-object', async ({ params, json }) => {
|
|
|
175
211
|
},
|
|
176
212
|
});
|
|
177
213
|
}
|
|
178
|
-
const result = await agent.generate(messages, { schema });
|
|
214
|
+
const result = await agent.generate(messages, { output: schema, threadId, resourceid });
|
|
179
215
|
return new Response(JSON.stringify(result), {
|
|
180
216
|
headers: {
|
|
181
217
|
'Content-Type': 'application/json',
|
|
@@ -197,9 +233,7 @@ router.post('/api/agents/:agentId/stream-object', async ({ params, json }) => {
|
|
|
197
233
|
try {
|
|
198
234
|
const agentId = decodeURIComponent(params.agentId);
|
|
199
235
|
const agent = mastra.getAgent(agentId);
|
|
200
|
-
const
|
|
201
|
-
const messages = body.messages;
|
|
202
|
-
const schema = body.schema;
|
|
236
|
+
const { messages, schema, threadId, resourceid } = await json();
|
|
203
237
|
const { ok, errorResponse } = await validateBody({
|
|
204
238
|
messages,
|
|
205
239
|
schema,
|
|
@@ -220,7 +254,7 @@ router.post('/api/agents/:agentId/stream-object', async ({ params, json }) => {
|
|
|
220
254
|
},
|
|
221
255
|
});
|
|
222
256
|
}
|
|
223
|
-
const streamResult = await agent.
|
|
257
|
+
const streamResult = await agent.stream(messages, { output: schema, threadId, resourceid });
|
|
224
258
|
return streamResult.toTextStreamResponse({
|
|
225
259
|
headers: {
|
|
226
260
|
'Content-Type': 'text/x-unknown',
|
|
@@ -240,9 +274,40 @@ router.post('/api/agents/:agentId/stream-object', async ({ params, json }) => {
|
|
|
240
274
|
});
|
|
241
275
|
}
|
|
242
276
|
});
|
|
277
|
+
router.post('/api/agents/:agentId/tools/:toolId/execute', async ({ params, json }) => {
|
|
278
|
+
try {
|
|
279
|
+
const agentId = decodeURIComponent(params.agentId);
|
|
280
|
+
const toolId = decodeURIComponent(params.toolId);
|
|
281
|
+
const agent = mastra.getAgent(agentId);
|
|
282
|
+
const tool = Object.values(agent?.tools || {}).find((tool) => tool.id === toolId);
|
|
283
|
+
const body = await json();
|
|
284
|
+
const result = await tool.execute({
|
|
285
|
+
context: {
|
|
286
|
+
...body,
|
|
287
|
+
},
|
|
288
|
+
mastra,
|
|
289
|
+
runId: agentId,
|
|
290
|
+
});
|
|
291
|
+
return new Response(JSON.stringify(result), {
|
|
292
|
+
headers: {
|
|
293
|
+
'Content-Type': 'application/json',
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
const apiError = error;
|
|
299
|
+
console.error('Error executing tool', apiError);
|
|
300
|
+
return new Response(JSON.stringify({ error: apiError.message || 'Error executing tool' }), {
|
|
301
|
+
status: apiError.status || 500,
|
|
302
|
+
headers: {
|
|
303
|
+
'Content-Type': 'application/json',
|
|
304
|
+
},
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
});
|
|
243
308
|
router.get('/api/workflows', async () => {
|
|
244
309
|
try {
|
|
245
|
-
const workflows = mastra.getWorkflows();
|
|
310
|
+
const workflows = mastra.getWorkflows({ serialized: true });
|
|
246
311
|
return new Response(JSON.stringify(workflows), {
|
|
247
312
|
headers: {
|
|
248
313
|
'Content-Type': 'application/json',
|
|
@@ -265,9 +330,23 @@ router.get('/api/workflows/:workflowId', async ({ params }) => {
|
|
|
265
330
|
const workflowId = decodeURIComponent(params.workflowId);
|
|
266
331
|
const workflow = mastra.getWorkflow(workflowId);
|
|
267
332
|
const triggerSchema = workflow.triggerSchema;
|
|
333
|
+
const stepGraph = workflow.stepGraph;
|
|
334
|
+
const stepSubscriberGraph = workflow.stepSubscriberGraph;
|
|
335
|
+
const serializedSteps = Object.entries(workflow.steps).reduce((acc, [key, step]) => {
|
|
336
|
+
const _step = step;
|
|
337
|
+
acc[key] = {
|
|
338
|
+
..._step,
|
|
339
|
+
inputSchema: _step.inputSchema ? stringify(zodToJsonSchema(_step.inputSchema)) : undefined,
|
|
340
|
+
outputSchema: _step.outputSchema ? stringify(zodToJsonSchema(_step.outputSchema)) : undefined,
|
|
341
|
+
};
|
|
342
|
+
return acc;
|
|
343
|
+
}, {});
|
|
268
344
|
return new Response(JSON.stringify({
|
|
269
|
-
|
|
345
|
+
name: workflow.name,
|
|
270
346
|
triggerSchema: triggerSchema ? stringify(zodToJsonSchema(triggerSchema)) : undefined,
|
|
347
|
+
steps: serializedSteps,
|
|
348
|
+
stepGraph,
|
|
349
|
+
stepSubscriberGraph,
|
|
271
350
|
}), {
|
|
272
351
|
headers: {
|
|
273
352
|
'Content-Type': 'application/json',
|
|
@@ -288,9 +367,8 @@ router.get('/api/workflows/:workflowId', async ({ params }) => {
|
|
|
288
367
|
router.post('/workflows/:workflowId/execute', async ({ params, json }) => {
|
|
289
368
|
try {
|
|
290
369
|
const workflowId = decodeURIComponent(params.workflowId);
|
|
291
|
-
const workflow = mastra.
|
|
370
|
+
const workflow = mastra.getWorkflow(workflowId);
|
|
292
371
|
const body = await json();
|
|
293
|
-
console.log('body', body);
|
|
294
372
|
const result = await workflow.execute(body);
|
|
295
373
|
return new Response(JSON.stringify(result), {
|
|
296
374
|
headers: {
|
|
@@ -309,9 +387,36 @@ router.post('/workflows/:workflowId/execute', async ({ params, json }) => {
|
|
|
309
387
|
});
|
|
310
388
|
}
|
|
311
389
|
});
|
|
312
|
-
router.get('/api/memory/
|
|
390
|
+
router.get('/api/memory/status', async () => {
|
|
313
391
|
try {
|
|
314
|
-
const
|
|
392
|
+
const memory = mastra.memory;
|
|
393
|
+
if (!memory) {
|
|
394
|
+
return new Response(JSON.stringify({ result: false }), {
|
|
395
|
+
headers: {
|
|
396
|
+
'Content-Type': 'application/json',
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
return new Response(JSON.stringify({ result: true }), {
|
|
401
|
+
headers: {
|
|
402
|
+
'Content-Type': 'application/json',
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
const apiError = error;
|
|
408
|
+
console.error('Error getting memory status', apiError);
|
|
409
|
+
return new Response(JSON.stringify({ error: apiError.message || 'Error getting memory status' }), {
|
|
410
|
+
status: apiError.status || 500,
|
|
411
|
+
headers: {
|
|
412
|
+
'Content-Type': 'application/json',
|
|
413
|
+
},
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
router.get('/api/memory/threads', async ({ query }) => {
|
|
418
|
+
try {
|
|
419
|
+
const { resourceid } = query;
|
|
315
420
|
const memory = mastra.memory;
|
|
316
421
|
if (!memory) {
|
|
317
422
|
return new Response(JSON.stringify({ error: 'Memory is not initialized' }), {
|
|
@@ -586,7 +691,7 @@ router.get('/api/memory/threads/:threadId/context-window', async ({ params, quer
|
|
|
586
691
|
router.post('/api/memory/save-messages', async ({ json }) => {
|
|
587
692
|
try {
|
|
588
693
|
const memory = mastra.memory;
|
|
589
|
-
const messages = await json();
|
|
694
|
+
const { messages } = await json();
|
|
590
695
|
if (!memory) {
|
|
591
696
|
return new Response(JSON.stringify({ error: 'Memory is not initialized' }), {
|
|
592
697
|
status: 400,
|
|
@@ -725,18 +830,6 @@ router.post('/api/memory/validate-tool-call-args', async ({ json }) => {
|
|
|
725
830
|
});
|
|
726
831
|
}
|
|
727
832
|
});
|
|
728
|
-
/**
|
|
729
|
-
* POST /syncs/{syncId}/execute
|
|
730
|
-
* @summary Execute a sync operation
|
|
731
|
-
* @tags Sync
|
|
732
|
-
* @param {string} syncId.path.required - Sync identifier
|
|
733
|
-
* @param {object} request.body.required - Sync parameters
|
|
734
|
-
* @param {string} request.body.runId - Run identifier
|
|
735
|
-
* @param {object} request.body.params - Sync parameters
|
|
736
|
-
* @return {object} 200 - Sync execution result
|
|
737
|
-
* @return {Error} 400 - Validation error
|
|
738
|
-
* @return {Error} 500 - Server error
|
|
739
|
-
*/
|
|
740
833
|
router.post('/api/syncs/:syncId/execute', async ({ params, json }) => {
|
|
741
834
|
try {
|
|
742
835
|
const syncId = decodeURIComponent(params.syncId);
|
|
@@ -768,6 +861,133 @@ router.post('/api/syncs/:syncId/execute', async ({ params, json }) => {
|
|
|
768
861
|
});
|
|
769
862
|
}
|
|
770
863
|
});
|
|
864
|
+
router.get('/api/logs', async () => {
|
|
865
|
+
try {
|
|
866
|
+
const logs = await mastra.getLogs();
|
|
867
|
+
return new Response(JSON.stringify(logs), {
|
|
868
|
+
headers: {
|
|
869
|
+
'Content-Type': 'application/json',
|
|
870
|
+
},
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
catch (error) {
|
|
874
|
+
const apiError = error;
|
|
875
|
+
console.error('Error getting logs', apiError);
|
|
876
|
+
return new Response(JSON.stringify({ error: apiError.message || 'Error getting logs' }), {
|
|
877
|
+
status: apiError.status || 500,
|
|
878
|
+
headers: {
|
|
879
|
+
'Content-Type': 'application/json',
|
|
880
|
+
},
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
router.get('/api/logs/:runId', async ({ params }) => {
|
|
885
|
+
try {
|
|
886
|
+
const runId = decodeURIComponent(params.runId);
|
|
887
|
+
const logs = await mastra.getLogsByRunId(runId);
|
|
888
|
+
return new Response(JSON.stringify(logs), {
|
|
889
|
+
headers: {
|
|
890
|
+
'Content-Type': 'application/json',
|
|
891
|
+
},
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
catch (error) {
|
|
895
|
+
const apiError = error;
|
|
896
|
+
console.error('Error getting logs', apiError);
|
|
897
|
+
return new Response(JSON.stringify({ error: apiError.message || 'Error getting logs' }), {
|
|
898
|
+
status: apiError.status || 500,
|
|
899
|
+
headers: {
|
|
900
|
+
'Content-Type': 'application/json',
|
|
901
|
+
},
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
router.get('/api/tools', async () => {
|
|
906
|
+
if (tools) {
|
|
907
|
+
const serializedTools = Object.entries(tools).reduce((acc, [id, _tool]) => {
|
|
908
|
+
const tool = _tool;
|
|
909
|
+
acc[id] = {
|
|
910
|
+
...tool,
|
|
911
|
+
inputSchema: tool.inputSchema ? stringify(zodToJsonSchema(tool.inputSchema)) : undefined,
|
|
912
|
+
outputSchema: tool.outputSchema ? stringify(zodToJsonSchema(tool.outputSchema)) : undefined,
|
|
913
|
+
};
|
|
914
|
+
return acc;
|
|
915
|
+
}, {});
|
|
916
|
+
return new Response(JSON.stringify(serializedTools), {
|
|
917
|
+
headers: {
|
|
918
|
+
'Content-Type': 'application/json',
|
|
919
|
+
},
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
return new Response(JSON.stringify({}), {
|
|
924
|
+
headers: {
|
|
925
|
+
'Content-Type': 'application/json',
|
|
926
|
+
},
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
router.get('/api/tools/:toolId', async ({ params }) => {
|
|
931
|
+
const toolId = decodeURIComponent(params.toolId);
|
|
932
|
+
const tool = Object.values(tools || {}).find((tool) => tool.id === toolId);
|
|
933
|
+
if (tool) {
|
|
934
|
+
const serializedTool = {
|
|
935
|
+
...tool,
|
|
936
|
+
inputSchema: tool.inputSchema ? stringify(zodToJsonSchema(tool.inputSchema)) : undefined,
|
|
937
|
+
outputSchema: tool.outputSchema ? stringify(zodToJsonSchema(tool.outputSchema)) : undefined,
|
|
938
|
+
};
|
|
939
|
+
return new Response(JSON.stringify(serializedTool), {
|
|
940
|
+
headers: {
|
|
941
|
+
'Content-Type': 'application/json',
|
|
942
|
+
},
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
return new Response(JSON.stringify({ error: 'Tool not found' }), {
|
|
947
|
+
status: 404,
|
|
948
|
+
headers: {
|
|
949
|
+
'Content-Type': 'application/json',
|
|
950
|
+
},
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
router.post('/api/tools/:toolId/execute', async ({ params, json }) => {
|
|
955
|
+
try {
|
|
956
|
+
const toolId = decodeURIComponent(params.toolId);
|
|
957
|
+
const tool = Object.values(tools || {}).find((tool) => tool.id === toolId);
|
|
958
|
+
if (!tool) {
|
|
959
|
+
return new Response(JSON.stringify({ error: 'Tool not found' }), {
|
|
960
|
+
status: 404,
|
|
961
|
+
headers: {
|
|
962
|
+
'Content-Type': 'application/json',
|
|
963
|
+
},
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
const { input } = await json();
|
|
967
|
+
const result = await tool.execute({
|
|
968
|
+
context: {
|
|
969
|
+
...input,
|
|
970
|
+
},
|
|
971
|
+
mastra,
|
|
972
|
+
runId: mastra.runId,
|
|
973
|
+
});
|
|
974
|
+
return new Response(JSON.stringify(result), {
|
|
975
|
+
headers: {
|
|
976
|
+
'Content-Type': 'application/json',
|
|
977
|
+
},
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
catch (error) {
|
|
981
|
+
const apiError = error;
|
|
982
|
+
console.error('Error executing tool', apiError);
|
|
983
|
+
return new Response(JSON.stringify({ error: apiError.message || 'Error executing tool' }), {
|
|
984
|
+
status: apiError.status || 500,
|
|
985
|
+
headers: {
|
|
986
|
+
'Content-Type': 'application/json',
|
|
987
|
+
},
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
});
|
|
771
991
|
// 404 handler
|
|
772
992
|
router.all('*', () => new Response('Not Found', { status: 404 }));
|
|
773
993
|
export default {
|
package/dist/utils/bundle.d.ts
CHANGED
|
@@ -12,16 +12,19 @@ export declare function bundleServer(entryPoint: string): Promise<esbuild.BuildR
|
|
|
12
12
|
metafile: true;
|
|
13
13
|
logLevel: "error";
|
|
14
14
|
nodePaths: string[];
|
|
15
|
-
|
|
15
|
+
conditions: string[];
|
|
16
16
|
banner: {
|
|
17
17
|
js: string;
|
|
18
18
|
};
|
|
19
|
+
external: string[];
|
|
19
20
|
logOverride: {
|
|
20
21
|
'commonjs-variable-in-esm': "silent";
|
|
21
22
|
};
|
|
22
23
|
}>>;
|
|
23
24
|
export declare function bundle(dirPath: string, options?: {
|
|
24
25
|
outfile?: string;
|
|
26
|
+
entryFile?: string;
|
|
27
|
+
buildName?: string;
|
|
25
28
|
}): Promise<esbuild.BuildResult<{
|
|
26
29
|
entryPoints: string[];
|
|
27
30
|
bundle: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/utils/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAanC,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/utils/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAanC,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;IA6FpD;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;IAuGnH"}
|
package/dist/utils/bundle.js
CHANGED
|
@@ -13,6 +13,10 @@ export async function bundleServer(entryPoint) {
|
|
|
13
13
|
upsertMastraDir();
|
|
14
14
|
const outfile = join(process.cwd(), '.mastra', 'server.mjs');
|
|
15
15
|
const cliNodeModules = join(path.dirname(path.dirname(__dirname)), 'node_modules');
|
|
16
|
+
if (!cliNodeModules) {
|
|
17
|
+
logger.error('Mastra CLI is not installed. Please run `npm install -g mastra` to install Mastra CLI.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
16
20
|
const result = await esbuild.build({
|
|
17
21
|
entryPoints: [entryPoint],
|
|
18
22
|
bundle: true,
|
|
@@ -26,6 +30,17 @@ export async function bundleServer(entryPoint) {
|
|
|
26
30
|
metafile: true, // Generates build metadata
|
|
27
31
|
logLevel: 'error',
|
|
28
32
|
nodePaths: [cliNodeModules],
|
|
33
|
+
conditions: ['import', 'node'],
|
|
34
|
+
banner: {
|
|
35
|
+
js: `
|
|
36
|
+
import { createRequire } from "module";
|
|
37
|
+
import { fileURLToPath } from 'url';
|
|
38
|
+
import path from 'path';
|
|
39
|
+
const require = createRequire(import.meta.url);
|
|
40
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
41
|
+
const __dirname = path.dirname(__filename);
|
|
42
|
+
`,
|
|
43
|
+
},
|
|
29
44
|
external: [
|
|
30
45
|
// Mark node built-ins as external
|
|
31
46
|
'fs',
|
|
@@ -59,17 +74,9 @@ export async function bundleServer(entryPoint) {
|
|
|
59
74
|
'@mastra/engine',
|
|
60
75
|
'@mastra/firecrawl',
|
|
61
76
|
'@mastra/github',
|
|
77
|
+
'@mastra/rag',
|
|
78
|
+
'@mastra/stabilityai',
|
|
62
79
|
],
|
|
63
|
-
banner: {
|
|
64
|
-
js: `
|
|
65
|
-
import { createRequire } from "module";
|
|
66
|
-
import { fileURLToPath } from 'url';
|
|
67
|
-
import path from 'path';
|
|
68
|
-
const require = createRequire(import.meta.url);
|
|
69
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
70
|
-
const __dirname = path.dirname(__filename);
|
|
71
|
-
`,
|
|
72
|
-
},
|
|
73
80
|
logOverride: {
|
|
74
81
|
'commonjs-variable-in-esm': 'silent',
|
|
75
82
|
},
|
|
@@ -95,7 +102,7 @@ export async function bundle(dirPath, options) {
|
|
|
95
102
|
// Ensure .mastra directory exists
|
|
96
103
|
upsertMastraDir();
|
|
97
104
|
const fileService = new FileService();
|
|
98
|
-
const entryPoint = fileService.getFirstExistingFile([join(dirPath, 'index.ts
|
|
105
|
+
const entryPoint = fileService.getFirstExistingFile([join(dirPath, `${options?.entryFile || 'index'}.ts`)]);
|
|
99
106
|
const outfile = options?.outfile || join(process.cwd(), '.mastra', 'mastra.mjs');
|
|
100
107
|
const result = await esbuild.build({
|
|
101
108
|
entryPoints: [entryPoint],
|
|
@@ -112,8 +119,12 @@ export async function bundle(dirPath, options) {
|
|
|
112
119
|
conditions: ['import', 'node'],
|
|
113
120
|
banner: {
|
|
114
121
|
js: `
|
|
115
|
-
import { createRequire } from
|
|
122
|
+
import { createRequire } from "module";
|
|
123
|
+
import { fileURLToPath } from 'url';
|
|
124
|
+
import path from 'path';
|
|
116
125
|
const require = createRequire(import.meta.url);
|
|
126
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
127
|
+
const __dirname = path.dirname(__filename);
|
|
117
128
|
`,
|
|
118
129
|
},
|
|
119
130
|
logOverride: {
|
|
@@ -156,16 +167,20 @@ export async function bundle(dirPath, options) {
|
|
|
156
167
|
'wasi',
|
|
157
168
|
'worker_threads',
|
|
158
169
|
'zlib',
|
|
170
|
+
'chromium-bidi/lib/cjs/bidiMapper/BidiMapper',
|
|
171
|
+
'chromium-bidi/lib/cjs/cdp/CdpConnection',
|
|
159
172
|
// Your packages
|
|
160
173
|
'@mastra/core',
|
|
161
174
|
'@mastra/memory',
|
|
162
175
|
'@mastra/engine',
|
|
163
176
|
'@mastra/firecrawl',
|
|
164
177
|
'@mastra/github',
|
|
178
|
+
'@mastra/rag',
|
|
179
|
+
'@mastra/stabilityai',
|
|
165
180
|
],
|
|
166
181
|
});
|
|
167
182
|
// Log build results
|
|
168
|
-
logger.success(
|
|
183
|
+
logger.success(`${options?.buildName} Build completed successfully`);
|
|
169
184
|
// Output build metadata
|
|
170
185
|
await esbuild.analyzeMetafile(result.metafile);
|
|
171
186
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mastra",
|
|
3
|
-
"version": "0.1.57-unstable.
|
|
3
|
+
"version": "0.1.57-unstable.88",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "cli for mastra",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@clack/prompts": "^0.8.2",
|
|
26
26
|
"@dagrejs/dagre": "^1.1.4",
|
|
27
27
|
"@hookform/resolvers": "^3.9.0",
|
|
28
|
+
"@radix-ui/react-alert-dialog": "^1.1.2",
|
|
28
29
|
"@radix-ui/react-checkbox": "^1.1.1",
|
|
29
30
|
"@radix-ui/react-collapsible": "^1.1.0",
|
|
30
31
|
"@radix-ui/react-dialog": "^1.1.3",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"@tanstack/react-virtual": "^3.10.4",
|
|
44
45
|
"@types/figlet": "^1.7.0",
|
|
45
46
|
"@xyflow/react": "^12.3.6",
|
|
47
|
+
"chokidar": "^4.0.3",
|
|
46
48
|
"class-variance-authority": "^0.7.1",
|
|
47
49
|
"clsx": "^2.1.1",
|
|
48
50
|
"cmdk": "^1.0.0",
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
"shiki": "^1.24.2",
|
|
83
85
|
"sonner": "^1.7.1",
|
|
84
86
|
"superjson": "^2.2.2",
|
|
87
|
+
"swr": "^2.2.5",
|
|
85
88
|
"tailwind-merge": "^2.5.5",
|
|
86
89
|
"tailwindcss-animate": "^1.0.7",
|
|
87
90
|
"tcp-port-used": "^1.0.2",
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
"yocto-spinner": "^0.1.1",
|
|
94
97
|
"zod": "^3.24.1",
|
|
95
98
|
"zod-to-json-schema": "^3.24.1",
|
|
96
|
-
"@mastra/core": "0.1.27-alpha.
|
|
99
|
+
"@mastra/core": "0.1.27-alpha.61"
|
|
97
100
|
},
|
|
98
101
|
"devDependencies": {
|
|
99
102
|
"@types/express": "^5.0.0",
|
|
@@ -106,6 +109,7 @@
|
|
|
106
109
|
"@types/tcp-port-used": "^1.0.4",
|
|
107
110
|
"@vitejs/plugin-react": "^4.3.4",
|
|
108
111
|
"autoprefixer": "^10.4.20",
|
|
112
|
+
"cpy-cli": "^5.0.0",
|
|
109
113
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
110
114
|
"eslint-plugin-react-refresh": "^0.4.14",
|
|
111
115
|
"postcss": "^8.4.49",
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
"build": "npm-run-all build:tsc copy-starter-files build:playground",
|
|
118
122
|
"build:tsc": "tsc",
|
|
119
123
|
"build:dev": "npx tsc --watch",
|
|
120
|
-
"copy-starter-files": "
|
|
124
|
+
"copy-starter-files": "cpy src/starter-files dist/",
|
|
121
125
|
"build:playground": "cd src/playground && vite build",
|
|
122
126
|
"dev:playground": "cd src/playground && vite",
|
|
123
127
|
"init": "npx tsx src/index.ts init",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Object.freeze(JSON.parse('{"colors":{"actionBar.toggledBackground":"#383a49","activityBarBadge.background":"#007ACC","checkbox.border":"#6B6B6B","editor.background":"#1E1E1E","editor.foreground":"#D4D4D4","editor.inactiveSelectionBackground":"#3A3D41","editor.selectionHighlightBackground":"#ADD6FF26","editorIndentGuide.activeBackground1":"#707070","editorIndentGuide.background1":"#404040","input.placeholderForeground":"#A6A6A6","list.activeSelectionIconForeground":"#FFF","list.dropBackground":"#383B3D","menu.background":"#252526","menu.border":"#454545","menu.foreground":"#CCCCCC","menu.selectionBackground":"#0078d4","menu.separatorBackground":"#454545","ports.iconRunningProcessForeground":"#369432","sideBarSectionHeader.background":"#0000","sideBarSectionHeader.border":"#ccc3","sideBarTitle.foreground":"#BBBBBB","statusBarItem.remoteBackground":"#16825D","statusBarItem.remoteForeground":"#FFF","tab.lastPinnedBorder":"#ccc3","tab.selectedBackground":"#222222","tab.selectedForeground":"#ffffffa0","terminal.inactiveSelectionBackground":"#3A3D41","widget.border":"#303031"},"displayName":"Dark Plus","name":"dark-plus","semanticHighlighting":true,"semanticTokenColors":{"customLiteral":"#DCDCAA","newOperator":"#C586C0","numberLiteral":"#b5cea8","stringLiteral":"#ce9178"},"tokenColors":[{"scope":["meta.embedded","source.groovy.embedded","string meta.image.inline.markdown","variable.legacy.builtin.python"],"settings":{"foreground":"#D4D4D4"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#6A9955"}},{"scope":"constant.language","settings":{"foreground":"#569cd6"}},{"scope":["constant.numeric","variable.other.enummember","keyword.operator.plus.exponent","keyword.operator.minus.exponent"],"settings":{"foreground":"#b5cea8"}},{"scope":"constant.regexp","settings":{"foreground":"#646695"}},{"scope":"entity.name.tag","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.tag.css","entity.name.tag.less"],"settings":{"foreground":"#d7ba7d"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#9cdcfe"}},{"scope":["entity.other.attribute-name.class.css","source.css entity.other.attribute-name.class","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.parent.less","source.css entity.other.attribute-name.pseudo-class","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.scss"],"settings":{"foreground":"#d7ba7d"}},{"scope":"invalid","settings":{"foreground":"#f44747"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#569cd6"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.strikethrough","settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inserted","settings":{"foreground":"#b5cea8"}},{"scope":"markup.deleted","settings":{"foreground":"#ce9178"}},{"scope":"markup.changed","settings":{"foreground":"#569cd6"}},{"scope":"punctuation.definition.quote.begin.markdown","settings":{"foreground":"#6A9955"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#6796e6"}},{"scope":"markup.inline.raw","settings":{"foreground":"#ce9178"}},{"scope":"punctuation.definition.tag","settings":{"foreground":"#808080"}},{"scope":["meta.preprocessor","entity.name.function.preprocessor"],"settings":{"foreground":"#569cd6"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#ce9178"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#b5cea8"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#9cdcfe"}},{"scope":"meta.diff.header","settings":{"foreground":"#569cd6"}},{"scope":"storage","settings":{"foreground":"#569cd6"}},{"scope":"storage.type","settings":{"foreground":"#569cd6"}},{"scope":["storage.modifier","keyword.operator.noexcept"],"settings":{"foreground":"#569cd6"}},{"scope":["string","meta.embedded.assembly"],"settings":{"foreground":"#ce9178"}},{"scope":"string.tag","settings":{"foreground":"#ce9178"}},{"scope":"string.value","settings":{"foreground":"#ce9178"}},{"scope":"string.regexp","settings":{"foreground":"#d16969"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#569cd6"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#d4d4d4"}},{"scope":["support.type.vendored.property-name","support.type.property-name","source.css variable","source.coffee.embedded"],"settings":{"foreground":"#9cdcfe"}},{"scope":"keyword","settings":{"foreground":"#569cd6"}},{"scope":"keyword.control","settings":{"foreground":"#569cd6"}},{"scope":"keyword.operator","settings":{"foreground":"#d4d4d4"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.alignof","keyword.operator.typeid","keyword.operator.alignas","keyword.operator.instanceof","keyword.operator.logical.python","keyword.operator.wordlike"],"settings":{"foreground":"#569cd6"}},{"scope":"keyword.other.unit","settings":{"foreground":"#b5cea8"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#569cd6"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#9cdcfe"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#b5cea8"}},{"scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#d4d4d4"}},{"scope":"variable.language","settings":{"foreground":"#569cd6"}},{"scope":["entity.name.function","support.function","support.constant.handlebars","source.powershell variable.other.member","entity.name.operator.custom-literal"],"settings":{"foreground":"#DCDCAA"}},{"scope":["support.class","support.type","entity.name.type","entity.name.namespace","entity.other.attribute","entity.name.scope-resolution","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#4EC9B0"}},{"scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class","punctuation.separator.namespace.ruby"],"settings":{"foreground":"#4EC9B0"}},{"scope":["keyword.control","source.cpp keyword.operator.new","keyword.operator.delete","keyword.other.using","keyword.other.directive.using","keyword.other.operator","entity.name.operator"],"settings":{"foreground":"#C586C0"}},{"scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable","constant.other.placeholder"],"settings":{"foreground":"#9CDCFE"}},{"scope":["variable.other.constant","variable.other.enummember"],"settings":{"foreground":"#4FC1FF"}},{"scope":["meta.object-literal.key"],"settings":{"foreground":"#9CDCFE"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#CE9178"}},{"scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#CE9178"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#DCDCAA"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d7ba7d"}},{"scope":["constant.character","constant.other.option"],"settings":{"foreground":"#569cd6"}},{"scope":"constant.character.escape","settings":{"foreground":"#d7ba7d"}},{"scope":"entity.name.label","settings":{"foreground":"#C8C8C8"}}],"type":"dark"}'));export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./html-DG1TtFnM.js";import n from"./ruby-DsC6krmi.js";import"./javascript-DNgb01dh.js";import"./css-u4bm_LMz.js";import"./haml-B1jT_oKV.js";import"./xml-BOQ9RtXF.js";import"./java-BN40hmum.js";import"./sql-D8nBeWSR.js";import"./graphql-DqgCZ2sd.js";import"./typescript-CVESyXxo.js";import"./jsx-CM4fc1WH.js";import"./tsx-DqpEK-75.js";import"./cpp-IRqjNdQP.js";import"./regexp-DoiKbUTj.js";import"./glsl-bwZ1_LLM.js";import"./c-BhsLqr-4.js";import"./shellscript-HNM5thJl.js";import"./lua-B2--UKVN.js";import"./yaml-CIiI48o2.js";const t=Object.freeze(JSON.parse('{"displayName":"ERB","fileTypes":["erb","rhtml","html.erb"],"injections":{"text.html.erb - (meta.embedded.block.erb | meta.embedded.line.erb | comment)":{"patterns":[{"begin":"(^\\\\s*)(?=<%+#(?![^%]*%>))","beginCaptures":{"0":{"name":"punctuation.whitespace.comment.leading.erb"}},"end":"(?!\\\\G)(\\\\s*$\\\\n)?","endCaptures":{"0":{"name":"punctuation.whitespace.comment.trailing.erb"}},"patterns":[{"include":"#comment"}]},{"begin":"(^\\\\s*)(?=<%(?![^%]*%>))","beginCaptures":{"0":{"name":"punctuation.whitespace.embedded.leading.erb"}},"end":"(?!\\\\G)(\\\\s*$\\\\n)?","endCaptures":{"0":{"name":"punctuation.whitespace.embedded.trailing.erb"}},"patterns":[{"include":"#tags"}]},{"include":"#comment"},{"include":"#tags"}]}},"name":"erb","patterns":[{"include":"text.html.basic"}],"repository":{"comment":{"patterns":[{"begin":"<%+#","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.erb"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.definition.comment.end.erb"}},"name":"comment.block.erb"}]},"tags":{"patterns":[{"begin":"<%+(?!>)[-=]?(?![^%]*%>)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.erb"}},"contentName":"source.ruby","end":"(-?%)>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.erb"},"1":{"name":"source.ruby"}},"name":"meta.embedded.block.erb","patterns":[{"captures":{"1":{"name":"punctuation.definition.comment.erb"}},"match":"(#).*?(?=-?%>)","name":"comment.line.number-sign.erb"},{"include":"source.ruby"}]},{"begin":"<%+(?!>)[-=]?","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.erb"}},"contentName":"source.ruby","end":"(-?%)>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.erb"},"1":{"name":"source.ruby"}},"name":"meta.embedded.line.erb","patterns":[{"captures":{"1":{"name":"punctuation.definition.comment.erb"}},"match":"(#).*?(?=-?%>)","name":"comment.line.number-sign.erb"},{"include":"source.ruby"}]}]}},"scopeName":"text.html.erb","embeddedLangs":["html","ruby"]}')),x=[...e,...n,t];export{x as default};
|