@grafana/assistant 0.1.34 → 0.1.36

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.
Files changed (175) hide show
  1. package/README.md +296 -42
  2. package/dist/analyticsEvents.d.ts +33 -0
  3. package/dist/analyticsEvents.d.ts.map +1 -0
  4. package/dist/components/button/OpenAssistantButton.d.ts +9 -4
  5. package/dist/components/button/OpenAssistantButton.d.ts.map +1 -1
  6. package/dist/components/button/OpenAssistantSplitButton.d.ts +2 -2
  7. package/dist/components/button/OpenAssistantSplitButton.d.ts.map +1 -1
  8. package/dist/components/button/QueryWithAssistantButton.d.ts +2 -2
  9. package/dist/components/button/QueryWithAssistantButton.d.ts.map +1 -1
  10. package/dist/components/grots/GrotAvatar.d.ts +31 -0
  11. package/dist/components/grots/GrotAvatar.d.ts.map +1 -0
  12. package/dist/components/grots/GrotTopicView.d.ts +19 -0
  13. package/dist/components/grots/GrotTopicView.d.ts.map +1 -0
  14. package/dist/components/grots/OpenGrotButton.d.ts +23 -0
  15. package/dist/components/grots/OpenGrotButton.d.ts.map +1 -0
  16. package/dist/components/index.d.ts +3 -0
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/components/input/AITextArea.d.ts +1 -1
  19. package/dist/components/input/AITextArea.d.ts.map +1 -1
  20. package/dist/components/input/AITextInput.d.ts +1 -1
  21. package/dist/components/input/AITextInput.d.ts.map +1 -1
  22. package/dist/components/input/useAIGeneration.d.ts.map +1 -1
  23. package/dist/components/prompt-card/AssistantPromptCard.d.ts +2 -2
  24. package/dist/components/prompt-card/AssistantPromptCard.d.ts.map +1 -1
  25. package/dist/context/agentSkill.d.ts +69 -0
  26. package/dist/context/agentSkill.d.ts.map +1 -0
  27. package/dist/context/base.d.ts.map +1 -1
  28. package/dist/context/chat.d.ts.map +1 -1
  29. package/dist/context/component.d.ts.map +1 -1
  30. package/dist/context/dashboard.d.ts.map +1 -1
  31. package/dist/context/datasource.d.ts.map +1 -1
  32. package/dist/context/entity.d.ts.map +1 -1
  33. package/dist/context/factory.d.ts.map +1 -1
  34. package/dist/context/index.d.ts +1 -0
  35. package/dist/context/index.d.ts.map +1 -1
  36. package/dist/context/label.d.ts.map +1 -1
  37. package/dist/context/page.d.ts.map +1 -1
  38. package/dist/context/skill.d.ts.map +1 -1
  39. package/dist/context/types.d.ts +15 -1
  40. package/dist/context/types.d.ts.map +1 -1
  41. package/dist/esm/analyticsEvents.js +31 -0
  42. package/dist/esm/analyticsEvents.js.map +1 -0
  43. package/dist/esm/components/button/OpenAssistantButton.js +13 -12
  44. package/dist/esm/components/button/OpenAssistantButton.js.map +1 -1
  45. package/dist/esm/components/button/OpenAssistantSplitButton.js +3 -2
  46. package/dist/esm/components/button/OpenAssistantSplitButton.js.map +1 -1
  47. package/dist/esm/components/grots/GrotAvatar.js +37 -0
  48. package/dist/esm/components/grots/GrotAvatar.js.map +1 -0
  49. package/dist/esm/components/grots/GrotTopicView.js +25 -0
  50. package/dist/esm/components/grots/GrotTopicView.js.map +1 -0
  51. package/dist/esm/components/grots/OpenGrotButton.js +36 -0
  52. package/dist/esm/components/grots/OpenGrotButton.js.map +1 -0
  53. package/dist/esm/components/index.js +3 -0
  54. package/dist/esm/components/index.js.map +1 -1
  55. package/dist/esm/components/input/useAIGeneration.js +14 -1
  56. package/dist/esm/components/input/useAIGeneration.js.map +1 -1
  57. package/dist/esm/components/prompt-card/AssistantPromptCard.js +2 -2
  58. package/dist/esm/components/prompt-card/AssistantPromptCard.js.map +1 -1
  59. package/dist/esm/context/agentSkill.js +70 -0
  60. package/dist/esm/context/agentSkill.js.map +1 -0
  61. package/dist/esm/context/base.js.map +1 -1
  62. package/dist/esm/context/chat.js +1 -0
  63. package/dist/esm/context/chat.js.map +1 -1
  64. package/dist/esm/context/component.js.map +1 -1
  65. package/dist/esm/context/factory.js +6 -4
  66. package/dist/esm/context/factory.js.map +1 -1
  67. package/dist/esm/context/index.js +1 -0
  68. package/dist/esm/context/index.js.map +1 -1
  69. package/dist/esm/context/page.js.map +1 -1
  70. package/dist/esm/context/questions.js +20 -26
  71. package/dist/esm/context/questions.js.map +1 -1
  72. package/dist/esm/extension/extension.js +7 -8
  73. package/dist/esm/extension/extension.js.map +1 -1
  74. package/dist/esm/extension/index.js +2 -1
  75. package/dist/esm/extension/index.js.map +1 -1
  76. package/dist/esm/extension/suggestionContexts.js +35 -0
  77. package/dist/esm/extension/suggestionContexts.js.map +1 -0
  78. package/dist/esm/grots/avatar/appearance.js +303 -0
  79. package/dist/esm/grots/avatar/appearance.js.map +1 -0
  80. package/dist/esm/grots/avatar/sprite.js +481 -0
  81. package/dist/esm/grots/avatar/sprite.js.map +1 -0
  82. package/dist/esm/grots/client.js +377 -0
  83. package/dist/esm/grots/client.js.map +1 -0
  84. package/dist/esm/grots/index.js +2 -0
  85. package/dist/esm/grots/index.js.map +1 -0
  86. package/dist/esm/grots/retry.js +67 -0
  87. package/dist/esm/grots/retry.js.map +1 -0
  88. package/dist/esm/grots/types.js +2 -0
  89. package/dist/esm/grots/types.js.map +1 -0
  90. package/dist/esm/index.js +4 -1
  91. package/dist/esm/index.js.map +1 -1
  92. package/dist/esm/inline/index.js.map +1 -1
  93. package/dist/esm/inline/inlineAssistant.js +1 -1
  94. package/dist/esm/inline/inlineAssistant.js.map +1 -1
  95. package/dist/esm/inline/useInlineAssistant.js +8 -3
  96. package/dist/esm/inline/useInlineAssistant.js.map +1 -1
  97. package/dist/esm/investigations/api.gen.js +6 -0
  98. package/dist/esm/investigations/api.gen.js.map +1 -0
  99. package/dist/esm/investigations/client.js +76 -0
  100. package/dist/esm/investigations/client.js.map +1 -0
  101. package/dist/esm/investigations/index.js +3 -0
  102. package/dist/esm/investigations/index.js.map +1 -0
  103. package/dist/esm/investigations/observe.js +204 -0
  104. package/dist/esm/investigations/observe.js.map +1 -0
  105. package/dist/esm/investigations/types.js +2 -0
  106. package/dist/esm/investigations/types.js.map +1 -0
  107. package/dist/esm/k6.js.map +1 -1
  108. package/dist/esm/lens/investigationLens.js +1 -1
  109. package/dist/esm/lens/investigationLens.js.map +1 -1
  110. package/dist/esm/lens/useInvestigationThroughLens.js +3 -1
  111. package/dist/esm/lens/useInvestigationThroughLens.js.map +1 -1
  112. package/dist/esm/limits/index.js +1 -1
  113. package/dist/esm/limits/index.js.map +1 -1
  114. package/dist/esm/pathfinder.js +41 -0
  115. package/dist/esm/pathfinder.js.map +1 -0
  116. package/dist/esm/sidebar.js +44 -23
  117. package/dist/esm/sidebar.js.map +1 -1
  118. package/dist/esm/terms/index.js +43 -5
  119. package/dist/esm/terms/index.js.map +1 -1
  120. package/dist/esm/tools/toolFactory.js.map +1 -1
  121. package/dist/esm/utils/errorHandling.js.map +1 -1
  122. package/dist/esm/utils/theme.js +11 -1
  123. package/dist/esm/utils/theme.js.map +1 -1
  124. package/dist/extension/extension.d.ts +206 -114
  125. package/dist/extension/extension.d.ts.map +1 -1
  126. package/dist/extension/index.d.ts +2 -1
  127. package/dist/extension/index.d.ts.map +1 -1
  128. package/dist/extension/suggestionContexts.d.ts +36 -0
  129. package/dist/extension/suggestionContexts.d.ts.map +1 -0
  130. package/dist/grots/avatar/appearance.d.ts +82 -0
  131. package/dist/grots/avatar/appearance.d.ts.map +1 -0
  132. package/dist/grots/avatar/sprite.d.ts +84 -0
  133. package/dist/grots/avatar/sprite.d.ts.map +1 -0
  134. package/dist/grots/client.d.ts +130 -0
  135. package/dist/grots/client.d.ts.map +1 -0
  136. package/dist/grots/index.d.ts +3 -0
  137. package/dist/grots/index.d.ts.map +1 -0
  138. package/dist/grots/retry.d.ts +7 -0
  139. package/dist/grots/retry.d.ts.map +1 -0
  140. package/dist/grots/types.d.ts +331 -0
  141. package/dist/grots/types.d.ts.map +1 -0
  142. package/dist/index.d.ts +4 -1
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +1 -1
  145. package/dist/index.js.map +1 -1
  146. package/dist/inline/index.d.ts +1 -1
  147. package/dist/inline/index.d.ts.map +1 -1
  148. package/dist/inline/inlineAssistant.d.ts +19 -6
  149. package/dist/inline/inlineAssistant.d.ts.map +1 -1
  150. package/dist/inline/useInlineAssistant.d.ts +5 -1
  151. package/dist/inline/useInlineAssistant.d.ts.map +1 -1
  152. package/dist/investigations/api.gen.d.ts +1872 -0
  153. package/dist/investigations/api.gen.d.ts.map +1 -0
  154. package/dist/investigations/client.d.ts +8 -0
  155. package/dist/investigations/client.d.ts.map +1 -0
  156. package/dist/investigations/index.d.ts +5 -0
  157. package/dist/investigations/index.d.ts.map +1 -0
  158. package/dist/investigations/observe.d.ts +10 -0
  159. package/dist/investigations/observe.d.ts.map +1 -0
  160. package/dist/investigations/types.d.ts +26 -0
  161. package/dist/investigations/types.d.ts.map +1 -0
  162. package/dist/lens/investigationLens.d.ts +0 -5
  163. package/dist/lens/investigationLens.d.ts.map +1 -1
  164. package/dist/lens/useInvestigationThroughLens.d.ts.map +1 -1
  165. package/dist/pathfinder.d.ts +41 -0
  166. package/dist/pathfinder.d.ts.map +1 -0
  167. package/dist/sidebar.d.ts +15 -0
  168. package/dist/sidebar.d.ts.map +1 -1
  169. package/dist/terms/index.d.ts +8 -0
  170. package/dist/terms/index.d.ts.map +1 -1
  171. package/dist/terms/settings.gen.d.ts +470 -89
  172. package/dist/terms/settings.gen.d.ts.map +1 -1
  173. package/dist/tools/types.d.ts +3 -3
  174. package/dist/utils/theme.d.ts.map +1 -1
  175. package/package.json +21 -18
package/README.md CHANGED
@@ -69,6 +69,20 @@ openAssistant({
69
69
  origin: 'grafana-slo-app/some-page',
70
70
  });
71
71
 
72
+ // Open a new conversation with one Agent Skill already attached, named by the token a user
73
+ // types after `/`. Never a handle or the server-issued selection id.
74
+ //
75
+ // This is a request, not a grant: the composer resolves the name against the catalog that user
76
+ // may already attach from, so an unknown, switched-off or unsupported name attaches nothing and
77
+ // says so, without revealing which. Naming a skill never auto-sends — whoever opens the link
78
+ // sees what it attached before anything reaches the model — and pins Assistant mode unless a
79
+ // `mode` is given. Ignored alongside `chatId`; a skill attaches to a new conversation only.
80
+ openAssistant({
81
+ origin: 'grafana-pathfinder-app/authoring-link',
82
+ prompt: 'Turn these steps into an interactive guide',
83
+ agentSkillInvocationName: 'pathfinder-authoring',
84
+ });
85
+
72
86
  // Close the assistant
73
87
  closeAssistant();
74
88
  ```
@@ -464,64 +478,57 @@ const namespace = newFunctionNamespace('myPlugin', myFunctions);
464
478
  export const getExtensionConfigs = () => [getExposeAssistantFunctionsConfig([namespace])];
465
479
  ```
466
480
 
467
- ### Contributing Assistant Extensions (Experimental)
468
-
469
- > **Experimental:** this API is under active development and may change in future releases. It requires a Grafana version with `AppPlugin.addFunction()` / `addedFunctions` support (February 2025+, covered by this package's `>=12.1.0` peer dependency floor).
481
+ ### Contributing Assistant extensions (experimental)
470
482
 
471
- An app plugin can contribute to the Grafana Assistant — chat-track "chits" (expanded tool-card details and inline components in assistant text), proposed first messages ("starters"), on-demand workflow guides ("skills"), custom artifact kinds for the canvas, and mode/system-prompt contributions — by registering a manifest function against the `ASSISTANT_EXTENSION_POINT`:
483
+ An app plugin can add conversation starters, expanded tool details, inline reply components, and custom artifact renderers to Grafana Assistant. Register one `AssistantExtensionManifest` with `getAssistantExtensionConfig`:
472
484
 
473
485
  ```typescript
474
486
  import { AppPlugin } from '@grafana/data';
475
- import { getAssistantExtensionConfig, AssistantExtensionManifest } from '@grafana/assistant';
487
+ import { SuggestionContext, getAssistantExtensionConfig, type AssistantExtensionManifest } from '@grafana/assistant';
476
488
 
477
489
  const manifest: AssistantExtensionManifest = {
478
490
  schemaVersion: 1,
479
- chits: [{ kind: 'tool-details', toolNames: ['myplugin_run_check'], component: MyToolDetails }],
480
- starters: [{ label: 'Run a check', message: 'Run a check against my production environment' }],
481
- skills: [
482
- {
483
- id: 'author-check',
484
- title: 'Author a check',
485
- description: 'Step-by-step workflow for creating a check with the myplugin tools.',
486
- content: '# Author a check\n\n1. List existing checks...\n2. Draft the check...\n3. Validate before saving.',
487
- },
488
- ],
489
- artifactKinds: [
490
- {
491
- ext: '.grafana-myplugin-app.check',
492
- label: 'Check',
493
- icon: 'check',
494
- tabPriority: 0, // ascending: lower promotes earlier, among your own kinds (built-ins always come first)
495
- validate: (data) => isCheck(data),
496
- renderer: CheckRenderer,
497
- },
498
- ],
499
- promptContributions: [
500
- {
501
- modeId: 'authoring',
502
- label: 'Check authoring',
503
- description: 'Author checks with guided help',
504
- whenToUse: 'When the user asks to create or edit checks',
505
- compose: 'append',
506
- prompt: 'You can author checks using the myplugin tools.',
507
- },
508
- ],
491
+ starters: [{
492
+ label: 'Review service errors',
493
+ message: 'Help me review recent service errors in this stack.',
494
+ contexts: [SuggestionContext.Alerting, SuggestionContext.Logs, SuggestionContext.Workspace],
495
+ }],
509
496
  };
510
497
 
511
498
  export const plugin = new AppPlugin().addFunction(getAssistantExtensionConfig(manifest));
512
499
  ```
513
500
 
514
- Artifact renderers and toolbars receive their `node` plus `fs: AssistantArtifactFs` — a read-only handle (`list`/`read`/`has`) over the conversation's artifact filesystem. It includes other plugins' and built-in artifacts by design (composition is the point). There is no write surface: artifact writes happen only through the Assistant's validated `write_artifact` path, and renderers must treat `fs` as the only artifact-content source besides their own node.
501
+ Starter `contexts` is an optional list of `SuggestionContext` values exported by `@grafana/assistant`. A starter is eligible when any listed context matches the current route (including nested routes). Eligible plugin starters share randomized selection with built-in route suggestions in the sidebar and Workspace; registration does not guarantee a visible slot. Omit `contexts` to limit the starter to the contributing plugin’s `/a/<pluginId>` routes. An empty list disables the starter. Invalid contexts cause the host to drop that starter rather than broaden its scope. Generic suggestions fill remaining slots.
502
+
503
+ Also add these fields to your existing `plugin.json`:
504
+
505
+ ```json
506
+ {
507
+ "preload": true,
508
+ "extensions": {
509
+ "addedFunctions": [{
510
+ "title": "assistant-extension",
511
+ "targets": ["grafana-assistant-app/extension/v1"]
512
+ }]
513
+ }
514
+ }
515
+ ```
516
+
517
+ Use Grafana 12.1 or later and an Assistant environment with `assistant.frontend.plugin-extensions` enabled. `preload: true` supports Grafana 12.1, whose extension loader doesn't discover function-only declarations. Add the function to your existing `AppPlugin` if you already have one. Keep the manifest and its component/function references stable after registration.
518
+
519
+ Use `starters` for attributed first messages on empty chats; use `provideQuestions` for page-specific suggestions. The supported `chits` kinds are `tool-details` and `inline`. Artifact writes use `artifact_files`; renderers receive a read-only conversation filesystem.
515
520
 
516
- `starters` are proposed first messages shown on fresh chats, visibly attributed to your plugin; selecting one sends `message` as an ordinary, user-visible user message. They are never auto-sent, never hidden, and never modify the system prompt. The Assistant enforces bounds: max 3 starters per plugin, `message` up to 500 characters, `label` up to 80 characters — entries beyond a cap are dropped whole.
521
+ The manifest also accepts `skills` and `promptContributions`. Skills currently appear in settings but aren't loaded by the model. Modes require `assistant.frontend.plugin-extensions-prompt` and your plugin ID in `assistant.frontend.plugin-extensions-prompt-allowlist`, in addition to the master flag. An operator can disable all contributions with `assistant.frontend.plugin-extensions-enabled.<pluginId>`.
517
522
 
518
- `skills` teach the Assistant plugin-specific workflows without adding resident prompt text: only a one-line catalog entry (title, description, handle) is ever in the prompt, and `content` loads only when the user attaches the skill or the model loads it. Each skill is catalogued under `plugin:{yourPluginId}:{id}` and listed read-only on the Assistant's Skills settings page, attributed to your plugin. Skills exist only while your registration is live — they are never persisted or indexed. Skill content reaches the model only where the Assistant's agent-skills runtime is enabled; the read-only settings listing needs no additional flag. The Assistant enforces bounds, dropping violating entries whole (never truncating): max 5 skills per plugin, `id` `[a-z][a-z0-9-]*` up to 64 characters, `title` up to 80, `description` up to 500, `content` up to 32768 UTF-8 bytes.
523
+ Browser registration does not enable skill activation, even when the builtin Agent Skills runtime is enabled. The proposed plugin activation contract requires trusted server integration and a supported runtime surface. Automatic discovery additionally requires a short author hint, `whenToUse`, which is not yet part of this SDK. Existing manifests remain valid for inspection and would be manual-only without a hint once manual plugin activation ships.
519
524
 
520
- #### Starters vs provideQuestions
525
+ Inline components can supply `prompt` (up to 4096 UTF-8 bytes) to explain when to emit their tag in normal chat, without selecting a mode. This is attributed chat context, not a system-prompt override. Set `selfClosing: true` for a childless marker such as `<grafana_myplugin_app_result name="checkout" />`; the host recovers saved bare/backticked tag names and suppresses identical duplicates outside code.
521
526
 
522
- Use [`provideQuestions`](#questions-system) to suggest questions on pages your plugin already runs on — it is URL-scoped, goes through the page-context registry, requires your module to be loaded on that page, and is unattributed. Use manifest `starters` for proposed first messages in the Assistant's fresh chats anywhere — they travel over the extension point (your module is loaded on demand), are visibly attributed to your plugin, are governed by the Assistant's per-plugin kill switch and caps, and will be statically declarable in the future. Both intentionally share the same rendering surface and send path.
527
+ Use `InlineChitProps` to receive `turn.isStreaming` and `turn.tools` (message-local tool names, IDs, and unknown inputs). Validate inputs in your plugin. A stopped turn is also non-streaming; this is not a success signal. Older hosts omit `turn` and ignore the new fields. The [inline integration example](../../../docs/sources/reference/plugin-extensions.md#use-tool-inputs-and-wait-for-the-turn) shows how to keep a scene stable after its first settled render.
523
528
 
524
- Also declare the target under `extensions.addedFunctions` in your `plugin.json`. The manifest function must be pure and stable: the same environment must always produce the same (deep-equal) manifest — gate on your own feature flags before registering rather than returning a varying manifest. Everything in the manifest is JSON-serializable except component and function references.
529
+ For a larger view, add `display: 'block'` with `selfClosing: true`. It uses the same tag but renders below the message text, outside Markdown paragraphs, at the available message width with keyboard-accessible horizontal scrolling. Omitted `display` keeps inline placement. `InlineChitDisplay` exports the two display values.
530
+
531
+ This API is experimental and may change between releases. For contribution examples, ownership rules, limits, and troubleshooting, refer to the [plugin extensions guide](../../../docs/sources/reference/plugin-extensions.md).
525
532
 
526
533
  ### Using the OpenAssistantButton Component
527
534
 
@@ -556,6 +563,15 @@ function MyDashboard() {
556
563
  origin="grafana-datasources/loki/query-editor"
557
564
  />
558
565
 
566
+ {/* Bordered icon-only button, for a row of secondary icon buttons */}
567
+ <OpenAssistantButton
568
+ prompt="Explain this issue"
569
+ iconOnlyButton={true}
570
+ iconOnlyVariant="bordered"
571
+ title="Ask Assistant"
572
+ origin="grafana-advisor-app/issue-actions"
573
+ />
574
+
559
575
  {/* Button without auto-send */}
560
576
  <OpenAssistantButton
561
577
  prompt="What patterns do you see in the data?"
@@ -711,6 +727,7 @@ A pre-built React component that renders a button to open the Grafana Assistant
711
727
  - `title?: string` - Text to display on the button (defaults to `'Analyze with Assistant'`)
712
728
  - `size?: 'xs' | 'sm' | 'md' | 'lg'` - Button size (defaults to `'sm'`)
713
729
  - `iconOnlyButton?: boolean` - If `true`, renders as an icon-only button with tooltip (defaults to `false`)
730
+ - `iconOnlyVariant?: 'ghost' | 'bordered'` - Style of the icon-only button. `'ghost'` is borderless. `'bordered'` renders a standard secondary `Button` that lines up with other secondary icon buttons, with `title` as its tooltip and accessible name. Only applies when `iconOnlyButton` is `true` (defaults to `'ghost'`)
714
731
 
715
732
  #### `<QueryWithAssistantButton />`
716
733
 
@@ -1029,6 +1046,229 @@ export function WeatherComponent() {
1029
1046
  }
1030
1047
  ```
1031
1048
 
1049
+ #### Configuring the agent and calling it without React
1050
+
1051
+ By default the inline assistant suits short content generation: at most 5 model calls per prompt, the smaller model, no reasoning, and 4096 output tokens per call.
1052
+ For agentic work, such as discovery with your own tools before answering, pass an `InlineAssistantConfig` to `useInlineAssistant(config)` or, without React, to the inline assistant factory.
1053
+ The config is fixed for the life of the instance and applies to every prompt sent to it.
1054
+
1055
+ | Field | Allowed values | Default |
1056
+ | --- | --- | --- |
1057
+ | `maxSteps` | integer from 1 to 76; the agent stops after the last model call | `5` |
1058
+ | `weak` | `true` for the smaller, faster model, `false` for the standard one | `true` |
1059
+ | `reasoningLevel` | `'none'`, `'low'`, `'medium'`, `'high'`, `'xhigh'`, `'max'` | `'none'` |
1060
+ | `maxTokens` | integer from 1 to 16000 output tokens per model call | `4096` |
1061
+
1062
+ `ensureInlineAssistantInitialized` loads the implementation on first use.
1063
+ The factory returns an `InlineAssistant` that owns one conversation: each `sendPrompt` continues it, so you can answer a question the model asked in the next prompt.
1064
+ Call `dispose()` when you are done.
1065
+
1066
+ ```typescript
1067
+ import { ensureInlineAssistantInitialized, getInlineAssistantFactory } from '@grafana/assistant';
1068
+
1069
+ await ensureInlineAssistantInitialized();
1070
+ const assistant = await getInlineAssistantFactory()('my-plugin/planner', {
1071
+ maxSteps: 30,
1072
+ weak: false,
1073
+ reasoningLevel: 'medium',
1074
+ maxTokens: 8000,
1075
+ });
1076
+ try {
1077
+ await assistant.sendPrompt({
1078
+ prompt: 'Plan the checks for this requirement: ...',
1079
+ systemPrompt: 'Explore with the tools, then call submit_plan once.',
1080
+ tools: [listDatasourcesTool, queryTool, submitPlanTool],
1081
+ onComplete: (text) => console.log(text),
1082
+ onError: (err) => console.error(err),
1083
+ });
1084
+ } finally {
1085
+ assistant.dispose();
1086
+ }
1087
+ ```
1088
+
1089
+ The implementation comes from the installed Grafana Assistant, which can be older than your copy of the SDK.
1090
+ Releases that predate `InlineAssistantConfig` ignore it and run with the defaults.
1091
+ An invalid value makes the factory reject before any conversation is created; the hook reports it through `onError` and `error`.
1092
+
1093
+ ### Creating and monitoring investigations
1094
+
1095
+ Use `createInvestigation`, `getInvestigationStatus`, and `getInvestigationReport` from a Grafana plugin. These methods call the public-preview v2 API through Grafana's plugin proxy as the signed-in user. They require a backend with the v2 investigation routes enabled. Do not embed service account tokens in browser code; use the [HTTP API](../../../docs/sources/reference/http-apis/_index.md#manage-investigations) for server-side integrations.
1096
+
1097
+ ```typescript
1098
+ import { createInvestigation, getInvestigationStatus, getInvestigationReport } from '@grafana/assistant';
1099
+
1100
+ // Call from an explicit user action. The caller awaits and handles failures.
1101
+ async function startInvestigation(signal: AbortSignal) {
1102
+ return createInvestigation({ instruction: 'Investigate elevated API latency' }, { signal });
1103
+ }
1104
+
1105
+ // Call on refresh or from a polling loop with an interval and a deadline.
1106
+ async function readInvestigation(investigationId: string, signal: AbortSignal) {
1107
+ const status = await getInvestigationStatus(investigationId, { signal });
1108
+ const report = status.state === 'completed'
1109
+ ? await getInvestigationReport(investigationId, { signal })
1110
+ : undefined;
1111
+ return { status, report };
1112
+ }
1113
+ ```
1114
+
1115
+ | Method | Result |
1116
+ | --- | --- |
1117
+ | `createInvestigation(input, options?)` | `CreatedInvestigation`: `investigationId` and `chatId`. Input includes required `instruction` and optional `title`, `labels`, and `teamNames`. |
1118
+ | `getInvestigationStatus(investigationId, options?)` | `InvestigationStatus`: identifiers, optional `state`, title, summary, and failure or completion details. |
1119
+ | `getInvestigationReport(investigationId, options?)` | `InvestigationReport`: `investigationId`, `reportPending`, and optional `reportSpec` and `reportContent`. |
1120
+
1121
+ Results are unwrapped from the HTTP success envelope and validated at runtime. The exported types derive from the backend OpenAPI schema. Each call makes one request; the SDK doesn't poll, retry, or display error notifications. Every method accepts `{ signal?: AbortSignal }`. Aborting stops waiting for the request; it doesn't cancel an investigation already created on the server. A failed or aborted create request can still have started an investigation, so don't retry it automatically.
1122
+
1123
+ Use the returned `investigationId` for reads. The separate `chatId` identifies the backing conversation. Poll `state`: `pending` and `in_progress` indicate ongoing work; `completed`, `failed`, and `cancelled` stop ordinary polling; `paused` needs intervention. State is an optional, open string: bound polling with a deadline and handle unfamiliar or absent states explicitly.
1124
+
1125
+ A report can be absent even when `reportPending` is false. A snapshot can return 404 before its session starts; status reads remain the lifecycle source. Report retrieval also works during an investigation when a snapshot exists. Render `reportContent` as text or sanitized Markdown, never as trusted HTML.
1126
+
1127
+ Handle rejected promises in your UI. HTTP failures preserve Grafana's `FetchError` contract (use `isFetchError` from `@grafana/runtime`); malformed responses reject with a validation error. Reads respect the signed-in user's permissions and team visibility. Refer to the HTTP reference for exact permissions and response fields. For live updates, use `observeInvestigation` below.
1128
+
1129
+ For a structured view derived from an existing report, use the lens hook below.
1130
+
1131
+ ### Observing investigation progress
1132
+
1133
+ `observeInvestigation(investigationId): Observable<InvestigationEvent>` watches an existing investigation as the signed-in Grafana user. It requires the v2 investigation APIs and the authenticated chat event stream on the backend. Each subscription starts its own connection and snapshot reads; calling the function alone does no work.
1134
+
1135
+ ```typescript
1136
+ import { observeInvestigation, type InvestigationEvent } from '@grafana/assistant';
1137
+
1138
+ // Pass your UI's update, error, and completion handlers.
1139
+ function watchInvestigation(
1140
+ investigationId: string,
1141
+ onEvent: (event: InvestigationEvent) => void,
1142
+ onError: (error: unknown) => void,
1143
+ onComplete: () => void,
1144
+ ) {
1145
+ const subscription = observeInvestigation(investigationId).subscribe({
1146
+ next: onEvent,
1147
+ error: onError,
1148
+ complete: onComplete,
1149
+ });
1150
+
1151
+ // Call when leaving the view. The investigation keeps running.
1152
+ return () => subscription.unsubscribe();
1153
+ }
1154
+ ```
1155
+
1156
+ | Event | Payload | Meaning |
1157
+ | --- | --- | --- |
1158
+ | `status` | `event.status: InvestigationStatus` | Current persisted lifecycle state, emitted initially and when its fields change. |
1159
+ | `report` | `event.report: InvestigationReport` | Current persisted report snapshot, when available, emitted initially and when its fields change. |
1160
+ | `progress` | `investigationId`, `messageId`, `contentIndex`, `delta` | Live user-visible text. Append deltas separately for each `(messageId, contentIndex)` pair. |
1161
+
1162
+ The first event is a status snapshot. A report snapshot can be absent before the session starts. Live text can arrive while a snapshot is loading. Progress excludes tool inputs, reasoning, and private sub-agent audiences; it is best-effort text, not a complete conversation history or the report itself. Render text safely. Report events contain persisted snapshots rather than every in-flight report edit.
1163
+
1164
+ The observer refreshes persisted state after the stream connects and on relevant notifications, and reconciles about every 5 seconds while idle. Reads are serialized and identical snapshots are suppressed. Stream notifications don't override persisted lifecycle state.
1165
+
1166
+ `completed`, `failed`, and `cancelled` are terminal states. After observing a terminal state and checking the report, the Observable completes when no report is pending. A missing report does not prevent completion. `paused`, unknown, and absent states keep the subscription open. Use the status payload to distinguish success from investigation failure; `complete` means observation finished successfully, not that the investigation succeeded.
1167
+
1168
+ HTTP failures, invalid response/event data, a connection that doesn't open within 30 seconds, or a disconnected stream terminate the subscription through `error`. HTTP errors retain Grafana's `FetchError` shape. Browser event-stream errors don't expose an HTTP status. There is no automatic reconnect: subscribe again to recover current snapshots. Missed text deltas are not replayed, including text produced before the initial connection. Keep partial progress distinct from a complete transcript.
1169
+
1170
+ Unsubscribing closes the event connection, aborts pending reads, and clears timers. It never pauses or cancels server-side work. Multiple subscriptions are independent; share one subscription in your UI when multiple consumers need the same updates. The API observes investigations only and doesn't send prompts or observe regular Assistant conversations.
1171
+
1172
+ ### Working with Grots (experimental)
1173
+
1174
+ The Grots client is experimental and may change between releases.
1175
+
1176
+ Use the Grots client from a Grafana plugin to list Grots, create one, chat with one in direct topics, or wake one with a workflow event. The calls go through Grafana's plugin proxy as the signed-in user, so there is no extra authentication; do not embed service account tokens in browser code. The Go SDK (`packages/assistant-go`, `GROTS.md`) has the same calls for servers.
1177
+
1178
+ ```typescript
1179
+ import {
1180
+ createGrot,
1181
+ createGrotTopic,
1182
+ listGrotTopicMessages,
1183
+ listGrots,
1184
+ postGrotTopicMessage,
1185
+ wakeGrot,
1186
+ readGrotLane,
1187
+ closeGrotLane,
1188
+ } from '@grafana/assistant';
1189
+
1190
+ const grots = await listGrots({ labelSelector: 'team=payments' });
1191
+
1192
+ // Chat: one topic per item. Reuse a dedupeKey only when retrying the same message.
1193
+ const { topic } = await createGrotTopic(grots[0].id, {
1194
+ title: 'Incident 42',
1195
+ content: 'Please investigate the 5xx rate on checkout-api.',
1196
+ dedupeKey: 'incident-42-open',
1197
+ });
1198
+ await postGrotTopicMessage(grots[0].id, topic.id, { content: 'The deploy was rolled back.', dedupeKey: 'incident-42-rollback' });
1199
+ const page = await listGrotTopicMessages(grots[0].id, topic.chatId); // takes chatId, not topic id
1200
+
1201
+ // Wake: events with the same laneKey run in order in one lane.
1202
+ await wakeGrot(grots[0].id, { workflow: 'disk-pressure', dedupeKey: `${runId}/${stepId}`, content: 'Disk above 90%', laneKey: 'incident-42' });
1203
+ const lane = await readGrotLane(grots[0].id, 'incident-42'); // lane.busy is false when the Grot is done
1204
+ await closeGrotLane(grots[0].id, 'incident-42'); // frees one of the 50 open lanes
1205
+ ```
1206
+
1207
+ #### Grot components
1208
+
1209
+ Three small components show Grots in your own plugin. They call the same client as above, as the signed-in user.
1210
+
1211
+ ```tsx
1212
+ import { GrotAvatar, GrotTopicView, OpenGrotButton } from '@grafana/assistant';
1213
+
1214
+ // Draws a Grot from its look: pass the Grot, or a `look` (the avatar string, or some of its parts).
1215
+ <GrotAvatar grot={grot} size={32} title="Ada, the on-call Grot" />
1216
+
1217
+ // Opens the Grot (and optionally one topic, by number) on the Assistant's Grots page.
1218
+ <OpenGrotButton grotId={grot.id} topic={topic.number} label="Open topic" variant="secondary" />
1219
+
1220
+ // One of your topics with the Grot, read only, as the Grots page shows it. Give its container a height.
1221
+ <div style={{ height: 480 }}>
1222
+ <GrotTopicView grotId={grot.id} topic={topic} />
1223
+ </div>
1224
+ ```
1225
+
1226
+ `GrotAvatar` and `OpenGrotButton` call nothing, so they need only `plugins.app:access` (the link opens the Grots page, which checks the person's own access). `GrotTopicView` renders the Assistant app's `grafana-assistant-app/grot-topic/v1` exposed component, so list that ID under `dependencies.extensions.exposedComponents` in your `plugin.json`. On an Assistant app that doesn't expose it yet, the view says to update the Assistant. It reads the Grot and its topic as the signed-in user, so it needs `grafana-assistant-app.durable-agents.<scope>:read` for the Grot's scope and `grafana-assistant-app.durable-agents.conversations.user:read` (see `packages/assistant-go/GROTS.md`). Without them it shows its error state.
1227
+
1228
+ Every function takes `{ signal }` to abort, validates the response and throws on a malformed one. Non-2xx responses reject with the Grafana fetch error. Messages come back as raw AI SDK `UIMessage` objects; `parseGrotTopicMessage(message)` turns one into a typed `ParsedGrotMessage` (`kind` is `user`, `assistant`, `system` or `unknown`, with `text` and typed `parts`). Unknown roles and part types stay readable and do not throw; a value that is not an object, or whose `id` or `role` is not a string, throws, as in Go.
1229
+
1230
+ Change things with `updateGrot(id, { expectedRevision, name, purpose, role, labels })`, `updateGrotTopic(id, topicId, { expectedRevision, title, archived, pinned })` and `archiveGrotTopic(id, topicId, expectedRevision)`. Pass the `revision` you last read; a stale one rejects with 409. Only those fields are sent: `updateGrot` cannot change tool grants, permissions or the execution binding (use `bindGrot`, below), and extra properties are dropped. If you send `labels` to a backend that predates labels, `updateGrot` throws `GrotLabelsNotSupportedError` (its `grot` property is the updated Grot): the other fields changed but the labels did not.
1231
+
1232
+ Calls make one request unless you pass `retry`. `retry: true` uses the Go SDK's `Chat` policy: 3 attempts in total, waits of 500 ms then 1 s (doubling, at most 10 s, 10% jitter), only on 429, 502, 503 and 504. Pass `{ maxAttempts, initialBackoffMs, maxBackoffMs }` to tune it. Invalid values (NaN, Infinity, a `maxAttempts` below 1 or not whole, a negative wait) fall back to the defaults. It applies to reads and the calls that carry a `dedupeKey` (`wakeGrot`, `createGrotTopic`, `postGrotTopicMessage`); `createGrot`, `bindGrot`, `closeGrotLane`, `updateGrot`, `updateGrotTopic` and `archiveGrotTopic` never retry. The Go SDK retries none of the Grots calls, so this is off by default.
1233
+
1234
+ `createGrot(input)` sends only the fields you pass: `name`, `purpose`, `role`, `scope`, `teamId`, `ownerDelegation`, `executionBinding`, `grant` and `labels`. Nothing is added for you. `scope` defaults to `user`, a private Grot, which the backend only accepts with `ownerDelegation: true`: your explicit consent that the Grot may use your Grafana permissions for unattended background work. Set it only when the person using your code agreed. `ownerDelegation` is refused on `team` Grots, and shared (`tenant`) Grots can't be created any more.
1235
+
1236
+ A Grot created without `executionBinding` and `grant` stays a `draft` and cannot run: `createGrotTopic` fails with 400 "configure an execution identity before running the agent". To create a Grot that can run, pass both, or call `bindGrot` on the Grot afterwards. Either turns on the Grot's background work and gives it tool access, so set them only when the person using your code has explicitly agreed, and never by default. The only `executionBinding` today is `'assistant-tenant-service'`. It is the same value for both scopes, but whose access the Grot runs with depends on its scope: a private (`user`) Grot runs with its owner's current Grafana permissions, so it can do what the owner can do when it runs and loses access when the owner does; a team Grot runs as a service account scoped to its team, not as the person who bound it. Tell your users which one they are granting before you bind a Grot for them. `grant` is `{ allowAllTools: true }`, which lets the Grot call every tool, or `{ allowAllTools: false, allowedTools: ['<TOOL_NAME>'] }` with at least one tool name. The backend refuses any other shape.
1237
+
1238
+ ```typescript
1239
+ const grot = await createGrot({
1240
+ name: 'Checkout watcher',
1241
+ ownerDelegation: true,
1242
+ executionBinding: 'assistant-tenant-service',
1243
+ grant: { allowAllTools: false, allowedTools: ['<TOOL_NAME>'] },
1244
+ });
1245
+
1246
+ // Or bind a Grot you already created. A stale expectedRevision, or a run in progress, rejects with 409.
1247
+ const bound = await bindGrot(draft.id, {
1248
+ expectedRevision: draft.revision,
1249
+ executionBinding: 'assistant-tenant-service',
1250
+ grant: { allowAllTools: true },
1251
+ });
1252
+ ```
1253
+
1254
+ Required RBAC (all actions carry the `grafana-assistant-app.` prefix, plus `plugins.app:access`):
1255
+
1256
+ | Function | Permissions |
1257
+ | --- | --- |
1258
+ | `listGrots`, `getGrot` | `durable-agents.<scope>:read` |
1259
+ | `createGrot` | `durable-agents.<scope>:create` for the new Grot's scope; with `executionBinding` and `grant`, also `durable-agents:configure` and `durable-agents.<scope>:execute` |
1260
+ | `bindGrot` | `durable-agents:configure` and `durable-agents.<scope>:write`, plus `:execute` on a draft Grot |
1261
+ | `wakeGrot`, `closeGrotLane` | `durable-agents.<scope>:execute` |
1262
+ | `readGrotLane` | `:execute` and `:read`, plus `durable-agents.conversations.tenant:read` |
1263
+ | `createGrotTopic` | `:execute`, plus `conversations.user:create` (first topic) and `conversations.user:write` |
1264
+ | `postGrotTopicMessage` | `:execute` and `conversations.user:write` |
1265
+ | `updateGrot` | `durable-agents.<scope>:write` |
1266
+ | `updateGrotTopic`, `archiveGrotTopic` | `:execute` and `conversations.user:write` |
1267
+ | `parseGrotTopicMessage` | none (local) |
1268
+ | `listGrotTopics`, `listGrotTopicMessages` | `:read` and `conversations.user:read` |
1269
+
1270
+ Private Grots answer 404 to anyone but their owner, and team Grots to non-members. See `packages/assistant-go/GROTS.md` for dedupe keys, lane limits and status codes.
1271
+
1032
1272
  ### Deriving Structured Views of Investigations (Lens)
1033
1273
 
1034
1274
  The `useInvestigationThroughLens` hook derives a structured, LLM-generated view of an investigation's report, shaped by a JSON Schema you provide. Use it when a host plugin (for example, IRM) holds an `investigationId` and wants a compact, typed digest of the investigation — an executive headline, contributing factors, follow-up actions — without rendering the full report.
@@ -1183,7 +1423,7 @@ try {
1183
1423
 
1184
1424
  #### `openAssistant(props: OpenAssistantProps): void`
1185
1425
 
1186
- Opens the Grafana Assistant sidebar.
1426
+ Opens the Grafana Assistant sidebar. Repeated calls with the same prompt and context are processed even while the sidebar remains open. Calls without `chatId` start a new conversation; calls with `chatId` target that conversation.
1187
1427
 
1188
1428
  **Parameters:**
1189
1429
 
@@ -1656,6 +1896,20 @@ export type ComponentImplementation;
1656
1896
  export type NamedComponents;
1657
1897
  ```
1658
1898
 
1899
+
1900
+ ### Plugin filesystems (experimental)
1901
+
1902
+ Extension manifests can provide `filesystem: AssistantFilesystemContribution` to
1903
+ mount live text/JSON files at `/plugins/<registered-plugin-id>/`. Required callbacks
1904
+ are `read`, `list`, and `metadata`; optional `create` and conditional `write` enable
1905
+ mutations. Each receives the current Grafana namespace; the owning backend must
1906
+ authorize every operation. An optional `agentGuide` is demand-loaded as the mount's
1907
+ read-only `AGENT.md`.
1908
+
1909
+ Registered artifact kinds can render mounted files in the canvas. Ordinary files
1910
+ remain tool-accessible. Reads and listings never attach artifacts. Refer to the
1911
+ [filesystem contract and example](../../../docs/sources/reference/plugin-extensions.md#expose-a-filesystem).
1912
+
1659
1913
  ## License
1660
1914
 
1661
1915
  Apache-2.0
@@ -0,0 +1,33 @@
1
+ /** Where an integration opened or showed Assistant, which every SDK event sends. */
2
+ type SdkEventOrigin = {
3
+ /**
4
+ * The caller's `origin`: a namespaced, slash-separated name for the integration and the place in it, such as
5
+ * `grafana-slo-app/slo-editor-overview`.
6
+ */
7
+ from: string;
8
+ };
9
+ /**
10
+ * A caller opens the Assistant sidebar. The from field identifies the entry point.
11
+ */
12
+ export declare const trackSidebarOpened: (properties: SdkEventOrigin) => void;
13
+ /**
14
+ * A caller toggles the Assistant sidebar and optionally supplies a prompt.
15
+ */
16
+ export declare const trackSidebarToggled: (properties: SdkEventOrigin & {
17
+ /** The prompt the caller asked Assistant to open with, as the caller wrote it; empty when it gave none. */
18
+ prompt: string;
19
+ }) => void;
20
+ /**
21
+ * The SDK renders the Open Assistant button for an integration.
22
+ */
23
+ export declare const trackOpenButtonDisplayed: (properties: SdkEventOrigin) => void;
24
+ /**
25
+ * The SDK renders the Open Assistant split button for an integration.
26
+ */
27
+ export declare const trackSplitButtonDisplayed: (properties: SdkEventOrigin) => void;
28
+ /**
29
+ * The SDK renders an Assistant prompt card for an integration.
30
+ */
31
+ export declare const trackPromptCardDisplayed: (properties: SdkEventOrigin) => void;
32
+ export {};
33
+ //# sourceMappingURL=analyticsEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyticsEvents.d.ts","sourceRoot":"","sources":["../src/analyticsEvents.ts"],"names":[],"mappings":"AAKA,oFAAoF;AACpF,KAAK,cAAc,GAAG;IACpB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,kBAAkB,sCAA4E,CAAC;AAE5G;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAE5B,2GAA2G;YACnG,MAAM;UAE2C,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,wBAAwB,sCAEnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,sCAEpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB,sCAEnC,CAAC"}
@@ -15,18 +15,23 @@ export interface OpenAssistantButtonProps {
15
15
  size?: 'xs' | 'sm' | 'md' | 'lg';
16
16
  /** If true, the button will be Assistant icon only with name as title. Defaults to false. */
17
17
  iconOnlyButton?: boolean;
18
+ /**
19
+ * Style of the icon-only button. `'ghost'` is borderless; `'bordered'` is a standard secondary `Button`
20
+ * that lines up with other secondary icon buttons. Only applies when `iconOnlyButton` is true. Defaults to `'ghost'`.
21
+ */
22
+ iconOnlyVariant?: 'ghost' | 'bordered';
18
23
  /** Function to call when the button is clicked. Optional, defaults to undefined. */
19
24
  onClick?: () => void;
20
25
  }
21
26
  /**
22
27
  * A button component that opens the Grafana Assistant with configurable prompt and context.
23
28
  */
24
- export declare function OpenAssistantButton(props: OpenAssistantButtonProps): import("react/jsx-runtime").JSX.Element | null;
29
+ export declare function OpenAssistantButton(props: OpenAssistantButtonProps): import("react").JSX.Element | null;
25
30
  /**
26
- * Presentational component separated from OpenAssistantButton to avoid hook dependencies in Storybook.
31
+ * Presentational component separated from OpenAssistantButton to avoid hook dependencies in previews.
27
32
  * It is not exported for users of the package.
28
33
  */
29
- export declare function OpenAssistantButtonView({ prompt, origin, context, autoSend, title, size, iconOnlyButton, openAssistant, onClick, }: OpenAssistantButtonProps & {
34
+ export declare function OpenAssistantButtonView({ prompt, origin, context, autoSend, title, size, iconOnlyButton, iconOnlyVariant, openAssistant, onClick, }: OpenAssistantButtonProps & {
30
35
  openAssistant: (props: OpenAssistantProps) => void;
31
- }): import("react/jsx-runtime").JSX.Element;
36
+ }): import("react").JSX.Element;
32
37
  //# sourceMappingURL=OpenAssistantButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAssistantButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,iUAAiU;IACjU,MAAM,EAAE,MAAM,CAAC;IACf,iIAAiI;IACjI,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,6FAA6F;IAC7F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,kDAOlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAe,EACf,KAAgC,EAChC,IAAW,EACX,cAAsB,EACtB,aAAa,EACb,OAAO,GACR,EAAE,wBAAwB,GAAG;IAC5B,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,2CA6CA"}
1
+ {"version":3,"file":"OpenAssistantButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,iUAAiU;IACjU,MAAM,EAAE,MAAM,CAAC;IACf,iIAAiI;IACjI,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,6FAA6F;IAC7F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACvC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,sCAOlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAe,EACf,KAAgC,EAChC,IAAW,EACX,cAAsB,EACtB,eAAyB,EACzB,aAAa,EACb,OAAO,GACR,EAAE,wBAAwB,GAAG;IAC5B,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,+BA2DA"}
@@ -27,8 +27,8 @@ export interface OpenAssistantSplitButtonProps {
27
27
  * A split button component that opens the Grafana Assistant with a dropdown for additional actions.
28
28
  * The gradient border wraps around both buttons as a unified control.
29
29
  */
30
- export declare function OpenAssistantSplitButton(props: OpenAssistantSplitButtonProps): import("react/jsx-runtime").JSX.Element | null;
30
+ export declare function OpenAssistantSplitButton(props: OpenAssistantSplitButtonProps): import("react").JSX.Element | null;
31
31
  export declare function OpenAssistantSplitButtonView({ prompt, origin, context, autoSend, title, size, onClick, menuItems, tooltip, dropdownButtonWidth, openAssistant, }: OpenAssistantSplitButtonProps & {
32
32
  openAssistant: (props: OpenAssistantProps) => void;
33
- }): import("react/jsx-runtime").JSX.Element;
33
+ }): import("react").JSX.Element;
34
34
  //# sourceMappingURL=OpenAssistantSplitButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAssistantSplitButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantSplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,WAAW,6BAA6B;IAC5C,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvC;AAUD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,kDAM5E;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAe,EACf,KAA6B,EAC7B,IAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,mBAAmB,EACnB,aAAa,GACd,EAAE,6BAA6B,GAAG;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,2CAiDA"}
1
+ {"version":3,"file":"OpenAssistantSplitButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantSplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,WAAW,6BAA6B;IAC5C,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvC;AAUD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,sCAM5E;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAe,EACf,KAA6B,EAC7B,IAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,mBAAmB,EACnB,aAAa,GACd,EAAE,6BAA6B,GAAG;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,+BAiDA"}
@@ -7,8 +7,8 @@ export interface QueryWithAssistantButtonProps<TQuery extends DataQuery = DataQu
7
7
  queries: TQuery[];
8
8
  dataSourceInstanceSettings: DataSourceInstanceSettings;
9
9
  app?: CoreApp;
10
- datasourceApi: DataSourceApi<TQuery, DataSourceJsonData, {}> | null;
10
+ datasourceApi: DataSourceApi<TQuery, DataSourceJsonData> | null;
11
11
  title?: string;
12
12
  }
13
- export declare function QueryWithAssistantButton<TQuery extends DataQuery = DataQuery>({ size, currentQuery, queries, dataSourceInstanceSettings, app, datasourceApi, title, }: QueryWithAssistantButtonProps<TQuery>): import("react/jsx-runtime").JSX.Element | null;
13
+ export declare function QueryWithAssistantButton<TQuery extends DataQuery = DataQuery>({ size, currentQuery, queries, dataSourceInstanceSettings, app, datasourceApi, title, }: QueryWithAssistantButtonProps<TQuery>): import("react").JSX.Element | null;
14
14
  //# sourceMappingURL=QueryWithAssistantButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryWithAssistantButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/QueryWithAssistantButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,MAAM,WAAW,6BAA6B,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IACjF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,aAAa,CAAC,MAAM,EAAE,kBAAkB,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,EAAE,EAC7E,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,0BAA0B,EAC1B,GAAG,EACH,aAAa,EACb,KAA8B,GAC/B,EAAE,6BAA6B,CAAC,MAAM,CAAC,kDAsEvC"}
1
+ {"version":3,"file":"QueryWithAssistantButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/QueryWithAssistantButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,MAAM,WAAW,6BAA6B,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS;IACjF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,aAAa,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,EAAE,EAC7E,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,0BAA0B,EAC1B,GAAG,EACH,aAAa,EACb,KAA8B,GAC/B,EAAE,6BAA6B,CAAC,MAAM,CAAC,sCAsEvC"}
@@ -0,0 +1,31 @@
1
+ import { type Appearance } from '../../grots/avatar/appearance';
2
+ /** @experimental This API is under active development and may change in future releases. */
3
+ export type GrotLook = Partial<Appearance>;
4
+ /** @experimental This API is under active development and may change in future releases. */
5
+ export interface GrotAvatarProps {
6
+ /**
7
+ * The Grot to draw. Its `avatar` string is its look, such as `mint.fin.band.bars.smile.cap.empty.curl`.
8
+ * A Grot without one gets a stable look derived from its `id`.
9
+ */
10
+ grot?: {
11
+ id: string;
12
+ name?: string;
13
+ avatar?: string;
14
+ };
15
+ /**
16
+ * A look to draw instead of `grot`: the dotted avatar string, or some of the parts. A part left out, or one with
17
+ * an unknown option, is the classic Grot's.
18
+ */
19
+ look?: string | GrotLook;
20
+ /** Width and height in pixels. Defaults to 32. */
21
+ size?: number;
22
+ /** Accessible label. Defaults to the Grot's name, else "Grot". */
23
+ title?: string;
24
+ }
25
+ /**
26
+ * A Grot at rest, drawn from its look. It is an image with an accessible name.
27
+ *
28
+ * @experimental This API is under active development and may change in future releases.
29
+ */
30
+ export declare function GrotAvatar(props: GrotAvatarProps): import("react").JSX.Element;
31
+ //# sourceMappingURL=GrotAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrotAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/grots/GrotAvatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGnH,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,4FAA4F;AAC5F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAMhD"}
@@ -0,0 +1,19 @@
1
+ /** The Assistant app's exposed component this view renders. Add it to your plugin.json's `dependencies.extensions.exposedComponents`. */
2
+ export declare const GROT_TOPIC_COMPONENT_ID = "grafana-assistant-app/grot-topic/v1";
3
+ /** @experimental This API is under active development and may change in future releases. */
4
+ export interface GrotTopicViewProps {
5
+ grotId: string;
6
+ /** The topic to show, such as a `GrotTopic`. Its `number` picks it among the signed-in person's topics with the Grot. */
7
+ topic: {
8
+ number: number;
9
+ };
10
+ }
11
+ /**
12
+ * One of the signed-in person's topics with a Grot, read only, drawn by the Grafana Assistant app: the Grots page's own
13
+ * conversation, so it changes when that page does. It fills its container's height and scrolls inside it, so give the
14
+ * container a height. Needs read access to the Grot and its direct chats, and an Assistant app that exposes
15
+ * `grafana-assistant-app/grot-topic/v1`.
16
+ * @experimental This API is under active development and may change in future releases.
17
+ */
18
+ export declare function GrotTopicView({ grotId, topic }: GrotTopicViewProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=GrotTopicView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrotTopicView.d.ts","sourceRoot":"","sources":["../../../src/components/grots/GrotTopicView.tsx"],"names":[],"mappings":"AAIA,yIAAyI;AACzI,eAAO,MAAM,uBAAuB,wCAAyC,CAAC;AAE9E,4FAA4F;AAC5F,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,yHAAyH;IACzH,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B;AAOD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,kBAAkB,+BAgBlE"}
@@ -0,0 +1,23 @@
1
+ /** @experimental This API is under active development and may change in future releases. */
2
+ export interface OpenGrotButtonProps {
3
+ /** ID of the Grot to open. */
4
+ grotId: string;
5
+ /** Number of one of the Grot's topics to open on (`GrotTopic.number`). Without it the Grot opens on its topics. */
6
+ topic?: number;
7
+ /** Button text. Defaults to "Open Grot". */
8
+ label?: string;
9
+ variant?: 'primary' | 'secondary';
10
+ size?: 'sm' | 'md' | 'lg';
11
+ }
12
+ /**
13
+ * The link the Grots page opens a Grot or topic from: `?assistantGrot=<id>&assistantTopic=<number>` on the Grots page
14
+ * (`WORKSPACE_GROT_PARAM`, `WORKSPACE_TOPIC_PARAM` and `GROTS_BASE_URL` in the plugin's `constants.ts`).
15
+ */
16
+ export declare function grotHref(grotId: string, topic?: number): string;
17
+ /**
18
+ * Opens a Grot, and optionally one of its topics, on the Grafana Assistant's Grots page.
19
+ *
20
+ * @experimental This API is under active development and may change in future releases.
21
+ */
22
+ export declare function OpenGrotButton({ grotId, topic, label, variant, size, }: OpenGrotButtonProps): import("react").JSX.Element;
23
+ //# sourceMappingURL=OpenGrotButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenGrotButton.d.ts","sourceRoot":"","sources":["../../../src/components/grots/OpenGrotButton.tsx"],"names":[],"mappings":"AAKA,4FAA4F;AAC5F,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,mHAAmH;IACnH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAmB,EACnB,OAAqB,EACrB,IAAW,GACZ,EAAE,mBAAmB,+BAgBrB"}