@m6d/cortex-cli 1.9.0 → 1.10.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
|
@@ -48,6 +48,29 @@ export const JSON_SCHEMA_ISSUE_KINDS = ["missing", "unexpected", "type_mismatch"
|
|
|
48
48
|
|
|
49
49
|
export const agentSlugSchema = z.string().regex(AGENT_SLUG_PATTERN);
|
|
50
50
|
export const localeSchema = z.enum(["en", "ar"]);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The widget's landing-page prompt chips, per locale. Every source of them
|
|
54
|
+
* (the Control Center agent row, a server-code override, the capabilities
|
|
55
|
+
* handshake) stores this exact shape, so the widget never sees a blank or
|
|
56
|
+
* unbounded chip whichever source won. Pure validation, no transforms: a
|
|
57
|
+
* value that passes is served verbatim, so each source trims before it
|
|
58
|
+
* stores.
|
|
59
|
+
*/
|
|
60
|
+
export const SUGGESTION_LIMITS = { perLocale: 6, chipLength: 200 } as const;
|
|
61
|
+
export const suggestionsSchema = z.record(
|
|
62
|
+
localeSchema,
|
|
63
|
+
z
|
|
64
|
+
.array(
|
|
65
|
+
z
|
|
66
|
+
.string()
|
|
67
|
+
.min(1)
|
|
68
|
+
.max(SUGGESTION_LIMITS.chipLength)
|
|
69
|
+
.refine((chip) => chip === chip.trim(), "chip has surrounding whitespace"),
|
|
70
|
+
)
|
|
71
|
+
.max(SUGGESTION_LIMITS.perLocale),
|
|
72
|
+
);
|
|
73
|
+
export type Suggestions = z.infer<typeof suggestionsSchema>;
|
|
51
74
|
export const catalogVersionSchema = z.string().regex(/^[0-9a-f]{16}$/);
|
|
52
75
|
|
|
53
76
|
export const sharedShapeSchema = z.object({
|
|
@@ -370,6 +393,8 @@ export const runtimeAgentConfigSchema = z.object({
|
|
|
370
393
|
triggers: z.array(triggerDeclarationSchema).default([]),
|
|
371
394
|
/** Whether end users may message this agent; false makes it headless. */
|
|
372
395
|
messageTrigger: z.boolean().default(true),
|
|
396
|
+
/** Operational like `messageTrigger`: edited on the agent row without republishing. */
|
|
397
|
+
suggestions: suggestionsSchema,
|
|
373
398
|
/** Absent from older Control Centers; reports then carry only the slug. */
|
|
374
399
|
agentRef: agentRefSchema.optional(),
|
|
375
400
|
catalogVersion: catalogVersionSchema,
|
|
@@ -99,6 +99,8 @@ export type AgentCapabilities = {
|
|
|
99
99
|
attachments: boolean;
|
|
100
100
|
/** False when the agent's `message` trigger is off: the widget hides its composer. */
|
|
101
101
|
messages: boolean;
|
|
102
|
+
/** Prompt chips on the blank-chat landing per locale, the runtime contract's `suggestionsSchema` shape; clicking one sends it as the first message. */
|
|
103
|
+
suggestions: Record<"en" | "ar", string[]>;
|
|
102
104
|
};
|
|
103
105
|
|
|
104
106
|
export type MessageMetadata = {
|