flower-trellis 0.6.4 → 0.6.6

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.
Files changed (54) hide show
  1. package/README.md +20 -1
  2. package/enhancements/0.6/overrides/bundles/control-plane-integrity.json +2 -0
  3. package/enhancements/0.6/overrides/bundles/intent-routing.json +2 -1
  4. package/enhancements/0.6/overrides/bundles/task-reference-contract.json +24 -0
  5. package/enhancements/0.6/overrides/conflicts.json +37 -4
  6. package/enhancements/0.6/overrides/patches/scripts/task-current-query-contract/patch.json +19 -0
  7. package/enhancements/0.6/overrides/patches/scripts/task-current-query-contract/task-current-content.py +39 -0
  8. package/enhancements/0.6/overrides/patches/scripts/task-current-query-contract/task-current-selector.py +38 -0
  9. package/enhancements/0.6/overrides/patches/scripts/task-reference-resolution/patch.json +20 -0
  10. package/enhancements/0.6/overrides/patches/scripts/task-reference-resolution/task-reference-content.py +64 -0
  11. package/enhancements/0.6/overrides/patches/scripts/task-reference-resolution/task-reference-selector.py +2 -0
  12. package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/content.md +2 -4
  13. package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/planning-contract-content.md +1 -1
  14. package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/readiness-content.md +2 -2
  15. package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/review-content.md +2 -2
  16. package/enhancements/0.6/scripts/decision_log.py +29 -24
  17. package/enhancements/0.6/scripts/task_progress.py +54 -13
  18. package/enhancements/0.6/scripts/untracked_flow.py +13 -5
  19. package/enhancements/MANIFEST.json +9 -2
  20. package/package.json +4 -4
  21. package/src/assets/flower_session_start.py +195 -0
  22. package/src/assets/flower_telemetry_hook.py +98 -0
  23. package/src/builtin-plugins/skill-garden/content-adapter.js +15 -1
  24. package/src/cli.js +3 -1
  25. package/src/commands/init.js +36 -1
  26. package/src/commands/plugin-remote.js +61 -14
  27. package/src/commands/plugin.js +14 -1
  28. package/src/commands/self-check.js +20 -0
  29. package/src/commands/self-update.js +38 -3
  30. package/src/commands/telemetry.js +30 -1
  31. package/src/commands/uninstall.js +20 -0
  32. package/src/commands/update-check.js +19 -0
  33. package/src/commands/update.js +52 -9
  34. package/src/commands/worktree.js +114 -0
  35. package/src/lib/cli-args.js +10 -0
  36. package/src/lib/developer.js +3 -2
  37. package/src/lib/flower-assets.js +21 -6
  38. package/src/lib/platform-patch-adapters.js +46 -8
  39. package/src/lib/telemetry-context.js +275 -0
  40. package/src/lib/telemetry-files.js +144 -0
  41. package/src/lib/telemetry-operation.js +84 -0
  42. package/src/lib/telemetry-queue.js +310 -0
  43. package/src/lib/telemetry-sender.js +7 -0
  44. package/src/lib/telemetry.js +12 -361
  45. package/src/patches/bundles/flower-platform-integration.json +4 -1
  46. package/src/patches/platforms/claude/session-start-hooks/patch.json +28 -0
  47. package/src/patches/platforms/claude/telemetry-hooks/patch.json +59 -0
  48. package/src/patches/platforms/codex/session-start-hooks/patch.json +3 -2
  49. package/src/patches/platforms/codex/telemetry-hooks/patch.json +59 -0
  50. package/src/plugin/application-service.js +5 -22
  51. package/src/plugin/contracts.js +1 -0
  52. package/src/plugin/lock-reachability.js +37 -0
  53. package/src/plugin/schemas/project-files.js +1 -0
  54. package/src/plugin/sources/gitlab-provider.js +50 -9
@@ -20,6 +20,9 @@ import {
20
20
  } from "./remote-archive.js";
21
21
 
22
22
  const PROFILE_RANK = Object.freeze({ standard: 0, integration: 1, system: 2 });
23
+ const RD_GUIDE_SOURCE_ID = "rd-guide";
24
+ const RD_GUIDE_PROJECT = "digital-rd-governance/rd-guide";
25
+ const LEGACY_RD_GUIDE_MARKETPLACE_PATH = ".flower-marketplace/marketplace.json";
23
26
 
24
27
  /**
25
28
  * GitLab Marketplace Provider;网络阶段由 prepare() 显式触发。
@@ -178,6 +181,7 @@ export class GitLabSourceProvider {
178
181
  inspected.version,
179
182
  manifest,
180
183
  inspected.indexCommit,
184
+ inspected.indexPath,
181
185
  );
182
186
  if (lockedPlugin) this.#assertLockedInspectionMatches(lockedPlugin, candidate);
183
187
  return candidate;
@@ -191,6 +195,7 @@ export class GitLabSourceProvider {
191
195
  */
192
196
  async prepareLocked(plugin) {
193
197
  if (this.packageRoots.has(this.#key(plugin))) return;
198
+ const indexPath = this.#lockedMarketplacePath(plugin);
194
199
  const cached = this.#findCachedPackage(plugin);
195
200
  if (cached) {
196
201
  this.#registerLockedCandidate(plugin, cached.root, cached.manifest, "standard");
@@ -198,7 +203,7 @@ export class GitLabSourceProvider {
198
203
  }
199
204
  const raw = await this.client.readRawFile(
200
205
  this.source.project,
201
- this.source.marketplacePath,
206
+ indexPath,
202
207
  plugin.source.indexCommit,
203
208
  );
204
209
  let marketplace;
@@ -627,7 +632,7 @@ export class GitLabSourceProvider {
627
632
  *
628
633
  * @param {string} pluginId Plugin 本地 ID
629
634
  * @param {string} requestedVersion 请求版本
630
- * @returns {Promise<{entry:object,version:object,indexCommit:string}>} Marketplace 版本上下文
635
+ * @returns {Promise<{entry:object,version:object,indexCommit:string,indexPath:string}>} Marketplace 版本上下文
631
636
  */
632
637
  async #marketplaceVersionForInspection(pluginId, requestedVersion) {
633
638
  const marketplace = await this.prepareIndex();
@@ -639,7 +644,7 @@ export class GitLabSourceProvider {
639
644
  path: `${this.id}/${pluginId}`,
640
645
  });
641
646
  }
642
- return { entry, version, indexCommit: this.indexCommit };
647
+ return { entry, version, indexCommit: this.indexCommit, indexPath: this.source.marketplacePath };
643
648
  }
644
649
 
645
650
  /**
@@ -647,12 +652,13 @@ export class GitLabSourceProvider {
647
652
  *
648
653
  * @param {string} pluginId Plugin 本地 ID
649
654
  * @param {import("../contracts.js").ResolvedPlugin} plugin 已锁定 Plugin
650
- * @returns {Promise<{entry:object,version:object,indexCommit:string}>} Marketplace 版本上下文
655
+ * @returns {Promise<{entry:object,version:object,indexCommit:string,indexPath:string}>} Marketplace 版本上下文
651
656
  */
652
657
  async #lockedMarketplaceVersionForInspection(pluginId, plugin) {
658
+ const indexPath = this.#lockedMarketplacePath(plugin);
653
659
  const raw = await this.client.readRawFile(
654
660
  this.source.project,
655
- this.source.marketplacePath,
661
+ indexPath,
656
662
  plugin.source.indexCommit,
657
663
  );
658
664
  let marketplace;
@@ -683,7 +689,7 @@ export class GitLabSourceProvider {
683
689
  path: plugin.id,
684
690
  });
685
691
  }
686
- return { entry, version, indexCommit: plugin.source.indexCommit };
692
+ return { entry, version, indexCommit: plugin.source.indexCommit, indexPath };
687
693
  }
688
694
 
689
695
  /**
@@ -700,7 +706,8 @@ export class GitLabSourceProvider {
700
706
  lockedPlugin.commit.toLowerCase() !== candidate.commit ||
701
707
  lockedPlugin.integrity !== candidate.integrity ||
702
708
  lockedPlugin.source.reference !== candidate.source.reference ||
703
- lockedPlugin.source.indexCommit !== candidate.source.indexCommit
709
+ lockedPlugin.source.indexCommit !== candidate.source.indexCommit ||
710
+ this.#lockedMarketplacePath(lockedPlugin) !== candidate.source.indexPath
704
711
  ) {
705
712
  throw new PluginRuntimeError(`GitLab lock 与 Marketplace 不一致:${lockedPlugin.id}`, {
706
713
  code: PLUGIN_RUNTIME_ERROR_CODES.TARGET_DRIFT,
@@ -717,9 +724,17 @@ export class GitLabSourceProvider {
717
724
  * @param {object} version Marketplace 版本条目
718
725
  * @param {object} manifest 已校验 Plugin manifest
719
726
  * @param {string} [indexCommit] Marketplace index commit
727
+ * @param {string} [indexPath] Marketplace index path
720
728
  * @returns {import("../contracts.js").PluginCandidate} Provider 候选
721
729
  */
722
- #candidateFromMarketplaceVersion(canonicalId, entry, version, manifest, indexCommit = this.indexCommit) {
730
+ #candidateFromMarketplaceVersion(
731
+ canonicalId,
732
+ entry,
733
+ version,
734
+ manifest,
735
+ indexCommit = this.indexCommit,
736
+ indexPath = this.source.marketplacePath,
737
+ ) {
723
738
  const id = composeCanonicalPluginId(this.id, manifest.id);
724
739
  if (id !== canonicalId || manifest.version !== version.version) {
725
740
  throw new PluginRuntimeError(`远程 Plugin 身份与索引不一致:${canonicalId}@${version.version}`, {
@@ -741,6 +756,7 @@ export class GitLabSourceProvider {
741
756
  type: "gitlab",
742
757
  reference: this.#sourceReference(entry.source),
743
758
  indexCommit,
759
+ indexPath: assertSafePosixRelativePath(indexPath, "Marketplace index path"),
744
760
  },
745
761
  commit: version.commit.toLowerCase(),
746
762
  integrity: version.integrity,
@@ -825,7 +841,10 @@ export class GitLabSourceProvider {
825
841
  const candidate = {
826
842
  id: plugin.id,
827
843
  version: plugin.version,
828
- source: plugin.source,
844
+ source: {
845
+ ...plugin.source,
846
+ indexPath: this.#lockedMarketplacePath(plugin),
847
+ },
829
848
  commit: plugin.commit,
830
849
  integrity: plugin.integrity,
831
850
  manifest,
@@ -834,6 +853,28 @@ export class GitLabSourceProvider {
834
853
  this.#registerCandidate(candidate, root);
835
854
  }
836
855
 
856
+ /**
857
+ * 解析旧 lock 固定使用的 Marketplace 路径。
858
+ *
859
+ * 旧 RD Guide 独立 Plugin 只存在于历史 `.flower-marketplace` 索引;该映射同时限定来源
860
+ * ID、项目和 Plugin ID 族,避免对其它 GitLab Marketplace 做多路径探测或误判。
861
+ *
862
+ * @param {import("../contracts.js").ResolvedPlugin} plugin 已锁定 Plugin
863
+ * @returns {string} 安全的固定 Marketplace 索引路径
864
+ */
865
+ #lockedMarketplacePath(plugin) {
866
+ const indexPath = plugin.source.indexPath || (
867
+ this.id === RD_GUIDE_SOURCE_ID &&
868
+ this.source.project === RD_GUIDE_PROJECT &&
869
+ plugin.source.id === RD_GUIDE_SOURCE_ID &&
870
+ plugin.source.reference === RD_GUIDE_PROJECT &&
871
+ plugin.id.startsWith(`${RD_GUIDE_SOURCE_ID}/xhgj-`)
872
+ ? LEGACY_RD_GUIDE_MARKETPLACE_PATH
873
+ : this.source.marketplacePath
874
+ );
875
+ return assertSafePosixRelativePath(indexPath, "Marketplace index path");
876
+ }
877
+
837
878
  /**
838
879
  * 登记已准备固定包候选。
839
880
  *