@axiom-lattice/protocols 4.2.2 → 4.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": "@axiom-lattice/protocols",
3
- "version": "4.2.2",
3
+ "version": "4.3.0",
4
4
  "description": "Unified protocol type definitions for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,11 +21,21 @@ export interface AgentWebAppFeatures {
21
21
  files?: boolean;
22
22
  }
23
23
 
24
+ /** One quick-start suggestion offered in the Web App chat empty state. */
25
+ export interface AgentWebAppQuickPrompt {
26
+ /** Button label, 1–40 chars. */
27
+ label: string;
28
+ /** Message text sent when the prompt is chosen, 1–500 chars. */
29
+ text: string;
30
+ }
31
+
24
32
  /** Optional display customization for an Agent Web App. */
25
33
  export interface AgentWebAppAppearance {
26
34
  title?: string;
27
35
  welcomeMessage?: string;
28
36
  primaryColor?: string;
37
+ /** Up to 6 quick-start suggestions for the chat empty state. */
38
+ quickPrompts?: AgentWebAppQuickPrompt[];
29
39
  }
30
40
 
31
41
  /** Identity assurance levels reported by the runtime. */
@@ -34,4 +34,14 @@ export interface ProjectRoomMessageStore {
34
34
  after: Date;
35
35
  excludeAuthorUserId?: string;
36
36
  }): Promise<number>;
37
+
38
+ /**
39
+ * Deletes one bounded batch of chat messages (`source: "user" | "agent"`) older than a horizon.
40
+ *
41
+ * @param input Exclusive upper time bound and maximum batch size (clamped by the store).
42
+ * @returns The number of deleted rows; callers loop until it returns fewer than the requested batch.
43
+ * @remarks Task/system/routine events are immutable room history and are never deleted. Deletes are
44
+ * idempotent and safe under concurrent maintenance runs.
45
+ */
46
+ deleteChatOlderThan(input: { before: Date; limit: number }): Promise<number>;
37
47
  }
@@ -54,11 +54,24 @@ export interface WorkspaceStore {
54
54
  * Project kind classification
55
55
  *
56
56
  * Defaults to "business" for legacy rows and omitted input.
57
- * "public" is reserved for the automatically ensured workspace public room;
58
- * user-facing project create/update APIs reject it.
57
+ * "public" marks a project visible to every member of the workspace;
58
+ * user-facing project create/update APIs accept it, but the automatically
59
+ * ensured workspace public room (see WORKSPACE_PUBLIC_ROOM_PROJECT_PREFIX)
60
+ * is protected from rename/delete.
59
61
  */
60
62
  export type ProjectKind = "business" | "training" | "personal" | "public";
61
63
 
64
+ /**
65
+ * Project id prefix for the automatically ensured workspace public room.
66
+ * Projects with this prefix are synthetic: they are pinned in CoSpace and
67
+ * excluded from the user-facing Projects list.
68
+ */
69
+ export const WORKSPACE_PUBLIC_ROOM_PROJECT_PREFIX = "workspace_public_";
70
+
71
+ export function isWorkspacePublicRoomProjectId(projectId: string): boolean {
72
+ return projectId.startsWith(WORKSPACE_PUBLIC_ROOM_PROJECT_PREFIX);
73
+ }
74
+
62
75
  /**
63
76
  * Project type definition
64
77
  */
@@ -4,6 +4,7 @@ import type {
4
4
  AgentWebAppError,
5
5
  AgentWebAppErrorCode,
6
6
  AgentWebAppFeatures,
7
+ AgentWebAppQuickPrompt,
7
8
  AgentWebAppRuntimeThread,
8
9
  AgentWebAppScope,
9
10
  AgentWebAppStore,
@@ -32,13 +33,15 @@ type CreateAgentWebAppInputKeys =
32
33
  | "integration"
33
34
  | "scope"
34
35
  | "features"
35
- | "appearance";
36
+ | "appearance"
37
+ | "identity";
36
38
  type UpdateAgentWebAppInputKeys =
37
39
  | "name"
38
40
  | "description"
39
41
  | "scope"
40
42
  | "features"
41
- | "appearance";
43
+ | "appearance"
44
+ | "identity";
42
45
  type AgentWebAppStorePatchKeys = UpdateAgentWebAppInputKeys | "status";
43
46
 
44
47
  type _CreateInputHasExactKeys = Expect<
@@ -83,8 +86,13 @@ type AgentWebAppBootstrapFeatureKeys =
83
86
  | "threadManagement"
84
87
  | "attachments"
85
88
  | "hitl"
86
- | "genUI";
87
- type AgentWebAppBootstrapAppearanceKeys = "title" | "welcomeMessage" | "primaryColor";
89
+ | "genUI"
90
+ | "files";
91
+ type AgentWebAppBootstrapAppearanceKeys =
92
+ | "title"
93
+ | "welcomeMessage"
94
+ | "primaryColor"
95
+ | "quickPrompts";
88
96
 
89
97
  type _BootstrapHasExactTopLevelKeys = Expect<
90
98
  Equal<keyof AgentWebAppBootstrap, AgentWebAppBootstrapKeys>
@@ -164,6 +172,11 @@ const features = {
164
172
  genUI: true,
165
173
  } satisfies CreateAgentWebAppInput["features"];
166
174
 
175
+ const quickPrompt: AgentWebAppQuickPrompt = {
176
+ label: "Pricing",
177
+ text: "How much does it cost?",
178
+ };
179
+
167
180
  const createInput = {
168
181
  assistantId: "assistant-1",
169
182
  name: "Customer portal",
@@ -176,7 +189,7 @@ const createInput = {
176
189
  allowedModelKeys: ["model-1", "model-2"],
177
190
  },
178
191
  features,
179
- appearance: { title: "Support", primaryColor: "#123456" },
192
+ appearance: { title: "Support", primaryColor: "#123456", quickPrompts: [quickPrompt] },
180
193
  } satisfies CreateAgentWebAppInput;
181
194
 
182
195
  const webApp = {