@arbidocs/blocks 0.4.2 → 0.4.4
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 +42 -0
- package/dist/agents/definitions/AgentCreator.d.ts +11 -2
- package/dist/agents/definitions/index.d.ts +1 -0
- package/dist/agents/definitions/persona.d.ts +16 -0
- package/dist/agents/index.cjs +199 -146
- package/dist/agents/index.js +3 -2
- package/dist/agents/tasks/TaskRunsDialog.d.ts +15 -3
- package/dist/agents/tasks/index.d.ts +1 -0
- package/dist/agents/tasks/taskRequest.d.ts +61 -0
- package/dist/chat/AssistantDock.d.ts +39 -0
- package/dist/chat/ChatDocuments.d.ts +17 -0
- package/dist/chat/ChatPage.d.ts +16 -0
- package/dist/chat/ChatThreads.d.ts +28 -0
- package/dist/chat/chat-page-types.d.ts +121 -0
- package/dist/chat/chat-surface.d.ts +9 -0
- package/dist/chat/index.cjs +247 -205
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +4 -2
- package/dist/{chunk-OBLSURHV.js → chunk-2NNTQLBY.js} +3 -3
- package/dist/{chunk-OBLSURHV.js.map → chunk-2NNTQLBY.js.map} +1 -1
- package/dist/chunk-2VBJ763Y.js +296 -0
- package/dist/chunk-2VBJ763Y.js.map +1 -0
- package/dist/{chunk-2ORA62OF.js → chunk-67MKU5U7.js} +3 -3
- package/dist/{chunk-2ORA62OF.js.map → chunk-67MKU5U7.js.map} +1 -1
- package/dist/{chunk-AE5FHFZ5.cjs → chunk-6CHMNKXC.cjs} +6 -6
- package/dist/{chunk-AE5FHFZ5.cjs.map → chunk-6CHMNKXC.cjs.map} +1 -1
- package/dist/{chunk-TYZUCAT7.js → chunk-7YADKWZT.js} +43 -6
- package/dist/chunk-7YADKWZT.js.map +1 -0
- package/dist/chunk-ATXPAD6S.cjs +1952 -0
- package/dist/chunk-ATXPAD6S.cjs.map +1 -0
- package/dist/{chunk-YBXCZEWS.js → chunk-B673CCW5.js} +29 -6
- package/dist/chunk-B673CCW5.js.map +1 -0
- package/dist/{chunk-ITGHMJOM.js → chunk-BBEMPS6C.js} +169 -26
- package/dist/chunk-BBEMPS6C.js.map +1 -0
- package/dist/{chunk-XNBAXRY7.cjs → chunk-DGVKBOY5.cjs} +188 -32
- package/dist/chunk-DGVKBOY5.cjs.map +1 -0
- package/dist/{chunk-2K33YGM6.cjs → chunk-DN3NFNIA.cjs} +63 -294
- package/dist/chunk-DN3NFNIA.cjs.map +1 -0
- package/dist/{chunk-XQ7PKKDY.cjs → chunk-G4YOH5DU.cjs} +3 -3
- package/dist/{chunk-XQ7PKKDY.cjs.map → chunk-G4YOH5DU.cjs.map} +1 -1
- package/dist/{chunk-AXIZ2MDV.js → chunk-HER7MTRR.js} +3 -3
- package/dist/{chunk-AXIZ2MDV.js.map → chunk-HER7MTRR.js.map} +1 -1
- package/dist/{chunk-SYDHKKRZ.cjs → chunk-IZHWP6WQ.cjs} +47 -5
- package/dist/chunk-IZHWP6WQ.cjs.map +1 -0
- package/dist/chunk-JPO3F4J7.js +1899 -0
- package/dist/chunk-JPO3F4J7.js.map +1 -0
- package/dist/{chunk-WJMEXTVD.cjs → chunk-KDG6FER6.cjs} +28 -2
- package/dist/chunk-KDG6FER6.cjs.map +1 -0
- package/dist/chunk-KHX2BX3S.cjs +307 -0
- package/dist/chunk-KHX2BX3S.cjs.map +1 -0
- package/dist/{chunk-WTNMWEBC.js → chunk-NJL4LIXX.js} +4 -3
- package/dist/chunk-NJL4LIXX.js.map +1 -0
- package/dist/{chunk-J2BGSWXM.cjs → chunk-O637DUKS.cjs} +27 -27
- package/dist/{chunk-J2BGSWXM.cjs.map → chunk-O637DUKS.cjs.map} +1 -1
- package/dist/{chunk-WW6EOVZA.js → chunk-OXF2IFXG.js} +26 -3
- package/dist/chunk-OXF2IFXG.js.map +1 -0
- package/dist/{chunk-6HIPFEID.cjs → chunk-PBS5MFIY.cjs} +4 -4
- package/dist/{chunk-6HIPFEID.cjs.map → chunk-PBS5MFIY.cjs.map} +1 -1
- package/dist/{chunk-AZQDNYH4.js → chunk-RCP6THBS.js} +9 -1249
- package/dist/chunk-RCP6THBS.js.map +1 -0
- package/dist/{chunk-GDFWJ73C.cjs → chunk-RIL7G7AS.cjs} +4 -1286
- package/dist/chunk-RIL7G7AS.cjs.map +1 -0
- package/dist/{chunk-DREI7EQ2.cjs → chunk-SS23F63U.cjs} +9 -9
- package/dist/{chunk-DREI7EQ2.cjs.map → chunk-SS23F63U.cjs.map} +1 -1
- package/dist/{chunk-7PEELPMA.js → chunk-TI4UTYRL.js} +62 -285
- package/dist/chunk-TI4UTYRL.js.map +1 -0
- package/dist/{chunk-6P6AEQJB.js → chunk-WJZBJUPX.js} +4 -4
- package/dist/{chunk-6P6AEQJB.js.map → chunk-WJZBJUPX.js.map} +1 -1
- package/dist/{chunk-UFHMLHIR.cjs → chunk-XAJIKT6Y.cjs} +32 -11
- package/dist/chunk-XAJIKT6Y.cjs.map +1 -0
- package/dist/{chunk-G3G7LZPM.cjs → chunk-XKKGGUU2.cjs} +29 -3
- package/dist/chunk-XKKGGUU2.cjs.map +1 -0
- package/dist/{chunk-UWGIB3VQ.js → chunk-XNOASBGW.js} +33 -12
- package/dist/chunk-XNOASBGW.js.map +1 -0
- package/dist/{chunk-CTZ5745I.js → chunk-XQKGYGCJ.js} +3 -3
- package/dist/{chunk-CTZ5745I.js.map → chunk-XQKGYGCJ.js.map} +1 -1
- package/dist/{chunk-54Q3RNJU.cjs → chunk-ZVPTFTGV.cjs} +4 -3
- package/dist/chunk-ZVPTFTGV.cjs.map +1 -0
- package/dist/citations/index.cjs +11 -11
- package/dist/citations/index.js +2 -2
- package/dist/collaboration/contacts/AddContactsParts.d.ts +9 -4
- package/dist/collaboration/contacts/index.d.ts +1 -0
- package/dist/collaboration/contacts/parseEmails.d.ts +26 -0
- package/dist/collaboration/index.cjs +51 -31
- package/dist/collaboration/index.js +1 -1
- package/dist/components/MemberAvatarStack.d.ts +7 -2
- package/dist/connect/index.cjs +41 -12
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +3 -2
- package/dist/connect/index.js +20 -4
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectionProvider.d.ts +2 -0
- package/dist/connection/ai.d.ts +13 -1
- package/dist/connection/useConnectedShellWorkspaces.d.ts +15 -0
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +2 -2
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +4 -3
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +4 -3
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +18 -17
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +3 -2
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +824 -695
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts +31 -0
- package/dist/retrieval/index.cjs +36 -36
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +13 -11
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +13 -11
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/SplitLayout.d.ts +32 -0
- package/dist/shell/index.cjs +72 -68
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +2 -2
- package/dist/site/index.cjs +71 -71
- package/dist/site/index.js +3 -3
- package/dist/studio/index.cjs +79 -76
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +9 -6
- package/dist/studio/index.js.map +1 -1
- package/dist/workspaces/WorkspaceGallery.d.ts +42 -0
- package/dist/workspaces/index.cjs +74 -7
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +2 -0
- package/dist/workspaces/index.js +73 -7
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +3 -3
- package/src/blocks.css +10 -13
- package/dist/chunk-2K33YGM6.cjs.map +0 -1
- package/dist/chunk-54Q3RNJU.cjs.map +0 -1
- package/dist/chunk-7PEELPMA.js.map +0 -1
- package/dist/chunk-AZQDNYH4.js.map +0 -1
- package/dist/chunk-G3G7LZPM.cjs.map +0 -1
- package/dist/chunk-GDFWJ73C.cjs.map +0 -1
- package/dist/chunk-ITGHMJOM.js.map +0 -1
- package/dist/chunk-SCFYPAG6.cjs +0 -18
- package/dist/chunk-SCFYPAG6.cjs.map +0 -1
- package/dist/chunk-SYDHKKRZ.cjs.map +0 -1
- package/dist/chunk-TYZUCAT7.js.map +0 -1
- package/dist/chunk-UFHMLHIR.cjs.map +0 -1
- package/dist/chunk-UWGIB3VQ.js.map +0 -1
- package/dist/chunk-WJMEXTVD.cjs.map +0 -1
- package/dist/chunk-WTNMWEBC.js.map +0 -1
- package/dist/chunk-WW6EOVZA.js.map +0 -1
- package/dist/chunk-XNBAXRY7.cjs.map +0 -1
- package/dist/chunk-YBXCZEWS.js.map +0 -1
- package/dist/chunk-YDHO4AVL.js +0 -16
- package/dist/chunk-YDHO4AVL.js.map +0 -1
package/README.md
CHANGED
|
@@ -92,6 +92,27 @@ import { PassagePill } from '@arbidocs/blocks/citations'
|
|
|
92
92
|
through `testId` / `testIds`.
|
|
93
93
|
- Parts are not polymorphic: `asChild` exists only where a part documents it.
|
|
94
94
|
|
|
95
|
+
## Assistant chat page
|
|
96
|
+
|
|
97
|
+
`ChatPage` (`@arbidocs/blocks/chat`) is a whole assistant chat: conversations with auto-titles, markdown
|
|
98
|
+
answers, composer with a document chip and upload, empty, error and retry states, plus `header` and `aside`
|
|
99
|
+
(workflow launcher) slots. It sizes to its container, so it holds up beside an open dock. Bind it with the
|
|
100
|
+
`@arbidocs/react` hook:
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { ChatPage, useChatSurface } from '@arbidocs/blocks/chat'
|
|
104
|
+
import { useConnectedChat } from '@arbidocs/blocks/connect' // or useArbiChat({ workspaceId }) from @arbidocs/react
|
|
105
|
+
|
|
106
|
+
const chat = useConnectedChat()
|
|
107
|
+
<ChatPage chat={chat} header={<h2>Assistant</h2>} aside={<WorkflowLauncher … />} />
|
|
108
|
+
|
|
109
|
+
// The dock yields to a mounted page chat:
|
|
110
|
+
const { isDockAvailable } = useChatSurface()
|
|
111
|
+
{isDockAvailable && <MyDock />}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Theme the user bubble with `--chat-user-bubble` and `--chat-user-bubble-foreground` (HSL triplets).
|
|
115
|
+
|
|
95
116
|
## Editorial site parts
|
|
96
117
|
|
|
97
118
|
`@arbidocs/blocks/site` (and the root) carry the layout parts for static marketing pages:
|
|
@@ -114,6 +135,27 @@ import { EditorialHero, EditorialSection, PanelGrid, CtaBand } from '@arbidocs/b
|
|
|
114
135
|
See `examples/custom-ui/MarketingPage.tsx` for a full page and `docs/design/blocks-package.md` for
|
|
115
136
|
the part table.
|
|
116
137
|
|
|
138
|
+
## Workspaces: gallery and switcher in a few lines
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
import { WorkspaceGallery } from '@arbidocs/blocks/workspaces'
|
|
142
|
+
import { WorkspaceSwitcher } from '@arbidocs/blocks'
|
|
143
|
+
import { useConnectedShellWorkspaces } from '@arbidocs/blocks/connect'
|
|
144
|
+
|
|
145
|
+
const { items, active, recent, open, openingId } = useConnectedShellWorkspaces({
|
|
146
|
+
seed: { workspaces: demoWorkspaces, activeId: 'demo-1' }, // host data, shown only if the account has none
|
|
147
|
+
onOpened: () => navigate('/app/documents'), // runs after the workspace is selected
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
<WorkspaceSwitcher workspace={active} recent={recent} onSwitch={open} /* ... */ />
|
|
151
|
+
<WorkspaceGallery workspaces={items} currentId={active?.id} openingId={openingId} onOpen={open} />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Clicking any card, the current one too, selects the workspace and then navigates. Without a
|
|
155
|
+
connection layer use `useShellWorkspaces` from `@arbidocs/react` and pass your own list and `select`.
|
|
156
|
+
Small helpers for host copy: `formatCount(1, { one: 'document', other: 'documents' })` and
|
|
157
|
+
`displayName(user)` for greetings. See `examples/custom-ui/HomePage.tsx`.
|
|
158
|
+
|
|
117
159
|
## Workspace isolation
|
|
118
160
|
|
|
119
161
|
Blocks hold no keys and do no crypto. Parts take the data of one workspace and never merge data
|
|
@@ -52,6 +52,8 @@ export interface AgentCreatorLabels {
|
|
|
52
52
|
workspaceAccess: string;
|
|
53
53
|
workspaceAccessHint: string;
|
|
54
54
|
workspaceAlready: string;
|
|
55
|
+
/** Accessible name of the revoke button next to an already-granted workspace. */
|
|
56
|
+
revokeWorkspace: (workspaceName: string) => string;
|
|
55
57
|
noWorkspacesToGrant: string;
|
|
56
58
|
name: string;
|
|
57
59
|
nameHint: string;
|
|
@@ -94,8 +96,15 @@ export interface AgentCreatorProps {
|
|
|
94
96
|
id: string;
|
|
95
97
|
name: string;
|
|
96
98
|
}>;
|
|
97
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Workspaces the agent can already read: shown ticked and fixed. Without `onRevokeWorkspace`
|
|
101
|
+
* they cannot be undone here; with it each gets a remove button.
|
|
102
|
+
*/
|
|
98
103
|
grantedWorkspaceIds?: string[];
|
|
104
|
+
/** Take back a granted workspace (the host revokes, then refreshes `grantedWorkspaceIds`). */
|
|
105
|
+
onRevokeWorkspace?: (workspaceId: string) => void;
|
|
106
|
+
/** The workspace whose revoke is in flight; its button is disabled. */
|
|
107
|
+
revokingWorkspaceId?: string;
|
|
99
108
|
/** One-click avatar (or anything that sits beside the name). */
|
|
100
109
|
avatar?: ReactNode | ((values: AgentCreatorValues) => ReactNode);
|
|
101
110
|
types?: AgentTypeOption<string>[];
|
|
@@ -115,4 +124,4 @@ export interface AgentCreatorProps {
|
|
|
115
124
|
* capabilities, a live sentence says what the agent can and cannot do, and the knobs (capability
|
|
116
125
|
* toggles, model, type, avatar, pickers) are folded under Advanced.
|
|
117
126
|
*/
|
|
118
|
-
export declare function AgentCreator({ open, onOpenChange, isEdit, agentName, capabilities, templates, models, workspaces, grantedWorkspaceIds, avatar, types, values: valuesProp, initialValues, onValuesChange, advanced, isSaving, onSubmit, labels, testId, }: AgentCreatorProps): import("react").JSX.Element;
|
|
127
|
+
export declare function AgentCreator({ open, onOpenChange, isEdit, agentName, capabilities, templates, models, workspaces, grantedWorkspaceIds, onRevokeWorkspace, revokingWorkspaceId, avatar, types, values: valuesProp, initialValues, onValuesChange, advanced, isSaving, onSubmit, labels, testId, }: AgentCreatorProps): import("react").JSX.Element;
|
|
@@ -2,3 +2,4 @@ export { AgentCard, DEFAULT_AGENT_CARD_LABELS, type AgentCardProps, type AgentCa
|
|
|
2
2
|
export { AgentGallery, DEFAULT_AGENT_GALLERY_LABELS, type AgentGalleryProps, type AgentGalleryLabels, type AgentGalleryTestIds, } from './AgentGallery';
|
|
3
3
|
export { CapabilityTile, CapabilityGrid, AgentTypeSelector, AgentAvatarField, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AGENT_AVATAR_FIELD_LABELS, type AgentTypeSelectorLabels, type AgentAvatarFieldLabels, type AgentAvatarFieldTestIds, type CapabilityTileProps, type AgentTypeOption, type AgentTypeSelectorProps, type AgentAvatarFieldProps, } from './AgentEditorParts';
|
|
4
4
|
export { AgentCreator, DEFAULT_AGENT_CREATOR_LABELS, deriveAgentName, isValidAgentName, summarizeCapabilities, summarizeAgent, type AgentCreatorProps, type AgentCreatorLabels, type AgentCreatorValues, type AgentCapability, type AgentTemplate, } from './AgentCreator';
|
|
5
|
+
export { composePersona, stripPersonaPreamble, agentCreatorToConfigSection, agentConfigSectionToValues, } from './persona';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentCreatorValues } from './AgentCreator';
|
|
2
|
+
/**
|
|
3
|
+
* The saved persona tells the agent its own name: "You are Reviewer, an AI agent. <description>".
|
|
4
|
+
* {@link stripPersonaPreamble} takes the preamble off again so the editor shows only what the user wrote.
|
|
5
|
+
*/
|
|
6
|
+
export declare function composePersona(name: string, description: string): string;
|
|
7
|
+
/** The description the user wrote, without the preamble {@link composePersona} adds. */
|
|
8
|
+
export declare function stripPersonaPreamble(persona: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* The `Agents` config section an {@link AgentCreatorValues} form stands for: the persona, the model
|
|
11
|
+
* when one is picked, and one boolean per capability key. Pass it as `sections.Agents` to
|
|
12
|
+
* `useSaveAgentConfig` from `@arbidocs/react`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function agentCreatorToConfigSection(values: Pick<AgentCreatorValues, 'name' | 'persona' | 'modelName' | 'capabilities'>, capabilityKeys: string[]): Record<string, unknown>;
|
|
15
|
+
/** The form values an existing agent's `Agents` config section opens as (edit mode). */
|
|
16
|
+
export declare function agentConfigSectionToValues(section: Record<string, unknown> | undefined, capabilityKeys: string[]): Pick<AgentCreatorValues, 'persona' | 'modelName' | 'capabilities'>;
|