@memberjunction/ng-dashboards 6.2.0-edge.3 → 6.2.0-edge.4
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/AI/components/analytics/realtime/realtime-transcripts-data.d.ts +4 -3
- package/dist/AI/components/analytics/realtime/realtime-transcripts-data.d.ts.map +1 -1
- package/dist/AI/components/analytics/realtime/realtime-transcripts-data.js +8 -5
- package/dist/AI/components/analytics/realtime/realtime-transcripts-data.js.map +1 -1
- package/dist/AI/components/duplicates/compare-value.component.d.ts +67 -0
- package/dist/AI/components/duplicates/compare-value.component.d.ts.map +1 -0
- package/dist/AI/components/duplicates/compare-value.component.js +168 -0
- package/dist/AI/components/duplicates/compare-value.component.js.map +1 -0
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.d.ts +49 -3
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.d.ts.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js +287 -169
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.d.ts +77 -0
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.d.ts.map +1 -0
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.js +116 -0
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.js.map +1 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts +1 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js +16 -4
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js.map +1 -1
- package/dist/AI/components/tags/tags-resource.component.d.ts +2 -0
- package/dist/AI/components/tags/tags-resource.component.d.ts.map +1 -1
- package/dist/AI/components/tags/tags-resource.component.js +12 -6
- package/dist/AI/components/tags/tags-resource.component.js.map +1 -1
- package/dist/AI/components/vectors/vector-index-auto.d.ts +29 -0
- package/dist/AI/components/vectors/vector-index-auto.d.ts.map +1 -0
- package/dist/AI/components/vectors/vector-index-auto.js +59 -0
- package/dist/AI/components/vectors/vector-index-auto.js.map +1 -0
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts +9 -0
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts.map +1 -1
- package/dist/AI/components/vectors/vector-management-resource.component.js +65 -20
- package/dist/AI/components/vectors/vector-management-resource.component.js.map +1 -1
- package/dist/Actions/components/actions-overview.component.d.ts.map +1 -1
- package/dist/Actions/components/actions-overview.component.js +7 -3
- package/dist/Actions/components/actions-overview.component.js.map +1 -1
- package/dist/Actions/components/categories-list-view.component.d.ts.map +1 -1
- package/dist/Actions/components/categories-list-view.component.js +3 -2
- package/dist/Actions/components/categories-list-view.component.js.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.d.ts.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.js +1 -0
- package/dist/ComponentStudio/component-studio-dashboard.component.js.map +1 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts +0 -3
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js +5 -14
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js.map +1 -1
- package/dist/ComponentStudio/components/artifact-load-dialog.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/artifact-load-dialog.component.js +1 -0
- package/dist/ComponentStudio/components/artifact-load-dialog.component.js.map +1 -1
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.js +1 -0
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.js.map +1 -1
- package/dist/Credentials/components/credentials-list-resource.component.d.ts +2 -0
- package/dist/Credentials/components/credentials-list-resource.component.d.ts.map +1 -1
- package/dist/Credentials/components/credentials-list-resource.component.js +12 -10
- package/dist/Credentials/components/credentials-list-resource.component.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-browser-agent-context.d.ts +14 -43
- package/dist/DashboardBrowser/dashboard-browser-agent-context.d.ts.map +1 -1
- package/dist/DashboardBrowser/dashboard-browser-agent-context.js +6 -29
- package/dist/DashboardBrowser/dashboard-browser-agent-context.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-browser-resource.component.d.ts +174 -321
- package/dist/DashboardBrowser/dashboard-browser-resource.component.d.ts.map +1 -1
- package/dist/DashboardBrowser/dashboard-browser-resource.component.js +522 -1195
- package/dist/DashboardBrowser/dashboard-browser-resource.component.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-library-filter.d.ts +116 -0
- package/dist/DashboardBrowser/dashboard-library-filter.d.ts.map +1 -0
- package/dist/DashboardBrowser/dashboard-library-filter.js +277 -0
- package/dist/DashboardBrowser/dashboard-library-filter.js.map +1 -0
- package/dist/DashboardBrowser/dashboard-share-dialog.component.d.ts +1 -1
- package/dist/DashboardBrowser/dashboard-share-dialog.component.js.map +1 -1
- package/dist/DashboardBrowser/dashboards-agent-tools.d.ts +26 -0
- package/dist/DashboardBrowser/dashboards-agent-tools.d.ts.map +1 -0
- package/dist/DashboardBrowser/dashboards-agent-tools.js +32 -0
- package/dist/DashboardBrowser/dashboards-agent-tools.js.map +1 -0
- package/dist/DashboardBrowser/dashboards-categories-resource.component.d.ts +58 -0
- package/dist/DashboardBrowser/dashboards-categories-resource.component.d.ts.map +1 -0
- package/dist/DashboardBrowser/dashboards-categories-resource.component.js +391 -0
- package/dist/DashboardBrowser/dashboards-categories-resource.component.js.map +1 -0
- package/dist/DashboardBrowser/dashboards-categories.helpers.d.ts +37 -0
- package/dist/DashboardBrowser/dashboards-categories.helpers.d.ts.map +1 -0
- package/dist/DashboardBrowser/dashboards-categories.helpers.js +68 -0
- package/dist/DashboardBrowser/dashboards-categories.helpers.js.map +1 -0
- package/dist/DashboardEditor/dashboard-editor.component.d.ts +295 -0
- package/dist/DashboardEditor/dashboard-editor.component.d.ts.map +1 -0
- package/dist/DashboardEditor/dashboard-editor.component.js +1022 -0
- package/dist/DashboardEditor/dashboard-editor.component.js.map +1 -0
- package/dist/DashboardEditor/dashboard-editor.types.d.ts +23 -0
- package/dist/DashboardEditor/dashboard-editor.types.d.ts.map +1 -0
- package/dist/DashboardEditor/dashboard-editor.types.js +3 -0
- package/dist/DashboardEditor/dashboard-editor.types.js.map +1 -0
- package/dist/DashboardEditor/dashboard-viewer-factory.d.ts +11 -0
- package/dist/DashboardEditor/dashboard-viewer-factory.d.ts.map +1 -0
- package/dist/DashboardEditor/dashboard-viewer-factory.js +17 -0
- package/dist/DashboardEditor/dashboard-viewer-factory.js.map +1 -0
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts +26 -0
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.js +302 -219
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/DataExplorer/services/explorer-state.service.d.ts +1 -1
- package/dist/DataExplorer/services/explorer-state.service.js +2 -5
- package/dist/DataExplorer/services/explorer-state.service.js.map +1 -1
- package/dist/FormBuilder/form-builder-resource.component.d.ts +0 -14
- package/dist/FormBuilder/form-builder-resource.component.d.ts.map +1 -1
- package/dist/FormBuilder/form-builder-resource.component.js +7 -29
- package/dist/FormBuilder/form-builder-resource.component.js.map +1 -1
- package/dist/Home/home-agent-context.d.ts +29 -10
- package/dist/Home/home-agent-context.d.ts.map +1 -1
- package/dist/Home/home-agent-context.js +50 -24
- package/dist/Home/home-agent-context.js.map +1 -1
- package/dist/Home/home-dashboard-switcher.component.d.ts +95 -0
- package/dist/Home/home-dashboard-switcher.component.d.ts.map +1 -0
- package/dist/Home/home-dashboard-switcher.component.js +442 -0
- package/dist/Home/home-dashboard-switcher.component.js.map +1 -0
- package/dist/Home/home-dashboard.component.d.ts +330 -17
- package/dist/Home/home-dashboard.component.d.ts.map +1 -1
- package/dist/Home/home-dashboard.component.js +1702 -1014
- package/dist/Home/home-dashboard.component.js.map +1 -1
- package/dist/Home/home-menus.d.ts +38 -0
- package/dist/Home/home-menus.d.ts.map +1 -0
- package/dist/Home/home-menus.js +53 -0
- package/dist/Home/home-menus.js.map +1 -0
- package/dist/Home/home-pinned-dashboards.d.ts +33 -0
- package/dist/Home/home-pinned-dashboards.d.ts.map +1 -0
- package/dist/Home/home-pinned-dashboards.js +76 -0
- package/dist/Home/home-pinned-dashboards.js.map +1 -0
- package/dist/PredictiveStudio/components/ps-production.component.d.ts +5 -1
- package/dist/PredictiveStudio/components/ps-production.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-production.component.js +64 -41
- package/dist/PredictiveStudio/components/ps-production.component.js.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.d.ts.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.js +3 -2
- package/dist/QueryBrowser/query-browser-resource.component.js.map +1 -1
- package/dist/RealtimeRecordings/realtime-recordings-dashboard.component.js +2 -2
- package/dist/RealtimeRecordings/realtime-recordings-dashboard.component.js.map +1 -1
- package/dist/TelephonyOperations/telephony-operations-dashboard.component.d.ts +1 -0
- package/dist/TelephonyOperations/telephony-operations-dashboard.component.d.ts.map +1 -1
- package/dist/TelephonyOperations/telephony-operations-dashboard.component.js +7 -0
- package/dist/TelephonyOperations/telephony-operations-dashboard.component.js.map +1 -1
- package/dist/Testing/components/testing-explorer.component.d.ts.map +1 -1
- package/dist/Testing/components/testing-explorer.component.js +7 -7
- package/dist/Testing/components/testing-explorer.component.js.map +1 -1
- package/dist/ai-dashboards.module.d.ts +21 -20
- package/dist/ai-dashboards.module.d.ts.map +1 -1
- package/dist/ai-dashboards.module.js +4 -1
- package/dist/ai-dashboards.module.js.map +1 -1
- package/dist/core-dashboards.module.d.ts +69 -62
- package/dist/core-dashboards.module.d.ts.map +1 -1
- package/dist/core-dashboards.module.js +22 -2
- package/dist/core-dashboards.module.js.map +1 -1
- package/dist/data-explorer-dashboards.module.d.ts +1 -1
- package/dist/data-explorer-dashboards.module.d.ts.map +1 -1
- package/dist/data-explorer-dashboards.module.js +3 -1
- package/dist/data-explorer-dashboards.module.js.map +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/dist/shared/dashboard-library-changes.d.ts +23 -0
- package/dist/shared/dashboard-library-changes.d.ts.map +1 -0
- package/dist/shared/dashboard-library-changes.js +26 -0
- package/dist/shared/dashboard-library-changes.js.map +1 -0
- package/dist/shared/dashboard-owner-names.d.ts +17 -0
- package/dist/shared/dashboard-owner-names.d.ts.map +1 -0
- package/dist/shared/dashboard-owner-names.js +65 -0
- package/dist/shared/dashboard-owner-names.js.map +1 -0
- package/dist/shared/dashboard-recents.d.ts +34 -0
- package/dist/shared/dashboard-recents.d.ts.map +1 -0
- package/dist/shared/dashboard-recents.js +87 -0
- package/dist/shared/dashboard-recents.js.map +1 -0
- package/dist/shared/dashboards-app-install.d.ts +59 -0
- package/dist/shared/dashboards-app-install.d.ts.map +1 -0
- package/dist/shared/dashboards-app-install.js +97 -0
- package/dist/shared/dashboards-app-install.js.map +1 -0
- package/dist/shared/dashboards-app.helpers.d.ts +42 -0
- package/dist/shared/dashboards-app.helpers.d.ts.map +1 -0
- package/dist/shared/dashboards-app.helpers.js +143 -0
- package/dist/shared/dashboards-app.helpers.js.map +1 -0
- package/package.json +69 -68
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Pure helpers for the Dashboard Browser's AI-agent integration.
|
|
3
|
-
*
|
|
4
|
-
* These functions are intentionally free of Angular / component dependencies so
|
|
5
|
-
* they can be unit-tested in isolation. The resource component
|
|
6
|
-
* ({@link DashboardBrowserResourceComponent}) supplies a plain snapshot of its
|
|
7
|
-
* current state and these helpers shape it into the flat key-value `AgentContext`
|
|
8
|
-
* object that flows to the async chat agent and the realtime co-agent via
|
|
9
|
-
* `NavigationService.SetAgentContext`.
|
|
10
|
-
*
|
|
11
|
-
* 🔒 SAFETY: this module only *describes* state and validates input. It performs
|
|
12
|
-
* no mutation and has no side effects.
|
|
13
|
-
*/
|
|
14
1
|
/** The two record-view modes the browser list supports. */
|
|
15
2
|
const VALID_BROWSER_VIEW_MODES = ['cards', 'list'];
|
|
16
3
|
/**
|
|
@@ -21,6 +8,8 @@ const VALID_BROWSER_VIEW_MODES = ['cards', 'list'];
|
|
|
21
8
|
* used by the Data Explorer's agent context.
|
|
22
9
|
*/
|
|
23
10
|
export const AGENT_CONTEXT_NAME_LIST_CAP = 25;
|
|
11
|
+
/** How many recently opened dashboards the context names. */
|
|
12
|
+
export const RECENTLY_OPENED_NAME_CAP = 3;
|
|
24
13
|
/**
|
|
25
14
|
* Cap an array of names to {@link AGENT_CONTEXT_NAME_LIST_CAP} entries.
|
|
26
15
|
* Pure + deterministic so the context shape stays unit-testable.
|
|
@@ -47,7 +36,7 @@ export function isValidBrowserViewMode(mode) {
|
|
|
47
36
|
return IsValidBrowserViewMode(mode);
|
|
48
37
|
}
|
|
49
38
|
/**
|
|
50
|
-
* Build the agent-visible context object for the
|
|
39
|
+
* Build the agent-visible context object for the Library page.
|
|
51
40
|
*
|
|
52
41
|
* Keeping this a pure function (no `this`) makes the context shape unit-testable
|
|
53
42
|
* and decouples it from change-detection timing.
|
|
@@ -58,12 +47,10 @@ export function isValidBrowserViewMode(mode) {
|
|
|
58
47
|
export function BuildDashboardBrowserAgentContext(input) {
|
|
59
48
|
const hasSearch = input.SearchText.trim().length > 0;
|
|
60
49
|
const context = {
|
|
61
|
-
Mode: input.Mode,
|
|
62
|
-
SelectedDashboardId: input.SelectedDashboardId,
|
|
63
|
-
SelectedDashboardName: input.SelectedDashboardName,
|
|
64
50
|
VisibleDashboards: capNames(input.VisibleDashboardNames),
|
|
65
51
|
TotalDashboardCount: input.TotalDashboardCount,
|
|
66
52
|
FilteredDashboardCount: input.FilteredDashboardCount,
|
|
53
|
+
LibraryFilter: input.LibraryFilter,
|
|
67
54
|
HasSearch: hasSearch,
|
|
68
55
|
SearchText: input.SearchText,
|
|
69
56
|
AvailableCategories: capNames(input.AvailableCategoryNames),
|
|
@@ -71,6 +58,8 @@ export function BuildDashboardBrowserAgentContext(input) {
|
|
|
71
58
|
SelectedCategoryName: input.SelectedCategoryName,
|
|
72
59
|
ViewMode: input.ViewMode,
|
|
73
60
|
IsLoading: input.IsLoading,
|
|
61
|
+
LibraryCounts: { ...input.LibraryCounts },
|
|
62
|
+
RecentlyOpenedNames: input.RecentlyOpenedNames.slice(0, RECENTLY_OPENED_NAME_CAP),
|
|
74
63
|
};
|
|
75
64
|
// When more dashboards/categories are visible than we publish names for, tell
|
|
76
65
|
// the co-agent the true total so it knows the streamed list is truncated.
|
|
@@ -80,18 +69,6 @@ export function BuildDashboardBrowserAgentContext(input) {
|
|
|
80
69
|
if (input.AvailableCategoryNames.length > AGENT_CONTEXT_NAME_LIST_CAP) {
|
|
81
70
|
context['AvailableCategoryCount'] = input.AvailableCategoryNames.length;
|
|
82
71
|
}
|
|
83
|
-
// Opened-dashboard awareness: only publish these fields when a dashboard is
|
|
84
|
-
// actually open (view/edit). At the list level we omit them entirely so the
|
|
85
|
-
// agent's context stays focused on browse/filter state.
|
|
86
|
-
if (input.Mode !== 'list') {
|
|
87
|
-
context['OpenedDashboardName'] = input.OpenedDashboardName ?? null;
|
|
88
|
-
context['OpenedDashboardId'] = input.OpenedDashboardId ?? null;
|
|
89
|
-
context['OpenedDashboardIsEditing'] = input.OpenedDashboardIsEditing ?? false;
|
|
90
|
-
context['OpenedDashboardCanEdit'] = input.OpenedDashboardCanEdit ?? false;
|
|
91
|
-
const panels = input.OpenedDashboardPanels ?? [];
|
|
92
|
-
context['OpenedDashboardPanelCount'] = panels.length;
|
|
93
|
-
context['OpenedDashboardPanels'] = panels.slice(0, AGENT_CONTEXT_NAME_LIST_CAP);
|
|
94
|
-
}
|
|
95
72
|
return context;
|
|
96
73
|
}
|
|
97
74
|
/** @deprecated Use {@link BuildDashboardBrowserAgentContext}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-browser-agent-context.js","sourceRoot":"","sources":["../../src/DashboardBrowser/dashboard-browser-agent-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,2DAA2D;AAC3D,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAK5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,KAAwB;IACtC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAa;IAChD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAK,wBAA8C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtG,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,sBAAsB,CAAC,IAAa;IAChD,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAwED;;;;;;;;GAQG;AACH,MAAM,UAAU,iCAAiC,CAC7C,KAAwC;IAExC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAErD,MAAM,OAAO,GAA4B;QACrC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;QAC9C,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;QAClD,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC;QACxD,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;QAC9C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;QACpD,SAAS,EAAE,SAAS;QACpB,UAA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AAC,CAAC;IACpF,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iCAAiC,CAC7C,KAAwC;IAExC,OAAO,iCAAiC,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC","sourcesContent":["/**\n * @fileoverview Pure helpers for the Dashboard Browser's AI-agent integration.\n *\n * These functions are intentionally free of Angular / component dependencies so\n * they can be unit-tested in isolation. The resource component\n * ({@link DashboardBrowserResourceComponent}) supplies a plain snapshot of its\n * current state and these helpers shape it into the flat key-value `AgentContext`\n * object that flows to the async chat agent and the realtime co-agent via\n * `NavigationService.SetAgentContext`.\n *\n * 🔒 SAFETY: this module only *describes* state and validates input. It performs\n * no mutation and has no side effects.\n */\n\n/** The two browser-mode levels surfaced to the agent. */\ntype BrowserMode = 'list' | 'view' | 'edit';\n\n/**\n * A single panel/widget on the currently-open dashboard, as surfaced to the\n * agent. Purely descriptive — no entity references, no config payloads, just\n * enough for the agent to reason about (and describe) what's on the dashboard.\n */\nexport interface OpenedDashboardPanelSummary {\n /** The panel's display title (e.g. \"Active Members\"). */\n Title: string;\n /** The part-type name (e.g. \"View\", \"Query\", \"WebURL\", \"Artifact\"). */\n PartTypeName: string;\n /** Optional Font Awesome icon class for the panel, when one is set. */\n Icon?: string;\n}\n\n/** The two record-view modes the browser list supports. */\nconst VALID_BROWSER_VIEW_MODES = ['cards', 'list'] as const;\n\n/** Narrowed union for the browser list's view mode. */\nexport type BrowserViewMode = (typeof VALID_BROWSER_VIEW_MODES)[number];\n\n/**\n * Upper bound on how many names we publish in a name-list context field\n * (VisibleDashboards, AvailableCategories). Keeping the streamed note bounded\n * avoids flooding the co-agent with hundreds of names; when the underlying list\n * is larger we surface a companion total-count field instead. Mirrors the cap\n * used by the Data Explorer's agent context.\n */\nexport const AGENT_CONTEXT_NAME_LIST_CAP = 25;\n\n/**\n * Cap an array of names to {@link AGENT_CONTEXT_NAME_LIST_CAP} entries.\n * Pure + deterministic so the context shape stays unit-testable.\n *\n * @param names - the full list of names (already de-duplicated by the caller)\n * @returns the first N names, where N is the cap\n */\nfunction capNames(names: readonly string[]): string[] {\n return names.slice(0, AGENT_CONTEXT_NAME_LIST_CAP);\n}\n\n/**\n * Type-guard / validator for a browser view-mode string. Keeps the\n * `SwitchViewMode` client tool tolerant of arbitrary agent input — only the two\n * known modes are accepted.\n *\n * @param mode - candidate mode string (may be anything the agent passes)\n * @returns true when `mode` is one of cards | list\n */\nexport function IsValidBrowserViewMode(mode: unknown): mode is BrowserViewMode {\n return typeof mode === 'string' && (VALID_BROWSER_VIEW_MODES as readonly string[]).includes(mode);\n}\n\n/** @deprecated Use {@link IsValidBrowserViewMode}. */\nexport function isValidBrowserViewMode(mode: unknown): mode is BrowserViewMode {\n return IsValidBrowserViewMode(mode);\n}\n\n/**\n * The plain, component-supplied snapshot used to build the agent context.\n * Mirrors the salient slice of {@link DashboardBrowserResourceComponent}'s state.\n */\nexport interface DashboardBrowserAgentContextInput {\n /** Current browser mode: list / view / edit. */\n Mode: BrowserMode;\n /** ID of the currently selected dashboard, or null at the list level. */\n SelectedDashboardId: string | null;\n /** Display name of the currently selected dashboard, or null. */\n SelectedDashboardName: string | null;\n /**\n * Names of the dashboards currently visible in the list (after any agent\n * search narrowing) — the ones the agent can open by name via OpenDashboard.\n * The component supplies the full visible list; this helper bounds it — see\n * {@link AGENT_CONTEXT_NAME_LIST_CAP}.\n */\n VisibleDashboardNames: string[];\n /** Total number of dashboards accessible to the user (unfiltered). */\n TotalDashboardCount: number;\n /**\n * Number of dashboards currently visible in the list. Equals\n * `VisibleDashboardNames.length` before the name-list cap is applied, so the\n * agent knows the true filtered count even when the published names are\n * truncated.\n */\n FilteredDashboardCount: number;\n /** The current free-text search applied to the dashboard list, or '' when none. */\n SearchText: string;\n /**\n * Names of the categories accessible to the user (so the agent can pick one\n * to filter by via SelectCategory). The component supplies the full list;\n * this helper bounds it — see {@link AGENT_CONTEXT_NAME_LIST_CAP}.\n */\n AvailableCategoryNames: string[];\n /** ID of the currently selected category filter, or null (root). */\n SelectedCategoryId: string | null;\n /** Display name of the currently selected category, or null (root). */\n SelectedCategoryName: string | null;\n /** Active record-view mode for the list (cards / list). */\n ViewMode: BrowserViewMode;\n /** Whether the browser is currently loading data. */\n IsLoading: boolean;\n\n // ----------------------------------------------------------------------\n // Opened-dashboard awareness (present only when Mode is 'view' or 'edit').\n // When a dashboard is open these describe its contents so the agent isn't\n // blind to what's on screen. All null/empty at the list level.\n // ----------------------------------------------------------------------\n\n /**\n * Name of the dashboard currently open in the view/edit pane, or null when\n * at the list level. Distinct from {@link SelectedDashboardName} only in\n * intent: this field is the explicit \"a dashboard is OPEN\" signal.\n */\n OpenedDashboardName?: string | null;\n /** ID of the dashboard currently open, or null at the list level. */\n OpenedDashboardId?: string | null;\n /** Whether the open dashboard is in edit mode (Mode === 'edit'). */\n OpenedDashboardIsEditing?: boolean;\n /** Whether the current user may edit the open dashboard (from permissions). */\n OpenedDashboardCanEdit?: boolean;\n /**\n * The panels/widgets on the open dashboard. Empty array when none / not\n * open. The component supplies the full list; this helper bounds it — see\n * {@link AGENT_CONTEXT_NAME_LIST_CAP}.\n */\n OpenedDashboardPanels?: OpenedDashboardPanelSummary[];\n}\n\n/**\n * Build the agent-visible context object for the Dashboard Browser.\n *\n * Keeping this a pure function (no `this`) makes the context shape unit-testable\n * and decouples it from change-detection timing.\n *\n * @param input - the component's current state snapshot\n * @returns a flat key-value object suitable for `SetAgentContext`\n */\nexport function BuildDashboardBrowserAgentContext(\n input: DashboardBrowserAgentContextInput,\n): Record<string, unknown> {\n const hasSearch = input.SearchText.trim().length > 0;\n\n const context: Record<string, unknown> = {\n Mode: input.Mode,\n SelectedDashboardId: input.SelectedDashboardId,\n SelectedDashboardName: input.SelectedDashboardName,\n VisibleDashboards: capNames(input.VisibleDashboardNames),\n TotalDashboardCount: input.TotalDashboardCount,\n FilteredDashboardCount: input.FilteredDashboardCount,\n HasSearch: hasSearch,\n SearchText: input.SearchText,\n AvailableCategories: capNames(input.AvailableCategoryNames),\n SelectedCategoryId: input.SelectedCategoryId,\n SelectedCategoryName: input.SelectedCategoryName,\n ViewMode: input.ViewMode,\n IsLoading: input.IsLoading,\n };\n\n // When more dashboards/categories are visible than we publish names for, tell\n // the co-agent the true total so it knows the streamed list is truncated.\n if (input.VisibleDashboardNames.length > AGENT_CONTEXT_NAME_LIST_CAP) {\n context['VisibleDashboardCount'] = input.VisibleDashboardNames.length;\n }\n if (input.AvailableCategoryNames.length > AGENT_CONTEXT_NAME_LIST_CAP) {\n context['AvailableCategoryCount'] = input.AvailableCategoryNames.length;\n }\n\n // Opened-dashboard awareness: only publish these fields when a dashboard is\n // actually open (view/edit). At the list level we omit them entirely so the\n // agent's context stays focused on browse/filter state.\n if (input.Mode !== 'list') {\n context['OpenedDashboardName'] = input.OpenedDashboardName ?? null;\n context['OpenedDashboardId'] = input.OpenedDashboardId ?? null;\n context['OpenedDashboardIsEditing'] = input.OpenedDashboardIsEditing ?? false;\n context['OpenedDashboardCanEdit'] = input.OpenedDashboardCanEdit ?? false;\n\n const panels = input.OpenedDashboardPanels ?? [];\n context['OpenedDashboardPanelCount'] = panels.length;\n context['OpenedDashboardPanels'] = panels.slice(0, AGENT_CONTEXT_NAME_LIST_CAP);\n }\n\n return context;\n}\n\n/** @deprecated Use {@link BuildDashboardBrowserAgentContext}. */\nexport function buildDashboardBrowserAgentContext(\n input: DashboardBrowserAgentContextInput,\n): Record<string, unknown> {\n return BuildDashboardBrowserAgentContext(input);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dashboard-browser-agent-context.js","sourceRoot":"","sources":["../../src/DashboardBrowser/dashboard-browser-agent-context.ts"],"names":[],"mappings":"AAeA,2DAA2D;AAC3D,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAK5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,6DAA6D;AAC7D,MAAM,CA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8E;IAC9E,0EAA0E;IAC1E,IAAI,KAAK,CAAC,qBAAqB,CAAC,MAAM,GAAG,2BAA2B,EAAE,CAAC;QACnE,OAAO,CAAC,uBAAuB,CAAC,GAAG,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC;IAC1E,CAAC;IACD,IAAI,KAAK,CAAC,sBAAsB,CAAC,MAAM,GAAG,2BAA2B,EAAE,CAAC;QACpE,OAAO,CAAC,wBAAwB,CAAC,GAAG,KAAK,CAAC,sBAAsB,CAAC,MAAM,CAAC;IAC5E,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iCAAiC,CAC7C,KAAwC;IAExC,OAAO,iCAAiC,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC","sourcesContent":["/**\n * @fileoverview Pure helpers for the AI-agent integration of the Dashboards app's Library page.\n *\n * These functions are intentionally free of Angular / component dependencies so\n * they can be unit-tested in isolation. The resource component\n * ({@link DashboardBrowserResourceComponent}) supplies a plain snapshot of its\n * current state and these helpers shape it into the flat key-value `AgentContext`\n * object that flows to the async chat agent and the realtime co-agent via\n * `NavigationService.SetAgentContext`.\n *\n * 🔒 SAFETY: this module only *describes* state and validates input. It performs\n * no mutation and has no side effects.\n */\nimport type { DashboardLibraryFilter } from './dashboard-library-filter';\n\n/** The two record-view modes the browser list supports. */\nconst VALID_BROWSER_VIEW_MODES = ['cards', 'list'] as const;\n\n/** Narrowed union for the browser list's view mode. */\nexport type BrowserViewMode = (typeof VALID_BROWSER_VIEW_MODES)[number];\n\n/**\n * Upper bound on how many names we publish in a name-list context field\n * (VisibleDashboards, AvailableCategories). Keeping the streamed note bounded\n * avoids flooding the co-agent with hundreds of names; when the underlying list\n * is larger we surface a companion total-count field instead. Mirrors the cap\n * used by the Data Explorer's agent context.\n */\nexport const AGENT_CONTEXT_NAME_LIST_CAP = 25;\n\n/** How many recently opened dashboards the context names. */\nexport const RECENTLY_OPENED_NAME_CAP = 3;\n\n/**\n * Cap an array of names to {@link AGENT_CONTEXT_NAME_LIST_CAP} entries.\n * Pure + deterministic so the context shape stays unit-testable.\n *\n * @param names - the full list of names (already de-duplicated by the caller)\n * @returns the first N names, where N is the cap\n */\nfunction capNames(names: readonly string[]): string[] {\n return names.slice(0, AGENT_CONTEXT_NAME_LIST_CAP);\n}\n\n/**\n * Type-guard / validator for a browser view-mode string. Keeps the\n * `SwitchViewMode` client tool tolerant of arbitrary agent input — only the two\n * known modes are accepted.\n *\n * @param mode - candidate mode string (may be anything the agent passes)\n * @returns true when `mode` is one of cards | list\n */\nexport function IsValidBrowserViewMode(mode: unknown): mode is BrowserViewMode {\n return typeof mode === 'string' && (VALID_BROWSER_VIEW_MODES as readonly string[]).includes(mode);\n}\n\n/** @deprecated Use {@link IsValidBrowserViewMode}. */\nexport function isValidBrowserViewMode(mode: unknown): mode is BrowserViewMode {\n return IsValidBrowserViewMode(mode);\n}\n\n/**\n * The plain, component-supplied snapshot used to build the agent context.\n * Mirrors the salient slice of {@link DashboardBrowserResourceComponent}'s state.\n */\nexport interface DashboardBrowserAgentContextInput {\n /**\n * Names of the dashboards currently visible in the list (after the Library\n * filter and any agent search narrowing) — the ones the agent can open by name\n * via OpenDashboard.\n * The component supplies the full visible list; this helper bounds it — see\n * {@link AGENT_CONTEXT_NAME_LIST_CAP}.\n */\n VisibleDashboardNames: string[];\n /** Total number of dashboards accessible to the user (unfiltered). */\n TotalDashboardCount: number;\n /**\n * Number of dashboards currently visible in the list. Equals\n * `VisibleDashboardNames.length` before the name-list cap is applied, so the\n * agent knows the true filtered count even when the published names are\n * truncated.\n */\n FilteredDashboardCount: number;\n /** The active Library filter in the rail (all, mine, shared, favorites, recent). */\n LibraryFilter: DashboardLibraryFilter;\n /** How many dashboards each Library filter lists. */\n LibraryCounts: Record<DashboardLibraryFilter, number>;\n /** The Config dashboards the user opened last, the most recent first. */\n RecentlyOpenedNames: string[];\n /** The current free-text search applied to the dashboard list, or '' when none. */\n SearchText: string;\n /**\n * Names of the categories accessible to the user (so the agent can pick one\n * to filter by via SelectCategory). The component supplies the full list;\n * this helper bounds it — see {@link AGENT_CONTEXT_NAME_LIST_CAP}.\n */\n AvailableCategoryNames: string[];\n /** ID of the currently selected category filter, or null (root). */\n SelectedCategoryId: string | null;\n /** Display name of the currently selected category, or null (root). */\n SelectedCategoryName: string | null;\n /** Active record-view mode for the list (cards / list). */\n ViewMode: BrowserViewMode;\n /** Whether the browser is currently loading data. */\n IsLoading: boolean;\n}\n\n/**\n * Build the agent-visible context object for the Library page.\n *\n * Keeping this a pure function (no `this`) makes the context shape unit-testable\n * and decouples it from change-detection timing.\n *\n * @param input - the component's current state snapshot\n * @returns a flat key-value object suitable for `SetAgentContext`\n */\nexport function BuildDashboardBrowserAgentContext(\n input: DashboardBrowserAgentContextInput,\n): Record<string, unknown> {\n const hasSearch = input.SearchText.trim().length > 0;\n\n const context: Record<string, unknown> = {\n VisibleDashboards: capNames(input.VisibleDashboardNames),\n TotalDashboardCount: input.TotalDashboardCount,\n FilteredDashboardCount: input.FilteredDashboardCount,\n LibraryFilter: input.LibraryFilter,\n HasSearch: hasSearch,\n SearchText: input.SearchText,\n AvailableCategories: capNames(input.AvailableCategoryNames),\n SelectedCategoryId: input.SelectedCategoryId,\n SelectedCategoryName: input.SelectedCategoryName,\n ViewMode: input.ViewMode,\n IsLoading: input.IsLoading,\n LibraryCounts: { ...input.LibraryCounts },\n RecentlyOpenedNames: input.RecentlyOpenedNames.slice(0, RECENTLY_OPENED_NAME_CAP),\n };\n\n // When more dashboards/categories are visible than we publish names for, tell\n // the co-agent the true total so it knows the streamed list is truncated.\n if (input.VisibleDashboardNames.length > AGENT_CONTEXT_NAME_LIST_CAP) {\n context['VisibleDashboardCount'] = input.VisibleDashboardNames.length;\n }\n if (input.AvailableCategoryNames.length > AGENT_CONTEXT_NAME_LIST_CAP) {\n context['AvailableCategoryCount'] = input.AvailableCategoryNames.length;\n }\n\n return context;\n}\n\n/** @deprecated Use {@link BuildDashboardBrowserAgentContext}. */\nexport function buildDashboardBrowserAgentContext(\n input: DashboardBrowserAgentContextInput,\n): Record<string, unknown> {\n return BuildDashboardBrowserAgentContext(input);\n}\n"]}
|