@allbluecn/kernel 0.12.3 → 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-yc_A73De.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
@@ -479,13 +479,74 @@ interface ComplianceService {
479
479
  }>;
480
480
  }
481
481
  //#endregion
482
+ //#region src/pro-contract/connectors.d.ts
483
+ /** 连接器摘要(客户端可展示的最小面;OAuth metadata 细节不出此契约)。 */
484
+ interface ConnectorDescriptorSummary {
485
+ /** 厂商 id(如 'notion'),路由与账号行的 provider 键 */
486
+ id: string;
487
+ /** 展示名(如 'Notion') */
488
+ label: string;
489
+ /** 该厂商暴露的资源清单 id(T21 经 MCP 动态发现前后的静态声明) */
490
+ resourceIds: string[];
491
+ }
492
+ interface ConnectorsService {
493
+ /** 已注册连接器描述符摘要(部署内可用厂商;探针失败/未注册厂商不出现在此列表)。 */
494
+ listDescriptorSummaries(): ConnectorDescriptorSummary[];
495
+ }
496
+ //#endregion
497
+ //#region src/pro-contract/market.d.ts
498
+ /** 托管索引条目安装来源(与自建索引 schema 的 source 联合成员一致)。 */
499
+ type ManagedIndexSource = {
500
+ kind: 'registry';
501
+ spec: string;
502
+ } | {
503
+ kind: 'git';
504
+ url: string;
505
+ committish?: string;
506
+ } | {
507
+ kind: 'tgz';
508
+ url: string;
509
+ };
510
+ /** 托管索引条目(浏览器安全摘要面:展示 + 安装 spec 派生所需最小字段)。 */
511
+ interface ManagedIndexEntry {
512
+ /** 插件包名(安装产物 bundle 名提示;真实名以安装器 inspect 为准) */
513
+ name: string;
514
+ /** 语义化版本(可更新检测与已装版本对比用) */
515
+ version?: string;
516
+ summary?: string;
517
+ risk?: 'low' | 'medium' | 'high';
518
+ homepage?: string;
519
+ source: ManagedIndexSource;
520
+ }
521
+ interface MarketIndexService {
522
+ /**
523
+ * 托管索引条目全集(Pro 侧自管拉取与缓存;探针失败返回空数组 = 区块缺席语义,
524
+ * 不抛错拖垮面板)。
525
+ */
526
+ listIndexEntries(): Promise<ManagedIndexEntry[]>;
527
+ /** 托管索引展示名(面板来源徽章用,如「官方精选」)。 */
528
+ label(): string;
529
+ }
530
+ //#endregion
531
+ //#region src/pro-contract/telemetry.d.ts
532
+ interface TelemetryService {
533
+ /**
534
+ * 托管 telemetry ingest 端点(POST JSON 载荷目标)。返回 null = 托管端点
535
+ * 未配置(缺席语义:harnessTelemetryUpload 门内但环境未就绪,调用方降级
536
+ * 提示用户自配 URL,不重试不抛错拖垮设置面)。
537
+ */
538
+ ingestUrl(): string | null;
539
+ /** 托管端点展示名(设置面来源徽章用,如「AllBlue 托管」)。 */
540
+ label(): string;
541
+ }
542
+ //#endregion
482
543
  //#region src/pro-contract/module.d.ts
483
544
  type ProEdition = 'oss' | 'pro';
484
545
  /**
485
546
  * Pro 功能键单一来源(generate-assembly 的 implementedModules 生成亦消费此常量)。
486
547
  * 新增 feature 只改这里;ProFeature 联合类型由本数组派生,杜绝双维护漂移。
487
548
  */
488
- declare const PRO_FEATURES: readonly ['billing', 'hostedAi', 'sso', 'audit', 'permissions', 'license', 'versionHistory', 'automation', 'templates', 'analytics', 'globalSearch', 'compliance'];
549
+ declare const PRO_FEATURES: readonly ['billing', 'hostedAi', 'sso', 'audit', 'permissions', 'license', 'versionHistory', 'automation', 'templates', 'analytics', 'globalSearch', 'compliance', 'connectors', 'market', 'telemetry'];
489
550
  type ProFeature = (typeof PRO_FEATURES)[number];
490
551
  interface ProModule {
491
552
  readonly isAvailable: boolean;
@@ -503,6 +564,9 @@ interface ProModule {
503
564
  readonly analytics: AnalyticsService | null;
504
565
  readonly globalSearch: GlobalSearchService | null;
505
566
  readonly compliance: ComplianceService | null;
567
+ readonly connectors: ConnectorsService | null;
568
+ readonly market: MarketIndexService | null;
569
+ readonly telemetry: TelemetryService | null;
506
570
  }
507
571
  //#endregion
508
572
  //#region src/contract/modules/billing/feature-registry.d.ts
@@ -510,7 +574,7 @@ interface FeatureMeta {
510
574
  /** oss = 开源免费;paid = 付费;enterprise = 企业版专属 */
511
575
  tier: 'oss' | 'paid' | 'enterprise';
512
576
  /** 该功能依赖的 proModule 服务名;null = 开源代码自带(仅权益门控) */
513
- module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | null;
577
+ module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | 'connectors' | 'market' | 'telemetry' | null;
514
578
  }
515
579
  declare const FeatureRegistry: {
516
580
  readonly byokAi: {
@@ -599,6 +663,35 @@ declare const FeatureRegistry: {
599
663
  readonly tier: 'oss';
600
664
  readonly module: null;
601
665
  };
666
+ /** Harness 连接器(P4 任务 20:Notion/Linear/飞书/钉钉/企业微信/腾讯会议六厂商 OAuth
667
+ * 连接与资源面)。module 'connectors':六厂商描述符注册表是 Pro 商业实现
668
+ * (packages/pro connectors 模块经 pro-patches 注入 web-saas),OSS 部署注册表为空
669
+ * → FeatureUnavailableError(连接器框架契约是开源的,厂商生态缺席)。
670
+ * tier 'paid':连接器是 Pro/Enterprise 档商业价值(open-source/free 档不含)。 */
671
+ readonly harnessConnectors: {
672
+ readonly tier: 'paid';
673
+ readonly module: 'connectors';
674
+ };
675
+ /** Harness 插件市场 Pro 托管索引(P4 任务 24,裁决 14)。module 'market':托管索引源是
676
+ * Pro 商业实现(packages/pro market 模块经 contributes.services.market 注入 web-saas),
677
+ * OSS 部署服务缺席 → FeatureUnavailableError。**用户自建索引源不收费**——本 key 只挡
678
+ * Pro 提供的托管索引区块;用户自配 HarnessPluginMarketSource 零门控(市场面板基础面
679
+ * 全开源)。tier 'paid':托管索引是 Pro/Enterprise 档商业价值。 */
680
+ readonly harnessMarketPrivateIndex: {
681
+ readonly tier: 'paid';
682
+ readonly module: 'market';
683
+ };
684
+ /** Harness telemetry 托管上传端点(P4 任务 25,裁决 14:新建 key,命名沿用
685
+ * harness<Capability> 既有风格)。module 'telemetry':托管 ingest 端点是 Pro 商业
686
+ * 实现(packages/pro telemetry 模块经 contributes.services.telemetry 注入),
687
+ * OSS 部署服务缺席 → FeatureUnavailableError。**用户自配上传 URL 不收费**——本 key
688
+ * 只挡 Pro 托管端点(HARNESS_TELEMETRY_ENDPOINT 语义的 service 形态);匿名计数与
689
+ * opt-in 日志上传本身全开源(HARNESS_TELEMETRY env 主闸默认关闭)。tier 'paid':
690
+ * 托管遥测接收面是 Pro/Enterprise 档商业价值。 */
691
+ readonly harnessTelemetryUpload: {
692
+ readonly tier: 'paid';
693
+ readonly module: 'telemetry';
694
+ };
602
695
  };
603
696
  type FeatureKey = keyof typeof FeatureRegistry;
604
697
  declare const FEATURE_KEYS: FeatureKey[];
@@ -1170,6 +1263,28 @@ interface RealtimeTransport {
1170
1263
  type AvatarPart = "face" | "eyes" | "eyebrows" | "mouth" | "nose" | "glasses" | "hair" | "accessories" | "details" | "beard";
1171
1264
  type AvatarConfig = Record<AvatarPart, number>;
1172
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;
1173
1288
  //#endregion
1174
1289
  //#region src/contract/modules/billing/plan-features-schema.d.ts
1175
1290
  declare const PlanFeaturesSchema: z.ZodRecord<z.ZodEnum<{
@@ -1182,6 +1297,9 @@ declare const PlanFeaturesSchema: z.ZodRecord<z.ZodEnum<{
1182
1297
  compliance: "compliance";
1183
1298
  customAgents: "customAgents";
1184
1299
  globalSearch: "globalSearch";
1300
+ harnessConnectors: "harnessConnectors";
1301
+ harnessMarketPrivateIndex: "harnessMarketPrivateIndex";
1302
+ harnessTelemetryUpload: "harnessTelemetryUpload";
1185
1303
  hostedAi: "hostedAi";
1186
1304
  largePageSize: "largePageSize";
1187
1305
  mediaGeneration: "mediaGeneration";
@@ -1509,4 +1627,4 @@ declare const ICON_MAP: Record<string, ComponentType<{
1509
1627
  className?: string;
1510
1628
  }>>;
1511
1629
  //#endregion
1512
- 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 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 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 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-yc_A73De.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 };
@@ -184,7 +184,10 @@ const PRO_FEATURES = [
184
184
  "templates",
185
185
  "analytics",
186
186
  "globalSearch",
187
- "compliance"
187
+ "compliance",
188
+ "connectors",
189
+ "market",
190
+ "telemetry"
188
191
  ];
189
192
  //#endregion
190
193
  //#region src/generate-assembly.ts
@@ -2584,6 +2587,98 @@ function formatParsedUA(parsed) {
2584
2587
  ].filter((s) => s && s !== "Unknown").join(" / ");
2585
2588
  }
2586
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
2587
2682
  //#region src/contract/modules/billing/feature-registry.ts
2588
2683
  const FeatureRegistry = {
2589
2684
  byokAi: {
@@ -2671,6 +2766,35 @@ const FeatureRegistry = {
2671
2766
  testGeneration: {
2672
2767
  tier: "oss",
2673
2768
  module: null
2769
+ },
2770
+ /** Harness 连接器(P4 任务 20:Notion/Linear/飞书/钉钉/企业微信/腾讯会议六厂商 OAuth
2771
+ * 连接与资源面)。module 'connectors':六厂商描述符注册表是 Pro 商业实现
2772
+ * (packages/pro connectors 模块经 pro-patches 注入 web-saas),OSS 部署注册表为空
2773
+ * → FeatureUnavailableError(连接器框架契约是开源的,厂商生态缺席)。
2774
+ * tier 'paid':连接器是 Pro/Enterprise 档商业价值(open-source/free 档不含)。 */
2775
+ harnessConnectors: {
2776
+ tier: "paid",
2777
+ module: "connectors"
2778
+ },
2779
+ /** Harness 插件市场 Pro 托管索引(P4 任务 24,裁决 14)。module 'market':托管索引源是
2780
+ * Pro 商业实现(packages/pro market 模块经 contributes.services.market 注入 web-saas),
2781
+ * OSS 部署服务缺席 → FeatureUnavailableError。**用户自建索引源不收费**——本 key 只挡
2782
+ * Pro 提供的托管索引区块;用户自配 HarnessPluginMarketSource 零门控(市场面板基础面
2783
+ * 全开源)。tier 'paid':托管索引是 Pro/Enterprise 档商业价值。 */
2784
+ harnessMarketPrivateIndex: {
2785
+ tier: "paid",
2786
+ module: "market"
2787
+ },
2788
+ /** Harness telemetry 托管上传端点(P4 任务 25,裁决 14:新建 key,命名沿用
2789
+ * harness<Capability> 既有风格)。module 'telemetry':托管 ingest 端点是 Pro 商业
2790
+ * 实现(packages/pro telemetry 模块经 contributes.services.telemetry 注入),
2791
+ * OSS 部署服务缺席 → FeatureUnavailableError。**用户自配上传 URL 不收费**——本 key
2792
+ * 只挡 Pro 托管端点(HARNESS_TELEMETRY_ENDPOINT 语义的 service 形态);匿名计数与
2793
+ * opt-in 日志上传本身全开源(HARNESS_TELEMETRY env 主闸默认关闭)。tier 'paid':
2794
+ * 托管遥测接收面是 Pro/Enterprise 档商业价值。 */
2795
+ harnessTelemetryUpload: {
2796
+ tier: "paid",
2797
+ module: "telemetry"
2674
2798
  }
2675
2799
  };
2676
2800
  const FEATURE_KEYS = Object.keys(FeatureRegistry);
@@ -2946,4 +3070,4 @@ const ICON_MAP = {
2946
3070
  music4: Music4
2947
3071
  };
2948
3072
  //#endregion
2949
- 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.3",
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",