Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e5f65f1
implement dashboard agent scaffolding
mbondyra Oct 13, 2025
5232b4e
types
mbondyra Oct 13, 2025
f6144fe
add a comment
mbondyra Oct 14, 2025
2343ebe
eslint
mbondyra Oct 14, 2025
b1b655b
[CI] Auto-commit changed files from 'node scripts/lint_packages --fix'
kibanamachine Oct 14, 2025
9453e6c
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 14, 2025
ec2cc93
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 14, 2025
286e5d1
Merge branch 'main' into dashboard_tool
elasticmachine Oct 27, 2025
9dbdc34
Merge branch 'main' into dashboard_tool
mbondyra Oct 28, 2025
02267f8
Merge remote-tracking branch 'upstream/main' into dashboard_tool
qn895 Oct 29, 2025
ee01831
Clean up console
qn895 Oct 29, 2025
69359ed
Add get and update
qn895 Nov 13, 2025
e8c6783
Dashboard
qn895 Nov 13, 2025
620a036
Tool
qn895 Nov 13, 2025
9fdc7ad
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Nov 13, 2025
cb61753
Merge branch 'main' into dashboards-in-agent-groundwork
rbrtj Nov 18, 2025
9841ed0
Merge branch 'main' into dashboards-in-agent-groundwork
rbrtj Nov 18, 2025
6de9005
Dashboard tools availability based on the UI setting
rbrtj Nov 18, 2025
a522691
cleanup
rbrtj Nov 19, 2025
f793076
exposing CRUD methods for dashboard plugin as a client
mbondyra Nov 20, 2025
38fae94
Merge remote-tracking branch 'upstream/dashboard_client' into dashboa…
rbrtj Nov 20, 2025
b2d527a
Update create_dashboard to work with new dashboard client api
rbrtj Nov 20, 2025
6a035aa
Merge remote-tracking branch 'upstream/main' into dashboards-in-agent…
rbrtj Nov 21, 2025
83f2075
Update create_dashboard logic to use normalized panel data
rbrtj Nov 24, 2025
6efb72b
extract normalizePanels to an util && refactor update_dashboard tool
rbrtj Nov 25, 2025
e364f22
Update codeowners & readme
rbrtj Nov 27, 2025
c202dec
Remove get_dashboard tool
rbrtj Nov 27, 2025
1f7430c
update codeowners & plugin list
rbrtj Nov 27, 2025
230c520
Hide dashboardAgent under feature flag
rbrtj Nov 28, 2025
f9310bf
Merge branch 'main' into dashboards-in-agent-groundwork
rbrtj Nov 28, 2025
d763296
Changes from node scripts/lint_ts_projects --fix
kibanamachine Nov 28, 2025
341d88c
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Nov 28, 2025
83464c8
type error fix & remove unnecessary const
rbrtj Dec 1, 2025
479de6a
Merge branch 'main' into dashboards-in-agent-groundwork
rbrtj Dec 1, 2025
64e8c55
Merge branch 'main' into dashboards-in-agent-groundwork
mbondyra Dec 3, 2025
b5730e0
support dashboard tag parsing and rendering
rbrtj Dec 3, 2025
e81fbfa
Merge branch 'main' into dashboards-agent-links
rbrtj Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export const isErrorResult = (result: ToolResult): result is ErrorResult => {
return result.type === ToolResultType.error;
};

export const isDashboardResult = (result: ToolResult): result is DashboardResult => {
return result.type === ToolResultType.dashboard;
};

export interface VisualizationElementAttributes {
toolResultId?: string;
chartType?: ChartType;
Expand All @@ -127,3 +131,14 @@ export const visualizationElement = {
chartType: 'chart-type',
},
};

export interface DashboardElementAttributes {
toolResultId?: string;
}

export const dashboardElement = {
tagName: 'dashboard',
attributes: {
toolResultId: 'tool-result-id',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { ToolResultType, platformCoreTools } from '@kbn/onechat-common';
import { dashboardElement } from '@kbn/onechat-common/tools/tool_result';
import type { OnechatPluginSetup } from '@kbn/onechat-plugin/server';
import { dashboardTools } from '../common';

Expand Down Expand Up @@ -108,17 +109,22 @@ General Guidelines:

function renderDashboardResultPrompt() {
const { dashboard } = ToolResultType;
const { tagName, attributes } = dashboardElement;

return `#### Handling Dashboard Results
When a tool call returns a result of type "${dashboard}", you should inform the user that a dashboard has been created and provide relevant information about it.
return `#### Rendering Dashboards
When a tool call returns a result of type "${dashboard}", you should render the dashboard in the UI by emitting a custom XML element:

<${tagName} ${attributes.toolResultId}="TOOL_RESULT_ID_HERE" />

**Rules**
* When you receive a tool result with \`"type": "${dashboard}"\`, extract the \`id\`, \`title\`, and other relevant data from the result.
* Provide a clickable link if a URL is available in \`content.url\`.
* The \`<${tagName}>\` element must only be used to render tool results of type \`${dashboard}\`.
* You must copy the \`tool_result_id\` from the tool's response into the \`${attributes.toolResultId}\` element attribute verbatim.
* Do not invent, alter, or guess \`tool_result_id\`. You must use the exact id provided in the tool response.
* You must not include any other attributes or content within the \`<${tagName}>\` element.

**Example for Dashboard:**
**Example Usage:**

Tool response:
Tool response includes:
{
"tool_result_id": "abc123",
"type": "${dashboard}",
Expand All @@ -133,6 +139,10 @@ function renderDashboardResultPrompt() {
}
}

Your response to the user should include:
Dashboard "My Dashboard" created successfully. You can view it at: [/app/dashboards#/view/dashboard-123](/app/dashboards#/view/dashboard-123)`;
To render this dashboard your reply should include:
<${tagName} ${attributes.toolResultId}="abc123" />

You may also add a brief message about the dashboard creation, for example:
"I've created a dashboard for you:"
<${tagName} ${attributes.toolResultId}="abc123" />`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ import {
} from '@elastic/eui';
import { type PluggableList } from 'unified';
import type { ConversationRoundStep } from '@kbn/onechat-common';
import { visualizationElement } from '@kbn/onechat-common/tools/tool_result';
import { visualizationElement, dashboardElement } from '@kbn/onechat-common/tools/tool_result';
import { useOnechatServices } from '../../../../hooks/use_onechat_service';
import {
Cursor,
esqlLanguagePlugin,
createVisualizationRenderer,
createDashboardRenderer,
loadingCursorPlugin,
visualizationTagParser,
dashboardTagParser,
} from './markdown_plugins';
import { useStepsFromPrevRounds } from '../../../../hooks/use_conversation';

Expand Down Expand Up @@ -125,13 +127,18 @@ export function ChatMessageText({ content, steps: stepsFromCurrentRound }: Props
stepsFromCurrentRound,
stepsFromPrevRounds,
}),
[dashboardElement.tagName]: createDashboardRenderer({
stepsFromCurrentRound,
stepsFromPrevRounds,
}),
};

return {
parsingPluginList: [
loadingCursorPlugin,
esqlLanguagePlugin,
visualizationTagParser,
dashboardTagParser,
...parsingPlugins,
],
processingPluginList: processingPlugins,
Expand Down
Loading