@meistrari/chat-nuxt 4.10.0-rc.2 → 4.10.0-rc.21

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.
Files changed (135) hide show
  1. package/README.md +8 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -0
  4. package/dist/runtime/conversations/components/chat-conversation-export-modal.d.vue.ts +10 -0
  5. package/dist/runtime/conversations/components/chat-conversation-export-modal.vue +126 -0
  6. package/dist/runtime/conversations/components/chat-conversation-export-modal.vue.d.ts +10 -0
  7. package/dist/runtime/conversations/components/chat-conversation-list.vue +8 -1
  8. package/dist/runtime/{rendering/components/openui/bar-chart.d.vue.ts → conversations/components/chat-export-document.d.vue.ts} +2 -5
  9. package/dist/runtime/conversations/components/chat-export-document.vue +26 -0
  10. package/dist/runtime/{rendering/components/openui/bar-chart.vue.d.ts → conversations/components/chat-export-document.vue.d.ts} +2 -5
  11. package/dist/runtime/{rendering/components/openui/checkbox.d.vue.ts → conversations/components/chat-export-file.d.vue.ts} +1 -1
  12. package/dist/runtime/conversations/components/chat-export-file.vue +12 -0
  13. package/dist/runtime/{rendering/components/openui/checkbox.vue.d.ts → conversations/components/chat-export-file.vue.d.ts} +1 -1
  14. package/dist/runtime/{rendering/components/openui/buttons.d.vue.ts → conversations/components/chat-export-message.d.vue.ts} +2 -3
  15. package/dist/runtime/conversations/components/chat-export-message.vue +84 -0
  16. package/dist/runtime/{rendering/components/openui/bar.vue.d.ts → conversations/components/chat-export-message.vue.d.ts} +2 -5
  17. package/dist/runtime/{rendering/components/openui/bar.d.vue.ts → conversations/components/chat-export-openui.d.vue.ts} +3 -4
  18. package/dist/runtime/conversations/components/chat-export-openui.vue +19 -0
  19. package/dist/runtime/conversations/components/chat-export-openui.vue.d.ts +9 -0
  20. package/dist/runtime/{rendering/components/openui/callout.d.vue.ts → conversations/components/chat-export-questions.d.vue.ts} +12 -4
  21. package/dist/runtime/conversations/components/chat-export-questions.vue +22 -0
  22. package/dist/runtime/{rendering/components/openui/callout.vue.d.ts → conversations/components/chat-export-questions.vue.d.ts} +12 -4
  23. package/dist/runtime/conversations/composables/conversation-list.d.ts +2 -1
  24. package/dist/runtime/conversations/composables/conversation-list.js +4 -13
  25. package/dist/runtime/conversations/export-document.d.ts +1 -0
  26. package/dist/runtime/conversations/export-document.js +154 -0
  27. package/dist/runtime/conversations/export.d.ts +4 -0
  28. package/dist/runtime/conversations/export.js +69 -4
  29. package/dist/runtime/embed/components/chat-embed-inner.vue +81 -7
  30. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +3 -2
  31. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -0
  32. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +3 -2
  33. package/dist/runtime/embed/execution-controls.d.ts +2 -1
  34. package/dist/runtime/embed/execution-controls.js +2 -2
  35. package/dist/runtime/messages/components/chat-execution-mode-selector.vue +10 -6
  36. package/dist/runtime/messages/components/chat-message-bubble.vue +7 -0
  37. package/dist/runtime/messages/components/chat-message-input.d.vue.ts +2 -0
  38. package/dist/runtime/messages/components/chat-message-input.vue +18 -1
  39. package/dist/runtime/messages/components/chat-message-input.vue.d.ts +2 -0
  40. package/dist/runtime/messages/composables/chat.d.ts +15 -0
  41. package/dist/runtime/messages/composables/chat.js +49 -5
  42. package/dist/runtime/messages/composer-draft.d.ts +16 -0
  43. package/dist/runtime/messages/composer-draft.js +61 -0
  44. package/dist/runtime/messages/composer-pending-send.d.ts +8 -0
  45. package/dist/runtime/messages/composer-pending-send.js +34 -0
  46. package/dist/runtime/messages/conversation-timeline.js +1 -1
  47. package/dist/runtime/rendering/components/openui/{markdown.d.vue.ts → markdown-prose.d.vue.ts} +1 -3
  48. package/dist/runtime/rendering/components/openui/{markdown.vue → markdown-prose.vue} +3 -3
  49. package/dist/runtime/rendering/components/openui/{markdown.vue.d.ts → markdown-prose.vue.d.ts} +1 -3
  50. package/dist/runtime/rendering/components/openui-block.vue +26 -52
  51. package/dist/runtime/rendering/openui/context.d.ts +2 -17
  52. package/dist/runtime/rendering/openui/context.js +0 -2
  53. package/dist/runtime/server/utils/chat-api-proxy.d.ts +1 -1
  54. package/dist/runtime/server/utils/chat-api-proxy.js +3 -2
  55. package/dist/runtime/types/composer.d.ts +6 -0
  56. package/dist/runtime/types/schemas/chat/chat-config.d.ts +6 -2
  57. package/dist/runtime/types/schemas/chat/chat-config.js +1 -0
  58. package/dist/runtime/types/schemas/chat/conversation-runtime.d.ts +8 -0
  59. package/dist/runtime/types/schemas/chat/conversations.d.ts +8 -0
  60. package/dist/runtime/types/schemas/chat/messages.d.ts +12 -0
  61. package/dist/runtime/types/schemas/chat/ui-language.d.ts +19 -2
  62. package/dist/runtime/types/schemas/chat/ui-language.js +8 -3
  63. package/dist/runtime/types/schemas/chat/v3.d.ts +160 -2
  64. package/dist/runtime/types/schemas/chat/v3.js +91 -5
  65. package/dist/runtime/types/schemas/integrations/slack-apps.d.ts +53 -0
  66. package/dist/runtime/types/schemas/integrations/slack-apps.js +6 -0
  67. package/dist/runtime/types/schemas/integrations/slack-identity.d.ts +26 -0
  68. package/dist/runtime/types/schemas/integrations/slack-identity.js +23 -0
  69. package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +40 -0
  70. package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
  71. package/dist/runtime/types/schemas/integrations/tela-api.d.ts +11 -0
  72. package/dist/runtime/types/schemas/integrations/tela-api.js +8 -0
  73. package/dist/runtime/types/schemas/integrations/tela-auth.d.ts +39 -0
  74. package/dist/runtime/types/schemas/integrations/tela-auth.js +12 -0
  75. package/dist/runtime/types/schemas/slack/apps.d.ts +144 -0
  76. package/dist/runtime/types/schemas/slack/apps.js +53 -0
  77. package/dist/runtime/types/schemas/slack/identities.d.ts +58 -0
  78. package/dist/runtime/types/schemas/slack/identities.js +19 -0
  79. package/dist/runtime/types/schemas/slack/installations.d.ts +39 -0
  80. package/dist/runtime/types/schemas/slack/installations.js +18 -0
  81. package/package.json +2 -2
  82. package/dist/runtime/rendering/components/openui/bar-chart.vue +0 -39
  83. package/dist/runtime/rendering/components/openui/bar.vue +0 -12
  84. package/dist/runtime/rendering/components/openui/button.d.vue.ts +0 -11
  85. package/dist/runtime/rendering/components/openui/button.vue +0 -30
  86. package/dist/runtime/rendering/components/openui/button.vue.d.ts +0 -11
  87. package/dist/runtime/rendering/components/openui/buttons.vue +0 -14
  88. package/dist/runtime/rendering/components/openui/buttons.vue.d.ts +0 -8
  89. package/dist/runtime/rendering/components/openui/callout.vue +0 -27
  90. package/dist/runtime/rendering/components/openui/card.d.vue.ts +0 -9
  91. package/dist/runtime/rendering/components/openui/card.vue +0 -19
  92. package/dist/runtime/rendering/components/openui/card.vue.d.ts +0 -9
  93. package/dist/runtime/rendering/components/openui/checkbox.vue +0 -26
  94. package/dist/runtime/rendering/components/openui/col.d.vue.ts +0 -10
  95. package/dist/runtime/rendering/components/openui/col.vue +0 -16
  96. package/dist/runtime/rendering/components/openui/col.vue.d.ts +0 -10
  97. package/dist/runtime/rendering/components/openui/form.d.vue.ts +0 -10
  98. package/dist/runtime/rendering/components/openui/form.vue +0 -60
  99. package/dist/runtime/rendering/components/openui/form.vue.d.ts +0 -10
  100. package/dist/runtime/rendering/components/openui/input.d.vue.ts +0 -10
  101. package/dist/runtime/rendering/components/openui/input.vue +0 -23
  102. package/dist/runtime/rendering/components/openui/input.vue.d.ts +0 -10
  103. package/dist/runtime/rendering/components/openui/metric.d.vue.ts +0 -11
  104. package/dist/runtime/rendering/components/openui/metric.vue +0 -20
  105. package/dist/runtime/rendering/components/openui/metric.vue.d.ts +0 -11
  106. package/dist/runtime/rendering/components/openui/option.d.vue.ts +0 -10
  107. package/dist/runtime/rendering/components/openui/option.vue +0 -12
  108. package/dist/runtime/rendering/components/openui/option.vue.d.ts +0 -10
  109. package/dist/runtime/rendering/components/openui/question.d.vue.ts +0 -11
  110. package/dist/runtime/rendering/components/openui/question.vue +0 -15
  111. package/dist/runtime/rendering/components/openui/question.vue.d.ts +0 -11
  112. package/dist/runtime/rendering/components/openui/questions.d.vue.ts +0 -9
  113. package/dist/runtime/rendering/components/openui/questions.vue +0 -91
  114. package/dist/runtime/rendering/components/openui/questions.vue.d.ts +0 -9
  115. package/dist/runtime/rendering/components/openui/select.d.vue.ts +0 -10
  116. package/dist/runtime/rendering/components/openui/select.vue +0 -27
  117. package/dist/runtime/rendering/components/openui/select.vue.d.ts +0 -10
  118. package/dist/runtime/rendering/components/openui/stack.d.vue.ts +0 -9
  119. package/dist/runtime/rendering/components/openui/stack.vue +0 -18
  120. package/dist/runtime/rendering/components/openui/stack.vue.d.ts +0 -9
  121. package/dist/runtime/rendering/components/openui/table.d.vue.ts +0 -9
  122. package/dist/runtime/rendering/components/openui/table.vue +0 -41
  123. package/dist/runtime/rendering/components/openui/table.vue.d.ts +0 -9
  124. package/dist/runtime/rendering/openui/actions.d.ts +0 -15
  125. package/dist/runtime/rendering/openui/actions.js +0 -40
  126. package/dist/runtime/rendering/openui/form-fields.d.ts +0 -10
  127. package/dist/runtime/rendering/openui/form-fields.js +0 -30
  128. package/dist/runtime/rendering/openui/program.d.ts +0 -15
  129. package/dist/runtime/rendering/openui/program.js +0 -74
  130. package/dist/runtime/rendering/openui/registry.d.ts +0 -5
  131. package/dist/runtime/rendering/openui/registry.js +0 -44
  132. package/dist/runtime/rendering/openui/render.d.ts +0 -21
  133. package/dist/runtime/rendering/openui/render.js +0 -45
  134. package/dist/runtime/rendering/openui/use-openui-context.d.ts +0 -2
  135. package/dist/runtime/rendering/openui/use-openui-context.js +0 -8
@@ -0,0 +1,144 @@
1
+ import { z } from 'zod';
2
+ export declare const credentialsSchema: z.ZodObject<{
3
+ clientId: z.ZodString;
4
+ clientSecret: z.ZodString;
5
+ signingSecret: z.ZodString;
6
+ }, z.core.$strict>;
7
+ export declare const registrationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ role: z.ZodLiteral<"manager">;
9
+ appId: z.ZodString;
10
+ teamId: z.ZodString;
11
+ creatorId: z.ZodString;
12
+ name: z.ZodString;
13
+ credentials: z.ZodObject<{
14
+ clientId: z.ZodString;
15
+ clientSecret: z.ZodString;
16
+ signingSecret: z.ZodString;
17
+ }, z.core.$strict>;
18
+ }, z.core.$strict>, z.ZodObject<{
19
+ role: z.ZodLiteral<"dedicated">;
20
+ workspaceId: z.ZodUUID;
21
+ agentId: z.ZodUUID;
22
+ appId: z.ZodString;
23
+ teamId: z.ZodString;
24
+ creatorId: z.ZodString;
25
+ name: z.ZodString;
26
+ credentials: z.ZodObject<{
27
+ clientId: z.ZodString;
28
+ clientSecret: z.ZodString;
29
+ signingSecret: z.ZodString;
30
+ }, z.core.$strict>;
31
+ }, z.core.$strict>], "role">;
32
+ export type AppCredentials = z.infer<typeof credentialsSchema>;
33
+ export declare const appNameSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
34
+ export declare const botStatuses: readonly ["creating", "configuring", "awaiting_distribution", "awaiting_installation", "active", "uninstalled", "failed", "unknown", "deactivated", "deleting", "delete_failed", "deleted"];
35
+ export declare const botStatusSchema: z.ZodEnum<{
36
+ unknown: "unknown";
37
+ failed: "failed";
38
+ creating: "creating";
39
+ configuring: "configuring";
40
+ awaiting_distribution: "awaiting_distribution";
41
+ awaiting_installation: "awaiting_installation";
42
+ active: "active";
43
+ uninstalled: "uninstalled";
44
+ deactivated: "deactivated";
45
+ deleting: "deleting";
46
+ delete_failed: "delete_failed";
47
+ deleted: "deleted";
48
+ }>;
49
+ export declare const botTargetSchema: z.ZodObject<{
50
+ actorId: z.ZodString;
51
+ workspaceId: z.ZodUUID;
52
+ agentId: z.ZodUUID;
53
+ }, z.core.$strip>;
54
+ export declare const botRequestSchema: z.ZodObject<{
55
+ actorId: z.ZodString;
56
+ workspaceId: z.ZodUUID;
57
+ agentId: z.ZodUUID;
58
+ teamId: z.ZodString;
59
+ workspaceName: z.ZodString;
60
+ agentName: z.ZodString;
61
+ name: z.ZodString;
62
+ requestKey: z.ZodUUID;
63
+ }, z.core.$strip>;
64
+ export declare const botChangesSchema: z.ZodObject<{
65
+ actorId: z.ZodString;
66
+ workspaceId: z.ZodUUID;
67
+ agentId: z.ZodUUID;
68
+ name: z.ZodOptional<z.ZodString>;
69
+ addAdminActorIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ removeAdminSlackUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ }, z.core.$strip>;
72
+ export declare const botIdSchema: z.ZodUUID;
73
+ export type BotTarget = z.infer<typeof botTargetSchema>;
74
+ export type BotRequest = z.infer<typeof botRequestSchema>;
75
+ export type BotChanges = z.infer<typeof botChangesSchema> & {
76
+ botId: z.infer<typeof botIdSchema>;
77
+ };
78
+ export type BotAction = BotTarget & {
79
+ botId: z.infer<typeof botIdSchema>;
80
+ };
81
+ export type BotStatus = z.infer<typeof botStatusSchema>;
82
+ export declare const botAdministratorSchema: z.ZodObject<{
83
+ slackUserId: z.ZodString;
84
+ actorId: z.ZodNullable<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ export declare const botSchema: z.ZodObject<{
87
+ id: z.ZodUUID;
88
+ name: z.ZodString;
89
+ teamId: z.ZodString;
90
+ teamName: z.ZodNullable<z.ZodString>;
91
+ status: z.ZodEnum<{
92
+ unknown: "unknown";
93
+ failed: "failed";
94
+ creating: "creating";
95
+ configuring: "configuring";
96
+ awaiting_distribution: "awaiting_distribution";
97
+ awaiting_installation: "awaiting_installation";
98
+ active: "active";
99
+ uninstalled: "uninstalled";
100
+ deactivated: "deactivated";
101
+ deleting: "deleting";
102
+ delete_failed: "delete_failed";
103
+ deleted: "deleted";
104
+ }>;
105
+ error: z.ZodNullable<z.ZodString>;
106
+ updating: z.ZodBoolean;
107
+ openUrl: z.ZodNullable<z.ZodURL>;
108
+ creatorActorId: z.ZodString;
109
+ admins: z.ZodArray<z.ZodObject<{
110
+ slackUserId: z.ZodString;
111
+ actorId: z.ZodNullable<z.ZodString>;
112
+ }, z.core.$strip>>;
113
+ manageable: z.ZodBoolean;
114
+ }, z.core.$strip>;
115
+ export type BotAdministrator = z.infer<typeof botAdministratorSchema>;
116
+ export type Bot = z.infer<typeof botSchema>;
117
+ export declare const operationResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
+ resolution: z.ZodLiteral<"absent">;
119
+ }, z.core.$strict>, z.ZodObject<{
120
+ resolution: z.ZodLiteral<"created">;
121
+ appId: z.ZodString;
122
+ credentials: z.ZodObject<{
123
+ clientId: z.ZodString;
124
+ clientSecret: z.ZodString;
125
+ signingSecret: z.ZodString;
126
+ }, z.core.$strict>;
127
+ }, z.core.$strict>], "resolution">;
128
+ export declare const configTokenPairSchema: z.ZodObject<{
129
+ accessToken: z.ZodString;
130
+ refreshToken: z.ZodString;
131
+ }, z.core.$strict>;
132
+ export declare const configTokenImportSchema: z.ZodObject<{
133
+ expiresAt: z.ZodNumber;
134
+ accessToken: z.ZodString;
135
+ refreshToken: z.ZodString;
136
+ teamId: z.ZodString;
137
+ userId: z.ZodString;
138
+ }, z.core.$strict>;
139
+ export type ConfigTokenPair = z.infer<typeof configTokenPairSchema>;
140
+ export declare const botInstallLinkSchema: z.ZodObject<{
141
+ url: z.ZodURL;
142
+ expiresAt: z.ZodISODateTime;
143
+ }, z.core.$strip>;
144
+ export type BotInstallLink = z.infer<typeof botInstallLinkSchema>;
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { actorIdSchema } from './identities';
3
+ export const credentialsSchema = z.strictObject({
4
+ clientId: z.string().regex(/^\d+\.\d+$/),
5
+ clientSecret: z.string().min(1).max(2000),
6
+ signingSecret: z.string().min(1).max(2000),
7
+ });
8
+ const common = {
9
+ appId: z.string().regex(/^A[A-Z0-9]+$/),
10
+ teamId: z.string().regex(/^T[A-Z0-9]+$/),
11
+ creatorId: z.string().regex(/^[UW][A-Z0-9]+$/),
12
+ name: z.string().trim().min(1).max(80),
13
+ credentials: credentialsSchema,
14
+ };
15
+ export const registrationSchema = z.discriminatedUnion('role', [
16
+ z.strictObject({ ...common, role: z.literal('manager') }),
17
+ z.strictObject({ ...common, role: z.literal('dedicated'), workspaceId: z.uuid(), agentId: z.uuid() }),
18
+ ]);
19
+ // Slack limits app names to 35 characters. Plain words only: no mention, link or mrkdwn syntax.
20
+ export const appNameSchema = z.string().max(200).transform(value => value.normalize('NFC').trim().replace(/ {2,}/g, ' ')).pipe(z.string().min(1).max(35).regex(/^[\p{L}\p{N}][\p{L}\p{N} .'()·-]*$/u));
21
+ export const botStatuses = ['creating', 'configuring', 'awaiting_distribution', 'awaiting_installation', 'active', 'uninstalled', 'failed', 'unknown', 'deactivated', 'deleting', 'delete_failed', 'deleted'];
22
+ export const botStatusSchema = z.enum(botStatuses);
23
+ export const botTargetSchema = z.object({ actorId: actorIdSchema, workspaceId: z.uuid(), agentId: z.uuid() });
24
+ // Workspace and agent names are Tela's current titles, shown in the Slack app; the name is validated by the bot rules.
25
+ export const botRequestSchema = botTargetSchema.extend({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), workspaceName: z.string().min(1).max(200), agentName: z.string().min(1).max(200), name: z.string().max(200), requestKey: z.uuid() });
26
+ export const botChangesSchema = botTargetSchema.extend({ name: z.string().max(200).optional(), addAdminActorIds: z.array(actorIdSchema).max(20).optional(), removeAdminSlackUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]{1,99}$/)).max(20).optional() });
27
+ export const botIdSchema = z.uuid();
28
+ export const botAdministratorSchema = z.object({
29
+ slackUserId: z.string(),
30
+ actorId: z.string().nullable().describe('The administrator\'s Tela account while their Slack identity in the bot\'s team is connected.'),
31
+ });
32
+ export const botSchema = z.object({
33
+ id: z.uuid().describe('The bot id: its app registration id, reserved before the Slack app exists.'),
34
+ name: z.string(),
35
+ teamId: z.string().describe('Slack workspace the bot is installed in.'),
36
+ teamName: z.string().nullable().describe('Workspace name learned from Sign in with Slack.'),
37
+ status: botStatusSchema,
38
+ error: z.string().nullable().describe('Why provisioning failed or is unknown, or why a deletion waits or failed.'),
39
+ updating: z.boolean().describe('A rename is being applied to the Slack app.'),
40
+ openUrl: z.url().nullable().describe('Slack deep link, only while the bot is installed.'),
41
+ creatorActorId: z.string(),
42
+ // An administrator's Tela account while their Slack identity in the bot's team is connected, otherwise null.
43
+ admins: z.array(botAdministratorSchema),
44
+ manageable: z.boolean().describe('The actor manages the bot: its creator or a designated administrator, through a single active Slack identity in its team.'),
45
+ });
46
+ const createdCredentialsSchema = z.strictObject({ clientId: z.string().regex(/^\d+\.\d+$/).max(100), clientSecret: z.string().min(1).max(2000), signingSecret: z.string().min(1).max(2000) });
47
+ export const operationResolutionSchema = z.discriminatedUnion('resolution', [
48
+ z.strictObject({ resolution: z.literal('absent') }),
49
+ z.strictObject({ resolution: z.literal('created'), appId: z.string().regex(/^A[A-Z0-9]+$/).max(100), credentials: createdCredentialsSchema }),
50
+ ]);
51
+ export const configTokenPairSchema = z.strictObject({ accessToken: z.string().regex(/^xoxe\.xoxp-[\w-]+$/).max(4000), refreshToken: z.string().regex(/^xoxe-[\w-]+$/).max(4000) });
52
+ export const configTokenImportSchema = z.strictObject({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), userId: z.string().regex(/^U[A-Z0-9]+$/).max(100), ...configTokenPairSchema.shape, expiresAt: z.number().int().positive() });
53
+ export const botInstallLinkSchema = z.object({ url: z.url(), expiresAt: z.iso.datetime() });
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ export declare const actorIdSchema: z.ZodString;
3
+ export declare const actorSchema: z.ZodObject<{
4
+ actorId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const onboardingStartSchema: z.ZodObject<{
7
+ actorId: z.ZodString;
8
+ agentId: z.ZodUUID;
9
+ }, z.core.$strip>;
10
+ export type OnboardingStart = z.infer<typeof onboardingStartSchema>;
11
+ export declare const onboardingIdSchema: z.ZodUUID;
12
+ export declare const onboardingStates: readonly ["created", "redirected", "identifying", "approving", "exchanging", "identity", "connected", "failed", "expired"];
13
+ export declare const onboardingStateSchema: z.ZodEnum<{
14
+ failed: "failed";
15
+ expired: "expired";
16
+ connected: "connected";
17
+ created: "created";
18
+ redirected: "redirected";
19
+ identifying: "identifying";
20
+ approving: "approving";
21
+ exchanging: "exchanging";
22
+ identity: "identity";
23
+ }>;
24
+ export declare const slackIdentitySchema: z.ZodObject<{
25
+ teamId: z.ZodString;
26
+ teamName: z.ZodNullable<z.ZodString>;
27
+ slackUserId: z.ZodString;
28
+ }, z.core.$strip>;
29
+ export declare const onboardingViewSchema: z.ZodObject<{
30
+ id: z.ZodUUID;
31
+ state: z.ZodEnum<{
32
+ failed: "failed";
33
+ expired: "expired";
34
+ connected: "connected";
35
+ created: "created";
36
+ redirected: "redirected";
37
+ identifying: "identifying";
38
+ approving: "approving";
39
+ exchanging: "exchanging";
40
+ identity: "identity";
41
+ }>;
42
+ error: z.ZodNullable<z.ZodString>;
43
+ identity: z.ZodNullable<z.ZodObject<{
44
+ teamId: z.ZodString;
45
+ teamName: z.ZodNullable<z.ZodString>;
46
+ slackUserId: z.ZodString;
47
+ slackUserName: z.ZodNullable<z.ZodString>;
48
+ replacesExisting: z.ZodBoolean;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>;
51
+ export type OnboardingState = z.infer<typeof onboardingStateSchema>;
52
+ export type SlackIdentity = z.infer<typeof slackIdentitySchema>;
53
+ export type OnboardingView = z.infer<typeof onboardingViewSchema>;
54
+ export declare const onboardingStartResultSchema: z.ZodObject<{
55
+ id: z.ZodUUID;
56
+ startUrl: z.ZodURL;
57
+ }, z.core.$strip>;
58
+ export type OnboardingStartResult = z.infer<typeof onboardingStartResultSchema>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export const actorIdSchema = z.string().min(1).max(100);
3
+ export const actorSchema = z.object({ actorId: actorIdSchema });
4
+ export const onboardingStartSchema = z.object({ actorId: actorIdSchema, agentId: z.uuid() });
5
+ export const onboardingIdSchema = z.uuid();
6
+ export const onboardingStates = ['created', 'redirected', 'identifying', 'approving', 'exchanging', 'identity', 'connected', 'failed', 'expired'];
7
+ export const onboardingStateSchema = z.enum(onboardingStates);
8
+ export const slackIdentitySchema = z.object({ teamId: z.string(), teamName: z.string().nullable(), slackUserId: z.string() });
9
+ export const onboardingViewSchema = z.object({
10
+ id: z.uuid(),
11
+ state: onboardingStateSchema.describe('An unfinished onboarding past its lifetime, or an identity whose confirmation window lapsed, reads as `expired`.'),
12
+ error: z.string().nullable().describe('Why the onboarding failed.'),
13
+ // The Slack identity awaiting the member's confirmation; only in the `identity` state.
14
+ identity: slackIdentitySchema.extend({
15
+ slackUserName: z.string().nullable(),
16
+ replacesExisting: z.boolean().describe('Confirming disconnects the Tela account the Slack member had connected.'),
17
+ }).nullable().describe('The Slack identity awaiting the actor\'s confirmation, only in the `identity` state.'),
18
+ });
19
+ export const onboardingStartResultSchema = z.object({ id: z.uuid(), startUrl: z.url() });
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export declare const installationSchema: z.ZodObject<{
3
+ appId: z.ZodString;
4
+ authVersion: z.ZodLiteral<"v2">;
5
+ tokenType: z.ZodLiteral<"bot">;
6
+ isEnterpriseInstall: z.ZodLiteral<false>;
7
+ team: z.ZodObject<{
8
+ id: z.ZodString;
9
+ }, z.core.$strip>;
10
+ user: z.ZodObject<{
11
+ id: z.ZodString;
12
+ token: z.ZodUndefined;
13
+ refreshToken: z.ZodUndefined;
14
+ expiresAt: z.ZodUndefined;
15
+ }, z.core.$strip>;
16
+ bot: z.ZodObject<{
17
+ id: z.ZodString;
18
+ userId: z.ZodString;
19
+ token: z.ZodString;
20
+ scopes: z.ZodArray<z.ZodString>;
21
+ refreshToken: z.ZodUndefined;
22
+ expiresAt: z.ZodUndefined;
23
+ }, z.core.$strip>;
24
+ metadata: z.ZodUUID;
25
+ }, z.core.$strip>;
26
+ export declare const installationCallbackQuerySchema: z.ZodObject<{
27
+ code: z.ZodString;
28
+ state: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export declare const installationRevocationSchema: z.ZodObject<{
31
+ eventId: z.ZodString;
32
+ eventTime: z.ZodNumber;
33
+ type: z.ZodEnum<{
34
+ app_uninstalled: "app_uninstalled";
35
+ tokens_revoked: "tokens_revoked";
36
+ }>;
37
+ botUserIds: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ export type InstallationRevocation = z.infer<typeof installationRevocationSchema>;
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export const installationSchema = z.object({
3
+ appId: z.string(),
4
+ authVersion: z.literal('v2'),
5
+ tokenType: z.literal('bot'),
6
+ isEnterpriseInstall: z.literal(false),
7
+ team: z.object({ id: z.string() }),
8
+ user: z.object({ id: z.string(), token: z.undefined(), refreshToken: z.undefined(), expiresAt: z.undefined() }),
9
+ bot: z.object({ id: z.string().regex(/^B[A-Z0-9]+$/), userId: z.string().regex(/^U[A-Z0-9]+$/), token: z.string().regex(/^xoxb-[\w-]+$/).max(2000), scopes: z.array(z.string()), refreshToken: z.undefined(), expiresAt: z.undefined() }),
10
+ metadata: z.uuid(),
11
+ });
12
+ export const installationCallbackQuerySchema = z.object({ code: z.string().max(2000), state: z.string().regex(/^[a-f0-9]{64}$/) });
13
+ export const installationRevocationSchema = z.object({
14
+ eventId: z.string(),
15
+ eventTime: z.number(),
16
+ type: z.enum(['app_uninstalled', 'tokens_revoked']),
17
+ botUserIds: z.array(z.string()),
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.10.0-rc.2",
3
+ "version": "4.10.0-rc.21",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -52,7 +52,7 @@
52
52
  "@iconify-json/ph": "^1.2.2",
53
53
  "@iconify/vue": "^5.0.0",
54
54
  "@meistrari/auth-nuxt": "3.31.0",
55
- "@meistrari/chat-ui-lang": "workspace:*",
55
+ "@meistrari/chat-ui-lang": "0.4.0-rc.0",
56
56
  "@meistrari/logger": "^2.1.3",
57
57
  "@meistrari/tela-build": "^1.79.0",
58
58
  "@openuidev/lang-core": "1.0.0",
@@ -1,39 +0,0 @@
1
- <script setup>
2
- const props = defineProps({
3
- props: { type: Object, required: true }
4
- });
5
- const bars = computed(() => (Array.isArray(props.props.bars) ? props.props.bars : []).map((node) => {
6
- const bar = node;
7
- if (bar?.typeName !== "Bar" || !bar.props || typeof bar.props.value !== "number" || !Number.isFinite(bar.props.value))
8
- return null;
9
- return {
10
- label: typeof bar.props.label === "string" ? bar.props.label : "",
11
- value: bar.props.value,
12
- display: typeof bar.props.display === "string" ? bar.props.display : String(bar.props.value)
13
- };
14
- }).filter((bar) => bar !== null));
15
- const max = computed(() => Math.max(0, ...bars.value.map((bar) => Math.abs(bar.value))));
16
- const fillClass = computed(() => ({
17
- neutral: "bg-gray-800",
18
- positive: "bg-green-600",
19
- negative: "bg-red-600"
20
- })[props.props.tone ?? "neutral"]);
21
- function width(bar) {
22
- return bar.value === 0 || max.value === 0 ? "0%" : `${Math.max(2, Math.round(Math.abs(bar.value) / max.value * 100))}%`;
23
- }
24
- </script>
25
-
26
- <template>
27
- <div flex flex-col gap-12px rounded-12px border-0.5px border p-16px data-openui="bar-chart">
28
- <span body-12-medium text-secondary>{{ props.props.title }}</span>
29
- <div flex flex-col gap-8px>
30
- <div v-for="(bar, index) in bars" :key="index" grid grid-cols="[minmax(96px,1fr)_3fr_auto]" items-center gap-12px>
31
- <span body-14-regular text-primary truncate>{{ bar.label }}</span>
32
- <div h-8px rounded-4px bg-muted overflow-hidden>
33
- <div h-full rounded-4px :class="bar.value < 0 ? 'bg-red-600' : fillClass" :style="{ width: width(bar) }" />
34
- </div>
35
- <span body-12-medium text-secondary tabular-nums>{{ bar.display }}</span>
36
- </div>
37
- </div>
38
- </div>
39
- </template>
@@ -1,12 +0,0 @@
1
- <script setup>
2
- const props = defineProps({
3
- props: { type: Object, required: true }
4
- });
5
- </script>
6
-
7
- <template>
8
- <div flex justify-between gap-12px body-14-regular text-primary data-openui="bar">
9
- <span>{{ props.props.label }}</span>
10
- <span text-secondary>{{ props.props.display ?? props.props.value }}</span>
11
- </div>
12
- </template>
@@ -1,11 +0,0 @@
1
- import type { ActionPlan } from '@openuidev/lang-core';
2
- type __VLS_Props = {
3
- props: {
4
- label: string;
5
- action?: ActionPlan;
6
- variant?: 'primary' | 'secondary';
7
- };
8
- };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
@@ -1,30 +0,0 @@
1
- <script setup>
2
- import { useOpenuiContext } from "../../openui/use-openui-context";
3
- const props = defineProps({
4
- props: { type: Object, required: true }
5
- });
6
- const { interactive, triggerAction } = useOpenuiContext();
7
- const sending = ref(false);
8
- async function click() {
9
- if (!interactive.value || sending.value)
10
- return;
11
- sending.value = true;
12
- try {
13
- await triggerAction(props.props.label, props.props.action);
14
- } finally {
15
- sending.value = false;
16
- }
17
- }
18
- </script>
19
-
20
- <template>
21
- <TelaButton
22
- :variant="props.props.variant === 'primary' ? 'primary' : 'secondary'"
23
- :disabled="!interactive"
24
- :loading="sending"
25
- data-openui="button"
26
- @click="click"
27
- >
28
- {{ props.props.label }}
29
- </TelaButton>
30
- </template>
@@ -1,11 +0,0 @@
1
- import type { ActionPlan } from '@openuidev/lang-core';
2
- type __VLS_Props = {
3
- props: {
4
- label: string;
5
- action?: ActionPlan;
6
- variant?: 'primary' | 'secondary';
7
- };
8
- };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
@@ -1,14 +0,0 @@
1
- <script setup>
2
- import { useOpenuiContext } from "../../openui/use-openui-context";
3
- const props = defineProps({
4
- props: { type: Object, required: true }
5
- });
6
- const { renderNode } = useOpenuiContext();
7
- const Children = () => renderNode(props.props.buttons);
8
- </script>
9
-
10
- <template>
11
- <div flex flex-wrap gap-8px data-openui="buttons">
12
- <Children />
13
- </div>
14
- </template>
@@ -1,8 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- buttons: unknown[];
4
- };
5
- };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
- declare const _default: typeof __VLS_export;
8
- export default _default;
@@ -1,27 +0,0 @@
1
- <script setup>
2
- import { OPENUI_MARKDOWN_COMPONENTS_KEY } from "../../openui/context";
3
- import { useWidgetProse } from "../../openui/use-widget-prose";
4
- const props = defineProps({
5
- props: { type: Object, required: true },
6
- partial: { type: Boolean, required: false }
7
- });
8
- const customComponents = inject(OPENUI_MARKDOWN_COMPONENTS_KEY, ref({}));
9
- const content = useWidgetProse(() => props.props.text);
10
- const TONES = {
11
- info: { icon: "i-ph-info", color: "text-secondary" },
12
- success: { icon: "i-ph-check-circle", color: "text-success" },
13
- warning: { icon: "i-ph-warning", color: "text-warning" },
14
- error: { icon: "i-ph-warning-octagon", color: "text-error" }
15
- };
16
- const tone = computed(() => TONES[props.props.tone ?? "info"]);
17
- </script>
18
-
19
- <template>
20
- <div flex gap-10px rounded-12px border-0.5px border bg-subtle px-14px py-12px data-openui="callout">
21
- <TelaIcon :name="tone.icon" size="16px" shrink-0 mt-2px :class="tone.color" />
22
- <div flex flex-col gap-4px min-w-0>
23
- <span v-if="props.props.title" body-14-medium text-primary>{{ props.props.title }}</span>
24
- <AppMarkdownRender :content="content" :final="!partial" :typewriter="false" :custom-components="customComponents" body-14-regular text-primary />
25
- </div>
26
- </div>
27
- </template>
@@ -1,9 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- children: unknown[];
4
- title?: string;
5
- };
6
- };
7
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
- declare const _default: typeof __VLS_export;
9
- export default _default;
@@ -1,19 +0,0 @@
1
- <script setup>
2
- import { useOpenuiContext } from "../../openui/use-openui-context";
3
- const props = defineProps({
4
- props: { type: Object, required: true }
5
- });
6
- const { renderNode } = useOpenuiContext();
7
- const Children = () => renderNode(props.props.children);
8
- </script>
9
-
10
- <template>
11
- <TelaCard size="sm" h-full data-openui="card">
12
- <div flex flex-col gap-12px>
13
- <h4 v-if="props.props.title" heading-h5-semibold text-contrast>
14
- {{ props.props.title }}
15
- </h4>
16
- <Children />
17
- </div>
18
- </TelaCard>
19
- </template>
@@ -1,9 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- children: unknown[];
4
- title?: string;
5
- };
6
- };
7
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
- declare const _default: typeof __VLS_export;
9
- export default _default;
@@ -1,26 +0,0 @@
1
- <script setup>
2
- import { OPENUI_FORM_KEY } from "../../openui/context";
3
- import { useOpenuiContext } from "../../openui/use-openui-context";
4
- const props = defineProps({
5
- props: { type: Object, required: true }
6
- });
7
- const form = inject(OPENUI_FORM_KEY, null);
8
- const local = ref(false);
9
- const { interactive } = useOpenuiContext();
10
- const checked = computed({
11
- get: () => (form ? form.get(props.props.name) : local.value) === true,
12
- set: (next) => {
13
- if (form)
14
- form.set(props.props.name, next === true);
15
- else
16
- local.value = next === true;
17
- }
18
- });
19
- </script>
20
-
21
- <template>
22
- <label flex items-center gap-8px body-14-regular text-primary cursor-pointer data-openui="checkbox">
23
- <TelaCheckbox v-model="checked" :disabled="!interactive" />
24
- {{ props.props.label }}
25
- </label>
26
- </template>
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- label: string;
4
- values: Array<string | number>;
5
- align?: 'left' | 'right';
6
- };
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
@@ -1,16 +0,0 @@
1
- <script setup>
2
- const props = defineProps({
3
- props: { type: Object, required: true }
4
- });
5
- </script>
6
-
7
- <template>
8
- <dl flex flex-col gap-4px data-openui="col">
9
- <dt body-12-medium text-secondary>
10
- {{ props.props.label }}
11
- </dt>
12
- <dd v-for="(value, index) in props.props.values" :key="index" body-14-regular text-primary>
13
- {{ value }}
14
- </dd>
15
- </dl>
16
- </template>
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- label: string;
4
- values: Array<string | number>;
5
- align?: 'left' | 'right';
6
- };
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- props: {
3
- name: string;
4
- fields: unknown[];
5
- submitLabel?: string;
6
- };
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;