@allbluecn/kernel 0.12.4 → 0.12.5

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/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as dumpModules, et as generateAssemblyCode, it as parseProfileImports, ot as resolvePluginOrder, rt as extractPluginLocalNames, tt as generateAssemblyFiles } from "./src-DyETlluZ.js";
2
+ import { ct as generateAssemblyFiles, dt as parseProfileImports, ot as dumpModules, pt as resolvePluginOrder, st as generateAssemblyCode, ut as extractPluginLocalNames } from "./src-BZ-bpKXv.js";
3
3
  import { parseArgs } from "node:util";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { dirname, relative, resolve } from "node:path";
package/dist/index.d.ts CHANGED
@@ -1263,6 +1263,28 @@ interface RealtimeTransport {
1263
1263
  type AvatarPart = "face" | "eyes" | "eyebrows" | "mouth" | "nose" | "glasses" | "hair" | "accessories" | "details" | "beard";
1264
1264
  type AvatarConfig = Record<AvatarPart, number>;
1265
1265
  type ShapeType = "circle" | "rounded" | "square";
1266
+ /**
1267
+ * 各部件索引上限(含):与 `public/avatar/preview/<part>/` 的文件数一一对应(数量 - 1)。
1268
+ * 超上限的索引在渲染时会被跳过(少画一层),不会裂图。
1269
+ */
1270
+ declare const AVATAR_PART_MAX: Record<AvatarPart, number>;
1271
+ /** 图层顺序(自下而上):脸 → 五官 → 遮挡物 → 装饰。服务端拼装与编辑器预览必须同序。 */
1272
+ declare const AVATAR_PART_ORDER: readonly AvatarPart[];
1273
+ /** 这些图层 index=0 表示「不戴」,渲染时整段跳过(不产出空 <g>)。 */
1274
+ declare const AVATAR_NONE_PARTS: readonly AvatarPart[];
1275
+ /** 全 0 配置(DB 列默认值同形;hasAvatarConfig 视其为「未配置」) */
1276
+ declare const DEFAULT_AVATAR_CONFIG: AvatarConfig;
1277
+ /** 预设底色(注册、OAuth 首登、admin 建号、会话回填共用) */
1278
+ declare const AVATAR_PRESET_BG_COLORS: readonly string[];
1279
+ /**
1280
+ * 随机头像配置:注册后自动生成,保证「新账号一定有头像」这一产品口径。
1281
+ * 每个部件在 [0, AVATAR_PART_MAX[part]] 内均匀取值。
1282
+ */
1283
+ declare function getRandomAvatarConfig(): AvatarConfig;
1284
+ /**
1285
+ * 按种子(用户名/邮箱)取预设底色:同一用户恒定同色,避免每次回填换底色。
1286
+ */
1287
+ declare function pickAvatarBgColor(seed: string): string;
1266
1288
  //#endregion
1267
1289
  //#region src/contract/modules/billing/plan-features-schema.d.ts
1268
1290
  declare const PlanFeaturesSchema: z.ZodRecord<z.ZodEnum<{
@@ -1605,4 +1627,4 @@ declare const ICON_MAP: Record<string, ComponentType<{
1605
1627
  className?: string;
1606
1628
  }>>;
1607
1629
  //#endregion
1608
- export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, type AICommandContext, type AICommandDef, type AICommandHandler, type AICommandResult, AI_SOURCE_MODES, type ActivationResult, AdapterKind, type AiAdapter, AiModelMeta, AiProviderMeta, AiProviderRow, type AiQuota, AiSourceMode, type AllBlueModule, type AnalyticsQuery, type AnalyticsResult, type AnalyticsService, type AssembleInput, type AssemblyFiles, type AuditLogEntry, type AuditQuery, type AuditService, type AutomationRule, type AutomationService, type AvatarConfig, type AvatarPart, type BillingService, BillingUnavailableError, type CLIAgentInfo, type CanvasElement, CategoryEmailFlags, CategoryFrequencies, type CheckoutParams, type ComplianceJobSummary, type ComplianceService, type ComponentCategory, type ComponentSource, type ConnectorDescriptorSummary, type ConnectorsService, type CustomDashboard, DEFAULT_CATEGORIES, DEFAULT_EMAIL_CATEGORIES, DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, DEVICE_SIZES, DND_STICKY_THRESHOLD, DependencyCategory, DependencyPriority, DependencySeed, DependencyUsage, type Design, type DesignDetail, type DesignVersionFull, type DesignVersionWithPages, type DesignVersionWithSemver, type DeveloperLogEntry, type DeviceType, type DocumentTemplate, type DocumentVersion, type EditableFieldType, type EditablePropField, type EntityDef, type EntityUpdateEvent, FEATURE_KEYS, type FeatureContribution, type FeatureKey, type FeatureMeta, FeatureRegistry, type SearchResult as GlobalSearchResult, type GlobalSearchService, type HarnessContribution, type HostSession, type HostedAiChatParams, type HostedAiChatResult, HostedAiError, type HostedAiModel, type HostedAiService, type HostedProviderAccess, ICON_MAP, type InvoiceInfo, LOAD_MORE_STEP, LOBE_ICON_MAP, type LicenseInfo, type LicenseIssueParams, type LicenseIssueResult, type LicenseService, type LicenseStatus, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, type ManagedIndexEntry, type ManagedIndexSource, type MarketIndexService, type Middleware, ModelCapability, ModelTab, NOTIFICATION_CATEGORIES, NOTIFICATION_FREQUENCIES, NotificationCategory, NotificationFrequency, NotificationItem, NotificationListResult, NotificationPreferences, NotificationSsePayload, NotificationSseValue, OSS_BASE_FEATURES, type OutlineNode, PROMPT_DEFINITIONS, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, PRO_FEATURES, type ParsedUA, type PermissionLevel, type PermissionsService, type PlanFeatures, PlanFeaturesSchema, type PlanInfo, type PluginContributions, type PluginDefinition, type PluginRouteContext, type PortalSessionParams, type PrismaContribution, type PrismaSeam, type ProEdition, type ProFeature, type ProModule, type ProServiceMap, type ProfileDefinition, PromptDefinition, PromptSection, PromptVariableDef, PromptVariableDefDTO, type PrototypeComponentConfig, ProviderCategory, type QueryFactoryMap, RESOURCE_KEYS, type RealtimeTransport, type RefDisplay, type Reference, type ReferenceDisplayFn, type ResizeDirection, type ResizeMode, type ResolveResult, type ResolvedRef, type ResourceKey, type ResourceMeta, ResourceRegistry, type ResourceSnapshot, type ResourceSnapshots, type RoleDefinition, type RouteContribution, SEED_AI_PROVIDERS, type SearchParams, type SearchResult$1 as SearchResult, type SeatCheckResult, type SeatUpdateParams, SeatsExceededError, type ServerSeam, type SettingsTabContribution, type ShapeType, type SsoProvider, type SsoService, type SubscriptionInfo, SyncDependencyResult, SystemPromptSectionDTO, SystemPromptTemplateDTO, SystemPromptVersionDTO, TIPTAP_ACTION_INSTRUCTIONS, type TelemetryService, type TemplatesService, ThirdPartyDependencyRow, type UiSlotContributions, UnknownPromptVariableError, UnreadSnapshotPayload, UpdateDependencyInput, VIRTUALIZE_THRESHOLD, type VersionHistoryService, VersionStatus, WebhookSignatureError, definePlugin, defineProfile, dumpModules, formatParsedUA, generateAssemblyCode, generateAssemblyFiles, getClientIp, getPromptDefinition, getServerSeam, interpolateTemplate, isInDndWindow, isOssFeature, isResourceDefined, listPromptDefinitions, moduleRegistry, normalizeCategoryFrequencies, normalizeEmailCategories, parseProfileImports, parseUserAgent, promptDefinitionKeys, registerPrismaSeam, registerServerSeam, resolveImportSpecifiers, resolveIpLocation, resolvePluginOrder };
1630
+ export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, type AICommandContext, type AICommandDef, type AICommandHandler, type AICommandResult, AI_SOURCE_MODES, AVATAR_NONE_PARTS, AVATAR_PART_MAX, AVATAR_PART_ORDER, AVATAR_PRESET_BG_COLORS, type ActivationResult, AdapterKind, type AiAdapter, AiModelMeta, AiProviderMeta, AiProviderRow, type AiQuota, AiSourceMode, type AllBlueModule, type AnalyticsQuery, type AnalyticsResult, type AnalyticsService, type AssembleInput, type AssemblyFiles, type AuditLogEntry, type AuditQuery, type AuditService, type AutomationRule, type AutomationService, type AvatarConfig, type AvatarPart, type BillingService, BillingUnavailableError, type CLIAgentInfo, type CanvasElement, CategoryEmailFlags, CategoryFrequencies, type CheckoutParams, type ComplianceJobSummary, type ComplianceService, type ComponentCategory, type ComponentSource, type ConnectorDescriptorSummary, type ConnectorsService, type CustomDashboard, DEFAULT_AVATAR_CONFIG, DEFAULT_CATEGORIES, DEFAULT_EMAIL_CATEGORIES, DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, DEVICE_SIZES, DND_STICKY_THRESHOLD, DependencyCategory, DependencyPriority, DependencySeed, DependencyUsage, type Design, type DesignDetail, type DesignVersionFull, type DesignVersionWithPages, type DesignVersionWithSemver, type DeveloperLogEntry, type DeviceType, type DocumentTemplate, type DocumentVersion, type EditableFieldType, type EditablePropField, type EntityDef, type EntityUpdateEvent, FEATURE_KEYS, type FeatureContribution, type FeatureKey, type FeatureMeta, FeatureRegistry, type SearchResult as GlobalSearchResult, type GlobalSearchService, type HarnessContribution, type HostSession, type HostedAiChatParams, type HostedAiChatResult, HostedAiError, type HostedAiModel, type HostedAiService, type HostedProviderAccess, ICON_MAP, type InvoiceInfo, LOAD_MORE_STEP, LOBE_ICON_MAP, type LicenseInfo, type LicenseIssueParams, type LicenseIssueResult, type LicenseService, type LicenseStatus, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, type ManagedIndexEntry, type ManagedIndexSource, type MarketIndexService, type Middleware, ModelCapability, ModelTab, NOTIFICATION_CATEGORIES, NOTIFICATION_FREQUENCIES, NotificationCategory, NotificationFrequency, NotificationItem, NotificationListResult, NotificationPreferences, NotificationSsePayload, NotificationSseValue, OSS_BASE_FEATURES, type OutlineNode, PROMPT_DEFINITIONS, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, PRO_FEATURES, type ParsedUA, type PermissionLevel, type PermissionsService, type PlanFeatures, PlanFeaturesSchema, type PlanInfo, type PluginContributions, type PluginDefinition, type PluginRouteContext, type PortalSessionParams, type PrismaContribution, type PrismaSeam, type ProEdition, type ProFeature, type ProModule, type ProServiceMap, type ProfileDefinition, PromptDefinition, PromptSection, PromptVariableDef, PromptVariableDefDTO, type PrototypeComponentConfig, ProviderCategory, type QueryFactoryMap, RESOURCE_KEYS, type RealtimeTransport, type RefDisplay, type Reference, type ReferenceDisplayFn, type ResizeDirection, type ResizeMode, type ResolveResult, type ResolvedRef, type ResourceKey, type ResourceMeta, ResourceRegistry, type ResourceSnapshot, type ResourceSnapshots, type RoleDefinition, type RouteContribution, SEED_AI_PROVIDERS, type SearchParams, type SearchResult$1 as SearchResult, type SeatCheckResult, type SeatUpdateParams, SeatsExceededError, type ServerSeam, type SettingsTabContribution, type ShapeType, type SsoProvider, type SsoService, type SubscriptionInfo, SyncDependencyResult, SystemPromptSectionDTO, SystemPromptTemplateDTO, SystemPromptVersionDTO, TIPTAP_ACTION_INSTRUCTIONS, type TelemetryService, type TemplatesService, ThirdPartyDependencyRow, type UiSlotContributions, UnknownPromptVariableError, UnreadSnapshotPayload, UpdateDependencyInput, VIRTUALIZE_THRESHOLD, type VersionHistoryService, VersionStatus, WebhookSignatureError, definePlugin, defineProfile, dumpModules, formatParsedUA, generateAssemblyCode, generateAssemblyFiles, getClientIp, getPromptDefinition, getRandomAvatarConfig, getServerSeam, interpolateTemplate, isInDndWindow, isOssFeature, isResourceDefined, listPromptDefinitions, moduleRegistry, normalizeCategoryFrequencies, normalizeEmailCategories, parseProfileImports, parseUserAgent, pickAvatarBgColor, promptDefinitionKeys, registerPrismaSeam, registerServerSeam, resolveImportSpecifiers, resolveIpLocation, resolvePluginOrder };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as dumpModules, A as promptDefinitionKeys, B as PROVIDER_CATEGORY_VALUES, C as DEFAULT_WATCHED_DEPENDENCIES, D as TIPTAP_ACTION_INSTRUCTIONS, E as PROMPT_DEFINITIONS, F as ADAPTER_KIND_VALUES, G as VIRTUALIZE_THRESHOLD, H as PROVIDER_BADGE_STYLES, I as LOBE_ICON_MAP, J as registerServerSeam, K as getServerSeam, L as MODEL_CAPABILITY_OPTIONS, M as interpolateTemplate, N as SEED_AI_PROVIDERS, O as getPromptDefinition, P as ADAPTER_KINDS, Q as WebhookSignatureError, R as MODEL_TABS, S as resolveIpLocation, T as DEPENDENCY_PRIORITIES, U as DND_STICKY_THRESHOLD, V as AI_SOURCE_MODES, W as LOAD_MORE_STEP, X as BillingUnavailableError, Y as HostedAiError, Z as SeatsExceededError, _ as OSS_BASE_FEATURES, a as DEFAULT_EMAIL_CATEGORIES, at as resolveImportSpecifiers, b as parseUserAgent, c as normalizeEmailCategories, ct as definePlugin, d as RESOURCE_KEYS, et as generateAssemblyCode, f as ResourceRegistry, g as FeatureRegistry, h as FEATURE_KEYS, i as DEFAULT_CATEGORIES, it as parseProfileImports, j as UnknownPromptVariableError, k as listPromptDefinitions, l as NOTIFICATION_CATEGORIES, m as PlanFeaturesSchema, n as DEVICE_SIZES, nt as PRO_FEATURES, o as isInDndWindow, ot as resolvePluginOrder, p as isResourceDefined, q as registerPrismaSeam, r as moduleRegistry, s as normalizeCategoryFrequencies, st as defineProfile, t as ICON_MAP, tt as generateAssemblyFiles, u as NOTIFICATION_FREQUENCIES, v as isOssFeature, w as DEPENDENCY_CATEGORIES, x as getClientIp, y as formatParsedUA, z as PROVIDER_CATEGORIES } from "./src-DyETlluZ.js";
2
- export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, AI_SOURCE_MODES, BillingUnavailableError, DEFAULT_CATEGORIES, DEFAULT_EMAIL_CATEGORIES, DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, DEVICE_SIZES, DND_STICKY_THRESHOLD, FEATURE_KEYS, FeatureRegistry, HostedAiError, ICON_MAP, LOAD_MORE_STEP, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, NOTIFICATION_CATEGORIES, NOTIFICATION_FREQUENCIES, OSS_BASE_FEATURES, PROMPT_DEFINITIONS, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, PRO_FEATURES, PlanFeaturesSchema, RESOURCE_KEYS, ResourceRegistry, SEED_AI_PROVIDERS, SeatsExceededError, TIPTAP_ACTION_INSTRUCTIONS, UnknownPromptVariableError, VIRTUALIZE_THRESHOLD, WebhookSignatureError, definePlugin, defineProfile, dumpModules, formatParsedUA, generateAssemblyCode, generateAssemblyFiles, getClientIp, getPromptDefinition, getServerSeam, interpolateTemplate, isInDndWindow, isOssFeature, isResourceDefined, listPromptDefinitions, moduleRegistry, normalizeCategoryFrequencies, normalizeEmailCategories, parseProfileImports, parseUserAgent, promptDefinitionKeys, registerPrismaSeam, registerServerSeam, resolveImportSpecifiers, resolveIpLocation, resolvePluginOrder };
1
+ import { $ as getServerSeam, A as DEFAULT_WATCHED_DEPENDENCIES, B as SEED_AI_PROVIDERS, C as DEFAULT_AVATAR_CONFIG, D as parseUserAgent, E as formatParsedUA, F as getPromptDefinition, G as MODEL_TABS, H as ADAPTER_KIND_VALUES, I as listPromptDefinitions, J as AI_SOURCE_MODES, K as PROVIDER_CATEGORIES, L as promptDefinitionKeys, M as DEPENDENCY_PRIORITIES, N as PROMPT_DEFINITIONS, O as getClientIp, P as TIPTAP_ACTION_INSTRUCTIONS, Q as VIRTUALIZE_THRESHOLD, R as UnknownPromptVariableError, S as AVATAR_PRESET_BG_COLORS, T as pickAvatarBgColor, U as LOBE_ICON_MAP, V as ADAPTER_KINDS, W as MODEL_CAPABILITY_OPTIONS, X as DND_STICKY_THRESHOLD, Y as PROVIDER_BADGE_STYLES, Z as LOAD_MORE_STEP, _ as OSS_BASE_FEATURES, a as DEFAULT_EMAIL_CATEGORIES, at as WebhookSignatureError, b as AVATAR_PART_MAX, c as normalizeEmailCategories, ct as generateAssemblyFiles, d as RESOURCE_KEYS, dt as parseProfileImports, et as registerPrismaSeam, f as ResourceRegistry, ft as resolveImportSpecifiers, g as FeatureRegistry, h as FEATURE_KEYS, ht as definePlugin, i as DEFAULT_CATEGORIES, it as SeatsExceededError, j as DEPENDENCY_CATEGORIES, k as resolveIpLocation, l as NOTIFICATION_CATEGORIES, lt as PRO_FEATURES, m as PlanFeaturesSchema, mt as defineProfile, n as DEVICE_SIZES, nt as HostedAiError, o as isInDndWindow, ot as dumpModules, p as isResourceDefined, pt as resolvePluginOrder, q as PROVIDER_CATEGORY_VALUES, r as moduleRegistry, rt as BillingUnavailableError, s as normalizeCategoryFrequencies, st as generateAssemblyCode, t as ICON_MAP, tt as registerServerSeam, u as NOTIFICATION_FREQUENCIES, v as isOssFeature, w as getRandomAvatarConfig, x as AVATAR_PART_ORDER, y as AVATAR_NONE_PARTS, z as interpolateTemplate } from "./src-BZ-bpKXv.js";
2
+ export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, AI_SOURCE_MODES, AVATAR_NONE_PARTS, AVATAR_PART_MAX, AVATAR_PART_ORDER, AVATAR_PRESET_BG_COLORS, BillingUnavailableError, DEFAULT_AVATAR_CONFIG, DEFAULT_CATEGORIES, DEFAULT_EMAIL_CATEGORIES, DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, DEVICE_SIZES, DND_STICKY_THRESHOLD, FEATURE_KEYS, FeatureRegistry, HostedAiError, ICON_MAP, LOAD_MORE_STEP, LOBE_ICON_MAP, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, NOTIFICATION_CATEGORIES, NOTIFICATION_FREQUENCIES, OSS_BASE_FEATURES, PROMPT_DEFINITIONS, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, PRO_FEATURES, PlanFeaturesSchema, RESOURCE_KEYS, ResourceRegistry, SEED_AI_PROVIDERS, SeatsExceededError, TIPTAP_ACTION_INSTRUCTIONS, UnknownPromptVariableError, VIRTUALIZE_THRESHOLD, WebhookSignatureError, definePlugin, defineProfile, dumpModules, formatParsedUA, generateAssemblyCode, generateAssemblyFiles, getClientIp, getPromptDefinition, getRandomAvatarConfig, getServerSeam, interpolateTemplate, isInDndWindow, isOssFeature, isResourceDefined, listPromptDefinitions, moduleRegistry, normalizeCategoryFrequencies, normalizeEmailCategories, parseProfileImports, parseUserAgent, pickAvatarBgColor, promptDefinitionKeys, registerPrismaSeam, registerServerSeam, resolveImportSpecifiers, resolveIpLocation, resolvePluginOrder };
@@ -2587,6 +2587,98 @@ function formatParsedUA(parsed) {
2587
2587
  ].filter((s) => s && s !== "Unknown").join(" / ");
2588
2588
  }
2589
2589
  //#endregion
2590
+ //#region src/contract/interfaces/avatar.ts
2591
+ /**
2592
+ * 各部件索引上限(含):与 `public/avatar/preview/<part>/` 的文件数一一对应(数量 - 1)。
2593
+ * 超上限的索引在渲染时会被跳过(少画一层),不会裂图。
2594
+ */
2595
+ const AVATAR_PART_MAX = {
2596
+ face: 15,
2597
+ eyes: 13,
2598
+ eyebrows: 15,
2599
+ mouth: 19,
2600
+ nose: 13,
2601
+ glasses: 14,
2602
+ hair: 58,
2603
+ accessories: 14,
2604
+ details: 13,
2605
+ beard: 16
2606
+ };
2607
+ /** 图层顺序(自下而上):脸 → 五官 → 遮挡物 → 装饰。服务端拼装与编辑器预览必须同序。 */
2608
+ const AVATAR_PART_ORDER = [
2609
+ "face",
2610
+ "nose",
2611
+ "mouth",
2612
+ "eyes",
2613
+ "eyebrows",
2614
+ "glasses",
2615
+ "hair",
2616
+ "accessories",
2617
+ "details",
2618
+ "beard"
2619
+ ];
2620
+ /** 这些图层 index=0 表示「不戴」,渲染时整段跳过(不产出空 <g>)。 */
2621
+ const AVATAR_NONE_PARTS = [
2622
+ "glasses",
2623
+ "hair",
2624
+ "accessories",
2625
+ "details",
2626
+ "beard"
2627
+ ];
2628
+ /** 全 0 配置(DB 列默认值同形;hasAvatarConfig 视其为「未配置」) */
2629
+ const DEFAULT_AVATAR_CONFIG = {
2630
+ face: 0,
2631
+ eyes: 0,
2632
+ eyebrows: 0,
2633
+ mouth: 0,
2634
+ nose: 0,
2635
+ glasses: 0,
2636
+ hair: 0,
2637
+ accessories: 0,
2638
+ details: 0,
2639
+ beard: 0
2640
+ };
2641
+ /** 预设底色(注册、OAuth 首登、admin 建号、会话回填共用) */
2642
+ const AVATAR_PRESET_BG_COLORS = [
2643
+ "#fff",
2644
+ "#fa541c",
2645
+ "#faad14",
2646
+ "#fadb14",
2647
+ "#a0d911",
2648
+ "#52c41a",
2649
+ "#1890ff",
2650
+ "#2f54eb",
2651
+ "#722ed1",
2652
+ "#eb2f96",
2653
+ "#bfbfbf",
2654
+ "#f0d5c0",
2655
+ "#debaba",
2656
+ "#babae1",
2657
+ "#e1bae1",
2658
+ "#bae1e1",
2659
+ "#c0d5f0",
2660
+ "#d5f0c0",
2661
+ "#e0e0e0",
2662
+ "#f5c6c6"
2663
+ ];
2664
+ /**
2665
+ * 随机头像配置:注册后自动生成,保证「新账号一定有头像」这一产品口径。
2666
+ * 每个部件在 [0, AVATAR_PART_MAX[part]] 内均匀取值。
2667
+ */
2668
+ function getRandomAvatarConfig() {
2669
+ const config = {};
2670
+ for (const part of Object.keys(AVATAR_PART_MAX)) config[part] = Math.floor(Math.random() * (AVATAR_PART_MAX[part] + 1));
2671
+ return config;
2672
+ }
2673
+ /**
2674
+ * 按种子(用户名/邮箱)取预设底色:同一用户恒定同色,避免每次回填换底色。
2675
+ */
2676
+ function pickAvatarBgColor(seed) {
2677
+ let hash = 0;
2678
+ for (let i = 0; i < seed.length; i++) hash = seed.charCodeAt(i) + ((hash << 5) - hash);
2679
+ return AVATAR_PRESET_BG_COLORS[Math.abs(hash) % AVATAR_PRESET_BG_COLORS.length];
2680
+ }
2681
+ //#endregion
2590
2682
  //#region src/contract/modules/billing/feature-registry.ts
2591
2683
  const FeatureRegistry = {
2592
2684
  byokAi: {
@@ -2978,4 +3070,4 @@ const ICON_MAP = {
2978
3070
  music4: Music4
2979
3071
  };
2980
3072
  //#endregion
2981
- export { dumpModules as $, promptDefinitionKeys as A, PROVIDER_CATEGORY_VALUES as B, DEFAULT_WATCHED_DEPENDENCIES as C, TIPTAP_ACTION_INSTRUCTIONS as D, PROMPT_DEFINITIONS as E, ADAPTER_KIND_VALUES as F, VIRTUALIZE_THRESHOLD as G, PROVIDER_BADGE_STYLES as H, LOBE_ICON_MAP as I, registerServerSeam as J, getServerSeam as K, MODEL_CAPABILITY_OPTIONS as L, interpolateTemplate as M, SEED_AI_PROVIDERS as N, getPromptDefinition as O, ADAPTER_KINDS as P, WebhookSignatureError as Q, MODEL_TABS as R, resolveIpLocation as S, DEPENDENCY_PRIORITIES as T, DND_STICKY_THRESHOLD as U, AI_SOURCE_MODES as V, LOAD_MORE_STEP as W, BillingUnavailableError as X, HostedAiError as Y, SeatsExceededError as Z, OSS_BASE_FEATURES as _, DEFAULT_EMAIL_CATEGORIES as a, resolveImportSpecifiers as at, parseUserAgent as b, normalizeEmailCategories as c, definePlugin as ct, RESOURCE_KEYS as d, generateAssemblyCode as et, ResourceRegistry as f, FeatureRegistry as g, FEATURE_KEYS as h, DEFAULT_CATEGORIES as i, parseProfileImports as it, UnknownPromptVariableError as j, listPromptDefinitions as k, NOTIFICATION_CATEGORIES as l, PlanFeaturesSchema as m, DEVICE_SIZES as n, PRO_FEATURES as nt, isInDndWindow as o, resolvePluginOrder as ot, isResourceDefined as p, registerPrismaSeam as q, moduleRegistry as r, extractPluginLocalNames as rt, normalizeCategoryFrequencies as s, defineProfile as st, ICON_MAP as t, generateAssemblyFiles as tt, NOTIFICATION_FREQUENCIES as u, isOssFeature as v, DEPENDENCY_CATEGORIES as w, getClientIp as x, formatParsedUA as y, PROVIDER_CATEGORIES as z };
3073
+ export { getServerSeam as $, DEFAULT_WATCHED_DEPENDENCIES as A, SEED_AI_PROVIDERS as B, DEFAULT_AVATAR_CONFIG as C, parseUserAgent as D, formatParsedUA as E, getPromptDefinition as F, MODEL_TABS as G, ADAPTER_KIND_VALUES as H, listPromptDefinitions as I, AI_SOURCE_MODES as J, PROVIDER_CATEGORIES as K, promptDefinitionKeys as L, DEPENDENCY_PRIORITIES as M, PROMPT_DEFINITIONS as N, getClientIp as O, TIPTAP_ACTION_INSTRUCTIONS as P, VIRTUALIZE_THRESHOLD as Q, UnknownPromptVariableError as R, AVATAR_PRESET_BG_COLORS as S, pickAvatarBgColor as T, LOBE_ICON_MAP as U, ADAPTER_KINDS as V, MODEL_CAPABILITY_OPTIONS as W, DND_STICKY_THRESHOLD as X, PROVIDER_BADGE_STYLES as Y, LOAD_MORE_STEP as Z, OSS_BASE_FEATURES as _, DEFAULT_EMAIL_CATEGORIES as a, WebhookSignatureError as at, AVATAR_PART_MAX as b, normalizeEmailCategories as c, generateAssemblyFiles as ct, RESOURCE_KEYS as d, parseProfileImports as dt, registerPrismaSeam as et, ResourceRegistry as f, resolveImportSpecifiers as ft, FeatureRegistry as g, FEATURE_KEYS as h, definePlugin as ht, DEFAULT_CATEGORIES as i, SeatsExceededError as it, DEPENDENCY_CATEGORIES as j, resolveIpLocation as k, NOTIFICATION_CATEGORIES as l, PRO_FEATURES as lt, PlanFeaturesSchema as m, defineProfile as mt, DEVICE_SIZES as n, HostedAiError as nt, isInDndWindow as o, dumpModules as ot, isResourceDefined as p, resolvePluginOrder as pt, PROVIDER_CATEGORY_VALUES as q, moduleRegistry as r, BillingUnavailableError as rt, normalizeCategoryFrequencies as s, generateAssemblyCode as st, ICON_MAP as t, registerServerSeam as tt, NOTIFICATION_FREQUENCIES as u, extractPluginLocalNames as ut, isOssFeature as v, getRandomAvatarConfig as w, AVATAR_PART_ORDER as x, AVATAR_NONE_PARTS as y, interpolateTemplate as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbluecn/kernel",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "description": "AllBlue 插件协议:类型定义 + 构建期装配器(零运行时)",
@@ -67,6 +67,7 @@
67
67
  },
68
68
  "scripts": {
69
69
  "build": "tsdown",
70
+ "dev": "tsdown --watch",
70
71
  "lint": "tsc --noEmit",
71
72
  "test": "vitest",
72
73
  "test:run": "vitest run",