chat-js 1.0.0-alpha.7 → 1.0.0-alpha.8

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 (232) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +433 -658
  3. package/package.json +1 -1
  4. package/templates/chat-app/AGENTS.md +1 -1
  5. package/templates/chat-app/agent/hooks/followup-suggestions.ts +1 -1
  6. package/templates/chat-app/agent/hooks/projects.ts +1 -1
  7. package/templates/chat-app/agent/hooks/search.ts +1 -1
  8. package/templates/chat-app/agent/instructions/projects.ts +1 -1
  9. package/templates/chat-app/agent/tools/mcp.ts +1 -1
  10. package/templates/chat-app/app/(auth)/device-login/page.tsx +1 -1
  11. package/templates/chat-app/app/(chat)/api/files/upload/route.ts +1 -1
  12. package/templates/chat-app/app/(chat)/chat/{[id] → [chatId]}/page.tsx +4 -4
  13. package/templates/chat-app/app/(chat)/project/[projectId]/chat/[chatId]/page.tsx +1 -1
  14. package/templates/chat-app/app/(chat)/project/[projectId]/page.tsx +1 -1
  15. package/templates/chat-app/app/(chat)/settings/connectors/[connectorId]/page.tsx +1 -1
  16. package/templates/chat-app/app/(chat)/settings/connectors/page.tsx +1 -1
  17. package/templates/chat-app/app/(chat)/settings/models/page.tsx +1 -1
  18. package/templates/chat-app/app/(chat)/share/[id]/page.tsx +1 -1
  19. package/templates/chat-app/app/api/agent-conversations/route.test.ts +5 -5
  20. package/templates/chat-app/app/api/agent-conversations/route.ts +2 -2
  21. package/templates/chat-app/app/api/agent-response-groups/route.test.ts +5 -5
  22. package/templates/chat-app/app/api/agent-response-groups/route.ts +1 -1
  23. package/templates/chat-app/app/api/eve/[...path]/route.test.ts +133 -4
  24. package/templates/chat-app/app/api/eve/[...path]/route.ts +175 -49
  25. package/templates/chat-app/app/api/eve-guest/route.ts +1 -1
  26. package/templates/chat-app/app/api/mcp/oauth/callback/route.ts +1 -1
  27. package/templates/chat-app/chatjs/core/chat/compose.ts +4 -4
  28. package/templates/chat-app/chatjs/core/chat/contracts.ts +6 -6
  29. package/templates/chat-app/chatjs/core/installation/contracts.ts +0 -7
  30. package/templates/chat-app/chatjs/generated/installed-auth-ui.ts +2 -2
  31. package/templates/chat-app/chatjs/generated/installed-auth.ts +4 -2
  32. package/templates/chat-app/chatjs/generated/installed-billing.ts +2 -2
  33. package/templates/chat-app/chatjs/generated/installed-chat-ui.ts +24 -24
  34. package/templates/chat-app/chatjs/generated/installed-chat.ts +12 -12
  35. package/templates/chat-app/chatjs/generated/installed-cleanup.ts +4 -4
  36. package/templates/chat-app/chatjs/generated/installed-instrumentation.ts +8 -2
  37. package/templates/chat-app/chatjs/generated/installed-layout.ts +2 -2
  38. package/templates/chat-app/chatjs/generated/installed-model-visibility.ts +2 -2
  39. package/templates/chat-app/chatjs/generated/installed-navigation.ts +2 -2
  40. package/templates/chat-app/chatjs/generated/installed-routers.ts +18 -19
  41. package/templates/chat-app/chatjs/generated/installed-session-profiles.ts +5 -3
  42. package/templates/chat-app/chatjs/generated/installed-sign-out.ts +2 -2
  43. package/templates/chat-app/chatjs/generated/installed-signed-out.ts +2 -2
  44. package/templates/chat-app/chatjs/generated/installed-uploads.ts +2 -2
  45. package/templates/chat-app/chatjs/plugins/ai-titles/{chat.ts → chat-server.ts} +3 -1
  46. package/templates/chat-app/chatjs/plugins/ai-titles/generate-title.ts +7 -9
  47. package/templates/chat-app/chatjs/plugins/ai-titles/{chatjs.json → plugin.json} +3 -4
  48. package/templates/chat-app/chatjs/plugins/ai-titles/title-queries.ts +4 -4
  49. package/templates/chat-app/chatjs/plugins/attachment-uploads/{client-plugin.ts → chat-ui.ts} +1 -3
  50. package/templates/chat-app/chatjs/plugins/attachment-uploads/plugin.json +16 -0
  51. package/templates/chat-app/chatjs/plugins/credits/billing.ts +3 -1
  52. package/templates/chat-app/chatjs/plugins/credits/{client-plugin.ts → chat-ui.ts} +1 -1
  53. package/templates/chat-app/chatjs/plugins/credits/{chatjs.json → plugin.json} +4 -13
  54. package/templates/chat-app/chatjs/plugins/credits/router.ts +4 -2
  55. package/templates/chat-app/chatjs/plugins/desktop/auth-form.tsx +3 -1
  56. package/templates/chat-app/chatjs/plugins/desktop/auth-server.ts +3 -1
  57. package/templates/chat-app/chatjs/plugins/desktop/{client-plugin.ts → layout-ui.ts} +1 -1
  58. package/templates/chat-app/chatjs/plugins/desktop/navigation.ts +3 -1
  59. package/templates/chat-app/chatjs/plugins/desktop/{chatjs.json → plugin.json} +4 -16
  60. package/templates/chat-app/chatjs/plugins/desktop/sign-out.ts +3 -1
  61. package/templates/chat-app/chatjs/plugins/feedback/chat-server.ts +13 -0
  62. package/templates/chat-app/chatjs/plugins/feedback/{client-plugin.ts → chat-ui.ts} +1 -1
  63. package/templates/chat-app/chatjs/plugins/feedback/feedback-actions.tsx +4 -4
  64. package/templates/chat-app/chatjs/plugins/feedback/feedback-queries.ts +11 -11
  65. package/templates/chat-app/chatjs/plugins/feedback/feedback-schema.ts +2 -2
  66. package/templates/chat-app/chatjs/plugins/feedback/{chatjs.json → plugin.json} +5 -14
  67. package/templates/chat-app/chatjs/plugins/feedback/router.ts +9 -7
  68. package/templates/chat-app/chatjs/plugins/feedback/vote-message.ts +3 -6
  69. package/templates/chat-app/chatjs/plugins/followup-suggestions/{chat.ts → chat-server.ts} +3 -1
  70. package/templates/chat-app/chatjs/plugins/followup-suggestions/{client-plugin.ts → chat-ui.ts} +1 -1
  71. package/templates/chat-app/chatjs/plugins/followup-suggestions/followup-queries.ts +2 -2
  72. package/templates/chat-app/chatjs/plugins/followup-suggestions/{chatjs.json → plugin.json} +5 -17
  73. package/templates/chat-app/chatjs/plugins/followup-suggestions/router.ts +8 -9
  74. package/templates/chat-app/chatjs/plugins/followup-suggestions/suggestions.tsx +2 -7
  75. package/templates/chat-app/chatjs/plugins/followup-suggestions/use-followups.ts +2 -2
  76. package/templates/chat-app/chatjs/plugins/guest-chat/cleanup.ts +1 -7
  77. package/templates/chat-app/chatjs/plugins/guest-chat/guest-auth.ts +1 -0
  78. package/templates/chat-app/chatjs/plugins/guest-chat/instrumentation.ts +6 -0
  79. package/templates/chat-app/chatjs/plugins/guest-chat/{chatjs.json → plugin.json} +6 -12
  80. package/templates/chat-app/chatjs/plugins/guest-chat/session-profile.ts +3 -1
  81. package/templates/chat-app/chatjs/plugins/guest-chat/signed-out.tsx +46 -20
  82. package/templates/chat-app/chatjs/plugins/image-viewer/{client-plugin.ts → chat-ui.ts} +1 -1
  83. package/templates/chat-app/chatjs/plugins/image-viewer/plugin.json +11 -0
  84. package/templates/chat-app/chatjs/plugins/mcp/{client-plugin.ts → chat-ui.ts} +1 -1
  85. package/templates/chat-app/chatjs/plugins/mcp/db/encrypted-text.ts +1 -1
  86. package/templates/chat-app/chatjs/plugins/mcp/{chatjs.json → plugin.json} +5 -13
  87. package/templates/chat-app/chatjs/plugins/mcp/router.ts +4 -2
  88. package/templates/chat-app/chatjs/plugins/mcp/setup.ts +2 -2
  89. package/templates/chat-app/chatjs/plugins/mcp/{mcp-env.ts → validate-env.ts} +2 -1
  90. package/templates/chat-app/chatjs/plugins/model-preferences/{client-plugin.ts → chat-ui.ts} +1 -3
  91. package/templates/chat-app/chatjs/plugins/model-preferences/{use-model-preferences.ts → model-visibility.ts} +1 -1
  92. package/templates/chat-app/chatjs/plugins/model-preferences/{chatjs.json → plugin.json} +5 -13
  93. package/templates/chat-app/chatjs/plugins/model-preferences/router.ts +5 -1
  94. package/templates/chat-app/chatjs/plugins/projects/{chat.ts → chat-server.ts} +3 -1
  95. package/templates/chat-app/chatjs/plugins/projects/{client-plugin.ts → chat-ui.ts} +1 -1
  96. package/templates/chat-app/chatjs/plugins/projects/conversation-hook.ts +1 -1
  97. package/templates/chat-app/chatjs/plugins/projects/db/project-queries.ts +2 -2
  98. package/templates/chat-app/chatjs/plugins/projects/{chatjs.json → plugin.json} +5 -14
  99. package/templates/chat-app/chatjs/plugins/projects/router.ts +7 -7
  100. package/templates/chat-app/chatjs/plugins/projects/ui/chat-contributions.tsx +3 -3
  101. package/templates/chat-app/chatjs/plugins/projects/ui/eve-move-project-dialog.tsx +1 -1
  102. package/templates/chat-app/chatjs/plugins/projects/ui/sidebar-projects.tsx +12 -11
  103. package/templates/chat-app/chatjs/plugins/search/{chat.ts → chat-server.ts} +8 -6
  104. package/templates/chat-app/chatjs/plugins/search/{client-plugin.ts → chat-ui.ts} +1 -1
  105. package/templates/chat-app/chatjs/plugins/search/{chatjs.json → plugin.json} +5 -14
  106. package/templates/chat-app/chatjs/plugins/search/router.ts +4 -2
  107. package/templates/chat-app/chatjs/plugins/search/search-backfill.ts +4 -4
  108. package/templates/chat-app/chatjs/plugins/search/search-chats.tsx +1 -1
  109. package/templates/chat-app/chatjs/plugins/search/search-hook.ts +2 -2
  110. package/templates/chat-app/chatjs/plugins/search/search-queries.ts +13 -13
  111. package/templates/chat-app/chatjs/plugins/search/search-results-view.tsx +2 -2
  112. package/templates/chat-app/chatjs/plugins/search/search-schema.ts +3 -3
  113. package/templates/chat-app/chatjs/plugins/sharing/{chat.ts → chat-server.ts} +3 -1
  114. package/templates/chat-app/chatjs/plugins/sharing/{client-plugin.ts → chat-ui.ts} +1 -1
  115. package/templates/chat-app/chatjs/plugins/sharing/{chatjs.json → plugin.json} +5 -14
  116. package/templates/chat-app/chatjs/plugins/sharing/router.ts +4 -2
  117. package/templates/chat-app/chatjs/plugins/sharing/ui/chat-contributions.tsx +9 -11
  118. package/templates/chat-app/chatjs/plugins/sharing/ui/share-button.tsx +6 -6
  119. package/templates/chat-app/chatjs/plugins/sharing/ui/share-dialog.tsx +9 -9
  120. package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/{client-plugin.ts → chat-ui.ts} +1 -1
  121. package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/plugin.json +12 -0
  122. package/templates/chat-app/chatjs/plugins/video-viewer/{client-plugin.ts → chat-ui.ts} +1 -1
  123. package/templates/chat-app/chatjs/plugins/video-viewer/plugin.json +10 -0
  124. package/templates/chat-app/chatjs/tools/attach-workspace-file/tool.ts +2 -2
  125. package/templates/chat-app/components/chat/chat-composer.tsx +35 -7
  126. package/templates/chat-app/components/chat/chat-conversation-screen.tsx +3 -3
  127. package/templates/chat-app/components/chat/chat-navigation.tsx +11 -1
  128. package/templates/chat-app/components/chat/chat-sidebar.tsx +3 -6
  129. package/templates/chat-app/components/chat/chat-transcript.tsx +52 -23
  130. package/templates/chat-app/components/chat-slots.tsx +1 -1
  131. package/templates/chat-app/components/composer/composer-menu.tsx +5 -4
  132. package/templates/chat-app/components/eve/eve-chat-header.tsx +5 -7
  133. package/templates/chat-app/components/eve/eve-chat-page.tsx +9 -9
  134. package/templates/chat-app/components/eve/eve-composer.tsx +16 -5
  135. package/templates/chat-app/components/eve/eve-conversation.tsx +160 -96
  136. package/templates/chat-app/components/eve/eve-creation-recovery.tsx +21 -2
  137. package/templates/chat-app/components/eve/eve-deletion-provider.tsx +10 -12
  138. package/templates/chat-app/components/eve/eve-history-list.tsx +3 -8
  139. package/templates/chat-app/components/eve/eve-logical-context.tsx +1 -0
  140. package/templates/chat-app/components/eve/eve-logical-navigation.tsx +3 -3
  141. package/templates/chat-app/components/eve/eve-message-content.tsx +252 -0
  142. package/templates/chat-app/components/eve/eve-message-part.tsx +13 -58
  143. package/templates/chat-app/components/eve/eve-pending-input.tsx +82 -5
  144. package/templates/chat-app/components/eve/eve-runtime-provider.tsx +74 -15
  145. package/templates/chat-app/components/eve/use-eve-composer-draft.ts +64 -26
  146. package/templates/chat-app/components/eve/use-eve-fork.ts +14 -16
  147. package/templates/chat-app/components/eve/use-logical-commands.ts +3 -3
  148. package/templates/chat-app/components/eve/use-new-eve-conversation.tsx +42 -7
  149. package/templates/chat-app/components/parallel-responses/model-picker.tsx +5 -1
  150. package/templates/chat-app/components/parallel-responses/responses.tsx +2 -2
  151. package/templates/chat-app/integrations/routers.ts +1 -1
  152. package/templates/chat-app/lib/chat-after-create.test.ts +1 -1
  153. package/templates/chat-app/lib/chat-after-create.ts +1 -1
  154. package/templates/chat-app/lib/db/eve-creation-failure.ts +3 -3
  155. package/templates/chat-app/lib/db/eve-current-copy.ts +11 -11
  156. package/templates/chat-app/lib/db/eve-deletion.ts +19 -19
  157. package/templates/chat-app/lib/db/eve-dispatch.ts +115 -18
  158. package/templates/chat-app/lib/db/eve-file-purge.ts +4 -4
  159. package/templates/chat-app/lib/db/eve-files.ts +13 -13
  160. package/templates/chat-app/lib/db/eve-queries.ts +28 -43
  161. package/templates/chat-app/lib/db/eve-response-groups.ts +30 -112
  162. package/templates/chat-app/lib/db/eve-subagents.ts +8 -8
  163. package/templates/chat-app/lib/db/eve-title.ts +2 -2
  164. package/templates/chat-app/lib/db/eve-workspace-deletion.ts +3 -3
  165. package/templates/chat-app/lib/db/eve-workspace-turns.ts +37 -5
  166. package/templates/chat-app/lib/db/eve-workspaces.ts +3 -3
  167. package/templates/chat-app/lib/db/migrations/0029_branch_identifiers.sql +23 -0
  168. package/templates/chat-app/lib/db/migrations/meta/0029_snapshot.json +2547 -0
  169. package/templates/chat-app/lib/db/migrations/meta/_journal.json +7 -0
  170. package/templates/chat-app/lib/db/schema.ts +19 -25
  171. package/templates/chat-app/lib/eve/completed-copy-source.test.ts +12 -2
  172. package/templates/chat-app/lib/eve/completed-copy-source.ts +5 -2
  173. package/templates/chat-app/lib/eve/contracts.test.ts +5 -5
  174. package/templates/chat-app/lib/eve/contracts.ts +1 -1
  175. package/templates/chat-app/lib/eve/conversation-scope.test.ts +2 -2
  176. package/templates/chat-app/lib/eve/conversation-scope.ts +4 -4
  177. package/templates/chat-app/lib/eve/create-conversation-operation.test.ts +1 -1
  178. package/templates/chat-app/lib/eve/create-response-group.test.ts +3 -3
  179. package/templates/chat-app/lib/eve/delete-local-conversation.ts +3 -3
  180. package/templates/chat-app/lib/eve/generated-files.test.ts +1 -1
  181. package/templates/chat-app/lib/eve/generated-files.ts +2 -2
  182. package/templates/chat-app/lib/eve/logical-chat.test.ts +17 -17
  183. package/templates/chat-app/lib/eve/logical-chat.ts +27 -31
  184. package/templates/chat-app/lib/eve/logical-response-slots.ts +4 -7
  185. package/templates/chat-app/lib/eve/message-delivery.ts +1 -0
  186. package/templates/chat-app/lib/eve/pending-create.test.ts +46 -7
  187. package/templates/chat-app/lib/eve/pending-create.ts +36 -4
  188. package/templates/chat-app/lib/eve/persisted-wire-order.test.ts +2 -2
  189. package/templates/chat-app/lib/eve/prepare-deletion.ts +3 -3
  190. package/templates/chat-app/lib/eve/purge-local-resources.ts +3 -3
  191. package/templates/chat-app/lib/eve/reconcile-workspace-turn.ts +2 -2
  192. package/templates/chat-app/lib/eve/request-policy.ts +1 -0
  193. package/templates/chat-app/lib/eve/resolve-creation-request.ts +1 -1
  194. package/templates/chat-app/lib/eve/response-group-contracts.ts +1 -1
  195. package/templates/chat-app/lib/eve/response-group-lineage.test.ts +12 -12
  196. package/templates/chat-app/lib/eve/response-group-lineage.ts +21 -24
  197. package/templates/chat-app/lib/eve/response-group.test.ts +2 -2
  198. package/templates/chat-app/lib/eve/response-group.ts +1 -1
  199. package/templates/chat-app/lib/eve/response-model.ts +11 -1
  200. package/templates/chat-app/lib/eve/restore-message-attachments.test.ts +1 -1
  201. package/templates/chat-app/lib/eve/restore-message-attachments.ts +3 -3
  202. package/templates/chat-app/lib/eve/retire-session.ts +3 -3
  203. package/templates/chat-app/lib/eve/steer-rejected.ts +7 -0
  204. package/templates/chat-app/lib/eve/workspace-turn-evidence.test.ts +27 -0
  205. package/templates/chat-app/lib/eve/workspace-turn-evidence.ts +20 -13
  206. package/templates/chat-app/playwright.config.ts +5 -1
  207. package/templates/chat-app/scripts/agent-status.ts +6 -19
  208. package/templates/chat-app/scripts/check-env.ts +75 -56
  209. package/templates/chat-app/scripts/installed-environment-validation.ts +14 -15
  210. package/templates/chat-app/trpc/init.ts +2 -0
  211. package/templates/chat-app/trpc/routers/_app.test.ts +56 -0
  212. package/templates/chat-app/trpc/routers/_app.ts +12 -11
  213. package/templates/chat-app/trpc/routers/eve.router.ts +2 -2
  214. package/templates/chat-app/chatjs/core/installation/plugin.ts +0 -13
  215. package/templates/chat-app/chatjs/plugins/attachment-uploads/chatjs.json +0 -22
  216. package/templates/chat-app/chatjs/plugins/credits/server-plugin.ts +0 -5
  217. package/templates/chat-app/chatjs/plugins/feedback/chat.ts +0 -13
  218. package/templates/chat-app/chatjs/plugins/feedback/server-plugin.ts +0 -8
  219. package/templates/chat-app/chatjs/plugins/followup-suggestions/server-plugin.ts +0 -8
  220. package/templates/chat-app/chatjs/plugins/guest-chat/server-plugin.ts +0 -12
  221. package/templates/chat-app/chatjs/plugins/image-viewer/chatjs.json +0 -17
  222. package/templates/chat-app/chatjs/plugins/mcp/server-plugin.ts +0 -5
  223. package/templates/chat-app/chatjs/plugins/model-preferences/server-plugin.ts +0 -8
  224. package/templates/chat-app/chatjs/plugins/projects/server-plugin.ts +0 -8
  225. package/templates/chat-app/chatjs/plugins/search/server-plugin.ts +0 -5
  226. package/templates/chat-app/chatjs/plugins/sharing/server-plugin.ts +0 -5
  227. package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/chatjs.json +0 -18
  228. package/templates/chat-app/chatjs/plugins/video-viewer/chatjs.json +0 -16
  229. package/templates/chat-app/lib/chat-route.ts +0 -18
  230. package/templates/chat-app/providers/parse-chat-id-from-pathname.test.ts +0 -126
  231. package/templates/chat-app/providers/parse-chat-id-from-pathname.ts +0 -51
  232. /package/templates/chat-app/chatjs/plugins/attachment-uploads/{integration.tsx → uploads.ts} +0 -0
@@ -21,15 +21,22 @@ import { getBoundEveConversationForSession } from "@/lib/db/eve-queries";
21
21
  import { rejectEveCommand } from "@/lib/eve/command-rejection";
22
22
  import { EVE_MESSAGE_OPERATION_HEADER } from "@/lib/eve/message-delivery";
23
23
  import { loadEveModelDefinition } from "@/lib/eve/model-selection";
24
+ import { getEveConnectionOptions } from "@/lib/eve/connection-options";
24
25
  import { prepareEveMessage } from "@/lib/eve/prepare-message";
25
26
  import { resolveEvePrincipal } from "@/lib/eve/principal";
27
+ import {
28
+ activeResponseModel,
29
+ responseModelReferences,
30
+ } from "@/lib/eve/response-model";
26
31
  import {
27
32
  parseSessionRequest,
28
33
  safeStreamQuery,
29
34
  sameOrigin,
30
35
  } from "@/lib/eve/request-policy";
31
36
  import { eveRequest } from "@/lib/eve/server";
37
+ import { EveSteerRejectedError } from "@/lib/eve/steer-rejected";
32
38
  import { relayResponse } from "./relay-response";
39
+ import { Client, conversationOf } from "eve/client";
33
40
  import { z } from "zod";
34
41
 
35
42
  const HTTP_BAD_REQUEST = 400;
@@ -39,6 +46,8 @@ const HTTP_NOT_FOUND = 404;
39
46
  const HTTP_PAYMENT_REQUIRED = 402;
40
47
  const NO_QUERY_PARAMETERS = 0;
41
48
  const COMMAND_TIMEOUT_MS = 30_000;
49
+ const ATTACHMENT_MODEL_TIMEOUT_MS = 5000;
50
+ const NATIVE_SESSION_CONFLICT = 409;
42
51
  const rejectRequest = (
43
52
  request: { readonly method: string },
44
53
  message: string,
@@ -85,6 +94,78 @@ const parseToolSelection = (
85
94
  () => header === null || typeof body !== "string" || header === body
86
95
  )
87
96
  .safeParse(header ?? body);
97
+
98
+ const steeringAttachmentModel = async (
99
+ ownerId: string,
100
+ sessionId: string,
101
+ fileKeys: readonly string[]
102
+ ): Promise<string | undefined> => {
103
+ if (fileKeys.length === 0) {
104
+ return undefined;
105
+ }
106
+ const client = new Client(getEveConnectionOptions(ownerId));
107
+ const { events } = await client.sessions
108
+ .attach(sessionId)
109
+ .snapshot({ signal: AbortSignal.timeout(ATTACHMENT_MODEL_TIMEOUT_MS) });
110
+ const modelId = activeResponseModel(
111
+ conversationOf(events).view,
112
+ responseModelReferences(events)
113
+ );
114
+ if (modelId === undefined) {
115
+ throw new Error("Wait for the active model before sending attachments.");
116
+ }
117
+ return modelId;
118
+ };
119
+
120
+ const readSteerRejection = async (
121
+ response: ReadonlyNativeSurface<Response>
122
+ ): Promise<string | undefined> => {
123
+ if (
124
+ response.status !== HTTP_BAD_REQUEST &&
125
+ response.status !== NATIVE_SESSION_CONFLICT
126
+ ) {
127
+ return undefined;
128
+ }
129
+ const body = z
130
+ .object({
131
+ ok: z.literal(false),
132
+ error: z.string(),
133
+ code: z.string().optional(),
134
+ })
135
+ .safeParse(await response.json().catch(() => null));
136
+ if (
137
+ body.success &&
138
+ (response.status === HTTP_BAD_REQUEST ||
139
+ body.data.code === "session_not_active" ||
140
+ body.data.code === "session_not_ready" ||
141
+ body.data.code === "session_stranded")
142
+ ) {
143
+ return body.data.error;
144
+ }
145
+ return undefined;
146
+ };
147
+
148
+ const prepareSteerBody = async (
149
+ message: ReadonlyNativeSurface<EveMessageInput>,
150
+ ownerId: string,
151
+ branchId: string,
152
+ sessionId: string
153
+ ): Promise<string> => {
154
+ try {
155
+ const fileKeys = eveMessageFileKeys(message);
156
+ const modelId = await steeringAttachmentModel(ownerId, sessionId, fileKeys);
157
+ await referenceEveFiles(ownerId, branchId, fileKeys);
158
+ return JSON.stringify({
159
+ message: await prepareEveMessage(message, modelId),
160
+ turnPolicy: "steer",
161
+ });
162
+ } catch (error) {
163
+ throw new EveSteerRejectedError(
164
+ error instanceof Error ? error.message : "Unable to read attachment."
165
+ );
166
+ }
167
+ };
168
+
88
169
  const readCommand = async (
89
170
  request: {
90
171
  readonly method: string;
@@ -92,6 +173,7 @@ const readCommand = async (
92
173
  readonly headers: { readonly get: (name: string) => string | null };
93
174
  },
94
175
  policy: {
176
+ readonly sessionId: string;
95
177
  readonly schema: Readonly<
96
178
  Pick<
97
179
  NonNullable<ReturnType<typeof parseSessionRequest>>["schema"],
@@ -100,10 +182,10 @@ const readCommand = async (
100
182
  >;
101
183
  },
102
184
  {
103
- conversationId,
185
+ branchId,
104
186
  ownerId,
105
187
  }: {
106
- readonly conversationId: string;
188
+ readonly branchId: string;
107
189
  readonly ownerId: string;
108
190
  }
109
191
  ): Promise<
@@ -114,6 +196,8 @@ const readCommand = async (
114
196
  message: EveMessageInput | undefined;
115
197
  modelId: string | undefined;
116
198
  selectedTool: UiToolName | undefined;
199
+ turnPolicy: "steer" | undefined;
200
+ steerSessionId: string | undefined;
117
201
  }
118
202
  > => {
119
203
  let body: string | undefined;
@@ -121,6 +205,7 @@ const readCommand = async (
121
205
  let message: EveMessageInput | undefined;
122
206
  let modelId: string | undefined;
123
207
  let selectedTool: UiToolName | undefined;
208
+ let turnPolicy: "steer" | undefined;
124
209
  if (request.method === "POST") {
125
210
  const input = policy.schema.safeParse(
126
211
  await request.json().catch(() => null)
@@ -129,7 +214,7 @@ const readCommand = async (
129
214
  return rejectEveCommand("Invalid command.", HTTP_BAD_REQUEST);
130
215
  }
131
216
  if ("message" in input.data) {
132
- ({ message } = input.data);
217
+ ({ message, turnPolicy } = input.data);
133
218
  const operationId = z
134
219
  .uuid()
135
220
  .safeParse(request.headers.get(EVE_MESSAGE_OPERATION_HEADER));
@@ -156,28 +241,71 @@ const readCommand = async (
156
241
  );
157
242
  }
158
243
  modelId = selectedModel ?? input.data.modelId;
159
- try {
160
- await loadEveModelDefinition(modelId);
161
- await referenceEveFiles(
162
- ownerId,
163
- conversationId,
164
- eveMessageFileKeys(input.data.message)
165
- );
166
- body = JSON.stringify({
167
- message: await prepareEveMessage(input.data.message, modelId),
168
- });
169
- } catch (error) {
170
- return rejectEveCommand(
171
- error instanceof Error ? error.message : "Unable to read attachment.",
172
- HTTP_BAD_REQUEST
173
- );
244
+ if (turnPolicy === undefined) {
245
+ try {
246
+ await loadEveModelDefinition(modelId);
247
+ await referenceEveFiles(
248
+ ownerId,
249
+ branchId,
250
+ eveMessageFileKeys(message)
251
+ );
252
+ body = JSON.stringify({
253
+ message: await prepareEveMessage(message, modelId),
254
+ });
255
+ } catch (error) {
256
+ return rejectEveCommand(
257
+ error instanceof Error
258
+ ? error.message
259
+ : "Unable to read attachment.",
260
+ HTTP_BAD_REQUEST
261
+ );
262
+ }
174
263
  }
175
264
  } else {
176
265
  body = JSON.stringify(input.data);
177
266
  }
178
267
  isNewMessage = "message" in input.data;
179
268
  }
180
- return { body, isNewMessage, message, modelId, selectedTool };
269
+ const turnOptions =
270
+ turnPolicy === undefined
271
+ ? { modelId, selectedTool }
272
+ : { modelId: undefined, selectedTool: undefined };
273
+ return {
274
+ body,
275
+ isNewMessage,
276
+ message,
277
+ ...turnOptions,
278
+ turnPolicy,
279
+ steerSessionId: turnPolicy === "steer" ? policy.sessionId : undefined,
280
+ };
281
+ };
282
+ const commandFailureResponse = (error: unknown): Response => {
283
+ if (error instanceof EveWorkspaceBusyError) {
284
+ return rejectEveCommand(error.message, 409);
285
+ }
286
+ if (error instanceof EveUsageReconciliationBusyError) {
287
+ return eveUsageBusyResponse(error);
288
+ }
289
+ if (error instanceof EveSteerRejectedError) {
290
+ return rejectEveCommand(error.message, HTTP_BAD_REQUEST);
291
+ }
292
+ if (error instanceof EveDispatchUnknownError) {
293
+ return Response.json(
294
+ {
295
+ code: "chatjs_delivery_unknown",
296
+ error:
297
+ "Message delivery is unknown. This operation will not be sent again.",
298
+ },
299
+ { status: 502, headers: { "cache-control": "no-store" } }
300
+ );
301
+ }
302
+ return Response.json(
303
+ {
304
+ error:
305
+ "The agent connection was interrupted. Reconnect to check its status; delivery may remain unknown.",
306
+ },
307
+ { status: 502 }
308
+ );
181
309
  };
182
310
  const handle = async (
183
311
  request: ReadonlyNativeSurface<Request>,
@@ -222,13 +350,13 @@ const handle = async (
222
350
  // Capture owner before the conversation getter, matching the original argument order.
223
351
  const { ownerId } = principal;
224
352
  const command = await readCommand(request, policy, {
225
- conversationId: conversation.id,
353
+ branchId: conversation.id,
226
354
  ownerId,
227
355
  });
228
356
  if (command instanceof Response) {
229
357
  return command;
230
358
  }
231
- const { body, modelId, selectedTool } = command;
359
+ const { body, modelId, selectedTool, steerSessionId, turnPolicy } = command;
232
360
  try {
233
361
  const admission = await checkTurnAdmission(
234
362
  { principal, sessionId: policy.sessionId },
@@ -237,12 +365,12 @@ const handle = async (
237
365
  if (admission instanceof Response) {
238
366
  return admission;
239
367
  }
240
- const dispatch = async (): Promise<Response> => {
368
+ const dispatch = async (dispatchBody = body): Promise<Response> => {
241
369
  const result = await eveRequest(
242
370
  principal.ownerId,
243
371
  `/eve/chat/${path.join("/")}${query.size > NO_QUERY_PARAMETERS ? `?${query}` : ""}`,
244
372
  {
245
- body,
373
+ body: dispatchBody,
246
374
  method: request.method,
247
375
  // Closing the reader must not cancel a validated command before Eve
248
376
  // can durably accept it. Streaming reads still follow browser lifetime.
@@ -264,18 +392,37 @@ const handle = async (
264
392
  {
265
393
  ownerId,
266
394
  operationId,
267
- conversationId: conversation.id,
395
+ branchId: conversation.id,
268
396
  kind: "send",
397
+ steerSessionId,
269
398
  intent: {
270
399
  sessionId: policy.sessionId,
271
400
  message: command.message,
272
401
  modelId: modelId ?? null,
273
402
  selectedTool: selectedTool ?? null,
403
+ turnPolicy,
274
404
  },
275
405
  },
276
406
  async () => {
277
- const result = await dispatch();
407
+ const { message } = command;
408
+ const result = await dispatch(
409
+ turnPolicy === "steer" && message !== undefined
410
+ ? await prepareSteerBody(
411
+ message,
412
+ ownerId,
413
+ conversation.id,
414
+ policy.sessionId
415
+ )
416
+ : body
417
+ );
278
418
  if (!result.ok) {
419
+ const rejection =
420
+ turnPolicy === "steer"
421
+ ? await readSteerRejection(result)
422
+ : undefined;
423
+ if (rejection !== undefined) {
424
+ throw new EveSteerRejectedError(rejection);
425
+ }
279
426
  throw new EveDispatchUnknownError();
280
427
  }
281
428
  return z
@@ -294,34 +441,13 @@ const handle = async (
294
441
  return relayResponse(
295
442
  await (request.method === "GET"
296
443
  ? dispatch()
297
- : withEveCopyCaptureFence(ownerId, dispatch))
444
+ : withEveCopyCaptureFence(ownerId, async () => await dispatch()))
298
445
  );
299
446
  } catch (error) {
300
- if (error instanceof EveWorkspaceBusyError) {
301
- return rejectEveCommand(error.message, 409);
302
- }
303
- if (error instanceof EveUsageReconciliationBusyError) {
304
- return eveUsageBusyResponse(error);
305
- }
306
- if (error instanceof EveDispatchUnknownError) {
307
- return Response.json(
308
- {
309
- code: "chatjs_delivery_unknown",
310
- error:
311
- "Message delivery is unknown. This operation will not be sent again.",
312
- },
313
- { status: 502, headers: { "cache-control": "no-store" } }
314
- );
315
- }
316
- return Response.json(
317
- {
318
- error:
319
- "The agent connection was interrupted. Reconnect to check its status; delivery may remain unknown.",
320
- },
321
- { status: 502 }
322
- );
447
+ return commandFailureResponse(error);
323
448
  }
324
449
  };
450
+
325
451
  const GET = handle;
326
452
  const POST = handle;
327
453
  export { GET, POST };
@@ -1,2 +1,2 @@
1
- // ChatJS source: guest-chat. Ownership: chatjs/plugins/guest-chat/chatjs.json.
1
+ // ChatJS source: guest-chat. Ownership: chatjs/plugins/guest-chat/plugin.json.
2
2
  export { POST } from "@/chatjs/plugins/guest-chat/routes/create-session";
@@ -1,2 +1,2 @@
1
- // ChatJS source: mcp. Ownership: chatjs/plugins/mcp/chatjs.json.
1
+ // ChatJS source: mcp. Ownership: chatjs/plugins/mcp/plugin.json.
2
2
  export { GET } from "@/chatjs/plugins/mcp/routes/oauth-callback";
@@ -10,7 +10,7 @@ const log = createModuleLogger("chat.after-create");
10
10
  const runAfter = async (
11
11
  adapters: readonly ChatServerIntegration[],
12
12
  invoke: (adapter: ChatServerIntegration) => Promise<void>,
13
- branchConversationId?: string
13
+ branchId?: string
14
14
  ): Promise<void> => {
15
15
  for (const [adapterIndex, adapter] of adapters.entries()) {
16
16
  try {
@@ -18,11 +18,11 @@ const runAfter = async (
18
18
  await invoke(adapter);
19
19
  } catch (error) {
20
20
  const errorName = error instanceof Error ? error.name : typeof error;
21
- if (branchConversationId === undefined) {
21
+ if (branchId === undefined) {
22
22
  log.warn({ errorName }, "Chat afterCreate contribution failed");
23
23
  } else {
24
24
  log.warn(
25
- { errorName, adapterIndex, conversationId: branchConversationId },
25
+ { errorName, adapterIndex, branchId },
26
26
  "Chat afterBranch contribution failed"
27
27
  );
28
28
  }
@@ -63,7 +63,7 @@ export const composeChat = (
63
63
  async (adapter) => {
64
64
  await adapter.afterBranch?.(context);
65
65
  },
66
- context.conversationId
66
+ context.branchId
67
67
  );
68
68
  },
69
69
  historyFilter: (input, surface) =>
@@ -16,7 +16,7 @@ export interface ChatLinks {
16
16
 
17
17
  export interface ChatCreatedContext {
18
18
  readonly ownerId: string;
19
- readonly conversationId: string;
19
+ readonly branchId: string;
20
20
  readonly message: ReadonlyEveMessageInput;
21
21
  }
22
22
 
@@ -28,7 +28,7 @@ export interface ChatServerIntegration {
28
28
  /** After a branch is bound, outside its transaction. May repeat on recovery. */
29
29
  readonly afterBranch?: (context: {
30
30
  readonly ownerId: string;
31
- readonly conversationId: string;
31
+ readonly branchId: string;
32
32
  readonly sessionId: string;
33
33
  }) => Promise<void>;
34
34
  /** Called only for a newly inserted logical chat, before its transaction commits. */
@@ -52,7 +52,7 @@ export interface ChatServerIntegration {
52
52
  readonly onDeleteConversations?: (
53
53
  tx: Readonly<Pick<typeof db, "delete">>,
54
54
  context: {
55
- readonly conversationIds: readonly string[];
55
+ readonly branchIds: readonly string[];
56
56
  readonly sessionIds: readonly string[];
57
57
  }
58
58
  ) => Promise<void>;
@@ -67,18 +67,18 @@ export interface ChatActionProps {
67
67
  readonly chat: {
68
68
  readonly id: string;
69
69
  readonly title: string;
70
- readonly conversationId?: string | null;
70
+ readonly branchId?: string | null;
71
71
  readonly state?: string;
72
72
  };
73
73
  }
74
74
  export interface ChatMessageProps {
75
- readonly conversationId: string;
75
+ readonly branchId: string;
76
76
  readonly messageId: string;
77
77
  readonly disabled: boolean;
78
78
  }
79
79
  export interface ChatSuggestionsProps {
80
80
  readonly sessionId: string;
81
- readonly conversationId: string;
81
+ readonly branchId: string;
82
82
  readonly events: readonly SessionStreamEvent[];
83
83
  readonly lastMessage?: {
84
84
  readonly role: string;
@@ -1,11 +1,5 @@
1
- import type { AnyTRPCRouter } from "@trpc/server";
2
1
  import type { DraftAttachment } from "@/lib/eve/draft";
3
2
 
4
- /** Preserve inferred procedure types: use `satisfies`, never annotate the map. */
5
- type InstalledRouters = Record<string, AnyTRPCRouter> & {
6
- eve?: never;
7
- };
8
-
9
3
  /** Installed once; only filters the picker. Core retains catalog and eligibility. */
10
4
  type ModelVisibility = (
11
5
  defaultEnabledIds: ReadonlySet<string>
@@ -37,6 +31,5 @@ export type {
37
31
  AttachmentUploadBehavior,
38
32
  AttachmentUploadInput,
39
33
  AttachmentUploadIntegration,
40
- InstalledRouters,
41
34
  InstrumentationRegistration,
42
35
  };
@@ -1,5 +1,5 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { DesktopAuthForm as pluginForm } from "@/chatjs/plugins/desktop/auth-form";
2
+ import desktopForm from "@/chatjs/plugins/desktop/auth-form";
3
3
  import type { AuthenticationUi } from "@/chatjs/core/authentication/contracts";
4
4
  export const installedAuthenticationForms: readonly AuthenticationUi["Form"][] =
5
- [pluginForm];
5
+ [desktopForm];
@@ -1,4 +1,6 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { desktopAuth as pluginAuth } from "@/chatjs/plugins/desktop/auth-server";
2
+ import desktopAuth from "@/chatjs/plugins/desktop/auth-server";
3
3
  import type { AuthenticationIntegration } from "@/chatjs/core/authentication/contracts";
4
- export const installedAuth: readonly AuthenticationIntegration[] = [pluginAuth];
4
+ export const installedAuth: readonly AuthenticationIntegration[] = [
5
+ desktopAuth,
6
+ ];
@@ -1,4 +1,4 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { creditsBilling as pluginBilling } from "@/chatjs/plugins/credits/billing";
2
+ import creditsBilling from "@/chatjs/plugins/credits/billing";
3
3
  import type { UsageBilling } from "@/chatjs/core/billing/contracts";
4
- export const installedBilling: readonly UsageBilling[] = [pluginBilling];
4
+ export const installedBilling: readonly UsageBilling[] = [creditsBilling];
@@ -1,29 +1,29 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
2
  "use client";
3
- import { attachmentUploadsClient as plugin0 } from "@/chatjs/plugins/attachment-uploads/client-plugin";
4
- import { creditsClient as plugin1 } from "@/chatjs/plugins/credits/client-plugin";
5
- import { feedbackClient as plugin2 } from "@/chatjs/plugins/feedback/client-plugin";
6
- import { followupSuggestionsClient as plugin3 } from "@/chatjs/plugins/followup-suggestions/client-plugin";
7
- import { imageViewerClient as plugin4 } from "@/chatjs/plugins/image-viewer/client-plugin";
8
- import { mcpClient as plugin5 } from "@/chatjs/plugins/mcp/client-plugin";
9
- import { modelPreferencesClient as plugin6 } from "@/chatjs/plugins/model-preferences/client-plugin";
10
- import { projectsClient as plugin7 } from "@/chatjs/plugins/projects/client-plugin";
11
- import { searchClient as plugin8 } from "@/chatjs/plugins/search/client-plugin";
12
- import { sharingClient as plugin9 } from "@/chatjs/plugins/sharing/client-plugin";
13
- import { spreadsheetViewerClient as plugin10 } from "@/chatjs/plugins/spreadsheet-viewer/client-plugin";
14
- import { videoViewerClient as plugin11 } from "@/chatjs/plugins/video-viewer/client-plugin";
3
+ import { chatUi as attachmentUploadsClient } from "@/chatjs/plugins/attachment-uploads/chat-ui";
4
+ import { chatUi as creditsClient } from "@/chatjs/plugins/credits/chat-ui";
5
+ import { chatUi as feedbackClient } from "@/chatjs/plugins/feedback/chat-ui";
6
+ import { chatUi as followupSuggestionsClient } from "@/chatjs/plugins/followup-suggestions/chat-ui";
7
+ import { chatUi as imageViewerClient } from "@/chatjs/plugins/image-viewer/chat-ui";
8
+ import { chatUi as mcpClient } from "@/chatjs/plugins/mcp/chat-ui";
9
+ import { chatUi as modelPreferencesClient } from "@/chatjs/plugins/model-preferences/chat-ui";
10
+ import { chatUi as projectsClient } from "@/chatjs/plugins/projects/chat-ui";
11
+ import { chatUi as searchClient } from "@/chatjs/plugins/search/chat-ui";
12
+ import { chatUi as sharingClient } from "@/chatjs/plugins/sharing/chat-ui";
13
+ import { chatUi as spreadsheetViewerClient } from "@/chatjs/plugins/spreadsheet-viewer/chat-ui";
14
+ import { chatUi as videoViewerClient } from "@/chatjs/plugins/video-viewer/chat-ui";
15
15
  import type { UiPlugin } from "@/chatjs/core/ui/slots";
16
16
  export const installedChatPlugins: readonly UiPlugin[] = [
17
- plugin0,
18
- plugin1,
19
- plugin2,
20
- plugin3,
21
- plugin4,
22
- plugin5,
23
- plugin6,
24
- plugin7,
25
- plugin8,
26
- plugin9,
27
- plugin10,
28
- plugin11,
17
+ attachmentUploadsClient,
18
+ creditsClient,
19
+ feedbackClient,
20
+ followupSuggestionsClient,
21
+ imageViewerClient,
22
+ mcpClient,
23
+ modelPreferencesClient,
24
+ projectsClient,
25
+ searchClient,
26
+ sharingClient,
27
+ spreadsheetViewerClient,
28
+ videoViewerClient,
29
29
  ];
@@ -1,16 +1,16 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { aiTitlesChat as chat0 } from "@/chatjs/plugins/ai-titles/chat";
3
- import { feedbackChat as chat1 } from "@/chatjs/plugins/feedback/chat";
4
- import { followupChat as chat2 } from "@/chatjs/plugins/followup-suggestions/chat";
5
- import { projectsChat as chat3 } from "@/chatjs/plugins/projects/chat";
6
- import { searchChat as chat4 } from "@/chatjs/plugins/search/chat";
7
- import { sharingChat as chat5 } from "@/chatjs/plugins/sharing/chat";
2
+ import aiTitlesChat from "@/chatjs/plugins/ai-titles/chat-server";
3
+ import feedbackChat from "@/chatjs/plugins/feedback/chat-server";
4
+ import followupSuggestionsChat from "@/chatjs/plugins/followup-suggestions/chat-server";
5
+ import projectsChat from "@/chatjs/plugins/projects/chat-server";
6
+ import searchChat from "@/chatjs/plugins/search/chat-server";
7
+ import sharingChat from "@/chatjs/plugins/sharing/chat-server";
8
8
  import type { ChatServerIntegration } from "@/chatjs/core/chat/contracts";
9
9
  export const installedChat: readonly ChatServerIntegration[] = [
10
- chat0,
11
- chat1,
12
- chat2,
13
- chat3,
14
- chat4,
15
- chat5,
10
+ aiTitlesChat,
11
+ feedbackChat,
12
+ followupSuggestionsChat,
13
+ projectsChat,
14
+ searchChat,
15
+ sharingChat,
16
16
  ];
@@ -1,6 +1,6 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { guestCleanup as cleanup0 } from "@/chatjs/plugins/guest-chat/cleanup";
2
+ import guestChatCleanup from "@/chatjs/plugins/guest-chat/cleanup";
3
3
  import type { CleanupTask } from "@/lib/cleanup/contracts";
4
- if (cleanup0.id !== "guest-chat")
5
- throw new Error("Cleanup identity disagrees with its descriptor.");
6
- export const installedCleanupTasks: readonly CleanupTask[] = [cleanup0];
4
+ export const installedCleanupTasks: readonly CleanupTask[] = [
5
+ { id: "guest-chat", run: guestChatCleanup },
6
+ ];
@@ -1,5 +1,11 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { guestChat as plugin0 } from "@/chatjs/plugins/guest-chat/server-plugin";
3
2
  import type { InstrumentationRegistration } from "@/chatjs/core/installation/contracts";
3
+
4
4
  export const installedInstrumentation: readonly InstrumentationRegistration[] =
5
- [plugin0().instrumentation];
5
+ [
6
+ async () => {
7
+ const { default: registerGuestChat } =
8
+ await import("@/chatjs/plugins/guest-chat/instrumentation");
9
+ await registerGuestChat();
10
+ },
11
+ ];
@@ -1,5 +1,5 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
2
  "use client";
3
- import { desktopClient as plugin0 } from "@/chatjs/plugins/desktop/client-plugin";
3
+ import { layoutUi as desktopLayout } from "@/chatjs/plugins/desktop/layout-ui";
4
4
  import type { UiPlugin } from "@/chatjs/core/ui/slots";
5
- export const installedLayoutPlugins: readonly UiPlugin[] = [plugin0];
5
+ export const installedLayoutPlugins: readonly UiPlugin[] = [desktopLayout];
@@ -1,6 +1,6 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { modelPreferencesClient as plugin0 } from "@/chatjs/plugins/model-preferences/client-plugin";
2
+ import { useModelVisibility } from "@/chatjs/plugins/model-preferences/model-visibility";
3
3
  import type { ModelVisibility } from "@/chatjs/core/installation/contracts";
4
4
  export const installedModelVisibility: readonly ModelVisibility[] = [
5
- plugin0.useModelVisibility,
5
+ useModelVisibility,
6
6
  ];
@@ -1,5 +1,5 @@
1
1
  // Generated by chat-js sync. Do not edit. Customize integrations/ or plugin source; inspect ownership with chat-js status.
2
- import { desktopNavigation as navigate } from "@/chatjs/plugins/desktop/navigation";
2
+ import desktopNavigation from "@/chatjs/plugins/desktop/navigation";
3
3
  export const installedNavigationHandlers: readonly (() => boolean)[] = [
4
- navigate,
4
+ desktopNavigation,
5
5
  ];