@dudousxd/nestjs-agent-dashboard 0.21.0 → 0.22.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/server/index.cjs +276 -60
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +92 -1
- package/dist/server/index.d.ts +92 -1
- package/dist/server/index.js +255 -47
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/index-BW1bqmTf.css +1 -0
- package/dist/spa/assets/index-C4U9WEBt.js +1 -0
- package/dist/spa/assets/{preview-CbqJ2CAQ.js → preview-CJ1UfhOA.js} +1 -1
- package/dist/spa/index.html +3 -3
- package/dist/spa/preview.html +3 -3
- package/package.json +1 -1
- package/dist/spa/assets/index-ClnZsvJ1.css +0 -1
- package/dist/spa/assets/index-D3yTBCU0.js +0 -1
- /package/dist/spa/assets/{index-DS11tOEH.js → index-Br3YfiYJ.js} +0 -0
package/dist/server/index.js
CHANGED
|
@@ -1052,8 +1052,8 @@ import { RouterModule } from "@nestjs/core";
|
|
|
1052
1052
|
import { existsSync, readFileSync } from "fs";
|
|
1053
1053
|
import { basename, extname, join, resolve, sep } from "path";
|
|
1054
1054
|
import { fileURLToPath } from "url";
|
|
1055
|
-
import { CanAnyone as
|
|
1056
|
-
import { Controller as
|
|
1055
|
+
import { CanAnyone as CanAnyone3 } from "@dudousxd/nestjs-agent-core";
|
|
1056
|
+
import { Controller as Controller3, Get as Get3, Header as Header2, Inject as Inject5, NotFoundException as NotFoundException2, Param as Param2, Req as Req2, Res, StreamableFile } from "@nestjs/common";
|
|
1057
1057
|
|
|
1058
1058
|
// src/server/console-authorize.guard.ts
|
|
1059
1059
|
import { Catch, HttpException, Inject as Inject3, Injectable as Injectable2, SetMetadata, UseFilters, UseGuards, applyDecorators } from "@nestjs/common";
|
|
@@ -1442,7 +1442,9 @@ function UseConsoleAuthorize() {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
__name(UseConsoleAuthorize, "UseConsoleAuthorize");
|
|
1444
1444
|
|
|
1445
|
-
// src/server/
|
|
1445
|
+
// src/server/console-switcher.ts
|
|
1446
|
+
import { CanAnyone as CanAnyone2 } from "@dudousxd/nestjs-agent-core";
|
|
1447
|
+
import { Controller as Controller2, Get as Get2, Header, Inject as Inject4, Injectable as Injectable3, Logger as Logger2, createParamDecorator } from "@nestjs/common";
|
|
1446
1448
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
1447
1449
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1448
1450
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -1469,7 +1471,186 @@ function _ts_param4(paramIndex, decorator) {
|
|
|
1469
1471
|
};
|
|
1470
1472
|
}
|
|
1471
1473
|
__name(_ts_param4, "_ts_param");
|
|
1474
|
+
var AVIARY_CONSOLES_SLOT = /* @__PURE__ */ Symbol.for("@dudousxd/aviary:consoles");
|
|
1475
|
+
var ID = /^[a-z][a-z0-9-]*$/;
|
|
1476
|
+
var ICONS = /* @__PURE__ */ new Set([
|
|
1477
|
+
"workflow",
|
|
1478
|
+
"telescope",
|
|
1479
|
+
"media",
|
|
1480
|
+
"payments",
|
|
1481
|
+
"agent",
|
|
1482
|
+
"identity",
|
|
1483
|
+
"generic"
|
|
1484
|
+
]);
|
|
1485
|
+
var CONSOLE_PROBE_TIMEOUT_MS = 300;
|
|
1486
|
+
function isSameOriginPath(path) {
|
|
1487
|
+
return typeof path === "string" && path.startsWith("/") && !path.startsWith("//");
|
|
1488
|
+
}
|
|
1489
|
+
__name(isSameOriginPath, "isSameOriginPath");
|
|
1490
|
+
function readAviaryConsoles() {
|
|
1491
|
+
const value = globalThis[AVIARY_CONSOLES_SLOT];
|
|
1492
|
+
if (value?.version !== 1 || !Array.isArray(value.entries)) return void 0;
|
|
1493
|
+
return value;
|
|
1494
|
+
}
|
|
1495
|
+
__name(readAviaryConsoles, "readAviaryConsoles");
|
|
1496
|
+
function registerAviaryConsole(entry, logger4) {
|
|
1497
|
+
if (!ID.test(entry.id)) throw new Error(`console id ${JSON.stringify(entry.id)} is invalid`);
|
|
1498
|
+
if (!isSameOriginPath(entry.path)) {
|
|
1499
|
+
throw new Error(`console path ${JSON.stringify(entry.path)} must start with a single "/"`);
|
|
1500
|
+
}
|
|
1501
|
+
const holder = globalThis;
|
|
1502
|
+
if (holder[AVIARY_CONSOLES_SLOT] === void 0) {
|
|
1503
|
+
const fresh = {
|
|
1504
|
+
version: 1,
|
|
1505
|
+
entries: []
|
|
1506
|
+
};
|
|
1507
|
+
holder[AVIARY_CONSOLES_SLOT] = fresh;
|
|
1508
|
+
}
|
|
1509
|
+
const registry = readAviaryConsoles();
|
|
1510
|
+
if (registry === void 0) return void 0;
|
|
1511
|
+
if (registry.entries.some((existing) => existing.id === entry.id)) {
|
|
1512
|
+
logger4?.warn(`console id "${entry.id}" is already registered`);
|
|
1513
|
+
return void 0;
|
|
1514
|
+
}
|
|
1515
|
+
registry.entries.push(entry);
|
|
1516
|
+
return () => {
|
|
1517
|
+
const index = registry.entries.indexOf(entry);
|
|
1518
|
+
if (index !== -1) registry.entries.splice(index, 1);
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
__name(registerAviaryConsole, "registerAviaryConsole");
|
|
1522
|
+
function consoleSwitcherConfig(selfId, endpoint) {
|
|
1523
|
+
const registry = readAviaryConsoles();
|
|
1524
|
+
if (!registry?.entries.some((entry) => entry.id === selfId)) return void 0;
|
|
1525
|
+
const others = registry.entries.filter((entry) => entry.id !== selfId).length;
|
|
1526
|
+
return others > 0 ? {
|
|
1527
|
+
endpoint,
|
|
1528
|
+
others
|
|
1529
|
+
} : void 0;
|
|
1530
|
+
}
|
|
1531
|
+
__name(consoleSwitcherConfig, "consoleSwitcherConfig");
|
|
1532
|
+
async function allows(entry, context, ms) {
|
|
1533
|
+
let timer;
|
|
1534
|
+
const timeout = new Promise((resolve2) => {
|
|
1535
|
+
timer = setTimeout(() => resolve2(false), ms);
|
|
1536
|
+
});
|
|
1537
|
+
try {
|
|
1538
|
+
return await Promise.race([
|
|
1539
|
+
Promise.resolve().then(() => entry.authorize(context)).then((decision) => decision?.allowed === true, () => false),
|
|
1540
|
+
timeout
|
|
1541
|
+
]);
|
|
1542
|
+
} finally {
|
|
1543
|
+
clearTimeout(timer);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
__name(allows, "allows");
|
|
1547
|
+
async function listVisibleConsoles(registry, selfId, context, timeoutMs = CONSOLE_PROBE_TIMEOUT_MS) {
|
|
1548
|
+
const others = (registry?.entries ?? []).filter((entry) => entry.id !== selfId && isSameOriginPath(entry.path)).sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
|
|
1549
|
+
const verdicts = await Promise.all(others.map((entry) => allows(entry, context, timeoutMs)));
|
|
1550
|
+
return {
|
|
1551
|
+
version: 1,
|
|
1552
|
+
current: selfId,
|
|
1553
|
+
consoles: others.filter((_, index) => verdicts[index]).map((entry) => ({
|
|
1554
|
+
id: entry.id,
|
|
1555
|
+
title: entry.title,
|
|
1556
|
+
icon: ICONS.has(entry.icon) ? entry.icon : "generic",
|
|
1557
|
+
href: entry.path
|
|
1558
|
+
}))
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
__name(listVisibleConsoles, "listVisibleConsoles");
|
|
1562
|
+
var AGENT_CONSOLE_ID = "agent";
|
|
1563
|
+
var logger2 = new Logger2("AgentDashboardModule");
|
|
1564
|
+
var AgentConsoleRegistration = class {
|
|
1565
|
+
static {
|
|
1566
|
+
__name(this, "AgentConsoleRegistration");
|
|
1567
|
+
}
|
|
1568
|
+
basePath;
|
|
1569
|
+
access;
|
|
1570
|
+
#unregister;
|
|
1571
|
+
constructor(basePath, access) {
|
|
1572
|
+
this.basePath = basePath;
|
|
1573
|
+
this.access = access;
|
|
1574
|
+
}
|
|
1575
|
+
onModuleInit() {
|
|
1576
|
+
this.#unregister = registerAviaryConsole({
|
|
1577
|
+
id: AGENT_CONSOLE_ID,
|
|
1578
|
+
title: "Agents",
|
|
1579
|
+
icon: "agent",
|
|
1580
|
+
order: 30,
|
|
1581
|
+
path: this.basePath === "" ? "/" : this.basePath,
|
|
1582
|
+
authorize: /* @__PURE__ */ __name((context) => this.access.check(context), "authorize")
|
|
1583
|
+
}, logger2);
|
|
1584
|
+
}
|
|
1585
|
+
onModuleDestroy() {
|
|
1586
|
+
this.#unregister?.();
|
|
1587
|
+
this.#unregister = void 0;
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
AgentConsoleRegistration = _ts_decorate4([
|
|
1591
|
+
Injectable3(),
|
|
1592
|
+
_ts_param4(0, Inject4(DASHBOARD_BASE_PATH)),
|
|
1593
|
+
_ts_metadata4("design:type", Function),
|
|
1594
|
+
_ts_metadata4("design:paramtypes", [
|
|
1595
|
+
String,
|
|
1596
|
+
typeof DashboardConsoleAccess === "undefined" ? Object : DashboardConsoleAccess
|
|
1597
|
+
])
|
|
1598
|
+
], AgentConsoleRegistration);
|
|
1599
|
+
var CurrentExecutionContext = createParamDecorator((_data, context) => ({
|
|
1600
|
+
context
|
|
1601
|
+
}));
|
|
1602
|
+
var AgentConsolesController = class {
|
|
1603
|
+
static {
|
|
1604
|
+
__name(this, "AgentConsolesController");
|
|
1605
|
+
}
|
|
1606
|
+
consoles(current) {
|
|
1607
|
+
return listVisibleConsoles(readAviaryConsoles(), AGENT_CONSOLE_ID, current.context);
|
|
1608
|
+
}
|
|
1609
|
+
};
|
|
1610
|
+
_ts_decorate4([
|
|
1611
|
+
Get2("consoles"),
|
|
1612
|
+
Header("Cache-Control", "private, no-store"),
|
|
1613
|
+
_ts_param4(0, CurrentExecutionContext()),
|
|
1614
|
+
_ts_metadata4("design:type", Function),
|
|
1615
|
+
_ts_metadata4("design:paramtypes", [
|
|
1616
|
+
typeof CurrentContext === "undefined" ? Object : CurrentContext
|
|
1617
|
+
]),
|
|
1618
|
+
_ts_metadata4("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
1619
|
+
], AgentConsolesController.prototype, "consoles", null);
|
|
1620
|
+
AgentConsolesController = _ts_decorate4([
|
|
1621
|
+
CanAnyone2(),
|
|
1622
|
+
Controller2()
|
|
1623
|
+
], AgentConsolesController);
|
|
1624
|
+
|
|
1625
|
+
// src/server/agent-ui.controller.ts
|
|
1626
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
1627
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1628
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1629
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1630
|
+
} else {
|
|
1631
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
1632
|
+
if (d = decorators[i]) {
|
|
1633
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1638
|
+
}
|
|
1639
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
1640
|
+
function _ts_metadata5(metadataKey, metadataValue) {
|
|
1641
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1642
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
1646
|
+
function _ts_param5(paramIndex, decorator) {
|
|
1647
|
+
return function(target, key) {
|
|
1648
|
+
decorator(target, key, paramIndex);
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
__name(_ts_param5, "_ts_param");
|
|
1472
1652
|
var BUILD_BASE = "/ai-gateway";
|
|
1653
|
+
var AGENT_DASHBOARD_CONFIG_ID = "agent-dashboard-config";
|
|
1473
1654
|
function spaDir() {
|
|
1474
1655
|
return fileURLToPath(new URL("../spa", import.meta.url));
|
|
1475
1656
|
}
|
|
@@ -1507,9 +1688,23 @@ var AgentUiController = class {
|
|
|
1507
1688
|
throw new NotFoundException2("Dashboard is not built. Run the package build.");
|
|
1508
1689
|
}
|
|
1509
1690
|
const html = readFileSync(indexPath, "utf8").replaceAll(`="${BUILD_BASE}/`, `="${this.basePath}/`);
|
|
1510
|
-
const inject = `<script>window.__AGENT_BASE__='${this.basePath}';window.__AGENT_API__='${this.apiBasePath}';</script
|
|
1691
|
+
const inject = `<script>window.__AGENT_BASE__='${this.basePath}';window.__AGENT_API__='${this.apiBasePath}';</script>${this.configBlock()}`;
|
|
1511
1692
|
return html.includes("</head>") ? html.replace("</head>", `${inject}</head>`) : inject + html;
|
|
1512
1693
|
}
|
|
1694
|
+
/**
|
|
1695
|
+
* The page's JSON config block (`agent-dashboard-config`, CSP-safe: data, not script). It carries
|
|
1696
|
+
* `switcher` only when another Aviary console is registered.
|
|
1697
|
+
*/
|
|
1698
|
+
configBlock() {
|
|
1699
|
+
const switcher = consoleSwitcherConfig(AGENT_CONSOLE_ID, `${this.apiBasePath}/consoles`);
|
|
1700
|
+
const json = JSON.stringify({
|
|
1701
|
+
apiBase: this.apiBasePath,
|
|
1702
|
+
...switcher !== void 0 ? {
|
|
1703
|
+
switcher
|
|
1704
|
+
} : {}
|
|
1705
|
+
}).replaceAll("<", "\\u003c");
|
|
1706
|
+
return `<script type="application/json" id="${AGENT_DASHBOARD_CONFIG_ID}">${json}</script>`;
|
|
1707
|
+
}
|
|
1513
1708
|
asset(file) {
|
|
1514
1709
|
const safe = basename(file);
|
|
1515
1710
|
if (safe !== file) throw new NotFoundException2();
|
|
@@ -1524,47 +1719,47 @@ var AgentUiController = class {
|
|
|
1524
1719
|
});
|
|
1525
1720
|
}
|
|
1526
1721
|
};
|
|
1527
|
-
|
|
1528
|
-
|
|
1722
|
+
_ts_decorate5([
|
|
1723
|
+
Get3(),
|
|
1529
1724
|
ConsolePage(),
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1725
|
+
Header2("Content-Type", "text/html; charset=utf-8"),
|
|
1726
|
+
Header2("Cache-Control", "no-store, must-revalidate"),
|
|
1727
|
+
_ts_param5(0, Req2()),
|
|
1728
|
+
_ts_param5(1, Res({
|
|
1534
1729
|
passthrough: true
|
|
1535
1730
|
})),
|
|
1536
|
-
|
|
1537
|
-
|
|
1731
|
+
_ts_metadata5("design:type", Function),
|
|
1732
|
+
_ts_metadata5("design:paramtypes", [
|
|
1538
1733
|
typeof UiPageRequest === "undefined" ? Object : UiPageRequest,
|
|
1539
1734
|
typeof UiPageResponse === "undefined" ? Object : UiPageResponse
|
|
1540
1735
|
]),
|
|
1541
|
-
|
|
1736
|
+
_ts_metadata5("design:returntype", String)
|
|
1542
1737
|
], AgentUiController.prototype, "index", null);
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1738
|
+
_ts_decorate5([
|
|
1739
|
+
Get3("assets/:file"),
|
|
1740
|
+
Header2("Cache-Control", "public, max-age=31536000, immutable"),
|
|
1741
|
+
_ts_param5(0, Param2("file")),
|
|
1742
|
+
_ts_metadata5("design:type", Function),
|
|
1743
|
+
_ts_metadata5("design:paramtypes", [
|
|
1549
1744
|
String
|
|
1550
1745
|
]),
|
|
1551
|
-
|
|
1746
|
+
_ts_metadata5("design:returntype", typeof StreamableFile === "undefined" ? Object : StreamableFile)
|
|
1552
1747
|
], AgentUiController.prototype, "asset", null);
|
|
1553
|
-
AgentUiController =
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1748
|
+
AgentUiController = _ts_decorate5([
|
|
1749
|
+
CanAnyone3(),
|
|
1750
|
+
Controller3(),
|
|
1751
|
+
_ts_param5(0, Inject5(DASHBOARD_BASE_PATH)),
|
|
1752
|
+
_ts_param5(1, Inject5(DASHBOARD_API_PATH)),
|
|
1753
|
+
_ts_metadata5("design:type", Function),
|
|
1754
|
+
_ts_metadata5("design:paramtypes", [
|
|
1560
1755
|
String,
|
|
1561
1756
|
String
|
|
1562
1757
|
])
|
|
1563
1758
|
], AgentUiController);
|
|
1564
1759
|
|
|
1565
1760
|
// src/server/dev-tools.ts
|
|
1566
|
-
import { Inject as
|
|
1567
|
-
function
|
|
1761
|
+
import { Inject as Inject6, Injectable as Injectable4, Logger as Logger3, NotFoundException as NotFoundException3 } from "@nestjs/common";
|
|
1762
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
1568
1763
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1569
1764
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1570
1765
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1577,19 +1772,19 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
1577
1772
|
}
|
|
1578
1773
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1579
1774
|
}
|
|
1580
|
-
__name(
|
|
1581
|
-
function
|
|
1775
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
1776
|
+
function _ts_metadata6(metadataKey, metadataValue) {
|
|
1582
1777
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1583
1778
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
1584
1779
|
}
|
|
1585
1780
|
}
|
|
1586
|
-
__name(
|
|
1587
|
-
function
|
|
1781
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
1782
|
+
function _ts_param6(paramIndex, decorator) {
|
|
1588
1783
|
return function(target, key) {
|
|
1589
1784
|
decorator(target, key, paramIndex);
|
|
1590
1785
|
};
|
|
1591
1786
|
}
|
|
1592
|
-
__name(
|
|
1787
|
+
__name(_ts_param6, "_ts_param");
|
|
1593
1788
|
var DEV_TOOLS_SLOT = /* @__PURE__ */ Symbol.for("@dudousxd/aviary:dev-tools");
|
|
1594
1789
|
function devToolsSlot() {
|
|
1595
1790
|
const holder = globalThis;
|
|
@@ -1923,7 +2118,7 @@ function agentDevTools(dashboard) {
|
|
|
1923
2118
|
];
|
|
1924
2119
|
}
|
|
1925
2120
|
__name(agentDevTools, "agentDevTools");
|
|
1926
|
-
var
|
|
2121
|
+
var logger3 = new Logger3("AgentDashboardModule");
|
|
1927
2122
|
var AgentDevToolsRegistration = class {
|
|
1928
2123
|
static {
|
|
1929
2124
|
__name(this, "AgentDevToolsRegistration");
|
|
@@ -1949,7 +2144,7 @@ var AgentDevToolsRegistration = class {
|
|
|
1949
2144
|
tools: agentDevTools(this.dashboard)
|
|
1950
2145
|
});
|
|
1951
2146
|
} catch (error) {
|
|
1952
|
-
|
|
2147
|
+
logger3.warn(`agent dev tools not registered: ${error instanceof Error ? error.message : String(error)}`);
|
|
1953
2148
|
}
|
|
1954
2149
|
}
|
|
1955
2150
|
onModuleDestroy() {
|
|
@@ -1957,11 +2152,11 @@ var AgentDevToolsRegistration = class {
|
|
|
1957
2152
|
this.#unregister = void 0;
|
|
1958
2153
|
}
|
|
1959
2154
|
};
|
|
1960
|
-
AgentDevToolsRegistration =
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2155
|
+
AgentDevToolsRegistration = _ts_decorate6([
|
|
2156
|
+
Injectable4(),
|
|
2157
|
+
_ts_param6(0, Inject6(DASHBOARD_DEV_TOOLS)),
|
|
2158
|
+
_ts_metadata6("design:type", Function),
|
|
2159
|
+
_ts_metadata6("design:paramtypes", [
|
|
1965
2160
|
Boolean,
|
|
1966
2161
|
typeof DashboardService === "undefined" ? Object : DashboardService,
|
|
1967
2162
|
typeof DashboardConsoleAccess === "undefined" ? Object : DashboardConsoleAccess
|
|
@@ -1969,7 +2164,7 @@ AgentDevToolsRegistration = _ts_decorate5([
|
|
|
1969
2164
|
], AgentDevToolsRegistration);
|
|
1970
2165
|
|
|
1971
2166
|
// src/server/agent-dashboard.module.ts
|
|
1972
|
-
function
|
|
2167
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
1973
2168
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1974
2169
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1975
2170
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1982,7 +2177,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
1982
2177
|
}
|
|
1983
2178
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1984
2179
|
}
|
|
1985
|
-
__name(
|
|
2180
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
1986
2181
|
function normalize(path) {
|
|
1987
2182
|
return normalizeDashboardPath(path);
|
|
1988
2183
|
}
|
|
@@ -2011,7 +2206,8 @@ var AgentApiModule = class _AgentApiModule {
|
|
|
2011
2206
|
...options.imports ?? []
|
|
2012
2207
|
],
|
|
2013
2208
|
controllers: options.routes === false ? [] : withControllerDecorators([
|
|
2014
|
-
AgentApiController
|
|
2209
|
+
AgentApiController,
|
|
2210
|
+
AgentConsolesController
|
|
2015
2211
|
], consoleDecorators(options.decorators)),
|
|
2016
2212
|
providers: [
|
|
2017
2213
|
DashboardService,
|
|
@@ -2042,7 +2238,7 @@ var AgentApiModule = class _AgentApiModule {
|
|
|
2042
2238
|
};
|
|
2043
2239
|
}
|
|
2044
2240
|
};
|
|
2045
|
-
AgentApiModule =
|
|
2241
|
+
AgentApiModule = _ts_decorate7([
|
|
2046
2242
|
Module({})
|
|
2047
2243
|
], AgentApiModule);
|
|
2048
2244
|
var AgentDashboardModule = class _AgentDashboardModule {
|
|
@@ -2101,7 +2297,11 @@ var AgentDashboardModule = class _AgentDashboardModule {
|
|
|
2101
2297
|
{
|
|
2102
2298
|
provide: DASHBOARD_API_PATH,
|
|
2103
2299
|
useValue: apiBasePath
|
|
2104
|
-
}
|
|
2300
|
+
},
|
|
2301
|
+
// The console switcher lists this console only where it serves its own page.
|
|
2302
|
+
...options.routes === false ? [] : [
|
|
2303
|
+
AgentConsoleRegistration
|
|
2304
|
+
]
|
|
2105
2305
|
],
|
|
2106
2306
|
// Re-export the API module so its DashboardService reaches importers (e.g. the host's own
|
|
2107
2307
|
// controllers), and the paths a self-mounted `AgentUiController` subclass injects.
|
|
@@ -2113,23 +2313,29 @@ var AgentDashboardModule = class _AgentDashboardModule {
|
|
|
2113
2313
|
};
|
|
2114
2314
|
}
|
|
2115
2315
|
};
|
|
2116
|
-
AgentDashboardModule =
|
|
2316
|
+
AgentDashboardModule = _ts_decorate7([
|
|
2117
2317
|
Module({})
|
|
2118
2318
|
], AgentDashboardModule);
|
|
2119
2319
|
export {
|
|
2120
2320
|
AGENT_ACTOR_DIRECTORY,
|
|
2121
2321
|
AGENT_ACTOR_RESOLVER,
|
|
2122
2322
|
AGENT_APPROVAL_PORT,
|
|
2323
|
+
AGENT_CONSOLE_ID,
|
|
2324
|
+
AGENT_DASHBOARD_CONFIG_ID,
|
|
2123
2325
|
AGENT_GOVERNANCE_QUERIES,
|
|
2124
2326
|
AGENT_PRICING_STORE,
|
|
2327
|
+
AVIARY_CONSOLES_SLOT,
|
|
2125
2328
|
AgentApiController,
|
|
2126
2329
|
AgentApiModule,
|
|
2330
|
+
AgentConsoleRegistration,
|
|
2331
|
+
AgentConsolesController,
|
|
2127
2332
|
AgentDashboardModule,
|
|
2128
2333
|
AgentDevToolsRegistration,
|
|
2129
2334
|
AgentUiController,
|
|
2130
2335
|
CONSOLE_AUTHORIZE_MISSING_WARNING,
|
|
2131
2336
|
CONSOLE_GATE,
|
|
2132
2337
|
CONSOLE_PAGE_METADATA,
|
|
2338
|
+
CONSOLE_PROBE_TIMEOUT_MS,
|
|
2133
2339
|
ConsoleAccessDenied,
|
|
2134
2340
|
ConsoleAuthorizeFilter,
|
|
2135
2341
|
ConsoleAuthorizeGuard,
|
|
@@ -2146,8 +2352,10 @@ export {
|
|
|
2146
2352
|
agentDevTools,
|
|
2147
2353
|
anyAuthorize,
|
|
2148
2354
|
authorizeByToken,
|
|
2355
|
+
listVisibleConsoles,
|
|
2149
2356
|
normalizeConsoleResult,
|
|
2150
2357
|
parsePriceInput,
|
|
2358
|
+
registerAviaryConsole,
|
|
2151
2359
|
resolveConsoleAuthorize
|
|
2152
2360
|
};
|
|
2153
2361
|
//# sourceMappingURL=index.js.map
|