@meistrari/chat-nuxt 4.10.0-rc.6 → 4.10.0-rc.7

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.10.0-rc.6",
4
+ "version": "4.10.0-rc.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * Chat API v3 (`/v3/chat`): the conversational surface over agent-api v5 events-v1.
4
- * The chat-api owns the conversation; agent-api owns the session and its history.
4
+ * The chat-api owns the thread; agent-api owns the session and its history.
5
5
  */
6
6
  export declare const CHAT_V3_CONTRACT_VERSION = "events-v1";
7
- /** Where the agent of the request stands in the v5 catalog. */
7
+ /** Where the agent of the request stands in agent-api, where the agent lives. */
8
8
  export declare const chatV3AgentStatusSchema: z.ZodEnum<{
9
9
  ready: "ready";
10
10
  not_requested: "not_requested";
@@ -53,3 +53,69 @@ export declare const chatV3ConfigurationSchema: z.ZodObject<{
53
53
  }, z.core.$strip>;
54
54
  }, z.core.$strip>;
55
55
  export type ChatV3Configuration = z.infer<typeof chatV3ConfigurationSchema>;
56
+ export declare const CHAT_V3_TITLE_CHARS = 200;
57
+ export declare const CHAT_V3_CREATION_KEY_CHARS = 128;
58
+ export declare const CHAT_V3_THREAD_PAGE: {
59
+ readonly default: 30;
60
+ readonly max: 100;
61
+ };
62
+ /** A thread as the chat owns it: access and title here, history in the agent-api session. */
63
+ export declare const chatV3ThreadSchema: z.ZodObject<{
64
+ threadId: z.ZodString;
65
+ agentId: z.ZodString;
66
+ sessionId: z.ZodString;
67
+ title: z.ZodString;
68
+ createdAt: z.ZodString;
69
+ updatedAt: z.ZodString;
70
+ }, z.core.$strip>;
71
+ export type ChatV3Thread = z.infer<typeof chatV3ThreadSchema>;
72
+ /** The session behind a thread, read live from agent-api; `null` when agent-api no longer has it. */
73
+ export declare const chatV3SessionSummarySchema: z.ZodNullable<z.ZodObject<{
74
+ status: z.ZodString;
75
+ harness: z.ZodString;
76
+ model: z.ZodNullable<z.ZodString>;
77
+ reasoningEffort: z.ZodNullable<z.ZodString>;
78
+ }, z.core.$strip>>;
79
+ export declare const chatV3ThreadDetailSchema: z.ZodObject<{
80
+ threadId: z.ZodString;
81
+ agentId: z.ZodString;
82
+ sessionId: z.ZodString;
83
+ title: z.ZodString;
84
+ createdAt: z.ZodString;
85
+ updatedAt: z.ZodString;
86
+ session: z.ZodNullable<z.ZodObject<{
87
+ status: z.ZodString;
88
+ harness: z.ZodString;
89
+ model: z.ZodNullable<z.ZodString>;
90
+ reasoningEffort: z.ZodNullable<z.ZodString>;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ export type ChatV3ThreadDetail = z.infer<typeof chatV3ThreadDetailSchema>;
94
+ /** Creation also opens the agent-api session; send an `Idempotency-Key` header to retry safely. */
95
+ export declare const chatV3CreateThreadSchema: z.ZodObject<{
96
+ agentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
97
+ title: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>;
99
+ export type ChatV3CreateThread = z.infer<typeof chatV3CreateThreadSchema>;
100
+ export declare const chatV3UpdateThreadSchema: z.ZodObject<{
101
+ title: z.ZodString;
102
+ }, z.core.$strict>;
103
+ export type ChatV3UpdateThread = z.infer<typeof chatV3UpdateThreadSchema>;
104
+ export declare const chatV3ThreadListQuerySchema: z.ZodObject<{
105
+ agentId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
106
+ before: z.ZodOptional<z.ZodString>;
107
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
108
+ }, z.core.$strict>;
109
+ export type ChatV3ThreadListQuery = z.infer<typeof chatV3ThreadListQuerySchema>;
110
+ export declare const chatV3ThreadListSchema: z.ZodObject<{
111
+ threads: z.ZodArray<z.ZodObject<{
112
+ threadId: z.ZodString;
113
+ agentId: z.ZodString;
114
+ sessionId: z.ZodString;
115
+ title: z.ZodString;
116
+ createdAt: z.ZodString;
117
+ updatedAt: z.ZodString;
118
+ }, z.core.$strip>>;
119
+ nextCursor: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type ChatV3ThreadList = z.infer<typeof chatV3ThreadListSchema>;
@@ -2,14 +2,14 @@ import { z } from 'zod';
2
2
  import { v5HarnessSchema } from '../integrations/agent-events';
3
3
  /**
4
4
  * Chat API v3 (`/v3/chat`): the conversational surface over agent-api v5 events-v1.
5
- * The chat-api owns the conversation; agent-api owns the session and its history.
5
+ * The chat-api owns the thread; agent-api owns the session and its history.
6
6
  */
7
7
  export const CHAT_V3_CONTRACT_VERSION = 'events-v1';
8
- /** Where the agent of the request stands in the v5 catalog. */
8
+ /** Where the agent of the request stands in agent-api, where the agent lives. */
9
9
  export const chatV3AgentStatusSchema = z.enum([
10
- /** No `telaAgentId` on the request: nothing to resolve yet. */
10
+ /** No `agentId` on the request: nothing to look up yet. */
11
11
  'not_requested',
12
- /** Tela knows the agent, but the v5 catalog does not: Tela has to create it there. */
12
+ /** agent-api has no such agent in the caller's workspace. */
13
13
  'not_in_catalog',
14
14
  /** In the catalog without a publication: `POST /v5/agents/snapshots` first. */
15
15
  'not_published',
@@ -35,3 +35,46 @@ export const chatV3ConfigurationSchema = z.object({
35
35
  eventsPerRequest: z.number().int().positive(),
36
36
  }),
37
37
  });
38
+ export const CHAT_V3_TITLE_CHARS = 200;
39
+ export const CHAT_V3_CREATION_KEY_CHARS = 128;
40
+ export const CHAT_V3_THREAD_PAGE = { default: 30, max: 100 };
41
+ /**
42
+ * The agent's id in agent-api, the only one the chat uses. Lowercased, as agent-api and Postgres
43
+ * write uuids, so the same agent always compares equal.
44
+ */
45
+ const agentIdSchema = z.string().uuid().transform(id => id.toLowerCase());
46
+ /** A thread as the chat owns it: access and title here, history in the agent-api session. */
47
+ export const chatV3ThreadSchema = z.object({
48
+ threadId: z.string().uuid(),
49
+ agentId: z.string().uuid(),
50
+ sessionId: z.string().uuid(),
51
+ title: z.string(),
52
+ createdAt: z.string(),
53
+ updatedAt: z.string(),
54
+ });
55
+ /** The session behind a thread, read live from agent-api; `null` when agent-api no longer has it. */
56
+ export const chatV3SessionSummarySchema = z.object({
57
+ status: z.string(),
58
+ harness: z.string(),
59
+ model: z.string().nullable(),
60
+ reasoningEffort: z.string().nullable(),
61
+ }).nullable();
62
+ export const chatV3ThreadDetailSchema = chatV3ThreadSchema.extend({ session: chatV3SessionSummarySchema });
63
+ /** Creation also opens the agent-api session; send an `Idempotency-Key` header to retry safely. */
64
+ export const chatV3CreateThreadSchema = z.object({
65
+ agentId: agentIdSchema,
66
+ title: z.string().trim().max(CHAT_V3_TITLE_CHARS).optional(),
67
+ }).strict();
68
+ export const chatV3UpdateThreadSchema = z.object({
69
+ title: z.string().trim().max(CHAT_V3_TITLE_CHARS),
70
+ }).strict();
71
+ export const chatV3ThreadListQuerySchema = z.object({
72
+ agentId: agentIdSchema.optional(),
73
+ /** Exclusive cursor: the last `threadId` of the previous page. */
74
+ before: z.string().uuid().optional(),
75
+ limit: z.coerce.number().int().min(1).max(CHAT_V3_THREAD_PAGE.max).default(CHAT_V3_THREAD_PAGE.default),
76
+ }).strict();
77
+ export const chatV3ThreadListSchema = z.object({
78
+ threads: z.array(chatV3ThreadSchema),
79
+ nextCursor: z.string().uuid().nullable(),
80
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.10.0-rc.6",
3
+ "version": "4.10.0-rc.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {