@sixb/app 0.1.8 → 0.1.9
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 +33 -24
- package/dist/agents.d.ts +3 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +8 -5
- package/dist/agents.js.map +3 -3
- package/package.json +3 -3
- package/src/agents.ts +7 -9
package/README.md
CHANGED
|
@@ -99,31 +99,13 @@ These routes are generated only when the project has at least one `app/` page, s
|
|
|
99
99
|
|
|
100
100
|
The default agent UI is imported through `@sixb/app/agents`, so app projects do not need to import `@sixb/agent-ui` directly. A framework-owned `agent-ui.css` bundle is generated before the app stylesheet and imports normal `@sixb/ui` styles, which means app-level token overrides in `app/globals.css` still apply in the usual way.
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
The routed page uses the same conversation header, history dialog, and new-thread flow as an
|
|
103
|
+
embedded agent panel. Applications that want a conversation to move between a full page and an
|
|
104
|
+
in-app dock should mount one `AgentSurface` in their shell and derive its `fullPage` presentation
|
|
105
|
+
from the route instead of mounting a second chat.
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
import type { PropsWithChildren } from "react"
|
|
108
|
-
|
|
109
|
-
export default function AgentsLayout({ children }: PropsWithChildren) {
|
|
110
|
-
return (
|
|
111
|
-
<AgentWorkspaceProvider
|
|
112
|
-
sidebarHeader={<AppSidebarHeader />}
|
|
113
|
-
sidebarFooter={<AppSidebarFooter />}
|
|
114
|
-
sidebarWidth="12.5rem"
|
|
115
|
-
>
|
|
116
|
-
{children}
|
|
117
|
-
</AgentWorkspaceProvider>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Explicit props passed to a project-owned `AgentsPage` override provider defaults. The custom width
|
|
123
|
-
applies to the persistent desktop rail; the mobile sheet keeps its responsive width.
|
|
124
|
-
|
|
125
|
-
The provider also accepts `documentPreviewRenderers`. Applications can register document viewers
|
|
126
|
-
without coupling `@sixb/app` or `@sixb/agent-ui` to their implementation.
|
|
107
|
+
Add `AgentWorkspaceProvider` to `app/agents/layout.tsx` to register `documentPreviewRenderers`
|
|
108
|
+
for the generated routes without coupling `@sixb/app` or `@sixb/agent-ui` to their implementation.
|
|
127
109
|
|
|
128
110
|
```tsx
|
|
129
111
|
<AgentWorkspaceProvider documentPreviewRenderers={[workbookPreviewRenderer]}>
|
|
@@ -177,6 +159,33 @@ Context is visible and removable before send, then stored on that user message.
|
|
|
177
159
|
object references explicitly. V1 accepts 12 entries, 16 KB per app-state entry, and 64 KB of app
|
|
178
160
|
state per message. Object references identify live data; they do not grant access.
|
|
179
161
|
|
|
162
|
+
For an assistant that lives beside the app, keep one `AgentSurface` mounted next to the route
|
|
163
|
+
outlet:
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import { AgentSurface } from "@sixb/app/agents"
|
|
167
|
+
|
|
168
|
+
function AppAssistant() {
|
|
169
|
+
return (
|
|
170
|
+
<AgentSurface
|
|
171
|
+
title="Invoice Assistant"
|
|
172
|
+
launcherLabel="Ask about invoices"
|
|
173
|
+
/>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
`AgentSurface` opens as a resizable dock by default and owns its open/closed state, width, and
|
|
179
|
+
selected thread. It persists those values in `sessionStorage`: refreshes restore them, while each
|
|
180
|
+
browser tab can diverge without changing the app URL. Pass controlled `mode`, `threadId`, or
|
|
181
|
+
`dockWidth` props when the host needs to own a value, or `persistenceKey={false}` to disable per-tab
|
|
182
|
+
persistence. Documents open in a modeless tabbed canvas over the app area while the dock stays
|
|
183
|
+
visible and interactive; hiding the canvas preserves its tabs. Mobile uses a full-screen dock and
|
|
184
|
+
modal document overlay. Set `fullPage` from the host's conversation route when that same session
|
|
185
|
+
should occupy the main application canvas. Connect `onRequestFullPage` and `onRequestDock` to host
|
|
186
|
+
navigation; leaving that route returns the session to its dock without changing the selected
|
|
187
|
+
thread.
|
|
188
|
+
|
|
180
189
|
### Styling and Tailwind
|
|
181
190
|
|
|
182
191
|
`app/globals.css` is treated as source:
|
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, type AgentDocumentPreviewRenderer, type AgentDocumentPreviewRendererProps, type AgentFileRef, AgentPanel, type AgentPanelProps, useAgentContext, } from "@sixb/agent-ui";
|
|
3
|
+
export { AgentContextProvider, type AgentDocumentPreviewRenderer, type AgentDocumentPreviewRendererProps, type AgentFileRef, AgentPanel, type AgentPanelProps, AgentSurface, type AgentSurfaceMode, type AgentSurfaceProps, handoffAgentSurfaceThread, setAgentSurfaceMode, useAgentContext, } from "@sixb/agent-ui";
|
|
4
4
|
export { agentContext } from "@sixb/core/agents/context";
|
|
5
5
|
export type AgentsPageProps = Omit<AgentChatPageProps, "routeBase">;
|
|
6
|
-
type AgentWorkspaceConfiguration = Pick<AgentsPageProps, "
|
|
6
|
+
type AgentWorkspaceConfiguration = Pick<AgentsPageProps, "documentPreviewRenderers">;
|
|
7
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({
|
|
9
|
+
export declare function AgentWorkspaceProvider({ 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,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,YAAY,EACjB,UAAU,EACV,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,gBAAgB,CAAA;
|
|
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,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AAEnE,KAAK,2BAA2B,GAAG,IAAI,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;AAEpF,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,2BAA2B,CAAC,CAAA;AAIxF,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,EACrC,wBAAwB,EACxB,QAAQ,GACT,EAAE,2BAA2B,wGAM7B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,gEAQxD"}
|
package/dist/agents.js
CHANGED
|
@@ -5,18 +5,18 @@ import { createContext, createElement, useContext } from "react";
|
|
|
5
5
|
import {
|
|
6
6
|
AgentContextProvider,
|
|
7
7
|
AgentPanel,
|
|
8
|
+
AgentSurface,
|
|
9
|
+
handoffAgentSurfaceThread,
|
|
10
|
+
setAgentSurfaceMode,
|
|
8
11
|
useAgentContext
|
|
9
12
|
} from "@sixb/agent-ui";
|
|
10
13
|
import { agentContext } from "@sixb/core/agents/context";
|
|
11
14
|
var AgentWorkspaceContext = createContext({});
|
|
12
15
|
function AgentWorkspaceProvider({
|
|
13
|
-
sidebarHeader,
|
|
14
|
-
sidebarFooter,
|
|
15
|
-
sidebarWidth,
|
|
16
16
|
documentPreviewRenderers,
|
|
17
17
|
children
|
|
18
18
|
}) {
|
|
19
|
-
return createElement(AgentWorkspaceContext.Provider, { value: {
|
|
19
|
+
return createElement(AgentWorkspaceContext.Provider, { value: { documentPreviewRenderers } }, children);
|
|
20
20
|
}
|
|
21
21
|
function AgentsPage(props) {
|
|
22
22
|
const workspaceConfiguration = useContext(AgentWorkspaceContext);
|
|
@@ -29,10 +29,13 @@ function AgentsPage(props) {
|
|
|
29
29
|
export {
|
|
30
30
|
AgentContextProvider,
|
|
31
31
|
AgentPanel,
|
|
32
|
+
AgentSurface,
|
|
32
33
|
AgentWorkspaceProvider,
|
|
33
34
|
agentContext,
|
|
34
35
|
AgentsPage as default,
|
|
36
|
+
handoffAgentSurfaceThread,
|
|
37
|
+
setAgentSurfaceMode,
|
|
35
38
|
useAgentContext
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
//# debugId=
|
|
41
|
+
//# debugId=F6514E745A4EB36964756E2164756E21
|
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 type AgentDocumentPreviewRenderer,\n type AgentDocumentPreviewRendererProps,\n type AgentFileRef,\n AgentPanel,\n type AgentPanelProps,\n useAgentContext,\n} from \"@sixb/agent-ui\"\
|
|
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 AgentSurface,\n type AgentSurfaceMode,\n type AgentSurfaceProps,\n handoffAgentSurfaceThread,\n setAgentSurfaceMode,\n useAgentContext,\n} from \"@sixb/agent-ui\"\nexport { agentContext } from \"@sixb/core/agents/context\"\n\nexport type AgentsPageProps = Omit<AgentChatPageProps, \"routeBase\">\n\ntype AgentWorkspaceConfiguration = Pick<AgentsPageProps, \"documentPreviewRenderers\">\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 documentPreviewRenderers,\n children,\n}: AgentWorkspaceProviderProps) {\n return createElement(\n AgentWorkspaceContext.Provider,\n { value: { 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;AAAA;AAAA;AAAA;AAcA;AAQA,IAAM,wBAAwB,cAA2C,CAAC,CAAC;AAGpE,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,GAC8B;AAAA,EAC9B,OAAO,cACL,sBAAsB,UACtB,EAAE,OAAO,EAAE,yBAAyB,EAAE,GACtC,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": "F6514E745A4EB36964756E2164756E21",
|
|
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.9",
|
|
4
4
|
"description": "Custom app toolkit for Sixb projects — route scanning, dev serving, and production builds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"prepack": "bun run build"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@sixb/agent-ui": "^0.1.
|
|
57
|
-
"@sixb/core": "^0.1.
|
|
56
|
+
"@sixb/agent-ui": "^0.1.9",
|
|
57
|
+
"@sixb/core": "^0.1.12",
|
|
58
58
|
"@sixb/ui": "^0.1.2",
|
|
59
59
|
"@tailwindcss/cli": "^4.2.2",
|
|
60
60
|
"tailwindcss": "^4.1.18"
|
package/src/agents.ts
CHANGED
|
@@ -8,17 +8,18 @@ export {
|
|
|
8
8
|
type AgentFileRef,
|
|
9
9
|
AgentPanel,
|
|
10
10
|
type AgentPanelProps,
|
|
11
|
+
AgentSurface,
|
|
12
|
+
type AgentSurfaceMode,
|
|
13
|
+
type AgentSurfaceProps,
|
|
14
|
+
handoffAgentSurfaceThread,
|
|
15
|
+
setAgentSurfaceMode,
|
|
11
16
|
useAgentContext,
|
|
12
17
|
} from "@sixb/agent-ui"
|
|
13
|
-
|
|
14
18
|
export { agentContext } from "@sixb/core/agents/context"
|
|
15
19
|
|
|
16
20
|
export type AgentsPageProps = Omit<AgentChatPageProps, "routeBase">
|
|
17
21
|
|
|
18
|
-
type AgentWorkspaceConfiguration = Pick<
|
|
19
|
-
AgentsPageProps,
|
|
20
|
-
"sidebarHeader" | "sidebarFooter" | "sidebarWidth" | "documentPreviewRenderers"
|
|
21
|
-
>
|
|
22
|
+
type AgentWorkspaceConfiguration = Pick<AgentsPageProps, "documentPreviewRenderers">
|
|
22
23
|
|
|
23
24
|
export type AgentWorkspaceProviderProps = PropsWithChildren<AgentWorkspaceConfiguration>
|
|
24
25
|
|
|
@@ -26,15 +27,12 @@ const AgentWorkspaceContext = createContext<AgentWorkspaceConfiguration>({})
|
|
|
26
27
|
|
|
27
28
|
/** Configure the framework-owned Agents routes, typically from `app/agents/layout.tsx`. */
|
|
28
29
|
export function AgentWorkspaceProvider({
|
|
29
|
-
sidebarHeader,
|
|
30
|
-
sidebarFooter,
|
|
31
|
-
sidebarWidth,
|
|
32
30
|
documentPreviewRenderers,
|
|
33
31
|
children,
|
|
34
32
|
}: AgentWorkspaceProviderProps) {
|
|
35
33
|
return createElement(
|
|
36
34
|
AgentWorkspaceContext.Provider,
|
|
37
|
-
{ value: {
|
|
35
|
+
{ value: { documentPreviewRenderers } },
|
|
38
36
|
children
|
|
39
37
|
)
|
|
40
38
|
}
|