@agentuity/cli 0.0.78 → 0.0.79
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/cmd/build/ast.d.ts +2 -2
- package/dist/cmd/build/ast.d.ts.map +1 -1
- package/dist/cmd/build/ast.js +118 -10
- package/dist/cmd/build/ast.js.map +1 -1
- package/dist/cmd/build/bundler.d.ts.map +1 -1
- package/dist/cmd/build/bundler.js +10 -11
- package/dist/cmd/build/bundler.js.map +1 -1
- package/dist/cmd/build/plugin.d.ts.map +1 -1
- package/dist/cmd/build/plugin.js +29 -31
- package/dist/cmd/build/plugin.js.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +0 -1
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/package.json +3 -3
- package/src/cmd/build/ast.ts +156 -14
- package/src/cmd/build/bundler.ts +10 -11
- package/src/cmd/build/plugin.ts +45 -41
- package/src/cmd/cloud/deploy.ts +0 -1
package/src/cmd/build/plugin.ts
CHANGED
|
@@ -236,38 +236,55 @@ const AgentuityBundler: BunPlugin = {
|
|
|
236
236
|
let newsource = await Bun.file(args.path).text();
|
|
237
237
|
if (args.path.startsWith(srcDir)) {
|
|
238
238
|
const contents = transpiler.transformSync(newsource);
|
|
239
|
-
const result = await parseAgentMetadata(
|
|
240
|
-
rootDir,
|
|
241
|
-
args.path,
|
|
242
|
-
contents,
|
|
243
|
-
projectId,
|
|
244
|
-
deploymentId
|
|
245
|
-
);
|
|
246
239
|
|
|
247
|
-
//
|
|
248
|
-
if (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
240
|
+
// Check if this is an eval file (eval.ts)
|
|
241
|
+
if (args.path.endsWith('/eval.ts')) {
|
|
242
|
+
// parseEvalMetadata will find the agent from the import statement
|
|
243
|
+
const [ns] = await parseEvalMetadata(
|
|
244
|
+
rootDir,
|
|
245
|
+
args.path,
|
|
246
|
+
contents,
|
|
247
|
+
projectId,
|
|
248
|
+
deploymentId,
|
|
249
|
+
undefined, // No agentId - will be resolved from import
|
|
250
|
+
agentMetadata
|
|
251
|
+
);
|
|
252
|
+
newsource = ns;
|
|
253
|
+
} else {
|
|
254
|
+
// Handle regular agent files
|
|
255
|
+
const result = await parseAgentMetadata(
|
|
256
|
+
rootDir,
|
|
257
|
+
args.path,
|
|
258
|
+
contents,
|
|
259
|
+
projectId,
|
|
260
|
+
deploymentId
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
// Skip files that don't have a createAgent export
|
|
264
|
+
if (result === undefined) {
|
|
265
|
+
return {
|
|
266
|
+
contents: newsource,
|
|
267
|
+
loader: 'ts',
|
|
268
|
+
};
|
|
269
|
+
}
|
|
254
270
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
271
|
+
const [ns, md] = result;
|
|
272
|
+
newsource = ns;
|
|
273
|
+
|
|
274
|
+
// Only process files that actually export an agent
|
|
275
|
+
if (md.has('name')) {
|
|
276
|
+
const newAgentName = md.get('name');
|
|
277
|
+
for (const [, kv] of agentMetadata) {
|
|
278
|
+
const found = kv.get('name');
|
|
279
|
+
if (newAgentName === found) {
|
|
280
|
+
throw new AgentNameDuplicateError({
|
|
281
|
+
message: `The agent in ${kv.get('filename')} and the agent in ${md.get('filename')} have the same name (${found}). Agent Names must be unique within a project.`,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
267
284
|
}
|
|
268
|
-
}
|
|
269
285
|
|
|
270
|
-
|
|
286
|
+
agentMetadata.set(md.get('name')!, md);
|
|
287
|
+
}
|
|
271
288
|
}
|
|
272
289
|
}
|
|
273
290
|
return {
|
|
@@ -276,19 +293,6 @@ const AgentuityBundler: BunPlugin = {
|
|
|
276
293
|
};
|
|
277
294
|
});
|
|
278
295
|
|
|
279
|
-
build.onLoad({ filter: /\/eval\.ts$/, namespace: 'file' }, async (args) => {
|
|
280
|
-
let newsource = await Bun.file(args.path).text();
|
|
281
|
-
if (args.path.startsWith(srcDir)) {
|
|
282
|
-
const contents = transpiler.transformSync(newsource);
|
|
283
|
-
const [ns] = parseEvalMetadata(rootDir, args.path, contents, projectId, deploymentId);
|
|
284
|
-
newsource = ns;
|
|
285
|
-
}
|
|
286
|
-
return {
|
|
287
|
-
contents: newsource,
|
|
288
|
-
loader: 'ts',
|
|
289
|
-
};
|
|
290
|
-
});
|
|
291
|
-
|
|
292
296
|
const patches = generatePatches();
|
|
293
297
|
for (const [, patch] of patches) {
|
|
294
298
|
let modulePath = join('node_modules', patch.module, '.*');
|
package/src/cmd/cloud/deploy.ts
CHANGED
|
@@ -559,7 +559,6 @@ export const deploySubcommand = createSubcommand({
|
|
|
559
559
|
|
|
560
560
|
// Show deployment URLs
|
|
561
561
|
if (complete?.publicUrls) {
|
|
562
|
-
tui.arrow(tui.bold(tui.padRight('Deployment ID:', 17)) + tui.link(deployment.id));
|
|
563
562
|
if (complete.publicUrls.custom?.length) {
|
|
564
563
|
for (const url of complete.publicUrls.custom) {
|
|
565
564
|
tui.arrow(tui.bold(tui.padRight('Deployment URL:', 17)) + tui.link(url));
|