@crossworks/client-types 0.232.82 → 0.232.85
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 +1 -1
- package/src/index.ts +51 -9
- package/src/journey-format.ts +14 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -260,7 +260,12 @@ export interface AgentAvatarDTO {
|
|
|
260
260
|
seed: string;
|
|
261
261
|
/** Avatar-builder component choices layered over the seed: component name →
|
|
262
262
|
* pinned variant, or null to hide an optional component. Stale entries
|
|
263
|
-
* (from another style) are ignored at render time.
|
|
263
|
+
* (from another style) are ignored at render time.
|
|
264
|
+
*
|
|
265
|
+
* READ: absent = seed only. WRITE protocol (agents create/patch): an
|
|
266
|
+
* ABSENT parts key means "keep what's stored" — so a parts-unaware client
|
|
267
|
+
* can never wipe pins — `{}` is the explicit clear, and a non-empty map
|
|
268
|
+
* replaces. Every client that writes avatars must send `{}` to clear. */
|
|
264
269
|
parts?: Record<string, string | null>;
|
|
265
270
|
}
|
|
266
271
|
|
|
@@ -321,6 +326,36 @@ export interface PersonaNoteDTO {
|
|
|
321
326
|
supersededBy?: string;
|
|
322
327
|
}
|
|
323
328
|
|
|
329
|
+
/** Raw counters behind an agent's experience level — always shipped next to
|
|
330
|
+
* the level so the UI can show WHY it is level N. All are lifetime counts for
|
|
331
|
+
* THIS brain (experience is per-brain, display-only — never a trust gate). */
|
|
332
|
+
export interface AgentExperienceComponentsDTO {
|
|
333
|
+
/** Completed conversation turns this agent answered on the assistant
|
|
334
|
+
* stream (web, Telegram, mobile). Team/forum turns live in a different
|
|
335
|
+
* store and are not counted (yet). */
|
|
336
|
+
turns: number;
|
|
337
|
+
/** Tool calls that succeeded across those turns. */
|
|
338
|
+
toolSuccesses: number;
|
|
339
|
+
/** Delegated runs this agent completed for other agents. */
|
|
340
|
+
delegations: number;
|
|
341
|
+
/** Heartbeat fires this agent completed. */
|
|
342
|
+
heartbeats: number;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/** An agent's experience readout — a soft-capped level derived from real
|
|
346
|
+
* accumulated usage (see `agent-experience.ts` server-side for the weights
|
|
347
|
+
* and curve). Computed at read time; nothing is stored. */
|
|
348
|
+
export interface AgentExperienceDTO {
|
|
349
|
+
level: number;
|
|
350
|
+
/** Total XP earned. */
|
|
351
|
+
xp: number;
|
|
352
|
+
/** Cumulative XP at which the current level began. */
|
|
353
|
+
levelXp: number;
|
|
354
|
+
/** Cumulative XP needed to reach the next level. */
|
|
355
|
+
nextLevelXp: number;
|
|
356
|
+
components: AgentExperienceComponentsDTO;
|
|
357
|
+
}
|
|
358
|
+
|
|
324
359
|
/** An agent as returned by `GET /api/agents` (and `…/[id]`). Dates are ISO
|
|
325
360
|
* strings. The server aliases its `AgentSummary` to this so the wire shape and
|
|
326
361
|
* the consuming client can't drift. */
|
|
@@ -366,6 +401,11 @@ export interface AgentDTO {
|
|
|
366
401
|
manifestManaged: boolean;
|
|
367
402
|
lastUsedAt: string | null;
|
|
368
403
|
usageCount: number;
|
|
404
|
+
/** Experience readout (level + raw counters). Optional: filled on the list
|
|
405
|
+
* reads the agent screens use (`GET /api/agents`, the assistant thread
|
|
406
|
+
* bundle); absent on single-row CRUD echoes where computing it would cost
|
|
407
|
+
* extra queries for nothing. */
|
|
408
|
+
experience?: AgentExperienceDTO;
|
|
369
409
|
createdAt: string;
|
|
370
410
|
updatedAt: string;
|
|
371
411
|
}
|
|
@@ -930,16 +970,18 @@ export type ProfilePreferences = {
|
|
|
930
970
|
* so an avatar still renders. Personal — two admins share the brain's style
|
|
931
971
|
* but never the same avatar. */
|
|
932
972
|
avatarSeed?: string;
|
|
933
|
-
/** Avatar-builder component choices for THIS
|
|
934
|
-
* seed: component name → pinned variant, or null to hide an optional
|
|
935
|
-
* component.
|
|
936
|
-
* brain style) are ignored at render time.
|
|
973
|
+
/** Avatar-builder component choices for THIS login's avatar, layered over
|
|
974
|
+
* the seed: component name → pinned variant, or null to hide an optional
|
|
975
|
+
* component. Per-login (the profile routes address the ACTOR's row). Stale
|
|
976
|
+
* entries (saved under another brain style) are ignored at render time.
|
|
977
|
+
* READ: absent/empty = seed only. WRITE (profile PUT): applied only when
|
|
978
|
+
* SENT; `{}` clears. */
|
|
937
979
|
avatarParts?: Record<string, string | null>;
|
|
938
|
-
/** Content-addressed storage key of THIS
|
|
980
|
+
/** Content-addressed storage key of THIS login's uploaded profile PHOTO —
|
|
939
981
|
* when set, clients show the photo instead of the generated avatar
|
|
940
|
-
* (photo → generated seed → initials).
|
|
941
|
-
* from Settings → Profile, never for agents.
|
|
942
|
-
* GET /api/profile/photo (cookie or asset token). */
|
|
982
|
+
* (photo → generated seed → initials). Per-login (the photo routes address
|
|
983
|
+
* the ACTOR's row); set only from Settings → Profile, never for agents.
|
|
984
|
+
* Served privately by GET /api/profile/photo (cookie or asset token). */
|
|
943
985
|
avatarPhotoKey?: string;
|
|
944
986
|
/** Content-Type of the photo bytes (png/jpeg/webp — never SVG). */
|
|
945
987
|
avatarPhotoType?: string;
|
package/src/journey-format.ts
CHANGED
|
@@ -247,6 +247,20 @@ export type ActivityItem = ActionPresentation & {
|
|
|
247
247
|
factCount: number;
|
|
248
248
|
mentionCount: number;
|
|
249
249
|
relationCount: number;
|
|
250
|
+
/** Who performed the action. Null for pipeline traces that carry no agent
|
|
251
|
+
* (extractor/summarizer runs identify via workerSlug instead; ingest and
|
|
252
|
+
* federation traces have neither). */
|
|
253
|
+
agentId: string | null;
|
|
254
|
+
agentName: string | null;
|
|
255
|
+
agentSlug: string | null;
|
|
256
|
+
/** Seed for GeneratedAvatar: the agent's stored avatar seed, falling back
|
|
257
|
+
* to its slug (same convention the settings screens use). */
|
|
258
|
+
avatarSeed: string | null;
|
|
259
|
+
/** ai-worker identity for worker-driven traces (extractor, summarizer). */
|
|
260
|
+
workerSlug: string | null;
|
|
261
|
+
/** Set on delegated child runs (invoke_agent) — the parent trace's id, so
|
|
262
|
+
* the UI can nest fan-out under the delegating turn. */
|
|
263
|
+
parentTraceId: string | null;
|
|
250
264
|
};
|
|
251
265
|
|
|
252
266
|
export type JourneyDetail = TraceDetail & { landed: LandedLayers | null };
|