@athenaintel/react 0.17.0 → 0.19.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 +179 -43
- package/dist/AthenaContext-B1QMhIP-.cjs.map +1 -1
- package/dist/AthenaContext-MOslgOmE.js.map +1 -1
- package/dist/SuperGroupingCard-BsWbHyV_.js +795 -0
- package/dist/SuperGroupingCard-BsWbHyV_.js.map +1 -0
- package/dist/SuperGroupingCard-CRRFUgjN.cjs +794 -0
- package/dist/SuperGroupingCard-CRRFUgjN.cjs.map +1 -0
- package/dist/chat/StatewireApprovalCard.d.ts +59 -2
- package/dist/chat/StatewireClientToolBridge.d.ts +3 -3
- package/dist/chat/StatewireQueuedMessages.d.ts +105 -6
- package/dist/chat/statewire-approval.d.ts +1 -1
- package/dist/chat/statewire-banners.d.ts +5 -9
- package/dist/chat/statewire-client-tools.d.ts +15 -21
- package/dist/chat/super-grouping/CollapsibleGroup.d.ts +52 -11
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +78 -21
- package/dist/chat/super-grouping/activity-timeline.d.ts +91 -0
- package/dist/chat/super-grouping/grouping-function.d.ts +13 -10
- package/dist/chat/super-grouping/index.d.ts +12 -0
- package/dist/chat/super-grouping/toolkit-map.d.ts +8 -1
- package/dist/chat/use-statewire-approval-request.d.ts +44 -0
- package/dist/chat-ui/header/conversation-history-panel.d.ts +11 -1
- package/dist/chat-ui/index.d.ts +9 -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/mentions/suggestions/shims.d.ts +0 -4
- 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 +21 -0
- package/dist/chat-ui/messages/statewire-continue-run.d.ts +82 -0
- package/dist/chat-ui/messages/user-edit-composer.d.ts +5 -2
- package/dist/chat-ui/statewire.d.ts +19 -0
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +7 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +52 -0
- package/dist/chat-ui-statewire.cjs +25 -0
- package/dist/chat-ui-statewire.cjs.map +1 -0
- package/dist/chat-ui-statewire.js +25 -0
- package/dist/chat-ui-statewire.js.map +1 -0
- package/dist/chat-ui.cjs +292 -252
- package/dist/chat-ui.cjs.map +1 -1
- package/dist/chat-ui.js +289 -248
- package/dist/chat-ui.js.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
- package/dist/diagnostics/errors.d.ts +4 -4
- package/dist/index.cjs +20237 -26233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -14
- package/dist/index.js +18465 -24458
- 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/misc-tool-uis-B2e0Okkn.cjs +43 -0
- package/dist/misc-tool-uis-B2e0Okkn.cjs.map +1 -0
- package/dist/misc-tool-uis-gAiQw0Yl.js +44 -0
- package/dist/misc-tool-uis-gAiQw0Yl.js.map +1 -0
- package/dist/provider/AthenaContext.d.ts +0 -7
- package/dist/provider/AthenaProvider.d.ts +28 -52
- package/dist/provider/config.d.ts +19 -15
- package/dist/provider/statewire-lifecycle-context.d.ts +3 -4
- package/dist/provider/statewire-window-context.d.ts +12 -0
- package/dist/provider/types.d.ts +0 -1
- package/dist/runtime/statewire-auth-headers.d.ts +38 -0
- package/dist/runtime/statewire-lifecycle.d.ts +25 -1
- package/dist/runtime/statewire-run-config.d.ts +18 -5
- package/dist/runtime/statewire-session-key.d.ts +13 -0
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +42 -16
- package/dist/statewire-continue-run-D34gS7_1.js +132 -0
- package/dist/statewire-continue-run-D34gS7_1.js.map +1 -0
- package/dist/statewire-continue-run-nE9VCKUh.cjs +131 -0
- package/dist/statewire-continue-run-nE9VCKUh.cjs.map +1 -0
- package/dist/statewire-history-edge-C8uyTEjX.cjs +1711 -0
- package/dist/statewire-history-edge-C8uyTEjX.cjs.map +1 -0
- package/dist/statewire-history-edge-CPohUKMt.js +1712 -0
- package/dist/statewire-history-edge-CPohUKMt.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/super-grouping.cjs +22 -0
- package/dist/super-grouping.cjs.map +1 -0
- package/dist/super-grouping.js +22 -0
- package/dist/super-grouping.js.map +1 -0
- package/dist/threads/ThreadList.d.ts +6 -1
- package/dist/threads/mint-thread-id.d.ts +8 -0
- package/dist/threads/statewire-thread-list.d.ts +26 -9
- 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/tool-fallback-DkQ3DLkn.js +4281 -0
- package/dist/tool-fallback-DkQ3DLkn.js.map +1 -0
- package/dist/tool-fallback-kfhpJQZa.cjs +4297 -0
- package/dist/tool-fallback-kfhpJQZa.cjs.map +1 -0
- package/dist/tools/index.d.ts +14 -0
- package/dist/tools/misc-tool-uis.d.ts +2 -0
- package/dist/tools/primitives.d.ts +41 -0
- package/dist/tools/tool-fallback.d.ts +78 -6
- package/dist/tools/tool-icons.d.ts +10 -0
- package/dist/tools/tool-uis.d.ts +1 -23
- package/dist/tools.cjs +41 -0
- package/dist/tools.cjs.map +1 -0
- package/dist/tools.js +41 -0
- package/dist/tools.js.map +1 -0
- package/dist/trash-2-B5OaNAL7.cjs +5096 -0
- package/dist/trash-2-B5OaNAL7.cjs.map +1 -0
- package/dist/trash-2-CCwSURL-.js +5081 -0
- package/dist/trash-2-CCwSURL-.js.map +1 -0
- package/dist/{use-rest-conversation-history-BdnG8jEP.cjs → use-rest-conversation-history-Cm8qMRxp.cjs} +985 -5405
- package/dist/use-rest-conversation-history-Cm8qMRxp.cjs.map +1 -0
- package/dist/{use-rest-conversation-history-DpEswBqQ.js → use-rest-conversation-history-veDZS-oL.js} +1035 -5455
- package/dist/use-rest-conversation-history-veDZS-oL.js.map +1 -0
- package/dist/wrench-BEf72cyP.cjs +417 -0
- package/dist/wrench-BEf72cyP.cjs.map +1 -0
- package/dist/wrench-CbrOlVYm.js +418 -0
- package/dist/wrench-CbrOlVYm.js.map +1 -0
- package/dist/x-Dfd2NzK0.cjs +42 -0
- package/dist/x-Dfd2NzK0.cjs.map +1 -0
- package/dist/x-_DntAa_a.js +43 -0
- package/dist/x-_DntAa_a.js.map +1 -0
- package/package.json +29 -11
- package/dist/chat/super-grouping/tool-status-labels.d.ts +0 -1
- 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 -39
- 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-BdnG8jEP.cjs.map +0 -1
- package/dist/use-rest-conversation-history-DpEswBqQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -50,37 +50,23 @@ 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
|
-
##
|
|
59
|
+
## Transport (statewire only, as of 0.18.0)
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
statewire sync host
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
back onto the legacy Iris `/api/chat` stream:
|
|
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.
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</AthenaProvider>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Migrating from ≤0.11.x (legacy default):**
|
|
75
|
-
|
|
76
|
-
- Threads are transport-scoped: conversations created on the legacy transport
|
|
77
|
-
are read-only from statewire (and vice versa). Users keep their history but
|
|
78
|
-
continue in new threads.
|
|
79
|
-
- The statewire runtime applies the deep-agent model default when no `model`
|
|
80
|
-
prop is set; pin `model` explicitly if you depended on the legacy default.
|
|
81
|
-
- The `agent` prop's legacy agent names are not honored on statewire; use
|
|
82
|
-
`collab_agent:<id>` refs (with `transport: 'statewire'` semantics) or the
|
|
83
|
-
default agent.
|
|
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).
|
|
84
70
|
|
|
85
71
|
The sync endpoint resolves in this order: an explicit `statewireSyncUrl`; the
|
|
86
72
|
`statewireSyncUrl` the host environment supplies (a Marathon-served computer
|
|
@@ -95,6 +81,11 @@ back to an Athena default — credentials are never sent to a host you didn't
|
|
|
95
81
|
configure. Hosts that predate the minted statewire fields keep working through
|
|
96
82
|
the `apiUrl` derivation. Auth reuses the provider's existing credential
|
|
97
83
|
plumbing: tokens ride `Authorization: Bearer` and API keys ride `X-API-KEY`.
|
|
84
|
+
A `getToken` resolver is called with `{ force: true }` right after the sync
|
|
85
|
+
host refuses a credential, so a caching getter must mint a fresh token then;
|
|
86
|
+
the persisted command lane is scoped to the signed-in user as well as the
|
|
87
|
+
host, so a shared browser never resends one user's pending sends under the
|
|
88
|
+
next user's token.
|
|
98
89
|
|
|
99
90
|
What the statewire transport wires up in `AthenaChat`:
|
|
100
91
|
|
|
@@ -103,27 +94,171 @@ What the statewire transport wires up in `AthenaChat`:
|
|
|
103
94
|
(or Continue for a generic pause) and resumes the run through the statewire
|
|
104
95
|
`run/input` command. Hosts that build their own thread UI should mount the
|
|
105
96
|
exported `StatewireApprovalCard` themselves — without it an approval-gated
|
|
106
|
-
run stays parked with no way to answer it.
|
|
97
|
+
run stays parked with no way to answer it. Its `renderDetails`,
|
|
98
|
+
`isHandledElsewhere`, and `readOnly` seams take host-specific review UIs,
|
|
99
|
+
requests another surface answers, and viewers without edit rights; the
|
|
100
|
+
headless `useStatewireApprovalRequest` behind it is exported for hosts with
|
|
101
|
+
their own decision UI.
|
|
107
102
|
- **Frontend tools:** tools in `frontendTools` with a local `execute` are
|
|
108
103
|
declared to the backend as `client_tools` and executed by the mounted
|
|
109
104
|
client-tool bridge, which resumes the run with each tool's result.
|
|
110
105
|
- **Mid-run sends and the queue:** a message sent while a run is active
|
|
111
|
-
queues on the server. The queue panel above the composer
|
|
112
|
-
entries with remove
|
|
113
|
-
run
|
|
106
|
+
queues on the server. The queue panel above the composer
|
|
107
|
+
(`StatewireQueuedMessages`) lists queued entries with remove, "Send now"
|
|
108
|
+
(steer), Prioritize (`run/prioritize`), inline edit, and failed sends with
|
|
109
|
+
Retry/Discard, plus Continue for a stopped run's queue head; hosts can opt
|
|
110
|
+
into `autoContinue` for stranded queues and slot their own row renderer and
|
|
111
|
+
editor.
|
|
112
|
+
- **Lean entries for hosts with their own composer:** `@athenaintel/react/chat-ui/statewire`
|
|
113
|
+
exports just the approval card, the queue tray, and the continue/run-ended
|
|
114
|
+
affordances (plus the runtime-message card and Continue pill they render),
|
|
115
|
+
and `@athenaintel/react/tools` exports the generic `ToolFallback` card with
|
|
116
|
+
its primitives (`ToolCard`, `ExpandableSection`, `NestedPtcMessages`) — so a
|
|
117
|
+
host that already ships its own composer and mention stack (Olympus) never
|
|
118
|
+
pulls the SDK's Tiptap graph into its build. Tool names, icons, categories,
|
|
119
|
+
and running copy come from the shared registry in
|
|
120
|
+
`@athenaintel/agent-runtime` (`getToolDisplayMeta`), and success/failure from
|
|
121
|
+
its `classifyToolResult`; the fallback takes host seams (`displayName`,
|
|
122
|
+
`icon`, `extraAction`, `notice`, `renderResult`, `onOpenAsset`,
|
|
123
|
+
`hideInternalIdArgs`) instead of being copied. `@athenaintel/react/super-grouping`
|
|
124
|
+
exports the grouped ("conversational") view of an assistant turn —
|
|
125
|
+
`SuperGroupingCard`, `SuperGroupingFinalText`, `CollapsibleGroup`, the
|
|
126
|
+
activity-timeline derivation, and the tool-based grouping function — with
|
|
127
|
+
slots for the host's text/tool renderers and controls (`renderHeaderActions`,
|
|
128
|
+
`renderRunningMeta`, `summaryDetails`, `waitingTools`, `expansionKey`), so
|
|
129
|
+
Olympus and the Chrome extension mount one card instead of copies.
|
|
130
|
+
- **Olympus consumes the package, not the source.** `@athenaintel/react` is a
|
|
131
|
+
workspace dependency of Olympus, resolved through this package's `exports`
|
|
132
|
+
to the built `dist/` (the guarded `prepare` script builds it on a cold
|
|
133
|
+
`bun install`; `olympus/scripts/prepare-react-sdk.ts` rebuilds it before
|
|
134
|
+
`bun run ts` when sources changed; `scripts/typecheck-all.ts` emits the
|
|
135
|
+
declarations before the repo typecheck). While editing the SDK against a
|
|
136
|
+
running Olympus, run `bun run dev` here so the dist follows your edits. The
|
|
137
|
+
Chrome extension and Office add-in still alias the entries to source.
|
|
114
138
|
- **Errors and connection state:** transport errors (send rejections,
|
|
115
139
|
paywall refusals) render as a dismissible banner; a degraded connection
|
|
116
|
-
shows a reconnect strip; a
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
statewire session to the selected
|
|
121
|
-
`useAthenaThreadManager
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`collab_agent:<asset_id>` refs (see below)
|
|
125
|
-
because the statewire host always runs the Athena deep agent.
|
|
126
|
-
|
|
140
|
+
shows a reconnect strip; a send into a thread created by the retired legacy
|
|
141
|
+
runtime is refused with a dismissible read-only notice (start a new chat).
|
|
142
|
+
Custom hosts can read all of it via `useAthenaStatewireLifecycle`.
|
|
143
|
+
- **Thread list:** `enableThreadList` provides the persisted Agora session
|
|
144
|
+
list; switching threads re-attaches the statewire session to the selected
|
|
145
|
+
thread. `ThreadList`, `useAthenaThreadManager`, and `useRefreshThreadList`
|
|
146
|
+
read that state (and render nothing / return `null` without it).
|
|
147
|
+
|
|
148
|
+
The `agent` prop only accepts `collab_agent:<asset_id>` refs (see below),
|
|
149
|
+
because the statewire host always runs the Athena deep agent. **Any other
|
|
150
|
+
non-blank value throws at first render** — it is a misconfiguration, and a
|
|
151
|
+
silently ignored selector would let a deployment answer as the wrong agent.
|
|
152
|
+
`model` defaults to the deep-agent default model (`DEFAULT_STATEWIRE_MODEL`)
|
|
153
|
+
unless a collab agent supplies one.
|
|
154
|
+
|
|
155
|
+
## What's new in 0.19.0
|
|
156
|
+
|
|
157
|
+
0.19.0 is a minor release with **no breaking changes**: every export that
|
|
158
|
+
shipped in 0.18.0 is still exported under the same name from the same entry,
|
|
159
|
+
and `<AthenaProvider>` / `<AthenaChat>` accept the same props. Bump the pin
|
|
160
|
+
and re-install; there is nothing to migrate.
|
|
161
|
+
|
|
162
|
+
- **Windowed history on every surface.** Each attach now declares a message
|
|
163
|
+
window (`ATHENA_SDK_MESSAGE_WINDOW`, 40 messages, sent as the
|
|
164
|
+
`x-athena-deep-agent-window` hello), so a long thread's first snapshot
|
|
165
|
+
carries the transcript's tail instead of every message. `<AthenaChat>`
|
|
166
|
+
mounts the new `StatewireHistoryEdge` row above the messages — "N earlier
|
|
167
|
+
messages", paged in as you scroll near the top (or on click) while the
|
|
168
|
+
reading position is kept — and cut tool outputs are fetched back for the
|
|
169
|
+
cards that show them. Hosts composing their own thread mount
|
|
170
|
+
`StatewireHistoryEdge` in `ChatThreadShell`'s `beforeMessages` slot (also
|
|
171
|
+
exported from `@athenaintel/react/chat-ui` and `/chat-ui/statewire`) and
|
|
172
|
+
read the tool-output store through `useStatewireToolOutputs`. Editing a
|
|
173
|
+
message below the loaded window resubmits with an anchored `run/edit`.
|
|
174
|
+
- **One approval card, queue tray, and continue affordance.**
|
|
175
|
+
`StatewireApprovalCard` (`renderDetails`, `isHandledElsewhere`, `readOnly`),
|
|
176
|
+
`StatewireQueuedMessages` (`renderContent`, `renderEditor`, `autoContinue`,
|
|
177
|
+
`onEvent`), and the continue / run-ended affordances are the single
|
|
178
|
+
implementations Olympus, the Chrome extension, and the Office add-in mount;
|
|
179
|
+
the headless `useStatewireApprovalRequest` and `HITL_PENDING_RESUME_GRACE_MS`
|
|
180
|
+
are exported for hosts with their own decision UI. New lean entry:
|
|
181
|
+
`@athenaintel/react/chat-ui/statewire`.
|
|
182
|
+
- **One tool display registry, result classifier, and fallback.**
|
|
183
|
+
`getToolDisplayMeta`, `classifyToolResult`, `isToolResultSuccess`,
|
|
184
|
+
`describeToolArgs`, `resultMessage`, `toolActiveLabel`, `toolCompletedLabel`
|
|
185
|
+
(re-exported from `@athenaintel/agent-runtime`), `TOOL_ICONS` / `toolIcon`,
|
|
186
|
+
the `ToolFallback` host seams (`ToolFallbackNotice`, `ToolFallbackOptions`,
|
|
187
|
+
`ToolFallbackContext`, …), `CopyToolSpecButton`, `InstallPackageToolUI`,
|
|
188
|
+
and `NestedPtcComponentsProvider` / `useNestedPtcComponents`. New lean
|
|
189
|
+
entry: `@athenaintel/react/tools`.
|
|
190
|
+
- **Grouped activity card and timeline.** `SuperGroupingCard`,
|
|
191
|
+
`SuperGroupingFinalText`, `SuperGroupingProvider`, `CollapsibleGroup`,
|
|
192
|
+
`buildActivityTimeline`, `useActivityExpansion`,
|
|
193
|
+
`createToolBasedGroupingFunction`, `TOOLKIT_THEMES`, and their types are
|
|
194
|
+
exported; `<AthenaChat groupToolCalls>` renders through them. New lean
|
|
195
|
+
entry: `@athenaintel/react/super-grouping`.
|
|
196
|
+
- **`rejected` is a first-class tool-result state.** A gated tool call the
|
|
197
|
+
user refused classifies as `{ state: 'rejected' }` (`ToolResultClassification`)
|
|
198
|
+
instead of an error, and reads as rejected on the tool card and in the
|
|
199
|
+
grouped timeline.
|
|
200
|
+
- **Diagnostics instead of console noise.** Composer, tool-UI, and mention
|
|
201
|
+
failures now emit `composer.attachment.error`, `composer.cancel.error`,
|
|
202
|
+
`tools.schema.warning`, `tools.debug`, and `mentions.fetch.error` on the
|
|
203
|
+
diagnostics bus (`onDiagnostic` / `onError`, `__ATHENA_SDK__.diagnostics`)
|
|
204
|
+
rather than through `console.*`.
|
|
205
|
+
- **`config.getToken` may be called with `{ force: true }`**
|
|
206
|
+
(`AthenaStatewireTokenGetter`) right after the statewire host refused the
|
|
207
|
+
previous credential; a getter that caches should mint a fresh token then.
|
|
208
|
+
Existing zero-argument getters keep working unchanged.
|
|
209
|
+
- **Dependencies.** The assistant-ui family is pinned exactly on one release
|
|
210
|
+
train (`@assistant-ui/react` 0.15.17, `@assistant-ui/react-statewire`
|
|
211
|
+
0.24.0, `assistant-stream` 0.3.41, `statewire` 0.14.0); the SDK's internal
|
|
212
|
+
`zod` moved to v4 (it is not part of the public types).
|
|
213
|
+
|
|
214
|
+
Moved, not renamed: `ToolCard`, `ExpandableSection`, `normalizeResult`,
|
|
215
|
+
`truncate`, `formatToolName`, and `ToolStatus` now live in the tool
|
|
216
|
+
primitives module and are exported from both `@athenaintel/react` (as before)
|
|
217
|
+
and `@athenaintel/react/tools`.
|
|
218
|
+
|
|
219
|
+
## Migrating from 0.17
|
|
220
|
+
|
|
221
|
+
0.18.0 deletes the legacy assistant-transport leg. Every Athena chat client
|
|
222
|
+
now speaks the native statewire wire, and the `TAG:JSON` transport over Iris
|
|
223
|
+
`/api/chat` is being removed server-side, so the SDK no longer offers it.
|
|
224
|
+
|
|
225
|
+
Removed from `<AthenaProvider>`:
|
|
226
|
+
|
|
227
|
+
- `transport` prop and `config.transport` — statewire is the only lane.
|
|
228
|
+
- `customToolConfigs` — it only ever reached the legacy leg (the deep-agent
|
|
229
|
+
runtime has no `custom_tool_configs` reader; MCP configuration is the parsed
|
|
230
|
+
`mcp_server_configs` key).
|
|
231
|
+
- `agent` no longer accepts named agents (`athena_assist_agent`, …). The only
|
|
232
|
+
accepted shape is `collab_agent:<asset_id>`; anything else throws with a
|
|
233
|
+
message naming the prop and the accepted shape. Omit the prop to run the
|
|
234
|
+
Athena deep agent. Validate ahead of time with `resolveAgentProp({ agent })`.
|
|
235
|
+
|
|
236
|
+
Removed exports:
|
|
237
|
+
|
|
238
|
+
- `useAthenaRuntime`, `AthenaRuntimeConfig`, `DEFAULT_API_URL`,
|
|
239
|
+
`DEFAULT_BACKEND_URL` — use `useAthenaStatewireRuntime` /
|
|
240
|
+
`buildStatewireRunConfig` for a custom chat surface.
|
|
241
|
+
- `ATHENA_TRANSPORTS`, `DEFAULT_ATHENA_TRANSPORT`, `resolveAthenaTransport`,
|
|
242
|
+
`allowsMidRunSend`, `AthenaTransport`, `ResolvedAthenaTransport`, and the
|
|
243
|
+
`transport` field on `AthenaConfig` (`useAthenaConfig()`).
|
|
244
|
+
- `convertLangChainToThreadMessages`, `autoCloseInFlightSubgraphMessages`,
|
|
245
|
+
`PTC_SUBCALL_DID_NOT_COMPLETE_MESSAGE` — the LangChain message converter
|
|
246
|
+
existed only for the legacy wire.
|
|
247
|
+
- `StatewireLegacyReadOnlyBanner` (rendered nothing since 0.17) and the
|
|
248
|
+
no-op `onLegacyReadOnly` option of `useAthenaStatewireRuntime`. The
|
|
249
|
+
residual `legacy_thread_read_only` 409 still surfaces through
|
|
250
|
+
`StatewireErrorBanner` / `useAthenaStatewireLifecycle`.
|
|
251
|
+
- `useAthenaThreadListAdapter` (the assistant-ui remote-thread-list adapter).
|
|
252
|
+
`useRefreshThreadList`, `useAthenaThreadId`, and `AthenaThreadIdContext`
|
|
253
|
+
remain and read the statewire thread-list state.
|
|
254
|
+
- Error codes `stream_failed` and `config_ignored`; diagnostics events
|
|
255
|
+
`stream.connected` and `stream.error`. `sdk.transport` still fires (always
|
|
256
|
+
`statewire`).
|
|
257
|
+
|
|
258
|
+
Unchanged: `apiUrl`/`backendUrl` (explicit, host-minted, or from
|
|
259
|
+
`environment`) — `apiUrl`'s origin still derives the statewire sync mount when
|
|
260
|
+
`statewireSyncUrl` is not set, and `backendUrl` is still the Agora REST base
|
|
261
|
+
for thread lists, uploads, and asset embeds.
|
|
127
262
|
|
|
128
263
|
## Collab Agents
|
|
129
264
|
|
|
@@ -133,7 +268,6 @@ the provider at one and the chat runs **as** that agent:
|
|
|
133
268
|
|
|
134
269
|
```tsx
|
|
135
270
|
<AthenaProvider
|
|
136
|
-
transport="statewire"
|
|
137
271
|
agent="collab_agent:asset_432af46f-293d-480b-a518-30b1f42a9ef7"
|
|
138
272
|
channel="askbob_web"
|
|
139
273
|
>
|
|
@@ -150,7 +284,10 @@ run the agent's base configuration.
|
|
|
150
284
|
|
|
151
285
|
### Requirements
|
|
152
286
|
|
|
153
|
-
-
|
|
287
|
+
- **The ref is the only accepted `agent` shape.** `collab_agent:<asset_id>`
|
|
288
|
+
selects the agent; omitting `agent` (or a blank string) runs the Athena deep
|
|
289
|
+
agent; any other value throws at render (`resolveAgentProp` is the same check,
|
|
290
|
+
exported for hosts that validate configuration up front).
|
|
154
291
|
- **Publish the agent.** Resolution reads the *published* snapshot, not the
|
|
155
292
|
live draft, so a channel that exists only in the editor is rejected with
|
|
156
293
|
`collab_agent_channel_unknown`.
|
|
@@ -167,7 +304,6 @@ returns a plausible answer using your config instead of theirs.
|
|
|
167
304
|
```tsx
|
|
168
305
|
// ❌ the agent's prompt, model, and tools are all discarded
|
|
169
306
|
<AthenaProvider
|
|
170
|
-
transport="statewire"
|
|
171
307
|
agent="collab_agent:asset_1234"
|
|
172
308
|
model="claude-opus-4-6"
|
|
173
309
|
systemPrompt="You are a helpful assistant."
|
|
@@ -175,7 +311,7 @@ returns a plausible answer using your config instead of theirs.
|
|
|
175
311
|
/>
|
|
176
312
|
|
|
177
313
|
// ✅ the agent's own configuration wins
|
|
178
|
-
<AthenaProvider
|
|
314
|
+
<AthenaProvider agent="collab_agent:asset_1234" />
|
|
179
315
|
```
|
|
180
316
|
|
|
181
317
|
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;"}
|