@grafana/assistant 0.1.13 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -2
- package/dist/components/button/OpenAssistantButton.d.ts +0 -33
- package/dist/components/button/OpenAssistantButton.d.ts.map +0 -1
- package/dist/components/button/OpenAssistantButton.stories.d.ts +0 -11
- package/dist/components/button/OpenAssistantButton.stories.d.ts.map +0 -1
- package/dist/components/button/OpenAssistantSplitButton.d.ts +0 -32
- package/dist/components/button/OpenAssistantSplitButton.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/input/AITextArea.d.ts +0 -12
- package/dist/components/input/AITextArea.d.ts.map +0 -1
- package/dist/components/input/AITextArea.stories.d.ts +0 -26
- package/dist/components/input/AITextArea.stories.d.ts.map +0 -1
- package/dist/components/input/AITextInput.d.ts +0 -10
- package/dist/components/input/AITextInput.d.ts.map +0 -1
- package/dist/components/input/AITextInput.stories.d.ts +0 -22
- package/dist/components/input/AITextInput.stories.d.ts.map +0 -1
- package/dist/components/input/types.d.ts +0 -14
- package/dist/components/input/types.d.ts.map +0 -1
- package/dist/context/base.d.ts +0 -31
- package/dist/context/base.d.ts.map +0 -1
- package/dist/context/chat.d.ts +0 -37
- package/dist/context/chat.d.ts.map +0 -1
- package/dist/context/component.d.ts +0 -45
- package/dist/context/component.d.ts.map +0 -1
- package/dist/context/dashboard.d.ts +0 -28
- package/dist/context/dashboard.d.ts.map +0 -1
- package/dist/context/datasource.d.ts +0 -20
- package/dist/context/datasource.d.ts.map +0 -1
- package/dist/context/entity.d.ts +0 -28
- package/dist/context/entity.d.ts.map +0 -1
- package/dist/context/factory.d.ts +0 -57
- package/dist/context/factory.d.ts.map +0 -1
- package/dist/context/index.d.ts +0 -13
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/label.d.ts +0 -33
- package/dist/context/label.d.ts.map +0 -1
- package/dist/context/page.d.ts +0 -47
- package/dist/context/page.d.ts.map +0 -1
- package/dist/context/playbook.d.ts +0 -13
- package/dist/context/playbook.d.ts.map +0 -1
- package/dist/context/questions.d.ts +0 -42
- package/dist/context/questions.d.ts.map +0 -1
- package/dist/context/types.d.ts +0 -75
- package/dist/context/types.d.ts.map +0 -1
- package/dist/functions.d.ts +0 -12
- package/dist/functions.d.ts.map +0 -1
- package/dist/hook.d.ts +0 -13
- package/dist/hook.d.ts.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/inline/index.d.ts +0 -4
- package/dist/inline/index.d.ts.map +0 -1
- package/dist/inline/inlineAssistant.d.ts +0 -40
- package/dist/inline/inlineAssistant.d.ts.map +0 -1
- package/dist/inline/types.d.ts +0 -84
- package/dist/inline/types.d.ts.map +0 -1
- package/dist/inline/useInlineAssistant.d.ts +0 -65
- package/dist/inline/useInlineAssistant.d.ts.map +0 -1
- package/dist/investigations.d.ts +0 -41
- package/dist/investigations.d.ts.map +0 -1
- package/dist/limits/index.d.ts +0 -73
- package/dist/limits/index.d.ts.map +0 -1
- package/dist/plugin.d.ts +0 -9
- package/dist/plugin.d.ts.map +0 -1
- package/dist/sidebar.d.ts +0 -26
- package/dist/sidebar.d.ts.map +0 -1
- package/dist/terms/index.d.ts +0 -60
- package/dist/terms/index.d.ts.map +0 -1
- package/dist/terms/settings.gen.d.ts +0 -461
- package/dist/terms/settings.gen.d.ts.map +0 -1
- package/dist/terms/versionCompare.d.ts +0 -16
- package/dist/terms/versionCompare.d.ts.map +0 -1
- package/dist/tools/index.d.ts +0 -3
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/toolFactory.d.ts +0 -22
- package/dist/tools/toolFactory.d.ts.map +0 -1
- package/dist/tools/types.d.ts +0 -181
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/utils/hash.d.ts +0 -6
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/theme.d.ts +0 -30
- package/dist/utils/theme.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/assistant",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Type definitions and helper functions for Grafana Assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,16 +32,20 @@
|
|
|
32
32
|
"author": "Grafana Labs",
|
|
33
33
|
"license": "Apache-2.0",
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@emotion/css": "^11.0.0",
|
|
36
|
+
"@grafana/tsconfig": "^2.0.0",
|
|
35
37
|
"@storybook/react": "^8.6.14",
|
|
36
|
-
"@swc/core": "1.15.
|
|
38
|
+
"@swc/core": "1.15.11",
|
|
37
39
|
"@swc/jest": "^0.2.26",
|
|
38
40
|
"@testing-library/jest-dom": "^6.1.4",
|
|
39
41
|
"@testing-library/react": "14.3.1",
|
|
40
42
|
"@types/jest": "^29.5.0",
|
|
43
|
+
"@types/react": "^18.0.0",
|
|
41
44
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
42
45
|
"jest": "^29.5.0",
|
|
43
46
|
"jest-environment-jsdom": "^29.5.0",
|
|
44
47
|
"react": "18.3.1",
|
|
48
|
+
"react-dom": "18.3.1",
|
|
45
49
|
"rxjs": "7.8.2",
|
|
46
50
|
"ts-loader": "^9.5.2",
|
|
47
51
|
"typescript": "^5.0.0",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChatContextItem } from '../../context/types';
|
|
3
|
-
import { OpenAssistantProps } from '../../sidebar';
|
|
4
|
-
export interface OpenAssistantButtonProps {
|
|
5
|
-
/** Prompt to pass to the openAssistant function. */
|
|
6
|
-
prompt: string;
|
|
7
|
-
/** Origin of the request that opened the assistant. This is used to track the source of the request. Should be a structured string using forward slashes, with the first part as a namespace. Examples: 'grafana-datasources/prometheus/query-builder', 'grafana-slo-app/slo-editor-overview', 'grafana/trace-view-analyzer`. */
|
|
8
|
-
origin: string;
|
|
9
|
-
/** Context to pass to the openAssistant function. Optional, defaults to undefined. Created with `createAssistantContextItem`. */
|
|
10
|
-
context?: ChatContextItem[];
|
|
11
|
-
/** Whether to automatically send the prompt. Optional, defaults to true. */
|
|
12
|
-
autoSend?: boolean;
|
|
13
|
-
/** Text to display on the button. Optional, defaults to 'Analyze with Assistant' */
|
|
14
|
-
title?: string;
|
|
15
|
-
/** Button size, defaults to sm */
|
|
16
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
17
|
-
/** If true, the button will be Assistant icon only with name as title. Defaults to false. */
|
|
18
|
-
iconOnlyButton?: boolean;
|
|
19
|
-
/** Function to call when the button is clicked. Optional, defaults to undefined. */
|
|
20
|
-
onClick?: () => void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* A button component that opens the Grafana Assistant with configurable prompt and context.
|
|
24
|
-
*/
|
|
25
|
-
export declare function OpenAssistantButton(props: OpenAssistantButtonProps): React.JSX.Element | null;
|
|
26
|
-
/**
|
|
27
|
-
* Presentational component separated from OpenAssistantButton to avoid hook dependencies in Storybook.
|
|
28
|
-
* It is not exported for users of the package.
|
|
29
|
-
*/
|
|
30
|
-
export declare function OpenAssistantButtonView({ prompt, origin, context, autoSend, title, size, iconOnlyButton, openAssistant, onClick, }: OpenAssistantButtonProps & {
|
|
31
|
-
openAssistant: (props: OpenAssistantProps) => void;
|
|
32
|
-
}): React.JSX.Element;
|
|
33
|
-
//# sourceMappingURL=OpenAssistantButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAssistantButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,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,4BAOlE;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,qBA6CA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { OpenAssistantButtonView } from './OpenAssistantButton';
|
|
3
|
-
declare const meta: Meta<typeof OpenAssistantButtonView>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof OpenAssistantButtonView>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const IconOnly: Story;
|
|
8
|
-
export declare const LargeButton: Story;
|
|
9
|
-
export declare const CustomTitle: Story;
|
|
10
|
-
export declare const WithBackground: Story;
|
|
11
|
-
//# sourceMappingURL=OpenAssistantButton.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAssistantButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,uBAAuB,CA0B9C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtD,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAgC5B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { ChatContextItem } from '../../context/types';
|
|
3
|
-
import { OpenAssistantProps } from '../../sidebar';
|
|
4
|
-
export interface OpenAssistantSplitButtonProps {
|
|
5
|
-
/** Prompt to pass to the openAssistant function. */
|
|
6
|
-
prompt: string;
|
|
7
|
-
/** Origin of the request that opened the assistant. */
|
|
8
|
-
origin: string;
|
|
9
|
-
/** Context to pass to the openAssistant function. Optional, defaults to undefined. */
|
|
10
|
-
context?: ChatContextItem[];
|
|
11
|
-
/** Whether to automatically send the prompt. Optional, defaults to true. */
|
|
12
|
-
autoSend?: boolean;
|
|
13
|
-
/** Text to display on the button. Optional, defaults to 'Chat with Assistant' */
|
|
14
|
-
title?: string;
|
|
15
|
-
/** Button size, defaults to sm */
|
|
16
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
17
|
-
/** Function to call when the main button is clicked. Optional. */
|
|
18
|
-
onClick?: () => void;
|
|
19
|
-
/** Additional menu items to show in the dropdown. Optional. */
|
|
20
|
-
menuItems?: ReactElement;
|
|
21
|
-
/** Tooltip text to display on hover. Optional. */
|
|
22
|
-
tooltip?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* A split button component that opens the Grafana Assistant with a dropdown for additional actions.
|
|
26
|
-
* The gradient border wraps around both buttons as a unified control.
|
|
27
|
-
*/
|
|
28
|
-
export declare function OpenAssistantSplitButton(props: OpenAssistantSplitButtonProps): React.JSX.Element | null;
|
|
29
|
-
export declare function OpenAssistantSplitButtonView({ prompt, origin, context, autoSend, title, size, onClick, menuItems, tooltip, openAssistant, }: OpenAssistantSplitButtonProps & {
|
|
30
|
-
openAssistant: (props: OpenAssistantProps) => void;
|
|
31
|
-
}): React.JSX.Element;
|
|
32
|
-
//# sourceMappingURL=OpenAssistantSplitButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAssistantSplitButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/OpenAssistantSplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,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,GAAG,IAAI,CAAC;IACjC,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;CAClB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,4BAM5E;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAe,EACf,KAA6B,EAC7B,IAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE,6BAA6B,GAAG;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD,qBA6CA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { OpenAssistantButton, type OpenAssistantButtonProps } from './button/OpenAssistantButton';
|
|
2
|
-
export { OpenAssistantSplitButton, type OpenAssistantSplitButtonProps } from './button/OpenAssistantSplitButton';
|
|
3
|
-
export { AITextInput, type AITextInputProps } from './input/AITextInput';
|
|
4
|
-
export { AITextArea, type AITextAreaProps } from './input/AITextArea';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,KAAK,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AIInputProps } from './types';
|
|
3
|
-
export interface AITextAreaProps extends AIInputProps {
|
|
4
|
-
/** Number of rows for the textarea */
|
|
5
|
-
rows?: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* An AI-powered controlled textarea component that uses the Grafana Assistant engine to generate content.
|
|
9
|
-
* Features an integrated send button as well as a gradient border animation while generating.
|
|
10
|
-
*/
|
|
11
|
-
export declare function AITextArea({ value, onChange, placeholder, origin, systemPrompt, onComplete, onError, onDelta, disabled, rows, className, 'data-testid': dataTestId, }: AITextAreaProps): React.JSX.Element;
|
|
12
|
-
//# sourceMappingURL=AITextArea.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AITextArea.d.ts","sourceRoot":"","sources":["../../../src/components/input/AITextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAgB,EAChB,IAAQ,EACR,SAAS,EACT,aAAa,EAAE,UAAU,GAC1B,EAAE,eAAe,qBAkEjB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AITextArea } from './AITextArea';
|
|
3
|
-
declare const meta: Meta<typeof AITextArea>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AITextArea>;
|
|
6
|
-
/**
|
|
7
|
-
* Basic usage with controlled state
|
|
8
|
-
*/
|
|
9
|
-
export declare const Basic: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Larger textarea for longer content
|
|
12
|
-
*/
|
|
13
|
-
export declare const LargeTextArea: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Disabled state
|
|
16
|
-
*/
|
|
17
|
-
export declare const Disabled: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Custom width
|
|
20
|
-
*/
|
|
21
|
-
export declare const CustomWidth: Story;
|
|
22
|
-
/**
|
|
23
|
-
* With error handling
|
|
24
|
-
*/
|
|
25
|
-
export declare const WithErrorHandling: Story;
|
|
26
|
-
//# sourceMappingURL=AITextArea.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AITextArea.stories.d.ts","sourceRoot":"","sources":["../../../src/components/input/AITextArea.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAyCjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KA6BnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAuB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAatB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAiD/B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AIInputProps } from './types';
|
|
3
|
-
export interface AITextInputProps extends AIInputProps {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* An AI-powered controlled text input component that uses the Grafana Assistant engine to generate content.
|
|
7
|
-
* Features an integrated send button as well as a gradient border animation while generating.
|
|
8
|
-
*/
|
|
9
|
-
export declare function AITextInput({ value, onChange, placeholder, origin, systemPrompt, onComplete, onError, onDelta, disabled, className, 'data-testid': dataTestId, }: AITextInputProps): React.JSX.Element;
|
|
10
|
-
//# sourceMappingURL=AITextInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AITextInput.d.ts","sourceRoot":"","sources":["../../../src/components/input/AITextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,gBAAiB,SAAQ,YAAY;CAAG;AAEzD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,aAAa,EAAE,UAAU,GAC1B,EAAE,gBAAgB,qBA+DlB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AITextInput } from './AITextInput';
|
|
3
|
-
declare const meta: Meta<typeof AITextInput>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AITextInput>;
|
|
6
|
-
/**
|
|
7
|
-
* Basic usage with controlled state
|
|
8
|
-
*/
|
|
9
|
-
export declare const Basic: Story;
|
|
10
|
-
/**
|
|
11
|
-
* Disabled state
|
|
12
|
-
*/
|
|
13
|
-
export declare const Disabled: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Custom width
|
|
16
|
-
*/
|
|
17
|
-
export declare const CustomWidth: Story;
|
|
18
|
-
/**
|
|
19
|
-
* With error handling
|
|
20
|
-
*/
|
|
21
|
-
export declare const WithErrorHandling: Story;
|
|
22
|
-
//# sourceMappingURL=AITextInput.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AITextInput.stories.d.ts","sourceRoot":"","sources":["../../../src/components/input/AITextInput.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAqClC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KA0BnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAatB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAsC/B,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface AIInputProps {
|
|
2
|
-
value: string;
|
|
3
|
-
onChange: (value: string) => void;
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
origin: string;
|
|
6
|
-
systemPrompt?: string;
|
|
7
|
-
onComplete?: (text: string) => void;
|
|
8
|
-
onError?: (error: Error) => void;
|
|
9
|
-
onDelta?: (delta: string) => void;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
'data-testid'?: string;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/input/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/context/base.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IconName } from '@grafana/ui';
|
|
2
|
-
import { ItemDataType, type ContextItemData } from './types';
|
|
3
|
-
export interface BaseParams {
|
|
4
|
-
title?: string;
|
|
5
|
-
hidden?: boolean;
|
|
6
|
-
img?: string;
|
|
7
|
-
icon?: IconName;
|
|
8
|
-
}
|
|
9
|
-
export interface NodeDataParams extends BaseParams {
|
|
10
|
-
id: string;
|
|
11
|
-
type: ItemDataType;
|
|
12
|
-
text?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class NodeData {
|
|
15
|
-
params: NodeDataParams;
|
|
16
|
-
id: string;
|
|
17
|
-
text: string;
|
|
18
|
-
type: ItemDataType;
|
|
19
|
-
constructor(params: NodeDataParams);
|
|
20
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
21
|
-
equals(other: unknown): boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface StructuredNodeDataParams extends BaseParams {
|
|
24
|
-
data: Record<string, any>;
|
|
25
|
-
}
|
|
26
|
-
export declare class StructuredNodeData extends NodeData {
|
|
27
|
-
data: Record<string, any>;
|
|
28
|
-
constructor(params: StructuredNodeDataParams);
|
|
29
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/context/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAwB,MAAM,SAAS,CAAC;AAGnF,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,QAAQ;IAKA,MAAM,EAAE,cAAc;IAJlC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,SAAM;IACV,IAAI,EAAE,YAAY,CAAC;gBAEP,MAAM,EAAE,cAAc;IAKzC,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;IAWxD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;CAMhC;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBACrB,MAAM,EAAE,wBAAwB;IAK5C,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAOzD"}
|
package/dist/context/chat.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ContextTypeRegistry } from './factory';
|
|
2
|
-
import { ChatContextItem } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new chat context item that can be added to conversations.
|
|
5
|
-
*
|
|
6
|
-
* This function creates structured context items that provide additional information
|
|
7
|
-
* to the AI assistant during conversations. Context items can include:
|
|
8
|
-
* - Datasources (metrics, logs, traces)
|
|
9
|
-
* - Labels and their values
|
|
10
|
-
* - Dashboards and folders
|
|
11
|
-
* - Structured data objects
|
|
12
|
-
*
|
|
13
|
-
* The created context item includes display metadata (title, icon, image) and
|
|
14
|
-
* the underlying data that will be formatted and sent to the LLM when the
|
|
15
|
-
* context is included in a conversation.
|
|
16
|
-
*
|
|
17
|
-
* @param type - The type of context to create (Datasource, Label, Dashboard etc.)
|
|
18
|
-
* @param params - Type-specific parameters for creating the context item
|
|
19
|
-
* @returns A ChatContextItem that can be added to conversation context
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // Create a context that will be passed into the function triggering an assistant open
|
|
24
|
-
* openAssistant({
|
|
25
|
-
* ...
|
|
26
|
-
* origin: 'my-feature',
|
|
27
|
-
* context: [
|
|
28
|
-
* createAssistantContextItem('datasource', {
|
|
29
|
-
* datasourceUid: datasource.uid,
|
|
30
|
-
* img: datasource.meta?.info?.logos?.small,
|
|
31
|
-
* }),
|
|
32
|
-
* ],
|
|
33
|
-
* });
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function createAssistantContextItem<T extends keyof ContextTypeRegistry>(type: T, params: ContextTypeRegistry[T]['params']): ChatContextItem;
|
|
37
|
-
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/context/chat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AA4BxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAC5E,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvC,eAAe,CAgBjB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseParams, NodeData } from './base';
|
|
3
|
-
import { type ContextItemData } from './types';
|
|
4
|
-
export type ComponentImplementation = ComponentType<any>;
|
|
5
|
-
export type NamedComponents = Record<string, ComponentImplementation>;
|
|
6
|
-
/**
|
|
7
|
-
* Type used to create a component context item.
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateComponentContextParams extends BaseParams {
|
|
10
|
-
components: Record<string, ComponentType<any>>;
|
|
11
|
-
prompt: string;
|
|
12
|
-
namespace?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class ComponentNodeData extends NodeData {
|
|
15
|
-
components: Record<string, ComponentType<any>>;
|
|
16
|
-
prompt: string;
|
|
17
|
-
namespace: string;
|
|
18
|
-
constructor(params: CreateComponentContextParams);
|
|
19
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* React hook that provides all components available globally.
|
|
23
|
-
* Components are available everywhere, regardless of URL patterns.
|
|
24
|
-
*
|
|
25
|
-
* @returns Object containing all components available globally, keyed by namespace.componentName
|
|
26
|
-
*/
|
|
27
|
-
export declare function usePageComponents(): Record<string, ComponentImplementation>;
|
|
28
|
-
/**
|
|
29
|
-
* Provide components to the assistant.
|
|
30
|
-
*
|
|
31
|
-
* Components are always available globally, but the prompt is only applied when the URL pattern matches.
|
|
32
|
-
*
|
|
33
|
-
* For catch-all URL patterns, returns a setter that takes a context array.
|
|
34
|
-
* For specific URL patterns, returns a setter that takes components and prompt separately.
|
|
35
|
-
*
|
|
36
|
-
* @param prompt - The prompt to use for the components (only applied when URL matches).
|
|
37
|
-
* @param namespace - The namespace to use for the components.
|
|
38
|
-
* @param components - The components to provide (always available).
|
|
39
|
-
* @param urlPattern - The URL pattern to match for the prompt (components are always available).
|
|
40
|
-
* @returns A setter function to update the context, with an unregister method attached
|
|
41
|
-
*/
|
|
42
|
-
export declare function provideComponents(prompt: string, namespace: string, components: Record<string, ComponentImplementation>, urlPattern?: string | RegExp): ((newComponents: Record<string, ComponentImplementation>, newPrompt: string) => void) & {
|
|
43
|
-
unregister: () => void;
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/context/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAC;AAIvE,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE,4BAA4B;IAQhD,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAWzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CA0B3E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EACnD,UAAU,GAAE,MAAM,GAAG,MAAa,GACjC,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG;IAAE,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAmFpH"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseParams, NodeData } from './base';
|
|
2
|
-
import { type ContextItemData } from './types';
|
|
3
|
-
export interface CreateDashboardContextParams extends BaseParams {
|
|
4
|
-
dashboardUid: string;
|
|
5
|
-
dashboardTitle: string;
|
|
6
|
-
folderUid?: string;
|
|
7
|
-
folderTitle?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface CreateFolderContextParams extends BaseParams {
|
|
10
|
-
folderUid: string;
|
|
11
|
-
folderTitle: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class DashboardNodeData extends NodeData {
|
|
14
|
-
dashboardUid: string;
|
|
15
|
-
dashboardTitle: string;
|
|
16
|
-
folderUid?: string;
|
|
17
|
-
folderTitle?: string;
|
|
18
|
-
constructor(params: CreateDashboardContextParams);
|
|
19
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
20
|
-
}
|
|
21
|
-
export declare class FolderNodeData extends NodeData {
|
|
22
|
-
folderUid: string;
|
|
23
|
-
folderTitle: string;
|
|
24
|
-
text: string;
|
|
25
|
-
constructor(params: CreateFolderContextParams);
|
|
26
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/context/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAA+C,MAAM,SAAS,CAAC;AAE5F,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAA0B,SAAQ,UAAU;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;gBAEhB,MAAM,EAAE,4BAA4B;IAShD,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAczD;AAED,qBAAa,cAAe,SAAQ,QAAQ;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,SAAM;gBAEL,MAAM,EAAE,yBAAyB;IAO7C,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAYzD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseParams, NodeData } from './base';
|
|
2
|
-
import { DatasourceMeta } from './factory';
|
|
3
|
-
import { type ContextItemData } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Type used to create a datasource context item.
|
|
6
|
-
*
|
|
7
|
-
* All required attributes will be inferred from the datasources uid.
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateDatasourceContextParams extends BaseParams {
|
|
10
|
-
datasourceUid: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class DatasourceNodeData extends NodeData {
|
|
13
|
-
datasourceUid: string;
|
|
14
|
-
datasourceType: string;
|
|
15
|
-
datasourceName: string;
|
|
16
|
-
img?: string;
|
|
17
|
-
constructor(params: CreateDatasourceContextParams & DatasourceMeta);
|
|
18
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=datasource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/context/datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,SAAS,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;gBAER,MAAM,EAAE,6BAA6B,GAAG,cAAc;IASlE,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAYzD"}
|
package/dist/context/entity.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseParams, NodeData } from './base';
|
|
2
|
-
import { type ContextItemData } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Type used to create an entity context item.
|
|
5
|
-
*/
|
|
6
|
-
export interface CreateEntityContextParams extends BaseParams {
|
|
7
|
-
type: string;
|
|
8
|
-
name: string;
|
|
9
|
-
scope?: {
|
|
10
|
-
env?: string;
|
|
11
|
-
site?: string;
|
|
12
|
-
namespace?: string;
|
|
13
|
-
};
|
|
14
|
-
properties?: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
export declare class EntityNodeData extends NodeData {
|
|
17
|
-
entityType: string;
|
|
18
|
-
name: string;
|
|
19
|
-
scope?: {
|
|
20
|
-
env?: string;
|
|
21
|
-
site?: string;
|
|
22
|
-
namespace?: string;
|
|
23
|
-
};
|
|
24
|
-
properties?: Record<string, any>;
|
|
25
|
-
constructor(params: CreateEntityContextParams);
|
|
26
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/context/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAAuB,MAAM,SAAS,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,UAAU;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,qBAAa,cAAe,SAAQ,QAAQ;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACK,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAE5B,MAAM,EAAE,yBAAyB;IAiB7C,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAazD"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { NodeData, NodeDataParams, StructuredNodeData, StructuredNodeDataParams } from './base';
|
|
2
|
-
import { ComponentNodeData, type CreateComponentContextParams } from './component';
|
|
3
|
-
import { DashboardNodeData, FolderNodeData, type CreateDashboardContextParams, type CreateFolderContextParams } from './dashboard';
|
|
4
|
-
import { DatasourceNodeData, type CreateDatasourceContextParams } from './datasource';
|
|
5
|
-
import { EntityNodeData, type CreateEntityContextParams } from './entity';
|
|
6
|
-
import { LabelNameNodeData, LabelValueNodeData, type CreateLabelNameContextParams, type CreateLabelValueContextParams } from './label';
|
|
7
|
-
/**
|
|
8
|
-
* registry to handle the type mappings between ItemData type, params and node data
|
|
9
|
-
*/
|
|
10
|
-
export type ContextTypeRegistry = {
|
|
11
|
-
datasource: {
|
|
12
|
-
params: CreateDatasourceContextParams;
|
|
13
|
-
node: DatasourceNodeData;
|
|
14
|
-
};
|
|
15
|
-
label_name: {
|
|
16
|
-
params: CreateLabelNameContextParams;
|
|
17
|
-
node: LabelNameNodeData;
|
|
18
|
-
};
|
|
19
|
-
label_value: {
|
|
20
|
-
params: CreateLabelValueContextParams;
|
|
21
|
-
node: LabelValueNodeData;
|
|
22
|
-
};
|
|
23
|
-
dashboard: {
|
|
24
|
-
params: CreateDashboardContextParams;
|
|
25
|
-
node: DashboardNodeData;
|
|
26
|
-
};
|
|
27
|
-
dashboard_folder: {
|
|
28
|
-
params: CreateFolderContextParams;
|
|
29
|
-
node: FolderNodeData;
|
|
30
|
-
};
|
|
31
|
-
structured: {
|
|
32
|
-
params: StructuredNodeDataParams;
|
|
33
|
-
node: StructuredNodeData;
|
|
34
|
-
};
|
|
35
|
-
component: {
|
|
36
|
-
params: CreateComponentContextParams;
|
|
37
|
-
node: ComponentNodeData;
|
|
38
|
-
};
|
|
39
|
-
entity: {
|
|
40
|
-
params: CreateEntityContextParams;
|
|
41
|
-
node: EntityNodeData;
|
|
42
|
-
};
|
|
43
|
-
unknown: {
|
|
44
|
-
params: NodeDataParams;
|
|
45
|
-
node: NodeData;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export type DatasourceMeta = {
|
|
49
|
-
datasourceType: string;
|
|
50
|
-
datasourceName: string;
|
|
51
|
-
img?: string;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Creates context nodes based on type with full type safety using generics
|
|
55
|
-
*/
|
|
56
|
-
export declare function createContextByType<T extends keyof ContextTypeRegistry>(type: T, params: ContextTypeRegistry[T]['params']): ContextTypeRegistry[T]['node'];
|
|
57
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/context/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,KAAK,4BAA4B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,KAAK,6BAA6B,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE;QAAE,MAAM,EAAE,6BAA6B,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAChF,UAAU,EAAE;QAAE,MAAM,EAAE,4BAA4B,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAC9E,WAAW,EAAE;QAAE,MAAM,EAAE,6BAA6B,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACjF,SAAS,EAAE;QAAE,MAAM,EAAE,4BAA4B,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAC7E,gBAAgB,EAAE;QAAE,MAAM,EAAE,yBAAyB,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IAC9E,UAAU,EAAE;QAAE,MAAM,EAAE,wBAAwB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAC3E,SAAS,EAAE;QAAE,MAAM,EAAE,4BAA4B,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAC7E,MAAM,EAAE;QAAE,MAAM,EAAE,yBAAyB,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IACpE,OAAO,EAAE;QAAE,MAAM,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAcF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACrE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvC,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAoChC"}
|
package/dist/context/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './base';
|
|
2
|
-
export * from './chat';
|
|
3
|
-
export * from './component';
|
|
4
|
-
export * from './dashboard';
|
|
5
|
-
export * from './datasource';
|
|
6
|
-
export * from './entity';
|
|
7
|
-
export * from './factory';
|
|
8
|
-
export * from './label';
|
|
9
|
-
export * from './page';
|
|
10
|
-
export * from './playbook';
|
|
11
|
-
export * from './questions';
|
|
12
|
-
export * from './types';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
package/dist/context/label.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseParams, NodeData } from './base';
|
|
2
|
-
import { DatasourceMeta } from './factory';
|
|
3
|
-
import { type ContextItemData } from './types';
|
|
4
|
-
export interface CreateLabelNameContextParams extends BaseParams {
|
|
5
|
-
datasourceUid: string;
|
|
6
|
-
labelName: string;
|
|
7
|
-
}
|
|
8
|
-
export interface CreateLabelValueContextParams extends CreateLabelNameContextParams {
|
|
9
|
-
labelValue: string;
|
|
10
|
-
/** Filter operator (e.g., '=', '!=', '=~', '!~'). Defaults to '=' if not specified */
|
|
11
|
-
operator?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class LabelNameNodeData extends NodeData {
|
|
14
|
-
datasourceUid: string;
|
|
15
|
-
datasourceType: string;
|
|
16
|
-
datasourceName: string;
|
|
17
|
-
labelName: string;
|
|
18
|
-
img?: string;
|
|
19
|
-
constructor(params: CreateLabelNameContextParams & DatasourceMeta);
|
|
20
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
21
|
-
}
|
|
22
|
-
export declare class LabelValueNodeData extends NodeData {
|
|
23
|
-
datasourceUid: string;
|
|
24
|
-
datasourceType: string;
|
|
25
|
-
datasourceName: string;
|
|
26
|
-
labelName: string;
|
|
27
|
-
labelValue: string;
|
|
28
|
-
img?: string;
|
|
29
|
-
operator: string;
|
|
30
|
-
constructor(params: CreateLabelValueContextParams & DatasourceMeta);
|
|
31
|
-
formatForLLM(codeElementIds?: string[]): ContextItemData;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=label.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/context/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAAmD,MAAM,SAAS,CAAC;AAEhG,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,6BAA8B,SAAQ,4BAA4B;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;gBAER,MAAM,EAAE,4BAA4B,GAAG,cAAc;IAUjE,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAczD;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,6BAA6B,GAAG,cAAc;IAgBlE,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe;CAgBzD"}
|