@dudousxd/nestjs-agent-dashboard 0.7.0 → 0.8.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/dist/client/agent-client.d.ts +48 -0
- package/dist/client/agent-client.d.ts.map +1 -1
- package/dist/client/agent-client.js +23 -0
- package/dist/client/agent-client.js.map +1 -1
- package/dist/server/index.cjs +282 -57
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +28 -1
- package/dist/server/index.d.ts +28 -1
- package/dist/server/index.js +227 -2
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/index-C42SW8IV.js +1 -0
- package/dist/spa/assets/index-DMBWMAsE.css +1 -0
- package/dist/spa/assets/index-DZVPxvtJ.js +49 -0
- package/dist/spa/assets/{preview-A3jHlGra.js → preview-DhDnTjWH.js} +1 -1
- package/dist/spa/index.html +3 -3
- package/dist/spa/preview.html +3 -3
- package/package.json +3 -3
- package/dist/spa/assets/index-BjIcXlBO.js +0 -1
- package/dist/spa/assets/index-CES4RqI4.js +0 -49
- package/dist/spa/assets/index-CVcgbps5.css +0 -1
package/dist/server/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(index_exports);
|
|
42
42
|
|
|
43
43
|
// src/server/agent-api.controller.ts
|
|
44
|
-
var
|
|
44
|
+
var import_common5 = require("@nestjs/common");
|
|
45
45
|
|
|
46
46
|
// src/server/dashboard.service.ts
|
|
47
47
|
var import_node_diagnostics_channel = require("diagnostics_channel");
|
|
@@ -209,6 +209,14 @@ var DashboardService = class {
|
|
|
209
209
|
recentToolCalls(limit) {
|
|
210
210
|
return this.queries.recentToolCalls(limit);
|
|
211
211
|
}
|
|
212
|
+
/** Paged, filterable tool calls for the Runs & tools activity table. */
|
|
213
|
+
toolCallsPage(query) {
|
|
214
|
+
return this.queries.toolCallsPage(query);
|
|
215
|
+
}
|
|
216
|
+
/** Paged, filterable runs for the Reliability recent-runs table. */
|
|
217
|
+
runsPage(query) {
|
|
218
|
+
return this.queries.runsPage(query);
|
|
219
|
+
}
|
|
212
220
|
/** Tool calls sitting `pending_approval`, oldest first, for the cross-thread approvals inbox. */
|
|
213
221
|
pendingApprovals(limit) {
|
|
214
222
|
return this.queries.pendingApprovals(limit);
|
|
@@ -250,6 +258,18 @@ var DashboardService = class {
|
|
|
250
258
|
return this.withActorLabels(rows);
|
|
251
259
|
}
|
|
252
260
|
/**
|
|
261
|
+
* Paged, filterable threads for the Runs & tools threads table — actor-labeled the same way
|
|
262
|
+
* {@link recentThreads} is.
|
|
263
|
+
*/
|
|
264
|
+
async threadsPage(query) {
|
|
265
|
+
const page = await this.queries.threadsPage(query);
|
|
266
|
+
const rows = await this.withActorLabels(page.rows);
|
|
267
|
+
return {
|
|
268
|
+
...page,
|
|
269
|
+
rows
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
253
273
|
* Decorate actor-scoped rows with `actorLabel`, batching the distinct `actorRef`s into ONE
|
|
254
274
|
* {@link ActorDirectory.resolveDisplay} call per response. `null` for every row when no directory
|
|
255
275
|
* is bound, or for a ref the directory didn't resolve.
|
|
@@ -340,6 +360,127 @@ DashboardService = _ts_decorate([
|
|
|
340
360
|
])
|
|
341
361
|
], DashboardService);
|
|
342
362
|
|
|
363
|
+
// src/server/parse-page-query.ts
|
|
364
|
+
var import_common4 = require("@nestjs/common");
|
|
365
|
+
var ISO_DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
366
|
+
function parsePageNumber(value) {
|
|
367
|
+
const parsed = value === void 0 ? Number.NaN : Number.parseInt(value, 10);
|
|
368
|
+
if (!Number.isFinite(parsed) || parsed < 1) return 1;
|
|
369
|
+
return parsed;
|
|
370
|
+
}
|
|
371
|
+
__name(parsePageNumber, "parsePageNumber");
|
|
372
|
+
function assertKnownFields(raw, allowed) {
|
|
373
|
+
for (const field of Object.keys(raw)) {
|
|
374
|
+
if (!allowed.includes(field)) {
|
|
375
|
+
throw new import_common4.BadRequestException(`Unknown where field "${field}".`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
__name(assertKnownFields, "assertKnownFields");
|
|
380
|
+
function assertDayFields(raw, dayFields) {
|
|
381
|
+
for (const field of dayFields) {
|
|
382
|
+
const value = raw[field];
|
|
383
|
+
if (value !== void 0 && !ISO_DAY.test(value)) {
|
|
384
|
+
throw new import_common4.BadRequestException(`"where[${field}]" must be YYYY-MM-DD.`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
__name(assertDayFields, "assertDayFields");
|
|
389
|
+
var DAY_FIELDS = [
|
|
390
|
+
"fromDay",
|
|
391
|
+
"toDay"
|
|
392
|
+
];
|
|
393
|
+
var TOOL_CALL_WHERE_FIELDS = [
|
|
394
|
+
"toolName",
|
|
395
|
+
"toolType",
|
|
396
|
+
"status",
|
|
397
|
+
"threadId",
|
|
398
|
+
"fromDay",
|
|
399
|
+
"toDay"
|
|
400
|
+
];
|
|
401
|
+
function parseToolCallWhere(raw) {
|
|
402
|
+
if (raw === void 0 || Object.keys(raw).length === 0) return void 0;
|
|
403
|
+
assertKnownFields(raw, TOOL_CALL_WHERE_FIELDS);
|
|
404
|
+
assertDayFields(raw, DAY_FIELDS);
|
|
405
|
+
return {
|
|
406
|
+
...raw.toolName !== void 0 ? {
|
|
407
|
+
toolName: raw.toolName
|
|
408
|
+
} : {},
|
|
409
|
+
...raw.toolType !== void 0 ? {
|
|
410
|
+
toolType: raw.toolType
|
|
411
|
+
} : {},
|
|
412
|
+
...raw.status !== void 0 ? {
|
|
413
|
+
status: raw.status
|
|
414
|
+
} : {},
|
|
415
|
+
...raw.threadId !== void 0 ? {
|
|
416
|
+
threadId: raw.threadId
|
|
417
|
+
} : {},
|
|
418
|
+
...raw.fromDay !== void 0 ? {
|
|
419
|
+
fromDay: raw.fromDay
|
|
420
|
+
} : {},
|
|
421
|
+
...raw.toDay !== void 0 ? {
|
|
422
|
+
toDay: raw.toDay
|
|
423
|
+
} : {}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
__name(parseToolCallWhere, "parseToolCallWhere");
|
|
427
|
+
var THREAD_WHERE_FIELDS = [
|
|
428
|
+
"actorRef",
|
|
429
|
+
"title",
|
|
430
|
+
"fromDay",
|
|
431
|
+
"toDay"
|
|
432
|
+
];
|
|
433
|
+
function parseThreadWhere(raw) {
|
|
434
|
+
if (raw === void 0 || Object.keys(raw).length === 0) return void 0;
|
|
435
|
+
assertKnownFields(raw, THREAD_WHERE_FIELDS);
|
|
436
|
+
assertDayFields(raw, DAY_FIELDS);
|
|
437
|
+
return {
|
|
438
|
+
...raw.actorRef !== void 0 ? {
|
|
439
|
+
actorRef: raw.actorRef
|
|
440
|
+
} : {},
|
|
441
|
+
...raw.title !== void 0 ? {
|
|
442
|
+
title: raw.title
|
|
443
|
+
} : {},
|
|
444
|
+
...raw.fromDay !== void 0 ? {
|
|
445
|
+
fromDay: raw.fromDay
|
|
446
|
+
} : {},
|
|
447
|
+
...raw.toDay !== void 0 ? {
|
|
448
|
+
toDay: raw.toDay
|
|
449
|
+
} : {}
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
__name(parseThreadWhere, "parseThreadWhere");
|
|
453
|
+
var RUN_WHERE_FIELDS = [
|
|
454
|
+
"agentName",
|
|
455
|
+
"status",
|
|
456
|
+
"errorCode",
|
|
457
|
+
"fromDay",
|
|
458
|
+
"toDay"
|
|
459
|
+
];
|
|
460
|
+
function parseRunWhere(raw) {
|
|
461
|
+
if (raw === void 0 || Object.keys(raw).length === 0) return void 0;
|
|
462
|
+
assertKnownFields(raw, RUN_WHERE_FIELDS);
|
|
463
|
+
assertDayFields(raw, DAY_FIELDS);
|
|
464
|
+
return {
|
|
465
|
+
...raw.agentName !== void 0 ? {
|
|
466
|
+
agentName: raw.agentName
|
|
467
|
+
} : {},
|
|
468
|
+
...raw.status !== void 0 ? {
|
|
469
|
+
status: raw.status
|
|
470
|
+
} : {},
|
|
471
|
+
...raw.errorCode !== void 0 ? {
|
|
472
|
+
errorCode: raw.errorCode
|
|
473
|
+
} : {},
|
|
474
|
+
...raw.fromDay !== void 0 ? {
|
|
475
|
+
fromDay: raw.fromDay
|
|
476
|
+
} : {},
|
|
477
|
+
...raw.toDay !== void 0 ? {
|
|
478
|
+
toDay: raw.toDay
|
|
479
|
+
} : {}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
__name(parseRunWhere, "parseRunWhere");
|
|
483
|
+
|
|
343
484
|
// src/server/agent-api.controller.ts
|
|
344
485
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
345
486
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -359,13 +500,13 @@ function _ts_param2(paramIndex, decorator) {
|
|
|
359
500
|
}
|
|
360
501
|
__name(_ts_param2, "_ts_param");
|
|
361
502
|
var DAY_MS = 864e5;
|
|
362
|
-
var
|
|
503
|
+
var ISO_DAY2 = /^\d{4}-\d{2}-\d{2}$/;
|
|
363
504
|
function utcDay(daysAgo) {
|
|
364
505
|
return new Date(Date.now() - daysAgo * DAY_MS).toISOString().slice(0, 10);
|
|
365
506
|
}
|
|
366
507
|
__name(utcDay, "utcDay");
|
|
367
508
|
function dayOr(value, fallback) {
|
|
368
|
-
return value !== void 0 &&
|
|
509
|
+
return value !== void 0 && ISO_DAY2.test(value) ? value : fallback;
|
|
369
510
|
}
|
|
370
511
|
__name(dayOr, "dayOr");
|
|
371
512
|
function resolveRange(from, to) {
|
|
@@ -409,10 +550,40 @@ var AgentApiController = class {
|
|
|
409
550
|
runs(limit) {
|
|
410
551
|
return this.dashboard.recentRuns(parseLimit(limit, 50));
|
|
411
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Paged, filterable runs for the Reliability recent-runs table. `page` (default 1), `limit`
|
|
555
|
+
* (default 25, max 200), and `where[agentName]`/`where[status]`/`where[errorCode]`/
|
|
556
|
+
* `where[fromDay]`/`where[toDay]` (`YYYY-MM-DD`) — an unknown `where` field 400s naming it.
|
|
557
|
+
*/
|
|
558
|
+
runsPage(page, limit, where) {
|
|
559
|
+
const parsedWhere = parseRunWhere(where);
|
|
560
|
+
return this.dashboard.runsPage({
|
|
561
|
+
page: parsePageNumber(page),
|
|
562
|
+
pageSize: parseLimit(limit, 25),
|
|
563
|
+
...parsedWhere !== void 0 ? {
|
|
564
|
+
where: parsedWhere
|
|
565
|
+
} : {}
|
|
566
|
+
});
|
|
567
|
+
}
|
|
412
568
|
/** Most recent tool calls (default 50, max 200) for the activity feed. */
|
|
413
569
|
toolCalls(limit) {
|
|
414
570
|
return this.dashboard.recentToolCalls(parseLimit(limit, 50));
|
|
415
571
|
}
|
|
572
|
+
/**
|
|
573
|
+
* Paged, filterable tool calls for the Runs & tools activity table. `page` (default 1), `limit`
|
|
574
|
+
* (default 25, max 200), and `where[toolName]`/`where[toolType]`/`where[status]`/`where[threadId]`/
|
|
575
|
+
* `where[fromDay]`/`where[toDay]` (`YYYY-MM-DD`) — an unknown `where` field 400s naming it.
|
|
576
|
+
*/
|
|
577
|
+
toolCallsPage(page, limit, where) {
|
|
578
|
+
const parsedWhere = parseToolCallWhere(where);
|
|
579
|
+
return this.dashboard.toolCallsPage({
|
|
580
|
+
page: parsePageNumber(page),
|
|
581
|
+
pageSize: parseLimit(limit, 25),
|
|
582
|
+
...parsedWhere !== void 0 ? {
|
|
583
|
+
where: parsedWhere
|
|
584
|
+
} : {}
|
|
585
|
+
});
|
|
586
|
+
}
|
|
416
587
|
/** Tool calls sitting `pending_approval` (default 50, max 200), oldest first — the approvals inbox. */
|
|
417
588
|
approvals(limit) {
|
|
418
589
|
return this.dashboard.pendingApprovals(parseLimit(limit, 50));
|
|
@@ -454,6 +625,21 @@ var AgentApiController = class {
|
|
|
454
625
|
return this.dashboard.recentThreads(parseLimit(limit, 50));
|
|
455
626
|
}
|
|
456
627
|
/**
|
|
628
|
+
* Paged, filterable threads for the Runs & tools threads table. `page` (default 1), `limit`
|
|
629
|
+
* (default 25, max 200), and `where[actorRef]`/`where[title]` (case-insensitive substring)/
|
|
630
|
+
* `where[fromDay]`/`where[toDay]` (`YYYY-MM-DD`) — an unknown `where` field 400s naming it.
|
|
631
|
+
*/
|
|
632
|
+
threadsPage(page, limit, where) {
|
|
633
|
+
const parsedWhere = parseThreadWhere(where);
|
|
634
|
+
return this.dashboard.threadsPage({
|
|
635
|
+
page: parsePageNumber(page),
|
|
636
|
+
pageSize: parseLimit(limit, 25),
|
|
637
|
+
...parsedWhere !== void 0 ? {
|
|
638
|
+
where: parsedWhere
|
|
639
|
+
} : {}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
457
643
|
* Current price row per model, for the pricing tab. 501s (via `DashboardService.listPrices`) when
|
|
458
644
|
* no `AGENT_PRICING_STORE` is bound.
|
|
459
645
|
*/
|
|
@@ -474,9 +660,9 @@ var AgentApiController = class {
|
|
|
474
660
|
}
|
|
475
661
|
};
|
|
476
662
|
_ts_decorate2([
|
|
477
|
-
(0,
|
|
478
|
-
_ts_param2(0, (0,
|
|
479
|
-
_ts_param2(1, (0,
|
|
663
|
+
(0, import_common5.Get)("spend"),
|
|
664
|
+
_ts_param2(0, (0, import_common5.Query)("from")),
|
|
665
|
+
_ts_param2(1, (0, import_common5.Query)("to")),
|
|
480
666
|
_ts_metadata2("design:type", Function),
|
|
481
667
|
_ts_metadata2("design:paramtypes", [
|
|
482
668
|
String,
|
|
@@ -485,10 +671,10 @@ _ts_decorate2([
|
|
|
485
671
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
486
672
|
], AgentApiController.prototype, "spend", null);
|
|
487
673
|
_ts_decorate2([
|
|
488
|
-
(0,
|
|
489
|
-
_ts_param2(0, (0,
|
|
490
|
-
_ts_param2(1, (0,
|
|
491
|
-
_ts_param2(2, (0,
|
|
674
|
+
(0, import_common5.Get)("top-threads"),
|
|
675
|
+
_ts_param2(0, (0, import_common5.Query)("from")),
|
|
676
|
+
_ts_param2(1, (0, import_common5.Query)("to")),
|
|
677
|
+
_ts_param2(2, (0, import_common5.Query)("limit")),
|
|
492
678
|
_ts_metadata2("design:type", Function),
|
|
493
679
|
_ts_metadata2("design:paramtypes", [
|
|
494
680
|
String,
|
|
@@ -498,9 +684,9 @@ _ts_decorate2([
|
|
|
498
684
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
499
685
|
], AgentApiController.prototype, "topThreads", null);
|
|
500
686
|
_ts_decorate2([
|
|
501
|
-
(0,
|
|
502
|
-
_ts_param2(0, (0,
|
|
503
|
-
_ts_param2(1, (0,
|
|
687
|
+
(0, import_common5.Get)("reliability"),
|
|
688
|
+
_ts_param2(0, (0, import_common5.Query)("from")),
|
|
689
|
+
_ts_param2(1, (0, import_common5.Query)("to")),
|
|
504
690
|
_ts_metadata2("design:type", Function),
|
|
505
691
|
_ts_metadata2("design:paramtypes", [
|
|
506
692
|
String,
|
|
@@ -509,8 +695,8 @@ _ts_decorate2([
|
|
|
509
695
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
510
696
|
], AgentApiController.prototype, "reliability", null);
|
|
511
697
|
_ts_decorate2([
|
|
512
|
-
(0,
|
|
513
|
-
_ts_param2(0, (0,
|
|
698
|
+
(0, import_common5.Get)("runs"),
|
|
699
|
+
_ts_param2(0, (0, import_common5.Query)("limit")),
|
|
514
700
|
_ts_metadata2("design:type", Function),
|
|
515
701
|
_ts_metadata2("design:paramtypes", [
|
|
516
702
|
String
|
|
@@ -518,8 +704,21 @@ _ts_decorate2([
|
|
|
518
704
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
519
705
|
], AgentApiController.prototype, "runs", null);
|
|
520
706
|
_ts_decorate2([
|
|
521
|
-
(0,
|
|
522
|
-
_ts_param2(0, (0,
|
|
707
|
+
(0, import_common5.Get)("runs-page"),
|
|
708
|
+
_ts_param2(0, (0, import_common5.Query)("page")),
|
|
709
|
+
_ts_param2(1, (0, import_common5.Query)("limit")),
|
|
710
|
+
_ts_param2(2, (0, import_common5.Query)("where")),
|
|
711
|
+
_ts_metadata2("design:type", Function),
|
|
712
|
+
_ts_metadata2("design:paramtypes", [
|
|
713
|
+
String,
|
|
714
|
+
String,
|
|
715
|
+
typeof Record === "undefined" ? Object : Record
|
|
716
|
+
]),
|
|
717
|
+
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
718
|
+
], AgentApiController.prototype, "runsPage", null);
|
|
719
|
+
_ts_decorate2([
|
|
720
|
+
(0, import_common5.Get)("tool-calls"),
|
|
721
|
+
_ts_param2(0, (0, import_common5.Query)("limit")),
|
|
523
722
|
_ts_metadata2("design:type", Function),
|
|
524
723
|
_ts_metadata2("design:paramtypes", [
|
|
525
724
|
String
|
|
@@ -527,8 +726,21 @@ _ts_decorate2([
|
|
|
527
726
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
528
727
|
], AgentApiController.prototype, "toolCalls", null);
|
|
529
728
|
_ts_decorate2([
|
|
530
|
-
(0,
|
|
531
|
-
_ts_param2(0, (0,
|
|
729
|
+
(0, import_common5.Get)("tool-calls-page"),
|
|
730
|
+
_ts_param2(0, (0, import_common5.Query)("page")),
|
|
731
|
+
_ts_param2(1, (0, import_common5.Query)("limit")),
|
|
732
|
+
_ts_param2(2, (0, import_common5.Query)("where")),
|
|
733
|
+
_ts_metadata2("design:type", Function),
|
|
734
|
+
_ts_metadata2("design:paramtypes", [
|
|
735
|
+
String,
|
|
736
|
+
String,
|
|
737
|
+
typeof Record === "undefined" ? Object : Record
|
|
738
|
+
]),
|
|
739
|
+
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
740
|
+
], AgentApiController.prototype, "toolCallsPage", null);
|
|
741
|
+
_ts_decorate2([
|
|
742
|
+
(0, import_common5.Get)("approvals"),
|
|
743
|
+
_ts_param2(0, (0, import_common5.Query)("limit")),
|
|
532
744
|
_ts_metadata2("design:type", Function),
|
|
533
745
|
_ts_metadata2("design:paramtypes", [
|
|
534
746
|
String
|
|
@@ -536,11 +748,11 @@ _ts_decorate2([
|
|
|
536
748
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
537
749
|
], AgentApiController.prototype, "approvals", null);
|
|
538
750
|
_ts_decorate2([
|
|
539
|
-
(0,
|
|
540
|
-
(0,
|
|
541
|
-
_ts_param2(0, (0,
|
|
542
|
-
_ts_param2(1, (0,
|
|
543
|
-
_ts_param2(2, (0,
|
|
751
|
+
(0, import_common5.Post)("approvals/:toolCallId"),
|
|
752
|
+
(0, import_common5.HttpCode)(204),
|
|
753
|
+
_ts_param2(0, (0, import_common5.Param)("toolCallId")),
|
|
754
|
+
_ts_param2(1, (0, import_common5.Body)()),
|
|
755
|
+
_ts_param2(2, (0, import_common5.Req)()),
|
|
544
756
|
_ts_metadata2("design:type", Function),
|
|
545
757
|
_ts_metadata2("design:paramtypes", [
|
|
546
758
|
String,
|
|
@@ -550,9 +762,9 @@ _ts_decorate2([
|
|
|
550
762
|
_ts_metadata2("design:returntype", Promise)
|
|
551
763
|
], AgentApiController.prototype, "decideApproval", null);
|
|
552
764
|
_ts_decorate2([
|
|
553
|
-
(0,
|
|
554
|
-
_ts_param2(0, (0,
|
|
555
|
-
_ts_param2(1, (0,
|
|
765
|
+
(0, import_common5.Get)("tools"),
|
|
766
|
+
_ts_param2(0, (0, import_common5.Query)("from")),
|
|
767
|
+
_ts_param2(1, (0, import_common5.Query)("to")),
|
|
556
768
|
_ts_metadata2("design:type", Function),
|
|
557
769
|
_ts_metadata2("design:paramtypes", [
|
|
558
770
|
String,
|
|
@@ -561,8 +773,8 @@ _ts_decorate2([
|
|
|
561
773
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
562
774
|
], AgentApiController.prototype, "tools", null);
|
|
563
775
|
_ts_decorate2([
|
|
564
|
-
(0,
|
|
565
|
-
_ts_param2(0, (0,
|
|
776
|
+
(0, import_common5.Get)("threads"),
|
|
777
|
+
_ts_param2(0, (0, import_common5.Query)("limit")),
|
|
566
778
|
_ts_metadata2("design:type", Function),
|
|
567
779
|
_ts_metadata2("design:paramtypes", [
|
|
568
780
|
String
|
|
@@ -570,14 +782,27 @@ _ts_decorate2([
|
|
|
570
782
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
571
783
|
], AgentApiController.prototype, "threads", null);
|
|
572
784
|
_ts_decorate2([
|
|
573
|
-
(0,
|
|
785
|
+
(0, import_common5.Get)("threads-page"),
|
|
786
|
+
_ts_param2(0, (0, import_common5.Query)("page")),
|
|
787
|
+
_ts_param2(1, (0, import_common5.Query)("limit")),
|
|
788
|
+
_ts_param2(2, (0, import_common5.Query)("where")),
|
|
789
|
+
_ts_metadata2("design:type", Function),
|
|
790
|
+
_ts_metadata2("design:paramtypes", [
|
|
791
|
+
String,
|
|
792
|
+
String,
|
|
793
|
+
typeof Record === "undefined" ? Object : Record
|
|
794
|
+
]),
|
|
795
|
+
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
796
|
+
], AgentApiController.prototype, "threadsPage", null);
|
|
797
|
+
_ts_decorate2([
|
|
798
|
+
(0, import_common5.Get)("pricing"),
|
|
574
799
|
_ts_metadata2("design:type", Function),
|
|
575
800
|
_ts_metadata2("design:paramtypes", []),
|
|
576
801
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
577
802
|
], AgentApiController.prototype, "listPrices", null);
|
|
578
803
|
_ts_decorate2([
|
|
579
|
-
(0,
|
|
580
|
-
_ts_param2(0, (0,
|
|
804
|
+
(0, import_common5.Post)("pricing"),
|
|
805
|
+
_ts_param2(0, (0, import_common5.Body)()),
|
|
581
806
|
_ts_metadata2("design:type", Function),
|
|
582
807
|
_ts_metadata2("design:paramtypes", [
|
|
583
808
|
Object
|
|
@@ -585,16 +810,16 @@ _ts_decorate2([
|
|
|
585
810
|
_ts_metadata2("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
586
811
|
], AgentApiController.prototype, "upsertPrice", null);
|
|
587
812
|
_ts_decorate2([
|
|
588
|
-
(0,
|
|
813
|
+
(0, import_common5.Sse)("stream"),
|
|
589
814
|
_ts_metadata2("design:type", Function),
|
|
590
815
|
_ts_metadata2("design:paramtypes", []),
|
|
591
816
|
_ts_metadata2("design:returntype", typeof Observable === "undefined" ? Object : Observable)
|
|
592
817
|
], AgentApiController.prototype, "stream", null);
|
|
593
818
|
AgentApiController = _ts_decorate2([
|
|
594
|
-
(0,
|
|
595
|
-
_ts_param2(1, (0,
|
|
596
|
-
_ts_param2(2, (0,
|
|
597
|
-
_ts_param2(2, (0,
|
|
819
|
+
(0, import_common5.Controller)(),
|
|
820
|
+
_ts_param2(1, (0, import_common5.Inject)(DASHBOARD_APPROVAL_ACTOR_REF)),
|
|
821
|
+
_ts_param2(2, (0, import_common5.Optional)()),
|
|
822
|
+
_ts_param2(2, (0, import_common5.Inject)(AGENT_ACTOR_RESOLVER)),
|
|
598
823
|
_ts_metadata2("design:type", Function),
|
|
599
824
|
_ts_metadata2("design:paramtypes", [
|
|
600
825
|
typeof DashboardService === "undefined" ? Object : DashboardService,
|
|
@@ -630,14 +855,14 @@ __name(agentDashboardMountPaths, "agentDashboardMountPaths");
|
|
|
630
855
|
|
|
631
856
|
// src/server/agent-dashboard.module.ts
|
|
632
857
|
var import_reflect_metadata = require("reflect-metadata");
|
|
633
|
-
var
|
|
858
|
+
var import_common7 = require("@nestjs/common");
|
|
634
859
|
var import_core = require("@nestjs/core");
|
|
635
860
|
|
|
636
861
|
// src/server/agent-ui.controller.ts
|
|
637
862
|
var import_node_fs = require("fs");
|
|
638
863
|
var import_node_path = require("path");
|
|
639
864
|
var import_node_url = require("url");
|
|
640
|
-
var
|
|
865
|
+
var import_common6 = require("@nestjs/common");
|
|
641
866
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
642
867
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
643
868
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -690,7 +915,7 @@ var AgentUiController = class {
|
|
|
690
915
|
}
|
|
691
916
|
const indexPath = (0, import_node_path.join)(this.dir, "index.html");
|
|
692
917
|
if (!(0, import_node_fs.existsSync)(indexPath)) {
|
|
693
|
-
throw new
|
|
918
|
+
throw new import_common6.NotFoundException("Dashboard is not built. Run the package build.");
|
|
694
919
|
}
|
|
695
920
|
const html = (0, import_node_fs.readFileSync)(indexPath, "utf8").replaceAll(`="${BUILD_BASE}/`, `="${this.basePath}/`);
|
|
696
921
|
const inject = `<script>window.__AGENT_BASE__='${this.basePath}';window.__AGENT_API__='${this.apiBasePath}';</script>`;
|
|
@@ -698,24 +923,24 @@ var AgentUiController = class {
|
|
|
698
923
|
}
|
|
699
924
|
asset(file) {
|
|
700
925
|
const safe = (0, import_node_path.basename)(file);
|
|
701
|
-
if (safe !== file) throw new
|
|
926
|
+
if (safe !== file) throw new import_common6.NotFoundException();
|
|
702
927
|
const root = (0, import_node_path.resolve)(this.dir, "assets");
|
|
703
928
|
const assetPath = (0, import_node_path.resolve)(root, safe);
|
|
704
929
|
if (!assetPath.startsWith(root + import_node_path.sep) || !(0, import_node_fs.existsSync)(assetPath)) {
|
|
705
|
-
throw new
|
|
930
|
+
throw new import_common6.NotFoundException();
|
|
706
931
|
}
|
|
707
932
|
const type = CONTENT_TYPES[(0, import_node_path.extname)(safe)] ?? "application/octet-stream";
|
|
708
|
-
return new
|
|
933
|
+
return new import_common6.StreamableFile((0, import_node_fs.readFileSync)(assetPath), {
|
|
709
934
|
type
|
|
710
935
|
});
|
|
711
936
|
}
|
|
712
937
|
};
|
|
713
938
|
_ts_decorate3([
|
|
714
|
-
(0,
|
|
715
|
-
(0,
|
|
716
|
-
(0,
|
|
717
|
-
_ts_param3(0, (0,
|
|
718
|
-
_ts_param3(1, (0,
|
|
939
|
+
(0, import_common6.Get)(),
|
|
940
|
+
(0, import_common6.Header)("Content-Type", "text/html; charset=utf-8"),
|
|
941
|
+
(0, import_common6.Header)("Cache-Control", "no-store, must-revalidate"),
|
|
942
|
+
_ts_param3(0, (0, import_common6.Req)()),
|
|
943
|
+
_ts_param3(1, (0, import_common6.Res)({
|
|
719
944
|
passthrough: true
|
|
720
945
|
})),
|
|
721
946
|
_ts_metadata3("design:type", Function),
|
|
@@ -726,19 +951,19 @@ _ts_decorate3([
|
|
|
726
951
|
_ts_metadata3("design:returntype", String)
|
|
727
952
|
], AgentUiController.prototype, "index", null);
|
|
728
953
|
_ts_decorate3([
|
|
729
|
-
(0,
|
|
730
|
-
(0,
|
|
731
|
-
_ts_param3(0, (0,
|
|
954
|
+
(0, import_common6.Get)("assets/:file"),
|
|
955
|
+
(0, import_common6.Header)("Cache-Control", "public, max-age=31536000, immutable"),
|
|
956
|
+
_ts_param3(0, (0, import_common6.Param)("file")),
|
|
732
957
|
_ts_metadata3("design:type", Function),
|
|
733
958
|
_ts_metadata3("design:paramtypes", [
|
|
734
959
|
String
|
|
735
960
|
]),
|
|
736
|
-
_ts_metadata3("design:returntype", typeof
|
|
961
|
+
_ts_metadata3("design:returntype", typeof import_common6.StreamableFile === "undefined" ? Object : import_common6.StreamableFile)
|
|
737
962
|
], AgentUiController.prototype, "asset", null);
|
|
738
963
|
AgentUiController = _ts_decorate3([
|
|
739
|
-
(0,
|
|
740
|
-
_ts_param3(0, (0,
|
|
741
|
-
_ts_param3(1, (0,
|
|
964
|
+
(0, import_common6.Controller)(),
|
|
965
|
+
_ts_param3(0, (0, import_common6.Inject)(DASHBOARD_BASE_PATH)),
|
|
966
|
+
_ts_param3(1, (0, import_common6.Inject)(DASHBOARD_API_PATH)),
|
|
742
967
|
_ts_metadata3("design:type", Function),
|
|
743
968
|
_ts_metadata3("design:paramtypes", [
|
|
744
969
|
String,
|
|
@@ -795,7 +1020,7 @@ var AgentApiModule = class _AgentApiModule {
|
|
|
795
1020
|
}
|
|
796
1021
|
};
|
|
797
1022
|
AgentApiModule = _ts_decorate4([
|
|
798
|
-
(0,
|
|
1023
|
+
(0, import_common7.Module)({})
|
|
799
1024
|
], AgentApiModule);
|
|
800
1025
|
var AgentDashboardModule = class _AgentDashboardModule {
|
|
801
1026
|
static {
|
|
@@ -857,7 +1082,7 @@ var AgentDashboardModule = class _AgentDashboardModule {
|
|
|
857
1082
|
}
|
|
858
1083
|
};
|
|
859
1084
|
AgentDashboardModule = _ts_decorate4([
|
|
860
|
-
(0,
|
|
1085
|
+
(0, import_common7.Module)({})
|
|
861
1086
|
], AgentDashboardModule);
|
|
862
1087
|
// Annotate the CommonJS export names for ESM import in node:
|
|
863
1088
|
0 && (module.exports = {
|