@builder.io/ai-utils 0.28.0 → 0.29.1
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/claw.d.ts +1 -0
- package/src/claw.js +1 -0
- package/src/codegen.d.ts +9 -9
- package/src/events.d.ts +12 -1
- package/src/messages.d.ts +11 -2
- package/src/projects.d.ts +4 -0
package/package.json
CHANGED
package/src/claw.d.ts
CHANGED
|
@@ -40,5 +40,6 @@ export interface ParsedChannelId {
|
|
|
40
40
|
* Examples:
|
|
41
41
|
* "slack/thread/T01234/C56789/1234567890.123456" → { platform: "slack", type: "thread", ids: ["T01234", "C56789", "1234567890.123456"] }
|
|
42
42
|
* "jira/comment/cloud-id/PROJ-123" → { platform: "jira", type: "comment", ids: ["cloud-id", "PROJ-123"] }
|
|
43
|
+
* "builder/branch/proj-id/my-branch" → { platform: "builder", type: "branch", ids: ["proj-id", "my-branch"] }
|
|
43
44
|
*/
|
|
44
45
|
export declare function parseChannelId(channelId: string): ParsedChannelId;
|
package/src/claw.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Examples:
|
|
6
6
|
* "slack/thread/T01234/C56789/1234567890.123456" → { platform: "slack", type: "thread", ids: ["T01234", "C56789", "1234567890.123456"] }
|
|
7
7
|
* "jira/comment/cloud-id/PROJ-123" → { platform: "jira", type: "comment", ids: ["cloud-id", "PROJ-123"] }
|
|
8
|
+
* "builder/branch/proj-id/my-branch" → { platform: "builder", type: "branch", ids: ["proj-id", "my-branch"] }
|
|
8
9
|
*/
|
|
9
10
|
export function parseChannelId(channelId) {
|
|
10
11
|
const parts = channelId.split("/");
|
package/src/codegen.d.ts
CHANGED
|
@@ -325,6 +325,8 @@ export interface ExitToolInput {
|
|
|
325
325
|
isMicrofrontend?: boolean;
|
|
326
326
|
setupNeedsCredentials?: boolean;
|
|
327
327
|
devServerNeedsCredentials?: boolean;
|
|
328
|
+
/** A human-readable description of what the project is about (not tech specs), used by fusion to route requests to the right project */
|
|
329
|
+
projectDescription?: string;
|
|
328
330
|
}
|
|
329
331
|
/**
|
|
330
332
|
* Configuration proposed by the configuration agent, stored in Firebase
|
|
@@ -412,6 +414,7 @@ export interface ProposedConfig {
|
|
|
412
414
|
isMicrofrontend?: boolean;
|
|
413
415
|
setupNeedsCredentials?: boolean;
|
|
414
416
|
devServerNeedsCredentials?: boolean;
|
|
417
|
+
projectDescription?: string;
|
|
415
418
|
cost?: number;
|
|
416
419
|
durationMs?: number;
|
|
417
420
|
}
|
|
@@ -444,6 +447,7 @@ export interface ProposeConfigParams {
|
|
|
444
447
|
isMicrofrontend?: boolean;
|
|
445
448
|
setupNeedsCredentials?: boolean;
|
|
446
449
|
devServerNeedsCredentials?: boolean;
|
|
450
|
+
projectDescription?: string;
|
|
447
451
|
}
|
|
448
452
|
export interface VerifySetupCommandToolInput {
|
|
449
453
|
command: string;
|
|
@@ -481,7 +485,7 @@ export interface SetEnvVariableToolInput {
|
|
|
481
485
|
export interface SendMessageToolInput {
|
|
482
486
|
channelId: string;
|
|
483
487
|
markdown: string;
|
|
484
|
-
status: "starting" | "question" | "done:success" | "done:error";
|
|
488
|
+
status: "starting" | "question" | "will-follow-up" | "done:success" | "done:error";
|
|
485
489
|
}
|
|
486
490
|
export interface SpawnBranchToolInput {
|
|
487
491
|
projectId: string;
|
|
@@ -489,12 +493,6 @@ export interface SpawnBranchToolInput {
|
|
|
489
493
|
builderUserId?: string;
|
|
490
494
|
hidden?: boolean;
|
|
491
495
|
}
|
|
492
|
-
export interface SendMessageToBranchToolInput {
|
|
493
|
-
projectId: string;
|
|
494
|
-
branchName: string;
|
|
495
|
-
message: string;
|
|
496
|
-
builderUserId?: string;
|
|
497
|
-
}
|
|
498
496
|
export interface ReadBranchToolInput {
|
|
499
497
|
projectId: string;
|
|
500
498
|
branchName: string;
|
|
@@ -602,7 +600,6 @@ export interface CodeGenToolMap {
|
|
|
602
600
|
SetEnvVariable: SetEnvVariableToolInput;
|
|
603
601
|
SendMessage: SendMessageToolInput;
|
|
604
602
|
SpawnBranch: SpawnBranchToolInput;
|
|
605
|
-
SendMessageToBranch: SendMessageToBranchToolInput;
|
|
606
603
|
ReadBranch: ReadBranchToolInput;
|
|
607
604
|
RunningAgents: RunningAgentsToolInput;
|
|
608
605
|
}
|
|
@@ -1150,7 +1147,7 @@ export interface UserSourceBase {
|
|
|
1150
1147
|
}
|
|
1151
1148
|
/** All integration sources: Slack, Teams, Jira, Linear, and git providers (GitHub, GitLab, Azure, Bitbucket). */
|
|
1152
1149
|
export interface UserSourceOther extends UserSourceBase {
|
|
1153
|
-
source: "slack" | "teams" | "jira" | "linear" | "github" | "gitlab" | "azure" | "bitbucket";
|
|
1150
|
+
source: "slack" | "telegram" | "teams" | "jira" | "linear" | "github" | "gitlab" | "azure" | "bitbucket";
|
|
1154
1151
|
/** User ID from the external platform (Slack user ID, GitHub user id, etc.) */
|
|
1155
1152
|
userId?: string;
|
|
1156
1153
|
userName?: string;
|
|
@@ -1170,6 +1167,9 @@ export interface UserSourceBuilder extends UserSourceBase {
|
|
|
1170
1167
|
}
|
|
1171
1168
|
export interface UserSourceAgent extends UserSourceBase {
|
|
1172
1169
|
source: "agent";
|
|
1170
|
+
userId?: string;
|
|
1171
|
+
userName?: string;
|
|
1172
|
+
userEmail?: string;
|
|
1173
1173
|
}
|
|
1174
1174
|
export type UserSource = UserSourceOther | UserSourceBuilder | UserSourceAgent;
|
|
1175
1175
|
export type AutoPushMode = "force-push" | "merge-push" | "ff-push" | "safe-push" | "none";
|
package/src/events.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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 } from "./codegen.js";
|
|
4
|
+
import type { ExitState, UserSource } from "./codegen.js";
|
|
5
|
+
import type { FileUpload } from "./messages.js";
|
|
5
6
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
6
7
|
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;
|
|
7
8
|
export interface AssistantCompletionResultEvent {
|
|
@@ -527,14 +528,24 @@ export type ClawMessageSentV1 = FusionEventVariant<"claw.message.sent", {
|
|
|
527
528
|
senderId?: string;
|
|
528
529
|
correlationId?: string;
|
|
529
530
|
channelId?: string;
|
|
531
|
+
dmId?: string;
|
|
530
532
|
senderDisplayName?: string;
|
|
533
|
+
userSource?: UserSource;
|
|
531
534
|
/** Optional context to include alongside the message (e.g. Slack thread history). */
|
|
532
535
|
messageContext?: string;
|
|
536
|
+
/** File attachments (images, PDFs, etc.) to include with the message. */
|
|
537
|
+
attachments?: FileUpload[];
|
|
533
538
|
}, {}, 1>;
|
|
534
539
|
export declare const ClawMessageSentV1: {
|
|
535
540
|
eventName: "claw.message.sent";
|
|
536
541
|
version: "1";
|
|
537
542
|
};
|
|
543
|
+
export interface SendMessageToOrgAgentInput {
|
|
544
|
+
content: string;
|
|
545
|
+
channelId?: string;
|
|
546
|
+
senderDisplayName?: string;
|
|
547
|
+
messageContext?: string;
|
|
548
|
+
}
|
|
538
549
|
export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | GitPrCreatedEvent | ClientDevtoolsSessionStartedEvent | FusionProjectCreatedV1 | SetupAgentCompletedV1 | ForceSetupAgentV1 | ClawMessageSentV1;
|
|
539
550
|
export interface ModelPermissionRequiredEvent {
|
|
540
551
|
type: "assistant.model.permission.required";
|
package/src/messages.d.ts
CHANGED
|
@@ -32,6 +32,15 @@ export interface ContentMessageItemVideo {
|
|
|
32
32
|
cache?: boolean;
|
|
33
33
|
ephemeral?: boolean;
|
|
34
34
|
}
|
|
35
|
+
export interface ContentMessageItemResource {
|
|
36
|
+
type: "resource";
|
|
37
|
+
resource: {
|
|
38
|
+
uri: string;
|
|
39
|
+
mimeType?: string;
|
|
40
|
+
text?: string;
|
|
41
|
+
blob?: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
35
44
|
export interface DocumentBase64Source {
|
|
36
45
|
type: "base64";
|
|
37
46
|
media_type: "application/pdf";
|
|
@@ -53,7 +62,7 @@ export interface ContentMessageItemToolResult {
|
|
|
53
62
|
tool_name?: string;
|
|
54
63
|
tool_input?: string;
|
|
55
64
|
title?: string;
|
|
56
|
-
content: string | (ContentMessageItemText | ContentMessageItemImage)[];
|
|
65
|
+
content: string | (ContentMessageItemText | ContentMessageItemImage | ContentMessageItemResource)[];
|
|
57
66
|
is_error?: boolean;
|
|
58
67
|
cache?: boolean;
|
|
59
68
|
ephemeral?: boolean;
|
|
@@ -195,7 +204,7 @@ export interface ContentMessageItemCodeExecutionToolResult {
|
|
|
195
204
|
content: any;
|
|
196
205
|
cache?: boolean;
|
|
197
206
|
}
|
|
198
|
-
export type ContentMessageItem = ContentMessageItemText | ContentMessageItemImage | ContentMessageItemDocument | ContentMessageItemVideo | ContentMessageItemThinking | ContentMessageItemRedactedThinking | ContentMessageItemToolUse | ContentMessageItemToolResult | ContentMessageItemWebSearchToolResult | ContentMessageItemServerToolUse | ContentMessageItemMCPToolUse | ContentMessageItemMCPToolResult | ContentMessageItemContainerUpload | ContentMessageItemCodeExecutionToolResult;
|
|
207
|
+
export type ContentMessageItem = ContentMessageItemText | ContentMessageItemImage | ContentMessageItemResource | ContentMessageItemDocument | ContentMessageItemVideo | ContentMessageItemThinking | ContentMessageItemRedactedThinking | ContentMessageItemToolUse | ContentMessageItemToolResult | ContentMessageItemWebSearchToolResult | ContentMessageItemServerToolUse | ContentMessageItemMCPToolUse | ContentMessageItemMCPToolResult | ContentMessageItemContainerUpload | ContentMessageItemCodeExecutionToolResult;
|
|
199
208
|
export type ContentMessage = ContentMessageItem[];
|
|
200
209
|
export interface SystemMessageParam {
|
|
201
210
|
/**
|
package/src/projects.d.ts
CHANGED
|
@@ -374,6 +374,7 @@ export interface PrInfo {
|
|
|
374
374
|
prNumber: number;
|
|
375
375
|
prUrl: string;
|
|
376
376
|
status: PRStatus;
|
|
377
|
+
updatedAt: number;
|
|
377
378
|
}
|
|
378
379
|
/**
|
|
379
380
|
* Metadata stored in branches for integration tracking and PR description generation.
|
|
@@ -423,6 +424,7 @@ export interface BranchSharedData {
|
|
|
423
424
|
prUrl?: string | null;
|
|
424
425
|
prInfoByFolder?: Record<string, PrInfo> | null;
|
|
425
426
|
prStatus?: PRStatus;
|
|
427
|
+
prStatusUpdatedAt?: number | null;
|
|
426
428
|
machineId?: string | null;
|
|
427
429
|
lastMachineIdRemovedAt?: number | null;
|
|
428
430
|
volumeId?: string | null;
|
|
@@ -779,6 +781,8 @@ export interface CreateBranchOptions {
|
|
|
779
781
|
type?: BranchType;
|
|
780
782
|
/** Optional suffix to append to generated branch names (e.g., model short name for parallel branches) */
|
|
781
783
|
branchNameSuffix?: string;
|
|
784
|
+
/** Additional metadata to store on the branch (e.g., Slack thread origin) */
|
|
785
|
+
metadata?: Record<string, unknown>;
|
|
782
786
|
}
|
|
783
787
|
interface BaseCreateBranchMessage {
|
|
784
788
|
}
|