@allbluecn/kernel 0.12.1 → 0.12.3

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-JIal4BUB.js";
2
+ import { $ as dumpModules, et as generateAssemblyCode, it as parseProfileImports, ot as resolvePluginOrder, rt as extractPluginLocalNames, tt as generateAssemblyFiles } from "./src-yc_A73De.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
@@ -165,11 +165,22 @@ interface HostedAiModel {
165
165
  provider: string;
166
166
  streaming: boolean;
167
167
  }
168
+ interface HostedProviderAccess {
169
+ provider: string;
170
+ baseUrl: string;
171
+ apiKey: string;
172
+ modelIds: string[];
173
+ expiresAt: string;
174
+ }
168
175
  interface HostedAiService {
169
176
  chatStream(params: HostedAiChatParams, signal?: AbortSignal): AsyncIterable<StreamChunk>;
170
177
  chat(params: HostedAiChatParams, signal?: AbortSignal): Promise<HostedAiChatResult>;
171
178
  getQuota(workspaceId: string): Promise<AiQuota>;
172
179
  listAvailableModels(): Promise<HostedAiModel[]>;
180
+ getHarnessProvider?(args: {
181
+ userId: string;
182
+ workspaceId: string;
183
+ }): Promise<HostedProviderAccess | null>;
173
184
  }
174
185
  //#endregion
175
186
  //#region src/pro-contract/sso.d.ts
@@ -231,6 +242,7 @@ interface PermissionsService {
231
242
  updateRole(roleId: string, updates: Partial<RoleDefinition>): Promise<void>;
232
243
  deleteRole(roleId: string): Promise<void>;
233
244
  checkPermission(userId: string, resource: string, action: string): Promise<PermissionLevel>;
245
+ checkWorkspacePermission?(userId: string, workspaceId: string, resource: string, action: string): Promise<PermissionLevel>;
234
246
  }
235
247
  //#endregion
236
248
  //#region src/pro-contract/license.d.ts
@@ -493,6 +505,109 @@ interface ProModule {
493
505
  readonly compliance: ComplianceService | null;
494
506
  }
495
507
  //#endregion
508
+ //#region src/contract/modules/billing/feature-registry.d.ts
509
+ interface FeatureMeta {
510
+ /** oss = 开源免费;paid = 付费;enterprise = 企业版专属 */
511
+ tier: 'oss' | 'paid' | 'enterprise';
512
+ /** 该功能依赖的 proModule 服务名;null = 开源代码自带(仅权益门控) */
513
+ module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | null;
514
+ }
515
+ declare const FeatureRegistry: {
516
+ readonly byokAi: {
517
+ readonly tier: 'oss';
518
+ readonly module: null;
519
+ };
520
+ readonly hostedAi: {
521
+ readonly tier: 'paid';
522
+ readonly module: 'hostedAi';
523
+ };
524
+ readonly multiProvider: {
525
+ readonly tier: 'paid';
526
+ readonly module: null;
527
+ };
528
+ readonly largePageSize: {
529
+ readonly tier: 'paid';
530
+ readonly module: null;
531
+ };
532
+ readonly versionHistory: {
533
+ readonly tier: 'paid';
534
+ readonly module: 'versionHistory';
535
+ };
536
+ readonly automation: {
537
+ readonly tier: 'paid';
538
+ readonly module: 'automation';
539
+ };
540
+ readonly templates: {
541
+ readonly tier: 'paid';
542
+ readonly module: 'templates';
543
+ };
544
+ readonly globalSearch: {
545
+ readonly tier: 'paid';
546
+ readonly module: 'globalSearch';
547
+ };
548
+ readonly analytics: {
549
+ readonly tier: 'enterprise';
550
+ readonly module: 'analytics';
551
+ };
552
+ readonly sso: {
553
+ readonly tier: 'enterprise';
554
+ readonly module: 'sso';
555
+ };
556
+ readonly audit: {
557
+ readonly tier: 'enterprise';
558
+ readonly module: 'audit';
559
+ };
560
+ readonly advancedPermissions: {
561
+ readonly tier: 'enterprise';
562
+ readonly module: 'permissions';
563
+ };
564
+ readonly compliance: {
565
+ readonly tier: 'enterprise';
566
+ readonly module: 'compliance';
567
+ };
568
+ readonly customAgents: {
569
+ readonly tier: 'paid';
570
+ readonly module: null;
571
+ };
572
+ /** 沙箱执行(P3)。module 为 null:沙箱是开源代码自带的平台能力,仅权益门控。
573
+ * 2026-11-07 用户裁决下放免费(harness TanStack AI 原生化 Phase 0):tier 'oss'
574
+ * 免订阅直接放行(testGeneration 同款口径),OSS_BASE_FEATURES 同步收录供客户端
575
+ * 权益快照。desktop 部署无订阅体系,走 requireFeature 内的点式直放分支(幂等)。
576
+ * 恢复 Pro 化 = tier 回 'paid' + 移出 OSS_BASE_FEATURES + seed 限额回 0。 */
577
+ readonly sandboxExecution: {
578
+ readonly tier: 'oss';
579
+ readonly module: null;
580
+ };
581
+ /** 媒体生成(P4c)。module 为 null:媒体生成是开源代码自带的平台能力(TanStack AI adapter 调用),
582
+ * 仅权益门控。2026-11-07 用户裁决下放免费(harness Phase 0):tier 'oss' 免订阅直接放行,
583
+ * OSS_BASE_FEATURES 同步收录。desktop BYOK 场景原点式豁免分支保留(幂等)。 */
584
+ readonly mediaGeneration: {
585
+ readonly tier: 'oss';
586
+ readonly module: null;
587
+ };
588
+ /** BUG 自动 AI 修复(P4)。module 为 null:入队是开源代码自带的平台能力(webhook + MCP 工具链),
589
+ * 本期全开源不设 requireFeature 门槛——仅入注册表防 CI check-feature-keys.ts 漂移(规格 §14.5)。 */
590
+ readonly bugAutoFix: {
591
+ readonly tier: 'paid';
592
+ readonly module: null;
593
+ };
594
+ /** AI 生成测试用例(testcase 模块 P3,规格 §12)。module 为 null:生成编排是开源代码自带的
595
+ * BYOK 平台能力(runChatAsAgent 消费用户自配 Key)。2026-10-10 起下放免费:tier 'oss'
596
+ * 免订阅直接放行(byokAi 同款口径),OSS_BASE_FEATURES 同步收录供客户端权益快照。
597
+ * desktop BYOK 场景原点式豁免分支保留(幂等)。 */
598
+ readonly testGeneration: {
599
+ readonly tier: 'oss';
600
+ readonly module: null;
601
+ };
602
+ };
603
+ type FeatureKey = keyof typeof FeatureRegistry;
604
+ declare const FEATURE_KEYS: FeatureKey[];
605
+ /** OSS 部署(billing 模块缺失)的基础白名单——唯一允许「无订阅即放行」的集合。
606
+ * testGeneration 虽有 tier 'oss'(requireFeature 直放),客户端权益快照走本集合构建
607
+ * features map,故须显式收录,否则 UI 入口(useFeature)仍判 locked。 */
608
+ declare const OSS_BASE_FEATURES: readonly FeatureKey[];
609
+ declare function isOssFeature(key: FeatureKey): boolean;
610
+ //#endregion
496
611
  //#region src/contributions.d.ts
497
612
  type Middleware = unknown;
498
613
  type PluginRouteContext = {
@@ -527,6 +642,14 @@ type ProServiceMap = Partial<Record<ProFeature, unknown>>;
527
642
  interface PrismaContribution {
528
643
  models: string[];
529
644
  }
645
+ interface HarnessContribution {
646
+ id: string;
647
+ factory: string;
648
+ config: Record<string, unknown>;
649
+ requiredServices: ProFeature[];
650
+ entitlements: FeatureKey[];
651
+ deployments: Array<'saas' | 'desktop'>;
652
+ }
530
653
  interface PluginContributions {
531
654
  routes?: RouteContribution[];
532
655
  serverMiddleware?: Middleware[];
@@ -536,6 +659,7 @@ interface PluginContributions {
536
659
  aiTools?: unknown[];
537
660
  prisma?: PrismaContribution;
538
661
  services?: ProServiceMap;
662
+ harness?: HarnessContribution[];
539
663
  }
540
664
  //#endregion
541
665
  //#region src/types.d.ts
@@ -1047,109 +1171,6 @@ type AvatarPart = "face" | "eyes" | "eyebrows" | "mouth" | "nose" | "glasses" |
1047
1171
  type AvatarConfig = Record<AvatarPart, number>;
1048
1172
  type ShapeType = "circle" | "rounded" | "square";
1049
1173
  //#endregion
1050
- //#region src/contract/modules/billing/feature-registry.d.ts
1051
- interface FeatureMeta {
1052
- /** oss = 开源免费;paid = 付费;enterprise = 企业版专属 */
1053
- tier: 'oss' | 'paid' | 'enterprise';
1054
- /** 该功能依赖的 proModule 服务名;null = 开源代码自带(仅权益门控) */
1055
- module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | null;
1056
- }
1057
- declare const FeatureRegistry: {
1058
- readonly byokAi: {
1059
- readonly tier: 'oss';
1060
- readonly module: null;
1061
- };
1062
- readonly hostedAi: {
1063
- readonly tier: 'paid';
1064
- readonly module: 'hostedAi';
1065
- };
1066
- readonly multiProvider: {
1067
- readonly tier: 'paid';
1068
- readonly module: null;
1069
- };
1070
- readonly largePageSize: {
1071
- readonly tier: 'paid';
1072
- readonly module: null;
1073
- };
1074
- readonly versionHistory: {
1075
- readonly tier: 'paid';
1076
- readonly module: 'versionHistory';
1077
- };
1078
- readonly automation: {
1079
- readonly tier: 'paid';
1080
- readonly module: 'automation';
1081
- };
1082
- readonly templates: {
1083
- readonly tier: 'paid';
1084
- readonly module: 'templates';
1085
- };
1086
- readonly globalSearch: {
1087
- readonly tier: 'paid';
1088
- readonly module: 'globalSearch';
1089
- };
1090
- readonly analytics: {
1091
- readonly tier: 'enterprise';
1092
- readonly module: 'analytics';
1093
- };
1094
- readonly sso: {
1095
- readonly tier: 'enterprise';
1096
- readonly module: 'sso';
1097
- };
1098
- readonly audit: {
1099
- readonly tier: 'enterprise';
1100
- readonly module: 'audit';
1101
- };
1102
- readonly advancedPermissions: {
1103
- readonly tier: 'enterprise';
1104
- readonly module: 'permissions';
1105
- };
1106
- readonly compliance: {
1107
- readonly tier: 'enterprise';
1108
- readonly module: 'compliance';
1109
- };
1110
- readonly customAgents: {
1111
- readonly tier: 'paid';
1112
- readonly module: null;
1113
- };
1114
- /** 沙箱执行(P3)。module 为 null:沙箱是开源代码自带的平台能力,仅权益门控。
1115
- * 2026-11-07 用户裁决下放免费(harness TanStack AI 原生化 Phase 0):tier 'oss'
1116
- * 免订阅直接放行(testGeneration 同款口径),OSS_BASE_FEATURES 同步收录供客户端
1117
- * 权益快照。desktop 部署无订阅体系,走 requireFeature 内的点式直放分支(幂等)。
1118
- * 恢复 Pro 化 = tier 回 'paid' + 移出 OSS_BASE_FEATURES + seed 限额回 0。 */
1119
- readonly sandboxExecution: {
1120
- readonly tier: 'oss';
1121
- readonly module: null;
1122
- };
1123
- /** 媒体生成(P4c)。module 为 null:媒体生成是开源代码自带的平台能力(TanStack AI adapter 调用),
1124
- * 仅权益门控。2026-11-07 用户裁决下放免费(harness Phase 0):tier 'oss' 免订阅直接放行,
1125
- * OSS_BASE_FEATURES 同步收录。desktop BYOK 场景原点式豁免分支保留(幂等)。 */
1126
- readonly mediaGeneration: {
1127
- readonly tier: 'oss';
1128
- readonly module: null;
1129
- };
1130
- /** BUG 自动 AI 修复(P4)。module 为 null:入队是开源代码自带的平台能力(webhook + MCP 工具链),
1131
- * 本期全开源不设 requireFeature 门槛——仅入注册表防 CI check-feature-keys.ts 漂移(规格 §14.5)。 */
1132
- readonly bugAutoFix: {
1133
- readonly tier: 'paid';
1134
- readonly module: null;
1135
- };
1136
- /** AI 生成测试用例(testcase 模块 P3,规格 §12)。module 为 null:生成编排是开源代码自带的
1137
- * BYOK 平台能力(runChatAsAgent 消费用户自配 Key)。2026-10-10 起下放免费:tier 'oss'
1138
- * 免订阅直接放行(byokAi 同款口径),OSS_BASE_FEATURES 同步收录供客户端权益快照。
1139
- * desktop BYOK 场景原点式豁免分支保留(幂等)。 */
1140
- readonly testGeneration: {
1141
- readonly tier: 'oss';
1142
- readonly module: null;
1143
- };
1144
- };
1145
- type FeatureKey = keyof typeof FeatureRegistry;
1146
- declare const FEATURE_KEYS: FeatureKey[];
1147
- /** OSS 部署(billing 模块缺失)的基础白名单——唯一允许「无订阅即放行」的集合。
1148
- * testGeneration 虽有 tier 'oss'(requireFeature 直放),客户端权益快照走本集合构建
1149
- * features map,故须显式收录,否则 UI 入口(useFeature)仍判 locked。 */
1150
- declare const OSS_BASE_FEATURES: readonly FeatureKey[];
1151
- declare function isOssFeature(key: FeatureKey): boolean;
1152
- //#endregion
1153
1174
  //#region src/contract/modules/billing/plan-features-schema.d.ts
1154
1175
  declare const PlanFeaturesSchema: z.ZodRecord<z.ZodEnum<{
1155
1176
  advancedPermissions: "advancedPermissions";
@@ -1488,4 +1509,4 @@ declare const ICON_MAP: Record<string, ComponentType<{
1488
1509
  className?: string;
1489
1510
  }>>;
1490
1511
  //#endregion
1491
- 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 HostSession, type HostedAiChatParams, type HostedAiChatResult, HostedAiError, type HostedAiModel, type HostedAiService, 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 };
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 };
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-JIal4BUB.js";
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
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 };
@@ -1482,7 +1482,7 @@ const PROMPT_DEFINITIONS = [
1482
1482
  {
1483
1483
  key: "story.generate",
1484
1484
  name: "需求生成",
1485
- description: "敏捷需求分析师:生成/拆解 Story(JSONL 严格输出)",
1485
+ description: "敏捷需求分析师:生成/拆解 Story(JSON 结构化输出)",
1486
1486
  sections: [
1487
1487
  {
1488
1488
  id: "role",
@@ -1493,12 +1493,12 @@ const PROMPT_DEFINITIONS = [
1493
1493
  id: "rules",
1494
1494
  order: 2,
1495
1495
  template: `输出要求(严格遵守):
1496
- 1. 严格遵循 JSONL 格式:每行输出一个 JSON 对象,不要输出除 JSON 对象行以外的任何内容。
1497
- 2. 每行对象仅允许字段:name(必填,2-50 字)。
1496
+ 1. 输出一个 JSON 对象:{"items":[...]},items 为 2-5 个需求对象的数组。
1497
+ 2. 每个需求对象仅允许字段:name(必填,2-50 字)。
1498
1498
  3. 可选字段:description、priority、labelNames。
1499
1499
  4. priority 仅限:urgent | high | medium | low | none。
1500
1500
  5. {{labelHint}}。
1501
- 6. 不要使用 markdown 代码块包裹,不要输出数组,不要输出其他解释文字。`
1501
+ 6. 不要使用 markdown 代码块包裹,不要输出其他解释文字。`
1502
1502
  },
1503
1503
  {
1504
1504
  id: "parent-story",
@@ -1642,16 +1642,16 @@ const PROMPT_DEFINITIONS = [
1642
1642
  {
1643
1643
  key: "design.prototype.stream",
1644
1644
  name: "设计稿流式生成",
1645
- description: "以 NDJSON 行协议逐行输出画布操作流(frame/nodes/replace/done),供 SSE 路由 /api/design/prototype 消费",
1645
+ description: "以 ops 数组 JSON 对象协议输出画布操作流(frame/nodes/replace/done),供 SSE 路由 /api/design/prototype 消费",
1646
1646
  sections: [{
1647
1647
  id: "contract",
1648
1648
  order: 1,
1649
- template: `你是设计画布流式生成助手。根据用户的自然语言描述,以 NDJSON 行协议逐行输出画布操作流。
1649
+ template: `你是设计画布流式生成助手。根据用户的自然语言描述,输出一个 JSON 对象,形如 {"ops":[...]},ops 数组按时间序包含画布操作。
1650
1650
 
1651
1651
  【输出契约(必须严格遵守)】
1652
- 1. 每行输出一个独立的 JSON 对象,行与行以换行分隔;不要输出 markdown 代码块标记,不要输出任何解释文字
1653
- 2. 每行只能是以下四种操作之一:
1654
- {"op":"frame","node":{"name":"画板名","x":0,"y":0,"width":375,"height":812}}
1652
+ 1. 只输出一个 JSON 对象:{"ops":[操作, 操作, ...]};不要输出 markdown 代码块标记,不要输出任何解释文字
1653
+ 2. 每个操作只能是以下四种之一:
1654
+ {"op":"frame","node":{...}}
1655
1655
  {"op":"nodes","nodes":[{...},{...}]}
1656
1656
  {"op":"replace","removeIds":["节点id"],"nodes":[{...}]}
1657
1657
  {"op":"done","message":"给用户的中文完成说明"}
@@ -1682,10 +1682,7 @@ const PROMPT_DEFINITIONS = [
1682
1682
  示例:
1683
1683
  用户:一个登录页
1684
1684
  输出:
1685
- {"op":"frame","node":{"name":"登录页","x":0,"y":0,"width":375,"height":812}}
1686
- {"op":"nodes","nodes":[{"type":"text","name":"标题","x":24,"y":60,"width":200,"height":32,"props":{"text":"欢迎回来"}},{"type":"input","name":"用户名","x":16,"y":120,"width":343,"height":40,"props":{"text":"用户名"}}]}
1687
- {"op":"nodes","nodes":[{"type":"input","name":"密码","x":16,"y":176,"width":343,"height":40,"props":{"text":"密码"}},{"type":"button","name":"登录","x":16,"y":240,"width":343,"height":44,"props":{"text":"登录"}}]}
1688
- {"op":"done","message":"已生成登录页:标题、两个输入框与主按钮"}`
1685
+ {"ops":[{"op":"frame","node":{"name":"登录页","x":0,"y":0,"width":375,"height":812}},{"op":"nodes","nodes":[{"type":"text","name":"标题","x":24,"y":60,"width":200,"height":32,"props":{"text":"欢迎回来"}},{"type":"input","name":"用户名","x":16,"y":120,"width":343,"height":40,"props":{"text":"用户名"}}]},{"op":"nodes","nodes":[{"type":"input","name":"密码","x":16,"y":176,"width":343,"height":40,"props":{"text":"密码"}},{"type":"button","name":"登录","x":16,"y":240,"width":343,"height":44,"props":{"text":"登录"}}]},{"op":"done","message":"已生成登录页:标题、两个输入框与主按钮"}]}`
1689
1686
  }],
1690
1687
  variables: [
1691
1688
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbluecn/kernel",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "description": "AllBlue 插件协议:类型定义 + 构建期装配器(零运行时)",
@@ -39,18 +39,20 @@
39
39
  "dist"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@tanstack/ai": "^0.43.0 || ^0.47.0 || ^0.52.0 || ^0.54.0 || ^1.0.0",
43
- "@tanstack/react-start": "^1.168.49",
42
+ "@tanstack/ai": "^1.8.0",
43
+ "@tanstack/ai-openai": "^1.2.0",
44
+ "@tanstack/react-start": "^1.169.7",
44
45
  "react": "^19",
45
46
  "lucide-react": "^1.47.0",
46
47
  "zod": "^3.25 || ^4",
47
- "@tanstack/react-router": "^1.168.0"
48
+ "@tanstack/react-router": "^1.170.46"
48
49
  },
49
50
  "devDependencies": {
50
- "@tanstack/ai": "1.2.0",
51
+ "@tanstack/ai": "1.8.0",
52
+ "@tanstack/ai-openai": "1.2.0",
51
53
  "@tanstack/react-router": "1.170.46",
52
- "@tanstack/react-start": "1.169.4",
53
- "@types/node": "^24.13.3",
54
+ "@tanstack/react-start": "1.169.7",
55
+ "@types/node": "^26.6.6",
54
56
  "@types/react": "^19",
55
57
  "lucide-react": "^1.47.0",
56
58
  "react": "^19",