@bubblelab/shared-schemas 0.1.45 → 0.1.46

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/index.js CHANGED
@@ -421,7 +421,9 @@ var SYSTEM_CREDENTIALS = /* @__PURE__ */ new Set([
421
421
  "CLOUDFLARE_R2_ACCOUNT_ID" /* CLOUDFLARE_R2_ACCOUNT_ID */,
422
422
  // Scraping credentials
423
423
  "APIFY_CRED" /* APIFY_CRED */,
424
- "CRUSTDATA_API_KEY" /* CRUSTDATA_API_KEY */
424
+ "CRUSTDATA_API_KEY" /* CRUSTDATA_API_KEY */,
425
+ // Enrichment credentials
426
+ "FULLENRICH_API_KEY" /* FULLENRICH_API_KEY */
425
427
  ]);
426
428
  var OPTIONAL_CREDENTIALS = /* @__PURE__ */ new Set([
427
429
  "CUSTOM_AUTH_KEY" /* CUSTOM_AUTH_KEY */,
@@ -2837,124 +2839,291 @@ var webhookResponseSchema = z12.object({
2837
2839
  }).openapi("WebhookResponse");
2838
2840
 
2839
2841
  // src/subscription-status-schema.ts
2842
+ import { z as z14 } from "@hono/zod-openapi";
2843
+
2844
+ // src/organization-schema.ts
2840
2845
  import { z as z13 } from "@hono/zod-openapi";
2841
- var hackathonOfferSchema = z13.object({
2842
- isActive: z13.boolean().openapi({
2846
+ var orgRoleSchema = z13.enum(["owner", "admin", "member"]).openapi("OrgRole");
2847
+ var orgTypeSchema = z13.enum(["personal", "organization"]).openapi("OrgType");
2848
+ var organizationSchema = z13.object({
2849
+ id: z13.number().openapi({
2850
+ description: "Organization ID",
2851
+ example: 123
2852
+ }),
2853
+ name: z13.string().openapi({
2854
+ description: "Organization name",
2855
+ example: "My Team"
2856
+ }),
2857
+ slug: z13.string().openapi({
2858
+ description: "Organization slug for URLs",
2859
+ example: "my-team"
2860
+ }),
2861
+ type: orgTypeSchema,
2862
+ role: orgRoleSchema.openapi({
2863
+ description: "Current user's role in this organization"
2864
+ }),
2865
+ memberCount: z13.number().openapi({
2866
+ description: "Number of members in the organization",
2867
+ example: 5
2868
+ }),
2869
+ createdAt: z13.string().openapi({
2870
+ description: "ISO timestamp when organization was created",
2871
+ example: "2024-01-01T00:00:00Z"
2872
+ })
2873
+ }).openapi("Organization");
2874
+ var organizationDetailSchema = organizationSchema.extend({
2875
+ workflowCount: z13.number().openapi({
2876
+ description: "Number of workflows in the organization",
2877
+ example: 10
2878
+ }),
2879
+ updatedAt: z13.string().openapi({
2880
+ description: "ISO timestamp when organization was last updated",
2881
+ example: "2024-01-02T00:00:00Z"
2882
+ })
2883
+ }).openapi("OrganizationDetail");
2884
+ var organizationMemberSchema = z13.object({
2885
+ userId: z13.string().openapi({
2886
+ description: "User ID",
2887
+ example: "user_123"
2888
+ }),
2889
+ email: z13.string().openapi({
2890
+ description: "User email",
2891
+ example: "user@example.com"
2892
+ }),
2893
+ name: z13.string().nullable().openapi({
2894
+ description: "User display name",
2895
+ example: "John Doe"
2896
+ }),
2897
+ avatarUrl: z13.string().optional().openapi({
2898
+ description: "User avatar URL",
2899
+ example: "https://example.com/avatar.png"
2900
+ }),
2901
+ role: orgRoleSchema,
2902
+ joinedAt: z13.string().openapi({
2903
+ description: "ISO timestamp when user joined the organization",
2904
+ example: "2024-01-01T00:00:00Z"
2905
+ })
2906
+ }).openapi("OrganizationMember");
2907
+ var createOrganizationSchema = z13.object({
2908
+ name: z13.string().min(1).max(100).openapi({
2909
+ description: "Organization name",
2910
+ example: "My Team"
2911
+ }),
2912
+ slug: z13.string().min(3).max(50).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").openapi({
2913
+ description: "Organization slug for URLs",
2914
+ example: "my-team"
2915
+ })
2916
+ }).openapi("CreateOrganizationRequest");
2917
+ var updateOrganizationSchema = z13.object({
2918
+ name: z13.string().min(1).max(100).optional().openapi({
2919
+ description: "Organization name",
2920
+ example: "My Team"
2921
+ }),
2922
+ slug: z13.string().min(3).max(50).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").optional().openapi({
2923
+ description: "Organization slug for URLs",
2924
+ example: "my-team"
2925
+ })
2926
+ }).openapi("UpdateOrganizationRequest");
2927
+ var addMemberSchema = z13.object({
2928
+ email: z13.string().email().openapi({
2929
+ description: "Email of the user to add",
2930
+ example: "user@example.com"
2931
+ }),
2932
+ role: z13.enum(["admin", "member"]).openapi({
2933
+ description: "Role to assign to the new member",
2934
+ example: "member"
2935
+ })
2936
+ }).openapi("AddMemberRequest");
2937
+ var updateMemberRoleSchema = z13.object({
2938
+ role: z13.enum(["admin", "member"]).openapi({
2939
+ description: "New role for the member",
2940
+ example: "admin"
2941
+ })
2942
+ }).openapi("UpdateMemberRoleRequest");
2943
+ var listOrganizationsResponseSchema = z13.object({
2944
+ organizations: z13.array(organizationSchema)
2945
+ }).openapi("ListOrganizationsResponse");
2946
+ var updateOrganizationResponseSchema = z13.object({
2947
+ id: z13.number(),
2948
+ name: z13.string(),
2949
+ slug: z13.string(),
2950
+ updatedAt: z13.string()
2951
+ }).openapi("UpdateOrganizationResponse");
2952
+ var listMembersResponseSchema = z13.object({
2953
+ members: z13.array(organizationMemberSchema)
2954
+ }).openapi("ListMembersResponse");
2955
+ var addMemberResponseSchema = z13.object({
2956
+ userId: z13.string(),
2957
+ role: orgRoleSchema,
2958
+ joinedAt: z13.string()
2959
+ }).openapi("AddMemberResponse");
2960
+ var updateMemberRoleResponseSchema = z13.object({
2961
+ userId: z13.string(),
2962
+ role: orgRoleSchema
2963
+ }).openapi("UpdateMemberRoleResponse");
2964
+ var successResponseSchema = z13.object({
2965
+ success: z13.boolean()
2966
+ }).openapi("SuccessResponse");
2967
+
2968
+ // src/subscription-status-schema.ts
2969
+ var tokenUsageSchema = z14.object({
2970
+ modelName: z14.string().optional().openapi({
2971
+ description: "Model name",
2972
+ example: "gpt-4"
2973
+ }),
2974
+ inputTokens: z14.number().openapi({
2975
+ description: "Input tokens used this month",
2976
+ example: 1500
2977
+ }),
2978
+ outputTokens: z14.number().openapi({
2979
+ description: "Output tokens used this month",
2980
+ example: 750
2981
+ }),
2982
+ totalTokens: z14.number().openapi({
2983
+ description: "Total tokens used this month",
2984
+ example: 2250
2985
+ })
2986
+ }).openapi("TokenUsage");
2987
+ var usageSchema = z14.object({
2988
+ executionCount: z14.number().openapi({
2989
+ description: "Current monthly execution count",
2990
+ example: 100
2991
+ }),
2992
+ tokenUsage: z14.array(tokenUsageSchema).openapi({
2993
+ description: "Token usage breakdown by model for current month"
2994
+ }),
2995
+ serviceUsage: z14.array(ServiceUsageSchema).openapi({
2996
+ description: "Service usage and cost breakdown for current month"
2997
+ })
2998
+ }).openapi("Usage");
2999
+ var billingOrganizationSchema = z14.object({
3000
+ id: z14.number().openapi({
3001
+ description: "Organization ID",
3002
+ example: 123
3003
+ }),
3004
+ name: z14.string().openapi({
3005
+ description: "Organization name",
3006
+ example: "My Team"
3007
+ }),
3008
+ slug: z14.string().openapi({
3009
+ description: "Organization slug",
3010
+ example: "my-team"
3011
+ }),
3012
+ role: orgRoleSchema.openapi({
3013
+ description: "Current user's role in this organization"
3014
+ }),
3015
+ memberCount: z14.number().openapi({
3016
+ description: "Number of members in the organization",
3017
+ example: 5
3018
+ })
3019
+ }).openapi("BillingOrganization");
3020
+ var hackathonOfferSchema = z14.object({
3021
+ isActive: z14.boolean().openapi({
2843
3022
  description: "Whether a hackathon offer is currently active",
2844
3023
  example: true
2845
3024
  }),
2846
- expiresAt: z13.string().openapi({
3025
+ expiresAt: z14.string().openapi({
2847
3026
  description: "ISO date when the hackathon offer expires",
2848
3027
  example: "2025-01-15T14:30:00.000Z"
2849
3028
  }),
2850
- redeemedAt: z13.string().openapi({
3029
+ redeemedAt: z14.string().openapi({
2851
3030
  description: "ISO date when the code was redeemed",
2852
3031
  example: "2025-01-14T14:30:00.000Z"
2853
3032
  })
2854
3033
  }).openapi("HackathonOffer");
2855
- var specialOfferSchema = z13.object({
2856
- isActive: z13.boolean().openapi({
3034
+ var specialOfferSchema = z14.object({
3035
+ isActive: z14.boolean().openapi({
2857
3036
  description: "Whether a special offer is currently active",
2858
3037
  example: true
2859
3038
  }),
2860
- plan: z13.string().openapi({
3039
+ plan: z14.string().openapi({
2861
3040
  description: "The plan granted by the special offer",
2862
3041
  example: "unlimited"
2863
3042
  }),
2864
- expiresAt: z13.string().nullable().openapi({
3043
+ expiresAt: z14.string().nullable().openapi({
2865
3044
  description: "ISO date when the special offer expires (null = never expires)",
2866
3045
  example: "2025-06-15T14:30:00.000Z"
2867
3046
  })
2868
3047
  }).openapi("SpecialOffer");
2869
- var redeemCouponRequestSchema = z13.object({
2870
- code: z13.string().min(1).openapi({
3048
+ var redeemCouponRequestSchema = z14.object({
3049
+ code: z14.string().min(1).openapi({
2871
3050
  description: "The coupon code to redeem",
2872
3051
  example: "HACKATHON2025"
2873
3052
  })
2874
3053
  }).openapi("RedeemCouponRequest");
2875
- var redeemCouponResponseSchema = z13.object({
2876
- success: z13.boolean().openapi({
3054
+ var redeemCouponResponseSchema = z14.object({
3055
+ success: z14.boolean().openapi({
2877
3056
  description: "Whether the redemption was successful",
2878
3057
  example: true
2879
3058
  }),
2880
- message: z13.string().openapi({
3059
+ message: z14.string().openapi({
2881
3060
  description: "Human-readable message about the redemption result",
2882
3061
  example: "Coupon redeemed successfully! You now have Pro access."
2883
3062
  }),
2884
- expiresAt: z13.string().optional().openapi({
3063
+ expiresAt: z14.string().optional().openapi({
2885
3064
  description: "When the offer expires (if successful)",
2886
3065
  example: "2025-01-15T14:30:00.000Z"
2887
3066
  })
2888
3067
  }).openapi("RedeemCouponResponse");
2889
- var subscriptionStatusResponseSchema = z13.object({
2890
- userId: z13.string().openapi({
3068
+ var subscriptionStatusResponseSchema = z14.object({
3069
+ userId: z14.string().openapi({
2891
3070
  description: "User ID from Clerk",
2892
3071
  example: "user_30Gbwrzto1VZvAHcGUm5NLQhpkp"
2893
3072
  }),
2894
- plan: z13.string().openapi({
3073
+ plan: z14.string().openapi({
2895
3074
  description: "Current subscription plan",
2896
3075
  example: "pro_plus"
2897
3076
  }),
2898
- planDisplayName: z13.string().openapi({
3077
+ planDisplayName: z14.string().openapi({
2899
3078
  description: "Human-readable plan name",
2900
3079
  example: "Pro Plus"
2901
3080
  }),
2902
- features: z13.array(z13.string()).openapi({
3081
+ features: z14.array(z14.string()).openapi({
2903
3082
  description: "List of features available to the user",
2904
3083
  example: ["unlimited_usage", "priority_support"]
2905
3084
  }),
2906
- usage: z13.object({
2907
- executionCount: z13.number().openapi({
2908
- description: "Current monthly execution count",
3085
+ // Organization context - which org the billing belongs to
3086
+ organization: billingOrganizationSchema.optional().openapi({
3087
+ description: "Organization that owns the billing (null for personal accounts without org)"
3088
+ }),
3089
+ // Organization-level usage (what billing is based on)
3090
+ usage: z14.object({
3091
+ executionCount: z14.number().openapi({
3092
+ description: "Organization monthly execution count",
2909
3093
  example: 100
2910
3094
  }),
2911
- executionLimit: z13.number().openapi({
2912
- description: "Current monthly execution limit",
3095
+ executionLimit: z14.number().openapi({
3096
+ description: "Organization monthly execution limit",
2913
3097
  example: 42
2914
3098
  }),
2915
- creditLimit: z13.number().openapi({
2916
- description: "Monthly credit limit",
3099
+ creditLimit: z14.number().openapi({
3100
+ description: "Organization monthly credit limit",
2917
3101
  example: 100
2918
3102
  }),
2919
- activeFlowLimit: z13.number().openapi({
2920
- description: "Current monthly active flow limit",
3103
+ activeFlowLimit: z14.number().openapi({
3104
+ description: "Organization monthly active flow limit",
2921
3105
  example: 2
2922
3106
  }),
2923
- estimatedMonthlyCost: z13.number().openapi({
3107
+ estimatedMonthlyCost: z14.number().openapi({
2924
3108
  description: "Projected monthly cost based on current usage trend",
2925
3109
  example: 14.19
2926
3110
  }),
2927
- resetDate: z13.string().openapi({
3111
+ resetDate: z14.string().openapi({
2928
3112
  description: "ISO date when usage resets",
2929
3113
  example: "2025-02-01T00:00:00.000Z"
2930
3114
  }),
2931
- tokenUsage: z13.array(
2932
- z13.object({
2933
- modelName: z13.string().openapi({
2934
- description: "Model name",
2935
- example: "gpt-4"
2936
- }),
2937
- inputTokens: z13.number().openapi({
2938
- description: "Input tokens used this month",
2939
- example: 1500
2940
- }),
2941
- outputTokens: z13.number().openapi({
2942
- description: "Output tokens used this month",
2943
- example: 750
2944
- }),
2945
- totalTokens: z13.number().openapi({
2946
- description: "Total tokens used this month",
2947
- example: 2250
2948
- })
2949
- })
2950
- ).openapi({
3115
+ tokenUsage: z14.array(tokenUsageSchema).openapi({
2951
3116
  description: "Token usage breakdown by model for current month"
2952
3117
  }),
2953
- serviceUsage: z13.array(ServiceUsageSchema).openapi({
3118
+ serviceUsage: z14.array(ServiceUsageSchema).openapi({
2954
3119
  description: "Service usage and cost breakdown for current month"
2955
3120
  })
2956
3121
  }),
2957
- isActive: z13.boolean().openapi({
3122
+ // User's personal contribution to the organization usage
3123
+ personalUsage: usageSchema.optional().openapi({
3124
+ description: "User's personal contribution to the organization's usage for current billing period"
3125
+ }),
3126
+ isActive: z14.boolean().openapi({
2958
3127
  description: "Whether the subscription is active",
2959
3128
  example: true
2960
3129
  }),
@@ -2967,11 +3136,11 @@ var subscriptionStatusResponseSchema = z13.object({
2967
3136
  }).openapi("SubscriptionStatusResponse");
2968
3137
 
2969
3138
  // src/milk-tea.ts
2970
- import { z as z16 } from "zod";
3139
+ import { z as z17 } from "zod";
2971
3140
 
2972
3141
  // src/ai-models.ts
2973
- import { z as z14 } from "zod";
2974
- var AvailableModels = z14.enum([
3142
+ import { z as z15 } from "zod";
3143
+ var AvailableModels = z15.enum([
2975
3144
  // OpenAI models
2976
3145
  "openai/gpt-5",
2977
3146
  "openai/gpt-5-mini",
@@ -2999,111 +3168,111 @@ var AvailableModels = z14.enum([
2999
3168
  ]);
3000
3169
 
3001
3170
  // src/agent-memory.ts
3002
- import { z as z15 } from "zod";
3171
+ import { z as z16 } from "zod";
3003
3172
  var TOOL_CALL_TO_DISCARD = ["get-bubble-details-tool"];
3004
- var ConversationMessageSchema = z15.object({
3005
- role: z15.enum(["user", "assistant", "tool"]).describe("The role of the message sender"),
3006
- content: z15.string().describe("The message content"),
3007
- toolCallId: z15.string().optional().describe("Tool call ID for tool messages"),
3008
- name: z15.string().optional().describe("Tool name for tool messages")
3173
+ var ConversationMessageSchema = z16.object({
3174
+ role: z16.enum(["user", "assistant", "tool"]).describe("The role of the message sender"),
3175
+ content: z16.string().describe("The message content"),
3176
+ toolCallId: z16.string().optional().describe("Tool call ID for tool messages"),
3177
+ name: z16.string().optional().describe("Tool name for tool messages")
3009
3178
  });
3010
3179
 
3011
3180
  // src/milk-tea.ts
3012
- var MilkTeaRequestSchema = z16.object({
3013
- userRequest: z16.string().min(1, "User request is required").describe("The user request or question about configuring the bubble"),
3014
- bubbleName: z16.string().min(1, "Bubble name is required").describe('The name of the bubble to configure (e.g., "email-tool")'),
3015
- bubbleSchema: z16.record(z16.unknown()).describe(
3181
+ var MilkTeaRequestSchema = z17.object({
3182
+ userRequest: z17.string().min(1, "User request is required").describe("The user request or question about configuring the bubble"),
3183
+ bubbleName: z17.string().min(1, "Bubble name is required").describe('The name of the bubble to configure (e.g., "email-tool")'),
3184
+ bubbleSchema: z17.record(z17.unknown()).describe(
3016
3185
  "The full schema/interface definition of the bubble including parameters and types"
3017
3186
  ),
3018
- currentCode: z16.string().optional().describe("The current workflow code context for validation"),
3019
- availableCredentials: z16.array(z16.string()).default([]).describe("List of credential types available to the user"),
3020
- userName: z16.string().describe("Name of the user making the request"),
3021
- insertLocation: z16.string().optional().describe("Location in code where the snippet should be inserted"),
3022
- conversationHistory: z16.array(ConversationMessageSchema).optional().default([]).describe(
3187
+ currentCode: z17.string().optional().describe("The current workflow code context for validation"),
3188
+ availableCredentials: z17.array(z17.string()).default([]).describe("List of credential types available to the user"),
3189
+ userName: z17.string().describe("Name of the user making the request"),
3190
+ insertLocation: z17.string().optional().describe("Location in code where the snippet should be inserted"),
3191
+ conversationHistory: z17.array(ConversationMessageSchema).optional().default([]).describe(
3023
3192
  "Previous conversation messages for multi-turn interactions (frontend manages state)"
3024
3193
  ),
3025
3194
  model: AvailableModels.default("google/gemini-2.5-pro").describe(
3026
3195
  "AI model to use for Milk Tea agent"
3027
3196
  )
3028
3197
  });
3029
- var MilkTeaResponseSchema = z16.object({
3030
- type: z16.enum(["code", "question", "reject"]).describe(
3198
+ var MilkTeaResponseSchema = z17.object({
3199
+ type: z17.enum(["code", "question", "reject"]).describe(
3031
3200
  "Type of response: code (generated snippet), question (needs clarification), reject (infeasible request)"
3032
3201
  ),
3033
- message: z16.string().describe(
3202
+ message: z17.string().describe(
3034
3203
  "Human-readable message: explanation for code, question text, or rejection reason"
3035
3204
  ),
3036
- snippet: z16.string().optional().describe(
3205
+ snippet: z17.string().optional().describe(
3037
3206
  'Generated TypeScript code snippet (only present when type is "code")'
3038
3207
  ),
3039
- success: z16.boolean().describe("Whether the operation completed successfully"),
3040
- error: z16.string().optional().describe("Error message if the operation failed")
3208
+ success: z17.boolean().describe("Whether the operation completed successfully"),
3209
+ error: z17.string().optional().describe("Error message if the operation failed")
3041
3210
  });
3042
- var MilkTeaAgentOutputSchema = z16.object({
3043
- type: z16.enum(["code", "question", "reject"]),
3044
- message: z16.string(),
3045
- snippet: z16.string().optional()
3211
+ var MilkTeaAgentOutputSchema = z17.object({
3212
+ type: z17.enum(["code", "question", "reject"]),
3213
+ message: z17.string(),
3214
+ snippet: z17.string().optional()
3046
3215
  });
3047
3216
 
3048
3217
  // src/pearl.ts
3049
- import { z as z17 } from "zod";
3218
+ import { z as z18 } from "zod";
3050
3219
  var PEARL_DEFAULT_MODEL = "openrouter/anthropic/claude-sonnet-4.5";
3051
- var PearlRequestSchema = z17.object({
3052
- userRequest: z17.string().min(1, "User request is required").describe("The user request or question about building a workflow"),
3053
- currentCode: z17.string().optional().describe("The current workflow code for context and modification"),
3054
- userName: z17.string().describe("Name of the user making the request"),
3055
- availableVariables: z17.array(z17.any()).describe("List of available variables in the current code"),
3056
- conversationHistory: z17.array(ConversationMessageSchema).optional().default([]).describe(
3220
+ var PearlRequestSchema = z18.object({
3221
+ userRequest: z18.string().min(1, "User request is required").describe("The user request or question about building a workflow"),
3222
+ currentCode: z18.string().optional().describe("The current workflow code for context and modification"),
3223
+ userName: z18.string().describe("Name of the user making the request"),
3224
+ availableVariables: z18.array(z18.any()).describe("List of available variables in the current code"),
3225
+ conversationHistory: z18.array(ConversationMessageSchema).optional().default([]).describe(
3057
3226
  "Previous conversation messages for multi-turn interactions (frontend manages state)"
3058
3227
  ),
3059
3228
  model: AvailableModels.default(PEARL_DEFAULT_MODEL).describe(
3060
3229
  "AI model to use for Pearl agent"
3061
3230
  ),
3062
- additionalContext: z17.string().optional().describe(
3231
+ additionalContext: z18.string().optional().describe(
3063
3232
  "Additional context information like timezone, user preferences, etc."
3064
3233
  ),
3065
- uploadedFiles: z17.array(
3066
- z17.object({
3067
- name: z17.string().describe("File name"),
3068
- content: z17.string().describe(
3234
+ uploadedFiles: z18.array(
3235
+ z18.object({
3236
+ name: z18.string().describe("File name"),
3237
+ content: z18.string().describe(
3069
3238
  "File content: base64 for images, plain text for text files"
3070
3239
  ),
3071
- fileType: z17.enum(["image", "text"]).describe("Type of file: image (base64) or text (plain text)")
3240
+ fileType: z18.enum(["image", "text"]).describe("Type of file: image (base64) or text (plain text)")
3072
3241
  })
3073
3242
  ).optional().default([]).describe(
3074
3243
  "Files uploaded by the user: images as base64, text files as plain text"
3075
3244
  )
3076
3245
  });
3077
- var PearlResponseSchema = z17.object({
3078
- type: z17.enum(["code", "question", "answer", "reject"]).describe(
3246
+ var PearlResponseSchema = z18.object({
3247
+ type: z18.enum(["code", "question", "answer", "reject"]).describe(
3079
3248
  "Type of response: code (generated workflow), question (needs clarification), answer (provides information/guidance), reject (infeasible request)"
3080
3249
  ),
3081
- message: z17.string().describe(
3250
+ message: z18.string().describe(
3082
3251
  "Human-readable message: explanation for code, question text, or rejection reason"
3083
3252
  ),
3084
- snippet: z17.string().optional().describe(
3253
+ snippet: z18.string().optional().describe(
3085
3254
  'Generated TypeScript code for complete workflow (only present when type is "code")'
3086
3255
  ),
3087
- bubbleParameters: z17.record(z17.number(), ParsedBubbleWithInfoSchema).optional().describe(
3256
+ bubbleParameters: z18.record(z18.number(), ParsedBubbleWithInfoSchema).optional().describe(
3088
3257
  'Parsed bubble parameters from the generated workflow (only present when type is "code")'
3089
3258
  ),
3090
- inputSchema: z17.record(z17.unknown()).optional().describe(
3259
+ inputSchema: z18.record(z18.unknown()).optional().describe(
3091
3260
  'Input schema for the generated workflow (only present when type is "code")'
3092
3261
  ),
3093
- requiredCredentials: z17.record(z17.string(), z17.array(z17.nativeEnum(CredentialType))).optional().describe(
3262
+ requiredCredentials: z18.record(z18.string(), z18.array(z18.nativeEnum(CredentialType))).optional().describe(
3094
3263
  'Required credentials for the bubbles in the workflow (only present when type is "code")'
3095
3264
  ),
3096
- success: z17.boolean().describe("Whether the operation completed successfully"),
3097
- error: z17.string().optional().describe("Error message if the operation failed")
3265
+ success: z18.boolean().describe("Whether the operation completed successfully"),
3266
+ error: z18.string().optional().describe("Error message if the operation failed")
3098
3267
  });
3099
- var PearlAgentOutputSchema = z17.object({
3100
- type: z17.enum(["code", "question", "answer", "reject", "text"]),
3101
- message: z17.string(),
3102
- snippet: z17.string().optional()
3268
+ var PearlAgentOutputSchema = z18.object({
3269
+ type: z18.enum(["code", "question", "answer", "reject", "text"]),
3270
+ message: z18.string(),
3271
+ snippet: z18.string().optional()
3103
3272
  });
3104
3273
 
3105
3274
  // src/rice.ts
3106
- import { z as z18 } from "zod";
3275
+ import { z as z19 } from "zod";
3107
3276
 
3108
3277
  // src/bubbleflow-generation-prompts.ts
3109
3278
  var RECOMMENDED_MODELS = {
@@ -3119,34 +3288,34 @@ var RECOMMENDED_MODELS = {
3119
3288
 
3120
3289
  // src/rice.ts
3121
3290
  var RICE_DEFAULT_MODEL = RECOMMENDED_MODELS.FAST;
3122
- var RiceIssueTypeSchema = z18.enum(["setup", "workflow", "input"]).nullable();
3123
- var RiceEvaluationResultSchema = z18.object({
3124
- working: z18.boolean().describe(
3291
+ var RiceIssueTypeSchema = z19.enum(["setup", "workflow", "input"]).nullable();
3292
+ var RiceEvaluationResultSchema = z19.object({
3293
+ working: z19.boolean().describe(
3125
3294
  "Whether the workflow is functioning correctly (true if no errors and expected behavior)"
3126
3295
  ),
3127
3296
  issueType: RiceIssueTypeSchema.describe(
3128
3297
  'Category of issue: "setup" (config/credentials), "workflow" (code logic), "input" (bad input data), or null if working'
3129
3298
  ),
3130
- summary: z18.string().describe(
3299
+ summary: z19.string().describe(
3131
3300
  "Brief summary of the execution. If working: what happened and any external changes made. If not working: description of the issue."
3132
3301
  ),
3133
- rating: z18.number().int().min(1).max(10).describe(
3302
+ rating: z19.number().int().min(1).max(10).describe(
3134
3303
  "Quality rating 1-10: 1-3=severe issues, 4-6=partial functionality, 7-8=working with minor issues, 9-10=excellent"
3135
3304
  )
3136
3305
  });
3137
- var RiceRequestSchema = z18.object({
3138
- executionLogs: z18.array(z18.unknown()).describe("StreamingLogEvent[] from execution"),
3139
- workflowCode: z18.string().describe("The original workflow code that was executed"),
3140
- executionId: z18.number().describe("ID of the execution being evaluated"),
3141
- bubbleFlowId: z18.number().describe("ID of the BubbleFlow being evaluated"),
3306
+ var RiceRequestSchema = z19.object({
3307
+ executionLogs: z19.array(z19.unknown()).describe("StreamingLogEvent[] from execution"),
3308
+ workflowCode: z19.string().describe("The original workflow code that was executed"),
3309
+ executionId: z19.number().describe("ID of the execution being evaluated"),
3310
+ bubbleFlowId: z19.number().describe("ID of the BubbleFlow being evaluated"),
3142
3311
  model: AvailableModels.optional().default(RICE_DEFAULT_MODEL).describe("AI model to use for Rice evaluation")
3143
3312
  });
3144
- var RiceResponseSchema = z18.object({
3145
- success: z18.boolean().describe("Whether the evaluation completed successfully"),
3313
+ var RiceResponseSchema = z19.object({
3314
+ success: z19.boolean().describe("Whether the evaluation completed successfully"),
3146
3315
  evaluation: RiceEvaluationResultSchema.optional().describe(
3147
3316
  "Evaluation result (only present if success=true)"
3148
3317
  ),
3149
- error: z18.string().optional().describe("Error message if the evaluation failed")
3318
+ error: z19.string().optional().describe("Error message if the evaluation failed")
3150
3319
  });
3151
3320
 
3152
3321
  // src/cron-utils.ts
@@ -4064,130 +4233,6 @@ function buildParameterObjectLiteral(parameters, options) {
4064
4233
  }
4065
4234
  return paramsString;
4066
4235
  }
4067
-
4068
- // src/organization-schema.ts
4069
- import { z as z19 } from "@hono/zod-openapi";
4070
- var orgRoleSchema = z19.enum(["owner", "admin", "member"]).openapi("OrgRole");
4071
- var orgTypeSchema = z19.enum(["personal", "organization"]).openapi("OrgType");
4072
- var organizationSchema = z19.object({
4073
- id: z19.number().openapi({
4074
- description: "Organization ID",
4075
- example: 123
4076
- }),
4077
- name: z19.string().openapi({
4078
- description: "Organization name",
4079
- example: "My Team"
4080
- }),
4081
- slug: z19.string().openapi({
4082
- description: "Organization slug for URLs",
4083
- example: "my-team"
4084
- }),
4085
- type: orgTypeSchema,
4086
- role: orgRoleSchema.openapi({
4087
- description: "Current user's role in this organization"
4088
- }),
4089
- memberCount: z19.number().openapi({
4090
- description: "Number of members in the organization",
4091
- example: 5
4092
- }),
4093
- createdAt: z19.string().openapi({
4094
- description: "ISO timestamp when organization was created",
4095
- example: "2024-01-01T00:00:00Z"
4096
- })
4097
- }).openapi("Organization");
4098
- var organizationDetailSchema = organizationSchema.extend({
4099
- workflowCount: z19.number().openapi({
4100
- description: "Number of workflows in the organization",
4101
- example: 10
4102
- }),
4103
- updatedAt: z19.string().openapi({
4104
- description: "ISO timestamp when organization was last updated",
4105
- example: "2024-01-02T00:00:00Z"
4106
- })
4107
- }).openapi("OrganizationDetail");
4108
- var organizationMemberSchema = z19.object({
4109
- userId: z19.string().openapi({
4110
- description: "User ID",
4111
- example: "user_123"
4112
- }),
4113
- email: z19.string().openapi({
4114
- description: "User email",
4115
- example: "user@example.com"
4116
- }),
4117
- name: z19.string().nullable().openapi({
4118
- description: "User display name",
4119
- example: "John Doe"
4120
- }),
4121
- avatarUrl: z19.string().optional().openapi({
4122
- description: "User avatar URL",
4123
- example: "https://example.com/avatar.png"
4124
- }),
4125
- role: orgRoleSchema,
4126
- joinedAt: z19.string().openapi({
4127
- description: "ISO timestamp when user joined the organization",
4128
- example: "2024-01-01T00:00:00Z"
4129
- })
4130
- }).openapi("OrganizationMember");
4131
- var createOrganizationSchema = z19.object({
4132
- name: z19.string().min(1).max(100).openapi({
4133
- description: "Organization name",
4134
- example: "My Team"
4135
- }),
4136
- slug: z19.string().min(3).max(50).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").openapi({
4137
- description: "Organization slug for URLs",
4138
- example: "my-team"
4139
- })
4140
- }).openapi("CreateOrganizationRequest");
4141
- var updateOrganizationSchema = z19.object({
4142
- name: z19.string().min(1).max(100).optional().openapi({
4143
- description: "Organization name",
4144
- example: "My Team"
4145
- }),
4146
- slug: z19.string().min(3).max(50).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").optional().openapi({
4147
- description: "Organization slug for URLs",
4148
- example: "my-team"
4149
- })
4150
- }).openapi("UpdateOrganizationRequest");
4151
- var addMemberSchema = z19.object({
4152
- email: z19.string().email().openapi({
4153
- description: "Email of the user to add",
4154
- example: "user@example.com"
4155
- }),
4156
- role: z19.enum(["admin", "member"]).openapi({
4157
- description: "Role to assign to the new member",
4158
- example: "member"
4159
- })
4160
- }).openapi("AddMemberRequest");
4161
- var updateMemberRoleSchema = z19.object({
4162
- role: z19.enum(["admin", "member"]).openapi({
4163
- description: "New role for the member",
4164
- example: "admin"
4165
- })
4166
- }).openapi("UpdateMemberRoleRequest");
4167
- var listOrganizationsResponseSchema = z19.object({
4168
- organizations: z19.array(organizationSchema)
4169
- }).openapi("ListOrganizationsResponse");
4170
- var updateOrganizationResponseSchema = z19.object({
4171
- id: z19.number(),
4172
- name: z19.string(),
4173
- slug: z19.string(),
4174
- updatedAt: z19.string()
4175
- }).openapi("UpdateOrganizationResponse");
4176
- var listMembersResponseSchema = z19.object({
4177
- members: z19.array(organizationMemberSchema)
4178
- }).openapi("ListMembersResponse");
4179
- var addMemberResponseSchema = z19.object({
4180
- userId: z19.string(),
4181
- role: orgRoleSchema,
4182
- joinedAt: z19.string()
4183
- }).openapi("AddMemberResponse");
4184
- var updateMemberRoleResponseSchema = z19.object({
4185
- userId: z19.string(),
4186
- role: orgRoleSchema
4187
- }).openapi("UpdateMemberRoleResponse");
4188
- var successResponseSchema = z19.object({
4189
- success: z19.boolean()
4190
- }).openapi("SuccessResponse");
4191
4236
  export {
4192
4237
  AssistantMessageSchema,
4193
4238
  AvailableModels,
@@ -4272,6 +4317,7 @@ export {
4272
4317
  activateBubbleFlowResponseSchema,
4273
4318
  addMemberResponseSchema,
4274
4319
  addMemberSchema,
4320
+ billingOrganizationSchema,
4275
4321
  browserbaseSessionCompleteRequestSchema,
4276
4322
  browserbaseSessionCompleteResponseSchema,
4277
4323
  browserbaseSessionCreateRequestSchema,
@@ -4356,6 +4402,7 @@ export {
4356
4402
  subscriptionStatusResponseSchema,
4357
4403
  successMessageResponseSchema,
4358
4404
  successResponseSchema,
4405
+ tokenUsageSchema,
4359
4406
  transferOwnershipResponseSchema,
4360
4407
  transferOwnershipSchema,
4361
4408
  trashedFlowSchema,
@@ -4369,6 +4416,7 @@ export {
4369
4416
  updateOrganizationSchema,
4370
4417
  updatePermissionResponseSchema,
4371
4418
  updatePermissionSchema,
4419
+ usageSchema,
4372
4420
  usedCredentialSchema,
4373
4421
  validateBubbleFlowCodeResponseSchema,
4374
4422
  validateBubbleFlowCodeSchema,