@sixb/app 0.1.4 → 0.1.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/README.md +9 -0
- package/dist/agents.d.ts +4 -4
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +5 -4
- package/dist/agents.js.map +3 -3
- package/package.json +3 -3
- package/src/agents.ts +11 -7
package/README.md
CHANGED
|
@@ -89,6 +89,15 @@ export default function AgentsLayout({ children }: PropsWithChildren) {
|
|
|
89
89
|
Explicit props passed to a project-owned `AgentsPage` override provider defaults. The custom width
|
|
90
90
|
applies to the persistent desktop rail; the mobile sheet keeps its responsive width.
|
|
91
91
|
|
|
92
|
+
The provider also accepts `documentPreviewRenderers`. Applications can register document viewers
|
|
93
|
+
without coupling `@sixb/app` or `@sixb/agent-ui` to their implementation.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<AgentWorkspaceProvider documentPreviewRenderers={[workbookPreviewRenderer]}>
|
|
97
|
+
{children}
|
|
98
|
+
</AgentWorkspaceProvider>
|
|
99
|
+
```
|
|
100
|
+
|
|
92
101
|
### Embedded Agent Panel
|
|
93
102
|
|
|
94
103
|
Embed the same conversation runtime without changing the page route:
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type AgentChatPageProps } from "@sixb/agent-ui/react-router";
|
|
2
2
|
import { type PropsWithChildren } from "react";
|
|
3
|
-
export { AgentContextProvider, AgentPanel, type AgentPanelProps, useAgentContext, } from "@sixb/agent-ui";
|
|
3
|
+
export { AgentContextProvider, type AgentDocumentPreviewRenderer, type AgentDocumentPreviewRendererProps, type AgentFileRef, AgentPanel, type AgentPanelProps, useAgentContext, } from "@sixb/agent-ui";
|
|
4
4
|
export { agentContext } from "@sixb/core/agents/context";
|
|
5
5
|
export type AgentsPageProps = Omit<AgentChatPageProps, "routeBase">;
|
|
6
|
-
type
|
|
7
|
-
export type AgentWorkspaceProviderProps = PropsWithChildren<
|
|
6
|
+
type AgentWorkspaceConfiguration = Pick<AgentsPageProps, "sidebarHeader" | "sidebarFooter" | "sidebarWidth" | "documentPreviewRenderers">;
|
|
7
|
+
export type AgentWorkspaceProviderProps = PropsWithChildren<AgentWorkspaceConfiguration>;
|
|
8
8
|
/** Configure the framework-owned Agents routes, typically from `app/agents/layout.tsx`. */
|
|
9
|
-
export declare function AgentWorkspaceProvider({ sidebarHeader, sidebarFooter, sidebarWidth, children, }: AgentWorkspaceProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<
|
|
9
|
+
export declare function AgentWorkspaceProvider({ sidebarHeader, sidebarFooter, sidebarWidth, documentPreviewRenderers, children, }: AgentWorkspaceProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<AgentWorkspaceConfiguration>>;
|
|
10
10
|
export default function AgentsPage(props: AgentsPageProps): import("react").FunctionComponentElement<AgentChatPageProps>;
|
|
11
11
|
//# sourceMappingURL=agents.d.ts.map
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,EAAgC,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAA;AAExF,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AAEnE,KAAK,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,EAAgC,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAA;AAExF,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,YAAY,EACjB,UAAU,EACV,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AAEnE,KAAK,2BAA2B,GAAG,IAAI,CACrC,eAAe,EACf,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,0BAA0B,CAChF,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,2BAA2B,CAAC,CAAA;AAIxF,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,EAAE,2BAA2B,wGAM7B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,gEAQxD"}
|
package/dist/agents.js
CHANGED
|
@@ -13,14 +13,15 @@ function AgentWorkspaceProvider({
|
|
|
13
13
|
sidebarHeader,
|
|
14
14
|
sidebarFooter,
|
|
15
15
|
sidebarWidth,
|
|
16
|
+
documentPreviewRenderers,
|
|
16
17
|
children
|
|
17
18
|
}) {
|
|
18
|
-
return createElement(AgentWorkspaceContext.Provider, { value: { sidebarHeader, sidebarFooter, sidebarWidth } }, children);
|
|
19
|
+
return createElement(AgentWorkspaceContext.Provider, { value: { sidebarHeader, sidebarFooter, sidebarWidth, documentPreviewRenderers } }, children);
|
|
19
20
|
}
|
|
20
21
|
function AgentsPage(props) {
|
|
21
|
-
const
|
|
22
|
+
const workspaceConfiguration = useContext(AgentWorkspaceContext);
|
|
22
23
|
return createElement(AgentChatPage, {
|
|
23
|
-
...
|
|
24
|
+
...workspaceConfiguration,
|
|
24
25
|
...props,
|
|
25
26
|
routeBase: "/agents"
|
|
26
27
|
});
|
|
@@ -34,4 +35,4 @@ export {
|
|
|
34
35
|
AgentContextProvider
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
//# debugId=
|
|
38
|
+
//# debugId=424CA12B96B1880764756E2164756E21
|
package/dist/agents.js.map
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/agents.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { AgentChatPage, type AgentChatPageProps } from \"@sixb/agent-ui/react-router\"\nimport { createContext, createElement, type PropsWithChildren, useContext } from \"react\"\n\nexport {\n AgentContextProvider,\n AgentPanel,\n type AgentPanelProps,\n useAgentContext,\n} from \"@sixb/agent-ui\"\n\nexport { agentContext } from \"@sixb/core/agents/context\"\n\nexport type AgentsPageProps = Omit<AgentChatPageProps, \"routeBase\">\n\ntype
|
|
5
|
+
"import { AgentChatPage, type AgentChatPageProps } from \"@sixb/agent-ui/react-router\"\nimport { createContext, createElement, type PropsWithChildren, useContext } from \"react\"\n\nexport {\n AgentContextProvider,\n type AgentDocumentPreviewRenderer,\n type AgentDocumentPreviewRendererProps,\n type AgentFileRef,\n AgentPanel,\n type AgentPanelProps,\n useAgentContext,\n} from \"@sixb/agent-ui\"\n\nexport { agentContext } from \"@sixb/core/agents/context\"\n\nexport type AgentsPageProps = Omit<AgentChatPageProps, \"routeBase\">\n\ntype AgentWorkspaceConfiguration = Pick<\n AgentsPageProps,\n \"sidebarHeader\" | \"sidebarFooter\" | \"sidebarWidth\" | \"documentPreviewRenderers\"\n>\n\nexport type AgentWorkspaceProviderProps = PropsWithChildren<AgentWorkspaceConfiguration>\n\nconst AgentWorkspaceContext = createContext<AgentWorkspaceConfiguration>({})\n\n/** Configure the framework-owned Agents routes, typically from `app/agents/layout.tsx`. */\nexport function AgentWorkspaceProvider({\n sidebarHeader,\n sidebarFooter,\n sidebarWidth,\n documentPreviewRenderers,\n children,\n}: AgentWorkspaceProviderProps) {\n return createElement(\n AgentWorkspaceContext.Provider,\n { value: { sidebarHeader, sidebarFooter, sidebarWidth, documentPreviewRenderers } },\n children\n )\n}\n\nexport default function AgentsPage(props: AgentsPageProps) {\n const workspaceConfiguration = useContext(AgentWorkspaceContext)\n\n return createElement(AgentChatPage, {\n ...workspaceConfiguration,\n ...props,\n routeBase: \"/agents\",\n })\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;AAAA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAUA;AAWA,IAAM,wBAAwB,cAA2C,CAAC,CAAC;AAGpE,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GAC8B;AAAA,EAC9B,OAAO,cACL,sBAAsB,UACtB,EAAE,OAAO,EAAE,eAAe,eAAe,cAAc,yBAAyB,EAAE,GAClF,QACF;AAAA;AAGF,SAAwB,UAAU,CAAC,OAAwB;AAAA,EACzD,MAAM,yBAAyB,WAAW,qBAAqB;AAAA,EAE/D,OAAO,cAAc,eAAe;AAAA,OAC/B;AAAA,OACA;AAAA,IACH,WAAW;AAAA,EACb,CAAC;AAAA;",
|
|
8
|
+
"debugId": "424CA12B96B1880764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Custom app toolkit for Sixb projects — route scanning, dev serving, and production builds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"prepack": "bun run build"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sixb/agent-ui": "^0.1.
|
|
52
|
-
"@sixb/core": "^0.1.
|
|
51
|
+
"@sixb/agent-ui": "^0.1.5",
|
|
52
|
+
"@sixb/core": "^0.1.6",
|
|
53
53
|
"@sixb/ui": "^0.1.1",
|
|
54
54
|
"@tailwindcss/cli": "^4.2.2",
|
|
55
55
|
"tailwindcss": "^4.1.18"
|
package/src/agents.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { createContext, createElement, type PropsWithChildren, useContext } from
|
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
AgentContextProvider,
|
|
6
|
+
type AgentDocumentPreviewRenderer,
|
|
7
|
+
type AgentDocumentPreviewRendererProps,
|
|
8
|
+
type AgentFileRef,
|
|
6
9
|
AgentPanel,
|
|
7
10
|
type AgentPanelProps,
|
|
8
11
|
useAgentContext,
|
|
@@ -12,34 +15,35 @@ export { agentContext } from "@sixb/core/agents/context"
|
|
|
12
15
|
|
|
13
16
|
export type AgentsPageProps = Omit<AgentChatPageProps, "routeBase">
|
|
14
17
|
|
|
15
|
-
type
|
|
18
|
+
type AgentWorkspaceConfiguration = Pick<
|
|
16
19
|
AgentsPageProps,
|
|
17
|
-
"sidebarHeader" | "sidebarFooter" | "sidebarWidth"
|
|
20
|
+
"sidebarHeader" | "sidebarFooter" | "sidebarWidth" | "documentPreviewRenderers"
|
|
18
21
|
>
|
|
19
22
|
|
|
20
|
-
export type AgentWorkspaceProviderProps = PropsWithChildren<
|
|
23
|
+
export type AgentWorkspaceProviderProps = PropsWithChildren<AgentWorkspaceConfiguration>
|
|
21
24
|
|
|
22
|
-
const AgentWorkspaceContext = createContext<
|
|
25
|
+
const AgentWorkspaceContext = createContext<AgentWorkspaceConfiguration>({})
|
|
23
26
|
|
|
24
27
|
/** Configure the framework-owned Agents routes, typically from `app/agents/layout.tsx`. */
|
|
25
28
|
export function AgentWorkspaceProvider({
|
|
26
29
|
sidebarHeader,
|
|
27
30
|
sidebarFooter,
|
|
28
31
|
sidebarWidth,
|
|
32
|
+
documentPreviewRenderers,
|
|
29
33
|
children,
|
|
30
34
|
}: AgentWorkspaceProviderProps) {
|
|
31
35
|
return createElement(
|
|
32
36
|
AgentWorkspaceContext.Provider,
|
|
33
|
-
{ value: { sidebarHeader, sidebarFooter, sidebarWidth } },
|
|
37
|
+
{ value: { sidebarHeader, sidebarFooter, sidebarWidth, documentPreviewRenderers } },
|
|
34
38
|
children
|
|
35
39
|
)
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
export default function AgentsPage(props: AgentsPageProps) {
|
|
39
|
-
const
|
|
43
|
+
const workspaceConfiguration = useContext(AgentWorkspaceContext)
|
|
40
44
|
|
|
41
45
|
return createElement(AgentChatPage, {
|
|
42
|
-
...
|
|
46
|
+
...workspaceConfiguration,
|
|
43
47
|
...props,
|
|
44
48
|
routeBase: "/agents",
|
|
45
49
|
})
|