joycraft 0.7.12 → 0.7.14

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 +30 -16
  2. package/dist/chunk-7BPB2IKY.js +255 -0
  3. package/dist/chunk-7BPB2IKY.js.map +1 -0
  4. package/dist/chunk-B73DPYYC.js +377 -0
  5. package/dist/chunk-B73DPYYC.js.map +1 -0
  6. package/dist/{chunk-DSVGHVYM.js → chunk-JYPBXPGD.js} +117 -90
  7. package/dist/chunk-JYPBXPGD.js.map +1 -0
  8. package/dist/{chunk-OAC5CVHJ.js → chunk-K4AI6FKB.js} +12 -2
  9. package/dist/chunk-K4AI6FKB.js.map +1 -0
  10. package/dist/{chunk-PBOICMDE.js → chunk-KKDKC4FM.js} +11 -73
  11. package/dist/chunk-KKDKC4FM.js.map +1 -0
  12. package/dist/chunk-OMFGDJW4.js +97 -0
  13. package/dist/chunk-OMFGDJW4.js.map +1 -0
  14. package/dist/chunk-PR4QDKPL.js +3755 -0
  15. package/dist/chunk-PR4QDKPL.js.map +1 -0
  16. package/dist/chunk-Z5JFEGWG.js +563 -0
  17. package/dist/chunk-Z5JFEGWG.js.map +1 -0
  18. package/dist/cli.js +389 -56
  19. package/dist/cli.js.map +1 -1
  20. package/dist/index.d.ts +235 -1
  21. package/dist/index.js +691 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/init-S5JU5BHL.js +60 -0
  24. package/dist/init-S5JU5BHL.js.map +1 -0
  25. package/dist/{init-autofix-YCSDK5ZR.js → init-autofix-WSKUT2HN.js} +4 -3
  26. package/dist/{init-autofix-YCSDK5ZR.js.map → init-autofix-WSKUT2HN.js.map} +1 -1
  27. package/dist/install-manifest-EQHT4474.js +37 -0
  28. package/dist/joycraft-release.json +8 -0
  29. package/dist/release-artifact-4TL5L2ZY.js +14 -0
  30. package/dist/release-resolver-P2H46QTU.js +293 -0
  31. package/dist/release-resolver-P2H46QTU.js.map +1 -0
  32. package/dist/{telemetry-store-X7K5NYWD.js → telemetry-store-IBO5GRTA.js} +2 -2
  33. package/dist/telemetry-store-IBO5GRTA.js.map +1 -0
  34. package/dist/update-HNTXCEKB.js +19 -0
  35. package/dist/update-HNTXCEKB.js.map +1 -0
  36. package/dist/update-check-YT765NE7.js +36 -0
  37. package/dist/update-check-YT765NE7.js.map +1 -0
  38. package/dist/upgrade-LZOND7OZ.js +28 -0
  39. package/dist/upgrade-LZOND7OZ.js.map +1 -0
  40. package/package.json +5 -2
  41. package/dist/chunk-BZW5DR3O.js +0 -91
  42. package/dist/chunk-BZW5DR3O.js.map +0 -1
  43. package/dist/chunk-DSVGHVYM.js.map +0 -1
  44. package/dist/chunk-OAC5CVHJ.js.map +0 -1
  45. package/dist/chunk-PBOICMDE.js.map +0 -1
  46. package/dist/chunk-Q2ZQ6RGD.js +0 -243
  47. package/dist/chunk-Q2ZQ6RGD.js.map +0 -1
  48. package/dist/init-J5Q6RX3K.js +0 -1307
  49. package/dist/init-J5Q6RX3K.js.map +0 -1
  50. package/dist/upgrade-AHUSQZEQ.js +0 -643
  51. package/dist/upgrade-AHUSQZEQ.js.map +0 -1
  52. package/dist/version-B2CCAEMC.js +0 -28
  53. /package/dist/{telemetry-store-X7K5NYWD.js.map → install-manifest-EQHT4474.js.map} +0 -0
  54. /package/dist/{version-B2CCAEMC.js.map → release-artifact-4TL5L2ZY.js.map} +0 -0
@@ -0,0 +1,563 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ DEFAULT_GITIGNORE_PROFILE,
4
+ HARNESSES,
5
+ LEGACY_CLAUDE_STATE_PATH,
6
+ LEGACY_VERSION_FILE,
7
+ STATE_PATH,
8
+ parseGitignoreProfile,
9
+ sanitizeHarnesses
10
+ } from "./chunk-KKDKC4FM.js";
11
+ import {
12
+ TELEMETRY_PATH
13
+ } from "./chunk-K4AI6FKB.js";
14
+
15
+ // src/install-manifest.ts
16
+ import {
17
+ existsSync as existsSync2,
18
+ lstatSync,
19
+ mkdirSync,
20
+ readFileSync as readFileSync2,
21
+ readdirSync,
22
+ renameSync,
23
+ writeFileSync as writeFileSync2
24
+ } from "fs";
25
+ import { dirname, join as join2 } from "path";
26
+ import { createHash } from "crypto";
27
+
28
+ // src/historical-vendor-catalogue.ts
29
+ var HISTORICAL_VENDOR_CATALOGUE = [
30
+ { path: ".agents/skills/joycraft-add-context/SKILL.md", version: "0.7.13", vendorHash: "524cebc35209abf1376c7f91166b966e259bfd5f7fbab257a1ff61f34cc935e9" },
31
+ { path: ".agents/skills/joycraft-add-fact/SKILL.md", version: "0.7.13", vendorHash: "0a7714a9486d0e7ddba1a4d172ffe2b92be66d614f777a7120913fed62ff683f" },
32
+ { path: ".agents/skills/joycraft-bugfix/SKILL.md", version: "0.7.13", vendorHash: "393fe6351ba3828df23bff13cfafdcb358a15e75c235dad4f6e1e0ea0e325d77" },
33
+ { path: ".agents/skills/joycraft-collaborative-setup/SKILL.md", version: "0.7.13", vendorHash: "af5f665b53717af8c140020a44e414f1980b5e4966fc790d69fe4258a2de6b21" },
34
+ { path: ".agents/skills/joycraft-decide/SKILL.md", version: "0.7.13", vendorHash: "8aa34fd72ce7f45ec137b51c559a850910ccd7c6bfda3ee9aaa3ce4b7a08b506" },
35
+ { path: ".agents/skills/joycraft-decompose/SKILL.md", version: "0.7.13", vendorHash: "98daa692bcec5474d1e03bf9e897dd6956cd444566d928d51323837aa12a7dda" },
36
+ { path: ".agents/skills/joycraft-design/SKILL.md", version: "0.7.13", vendorHash: "eacfdd6285c79a647ae4bd97337b7ebe8910fbf91ca7a737c73aa84cc56d82dd" },
37
+ { path: ".agents/skills/joycraft-gather-context/SKILL.md", version: "0.7.13", vendorHash: "9e1785b6f038cbef36ff40e2506b1bf873edc5870c9881fbbbb5266e931e0463" },
38
+ { path: ".agents/skills/joycraft-harden/SKILL.md", version: "0.7.13", vendorHash: "3fb9b50cc34f8289d2669dfc432cbc07ccb9d737e6741fd5163667b9e9d6356b" },
39
+ { path: ".agents/skills/joycraft-implement-feature/SKILL.md", version: "0.7.13", vendorHash: "54036db549ecddbc4bbc10f2cb12cec7d826b7cbdcb9a6e1d71323abe06bf0c0" },
40
+ { path: ".agents/skills/joycraft-implement-level5/SKILL.md", version: "0.7.13", vendorHash: "bd719467d595d284b45c65ff8540a187ae933a573a4dd830247d5dd3f887881f" },
41
+ { path: ".agents/skills/joycraft-implement/SKILL.md", version: "0.7.13", vendorHash: "604aaa84a81badaecd847e57820def32da072feb42bf856a6757095a66f3eb0d" },
42
+ { path: ".agents/skills/joycraft-interview/SKILL.md", version: "0.7.13", vendorHash: "3e647685a5b880464716df2ab772d350ead1e2c13d90f3235d3e04a5146205c9" },
43
+ { path: ".agents/skills/joycraft-lockdown/SKILL.md", version: "0.7.13", vendorHash: "04a9ec840a0d0f3a20aa859ee5e1eb1cdf0e6a50e1c8f2122e2ada132b77898c" },
44
+ { path: ".agents/skills/joycraft-new-feature/SKILL.md", version: "0.7.13", vendorHash: "b9f65b7d2658007aa7b08877ab3aa53941fafea67245879139e7f13ed15100b6" },
45
+ { path: ".agents/skills/joycraft-optimize/SKILL.md", version: "0.7.13", vendorHash: "0b26f7b85950f565c556cd52b9a6807c677f53b366ade7490ec5f4fc2668468a" },
46
+ { path: ".agents/skills/joycraft-research/SKILL.md", version: "0.7.13", vendorHash: "08bae7c5fe747b0dbdc4107cfba032e5d83224a82e5e9be64bbc8a84b6e9a4b7" },
47
+ { path: ".agents/skills/joycraft-session-end/SKILL.md", version: "0.7.13", vendorHash: "64da17d75c2b5d2a9053fe4f73a6fca04bedc5987723a6e379f411e2dfd51084" },
48
+ { path: ".agents/skills/joycraft-setup/SKILL.md", version: "0.7.13", vendorHash: "c291966d67d0298c3c9cbd7d1f3765770532e48f568a218304a67131be7f285f" },
49
+ { path: ".agents/skills/joycraft-spec-done/SKILL.md", version: "0.7.13", vendorHash: "4018ed142f00ca4d2934c0f213a1047a9dc92d3348d89aa0565198dd6ba118cf" },
50
+ { path: ".agents/skills/joycraft-tune/SKILL.md", version: "0.7.13", vendorHash: "b8947f89104ae15d1a4ce89cdbc0f29f508a174d5fc6051d32a80dfda32be75f" },
51
+ { path: ".agents/skills/joycraft-verify/SKILL.md", version: "0.7.13", vendorHash: "800a2891c66edce4cbf243f6619540f8fa6f8ddc69f55d6e44a2f4844273c17b" },
52
+ { path: ".claude/skills/joycraft-add-context/SKILL.md", version: "0.7.13", vendorHash: "65d668e04dcfce62d7c0519314520c254a38533a482a7a1ca3b3c2c7da45bad8" },
53
+ { path: ".claude/skills/joycraft-add-fact/SKILL.md", version: "0.7.13", vendorHash: "78de4864957d916edb2063bd8d596b92d5be29953a4feb4e15cfa0281135c860" },
54
+ { path: ".claude/skills/joycraft-bugfix/SKILL.md", version: "0.7.13", vendorHash: "1b1ac3ff486cf7f1956a2d774b347e44d14d8f21a3bb2b2028d375bb7499859d" },
55
+ { path: ".claude/skills/joycraft-collaborative-setup/SKILL.md", version: "0.7.13", vendorHash: "3f410c8c5b618112f9ecdd9efaaebe7bf96e5909560b9a9bb9588835560bb760" },
56
+ { path: ".claude/skills/joycraft-decide/SKILL.md", version: "0.7.13", vendorHash: "83c8748634497b00092c440fa3d2851da4fba58de0e2dc6c6a72e8ac247c8d58" },
57
+ { path: ".claude/skills/joycraft-decompose/SKILL.md", version: "0.7.13", vendorHash: "40a935fd36ab5bcb147896ebe7080836e231330a45c282441aa99048b919f97a" },
58
+ { path: ".claude/skills/joycraft-design/SKILL.md", version: "0.7.13", vendorHash: "59a4e5d21eab39518b7865a140a28f09dcedc0e96e30c83148abe8c082f6dbfc" },
59
+ { path: ".claude/skills/joycraft-gather-context/SKILL.md", version: "0.7.13", vendorHash: "78e5a4195128ff8e8fd2a07c4f90e5625ca1e60706bb4c71d0fc11e7593f84eb" },
60
+ { path: ".claude/skills/joycraft-harden/SKILL.md", version: "0.7.13", vendorHash: "f1547439de361eac876b46e2493038db3e80b0a5316746ba7ce1fd94a0edaa80" },
61
+ { path: ".claude/skills/joycraft-implement-feature/SKILL.md", version: "0.7.13", vendorHash: "fc313168df9501a38527a0db3c29fd3194a7aaf746c85279e45bf8c94133c466" },
62
+ { path: ".claude/skills/joycraft-implement-level5/SKILL.md", version: "0.7.13", vendorHash: "321dc2781f7f219757ae1cfd790c596e297489b0abfa74f9319b32ccd7531e65" },
63
+ { path: ".claude/skills/joycraft-implement/SKILL.md", version: "0.7.13", vendorHash: "5797660ec30302197b3210a603bc5c21093cabb96624b922d217c5cd7f4c4e6d" },
64
+ { path: ".claude/skills/joycraft-interview/SKILL.md", version: "0.7.13", vendorHash: "55b91b4e161ad050ce6c9ca4671800fd7026e050930625c74cea8d1014ff1dff" },
65
+ { path: ".claude/skills/joycraft-lockdown/SKILL.md", version: "0.7.13", vendorHash: "b64483b7d29c9bfaf58366db2fcef6eaf80b8eae14c5013f220498f97af47a16" },
66
+ { path: ".claude/skills/joycraft-new-feature/SKILL.md", version: "0.7.13", vendorHash: "cf58d515575543c43a8b7c1af3d6308aa6a20b344365b4e21dd5bad95b246893" },
67
+ { path: ".claude/skills/joycraft-optimize/SKILL.md", version: "0.7.13", vendorHash: "09798521677eedcf9d18ed7ac98f16bc1088f650b12b7ededa03928eca5d286e" },
68
+ { path: ".claude/skills/joycraft-research/SKILL.md", version: "0.7.13", vendorHash: "51f802e10a86687e085d1c44c7b969a203ae4cfb28d4c494f9755367b1c3c587" },
69
+ { path: ".claude/skills/joycraft-session-end/SKILL.md", version: "0.7.13", vendorHash: "32f8e8e20bff25860a3b6c0e63469ca19234da17c0c2cf0f21560bd4cd7304c7" },
70
+ { path: ".claude/skills/joycraft-setup/SKILL.md", version: "0.7.13", vendorHash: "4c8b65e1a308378ce45ae48a2470a3978fbd3641be674d13cd807ecb1c935899" },
71
+ { path: ".claude/skills/joycraft-spec-done/SKILL.md", version: "0.7.13", vendorHash: "3931b2e8eeb8cab2a4216181f73e83e99e8c6266486217adc4bbcdd0870d8dd9" },
72
+ { path: ".claude/skills/joycraft-tune/SKILL.md", version: "0.7.13", vendorHash: "ca7c90631f9b5aafab53c24850c3e78013b62aad7b0bb45525875a1987da5c70" },
73
+ { path: ".claude/skills/joycraft-verify/SKILL.md", version: "0.7.13", vendorHash: "bca24134425277cf4f12ad9ad19db4c37f4d8f7e24be726921d70425fd02a151" },
74
+ { path: ".github/skills/joycraft-add-context/SKILL.md", version: "0.7.13", vendorHash: "b961cd0ae2adcefa9c4194dd5d5314dba036f39a4cd5597f9ad6a649e62e42f2" },
75
+ { path: ".github/skills/joycraft-add-fact/SKILL.md", version: "0.7.13", vendorHash: "f616995bc510f2df856a1f41471955982431559a467f279a7d48f80cc4905220" },
76
+ { path: ".github/skills/joycraft-bugfix/SKILL.md", version: "0.7.13", vendorHash: "cb615340d6a60bc7a28019a9f273f34455ae392a1c879ca432faa3fcb19b585a" },
77
+ { path: ".github/skills/joycraft-collaborative-setup/SKILL.md", version: "0.7.13", vendorHash: "15d9b050be7341ce8180cae7906ace21801a27f0b15ac3f06f28cca685051964" },
78
+ { path: ".github/skills/joycraft-decide/SKILL.md", version: "0.7.13", vendorHash: "2dc651105c2dc0b085c1de1bb03b4e549b33fdf45cbe8f9cd9c89559a64e48e5" },
79
+ { path: ".github/skills/joycraft-decompose/SKILL.md", version: "0.7.13", vendorHash: "b22e8121cd610dde1555fde3ce1b484270d017627611fe5f5d2f51c9d5066d70" },
80
+ { path: ".github/skills/joycraft-design/SKILL.md", version: "0.7.13", vendorHash: "c31ee67b53b4b8b3f34dd630eedb87276e98b13a1db00c43e7585cf8e2f59dae" },
81
+ { path: ".github/skills/joycraft-gather-context/SKILL.md", version: "0.7.13", vendorHash: "91be1d0bef0c26198986b296bddc3ff1e16236d0ebd32cd00d39dfe715fcc6f4" },
82
+ { path: ".github/skills/joycraft-harden/SKILL.md", version: "0.7.13", vendorHash: "f1a19dbedfef6fcef084c4c31847519ada534e3c06b0a2593e2bd08de533742a" },
83
+ { path: ".github/skills/joycraft-implement-feature/SKILL.md", version: "0.7.13", vendorHash: "9822a6158057d6b819e4c6fd496adab7e7a1c66eab5e0b1eab86624419c542c3" },
84
+ { path: ".github/skills/joycraft-implement-level5/SKILL.md", version: "0.7.13", vendorHash: "04c4c3e1d4abcdd59d6cf864c07a367beeb9fc720af50fb306f8584d4b7ae0de" },
85
+ { path: ".github/skills/joycraft-implement/SKILL.md", version: "0.7.13", vendorHash: "805ef3ae9466348c2d3cab20435cdac5ba6ef4182b4fa6dcad2c80798ab68b33" },
86
+ { path: ".github/skills/joycraft-interview/SKILL.md", version: "0.7.13", vendorHash: "9baa37fc3f1468ec4f87246a6ae587352554ce7df495c02d39f0bef9c045034a" },
87
+ { path: ".github/skills/joycraft-lockdown/SKILL.md", version: "0.7.13", vendorHash: "2610c6656b2222a0aefff9a066badf66a7f4e21e94ce94f9502002818eee50a3" },
88
+ { path: ".github/skills/joycraft-new-feature/SKILL.md", version: "0.7.13", vendorHash: "40a6f77a5d9b76053221b467396fff3118b11b6ac255b2812b989d0cb42629c8" },
89
+ { path: ".github/skills/joycraft-optimize/SKILL.md", version: "0.7.13", vendorHash: "83ada4b1f9d3d5087b633a9d8768c2542fa1135d32bb5f554acab8f4f1d9f02a" },
90
+ { path: ".github/skills/joycraft-research/SKILL.md", version: "0.7.13", vendorHash: "f85fa50f4e4cf8e0e97bcff981be42a6a23b2c4c6b8a9b624d398bf26ed0e540" },
91
+ { path: ".github/skills/joycraft-session-end/SKILL.md", version: "0.7.13", vendorHash: "8ba7560d9a6c30763342f7ccf2cadc096376a21cabc4beeb93a2b120408f5a5c" },
92
+ { path: ".github/skills/joycraft-setup/SKILL.md", version: "0.7.13", vendorHash: "d7e114fc92a04ab06af23c72609dcd525f38b02d479500e9be037aeaa4aa228d" },
93
+ { path: ".github/skills/joycraft-spec-done/SKILL.md", version: "0.7.13", vendorHash: "24f5153eb732b258a911e41e02a7928480b92a8e64e391590d784bf6713decbe" },
94
+ { path: ".github/skills/joycraft-tune/SKILL.md", version: "0.7.13", vendorHash: "a7f379b3737747082e96688c814a37425dfd732d54199873a212ecc4a4c17aa8" },
95
+ { path: ".github/skills/joycraft-verify/SKILL.md", version: "0.7.13", vendorHash: "b957dc8bfb3fab27b4b41ff4c1fa23c2d2c4a9e6705842807602357e7d6c2b44" },
96
+ { path: ".omp/skills/joycraft-add-context/SKILL.md", version: "0.7.13", vendorHash: "cd0ee4cdf4bacfe4e48222efd5d8182becf19250023072c0666337713eb320f5" },
97
+ { path: ".omp/skills/joycraft-add-fact/SKILL.md", version: "0.7.13", vendorHash: "00b8fc234071f965a600c15261e012da5066b4d0b6343eb7f68106c0c1fb6dc9" },
98
+ { path: ".omp/skills/joycraft-bugfix/SKILL.md", version: "0.7.13", vendorHash: "df70b84b4dea273496f395a43f478036a951340e43656f3fb2918728109e36f3" },
99
+ { path: ".omp/skills/joycraft-collaborative-setup/SKILL.md", version: "0.7.13", vendorHash: "4affb1f3f5a11da8bf1d7757ed82d82d0761f2d126fb9323dbcf7bb53f5965a7" },
100
+ { path: ".omp/skills/joycraft-decide/SKILL.md", version: "0.7.13", vendorHash: "c9c4f6d2d73359799b999e6b8fe4760a1dd63d544bb848d6021675d319a1b8b3" },
101
+ { path: ".omp/skills/joycraft-decompose/SKILL.md", version: "0.7.13", vendorHash: "f44ad20ae535a5899085db367e783fa7bb37be326a30c8a920c5028f702daf56" },
102
+ { path: ".omp/skills/joycraft-design/SKILL.md", version: "0.7.13", vendorHash: "2ef2a7a1c66e3f9731515cc4ce1a954aa2305dd9f9299b74fc8705c146b69a7f" },
103
+ { path: ".omp/skills/joycraft-gather-context/SKILL.md", version: "0.7.13", vendorHash: "b751d9eabdd0e84ac7b8187f86ac0d0eabaafd90b8a8f05cea6ed05e12a65e3e" },
104
+ { path: ".omp/skills/joycraft-harden/SKILL.md", version: "0.7.13", vendorHash: "3fb9b50cc34f8289d2669dfc432cbc07ccb9d737e6741fd5163667b9e9d6356b" },
105
+ { path: ".omp/skills/joycraft-implement-feature/SKILL.md", version: "0.7.13", vendorHash: "e0e398906cba11fefeeb681fbc1fd9159aa633a2def02dac29c0283349e29711" },
106
+ { path: ".omp/skills/joycraft-implement-level5/SKILL.md", version: "0.7.13", vendorHash: "10550c9753c673e9f5127809a4940725ab8f955dedf2b87e3220fd8da3175405" },
107
+ { path: ".omp/skills/joycraft-implement/SKILL.md", version: "0.7.13", vendorHash: "4ec06d09f4e012e96d4c8b964a2cb244ee41d8571e28f1a7a55868365eede832" },
108
+ { path: ".omp/skills/joycraft-interview/SKILL.md", version: "0.7.13", vendorHash: "e7053515107baf5d0bc6ab9adbd7435c56fc6468661c80486bc1db52f1354e86" },
109
+ { path: ".omp/skills/joycraft-lockdown/SKILL.md", version: "0.7.13", vendorHash: "faf63c69e401fc63474d284d207c98b2ddb19c1489229c8d110c32ebf1732d05" },
110
+ { path: ".omp/skills/joycraft-new-feature/SKILL.md", version: "0.7.13", vendorHash: "9d0acdca3853a9d270a60160813ebeeb1e7ec6b1a633379f46caa5f96076ccd8" },
111
+ { path: ".omp/skills/joycraft-optimize/SKILL.md", version: "0.7.13", vendorHash: "5a5bb97c3b7cb7ff8edccfc23be69438b5247c5747662322e7fd249d9380cd44" },
112
+ { path: ".omp/skills/joycraft-research/SKILL.md", version: "0.7.13", vendorHash: "6b4662bf006dca3c39324f129b651dfd4227a66f36a2f16c801631a8a73a1ccf" },
113
+ { path: ".omp/skills/joycraft-session-end/SKILL.md", version: "0.7.13", vendorHash: "fc8bcff0224621e353025b0620a7c34e6b2097495a55c0731a64e1d499a84562" },
114
+ { path: ".omp/skills/joycraft-setup/SKILL.md", version: "0.7.13", vendorHash: "21c2d14bd09641e80eb8af50bc9f648f5f1ddc7c1f99261173eb712f4fa9901e" },
115
+ { path: ".omp/skills/joycraft-spec-done/SKILL.md", version: "0.7.13", vendorHash: "4d0afb784a6ce605f6bef00f575dbf8e00a27171d4907cf021436db6c608b498" },
116
+ { path: ".omp/skills/joycraft-tune/SKILL.md", version: "0.7.13", vendorHash: "7ed1742e1adc5a5d5cb631a892a63fe3306983ac49ba455849b818cbbc01d119" },
117
+ { path: ".omp/skills/joycraft-verify/SKILL.md", version: "0.7.13", vendorHash: "78ecec32976db26be3335e31fb35d02992e456b532e019384f3bc1c5d75059a2" },
118
+ { path: ".pi/agents/joycraft-researcher.md", version: "0.7.13", vendorHash: "70051be1f163572f6925ebc46c0e39d5114ecb72695c82328a78e8a0d40d47a8" },
119
+ { path: ".pi/agents/joycraft-verifier.md", version: "0.7.13", vendorHash: "23839a8cb03a10042907c1fa130adf4ad71b8aa070aed08d7281fa8da50c4049" },
120
+ { path: ".pi/extensions/joycraft-pipeline.ts", version: "0.7.13", vendorHash: "ef5468ee36fd6c5c7358153b498c5b6b383e9f5be4138751e0e695c8468b02a8" },
121
+ { path: ".pi/scripts/joycraft/README.md", version: "0.7.13", vendorHash: "40659c6e6a986be27a0d8f785cae7e2c7ff0262c57fc3e69e281697bd51cdecc" },
122
+ { path: ".pi/scripts/joycraft/joycraft-implement-loop", version: "0.7.13", vendorHash: "999203536df774e88b4821001ec70cf36669eba99788cb17062f8cf9ac818aa7" },
123
+ { path: ".pi/scripts/joycraft/joycraft-mark-done", version: "0.7.13", vendorHash: "2a62b21779dde88b49580a35d4f18a65caeb1fac69abd65c4c932abdb67391ff" },
124
+ { path: ".pi/scripts/joycraft/joycraft-next-spec", version: "0.7.13", vendorHash: "018b0ebb5347e681ee094201277cf93992f79cbed489f4fc308f27eb67193327" },
125
+ { path: ".pi/scripts/joycraft/joycraft-session-end", version: "0.7.13", vendorHash: "134d0d6403a5c2178e1c8d3c03098e0f6c828a11091a9962ac63b399aa9f1b69" },
126
+ { path: ".pi/scripts/joycraft/joycraft-spec-status", version: "0.7.13", vendorHash: "005551b6e16a70a10702f798f1367fd7c540c462bf3354ffd1b0de9766418a7e" },
127
+ { path: ".pi/skills/joycraft-add-context/SKILL.md", version: "0.7.13", vendorHash: "cd0ee4cdf4bacfe4e48222efd5d8182becf19250023072c0666337713eb320f5" },
128
+ { path: ".pi/skills/joycraft-add-fact/SKILL.md", version: "0.7.13", vendorHash: "00b8fc234071f965a600c15261e012da5066b4d0b6343eb7f68106c0c1fb6dc9" },
129
+ { path: ".pi/skills/joycraft-bugfix/SKILL.md", version: "0.7.13", vendorHash: "df70b84b4dea273496f395a43f478036a951340e43656f3fb2918728109e36f3" },
130
+ { path: ".pi/skills/joycraft-collaborative-setup/SKILL.md", version: "0.7.13", vendorHash: "4affb1f3f5a11da8bf1d7757ed82d82d0761f2d126fb9323dbcf7bb53f5965a7" },
131
+ { path: ".pi/skills/joycraft-decide/SKILL.md", version: "0.7.13", vendorHash: "c9c4f6d2d73359799b999e6b8fe4760a1dd63d544bb848d6021675d319a1b8b3" },
132
+ { path: ".pi/skills/joycraft-decompose/SKILL.md", version: "0.7.13", vendorHash: "b31b18976b9c47353dcb472c6c584f2e69e22966542f221b03c1ca876b2a234b" },
133
+ { path: ".pi/skills/joycraft-design/SKILL.md", version: "0.7.13", vendorHash: "2ef2a7a1c66e3f9731515cc4ce1a954aa2305dd9f9299b74fc8705c146b69a7f" },
134
+ { path: ".pi/skills/joycraft-gather-context/SKILL.md", version: "0.7.13", vendorHash: "b751d9eabdd0e84ac7b8187f86ac0d0eabaafd90b8a8f05cea6ed05e12a65e3e" },
135
+ { path: ".pi/skills/joycraft-harden/SKILL.md", version: "0.7.13", vendorHash: "3fb9b50cc34f8289d2669dfc432cbc07ccb9d737e6741fd5163667b9e9d6356b" },
136
+ { path: ".pi/skills/joycraft-implement-feature/SKILL.md", version: "0.7.13", vendorHash: "d251410f7137dd2b792ea5fff3c8bcc7c74b7599aa1b54ce792e2380727c48cd" },
137
+ { path: ".pi/skills/joycraft-implement-level5/SKILL.md", version: "0.7.13", vendorHash: "10550c9753c673e9f5127809a4940725ab8f955dedf2b87e3220fd8da3175405" },
138
+ { path: ".pi/skills/joycraft-implement/SKILL.md", version: "0.7.13", vendorHash: "9fecb2fcf98ee7ecb09c4decb4ba451fedd63dea9e81558f3e2e3b10d42f0c92" },
139
+ { path: ".pi/skills/joycraft-interview/SKILL.md", version: "0.7.13", vendorHash: "e7053515107baf5d0bc6ab9adbd7435c56fc6468661c80486bc1db52f1354e86" },
140
+ { path: ".pi/skills/joycraft-lockdown/SKILL.md", version: "0.7.13", vendorHash: "faf63c69e401fc63474d284d207c98b2ddb19c1489229c8d110c32ebf1732d05" },
141
+ { path: ".pi/skills/joycraft-new-feature/SKILL.md", version: "0.7.13", vendorHash: "9d0acdca3853a9d270a60160813ebeeb1e7ec6b1a633379f46caa5f96076ccd8" },
142
+ { path: ".pi/skills/joycraft-optimize/SKILL.md", version: "0.7.13", vendorHash: "9099c180a9b07e650608bc7b829520929e74c6996e83a51ea06b94c497ccd824" },
143
+ { path: ".pi/skills/joycraft-research/SKILL.md", version: "0.7.13", vendorHash: "baa61e8e117b0b8e79f98083840b795f348ca41c47175e8b205b06c3943da7e9" },
144
+ { path: ".pi/skills/joycraft-session-end/SKILL.md", version: "0.7.13", vendorHash: "fc8bcff0224621e353025b0620a7c34e6b2097495a55c0731a64e1d499a84562" },
145
+ { path: ".pi/skills/joycraft-setup/SKILL.md", version: "0.7.13", vendorHash: "21c2d14bd09641e80eb8af50bc9f648f5f1ddc7c1f99261173eb712f4fa9901e" },
146
+ { path: ".pi/skills/joycraft-spec-done/SKILL.md", version: "0.7.13", vendorHash: "71fa49c0a8624d2a45f1b6f6de00cf7ec119cb1c4eaa139cc440af669948beb1" },
147
+ { path: ".pi/skills/joycraft-tune/SKILL.md", version: "0.7.13", vendorHash: "d391d24224459867b7f5c1bc64b4834fa9bd7fff4ac01b95e11ab49b8c3e25c6" },
148
+ { path: ".pi/skills/joycraft-verify/SKILL.md", version: "0.7.13", vendorHash: "e5cb5a8b244b9064bd8ad7ba9ccb13233417698208f0a7d68f160ed1d5498816" },
149
+ { path: "docs/templates/CONTRIBUTING-joycraft-template.md", version: "0.7.13", vendorHash: "e204c6a68168784133481cddd14cda80719a25c0b889f6ce96bb229f2657dee0" },
150
+ { path: "docs/templates/DECISION_DOSSIER_TEMPLATE.html", version: "0.7.13", vendorHash: "2547d26dcc6eacb559e98418334d8ef9faa9b9aed98f5a62fd5fe29dd2621d9e" },
151
+ { path: "docs/templates/REVIEW_GATE_TEMPLATE.html", version: "0.7.13", vendorHash: "8a6087d778e9b0549a76b11207afde00260d9a1516e02b4b39b81aa8f71ab98e" },
152
+ { path: "docs/templates/context/anchors.md", version: "0.7.13", vendorHash: "6d2d1655715e55c4d9773cb822dabbac3593189a8078affe08f6da46ce983d2a" },
153
+ { path: "docs/templates/context/dangerous-assumptions.md", version: "0.7.13", vendorHash: "3a284c31bf6b11a47d9b6a0ac3280835c04e816c6001ca7b5bb38c144f30f1e0" },
154
+ { path: "docs/templates/context/decision-log.md", version: "0.7.13", vendorHash: "2cba6fe33e7ec97141fc2aaa7765d60de5bc5be84dfb56042e11287718cfaf9d" },
155
+ { path: "docs/templates/context/institutional-knowledge.md", version: "0.7.13", vendorHash: "b2087bcbf493864a54e1eb463803d0df3b2594757db2b61c26b1c9b017e5ce78" },
156
+ { path: "docs/templates/context/production-map.md", version: "0.7.13", vendorHash: "d6cee1d5335deac40d9a2e56b2fc27bc2122eef77f6cf77c015e34d6e24ead07" },
157
+ { path: "docs/templates/context/reference/backend.md", version: "0.7.13", vendorHash: "25e2ccb9970be0cef7d0a587af8a0e7aa4d4261c48e0aa090209b83eca0a2c14" },
158
+ { path: "docs/templates/context/reference/design-system.md", version: "0.7.13", vendorHash: "d6fea157017f70429b2f8af54dbf609c24892a95c08b787211d01b6cdbe9de7f" },
159
+ { path: "docs/templates/context/reference/frontend-methodology.md", version: "0.7.13", vendorHash: "d555c5c29d49caacba2cd3ab6d39a600fc23afeb5aafe0fe5a8868c2d99acaad" },
160
+ { path: "docs/templates/context/reference/reference-doc.md", version: "0.7.13", vendorHash: "e04f93e74041b4b3e74dbdcfc67f01ffd54070fe90d4a22d4226ba2b8fdb9460" },
161
+ { path: "docs/templates/context/reference/testing.md", version: "0.7.13", vendorHash: "c4994726c1246cfc07a14fc8aedbec8bc4ef6a7f17f7ba7db7d5bfb9f0c471ef" },
162
+ { path: "docs/templates/context/troubleshooting.md", version: "0.7.13", vendorHash: "08256329808b2d51c45ec23ac7b3efd163dacea172cb491bf57cfdf54cdb35f1" },
163
+ { path: "docs/templates/examples/example-brief.md", version: "0.7.13", vendorHash: "9c3a3f36aaf9779936bfc980edb66c0bacee001ca0fe33ba53d676da4487855f" },
164
+ { path: "docs/templates/examples/example-spec.md", version: "0.7.13", vendorHash: "a7279dcb57e68fa0996d14ddd60b6b1a1194d188db87e35a6e24ee05986d2bfd" },
165
+ { path: "docs/templates/output/README.md", version: "0.7.13", vendorHash: "e6a4e51f42e2085545ec514cad65e39e93663fd6b5b07708ca6ba97f3f00048d" },
166
+ { path: "docs/templates/reference/knowledge-lifecycle.md", version: "0.7.13", vendorHash: "f696671dae7d3bb9a99279b933eb0b3a52195bddf91e778f633bb840f99943ee" },
167
+ { path: "docs/templates/reference/output-style.md", version: "0.7.13", vendorHash: "6d122b22fc358e017eb936ed0505d33bca34c48090262b2b5e3fb0ce922a23b1" },
168
+ { path: "docs/templates/reference/spec-status-lifecycle.md", version: "0.7.13", vendorHash: "8accc0acee84301f98a2124b675bb9916bfe3174072fc96409d8d7cc6cec54f0" },
169
+ { path: "docs/templates/scenarios/README.md", version: "0.7.13", vendorHash: "137780df224ca45c402c66861e12d7a9c34b7435e82a89924fd7be363b5389dc" },
170
+ { path: "docs/templates/scenarios/example-scenario.test.ts.template", version: "0.7.13", vendorHash: "ca55be6f7a0f11bda7cc51aa5f8ba93ea363d1e6ada67c48287010c7e4a6e559" },
171
+ { path: "docs/templates/scenarios/package.json", version: "0.7.13", vendorHash: "9c1bf58f3cd555bc2c805bf9910eed0eb8768adc3b3cbd74906fbf8f57f0e9fc" },
172
+ { path: "docs/templates/scenarios/prompts/scenario-agent.md", version: "0.7.13", vendorHash: "f37ed346807ce667473af9db227ed7d5f043c97b01bc97fb1887696346f476c6" },
173
+ { path: "docs/templates/scenarios/workflows/generate.yml", version: "0.7.13", vendorHash: "bc2cc231148eb5d7224b5a7e5e982fc85f6aac7166baea1ea6a377b8ecad5a56" },
174
+ { path: "docs/templates/scenarios/workflows/run.yml", version: "0.7.13", vendorHash: "c50fa2d0ba201eba842ba87f140d0531e86d43339e17bcfc4ced0600e2e6869c" },
175
+ { path: "docs/templates/workflows/autofix.yml", version: "0.7.13", vendorHash: "d3900967afe005a8ebd524f7a18a7e06b40ec73db01c921b76c6429abc36fe3f" },
176
+ { path: "docs/templates/workflows/scenarios-dispatch.yml", version: "0.7.13", vendorHash: "ca325380f86f834c54d5290f4b8cff4064ae3fb5be31b51ded1ad44aa10d306f" },
177
+ { path: "docs/templates/workflows/scenarios-rerun.yml", version: "0.7.13", vendorHash: "7bffeac1e8f49bdef2d6978c2df21c51d896befde02d5fb6b2bf3d6db12e6301" },
178
+ { path: "docs/templates/workflows/spec-dispatch.yml", version: "0.7.13", vendorHash: "44fed6ef0edf25f0c3d7caffadbf20a480bb2e31c9ad182b864438e193bd2ad0" }
179
+ ];
180
+
181
+ // src/gitignore.ts
182
+ import { existsSync, readFileSync, writeFileSync } from "fs";
183
+ import { execFileSync } from "child_process";
184
+ import { join } from "path";
185
+ import { createInterface } from "readline";
186
+ var PRIVATE_PROFILE_IGNORES = [".claude/", ".agents/", ".pi/", ".github/skills/joycraft-*/", ".omp/"];
187
+ var SHARED_MANIFEST_PATH = "docs/.joycraft/manifest.json";
188
+ var PRIVATE_MANIFEST_PATH = "docs/.joycraft/local/manifest.json";
189
+ var CHECKER_PATH = "docs/.joycraft/check.mjs";
190
+ var JOYCRAFT_LOCAL_DIR = "docs/.joycraft/local/";
191
+ var PRIVATE_DIRS_DISPLAY = PRIVATE_PROFILE_IGNORES.join(", ");
192
+ var PRIVATE_UNTRACK_COMMAND = `git rm -r --cached ${PRIVATE_PROFILE_IGNORES.map((d) => d.replace(/\/$/, "")).join(" ")}`;
193
+ function appendGitignoreEntries(current, entries) {
194
+ const present = new Set(current.split("\n").map((line) => line.trim()));
195
+ const missing = entries.filter((entry) => !present.has(entry.trim()));
196
+ if (missing.length === 0) return { content: current, added: [] };
197
+ const separator = current.length > 0 && !current.endsWith("\n") ? "\n" : "";
198
+ return { content: current + separator + missing.join("\n") + "\n", added: missing };
199
+ }
200
+ function planGitignoreProfile(current, profile) {
201
+ const machineOwned = [STATE_PATH, TELEMETRY_PATH, JOYCRAFT_LOCAL_DIR];
202
+ const entries = profile === "private" ? [...PRIVATE_PROFILE_IGNORES, CHECKER_PATH, ...machineOwned] : machineOwned;
203
+ return appendGitignoreEntries(current, entries);
204
+ }
205
+ function sharedManifestIgnoreWarning(targetDir) {
206
+ try {
207
+ execFileSync(
208
+ "git",
209
+ ["check-ignore", "--no-index", "-q", "--", SHARED_MANIFEST_PATH],
210
+ { cwd: targetDir, stdio: ["ignore", "ignore", "ignore"] }
211
+ );
212
+ let output = "";
213
+ try {
214
+ output = execFileSync(
215
+ "git",
216
+ ["check-ignore", "--no-index", "-v", "--", SHARED_MANIFEST_PATH],
217
+ { cwd: targetDir, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }
218
+ ).trim();
219
+ } catch {
220
+ }
221
+ const rule = output.split(" ")[0] ?? output;
222
+ const detail = rule && !/:(?:\d+:)?!/.test(rule) ? ` (${rule})` : "";
223
+ return `Shared Joycraft manifest ${SHARED_MANIFEST_PATH} is hidden by the effective Git ignore rule${detail}. Teammates and clones may not receive the shared installation facts; remove or narrow that rule if this install should be shared.`;
224
+ } catch {
225
+ return null;
226
+ }
227
+ }
228
+ function validateGitignoreFlag(flag) {
229
+ const parsed = parseGitignoreProfile(flag);
230
+ if (!parsed) {
231
+ throw new Error(`Unknown gitignore profile '${flag}'. Use 'shared' or 'private'.`);
232
+ }
233
+ return parsed;
234
+ }
235
+ async function promptGitignoreProfile(intro) {
236
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
237
+ console.log(intro);
238
+ console.log(" shared \u2014 commit skills so your team gets the same workflow (default)");
239
+ console.log(` private \u2014 gitignore ${PRIVATE_DIRS_DISPLAY}; track only CLAUDE.md, AGENTS.md, docs/`);
240
+ return new Promise((resolve) => {
241
+ const ask = () => {
242
+ rl.question(`Profile [shared/private] (${DEFAULT_GITIGNORE_PROFILE}): `, (answer) => {
243
+ if (answer.trim() === "") {
244
+ rl.close();
245
+ resolve(DEFAULT_GITIGNORE_PROFILE);
246
+ return;
247
+ }
248
+ const parsed = parseGitignoreProfile(answer);
249
+ if (parsed) {
250
+ rl.close();
251
+ resolve(parsed);
252
+ return;
253
+ }
254
+ console.log(
255
+ `Unrecognized answer '${answer.trim()}' \u2014 type 'shared' or 'private', or press Enter for ${DEFAULT_GITIGNORE_PROFILE}.`
256
+ );
257
+ ask();
258
+ });
259
+ };
260
+ ask();
261
+ });
262
+ }
263
+ async function resolveGitignoreProfile(opts) {
264
+ if (opts.flag !== void 0) {
265
+ return { profile: validateGitignoreFlag(opts.flag), decided: true };
266
+ }
267
+ if (opts.persisted) {
268
+ return { profile: opts.persisted, decided: true };
269
+ }
270
+ if (opts.interactive) {
271
+ return { profile: await promptGitignoreProfile(opts.promptIntro), decided: true };
272
+ }
273
+ return { profile: DEFAULT_GITIGNORE_PROFILE, decided: false };
274
+ }
275
+
276
+ // src/install-manifest.ts
277
+ var INSTALLATION_MANIFEST_SCHEMA = 1;
278
+ function manifestPath(profile = DEFAULT_GITIGNORE_PROFILE) {
279
+ return profile === "private" ? PRIVATE_MANIFEST_PATH : SHARED_MANIFEST_PATH;
280
+ }
281
+ function rawFileHash(content) {
282
+ return createHash("sha256").update(content).digest("hex");
283
+ }
284
+ function manifestDigest(manifest) {
285
+ return rawFileHash(JSON.stringify(manifest));
286
+ }
287
+ function normalizedVendorHash(content) {
288
+ return rawFileHash(content.replace(/\r\n?/g, "\n"));
289
+ }
290
+ function normalizeManifestPath(value) {
291
+ if (typeof value !== "string" || value.length === 0) {
292
+ throw new Error("Manifest paths must be non-empty strings.");
293
+ }
294
+ if (value.includes("\0") || value.includes("\\") || value.startsWith("/") || /^[A-Za-z]:/.test(value)) {
295
+ throw new Error(`Manifest path must be a portable relative path: '${value}'.`);
296
+ }
297
+ const parts = value.split("/");
298
+ if (parts.some((part) => part === "" || part === "." || part === "..")) {
299
+ throw new Error(`Manifest path must not contain traversal or empty segments: '${value}'.`);
300
+ }
301
+ return parts.join("/");
302
+ }
303
+ function isHarness(value) {
304
+ return typeof value === "string" && HARNESSES.includes(value);
305
+ }
306
+ function isHash(value) {
307
+ return typeof value === "string" && /^[0-9a-f]{64}$/i.test(value);
308
+ }
309
+ function isBundleIntegrity(value) {
310
+ if (value === "") return true;
311
+ if (typeof value !== "string" || !value.startsWith("sha512-")) return false;
312
+ const encoded = value.slice("sha512-".length);
313
+ if (!/^[A-Za-z0-9+/]+={0,2}$/.test(encoded)) return false;
314
+ try {
315
+ const decoded = Buffer.from(encoded, "base64");
316
+ return decoded.length === 64 && decoded.toString("base64") === encoded;
317
+ } catch {
318
+ return false;
319
+ }
320
+ }
321
+ function validFileEntry(value) {
322
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
323
+ const file = value;
324
+ if (typeof file.vendorVersion !== "string" || typeof file.vendorHash !== "string") return false;
325
+ if (!["vendor", "create-once", "config-patch"].includes(String(file.kind))) return false;
326
+ if (file.ownership !== "verified" && file.ownership !== "unknown") return false;
327
+ if (file.ownedKey !== void 0 && typeof file.ownedKey !== "string") return false;
328
+ if (file.ownedRegion !== void 0 && typeof file.ownedRegion !== "string") return false;
329
+ if (file.kind === "config-patch" && !file.ownedKey && !file.ownedRegion) return false;
330
+ return file.ownership === "unknown" && file.vendorHash === "" || isHash(file.vendorHash);
331
+ }
332
+ function validateManifest(value) {
333
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
334
+ const manifest = value;
335
+ if (manifest.schemaVersion !== INSTALLATION_MANIFEST_SCHEMA) return false;
336
+ if (typeof manifest.targetVersion !== "string" || manifest.targetVersion.length === 0) return false;
337
+ if (!isBundleIntegrity(manifest.bundleIntegrity)) return false;
338
+ if (manifest.profile !== "shared" && manifest.profile !== "private") return false;
339
+ if (!Array.isArray(manifest.harnesses) || manifest.harnesses.some((h) => !isHarness(h))) return false;
340
+ if (new Set(manifest.harnesses).size !== manifest.harnesses.length) return false;
341
+ if (!manifest.files || typeof manifest.files !== "object" || Array.isArray(manifest.files)) return false;
342
+ for (const [path, entry] of Object.entries(manifest.files)) {
343
+ try {
344
+ if (normalizeManifestPath(path) !== path || !validFileEntry(entry)) return false;
345
+ } catch {
346
+ return false;
347
+ }
348
+ }
349
+ return true;
350
+ }
351
+ function parseInstallationManifest(input) {
352
+ let parsed = input;
353
+ if (typeof input === "string") {
354
+ try {
355
+ parsed = JSON.parse(input);
356
+ } catch (error) {
357
+ throw new Error(`Invalid installation manifest JSON: ${error instanceof Error ? error.message : String(error)}`);
358
+ }
359
+ }
360
+ if (!validateManifest(parsed)) {
361
+ const schema = parsed && typeof parsed === "object" ? parsed.schemaVersion : void 0;
362
+ if (typeof schema === "number" && schema > INSTALLATION_MANIFEST_SCHEMA) {
363
+ throw new Error(`Unsupported installation manifest schema ${schema}; refusing mutation.`);
364
+ }
365
+ throw new Error("Invalid installation manifest schema.");
366
+ }
367
+ return parsed;
368
+ }
369
+ function readInstallationManifestInfo(root, profile = DEFAULT_GITIGNORE_PROFILE) {
370
+ const path = join2(root, manifestPath(profile));
371
+ if (!existsSync2(path)) return { path, status: "missing", diagnostics: [] };
372
+ let raw;
373
+ try {
374
+ raw = readFileSync2(path, "utf8");
375
+ } catch (error) {
376
+ return { path, status: "corrupt", raw: void 0, diagnostics: [`Unable to read installation manifest: ${String(error)}`] };
377
+ }
378
+ let parsed;
379
+ try {
380
+ parsed = JSON.parse(raw);
381
+ } catch {
382
+ return { path, status: "corrupt", raw, diagnostics: ["Installation manifest contains malformed JSON."] };
383
+ }
384
+ const schema = parsed && typeof parsed === "object" ? parsed.schemaVersion : void 0;
385
+ if (typeof schema === "number" && schema > INSTALLATION_MANIFEST_SCHEMA) {
386
+ return { path, status: "future-schema", raw, diagnostics: [`Installation manifest schema ${schema} is newer than supported schema ${INSTALLATION_MANIFEST_SCHEMA}.`] };
387
+ }
388
+ if (!validateManifest(parsed)) {
389
+ return { path, status: "invalid", raw, diagnostics: ["Installation manifest failed schema validation."] };
390
+ }
391
+ return { path, status: "valid", raw, diagnostics: [], manifest: parsed };
392
+ }
393
+ function readInstallationManifest(root, profile = DEFAULT_GITIGNORE_PROFILE) {
394
+ return readInstallationManifestInfo(root, profile).manifest ?? null;
395
+ }
396
+ function writeInstallationManifest(root, manifest, profile = manifest.profile) {
397
+ if (!validateManifest(manifest)) throw new Error("Refusing to write an invalid installation manifest.");
398
+ if (profile !== manifest.profile) {
399
+ throw new Error(`Manifest profile '${manifest.profile}' does not match requested write profile '${profile}'.`);
400
+ }
401
+ const path = join2(root, manifestPath(profile));
402
+ const existing = readInstallationManifestInfo(root, profile);
403
+ if (existing.status !== "missing" && existing.status !== "valid") {
404
+ throw new Error(`Refusing to replace ${existing.status} installation manifest; preserve its bytes for diagnosis.`);
405
+ }
406
+ mkdirSync(dirname(path), { recursive: true });
407
+ const tempPath = `${path}.tmp-${process.pid}`;
408
+ writeFileSync2(tempPath, JSON.stringify(manifest, null, 2) + "\n", "utf8");
409
+ renameSync(tempPath, path);
410
+ }
411
+ function harnessRoot(harness) {
412
+ return { claude: ".claude", codex: ".agents", pi: ".pi", copilot: ".github", omp: ".omp" }[harness];
413
+ }
414
+ function hasJoycraftArtifact(root, harness) {
415
+ const start = join2(root, harnessRoot(harness));
416
+ if (!existsSync2(start)) return false;
417
+ const visit = (directory) => {
418
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
419
+ const full = join2(directory, entry.name);
420
+ if (entry.isDirectory()) {
421
+ if (visit(full)) return true;
422
+ } else if (entry.isFile() && isApprovedJoycraftPath(harness, full.slice(start.length + 1))) {
423
+ return true;
424
+ }
425
+ }
426
+ return false;
427
+ };
428
+ return visit(start);
429
+ }
430
+ function isApprovedJoycraftPath(harness, relative) {
431
+ const normalized = relative.split("\\").join("/");
432
+ const prefixes = {
433
+ claude: ["skills/joycraft-", "hooks/joycraft-"],
434
+ codex: ["skills/joycraft-"],
435
+ pi: ["skills/joycraft-", "agents/joycraft-", "scripts/joycraft/"],
436
+ copilot: ["skills/joycraft-"],
437
+ omp: ["skills/joycraft-"]
438
+ };
439
+ return prefixes[harness].some((prefix) => normalized.startsWith(prefix));
440
+ }
441
+ function inventoryEntries(value) {
442
+ if (!value) return [];
443
+ if (Array.isArray(value)) return [...value];
444
+ return Object.entries(value).map(([path, entry]) => entry.path === path ? entry : { ...entry, path });
445
+ }
446
+ function contentEntry(value) {
447
+ if (typeof value === "string" || Buffer.isBuffer(value)) return { content: value };
448
+ return value ?? {};
449
+ }
450
+ function readLegacyState(root) {
451
+ for (const relative of [STATE_PATH, LEGACY_CLAUDE_STATE_PATH, LEGACY_VERSION_FILE]) {
452
+ const path = join2(root, relative);
453
+ if (!existsSync2(path)) continue;
454
+ const raw = readFileSync2(path, "utf8");
455
+ try {
456
+ return JSON.parse(raw);
457
+ } catch {
458
+ return raw;
459
+ }
460
+ }
461
+ return void 0;
462
+ }
463
+ function adoptLegacyInstallation(root, options) {
464
+ const entries = inventoryEntries(options.inventory);
465
+ const candidates = options.candidateContent ?? {};
466
+ const trusted = /* @__PURE__ */ new Map();
467
+ for (const item of options.catalogue ?? HISTORICAL_VENDOR_CATALOGUE) {
468
+ try {
469
+ const path = normalizeManifestPath(item.path);
470
+ const records = trusted.get(path) ?? [];
471
+ records.push({ ...item, vendorHash: item.vendorHash.toLowerCase() });
472
+ trusted.set(path, records);
473
+ } catch {
474
+ }
475
+ }
476
+ const activeHarnesses = HARNESSES.filter((h) => hasJoycraftArtifact(root, h));
477
+ const diagnostics = [];
478
+ const conflicts = [];
479
+ const files = {};
480
+ let targetVersion = options.targetVersion ?? "legacy";
481
+ const discoveredLegacyState = readLegacyState(root);
482
+ const suppliedLegacy = options.legacyState ?? discoveredLegacyState;
483
+ const legacyRecord = suppliedLegacy && typeof suppliedLegacy === "object" && !Array.isArray(suppliedLegacy) ? suppliedLegacy : void 0;
484
+ const explicitHarnesses = sanitizeHarnesses(legacyRecord?.harnesses);
485
+ const selectedHarnesses = explicitHarnesses ?? activeHarnesses;
486
+ for (const entry of entries) {
487
+ let path;
488
+ try {
489
+ path = normalizeManifestPath(entry.path);
490
+ } catch (error) {
491
+ diagnostics.push(String(error));
492
+ continue;
493
+ }
494
+ const harness = HARNESSES.find((h) => path === harnessRoot(h) || path.startsWith(`${harnessRoot(h)}/`));
495
+ if (harness && !selectedHarnesses.includes(harness)) continue;
496
+ const diskPath = join2(root, ...path.split("/"));
497
+ if (!existsSync2(diskPath) || !lstatSync(diskPath).isFile()) continue;
498
+ const current = readFileSync2(diskPath);
499
+ const candidate = contentEntry(candidates[path] ?? candidates[entry.path] ?? entry);
500
+ const suppliedCandidateHash = candidate.vendorHash;
501
+ const candidateHash = (suppliedCandidateHash && isHash(suppliedCandidateHash) ? suppliedCandidateHash : candidate.content !== void 0 ? normalizedVendorHash(Buffer.isBuffer(candidate.content) ? candidate.content.toString("utf8") : candidate.content) : "").toLowerCase();
502
+ const currentHash = normalizedVendorHash(current.toString("utf8"));
503
+ const verifiedTarget = Boolean(candidateHash && currentHash === candidateHash);
504
+ const historical = verifiedTarget ? void 0 : trusted.get(path)?.find((record) => currentHash === record.vendorHash);
505
+ const verifiedHistorical = Boolean(historical);
506
+ const ownership = verifiedTarget || verifiedHistorical ? "verified" : "unknown";
507
+ if (ownership === "unknown") conflicts.push(path);
508
+ if (!options.targetVersion && targetVersion === "legacy" && candidate.vendorVersion) targetVersion = candidate.vendorVersion;
509
+ files[path] = {
510
+ vendorVersion: verifiedHistorical ? historical.version : candidate.vendorVersion ?? targetVersion,
511
+ vendorHash: verifiedTarget ? candidateHash : historical?.vendorHash || candidateHash,
512
+ kind: entry.kind ?? "vendor",
513
+ ownership,
514
+ ...entry.ownedKey ? { ownedKey: entry.ownedKey } : {},
515
+ ...entry.ownedRegion ? { ownedRegion: entry.ownedRegion } : {}
516
+ };
517
+ }
518
+ const manifest = {
519
+ schemaVersion: 1,
520
+ targetVersion,
521
+ bundleIntegrity: options.bundleIntegrity ?? "",
522
+ harnesses: [...selectedHarnesses],
523
+ profile: options.profile ?? parseGitignoreProfile(legacyRecord?.gitignoreProfile) ?? DEFAULT_GITIGNORE_PROFILE,
524
+ files
525
+ };
526
+ const legacy = suppliedLegacy;
527
+ const legacyUnknown = legacyRecord ? { ...legacyRecord } : legacy;
528
+ if (legacyRecord) {
529
+ for (const key of ["version", "files", "gitignoreProfile", "harnesses", "autoOpen", "updatePolicy", "dismissedRelease", "lastCheckedAt"]) {
530
+ delete legacyUnknown[key];
531
+ }
532
+ }
533
+ const localSettings = {
534
+ ...legacyRecord && typeof legacyRecord.autoOpen === "boolean" ? { autoOpen: legacyRecord.autoOpen } : {},
535
+ ...legacyRecord && legacyRecord.updatePolicy !== void 0 ? { updatePolicy: legacyRecord.updatePolicy } : {},
536
+ ...legacyRecord && typeof legacyRecord.dismissedRelease === "string" ? { dismissedRelease: legacyRecord.dismissedRelease } : {},
537
+ ...legacyRecord && typeof legacyRecord.lastCheckedAt === "string" ? { lastCheckedAt: legacyRecord.lastCheckedAt } : {},
538
+ ...legacy !== void 0 ? { legacy: { state: legacyUnknown } } : {}
539
+ };
540
+ return { manifest, localSettings, diagnostics, conflicts };
541
+ }
542
+
543
+ export {
544
+ SHARED_MANIFEST_PATH,
545
+ PRIVATE_MANIFEST_PATH,
546
+ PRIVATE_DIRS_DISPLAY,
547
+ planGitignoreProfile,
548
+ sharedManifestIgnoreWarning,
549
+ resolveGitignoreProfile,
550
+ INSTALLATION_MANIFEST_SCHEMA,
551
+ manifestPath,
552
+ rawFileHash,
553
+ manifestDigest,
554
+ normalizedVendorHash,
555
+ normalizeManifestPath,
556
+ validateManifest,
557
+ parseInstallationManifest,
558
+ readInstallationManifestInfo,
559
+ readInstallationManifest,
560
+ writeInstallationManifest,
561
+ adoptLegacyInstallation
562
+ };
563
+ //# sourceMappingURL=chunk-Z5JFEGWG.js.map