@builder.io/ai-utils 0.97.0 → 0.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/codegen.d.ts +14 -0
- package/src/codegen.js +6 -1
- package/src/completion.d.ts +14 -1
- package/src/editor-ai.d.ts +4 -0
- package/src/editor-ai.js +8 -0
- package/src/events.d.ts +14 -2
- package/src/publish-agent.d.ts +4 -77
- package/src/publish-agent.js +3 -30
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -374,6 +374,7 @@ export declare const BuilderEditToolInputSchema: z.ZodObject<{
|
|
|
374
374
|
filePath: z.ZodString;
|
|
375
375
|
old_str: z.ZodString;
|
|
376
376
|
new_str: z.ZodString;
|
|
377
|
+
replace_all: z.ZodOptional<z.ZodBoolean>;
|
|
377
378
|
activeLocale: z.ZodOptional<z.ZodString>;
|
|
378
379
|
}, z.core.$strip>;
|
|
379
380
|
export type BuilderEditToolInput = z.infer<typeof BuilderEditToolInputSchema>;
|
|
@@ -1553,6 +1554,7 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
|
|
|
1553
1554
|
filePath: z.ZodString;
|
|
1554
1555
|
old_str: z.ZodString;
|
|
1555
1556
|
new_str: z.ZodString;
|
|
1557
|
+
replace_all: z.ZodOptional<z.ZodBoolean>;
|
|
1556
1558
|
activeLocale: z.ZodOptional<z.ZodString>;
|
|
1557
1559
|
}, z.core.$strip>;
|
|
1558
1560
|
WebFetch: z.ZodObject<{
|
|
@@ -2169,6 +2171,17 @@ export type CodeGenPosition = z.infer<typeof CodeGenPositionSchema>;
|
|
|
2169
2171
|
export declare const PublishAgentMessageRequestSchema: z.ZodObject<{
|
|
2170
2172
|
message: z.ZodOptional<z.ZodString>;
|
|
2171
2173
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
2174
|
+
modelOverride: z.ZodOptional<z.ZodString>;
|
|
2175
|
+
reasoning: z.ZodOptional<z.ZodEnum<{
|
|
2176
|
+
auto: "auto";
|
|
2177
|
+
high: "high";
|
|
2178
|
+
low: "low";
|
|
2179
|
+
max: "max";
|
|
2180
|
+
medium: "medium";
|
|
2181
|
+
minimal: "minimal";
|
|
2182
|
+
none: "none";
|
|
2183
|
+
xhigh: "xhigh";
|
|
2184
|
+
}>>;
|
|
2172
2185
|
toolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2173
2186
|
type: z.ZodLiteral<"tool_result">;
|
|
2174
2187
|
tool_use_id: z.ZodString;
|
|
@@ -3988,6 +4001,7 @@ export interface GenerateCodeEventDone {
|
|
|
3988
4001
|
nextUrl: string;
|
|
3989
4002
|
autoContinue: boolean;
|
|
3990
4003
|
model: string;
|
|
4004
|
+
modelOverride?: string;
|
|
3991
4005
|
promptVersion: string | undefined;
|
|
3992
4006
|
/** True when this turn was a compaction pass run on an internal model. */
|
|
3993
4007
|
compact: boolean;
|
package/src/codegen.js
CHANGED
|
@@ -567,6 +567,9 @@ export const BuilderEditToolInputSchema = z
|
|
|
567
567
|
new_str: z.string().meta({
|
|
568
568
|
description: "New content to replace the old content with",
|
|
569
569
|
}),
|
|
570
|
+
replace_all: z.boolean().optional().meta({
|
|
571
|
+
description: "Replace every occurrence of old_str instead of only the first. Matches old_str as an exact substring, so it is not restricted to complete lines — use it to change a word repeated throughout a long rich-text body. Only use it when every occurrence should get the same replacement.",
|
|
572
|
+
}),
|
|
570
573
|
activeLocale: z.string().min(1).optional().meta({
|
|
571
574
|
description: 'Locale to edit. Use "Default" for the default locale, or one of the configured available locales.',
|
|
572
575
|
}),
|
|
@@ -1781,6 +1784,8 @@ export const PublishAgentMessageRequestSchema = z
|
|
|
1781
1784
|
.object({
|
|
1782
1785
|
message: z.string().max(100000).optional(),
|
|
1783
1786
|
sessionId: z.string().min(1).max(256).optional(),
|
|
1787
|
+
modelOverride: z.string().min(1).max(256).optional(),
|
|
1788
|
+
reasoning: ReasoningEffortSchema.optional(),
|
|
1784
1789
|
toolResults: z.array(ContentMessageItemToolResultSchema).optional(),
|
|
1785
1790
|
confirmation: z
|
|
1786
1791
|
.object({
|
|
@@ -1793,7 +1798,7 @@ export const PublishAgentMessageRequestSchema = z
|
|
|
1793
1798
|
path: ["message"],
|
|
1794
1799
|
message: "A message or at least one tool result is required.",
|
|
1795
1800
|
})
|
|
1796
|
-
.refine(({
|
|
1801
|
+
.refine(({ toolResults, sessionId }) => !(toolResults === null || toolResults === void 0 ? void 0 : toolResults.length) || Boolean(sessionId), {
|
|
1797
1802
|
path: ["sessionId"],
|
|
1798
1803
|
message: "A session ID is required when continuing with tool results.",
|
|
1799
1804
|
})
|
package/src/completion.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
|
|
2
|
-
import type { Message, MessageParam, Attachment } from "./messages.js";
|
|
2
|
+
import type { Message, MessageParam, Attachment, ContentMessageItemToolResult } from "./messages.js";
|
|
3
3
|
import type { BuilderModel } from "./events.js";
|
|
4
|
+
import type { ReasoningEffort } from "./codegen.js";
|
|
4
5
|
export type { BuilderContent, BuilderElement, Component };
|
|
5
6
|
export interface CompletionOptions {
|
|
6
7
|
/**
|
|
@@ -14,6 +15,11 @@ export interface CompletionOptions {
|
|
|
14
15
|
* Note: This is not the Builder.io data model.
|
|
15
16
|
*/
|
|
16
17
|
modelId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Reasoning effort for the selected LLM.
|
|
20
|
+
* Defaults according to the session mode, typically to medium.
|
|
21
|
+
*/
|
|
22
|
+
reasoning?: ReasoningEffort;
|
|
17
23
|
/**
|
|
18
24
|
* The unique LOCAL identifier of the thread to submit the user message to.
|
|
19
25
|
* This is used to identify the thread with our own id (openai assistant id is different)
|
|
@@ -84,6 +90,13 @@ export interface CompletionOptions {
|
|
|
84
90
|
*/
|
|
85
91
|
thread?: "persist" | "ephemeral";
|
|
86
92
|
attachments?: Attachment[];
|
|
93
|
+
/**
|
|
94
|
+
* Answers to a prior `AskUserQuestion` tool call, sent on the follow-up
|
|
95
|
+
* request that resumes the paused turn. Each entry's `tool_use_id` must match
|
|
96
|
+
* the `id` from the `assistant.model.question.required` event, so the resumed
|
|
97
|
+
* codegen session pairs the answer with its pending tool_use.
|
|
98
|
+
*/
|
|
99
|
+
toolResults?: ContentMessageItemToolResult[];
|
|
87
100
|
}
|
|
88
101
|
export interface BuilderEditorState {
|
|
89
102
|
/**
|
package/src/editor-ai.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const EditorAiReadRequestSchema: z.ZodObject<{
|
|
|
10
10
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
activeLocale: z.ZodOptional<z.ZodString>;
|
|
13
|
+
baseContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
13
14
|
}, z.core.$strip>;
|
|
14
15
|
export type EditorAiReadRequest = z.infer<typeof EditorAiReadRequestSchema>;
|
|
15
16
|
export declare const EditorAiReadResponseSchema: z.ZodObject<{
|
|
@@ -25,11 +26,13 @@ export declare const EditorAiEditRequestSchema: z.ZodObject<{
|
|
|
25
26
|
contentId: z.ZodString;
|
|
26
27
|
old_str: z.ZodString;
|
|
27
28
|
new_str: z.ZodString;
|
|
29
|
+
replace_all: z.ZodOptional<z.ZodBoolean>;
|
|
28
30
|
activeLocale: z.ZodOptional<z.ZodString>;
|
|
29
31
|
components: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
32
|
name: z.ZodString;
|
|
31
33
|
}, z.core.$loose>>>;
|
|
32
34
|
allowedComponentNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
baseContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
33
36
|
}, z.core.$strip>;
|
|
34
37
|
export type EditorAiEditRequest = z.infer<typeof EditorAiEditRequestSchema>;
|
|
35
38
|
export declare const EditorAiEditResponseSchema: z.ZodObject<{
|
|
@@ -46,6 +49,7 @@ export declare const EditorAiWriteRequestSchema: z.ZodObject<{
|
|
|
46
49
|
name: z.ZodString;
|
|
47
50
|
}, z.core.$loose>>>;
|
|
48
51
|
allowedComponentNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
baseContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
53
|
}, z.core.$strip>;
|
|
50
54
|
export type EditorAiWriteRequest = z.infer<typeof EditorAiWriteRequestSchema>;
|
|
51
55
|
export declare const EditorAiWriteResponseSchema: z.ZodObject<{
|
package/src/editor-ai.js
CHANGED
|
@@ -16,6 +16,9 @@ const componentsField = z.array(EditorAiComponentSchema).optional();
|
|
|
16
16
|
// Omitted is unrestricted; empty forbids every component. Only components-only
|
|
17
17
|
// spaces send it.
|
|
18
18
|
const allowedComponentNamesField = z.array(z.string().min(1)).optional();
|
|
19
|
+
// Edit this instead of the stored document, letting a caller work on an
|
|
20
|
+
// unpublished revision. Ownership still checked against stored. Blocks decoded.
|
|
21
|
+
const baseContentField = z.record(z.string(), z.unknown()).optional();
|
|
19
22
|
export const EditorAiReadRequestSchema = z
|
|
20
23
|
.object({
|
|
21
24
|
contentId: z.string().min(1),
|
|
@@ -23,6 +26,7 @@ export const EditorAiReadRequestSchema = z
|
|
|
23
26
|
limit: z.number().int().min(1).max(EDITOR_AI_READ_MAX_LIMIT).optional(),
|
|
24
27
|
// Locale to operate on; defaults to "Default" when omitted.
|
|
25
28
|
activeLocale: z.string().min(1).optional(),
|
|
29
|
+
baseContent: baseContentField,
|
|
26
30
|
})
|
|
27
31
|
.meta({ title: "EditorAiReadRequest" });
|
|
28
32
|
export const EditorAiReadResponseSchema = z
|
|
@@ -45,10 +49,13 @@ export const EditorAiEditRequestSchema = z
|
|
|
45
49
|
message: "old_str must not be only whitespace",
|
|
46
50
|
}),
|
|
47
51
|
new_str: z.string(),
|
|
52
|
+
// Exact-substring replace of every occurrence, skipping the fuzzy line diff.
|
|
53
|
+
replace_all: z.boolean().optional(),
|
|
48
54
|
// Locale to operate on; defaults to "Default" when omitted.
|
|
49
55
|
activeLocale: z.string().min(1).optional(),
|
|
50
56
|
components: componentsField,
|
|
51
57
|
allowedComponentNames: allowedComponentNamesField,
|
|
58
|
+
baseContent: baseContentField,
|
|
52
59
|
})
|
|
53
60
|
.meta({ title: "EditorAiEditRequest" });
|
|
54
61
|
export const EditorAiEditResponseSchema = z
|
|
@@ -66,6 +73,7 @@ export const EditorAiWriteRequestSchema = z
|
|
|
66
73
|
activeLocale: z.string().min(1).optional(),
|
|
67
74
|
components: componentsField,
|
|
68
75
|
allowedComponentNames: allowedComponentNamesField,
|
|
76
|
+
baseContent: baseContentField,
|
|
69
77
|
})
|
|
70
78
|
.meta({ title: "EditorAiWriteRequest" });
|
|
71
79
|
export const EditorAiWriteResponseSchema = z
|
package/src/events.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
|
|
2
2
|
import type { AssistantMessage, AssistantMessageAction } from "./messages.js";
|
|
3
3
|
import type { AssistantSettings } from "./settings.js";
|
|
4
|
-
import type { ExitState, UserSource, CodeGenPosition, ReviewSeverity, ReviewVerdict } from "./codegen.js";
|
|
4
|
+
import type { ExitState, UserSource, CodeGenPosition, ReviewSeverity, ReviewVerdict, AskUserQuestion } from "./codegen.js";
|
|
5
5
|
import type { FileUpload } from "./messages.js";
|
|
6
6
|
import type { BuilderConfigRealtime } from "./builder-config.js";
|
|
7
7
|
import type { DeployFailureReport } from "./projects.js";
|
|
8
8
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
9
|
-
export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent | ModelPermissionRequiredEvent | ModelPermissionResponseEvent;
|
|
9
|
+
export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent | ModelPermissionRequiredEvent | ModelPermissionResponseEvent | AssistantQuestionRequiredEvent;
|
|
10
10
|
export interface AssistantCompletionResultEvent {
|
|
11
11
|
type: "assistant.result";
|
|
12
12
|
data: {
|
|
@@ -1400,4 +1400,16 @@ export interface ModelPermissionResponseEvent extends AwaitResultEvent {
|
|
|
1400
1400
|
reason?: string;
|
|
1401
1401
|
};
|
|
1402
1402
|
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Emitted when the model calls `AskUserQuestion`. The turn pauses; the client
|
|
1405
|
+
* renders the questions and resumes by sending a new completion whose
|
|
1406
|
+
* `toolResults` carries a result with `tool_use_id === data.id`.
|
|
1407
|
+
*/
|
|
1408
|
+
export interface AssistantQuestionRequiredEvent {
|
|
1409
|
+
type: "assistant.model.question.required";
|
|
1410
|
+
data: {
|
|
1411
|
+
id: string;
|
|
1412
|
+
questions: AskUserQuestion[];
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1403
1415
|
export {};
|
package/src/publish-agent.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GenerateCompletionStep } from "./codegen.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
export declare const PublishAgentSessionCursorSchema: z.ZodObject<{
|
|
3
4
|
updatedAt: z.ZodNumber;
|
|
@@ -23,52 +24,6 @@ export declare const PublishAgentSessionUpdateRequestSchema: z.ZodObject<{
|
|
|
23
24
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
export type PublishAgentSessionUpdateRequest = z.infer<typeof PublishAgentSessionUpdateRequestSchema>;
|
|
26
|
-
export declare const PublishAgentAttachmentReferenceSchema: z.ZodObject<{
|
|
27
|
-
id: z.ZodOptional<z.ZodString>;
|
|
28
|
-
type: z.ZodString;
|
|
29
|
-
name: z.ZodOptional<z.ZodString>;
|
|
30
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
export type PublishAgentAttachmentReference = z.infer<typeof PublishAgentAttachmentReferenceSchema>;
|
|
33
|
-
export declare const PublishAgentToolReferenceSchema: z.ZodObject<{
|
|
34
|
-
id: z.ZodOptional<z.ZodString>;
|
|
35
|
-
name: z.ZodString;
|
|
36
|
-
status: z.ZodEnum<{
|
|
37
|
-
completed: "completed";
|
|
38
|
-
requested: "requested";
|
|
39
|
-
}>;
|
|
40
|
-
}, z.core.$strip>;
|
|
41
|
-
export type PublishAgentToolReference = z.infer<typeof PublishAgentToolReferenceSchema>;
|
|
42
|
-
export declare const PublishAgentSessionMessageSchema: z.ZodObject<{
|
|
43
|
-
id: z.ZodString;
|
|
44
|
-
role: z.ZodEnum<{
|
|
45
|
-
assistant: "assistant";
|
|
46
|
-
user: "user";
|
|
47
|
-
}>;
|
|
48
|
-
senderId: z.ZodOptional<z.ZodString>;
|
|
49
|
-
content: z.ZodOptional<z.ZodString>;
|
|
50
|
-
createdAt: z.ZodNumber;
|
|
51
|
-
status: z.ZodEnum<{
|
|
52
|
-
completed: "completed";
|
|
53
|
-
error: "error";
|
|
54
|
-
running: "running";
|
|
55
|
-
}>;
|
|
56
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
57
|
-
id: z.ZodOptional<z.ZodString>;
|
|
58
|
-
type: z.ZodString;
|
|
59
|
-
name: z.ZodOptional<z.ZodString>;
|
|
60
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
}, z.core.$strip>>>;
|
|
62
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
-
id: z.ZodOptional<z.ZodString>;
|
|
64
|
-
name: z.ZodString;
|
|
65
|
-
status: z.ZodEnum<{
|
|
66
|
-
completed: "completed";
|
|
67
|
-
requested: "requested";
|
|
68
|
-
}>;
|
|
69
|
-
}, z.core.$strip>>>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
export type PublishAgentSessionMessage = z.infer<typeof PublishAgentSessionMessageSchema>;
|
|
72
27
|
export declare const PublishAgentSessionSummarySchema: z.ZodObject<{
|
|
73
28
|
id: z.ZodString;
|
|
74
29
|
spaceId: z.ZodString;
|
|
@@ -114,36 +69,8 @@ export declare const PublishAgentSessionDetailResponseSchema: z.ZodObject<{
|
|
|
114
69
|
totalCompletions: z.ZodNumber;
|
|
115
70
|
numUserMessages: z.ZodNumber;
|
|
116
71
|
}, z.core.$strip>;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
assistant: "assistant";
|
|
121
|
-
user: "user";
|
|
122
|
-
}>;
|
|
123
|
-
senderId: z.ZodOptional<z.ZodString>;
|
|
124
|
-
content: z.ZodOptional<z.ZodString>;
|
|
125
|
-
createdAt: z.ZodNumber;
|
|
126
|
-
status: z.ZodEnum<{
|
|
127
|
-
completed: "completed";
|
|
128
|
-
error: "error";
|
|
129
|
-
running: "running";
|
|
130
|
-
}>;
|
|
131
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
132
|
-
id: z.ZodOptional<z.ZodString>;
|
|
133
|
-
type: z.ZodString;
|
|
134
|
-
name: z.ZodOptional<z.ZodString>;
|
|
135
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
136
|
-
}, z.core.$strip>>>;
|
|
137
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
138
|
-
id: z.ZodOptional<z.ZodString>;
|
|
139
|
-
name: z.ZodString;
|
|
140
|
-
status: z.ZodEnum<{
|
|
141
|
-
completed: "completed";
|
|
142
|
-
requested: "requested";
|
|
143
|
-
}>;
|
|
144
|
-
}, z.core.$strip>>>;
|
|
145
|
-
}, z.core.$strip>>;
|
|
146
|
-
messagesCanLoadMore: z.ZodBoolean;
|
|
147
|
-
messagesNextCursor: z.ZodNullable<z.ZodString>;
|
|
72
|
+
steps: z.ZodArray<z.ZodCustom<GenerateCompletionStep, GenerateCompletionStep>>;
|
|
73
|
+
canLoadMore: z.ZodBoolean;
|
|
74
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
148
75
|
}, z.core.$strip>;
|
|
149
76
|
export type PublishAgentSessionDetailResponse = z.infer<typeof PublishAgentSessionDetailResponseSchema>;
|
package/src/publish-agent.js
CHANGED
|
@@ -30,33 +30,6 @@ export const PublishAgentSessionUpdateRequestSchema = z
|
|
|
30
30
|
message: "Provide title, archived, or both.",
|
|
31
31
|
})
|
|
32
32
|
.meta({ title: "PublishAgentSessionUpdateRequest" });
|
|
33
|
-
export const PublishAgentAttachmentReferenceSchema = z
|
|
34
|
-
.object({
|
|
35
|
-
id: z.string().optional(),
|
|
36
|
-
type: z.string(),
|
|
37
|
-
name: z.string().optional(),
|
|
38
|
-
size: z.number().optional(),
|
|
39
|
-
})
|
|
40
|
-
.meta({ title: "PublishAgentAttachmentReference" });
|
|
41
|
-
export const PublishAgentToolReferenceSchema = z
|
|
42
|
-
.object({
|
|
43
|
-
id: z.string().optional(),
|
|
44
|
-
name: z.string(),
|
|
45
|
-
status: z.enum(["requested", "completed"]),
|
|
46
|
-
})
|
|
47
|
-
.meta({ title: "PublishAgentToolReference" });
|
|
48
|
-
export const PublishAgentSessionMessageSchema = z
|
|
49
|
-
.object({
|
|
50
|
-
id: z.string(),
|
|
51
|
-
role: z.enum(["user", "assistant"]),
|
|
52
|
-
senderId: z.string().optional(),
|
|
53
|
-
content: z.string().optional(),
|
|
54
|
-
createdAt: z.number(),
|
|
55
|
-
status: z.enum(["completed", "running", "error"]),
|
|
56
|
-
attachments: z.array(PublishAgentAttachmentReferenceSchema).optional(),
|
|
57
|
-
tools: z.array(PublishAgentToolReferenceSchema).optional(),
|
|
58
|
-
})
|
|
59
|
-
.meta({ title: "PublishAgentSessionMessage" });
|
|
60
33
|
export const PublishAgentSessionSummarySchema = z
|
|
61
34
|
.object({
|
|
62
35
|
id: z.string(),
|
|
@@ -81,8 +54,8 @@ export const PublishAgentSessionListResponseSchema = z
|
|
|
81
54
|
export const PublishAgentSessionDetailResponseSchema = z
|
|
82
55
|
.object({
|
|
83
56
|
session: PublishAgentSessionSummarySchema,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
57
|
+
steps: z.array(z.custom()),
|
|
58
|
+
canLoadMore: z.boolean(),
|
|
59
|
+
nextCursor: z.string().nullable(),
|
|
87
60
|
})
|
|
88
61
|
.meta({ title: "PublishAgentSessionDetailResponse" });
|