@agentuity/cli 0.0.78 → 0.0.80
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 +229 -24
- package/dist/cmd/build/ast.js.map +1 -1
- package/dist/cmd/build/bundler.d.ts +3 -1
- package/dist/cmd/build/bundler.d.ts.map +1 -1
- package/dist/cmd/build/bundler.js +18 -17
- package/dist/cmd/build/bundler.js.map +1 -1
- package/dist/cmd/build/index.d.ts.map +1 -1
- package/dist/cmd/build/index.js +5 -2
- package/dist/cmd/build/index.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/build/{workbench-templates.d.ts → workbench.d.ts} +3 -1
- package/dist/cmd/build/workbench.d.ts.map +1 -0
- package/dist/cmd/build/{workbench-templates.js → workbench.js} +13 -1
- package/dist/cmd/build/workbench.js.map +1 -0
- 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/dist/cmd/dev/index.d.ts.map +1 -1
- package/dist/cmd/dev/index.js +11 -2
- package/dist/cmd/dev/index.js.map +1 -1
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +13 -2
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/sound.d.ts.map +1 -1
- package/dist/sound.js +1 -16
- package/dist/sound.js.map +1 -1
- package/package.json +5 -4
- package/src/cmd/build/ast.ts +322 -38
- package/src/cmd/build/bundler.ts +20 -17
- package/src/cmd/build/index.ts +5 -2
- package/src/cmd/build/plugin.ts +45 -41
- package/src/cmd/build/{workbench-templates.ts → workbench.ts} +13 -0
- package/src/cmd/cloud/deploy.ts +0 -1
- package/src/cmd/dev/index.ts +13 -2
- package/src/cmd/project/template-flow.ts +14 -2
- package/src/sound.ts +1 -17
- package/dist/cmd/build/workbench-templates.d.ts.map +0 -1
- package/dist/cmd/build/workbench-templates.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
1
2
|
import { encodeWorkbenchConfig, type WorkbenchConfig } from '@agentuity/core';
|
|
3
|
+
import { analyzeWorkbench, WorkbenchAnalysis } from './ast';
|
|
2
4
|
|
|
3
5
|
export function generateWorkbenchMainTsx(config: WorkbenchConfig): string {
|
|
4
6
|
const encodedConfig = encodeWorkbenchConfig(config);
|
|
@@ -35,3 +37,14 @@ export function generateWorkbenchIndexHtml(): string {
|
|
|
35
37
|
</body>
|
|
36
38
|
</html>`;
|
|
37
39
|
}
|
|
40
|
+
|
|
41
|
+
export async function getWorkbench(dir: string): Promise<WorkbenchAnalysis> {
|
|
42
|
+
const appFile = Bun.file(join(dir, 'app.ts'));
|
|
43
|
+
if (await appFile.exists()) {
|
|
44
|
+
return analyzeWorkbench(await appFile.text());
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
hasWorkbench: false,
|
|
48
|
+
config: null,
|
|
49
|
+
};
|
|
50
|
+
}
|
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));
|
package/src/cmd/dev/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { APIClient, getAPIBaseURL, getGravityDevModeURL } from '../../api';
|
|
|
20
20
|
import { download } from './download';
|
|
21
21
|
import { createDevmodeSyncService } from './sync';
|
|
22
22
|
import { getDevmodeDeploymentId } from '../build/ast';
|
|
23
|
+
import { getWorkbench } from '../build/workbench';
|
|
23
24
|
import { BuildMetadata } from '@agentuity/server';
|
|
24
25
|
import { getCommand } from '../../command-prefix';
|
|
25
26
|
import { notifyWorkbenchClients } from '../../utils/workbench-notify';
|
|
@@ -159,16 +160,25 @@ export const command = createCommand({
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
|
|
163
|
+
const workbench = await getWorkbench(rootDir);
|
|
164
|
+
|
|
162
165
|
const canDoInput =
|
|
163
166
|
interactive && !!(process.stdin.isTTY && process.stdout.isTTY && !process.env.CI);
|
|
164
167
|
|
|
168
|
+
const padding = 12;
|
|
169
|
+
|
|
165
170
|
const devmodebody =
|
|
166
|
-
tui.muted(tui.padRight('Local:',
|
|
171
|
+
tui.muted(tui.padRight('Local:', padding)) +
|
|
167
172
|
tui.link(`http://127.0.0.1:${opts.port}`) +
|
|
168
173
|
'\n' +
|
|
169
|
-
tui.muted(tui.padRight('Public:',
|
|
174
|
+
tui.muted(tui.padRight('Public:', padding)) +
|
|
170
175
|
(devmode?.hostname ? tui.link(`https://${devmode.hostname}`) : tui.warn('Disabled')) +
|
|
171
176
|
'\n' +
|
|
177
|
+
tui.muted(tui.padRight('Workbench:', padding)) +
|
|
178
|
+
(workbench.hasWorkbench
|
|
179
|
+
? tui.link(`http://127.0.0.1:${opts.port}${workbench.config?.route ?? '/workbench'}`)
|
|
180
|
+
: tui.warn('Disabled')) +
|
|
181
|
+
'\n' +
|
|
172
182
|
(canDoInput
|
|
173
183
|
? '\n' + tui.muted('Press ') + tui.bold('h') + tui.muted(' for keyboard shortcuts')
|
|
174
184
|
: '');
|
|
@@ -520,6 +530,7 @@ export const command = createCommand({
|
|
|
520
530
|
port: opts.port,
|
|
521
531
|
region: project?.region ?? 'local',
|
|
522
532
|
logger,
|
|
533
|
+
workbench,
|
|
523
534
|
});
|
|
524
535
|
building = false;
|
|
525
536
|
buildCompletedAt = Date.now();
|
|
@@ -190,12 +190,24 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<void> {
|
|
|
190
190
|
} else if (skipPrompts) {
|
|
191
191
|
selectedTemplate = templates[0];
|
|
192
192
|
} else {
|
|
193
|
+
let maxLength = 15;
|
|
194
|
+
templates.forEach((t) => {
|
|
195
|
+
if (maxLength < t.name.length) {
|
|
196
|
+
maxLength = t.name.length;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
maxLength = Math.min(maxLength + 1, 40);
|
|
200
|
+
const [_winWidth] = process.stdout.getWindowSize();
|
|
201
|
+
const winWidth = _winWidth - maxLength - 8; // space for the name and left indent
|
|
193
202
|
const templateId = await prompt.select({
|
|
194
203
|
message: 'Select a template:',
|
|
195
204
|
options: templates.map((t) => ({
|
|
196
205
|
value: t.id,
|
|
197
|
-
label: t.name,
|
|
198
|
-
hint:
|
|
206
|
+
label: t.name.padEnd(maxLength),
|
|
207
|
+
hint:
|
|
208
|
+
t.description.length > winWidth
|
|
209
|
+
? t.description.substring(0, winWidth - 3) + '...'
|
|
210
|
+
: t.description,
|
|
199
211
|
})),
|
|
200
212
|
});
|
|
201
213
|
const found = templates.find((t) => t.id === templateId);
|
package/src/sound.ts
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
|
|
3
1
|
export function playSound(): void {
|
|
4
2
|
const platform = process.platform;
|
|
5
3
|
|
|
6
4
|
let command: string[];
|
|
7
5
|
switch (platform) {
|
|
8
6
|
case 'darwin': {
|
|
9
|
-
|
|
10
|
-
'Blow.aiff',
|
|
11
|
-
'Bottle.aiff',
|
|
12
|
-
'Frog.aiff',
|
|
13
|
-
'Funk.aiff',
|
|
14
|
-
'Glass.aiff',
|
|
15
|
-
'Hero.aiff',
|
|
16
|
-
'Morse.aiff',
|
|
17
|
-
'Ping.aiff',
|
|
18
|
-
'Pop.aiff',
|
|
19
|
-
'Purr.aiff',
|
|
20
|
-
'Sosumi.aiff',
|
|
21
|
-
] as const;
|
|
22
|
-
const file = items[Math.floor(Math.random() * items.length)];
|
|
23
|
-
command = ['afplay', join('/System/Library/Sounds', file)];
|
|
7
|
+
command = ['afplay', '/System/Library/Sounds/Blow.aiff'];
|
|
24
8
|
break;
|
|
25
9
|
}
|
|
26
10
|
case 'linux':
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-templates.d.ts","sourceRoot":"","sources":["../../../src/cmd/build/workbench-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAmBxE;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAanD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-templates.js","sourceRoot":"","sources":["../../../src/cmd/build/workbench-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iBAAiB,CAAC;AAE9E,MAAM,UAAU,wBAAwB,CAAC,MAAuB;IAC/D,MAAM,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpD,OAAO;;;;;;;;;;;;;;gCAcwB,aAAa;iCACZ,aAAa;CAC7C,CAAC;AACF,CAAC;AAED,MAAM,UAAU,0BAA0B;IACzC,OAAO;;;;;;;;;;;QAWA,CAAC;AACT,CAAC"}
|