@crossworks/client-types 0.232.83 → 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 +35 -0
- package/src/journey-format.ts +14 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -326,6 +326,36 @@ export interface PersonaNoteDTO {
|
|
|
326
326
|
supersededBy?: string;
|
|
327
327
|
}
|
|
328
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
|
+
|
|
329
359
|
/** An agent as returned by `GET /api/agents` (and `…/[id]`). Dates are ISO
|
|
330
360
|
* strings. The server aliases its `AgentSummary` to this so the wire shape and
|
|
331
361
|
* the consuming client can't drift. */
|
|
@@ -371,6 +401,11 @@ export interface AgentDTO {
|
|
|
371
401
|
manifestManaged: boolean;
|
|
372
402
|
lastUsedAt: string | null;
|
|
373
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;
|
|
374
409
|
createdAt: string;
|
|
375
410
|
updatedAt: string;
|
|
376
411
|
}
|
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 };
|