@elizaos/app-core 2.0.0-alpha.352 → 2.0.0-alpha.353
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/package.json +5 -5
- package/packages/agent/src/services/relationships-graph.d.ts.map +1 -1
- package/packages/agent/src/services/relationships-graph.js +23 -6
- package/packages/app-core/src/components/character/CharacterEditorPanels.d.ts.map +1 -1
- package/packages/app-core/src/components/character/CharacterEditorPanels.js +71 -130
- package/packages/app-core/src/components/character/CharacterHubView.d.ts.map +1 -1
- package/packages/app-core/src/components/character/CharacterHubView.js +180 -43
- package/packages/app-core/src/components/character/CharacterOverviewSection.d.ts +9 -4
- package/packages/app-core/src/components/character/CharacterOverviewSection.d.ts.map +1 -1
- package/packages/app-core/src/components/character/CharacterOverviewSection.js +16 -51
- package/packages/app-core/src/components/conversations/ConversationsSidebar.d.ts.map +1 -1
- package/packages/app-core/src/components/conversations/ConversationsSidebar.js +24 -7
- package/packages/app-core/src/components/pages/RelationshipsGraphPanel.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/RelationshipsGraphPanel.js +192 -76
- package/packages/app-core/src/components/pages/relationships/RelationshipsPersonPanels.d.ts +4 -1
- package/packages/app-core/src/components/pages/relationships/RelationshipsPersonPanels.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/relationships/RelationshipsPersonPanels.js +96 -9
- package/packages/app-core/src/components/pages/relationships/RelationshipsWorkspaceView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/relationships/RelationshipsWorkspaceView.js +8 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/app-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.353",
|
|
4
4
|
"description": "Shared application core for elizaOS white-label agent apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"@capacitor/preferences": "^8.0.1",
|
|
470
470
|
"@capacitor/push-notifications": "^8.0.0",
|
|
471
471
|
"@clack/prompts": "^1.0.0",
|
|
472
|
-
"@elizaos/agent": "^2.0.0-alpha.
|
|
472
|
+
"@elizaos/agent": "^2.0.0-alpha.353",
|
|
473
473
|
"@elizaos/app-companion": "^0.0.0",
|
|
474
474
|
"@elizaos/app-elizamaker": "^0.0.0",
|
|
475
475
|
"@elizaos/app-lifeops": "^0.0.0",
|
|
@@ -478,11 +478,11 @@
|
|
|
478
478
|
"@elizaos/app-task-coordinator": "^0.0.0",
|
|
479
479
|
"@elizaos/app-training": "^0.0.1",
|
|
480
480
|
"@elizaos/app-vincent": "^0.0.0",
|
|
481
|
-
"@elizaos/core": "^2.0.0-alpha.
|
|
481
|
+
"@elizaos/core": "^2.0.0-alpha.353",
|
|
482
482
|
"@elizaos/plugin-browser-bridge": "^0.1.0",
|
|
483
483
|
"@elizaos/plugin-wechat": "^0.1.0",
|
|
484
|
-
"@elizaos/shared": "^2.0.0-alpha.
|
|
485
|
-
"@elizaos/ui": "^2.0.0-alpha.
|
|
484
|
+
"@elizaos/shared": "^2.0.0-alpha.353",
|
|
485
|
+
"@elizaos/ui": "^2.0.0-alpha.353",
|
|
486
486
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
487
487
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
488
488
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships-graph.d.ts","sourceRoot":"","sources":["../../../../../../agent/src/services/relationships-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,MAAM,EAGN,IAAI,EACL,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"relationships-graph.d.ts","sourceRoot":"","sources":["../../../../../../agent/src/services/relationships-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,MAAM,EAGN,I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AAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAgCF;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,IAAI,EACrB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,IAAI,EACrB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { asNonEmptyString, asRecord } from "@elizaos/shared/type-guards";
|
|
2
2
|
import { resolveOwnerEntityId } from "../runtime/owner-entity.js";
|
|
3
|
+
import { fetchConfiguredOwnerName } from "./owner-name.js";
|
|
3
4
|
const KNOWN_PLATFORM_KEYS = [
|
|
4
5
|
"discord",
|
|
5
6
|
"telegram",
|
|
@@ -734,12 +735,15 @@ function buildSummaries(clusters, contexts, factCounts, ownerInfo) {
|
|
|
734
735
|
});
|
|
735
736
|
}
|
|
736
737
|
const primaryContext = contexts.get(cluster.primaryEntityId);
|
|
737
|
-
const
|
|
738
|
+
const fallbackDisplayName = preferredContactLabel(primaryContext?.contact ?? null) ??
|
|
738
739
|
entityNames(primaryContext?.entity ?? null)[0] ??
|
|
739
740
|
identities.find((identity) => identity.names[0])?.names[0] ??
|
|
740
741
|
identities.find((identity) => identity.handles[0])?.handles[0]?.handle ??
|
|
741
742
|
emails.values().next().value ??
|
|
742
743
|
cluster.primaryEntityId;
|
|
744
|
+
const displayName = isOwner && ownerInfo.configuredOwnerName
|
|
745
|
+
? ownerInfo.configuredOwnerName
|
|
746
|
+
: fallbackDisplayName;
|
|
743
747
|
aliases.delete(displayName);
|
|
744
748
|
if (isOwner && ownerInfo.ownerEntityId) {
|
|
745
749
|
upsertProfile(profiles, {
|
|
@@ -1354,6 +1358,7 @@ async function buildGraphModel(runtime, relationshipsService) {
|
|
|
1354
1358
|
const ownerEntityId = await resolveOwnerEntityId(runtime).catch(() => null);
|
|
1355
1359
|
const cloudAuth = runtime.getService("CLOUD_AUTH");
|
|
1356
1360
|
const cloudUserId = asString(cloudAuth?.getUserId?.()) ?? null;
|
|
1361
|
+
const configuredOwnerName = await fetchConfiguredOwnerName().catch(() => null);
|
|
1357
1362
|
const entityContexts = new Map();
|
|
1358
1363
|
await Promise.all(entityIds.map(async (entityId) => {
|
|
1359
1364
|
const [entity, contact] = await Promise.all([
|
|
@@ -1379,6 +1384,7 @@ async function buildGraphModel(runtime, relationshipsService) {
|
|
|
1379
1384
|
const summaries = buildSummaries(clustersList, entityContexts, factCounts, {
|
|
1380
1385
|
ownerEntityId,
|
|
1381
1386
|
cloudUserId,
|
|
1387
|
+
configuredOwnerName,
|
|
1382
1388
|
});
|
|
1383
1389
|
const peopleByGroupId = new Map(summaries.map((summary) => [summary.groupId, summary]));
|
|
1384
1390
|
const explicitEdgeMap = buildRelationshipEdgeMap(relationships, clusterByEntityId);
|
|
@@ -1433,15 +1439,23 @@ export function createNativeRelationshipsGraphService(runtime, relationshipsServ
|
|
|
1433
1439
|
}
|
|
1434
1440
|
return modelBuildPromise;
|
|
1435
1441
|
}
|
|
1442
|
+
function applyOwnerName(summaries, ownerName) {
|
|
1443
|
+
if (!ownerName)
|
|
1444
|
+
return summaries;
|
|
1445
|
+
return summaries.map((summary) => summary.isOwner ? { ...summary, displayName: ownerName } : summary);
|
|
1446
|
+
}
|
|
1436
1447
|
return {
|
|
1437
1448
|
async getGraphSnapshot(query = {}) {
|
|
1438
|
-
const model = await
|
|
1449
|
+
const [model, ownerName] = await Promise.all([
|
|
1450
|
+
getCachedModel(),
|
|
1451
|
+
fetchConfiguredOwnerName().catch(() => null),
|
|
1452
|
+
]);
|
|
1439
1453
|
const scopedGraph = graphViewForScope(model.summaries, model.edges, model.messageCountsByGroupId, query.scope);
|
|
1440
1454
|
const matchingSummaries = scopedGraph.summaries.filter((summary) => matchesQuery(summary, query));
|
|
1441
1455
|
const matchingGroupIds = new Set(matchingSummaries.map((summary) => summary.groupId));
|
|
1442
1456
|
const filteredEdges = scopedGraph.edges.filter((edge) => matchingGroupIds.has(edge.sourcePersonId) &&
|
|
1443
1457
|
matchingGroupIds.has(edge.targetPersonId));
|
|
1444
|
-
const decoratedSummaries = applyRelationshipCounts(matchingSummaries, filteredEdges);
|
|
1458
|
+
const decoratedSummaries = applyOwnerName(applyRelationshipCounts(matchingSummaries, filteredEdges), ownerName);
|
|
1445
1459
|
const offset = Math.max(0, query.offset ?? 0);
|
|
1446
1460
|
const limit = typeof query.limit === "number" && query.limit > 0
|
|
1447
1461
|
? query.limit
|
|
@@ -1465,14 +1479,17 @@ export function createNativeRelationshipsGraphService(runtime, relationshipsServ
|
|
|
1465
1479
|
};
|
|
1466
1480
|
},
|
|
1467
1481
|
async getPersonDetail(primaryEntityId) {
|
|
1468
|
-
const model = await
|
|
1482
|
+
const [model, ownerName] = await Promise.all([
|
|
1483
|
+
getCachedModel(),
|
|
1484
|
+
fetchConfiguredOwnerName().catch(() => null),
|
|
1485
|
+
]);
|
|
1469
1486
|
const cluster = Array.from(model.clusters.values()).find((entry) => entry.primaryEntityId === primaryEntityId ||
|
|
1470
1487
|
entry.memberEntityIds.includes(primaryEntityId)) ?? null;
|
|
1471
1488
|
if (!cluster) {
|
|
1472
1489
|
return null;
|
|
1473
1490
|
}
|
|
1474
|
-
const summary = applyRelationshipCounts(model.summaries.filter((entry) => entry.groupId === cluster.groupId), model.edges.filter((edge) => edge.sourcePersonId === cluster.groupId ||
|
|
1475
|
-
edge.targetPersonId === cluster.groupId))[0];
|
|
1491
|
+
const summary = applyOwnerName(applyRelationshipCounts(model.summaries.filter((entry) => entry.groupId === cluster.groupId), model.edges.filter((edge) => edge.sourcePersonId === cluster.groupId ||
|
|
1492
|
+
edge.targetPersonId === cluster.groupId)), ownerName)[0];
|
|
1476
1493
|
if (!summary) {
|
|
1477
1494
|
return null;
|
|
1478
1495
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterEditorPanels.d.ts","sourceRoot":"","sources":["../../../../../../src/components/character/CharacterEditorPanels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAQzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CharacterEditorPanels.d.ts","sourceRoot":"","sources":["../../../../../../src/components/character/CharacterEditorPanels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAQzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAkGnE,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE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AAE,IAAI,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CAC9D;AAID,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,eAAe,EACf,CAAC,GACF,EAAE,2BAA2B,2CAqB7B;AAID,wBAAgB,mBAAmB,CAAC,EAClC,CAAC,EACD,mBAAmB,EACnB,gBAAgB,EAChB,6BAA6B,EAC7B,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,CAAC,GACF,EAAE,wBAAwB,2CA2M1B;AAID,wBAAgB,sBAAsB,CAAC,EACrC,CAAC,EACD,yBAAyB,EACzB,eAAe,EACf,CAAC,GACF,EAAE,2BAA2B,2CAmU7B"}
|
|
@@ -7,8 +7,6 @@ const PlusIconSvg = ({ className }) => (_jsx("svg", { width: "10", height: "10",
|
|
|
7
7
|
const TrashIconSvg = ({ className }) => (_jsx("svg", { width: "11", height: "11", viewBox: "0 0 11 11", fill: "none", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", className: className, children: _jsx("path", { d: "M1.75 2.75h7.5M4 2.75V1.75h3v1M2.75 2.75l.4 6.75h4.7l.4-6.75" }) }));
|
|
8
8
|
/* ── Small grip icon shown as drag affordance ───────────────────── */
|
|
9
9
|
const GripIconSvg = ({ className }) => (_jsxs("svg", { width: "10", height: "14", viewBox: "0 0 10 14", fill: "currentColor", "aria-hidden": "true", className: className, children: [_jsx("circle", { cx: "3", cy: "3", r: "1" }), _jsx("circle", { cx: "3", cy: "7", r: "1" }), _jsx("circle", { cx: "3", cy: "11", r: "1" }), _jsx("circle", { cx: "7", cy: "3", r: "1" }), _jsx("circle", { cx: "7", cy: "7", r: "1" }), _jsx("circle", { cx: "7", cy: "11", r: "1" })] }));
|
|
10
|
-
const ArrowUpIconSvg = ({ className }) => (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", className: className, children: _jsx("path", { d: "M6 10V2M2.75 5.25 6 2l3.25 3.25" }) }));
|
|
11
|
-
const ArrowDownIconSvg = ({ className }) => (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", className: className, children: _jsx("path", { d: "M6 2v8M2.75 6.75 6 10l3.25-3.25" }) }));
|
|
12
10
|
const compactIconBtn = "inline-flex h-7 w-7 items-center justify-center rounded-sm border border-border/35 text-muted transition-colors hover:border-border/70 hover:bg-bg-muted/70 hover:text-txt focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/60 disabled:cursor-not-allowed disabled:opacity-35 disabled:hover:bg-transparent";
|
|
13
11
|
/* ── Style section constants ─────────────────────────────────────── */
|
|
14
12
|
const STYLE_SECTION_KEYS = ["all"];
|
|
@@ -24,32 +22,6 @@ const STYLE_SECTION_EMPTY_STATES = {
|
|
|
24
22
|
defaultValue: "No style rules yet.",
|
|
25
23
|
},
|
|
26
24
|
};
|
|
27
|
-
const STYLE_INTENT_GROUPS = [
|
|
28
|
-
{
|
|
29
|
-
id: "voice",
|
|
30
|
-
label: "Voice",
|
|
31
|
-
hint: "Tone, phrasing, vocabulary, and point of view.",
|
|
32
|
-
match: /\b(tone|voice|speak|writes?|sounds?|word|phrase|slang|grammar|sentence|style|humor|funny|serious|casual|formal|emoji)\b/i,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: "behavior",
|
|
36
|
-
label: "Behavior",
|
|
37
|
-
hint: "How the character acts, answers, and makes choices.",
|
|
38
|
-
match: /\b(should|always|never|avoid|prefer|respond|answer|ask|explain|focus|do not|don't|must|will|acts?|behavior)\b/i,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "boundaries",
|
|
42
|
-
label: "Boundaries",
|
|
43
|
-
hint: "Safety, limits, privacy, and things to refuse or avoid.",
|
|
44
|
-
match: /\b(refuse|limit|boundary|private|privacy|secret|safe|unsafe|harm|illegal|policy|disclose|medical|legal|financial)\b/i,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "general",
|
|
48
|
-
label: "General",
|
|
49
|
-
hint: "Rules that do not fit a specific intent yet.",
|
|
50
|
-
match: null,
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
25
|
function normalizeComparable(value) {
|
|
54
26
|
return value.trim().toLowerCase().replace(/\s+/g, " ");
|
|
55
27
|
}
|
|
@@ -63,15 +35,11 @@ function getDuplicateIndices(items) {
|
|
|
63
35
|
});
|
|
64
36
|
return new Set([...buckets.values()].filter((indices) => indices.length > 1).flat());
|
|
65
37
|
}
|
|
66
|
-
function getStyleIntentGroupId(item) {
|
|
67
|
-
return (STYLE_INTENT_GROUPS.find((group) => group.match?.test(item)) ??
|
|
68
|
-
STYLE_INTENT_GROUPS[STYLE_INTENT_GROUPS.length - 1]).id;
|
|
69
|
-
}
|
|
70
38
|
/* ── CharacterIdentityPanel ──────────────────────────────────────── */
|
|
71
39
|
export function CharacterIdentityPanel({ bioText, handleFieldEdit, t, }) {
|
|
72
40
|
return (_jsx("div", { className: "flex flex-col gap-5", children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-2xs font-semibold uppercase tracking-[0.08em] text-muted", children: t("charactereditor.AboutMe", { defaultValue: "About Me" }) }), _jsx(Textarea, { value: bioText, rows: 8, placeholder: t("charactereditor.AboutMePlaceholder", {
|
|
73
41
|
defaultValue: "Describe who your agent is...",
|
|
74
|
-
}), onChange: (e) => handleFieldEdit("bio", e.target.value), className: "w-full resize-
|
|
42
|
+
}), onChange: (e) => handleFieldEdit("bio", e.target.value), className: "w-full resize-none min-h-[8rem] overflow-x-hidden rounded-none border-0 border-b border-border/40 bg-transparent px-0 py-2 font-mono text-xs leading-relaxed text-txt focus-visible:border-accent/60 focus-visible:ring-0" })] }) }));
|
|
75
43
|
}
|
|
76
44
|
/* ── CharacterStylePanel ─────────────────────────────────────────── */
|
|
77
45
|
export function CharacterStylePanel({ d, pendingStyleEntries, styleEntryDrafts, handlePendingStyleEntryChange, handleAddStyleEntry, handleRemoveStyleEntry, handleStyleEntryDraftChange, handleCommitStyleEntry, handleReorderStyleEntries, t, }) {
|
|
@@ -90,50 +58,42 @@ export function CharacterStylePanel({ d, pendingStyleEntries, styleEntryDrafts,
|
|
|
90
58
|
}) })] }) }), _jsx("div", { className: "flex flex-col gap-5 min-h-0", children: STYLE_SECTION_KEYS.map((key) => {
|
|
91
59
|
const items = style?.[key] ?? [];
|
|
92
60
|
const duplicateIndices = getDuplicateIndices(items);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}), children: _jsx(GripIconSvg, {}) }), _jsx(Input, { value: styleEntryDrafts[key]?.[index] ?? item, onChange: (e) => handleStyleEntryDraftChange(key, index, e.target.value), onBlur: () => handleCommitStyleEntry(key, index), "aria-label": `${t(`charactereditor.StyleRules.${key}`, {
|
|
130
|
-
defaultValue: "Style rule",
|
|
131
|
-
})} ${index + 1}`, className: "h-9 min-w-0 flex-1 rounded-sm border border-border/25 bg-bg/60 px-2 text-sm text-txt focus-visible:border-accent/60 focus-visible:ring-0" }), isDuplicate ? (_jsx("span", { className: "shrink-0 rounded-sm bg-warning/15 px-1.5 py-0.5 text-[0.68rem] font-medium text-warning", children: t("charactereditor.DuplicateRule", {
|
|
132
|
-
defaultValue: "duplicate",
|
|
133
|
-
}) })) : null, _jsx("div", { className: "flex shrink-0 items-center", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-7 w-7 shrink-0 rounded-sm border border-border/35 p-0 text-muted transition-colors hover:border-danger/45 hover:bg-danger/10 hover:text-danger", onClick: () => handleRemoveStyleEntry(key, index), title: t("common.remove"), "aria-label": `${t("common.remove")} ${t(`charactereditor.StyleRules.${key}`, {
|
|
134
|
-
defaultValue: "style rule",
|
|
135
|
-
})} ${index + 1}`, children: _jsx(TrashIconSvg, {}) }) })] }, `${key}:${index}`));
|
|
136
|
-
}) })] }, group.id)))) : (_jsx("div", { className: "rounded-md border border-dashed border-border/40 bg-bg-muted/20 px-3 py-4 text-sm text-muted", children: t(STYLE_SECTION_EMPTY_STATES[key].key, {
|
|
61
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", "data-testid": `style-section-${key}`, children: [duplicateIndices.size > 0 ? (_jsx("div", { className: "flex flex-wrap items-center gap-2 text-xs text-muted", children: _jsxs("span", { className: "rounded-sm border border-warning/50 bg-warning/10 px-2 py-1 text-warning", children: [duplicateIndices.size, " ", t("charactereditor.PossibleDuplicates", {
|
|
62
|
+
defaultValue: "possible duplicates",
|
|
63
|
+
})] }) })) : null, _jsx("div", { className: "flex flex-col gap-1", children: items.length > 0 ? (items.map((item, index) => {
|
|
64
|
+
const isDragging = dragStyleIndex?.key === key &&
|
|
65
|
+
dragStyleIndex.index === index;
|
|
66
|
+
const isDuplicate = duplicateIndices.has(index);
|
|
67
|
+
return (_jsxs("fieldset", { draggable: true, onDragStart: (e) => {
|
|
68
|
+
setDragStyleIndex({ key, index });
|
|
69
|
+
e.dataTransfer.effectAllowed = "move";
|
|
70
|
+
}, onDragOver: (e) => {
|
|
71
|
+
if (dragStyleIndex === null ||
|
|
72
|
+
dragStyleIndex.key !== key ||
|
|
73
|
+
dragStyleIndex.index === index)
|
|
74
|
+
return;
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
e.dataTransfer.dropEffect = "move";
|
|
77
|
+
}, onDrop: (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
if (dragStyleIndex === null ||
|
|
80
|
+
dragStyleIndex.key !== key ||
|
|
81
|
+
dragStyleIndex.index === index)
|
|
82
|
+
return;
|
|
83
|
+
handleReorderStyleEntries(key, reorderStyle(items, dragStyleIndex.index, index));
|
|
84
|
+
setDragStyleIndex(null);
|
|
85
|
+
}, onDragEnd: () => setDragStyleIndex(null), className: `group flex min-w-0 items-center gap-2 px-0 py-1 transition-opacity ${isDuplicate ? "" : ""} ${isDragging ? "opacity-40" : ""}`, children: [_jsx("span", { className: "shrink-0 text-muted opacity-60 cursor-grab active:cursor-grabbing select-none", "aria-hidden": "true", title: t("charactereditor.DragToReorder", {
|
|
86
|
+
defaultValue: "Drag to reorder",
|
|
87
|
+
}), children: _jsx(GripIconSvg, {}) }), _jsx(Input, { value: styleEntryDrafts[key]?.[index] ?? item, onChange: (e) => handleStyleEntryDraftChange(key, index, e.target.value), onBlur: () => handleCommitStyleEntry(key, index), "aria-label": `${t(`charactereditor.StyleRules.${key}`, {
|
|
88
|
+
defaultValue: "Style rule",
|
|
89
|
+
})} ${index + 1}`, className: `h-8 min-w-0 flex-1 rounded-none border-0 border-b bg-transparent px-0 text-sm text-txt focus-visible:ring-0 ${isDuplicate
|
|
90
|
+
? "border-warning/60 focus-visible:border-warning"
|
|
91
|
+
: "border-border/30 focus-visible:border-accent/60"}` }), isDuplicate ? (_jsx("span", { className: "shrink-0 rounded-sm bg-warning/15 px-1.5 py-0.5 text-[0.68rem] font-medium text-warning", children: t("charactereditor.DuplicateRule", {
|
|
92
|
+
defaultValue: "duplicate",
|
|
93
|
+
}) })) : null, _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-7 w-7 shrink-0 rounded-sm p-0 text-muted opacity-0 transition-colors hover:text-danger group-hover:opacity-100 focus-visible:opacity-100", onClick: () => handleRemoveStyleEntry(key, index), title: t("common.remove"), "aria-label": `${t("common.remove")} ${t(`charactereditor.StyleRules.${key}`, {
|
|
94
|
+
defaultValue: "style rule",
|
|
95
|
+
})} ${index + 1}`, children: _jsx(TrashIconSvg, {}) })] }, `${key}:${index}`));
|
|
96
|
+
})) : (_jsx("div", { className: "rounded-md border border-dashed border-border/40 bg-bg-muted/20 px-3 py-4 text-sm text-muted", children: t(STYLE_SECTION_EMPTY_STATES[key].key, {
|
|
137
97
|
defaultValue: STYLE_SECTION_EMPTY_STATES[key].defaultValue,
|
|
138
98
|
}) })) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Input, { type: "text", value: pendingStyleEntries[key], placeholder: t(STYLE_SECTION_PLACEHOLDERS[key].key, {
|
|
139
99
|
defaultValue: STYLE_SECTION_PLACEHOLDERS[key].defaultValue,
|
|
@@ -162,30 +122,13 @@ export function CharacterExamplesPanel({ d, normalizedMessageExamples, handleFie
|
|
|
162
122
|
next.splice(to, 0, moved);
|
|
163
123
|
return next;
|
|
164
124
|
};
|
|
165
|
-
const movePostExample = (from, to) => {
|
|
166
|
-
if (to < 0 || to >= postExamples.length)
|
|
167
|
-
return;
|
|
168
|
-
handleFieldEdit("postExamples", reorder(postExamples, from, to));
|
|
169
|
-
};
|
|
170
125
|
return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("section", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-2", children: [_jsxs("div", { children: [_jsx("span", { className: "text-2xs font-semibold uppercase tracking-[0.08em] text-muted", children: t("charactereditor.ChatExamples", {
|
|
171
126
|
defaultValue: "Chat Examples",
|
|
172
127
|
}) }), _jsx("p", { className: "mt-1 text-xs text-muted", children: t("charactereditor.ChatExamplesHelp", {
|
|
173
128
|
defaultValue: "Example conversations grouped by channel and speaker.",
|
|
174
129
|
}) })] }), _jsxs("span", { className: "rounded-sm border border-border/40 px-2 py-1 text-xs text-muted", children: [normalizedMessageExamples.length, " ", t("charactereditor.ConversationCount", {
|
|
175
130
|
defaultValue: "conversations",
|
|
176
|
-
})] })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [normalizedMessageExamples.map((convo, ci) => (_jsxs("div", { className: "flex flex-col gap-2 rounded-md border border-border/35 bg-bg-muted/15 p-3", children: [_jsxs("div", { className: "
|
|
177
|
-
defaultValue: "Conversation",
|
|
178
|
-
}), " ", ci + 1] }), _jsxs("span", { className: "text-[0.68rem] text-muted", children: [convo.examples.length, " ", t("charactereditor.TurnCount", {
|
|
179
|
-
defaultValue: "turns",
|
|
180
|
-
})] })] }), _jsx("button", { type: "button", className: compactIconBtn, onClick: () => {
|
|
181
|
-
const updated = [...normalizedMessageExamples];
|
|
182
|
-
updated.splice(ci, 1);
|
|
183
|
-
handleFieldEdit("messageExamples", updated);
|
|
184
|
-
}, title: t("charactereditor.RemoveExample", {
|
|
185
|
-
defaultValue: "Remove conversation",
|
|
186
|
-
}), "aria-label": `${t("common.remove")} conversation ${ci + 1}`, children: _jsx(TrashIconSvg, {}) })] }), convo.examples.map((msg, mi) => (_jsxs("div", { className: "grid min-w-0 grid-cols-[4.5rem_1fr] items-start gap-2", children: [_jsx("span", { className: `mt-2 rounded-sm border px-2 py-1 text-center text-[0.68rem] font-semibold uppercase tracking-[0.06em] ${msg.name === "{{user1}}"
|
|
187
|
-
? "border-border/40 text-muted"
|
|
188
|
-
: "border-accent/35 bg-accent/10 text-accent"}`, children: msg.name === "{{user1}}" ? "user" : "agent" }), _jsx(Textarea, { value: msg.content?.text ?? "", rows: 2, "aria-label": `${msg.name === "{{user1}}" ? "User" : "Agent"} message, conversation ${ci + 1}, turn ${mi + 1}`, onChange: (e) => {
|
|
131
|
+
})] })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [normalizedMessageExamples.map((convo, ci) => (_jsxs("div", { className: "group/convo flex flex-col gap-2 rounded-md border border-border/35 bg-bg-muted/15 p-3", children: [convo.examples.map((msg, mi) => (_jsxs("div", { className: "grid min-w-0 grid-cols-[4.5rem_1fr] items-start gap-2", children: [_jsx("span", { className: `mt-2 px-2 py-1 text-center text-[0.68rem] font-semibold uppercase tracking-[0.06em] ${msg.name === "{{user1}}" ? "text-muted" : "text-accent"}`, children: msg.name === "{{user1}}" ? "user" : "agent" }), _jsx(Textarea, { value: msg.content?.text ?? "", rows: 2, "aria-label": `${msg.name === "{{user1}}" ? "User" : "Agent"} message, conversation ${ci + 1}, turn ${mi + 1}`, onChange: (e) => {
|
|
189
132
|
const updated = [...normalizedMessageExamples];
|
|
190
133
|
const convoClone = {
|
|
191
134
|
examples: [...updated[ci].examples],
|
|
@@ -196,27 +139,33 @@ export function CharacterExamplesPanel({ d, normalizedMessageExamples, handleFie
|
|
|
196
139
|
};
|
|
197
140
|
updated[ci] = convoClone;
|
|
198
141
|
handleFieldEdit("messageExamples", updated);
|
|
199
|
-
}, className: "min-h-[3rem] w-full resize-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
defaultValue: "Add turn",
|
|
217
|
-
}), children: [_jsx(PlusIconSvg, {}), t("charactereditor.AddTurn", {
|
|
142
|
+
}, className: "min-h-[3rem] w-full resize-none rounded-sm border border-border/30 bg-bg/70 px-2 py-1.5 text-sm leading-relaxed text-txt focus-visible:border-accent/60 focus-visible:ring-0" })] }, `msg-${ci}-${mi}`))), _jsxs("div", { className: "mt-1 flex items-center justify-end gap-2", children: [_jsxs("button", { type: "button", className: "inline-flex h-8 items-center gap-2 rounded-md border border-border/40 px-2.5 text-xs font-medium text-txt transition-colors hover:bg-bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/60", onClick: () => {
|
|
143
|
+
const agentName = typeof d.name === "string" && d.name.trim()
|
|
144
|
+
? d.name.trim()
|
|
145
|
+
: "Agent";
|
|
146
|
+
const updated = [...normalizedMessageExamples];
|
|
147
|
+
const convoClone = {
|
|
148
|
+
examples: [
|
|
149
|
+
...updated[ci].examples,
|
|
150
|
+
{ name: "{{user1}}", content: { text: "" } },
|
|
151
|
+
{ name: agentName, content: { text: "" } },
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
updated[ci] = convoClone;
|
|
155
|
+
handleFieldEdit("messageExamples", updated);
|
|
156
|
+
}, title: t("charactereditor.AddTurn", {
|
|
157
|
+
defaultValue: "Add turn",
|
|
158
|
+
}), "aria-label": t("charactereditor.AddTurn", {
|
|
218
159
|
defaultValue: "Add turn",
|
|
219
|
-
})
|
|
160
|
+
}), children: [_jsx(PlusIconSvg, {}), t("charactereditor.AddTurn", {
|
|
161
|
+
defaultValue: "Add turn",
|
|
162
|
+
})] }), _jsx("button", { type: "button", className: compactIconBtn, onClick: () => {
|
|
163
|
+
const updated = [...normalizedMessageExamples];
|
|
164
|
+
updated.splice(ci, 1);
|
|
165
|
+
handleFieldEdit("messageExamples", updated);
|
|
166
|
+
}, title: t("charactereditor.RemoveExample", {
|
|
167
|
+
defaultValue: "Remove conversation",
|
|
168
|
+
}), "aria-label": `${t("common.remove")} conversation ${ci + 1}`, children: _jsx(TrashIconSvg, {}) })] })] }, `convo-${ci}`))), normalizedMessageExamples.length === 0 && (_jsx("div", { className: "rounded-md border border-dashed border-border/40 bg-bg-muted/20 px-3 py-4 text-sm text-muted", children: t("charactereditor.NoChatExamples", {
|
|
220
169
|
defaultValue: "No chat examples yet.",
|
|
221
170
|
}) }))] }), _jsxs("button", { type: "button", className: "inline-flex h-9 self-start items-center gap-2 rounded-md border border-accent/35 px-3 text-sm font-medium text-accent transition-colors hover:bg-accent/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/60", onClick: () => {
|
|
222
171
|
const agentName = typeof d.name === "string" && d.name.trim()
|
|
@@ -275,21 +224,13 @@ export function CharacterExamplesPanel({ d, normalizedMessageExamples, handleFie
|
|
|
275
224
|
const updated = [...postExamples];
|
|
276
225
|
updated[pi] = e.target.value;
|
|
277
226
|
handleFieldEdit("postExamples", updated);
|
|
278
|
-
}, className: "min-h-[4.25rem] w-full resize-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
defaultValue: "Move post down",
|
|
286
|
-
})} ${pi + 1}`, children: _jsx(ArrowDownIconSvg, {}) }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-7 w-7 shrink-0 rounded-sm border border-border/35 p-0 text-muted transition-colors hover:border-danger/45 hover:bg-danger/10 hover:text-danger", onClick: () => {
|
|
287
|
-
const updated = [...postExamples];
|
|
288
|
-
updated.splice(pi, 1);
|
|
289
|
-
handleFieldEdit("postExamples", updated);
|
|
290
|
-
}, "aria-label": `${t("common.remove")} post ${pi + 1}`, title: t("charactereditor.RemovePost", {
|
|
291
|
-
defaultValue: "Remove post",
|
|
292
|
-
}), children: _jsx(TrashIconSvg, {}) })] })] }, `post-${pi}`));
|
|
227
|
+
}, className: "min-h-[4.25rem] w-full resize-none rounded-sm border border-border/30 bg-bg/70 px-2 py-1.5 text-sm leading-relaxed text-txt focus-visible:border-accent/60 focus-visible:ring-0" })] }), _jsx("div", { className: "flex shrink-0 flex-col gap-1", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-7 w-7 shrink-0 rounded-sm border border-border/35 p-0 text-muted transition-colors hover:border-danger/45 hover:bg-danger/10 hover:text-danger", onClick: () => {
|
|
228
|
+
const updated = [...postExamples];
|
|
229
|
+
updated.splice(pi, 1);
|
|
230
|
+
handleFieldEdit("postExamples", updated);
|
|
231
|
+
}, "aria-label": `${t("common.remove")} post ${pi + 1}`, title: t("charactereditor.RemovePost", {
|
|
232
|
+
defaultValue: "Remove post",
|
|
233
|
+
}), children: _jsx(TrashIconSvg, {}) }) })] }, `post-${pi}`));
|
|
293
234
|
}), postExamples.length === 0 && (_jsx("div", { className: "rounded-md border border-dashed border-border/40 bg-bg-muted/20 px-3 py-4 text-sm text-muted", children: t("charactereditor.NoPostExamples", {
|
|
294
235
|
defaultValue: "No post examples yet.",
|
|
295
236
|
}) })), _jsxs("button", { type: "button", className: "mt-1 inline-flex h-9 self-start items-center gap-2 rounded-md border border-accent/35 px-3 text-sm font-medium text-accent transition-colors hover:bg-accent/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/60", onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterHubView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/character/CharacterHubView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"CharacterHubView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/character/CharacterHubView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA4BzD,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,wBAAwB,CAAC;AAyBhC,KAAK,qBAAqB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAgKrD,wBAAgB,gBAAgB,CAAC,EAC/B,CAAC,EACD,OAAO,EACP,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,6BAA6B,EAC7B,cAAc,EACd,2BAA2B,EAC3B,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,GACP,EAAE;IACD,CAAC,EAAE,aAAa,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB,EAAE,mBAAmB,EAAE,CAAC;IACjD,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C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