@aintela/chat 0.6.0 → 0.8.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 +43 -0
- package/dist/components.js +9004 -7708
- package/dist/components.js.map +1 -1
- package/dist/{httpArtifactService-DYQDPVVH.js → detachedRunActivity-RNg1JDDW.js} +799 -334
- package/dist/detachedRunActivity-RNg1JDDW.js.map +1 -0
- package/dist/detachedRunModel-X59Pb5V-.js +67 -0
- package/dist/{detachedRunModel-1ii9qGTW.js.map → detachedRunModel-X59Pb5V-.js.map} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/httpSessionService-DLdoBZRW.js +320 -0
- package/dist/httpSessionService-DLdoBZRW.js.map +1 -0
- package/dist/index.js +325 -275
- package/dist/models.js +47 -41
- package/dist/{serializer-BNsp8xs2.js → serializer-DvR3nOcf.js} +781 -652
- package/dist/serializer-DvR3nOcf.js.map +1 -0
- package/dist/services.js +22 -15
- package/dist/src/components/AgentTeam/BillingLimitBanner.d.ts +7 -0
- package/dist/src/components/AgentTeam/ChatAgentHeader.d.ts +34 -0
- package/dist/src/components/AgentTeam/HandoffDivider.d.ts +13 -0
- package/dist/src/components/AgentTeam/PersonaAvatar.d.ts +20 -0
- package/dist/src/components/AgentTeam/__tests__/agentTeam.test.d.ts +0 -0
- package/dist/src/components/AgentTeam/__tests__/billingLimit.test.d.ts +0 -0
- package/dist/src/components/AgentTeam/__tests__/messagePersona.test.d.ts +0 -0
- package/dist/src/components/AgentTeam/agentRoles.d.ts +33 -0
- package/dist/src/components/AgentTeam/chatAgent.d.ts +24 -0
- package/dist/src/components/AgentTeam/index.d.ts +7 -0
- package/dist/src/components/AgentTeam/personas.d.ts +60 -0
- package/dist/src/components/AiChat/AiChatContext.d.ts +9 -1
- package/dist/src/components/AiChat/AiChatTypes.d.ts +17 -1
- package/dist/src/components/AiChat/ChatPane/InteractionOriginBadge.d.ts +15 -0
- package/dist/src/components/AiChat/ChatPane/messageUserOrigin.test.d.ts +1 -0
- package/dist/src/components/AiChat/aiChatEngine.d.ts +13 -1
- package/dist/src/components/AiChat/stateConfiguration.d.ts +7 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/v2/DetachedRunTaskBox.d.ts +30 -5
- package/dist/src/components/v2/DetachedRunTaskBox.live.test.d.ts +1 -0
- package/dist/src/components/v2/DetachedRunTranscript.d.ts +89 -0
- package/dist/src/components/v2/DetachedRunTranscript.test.d.ts +1 -0
- package/dist/src/components/v2/index.d.ts +5 -0
- package/dist/src/components/v2/useDetachedRunLiveActivity.d.ts +30 -0
- package/dist/src/components/v2/useDetachedRunResumeKey.d.ts +15 -0
- package/dist/src/components/v2/useDetachedRunResumeKey.test.d.ts +1 -0
- package/dist/src/models/Interaction.d.ts +26 -0
- package/dist/src/models/ServerEvent.d.ts +3 -0
- package/dist/src/models/billingLimit.d.ts +23 -0
- package/dist/src/models/detachedRunModel.d.ts +11 -0
- package/dist/src/models/enums.d.ts +3 -1
- package/dist/src/models/index.d.ts +5 -3
- package/dist/src/models/semanticKernelModel/models.d.ts +40 -1
- package/dist/src/services/WebSocketConnection/WebSocketConnectionV2.d.ts +4 -1
- package/dist/src/services/WebSocketConnection/webSocketConnection.d.ts +18 -2
- package/dist/src/services/detachedRun/DetachedRunFramesTransport.d.ts +68 -0
- package/dist/src/services/detachedRun/DetachedRunFramesTransport.test.d.ts +1 -0
- package/dist/src/services/detachedRun/detachedRunActivity.d.ts +25 -0
- package/dist/src/services/detachedRun/streamDetachedRunFrames.d.ts +110 -0
- package/dist/src/services/detachedRun/streamDetachedRunFrames.test.d.ts +1 -0
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/servers/AgentGatewayService.d.ts +1 -1
- package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +67 -1
- package/dist/src/services/servers/gatewayAnnounceDetachedRun.test.d.ts +1 -0
- package/dist/src/services/servers/gatewayInteractionStarted.test.d.ts +1 -0
- package/dist/src/services/wire/decodeFrame.d.ts +6 -1
- package/dist/tests/fakes/fakeWebSocket.d.ts +8 -2
- package/dist/tests/fakes/makeGateway.d.ts +3 -1
- package/dist/{useChatSessions-Q41Jmr6P.js → useChatSessions-DwqgYo79.js} +2 -2
- package/dist/{useChatSessions-Q41Jmr6P.js.map → useChatSessions-DwqgYo79.js.map} +1 -1
- package/package.json +1 -1
- package/dist/detachedRunModel-1ii9qGTW.js +0 -50
- package/dist/httpArtifactService-DYQDPVVH.js.map +0 -1
- package/dist/httpSessionService-BY7JeW8d.js +0 -309
- package/dist/httpSessionService-BY7JeW8d.js.map +0 -1
- package/dist/serializer-BNsp8xs2.js.map +0 -1
package/README.md
CHANGED
|
@@ -128,6 +128,49 @@ flag is available on its own as `useTurnOpen()`
|
|
|
128
128
|
(prefer it over `UiToolContext.onGoing`, which is a per-surface snapshot: `false`
|
|
129
129
|
forever on a card that has settled into history, even while a later turn streams).
|
|
130
130
|
|
|
131
|
+
### Turns this tab did not send, and a detached run as a transcript (AIA Issue 1548)
|
|
132
|
+
|
|
133
|
+
The server announces every turn with an `InteractionStarted` frame before its first delta. A
|
|
134
|
+
turn this tab did not send — a WhatsApp message, a platform turn after a task settled, another
|
|
135
|
+
tab's turn — opens with its text as the user's bubble and a small origin badge ("WhatsApp",
|
|
136
|
+
"Plataforma", "API"; override the words with `interactionOriginLabels`). It never takes the
|
|
137
|
+
place of a local turn that is still streaming, and neither turn unlocks the composer for the
|
|
138
|
+
other. History reload reads the same origin from the session (`InteractionOriginContent`).
|
|
139
|
+
|
|
140
|
+
`DetachedRunTranscript` draws one detached run as a read-only chat — the same engine and
|
|
141
|
+
`ChatPane`, fed by the run's frames stream (`GET /detached-runs/{id}/frames`, SSE read over
|
|
142
|
+
`fetch` because the route needs a bearer):
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
import { DetachedRunTranscript } from '@aintela/chat';
|
|
146
|
+
|
|
147
|
+
<DetachedRunTranscript
|
|
148
|
+
runId={runId}
|
|
149
|
+
baseUrl={agentsServerUrl}
|
|
150
|
+
fetchImpl={authenticatedFetch} // or getToken={() => token}; default: user.access_token
|
|
151
|
+
getUser={readLiveUser} // whose token reads the run's artifacts
|
|
152
|
+
uiTools={uiTools} // any <AiChat> presentation prop passes through
|
|
153
|
+
onUnauthorized={refreshToken} // on a 401: refresh, resolve true ⇒ one retry with the fresh token
|
|
154
|
+
onError={(e) => setStopped(e.kind)} // 'notFound' | 'forbidden' | 'unauthorized' | 'gaveUp'
|
|
155
|
+
resumeKey={answersSent} // change it after answering: the stream ends when the run stops
|
|
156
|
+
footer={<AnswerComposer runId={runId} />}
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`DetachedRunTaskBox` polls the run's record (the source of truth) and, given the same `baseUrl` +
|
|
161
|
+
`fetchImpl`/`getToken`, follows its frames while it is Pending/Running: a one-line activity ticker
|
|
162
|
+
and a task list that moves the moment the agent updates it. "ver detalhes" mounts the run's
|
|
163
|
+
`DetachedRunTranscript` inline (`uiTools` / `partRenderers` pass through). `onSettled(run)` fires
|
|
164
|
+
once per settle the conversation was not told about (`run.announced === false`); answer it with
|
|
165
|
+
`engine.announceDetachedRun(run.id, run.settledAt)`, which sends the `AnnounceDetachedRun` socket
|
|
166
|
+
action — held while a turn is open in this tab, deduped per settle — and the server's announcement
|
|
167
|
+
arrives as an ordinary `platform` turn.
|
|
168
|
+
|
|
169
|
+
A host with its own `<AiChat>` wrapper takes the engine instead —
|
|
170
|
+
`const { engine } = useDetachedRunTranscript({ runId, baseUrl, … })`, then
|
|
171
|
+
`<MyScopedAiChat engine={engine}><ChatPane /></MyScopedAiChat>` with `hidePromptInput`. The
|
|
172
|
+
reader on its own is `streamDetachedRunFrames(…)` (services).
|
|
173
|
+
|
|
131
174
|
### Component names (breaking in 0.3.0)
|
|
132
175
|
|
|
133
176
|
Every v2 component is exported under its **plain name** — `AppBar`, `Prompt`,
|