@adecore/agent-contracts 0.67.1 → 0.69.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/dist/chat.d.ts +26 -0
- package/dist/chat.js +19 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol.d.ts +24 -1
- package/dist/protocol.js +3 -2
- package/dist/visual-viewport.js +5 -0
- package/package.json +3 -3
- package/src/chat.ts +23 -2
- package/src/index.ts +4 -0
- package/src/protocol.ts +4 -1
- package/src/visual-viewport.ts +5 -0
package/dist/chat.d.ts
CHANGED
|
@@ -4183,6 +4183,22 @@ export declare const ChatAttachPayloadSchema: z.ZodObject<{
|
|
|
4183
4183
|
chatId: z.ZodString;
|
|
4184
4184
|
historyLimit: z.ZodOptional<z.ZodNumber>;
|
|
4185
4185
|
since: z.ZodOptional<z.ZodNumber>;
|
|
4186
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
4187
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
4188
|
+
account: z.ZodOptional<z.ZodString>;
|
|
4189
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
4190
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
4191
|
+
selection: z.ZodOptional<z.ZodObject<{
|
|
4192
|
+
model: z.ZodString;
|
|
4193
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
4194
|
+
}, z.core.$strip>>;
|
|
4195
|
+
runtimeMode: z.ZodOptional<z.ZodEnum<{
|
|
4196
|
+
auto: "auto";
|
|
4197
|
+
"auto-accept-edits": "auto-accept-edits";
|
|
4198
|
+
"full-access": "full-access";
|
|
4199
|
+
supervised: "supervised";
|
|
4200
|
+
}>>;
|
|
4201
|
+
}, z.core.$strip>>;
|
|
4186
4202
|
}, z.core.$strip>;
|
|
4187
4203
|
export declare const ChatHistoryPayloadSchema: z.ZodObject<{
|
|
4188
4204
|
chatId: z.ZodString;
|
|
@@ -5382,6 +5398,11 @@ export declare const ChatVisualsEventSchema: z.ZodObject<{
|
|
|
5382
5398
|
}, z.core.$strip>>;
|
|
5383
5399
|
}, z.core.$strip>;
|
|
5384
5400
|
export type ChatVisualsEvent = z.infer<typeof ChatVisualsEventSchema>;
|
|
5401
|
+
export declare const ChatSuggestionEventSchema: z.ZodObject<{
|
|
5402
|
+
chatId: z.ZodString;
|
|
5403
|
+
suggestion: z.ZodNullable<z.ZodString>;
|
|
5404
|
+
}, z.core.$strip>;
|
|
5405
|
+
export type ChatSuggestionEvent = z.infer<typeof ChatSuggestionEventSchema>;
|
|
5385
5406
|
export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
5386
5407
|
info: z.ZodObject<{
|
|
5387
5408
|
chatId: z.ZodString;
|
|
@@ -8140,6 +8161,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
|
|
|
8140
8161
|
preTokens: z.ZodNullable<z.ZodNumber>;
|
|
8141
8162
|
postTokens: z.ZodOptional<z.ZodNumber>;
|
|
8142
8163
|
}, z.core.$strip>], "kind">>>;
|
|
8164
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
8143
8165
|
}, z.core.$strip>;
|
|
8144
8166
|
export type ChatAttachResult = z.infer<typeof ChatAttachResultSchema>;
|
|
8145
8167
|
export declare const ChatDeliverySchema: z.ZodEnum<{
|
|
@@ -8733,6 +8755,10 @@ export declare const ChatForkInfoResultSchema: z.ZodObject<{
|
|
|
8733
8755
|
filesAfterTurn: z.ZodBoolean;
|
|
8734
8756
|
}, z.core.$strip>;
|
|
8735
8757
|
export type ChatForkInfoResult = z.infer<typeof ChatForkInfoResultSchema>;
|
|
8758
|
+
export declare const ChatListPayloadSchema: z.ZodObject<{
|
|
8759
|
+
omitCommands: z.ZodOptional<z.ZodBoolean>;
|
|
8760
|
+
}, z.core.$strip>;
|
|
8761
|
+
export type ChatListPayload = z.infer<typeof ChatListPayloadSchema>;
|
|
8736
8762
|
export declare const ChatListResultSchema: z.ZodObject<{
|
|
8737
8763
|
chats: z.ZodArray<z.ZodObject<{
|
|
8738
8764
|
chatId: z.ZodString;
|
package/dist/chat.js
CHANGED
|
@@ -824,7 +824,12 @@ export const ChatCancelPayloadSchema = ChatTargetPayloadSchema.extend({ subagent
|
|
|
824
824
|
export const ChatAttachPayloadSchema = ChatTargetPayloadSchema.extend({
|
|
825
825
|
historyLimit: z.number().int().min(1).max(100).optional(),
|
|
826
826
|
// The last seq this client saw; honored when the daemon still holds everything after it.
|
|
827
|
-
since: z.number().int().nonnegative().optional()
|
|
827
|
+
since: z.number().int().nonnegative().optional(),
|
|
828
|
+
/*
|
|
829
|
+
* Makes the chat first, as `chat.create` with these would, so opening one takes a single request. A
|
|
830
|
+
* host that predates it ignores it and refuses a chat it does not have with `chat-not-found`.
|
|
831
|
+
*/
|
|
832
|
+
create: ChatCreatePayloadSchema.omit({ chatId: true }).optional()
|
|
828
833
|
});
|
|
829
834
|
export const ChatHistoryPayloadSchema = ChatTargetPayloadSchema.extend({
|
|
830
835
|
cursor: z.string().min(1).max(128),
|
|
@@ -916,6 +921,8 @@ export const ChatRemoveVisualPayloadSchema = ChatTargetPayloadSchema.extend({ vi
|
|
|
916
921
|
export const ChatVisualsResultSchema = z.object({ visuals: ChatVisualsSchema });
|
|
917
922
|
// The whole list after every change, to every client attached to the chat.
|
|
918
923
|
export const ChatVisualsEventSchema = z.object({ chatId: ChatIdSchema, visuals: ChatVisualsSchema });
|
|
924
|
+
// What the CLI predicts the person sends next, to every client attached to the chat; null once a turn opens. Never stored.
|
|
925
|
+
export const ChatSuggestionEventSchema = z.object({ chatId: ChatIdSchema, suggestion: z.string().min(1).nullable() });
|
|
919
926
|
export const ChatAttachResultSchema = z.object({
|
|
920
927
|
info: ChatInfoSchema,
|
|
921
928
|
items: z.array(ChatItemSchema),
|
|
@@ -933,7 +940,9 @@ export const ChatAttachResultSchema = z.object({
|
|
|
933
940
|
// With a page: the active Workflow calls (`activeWorkflows`) from before it, so what shows a workflow beside the thread never waits on a scroll.
|
|
934
941
|
workflows: z.array(ChatToolItemSchema).optional(),
|
|
935
942
|
// With a page: the thread before it as `outlineItems` cuts it, so the scrubber reaches the whole thread before a scroll does.
|
|
936
|
-
outline: z.array(ChatItemSchema).optional()
|
|
943
|
+
outline: z.array(ChatItemSchema).optional(),
|
|
944
|
+
// The next prompt the CLI predicts after the last turn; absent while it predicts none.
|
|
945
|
+
suggestion: z.string().min(1).optional()
|
|
937
946
|
});
|
|
938
947
|
export const ChatDeliverySchema = z.enum(['steer', 'queue']);
|
|
939
948
|
export const ChatSendPayloadSchema = z
|
|
@@ -1071,6 +1080,14 @@ export const ChatForkInfoResultSchema = z.object({
|
|
|
1071
1080
|
branch: z.string().nullable(),
|
|
1072
1081
|
filesAfterTurn: z.boolean()
|
|
1073
1082
|
});
|
|
1083
|
+
/*
|
|
1084
|
+
* With `omitCommands` every chat comes with `slashCommands` empty and without `skills`, which are most of
|
|
1085
|
+
* a long list's bytes and only a composer reads, from `chat.attach` and its events. A host that predates
|
|
1086
|
+
* it ignores it and sends them, so a client takes either answer.
|
|
1087
|
+
*/
|
|
1088
|
+
export const ChatListPayloadSchema = z.object({
|
|
1089
|
+
omitCommands: z.boolean().optional()
|
|
1090
|
+
});
|
|
1074
1091
|
export const ChatListResultSchema = z.object({
|
|
1075
1092
|
chats: lossyItems(z.array(ChatInfoSchema))
|
|
1076
1093
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AGENT_KIND_MAX_LENGTH, AgentKindSchema, type AgentKind, AgentStatusSchema, type AgentStatus, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, type AgentRequest, AgentInfoSchema, type AgentInfo, SessionStatusEventSchema, type SessionStatusEvent, AgentResumePayloadSchema, type AgentResumePayload, ApprovalChoiceSchema, type ApprovalChoice, ApprovalRequestSchema, type ApprovalRequest, SessionApprovalsEventSchema, type SessionApprovalsEvent, ApprovalAnswerPayloadSchema, type ApprovalAnswerPayload, ApprovalAnswerResultSchema, type ApprovalAnswerResult, ApprovalPreferencePayloadSchema, type ApprovalPreferencePayload } from './agent.ts';
|
|
2
|
-
export { ChatIdSchema, type ChatId, ChatContextBreakdownSchema, type ChatContextBreakdown, ChatUsageSchema, type ChatUsage, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, type ChatAttachmentUpload, ChatAttachmentUploadsSchema, ChatAttachmentSchema, type ChatAttachment, ChatUiChoiceOriginSchema, type ChatUiChoiceOrigin, ChatUiAnswerSchema, type ChatUiAnswer, ChatQuoteSourceSchema, type ChatQuoteSource, ChatQueuedMessageSchema, type ChatQueuedMessage, ChatBackgroundTaskSchema, type ChatBackgroundTask, ChatTurnLimitSchema, type ChatTurnLimit, ChatGoalStatusSchema, type ChatGoalStatus, ChatGoalSchema, type ChatGoal, ChatQuestionSchema, type ChatQuestion, ChatRequestKindSchema, type ChatRequestKind, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, type ChatRequestApproval, ChatRequestSummarySchema, type ChatRequestSummary, ChatInfoSchema, type ChatInfo, ChatSkillSourceSchema, type ChatSkillSource, ChatSkillSchema, type ChatSkill, SkillsListPayloadSchema, type SkillsListPayload, SkillsListResultSchema, type SkillsListResult, ChatUserItemSchema, ChatUiQueryReadingSchema, type ChatUiQueryReading, ChatUiLinkReadingSchema, type ChatUiLinkReading, ChatUiPlaceReadingSchema, type ChatUiPlaceReading, ChatUiQueryStateSchema, type ChatUiQueryState, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, type ChatToolState, ChatToolProgressSchema, type ChatToolProgress, ChatFileChangeSchema, type ChatFileChange, ChatSubagentStatusSchema, type ChatSubagentStatus, ChatWorkflowPhaseSchema, type ChatWorkflowPhase, ChatWorkflowAgentSchema, type ChatWorkflowAgent, ChatWorkflowSchema, type ChatWorkflow, workflowAgentRef, workflowAgentIdOf, CHAT_PAYLOAD_INLINE_BYTES, ChatPayloadRefSchema, type ChatPayloadRef, ChatToolItemSchema, ChatSubagentUsageSchema, type ChatSubagentUsage, HOST_TASK_ORIGIN, taskRowId, taskIdOfRow, ChatSubagentItemSchema, ChatApprovalDecisionSchema, type ChatApprovalDecision, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, type ChatCheckpointFile, ChatCheckpointDiffSchema, type ChatCheckpointDiff, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, activeWorkflows, workflowEndedAt, CHAT_OUTLINE_TEXT_CHARS, outlineItems, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatNoteMessageSchema, ChatCompactionItemSchema, ChatItemSchema, type ChatItem, type ChatUserItem, type ChatAssistantItem, type ChatThinkingItem, type ChatToolItem, type ChatSubagentItem, type ChatApprovalItem, type ChatQuestionItem, type ChatTurnItem, type ChatNoteItem, type ChatNoteMessage, type ChatCompactionItem, type ChatUnknownItem, ChatEventSchema, type ChatEvent, type ChatUnknownEvent, ChatEventEnvelopeSchema, type ChatEventEnvelope, ChatCreatePayloadSchema, type ChatCreatePayload, ChatConfigurePayloadSchema, type ChatConfigurePayload, ChatPreferencesPayloadSchema, type ChatPreferencesPayload, ChatTargetPayloadSchema, type ChatTargetPayload, ChatClearPayloadSchema, type ChatClearPayload, ChatCancelPayloadSchema, type ChatCancelPayload, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, type ChatHistoryResult, ChatSubagentPayloadSchema, type ChatSubagentPayload, ChatStopSubagentPayloadSchema, type ChatStopSubagentPayload, ChatGoalActionSchema, type ChatGoalAction, ChatGoalPayloadSchema, type ChatGoalPayload, ChatStopTaskPayloadSchema, type ChatStopTaskPayload, ChatSubagentPageSchema, ChatSubagentSourceSchema, type ChatSubagentSource, ChatSubagentResultSchema, type ChatSubagentResult, ChatStatusEventSchema, type ChatStatusEvent, ChatSubagentChangedEventSchema, type ChatSubagentChangedEvent, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, type ChatBookmark, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, type ChatAddBookmarkPayload, ChatRenameBookmarkPayloadSchema, type ChatRenameBookmarkPayload, ChatRemoveBookmarkPayloadSchema, type ChatRemoveBookmarkPayload, ChatBookmarksResultSchema, type ChatBookmarksResult, ChatBookmarksEventSchema, type ChatBookmarksEvent, ChatRemoveVisualPayloadSchema, type ChatRemoveVisualPayload, ChatVisualsResultSchema, type ChatVisualsResult, ChatVisualsEventSchema, type ChatVisualsEvent, ChatAttachResultSchema, type ChatAttachResult, ChatDeliverySchema, type ChatDelivery, ChatSendPayloadSchema, type ChatSendPayload, ChatSendResultSchema, type ChatSendResult, ChatUiChoicePayloadSchema, type ChatUiChoicePayload, ChatUiQueryPayloadSchema, type ChatUiQueryPayload, ChatUiLinkPayloadSchema, type ChatUiLinkPayload, ChatQueuePayloadSchema, type ChatQueuePayload, ChatUnqueueResultSchema, type ChatUnqueueResult, ChatApprovePayloadSchema, type ChatApprovePayload, ChatDismissPayloadSchema, type ChatDismissPayload, ChatAnswerPayloadSchema, type ChatAnswerPayload, ChatTurnDiffPayloadSchema, type ChatTurnDiffPayload, ChatTurnDiffResultSchema, type ChatTurnDiffResult, ChatToolOutputPayloadSchema, type ChatToolOutputPayload, ChatToolOutputResultSchema, type ChatToolOutputResult, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, type ChatForkPayload, ChatForkResultSchema, type ChatForkResult, ChatContinueOnPayloadSchema, type ChatContinueOnPayload, ChatContinueOnResultSchema, type ChatContinueOnResult, ChatSummarizePayloadSchema, type ChatSummarizePayload, ChatSummarizeResultSchema, type ChatSummarizeResult, ChatForkInfoPayloadSchema, type ChatForkInfoPayload, ChatForkInfoResultSchema, type ChatForkInfoResult, ChatListResultSchema, type ChatListResult, GeneratedImageInputSchema, type GeneratedImageInput, generatedImageAttachment, holdsConversation, chatActivity, type ChatActivity } from './chat.ts';
|
|
2
|
+
export { ChatIdSchema, type ChatId, ChatContextBreakdownSchema, type ChatContextBreakdown, ChatUsageSchema, type ChatUsage, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, type ChatAttachmentUpload, ChatAttachmentUploadsSchema, ChatAttachmentSchema, type ChatAttachment, ChatUiChoiceOriginSchema, type ChatUiChoiceOrigin, ChatUiAnswerSchema, type ChatUiAnswer, ChatQuoteSourceSchema, type ChatQuoteSource, ChatQueuedMessageSchema, type ChatQueuedMessage, ChatBackgroundTaskSchema, type ChatBackgroundTask, ChatTurnLimitSchema, type ChatTurnLimit, ChatGoalStatusSchema, type ChatGoalStatus, ChatGoalSchema, type ChatGoal, ChatQuestionSchema, type ChatQuestion, ChatRequestKindSchema, type ChatRequestKind, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, type ChatRequestApproval, ChatRequestSummarySchema, type ChatRequestSummary, ChatInfoSchema, type ChatInfo, ChatSkillSourceSchema, type ChatSkillSource, ChatSkillSchema, type ChatSkill, SkillsListPayloadSchema, type SkillsListPayload, SkillsListResultSchema, type SkillsListResult, ChatUserItemSchema, ChatUiQueryReadingSchema, type ChatUiQueryReading, ChatUiLinkReadingSchema, type ChatUiLinkReading, ChatUiPlaceReadingSchema, type ChatUiPlaceReading, ChatUiQueryStateSchema, type ChatUiQueryState, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, type ChatToolState, ChatToolProgressSchema, type ChatToolProgress, ChatFileChangeSchema, type ChatFileChange, ChatSubagentStatusSchema, type ChatSubagentStatus, ChatWorkflowPhaseSchema, type ChatWorkflowPhase, ChatWorkflowAgentSchema, type ChatWorkflowAgent, ChatWorkflowSchema, type ChatWorkflow, workflowAgentRef, workflowAgentIdOf, CHAT_PAYLOAD_INLINE_BYTES, ChatPayloadRefSchema, type ChatPayloadRef, ChatToolItemSchema, ChatSubagentUsageSchema, type ChatSubagentUsage, HOST_TASK_ORIGIN, taskRowId, taskIdOfRow, ChatSubagentItemSchema, ChatApprovalDecisionSchema, type ChatApprovalDecision, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, type ChatCheckpointFile, ChatCheckpointDiffSchema, type ChatCheckpointDiff, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, activeWorkflows, workflowEndedAt, CHAT_OUTLINE_TEXT_CHARS, outlineItems, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatNoteMessageSchema, ChatCompactionItemSchema, ChatItemSchema, type ChatItem, type ChatUserItem, type ChatAssistantItem, type ChatThinkingItem, type ChatToolItem, type ChatSubagentItem, type ChatApprovalItem, type ChatQuestionItem, type ChatTurnItem, type ChatNoteItem, type ChatNoteMessage, type ChatCompactionItem, type ChatUnknownItem, ChatEventSchema, type ChatEvent, type ChatUnknownEvent, ChatEventEnvelopeSchema, type ChatEventEnvelope, ChatCreatePayloadSchema, type ChatCreatePayload, ChatConfigurePayloadSchema, type ChatConfigurePayload, ChatPreferencesPayloadSchema, type ChatPreferencesPayload, ChatTargetPayloadSchema, type ChatTargetPayload, ChatClearPayloadSchema, type ChatClearPayload, ChatCancelPayloadSchema, type ChatCancelPayload, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, type ChatHistoryResult, ChatSubagentPayloadSchema, type ChatSubagentPayload, ChatStopSubagentPayloadSchema, type ChatStopSubagentPayload, ChatGoalActionSchema, type ChatGoalAction, ChatGoalPayloadSchema, type ChatGoalPayload, ChatStopTaskPayloadSchema, type ChatStopTaskPayload, ChatSubagentPageSchema, ChatSubagentSourceSchema, type ChatSubagentSource, ChatSubagentResultSchema, type ChatSubagentResult, ChatStatusEventSchema, type ChatStatusEvent, ChatSubagentChangedEventSchema, type ChatSubagentChangedEvent, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, type ChatBookmark, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, type ChatAddBookmarkPayload, ChatRenameBookmarkPayloadSchema, type ChatRenameBookmarkPayload, ChatRemoveBookmarkPayloadSchema, type ChatRemoveBookmarkPayload, ChatBookmarksResultSchema, type ChatBookmarksResult, ChatBookmarksEventSchema, type ChatBookmarksEvent, ChatRemoveVisualPayloadSchema, type ChatRemoveVisualPayload, ChatVisualsResultSchema, type ChatVisualsResult, ChatVisualsEventSchema, type ChatVisualsEvent, ChatSuggestionEventSchema, type ChatSuggestionEvent, ChatAttachResultSchema, type ChatAttachResult, ChatDeliverySchema, type ChatDelivery, ChatSendPayloadSchema, type ChatSendPayload, ChatSendResultSchema, type ChatSendResult, ChatUiChoicePayloadSchema, type ChatUiChoicePayload, ChatUiQueryPayloadSchema, type ChatUiQueryPayload, ChatUiLinkPayloadSchema, type ChatUiLinkPayload, ChatQueuePayloadSchema, type ChatQueuePayload, ChatUnqueueResultSchema, type ChatUnqueueResult, ChatApprovePayloadSchema, type ChatApprovePayload, ChatDismissPayloadSchema, type ChatDismissPayload, ChatAnswerPayloadSchema, type ChatAnswerPayload, ChatTurnDiffPayloadSchema, type ChatTurnDiffPayload, ChatTurnDiffResultSchema, type ChatTurnDiffResult, ChatToolOutputPayloadSchema, type ChatToolOutputPayload, ChatToolOutputResultSchema, type ChatToolOutputResult, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, type ChatForkPayload, ChatForkResultSchema, type ChatForkResult, ChatContinueOnPayloadSchema, type ChatContinueOnPayload, ChatContinueOnResultSchema, type ChatContinueOnResult, ChatSummarizePayloadSchema, type ChatSummarizePayload, ChatSummarizeResultSchema, type ChatSummarizeResult, ChatForkInfoPayloadSchema, type ChatForkInfoPayload, ChatForkInfoResultSchema, type ChatForkInfoResult, ChatListPayloadSchema, type ChatListPayload, ChatListResultSchema, type ChatListResult, GeneratedImageInputSchema, type GeneratedImageInput, generatedImageAttachment, holdsConversation, chatActivity, type ChatActivity } from './chat.ts';
|
|
3
3
|
export { ErrorSchema, type WireError, RequestSchema, type Request, ReplyOkSchema, type ReplyOk, ReplyErrorSchema, type ReplyError, ReplySchema, type Reply, EventSchema, type Event, ServerFrameSchema, type ServerFrame, type ParseResult, parseRequest, parseServerFrame } from './envelope.ts';
|
|
4
4
|
export { SessionIdSchema, type SessionId } from './ids.ts';
|
|
5
5
|
export { ModelOptionChoiceSchema, type ModelOptionChoice, ModelOptionDescriptorSchema, type ModelOptionDescriptor, ModelInfoSchema, type ModelInfo, ModelSelectionSchema, type ModelSelection, ModelCatalogProfileSchema, type ModelCatalogProfile, ModelCatalogEntrySchema, type ModelCatalogEntry, ModelCatalogDataSchema, type ModelCatalogData, RuntimeModeSchema, type RuntimeMode, ProviderCapabilitiesSchema, type ProviderCapabilities, ProviderPlatformSchema, type ProviderPlatform, ProviderSignInSchema, type ProviderSignIn, ProviderInstallSchema, type ProviderInstall, ProviderInfoSchema, type ProviderInfo, FRONTIER_PROVIDER_KINDS, API_PROVIDER_KINDS, type ProviderPickerGroup, type ProviderPickerGroups, providerGroupOf, pickerGroupsOf, inPickerOrder, separatesGroups, ProviderListResultSchema, type ProviderListResult, resumeCommandFor } from './model.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Public API: exports.test.ts snapshots this list, so a name added or dropped here is an API change.
|
|
2
2
|
export { AGENT_KIND_MAX_LENGTH, AgentKindSchema, AgentStatusSchema, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, AgentInfoSchema, SessionStatusEventSchema, AgentResumePayloadSchema, ApprovalChoiceSchema, ApprovalRequestSchema, SessionApprovalsEventSchema, ApprovalAnswerPayloadSchema, ApprovalAnswerResultSchema, ApprovalPreferencePayloadSchema } from './agent.js';
|
|
3
|
-
export { ChatIdSchema, ChatContextBreakdownSchema, ChatUsageSchema, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, ChatAttachmentUploadsSchema, ChatAttachmentSchema, ChatUiChoiceOriginSchema, ChatUiAnswerSchema, ChatQuoteSourceSchema, ChatQueuedMessageSchema, ChatBackgroundTaskSchema, ChatTurnLimitSchema, ChatGoalStatusSchema, ChatGoalSchema, ChatQuestionSchema, ChatRequestKindSchema, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, ChatRequestSummarySchema, ChatInfoSchema, ChatSkillSourceSchema, ChatSkillSchema, SkillsListPayloadSchema, SkillsListResultSchema, ChatUserItemSchema, ChatUiQueryReadingSchema, ChatUiLinkReadingSchema, ChatUiPlaceReadingSchema, ChatUiQueryStateSchema, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, ChatToolProgressSchema, ChatFileChangeSchema, ChatSubagentStatusSchema, ChatWorkflowPhaseSchema, ChatWorkflowAgentSchema, ChatWorkflowSchema, workflowAgentRef, workflowAgentIdOf, CHAT_PAYLOAD_INLINE_BYTES, ChatPayloadRefSchema, ChatToolItemSchema, ChatSubagentUsageSchema, HOST_TASK_ORIGIN, taskRowId, taskIdOfRow, ChatSubagentItemSchema, ChatApprovalDecisionSchema, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, ChatCheckpointDiffSchema, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, activeWorkflows, workflowEndedAt, CHAT_OUTLINE_TEXT_CHARS, outlineItems, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatNoteMessageSchema, ChatCompactionItemSchema, ChatItemSchema, ChatEventSchema, ChatEventEnvelopeSchema, ChatCreatePayloadSchema, ChatConfigurePayloadSchema, ChatPreferencesPayloadSchema, ChatTargetPayloadSchema, ChatClearPayloadSchema, ChatCancelPayloadSchema, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, ChatSubagentPayloadSchema, ChatStopSubagentPayloadSchema, ChatGoalActionSchema, ChatGoalPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentPageSchema, ChatSubagentSourceSchema, ChatSubagentResultSchema, ChatStatusEventSchema, ChatSubagentChangedEventSchema, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatBookmarksResultSchema, ChatBookmarksEventSchema, ChatRemoveVisualPayloadSchema, ChatVisualsResultSchema, ChatVisualsEventSchema, ChatAttachResultSchema, ChatDeliverySchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiQueryPayloadSchema, ChatUiLinkPayloadSchema, ChatQueuePayloadSchema, ChatUnqueueResultSchema, ChatApprovePayloadSchema, ChatDismissPayloadSchema, ChatAnswerPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, ChatToolOutputPayloadSchema, ChatToolOutputResultSchema, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, ChatForkResultSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatListResultSchema, GeneratedImageInputSchema, generatedImageAttachment, holdsConversation, chatActivity } from './chat.js';
|
|
3
|
+
export { ChatIdSchema, ChatContextBreakdownSchema, ChatUsageSchema, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, ChatAttachmentUploadsSchema, ChatAttachmentSchema, ChatUiChoiceOriginSchema, ChatUiAnswerSchema, ChatQuoteSourceSchema, ChatQueuedMessageSchema, ChatBackgroundTaskSchema, ChatTurnLimitSchema, ChatGoalStatusSchema, ChatGoalSchema, ChatQuestionSchema, ChatRequestKindSchema, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, ChatRequestSummarySchema, ChatInfoSchema, ChatSkillSourceSchema, ChatSkillSchema, SkillsListPayloadSchema, SkillsListResultSchema, ChatUserItemSchema, ChatUiQueryReadingSchema, ChatUiLinkReadingSchema, ChatUiPlaceReadingSchema, ChatUiQueryStateSchema, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, ChatToolProgressSchema, ChatFileChangeSchema, ChatSubagentStatusSchema, ChatWorkflowPhaseSchema, ChatWorkflowAgentSchema, ChatWorkflowSchema, workflowAgentRef, workflowAgentIdOf, CHAT_PAYLOAD_INLINE_BYTES, ChatPayloadRefSchema, ChatToolItemSchema, ChatSubagentUsageSchema, HOST_TASK_ORIGIN, taskRowId, taskIdOfRow, ChatSubagentItemSchema, ChatApprovalDecisionSchema, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, ChatCheckpointDiffSchema, ChatTurnItemSchema, notResumedNote, abortedByMachine, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, activeWorkflows, workflowEndedAt, CHAT_OUTLINE_TEXT_CHARS, outlineItems, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatNoteMessageSchema, ChatCompactionItemSchema, ChatItemSchema, ChatEventSchema, ChatEventEnvelopeSchema, ChatCreatePayloadSchema, ChatConfigurePayloadSchema, ChatPreferencesPayloadSchema, ChatTargetPayloadSchema, ChatClearPayloadSchema, ChatCancelPayloadSchema, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, ChatSubagentPayloadSchema, ChatStopSubagentPayloadSchema, ChatGoalActionSchema, ChatGoalPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentPageSchema, ChatSubagentSourceSchema, ChatSubagentResultSchema, ChatStatusEventSchema, ChatSubagentChangedEventSchema, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatBookmarksResultSchema, ChatBookmarksEventSchema, ChatRemoveVisualPayloadSchema, ChatVisualsResultSchema, ChatVisualsEventSchema, ChatSuggestionEventSchema, ChatAttachResultSchema, ChatDeliverySchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiQueryPayloadSchema, ChatUiLinkPayloadSchema, ChatQueuePayloadSchema, ChatUnqueueResultSchema, ChatApprovePayloadSchema, ChatDismissPayloadSchema, ChatAnswerPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, ChatToolOutputPayloadSchema, ChatToolOutputResultSchema, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, ChatForkResultSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatListPayloadSchema, ChatListResultSchema, GeneratedImageInputSchema, generatedImageAttachment, holdsConversation, chatActivity } from './chat.js';
|
|
4
4
|
export { ErrorSchema, RequestSchema, ReplyOkSchema, ReplyErrorSchema, ReplySchema, EventSchema, ServerFrameSchema, parseRequest, parseServerFrame } from './envelope.js';
|
|
5
5
|
export { SessionIdSchema } from './ids.js';
|
|
6
6
|
export { ModelOptionChoiceSchema, ModelOptionDescriptorSchema, ModelInfoSchema, ModelSelectionSchema, ModelCatalogProfileSchema, ModelCatalogEntrySchema, ModelCatalogDataSchema, RuntimeModeSchema, ProviderCapabilitiesSchema, ProviderPlatformSchema, ProviderSignInSchema, ProviderInstallSchema, ProviderInfoSchema, FRONTIER_PROVIDER_KINDS, API_PROVIDER_KINDS, providerGroupOf, pickerGroupsOf, inPickerOrder, separatesGroups, ProviderListResultSchema, resumeCommandFor } from './model.js';
|
package/dist/protocol.d.ts
CHANGED
|
@@ -609,6 +609,22 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
609
609
|
chatId: z.ZodString;
|
|
610
610
|
historyLimit: z.ZodOptional<z.ZodNumber>;
|
|
611
611
|
since: z.ZodOptional<z.ZodNumber>;
|
|
612
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
613
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
614
|
+
account: z.ZodOptional<z.ZodString>;
|
|
615
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
616
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
617
|
+
selection: z.ZodOptional<z.ZodObject<{
|
|
618
|
+
model: z.ZodString;
|
|
619
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
620
|
+
}, z.core.$strip>>;
|
|
621
|
+
runtimeMode: z.ZodOptional<z.ZodEnum<{
|
|
622
|
+
auto: "auto";
|
|
623
|
+
"auto-accept-edits": "auto-accept-edits";
|
|
624
|
+
"full-access": "full-access";
|
|
625
|
+
supervised: "supervised";
|
|
626
|
+
}>>;
|
|
627
|
+
}, z.core.$strip>>;
|
|
612
628
|
}, z.core.$strip>;
|
|
613
629
|
readonly result: z.ZodObject<{
|
|
614
630
|
info: z.ZodObject<{
|
|
@@ -3368,6 +3384,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
3368
3384
|
preTokens: z.ZodNullable<z.ZodNumber>;
|
|
3369
3385
|
postTokens: z.ZodOptional<z.ZodNumber>;
|
|
3370
3386
|
}, z.core.$strip>], "kind">>>;
|
|
3387
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
3371
3388
|
}, z.core.$strip>;
|
|
3372
3389
|
};
|
|
3373
3390
|
readonly 'chat.detach': {
|
|
@@ -5513,7 +5530,9 @@ export declare const AGENT_REQUEST_SCHEMAS: {
|
|
|
5513
5530
|
readonly result: z.ZodObject<{}, z.core.$strip>;
|
|
5514
5531
|
};
|
|
5515
5532
|
readonly 'chat.list': {
|
|
5516
|
-
readonly payload: z.ZodObject<{
|
|
5533
|
+
readonly payload: z.ZodObject<{
|
|
5534
|
+
omitCommands: z.ZodOptional<z.ZodBoolean>;
|
|
5535
|
+
}, z.core.$strip>;
|
|
5517
5536
|
readonly result: z.ZodObject<{
|
|
5518
5537
|
chats: z.ZodArray<z.ZodObject<{
|
|
5519
5538
|
chatId: z.ZodString;
|
|
@@ -7141,6 +7160,10 @@ export declare const AGENT_EVENT_SCHEMAS: {
|
|
|
7141
7160
|
turnId: z.ZodOptional<z.ZodString>;
|
|
7142
7161
|
}, z.core.$strip>>;
|
|
7143
7162
|
}, z.core.$strip>;
|
|
7163
|
+
readonly 'chat.suggestion': z.ZodObject<{
|
|
7164
|
+
chatId: z.ZodString;
|
|
7165
|
+
suggestion: z.ZodNullable<z.ZodString>;
|
|
7166
|
+
}, z.core.$strip>;
|
|
7144
7167
|
readonly 'usage.changed': z.ZodObject<{
|
|
7145
7168
|
scannedAt: z.ZodNumber;
|
|
7146
7169
|
}, z.core.$strip>;
|
package/dist/protocol.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ChatAddBookmarkPayloadSchema, ChatAnswerPayloadSchema, ChatApprovePayloadSchema, ChatAttachPayloadSchema, ChatAttachResultSchema, ChatBookmarksEventSchema, ChatBookmarksResultSchema, ChatCancelPayloadSchema, ChatClearPayloadSchema, ChatConfigurePayloadSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatCreatePayloadSchema, ChatDismissPayloadSchema, ChatEventEnvelopeSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatForkPayloadSchema, ChatForkResultSchema, ChatGoalPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryResultSchema, ChatInfoSchema, ChatListResultSchema, ChatPreferencesPayloadSchema, ChatQueuePayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatRemoveVisualPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiLinkPayloadSchema, ChatUiLinkReadingSchema, ChatUiQueryPayloadSchema, ChatUiQueryReadingSchema, ChatStatusEventSchema, ChatStopSubagentPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentChangedEventSchema, ChatSubagentPayloadSchema, ChatSubagentResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatTargetPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, ChatToolOutputPayloadSchema, ChatToolOutputResultSchema, ChatUnqueueResultSchema, ChatVisualsEventSchema, ChatVisualsResultSchema, SkillsListPayloadSchema, SkillsListResultSchema } from './chat.js';
|
|
2
|
+
import { ChatAddBookmarkPayloadSchema, ChatAnswerPayloadSchema, ChatApprovePayloadSchema, ChatAttachPayloadSchema, ChatAttachResultSchema, ChatBookmarksEventSchema, ChatBookmarksResultSchema, ChatCancelPayloadSchema, ChatClearPayloadSchema, ChatConfigurePayloadSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatCreatePayloadSchema, ChatDismissPayloadSchema, ChatEventEnvelopeSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatForkPayloadSchema, ChatForkResultSchema, ChatGoalPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryResultSchema, ChatInfoSchema, ChatListPayloadSchema, ChatListResultSchema, ChatPreferencesPayloadSchema, ChatQueuePayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatRemoveVisualPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiLinkPayloadSchema, ChatUiLinkReadingSchema, ChatUiQueryPayloadSchema, ChatUiQueryReadingSchema, ChatStatusEventSchema, ChatStopSubagentPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentChangedEventSchema, ChatSubagentPayloadSchema, ChatSubagentResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatTargetPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, ChatToolOutputPayloadSchema, ChatToolOutputResultSchema, ChatUnqueueResultSchema, ChatSuggestionEventSchema, ChatVisualsEventSchema, ChatVisualsResultSchema, SkillsListPayloadSchema, SkillsListResultSchema } from './chat.js';
|
|
3
3
|
import { ProviderListResultSchema } from './model.js';
|
|
4
4
|
import { ProviderAccountCreatePayloadSchema, ProviderAccountCreateResultSchema, ProviderAccountWatchLoginPayloadSchema, ProviderAccountsReorderPayloadSchema, ProviderAccountsSavePayloadSchema, ProviderAccountsSchema, ProviderAccountsShareConfigPayloadSchema } from './provider-accounts.js';
|
|
5
5
|
import { UsageChangedEventSchema, UsageLimitsSnapshotSchema, UsageSummaryPayloadSchema, UsageSummaryResultSchema } from './usage.js';
|
|
@@ -61,7 +61,7 @@ export const AGENT_REQUEST_SCHEMAS = {
|
|
|
61
61
|
'chat.kill': { payload: ChatTargetPayloadSchema, result: EmptySchema },
|
|
62
62
|
// Ends the chat's CLI and keeps the conversation, which the next message resumes in a fresh process.
|
|
63
63
|
'chat.restart': { payload: ChatTargetPayloadSchema, result: EmptySchema },
|
|
64
|
-
'chat.list': { payload:
|
|
64
|
+
'chat.list': { payload: ChatListPayloadSchema, result: ChatListResultSchema }
|
|
65
65
|
};
|
|
66
66
|
export const AGENT_EVENT_SCHEMAS = {
|
|
67
67
|
'chat.event': ChatEventEnvelopeSchema,
|
|
@@ -69,6 +69,7 @@ export const AGENT_EVENT_SCHEMAS = {
|
|
|
69
69
|
'chat.subagentChanged': ChatSubagentChangedEventSchema,
|
|
70
70
|
'chat.bookmarks': ChatBookmarksEventSchema,
|
|
71
71
|
'chat.visuals': ChatVisualsEventSchema,
|
|
72
|
+
'chat.suggestion': ChatSuggestionEventSchema,
|
|
72
73
|
'usage.changed': UsageChangedEventSchema,
|
|
73
74
|
'usage.limitsChanged': UsageLimitsSnapshotSchema,
|
|
74
75
|
'accounts.changed': ProviderAccountsSchema
|
package/dist/visual-viewport.js
CHANGED
|
@@ -35,6 +35,11 @@ window.addEventListener('message', function (event) {
|
|
|
35
35
|
viewport = next;
|
|
36
36
|
apply(next.top);
|
|
37
37
|
});
|
|
38
|
+
// The new frame size travels apart from the message and often lands after it, so a top beyond the old
|
|
39
|
+
// size was clamped; once the size arrives, scroll there again.
|
|
40
|
+
window.addEventListener('resize', function () {
|
|
41
|
+
if (viewport) { apply(viewport.top); }
|
|
42
|
+
});
|
|
38
43
|
function nestedScroll(path, delta, axis) {
|
|
39
44
|
for (var i = 0; i < path.length; i++) {
|
|
40
45
|
var node = path[i];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agent-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.0",
|
|
4
4
|
"description": "Schemas and port contracts for agent chats, provider accounts, models and usage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"test": "bun --conditions=source test"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@adecore/intelligent-ui": "0.
|
|
90
|
-
"@adecore/utils": "0.
|
|
89
|
+
"@adecore/intelligent-ui": "0.69.0",
|
|
90
|
+
"@adecore/utils": "0.69.0",
|
|
91
91
|
"zod": "^4.6.7"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
package/src/chat.ts
CHANGED
|
@@ -1060,7 +1060,12 @@ export type ChatCancelPayload = z.infer<typeof ChatCancelPayloadSchema>;
|
|
|
1060
1060
|
export const ChatAttachPayloadSchema = ChatTargetPayloadSchema.extend({
|
|
1061
1061
|
historyLimit: z.number().int().min(1).max(100).optional(),
|
|
1062
1062
|
// The last seq this client saw; honored when the daemon still holds everything after it.
|
|
1063
|
-
since: z.number().int().nonnegative().optional()
|
|
1063
|
+
since: z.number().int().nonnegative().optional(),
|
|
1064
|
+
/*
|
|
1065
|
+
* Makes the chat first, as `chat.create` with these would, so opening one takes a single request. A
|
|
1066
|
+
* host that predates it ignores it and refuses a chat it does not have with `chat-not-found`.
|
|
1067
|
+
*/
|
|
1068
|
+
create: ChatCreatePayloadSchema.omit({ chatId: true }).optional()
|
|
1064
1069
|
});
|
|
1065
1070
|
|
|
1066
1071
|
export const ChatHistoryPayloadSchema = ChatTargetPayloadSchema.extend({
|
|
@@ -1196,6 +1201,10 @@ export type ChatVisualsResult = z.infer<typeof ChatVisualsResultSchema>;
|
|
|
1196
1201
|
export const ChatVisualsEventSchema = z.object({ chatId: ChatIdSchema, visuals: ChatVisualsSchema });
|
|
1197
1202
|
export type ChatVisualsEvent = z.infer<typeof ChatVisualsEventSchema>;
|
|
1198
1203
|
|
|
1204
|
+
// What the CLI predicts the person sends next, to every client attached to the chat; null once a turn opens. Never stored.
|
|
1205
|
+
export const ChatSuggestionEventSchema = z.object({ chatId: ChatIdSchema, suggestion: z.string().min(1).nullable() });
|
|
1206
|
+
export type ChatSuggestionEvent = z.infer<typeof ChatSuggestionEventSchema>;
|
|
1207
|
+
|
|
1199
1208
|
export const ChatAttachResultSchema = z.object({
|
|
1200
1209
|
info: ChatInfoSchema,
|
|
1201
1210
|
items: z.array(ChatItemSchema),
|
|
@@ -1213,7 +1222,9 @@ export const ChatAttachResultSchema = z.object({
|
|
|
1213
1222
|
// With a page: the active Workflow calls (`activeWorkflows`) from before it, so what shows a workflow beside the thread never waits on a scroll.
|
|
1214
1223
|
workflows: z.array(ChatToolItemSchema).optional(),
|
|
1215
1224
|
// With a page: the thread before it as `outlineItems` cuts it, so the scrubber reaches the whole thread before a scroll does.
|
|
1216
|
-
outline: z.array(ChatItemSchema).optional()
|
|
1225
|
+
outline: z.array(ChatItemSchema).optional(),
|
|
1226
|
+
// The next prompt the CLI predicts after the last turn; absent while it predicts none.
|
|
1227
|
+
suggestion: z.string().min(1).optional()
|
|
1217
1228
|
});
|
|
1218
1229
|
export type ChatAttachResult = z.infer<typeof ChatAttachResultSchema>;
|
|
1219
1230
|
|
|
@@ -1400,6 +1411,16 @@ export const ChatForkInfoResultSchema = z.object({
|
|
|
1400
1411
|
});
|
|
1401
1412
|
export type ChatForkInfoResult = z.infer<typeof ChatForkInfoResultSchema>;
|
|
1402
1413
|
|
|
1414
|
+
/*
|
|
1415
|
+
* With `omitCommands` every chat comes with `slashCommands` empty and without `skills`, which are most of
|
|
1416
|
+
* a long list's bytes and only a composer reads, from `chat.attach` and its events. A host that predates
|
|
1417
|
+
* it ignores it and sends them, so a client takes either answer.
|
|
1418
|
+
*/
|
|
1419
|
+
export const ChatListPayloadSchema = z.object({
|
|
1420
|
+
omitCommands: z.boolean().optional()
|
|
1421
|
+
});
|
|
1422
|
+
export type ChatListPayload = z.infer<typeof ChatListPayloadSchema>;
|
|
1423
|
+
|
|
1403
1424
|
export const ChatListResultSchema = z.object({
|
|
1404
1425
|
chats: lossyItems(z.array(ChatInfoSchema))
|
|
1405
1426
|
});
|
package/src/index.ts
CHANGED
|
@@ -214,6 +214,8 @@ export {
|
|
|
214
214
|
type ChatVisualsResult,
|
|
215
215
|
ChatVisualsEventSchema,
|
|
216
216
|
type ChatVisualsEvent,
|
|
217
|
+
ChatSuggestionEventSchema,
|
|
218
|
+
type ChatSuggestionEvent,
|
|
217
219
|
ChatAttachResultSchema,
|
|
218
220
|
type ChatAttachResult,
|
|
219
221
|
ChatDeliverySchema,
|
|
@@ -263,6 +265,8 @@ export {
|
|
|
263
265
|
type ChatForkInfoPayload,
|
|
264
266
|
ChatForkInfoResultSchema,
|
|
265
267
|
type ChatForkInfoResult,
|
|
268
|
+
ChatListPayloadSchema,
|
|
269
|
+
type ChatListPayload,
|
|
266
270
|
ChatListResultSchema,
|
|
267
271
|
type ChatListResult,
|
|
268
272
|
GeneratedImageInputSchema,
|
package/src/protocol.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
ChatHistoryPayloadSchema,
|
|
24
24
|
ChatHistoryResultSchema,
|
|
25
25
|
ChatInfoSchema,
|
|
26
|
+
ChatListPayloadSchema,
|
|
26
27
|
ChatListResultSchema,
|
|
27
28
|
ChatPreferencesPayloadSchema,
|
|
28
29
|
ChatQueuePayloadSchema,
|
|
@@ -50,6 +51,7 @@ import {
|
|
|
50
51
|
ChatToolOutputPayloadSchema,
|
|
51
52
|
ChatToolOutputResultSchema,
|
|
52
53
|
ChatUnqueueResultSchema,
|
|
54
|
+
ChatSuggestionEventSchema,
|
|
53
55
|
ChatVisualsEventSchema,
|
|
54
56
|
ChatVisualsResultSchema,
|
|
55
57
|
SkillsListPayloadSchema,
|
|
@@ -126,7 +128,7 @@ export const AGENT_REQUEST_SCHEMAS = {
|
|
|
126
128
|
'chat.kill': { payload: ChatTargetPayloadSchema, result: EmptySchema },
|
|
127
129
|
// Ends the chat's CLI and keeps the conversation, which the next message resumes in a fresh process.
|
|
128
130
|
'chat.restart': { payload: ChatTargetPayloadSchema, result: EmptySchema },
|
|
129
|
-
'chat.list': { payload:
|
|
131
|
+
'chat.list': { payload: ChatListPayloadSchema, result: ChatListResultSchema }
|
|
130
132
|
} as const;
|
|
131
133
|
|
|
132
134
|
export const AGENT_EVENT_SCHEMAS = {
|
|
@@ -135,6 +137,7 @@ export const AGENT_EVENT_SCHEMAS = {
|
|
|
135
137
|
'chat.subagentChanged': ChatSubagentChangedEventSchema,
|
|
136
138
|
'chat.bookmarks': ChatBookmarksEventSchema,
|
|
137
139
|
'chat.visuals': ChatVisualsEventSchema,
|
|
140
|
+
'chat.suggestion': ChatSuggestionEventSchema,
|
|
138
141
|
'usage.changed': UsageChangedEventSchema,
|
|
139
142
|
'usage.limitsChanged': UsageLimitsSnapshotSchema,
|
|
140
143
|
'accounts.changed': ProviderAccountsSchema
|
package/src/visual-viewport.ts
CHANGED
|
@@ -35,6 +35,11 @@ window.addEventListener('message', function (event) {
|
|
|
35
35
|
viewport = next;
|
|
36
36
|
apply(next.top);
|
|
37
37
|
});
|
|
38
|
+
// The new frame size travels apart from the message and often lands after it, so a top beyond the old
|
|
39
|
+
// size was clamped; once the size arrives, scroll there again.
|
|
40
|
+
window.addEventListener('resize', function () {
|
|
41
|
+
if (viewport) { apply(viewport.top); }
|
|
42
|
+
});
|
|
38
43
|
function nestedScroll(path, delta, axis) {
|
|
39
44
|
for (var i = 0; i < path.length; i++) {
|
|
40
45
|
var node = path[i];
|