@xyd-js/storybook 0.0.1-xyd.3 → 0.0.1-xyd.5
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/.storybook/main.ts +173 -4
- package/.storybook/preview.ts +2 -1
- package/CHANGELOG.md +21 -0
- package/package.json +9 -5
- package/src/components/DemoWireframe.tsx +237 -0
- package/src/components/logo.tsx +37 -0
- package/src/content/atlas-index/package-index.mdx +192 -0
- package/src/content/atlas-index/wip1.mdx +131 -0
- package/src/content/atlas-index.mdx +53 -0
- package/src/docs/atlas/Atlas.stories.tsx +4 -9
- package/src/docs/atlas/AtlasIndex.stories.tsx +130 -0
- package/src/docs/components/writer/Badge.stories.tsx +12 -0
- package/src/docs/components/writer/Table.stories.tsx +32 -0
- package/src/docs/themes/themes.stories.tsx +29 -25
- package/storybook-static/assets/{Atlas.stories-DZYfThCH.js → Atlas.stories-D9DS7hl-.js} +122 -125
- package/storybook-static/assets/AtlasIndex.stories-D_Oxkfvi.js +41 -0
- package/storybook-static/assets/Badge.stories-D8HrQDwV.js +31 -0
- package/storybook-static/assets/{Breadcrumbs.stories-CBZHgnc_.js → Breadcrumbs.stories-tNKyphmn.js} +1 -1
- package/storybook-static/assets/{Button.stories-GbxU4miF.js → Button.stories-C9qt61OR.js} +1 -1
- package/storybook-static/assets/{CTABanner-B-metiuR-D4ZzKv-X.js → CTABanner-XQNnnpUx-DwYWZ4fP.js} +1 -1
- package/storybook-static/assets/{CTABanner.stories-CaOKO0ld.js → CTABanner.stories-BiQXR4rl.js} +1 -1
- package/storybook-static/assets/{Callout.stories-tcSBv6VP.js → Callout.stories-CGC_uVON.js} +1 -1
- package/storybook-static/assets/CodeSample-DxPp80ID-C5AHaCBx-D2i_bX1Z.js +9 -0
- package/storybook-static/assets/CodeSample.stories-DTrUVe_s.js +22 -0
- package/storybook-static/assets/{Color-YHDXOIA2-DPpRgFoU.js → Color-YHDXOIA2-jdiJ8nLV.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-DurUlUle.js → DocsRenderer-CFRXHY34-Dx8J2UZ2.js} +4 -4
- package/storybook-static/assets/{GuideCard.stories-BjGAAS2v.js → GuideCard.stories-DNNHeSGK.js} +1 -1
- package/storybook-static/assets/{Heading.stories-DNgMHnuZ.js → Heading.stories-PDwVi1FA.js} +1 -1
- package/storybook-static/assets/{Nav.stories-DpHSEq4D.js → Nav.stories-DDu5T02Y.js} +1 -1
- package/storybook-static/assets/{NavLinks.stories-Cny7rsno.js → NavLinks.stories-DNOvI3bZ.js} +1 -1
- package/storybook-static/assets/{Pre.stories-DrUO72FS.js → Pre.stories-BHVX2jFF.js} +1 -1
- package/storybook-static/assets/{Sidebar.stories-jNXFb8lB.js → Sidebar.stories-CtYcwtfR.js} +1 -1
- package/storybook-static/assets/{Steps.stories-DTL8as-0.js → Steps.stories-lNmlIaIJ.js} +1 -1
- package/storybook-static/assets/{SubNav.stories-C6zqzDri.js → SubNav.stories-DH8b0a7D.js} +1 -1
- package/storybook-static/assets/Table.stories-B6GQYi2j.js +72 -0
- package/storybook-static/assets/{UnderlineNav-3vpnAIF7-BT3EXSFv.js → UnderlineNav-C2aEVraN-9GpY15Jh.js} +41 -36
- package/storybook-static/assets/{_rollupPluginBabelHelpers-Dyp77Dty-DyHbsKhl.js → _rollupPluginBabelHelpers-DsEzE6Ab-CerVq3GU.js} +1 -1
- package/storybook-static/assets/{chevron-right-B9VhLASW.js → chevron-right-MQoc73cD.js} +1 -1
- package/storybook-static/assets/{chunk-K6AXKMTT-BnQROexa.js → chunk-K6AXKMTT-CzEIZnfC.js} +1 -1
- package/storybook-static/assets/content-B1kn5ITj.js +22 -0
- package/storybook-static/assets/{browser.esm-CjKZlQaR.js → copy-DNsBvoDT.js} +12 -12
- package/storybook-static/assets/entry-preview-PtW0VFtQ.js +2 -0
- package/storybook-static/assets/{entry-preview-docs-B1zb5AAd.js → entry-preview-docs-D4yhrvjB.js} +1 -1
- package/storybook-static/assets/{iframe-CyyH_MO_.js → iframe-20rzKf4k.js} +2 -2
- package/storybook-static/assets/index-BPIV5q2-.js +18 -0
- package/storybook-static/assets/index-BdGwgT04.js +9 -0
- package/storybook-static/assets/{index-BxVt_j7t.js → index-C3_PYvTT.js} +1 -1
- package/storybook-static/assets/{index-D1ZprCIH.js → index-C7VnYWJ0.js} +2 -2
- package/storybook-static/assets/{index-C2_NlWRN.js → index-CGqnQ2T-.js} +1 -1
- package/storybook-static/assets/{index-0nua7n0t.js → index-DXayMMq-.js} +1 -1
- package/storybook-static/assets/layouts-BwYpnzso.js +32 -0
- package/storybook-static/assets/preview-CoMWgYGQ.css +1 -0
- package/storybook-static/assets/{preview-Dxzxt1-G.js → preview-jqfvLFBB.js} +2 -2
- package/storybook-static/assets/react-18-DQs0uuxx.js +25 -0
- package/storybook-static/assets/test-utils-Di69x3Vj.js +9 -0
- package/storybook-static/assets/themes-designsystem.stories-DJ0jz3mR.js +11 -0
- package/storybook-static/assets/themes.stories-BEC7n9_k.js +41 -0
- package/storybook-static/assets/{writer-v2rZ4csj.js → writer-kuuIP814.js} +3 -3
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +1 -1
- package/storybook-static/sb-manager/globals-runtime.js +1 -1
- package/tsconfig.json +16 -11
- package/storybook-static/assets/Badge.stories-DF-ZkkUj.js +0 -21
- package/storybook-static/assets/CodeSample.stories-D1wOj6L_.js +0 -22
- package/storybook-static/assets/Table.stories-DPECFQX9.js +0 -43
- package/storybook-static/assets/content-C136bEWi.js +0 -8
- package/storybook-static/assets/entry-preview-Bn3hol48.js +0 -2
- package/storybook-static/assets/index-B7gF9TUu.js +0 -9
- package/storybook-static/assets/index-UoN3NoLW.js +0 -17
- package/storybook-static/assets/layouts-iQ1eohh7.js +0 -15
- package/storybook-static/assets/preview-CsUWOVrN.css +0 -1
- package/storybook-static/assets/react-18-BsB9_d4u.js +0 -25
- package/storybook-static/assets/test-utils-CHVDXiZU.js +0 -9
- package/storybook-static/assets/themes-designsystem.stories-zS0faIx7.js +0 -11
- package/storybook-static/assets/themes.stories-Bzt1MmN5.js +0 -41
- package/tsconfig.app.json +0 -24
- package/tsconfig.node.json +0 -13
- /package/storybook-static/assets/{preview-D_vTenOO.js → preview-DQn0GC_k.js} +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Package Index
|
|
2
|
+
|
|
3
|
+
These are all the API packages. See all [API symbols](#).
|
|
4
|
+
|
|
5
|
+
<TableV2>
|
|
6
|
+
<TableV2.Head>
|
|
7
|
+
<TableV2.Tr>
|
|
8
|
+
<TableV2.Th>Package</TableV2.Th>
|
|
9
|
+
<TableV2.Th numeric>Description</TableV2.Th>
|
|
10
|
+
</TableV2.Tr>
|
|
11
|
+
</TableV2.Head>
|
|
12
|
+
<TableV2.Tr>
|
|
13
|
+
<TableV2.Td>
|
|
14
|
+
<TableV2.ModelCell>
|
|
15
|
+
[`@xyd-js/atlas`](#)
|
|
16
|
+
</TableV2.ModelCell>
|
|
17
|
+
</TableV2.Td>
|
|
18
|
+
<TableV2.Td numeric muted>
|
|
19
|
+
<TableV2.Cell>
|
|
20
|
+
API Reference template
|
|
21
|
+
</TableV2.Cell>
|
|
22
|
+
</TableV2.Td>
|
|
23
|
+
</TableV2.Tr>
|
|
24
|
+
<TableV2.Tr>
|
|
25
|
+
<TableV2.Td>
|
|
26
|
+
<TableV2.ModelCell>
|
|
27
|
+
[`@xyd-js/cli`](#)
|
|
28
|
+
</TableV2.ModelCell>
|
|
29
|
+
</TableV2.Td>
|
|
30
|
+
<TableV2.Td numeric muted>
|
|
31
|
+
<TableV2.Cell>
|
|
32
|
+
Command line interface tools
|
|
33
|
+
</TableV2.Cell>
|
|
34
|
+
</TableV2.Td>
|
|
35
|
+
</TableV2.Tr>
|
|
36
|
+
<TableV2.Tr>
|
|
37
|
+
<TableV2.Td>
|
|
38
|
+
<TableV2.ModelCell>
|
|
39
|
+
[`@xyd-js/components`](#)
|
|
40
|
+
</TableV2.ModelCell>
|
|
41
|
+
</TableV2.Td>
|
|
42
|
+
<TableV2.Td numeric muted>
|
|
43
|
+
<TableV2.Cell>
|
|
44
|
+
Shared React components library
|
|
45
|
+
</TableV2.Cell>
|
|
46
|
+
</TableV2.Td>
|
|
47
|
+
</TableV2.Tr>
|
|
48
|
+
<TableV2.Tr>
|
|
49
|
+
<TableV2.Td>
|
|
50
|
+
<TableV2.ModelCell>
|
|
51
|
+
[`@xyd-js/content`](#)
|
|
52
|
+
</TableV2.ModelCell>
|
|
53
|
+
</TableV2.Td>
|
|
54
|
+
<TableV2.Td numeric muted>
|
|
55
|
+
<TableV2.Cell>
|
|
56
|
+
Content management and MDX utilities
|
|
57
|
+
</TableV2.Cell>
|
|
58
|
+
</TableV2.Td>
|
|
59
|
+
</TableV2.Tr>
|
|
60
|
+
<TableV2.Tr>
|
|
61
|
+
<TableV2.Td>
|
|
62
|
+
<TableV2.ModelCell>
|
|
63
|
+
[`@xyd-js/core`](#)
|
|
64
|
+
</TableV2.ModelCell>
|
|
65
|
+
</TableV2.Td>
|
|
66
|
+
<TableV2.Td numeric muted>
|
|
67
|
+
<TableV2.Cell>
|
|
68
|
+
Core utilities and shared functionality
|
|
69
|
+
</TableV2.Cell>
|
|
70
|
+
</TableV2.Td>
|
|
71
|
+
</TableV2.Tr>
|
|
72
|
+
<TableV2.Tr>
|
|
73
|
+
<TableV2.Td>
|
|
74
|
+
<TableV2.ModelCell>
|
|
75
|
+
[`@xyd-js/documan`](#)
|
|
76
|
+
</TableV2.ModelCell>
|
|
77
|
+
</TableV2.Td>
|
|
78
|
+
<TableV2.Td numeric muted>
|
|
79
|
+
<TableV2.Cell>
|
|
80
|
+
Documentation sever runner
|
|
81
|
+
</TableV2.Cell>
|
|
82
|
+
</TableV2.Td>
|
|
83
|
+
</TableV2.Tr>
|
|
84
|
+
<TableV2.Tr>
|
|
85
|
+
<TableV2.Td>
|
|
86
|
+
<TableV2.ModelCell>
|
|
87
|
+
[`@xyd-js/framework`](#)
|
|
88
|
+
</TableV2.ModelCell>
|
|
89
|
+
</TableV2.Td>
|
|
90
|
+
<TableV2.Td numeric muted>
|
|
91
|
+
<TableV2.Cell>
|
|
92
|
+
Bridge between core logic and ui
|
|
93
|
+
</TableV2.Cell>
|
|
94
|
+
</TableV2.Td>
|
|
95
|
+
</TableV2.Tr>
|
|
96
|
+
<TableV2.Tr>
|
|
97
|
+
<TableV2.Td>
|
|
98
|
+
<TableV2.ModelCell>
|
|
99
|
+
[`@xyd-js/gql`](#)
|
|
100
|
+
</TableV2.ModelCell>
|
|
101
|
+
</TableV2.Td>
|
|
102
|
+
<TableV2.Td numeric muted>
|
|
103
|
+
<TableV2.Cell>
|
|
104
|
+
GraphQL utilities and tools
|
|
105
|
+
</TableV2.Cell>
|
|
106
|
+
</TableV2.Td>
|
|
107
|
+
</TableV2.Tr>
|
|
108
|
+
<TableV2.Tr>
|
|
109
|
+
<TableV2.Td>
|
|
110
|
+
<TableV2.ModelCell>
|
|
111
|
+
[`@xyd-js/openapi`](#)
|
|
112
|
+
</TableV2.ModelCell>
|
|
113
|
+
</TableV2.Td>
|
|
114
|
+
<TableV2.Td numeric muted>
|
|
115
|
+
<TableV2.Cell>
|
|
116
|
+
OpenAPI specification tools
|
|
117
|
+
</TableV2.Cell>
|
|
118
|
+
</TableV2.Td>
|
|
119
|
+
</TableV2.Tr>
|
|
120
|
+
<TableV2.Tr>
|
|
121
|
+
<TableV2.Td>
|
|
122
|
+
<TableV2.ModelCell>
|
|
123
|
+
[`@xyd-js/plugin-zero`](#)
|
|
124
|
+
</TableV2.ModelCell>
|
|
125
|
+
</TableV2.Td>
|
|
126
|
+
<TableV2.Td numeric muted>
|
|
127
|
+
<TableV2.Cell>
|
|
128
|
+
Core documentation plugin
|
|
129
|
+
</TableV2.Cell>
|
|
130
|
+
</TableV2.Td>
|
|
131
|
+
</TableV2.Tr>
|
|
132
|
+
<TableV2.Tr>
|
|
133
|
+
<TableV2.Td>
|
|
134
|
+
<TableV2.ModelCell>
|
|
135
|
+
[`@xyd-js/storybook`](#)
|
|
136
|
+
</TableV2.ModelCell>
|
|
137
|
+
</TableV2.Td>
|
|
138
|
+
<TableV2.Td numeric muted>
|
|
139
|
+
<TableV2.Cell>
|
|
140
|
+
Component documentation and testing
|
|
141
|
+
</TableV2.Cell>
|
|
142
|
+
</TableV2.Td>
|
|
143
|
+
</TableV2.Tr>
|
|
144
|
+
<TableV2.Tr>
|
|
145
|
+
<TableV2.Td>
|
|
146
|
+
<TableV2.ModelCell>
|
|
147
|
+
[`@xyd-js/theme-poetry`](#)
|
|
148
|
+
</TableV2.ModelCell>
|
|
149
|
+
</TableV2.Td>
|
|
150
|
+
<TableV2.Td numeric muted>
|
|
151
|
+
<TableV2.Cell>
|
|
152
|
+
On of the default themes
|
|
153
|
+
</TableV2.Cell>
|
|
154
|
+
</TableV2.Td>
|
|
155
|
+
</TableV2.Tr>
|
|
156
|
+
<TableV2.Tr>
|
|
157
|
+
<TableV2.Td>
|
|
158
|
+
<TableV2.ModelCell>
|
|
159
|
+
[`@xyd-js/ui`](#)
|
|
160
|
+
</TableV2.ModelCell>
|
|
161
|
+
</TableV2.Td>
|
|
162
|
+
<TableV2.Td numeric muted>
|
|
163
|
+
<TableV2.Cell>
|
|
164
|
+
Core documentations ui elements
|
|
165
|
+
</TableV2.Cell>
|
|
166
|
+
</TableV2.Td>
|
|
167
|
+
</TableV2.Tr>
|
|
168
|
+
<TableV2.Tr>
|
|
169
|
+
<TableV2.Td>
|
|
170
|
+
<TableV2.ModelCell>
|
|
171
|
+
[`@xyd-js/uniform`](#)
|
|
172
|
+
</TableV2.ModelCell>
|
|
173
|
+
</TableV2.Td>
|
|
174
|
+
<TableV2.Td numeric muted>
|
|
175
|
+
<TableV2.Cell>
|
|
176
|
+
Unified formatting for API references
|
|
177
|
+
</TableV2.Cell>
|
|
178
|
+
</TableV2.Td>
|
|
179
|
+
</TableV2.Tr>
|
|
180
|
+
<TableV2.Tr>
|
|
181
|
+
<TableV2.Td>
|
|
182
|
+
<TableV2.ModelCell>
|
|
183
|
+
[`@xyd-js/xtokens`](#)
|
|
184
|
+
</TableV2.ModelCell>
|
|
185
|
+
</TableV2.Td>
|
|
186
|
+
<TableV2.Td numeric muted>
|
|
187
|
+
<TableV2.Cell>
|
|
188
|
+
Design tokens and theming system
|
|
189
|
+
</TableV2.Cell>
|
|
190
|
+
</TableV2.Td>
|
|
191
|
+
</TableV2.Tr>
|
|
192
|
+
</TableV2>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Function `gqlSchemaToReferences`
|
|
2
|
+
|
|
3
|
+
:::code-group
|
|
4
|
+
```ts
|
|
5
|
+
function gqlSchemaToReferences(
|
|
6
|
+
schemaLocation: string
|
|
7
|
+
): Promise<Reference[]>
|
|
8
|
+
```
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
Converts a GraphQL schema file to a list of uniform references.
|
|
12
|
+
|
|
13
|
+
:::Details{kind="tertiary" title="<>Source code in <code>src/hello.ts</code></>" icon="<IconQuote/>"}
|
|
14
|
+
```ts {from="index.ts"}
|
|
15
|
+
export async function gqlSchemaToReferences(
|
|
16
|
+
schemaLocation: string
|
|
17
|
+
): Promise<Reference[]> {
|
|
18
|
+
const loadersList = {
|
|
19
|
+
["GraphQLFileLoader"]: "@graphql-tools/graphql-file-loader",
|
|
20
|
+
}
|
|
21
|
+
const loaders = await getDocumentLoaders(loadersList);
|
|
22
|
+
|
|
23
|
+
// @ts-ignore TODO: but ts works in @graphql-markdown/core
|
|
24
|
+
const schema = await loadSchema(schemaLocation as string, loaders);
|
|
25
|
+
|
|
26
|
+
const references: Reference[] = []
|
|
27
|
+
|
|
28
|
+
const queries = schema.getRootType(OperationTypeNode.QUERY)
|
|
29
|
+
const queryFields = queries?.getFields?.()
|
|
30
|
+
|
|
31
|
+
if (queryFields) {
|
|
32
|
+
references.push(...gqlOperationsToUniformRef(
|
|
33
|
+
ReferenceType.GRAPHQL_QUERY,
|
|
34
|
+
queryFields
|
|
35
|
+
))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const mutations = schema.getRootType(OperationTypeNode.MUTATION)
|
|
39
|
+
const mutationFields = mutations?.getFields?.()
|
|
40
|
+
|
|
41
|
+
if (mutationFields) {
|
|
42
|
+
references.push(...gqlOperationsToUniformRef(
|
|
43
|
+
ReferenceType.GRAPHQL_MUTATION,
|
|
44
|
+
mutationFields
|
|
45
|
+
))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const typeMap = schema.getTypeMap();
|
|
49
|
+
|
|
50
|
+
for (const gqlType of Object.values(typeMap)) {
|
|
51
|
+
const builtInType = isSpecifiedScalarType(gqlType) ||
|
|
52
|
+
isIntrospectionType(gqlType) ||
|
|
53
|
+
gqlType.name === "Mutation"
|
|
54
|
+
|
|
55
|
+
if (builtInType) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
switch (gqlType.constructor.name) {
|
|
60
|
+
case 'GraphQLObjectType': {
|
|
61
|
+
const type = gqlType as GraphQLObjectType;
|
|
62
|
+
|
|
63
|
+
references.push(gqlObjectToUniformRef(type))
|
|
64
|
+
|
|
65
|
+
break
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
case 'GraphQLInputObjectType': {
|
|
69
|
+
const type = gqlType as GraphQLInputObjectType;
|
|
70
|
+
|
|
71
|
+
references.push(gqlInputToUniformRef(type))
|
|
72
|
+
break
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
case 'GraphQLEnumType': {
|
|
76
|
+
const type = gqlType as GraphQLEnumType;
|
|
77
|
+
|
|
78
|
+
references.push(gqlEnumToUniformRef(type))
|
|
79
|
+
|
|
80
|
+
break
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
case 'GraphQLScalarType': {
|
|
84
|
+
const type = gqlType as GraphQLScalarType
|
|
85
|
+
|
|
86
|
+
references.push(gqlScalarToUniformRef(type))
|
|
87
|
+
|
|
88
|
+
break
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
default: {
|
|
92
|
+
console.debug(`Unsupported type: ${gqlType.constructor.name}`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return references
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
:::
|
|
101
|
+
|
|
102
|
+
:::TableV2
|
|
103
|
+
```ts
|
|
104
|
+
[
|
|
105
|
+
["See also", ""],
|
|
106
|
+
["[`@xyd-js/atlas`](#)", ""]
|
|
107
|
+
]
|
|
108
|
+
```
|
|
109
|
+
:::
|
|
110
|
+
|
|
111
|
+
## Parameters
|
|
112
|
+
:::TableV2
|
|
113
|
+
```ts
|
|
114
|
+
[
|
|
115
|
+
["Name", "Type", "Description"],
|
|
116
|
+
["`schemaLocation`", "`string`", "The location of the GraphQL schema file."]
|
|
117
|
+
]
|
|
118
|
+
```
|
|
119
|
+
:::
|
|
120
|
+
|
|
121
|
+
## Returns
|
|
122
|
+
:::TableV2
|
|
123
|
+
```ts
|
|
124
|
+
[
|
|
125
|
+
["Type", "Description"],
|
|
126
|
+
["`Promise<Resolve[]>`", "The list of uniform references."]
|
|
127
|
+
]
|
|
128
|
+
```
|
|
129
|
+
:::
|
|
130
|
+
|
|
131
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Agents
|
|
2
|
+
|
|
3
|
+
## ToolsToFinalOutputFunction `module-attribute`
|
|
4
|
+
|
|
5
|
+
:::code-group
|
|
6
|
+
```py
|
|
7
|
+
ToolsToFinalOutputFunction: TypeAlias = Callable[
|
|
8
|
+
[RunContextWrapper[TContext], list[FunctionToolResult]],
|
|
9
|
+
MaybeAwaitable[ToolsToFinalOutputResult],
|
|
10
|
+
]
|
|
11
|
+
```
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
A function that takes a run context and a list of tool results, and returns a `ToolToFinalOutputResult`.
|
|
15
|
+
|
|
16
|
+
## ToolsToFinalOutputResult `dataclass`
|
|
17
|
+
|
|
18
|
+
:::code-group
|
|
19
|
+
```py
|
|
20
|
+
ToolsToFinalOutputResult: TypeAlias = Union[
|
|
21
|
+
FinalOutput,
|
|
22
|
+
Tuple[FinalOutput, list[FunctionToolResult]],
|
|
23
|
+
]
|
|
24
|
+
```
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
### is_final_output `instance-attribute`
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<Details
|
|
31
|
+
kind="tertiary"
|
|
32
|
+
title={<>
|
|
33
|
+
Source code in
|
|
34
|
+
<code>src/agents/agent.py</code>
|
|
35
|
+
</>
|
|
36
|
+
}
|
|
37
|
+
icon={<IconQuote/>}
|
|
38
|
+
>
|
|
39
|
+
```py
|
|
40
|
+
@dataclass
|
|
41
|
+
class ToolsToFinalOutputResult:
|
|
42
|
+
is_final_output: bool
|
|
43
|
+
"""Whether this is the final output. If False, the LLM will run again and receive the tool call
|
|
44
|
+
output.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
final_output: Any | None = None
|
|
48
|
+
"""The final output. Can be None if `is_final_output` is False, otherwise must match the
|
|
49
|
+
`output_type` of the agent.
|
|
50
|
+
"""
|
|
51
|
+
```
|
|
52
|
+
</Details>
|
|
53
|
+
|
|
@@ -5,20 +5,14 @@ import {Reference} from '@xyd-js/uniform';
|
|
|
5
5
|
import {Atlas} from "@xyd-js/atlas";
|
|
6
6
|
|
|
7
7
|
import {uniformToReferences} from "./uniform-to-references";
|
|
8
|
-
import {MDXReference} from "../../utils/mdx
|
|
9
|
-
|
|
10
|
-
const HelloWorld = () => {
|
|
11
|
-
return <h1>Hello, World!</h1>;
|
|
12
|
-
};
|
|
8
|
+
import {MDXReference} from "../../utils/mdx";
|
|
13
9
|
|
|
14
10
|
export default {
|
|
15
11
|
title: 'Atlas/Atlas',
|
|
16
|
-
component:
|
|
12
|
+
component: Atlas,
|
|
17
13
|
} as Meta;
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const Template = (args) => {
|
|
15
|
+
const Template = (args: any) => {
|
|
22
16
|
const [references, setReferences] = useState<MDXReference<Reference[]> | []>([])
|
|
23
17
|
|
|
24
18
|
async function load() {
|
|
@@ -45,3 +39,4 @@ const Template = (args) => {
|
|
|
45
39
|
|
|
46
40
|
export const Default = Template.bind({});
|
|
47
41
|
Default.args = {};
|
|
42
|
+
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, {useState, useEffect} from 'react';
|
|
2
|
+
import type {Meta} from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {Reference} from '@xyd-js/uniform';
|
|
5
|
+
import {
|
|
6
|
+
CodeSample,
|
|
7
|
+
} from '@xyd-js/components/coder';
|
|
8
|
+
import {
|
|
9
|
+
TableV2
|
|
10
|
+
} from "@xyd-js/components/writer";
|
|
11
|
+
import {LayoutPrimary} from "@xyd-js/components/layouts";
|
|
12
|
+
import getContentComponents from "@xyd-js/components/content"
|
|
13
|
+
import {AtlasIndex} from "@xyd-js/atlas/atlas-index"
|
|
14
|
+
|
|
15
|
+
import PackageIndexWip1Content from "../../content/atlas-index/wip1.mdx"
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
DemoNavbar,
|
|
19
|
+
DemoSubNav,
|
|
20
|
+
DemoSidebar,
|
|
21
|
+
DemoContent,
|
|
22
|
+
DemoTOC
|
|
23
|
+
} from "../../components/DemoWireframe";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
title: 'Atlas/AtlasIndex',
|
|
27
|
+
component: AtlasIndex,
|
|
28
|
+
} as Meta;
|
|
29
|
+
|
|
30
|
+
const contentComponents = getContentComponents()
|
|
31
|
+
|
|
32
|
+
const Content = {
|
|
33
|
+
Text: contentComponents.p,
|
|
34
|
+
Details: contentComponents.Details,
|
|
35
|
+
IconQuote: contentComponents.IconQuote,
|
|
36
|
+
Code: contentComponents.code,
|
|
37
|
+
Heading1: contentComponents.h1,
|
|
38
|
+
Heading2: contentComponents.h2,
|
|
39
|
+
Container: contentComponents.Content,
|
|
40
|
+
CodeSample: contentComponents.CodeSample
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Default = () => {
|
|
44
|
+
return <LayoutPrimary
|
|
45
|
+
header={<DemoNavbar/>}
|
|
46
|
+
subheader={<DemoSubNav/>}
|
|
47
|
+
aside={<DemoSidebar/>}
|
|
48
|
+
content={<>
|
|
49
|
+
{/*<FakeContent/>*/}
|
|
50
|
+
<AtlasIndex data={exampleUniform}/>
|
|
51
|
+
</>}
|
|
52
|
+
contentNav={<DemoTOC/>}
|
|
53
|
+
layoutSize="large"
|
|
54
|
+
/>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function FakeContent() {
|
|
58
|
+
return <DemoContent breadcrumbs={false}>
|
|
59
|
+
{<PackageIndexWip1Content components={{
|
|
60
|
+
...contentComponents,
|
|
61
|
+
pre: Pre,
|
|
62
|
+
TableV2
|
|
63
|
+
}}/>}
|
|
64
|
+
</DemoContent>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function Pre({children, ...rest}: { children: React.ReactNode }) {
|
|
68
|
+
const codeElement = children as any
|
|
69
|
+
if (!children) {
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const {className, children: codeChildren} = codeElement.props;
|
|
74
|
+
const language = className?.replace('language-', '') || '';
|
|
75
|
+
const codeContent = codeChildren || '';
|
|
76
|
+
|
|
77
|
+
return <CodeSample
|
|
78
|
+
name={language}
|
|
79
|
+
description={""}
|
|
80
|
+
codeblocks={[
|
|
81
|
+
{
|
|
82
|
+
value: codeContent,
|
|
83
|
+
lang: language,
|
|
84
|
+
meta: language,
|
|
85
|
+
}
|
|
86
|
+
]}
|
|
87
|
+
size="full"
|
|
88
|
+
kind="secondary"
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const exampleUniform = {
|
|
93
|
+
"title": "Function gqlSchemaToReferences",
|
|
94
|
+
"canonical": "fn-gqlSchemaToReferences",
|
|
95
|
+
"description": "Converts a GraphQL schema file to references.\n",
|
|
96
|
+
"context": {
|
|
97
|
+
"fileName": "index.ts",
|
|
98
|
+
"fileFullPath": "src/index.ts",
|
|
99
|
+
"line": 48,
|
|
100
|
+
"col": 16,
|
|
101
|
+
"signatureText": "export function gqlSchemaToReferences(schemaLocation: string): Promise<[\n]>;",
|
|
102
|
+
"sourcecode": "export function gqlSchemaToReferences(\n schemaLocation: string\n): Promise<[]> {\n if (schemaLocation.endsWith(\".graphql\")) {\n return Promise.resolve([])\n }\n\n return Promise.resolve([])\n}",
|
|
103
|
+
"package": "@xyd-sources-examples/package-a"
|
|
104
|
+
},
|
|
105
|
+
"examples": {
|
|
106
|
+
"groups": []
|
|
107
|
+
},
|
|
108
|
+
"definitions": [
|
|
109
|
+
{
|
|
110
|
+
"title": "Returns",
|
|
111
|
+
"properties": [
|
|
112
|
+
{
|
|
113
|
+
"name": "",
|
|
114
|
+
"type": "<Promise>",
|
|
115
|
+
"description": "references\n"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"title": "Parameters",
|
|
121
|
+
"properties": [
|
|
122
|
+
{
|
|
123
|
+
"name": "schemaLocation",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "The location of the schema file.\n"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
} as Reference
|
|
@@ -29,4 +29,16 @@ export const Warning = () => {
|
|
|
29
29
|
Warning
|
|
30
30
|
</Badge>
|
|
31
31
|
</div>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Info = () => {
|
|
35
|
+
return <div style={{
|
|
36
|
+
padding: "100px",
|
|
37
|
+
paddingTop: "0px",
|
|
38
|
+
margin: "0 auto",
|
|
39
|
+
}}>
|
|
40
|
+
<Badge kind="info">
|
|
41
|
+
Warning
|
|
42
|
+
</Badge>
|
|
43
|
+
</div>
|
|
32
44
|
}
|
|
@@ -3,6 +3,7 @@ import type {Meta} from '@storybook/react';
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
Table,
|
|
6
|
+
TableV2
|
|
6
7
|
} from '@xyd-js/components/writer';
|
|
7
8
|
|
|
8
9
|
export default {
|
|
@@ -52,3 +53,34 @@ export const Default = () => {
|
|
|
52
53
|
</Table>
|
|
53
54
|
</div>
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
export const V2 = () => {
|
|
58
|
+
return <TableV2>
|
|
59
|
+
<TableV2.Head>
|
|
60
|
+
<TableV2.Tr>
|
|
61
|
+
<TableV2.Th>Model</TableV2.Th>
|
|
62
|
+
<TableV2.Th numeric>Training</TableV2.Th>
|
|
63
|
+
<TableV2.Th numeric>Input</TableV2.Th>
|
|
64
|
+
<TableV2.Th numeric>Cached input</TableV2.Th>
|
|
65
|
+
<TableV2.Th numeric>Output</TableV2.Th>
|
|
66
|
+
</TableV2.Tr>
|
|
67
|
+
</TableV2.Head>
|
|
68
|
+
<TableV2.Tr>
|
|
69
|
+
<TableV2.Td>
|
|
70
|
+
<TableV2.ModelCell>gpt-4o-2024-08-06</TableV2.ModelCell>
|
|
71
|
+
</TableV2.Td>
|
|
72
|
+
<TableV2.Td numeric>
|
|
73
|
+
<TableV2.Cell>$25.00</TableV2.Cell>
|
|
74
|
+
</TableV2.Td>
|
|
75
|
+
<TableV2.Td numeric>
|
|
76
|
+
<TableV2.Cell>$3.75</TableV2.Cell>
|
|
77
|
+
</TableV2.Td>
|
|
78
|
+
<TableV2.Td numeric muted>
|
|
79
|
+
<TableV2.Cell>$1.875</TableV2.Cell>
|
|
80
|
+
</TableV2.Td>
|
|
81
|
+
<TableV2.Td numeric>
|
|
82
|
+
<TableV2.Cell>$15.00</TableV2.Cell>
|
|
83
|
+
</TableV2.Td>
|
|
84
|
+
</TableV2.Tr>
|
|
85
|
+
</TableV2>
|
|
86
|
+
}
|