@dudousxd/nestjs-agent-dashboard 0.21.0 → 0.23.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 +356 -84
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +114 -2
- package/dist/server/index.d.ts +114 -2
- package/dist/server/index.js +333 -71
- 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 +2 -2
- 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.d.cts
CHANGED
|
@@ -4,6 +4,13 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import { ExecutionContext, Type, Logger, DynamicModule, StreamableFile, OnModuleInit, HttpException, ExceptionFilter, ArgumentsHost, CanActivate, OnModuleDestroy } from '@nestjs/common';
|
|
5
5
|
import { ModuleRef, HttpAdapterHost } from '@nestjs/core';
|
|
6
6
|
|
|
7
|
+
/** The agent's `tenancy` option, as `AgentModule.forRoot({ tenancy })` holds it. */
|
|
8
|
+
type AgentTenancyOption = 'inherit' | false | {
|
|
9
|
+
enabled?: 'inherit' | boolean;
|
|
10
|
+
kinds?: string[];
|
|
11
|
+
nullRows?: 'tenantless' | 'shared';
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
/** An actor-scoped row decorated with its resolved display label — `null` when unbound or unresolved. */
|
|
8
15
|
interface WithActorLabel {
|
|
9
16
|
actorLabel: string | null;
|
|
@@ -68,7 +75,17 @@ declare class DashboardService {
|
|
|
68
75
|
private readonly actorDirectory?;
|
|
69
76
|
private readonly pricingStore?;
|
|
70
77
|
private readonly approvalPort?;
|
|
71
|
-
|
|
78
|
+
private readonly agentOptions?;
|
|
79
|
+
private readonly contextAccessor?;
|
|
80
|
+
constructor(queries: AgentGovernanceQueries, actorDirectory?: ActorDirectory | undefined, pricingStore?: AgentPricingStore | undefined, approvalPort?: AgentApprovalPort | undefined, agentOptions?: {
|
|
81
|
+
tenancy?: AgentTenancyOption;
|
|
82
|
+
} | undefined, contextAccessor?: unknown | undefined);
|
|
83
|
+
/**
|
|
84
|
+
* The read-model for this request: with the agent's tenancy on, narrowed to the viewer's context
|
|
85
|
+
* tenant (another tenant's thread or run is not found). A store without `forTenant` cannot be
|
|
86
|
+
* narrowed, so the console refuses (`501`) rather than show every tenant's rows.
|
|
87
|
+
*/
|
|
88
|
+
private scoped;
|
|
72
89
|
/** Spend/usage overview for a day range: by-model + by-actor spend and the daily trend, in parallel. */
|
|
73
90
|
spend(range: GovernanceRange): Promise<SpendOverview>;
|
|
74
91
|
/** Top threads by cost for a day range (default 10, highest cost first). */
|
|
@@ -473,6 +490,8 @@ interface UiPageResponse {
|
|
|
473
490
|
status(code: number): unknown;
|
|
474
491
|
setHeader(name: string, value: string): unknown;
|
|
475
492
|
}
|
|
493
|
+
/** The id of the page's JSON config block. */
|
|
494
|
+
declare const AGENT_DASHBOARD_CONFIG_ID = "agent-dashboard-config";
|
|
476
495
|
/**
|
|
477
496
|
* Serves the bundled AI-gateway console SPA at the configured base (+ hashed assets at
|
|
478
497
|
* `<base>/assets`). The path comes from `RouterModule` (set by
|
|
@@ -488,6 +507,11 @@ declare class AgentUiController {
|
|
|
488
507
|
private readonly dir;
|
|
489
508
|
constructor(basePath: string, apiBasePath: string);
|
|
490
509
|
index(req: UiPageRequest, res: UiPageResponse): string;
|
|
510
|
+
/**
|
|
511
|
+
* The page's JSON config block (`agent-dashboard-config`, CSP-safe: data, not script). It carries
|
|
512
|
+
* `switcher` only when another Aviary console is registered.
|
|
513
|
+
*/
|
|
514
|
+
private configBlock;
|
|
491
515
|
asset(file: string): StreamableFile;
|
|
492
516
|
}
|
|
493
517
|
|
|
@@ -547,6 +571,90 @@ declare class ConsoleAuthorizeFilter implements ExceptionFilter<ConsoleAccessDen
|
|
|
547
571
|
*/
|
|
548
572
|
declare function UseConsoleAuthorize(): ClassDecorator & MethodDecorator;
|
|
549
573
|
|
|
574
|
+
/** The process-wide slot every Aviary console registers into (created by whichever boots first). */
|
|
575
|
+
declare const AVIARY_CONSOLES_SLOT: unique symbol;
|
|
576
|
+
/** The icon a console shows in the switcher. An unknown value renders as `generic`. */
|
|
577
|
+
type AviaryConsoleIcon = 'workflow' | 'telescope' | 'media' | 'payments' | 'agent' | 'identity' | 'generic';
|
|
578
|
+
/** What a console's `authorize` answers; only `allowed: true` lists it. */
|
|
579
|
+
interface AviaryConsoleDecision {
|
|
580
|
+
allowed: boolean;
|
|
581
|
+
reason?: string;
|
|
582
|
+
redirectTo?: string;
|
|
583
|
+
}
|
|
584
|
+
/** One console the switcher can list. */
|
|
585
|
+
interface AviaryConsoleEntry {
|
|
586
|
+
/** `/^[a-z][a-z0-9-]*$/`: `'durable'`, `'telescope'`, `'agent'`, `'media'`, … */
|
|
587
|
+
id: string;
|
|
588
|
+
/** Product title: `'Workflows'`, `'Telescope'`, `'Agents'`, `'Media'`. */
|
|
589
|
+
title: string;
|
|
590
|
+
icon: AviaryConsoleIcon;
|
|
591
|
+
/** Same-origin absolute path of the console's page (`/ai-gateway`). */
|
|
592
|
+
path: string;
|
|
593
|
+
/** Sort key: durable 10, telescope 20, agent 30, media 50. */
|
|
594
|
+
order: number;
|
|
595
|
+
/** The console's resolved gate (what its own routes run). Never throws. */
|
|
596
|
+
authorize(context: ExecutionContext): Promise<AviaryConsoleDecision>;
|
|
597
|
+
}
|
|
598
|
+
/** The value at {@link AVIARY_CONSOLES_SLOT}. Data only, so every console's copy is identical. */
|
|
599
|
+
interface AviaryConsoleRegistry {
|
|
600
|
+
readonly version: 1;
|
|
601
|
+
readonly entries: AviaryConsoleEntry[];
|
|
602
|
+
}
|
|
603
|
+
/** One console as `GET <api>/consoles` returns it. */
|
|
604
|
+
interface VisibleConsole {
|
|
605
|
+
id: string;
|
|
606
|
+
title: string;
|
|
607
|
+
icon: AviaryConsoleIcon;
|
|
608
|
+
href: string;
|
|
609
|
+
}
|
|
610
|
+
/** The answer of `GET <api>/consoles`. */
|
|
611
|
+
interface VisibleConsoles {
|
|
612
|
+
version: 1;
|
|
613
|
+
current: string;
|
|
614
|
+
consoles: VisibleConsole[];
|
|
615
|
+
}
|
|
616
|
+
/** How long another console's `authorize` may take before it is left out. */
|
|
617
|
+
declare const CONSOLE_PROBE_TIMEOUT_MS = 300;
|
|
618
|
+
/**
|
|
619
|
+
* Adds a console to the process's switcher registry, creating it when absent. Returns a function
|
|
620
|
+
* that removes the entry again, or `undefined` when it was not added (another registry version, or
|
|
621
|
+
* the id is taken: logged as a warning). A bad `id` or `path` throws.
|
|
622
|
+
*/
|
|
623
|
+
declare function registerAviaryConsole(entry: AviaryConsoleEntry, logger?: {
|
|
624
|
+
warn(message: string): void;
|
|
625
|
+
}): (() => void) | undefined;
|
|
626
|
+
/**
|
|
627
|
+
* The consoles other than `selfId` the viewer may open, by `order` then `id`. Every other entry's
|
|
628
|
+
* `authorize` runs in parallel, each given `timeoutMs`; a timeout, a rejection or any denial hides
|
|
629
|
+
* it. No reason is ever returned.
|
|
630
|
+
*/
|
|
631
|
+
declare function listVisibleConsoles(registry: AviaryConsoleRegistry | undefined, selfId: string, context: ExecutionContext, timeoutMs?: number): Promise<VisibleConsoles>;
|
|
632
|
+
/** The agent console's id in the registry. */
|
|
633
|
+
declare const AGENT_CONSOLE_ID = "agent";
|
|
634
|
+
/**
|
|
635
|
+
* Registers the agent console into the switcher registry (the console's page path, gated by its
|
|
636
|
+
* resolved `authorize`). Provided only when the console's routes are mounted; removed on shutdown.
|
|
637
|
+
*/
|
|
638
|
+
declare class AgentConsoleRegistration implements OnModuleInit, OnModuleDestroy {
|
|
639
|
+
#private;
|
|
640
|
+
private readonly basePath;
|
|
641
|
+
private readonly access;
|
|
642
|
+
constructor(basePath: string, access: DashboardConsoleAccess);
|
|
643
|
+
onModuleInit(): void;
|
|
644
|
+
onModuleDestroy(): void;
|
|
645
|
+
}
|
|
646
|
+
/** What the route hands on to the other consoles' `authorize`: this request's `ExecutionContext`. */
|
|
647
|
+
interface CurrentContext {
|
|
648
|
+
context: ExecutionContext;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* `GET <api>/consoles`: the other Aviary consoles this viewer may open. Behind the console's own
|
|
652
|
+
* access check, like every API route, so only someone who may open this console learns the list.
|
|
653
|
+
*/
|
|
654
|
+
declare class AgentConsolesController {
|
|
655
|
+
consoles(current: CurrentContext): Promise<VisibleConsoles>;
|
|
656
|
+
}
|
|
657
|
+
|
|
550
658
|
interface DevToolInputProperty {
|
|
551
659
|
type: 'string' | 'number' | 'integer' | 'boolean' | 'array';
|
|
552
660
|
description?: string;
|
|
@@ -641,6 +749,10 @@ declare const AGENT_APPROVAL_PORT: unique symbol;
|
|
|
641
749
|
* unauthenticated), `executedByRef` is simply omitted.
|
|
642
750
|
*/
|
|
643
751
|
declare const AGENT_ACTOR_RESOLVER: unique symbol;
|
|
752
|
+
/** `AgentModule`'s options — read for their `tenancy`. Optional: absent → tenancy `'inherit'`. */
|
|
753
|
+
declare const AGENT_OPTIONS: unique symbol;
|
|
754
|
+
/** `@dudousxd/nestjs-context`'s accessor. Optional: absent → the global slot, else tenancy off. */
|
|
755
|
+
declare const CONTEXT_ACCESSOR: unique symbol;
|
|
644
756
|
/** DI token carrying the UI mount base (e.g. `/ai-gateway`). */
|
|
645
757
|
declare const DASHBOARD_BASE_PATH: unique symbol;
|
|
646
758
|
/** DI token carrying the JSON API base the SPA fetches from (e.g. `/ai-gateway/api`). */
|
|
@@ -658,4 +770,4 @@ declare const DASHBOARD_CONSOLE_OPTIONS: unique symbol;
|
|
|
658
770
|
/** DI token: whether the agent's dev tools register into the dev-tools slot. */
|
|
659
771
|
declare const DASHBOARD_DEV_TOOLS: unique symbol;
|
|
660
772
|
|
|
661
|
-
export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_GOVERNANCE_QUERIES, AGENT_PRICING_STORE, type ActorSpendRowWithLabel, AgentApiController, AgentApiModule, AgentDashboardModule, type AgentDashboardMountPathsOptions, type AgentDashboardOptions, type AgentDevTool, AgentDevToolsRegistration, AgentUiController, CONSOLE_AUTHORIZE_MISSING_WARNING, CONSOLE_GATE, CONSOLE_PAGE_METADATA, ConsoleAccessDenied, type ConsoleAuthorize, ConsoleAuthorizeFilter, ConsoleAuthorizeGuard, type ConsoleAuthorizeResult, type ConsoleAuthorizer, type ConsoleAuthorizerClass, type ConsoleDecide, type ConsoleDecision, type ConsoleGate, ConsolePage, type ConsolePolicyCheck, DASHBOARD_API_PATH, DASHBOARD_APPROVAL_ACTOR_REF, DASHBOARD_BASE_PATH, DASHBOARD_CONSOLE_OPTIONS, DASHBOARD_DEV_TOOLS, DashboardConsoleAccess, DashboardService, type LiveAgentEvent, type ReliabilityOverview, type RunDetailWithLabel, type SpendOverview, type ThreadActivityRowWithLabel, type ThreadDetailWithLabel, type ThreadSpendRowWithLabel, UseConsoleAuthorize, type WithActorLabel, agentDashboardMountPaths, agentDevTools, anyAuthorize, authorizeByToken, normalizeConsoleResult, parsePriceInput, resolveConsoleAuthorize };
|
|
773
|
+
export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_CONSOLE_ID, AGENT_DASHBOARD_CONFIG_ID, AGENT_GOVERNANCE_QUERIES, AGENT_OPTIONS, AGENT_PRICING_STORE, AVIARY_CONSOLES_SLOT, type ActorSpendRowWithLabel, AgentApiController, AgentApiModule, AgentConsoleRegistration, AgentConsolesController, AgentDashboardModule, type AgentDashboardMountPathsOptions, type AgentDashboardOptions, type AgentDevTool, AgentDevToolsRegistration, AgentUiController, type AviaryConsoleDecision, type AviaryConsoleEntry, type AviaryConsoleIcon, type AviaryConsoleRegistry, CONSOLE_AUTHORIZE_MISSING_WARNING, CONSOLE_GATE, CONSOLE_PAGE_METADATA, CONSOLE_PROBE_TIMEOUT_MS, CONTEXT_ACCESSOR, ConsoleAccessDenied, type ConsoleAuthorize, ConsoleAuthorizeFilter, ConsoleAuthorizeGuard, type ConsoleAuthorizeResult, type ConsoleAuthorizer, type ConsoleAuthorizerClass, type ConsoleDecide, type ConsoleDecision, type ConsoleGate, ConsolePage, type ConsolePolicyCheck, DASHBOARD_API_PATH, DASHBOARD_APPROVAL_ACTOR_REF, DASHBOARD_BASE_PATH, DASHBOARD_CONSOLE_OPTIONS, DASHBOARD_DEV_TOOLS, DashboardConsoleAccess, DashboardService, type LiveAgentEvent, type ReliabilityOverview, type RunDetailWithLabel, type SpendOverview, type ThreadActivityRowWithLabel, type ThreadDetailWithLabel, type ThreadSpendRowWithLabel, UseConsoleAuthorize, type VisibleConsole, type VisibleConsoles, type WithActorLabel, agentDashboardMountPaths, agentDevTools, anyAuthorize, authorizeByToken, listVisibleConsoles, normalizeConsoleResult, parsePriceInput, registerAviaryConsole, resolveConsoleAuthorize };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import { ExecutionContext, Type, Logger, DynamicModule, StreamableFile, OnModuleInit, HttpException, ExceptionFilter, ArgumentsHost, CanActivate, OnModuleDestroy } from '@nestjs/common';
|
|
5
5
|
import { ModuleRef, HttpAdapterHost } from '@nestjs/core';
|
|
6
6
|
|
|
7
|
+
/** The agent's `tenancy` option, as `AgentModule.forRoot({ tenancy })` holds it. */
|
|
8
|
+
type AgentTenancyOption = 'inherit' | false | {
|
|
9
|
+
enabled?: 'inherit' | boolean;
|
|
10
|
+
kinds?: string[];
|
|
11
|
+
nullRows?: 'tenantless' | 'shared';
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
/** An actor-scoped row decorated with its resolved display label — `null` when unbound or unresolved. */
|
|
8
15
|
interface WithActorLabel {
|
|
9
16
|
actorLabel: string | null;
|
|
@@ -68,7 +75,17 @@ declare class DashboardService {
|
|
|
68
75
|
private readonly actorDirectory?;
|
|
69
76
|
private readonly pricingStore?;
|
|
70
77
|
private readonly approvalPort?;
|
|
71
|
-
|
|
78
|
+
private readonly agentOptions?;
|
|
79
|
+
private readonly contextAccessor?;
|
|
80
|
+
constructor(queries: AgentGovernanceQueries, actorDirectory?: ActorDirectory | undefined, pricingStore?: AgentPricingStore | undefined, approvalPort?: AgentApprovalPort | undefined, agentOptions?: {
|
|
81
|
+
tenancy?: AgentTenancyOption;
|
|
82
|
+
} | undefined, contextAccessor?: unknown | undefined);
|
|
83
|
+
/**
|
|
84
|
+
* The read-model for this request: with the agent's tenancy on, narrowed to the viewer's context
|
|
85
|
+
* tenant (another tenant's thread or run is not found). A store without `forTenant` cannot be
|
|
86
|
+
* narrowed, so the console refuses (`501`) rather than show every tenant's rows.
|
|
87
|
+
*/
|
|
88
|
+
private scoped;
|
|
72
89
|
/** Spend/usage overview for a day range: by-model + by-actor spend and the daily trend, in parallel. */
|
|
73
90
|
spend(range: GovernanceRange): Promise<SpendOverview>;
|
|
74
91
|
/** Top threads by cost for a day range (default 10, highest cost first). */
|
|
@@ -473,6 +490,8 @@ interface UiPageResponse {
|
|
|
473
490
|
status(code: number): unknown;
|
|
474
491
|
setHeader(name: string, value: string): unknown;
|
|
475
492
|
}
|
|
493
|
+
/** The id of the page's JSON config block. */
|
|
494
|
+
declare const AGENT_DASHBOARD_CONFIG_ID = "agent-dashboard-config";
|
|
476
495
|
/**
|
|
477
496
|
* Serves the bundled AI-gateway console SPA at the configured base (+ hashed assets at
|
|
478
497
|
* `<base>/assets`). The path comes from `RouterModule` (set by
|
|
@@ -488,6 +507,11 @@ declare class AgentUiController {
|
|
|
488
507
|
private readonly dir;
|
|
489
508
|
constructor(basePath: string, apiBasePath: string);
|
|
490
509
|
index(req: UiPageRequest, res: UiPageResponse): string;
|
|
510
|
+
/**
|
|
511
|
+
* The page's JSON config block (`agent-dashboard-config`, CSP-safe: data, not script). It carries
|
|
512
|
+
* `switcher` only when another Aviary console is registered.
|
|
513
|
+
*/
|
|
514
|
+
private configBlock;
|
|
491
515
|
asset(file: string): StreamableFile;
|
|
492
516
|
}
|
|
493
517
|
|
|
@@ -547,6 +571,90 @@ declare class ConsoleAuthorizeFilter implements ExceptionFilter<ConsoleAccessDen
|
|
|
547
571
|
*/
|
|
548
572
|
declare function UseConsoleAuthorize(): ClassDecorator & MethodDecorator;
|
|
549
573
|
|
|
574
|
+
/** The process-wide slot every Aviary console registers into (created by whichever boots first). */
|
|
575
|
+
declare const AVIARY_CONSOLES_SLOT: unique symbol;
|
|
576
|
+
/** The icon a console shows in the switcher. An unknown value renders as `generic`. */
|
|
577
|
+
type AviaryConsoleIcon = 'workflow' | 'telescope' | 'media' | 'payments' | 'agent' | 'identity' | 'generic';
|
|
578
|
+
/** What a console's `authorize` answers; only `allowed: true` lists it. */
|
|
579
|
+
interface AviaryConsoleDecision {
|
|
580
|
+
allowed: boolean;
|
|
581
|
+
reason?: string;
|
|
582
|
+
redirectTo?: string;
|
|
583
|
+
}
|
|
584
|
+
/** One console the switcher can list. */
|
|
585
|
+
interface AviaryConsoleEntry {
|
|
586
|
+
/** `/^[a-z][a-z0-9-]*$/`: `'durable'`, `'telescope'`, `'agent'`, `'media'`, … */
|
|
587
|
+
id: string;
|
|
588
|
+
/** Product title: `'Workflows'`, `'Telescope'`, `'Agents'`, `'Media'`. */
|
|
589
|
+
title: string;
|
|
590
|
+
icon: AviaryConsoleIcon;
|
|
591
|
+
/** Same-origin absolute path of the console's page (`/ai-gateway`). */
|
|
592
|
+
path: string;
|
|
593
|
+
/** Sort key: durable 10, telescope 20, agent 30, media 50. */
|
|
594
|
+
order: number;
|
|
595
|
+
/** The console's resolved gate (what its own routes run). Never throws. */
|
|
596
|
+
authorize(context: ExecutionContext): Promise<AviaryConsoleDecision>;
|
|
597
|
+
}
|
|
598
|
+
/** The value at {@link AVIARY_CONSOLES_SLOT}. Data only, so every console's copy is identical. */
|
|
599
|
+
interface AviaryConsoleRegistry {
|
|
600
|
+
readonly version: 1;
|
|
601
|
+
readonly entries: AviaryConsoleEntry[];
|
|
602
|
+
}
|
|
603
|
+
/** One console as `GET <api>/consoles` returns it. */
|
|
604
|
+
interface VisibleConsole {
|
|
605
|
+
id: string;
|
|
606
|
+
title: string;
|
|
607
|
+
icon: AviaryConsoleIcon;
|
|
608
|
+
href: string;
|
|
609
|
+
}
|
|
610
|
+
/** The answer of `GET <api>/consoles`. */
|
|
611
|
+
interface VisibleConsoles {
|
|
612
|
+
version: 1;
|
|
613
|
+
current: string;
|
|
614
|
+
consoles: VisibleConsole[];
|
|
615
|
+
}
|
|
616
|
+
/** How long another console's `authorize` may take before it is left out. */
|
|
617
|
+
declare const CONSOLE_PROBE_TIMEOUT_MS = 300;
|
|
618
|
+
/**
|
|
619
|
+
* Adds a console to the process's switcher registry, creating it when absent. Returns a function
|
|
620
|
+
* that removes the entry again, or `undefined` when it was not added (another registry version, or
|
|
621
|
+
* the id is taken: logged as a warning). A bad `id` or `path` throws.
|
|
622
|
+
*/
|
|
623
|
+
declare function registerAviaryConsole(entry: AviaryConsoleEntry, logger?: {
|
|
624
|
+
warn(message: string): void;
|
|
625
|
+
}): (() => void) | undefined;
|
|
626
|
+
/**
|
|
627
|
+
* The consoles other than `selfId` the viewer may open, by `order` then `id`. Every other entry's
|
|
628
|
+
* `authorize` runs in parallel, each given `timeoutMs`; a timeout, a rejection or any denial hides
|
|
629
|
+
* it. No reason is ever returned.
|
|
630
|
+
*/
|
|
631
|
+
declare function listVisibleConsoles(registry: AviaryConsoleRegistry | undefined, selfId: string, context: ExecutionContext, timeoutMs?: number): Promise<VisibleConsoles>;
|
|
632
|
+
/** The agent console's id in the registry. */
|
|
633
|
+
declare const AGENT_CONSOLE_ID = "agent";
|
|
634
|
+
/**
|
|
635
|
+
* Registers the agent console into the switcher registry (the console's page path, gated by its
|
|
636
|
+
* resolved `authorize`). Provided only when the console's routes are mounted; removed on shutdown.
|
|
637
|
+
*/
|
|
638
|
+
declare class AgentConsoleRegistration implements OnModuleInit, OnModuleDestroy {
|
|
639
|
+
#private;
|
|
640
|
+
private readonly basePath;
|
|
641
|
+
private readonly access;
|
|
642
|
+
constructor(basePath: string, access: DashboardConsoleAccess);
|
|
643
|
+
onModuleInit(): void;
|
|
644
|
+
onModuleDestroy(): void;
|
|
645
|
+
}
|
|
646
|
+
/** What the route hands on to the other consoles' `authorize`: this request's `ExecutionContext`. */
|
|
647
|
+
interface CurrentContext {
|
|
648
|
+
context: ExecutionContext;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* `GET <api>/consoles`: the other Aviary consoles this viewer may open. Behind the console's own
|
|
652
|
+
* access check, like every API route, so only someone who may open this console learns the list.
|
|
653
|
+
*/
|
|
654
|
+
declare class AgentConsolesController {
|
|
655
|
+
consoles(current: CurrentContext): Promise<VisibleConsoles>;
|
|
656
|
+
}
|
|
657
|
+
|
|
550
658
|
interface DevToolInputProperty {
|
|
551
659
|
type: 'string' | 'number' | 'integer' | 'boolean' | 'array';
|
|
552
660
|
description?: string;
|
|
@@ -641,6 +749,10 @@ declare const AGENT_APPROVAL_PORT: unique symbol;
|
|
|
641
749
|
* unauthenticated), `executedByRef` is simply omitted.
|
|
642
750
|
*/
|
|
643
751
|
declare const AGENT_ACTOR_RESOLVER: unique symbol;
|
|
752
|
+
/** `AgentModule`'s options — read for their `tenancy`. Optional: absent → tenancy `'inherit'`. */
|
|
753
|
+
declare const AGENT_OPTIONS: unique symbol;
|
|
754
|
+
/** `@dudousxd/nestjs-context`'s accessor. Optional: absent → the global slot, else tenancy off. */
|
|
755
|
+
declare const CONTEXT_ACCESSOR: unique symbol;
|
|
644
756
|
/** DI token carrying the UI mount base (e.g. `/ai-gateway`). */
|
|
645
757
|
declare const DASHBOARD_BASE_PATH: unique symbol;
|
|
646
758
|
/** DI token carrying the JSON API base the SPA fetches from (e.g. `/ai-gateway/api`). */
|
|
@@ -658,4 +770,4 @@ declare const DASHBOARD_CONSOLE_OPTIONS: unique symbol;
|
|
|
658
770
|
/** DI token: whether the agent's dev tools register into the dev-tools slot. */
|
|
659
771
|
declare const DASHBOARD_DEV_TOOLS: unique symbol;
|
|
660
772
|
|
|
661
|
-
export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_GOVERNANCE_QUERIES, AGENT_PRICING_STORE, type ActorSpendRowWithLabel, AgentApiController, AgentApiModule, AgentDashboardModule, type AgentDashboardMountPathsOptions, type AgentDashboardOptions, type AgentDevTool, AgentDevToolsRegistration, AgentUiController, CONSOLE_AUTHORIZE_MISSING_WARNING, CONSOLE_GATE, CONSOLE_PAGE_METADATA, ConsoleAccessDenied, type ConsoleAuthorize, ConsoleAuthorizeFilter, ConsoleAuthorizeGuard, type ConsoleAuthorizeResult, type ConsoleAuthorizer, type ConsoleAuthorizerClass, type ConsoleDecide, type ConsoleDecision, type ConsoleGate, ConsolePage, type ConsolePolicyCheck, DASHBOARD_API_PATH, DASHBOARD_APPROVAL_ACTOR_REF, DASHBOARD_BASE_PATH, DASHBOARD_CONSOLE_OPTIONS, DASHBOARD_DEV_TOOLS, DashboardConsoleAccess, DashboardService, type LiveAgentEvent, type ReliabilityOverview, type RunDetailWithLabel, type SpendOverview, type ThreadActivityRowWithLabel, type ThreadDetailWithLabel, type ThreadSpendRowWithLabel, UseConsoleAuthorize, type WithActorLabel, agentDashboardMountPaths, agentDevTools, anyAuthorize, authorizeByToken, normalizeConsoleResult, parsePriceInput, resolveConsoleAuthorize };
|
|
773
|
+
export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_CONSOLE_ID, AGENT_DASHBOARD_CONFIG_ID, AGENT_GOVERNANCE_QUERIES, AGENT_OPTIONS, AGENT_PRICING_STORE, AVIARY_CONSOLES_SLOT, type ActorSpendRowWithLabel, AgentApiController, AgentApiModule, AgentConsoleRegistration, AgentConsolesController, AgentDashboardModule, type AgentDashboardMountPathsOptions, type AgentDashboardOptions, type AgentDevTool, AgentDevToolsRegistration, AgentUiController, type AviaryConsoleDecision, type AviaryConsoleEntry, type AviaryConsoleIcon, type AviaryConsoleRegistry, CONSOLE_AUTHORIZE_MISSING_WARNING, CONSOLE_GATE, CONSOLE_PAGE_METADATA, CONSOLE_PROBE_TIMEOUT_MS, CONTEXT_ACCESSOR, ConsoleAccessDenied, type ConsoleAuthorize, ConsoleAuthorizeFilter, ConsoleAuthorizeGuard, type ConsoleAuthorizeResult, type ConsoleAuthorizer, type ConsoleAuthorizerClass, type ConsoleDecide, type ConsoleDecision, type ConsoleGate, ConsolePage, type ConsolePolicyCheck, DASHBOARD_API_PATH, DASHBOARD_APPROVAL_ACTOR_REF, DASHBOARD_BASE_PATH, DASHBOARD_CONSOLE_OPTIONS, DASHBOARD_DEV_TOOLS, DashboardConsoleAccess, DashboardService, type LiveAgentEvent, type ReliabilityOverview, type RunDetailWithLabel, type SpendOverview, type ThreadActivityRowWithLabel, type ThreadDetailWithLabel, type ThreadSpendRowWithLabel, UseConsoleAuthorize, type VisibleConsole, type VisibleConsoles, type WithActorLabel, agentDashboardMountPaths, agentDevTools, anyAuthorize, authorizeByToken, listVisibleConsoles, normalizeConsoleResult, parsePriceInput, registerAviaryConsole, resolveConsoleAuthorize };
|