@iqai/adk-cli 0.2.8 → 0.3.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.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -0
- package/dist/app.module.d.ts +3 -0
- package/dist/app.module.d.ts.map +1 -0
- package/dist/app.module.js +24 -0
- package/dist/app.module.js.map +1 -0
- package/dist/cli/cli.module.d.ts +3 -0
- package/dist/cli/cli.module.d.ts.map +1 -0
- package/dist/cli/cli.module.js +25 -0
- package/dist/cli/cli.module.js.map +1 -0
- package/dist/cli/new.command.d.ts +10 -0
- package/dist/cli/new.command.d.ts.map +1 -0
- package/dist/cli/new.command.js +273 -0
- package/dist/cli/new.command.js.map +1 -0
- package/dist/cli/run.command.d.ts +20 -0
- package/dist/cli/run.command.d.ts.map +1 -0
- package/dist/cli/run.command.js +342 -0
- package/dist/cli/run.command.js.map +1 -0
- package/dist/cli/serve.command.d.ts +20 -0
- package/dist/cli/serve.command.d.ts.map +1 -0
- package/dist/cli/serve.command.js +137 -0
- package/dist/cli/serve.command.js.map +1 -0
- package/dist/cli/web.command.d.ts +20 -0
- package/dist/cli/web.command.d.ts.map +1 -0
- package/dist/cli/web.command.js +146 -0
- package/dist/cli/web.command.js.map +1 -0
- package/dist/common/tokens.d.ts +5 -0
- package/dist/common/tokens.d.ts.map +1 -0
- package/dist/common/tokens.js +8 -0
- package/dist/common/tokens.js.map +1 -0
- package/dist/common/types.d.ts +91 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -0
- package/dist/http/bootstrap.d.ts +17 -0
- package/dist/http/bootstrap.d.ts.map +1 -0
- package/dist/http/bootstrap.js +221 -0
- package/dist/http/bootstrap.js.map +1 -0
- package/dist/http/config/config.module.d.ts +6 -0
- package/dist/http/config/config.module.d.ts.map +1 -0
- package/dist/http/config/config.module.js +32 -0
- package/dist/http/config/config.module.js.map +1 -0
- package/dist/http/discovery/agents.controller.d.ts +13 -0
- package/dist/http/discovery/agents.controller.d.ts.map +1 -0
- package/dist/http/discovery/agents.controller.js +73 -0
- package/dist/http/discovery/agents.controller.js.map +1 -0
- package/dist/http/discovery/discovery.module.d.ts +3 -0
- package/dist/http/discovery/discovery.module.d.ts.map +1 -0
- package/dist/http/discovery/discovery.module.js +22 -0
- package/dist/http/discovery/discovery.module.js.map +1 -0
- package/dist/http/dto/api.dto.d.ts +70 -0
- package/dist/http/dto/api.dto.d.ts.map +1 -0
- package/dist/http/dto/api.dto.js +268 -0
- package/dist/http/dto/api.dto.js.map +1 -0
- package/dist/http/events/events.controller.d.ts +8 -0
- package/dist/http/events/events.controller.d.ts.map +1 -0
- package/dist/http/events/events.controller.js +55 -0
- package/dist/http/events/events.controller.js.map +1 -0
- package/dist/http/events/events.module.d.ts +3 -0
- package/dist/http/events/events.module.d.ts.map +1 -0
- package/dist/http/events/events.module.js +25 -0
- package/dist/http/events/events.module.js.map +1 -0
- package/dist/http/events/events.service.d.ts +8 -0
- package/dist/http/events/events.service.d.ts.map +1 -0
- package/dist/http/events/events.service.js +37 -0
- package/dist/http/events/events.service.js.map +1 -0
- package/dist/http/health/health.controller.d.ts +6 -0
- package/dist/http/health/health.controller.d.ts.map +1 -0
- package/dist/http/health/health.controller.js +37 -0
- package/dist/http/health/health.controller.js.map +1 -0
- package/dist/http/health/health.module.d.ts +3 -0
- package/dist/http/health/health.module.d.ts.map +1 -0
- package/dist/http/health/health.module.js +20 -0
- package/dist/http/health/health.module.js.map +1 -0
- package/dist/http/http.module.d.ts +6 -0
- package/dist/http/http.module.d.ts.map +1 -0
- package/dist/http/http.module.js +43 -0
- package/dist/http/http.module.js.map +1 -0
- package/dist/http/messaging/messaging.controller.d.ts +9 -0
- package/dist/http/messaging/messaging.controller.d.ts.map +1 -0
- package/dist/http/messaging/messaging.controller.js +83 -0
- package/dist/http/messaging/messaging.controller.js.map +1 -0
- package/dist/http/messaging/messaging.module.d.ts +3 -0
- package/dist/http/messaging/messaging.module.d.ts.map +1 -0
- package/dist/http/messaging/messaging.module.js +25 -0
- package/dist/http/messaging/messaging.module.js.map +1 -0
- package/dist/http/messaging/messaging.service.d.ts +11 -0
- package/dist/http/messaging/messaging.service.d.ts.map +1 -0
- package/dist/http/messaging/messaging.service.js +48 -0
- package/dist/http/messaging/messaging.service.js.map +1 -0
- package/dist/http/providers/agent-loader.service.d.ts +49 -0
- package/dist/http/providers/agent-loader.service.d.ts.map +1 -0
- package/dist/http/providers/agent-loader.service.js +416 -0
- package/dist/http/providers/agent-loader.service.js.map +1 -0
- package/dist/http/providers/agent-manager.service.d.ts +24 -0
- package/dist/http/providers/agent-manager.service.d.ts.map +1 -0
- package/dist/http/providers/agent-manager.service.js +222 -0
- package/dist/http/providers/agent-manager.service.js.map +1 -0
- package/dist/http/providers/agent-scanner.service.d.ts +9 -0
- package/dist/http/providers/agent-scanner.service.d.ts.map +1 -0
- package/dist/http/providers/agent-scanner.service.js +108 -0
- package/dist/http/providers/agent-scanner.service.js.map +1 -0
- package/dist/http/providers/providers.module.d.ts +3 -0
- package/dist/http/providers/providers.module.d.ts.map +1 -0
- package/dist/http/providers/providers.module.js +47 -0
- package/dist/http/providers/providers.module.js.map +1 -0
- package/dist/http/reload/hot-reload.service.d.ts +16 -0
- package/dist/http/reload/hot-reload.service.d.ts.map +1 -0
- package/dist/http/reload/hot-reload.service.js +79 -0
- package/dist/http/reload/hot-reload.service.js.map +1 -0
- package/dist/http/reload/reload.controller.d.ts +14 -0
- package/dist/http/reload/reload.controller.d.ts.map +1 -0
- package/dist/http/reload/reload.controller.js +50 -0
- package/dist/http/reload/reload.controller.js.map +1 -0
- package/dist/http/reload/reload.module.d.ts +3 -0
- package/dist/http/reload/reload.module.d.ts.map +1 -0
- package/dist/http/reload/reload.module.js +23 -0
- package/dist/http/reload/reload.module.js.map +1 -0
- package/dist/http/runtime-config.d.ts +22 -0
- package/dist/http/runtime-config.d.ts.map +1 -0
- package/dist/http/runtime-config.js +5 -0
- package/dist/http/runtime-config.js.map +1 -0
- package/dist/http/sessions/sessions.controller.d.ts +11 -0
- package/dist/http/sessions/sessions.controller.d.ts.map +1 -0
- package/dist/http/sessions/sessions.controller.js +116 -0
- package/dist/http/sessions/sessions.controller.js.map +1 -0
- package/dist/http/sessions/sessions.module.d.ts +3 -0
- package/dist/http/sessions/sessions.module.d.ts.map +1 -0
- package/dist/http/sessions/sessions.module.js +25 -0
- package/dist/http/sessions/sessions.module.js.map +1 -0
- package/dist/http/sessions/sessions.service.d.ts +54 -0
- package/dist/http/sessions/sessions.service.d.ts.map +1 -0
- package/dist/http/sessions/sessions.service.js +353 -0
- package/dist/http/sessions/sessions.service.js.map +1 -0
- package/dist/http/state/state.controller.d.ts +9 -0
- package/dist/http/state/state.controller.d.ts.map +1 -0
- package/dist/http/state/state.controller.js +76 -0
- package/dist/http/state/state.controller.js.map +1 -0
- package/dist/http/state/state.module.d.ts +3 -0
- package/dist/http/state/state.module.d.ts.map +1 -0
- package/dist/http/state/state.module.js +25 -0
- package/dist/http/state/state.module.js.map +1 -0
- package/dist/http/state/state.service.d.ts +9 -0
- package/dist/http/state/state.service.d.ts.map +1 -0
- package/dist/http/state/state.service.js +55 -0
- package/dist/http/state/state.service.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +25 -0
- package/dist/main.js.map +1 -0
- package/package.json +18 -12
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1187
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1171
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.WebCommand = void 0;
|
|
16
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
+
const nest_commander_1 = require("nest-commander");
|
|
18
|
+
const bootstrap_1 = require("../http/bootstrap");
|
|
19
|
+
let WebCommand = class WebCommand extends nest_commander_1.CommandRunner {
|
|
20
|
+
async run(_passedParams, options) {
|
|
21
|
+
const apiPort = options?.port ?? 8042;
|
|
22
|
+
const webPort = options?.webPort ?? 3000;
|
|
23
|
+
const host = options?.host ?? "localhost";
|
|
24
|
+
const useLocal = options?.local ?? false;
|
|
25
|
+
const webUrl = options?.webUrl ?? "https://adk-web.iqai.com";
|
|
26
|
+
console.log(chalk_1.default.blue("🌐 Starting ADK Web Interface..."));
|
|
27
|
+
// Start the API server first (quiet)
|
|
28
|
+
const server = await (0, bootstrap_1.startHttpServer)({
|
|
29
|
+
port: apiPort,
|
|
30
|
+
host,
|
|
31
|
+
agentsDir: options?.dir ?? process.cwd(),
|
|
32
|
+
quiet: true,
|
|
33
|
+
});
|
|
34
|
+
let webAppUrl;
|
|
35
|
+
if (useLocal) {
|
|
36
|
+
// Local development: assume web app is already running on webPort
|
|
37
|
+
if (apiPort === 8042) {
|
|
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
|
+
}
|
|
52
|
+
}
|
|
53
|
+
console.log(chalk_1.default.cyan(`🔗 Open this URL in your browser: ${webAppUrl}`));
|
|
54
|
+
console.log(chalk_1.default.gray(` API Server: http://${host}:${apiPort}`));
|
|
55
|
+
console.log(chalk_1.default.cyan("Press Ctrl+C to stop the API server"));
|
|
56
|
+
const cleanup = async () => {
|
|
57
|
+
console.log(chalk_1.default.yellow("\n🛑 Stopping API server..."));
|
|
58
|
+
await server.stop();
|
|
59
|
+
process.exit(0);
|
|
60
|
+
};
|
|
61
|
+
process.on("SIGINT", cleanup);
|
|
62
|
+
process.on("SIGTERM", cleanup);
|
|
63
|
+
// Keep the process running
|
|
64
|
+
await new Promise(() => { });
|
|
65
|
+
}
|
|
66
|
+
parsePort(val) {
|
|
67
|
+
return Number(val);
|
|
68
|
+
}
|
|
69
|
+
parseWebPort(val) {
|
|
70
|
+
return Number(val);
|
|
71
|
+
}
|
|
72
|
+
parseHost(val) {
|
|
73
|
+
return val;
|
|
74
|
+
}
|
|
75
|
+
parseDir(val) {
|
|
76
|
+
return val;
|
|
77
|
+
}
|
|
78
|
+
parseLocal() {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
parseWebUrl(val) {
|
|
82
|
+
return val;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.WebCommand = WebCommand;
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, nest_commander_1.Option)({
|
|
88
|
+
flags: "-p, --port <port>",
|
|
89
|
+
description: "Port for API server",
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [String]),
|
|
93
|
+
__metadata("design:returntype", Number)
|
|
94
|
+
], 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
|
+
__decorate([
|
|
105
|
+
(0, nest_commander_1.Option)({
|
|
106
|
+
flags: "-h, --host <host>",
|
|
107
|
+
description: "Host for servers",
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Function),
|
|
110
|
+
__metadata("design:paramtypes", [String]),
|
|
111
|
+
__metadata("design:returntype", String)
|
|
112
|
+
], WebCommand.prototype, "parseHost", null);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, nest_commander_1.Option)({
|
|
115
|
+
flags: "-d, --dir <directory>",
|
|
116
|
+
description: "Directory to scan for agents (default: current directory)",
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", [String]),
|
|
120
|
+
__metadata("design:returntype", String)
|
|
121
|
+
], 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
|
+
__decorate([
|
|
132
|
+
(0, nest_commander_1.Option)({
|
|
133
|
+
flags: "--web-url <url>",
|
|
134
|
+
description: "URL of the web application (used when not --local)",
|
|
135
|
+
}),
|
|
136
|
+
__metadata("design:type", Function),
|
|
137
|
+
__metadata("design:paramtypes", [String]),
|
|
138
|
+
__metadata("design:returntype", String)
|
|
139
|
+
], WebCommand.prototype, "parseWebUrl", null);
|
|
140
|
+
exports.WebCommand = WebCommand = __decorate([
|
|
141
|
+
(0, nest_commander_1.Command)({
|
|
142
|
+
name: "web",
|
|
143
|
+
description: "Start a web interface for testing agents",
|
|
144
|
+
})
|
|
145
|
+
], WebCommand);
|
|
146
|
+
//# sourceMappingURL=web.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.command.js","sourceRoot":"","sources":["../../src/cli/web.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,mDAAgE;AAChE,iDAAoD;AAe7C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,8BAAa;IAC5C,KAAK,CAAC,GAAG,CACR,aAAuB,EACvB,OAA2B;QAE3B,MAAM,OAAO,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC;QACtC,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC;QACzC,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,WAAW,CAAC;QAC1C,MAAM,QAAQ,GAAG,OAAO,EAAE,KAAK,IAAI,KAAK,CAAC;QACzC,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,0BAA0B,CAAC;QAE7D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAE5D,qCAAqC;QACrC,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAe,EAAC;YACpC,IAAI,EAAE,OAAO;YACb,IAAI;YACJ,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;YACxC,KAAK,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,IAAI,SAAiB,CAAC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"AAAA,eAAO,MAAM,MAAM;;;CAGT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/common/tokens.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACrB,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACL,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { BaseAgent, EnhancedRunner } from "@iqai/adk";
|
|
2
|
+
export interface Agent {
|
|
3
|
+
relativePath: string;
|
|
4
|
+
name: string;
|
|
5
|
+
absolutePath: string;
|
|
6
|
+
instance?: BaseAgent;
|
|
7
|
+
}
|
|
8
|
+
export interface LoadedAgent {
|
|
9
|
+
agent: BaseAgent;
|
|
10
|
+
runner: EnhancedRunner;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
appName: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ServerConfig {
|
|
16
|
+
agentsDir: string;
|
|
17
|
+
port: number;
|
|
18
|
+
host: string;
|
|
19
|
+
quiet: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AgentListResponse {
|
|
22
|
+
path: string;
|
|
23
|
+
name: string;
|
|
24
|
+
directory: string;
|
|
25
|
+
relativePath: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MessageRequest {
|
|
28
|
+
message: string;
|
|
29
|
+
attachments?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
data: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export interface MessageResponse {
|
|
36
|
+
response: string;
|
|
37
|
+
}
|
|
38
|
+
export interface MessagesResponse {
|
|
39
|
+
messages: Array<{
|
|
40
|
+
id: number;
|
|
41
|
+
type: "user" | "assistant";
|
|
42
|
+
content: string;
|
|
43
|
+
timestamp: string;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface SessionResponse {
|
|
47
|
+
id: string;
|
|
48
|
+
appName: string;
|
|
49
|
+
userId: string;
|
|
50
|
+
state: Record<string, any>;
|
|
51
|
+
eventCount: number;
|
|
52
|
+
lastUpdateTime: number;
|
|
53
|
+
createdAt: number;
|
|
54
|
+
}
|
|
55
|
+
export interface SessionsResponse {
|
|
56
|
+
sessions: SessionResponse[];
|
|
57
|
+
}
|
|
58
|
+
export interface CreateSessionRequest {
|
|
59
|
+
state?: Record<string, any>;
|
|
60
|
+
sessionId?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface EventsResponse {
|
|
63
|
+
events: Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
author: string;
|
|
66
|
+
timestamp: number;
|
|
67
|
+
content: any;
|
|
68
|
+
actions: any;
|
|
69
|
+
functionCalls: any[];
|
|
70
|
+
functionResponses: any[];
|
|
71
|
+
branch?: string;
|
|
72
|
+
isFinalResponse: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
totalCount: number;
|
|
75
|
+
}
|
|
76
|
+
export interface StateResponse {
|
|
77
|
+
agentState: Record<string, any>;
|
|
78
|
+
userState: Record<string, any>;
|
|
79
|
+
sessionState: Record<string, any>;
|
|
80
|
+
metadata: {
|
|
81
|
+
lastUpdated: number;
|
|
82
|
+
changeCount: number;
|
|
83
|
+
totalKeys: number;
|
|
84
|
+
sizeBytes: number;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export interface StateUpdateRequest {
|
|
88
|
+
path: string;
|
|
89
|
+
value: any;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,WAAW,KAAK;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,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
1
|
+
import "reflect-metadata";
|
|
2
|
+
import type { NestExpressApplication } from "@nestjs/platform-express";
|
|
3
|
+
import type { RuntimeConfig } from "./runtime-config";
|
|
4
|
+
export interface StartedHttpServer {
|
|
5
|
+
app: NestExpressApplication;
|
|
6
|
+
url: string;
|
|
7
|
+
stop: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Start a Nest Express HTTP server with the ADK controllers and providers.
|
|
11
|
+
* Mirrors previous Hono server endpoints:
|
|
12
|
+
* - GET /health
|
|
13
|
+
* - /api/agents ...
|
|
14
|
+
* - /api/agents/:id/sessions ...
|
|
15
|
+
*/
|
|
16
|
+
export declare function startHttpServer(config: RuntimeConfig): Promise<StartedHttpServer>;
|
|
17
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/http/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAkKtD,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,sBAAsB,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,aAAa,GACnB,OAAO,CAAC,iBAAiB,CAAC,CA4E5B"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startHttpServer = startHttpServer;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const core_1 = require("@nestjs/core");
|
|
8
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
9
|
+
const http_module_1 = require("./http.module");
|
|
10
|
+
const agent_manager_service_1 = require("./providers/agent-manager.service");
|
|
11
|
+
const hot_reload_service_1 = require("./reload/hot-reload.service");
|
|
12
|
+
// Reuse the same well-known skips used by AgentScanner
|
|
13
|
+
const DIRECTORIES_TO_SKIP = [
|
|
14
|
+
"node_modules",
|
|
15
|
+
".git",
|
|
16
|
+
".next",
|
|
17
|
+
"dist",
|
|
18
|
+
"build",
|
|
19
|
+
".turbo",
|
|
20
|
+
"coverage",
|
|
21
|
+
".vscode",
|
|
22
|
+
".idea",
|
|
23
|
+
];
|
|
24
|
+
function pathHasSkippedDir(p) {
|
|
25
|
+
const parts = p.split(node_path_1.sep).filter(Boolean);
|
|
26
|
+
return parts.some((part) => DIRECTORIES_TO_SKIP.includes(part));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Load simple .gitignore prefixes.
|
|
30
|
+
* For robustness without extra deps, we:
|
|
31
|
+
* - ignore blank and comment lines
|
|
32
|
+
* - skip complex globs (* ? [])
|
|
33
|
+
* - treat entries as path prefixes relative to repo root
|
|
34
|
+
*/
|
|
35
|
+
function loadGitignorePrefixes(rootDir) {
|
|
36
|
+
try {
|
|
37
|
+
const igPath = (0, node_path_1.resolve)(rootDir, ".gitignore");
|
|
38
|
+
if (!(0, node_fs_1.existsSync)(igPath))
|
|
39
|
+
return [];
|
|
40
|
+
const lines = (0, node_fs_1.readFileSync)(igPath, "utf8").split("\n");
|
|
41
|
+
const prefixes = [];
|
|
42
|
+
for (const raw of lines) {
|
|
43
|
+
const line = raw.trim();
|
|
44
|
+
if (!line || line.startsWith("#"))
|
|
45
|
+
continue;
|
|
46
|
+
if (/[?*\[\]]/.test(line))
|
|
47
|
+
continue; // skip complex glob lines
|
|
48
|
+
const normalized = line.replace(/\/+$/, "");
|
|
49
|
+
const abs = (0, node_path_1.resolve)(rootDir, normalized);
|
|
50
|
+
prefixes.push(abs + node_path_1.sep);
|
|
51
|
+
}
|
|
52
|
+
return prefixes;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function shouldIgnorePath(fullPath, prefixes) {
|
|
59
|
+
if (pathHasSkippedDir(fullPath))
|
|
60
|
+
return true;
|
|
61
|
+
for (const pref of prefixes) {
|
|
62
|
+
if (fullPath.startsWith(pref))
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Setup hot reload file watching with .gitignore filtering and well-known directory skips.
|
|
69
|
+
* Returns watcher/timeout references and a teardown function to close resources.
|
|
70
|
+
*/
|
|
71
|
+
function setupHotReload(agentManager, hotReload, config) {
|
|
72
|
+
const watchers = [];
|
|
73
|
+
const debouncers = [];
|
|
74
|
+
const shouldWatch = config.hotReload ?? process.env.NODE_ENV !== "production";
|
|
75
|
+
if (!shouldWatch) {
|
|
76
|
+
return { watchers, debouncers, teardownHotReload: () => { } };
|
|
77
|
+
}
|
|
78
|
+
const rootDir = process.cwd();
|
|
79
|
+
const gitignorePrefixes = loadGitignorePrefixes(rootDir);
|
|
80
|
+
const rawPaths = Array.isArray(config.watchPaths) && config.watchPaths.length > 0
|
|
81
|
+
? config.watchPaths
|
|
82
|
+
: [rootDir];
|
|
83
|
+
const paths = rawPaths.filter(Boolean).map((p) => (0, node_path_1.resolve)(p));
|
|
84
|
+
for (const p of paths) {
|
|
85
|
+
try {
|
|
86
|
+
const watcher = (0, node_fs_1.watch)(p,
|
|
87
|
+
// recursive is supported on macOS and Windows; best-effort on others
|
|
88
|
+
{ recursive: true }, (_event, filename) => {
|
|
89
|
+
// Filter out ignored paths early
|
|
90
|
+
const fullPath = typeof filename === "string" ? (0, node_path_1.resolve)(p, filename) : p;
|
|
91
|
+
if (shouldIgnorePath(fullPath, gitignorePrefixes)) {
|
|
92
|
+
if (!config.quiet && process.env.ADK_DEBUG_NEST === "1") {
|
|
93
|
+
console.log(`[hot-reload] Ignored change in ${fullPath}`);
|
|
94
|
+
}
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// Simple global debounce: clear pending reloads and schedule a new one
|
|
98
|
+
while (debouncers.length) {
|
|
99
|
+
const t = debouncers.pop();
|
|
100
|
+
if (t)
|
|
101
|
+
clearTimeout(t);
|
|
102
|
+
}
|
|
103
|
+
const t = setTimeout(async () => {
|
|
104
|
+
try {
|
|
105
|
+
// Clear running agents so next use reloads fresh code, then rescan
|
|
106
|
+
agentManager.stopAllAgents();
|
|
107
|
+
agentManager.scanAgents(config.agentsDir);
|
|
108
|
+
if (!config.quiet && process.env.ADK_DEBUG_NEST === "1") {
|
|
109
|
+
console.log(`[hot-reload] Reloaded agents after change in ${filename ?? p}`);
|
|
110
|
+
}
|
|
111
|
+
// Notify connected clients (web UI) to refresh
|
|
112
|
+
try {
|
|
113
|
+
hotReload?.broadcast(typeof filename === "string" ? filename : null);
|
|
114
|
+
}
|
|
115
|
+
catch { }
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
console.error("[hot-reload] Error during reload:", e);
|
|
119
|
+
}
|
|
120
|
+
}, 300);
|
|
121
|
+
debouncers.push(t);
|
|
122
|
+
});
|
|
123
|
+
watchers.push(watcher);
|
|
124
|
+
if (!config.quiet && process.env.ADK_DEBUG_NEST === "1") {
|
|
125
|
+
console.log(`[hot-reload] Watching ${p}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
console.warn(`[hot-reload] Failed to watch ${p}: ${e instanceof Error ? e.message : String(e)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const teardownHotReload = () => {
|
|
133
|
+
for (const t of debouncers) {
|
|
134
|
+
clearTimeout(t);
|
|
135
|
+
}
|
|
136
|
+
for (const w of watchers) {
|
|
137
|
+
try {
|
|
138
|
+
w.close();
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
hotReload?.closeAll();
|
|
144
|
+
}
|
|
145
|
+
catch { }
|
|
146
|
+
};
|
|
147
|
+
return { watchers, debouncers, teardownHotReload };
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Start a Nest Express HTTP server with the ADK controllers and providers.
|
|
151
|
+
* Mirrors previous Hono server endpoints:
|
|
152
|
+
* - GET /health
|
|
153
|
+
* - /api/agents ...
|
|
154
|
+
* - /api/agents/:id/sessions ...
|
|
155
|
+
*/
|
|
156
|
+
async function startHttpServer(config) {
|
|
157
|
+
const app = await core_1.NestFactory.create(http_module_1.HttpModule.register(config), {
|
|
158
|
+
logger: process.env.ADK_DEBUG_NEST === "1"
|
|
159
|
+
? ["log", "error", "warn", "debug", "verbose"]
|
|
160
|
+
: ["error", "warn"],
|
|
161
|
+
});
|
|
162
|
+
// CORS parity with previous Hono app.use("/*", cors())
|
|
163
|
+
app.enableCors({
|
|
164
|
+
origin: true,
|
|
165
|
+
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
166
|
+
allowedHeaders: ["Content-Type", "Authorization"],
|
|
167
|
+
});
|
|
168
|
+
// Configure body size limits using NestJS methods
|
|
169
|
+
const bodyLimit = process.env.ADK_HTTP_BODY_LIMIT || "25mb";
|
|
170
|
+
app.useBodyParser("json", { limit: bodyLimit });
|
|
171
|
+
app.useBodyParser("urlencoded", { limit: bodyLimit, extended: true });
|
|
172
|
+
// Initial agent scan (parity with ADKServer constructor)
|
|
173
|
+
const agentManager = app.get(agent_manager_service_1.AgentManager, { strict: false });
|
|
174
|
+
const hotReload = app.get(hot_reload_service_1.HotReloadService, { strict: false });
|
|
175
|
+
agentManager.scanAgents(config.agentsDir);
|
|
176
|
+
// Swagger / OpenAPI setup
|
|
177
|
+
const enableSwagger = config.swagger ?? process.env.NODE_ENV !== "production";
|
|
178
|
+
if (enableSwagger) {
|
|
179
|
+
const builder = new swagger_1.DocumentBuilder()
|
|
180
|
+
.setTitle("ADK HTTP API")
|
|
181
|
+
.setDescription("REST endpoints for managing and interacting with ADK agents")
|
|
182
|
+
.setVersion("1.0.0")
|
|
183
|
+
.addTag("agents")
|
|
184
|
+
.addTag("sessions")
|
|
185
|
+
.addTag("events")
|
|
186
|
+
.addTag("state")
|
|
187
|
+
.addTag("messaging")
|
|
188
|
+
.addTag("health")
|
|
189
|
+
.build();
|
|
190
|
+
const document = swagger_1.SwaggerModule.createDocument(app, builder, {
|
|
191
|
+
deepScanRoutes: true,
|
|
192
|
+
});
|
|
193
|
+
swagger_1.SwaggerModule.setup("docs", app, document, {
|
|
194
|
+
customSiteTitle: "ADK API Docs",
|
|
195
|
+
jsonDocumentUrl: "/openapi.json",
|
|
196
|
+
});
|
|
197
|
+
if (!config.quiet && process.env.ADK_DEBUG_NEST === "1") {
|
|
198
|
+
console.log("[openapi] Docs available at /docs (json: /openapi.json)");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// Hot reloading: setup via helper for readability and testability
|
|
202
|
+
const { teardownHotReload } = setupHotReload(agentManager, hotReload, config);
|
|
203
|
+
await app.listen(config.port, config.host);
|
|
204
|
+
const url = `http://${config.host}:${config.port}`;
|
|
205
|
+
const stop = async () => {
|
|
206
|
+
try {
|
|
207
|
+
// Graceful shutdown: stop all agents first
|
|
208
|
+
agentManager.stopAllAgents();
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
// Tear down hot reload resources and close app
|
|
212
|
+
try {
|
|
213
|
+
teardownHotReload();
|
|
214
|
+
}
|
|
215
|
+
catch { }
|
|
216
|
+
await app.close();
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
return { app, url, stop };
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/http/bootstrap.ts"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AC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,UAAU,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;IAEnD,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;QACvB,IAAI,CAAC;YACJ,2CAA2C;YAC3C,YAAY,CAAC,aAAa,EAAE,CAAC;QAC9B,CAAC;gBAAS,CAAC;YACV,+CAA+C;YAC/C,IAAI,CAAC;gBACJ,iBAAiB,EAAE,CAAC;YACrB,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACF,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.module.d.ts","sourceRoot":"","sources":["../../../src/http/config/config.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAEa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CAWrD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var ConfigModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConfigModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const tokens_1 = require("../../common/tokens");
|
|
13
|
+
const runtime_config_1 = require("../runtime-config");
|
|
14
|
+
let ConfigModule = ConfigModule_1 = class ConfigModule {
|
|
15
|
+
static register(config) {
|
|
16
|
+
return {
|
|
17
|
+
module: ConfigModule_1,
|
|
18
|
+
providers: [
|
|
19
|
+
{ provide: runtime_config_1.RUNTIME_CONFIG, useValue: config },
|
|
20
|
+
{ provide: tokens_1.TOKENS.AGENTS_DIR, useValue: config.agentsDir },
|
|
21
|
+
{ provide: tokens_1.TOKENS.QUIET, useValue: config.quiet },
|
|
22
|
+
],
|
|
23
|
+
exports: [runtime_config_1.RUNTIME_CONFIG, tokens_1.TOKENS.AGENTS_DIR, tokens_1.TOKENS.QUIET],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.ConfigModule = ConfigModule;
|
|
28
|
+
exports.ConfigModule = ConfigModule = ConfigModule_1 = __decorate([
|
|
29
|
+
(0, common_1.Global)(),
|
|
30
|
+
(0, common_1.Module)({})
|
|
31
|
+
], ConfigModule);
|
|
32
|
+
//# sourceMappingURL=config.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../../src/http/config/config.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoE;AACpE,gDAA6C;AAC7C,sDAAuE;AAIhE,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAqB;QACpC,OAAO;YACN,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE;gBACV,EAAE,OAAO,EAAE,+BAAc,EAAE,QAAQ,EAAE,MAAM,EAAE;gBAC7C,EAAE,OAAO,EAAE,eAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE;gBAC1D,EAAE,OAAO,EAAE,eAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE;aACjD;YACD,OAAO,EAAE,CAAC,+BAAc,EAAE,eAAM,CAAC,UAAU,EAAE,eAAM,CAAC,KAAK,CAAC;SAC1D,CAAC;IACH,CAAC;CACD,CAAA;AAZY,oCAAY;uBAAZ,YAAY;IAFxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAYxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentListResponse } from "../../common/types";
|
|
2
|
+
import { AgentManager } from "../providers/agent-manager.service";
|
|
3
|
+
export declare class AgentsController {
|
|
4
|
+
private readonly agentManager;
|
|
5
|
+
constructor(agentManager: AgentManager);
|
|
6
|
+
listAgents(): {
|
|
7
|
+
agents: AgentListResponse[];
|
|
8
|
+
};
|
|
9
|
+
refreshAgents(): {
|
|
10
|
+
agents: AgentListResponse[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=agents.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.controller.d.ts","sourceRoot":"","sources":["../../../src/http/discovery/agents.controller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAWlE,qBAEa,gBAAgB;IAEL,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAUlE,UAAU,IAAI;QAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAY7C,aAAa,IAAI;QAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;KAAE;CAMhD"}
|