@m6d/cortex-angular 0.1.1 → 0.3.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m6d/cortex-angular",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Reusable AI agent chat UI library for Angular",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -10,11 +10,6 @@ declare const LOCALES: readonly [
10
10
  "ar"
11
11
  ];
12
12
  export type Locale = (typeof LOCALES)[number];
13
- declare const TOOL_SURFACES: readonly [
14
- "inline",
15
- "modal"
16
- ];
17
- export type ToolSurface = (typeof TOOL_SURFACES)[number];
18
13
  declare const ATTACHMENT_STATUSES: readonly [
19
14
  "pending",
20
15
  "described",
@@ -47,32 +42,6 @@ export type ThreadSummary = {
47
42
  name: string;
48
43
  };
49
44
  };
50
- export type TokenUsage = {
51
- input: {
52
- noCache: number;
53
- cacheRead: number;
54
- cacheWrite: number;
55
- total: number;
56
- };
57
- output: {
58
- reasoning: number;
59
- text: number;
60
- total: number;
61
- };
62
- total: number;
63
- };
64
- /**
65
- * How to launch one client tool: stamped by the server, per tool name, on
66
- * the metadata of an assistant message that may carry its pending call. Kept in
67
- * the message so the binding survives server restarts while a run is parked.
68
- */
69
- export type ClientToolBinding = {
70
- toolId: string;
71
- surface: ToolSurface;
72
- embedOrigin: string;
73
- /** Variables the initiate call's input reads. */
74
- variables: string[];
75
- };
76
45
  /**
77
46
  * What the server offers this agent's clients, fetched once at widget startup.
78
47
  * The widget hides UI for anything absent; enforcement stays server-side.
@@ -86,18 +55,6 @@ export type AgentCapabilities = {
86
55
  /** Headline of the blank-chat landing per locale; "" falls back to the widget's built-in copy. */
87
56
  greeting: Greeting;
88
57
  };
89
- export type MessageMetadata = {
90
- /** ISO time the server stored the message; stamped from the row when a transcript is served. */
91
- createdAt?: string;
92
- modelId?: string;
93
- providerMetadata?: unknown;
94
- isAborted?: boolean;
95
- tokenUsage?: TokenUsage;
96
- attachments?: AttachmentSummary[];
97
- clientTools?: Record<string, ClientToolBinding>;
98
- /** Set on `trigger` messages: the firing that wrote them. */
99
- trigger?: TriggerFiringSummary;
100
- };
101
58
  /**
102
59
  * One landing-page chip: the widget shows `title` and sends `prompt` as the
103
60
  * first message when clicked. The two may be the same text.
@@ -109,12 +66,6 @@ export type Suggestion = {
109
66
  /** The runtime contract's `suggestionsSchema` and `greetingSchema` are built from these. */
110
67
  export type Suggestions = Record<Locale, Suggestion[]>;
111
68
  export type Greeting = Record<Locale, string>;
112
- export type TriggerFiringSummary = {
113
- name: string;
114
- firingId: string;
115
- firedAt: string;
116
- payload: unknown;
117
- };
118
69
  export type CortexHeaders = Record<string, string>;
119
70
  /**
120
71
  * How the widget reaches its cortex server. `baseUrl` may be a thunk so a host
@@ -287,13 +238,6 @@ declare class CortexChatService {
287
238
  * only resolves once the continuation turn ends, far too late to gate UI on.
288
239
  */
289
240
  readonly hasPendingToolCalls: import("@angular/core").Signal<boolean>;
290
- /**
291
- * The per-message facts the SDK's `UIMessage` has no room for — usage, model
292
- * id, the aborted flag, attachments. They are cortex's own envelope around the
293
- * stored parts, so they arrive with the persisted transcript rather than over
294
- * the stream, and are merged back in by message id at render time.
295
- */
296
- readonly messageMetadata: import("@angular/core").WritableSignal<ReadonlyMap<string, MessageMetadata>>;
297
241
  /** What the server offers this agent's clients; undefined until the handshake answers. */
298
242
  readonly capabilities: import("@angular/core").WritableSignal<AgentCapabilities | undefined>;
299
243
  private readonly events;
@@ -361,13 +305,6 @@ declare class CortexChatService {
361
305
  private createConnection;
362
306
  private refreshMessages;
363
307
  private readBackMessages;
364
- /**
365
- * Server rows are merged over what is held, never swapped in: the entry this
366
- * client seeded for a message it just sent must outlive a hydration or
367
- * read-back that started before the send.
368
- */
369
- private absorbMetadata;
370
- private setMetadata;
371
308
  private subscribeToWsEvents;
372
309
  /**
373
310
  * Only what these events mean for the open conversation — their list-shaped