@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
@@ -0,0 +1,82 @@
1
+ /** Local-day drink gestures; independent of the saved appearance. */
2
+ export type GrotDaypart = 'morning' | 'evening';
3
+ /**
4
+ * The parts a Grot's pixel sprite is put together from, with their options in
5
+ * the order its look editor shows them. Each part's first option is the
6
+ * classic Grot.
7
+ */
8
+ declare const options: {
9
+ readonly palette: readonly ['classic', 'mint', 'berry', 'glacier', 'night', 'moss', 'handheld', 'sunset', 'cotton', 'grape', 'ember', 'slate'];
10
+ readonly crest: readonly ['spikes', 'fin', 'mohawk', 'antenna', 'flame', 'sprout', 'horns', 'bald'];
11
+ readonly visor: readonly ['band', 'goggles', 'slim', 'shades'];
12
+ readonly screen: readonly ['bars', 'dots', 'tall', 'big', 'love', 'plus', 'dizzy', 'wink'];
13
+ readonly mouth: readonly ['smile', 'grin', 'flat', 'fang', 'stache', 'wavy'];
14
+ readonly hat: readonly ['nohat', 'beanie', 'cap', 'crown', 'party', 'headset', 'wizard', 'cowboy', 'chef', 'viking', 'tophat', 'halo', 'flower', 'copter', 'hardhat'];
15
+ readonly held: readonly ['empty', 'coffee', 'wrench', 'magnifier', 'chart', 'duck', 'pager', 'laptop', 'balloon', 'pizza', 'flag', 'donut', 'clip', 'bell', 'shield', 'bug', 'key'];
16
+ readonly tail: readonly ['curl', 'spike', 'bolt', 'heart', 'fluff', 'notail'];
17
+ };
18
+ export type GrotPart = keyof typeof options;
19
+ export type Appearance = {
20
+ [P in GrotPart]: (typeof options)[P][number];
21
+ };
22
+ export type GrotOption = Appearance[GrotPart];
23
+ /** Typed per part, so a part's options are its own option type. */
24
+ export declare const grotOptions: {
25
+ [P in GrotPart]: readonly Appearance[P][];
26
+ };
27
+ export declare const partLabels: {
28
+ palette: string;
29
+ crest: string;
30
+ visor: string;
31
+ screen: string;
32
+ mouth: string;
33
+ hat: string;
34
+ held: string;
35
+ tail: string;
36
+ };
37
+ /** The parts in editor order, which is also the order an avatar string stores them in. */
38
+ export declare const partOrder: GrotPart[];
39
+ export type GrotPalette = Appearance['palette'];
40
+ /**
41
+ * Grot's own illustration palettes. These are mascot colours, not UI colours:
42
+ * they stay the same in light and dark themes, like the mascot artwork does.
43
+ * `accent` is the UI token that stands in for the Grot on its surfaces.
44
+ */
45
+ export declare const grotPalette: Record<GrotPalette, {
46
+ outline: string;
47
+ body: string;
48
+ light: string;
49
+ shade: string;
50
+ crest: string;
51
+ crestShade: string;
52
+ visor: string;
53
+ visorLight: string;
54
+ screen: string;
55
+ glyph: string;
56
+ accent: string;
57
+ }>;
58
+ /** The classic Grot: every part's first option. */
59
+ export declare const classicLook: Appearance;
60
+ /** Options that were removed, by part: the id a saved look may still name, and the option that replaces it. */
61
+ export declare const renamedOptions: {
62
+ [P in GrotPart]?: Record<string, Appearance[P]>;
63
+ };
64
+ type Renamed = {
65
+ [Q in GrotPart]?: Record<string, Appearance[Q]>;
66
+ };
67
+ /**
68
+ * The stored look, part by part. A part it does not name, such as one added
69
+ * since it was saved, gets a stable option derived from the id. A removed option
70
+ * maps to its replacement in renamedOptions first.
71
+ */
72
+ export declare function appearanceWith(agent: {
73
+ id: string;
74
+ avatar?: string;
75
+ }, renamed: Renamed): Appearance;
76
+ /** The stored look of an agent. Takes one argument, so it is safe to pass to `.map`. */
77
+ export declare const appearanceOf: (agent: {
78
+ id: string;
79
+ avatar?: string;
80
+ }) => Appearance;
81
+ export {};
82
+ //# sourceMappingURL=appearance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../src/grots/avatar/appearance.ts"],"names":[],"mappings":"AACA,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhD;;;;GAIG;AACH,QAAA,MAAM,OAAO;aACX,OAAO,YACL,SAAS,EACT,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO;aAET,KAAK,YAAG,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;aAChF,KAAK,YAAG,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ;aAC3C,MAAM,YAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;aACvE,KAAK,YAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;aACzD,GAAG,YACD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ACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAgKF,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,WAAW,EAAE,UASzB,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,cAAc,EAAE;KAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAI7E,CAAC;AAEF,KAAK,OAAO,GAAG;KAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAoCnE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,CASnG;AAED,wFAAwF;AACxF,eAAO,MAAM,YAAY,UAAW;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,UAC/B,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { type Appearance, type GrotPalette } from './appearance';
2
+ /**
3
+ * A Grot is a 32×32 pixel sprite put together from parts, back to front.
4
+ * Each part is rows of pixels from (x, y); `.` is empty and every other
5
+ * character names a colour. A part gets a one-pixel dark outline unless it is
6
+ * bare, so parts in front draw a clean edge over the ones behind.
7
+ */
8
+ export interface Part {
9
+ x: number;
10
+ y: number;
11
+ rows: readonly string[];
12
+ bare?: boolean;
13
+ }
14
+ export declare const SPRITE_SIZE = 32;
15
+ /** The classic Grot side on, facing right: a round body, a dorsal crest, a wraparound visor and amber arms. */
16
+ export declare const body: Part;
17
+ export declare const feet: {
18
+ back: {
19
+ x: number;
20
+ y: number;
21
+ rows: string[];
22
+ };
23
+ front: {
24
+ x: number;
25
+ y: number;
26
+ rows: string[];
27
+ };
28
+ };
29
+ /** The near arm, which holds things and waves. */
30
+ export declare const arms: {
31
+ rest: {
32
+ x: number;
33
+ y: number;
34
+ rows: string[];
35
+ };
36
+ up: {
37
+ x: number;
38
+ y: number;
39
+ rows: string[];
40
+ };
41
+ };
42
+ export declare const crests: Record<Appearance['crest'], Part | undefined>;
43
+ /** Visors: `n` is the screen the eyes and status glyphs show on. They wrap the front of the face. */
44
+ export declare const visors: Record<Appearance['visor'], Part>;
45
+ /** Where each visor's two eyes sit: their centre columns and row. */
46
+ export declare const eyesAt: Record<Appearance['visor'], {
47
+ x: [number, number];
48
+ y: number;
49
+ }>;
50
+ /** The mouths people pick, plus the open "o" an alarmed Grot makes. The classic one is a smirk. */
51
+ export declare const mouths: Record<Appearance['mouth'] | 'o', Part>;
52
+ export declare const hats: Record<Appearance['hat'], Part | undefined>;
53
+ /** Hats tall enough to cover most of a crest: the crest is not drawn under them. */
54
+ export declare const crestHidingHats: ReadonlySet<Appearance['hat']>;
55
+ /** What a Grot holds in its near hand, in front of its belly. */
56
+ export declare const heldItems: Record<Appearance['held'], Part | undefined>;
57
+ /** Tails trail behind, at the bottom left. */
58
+ export declare const tails: Record<Appearance['tail'], Part | undefined>;
59
+ /**
60
+ * What a visor's screen can show, built once per visor: the screen itself to
61
+ * clip to, the eyes in each style, and the glyphs that replace them by mood.
62
+ */
63
+ export declare const screens: (key: "band" | "goggles" | "shades" | "slim") => {
64
+ screen: Part;
65
+ eyes: {
66
+ bars: Part;
67
+ dots: Part;
68
+ tall: Part;
69
+ big: Part;
70
+ love: Part;
71
+ plus: Part;
72
+ dizzy: Part;
73
+ wink: Part;
74
+ };
75
+ };
76
+ export interface Paint {
77
+ fill: string;
78
+ d: string;
79
+ }
80
+ /** A part as one path per colour, on its outline unless it is bare. */
81
+ export declare function paint(part: Part | undefined, palette: GrotPalette): Paint[];
82
+ /** An idle Grot sprite as a transparent SVG data URL for surfaces that take an image src (e.g. `@` menu items). */
83
+ export declare function spriteSvgDataUrl(look: Appearance): string;
84
+ //# sourceMappingURL=sprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../../src/grots/avatar/sprite.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,KAAK,CAAC;AA2C9B,+GAA+G;AAC/G,eAAO,MAAM,IAAI,EAAE,IA2BlB,CAAC;AAEF,eAAO,MAAM,IAAI;;QACP,CAAC;QAAM,CAAC;QAAM,IAAI;;;QACjB,CAAC;QAAM,CAAC;QAAM,IAAI;;CACG,CAAC;AAEjC,kDAAkD;AAClD,eAAO,MAAM,IAAI;;QACP,CAAC;QAAM,CAAC;QAAM,IAAI;;;QACpB,CAAC;QAAM,CAAC;QAAM,IAAI;;CACM,CAAC;AAEjC,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAuDhE,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAiBpD,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAKlF,CAAC;AAuDF,mGAAmG;AACnG,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,GAAG,EAAE,IAAI,CAQ1D,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAsC5D,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAUzD,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAsDlE,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAO9D,CAAC;AA0BF;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;CAyClB,CAAC;AAEH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;CACX;AA2BD,uEAAuE;AACvE,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,KAAK,EAAE,CA+B3E;AAID,mHAAmH;AACnH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAiCzD"}
@@ -0,0 +1,130 @@
1
+ import type { BindGrotInput, CreateGrotInput, CreateGrotTopicInput, Grot, GrotEvent, GrotLane, GrotLaneClosed, GrotMessage, GrotMessagesPage, GrotRequestOptions, GrotTopic, GrotTopicAccepted, GrotTopicList, GrotTopicMessageInput, GrotWork, ListGrotsOptions, ListGrotTopicMessagesOptions, ListGrotTopicsOptions, ParsedGrotMessage, ReadGrotLaneOptions, UpdateGrotInput, UpdateGrotTopicInput } from './types';
2
+ /**
3
+ * List the Grots the signed-in user may use (newest 100, newest first).
4
+ * Needs `durable-agents.<scope>:read` for each scope listed.
5
+ * @experimental This API is under active development and may change in future releases.
6
+ */
7
+ export declare function listGrots(options?: ListGrotsOptions): Promise<Grot[]>;
8
+ /**
9
+ * Read one Grot. Another user's private Grot returns 404.
10
+ *
11
+ * @experimental This API is under active development and may change in future releases.
12
+ */
13
+ export declare function getGrot(grotId: string, options?: GrotRequestOptions): Promise<Grot>;
14
+ /**
15
+ * Create a Grot. Needs `durable-agents.<scope>:create` for the new Grot's scope. Never retried, even with
16
+ * `retry` set: retrying creation can create duplicates.
17
+ *
18
+ * The call sends exactly the fields of {@link CreateGrotInput} and nothing else. A private Grot (the default scope)
19
+ * needs `ownerDelegation: true`, the creator's explicit consent for background work with their own Grafana
20
+ * permissions. On a `team` Grot the backend refuses it, so it is dropped from the request.
21
+ *
22
+ * Without `executionBinding` and `grant` the Grot is created as a `draft` and cannot run: a run, such as
23
+ * `createGrotTopic`, fails with 400 until you call {@link bindGrot}. Pass both to create a Grot that can run at
24
+ * once. That turns on its background work and gives it tool access, so it also needs `durable-agents:configure`
25
+ * and `durable-agents.<scope>:execute`. `grant: { allowAllTools: true }` lets the Grot call every tool. Set these
26
+ * only when the person using your code has explicitly agreed; they are never defaulted.
27
+ * @experimental This API is under active development and may change in future releases.
28
+ */
29
+ export declare function createGrot(input: CreateGrotInput, options?: GrotRequestOptions): Promise<Grot>;
30
+ /**
31
+ * Give an existing Grot access so it can run (`PUT /durable-agents/{id}/binding`; the Go SDK has no such call). On
32
+ * a `draft` Grot this also activates it and turns on its background work; on an active one it replaces the tool
33
+ * grant. Needs `durable-agents:configure` and `durable-agents.<scope>:write`, plus `:execute` for a draft. A stale
34
+ * `expectedRevision` returns 409, as does a Grot with a run in progress; wait for it to finish, re-read the Grot
35
+ * and call again. Never retried, even with `retry` set. Returns the updated Grot.
36
+ *
37
+ * `grant: { allowAllTools: true }` lets the Grot call every tool. Only call this when the person using your code
38
+ * has explicitly agreed to give the Grot that access.
39
+ * @experimental This API is under active development and may change in future releases.
40
+ */
41
+ export declare function bindGrot(grotId: string, input: BindGrotInput, options?: GrotRequestOptions): Promise<Grot>;
42
+ /**
43
+ * Wake a Grot with a workflow event in its own conversation. Needs `durable-agents.<scope>:execute`.
44
+ * Retry only with the same workflow, laneKey, dedupeKey and body. The API limits `workflow` to 253 characters,
45
+ * `title`, `dedupeKey`, `runId` and `stepId` to 256, and `content` to 16000. Unlike direct-topic keys, a workflow
46
+ * `dedupeKey` may contain ":".
47
+ * @experimental This API is under active development and may change in future releases.
48
+ */
49
+ export declare function wakeGrot(grotId: string, event: GrotEvent, options?: GrotRequestOptions): Promise<GrotWork>;
50
+ /** Close a lane to free one of the Grot's 50 open lanes. An unknown lane returns `closed: false`. Never retried, even
51
+ * with `retry`: a repeat after a lost response would report `closed: false` for a lane the first call closed.
52
+ *
53
+ * @experimental This API is under active development and may change in future releases.
54
+ */
55
+ export declare function closeGrotLane(grotId: string, laneKey: string, options?: GrotRequestOptions): Promise<GrotLaneClosed>;
56
+ /**
57
+ * Read a lane you opened with `wakeGrot`. Needs `durable-agents.<scope>:execute` and `:read`, plus
58
+ * `conversations.tenant:read`. A key you never sent returns 404.
59
+ * @experimental This API is under active development and may change in future releases.
60
+ */
61
+ export declare function readGrotLane(grotId: string, laneKey: string, options?: ReadGrotLaneOptions): Promise<GrotLane>;
62
+ /**
63
+ * Open a topic in the signed-in user's direct conversation with a Grot and send its first message.
64
+ * Needs `durable-agents.<scope>:execute`, plus `conversations.user:create` for the first topic and
65
+ * `conversations.user:write` for later topics and for retries. Retries only with `retry`
66
+ * (the `dedupeKey` makes that safe); otherwise retry by hand with the same `dedupeKey`.
67
+ * @experimental This API is under active development and may change in future releases.
68
+ */
69
+ export declare function createGrotTopic(grotId: string, input: CreateGrotTopicInput, options?: GrotRequestOptions): Promise<GrotTopicAccepted>;
70
+ /**
71
+ * Send a follow-up message in an existing topic. Posting to an archived topic restores it.
72
+ * Needs `durable-agents.<scope>:execute` and `conversations.user:write`.
73
+ * @experimental This API is under active development and may change in future releases.
74
+ */
75
+ export declare function postGrotTopicMessage(grotId: string, topicId: string, message: GrotTopicMessageInput, options?: GrotRequestOptions): Promise<GrotTopicAccepted>;
76
+ /**
77
+ * List the topics in the signed-in user's direct conversation with a Grot. 404 before the first topic.
78
+ * Needs `durable-agents.<scope>:read` and `conversations.user:read`.
79
+ * @experimental This API is under active development and may change in future releases.
80
+ */
81
+ export declare function listGrotTopics(grotId: string, options?: ListGrotTopicsOptions): Promise<GrotTopicList>;
82
+ /**
83
+ * Read a topic's messages, oldest first. Pass the topic's `chatId`, not its `id`.
84
+ * Needs `durable-agents.<scope>:read` and read access on that chat (`conversations.user:read` for your direct
85
+ * topics).
86
+ * @experimental This API is under active development and may change in future releases.
87
+ */
88
+ export declare function listGrotTopicMessages(grotId: string, chatId: string, options?: ListGrotTopicMessagesOptions): Promise<GrotMessagesPage>;
89
+ /**
90
+ * Thrown by `updateGrot` when you sent `labels` and the response has no `labels` key: a backend that predates
91
+ * labels (grafana-assistant-app #17893) applied the other fields and ignored the labels, so even `{}` did not clear
92
+ * them. Mirrors the Go SDK's `ErrLabelsNotSupported`. `grot` is the updated Grot.
93
+ * @experimental This API is under active development and may change in future releases.
94
+ */
95
+ export declare class GrotLabelsNotSupportedError extends Error {
96
+ readonly grot: Grot;
97
+ constructor(grot: Grot);
98
+ }
99
+ /**
100
+ * Change a Grot's name, purpose, role or labels (Go: `UpdateGrot`, `PUT /durable-agents/{id}`). A stale
101
+ * `expectedRevision` returns 409. Needs `durable-agents.<scope>:write`. Never retried. Throws {@link GrotLabelsNotSupportedError} (carrying the updated Grot)
102
+ * when `labels` was sent and the backend did not return labels.
103
+ *
104
+ * The body is built from `expectedRevision`, `name`, `purpose`, `role` and `labels` only. The backend's update body
105
+ * also accepts avatar, budget, parallel runs and memory mode, which the Go SDK leaves out and so does this client;
106
+ * the tool grant and execution binding have their own route, {@link bindGrot}, and cannot be sent from here.
107
+ * @experimental This API is under active development and may change in future releases.
108
+ */
109
+ export declare function updateGrot(grotId: string, input: UpdateGrotInput, options?: GrotRequestOptions): Promise<Grot>;
110
+ /**
111
+ * Rename, archive, restore, pin or unpin a topic (Go: `UpdateTopic`,
112
+ * `PUT /durable-agents/{id}/direct/topics/{topicId}`). A stale `expectedRevision` returns 409. Needs
113
+ * `durable-agents.<scope>:execute` and `conversations.user:write`. Never retried.
114
+ * @experimental This API is under active development and may change in future releases.
115
+ */
116
+ export declare function updateGrotTopic(grotId: string, topicId: string, input: UpdateGrotTopicInput, options?: GrotRequestOptions): Promise<GrotTopic>;
117
+ /**
118
+ * Archive a topic (Go: `ArchiveTopic`). Same route and RBAC as {@link updateGrotTopic}; post a message to restore it.
119
+ *
120
+ * @experimental This API is under active development and may change in future releases.
121
+ */
122
+ export declare function archiveGrotTopic(grotId: string, topicId: string, expectedRevision: number, options?: GrotRequestOptions): Promise<GrotTopic>;
123
+ /**
124
+ * Decode a raw message from `listGrotTopicMessages` or `readGrotLane` (Go: `ParseTopicMessage`). Like Go it throws
125
+ * when the value is not an object or `id` / `role` is not a string. Unlike Go it keeps unknown roles and part types
126
+ * readable (`kind: 'unknown'`) instead of failing. `GrotMessage` itself is unchanged.
127
+ * @experimental This API is under active development and may change in future releases.
128
+ */
129
+ export declare function parseGrotTopicMessage(raw: GrotMessage): ParsedGrotMessage;
130
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/grots/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,IAAI,EAEJ,SAAS,EACT,QAAQ,EACR,cAAc,EACd,WAAW,EAEX,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,EACjB,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d,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAY5B;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAGhH;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,gBAAgB,CAAC,CAY3B;AAED;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,IAAI;IAA/B,YAAqB,IAAI,EAAE,IAAI,EAG9B;CACF;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,eAAe,EACtB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAcf;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,oBAAoB,EAC3B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,SAAS,CAAC,CAUpB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,SAAS,CAAC,CAEpB;AAmCD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,GAAG,iBAAiB,CAsBzE"}
@@ -0,0 +1,3 @@
1
+ export { archiveGrotTopic, bindGrot, closeGrotLane, createGrot, createGrotTopic, getGrot, GrotLabelsNotSupportedError, listGrotTopicMessages, listGrotTopics, listGrots, parseGrotTopicMessage, postGrotTopicMessage, readGrotLane, updateGrot, updateGrotTopic, wakeGrot, } from './client';
2
+ export type { BindGrotInput, CreateGrotInput, CreateGrotTopicInput, Grot, GrotDirectTopic, GrotEvent, GrotExecutionBinding, GrotGrant, GrotLane, GrotLaneClosed, GrotMessage, GrotMessagePart, GrotMessagesPage, GrotRequestOptions, GrotRetryOptions, GrotTopic, GrotTopicAccepted, GrotTopicList, GrotTopicMessageInput, GrotWork, ListGrotsOptions, ListGrotTopicMessagesOptions, ListGrotTopicsOptions, ParsedGrotMessage, ReadGrotLaneOptions, UpdateGrotInput, UpdateGrotTopicInput, } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/grots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,OAAO,EACP,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,GACT,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,IAAI,EACJ,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { GrotRetryOptions } from './types';
2
+ export declare function isRetryableStatus(error: unknown): boolean;
3
+ /** Wait before retry number `attempt` (1 is the wait after the first failure). `random` is injectable for tests. */
4
+ export declare function backoffMs(attempt: number, options?: GrotRetryOptions, random?: () => number): number;
5
+ /** Run `attempt`, repeating it on a retryable status when `retry` is enabled. Aborting stops the wait. */
6
+ export declare function withRetry<T>(attempt: () => Promise<T>, retry: boolean | GrotRetryOptions | undefined, signal?: AbortSignal): Promise<T>;
7
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/grots/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsBhD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGzD;AAED,oHAAoH;AACpH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,EAAE,MAAM,eAAc,GAAG,MAAM,CAOvG;AAoBD,0GAA0G;AAC1G,wBAAsB,SAAS,CAAC,CAAC,EAC/B,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,EAC7C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CAgBZ"}