@iqai/adk-cli 0.3.8 → 0.3.9
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/CHANGELOG.md +6 -0
- package/README.md +1 -4
- package/dist/cli/web.command.d.ts +0 -4
- package/dist/cli/web.command.d.ts.map +1 -1
- package/dist/cli/web.command.js +6 -45
- package/dist/cli/web.command.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -126,9 +126,6 @@ adk web --port 8080
|
|
|
126
126
|
# Scan custom directory for agents
|
|
127
127
|
adk web --dir ./my-agents
|
|
128
128
|
|
|
129
|
-
# Run local development version
|
|
130
|
-
adk web --local --web-port 3000
|
|
131
|
-
|
|
132
129
|
# Custom web application URL
|
|
133
130
|
adk web --web-url https://custom-web-app.com
|
|
134
131
|
```
|
|
@@ -182,7 +179,7 @@ npm install
|
|
|
182
179
|
adk run
|
|
183
180
|
|
|
184
181
|
# 4. In another terminal, start web interface
|
|
185
|
-
adk web
|
|
182
|
+
adk web
|
|
186
183
|
```
|
|
187
184
|
|
|
188
185
|
### Multi-Agent Development
|
|
@@ -3,17 +3,13 @@ interface WebCommandOptions {
|
|
|
3
3
|
port?: number;
|
|
4
4
|
dir?: string;
|
|
5
5
|
host?: string;
|
|
6
|
-
webPort?: number;
|
|
7
|
-
local?: boolean;
|
|
8
6
|
webUrl?: string;
|
|
9
7
|
}
|
|
10
8
|
export declare class WebCommand extends CommandRunner {
|
|
11
9
|
run(_passedParams: string[], options?: WebCommandOptions): Promise<void>;
|
|
12
10
|
parsePort(val: string): number;
|
|
13
|
-
parseWebPort(val: string): number;
|
|
14
11
|
parseHost(val: string): string;
|
|
15
12
|
parseDir(val: string): string;
|
|
16
|
-
parseLocal(): boolean;
|
|
17
13
|
parseWebUrl(val: string): string;
|
|
18
14
|
}
|
|
19
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.command.d.ts","sourceRoot":"","sources":["../../src/cli/web.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGhE,UAAU,iBAAiB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"web.command.d.ts","sourceRoot":"","sources":["../../src/cli/web.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGhE,UAAU,iBAAiB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAIa,UAAW,SAAQ,aAAa;IACtC,GAAG,CACR,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC;IA2ChB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ9B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ9B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ7B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAGhC"}
|
package/dist/cli/web.command.js
CHANGED
|
@@ -19,9 +19,7 @@ const bootstrap_1 = require("../http/bootstrap");
|
|
|
19
19
|
let WebCommand = class WebCommand extends nest_commander_1.CommandRunner {
|
|
20
20
|
async run(_passedParams, options) {
|
|
21
21
|
const apiPort = options?.port ?? 8042;
|
|
22
|
-
const webPort = options?.webPort ?? 3000;
|
|
23
22
|
const host = options?.host ?? "localhost";
|
|
24
|
-
const useLocal = options?.local ?? false;
|
|
25
23
|
const webUrl = options?.webUrl ?? "https://adk-web.iqai.com";
|
|
26
24
|
console.log(chalk_1.default.blue("🌐 Starting ADK Web Interface..."));
|
|
27
25
|
// Start the API server first (quiet)
|
|
@@ -31,25 +29,12 @@ let WebCommand = class WebCommand extends nest_commander_1.CommandRunner {
|
|
|
31
29
|
agentsDir: options?.dir ?? process.cwd(),
|
|
32
30
|
quiet: true,
|
|
33
31
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
webAppUrl = `http://${host}:${webPort}`;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
webAppUrl = `http://${host}:${webPort}?port=${apiPort}`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
// Production hosted UI
|
|
46
|
-
if (apiPort === 8042) {
|
|
47
|
-
webAppUrl = webUrl;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
webAppUrl = `${webUrl}?port=${apiPort}`;
|
|
51
|
-
}
|
|
32
|
+
// Build the web app URL - add port param if not using default
|
|
33
|
+
const url = new URL(webUrl);
|
|
34
|
+
if (apiPort !== 8042) {
|
|
35
|
+
url.searchParams.set("port", apiPort.toString());
|
|
52
36
|
}
|
|
37
|
+
const webAppUrl = url.toString();
|
|
53
38
|
console.log(chalk_1.default.cyan(`🔗 Open this URL in your browser: ${webAppUrl}`));
|
|
54
39
|
console.log(chalk_1.default.gray(` API Server: http://${host}:${apiPort}`));
|
|
55
40
|
console.log(chalk_1.default.cyan("Press Ctrl+C to stop the API server"));
|
|
@@ -66,18 +51,12 @@ let WebCommand = class WebCommand extends nest_commander_1.CommandRunner {
|
|
|
66
51
|
parsePort(val) {
|
|
67
52
|
return Number(val);
|
|
68
53
|
}
|
|
69
|
-
parseWebPort(val) {
|
|
70
|
-
return Number(val);
|
|
71
|
-
}
|
|
72
54
|
parseHost(val) {
|
|
73
55
|
return val;
|
|
74
56
|
}
|
|
75
57
|
parseDir(val) {
|
|
76
58
|
return val;
|
|
77
59
|
}
|
|
78
|
-
parseLocal() {
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
60
|
parseWebUrl(val) {
|
|
82
61
|
return val;
|
|
83
62
|
}
|
|
@@ -92,15 +71,6 @@ __decorate([
|
|
|
92
71
|
__metadata("design:paramtypes", [String]),
|
|
93
72
|
__metadata("design:returntype", Number)
|
|
94
73
|
], WebCommand.prototype, "parsePort", null);
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, nest_commander_1.Option)({
|
|
97
|
-
flags: "--web-port <port>",
|
|
98
|
-
description: "Port for web app (when using --local)",
|
|
99
|
-
}),
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [String]),
|
|
102
|
-
__metadata("design:returntype", Number)
|
|
103
|
-
], WebCommand.prototype, "parseWebPort", null);
|
|
104
74
|
__decorate([
|
|
105
75
|
(0, nest_commander_1.Option)({
|
|
106
76
|
flags: "-h, --host <host>",
|
|
@@ -119,19 +89,10 @@ __decorate([
|
|
|
119
89
|
__metadata("design:paramtypes", [String]),
|
|
120
90
|
__metadata("design:returntype", String)
|
|
121
91
|
], WebCommand.prototype, "parseDir", null);
|
|
122
|
-
__decorate([
|
|
123
|
-
(0, nest_commander_1.Option)({
|
|
124
|
-
flags: "--local",
|
|
125
|
-
description: "Run local web app instead of opening production URL",
|
|
126
|
-
}),
|
|
127
|
-
__metadata("design:type", Function),
|
|
128
|
-
__metadata("design:paramtypes", []),
|
|
129
|
-
__metadata("design:returntype", Boolean)
|
|
130
|
-
], WebCommand.prototype, "parseLocal", null);
|
|
131
92
|
__decorate([
|
|
132
93
|
(0, nest_commander_1.Option)({
|
|
133
94
|
flags: "--web-url <url>",
|
|
134
|
-
description: "URL of the web application
|
|
95
|
+
description: "URL of the web application",
|
|
135
96
|
}),
|
|
136
97
|
__metadata("design:type", Function),
|
|
137
98
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.command.js","sourceRoot":"","sources":["../../src/cli/web.command.ts"],"names":[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