@signalcore/ui 1.0.0-beta.0 → 1.0.0-beta.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/dist/AgentChat.js +10 -2
- package/dist/AgentChat.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/types.d.ts +7 -0
- package/dist/types.js.map +1 -1
- package/dist/widget.js +2 -2
- package/package.json +1 -1
- package/src/AgentChat.tsx +20 -3
- package/src/index.ts +1 -0
- package/src/styles.css +9 -0
- package/src/types.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalcore/ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "SignalCore's components for the people an agent serves: the chat, the call, the agent's space, and the <signalcore-chat> widget.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"signalcore",
|
package/src/AgentChat.tsx
CHANGED
|
@@ -59,6 +59,7 @@ import type {
|
|
|
59
59
|
Message,
|
|
60
60
|
Request,
|
|
61
61
|
Step,
|
|
62
|
+
StepApp,
|
|
62
63
|
StepState,
|
|
63
64
|
} from "./types";
|
|
64
65
|
import {
|
|
@@ -1294,7 +1295,12 @@ function Reply({
|
|
|
1294
1295
|
<BuilderStep step={step} words={words} classNames={classNames} />
|
|
1295
1296
|
) : (
|
|
1296
1297
|
<>
|
|
1297
|
-
<Mark
|
|
1298
|
+
<Mark
|
|
1299
|
+
state={step.state}
|
|
1300
|
+
action={step.action}
|
|
1301
|
+
app={step.app ?? null}
|
|
1302
|
+
classNames={classNames}
|
|
1303
|
+
/>
|
|
1298
1304
|
<span>{words.steps[step.action] ?? actionWords(step.action)}</span>
|
|
1299
1305
|
{/* What a step answered is the model's, in its words: only why it failed. */}
|
|
1300
1306
|
{step.state === "failed" && step.output !== null && <small>{step.output}</small>}
|
|
@@ -1393,7 +1399,12 @@ function BuilderStep({
|
|
|
1393
1399
|
}) {
|
|
1394
1400
|
const row = (
|
|
1395
1401
|
<>
|
|
1396
|
-
<Mark
|
|
1402
|
+
<Mark
|
|
1403
|
+
state={step.state}
|
|
1404
|
+
action={step.action}
|
|
1405
|
+
app={step.app ?? null}
|
|
1406
|
+
classNames={classNames}
|
|
1407
|
+
/>
|
|
1397
1408
|
<span>{words.steps[step.action] ?? actionWords(step.action)}</span>
|
|
1398
1409
|
{step.state === "failed" && <em>{words.failed}</em>}
|
|
1399
1410
|
</>
|
|
@@ -1417,16 +1428,22 @@ function BuilderStep({
|
|
|
1417
1428
|
function Mark({
|
|
1418
1429
|
state,
|
|
1419
1430
|
action,
|
|
1431
|
+
app,
|
|
1420
1432
|
classNames,
|
|
1421
1433
|
}: {
|
|
1422
1434
|
state: StepState;
|
|
1423
1435
|
action: string;
|
|
1436
|
+
app: StepApp | null;
|
|
1424
1437
|
classNames: ClassNames;
|
|
1425
1438
|
}) {
|
|
1426
1439
|
const Glyph = stepGlyph(action);
|
|
1440
|
+
// A connected app's step wears the app's logo once done; only an https one is loaded.
|
|
1441
|
+
const logo = app?.icon && /^https:\/\//i.test(app.icon) ? app.icon : null;
|
|
1427
1442
|
return (
|
|
1428
1443
|
<span aria-hidden className={classes(classNames, "sc-chat__mark")}>
|
|
1429
|
-
{state === "done" ? (
|
|
1444
|
+
{state === "done" && logo !== null ? (
|
|
1445
|
+
<img src={logo} alt="" loading="lazy" draggable={false} />
|
|
1446
|
+
) : state === "done" ? (
|
|
1430
1447
|
<Glyph />
|
|
1431
1448
|
) : state === "running" ? null : (
|
|
1432
1449
|
<svg viewBox="0 0 14 14" fill="none">
|
package/src/index.ts
CHANGED
package/src/styles.css
CHANGED
|
@@ -501,6 +501,15 @@
|
|
|
501
501
|
height: 16px;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
+
/* A connected app's logo, in the same square as a glyph: its own colours, softly cornered. */
|
|
505
|
+
.sc-chat__mark > img {
|
|
506
|
+
display: block;
|
|
507
|
+
width: 16px;
|
|
508
|
+
height: 16px;
|
|
509
|
+
border-radius: 4px;
|
|
510
|
+
object-fit: contain;
|
|
511
|
+
}
|
|
512
|
+
|
|
504
513
|
.sc-chat__step--waiting .sc-chat__mark {
|
|
505
514
|
color: var(--_accent);
|
|
506
515
|
}
|
package/src/types.ts
CHANGED
|
@@ -253,6 +253,14 @@ export interface Step {
|
|
|
253
253
|
awaits: boolean;
|
|
254
254
|
/** Set while it waits to be allowed: by the person (the turn stopped), or by the business. */
|
|
255
255
|
request: Request | null;
|
|
256
|
+
/** A connected app's action: the app, its logo an https address; absent for the platform's. */
|
|
257
|
+
app?: StepApp | null | undefined;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** The connected app a step's action belongs to: its name and logo. */
|
|
261
|
+
export interface StepApp {
|
|
262
|
+
name: string;
|
|
263
|
+
icon: string | null;
|
|
256
264
|
}
|
|
257
265
|
|
|
258
266
|
/**
|