@athenaintel/react 0.16.3 → 0.18.0
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 +89 -51
- package/dist/AthenaContext-B1QMhIP-.cjs.map +1 -1
- package/dist/AthenaContext-MOslgOmE.js.map +1 -1
- package/dist/chat/statewire-banners.d.ts +5 -9
- package/dist/chat-ui/index.d.ts +3 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +24 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +5 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +1 -1
- package/dist/chat-ui/messages/continue-pill.d.ts +13 -0
- package/dist/chat-ui/messages/message-components.d.ts +7 -2
- package/dist/chat-ui/messages/runtime-message.d.ts +22 -0
- package/dist/chat-ui/messages/statewire-continue-run.d.ts +41 -0
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +1 -1
- package/dist/chat-ui.cjs +279 -56
- package/dist/chat-ui.cjs.map +1 -1
- package/dist/chat-ui.js +312 -89
- package/dist/chat-ui.js.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
- package/dist/diagnostics/errors.d.ts +0 -4
- package/dist/index.cjs +18866 -21879
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.js +18884 -21897
- package/dist/index.js.map +1 -1
- package/dist/lib/athena-urls.d.ts +0 -2
- package/dist/lib/posthog/wrap-posthog-client.d.ts +3 -1
- package/dist/provider/AthenaContext.d.ts +0 -7
- package/dist/provider/AthenaProvider.d.ts +25 -51
- package/dist/provider/config.d.ts +13 -12
- package/dist/provider/statewire-lifecycle-context.d.ts +3 -4
- package/dist/provider/types.d.ts +0 -1
- package/dist/runtime/auth.d.ts +37 -4
- package/dist/runtime/statewire-lifecycle.d.ts +0 -1
- package/dist/runtime/statewire-run-config.d.ts +18 -5
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +6 -11
- package/dist/styles.css +1 -1
- package/dist/threads/ThreadList.d.ts +6 -1
- package/dist/threads/statewire-thread-list.d.ts +6 -5
- package/dist/threads/thread-id-context.d.ts +9 -0
- package/dist/threads/use-statewire-conversation-history.d.ts +2 -0
- package/dist/threads/useAthenaThreadManager.d.ts +24 -12
- package/dist/{use-rest-conversation-history-BgG4VyZQ.js → use-rest-conversation-history-Bs5qn5G3.js} +7500 -6959
- package/dist/use-rest-conversation-history-Bs5qn5G3.js.map +1 -0
- package/dist/{use-rest-conversation-history-CMuTZmsp.cjs → use-rest-conversation-history-Dm0rdQgT.cjs} +7311 -6770
- package/dist/use-rest-conversation-history-Dm0rdQgT.cjs.map +1 -0
- package/package.json +3 -3
- package/dist/runtime/converter.d.ts +0 -5
- package/dist/runtime/external-message-converter.d.ts +0 -21
- package/dist/runtime/schemas.d.ts +0 -24
- package/dist/runtime/transport.d.ts +0 -37
- package/dist/runtime/useAthenaRuntime.d.ts +0 -47
- package/dist/threads/adapter.d.ts +0 -42
- package/dist/threads/useActiveThreadStateHydration.d.ts +0 -12
- package/dist/threads/useThreadTitlePolling.d.ts +0 -14
- package/dist/use-rest-conversation-history-BgG4VyZQ.js.map +0 -1
- package/dist/use-rest-conversation-history-CMuTZmsp.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -50,47 +50,37 @@ function App() {
|
|
|
50
50
|
</AthenaProvider>
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
`config` accepts `apiKey`, `token`, `apiUrl`, `backendUrl`, `appUrl`, `trustedParentOrigins`, `environment`, `
|
|
53
|
+
`config` accepts `apiKey`, `token`, `getToken`, `apiUrl`, `backendUrl`, `appUrl`, `statewireSyncUrl`, `trustedParentOrigins`, `environment`, `extraRunConfig`, and `posthog`. Top-level `apiKey`, `token`, `apiUrl`, `backendUrl`, `appUrl`, and `environment` props remain supported as compatibility aliases, but `config` is now the preferred API.
|
|
54
54
|
|
|
55
55
|
If `config.appUrl` is omitted, the provider resolves it from the parent bridge or from the matching Athena environment defaults. Known Athena staging and production `apiUrl` and `backendUrl` values automatically fall back to the corresponding frontend origin.
|
|
56
56
|
|
|
57
57
|
Use `trustedParentOrigins` when the SDK runs inside an iframe on a private-cloud or custom parent domain and you want to explicitly allow postMessage auth/config from that parent.
|
|
58
58
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
statewire sync host
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
The sync endpoint defaults to the effective `apiUrl` host + `/v2/threads`
|
|
86
|
-
(e.g. staging resolves to `https://iris.stg.athenaintel.com/v2/threads`, the
|
|
87
|
-
same statewire base the mobile app and Chrome extension ship); pass
|
|
88
|
-
`statewireSyncUrl` to override it for custom hosts whose sync mount lives on
|
|
89
|
-
a different origin. If neither yields a URL (e.g. an unparseable custom
|
|
90
|
-
`apiUrl`), the provider throws instead of falling back to an Athena default —
|
|
91
|
-
credentials are never sent to a host you didn't configure. Auth reuses the
|
|
92
|
-
provider's existing credential plumbing: tokens ride `Authorization: Bearer`
|
|
93
|
-
and API keys ride `X-API-KEY`.
|
|
59
|
+
## Transport (statewire only, as of 0.18.0)
|
|
60
|
+
|
|
61
|
+
The SDK speaks one chat transport: **statewire**. The provider attaches to the
|
|
62
|
+
deep-agent statewire sync host at `<statewireSyncUrl>/<threadId>`, so the
|
|
63
|
+
thread is hosted server-side and replicated live — history, reconnect, run
|
|
64
|
+
scheduling, mid-run queueing, HITL approvals, and client tools (for recognized
|
|
65
|
+
SDK hosts, e.g. computer-asset `app_id`s) all come from the server snapshot.
|
|
66
|
+
|
|
67
|
+
The legacy Iris `/api/chat` assistant-transport leg was deleted in 0.18.0
|
|
68
|
+
along with the `transport` prop — there is nothing to opt back onto. See
|
|
69
|
+
[Migrating from 0.17](#migrating-from-017).
|
|
70
|
+
|
|
71
|
+
The sync endpoint resolves in this order: an explicit `statewireSyncUrl`; the
|
|
72
|
+
`statewireSyncUrl` the host environment supplies (a Marathon-served computer
|
|
73
|
+
asset mints it from `/_athena/auth` alongside `backendBaseUrl`, the bare Agora
|
|
74
|
+
base — a trusted parent iframe can post the same fields); then the effective
|
|
75
|
+
`apiUrl` host + `/v2/threads` (e.g. staging resolves to
|
|
76
|
+
`https://iris.stg.athenaintel.com/v2/threads`, the same statewire base the
|
|
77
|
+
mobile app and Chrome extension ship). Pass `statewireSyncUrl` to pin a custom
|
|
78
|
+
host whose sync mount lives on a different origin. If nothing yields a URL
|
|
79
|
+
(e.g. an unparseable custom `apiUrl`), the provider throws instead of falling
|
|
80
|
+
back to an Athena default — credentials are never sent to a host you didn't
|
|
81
|
+
configure. Hosts that predate the minted statewire fields keep working through
|
|
82
|
+
the `apiUrl` derivation. Auth reuses the provider's existing credential
|
|
83
|
+
plumbing: tokens ride `Authorization: Bearer` and API keys ride `X-API-KEY`.
|
|
94
84
|
|
|
95
85
|
What the statewire transport wires up in `AthenaChat`:
|
|
96
86
|
|
|
@@ -109,17 +99,64 @@ What the statewire transport wires up in `AthenaChat`:
|
|
|
109
99
|
run's steer lane.
|
|
110
100
|
- **Errors and connection state:** transport errors (send rejections,
|
|
111
101
|
paywall refusals) render as a dismissible banner; a degraded connection
|
|
112
|
-
shows a reconnect strip; a
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
statewire session to the selected
|
|
117
|
-
`useAthenaThreadManager
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
`collab_agent:<asset_id>` refs (see below)
|
|
121
|
-
because the statewire host always runs the Athena deep agent.
|
|
122
|
-
|
|
102
|
+
shows a reconnect strip; a send into a thread created by the retired legacy
|
|
103
|
+
runtime is refused with a dismissible read-only notice (start a new chat).
|
|
104
|
+
Custom hosts can read all of it via `useAthenaStatewireLifecycle`.
|
|
105
|
+
- **Thread list:** `enableThreadList` provides the persisted Agora session
|
|
106
|
+
list; switching threads re-attaches the statewire session to the selected
|
|
107
|
+
thread. `ThreadList`, `useAthenaThreadManager`, and `useRefreshThreadList`
|
|
108
|
+
read that state (and render nothing / return `null` without it).
|
|
109
|
+
|
|
110
|
+
The `agent` prop only accepts `collab_agent:<asset_id>` refs (see below),
|
|
111
|
+
because the statewire host always runs the Athena deep agent. **Any other
|
|
112
|
+
non-blank value throws at first render** — it is a misconfiguration, and a
|
|
113
|
+
silently ignored selector would let a deployment answer as the wrong agent.
|
|
114
|
+
`model` defaults to the deep-agent default model (`DEFAULT_STATEWIRE_MODEL`)
|
|
115
|
+
unless a collab agent supplies one.
|
|
116
|
+
|
|
117
|
+
## Migrating from 0.17
|
|
118
|
+
|
|
119
|
+
0.18.0 deletes the legacy assistant-transport leg. Every Athena chat client
|
|
120
|
+
now speaks the native statewire wire, and the `TAG:JSON` transport over Iris
|
|
121
|
+
`/api/chat` is being removed server-side, so the SDK no longer offers it.
|
|
122
|
+
|
|
123
|
+
Removed from `<AthenaProvider>`:
|
|
124
|
+
|
|
125
|
+
- `transport` prop and `config.transport` — statewire is the only lane.
|
|
126
|
+
- `customToolConfigs` — it only ever reached the legacy leg (the deep-agent
|
|
127
|
+
runtime has no `custom_tool_configs` reader; MCP configuration is the parsed
|
|
128
|
+
`mcp_server_configs` key).
|
|
129
|
+
- `agent` no longer accepts named agents (`athena_assist_agent`, …). The only
|
|
130
|
+
accepted shape is `collab_agent:<asset_id>`; anything else throws with a
|
|
131
|
+
message naming the prop and the accepted shape. Omit the prop to run the
|
|
132
|
+
Athena deep agent. Validate ahead of time with `resolveAgentProp({ agent })`.
|
|
133
|
+
|
|
134
|
+
Removed exports:
|
|
135
|
+
|
|
136
|
+
- `useAthenaRuntime`, `AthenaRuntimeConfig`, `DEFAULT_API_URL`,
|
|
137
|
+
`DEFAULT_BACKEND_URL` — use `useAthenaStatewireRuntime` /
|
|
138
|
+
`buildStatewireRunConfig` for a custom chat surface.
|
|
139
|
+
- `ATHENA_TRANSPORTS`, `DEFAULT_ATHENA_TRANSPORT`, `resolveAthenaTransport`,
|
|
140
|
+
`allowsMidRunSend`, `AthenaTransport`, `ResolvedAthenaTransport`, and the
|
|
141
|
+
`transport` field on `AthenaConfig` (`useAthenaConfig()`).
|
|
142
|
+
- `convertLangChainToThreadMessages`, `autoCloseInFlightSubgraphMessages`,
|
|
143
|
+
`PTC_SUBCALL_DID_NOT_COMPLETE_MESSAGE` — the LangChain message converter
|
|
144
|
+
existed only for the legacy wire.
|
|
145
|
+
- `StatewireLegacyReadOnlyBanner` (rendered nothing since 0.17) and the
|
|
146
|
+
no-op `onLegacyReadOnly` option of `useAthenaStatewireRuntime`. The
|
|
147
|
+
residual `legacy_thread_read_only` 409 still surfaces through
|
|
148
|
+
`StatewireErrorBanner` / `useAthenaStatewireLifecycle`.
|
|
149
|
+
- `useAthenaThreadListAdapter` (the assistant-ui remote-thread-list adapter).
|
|
150
|
+
`useRefreshThreadList`, `useAthenaThreadId`, and `AthenaThreadIdContext`
|
|
151
|
+
remain and read the statewire thread-list state.
|
|
152
|
+
- Error codes `stream_failed` and `config_ignored`; diagnostics events
|
|
153
|
+
`stream.connected` and `stream.error`. `sdk.transport` still fires (always
|
|
154
|
+
`statewire`).
|
|
155
|
+
|
|
156
|
+
Unchanged: `apiUrl`/`backendUrl` (explicit, host-minted, or from
|
|
157
|
+
`environment`) — `apiUrl`'s origin still derives the statewire sync mount when
|
|
158
|
+
`statewireSyncUrl` is not set, and `backendUrl` is still the Agora REST base
|
|
159
|
+
for thread lists, uploads, and asset embeds.
|
|
123
160
|
|
|
124
161
|
## Collab Agents
|
|
125
162
|
|
|
@@ -129,7 +166,6 @@ the provider at one and the chat runs **as** that agent:
|
|
|
129
166
|
|
|
130
167
|
```tsx
|
|
131
168
|
<AthenaProvider
|
|
132
|
-
transport="statewire"
|
|
133
169
|
agent="collab_agent:asset_432af46f-293d-480b-a518-30b1f42a9ef7"
|
|
134
170
|
channel="askbob_web"
|
|
135
171
|
>
|
|
@@ -146,7 +182,10 @@ run the agent's base configuration.
|
|
|
146
182
|
|
|
147
183
|
### Requirements
|
|
148
184
|
|
|
149
|
-
-
|
|
185
|
+
- **The ref is the only accepted `agent` shape.** `collab_agent:<asset_id>`
|
|
186
|
+
selects the agent; omitting `agent` (or a blank string) runs the Athena deep
|
|
187
|
+
agent; any other value throws at render (`resolveAgentProp` is the same check,
|
|
188
|
+
exported for hosts that validate configuration up front).
|
|
150
189
|
- **Publish the agent.** Resolution reads the *published* snapshot, not the
|
|
151
190
|
live draft, so a channel that exists only in the editor is rejected with
|
|
152
191
|
`collab_agent_channel_unknown`.
|
|
@@ -163,7 +202,6 @@ returns a plausible answer using your config instead of theirs.
|
|
|
163
202
|
```tsx
|
|
164
203
|
// ❌ the agent's prompt, model, and tools are all discarded
|
|
165
204
|
<AthenaProvider
|
|
166
|
-
transport="statewire"
|
|
167
205
|
agent="collab_agent:asset_1234"
|
|
168
206
|
model="claude-opus-4-6"
|
|
169
207
|
systemPrompt="You are a helpful assistant."
|
|
@@ -171,7 +209,7 @@ returns a plausible answer using your config instead of theirs.
|
|
|
171
209
|
/>
|
|
172
210
|
|
|
173
211
|
// ✅ the agent's own configuration wins
|
|
174
|
-
<AthenaProvider
|
|
212
|
+
<AthenaProvider agent="collab_agent:asset_1234" />
|
|
175
213
|
```
|
|
176
214
|
|
|
177
215
|
Pass them only when you deliberately want to override the agent — an explicit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AthenaContext-B1QMhIP-.cjs","sources":["../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type {
|
|
1
|
+
{"version":3,"file":"AthenaContext-B1QMhIP-.cjs","sources":["../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":["createContext","useContext"],"mappings":";;AAYO,MAAM,gBAAgBA,MAAAA,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAMC,MAAAA,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AthenaContext-MOslgOmE.js","sources":["../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type {
|
|
1
|
+
{"version":3,"file":"AthenaContext-MOslgOmE.js","sources":["../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":[],"mappings":";AAYO,MAAM,gBAAgB,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAM,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Dismissible transport-error banner
|
|
4
|
-
* paywall refusals, and command
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Dismissible transport-error banner: send rejections (including the
|
|
4
|
+
* pre-cutover-thread dispatch fence's 409), paywall refusals, and command
|
|
5
|
+
* failures that would otherwise vanish into the console after the composer
|
|
6
|
+
* already cleared. Renders nothing outside `AthenaProvider`.
|
|
7
7
|
*/
|
|
8
8
|
export declare const StatewireErrorBanner: FC;
|
|
9
9
|
/**
|
|
10
10
|
* Degraded-connection strip: shown only while the statewire channel is
|
|
11
|
-
*
|
|
12
|
-
* transport exposes one. Healthy states render nothing.
|
|
11
|
+
* degraded, with a manual reconnect affordance when the transport exposes one.
|
|
13
12
|
*/
|
|
14
13
|
export declare const StatewireConnectionBanner: FC;
|
|
15
|
-
/** Read-only notice for pre-cutover threads whose history lives under the
|
|
16
|
-
* legacy runtime; the server fences dispatch into them. */
|
|
17
|
-
export declare const StatewireLegacyReadOnlyBanner: FC;
|
package/dist/chat-ui/index.d.ts
CHANGED
|
@@ -36,3 +36,6 @@ export { UserEditComposer } from "./messages/user-edit-composer";
|
|
|
36
36
|
export { MessageActionsReadOnlyProvider, useMessageActionsReadOnly, } from "./messages/message-actions-config";
|
|
37
37
|
export { TextShimmerLoader, ThreadRunningIndicator, } from "./messages/running-indicator";
|
|
38
38
|
export { SignInCard, SignInConsent, SignInFallbackSection, SignInSecondaryButton, SignInSelect, SignInTextField, } from "./auth/sign-in-card";
|
|
39
|
+
export { RuntimeMessageCard, type RuntimeMessageCardProps } from "./messages/runtime-message";
|
|
40
|
+
export { ContinuePill } from "./messages/continue-pill";
|
|
41
|
+
export { StatewireContinueRunAffordance, StatewireContinueRunButton, type StatewireContinueRunButtonProps, StatewireRunEndedFooter, type StatewireRunEndedFooterProps, } from "./messages/statewire-continue-run";
|
|
@@ -20,6 +20,30 @@ export declare function fetchGraphQL<T = any>(auth: MentionAuthContext, query: s
|
|
|
20
20
|
export declare const SIMPLE_SEARCH_QUERY = "\n query SimpleSearch($input: SimpleSearchRequestInput!) {\n simpleSearch(input: $input) {\n assets {\n \n id\n title\n athenaOriginalType\n athenaConvertedType\n parentFolderId\n updatedAt\n isFavorited\n isArchived\n isHidden\n\n }\n totalCount\n }\n }\n";
|
|
21
21
|
export declare const PAGINATED_ASSETS_QUERY = "\n query GetPaginatedAssetsForWorkspace(\n $limit: Int!\n $offset: Int!\n $parentFolderId: String\n $filterTypes: [String!]\n $filterColumns: ColumnFilter\n ) {\n getPaginatedAssetsForWorkspace(\n limit: $limit\n offset: $offset\n parentFolderId: $parentFolderId\n filterTypes: $filterTypes\n filterColumns: $filterColumns\n ) {\n \n id\n title\n athenaOriginalType\n athenaConvertedType\n parentFolderId\n updatedAt\n isFavorited\n isArchived\n isHidden\n\n }\n }\n";
|
|
22
22
|
export declare const WORKSPACE_MEMBERS_QUERY = "\n query GetUsersInWorkspace($workspaceId: String!) {\n getUsersInWorkspace(workspaceId: $workspaceId) {\n id\n email\n firstName\n lastName\n isAdmin\n avatarUrl\n }\n }\n";
|
|
23
|
+
export declare const TOOL_CATALOG_QUERY = "\n query MentionToolCatalog {\n getToolkitToToolsMapping {\n tools {\n id\n name\n description\n icon\n adminOnly\n isMentionable\n }\n toolkits {\n name\n displayName\n description\n icon\n onlyAdmin\n hideFromMenu\n isMentionable\n }\n }\n }\n";
|
|
24
|
+
export interface ToolCatalogTool {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string | null;
|
|
28
|
+
icon: string;
|
|
29
|
+
adminOnly: boolean;
|
|
30
|
+
isMentionable: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ToolCatalogToolkit {
|
|
33
|
+
name: string;
|
|
34
|
+
displayName: string;
|
|
35
|
+
description: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
onlyAdmin: boolean;
|
|
38
|
+
hideFromMenu: boolean;
|
|
39
|
+
isMentionable: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolCatalogResult {
|
|
42
|
+
getToolkitToToolsMapping: {
|
|
43
|
+
tools: ToolCatalogTool[];
|
|
44
|
+
toolkits: ToolCatalogToolkit[];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
23
47
|
export interface AssetResult {
|
|
24
48
|
id: string;
|
|
25
49
|
title: string | null;
|
|
@@ -49,6 +49,11 @@ export interface TeamConfig {
|
|
|
49
49
|
auth: MentionAuthContext;
|
|
50
50
|
}
|
|
51
51
|
export declare const fetchTeam: SourceFn<TeamConfig>;
|
|
52
|
+
export interface ToolCatalogConfig {
|
|
53
|
+
auth: MentionAuthContext;
|
|
54
|
+
}
|
|
55
|
+
export declare const fetchTools: SourceFn<ToolCatalogConfig>;
|
|
56
|
+
export declare const fetchToolkits: SourceFn<ToolCatalogConfig>;
|
|
52
57
|
export interface DrivesConfig {
|
|
53
58
|
auth: MentionAuthContext;
|
|
54
59
|
}
|
|
@@ -21,7 +21,7 @@ export type MentionSuggestionsStore = Store<MentionSuggestionsStoreState>;
|
|
|
21
21
|
/**
|
|
22
22
|
* All mention menu categories, in display order.
|
|
23
23
|
*/
|
|
24
|
-
export declare const ROOT_MENTION_CATEGORIES: readonly ["favorites", "assets", "projects", "browse_profiles", "folders", "team", "drives"];
|
|
24
|
+
export declare const ROOT_MENTION_CATEGORIES: readonly ["favorites", "assets", "projects", "browse_profiles", "folders", "tools", "toolkits", "team", "drives"];
|
|
25
25
|
export type MentionRootCategory = (typeof ROOT_MENTION_CATEGORIES)[number];
|
|
26
26
|
/**
|
|
27
27
|
* Creates a stable MentionSuggestionsStore.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FC } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Continue action for recoverable chat states.
|
|
4
|
+
*
|
|
5
|
+
* The dispatch waits for the exit animation to paint. If the owning runtime
|
|
6
|
+
* does not leave the recoverable state (for example, the command is rejected),
|
|
7
|
+
* the control resets so the user can try again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ContinuePill: FC<{
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
dataTestId?: string;
|
|
13
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ToolCallMessagePartComponent } from "@assistant-ui/react";
|
|
2
2
|
import "@assistant-ui/react-markdown/styles/dot.css";
|
|
3
|
-
import type
|
|
3
|
+
import { type ButtonHTMLAttributes, type FC, type ReactNode } from "react";
|
|
4
4
|
import type { ComposerAction } from "../composer/composer-action";
|
|
5
5
|
export declare function IconButton({ children, tooltip, className, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
6
|
tooltip: string;
|
|
@@ -22,12 +22,17 @@ export interface CreateAssistantMessageOptions {
|
|
|
22
22
|
* timelines supply their own; the default renders markdown and tool cards.
|
|
23
23
|
*/
|
|
24
24
|
content?: FC;
|
|
25
|
+
/**
|
|
26
|
+
* Inline affordance rendered inside a runtime-ending card (e.g. a Continue
|
|
27
|
+
* button). Hosts without one leave it unset.
|
|
28
|
+
*/
|
|
29
|
+
runtimeMessageAction?: ReactNode;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
32
|
* Builds the assistant bubble. Call this once per host (memoized on its
|
|
28
33
|
* inputs) so the returned component identity stays stable across renders.
|
|
29
34
|
*/
|
|
30
|
-
export declare function createAssistantMessage({ toolFallback, extraActions, content: Content, }: CreateAssistantMessageOptions): FC;
|
|
35
|
+
export declare function createAssistantMessage({ toolFallback, extraActions, content: Content, runtimeMessageAction, }: CreateAssistantMessageOptions): FC;
|
|
31
36
|
/** Panel chrome: the thread card and the header row that sits inside it. */
|
|
32
37
|
export declare const THREAD_PANEL_CLASS = "m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]";
|
|
33
38
|
export declare const THREAD_HEADER_CLASS = "flex items-center justify-between gap-2 px-3 py-2";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared DOM rendering for a runtime ending (see
|
|
3
|
+
* `@athenaintel/agent-runtime`'s `runtime-messages.ts`): the status row for a
|
|
4
|
+
* stop / pause / failure, and the banner that frames a handoff summary. Hosts
|
|
5
|
+
* that build their assistant row with `createAssistantMessage` get these for
|
|
6
|
+
* free; hosts with their own row (Olympus, mobile) render their own presenter
|
|
7
|
+
* from the same {@link AthenaRuntimeMessage} so the taxonomy cannot drift.
|
|
8
|
+
*/
|
|
9
|
+
import { type AthenaRuntimeMessage } from "@athenaintel/agent-runtime";
|
|
10
|
+
import type { FC, ReactNode } from "react";
|
|
11
|
+
export interface RuntimeMessageCardProps {
|
|
12
|
+
message: AthenaRuntimeMessage;
|
|
13
|
+
/** An inline affordance (e.g. a Continue button) rendered inside the card. */
|
|
14
|
+
action?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The status row for a runtime ending. For `stopped` / `paused` / `failed` it
|
|
19
|
+
* replaces the assistant bubble; for `handoff` it sits above the closing
|
|
20
|
+
* summary, which keeps rendering as ordinary prose.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RuntimeMessageCard: FC<RuntimeMessageCardProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
export interface StatewireContinueRunButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* Also offer Continue while the thread projects `ready`. An old snapshot
|
|
5
|
+
* can report a resting thread whose last persisted ending is still
|
|
6
|
+
* continuable; the marker row that mounts this button knows that.
|
|
7
|
+
*/
|
|
8
|
+
allowReadyFallback?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Dispatches the bare `run/continue` for the live Statewire thread — the
|
|
12
|
+
* heal-then-continue recovery for stopped, errored, and pod-drained runs. The
|
|
13
|
+
* command is exactly what the library's `onResume` emits, so it inherits the
|
|
14
|
+
* optimistic running-flip (the pill unmounts once the dispatch is accepted)
|
|
15
|
+
* and routes rejections to the runtime's shared `onError` policy.
|
|
16
|
+
*
|
|
17
|
+
* Requires `capabilities.continue` on the host thread and a statewire aui
|
|
18
|
+
* scope (throws outside one, like every `useStatewire*` hook).
|
|
19
|
+
*/
|
|
20
|
+
export declare function StatewireContinueRunButton({ allowReadyFallback, }?: StatewireContinueRunButtonProps): ReactElement | null;
|
|
21
|
+
/**
|
|
22
|
+
* Recovery affordance for the latest persisted stopped/failed run marker,
|
|
23
|
+
* for the `runtimeMessageAction` slot of `createAssistantMessage`.
|
|
24
|
+
*
|
|
25
|
+
* Marker messages remain in history forever, so only the current last message
|
|
26
|
+
* may continue. The extras guard keeps Statewire hooks out of read-only or
|
|
27
|
+
* legacy runtimes where they would throw.
|
|
28
|
+
*/
|
|
29
|
+
export declare function StatewireContinueRunAffordance(): ReactElement | null;
|
|
30
|
+
export interface StatewireRunEndedFooterProps {
|
|
31
|
+
/** Merged onto the recovery card's default classes. */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Recovery row for a settled run whose persisted ending is no longer the
|
|
36
|
+
* transcript tail — rendered after the messages (`renderMessages`). Rewinds,
|
|
37
|
+
* compaction, and older snapshots can all leave the durable run state
|
|
38
|
+
* recoverable without a marker row that owns the action. Renders nothing on
|
|
39
|
+
* legacy (non-statewire) threads.
|
|
40
|
+
*/
|
|
41
|
+
export declare function StatewireRunEndedFooter({ className, }?: StatewireRunEndedFooterProps): ReactElement | null;
|
|
@@ -23,7 +23,7 @@ export interface ChatComposerDockProps {
|
|
|
23
23
|
editor: ReactNode;
|
|
24
24
|
/** Toolbar contents before the spacer (attach buttons, pickers). */
|
|
25
25
|
toolbarStart?: ReactNode;
|
|
26
|
-
/** Toolbar contents after the spacer (voice
|
|
26
|
+
/** Toolbar contents after the spacer (voice and send/stop controls). */
|
|
27
27
|
toolbarEnd: ReactNode;
|
|
28
28
|
}
|
|
29
29
|
/**
|