teamix-evo 0.13.4 → 0.14.1

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/README.md CHANGED
@@ -171,6 +171,7 @@ TEAMIX_DEBUG=1 teamix-evo tokens init opentrek
171
171
  | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
172
172
  | `teamix-evo init [-y] [--dry-run] [--variant <n>]` | 普通版接入:检测冲突 → wizard → 静默落地(已有 npm 工程入口) |
173
173
  | `teamix-evo update [--dry-run] [--cwd <dir>]` | 一键升级已装资源(tokens + skills,ADR 0003 三态 + ADR 0035 短路) |
174
+ | `teamix-evo migrate [--cwd <dir>] [--json]` | shadcn 项目迁移前置检查(AI skill 引导实际迁移) |
174
175
  | `teamix-evo restore [ts] [--list] [-y]` | 回滚 `.teamix-evo/` 到指定 snapshot(ADR 0019 §2 — 自身可逆) |
175
176
  | `teamix-evo switch <new-variant> [--apply] [-y]` | variant 切换:默认 dry-run 展示 file-level diff,--apply 才真写(ADR 0019 §D3) |
176
177
  | `teamix-evo tokens init <variant>` | 初始化 tokens |
@@ -200,11 +201,7 @@ TEAMIX_DEBUG=1 teamix-evo tokens init opentrek
200
201
  | `teamix-evo blocks add <id...>` | 安装营销页区块(保留目录结构) |
201
202
  | `teamix-evo blocks list [--installed] [--json]` | 列出可用/已安装区块 |
202
203
  | `teamix-evo blocks upgrade [<id...>]` | 升级已安装的区块源码 |
203
- | `teamix-evo templates list-variants` | _(deprecated → blocks)_ 列出 templates 包内提供的页面模板变体 |
204
- | `teamix-evo templates add <id...> --variant <name>` | _(deprecated → blocks)_ 安装变体感知页面模板 |
205
204
  | `teamix-evo lint init [-y]` | 一键安装 ESLint + Stylelint token-discipline 规则集 |
206
- | `teamix-evo logs analyze [...]` | 分析 vibe-logger AI 调用链(`.log/ai/**/*.jsonl`) |
207
- | `teamix-evo logs trace [...]` | 按会话还原 AI 调用链(prompt → PreToolUse → PostToolUse → Stop) |
208
205
 
209
206
  > 占位组件 → 真组件的升级流程**不是** CLI 子命令,由
210
207
  > [`teamix-evo-manage`](../../packages/skills/src/teamix-evo-manage/SKILL.md)
@@ -1,4 +1,4 @@
1
- import { InstalledResource, SkillIde, SkillScope, UiAliases, UiEntry, VariantManifest, SkillsPackageManifest, SkillEntry, UiPackageManifest, InstalledManifest, ProjectConfig } from '@teamix-evo/registry';
1
+ import { InstalledResource, SkillIde, SkillScope, UiAliases, UiEntry, VariantManifest, SkillEntry, SkillsPackageManifest, UiPackageManifest, InstalledManifest, ProjectConfig } from '@teamix-evo/registry';
2
2
  export { InstalledManifest, InstalledResource, ProjectConfig, SkillIde, SkillScope, TailwindVersion, UiAliases } from '@teamix-evo/registry';
3
3
 
4
4
  interface RunTokensInitOptions {
@@ -74,7 +74,6 @@ interface ListVariantsResult {
74
74
  description?: string;
75
75
  linked?: {
76
76
  'biz-ui'?: string;
77
- templates?: string;
78
77
  };
79
78
  }>;
80
79
  }
@@ -315,8 +314,14 @@ interface RunUiAddResult {
315
314
  packageName: string;
316
315
  /** Registered ids in install order (deps + requested). */
317
316
  orderedIds: string[];
318
- /** Number of files written. */
317
+ /** Number of files written (= created + overwritten). */
319
318
  written: number;
319
+ /** Number of files newly created. */
320
+ created: number;
321
+ /** Number of existing files overwritten. */
322
+ overwritten: number;
323
+ /** Number of overwritten files that had local modifications. */
324
+ userModified: number;
320
325
  /** Number of files skipped due to frozen + exists. */
321
326
  skipped: number;
322
327
  /** Aggregate npm dependencies of the installed entries. */
@@ -391,14 +396,15 @@ interface RunVariantUiAddResult {
391
396
  variant: string;
392
397
  orderedIds: string[];
393
398
  written: number;
399
+ created: number;
400
+ overwritten: number;
401
+ userModified: number;
394
402
  skipped: number;
395
403
  npmDependencies: Record<string, string>;
396
404
  resources: InstalledResource[];
397
405
  }
398
406
  /** `teamix-evo biz-ui add <ids...> --variant <name>`. */
399
407
  declare function runBizUiAdd(options: RunVariantUiAddOptions): Promise<RunVariantUiAddResult>;
400
- /** `teamix-evo templates add <ids...> --variant <name>`. */
401
- declare function runTemplatesAdd(options: RunVariantUiAddOptions): Promise<RunVariantUiAddResult>;
402
408
  interface ListVariantUiResult {
403
409
  packageName: string;
404
410
  variants: Array<{
@@ -409,7 +415,6 @@ interface ListVariantUiResult {
409
415
  }>;
410
416
  }
411
417
  declare function listBizUiVariants(packageRoot?: string): Promise<ListVariantUiResult>;
412
- declare function listTemplatesVariants(packageRoot?: string): Promise<ListVariantUiResult>;
413
418
  interface ListVariantUiEntriesResult {
414
419
  packageName: string;
415
420
  variant: string;
@@ -422,7 +427,6 @@ interface ListVariantUiEntriesResult {
422
427
  }>;
423
428
  }
424
429
  declare function listBizUiEntries(variant: string, packageRoot?: string): Promise<ListVariantUiEntriesResult>;
425
- declare function listTemplatesEntries(variant: string, packageRoot?: string): Promise<ListVariantUiEntriesResult>;
426
430
 
427
431
  /**
428
432
  * Phase 3.E lint conflict strategies (mirrors `init-conflicts.ts`).
@@ -521,9 +525,8 @@ interface RunGenerateAgentsMdOptions {
521
525
  /** Tokens / skills variant (e.g. "opentrek"). Used for header context. */
522
526
  variant: string;
523
527
  /**
524
- * Skill ids whose `<projectRoot>/.teamix-evo/skills/<id>/SKILL.md` should be
525
- * indexed. Caller is responsible for filtering out global-only skills
526
- * (e.g. `teamix-evo-manage`).
528
+ * Skill ids to index. Caller is responsible for filtering out global-only
529
+ * skills (e.g. `teamix-evo-manage`).
527
530
  */
528
531
  skillIds: string[];
529
532
  /**
@@ -603,10 +606,10 @@ declare function extractDescriptionParts(fileContent: string): SkillDescriptionP
603
606
  * - `teamix-evo-installed`: 已存在 `.teamix-evo/` → 推荐 `teamix-evo update` / 卸载流程
604
607
  * - `non-teamix-evo` : 已有非 teamix-evo 工程 → 走 `teamix-evo init` 普通版接入
605
608
  */
606
- type ProjectState = 'empty' | 'teamix-evo-installed' | 'non-teamix-evo';
607
- interface ProjectStateReport {
609
+ type ProjectState$1 = 'empty' | 'teamix-evo-installed' | 'non-teamix-evo';
610
+ interface ProjectStateReport$1 {
608
611
  /** Decision-tree branch the caller should take. */
609
- state: ProjectState;
612
+ state: ProjectState$1;
610
613
  /** Absolute path that was inspected. */
611
614
  cwd: string;
612
615
  /** Whether `.teamix-evo/` exists at `cwd`. */
@@ -629,8 +632,28 @@ interface ProjectStateReport {
629
632
  * → `empty`
630
633
  * 3. otherwise → `non-teamix-evo`
631
634
  */
635
+ declare function detectProjectState$1(cwd: string): Promise<ProjectStateReport$1>;
636
+
637
+ /**
638
+ * ADR 0046 — Three-command lifecycle model.
639
+ *
640
+ * Detection priority:
641
+ * .teamix-evo/ → components.json (with shadcn traits) → empty → other
642
+ */
643
+ type ProjectState = 'empty' | 'shadcn' | 'teamix-evo' | 'other';
644
+ interface ProjectStateReport {
645
+ state: ProjectState;
646
+ cwd: string;
647
+ hasTeamixDir: boolean;
648
+ hasPackageJson: boolean;
649
+ hasComponentsJson: boolean;
650
+ significantEntries: string[];
651
+ }
632
652
  declare function detectProjectState(cwd: string): Promise<ProjectStateReport>;
633
653
 
654
+ type LifecycleCommand = 'init' | 'migrate' | 'update';
655
+ declare function assertCommandPrecondition(command: LifecycleCommand, state: ProjectState): void;
656
+
634
657
  /**
635
658
  * The 8 categories of consumer-side files that `teamix-evo init` may
636
659
  * conflict with when running against a non-teamix-evo project.
@@ -698,7 +721,7 @@ interface FileChange {
698
721
  * true, it skips conflict detection entirely.
699
722
  */
700
723
 
701
- type ProjectInitStepName = 'tokens' | 'skills' | 'agents-md' | 'ui-init' | 'ui-add' | 'biz-ui-add' | 'lint' | 'gitignore';
724
+ type ProjectInitStepName = 'tokens' | 'skills' | 'agents-md' | 'ui-init' | 'ui-add' | 'biz-ui-add' | 'meta-landing' | 'lint' | 'gitignore';
702
725
  type ProjectInitStepStatus = 'ok' | 'skip' | 'fail' | 'planned';
703
726
  interface ProjectInitStep {
704
727
  name: ProjectInitStepName;
@@ -767,19 +790,9 @@ interface InstallResult {
767
790
  declare function installResources(options: InstallOptions): Promise<InstallResult>;
768
791
 
769
792
  /**
770
- * Source-mirror skills installer (per ADR 0013).
771
- *
772
- * Two-stage flow:
773
- * 1. **writeSkillSources** — render upstream `<packageRoot>/<skill.source>` and
774
- * write to `<projectRoot>/.teamix-evo/skills-source/<id>/` (the consumer-side
775
- * source of truth, regenerable, in git).
776
- * 2. **syncSkillsToIdes** — pure byte-for-byte copy from source dir to each
777
- * requested IDE mirror path (`.qoder/skills/<id>/`, `.claude/skills/<id>/`).
778
- * Mirrors are 100% derived; not subject to managed-region preservation.
779
- *
780
- * `installSkills` orchestrates both. `updateSkills` re-renders the source with
781
- * managed-region preservation against the existing source (NOT the mirrors),
782
- * then re-syncs.
793
+ * Skills installer renders upstream skill sources from the npm package
794
+ * and writes directly to IDE mirror paths (`.qoder/skills/<id>/`,
795
+ * `.claude/skills/<id>/`).
783
796
  */
784
797
  interface SkillInstallOptions {
785
798
  /** Project root directory */
@@ -802,28 +815,12 @@ interface SkillInstallResult {
802
815
  count: number;
803
816
  }
804
817
  /**
805
- * Install (or reinstall) all skills declared in the manifest using the
806
- * source-mirror flow. Returns InstalledResource records for both source files
807
- * and IDE mirror files.
818
+ * Install (or reinstall) all skills declared in the manifest.
819
+ * Renders from the npm package and writes directly to IDE mirror paths.
808
820
  */
809
821
  declare function installSkills(options: SkillInstallOptions): Promise<SkillInstallResult>;
810
822
  interface SkillUpdateOptions extends SkillInstallOptions {
811
- /**
812
- * Optional: existing installed records (legacy parameter kept for callers that
813
- * still pass it). The refactored updater consults the file-system source under
814
- * `.teamix-evo/skills/<id>/` for managed-region preservation, so this is
815
- * unused by the new flow. Callers should stop passing it.
816
- */
817
823
  installed?: InstalledResource[];
818
- /**
819
- * Optional: limit the update to these skill ids. When provided, skills not
820
- * in the set are skipped (no source rewrite, no mirror). Per ADR 0035,
821
- * the high-level `runSkillsUpdate` always passes this with the intersection
822
- * of `keys(lock.skills)` and the current install scope, ensuring update
823
- * never accidentally installs new skills or skills from a mismatched scope.
824
- *
825
- * Type matches `SkillInstallOptions.onlyIds` (mutable `string[] | undefined`).
826
- */
827
824
  onlyIds?: string[];
828
825
  }
829
826
  interface SkillUpdateResult {
@@ -836,49 +833,42 @@ interface SkillUpdateResult {
836
833
  };
837
834
  }
838
835
  /**
839
- * Update skills with managed-region preservation applied at the SOURCE layer
840
- * (not the mirrors). After source is rewritten, mirrors are re-synced cleanly.
836
+ * Update skills with strategy-aware logic (frozen/regenerable/managed) applied
837
+ * directly to IDE mirror files.
841
838
  */
842
839
  declare function updateSkills(options: SkillUpdateOptions): Promise<SkillUpdateResult>;
843
840
  /**
844
- * Sync existing skill sources to the requested IDE mirror paths.
845
- *
846
- * Used by:
847
- * - `skills add` (immediate mirror after source write — handled by installSkills)
848
- * - `skills sync` (re-mirror after the user adds an IDE or moves machines)
849
- * - `skills update` (re-mirror after source is rewritten)
850
- *
851
- * `onlyIds` lets the caller limit which skills are synced.
841
+ * Re-install skills from the npm package to IDE mirror paths.
842
+ * Used by `skills sync` to refresh IDE files from upstream.
852
843
  */
853
- interface SkillSyncOptions {
844
+ interface ReinstallToIdesOptions {
854
845
  projectRoot: string;
855
- /** Skills present in the source dir to mirror (caller derives from lock). */
846
+ /** Skills to reinstall (caller derives from lock). */
856
847
  skills: ReadonlyArray<{
857
848
  id: string;
858
849
  name: string;
859
850
  updateStrategy: SkillEntry['updateStrategy'];
860
- /** Managed-region ids for region-aware mirror sync. */
861
851
  managedRegions?: readonly string[];
862
852
  }>;
853
+ /** Upstream package data for rendering. */
854
+ manifest: SkillsPackageManifest;
855
+ data: Record<string, unknown>;
856
+ packageRoot: string;
863
857
  ides: readonly SkillIde[];
864
858
  scope: SkillScope;
865
- onlyIds?: string[];
866
859
  }
867
- interface SkillSyncResult {
860
+ interface ReinstallToIdesResult {
868
861
  resources: InstalledResource[];
869
862
  count: number;
870
863
  }
871
864
  /**
872
- * Mirror existing source dirs (`.teamix-evo/skills/<id>/`) to the given IDE
873
- * paths. Pure byte-for-byte copy — no rendering, no merge.
865
+ * Reinstall skills from npm package directly to IDE mirrors.
874
866
  */
875
- declare function syncSkillsToIdes(options: SkillSyncOptions): Promise<SkillSyncResult>;
867
+ declare function reinstallSkillsToIdes(options: ReinstallToIdesOptions): Promise<ReinstallToIdesResult>;
876
868
  /**
877
869
  * Remove all installed skill files. Returns the absolute paths removed.
878
- * After files are unlinked, walks up the directory tree pruning empty dirs
879
- * until a non-empty ancestor is reached (#33).
880
870
  */
881
- declare function removeSkillFiles(records: InstalledResource[]): Promise<string[]>;
871
+ declare function removeSkillFiles(records: InstalledResource[], projectRoot: string): Promise<string[]>;
882
872
 
883
873
  interface UiInstallOptions {
884
874
  /** Project root directory */
@@ -890,7 +880,7 @@ interface UiInstallOptions {
890
880
  /**
891
881
  * Optional per-entry package root override. When set, entries in the map
892
882
  * resolve their `file.source` against the mapped root instead of `packageRoot`.
893
- * Used by variant-aware packages (biz-ui / templates) that pull in
883
+ * Used by variant-aware packages (biz-ui) that pull in
894
884
  * @teamix-evo/ui transitive deps — each entry resolves from its source package.
895
885
  */
896
886
  entryPackageRoot?: Map<string, string>;
@@ -902,6 +892,8 @@ interface UiInstallOptions {
902
892
  skipExisting?: boolean;
903
893
  /** When false, preserve directory structure in import paths (skip flattenRestPath). Defaults to true. */
904
894
  flatten?: boolean;
895
+ /** Prior manifest resources for the same package — used to detect user-modified files before overwrite. */
896
+ priorResources?: InstalledResource[];
905
897
  }
906
898
  interface UiInstallResult {
907
899
  /** Ordered list of entry ids that were processed (deps + requested) */
@@ -910,8 +902,14 @@ interface UiInstallResult {
910
902
  resources: InstalledResource[];
911
903
  /** Aggregate npm dependencies across the installed entries */
912
904
  npmDependencies: Record<string, string>;
913
- /** Number of files written */
905
+ /** Number of files written (= created + overwritten, kept for backwards compat) */
914
906
  written: number;
907
+ /** Number of files newly created (target did not exist) */
908
+ created: number;
909
+ /** Number of existing files overwritten */
910
+ overwritten: number;
911
+ /** Number of overwritten files that had local modifications vs manifest hash */
912
+ userModified: number;
915
913
  /** Number of files skipped because they already exist (frozen) */
916
914
  skipped: number;
917
915
  }
@@ -923,7 +921,7 @@ declare function installUiEntries(options: UiInstallOptions): Promise<UiInstallR
923
921
  /**
924
922
  * Remove all installed ui resource files and prune empty parent directories.
925
923
  */
926
- declare function removeUiFiles(records: InstalledResource[]): Promise<string[]>;
924
+ declare function removeUiFiles(records: InstalledResource[], projectRoot: string): Promise<string[]>;
927
925
 
928
926
  /**
929
927
  * Load the variant manifest and _data.json for template rendering.
@@ -992,4 +990,4 @@ declare function readInstalledManifest(projectRoot: string): Promise<InstalledMa
992
990
  */
993
991
  declare function writeInstalledManifest(projectRoot: string, manifest: InstalledManifest): Promise<void>;
994
992
 
995
- export { type ConflictItem, type ConflictKey, type ConflictReport, type ConflictStrategy, DEFAULT_UI_ALIASES, DEFAULT_UI_ICON_LIBRARY, type InstallOptions, type InstallResult, type ListVariantUiEntriesResult, type ListVariantUiResult, type ListVariantsResult, type ProjectInitStep, type ProjectInitStepName, type ProjectInitStepStatus, type ProjectState, type ProjectStateReport, type ResumeHint, type RunGenerateAgentsMdOptions, type RunGenerateAgentsMdResult, type RunLintInitOptions, type RunLintInitResult, type RunProjectInitOptions, type RunProjectInitResult, type RunSkillsAddOptions, type RunSkillsAddResult, type RunSkillsInitOptions, type RunSkillsInitResult, type RunSkillsUpdateOptions, type RunSkillsUpdateResult, type RunTokensInitOptions, type RunTokensInitResult, type RunUiAddOptions, type RunUiAddResult, type RunUiInitOptions, type RunUiInitResult, type RunUiListOptions, type RunUiListResult, type RunVariantUiAddOptions, type RunVariantUiAddResult, type SkillInstallOptions, type SkillInstallResult, type SkillSyncOptions, type SkillSyncResult, type SkillUpdateOptions, type SkillUpdateResult, type UiEntryListItem, type UiInstallOptions, type UiInstallResult, type UpdatePlanItem, detectConflicts, detectProjectState, ensureTeamixDir, extractDescriptionParts, getTeamixDir, installResources, installSkills, installUiEntries, listBizUiEntries, listBizUiVariants, listTemplatesEntries, listTemplatesVariants, listTokenVariants, loadSkillsData, loadUiData, loadVariantData, readInstalledManifest, readProjectConfig, removeSkillFiles, removeUiFiles, runBizUiAdd, runGenerateAgentsMd, runLintInit, runProjectInit, runSkillsAdd, runSkillsInit, runSkillsUpdate, runTemplatesAdd, runTokensInit, runUiAdd, runUiInit, runUiList, syncSkillsToIdes, updateSkills, writeInstalledManifest, writeProjectConfig };
993
+ export { type ConflictItem, type ConflictKey, type ConflictReport, type ConflictStrategy, DEFAULT_UI_ALIASES, DEFAULT_UI_ICON_LIBRARY, type InstallOptions, type InstallResult, type ListVariantUiEntriesResult, type ListVariantUiResult, type ListVariantsResult, type ProjectInitStep, type ProjectInitStepName, type ProjectInitStepStatus, type ProjectState, type ProjectState$1 as ProjectStateLegacy, type ProjectStateReport, type ProjectStateReport$1 as ProjectStateReportLegacy, type ReinstallToIdesOptions, type ReinstallToIdesResult, type ResumeHint, type RunGenerateAgentsMdOptions, type RunGenerateAgentsMdResult, type RunLintInitOptions, type RunLintInitResult, type RunProjectInitOptions, type RunProjectInitResult, type RunSkillsAddOptions, type RunSkillsAddResult, type RunSkillsInitOptions, type RunSkillsInitResult, type RunSkillsUpdateOptions, type RunSkillsUpdateResult, type RunTokensInitOptions, type RunTokensInitResult, type RunUiAddOptions, type RunUiAddResult, type RunUiInitOptions, type RunUiInitResult, type RunUiListOptions, type RunUiListResult, type RunVariantUiAddOptions, type RunVariantUiAddResult, type SkillInstallOptions, type SkillInstallResult, type SkillUpdateOptions, type SkillUpdateResult, type UiEntryListItem, type UiInstallOptions, type UiInstallResult, type UpdatePlanItem, assertCommandPrecondition, detectConflicts, detectProjectState, detectProjectState$1 as detectProjectStateLegacy, ensureTeamixDir, extractDescriptionParts, getTeamixDir, installResources, installSkills, installUiEntries, listBizUiEntries, listBizUiVariants, listTokenVariants, loadSkillsData, loadUiData, loadVariantData, readInstalledManifest, readProjectConfig, reinstallSkillsToIdes, removeSkillFiles, removeUiFiles, runBizUiAdd, runGenerateAgentsMd, runLintInit, runProjectInit, runSkillsAdd, runSkillsInit, runSkillsUpdate, runTokensInit, runUiAdd, runUiInit, runUiList, updateSkills, writeInstalledManifest, writeProjectConfig };