@kevlns/v-cli 0.4.5 → 0.4.7

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/sdk.d.ts CHANGED
@@ -387,10 +387,12 @@ interface SideEffectRecord {
387
387
  reversible: boolean;
388
388
  details?: Record<string, unknown>;
389
389
  }
390
- /** 资源需求(声明 + 组织层注入授权;本阶段内核不实现资源锁) */
390
+ /** 资源需求(内核跨进程共享/独占租约 + 组织层权限授权) */
391
391
  type ResourceKind = "project-workspace" | "engine-editor" | "build-target" | "user-cache" | "network";
392
392
  type ResourceMode = "exclusive" | "shared";
393
393
  interface ResourceRequirement {
394
+ /** 同类资源的稳定名称,例如 unity 工具缓存;省略表示该类公共资源。 */
395
+ key?: string;
394
396
  kind: ResourceKind;
395
397
  mode: ResourceMode;
396
398
  scope: "project" | "machine";
@@ -406,6 +408,8 @@ interface RetrySemantics {
406
408
  description: string;
407
409
  }
408
410
  interface CapabilityDescriptor {
411
+ /** 对应官方工具的命令路径;用于完整覆盖审计。 */
412
+ commands?: string[][];
409
413
  /** 稳定 capability id,必须带 provider 命名空间前缀(如 unity.compile) */
410
414
  id: string;
411
415
  /** 语义化版本,如 "0.1.0" */
@@ -606,6 +610,8 @@ interface CapabilityExecutionContext {
606
610
  }
607
611
  /** 实现返回的结构化结果(内核补全 project/时间/日志/持久化等字段) */
608
612
  interface ImplementationOutcome<Out = unknown> {
613
+ /** 已由工具回执确认的后台进程;调用结束后由其继续持有资源租约。 */
614
+ resourceOwnerPid?: number;
609
615
  execution: {
610
616
  status: ExecutionStatus;
611
617
  lifecycle: ExecutionLifecycle;
@@ -723,6 +729,7 @@ interface CapabilitySummary {
723
729
  preconditions: string[];
724
730
  sideEffectKinds: SideEffectKind[];
725
731
  resources: {
732
+ key?: string;
726
733
  kind: ResourceKind;
727
734
  mode: ResourceMode;
728
735
  scope: ResourceRequirement["scope"];
@@ -870,7 +877,7 @@ interface CapabilityRunRequest {
870
877
  /** false = 不落盘模式(测试/SDK 探测);默认 true */
871
878
  persist?: boolean;
872
879
  signal?: AbortSignal;
873
- /** 组织层注入的资源授权校验(本阶段内核不实现资源锁) */
880
+ /** 组织层注入的权限授权校验;内核始终执行资源互斥 */
874
881
  authorize?: ResourceAuthorizer;
875
882
  }
876
883
  interface CapabilityRuntimeDeps {
@@ -950,23 +957,11 @@ interface OfficialPluginInfo {
950
957
  }[];
951
958
  }
952
959
 
953
- /**
954
- * Unity provider(首个 provider):把已安装的 @kevlns/u-cli-mod 包能力
955
- * 包装成结构化 capability,受控 argv 调用(无 shell 拼接),
956
- * 目标工程由 .vant/config/v-cli.json 的 bindings.unity.projectDir 统一绑定。
957
- *
958
- * 能力集(本阶段):unity.doctor / unity.editor-status / unity.compile /
959
- * unity.compile-status / unity.test-start / unity.test-status / unity.test-cancel。
960
- *
961
- * 语义边界:
962
- * - 触发类(compile / test-start)只报告 accepted/running,验收一律 not-run(pending),
963
- * 完成判定必须轮询对应状态能力。
964
- * - 状态类只按证据判定:字段缺失、取值不在已知值域、报告缺失 → 一律不通过
965
- * (failed 或 not-run),并把实际读到的字段写进证据。
966
- * - exec 前的就绪判据来自包内 AGENTS.md(doctor cli.state=valid &&
967
- * pipeline.installed=true && pipeline.state=current),由前置条件 unity.pipeline-ready
968
- * 自动执行 doctor 核对;不提供跳过检查的输入选项。
969
- */
960
+ interface CommandProviderDeps {
961
+ executor: ProcessExecutor;
962
+ discoverBackend?: () => OfficialPluginInfo;
963
+ env?: Record<string, string | undefined>;
964
+ }
970
965
 
971
966
  declare const UNITY_PROVIDER_ID = "unity";
972
967
  declare const UNITY_PROVIDER_VERSION = "0.2.0";
@@ -1011,23 +1006,6 @@ interface ArtProviderDeps {
1011
1006
  declare const artBindingContract: ProviderBindingContract;
1012
1007
  declare function createArtProvider(deps: ArtProviderDeps): CapabilityProvider;
1013
1008
 
1014
- /**
1015
- * Figma provider(阶段 E):把已安装的 @kevlns/figma-to-uprefab 的离线
1016
- * staging contract 校验与只读诊断包装成结构化 capability。
1017
- *
1018
- * 边界(计划 §8,硬约束):
1019
- * - 只做离线验证:contract/doctor 全程无网络,不调用任何 Figma REST/收费接口。
1020
- * - 不做 source→IR 转换、不推广生成资产到生产路径、不修改 UIConfig。
1021
- * - 不读取也不输出 Figma 凭据:经 v-cli 托管配置注入 uiSystem/staging(无令牌字段),
1022
- * 验证过程不要求配置访问令牌(doctor 对 token 的 [FAIL] 如实报告,不作为通过条件)。
1023
- * - 路径边界:projectDir/stagingRoot 为绑定路径字段(核心强核对:相对工程根、
1024
- * 越界/链接在执行前拒绝);staging 内容的资产越界由插件自身 fail-closed(CON_/PAT_ 码族)。
1025
- *
1026
- * 托管配置(阶段 A 实证的路线):每次执行生成 .vant/state/figma/user-config.json
1027
- * (projects 键 = Unity 工程绝对路径的规范化形式,与工具 normalizeProjectKey 一致:
1028
- * 正斜杠 + win32 小写),经 env FIGMA_TO_UPREFAB_CONFIG 指给插件——不触碰用户真实配置。
1029
- */
1030
-
1031
1009
  declare const FIGMA_PROVIDER_ID = "figma";
1032
1010
  declare const FIGMA_PROVIDER_VERSION = "0.1.0";
1033
1011
  /** bindings.figma 绑定段(Provider 自包含契约) */
@@ -1047,15 +1025,10 @@ interface FigmaProviderDeps {
1047
1025
  }
1048
1026
  declare function createFigmaProvider(deps: FigmaProviderDeps): CapabilityProvider;
1049
1027
 
1050
- /**
1051
- * 默认 capability 注册表:显式装配内置 Provider。
1052
- *
1053
- * 位于 src/ 根(不在 src/core/** 内):core 不得 import providers(方向约束,
1054
- * 测试覆盖)。SDK/CLI 缺省用它;调用方可通过 providers 提供完整集合。
1055
- */
1056
-
1057
1028
  interface DefaultRegistryOptions {
1058
1029
  executor?: ProcessExecutor;
1030
+ shipDiscoverBackend?: CommandProviderDeps["discoverBackend"];
1031
+ xlmergeDiscoverBackend?: CommandProviderDeps["discoverBackend"];
1059
1032
  /** 完整 Provider 集合(提供即完全替代内置装配;顺序即注册顺序) */
1060
1033
  providers?: CapabilityProvider[];
1061
1034
  /** 覆盖 Unity 后端发现(测试/夹具注入;providers 提供时忽略) */
@@ -1177,6 +1150,23 @@ declare function redactArgv(argv: string[]): RedactionResult<string[]>;
1177
1150
  declare const REDACTION_PLACEHOLDER = "***redacted***";
1178
1151
 
1179
1152
  /** 版本常量:与 package.json 保持一致(有测试保证) */
1180
- declare const VERSION = "0.4.5";
1153
+ declare const VERSION = "0.4.7";
1154
+
1155
+ /** 已发布命令清单与真实注册表逐项对照,不从命名猜测覆盖。 */
1156
+ declare function capabilityCoverage(registry: CapabilityRegistry): {
1157
+ ok: boolean;
1158
+ providers: {
1159
+ provider: string;
1160
+ package: string;
1161
+ version: string | undefined;
1162
+ state: OfficialPluginStatus;
1163
+ commands: {
1164
+ command: string[];
1165
+ capabilities: string[];
1166
+ covered: boolean;
1167
+ }[];
1168
+ missing: string[][];
1169
+ }[];
1170
+ };
1181
1171
 
1182
- export { type AcceptanceStatus, type ArtProviderDeps, type Artifact, type CapabilityDescriptor, CapabilityError, type CapabilityExecutionContext, type CapabilityImplementation, type CapabilityProvider, type CapabilityRegistration, CapabilityRegistrationError, CapabilityRegistry, type CapabilityRunRequest, type CapabilityRunResult, type CapabilityRuntimeDeps, type CapabilitySummary, type DefaultRegistryOptions, EXECUTION_HANDLE_VERSION, type ErrorCategory, type Evidence, type ExecutionHandle, type ExecutionHandleSeed, type ExecutionLifecycle, type ExecutionStatus, FIGMA_PROVIDER_ID, FIGMA_PROVIDER_VERSION, type FigmaBinding, type FigmaProviderDeps, type HandleVerification, type ImplementationOutcome, type InitProjectConfigResult, JSON_TYPES, type JsonSchema, type JsonSchemaArray, type JsonSchemaBoolean, type JsonSchemaNull, type JsonSchemaNumber, type JsonSchemaObject, type JsonSchemaString, type JsonSchemaType, type LoadProjectConfigResult, type LogRef, NodeProcessExecutor, OPERATIONS_RELATIVE, OperationExistsError, type OperationLogger, OperationStore, type OperationSummary, PROJECT_CLI_CONFIG_RELATIVE, PathSafetyError, type PreconditionChecker, type PreconditionDeclaration, type PreconditionOutcome, type ProcessExecutor, type ProcessInvocation, type ProcessOutcome, type ProjectBindingInfo, type ProjectCliConfig, type ProjectInspection, type ProjectRoot, type ProviderBindingContract, type ProviderBindingResolution, type ProviderBindingResolutionError, type ProviderBindingResolutionOk, type ProviderBindingResolveInput, type ProviderDefaultBinding, type ProviderInfo, type ProviderPathField, type ProviderSet, type ProviderState, type ProviderStatus, REDACTION_PLACEHOLDER, type ResolvedProviderBinding, type ResourceAuthorizationDecision, type ResourceAuthorizationRequest, type ResourceAuthorizer, type ResourceKind, type ResourceMode, type ResourceRequirement, type RetrySemantics, type SideEffectDeclaration, type SideEffectKind, type SideEffectRecord, type StructuredError, UNITY_PROVIDER_ID, UNITY_PROVIDER_VERSION, type UnityBinding, type UnityProviderDeps, type UnityTestMode, VANT_PROJECT_CONFIG_RELATIVE, VERSION, artBindingContract, buildDoctorArgv, buildExecArgv, buildExecutionHandle, canonicalize, createArtProvider, createDefaultRegistry, createFigmaProvider, createUnityProvider, executionFromProcess, exitCodeForResult, figmaBindingContract, formatResultJson, generateOperationId, initProjectConfig, inspectProject, loadProjectConfig, redactArgv, redactSecrets, renderProjectConfig, resolveBindings, resolveInsideProject, resolveProjectRoot, runCapability, splitSafeRelative, structuredError, toProviderSet, toStructuredError, unityBindingContract, validateCapability, validateOperationId, validateProjectCliConfig, validateProvider, validateSchemaDefinition, validateValue, verifyExecutionHandle };
1172
+ export { type AcceptanceStatus, type ArtProviderDeps, type Artifact, type CapabilityDescriptor, CapabilityError, type CapabilityExecutionContext, type CapabilityImplementation, type CapabilityProvider, type CapabilityRegistration, CapabilityRegistrationError, CapabilityRegistry, type CapabilityRunRequest, type CapabilityRunResult, type CapabilityRuntimeDeps, type CapabilitySummary, type DefaultRegistryOptions, EXECUTION_HANDLE_VERSION, type ErrorCategory, type Evidence, type ExecutionHandle, type ExecutionHandleSeed, type ExecutionLifecycle, type ExecutionStatus, FIGMA_PROVIDER_ID, FIGMA_PROVIDER_VERSION, type FigmaBinding, type FigmaProviderDeps, type HandleVerification, type ImplementationOutcome, type InitProjectConfigResult, JSON_TYPES, type JsonSchema, type JsonSchemaArray, type JsonSchemaBoolean, type JsonSchemaNull, type JsonSchemaNumber, type JsonSchemaObject, type JsonSchemaString, type JsonSchemaType, type LoadProjectConfigResult, type LogRef, NodeProcessExecutor, OPERATIONS_RELATIVE, OperationExistsError, type OperationLogger, OperationStore, type OperationSummary, PROJECT_CLI_CONFIG_RELATIVE, PathSafetyError, type PreconditionChecker, type PreconditionDeclaration, type PreconditionOutcome, type ProcessExecutor, type ProcessInvocation, type ProcessOutcome, type ProjectBindingInfo, type ProjectCliConfig, type ProjectInspection, type ProjectRoot, type ProviderBindingContract, type ProviderBindingResolution, type ProviderBindingResolutionError, type ProviderBindingResolutionOk, type ProviderBindingResolveInput, type ProviderDefaultBinding, type ProviderInfo, type ProviderPathField, type ProviderSet, type ProviderState, type ProviderStatus, REDACTION_PLACEHOLDER, type ResolvedProviderBinding, type ResourceAuthorizationDecision, type ResourceAuthorizationRequest, type ResourceAuthorizer, type ResourceKind, type ResourceMode, type ResourceRequirement, type RetrySemantics, type SideEffectDeclaration, type SideEffectKind, type SideEffectRecord, type StructuredError, UNITY_PROVIDER_ID, UNITY_PROVIDER_VERSION, type UnityBinding, type UnityProviderDeps, type UnityTestMode, VANT_PROJECT_CONFIG_RELATIVE, VERSION, artBindingContract, buildDoctorArgv, buildExecArgv, buildExecutionHandle, canonicalize, capabilityCoverage, createArtProvider, createDefaultRegistry, createFigmaProvider, createUnityProvider, executionFromProcess, exitCodeForResult, figmaBindingContract, formatResultJson, generateOperationId, initProjectConfig, inspectProject, loadProjectConfig, redactArgv, redactSecrets, renderProjectConfig, resolveBindings, resolveInsideProject, resolveProjectRoot, runCapability, splitSafeRelative, structuredError, toProviderSet, toStructuredError, unityBindingContract, validateCapability, validateOperationId, validateProjectCliConfig, validateProvider, validateSchemaDefinition, validateValue, verifyExecutionHandle };