@aintela/chat 0.2.59 → 0.3.1
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 +77 -0
- package/dist/{ClientMessage-EKgfuTp8.js → ClientMessage-DUby3KyC.js} +16 -22
- package/dist/{ClientMessage-EKgfuTp8.js.map → ClientMessage-DUby3KyC.js.map} +1 -1
- package/dist/Memory-CjrYSkzB.js +47 -0
- package/dist/Memory-CjrYSkzB.js.map +1 -0
- package/dist/atMentions-CnHuJKhX.js +959 -0
- package/dist/atMentions-CnHuJKhX.js.map +1 -0
- package/dist/components.js +10161 -11344
- package/dist/components.js.map +1 -1
- package/dist/environmentUtils-VZNTCzEE.js +88 -0
- package/dist/environmentUtils-VZNTCzEE.js.map +1 -0
- package/dist/hooks.js +4 -5
- package/dist/{httpArtifactService-CpbRpTHb.js → httpArtifactService-Ba9xFy1E.js} +537 -646
- package/dist/httpArtifactService-Ba9xFy1E.js.map +1 -0
- package/dist/{httpSessionService-BEQMIKfv.js → httpSessionService-DXlT2vxT.js} +34 -24
- package/dist/httpSessionService-DXlT2vxT.js.map +1 -0
- package/dist/index.js +242 -243
- package/dist/models.js +48 -51
- package/dist/models.js.map +1 -1
- package/dist/serializer-D2W42bdT.js +1730 -0
- package/dist/serializer-D2W42bdT.js.map +1 -0
- package/dist/services.js +2 -2
- package/dist/src/components/AiChat/AiChatContext.d.ts +0 -3
- package/dist/src/components/AiChat/AiChatProvider.agent.test.d.ts +1 -0
- package/dist/src/components/AiChat/AiChatProvider.d.ts +2 -2
- package/dist/src/components/AiChat/AiChatTypes.d.ts +45 -27
- package/dist/src/components/AiChat/ChatPane/ChatPane.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/MessageAgent.d.ts +0 -1
- package/dist/src/components/AiChat/ChatPane/MessagePart.d.ts +5 -3
- package/dist/src/components/AiChat/ChatPane/MessagePart.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/friendlyToolConfig.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/messageAgentThoughts.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRun.d.ts +28 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRunContext.d.ts +18 -0
- package/dist/src/components/AiChat/ChatPane/parts/index.d.ts +5 -1
- package/dist/src/components/AiChat/ChatPane/parts/thoughtRun.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolDispatcher.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolRegistry.test.d.ts +1 -0
- package/dist/src/components/AiChat/aiChatEngine.d.ts +24 -5
- package/dist/src/components/AiChat/index.d.ts +1 -3
- package/dist/src/components/AiChat/sessionStateManagerService.bind.test.d.ts +1 -0
- package/dist/src/components/AiChat/sessionStateManagerService.d.ts +22 -10
- package/dist/src/components/AiChat/useAgentEngine.d.ts +69 -0
- package/dist/src/components/AiChat/useAgentEngine.test.d.ts +1 -0
- package/dist/src/components/index.d.ts +4 -7
- package/dist/src/components/v2/AiChatFloating.d.ts +3 -0
- package/dist/src/components/v2/PromptV2.d.ts +21 -6
- package/dist/src/components/v2/PromptV2.test.d.ts +1 -0
- package/dist/src/components/v2/icons.d.ts +1 -0
- package/dist/src/components/v2/index.d.ts +25 -25
- package/dist/src/hooks/index.d.ts +1 -1
- package/dist/src/hooks/useContainerWidth.d.ts +0 -1
- package/dist/src/models/ArtifactData.d.ts +0 -7
- package/dist/src/models/ChatSession.d.ts +0 -32
- package/dist/src/models/ClientMessage.d.ts +0 -4
- package/dist/src/models/ServerEvent.d.ts +0 -36
- package/dist/src/models/enums.d.ts +0 -1
- package/dist/src/models/index.d.ts +1 -2
- package/dist/src/models/interactionPartUtils.test.d.ts +1 -0
- package/dist/src/models/semanticKernelModel/sanitizeJsonString.test.d.ts +0 -0
- package/dist/src/models/serverEventDecode.test.d.ts +0 -0
- package/dist/src/services/WebSocketConnection/webSocketConnectionV2.reconnect.test.d.ts +0 -0
- package/dist/src/services/interactionService.d.ts +11 -0
- package/dist/src/services/interactionServiceGrouping.test.d.ts +1 -0
- package/dist/src/services/servers/AgentGatewayService.d.ts +25 -18
- package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +0 -1
- package/dist/src/services/servers/agentGatewayAgentContext.test.d.ts +1 -0
- package/dist/src/services/storageService.d.ts +34 -59
- package/dist/src/services/storageService.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +2 -6
- package/dist/src/utils/urlParser.d.ts +0 -1
- package/dist/src/utils/urlParser.test.d.ts +1 -0
- package/dist/tests/fakes/fakeChatServices.d.ts +42 -0
- package/dist/tests/fakes/fakeRawWebSocket.d.ts +51 -0
- package/dist/tests/fakes/fakeStorage.d.ts +7 -0
- package/dist/tests/fakes/makeGateway.d.ts +24 -1
- package/dist/{useChatSessions-BQP7DhY1.js → useChatSessions-1AAvAdPW.js} +2 -2
- package/dist/{useChatSessions-BQP7DhY1.js.map → useChatSessions-1AAvAdPW.js.map} +1 -1
- package/dist/useContainerWidth-B40_i-NW.js +295 -0
- package/dist/{useContainerWidth-B3t1ZTlo.js.map → useContainerWidth-B40_i-NW.js.map} +1 -1
- package/dist/utils.js +340 -57
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/Memory-DjLZqgbF.js +0 -84
- package/dist/Memory-DjLZqgbF.js.map +0 -1
- package/dist/atMentions-C0dza8DD.js +0 -1000
- package/dist/atMentions-C0dza8DD.js.map +0 -1
- package/dist/auth-lluJZyQO.js +0 -524
- package/dist/auth-lluJZyQO.js.map +0 -1
- package/dist/environmentUtils-CUVZ6Dq1.js +0 -478
- package/dist/environmentUtils-CUVZ6Dq1.js.map +0 -1
- package/dist/httpArtifactService-CpbRpTHb.js.map +0 -1
- package/dist/httpSessionService-BEQMIKfv.js.map +0 -1
- package/dist/serializer-BXSH9aYQ.js +0 -1360
- package/dist/serializer-BXSH9aYQ.js.map +0 -1
- package/dist/src/components/AiChat/AiChatFloating.d.ts +0 -3
- package/dist/src/components/AiChat/ChatPane/LastPrompts.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/Prompt.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/SubAgentBox.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/TaskList.d.ts +0 -6
- package/dist/src/components/AiChat/useLiveSession.d.ts +0 -52
- package/dist/src/components/v2/AiChatFloatingV2.d.ts +0 -3
- package/dist/src/utils/jsonDetector.d.ts +0 -50
- package/dist/src/utils/jsonUtils.d.ts +0 -1
- package/dist/src/utils/materialIconsSvg.d.ts +0 -51
- package/dist/src/utils/objectUtils.d.ts +0 -31
- package/dist/src/utils/parseArtifact.d.ts +0 -3
- package/dist/src/utils/uriUtils.d.ts +0 -39
- package/dist/useContainerWidth-B3t1ZTlo.js +0 -309
package/README.md
CHANGED
|
@@ -103,6 +103,59 @@ flag is available on its own as `useTurnOpen()`
|
|
|
103
103
|
(prefer it over `UiToolContext.onGoing`, which is a per-surface snapshot: `false`
|
|
104
104
|
forever on a card that has settled into history, even while a later turn streams).
|
|
105
105
|
|
|
106
|
+
### Component names (breaking in 0.3.0)
|
|
107
|
+
|
|
108
|
+
Every v2 component is exported under its **plain name** — `AppBar`, `Prompt`,
|
|
109
|
+
`TaskList`, `RunProgressStrip` — and again under its historical `…V2` name as an
|
|
110
|
+
alias, so no existing import breaks. Prefer the plain names.
|
|
111
|
+
|
|
112
|
+
The suffix existed to separate these from a v1 layer that no longer exists: the
|
|
113
|
+
last four v1 components (`Prompt`, `LastPrompts`, `TaskList`, `SubAgentBox`) were
|
|
114
|
+
deleted in 0.3.0 after confirming nothing consumed them, and the two
|
|
115
|
+
`AiChatFloating` implementations were merged into one. Gone with them are the
|
|
116
|
+
props that selected the v1 renderers — **`compactPrompt`**, **`showTaskList`**
|
|
117
|
+
and **`showSubAgents`**. The prompt is always the compact one now; the task list
|
|
118
|
+
and sub-agent trace live in the RunProgress panel.
|
|
119
|
+
|
|
120
|
+
### One engine, one agent (breaking in 0.3.0)
|
|
121
|
+
|
|
122
|
+
The `AgentContext` — which agent answers — is owned by the **engine**, and by nothing
|
|
123
|
+
else. It is supplied exactly once, when the engine is created, and the gateway stamps
|
|
124
|
+
`AgentId` on every frame from it. Before 0.3.0 three different public inputs accepted a
|
|
125
|
+
context for the same conversation and only one of them decided anything, so a surface
|
|
126
|
+
could bind, stamp and pass `expense-agent` everywhere and still send every turn as the
|
|
127
|
+
app-default agent, with nothing failing.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
// One hook per agent. The registry key is DERIVED from the agent, so "same key,
|
|
131
|
+
// different agent" cannot be expressed.
|
|
132
|
+
export const useExpenseChatEngine = () => useAgentEngine(expenseConfig()); // key: 'expense-agent'
|
|
133
|
+
const { engine } = useExpenseChatEngine();
|
|
134
|
+
|
|
135
|
+
await engine.openLiveSession(sessionId); // no context to pass, so none to get wrong
|
|
136
|
+
<AiChat engine={engine} /> // adopting: `agentContext` is a compile error here
|
|
137
|
+
<AiChat agentContext={ctx} … /> // building its own engine: the one place it belongs
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Pass `useAgentEngine(config, { scope })` for two *independent* conversations with the
|
|
141
|
+
**same** agent. To switch agent inside a live conversation there is
|
|
142
|
+
`engine.forceAgentContext(ctx)` — deliberately ugly, because the session already holds
|
|
143
|
+
another agent's history and the server stamps `Session.AgentId` on the first turn only,
|
|
144
|
+
so the conversation keeps reporting the agent it started as. Prefer a second engine.
|
|
145
|
+
Routine, non-identity changes have plain setters: `setCustomer`, `setModel`.
|
|
146
|
+
|
|
147
|
+
Migration from 0.2.x — every removal is a compile error at the call site, by design:
|
|
148
|
+
|
|
149
|
+
| 0.2.x | 0.3.0 |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `useLiveSession(config, { key })` | `useAgentEngine(config, { scope })` — drop the key |
|
|
152
|
+
| `<AiChat engine={e} agentContext={ctx} />` | `<AiChat engine={e} />` |
|
|
153
|
+
| `engine.openLiveSession(ctx, id)` | `engine.openLiveSession(id)` |
|
|
154
|
+
| `mgr.bindAndOpenLiveSession(ctx, id, opts)` | `mgr.bindAndOpenLiveSession(id, opts)` |
|
|
155
|
+
| `mgr.createSession(ctx, id)` / `mgr.retrieveSession(ctx, id)` | `mgr.createSession(id)` / `mgr.retrieveSession(id)` |
|
|
156
|
+
| `gateway.setAgentContext(ctx)` / `engine.setAgentContext(ctx)` | `forceAgentContext(ctx)` — most hosts call neither |
|
|
157
|
+
| — | new: `engine.getAgentContext()`, `engine.setCustomer()`, `engineKeyFor()` |
|
|
158
|
+
|
|
106
159
|
## Testing
|
|
107
160
|
|
|
108
161
|
Vitest runs the unit + integration suite. Co-located `*.test.ts` files
|
|
@@ -118,6 +171,30 @@ npm run test:watch # watch mode
|
|
|
118
171
|
npm run test:coverage # generates coverage/ (html + lcov + json-summary)
|
|
119
172
|
```
|
|
120
173
|
|
|
174
|
+
Two fakes sit at different depths, and picking the wrong one is the usual reason
|
|
175
|
+
a test proves nothing:
|
|
176
|
+
|
|
177
|
+
- `tests/fakes/makeGateway.ts` + `fakeWebSocket.ts` replace the whole
|
|
178
|
+
`IWebSocketConnection`. Use these when the code under test is the **gateway**
|
|
179
|
+
or anything above it — they let you `deliver()` parsed server events directly.
|
|
180
|
+
- `tests/fakes/fakeRawWebSocket.ts` replaces the **browser `WebSocket` global**,
|
|
181
|
+
one layer lower. Use it when the code under test is `WebSocketConnecionV2`
|
|
182
|
+
itself (dial URL, resume cursor, reconnect loop), so all of `connect()` stays
|
|
183
|
+
real.
|
|
184
|
+
|
|
185
|
+
`test:coverage` enforces a **ratchet** (`thresholds` in `vitest.config.ts`) set
|
|
186
|
+
just under today's numbers. It exists to stop coverage sliding backwards, not to
|
|
187
|
+
describe a target — raise it when a batch of tests lands, and never lower it to
|
|
188
|
+
turn a red run green.
|
|
189
|
+
|
|
190
|
+
**CI** (`.github/workflows/ci.yml`) runs on every PR and every push to `main`:
|
|
191
|
+
typecheck → tests + coverage (the ratchet, so a drop fails the run) → library
|
|
192
|
+
build → demo typecheck. The build is included because the npm tarball ships a
|
|
193
|
+
prebuilt `dist/`, and the demo because it consumes the library through a source
|
|
194
|
+
alias and so catches breaking API changes the library's own typecheck cannot
|
|
195
|
+
see. Each run's summary page carries the coverage table and the ten biggest gaps
|
|
196
|
+
by uncovered statements; the full HTML report is attached as an artifact.
|
|
197
|
+
|
|
121
198
|
VS Code wiring (auto-installed via `.vscode/extensions.json`):
|
|
122
199
|
|
|
123
200
|
- **Vitest** extension surfaces pass/fail gutters next to each `it(...)`
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var c = (a, s, i) => s in a ? m(a, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[s] = i;
|
|
3
|
+
var r = (a, s) => m(a, "name", { value: s, configurable: !0 });
|
|
4
|
+
var e = (a, s, i) => c(a, typeof s != "symbol" ? s + "" : s, i);
|
|
5
|
+
const t = class t {
|
|
6
|
+
constructor(s, i, d, f, y) {
|
|
7
|
+
e(this, "mimeType");
|
|
8
|
+
e(this, "data");
|
|
9
|
+
e(this, "friendlyMessage");
|
|
10
|
+
e(this, "fake");
|
|
11
11
|
/**
|
|
12
12
|
* Optional image attachments that travel as a structured payload
|
|
13
13
|
* on the WS frame (see `IMessage.Images`). Kept separate from
|
|
14
14
|
* `data` so we don't have to encode them into the text body — the
|
|
15
15
|
* server adds them as `ImageContent` entries on the user turn.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
e(this, "images");
|
|
18
18
|
/**
|
|
19
19
|
* Optional client-only UI representation for this user turn. Carried to the
|
|
20
20
|
* server as a `UserUiContent` sibling (persisted + replayed) but stripped from
|
|
@@ -22,19 +22,13 @@ const i = class i {
|
|
|
22
22
|
* serialized JSON string. The gateway also injects a matching `UserAnswer` part
|
|
23
23
|
* on the live interaction so the component renders immediately.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
this.data =
|
|
27
|
-
}
|
|
28
|
-
toPythonJson() {
|
|
29
|
-
return {
|
|
30
|
-
mime_type: this.mimeType,
|
|
31
|
-
data: this.data
|
|
32
|
-
};
|
|
25
|
+
e(this, "userUi");
|
|
26
|
+
this.data = s, this.mimeType = i, this.friendlyMessage = f, this.fake = d, this.images = y;
|
|
33
27
|
}
|
|
34
28
|
};
|
|
35
|
-
|
|
36
|
-
let
|
|
29
|
+
r(t, "ClientMessage");
|
|
30
|
+
let h = t;
|
|
37
31
|
export {
|
|
38
|
-
|
|
32
|
+
h as C
|
|
39
33
|
};
|
|
40
|
-
//# sourceMappingURL=ClientMessage-
|
|
34
|
+
//# sourceMappingURL=ClientMessage-DUby3KyC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientMessage-
|
|
1
|
+
{"version":3,"file":"ClientMessage-DUby3KyC.js","sources":["../src/models/ClientMessage.ts"],"sourcesContent":["/**\n * A single image attachment carried alongside a ClientMessage. `data`\n * is the raw base64 payload (no `data:<mime>;base64,` prefix) so the\n * server can `Convert.FromBase64String` directly into bytes.\n */\nexport interface ClientMessageImage {\n mimeType: string;\n data: string;\n}\n\nexport class ClientMessage {\n mimeType: string;\n data: string;\n friendlyMessage?: string;\n fake?: boolean;\n /**\n * Optional image attachments that travel as a structured payload\n * on the WS frame (see `IMessage.Images`). Kept separate from\n * `data` so we don't have to encode them into the text body — the\n * server adds them as `ImageContent` entries on the user turn.\n */\n images?: ClientMessageImage[];\n\n /**\n * Optional client-only UI representation for this user turn. Carried to the\n * server as a `UserUiContent` sibling (persisted + replayed) but stripped from\n * every model request — `data` stays the only model-facing text. `args` is a\n * serialized JSON string. The gateway also injects a matching `UserAnswer` part\n * on the live interaction so the component renders immediately.\n */\n userUi?: { name: string; args?: string };\n\n constructor(data: string, mimeType: string, fake?: boolean, friendlyMessage?: string, images?: ClientMessageImage[]) {\n this.data = data;\n this.mimeType = mimeType;\n this.friendlyMessage = friendlyMessage;\n this.fake = fake;\n this.images = images;\n }\n}"],"names":["_ClientMessage","data","mimeType","fake","friendlyMessage","images","__publicField","__name","ClientMessage"],"mappings":";;;;AAUO,MAAMA,IAAN,MAAMA,EAAc;AAAA,EAsBzB,YAAYC,GAAcC,GAAkBC,GAAgBC,GAA0BC,GAA+B;AArBrH,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,EAAA;AASA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,EAAA;AAGE,SAAK,OAAOL,GACZ,KAAK,WAAWC,GAChB,KAAK,kBAAkBE,GACvB,KAAK,OAAOD,GACZ,KAAK,SAASE;AAAA,EAChB;AACF;AA7B2BE,EAAAP,GAAA;AAApB,IAAMQ,IAANR;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var g = (a, i, r) => i in a ? b(a, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[i] = r;
|
|
3
|
+
var s = (a, i) => b(a, "name", { value: i, configurable: !0 });
|
|
4
|
+
var e = (a, i, r) => g(a, typeof i != "symbol" ? i + "" : i, r);
|
|
5
|
+
const n = class n {
|
|
6
|
+
constructor(i, r) {
|
|
7
|
+
e(this, "id");
|
|
8
|
+
e(this, "biName");
|
|
9
|
+
this.id = i, this.biName = r;
|
|
10
|
+
}
|
|
11
|
+
getBiName() {
|
|
12
|
+
return `BI_${this.biName}`;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
s(n, "Account");
|
|
16
|
+
let l = n;
|
|
17
|
+
const t = {
|
|
18
|
+
ExplorerAgent: "ExplorerAgent",
|
|
19
|
+
DashboardAgent: "DashboardAgent",
|
|
20
|
+
Unknown: "Unknown"
|
|
21
|
+
}, d = [
|
|
22
|
+
"Completed",
|
|
23
|
+
"Failed",
|
|
24
|
+
"Cancelled"
|
|
25
|
+
];
|
|
26
|
+
function u(a) {
|
|
27
|
+
return a ? d.includes(a) : !1;
|
|
28
|
+
}
|
|
29
|
+
s(u, "isSubAgentTerminalStatus");
|
|
30
|
+
var h = /* @__PURE__ */ ((a) => (a[a.Table = 0] = "Table", a[a.Metric = 1] = "Metric", a[a.Chart = 2] = "Chart", a[a.Dashboards = 3] = "Dashboards", a[a.Suggestions = 4] = "Suggestions", a[a.Memory = 5] = "Memory", a))(h || {});
|
|
31
|
+
const c = {
|
|
32
|
+
0: "Table",
|
|
33
|
+
1: "Metric",
|
|
34
|
+
2: "Chart",
|
|
35
|
+
3: "Dashboards",
|
|
36
|
+
4: "Suggestions",
|
|
37
|
+
5: "Memory"
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
l as A,
|
|
41
|
+
c as M,
|
|
42
|
+
d as S,
|
|
43
|
+
t as a,
|
|
44
|
+
h as b,
|
|
45
|
+
u as i
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=Memory-CjrYSkzB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Memory-CjrYSkzB.js","sources":["../src/models/contexts.ts","../src/models/Agent.ts","../src/models/subAgentModel.ts","../src/models/Memory.ts"],"sourcesContent":["import type { Customer } from \"./Customer\";\nimport type { Agent } from \"./Agent\";\nimport { type IDBStorable } from \"./IDBStorable\";\n\nexport class Account {\n id: string;\n biName: string;\n\n constructor(id: string, biName: string) {\n this.id = id;\n this.biName = biName;\n }\n\n getBiName() {\n return `BI_${this.biName}`;\n }\n}\n\nexport interface User extends IDBStorable {\n email: string;\n family_name: string;\n given_name: string;\n name: string;\n hd: string;\n picture: string;\n access_token: string;\n previous_access_token?: string;\n refresh_token?: string;\n account?: Account;\n}\n\nexport interface AuthState {\n isAuthenticated: boolean;\n isLoading: boolean;\n login: (userData: User) => void;\n logout: () => void;\n errorMessage: string | null;\n}\n\nexport interface AgentContext {\n agentConfig: Partial<Agent>;\n customer?: Customer;\n model?: string;\n}\n","export type AgentKind = 'ExplorerAgent' | 'DashboardAgent' | 'Unknown';\nexport const AgentKind = {\n ExplorerAgent: 'ExplorerAgent' as AgentKind,\n DashboardAgent: 'DashboardAgent' as AgentKind,\n Unknown: 'Unknown' as AgentKind,\n} as const;\n\n/**\n * Agent model - represents an AI agent configuration\n * Mirrors the .NET Agent entity in Envision.SemanticKernel.Models.Agent\n */\nexport interface Agent {\n id: string;\n name: string;\n type?: AgentKind;\n defaultModelId?: string;\n defaultQuickModelId?: string;\n description?: string;\n muiIconName?: string;\n embeddingConfigurationId: string;\n agentImplementation?: string;\n agentBootStrapImplementation?: string;\n parameters?: Record<string, string>;\n plugins: string[];\n /** List of additional main instruction IDs (Category: Main or Generic) for this agent */\n mainInstructionIds?: string[];\n lastUpdated?: Date;\n created?: Date;\n}\n\n/**\n * Partial agent for listing purposes (only essential fields)\n */\nexport type AgentSummary = Pick<Agent, 'id' | 'name' | 'description' | 'muiIconName' | 'type'>;\n","import type { TodoList } from './todoListModel';\n\n/**\n * Mirrors `Envision.SemanticKernel.Core.SubAgent.SubAgentStatus` enum on the\n * server. Values come back as plain strings (the controller uses `Status.ToString()`).\n */\nexport type SubAgentStatus =\n | 'Pending'\n | 'Running'\n | 'Completed'\n | 'Failed'\n | 'Cancelled'\n | 'Unknown';\n\n/**\n * Lightweight representation of a chat message embedded in the SubAgentDto.\n * The server-side `Message` type carries more fields, but only the basics are\n * needed for status polling on the client.\n */\nexport interface SubAgentMessage {\n id?: string;\n role?: string;\n content?: string;\n [key: string]: unknown;\n}\n\n/**\n * TypeScript counterpart of `Envision.SemanticKernel.Core.SubAgent.SubAgentDto`.\n *\n * This is the payload returned by `GET /SubAgent/{sessionId}/{id}`.\n *\n * `TodoList.percentComplete` is serialized by the server as a fraction in the\n * range `[0, 1]` (i.e. `completedItems / totalItems`). It can be `NaN` when the\n * todo list is empty, so consumers should guard against non-finite values.\n */\nexport interface SubAgentDto {\n id?: string;\n subAgentId: string;\n name: string;\n sessionId?: string;\n dashboardId?: string | null;\n todoList?: TodoList | null;\n generalInstructions?: string | null;\n dashboardInstructions?: string | null;\n detailedStatus?: string | null;\n status: SubAgentStatus | string;\n error?: string | null;\n hasResult?: boolean | null;\n finalSummary?: string | null;\n parameters?: Record<string, string> | null;\n updatedAt?: string | Date | null;\n created?: string | Date | null;\n message?: SubAgentMessage | null;\n}\n\n/** Status values that indicate the sub-agent is no longer making progress. */\nexport const SUB_AGENT_TERMINAL_STATUSES: ReadonlyArray<SubAgentStatus> = [\n 'Completed',\n 'Failed',\n 'Cancelled',\n];\n\nexport function isSubAgentTerminalStatus(status: string | undefined | null): boolean {\n if (!status) return false;\n return (SUB_AGENT_TERMINAL_STATUSES as readonly string[]).includes(status);\n}\n","/**\n * Memory model - represents a semantic memory stored in MongoDB and Qdrant\n * Mirrors the .NET Memory entity in Envision.SemanticKernel.Core/Memory/Memory.cs\n */\n\n/**\n * Context types for memories - determines how they're filtered in semantic search\n */\nexport enum MemoryContexts {\n Table = 0, // Table schema information\n Metric = 1, // Business metrics and KPIs\n Chart = 2, // Chart/visualization descriptions\n Dashboards = 3, // Dashboard information\n Suggestions = 4, // Business recommendations\n Memory = 5 // General memories (no filter applied in search)\n}\n\n/**\n * Human-readable labels for each context type\n */\nexport const MemoryContextLabels: Record<MemoryContexts, string> = {\n [MemoryContexts.Table]: 'Table',\n [MemoryContexts.Metric]: 'Metric',\n [MemoryContexts.Chart]: 'Chart',\n [MemoryContexts.Dashboards]: 'Dashboards',\n [MemoryContexts.Suggestions]: 'Suggestions',\n [MemoryContexts.Memory]: 'Memory',\n};\n\n/**\n * Full Memory entity as stored in the database\n */\nexport interface SemanticMemory {\n id: string;\n memoryText: string;\n relatedTags?: string;\n created?: string;\n updatedAt?: string;\n // Runtime properties (populated by search results only)\n runtimeScore?: number;\n runtimeRank?: number;\n}\n\n/**\n * Input model for creating/updating memories\n * Does not include id, created, or runtime properties\n */\nexport interface SemanticMemoryInput {\n memoryText: string;\n relatedTags?: string;\n}\n\n/**\n * Options for semantic search\n */\nexport interface SemanticMemorySearchOptions {\n relatedTable?: string;\n relatedContext?: MemoryContexts;\n relatedTags?: string;\n limit?: number;\n}\n"],"names":["_Account","id","biName","__publicField","__name","Account","AgentKind","SUB_AGENT_TERMINAL_STATUSES","isSubAgentTerminalStatus","status","MemoryContexts","MemoryContextLabels"],"mappings":";;;;AAIO,MAAMA,IAAN,MAAMA,EAAQ;AAAA,EAIjB,YAAYC,GAAYC,GAAgB;AAHxC,IAAAC,EAAA;AACA,IAAAA,EAAA;AAGI,SAAK,KAAKF,GACV,KAAK,SAASC;AAAA,EAClB;AAAA,EAEA,YAAY;AACR,WAAO,MAAM,KAAK,MAAM;AAAA,EAC5B;AACJ;AAZqBE,EAAAJ,GAAA;AAAd,IAAMK,IAANL;ACHA,MAAMM,IAAY;AAAA,EACrB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,SAAS;AACb,GCmDaC,IAA6D;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AACJ;AAEO,SAASC,EAAyBC,GAA4C;AACjF,SAAKA,IACGF,EAAkD,SAASE,CAAM,IADrD;AAExB;AAHgBL,EAAAI,GAAA;ACtDT,IAAKE,sBAAAA,OACRA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SACAA,EAAAA,EAAA,SAAS,CAAA,IAAT,UACAA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SACAA,EAAAA,EAAA,aAAa,CAAA,IAAb,cACAA,EAAAA,EAAA,cAAc,CAAA,IAAd,eACAA,EAAAA,EAAA,SAAS,CAAA,IAAT,UANQA,IAAAA,KAAA,CAAA,CAAA;AAYL,MAAMC,IAAsD;AAAA,EAC9D,GAAuB;AAAA,EACvB,GAAwB;AAAA,EACxB,GAAuB;AAAA,EACvB,GAA4B;AAAA,EAC5B,GAA6B;AAAA,EAC7B,GAAwB;AAC7B;"}
|