@datalayer/agent-runtimes 1.3.11 → 1.3.13
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/README.md +1 -2
- package/lib/AgentNode.js +3 -3
- package/lib/api/runtimes/healthz.js +4 -2
- package/lib/api/spacer/healthz.js +4 -2
- package/lib/chat/base/ChatBase.js +39 -25
- package/lib/chat/base/modelChoice.d.ts +62 -0
- package/lib/chat/base/modelChoice.js +56 -0
- package/lib/chat/messages/ChatMessageList.js +13 -5
- package/lib/chat/messages/FormSubmissionMessage.d.ts +17 -0
- package/lib/chat/messages/FormSubmissionMessage.js +49 -0
- package/lib/chat/messages/formSubmission.d.ts +41 -0
- package/lib/chat/messages/formSubmission.js +90 -0
- package/lib/chat/prompt/menus/ModelSelector.js +11 -4
- package/lib/chat/styles/streamdownStyles.js +40 -0
- package/lib/client/mixins/RuntimesMixin.js +1 -1
- package/lib/client/mixins/SpacerMixin.js +3 -3
- package/lib/components/a2ui/A2uiMarkdownProvider.d.ts +11 -0
- package/lib/components/a2ui/A2uiMarkdownProvider.js +13 -0
- package/lib/components/a2ui/index.d.ts +1 -0
- package/lib/components/a2ui/index.js +1 -0
- package/lib/examples/A2UiAgentExample.js +36 -223
- package/lib/examples/A2UiJupyterOutputExample.js +11 -1
- package/lib/examples/A2UiViewerExample.d.ts +9 -2
- package/lib/examples/A2UiViewerExample.js +33 -3
- package/lib/examples/main.js +37 -35
- package/lib/examples/utils/a2uiMarkdownProvider.d.ts +1 -7
- package/lib/examples/utils/a2uiMarkdownProvider.js +6 -8
- package/lib/loop/core/index.d.ts +33 -2
- package/lib/loop/core/index.js +29 -2
- package/lib/loop/embed/LoopEmbed.js +1 -0
- package/lib/loop/index.d.ts +1 -1
- package/lib/loop/index.js +4 -1
- package/lib/loop/plugins/a2ui-surface/InlineSurface.d.ts +22 -0
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +64 -0
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.d.ts +38 -0
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +64 -0
- package/lib/loop/plugins/a2ui-surface/index.d.ts +34 -0
- package/lib/loop/plugins/a2ui-surface/index.js +91 -0
- package/lib/loop/plugins/a2ui-surface/toolResult.d.ts +52 -0
- package/lib/loop/plugins/a2ui-surface/toolResult.js +106 -0
- package/lib/loop/plugins/chat/ChatView.js +81 -10
- package/lib/loop/plugins/chat/index.d.ts +14 -0
- package/lib/loop/plugins/chat/index.js +1 -0
- package/lib/loop/plugins/document/index.js +4 -0
- package/lib/loop/plugins/notebook/index.js +4 -0
- package/lib/loop/plugins/shell/useEditorPreviews.js +7 -0
- package/lib/loop/presets.d.ts +5 -0
- package/lib/loop/presets.js +7 -1
- package/lib/models/environments.generated.d.ts +7 -1
- package/lib/models/environments.generated.js +1 -1
- package/lib/specs/agents/agents.d.ts +1 -0
- package/lib/specs/agents/agents.js +112 -0
- package/lib/specs/models.js +3 -3
- package/lib/tools/adapters/copilotkit/CopilotKitToolAdapter.js +1 -1
- package/package.json +10 -4
- package/patches/@primer+react+37.31.0.patch +390 -0
- package/patches/eslint-plugin-react+7.37.5.patch +65 -0
- package/scripts/apply-patches.sh +15 -1
- package/scripts/codegen/compose.py +4 -4
- package/scripts/codegen/generate_agents.py +1 -2
- package/scripts/codegen/generate_frontend_tools.py +1 -1
- package/scripts/codegen/generate_models.py +33 -8
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
diff --git a/node_modules/@primer/react/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts b/node_modules/@primer/react/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
2
|
+
index fd9bcf5..20408cb 100644
|
|
3
|
+
--- a/node_modules/@primer/react/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
4
|
+
+++ b/node_modules/@primer/react/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
5
|
+
@@ -10,7 +10,7 @@ interface AnchoredOverlayPropsWithAnchor {
|
|
6
|
+
* A custom function component used to render the anchor element.
|
|
7
|
+
* Will receive the selected text as `children` prop when an item is activated.
|
|
8
|
+
*/
|
|
9
|
+
- renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
|
|
10
|
+
+ renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => React.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* An override to the internal ref that will be spread on to the renderAnchor
|
|
13
|
+
*/
|
|
14
|
+
diff --git a/node_modules/@primer/react/lib-esm/BaseStyles.d.ts b/node_modules/@primer/react/lib-esm/BaseStyles.d.ts
|
|
15
|
+
index d5ce099..cfb4a98 100644
|
|
16
|
+
--- a/node_modules/@primer/react/lib-esm/BaseStyles.d.ts
|
|
17
|
+
+++ b/node_modules/@primer/react/lib-esm/BaseStyles.d.ts
|
|
18
|
+
@@ -4,7 +4,7 @@ import type { SystemCommonProps, SystemTypographyProps } from './constants';
|
|
19
|
+
import type { SxProp } from './sx';
|
|
20
|
+
import 'focus-visible';
|
|
21
|
+
export type BaseStylesProps = PropsWithChildren & {
|
|
22
|
+
- as?: React.ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
23
|
+
+ as?: React.ComponentType<any> | keyof React.JSX.IntrinsicElements;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
color?: string;
|
|
27
|
+
diff --git a/node_modules/@primer/react/lib-esm/DataTable/Table.d.ts b/node_modules/@primer/react/lib-esm/DataTable/Table.d.ts
|
|
28
|
+
index 6a0c96b..11bea9a 100644
|
|
29
|
+
--- a/node_modules/@primer/react/lib-esm/DataTable/Table.d.ts
|
|
30
|
+
+++ b/node_modules/@primer/react/lib-esm/DataTable/Table.d.ts
|
|
31
|
+
@@ -88,7 +88,7 @@ export type TableTitleProps = React.PropsWithChildren<{
|
|
32
|
+
* `TableSubtitle`. This is useful when specifying markup that is more
|
|
33
|
+
* semantic for your use-case, such as a heading tag.
|
|
34
|
+
*/
|
|
35
|
+
- as?: keyof JSX.IntrinsicElements | React.ComponentType;
|
|
36
|
+
+ as?: keyof React.JSX.IntrinsicElements | React.ComponentType;
|
|
37
|
+
/**
|
|
38
|
+
* Provide a unique id for the table subtitle. This should be used along with
|
|
39
|
+
* `aria-labelledby` on `DataTable`
|
|
40
|
+
@@ -102,7 +102,7 @@ export type TableSubtitleProps = React.PropsWithChildren<{
|
|
41
|
+
* `TableSubtitle`. This is useful when specifying markup that is more
|
|
42
|
+
* semantic for your use-case
|
|
43
|
+
*/
|
|
44
|
+
- as?: keyof JSX.IntrinsicElements | React.ComponentType;
|
|
45
|
+
+ as?: keyof React.JSX.IntrinsicElements | React.ComponentType;
|
|
46
|
+
/**
|
|
47
|
+
* Provide a unique id for the table subtitle. This should be used along with
|
|
48
|
+
* `aria-describedby` on `DataTable`
|
|
49
|
+
diff --git a/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionList.d.ts b/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionList.d.ts
|
|
50
|
+
index 8cde497..13d91d1 100644
|
|
51
|
+
--- a/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionList.d.ts
|
|
52
|
+
+++ b/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionList.d.ts
|
|
53
|
+
@@ -23,7 +23,7 @@ export interface FilteredActionListProps extends Partial<Omit<GroupedListProps,
|
|
54
|
+
fullScreenOnNarrow?: boolean;
|
|
55
|
+
onSelectAllChange?: (checked: boolean) => void;
|
|
56
|
+
}
|
|
57
|
+
-export declare function FilteredActionList({ loading, placeholderText, filterValue: externalFilterValue, loadingType, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, sx, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled, fullScreenOnNarrow, onSelectAllChange, ...listProps }: FilteredActionListProps): JSX.Element;
|
|
58
|
+
+export declare function FilteredActionList({ loading, placeholderText, filterValue: externalFilterValue, loadingType, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, sx, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled, fullScreenOnNarrow, onSelectAllChange, ...listProps }: FilteredActionListProps): React.JSX.Element;
|
|
59
|
+
export declare namespace FilteredActionList {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
diff --git a/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionListLoaders.d.ts b/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
63
|
+
index 2da18be..ef3829c 100644
|
|
64
|
+
--- a/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
65
|
+
+++ b/node_modules/@primer/react/lib-esm/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
66
|
+
@@ -1,3 +1,4 @@
|
|
67
|
+
+import type React from 'react';
|
|
68
|
+
export declare class FilteredActionListLoadingType {
|
|
69
|
+
name: string;
|
|
70
|
+
appearsInBody: boolean;
|
|
71
|
+
@@ -11,5 +12,5 @@ export declare const FilteredActionListLoadingTypes: {
|
|
72
|
+
export declare function FilteredActionListBodyLoader({ loadingType, height, }: {
|
|
73
|
+
loadingType: FilteredActionListLoadingType;
|
|
74
|
+
height: number;
|
|
75
|
+
-}): JSX.Element;
|
|
76
|
+
+}): React.JSX.Element;
|
|
77
|
+
//# sourceMappingURL=FilteredActionListLoaders.d.ts.map
|
|
78
|
+
|
|
79
|
+
diff --git a/node_modules/@primer/react/lib-esm/SelectPanel/SelectPanel.d.ts b/node_modules/@primer/react/lib-esm/SelectPanel/SelectPanel.d.ts
|
|
80
|
+
index 0c79996..1dfd2cd 100644
|
|
81
|
+
--- a/node_modules/@primer/react/lib-esm/SelectPanel/SelectPanel.d.ts
|
|
82
|
+
+++ b/node_modules/@primer/react/lib-esm/SelectPanel/SelectPanel.d.ts
|
|
83
|
+
@@ -59,7 +59,7 @@ type SelectPanelVariantProps = {
|
|
84
|
+
onCancel: () => void;
|
|
85
|
+
};
|
|
86
|
+
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection) & SelectPanelVariantProps;
|
|
87
|
+
-declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, sx, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, ...listProps }: SelectPanelProps): JSX.Element;
|
|
88
|
+
+declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, sx, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, ...listProps }: SelectPanelProps): React.JSX.Element;
|
|
89
|
+
declare const SecondaryButton: React.FC<ButtonProps>;
|
|
90
|
+
declare const SecondaryLink: React.FC<LinkButtonProps & ButtonProps>;
|
|
91
|
+
export declare const SelectPanel: typeof Panel & {
|
|
92
|
+
diff --git a/node_modules/@primer/react/lib-esm/Text/Text.d.ts b/node_modules/@primer/react/lib-esm/Text/Text.d.ts
|
|
93
|
+
index e7692aa..5449c58 100644
|
|
94
|
+
--- a/node_modules/@primer/react/lib-esm/Text/Text.d.ts
|
|
95
|
+
+++ b/node_modules/@primer/react/lib-esm/Text/Text.d.ts
|
|
96
|
+
@@ -3,7 +3,7 @@ import React from 'react';
|
|
97
|
+
import type { SystemCommonProps, SystemTypographyProps } from '../constants';
|
|
98
|
+
import type { SxProp } from '../sx';
|
|
99
|
+
type StyledTextProps = {
|
|
100
|
+
- as?: React.ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
101
|
+
+ as?: React.ComponentType<any> | keyof React.JSX.IntrinsicElements;
|
|
102
|
+
size?: 'large' | 'medium' | 'small';
|
|
103
|
+
weight?: 'light' | 'normal' | 'medium' | 'semibold';
|
|
104
|
+
} & SystemTypographyProps & SystemCommonProps & SxProp & React.HTMLAttributes<HTMLSpanElement>;
|
|
105
|
+
diff --git a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Divider.d.ts b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Divider.d.ts
|
|
106
|
+
index 91a770f..25ab073 100644
|
|
107
|
+
--- a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Divider.d.ts
|
|
108
|
+
+++ b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Divider.d.ts
|
|
109
|
+
@@ -1,8 +1,9 @@
|
|
110
|
+
+import type React from 'react';
|
|
111
|
+
export declare const StyledDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
112
|
+
/**
|
|
113
|
+
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
|
114
|
+
*/
|
|
115
|
+
-export declare function Divider(): JSX.Element;
|
|
116
|
+
+export declare function Divider(): React.JSX.Element;
|
|
117
|
+
export declare namespace Divider {
|
|
118
|
+
var renderItem: typeof Divider;
|
|
119
|
+
}
|
|
120
|
+
diff --git a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Group.d.ts b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Group.d.ts
|
|
121
|
+
index 98c8809..1fdceeb 100644
|
|
122
|
+
--- a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Group.d.ts
|
|
123
|
+
+++ b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Group.d.ts
|
|
124
|
+
@@ -16,7 +16,7 @@ export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxPro
|
|
125
|
+
/**
|
|
126
|
+
* `Items` to render in the `Group`.
|
|
127
|
+
*/
|
|
128
|
+
- items?: JSX.Element[];
|
|
129
|
+
+ items?: React.JSX.Element[];
|
|
130
|
+
/**
|
|
131
|
+
* Whether to display a divider above each `Item` in this `Group` when it does not follow a `Header` or `Divider`.
|
|
132
|
+
*/
|
|
133
|
+
@@ -25,5 +25,5 @@ export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxPro
|
|
134
|
+
/**
|
|
135
|
+
* Collects related `Items` in an `ActionList`.
|
|
136
|
+
*/
|
|
137
|
+
-export declare function Group({ header, items, ...props }: GroupProps): JSX.Element;
|
|
138
|
+
+export declare function Group({ header, items, ...props }: GroupProps): React.JSX.Element;
|
|
139
|
+
//# sourceMappingURL=Group.d.ts.map
|
|
140
|
+
|
|
141
|
+
diff --git a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Header.d.ts b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Header.d.ts
|
|
142
|
+
index c31b8cc..c5a0401 100644
|
|
143
|
+
--- a/node_modules/@primer/react/lib-esm/deprecated/ActionList/Header.d.ts
|
|
144
|
+
+++ b/node_modules/@primer/react/lib-esm/deprecated/ActionList/Header.d.ts
|
|
145
|
+
@@ -26,5 +26,5 @@ export declare const StyledHeader: import("styled-components").StyledComponent<"
|
|
146
|
+
/**
|
|
147
|
+
* Displays the name and description of a `Group`.
|
|
148
|
+
*/
|
|
149
|
+
-export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): JSX.Element;
|
|
150
|
+
+export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): React.JSX.Element;
|
|
151
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
152
|
+
|
|
153
|
+
diff --git a/node_modules/@primer/react/lib-esm/deprecated/ActionMenu.d.ts b/node_modules/@primer/react/lib-esm/deprecated/ActionMenu.d.ts
|
|
154
|
+
index 6ddbd32..d61abe9 100644
|
|
155
|
+
--- a/node_modules/@primer/react/lib-esm/deprecated/ActionMenu.d.ts
|
|
156
|
+
+++ b/node_modules/@primer/react/lib-esm/deprecated/ActionMenu.d.ts
|
|
157
|
+
@@ -31,7 +31,7 @@ export type ActionMenuProps = ActionMenuBaseProps & AnchoredOverlayWrapperAnchor
|
|
158
|
+
* @deprecated Use ActionMenu with composable API instead. See https://primer.style/react/ActionMenu for more details.
|
|
159
|
+
*/
|
|
160
|
+
export declare const ActionMenu: {
|
|
161
|
+
- ({ anchorContent, renderAnchor, anchorRef: externalAnchorRef, onAction, open, setOpen, overlayProps, items, ...listProps }: ActionMenuProps): JSX.Element;
|
|
162
|
+
+ ({ anchorContent, renderAnchor, anchorRef: externalAnchorRef, onAction, open, setOpen, overlayProps, items, ...listProps }: ActionMenuProps): React.JSX.Element;
|
|
163
|
+
displayName: string;
|
|
164
|
+
} & {
|
|
165
|
+
Divider: typeof Divider;
|
|
166
|
+
diff --git a/node_modules/@primer/react/lib-esm/utils/polymorphic.d.ts b/node_modules/@primer/react/lib-esm/utils/polymorphic.d.ts
|
|
167
|
+
index bbe2f50..f2abd05 100644
|
|
168
|
+
--- a/node_modules/@primer/react/lib-esm/utils/polymorphic.d.ts
|
|
169
|
+
+++ b/node_modules/@primer/react/lib-esm/utils/polymorphic.d.ts
|
|
170
|
+
@@ -11,7 +11,7 @@ type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
|
|
171
|
+
*/
|
|
172
|
+
type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
|
|
173
|
+
/**
|
|
174
|
+
- * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
175
|
+
+ * Infers the React.JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
176
|
+
*/
|
|
177
|
+
type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
|
|
178
|
+
type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
|
|
179
|
+
@@ -24,13 +24,13 @@ interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}> extends For
|
|
180
|
+
* from `as` element with the own props taking precedence.
|
|
181
|
+
*
|
|
182
|
+
* We explicitly avoid `React.ElementType` and manually narrow the prop types
|
|
183
|
+
- * so that events are typed when using JSX.IntrinsicElements.
|
|
184
|
+
+ * so that events are typed when using React.JSX.IntrinsicElements.
|
|
185
|
+
*/
|
|
186
|
+
<As = IntrinsicElementString>(props: As extends '' ? {
|
|
187
|
+
- as: keyof JSX.IntrinsicElements;
|
|
188
|
+
+ as: keyof React.JSX.IntrinsicElements;
|
|
189
|
+
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
190
|
+
as: As;
|
|
191
|
+
- }> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
192
|
+
+ }> : As extends keyof React.JSX.IntrinsicElements ? Merge<React.JSX.IntrinsicElements[As], OwnProps & {
|
|
193
|
+
as: As;
|
|
194
|
+
}> : never): React.ReactElement | null;
|
|
195
|
+
}
|
|
196
|
+
diff --git a/node_modules/@primer/react/lib/AnchoredOverlay/AnchoredOverlay.d.ts b/node_modules/@primer/react/lib/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
197
|
+
index fd9bcf5..20408cb 100644
|
|
198
|
+
--- a/node_modules/@primer/react/lib/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
199
|
+
+++ b/node_modules/@primer/react/lib/AnchoredOverlay/AnchoredOverlay.d.ts
|
|
200
|
+
@@ -10,7 +10,7 @@ interface AnchoredOverlayPropsWithAnchor {
|
|
201
|
+
* A custom function component used to render the anchor element.
|
|
202
|
+
* Will receive the selected text as `children` prop when an item is activated.
|
|
203
|
+
*/
|
|
204
|
+
- renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
|
|
205
|
+
+ renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => React.JSX.Element;
|
|
206
|
+
/**
|
|
207
|
+
* An override to the internal ref that will be spread on to the renderAnchor
|
|
208
|
+
*/
|
|
209
|
+
diff --git a/node_modules/@primer/react/lib/BaseStyles.d.ts b/node_modules/@primer/react/lib/BaseStyles.d.ts
|
|
210
|
+
index d5ce099..cfb4a98 100644
|
|
211
|
+
--- a/node_modules/@primer/react/lib/BaseStyles.d.ts
|
|
212
|
+
+++ b/node_modules/@primer/react/lib/BaseStyles.d.ts
|
|
213
|
+
@@ -4,7 +4,7 @@ import type { SystemCommonProps, SystemTypographyProps } from './constants';
|
|
214
|
+
import type { SxProp } from './sx';
|
|
215
|
+
import 'focus-visible';
|
|
216
|
+
export type BaseStylesProps = PropsWithChildren & {
|
|
217
|
+
- as?: React.ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
218
|
+
+ as?: React.ComponentType<any> | keyof React.JSX.IntrinsicElements;
|
|
219
|
+
className?: string;
|
|
220
|
+
style?: CSSProperties;
|
|
221
|
+
color?: string;
|
|
222
|
+
diff --git a/node_modules/@primer/react/lib/DataTable/Table.d.ts b/node_modules/@primer/react/lib/DataTable/Table.d.ts
|
|
223
|
+
index 6a0c96b..11bea9a 100644
|
|
224
|
+
--- a/node_modules/@primer/react/lib/DataTable/Table.d.ts
|
|
225
|
+
+++ b/node_modules/@primer/react/lib/DataTable/Table.d.ts
|
|
226
|
+
@@ -88,7 +88,7 @@ export type TableTitleProps = React.PropsWithChildren<{
|
|
227
|
+
* `TableSubtitle`. This is useful when specifying markup that is more
|
|
228
|
+
* semantic for your use-case, such as a heading tag.
|
|
229
|
+
*/
|
|
230
|
+
- as?: keyof JSX.IntrinsicElements | React.ComponentType;
|
|
231
|
+
+ as?: keyof React.JSX.IntrinsicElements | React.ComponentType;
|
|
232
|
+
/**
|
|
233
|
+
* Provide a unique id for the table subtitle. This should be used along with
|
|
234
|
+
* `aria-labelledby` on `DataTable`
|
|
235
|
+
@@ -102,7 +102,7 @@ export type TableSubtitleProps = React.PropsWithChildren<{
|
|
236
|
+
* `TableSubtitle`. This is useful when specifying markup that is more
|
|
237
|
+
* semantic for your use-case
|
|
238
|
+
*/
|
|
239
|
+
- as?: keyof JSX.IntrinsicElements | React.ComponentType;
|
|
240
|
+
+ as?: keyof React.JSX.IntrinsicElements | React.ComponentType;
|
|
241
|
+
/**
|
|
242
|
+
* Provide a unique id for the table subtitle. This should be used along with
|
|
243
|
+
* `aria-describedby` on `DataTable`
|
|
244
|
+
diff --git a/node_modules/@primer/react/lib/FilteredActionList/FilteredActionList.d.ts b/node_modules/@primer/react/lib/FilteredActionList/FilteredActionList.d.ts
|
|
245
|
+
index 8cde497..13d91d1 100644
|
|
246
|
+
--- a/node_modules/@primer/react/lib/FilteredActionList/FilteredActionList.d.ts
|
|
247
|
+
+++ b/node_modules/@primer/react/lib/FilteredActionList/FilteredActionList.d.ts
|
|
248
|
+
@@ -23,7 +23,7 @@ export interface FilteredActionListProps extends Partial<Omit<GroupedListProps,
|
|
249
|
+
fullScreenOnNarrow?: boolean;
|
|
250
|
+
onSelectAllChange?: (checked: boolean) => void;
|
|
251
|
+
}
|
|
252
|
+
-export declare function FilteredActionList({ loading, placeholderText, filterValue: externalFilterValue, loadingType, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, sx, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled, fullScreenOnNarrow, onSelectAllChange, ...listProps }: FilteredActionListProps): JSX.Element;
|
|
253
|
+
+export declare function FilteredActionList({ loading, placeholderText, filterValue: externalFilterValue, loadingType, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, sx, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled, fullScreenOnNarrow, onSelectAllChange, ...listProps }: FilteredActionListProps): React.JSX.Element;
|
|
254
|
+
export declare namespace FilteredActionList {
|
|
255
|
+
var displayName: string;
|
|
256
|
+
}
|
|
257
|
+
diff --git a/node_modules/@primer/react/lib/FilteredActionList/FilteredActionListLoaders.d.ts b/node_modules/@primer/react/lib/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
258
|
+
index 2da18be..ef3829c 100644
|
|
259
|
+
--- a/node_modules/@primer/react/lib/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
260
|
+
+++ b/node_modules/@primer/react/lib/FilteredActionList/FilteredActionListLoaders.d.ts
|
|
261
|
+
@@ -1,3 +1,4 @@
|
|
262
|
+
+import type React from 'react';
|
|
263
|
+
export declare class FilteredActionListLoadingType {
|
|
264
|
+
name: string;
|
|
265
|
+
appearsInBody: boolean;
|
|
266
|
+
@@ -11,5 +12,5 @@ export declare const FilteredActionListLoadingTypes: {
|
|
267
|
+
export declare function FilteredActionListBodyLoader({ loadingType, height, }: {
|
|
268
|
+
loadingType: FilteredActionListLoadingType;
|
|
269
|
+
height: number;
|
|
270
|
+
-}): JSX.Element;
|
|
271
|
+
+}): React.JSX.Element;
|
|
272
|
+
//# sourceMappingURL=FilteredActionListLoaders.d.ts.map
|
|
273
|
+
|
|
274
|
+
diff --git a/node_modules/@primer/react/lib/SelectPanel/SelectPanel.d.ts b/node_modules/@primer/react/lib/SelectPanel/SelectPanel.d.ts
|
|
275
|
+
index 0c79996..1dfd2cd 100644
|
|
276
|
+
--- a/node_modules/@primer/react/lib/SelectPanel/SelectPanel.d.ts
|
|
277
|
+
+++ b/node_modules/@primer/react/lib/SelectPanel/SelectPanel.d.ts
|
|
278
|
+
@@ -59,7 +59,7 @@ type SelectPanelVariantProps = {
|
|
279
|
+
onCancel: () => void;
|
|
280
|
+
};
|
|
281
|
+
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection) & SelectPanelVariantProps;
|
|
282
|
+
-declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, sx, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, ...listProps }: SelectPanelProps): JSX.Element;
|
|
283
|
+
+declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, sx, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, ...listProps }: SelectPanelProps): React.JSX.Element;
|
|
284
|
+
declare const SecondaryButton: React.FC<ButtonProps>;
|
|
285
|
+
declare const SecondaryLink: React.FC<LinkButtonProps & ButtonProps>;
|
|
286
|
+
export declare const SelectPanel: typeof Panel & {
|
|
287
|
+
diff --git a/node_modules/@primer/react/lib/Text/Text.d.ts b/node_modules/@primer/react/lib/Text/Text.d.ts
|
|
288
|
+
index e7692aa..5449c58 100644
|
|
289
|
+
--- a/node_modules/@primer/react/lib/Text/Text.d.ts
|
|
290
|
+
+++ b/node_modules/@primer/react/lib/Text/Text.d.ts
|
|
291
|
+
@@ -3,7 +3,7 @@ import React from 'react';
|
|
292
|
+
import type { SystemCommonProps, SystemTypographyProps } from '../constants';
|
|
293
|
+
import type { SxProp } from '../sx';
|
|
294
|
+
type StyledTextProps = {
|
|
295
|
+
- as?: React.ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
296
|
+
+ as?: React.ComponentType<any> | keyof React.JSX.IntrinsicElements;
|
|
297
|
+
size?: 'large' | 'medium' | 'small';
|
|
298
|
+
weight?: 'light' | 'normal' | 'medium' | 'semibold';
|
|
299
|
+
} & SystemTypographyProps & SystemCommonProps & SxProp & React.HTMLAttributes<HTMLSpanElement>;
|
|
300
|
+
diff --git a/node_modules/@primer/react/lib/deprecated/ActionList/Divider.d.ts b/node_modules/@primer/react/lib/deprecated/ActionList/Divider.d.ts
|
|
301
|
+
index 91a770f..25ab073 100644
|
|
302
|
+
--- a/node_modules/@primer/react/lib/deprecated/ActionList/Divider.d.ts
|
|
303
|
+
+++ b/node_modules/@primer/react/lib/deprecated/ActionList/Divider.d.ts
|
|
304
|
+
@@ -1,8 +1,9 @@
|
|
305
|
+
+import type React from 'react';
|
|
306
|
+
export declare const StyledDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
307
|
+
/**
|
|
308
|
+
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
|
309
|
+
*/
|
|
310
|
+
-export declare function Divider(): JSX.Element;
|
|
311
|
+
+export declare function Divider(): React.JSX.Element;
|
|
312
|
+
export declare namespace Divider {
|
|
313
|
+
var renderItem: typeof Divider;
|
|
314
|
+
}
|
|
315
|
+
diff --git a/node_modules/@primer/react/lib/deprecated/ActionList/Group.d.ts b/node_modules/@primer/react/lib/deprecated/ActionList/Group.d.ts
|
|
316
|
+
index 98c8809..1fdceeb 100644
|
|
317
|
+
--- a/node_modules/@primer/react/lib/deprecated/ActionList/Group.d.ts
|
|
318
|
+
+++ b/node_modules/@primer/react/lib/deprecated/ActionList/Group.d.ts
|
|
319
|
+
@@ -16,7 +16,7 @@ export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxPro
|
|
320
|
+
/**
|
|
321
|
+
* `Items` to render in the `Group`.
|
|
322
|
+
*/
|
|
323
|
+
- items?: JSX.Element[];
|
|
324
|
+
+ items?: React.JSX.Element[];
|
|
325
|
+
/**
|
|
326
|
+
* Whether to display a divider above each `Item` in this `Group` when it does not follow a `Header` or `Divider`.
|
|
327
|
+
*/
|
|
328
|
+
@@ -25,5 +25,5 @@ export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxPro
|
|
329
|
+
/**
|
|
330
|
+
* Collects related `Items` in an `ActionList`.
|
|
331
|
+
*/
|
|
332
|
+
-export declare function Group({ header, items, ...props }: GroupProps): JSX.Element;
|
|
333
|
+
+export declare function Group({ header, items, ...props }: GroupProps): React.JSX.Element;
|
|
334
|
+
//# sourceMappingURL=Group.d.ts.map
|
|
335
|
+
|
|
336
|
+
diff --git a/node_modules/@primer/react/lib/deprecated/ActionList/Header.d.ts b/node_modules/@primer/react/lib/deprecated/ActionList/Header.d.ts
|
|
337
|
+
index c31b8cc..c5a0401 100644
|
|
338
|
+
--- a/node_modules/@primer/react/lib/deprecated/ActionList/Header.d.ts
|
|
339
|
+
+++ b/node_modules/@primer/react/lib/deprecated/ActionList/Header.d.ts
|
|
340
|
+
@@ -26,5 +26,5 @@ export declare const StyledHeader: import("styled-components").StyledComponent<"
|
|
341
|
+
/**
|
|
342
|
+
* Displays the name and description of a `Group`.
|
|
343
|
+
*/
|
|
344
|
+
-export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): JSX.Element;
|
|
345
|
+
+export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): React.JSX.Element;
|
|
346
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
347
|
+
|
|
348
|
+
diff --git a/node_modules/@primer/react/lib/deprecated/ActionMenu.d.ts b/node_modules/@primer/react/lib/deprecated/ActionMenu.d.ts
|
|
349
|
+
index 6ddbd32..d61abe9 100644
|
|
350
|
+
--- a/node_modules/@primer/react/lib/deprecated/ActionMenu.d.ts
|
|
351
|
+
+++ b/node_modules/@primer/react/lib/deprecated/ActionMenu.d.ts
|
|
352
|
+
@@ -31,7 +31,7 @@ export type ActionMenuProps = ActionMenuBaseProps & AnchoredOverlayWrapperAnchor
|
|
353
|
+
* @deprecated Use ActionMenu with composable API instead. See https://primer.style/react/ActionMenu for more details.
|
|
354
|
+
*/
|
|
355
|
+
export declare const ActionMenu: {
|
|
356
|
+
- ({ anchorContent, renderAnchor, anchorRef: externalAnchorRef, onAction, open, setOpen, overlayProps, items, ...listProps }: ActionMenuProps): JSX.Element;
|
|
357
|
+
+ ({ anchorContent, renderAnchor, anchorRef: externalAnchorRef, onAction, open, setOpen, overlayProps, items, ...listProps }: ActionMenuProps): React.JSX.Element;
|
|
358
|
+
displayName: string;
|
|
359
|
+
} & {
|
|
360
|
+
Divider: typeof Divider;
|
|
361
|
+
diff --git a/node_modules/@primer/react/lib/utils/polymorphic.d.ts b/node_modules/@primer/react/lib/utils/polymorphic.d.ts
|
|
362
|
+
index bbe2f50..f2abd05 100644
|
|
363
|
+
--- a/node_modules/@primer/react/lib/utils/polymorphic.d.ts
|
|
364
|
+
+++ b/node_modules/@primer/react/lib/utils/polymorphic.d.ts
|
|
365
|
+
@@ -11,7 +11,7 @@ type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
|
|
366
|
+
*/
|
|
367
|
+
type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
|
|
368
|
+
/**
|
|
369
|
+
- * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
370
|
+
+ * Infers the React.JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
371
|
+
*/
|
|
372
|
+
type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
|
|
373
|
+
type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
|
|
374
|
+
@@ -24,13 +24,13 @@ interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}> extends For
|
|
375
|
+
* from `as` element with the own props taking precedence.
|
|
376
|
+
*
|
|
377
|
+
* We explicitly avoid `React.ElementType` and manually narrow the prop types
|
|
378
|
+
- * so that events are typed when using JSX.IntrinsicElements.
|
|
379
|
+
+ * so that events are typed when using React.JSX.IntrinsicElements.
|
|
380
|
+
*/
|
|
381
|
+
<As = IntrinsicElementString>(props: As extends '' ? {
|
|
382
|
+
- as: keyof JSX.IntrinsicElements;
|
|
383
|
+
+ as: keyof React.JSX.IntrinsicElements;
|
|
384
|
+
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
385
|
+
as: As;
|
|
386
|
+
- }> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
387
|
+
+ }> : As extends keyof React.JSX.IntrinsicElements ? Merge<React.JSX.IntrinsicElements[As], OwnProps & {
|
|
388
|
+
as: As;
|
|
389
|
+
}> : never): React.ReactElement | null;
|
|
390
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js b/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js
|
|
2
|
+
index 4a2cfee..7ebf845 100644
|
|
3
|
+
--- a/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js
|
|
4
|
+
+++ b/node_modules/eslint-plugin-react/lib/rules/jsx-filename-extension.js
|
|
5
|
+
@@ -6,6 +6,7 @@
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const path = require('path');
|
|
9
|
+
+const getFilename = require('../util/eslint').getFilename;
|
|
10
|
+
const docsUrl = require('../util/docsUrl');
|
|
11
|
+
const report = require('../util/report');
|
|
12
|
+
|
|
13
|
+
@@ -61,7 +62,7 @@ module.exports = {
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
create(context) {
|
|
17
|
+
- const filename = context.getFilename();
|
|
18
|
+
+ const filename = getFilename(context);
|
|
19
|
+
|
|
20
|
+
let jsxNode;
|
|
21
|
+
|
|
22
|
+
diff --git a/node_modules/eslint-plugin-react/lib/util/eslint.js b/node_modules/eslint-plugin-react/lib/util/eslint.js
|
|
23
|
+
index 79a0537..740e94a 100644
|
|
24
|
+
--- a/node_modules/eslint-plugin-react/lib/util/eslint.js
|
|
25
|
+
+++ b/node_modules/eslint-plugin-react/lib/util/eslint.js
|
|
26
|
+
@@ -4,6 +4,10 @@ function getSourceCode(context) {
|
|
27
|
+
return context.getSourceCode ? context.getSourceCode() : context.sourceCode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
+function getFilename(context) {
|
|
31
|
+
+ return context.filename !== undefined ? context.filename : context.getFilename();
|
|
32
|
+
+}
|
|
33
|
+
+
|
|
34
|
+
function getAncestors(context, node) {
|
|
35
|
+
const sourceCode = getSourceCode(context);
|
|
36
|
+
return sourceCode.getAncestors ? sourceCode.getAncestors(node) : context.getAncestors();
|
|
37
|
+
@@ -38,6 +42,7 @@ function getText(context) {
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
getAncestors,
|
|
41
|
+
+ getFilename,
|
|
42
|
+
getFirstTokens,
|
|
43
|
+
getScope,
|
|
44
|
+
getSourceCode,
|
|
45
|
+
diff --git a/node_modules/eslint-plugin-react/lib/util/version.js b/node_modules/eslint-plugin-react/lib/util/version.js
|
|
46
|
+
index c9dc683..1172f98 100644
|
|
47
|
+
--- a/node_modules/eslint-plugin-react/lib/util/version.js
|
|
48
|
+
+++ b/node_modules/eslint-plugin-react/lib/util/version.js
|
|
49
|
+
@@ -8,6 +8,7 @@
|
|
50
|
+
const fs = require('fs');
|
|
51
|
+
const path = require('path');
|
|
52
|
+
|
|
53
|
+
+const getFilename = require('./eslint').getFilename;
|
|
54
|
+
const resolve = require('resolve');
|
|
55
|
+
const semver = require('semver');
|
|
56
|
+
const error = require('./error');
|
|
57
|
+
@@ -28,7 +29,7 @@ function resetDetectedVersion() {
|
|
58
|
+
|
|
59
|
+
function resolveBasedir(contextOrFilename) {
|
|
60
|
+
if (contextOrFilename) {
|
|
61
|
+
- const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.getFilename();
|
|
62
|
+
+ const filename = typeof contextOrFilename === 'string' ? contextOrFilename : getFilename(contextOrFilename);
|
|
63
|
+
const dirname = path.dirname(filename);
|
|
64
|
+
try {
|
|
65
|
+
if (fs.statSync(filename).isFile()) {
|
package/scripts/apply-patches.sh
CHANGED
|
@@ -39,7 +39,12 @@ for patch_file in patches/*.patch; do
|
|
|
39
39
|
# Extract package name from patch filename (e.g., @datalayer+jupyter-lexical+1.0.8.patch)
|
|
40
40
|
filename=$(basename "$patch_file")
|
|
41
41
|
# Handle scoped packages: @datalayer+jupyter-lexical+1.0.8.patch -> @datalayer/jupyter-lexical
|
|
42
|
-
|
|
42
|
+
# Unscoped packages: eslint-plugin-react+7.37.5.patch -> eslint-plugin-react
|
|
43
|
+
if [[ "$filename" == @* ]]; then
|
|
44
|
+
pkg_name=$(echo "$filename" | sed 's/+/\//; s/+.*//')
|
|
45
|
+
else
|
|
46
|
+
pkg_name="${filename%%+*}"
|
|
47
|
+
fi
|
|
43
48
|
|
|
44
49
|
if [ ! -d "node_modules/$pkg_name" ]; then
|
|
45
50
|
echo -e "${YELLOW}⚠️ Package $pkg_name not found in local node_modules (may be hoisted in monorepo)${NC}"
|
|
@@ -53,6 +58,15 @@ if [ "$MISSING_PACKAGES" = true ]; then
|
|
|
53
58
|
exit 0
|
|
54
59
|
fi
|
|
55
60
|
|
|
61
|
+
# `npm install --workspaces --include-workspace-root` runs this postinstall
|
|
62
|
+
# twice, for the root and for its "." workspace, and possibly at the same
|
|
63
|
+
# time: two patch-package runs editing the same files fail each other. One
|
|
64
|
+
# at a time, the second finds the patches applied and leaves them.
|
|
65
|
+
if command -v flock >/dev/null 2>&1; then
|
|
66
|
+
exec 9>"node_modules/.apply-patches.lock"
|
|
67
|
+
flock 9
|
|
68
|
+
fi
|
|
69
|
+
|
|
56
70
|
npx patch-package
|
|
57
71
|
|
|
58
72
|
echo -e "${GREEN}✅ Patches applied successfully${NC}"
|
|
@@ -145,9 +145,7 @@ def _lookup(
|
|
|
145
145
|
spec = catalogue.get(base) or catalogue.get(ref)
|
|
146
146
|
if spec is None:
|
|
147
147
|
known = ", ".join(sorted(catalogue)[:8]) or "nothing"
|
|
148
|
-
raise CompositionError(
|
|
149
|
-
f"{kind} {ref!r} is not defined (known: {known}…)"
|
|
150
|
-
)
|
|
148
|
+
raise CompositionError(f"{kind} {ref!r} is not defined (known: {known}…)")
|
|
151
149
|
return spec
|
|
152
150
|
|
|
153
151
|
|
|
@@ -179,7 +177,9 @@ def resolve_spec(
|
|
|
179
177
|
|
|
180
178
|
for include in spec.get("includes") or []:
|
|
181
179
|
fragment = _lookup(str(include), fragments, "Fragment")
|
|
182
|
-
resolved = merge_spec(
|
|
180
|
+
resolved = merge_spec(
|
|
181
|
+
resolved, {k: v for k, v in fragment.items() if k != "id"}
|
|
182
|
+
)
|
|
183
183
|
|
|
184
184
|
parent_ref = spec.get("extends")
|
|
185
185
|
if parent_ref:
|
|
@@ -16,6 +16,7 @@ from pathlib import Path
|
|
|
16
16
|
from typing import Any, Dict, List
|
|
17
17
|
|
|
18
18
|
import yaml
|
|
19
|
+
from compose import resolve_spec # noqa: E402 (sibling module, same folder)
|
|
19
20
|
from versioning import (
|
|
20
21
|
ensure_spec_version,
|
|
21
22
|
split_spec_ref,
|
|
@@ -23,8 +24,6 @@ from versioning import (
|
|
|
23
24
|
versioned_ref,
|
|
24
25
|
)
|
|
25
26
|
|
|
26
|
-
from compose import resolve_spec # noqa: E402 (sibling module, same folder)
|
|
27
|
-
|
|
28
27
|
|
|
29
28
|
def _fmt_list(items: list[str]) -> str:
|
|
30
29
|
"""Format a list of strings with double quotes for ruff compliance."""
|
|
@@ -32,7 +32,6 @@ def load_frontend_tool_specs(specs_dir: Path) -> list[dict[str, Any]]:
|
|
|
32
32
|
return specs
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
36
35
|
def _fmt_toolset(value):
|
|
37
36
|
"""A toolset is `"all"` or a list of tool names — emit whichever it is.
|
|
38
37
|
|
|
@@ -50,6 +49,7 @@ def _fmt_toolset_ts(value):
|
|
|
50
49
|
return "[" + ", ".join(f"'{name}'" for name in value) + "]"
|
|
51
50
|
return f"'{value}'"
|
|
52
51
|
|
|
52
|
+
|
|
53
53
|
def _py_literal(value: Any) -> str:
|
|
54
54
|
return (
|
|
55
55
|
json.dumps(value, ensure_ascii=False)
|
|
@@ -15,7 +15,7 @@ Usage:
|
|
|
15
15
|
import argparse
|
|
16
16
|
import sys
|
|
17
17
|
from pathlib import Path
|
|
18
|
-
from typing import Any
|
|
18
|
+
from typing import Any, Optional
|
|
19
19
|
|
|
20
20
|
import yaml
|
|
21
21
|
from versioning import ensure_spec_version, version_suffix
|
|
@@ -41,6 +41,31 @@ def _make_const_name(model_id: str) -> str:
|
|
|
41
41
|
return model_id.upper().replace(":", "_").replace("-", "_").replace(".", "_")
|
|
42
42
|
|
|
43
43
|
|
|
44
|
+
def _pick_default(specs: list[dict]) -> Optional[dict]:
|
|
45
|
+
"""The spec the generated DEFAULT_MODEL points at.
|
|
46
|
+
|
|
47
|
+
Among the specs that claim `default`, an **available** one wins. The two
|
|
48
|
+
flags answer different questions — which model to open on, and whether
|
|
49
|
+
this deployment may call it at all — and nothing stopped a spec set from
|
|
50
|
+
claiming the first and denying the second. When that happened the chat
|
|
51
|
+
opened on a model it could not use, and fell back to whatever was listed
|
|
52
|
+
first, which is how a Bedrock deployment ended up calling Alibaba.
|
|
53
|
+
"""
|
|
54
|
+
claimed = [spec for spec in specs if spec.get("default", False)]
|
|
55
|
+
if not claimed:
|
|
56
|
+
return None
|
|
57
|
+
usable = [spec for spec in claimed if spec.get("available", False)]
|
|
58
|
+
if len(claimed) > 1:
|
|
59
|
+
print(
|
|
60
|
+
" ! more than one model claims the default: "
|
|
61
|
+
+ ", ".join(spec["id"] for spec in claimed)
|
|
62
|
+
)
|
|
63
|
+
if not usable:
|
|
64
|
+
print(" ! the default model is not available: " + claimed[0]["id"])
|
|
65
|
+
return claimed[0]
|
|
66
|
+
return usable[0]
|
|
67
|
+
|
|
68
|
+
|
|
44
69
|
def _make_enum_name(model_id: str) -> str:
|
|
45
70
|
"""Convert a model ID to an enum member name (same as const name)."""
|
|
46
71
|
return _make_const_name(model_id)
|
|
@@ -163,9 +188,9 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
|
|
|
163
188
|
)
|
|
164
189
|
|
|
165
190
|
# Find default model
|
|
166
|
-
|
|
167
|
-
if
|
|
168
|
-
default_id =
|
|
191
|
+
default_spec = _pick_default(specs)
|
|
192
|
+
if default_spec:
|
|
193
|
+
default_id = default_spec["id"]
|
|
169
194
|
default_enum = _make_enum_name(default_id)
|
|
170
195
|
lines.extend(
|
|
171
196
|
[
|
|
@@ -365,11 +390,11 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
|
|
|
365
390
|
)
|
|
366
391
|
|
|
367
392
|
# Default model
|
|
368
|
-
|
|
369
|
-
if
|
|
370
|
-
default_id =
|
|
393
|
+
default_spec = _pick_default(specs)
|
|
394
|
+
if default_spec:
|
|
395
|
+
default_id = default_spec["id"]
|
|
371
396
|
default_const = _make_const_name(default_id) + version_suffix(
|
|
372
|
-
|
|
397
|
+
default_spec["version"]
|
|
373
398
|
)
|
|
374
399
|
lines.extend(
|
|
375
400
|
[
|