@xgent-ai/skills 0.7.5 → 0.7.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/.claude/hooks/xgent-statusline.js +32 -18
- package/README.md +61 -35
- package/bin/phoenix-diagram.js +14 -0
- package/bin/xgent-skills.js +166 -240
- package/dist/phoenix-diagram/LICENSE +21 -0
- package/dist/phoenix-diagram/NOTICE.md +34 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/005fc765ddc5115da796cca915baa9557abae13ff35e0a47c47affc56f6c414d.txt +272 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/010492e490b92ec85db01daad2a290ea5959f29314a1c4ff25e7a172e223abf9.txt +18 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f.txt +3 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0218327e7a480793ffdd4eb792379a9709e5c135c7ba267f709d6f6d4d70af0a.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/02bb8c3b4e70190e3986c0404ad2fd8d639b4f534252d82379cc1b502b6d1812.txt +191 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0444c6991eead6822f7b9102e654448d51624431119546492e8b231db42c48bb.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0552c898248eadfc130df0c0e8f6f82776fcb3f1dd5a5af2fa991b5baff9367a.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0ab4d106b6faac07fb6a051815fd1b4d862d730895e2d7d7358c2f13565e7a38.txt +20 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0d3f7c086c6b6cf3ea4aac714e9aa3e1fb02e355ce35bd21c56acf8d04390885.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/117829c3ca21efb132d81a44b55363d395ab8eea18526873bc828da4c0e5f038.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/123a331b5dbf04c30097fa43b8f858bc85df671fe776de498d01f3d6b7c1f69e.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/1a2f5c12ddc934d58956aa5dbdd3255fe55fd957633ab7d0d39e4f0daa73f7df.txt +26 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5.txt +373 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/1f485f0d6125658861351e3d6084ea90fefe78f89450be9915044b7c56d5a75a.txt +15 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b.txt +26 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/20c7855c364d57ea4c97889a5e8d98470a9952dade37bd9248b9a54431670e5e.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/20fe7b00e904ed690e3b9fd6073784d3fc428141dbd10b81c01fd143d0797f58.txt +176 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/219920e865eee70b7dcfc948a86b099e7f4fe2de01bcca2ca9a20c0a033f2b59.txt +7 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d.txt +7 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3.txt +23 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5.txt +220 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/28a9529c7d0bb4dc51f4bf5c116a3d16ef247a052f7591466768ddf563fd1cf5.txt +428 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/29e9fe5074bd27e0e5d5d110394fbbcd841baee2651a3c4b4560a632702cede4.txt +26 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/30fefc3a7d6a0041541858293bcbea2dde4caa4c0a5802f996a7f7e8c0085652.txt +23 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3521672491a3479422d5fe1aca6645dd2984090f85da6e5205abfb18fb7a6897.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/35242e7a83f69875e6edeff02291e688c97caafe2f8902e4e19b49d3e78b4cab.txt +176 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/36516aefdc84c5d5a1e7485425913a22dbda69eb1930c5e84d6ae4972b5194b9.txt +23 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/375bdbf54d6584debb4bcc5bce1c9dcfdd581f977c9a8469113dbdf208f4c927.txt +131 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/391a5396cec6230bfabd4ef4eb2350eb895bc5efce377a2218f5702ed020d3e3.txt +20 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/39712155836e5c10ef1b07037b606e4ad2d633e72205d162fdd7e2290aa54f15.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3bb1e548250b3acc43febde65a5cdba9f2e0a3288018aa41f009a3c59ffab51a.txt +390 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3bc70e239e91272782006c638fc0452a714d384224f11f0923036b7be07cf9b5.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04.txt +373 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3f941b3b89cf7b8370ceb83cc76d2120d471b58735d8ca60238a751a48d7f72f.txt +359 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/3fa4ca83dcc9237839b1bdeb2e6d16bdfb5ec0c5ce42b24694d8bbf0dcbef72c.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/42fa16951ce7f24b5a467a40e5b449a1d41e662f97ca779864f053f39e097737.txt +26 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/4455bf75a91154108304cb283e0fea9948c14f13e20d60887cf2552449dea3b1.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/451167c55c0fa447cc2d5632714f5e3c567fe4f1e1badefab2c1333852198aca.txt +542 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/45f522cacecb1023856e46df79ca625dfc550c94910078bd8aec6e02880b3d42.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/45fd05c4865e7c350b98ad7ac50e1b15462d49af4a91e9b0c9dd933dc9a69742.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/4789210f4df8abc03fce1cddd9c2ba517f184840687f2815d741de282c1aa93a.txt +228 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/4cada0bd02ea3692eee6f16400d86c6508bbd3bafb2b65fed0419f36d4f83e8f.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/516b24e051bf5630880ebbd55c40a25ce9552ebaf8970a53e8976eb70e522406.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/553fffcd9b1cb158bc3e9edc35da85ca5c3b3d7d2e61c883ebcfa8a65814b583.txt +13 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/5757a1f28eff735a8b5e7425478f367812d71e974530f5bedd01219480965f4a.txt +51 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/5b698ca13897be3afdb7174256fa1574f8c6892b8bea1a66dd6469d3fe27885a.txt +19 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/5e05b024f653a5ce199e77cbbbd42fb5553562ec714b819421ed0c3e552a75d7.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/60a7062291b01ba068f300612cdbdc20382ac1d4934f07bcdd7167c15299f309.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a.txt +176 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/6df43f6f4b5d4587f3d8d71e45532c688fd168afa5fe89d571cb32fa09c4ef51.txt +187 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/709e3175b4212f7b13aa93971c9f62ff8c69ec45ad8c6532a7e0c41d7a7d6f8c.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/71674605ec4c087fe9eb534e3e4f9e26eb2e4aabcd76a29fd156c6a844d44b3d.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7365cc8878a1d7ce155a58c4ca09c3d7a6be413efa5334a80ea842912b669349.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7abd9b6960dcf7d4d0a48606a5b71bfe37d472db68d70637f3a58a56785f1621.txt +13 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7ca6700600dfa9c9497bf5556365067daa802c871ea78239f129309c7a2048f7.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7cfafc877eccc46c0e346ccbaa5c51bb6b894d2b818e617d970211e232785ad4.txt +15 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c.txt +24 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7e5886959f67f8c75063a9d55cd3cb08c5a8cbea9a944fa1df2d4ae038f53721.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/7fea0ee51a4ca5d5cea7464135fd55e8b09caf3a61da3d451ac8a22af95c033f.txt +20 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/83c1763356e822adde0a2cae748d938a73fdc263849ccff6b27776dff213bd32.txt +24 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/86dd7f026f916daf7511e39951ad8ea8cf55a8db67ae64060dacf829761c18f3.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8a35369f3ca263b3c62fbb5032947e53b6bfebc6c8a4d1bb982de1c069f6fba5.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8b43ce8accd61e9d370b5ca9e9c4f953279b5c239926c62315b40e24df51b726.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8bb1b50b0e5c9399ae33bd35fab2769010fa6c14e8860c729a52295d84896b7a.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8bce3b45e49ecd1461f223b46de133d8f62cd39f745cfdaf81bee554b908bd42.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/8c7516d4b27b1e495be5e38b612298b63de48d05f49cdac94f70f3cd70f8864b.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9046848b63a5c92bff14e4accca80bd987e0623b74adf9226ce5198d312b79d5.txt +30 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5.txt +12 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9117d922e667125508dde62b02c1f57ed22f5ad21eb536aa2e2d99e1c796e639.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9387c2d197e2370a740ca457dae1662c56de56b811ee4862024343961307f9bf.txt +19 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/946c9835d8034d24404f8cfec5f4654cee5dad17e944afc3d06d742cf2882831.txt +240 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/95bd3988beee069fa2848f648dab43cc6e0b2add2ad6bcb17360caf749802bcc.txt +176 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411.txt +396 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9d185ac6703c4b0453974c0d85e9eee43e6941009296bb1f5eb0b54e2329e9f3.txt +202 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9e0dfd2dd4173a530e238cb6adb37aa78c34c6bc7444e0e10c1ab5d8881f63ba.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9f2ae19ef94ba82887729a4a1617ff25eede56611dd21a4b2c6f797df30fca33.txt +2013 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/9fa38f610a00115dd1f612bdd3559e3b381ea579538b6ff25a5899da250a5fce.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a00511478c83ebb464ef19d840f061c7444adc4636bb561900e75c5808cfc6cc.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a2010f343487d3f7618affe54f789f5487602331c0a8d03f49e9a7c547cf0499.txt +121 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a5dea80c1f383cb5f80a6bb0da5e55a2beb9f24adb123ce6300af2cbaaa3bf65.txt +19 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a825bd853ab71619a4923d7b4311221427848070ff44d990da39b0b274c1683f.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/ae9baa7beea910273c2f384c2a6b721fb7bd02bda3436074a1072e4ee689f985.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b1181a40b2a7b25cf66fd01481713bc1005df082c53ef73e851e55071b102744.txt +19 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b38f11f6096706e6de553dabe2a7ed142d59b6fa8c97e290c67496154745cdd5.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b3d734001a94efff3579978d953391aa7115f877657d25eb54037a43875d078a.txt +9 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b4eb00df6e2a4d22518fcaa6a2b4646f249b3a3c9814509b22bd2091f1392ff1.txt +27 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b68ad1a3367b825447089e1f8d6829b97f47a89eb78d2f4ebaef4672f5606186.txt +22 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/b7e650f3fce5c53249d1cdc608b54df156a97edd636cf9d23498d0cfe7aec63e.txt +19 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c09aae9d3c77b531f56351a9947bc7446511d6b025b3255312d3e3442a9a7583.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c16f8dcf1a368b83be78d826ea23de4079fe1b4469a0ab9ee20563f37ff3d44b.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383.txt +21 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c30152c94a6d75e021adbc52b3a52470366a46edb917e17deae3259251af244c.txt +42 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c394e3bda1f3b9378f30a7cab11242887eeeafc73c7bef36a0fe13e09691e18b.txt +17 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4.txt +201 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c962ee4d1d05ddc138b202b2540219ebc57893fcf97b364852094a9a94ce1365.txt +7 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30.txt +202 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/d1fc1bc0d155df60b2e7705b6b2ae02a05c96f948e1cec6e2fb86360b09f346b.txt +29 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/d5c22aa3118d240e877ad41c5d9fa232f9c77d757d4aac0c2f943afc0a95e0ef.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/d5fca2653c88ad02d197faead77e22b80c70636b5bec6e02f2805f389a21b86d.txt +10 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/db11fec9946737df39ca3898d9cd8c10ec6f6c3a884a6802b0ad0b81b4e8f23a.txt +1 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/dc91f8200e4b2a1f9261035d4c18c33c246911a6c0f7b543d75347e61b249cff.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/ddea4e94a1c35ed9826e54e13a5b50b8f81b21665a00ca07c8861f1859e56b6b.txt +14 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/e271993808fec50ab29350b39539cdec611a9103f827e0aa26d61da70e2d33f8.txt +61 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/e66c269d4819aaab34b49ef5220c4ddab6756f21bb5180761a4eb8561f2b7bbd.txt +438 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/ecc269ef87fd38a1d98e30bfac9ba964a9dbd9315c3770fed98d4d7cb5882055.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829.txt +22 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f025ccfb7dfb6bdfedc75ca0f67acc69e6fb4998143d834f7c2f38a29989680f.txt +13 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f367c1b8e1aa262435251e442901da4607b4650e0e63a026f5044473ecfb90f2.txt +46 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f51ac2c59a222f7476ce507ca879960e2b64ea64bb2786eefdbeb7b0b538d1b7.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f7715d38a3fa1b4ac97c5729740752505a39cb92ee83ab5b102aeb5eaa7cdea4.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f7db81051789b729fea528a63ec4c938fdcb93d9d61d97dc8cc2e9df6d47f2a1.txt +39 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/f9c4c77baa3828004ee54b8a4f2db2e88ed44a6237a493965bf551fac0fcb62d.txt +17 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85.txt +373 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/fb77f0a9c53e473abe5103c8632ef9f0f2874d4fb3f17cb2d8c661aab9cee9d7.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/ff8f68cb076caf8cefe7a6430d4ac086ce6af2ca8ce2c4e5a2004d4552ef52a2.txt +25 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/ff92bed461f50338dd703a9ba9aee496a425957873df1d91192776e4bdf5dda7.txt +74 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/COPYRIGHT-library.html +29357 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/Apache-2.0.txt +73 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/BSD-2-Clause.txt +9 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/CC-BY-SA-4.0.txt +427 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/GCC-exception-3.1.txt +30 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/GPL-2.0-only.txt +133 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/GPL-3.0-or-later.txt +202 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/ISC.txt +7 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/LLVM-exception.txt +15 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/MIT.txt +9 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/NCSA.txt +29 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/OFL-1.1.txt +43 -0
- package/dist/phoenix-diagram/THIRD-PARTY-LICENSES/rust-std-1.99.1/licenses/Unicode-3.0.txt +39 -0
- package/dist/phoenix-diagram/THIRD-PARTY-NOTICES.md +210 -0
- package/dist/phoenix-diagram/THIRD-PARTY.json +5459 -0
- package/dist/phoenix-diagram/VERSION.json +39 -0
- package/dist/phoenix-diagram/bundle/ENGINE.json +39 -0
- package/dist/phoenix-diagram/bundle/SKILL.md +109 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.architecture.json +11 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.class.json +23 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.dataflow.json +11 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.erd.json +25 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.lifecycle.json +11 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.sequence.json +13 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.timeline.json +15 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.tree.json +13 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.waterfall.json +12 -0
- package/dist/phoenix-diagram/bundle/examples/minimal.workflow.json +12 -0
- package/dist/phoenix-diagram/bundle/manifest.json +253 -0
- package/dist/phoenix-diagram/bundle/references/architecture-compare.md +111 -0
- package/dist/phoenix-diagram/bundle/references/authoring-defaults.md +42 -0
- package/dist/phoenix-diagram/bundle/references/brand-marks.md +52 -0
- package/dist/phoenix-diagram/bundle/references/compatibility.md +22 -0
- package/dist/phoenix-diagram/bundle/references/delivery-contract.md +127 -0
- package/dist/phoenix-diagram/bundle/references/extending-types.md +14 -0
- package/dist/phoenix-diagram/bundle/references/migration.md +57 -0
- package/dist/phoenix-diagram/bundle/references/preview.md +45 -0
- package/dist/phoenix-diagram/bundle/references/repository-authoring.md +29 -0
- package/dist/phoenix-diagram/bundle/references/viewer-runtime.md +27 -0
- package/dist/phoenix-diagram/bundle/schemas/README.md +23 -0
- package/dist/phoenix-diagram/bundle/schemas/architecture.schema.json +329 -0
- package/dist/phoenix-diagram/bundle/schemas/class.schema.json +348 -0
- package/dist/phoenix-diagram/bundle/schemas/common.schema.json +358 -0
- package/{skills/archify → dist/phoenix-diagram/bundle}/schemas/dataflow.schema.json +36 -8
- package/dist/phoenix-diagram/bundle/schemas/erd.schema.json +384 -0
- package/dist/phoenix-diagram/bundle/schemas/lifecycle.schema.json +202 -0
- package/{skills/archify → dist/phoenix-diagram/bundle}/schemas/sequence.schema.json +41 -10
- package/dist/phoenix-diagram/bundle/schemas/timeline.schema.json +170 -0
- package/dist/phoenix-diagram/bundle/schemas/tree.schema.json +144 -0
- package/dist/phoenix-diagram/bundle/schemas/waterfall.schema.json +150 -0
- package/{skills/archify → dist/phoenix-diagram/bundle}/schemas/workflow.schema.json +42 -10
- package/dist/phoenix-diagram/bundle/scripts/phoenix-bootstrap.cjs +589 -0
- package/dist/phoenix-diagram/bundle/scripts/phoenix-diagram +6 -0
- package/dist/phoenix-diagram/bundle/scripts/phoenix-launcher.cjs +10 -0
- package/dist/phoenix-ui/THIRD-PARTY.json +164 -158
- package/dist/phoenix-ui/VERSION.json +17 -17
- package/dist/phoenix-ui/bundle/blobs/00727f7b333a7be8ac7740aa257a3a3f691db8ae545a6afab2b787acab5e88df +46 -0
- package/dist/phoenix-ui/bundle/blobs/{547e3c89d5b8feeddd67e43131fd84b95253eb42bf7d730b4e471dba011f6e51 → 00f4a6a630f31eb05fbdd5725e4a294233d24574bd70f4f32f4597d8256a7c1c} +0 -4
- package/dist/phoenix-ui/bundle/blobs/{41400e182e2180a567923d58bfa935d2799a54f2a747b2c5813c3884c84f768b → 04057592e18ea9dd3c4edcac14cde3fa5b75239c2552d4459db8e047068f61a8} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{34571f7d46632205d518d15cb008457494dfad745c6b483bb11d63ca3a22ac48 → 0cb3bf26e1980b0e530373fb32edbe5864a171492a04e2abe1952ffe78bff231} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{852d2943678a76c33b2f7a090d2ca6c152cd120e9ae62775fcc91519b9289011 → 0e684572eb98d24b39cd70fa23e66c163178f5a11756dcf8a98fe2335636b33f} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{d17b3a454146e74ef4ecf69d7b72a8fa45c4fe1c695dffb0d36690b653cd2d8f → 10553c45c7bf38e527a57a281c4365152a768b4dd7ef597ff34ae841e9ff7d41} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{e49257c0fd32b195cccb16fbfda769c007be6b38f25aceefecd23cfff9366cec → 125bc7030d7f2ba789d7b1d5f474af34f8902b764e7bc351b98f1f6f55779929} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{74dbcbbad6c3831e95abb38775dd488c59ae9f1d44a95f5fd4bc0051577488fa → 13cf6c054ed424e2eb639ea12d20a4aa2b1c85eeb00afa8cbd8a30c6c22aadd8} +1 -1
- package/dist/phoenix-ui/bundle/blobs/1832ff9624cebd30370eb0e806665c656ac879215f93d33bcc0750baa47459dc +46 -0
- package/dist/phoenix-ui/bundle/blobs/{8e7de5ca347036a07f5f1e9cab942d8ff378d029bc101fa6d126406f3298c9db → 1864a10c29e7062cca5e49d1790dc7d9d8ea777bfa2ab6fd941635965cd0084d} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{784722b72224a7005a80cdcd6408dd2b25b23fd9619d0f6c8788f7ac681fad4c → 1ecc81de39d28b85b95e797bcc338d4213a50231c3315a741d14571fd22c844f} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{b8c614dc7c2eb30ee0f864fec116dbcafb39e5a199dce66d0c1a88b13f76265a → 2079e4146039a8dadf19a39237cbdc0b8b54ea1fa16d320716c2cbf58161c835} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{dba6e4a09c5d752e5ddebe7c2c1aefc9c4b2a84e01a3178599579778ed2d09e9 → 2813aa68c0804a7fe061d88201d8a684cac9987b48511e1e2cbfe0a869a67a82} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{2889c2817b5079abff254bb6d13f92dbde0fabc38be4acc7d20e613eef5e5829 → 2873e340be947c83c3d03520139b73524fd166a34063d2693d3b711021ea5b87} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{64c4aa2d1c24ae5028e987498ac544020d48600a51d9654b2df562681ba480f2 → 298ef41899acefa056eccf2345378078832db6d868d2377f471f896d5c1599f9} +6 -14
- package/dist/phoenix-ui/bundle/blobs/{1b7174a6f3f49a8efc8f7fa74ff84cf8960e2646b9bc976e4129a7c8ad608faa → 2b5cef2a14a5b1256ec6de9172a4f57f227948ced1921ef86e899f48524d7fb8} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{f148f630f43f3c91cf10feeda5a3c21448ca0683ce82d0fe763c1b43dee584d6 → 2d376cbbf7ec1e262614aac4f1b200e8f60e86e940c7137a2a26788bc857e509} +6 -7
- package/dist/phoenix-ui/bundle/blobs/2e5985a6eb339d70cfa25f6d2b420a0ef286caa8467f0226eb841702ec438d0b +46 -0
- package/dist/phoenix-ui/bundle/blobs/{7e199833376de5d2b6e088ee2965b448f94da842f28ccbd707e1cc3a295147c8 → 3322d691bf7b578b38723576df6b266993b2afb9e567b0cd1ded898ffe1dc17e} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{f82bfc4c6bc9169d4978d5e16fb925f6e152fdd21dc6a2fae719dfdc1645581f → 3625c5c2750f117021232ce81c1e39ac5ef7c21445729327b88cf54dfc937df0} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{2ceacad745665f79fd7ad5565646426a36a1b508c0469b931d0f202fad45a80b → 36310febe3e7bd4c9b21407603f2a04afefdc87b7821758bb47098b1b2876765} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{24d92a176573768bfffaf8f9c6483e58bceb5bf2a095d1cdf3d3a2c0bcda0707 → 3a9c2daf4ef284ca83b0e7f6fef3a5300e273c32b20769e090463cb8a8b0b06f} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{153e377c44b162cf0074698a61716db7f664db78f5635efa926bed484de4f54c → 3ce1a44efe39b93e7a39307c6a5e5f514e938fbae818e358986b4db1b05883ca} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{ad8ad0b7acf6c88ef9ce0ee1a640c2200da77821f0d97d605d4f1d4a10e5897a → 403fcde498d75abec7844ee31434201152ac229f7675772164d69563f0572da4} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{e8ee6c08e94b80324173d89d6f4cdc5b4829ea6858b3a11fc186588a490cada4 → 45d0e7eff0923c40296e971318756617944c4f1c97f03126cd74c0f8c629f8a4} +3 -1
- package/dist/phoenix-ui/bundle/blobs/{e23dabf908842be08751fc4e7f3b586e8c6b1ca0fc30303ec5317c77f83dcf26 → 4c0f396bfa85171f61972d3f3765733318769bb53fe06d2cdcb5d7f64578b5b8} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{a5517d32c1539c388c47c00879a0d807ed2989647bfa8c0844ef22328f75f5be → 4f6563876e0e0cc51c38a06767b8800eb3238611e9fdd11e5ff9dd487c742e74} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{a9d2203acd45ca33a13d5c68b02b23ed512425ac15f0e8438318ed124b43729d → 4fcada229d0c689c1a493d13184145a81ff40c498e882142ae390bda8e5b2492} +15 -0
- package/dist/phoenix-ui/bundle/blobs/5293adc55cf66068b6df20468ad9e91433fd1c48e75d66c86f874aca951a8fb9 +46 -0
- package/dist/phoenix-ui/bundle/blobs/{96e2e6bd4fcf9a2c6da65fb029f96d9176308fae2efd9d8653d3b8d838960e07 → 5436f0301ec258f3badcc6842019ee29a9b870d2727dc425fbc9cc0f4f88a284} +3 -1
- package/dist/phoenix-ui/bundle/blobs/{d0f4939e86a62b0ca437d51a997ceba7e77d64566b7fa8ca2747487e31ca819d → 54a09a4afdffca3cc135e5007716ea684dc1ed7a78349de859225c55a2fed810} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{d5102701d41f7c6195d410a873f742ac72c428b04196e47df5555c5ccaf80504 → 55277fa15eb4bd2f09bf7bb24c4e79df417b06654b1e10f502c7928b192fd7cc} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{878064e46af4e4109bab405f965e4149bee40bbe8912ffede10b74cec6cff027 → 567c3f42394f9aee9b048a001016a7ba9d8773d78027f8c995c379886634e719} +6 -3
- package/dist/phoenix-ui/bundle/blobs/57c8f33a7401f918566b8a4883871a69ef2223438c51f158c67f69e3250be465 +46 -0
- package/dist/phoenix-ui/bundle/blobs/{bc29e115fd337dda2cc7fc70b868dc18e426b08ec186fd270fcfe96bb2efaa5d → 61450dbef64859e3136cd17ae3e997134d5df5721d96985c4e07367f38522129} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{e3c1e925be0b2deb0e3765b83ab94b86560292364f275e98bb23a8bdf2c2e049 → 656bbfda3e72b40d53b5832293dc8700ad8a784e804a6246271bf0ea23527822} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{ffcaa5c58e779ec74d18bfc3013ad8003f6e7a23f629c1a3b878618961a8b6a3 → 68b454a99ba72c3b9b93ed96c4267847297169f6a5bf321b20e60d637c271068} +6 -3
- package/dist/phoenix-ui/bundle/blobs/68e44832c82b873b0aeb2da56def7b1de5f612c019445e5e28238c690124cbbe +46 -0
- package/dist/phoenix-ui/bundle/blobs/{45bbd4a8e02ca0012216c5c68e1dcd655ae0046bd50ba4295ef1f58ec4a0957c → 6b8d4c71355429a0b16bf367163fea46103a0a99b4e34f87608a39d85b1b980a} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{264815d0080e4862715a4f82542e66241c6563f07259d32aed4a17bbc329b9cc → 6cef874722442de7c60ea96f4221dc54cc4250a270cd05a1e818b58c5b43e232} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{2028a857c0476324a4256faf66693e2a869275e53a88d2b182a28b62c2a17893 → 7181f1f4c452c4345695f9100f6deb610f54f4c55f126043433a65b8491fc680} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{ccb76aabba47938d518a5d46a09d7e70c4a9222bc391e163763f2a7f12d30437 → 75850a8c9d2a8259f71ef1f86dd5d1325415227c1887e81a3467ae1ee400979f} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{4b03cdb5b17d534b5c7e84b079c066f59e8b60b9e454671a453867c4aeb9920d → 77bcc6c2d6ac00a8bfead3b6c6b5fc69f4b60bf086ebbc89271e1b23003168c9} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{9520e25a381c82af6f46e175b7c347d1dc513d933dd6cf8c52570c72abb4ca7f → 792552563745d208594cf4ade19110f2c811a0e1a2661ae1ef43a185ccff5a69} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{f7c8af35acf71a96056afb6afcff6a3ea42f65561f02652d04e11ad9ece9b8e9 → 7acd9b6f2f61b509c6a518508b8b52c2f0de67cdea4fd3f3d383b3ce8b38cf5e} +6 -7
- package/dist/phoenix-ui/bundle/blobs/7bacc1e3da7e8b7127ca3f8f69a2422098b9b2d23fbedefc56dfe76117c1c0e3 +46 -0
- package/dist/phoenix-ui/bundle/blobs/{78662176c1d31cec2d640f70df203f93cc1aec604cfc31619f4d2c62ab78861b → 8078b804bea630ed9c4ea07ec2f8ac92aba4128725860a66599eda90390d98f6} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{2291169748fe0c4c80634dff3083e7464f82d4358b9b2186759b316e612d466f → 88b150cb804bc141b80a5687a091f61b99627155c465a27adb88546ef615af92} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{bde88bf5ac59d744440d9b65f95ceaae01c803b101d48e6afd644a06eeb5de63 → 90f8b07ec12b78e633e306322cda58415aea70d8e0f9ff85bd439361c01dabe1} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{486145071d3445e82774f1b39b2bb15986ce52277e798a31ef7e9c27afb42af3 → 95b2944686e8258a655c3b5e6db68593e24e5199354e46aac553918ea2c0f55a} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{a1998e37084c11f496d4970f86a85d5a6375bbeaa4797b9f42bbac2d44048d23 → 979639f0e8859d600a8db57e733566d9ad37ff8258c3e05a6f9c0f3008e92373} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{3173293607055ea6e1a153ec6f51fb8154782157c8a61abf411da1f41be61728 → 9eaaa00049844060f842fe7fb73cc8edc4be5225cf38a96f33bda3ffc381456c} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{69086f7cb235b35ccc230e1f2da41cbb10cea8f0636b6d4514672113a3adc2cb → a420bbda622399399a6b5c7c3614dcaebc6c62faceaf7b3c83c97db53d26b165} +1 -1
- package/dist/phoenix-ui/bundle/blobs/a63054b8920905045753facece83f154bf806158c6f46ef380036e7a82d4fde5 +46 -0
- package/dist/phoenix-ui/bundle/blobs/{e802e4f7bdc89050a9c0f2ca506e1d493a2316e6e810c0336c57aa073717ef3e → a63788c764b0e4fdcbc029d46093016310edcbcf702d62688e5aaac7ddeee6fd} +3 -1
- package/dist/phoenix-ui/bundle/blobs/{827a211ea03d2cb44b4ea1bc81ba1a6dc51a87fa16d6692997c4e4751241c815 → acfc4c26b135d5b27fc0930738486c9d43d379704102fab45564320180942e4b} +4 -2
- package/dist/phoenix-ui/bundle/blobs/{8da14f3eabac53c990a66e721387367b46cb676cc4204e8c67d6f88c95a6217f → ad243ca615349127aa422bccc1a6604ad17149735659087ca5bab3c5fae97f4e} +6 -7
- package/dist/phoenix-ui/bundle/blobs/b63931066e2b2623d012e1a3c1a0769cc43ed6640460c3899669b45539d6a20d +46 -0
- package/dist/phoenix-ui/bundle/blobs/{bb65af58ecc3e0c0093dc9a705a7ab643035e4e592c3adb93583c82d1aef1f51 → bde793ab5ad776f7e6f6d25ce2b838c1b5022054a1dad5502a873423eb0ad917} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{8de7c97949b0bc4194b3be7645e4b13e9419767927482d01cf19476f6cbeda14 → c0a70ab2889e5c16e1f09249aefad948ce352c42cfe2b5afb758a4524e1b21b6} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{60b2914df394800688c4e20f4eb34e117cd430df9954cf4d48574734507723f4 → c9ee9006ae6c0194a5d39a9f0cb275c52d74a71ea3f6dc2b4c1c7bd89f48a2c0} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{6d8315e307eab11d3236935daf7267746cce6da3b51296e6999651ac97bda3a3 → cadc2daefcf238aab981fa56388381d3d5ab9c0686bb9dd8187035c9933dfcee} +6 -3
- package/dist/phoenix-ui/bundle/blobs/{d7b744fcc95164d96d9f811a93e2e8a374887146eb762ef775f3d3c7f27abc8d → cbea5728b90f58ff047be6ec4f14eed9d63c7148f5db99b5f147d2f17b472317} +1 -1
- package/dist/phoenix-ui/bundle/blobs/d408a4fea71b656aa8a5f6b5c037815a6e4229df336629ebddf4b5c85ed82fac +46 -0
- package/dist/phoenix-ui/bundle/blobs/{6ff950a5729ad9ea480ddf8c1b489b1c84189bbf7d6034b3b5a98e7c11a28cec → d9ae0c782d8a77787561536c0d7bc3b61175d59303f3cb8c20796f85140c6984} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{1d53e2226465b1047faec7cda2e743e61540ea69e073a3a4057e8d86b277405f → e2932d63eb7f52a82960a19ba79bc800ef4f212164e098f96dee7a4326302f38} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{fa576f6655b235bdea535198647305b7a3855e810180cbdf5d4c246c03c7d190 → e381bcfec42ac541d574011460600cf0818aa0e3362e8c6d205b4157890bf821} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{8fbce5b4859e6011afa83b1c07c4436589cd7181f9cb997538f4c27f196d0d34 → e415657d8725d9b60ece42cc18581da177c42fc47cb11e501db722a5f524ecf7} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{546a8428a2d8628bb3496fadb8c36a6dd65a33464291f214ceb581828f37081b → e46d63e5f8a6ead1d44c8b6302a0c7247af8585b975ab5715518381777622ede} +6 -3
- package/dist/phoenix-ui/bundle/blobs/ee63b3f9b354d69443d05ea4a338af56546897335ace7533546e10be56ea2207 +46 -0
- package/dist/phoenix-ui/bundle/blobs/{c23617601e9c4d97b775c175a5ce1642c40459b157d0821609fe1d253b83ced8 → ef7d57633252f4604749447608850e299c277f7dd1a32776685df0724b1051c8} +6 -7
- package/dist/phoenix-ui/bundle/blobs/{0581c8428246f43c5374393878a29e38f2b1865df87e6f13f2309b8eae54e76f → f0652c6ce41e6949133360178f192ea4ee9f6129a018c7a8b6652870c2330392} +1 -1
- package/dist/phoenix-ui/bundle/blobs/{cfac9eaf96481a8874391e5cecc6149abea1f1f19622f77f1ebb9e1876720e91 → f06c9d797ca2ac8c6a49d3dcd2e99d1b4df8bc9637a49c7e80f3161f49d06b1b} +4 -2
- package/dist/phoenix-ui/bundle/blobs/{d50780cb0a345051ae3fb12c5f8249a5dac9324d6a1963f04d03aaf769ffc27c → f077545caeb3ecb9f51a3f703a09736ca924869f4b4345c1b1ffbd9bf927a287} +6 -3
- package/dist/phoenix-ui/bundle/blobs/f781c5874bcd79ebe1b3b012275b9af7eae6c4867e9a16e29bb3d3ed3dc1940b +46 -0
- package/dist/phoenix-ui/bundle/blobs/fa10c0c926997387c89b7c1070e25b1b2b53ee891741e3c450a89ec6c6dcaf7d +46 -0
- package/dist/phoenix-ui/bundle/blobs/fb1a36ab7116b0c6709b89720cdded29d80982114c2f87cad614e01e126270dd +46 -0
- package/dist/phoenix-ui/bundle/blobs/fbd3214fc12ba70d9c69a995742ba73dc5365823af63afdc93c0c8a8f0c484af +46 -0
- package/dist/phoenix-ui/bundle/blobs/{77682e9d63b484f94a699f2c0b393e4540797d311362c384a3d643aec11d6985 → fea19b8381ec10ff8ed1923a336332974bbb552227ed215e7ddaaf0ec0112c1d} +1 -1
- package/dist/phoenix-ui/bundle/manifest.json +126 -126
- package/docs/phoenix-diagram.md +173 -0
- package/docs/phoenix-ui.md +40 -12
- package/package.json +14 -10
- package/skills/agi-mode/SKILL.md +3 -1
- package/skills/agi-mode/assets/sdlc/event.md +4 -5
- package/skills/agi-mode/assets/sdlc/object-status.md +1 -1
- package/skills/agi-mode/assets/sdlc/protocol.md +4 -2
- package/skills/agi-mode/evals/scenarios.md +108 -3
- package/skills/agi-mode/playbooks/authoring-a-skill.md +13 -2
- package/skills/agi-mode/playbooks/eval.md +19 -3
- package/skills/agi-mode/playbooks/hillclimb.md +4 -2
- package/skills/agi-mode/playbooks/reflection.md +1 -1
- package/skills/agi-mode/playbooks/sdlc.md +10 -6
- package/skills/agi-mode/playbooks/what-next.md +6 -2
- package/skills/agi-mode/references/eval-protocol.md +13 -4
- package/skills/agi-mode/references/interface-design.md +1 -0
- package/skills/agi-mode/references/remote-evolution.md +178 -0
- package/skills/agi-mode/references/skill-evolution.md +2 -0
- package/skills/agi-mode/scripts/evolution/compare.py +569 -0
- package/skills/agi-mode/scripts/evolution/evolution.py +2886 -0
- package/skills/agi-mode/scripts/evolution/examples/public-smoke.json +128 -0
- package/skills/agi-mode/scripts/evolution/examples/quality-calibration.json +128 -0
- package/skills/agi-mode/scripts/evolution/examples/quality-rubric.json +133 -0
- package/skills/agi-mode/scripts/evolution/protocol.py +1586 -0
- package/skills/agi-mode/scripts/evolution/pyproject.toml +16 -0
- package/skills/agi-mode/scripts/evolution/quality.py +689 -0
- package/skills/agi-mode/scripts/evolution/remote.py +2303 -0
- package/skills/agi-mode/scripts/evolution/tests/support.py +201 -0
- package/skills/agi-mode/scripts/evolution/tests/test_apply.py +643 -0
- package/skills/agi-mode/scripts/evolution/tests/test_bounded_exploration.py +236 -0
- package/skills/agi-mode/scripts/evolution/tests/test_bundles.py +414 -0
- package/skills/agi-mode/scripts/evolution/tests/test_calibration.py +460 -0
- package/skills/agi-mode/scripts/evolution/tests/test_compare.py +377 -0
- package/skills/agi-mode/scripts/evolution/tests/test_protocol.py +357 -0
- package/skills/agi-mode/scripts/evolution/tests/test_quality.py +647 -0
- package/skills/agi-mode/scripts/evolution/tests/test_remote.py +857 -0
- package/skills/agi-mode/scripts/evolution/tests/test_search.py +1109 -0
- package/skills/agi-mode/scripts/evolution/tests/test_typesafe.py +624 -0
- package/skills/agi-mode/scripts/evolution/tests/test_verifier_context.py +132 -0
- package/skills/agi-mode/scripts/evolution/typesafe_worker.py +145 -0
- package/skills/agi-mode/scripts/evolution/uv.lock +2548 -0
- package/skills/apply-code-review/SKILL.md +1 -0
- package/skills/apply-code-review/agents/openai.yaml +2 -0
- package/skills/apply-doc-review/SKILL.md +1 -0
- package/skills/apply-doc-review/agents/openai.yaml +2 -0
- package/skills/apply-ui-review/SKILL.md +1 -0
- package/skills/apply-ui-review/agents/openai.yaml +2 -0
- package/skills/autoresearch/SKILL.md +1 -0
- package/skills/clean-artifacts/SKILL.md +52 -0
- package/skills/clean-artifacts/agents/openai.yaml +4 -0
- package/skills/clean-artifacts/evals/scenarios.md +13 -0
- package/skills/clean-artifacts/references/history-cleanup.md +41 -0
- package/skills/crd/SKILL.md +100 -65
- package/skills/crd/assets/cr-template.md +15 -0
- package/skills/crd-respond/SKILL.md +17 -5
- package/skills/crd-respond/agents/openai.yaml +2 -2
- package/skills/crd-respond/assets/response-template.md +7 -0
- package/skills/crd-respond/evals/scenarios.md +7 -0
- package/skills/create-verification-skill/SKILL.md +1 -0
- package/skills/debugging/SKILL.md +1 -0
- package/skills/design-md/SKILL.md +1 -0
- package/skills/design-reference/SKILL.md +6 -2
- package/skills/design-reference/evals/scenarios.md +4 -0
- package/skills/dev-plan/SKILL.md +11 -6
- package/skills/dev-plan/references/execution-workflow.md +1 -1
- package/skills/dev-plan/references/plan-skeleton.md +234 -69
- package/skills/dev-plan/scripts/check_plan.py +1 -1
- package/skills/documentation-writer/SKILL.md +19 -14
- package/skills/documentation-writer/references/architecture.md +6 -2
- package/skills/documentation-writer/references/user-manual.md +2 -2
- package/skills/elintp/SKILL.md +12 -6
- package/skills/experience-capture/SKILL.md +1 -0
- package/skills/gdpr-compliant/SKILL.md +1 -0
- package/skills/kpi-dashboard-design/SKILL.md +1 -0
- package/skills/landing-page-conversion-audit/SKILL.md +1 -0
- package/skills/mcp-release-qa/SKILL.md +2 -1
- package/skills/meeting-minutes/SKILL.md +1 -0
- package/skills/optimize-agents-md/SKILL.md +128 -0
- package/skills/optimize-agents-md/assets/coding-principles.md +118 -0
- package/skills/phoenix-diagram/ENGINE.json +39 -0
- package/skills/phoenix-diagram/SKILL.md +109 -0
- package/skills/phoenix-diagram/examples/legacy.agent-tool-call.workflow.json +94 -0
- package/skills/phoenix-diagram/examples/legacy.async-job-roundtrip.sequence.json +61 -0
- package/skills/phoenix-diagram/examples/legacy.deployment-release.lifecycle.json +49 -0
- package/skills/phoenix-diagram/examples/legacy.product-analytics.dataflow.json +76 -0
- package/skills/{archify/test/fixtures/v1-baseline/web-app.architecture.json → phoenix-diagram/examples/legacy.web-app.architecture.json} +16 -11
- package/skills/phoenix-diagram/examples/minimal.architecture.json +11 -0
- package/skills/phoenix-diagram/examples/minimal.class.json +23 -0
- package/skills/phoenix-diagram/examples/minimal.dataflow.json +11 -0
- package/skills/phoenix-diagram/examples/minimal.erd.json +25 -0
- package/skills/phoenix-diagram/examples/minimal.lifecycle.json +11 -0
- package/skills/phoenix-diagram/examples/minimal.sequence.json +13 -0
- package/skills/phoenix-diagram/examples/minimal.timeline.json +15 -0
- package/skills/phoenix-diagram/examples/minimal.tree.json +13 -0
- package/skills/phoenix-diagram/examples/minimal.waterfall.json +12 -0
- package/skills/phoenix-diagram/examples/minimal.workflow.json +12 -0
- package/skills/phoenix-diagram/references/architecture-compare.md +111 -0
- package/skills/phoenix-diagram/references/authoring-defaults.md +42 -0
- package/skills/phoenix-diagram/references/brand-marks.md +52 -0
- package/skills/phoenix-diagram/references/compatibility.md +22 -0
- package/skills/phoenix-diagram/references/delivery-contract.md +127 -0
- package/skills/phoenix-diagram/references/extending-types.md +14 -0
- package/skills/phoenix-diagram/references/migration.md +57 -0
- package/skills/phoenix-diagram/references/preview.md +45 -0
- package/skills/phoenix-diagram/references/repository-authoring.md +29 -0
- package/skills/phoenix-diagram/references/viewer-runtime.md +27 -0
- package/skills/phoenix-diagram/schemas/README.md +23 -0
- package/skills/phoenix-diagram/schemas/architecture.schema.json +329 -0
- package/skills/phoenix-diagram/schemas/class.schema.json +348 -0
- package/skills/phoenix-diagram/schemas/common.schema.json +358 -0
- package/skills/{archify/schemas/lifecycle.schema.json → phoenix-diagram/schemas/dataflow.schema.json} +63 -58
- package/skills/phoenix-diagram/schemas/erd.schema.json +384 -0
- package/skills/phoenix-diagram/schemas/lifecycle.schema.json +202 -0
- package/skills/phoenix-diagram/schemas/sequence.schema.json +254 -0
- package/skills/phoenix-diagram/schemas/timeline.schema.json +170 -0
- package/skills/phoenix-diagram/schemas/tree.schema.json +144 -0
- package/skills/phoenix-diagram/schemas/waterfall.schema.json +150 -0
- package/skills/phoenix-diagram/schemas/workflow.schema.json +460 -0
- package/skills/phoenix-diagram/scripts/phoenix-bootstrap.cjs +589 -0
- package/skills/phoenix-diagram/scripts/phoenix-diagram +6 -0
- package/skills/phoenix-diagram/scripts/phoenix-launcher.cjs +10 -0
- package/skills/phoenix-ui/GENERATED.json +255 -240
- package/skills/phoenix-ui/SKILL.md +7 -4
- package/skills/phoenix-ui/evals/scenarios.md +8 -1
- package/skills/phoenix-ui/reference/craft-floor.md +3 -1
- package/skills/phoenix-ui/reference/critique.md +6 -14
- package/skills/phoenix-ui/reference/init.md +1 -1
- package/skills/phoenix-ui/reference/live.md +1 -1
- package/skills/phoenix-ui/reference/operate.md +15 -0
- package/skills/phoenix-ui/scripts/ENGINE.json +17 -17
- package/skills/phoenix-ui/scripts/phoenix-bootstrap.cjs +0 -4
- package/skills/portal-app-exchange/SKILL.md +1 -0
- package/skills/portal-dev-setup/SKILL.md +71 -12
- package/skills/portal-dev-setup/scripts/onebox.sh +69 -6
- package/skills/portal-external-app/SKILL.md +55 -16
- package/skills/portal-external-app/references/config-placement.md +108 -2
- package/skills/portal-external-app/references/registration-and-onebox.md +56 -2
- package/skills/portal-logging/SKILL.md +1 -0
- package/skills/portal-micro-app/SKILL.md +2 -1
- package/skills/portal-micro-app/references/sdk-reference.md +3 -1
- package/skills/prd/SKILL.md +238 -159
- package/skills/prd/evals/scenarios.md +13 -0
- package/skills/prd/references/prd-skeleton.md +14 -4
- package/skills/react/SKILL.md +1 -0
- package/skills/resolve-blocked/SKILL.md +46 -19
- package/skills/resolve-blocked/agents/openai.yaml +2 -2
- package/skills/resolve-blocked/evals/scenarios.md +22 -0
- package/skills/resolve-blocked/references/decisions-contract.md +7 -4
- package/skills/review-code/SKILL.md +308 -46
- package/skills/review-code/agents/openai.yaml +2 -0
- package/skills/review-dev-plan/SKILL.md +88 -33
- package/skills/review-dev-plan/agents/openai.yaml +2 -0
- package/skills/review-dev-plan/references/report-contract.md +53 -19
- package/skills/review-dev-plan/references/review-lenses.md +2 -1
- package/skills/review-prd/SKILL.md +90 -34
- package/skills/review-prd/agents/openai.yaml +2 -0
- package/skills/review-prd/references/report-contract.md +54 -18
- package/skills/review-prd-dev-gaps/SKILL.md +1 -0
- package/skills/review-prd-dev-gaps/agents/openai.yaml +2 -0
- package/skills/review-ui/SKILL.md +369 -71
- package/skills/review-ui/agents/openai.yaml +2 -0
- package/skills/review-ui/evals/scenarios.md +2 -0
- package/skills/rust/SKILL.md +76 -84
- package/skills/rust/references/api-design.md +97 -0
- package/skills/rust/references/{chapter_10.md → async-tokio.md} +42 -18
- package/skills/rust/references/behavioral-patterns.md +49 -0
- package/skills/rust/references/bevy.md +95 -0
- package/skills/rust/references/{chapter_02.md → clippy-and-linting.md} +26 -15
- package/skills/rust/references/{chapter_01.md → coding-idioms.md} +58 -7
- package/skills/rust/references/crates-and-dependencies.md +66 -0
- package/skills/rust/references/{chapter_08.md → documentation.md} +30 -3
- package/skills/rust/references/{chapter_04.md → error-handling.md} +32 -6
- package/skills/rust/references/{chapter_06.md → generics-and-dispatch.md} +28 -11
- package/skills/rust/references/macros.md +45 -0
- package/skills/rust/references/{chapter_03.md → performance.md} +25 -2
- package/skills/rust/references/{chapter_09.md → pointers-and-ownership.md} +37 -17
- package/skills/rust/references/{chapter_05.md → testing.md} +18 -2
- package/skills/rust/references/{chapter_07.md → type-state.md} +5 -1
- package/skills/rust/references/unsafe-and-ffi.md +56 -0
- package/skills/rust-port/SKILL.md +144 -0
- package/skills/rust-review/SKILL.md +177 -0
- package/skills/security-audit/SKILL.md +1 -0
- package/skills/spec-human-decision/SKILL.md +1 -0
- package/skills/sql-optimization/SKILL.md +1 -0
- package/skills/story-points/SKILL.md +1 -0
- package/skills/swarm/SKILL.md +1 -0
- package/skills/test-plan/SKILL.md +1 -0
- package/skills/ui-loop/SKILL.md +39 -0
- package/skills/ui-loop/agents/openai.yaml +3 -0
- package/skills/ui-pattern-research/SKILL.md +1 -0
- package/skills/use-llm-gateway/SKILL.md +58 -0
- package/skills/use-llm-gateway/agents/openai.yaml +4 -0
- package/skills/use-llm-gateway/references/api.md +129 -0
- package/skills/use-llm-gateway/references/recovery.md +86 -0
- package/skills/use-prompt-dsl/SKILL.md +165 -0
- package/skills/use-prompt-dsl/references/examples.md +726 -0
- package/skills/use-prompt-dsl/references/language.md +938 -0
- package/skills/use-rustify-docs/SKILL.md +60 -0
- package/skills/use-rustify-docs/agents/openai.yaml +4 -0
- package/skills/use-rustify-docs/references/rustify-docs.md +138 -0
- package/skills/use-task-gateway/SKILL.md +60 -0
- package/skills/use-task-gateway/agents/openai.yaml +3 -0
- package/skills/use-task-gateway/references/authentication.md +75 -0
- package/skills/use-task-gateway/references/task-api.md +121 -0
- package/skills/use-task-gateway/references/workers.md +85 -0
- package/skills/use-task-gateway/references/workflow-actions.md +66 -0
- package/skills/use-workflow-service/SKILL.md +57 -0
- package/skills/use-workflow-service/agents/openai.yaml +3 -0
- package/skills/use-workflow-service/references/action-provider.md +84 -0
- package/skills/use-workflow-service/references/authentication.md +76 -0
- package/skills/use-workflow-service/references/authoring.md +62 -0
- package/skills/use-workflow-service/references/mcp.md +47 -0
- package/skills/use-workflow-service/references/open-api.md +88 -0
- package/skills/use-workflow-service/references/orchestration-choice.md +63 -0
- package/skills/working-with-mbx/SKILL.md +1 -0
- package/skills/working-with-mise/SKILL.md +1 -0
- package/skills/xgent-app-release/SKILL.md +114 -16
- package/skills/xgent-app-release/references/build-and-package.md +2 -1
- package/skills/xgent-app-release/references/publish-api.md +6 -1
- package/skills/xgent-app-release/references/troubleshooting.md +2 -1
- package/skills/xgent-app-release/references/verify-preflight.mjs +21 -1
- package/skills/xgent-app-release/scripts/preflight.mjs +42 -3
- package/skills/xgent-image-push/SKILL.md +1 -0
- package/skills/xgent-init/SKILL.md +1 -0
- package/docs/claude-context-goal-guard.md +0 -124
- package/docs/codex-context-goal-guard.md +0 -109
- package/hooks/claude/context-goal-guard.js +0 -139
- package/hooks/claude/settings.example.json +0 -26
- package/hooks/codex/context-goal-guard.py +0 -189
- package/hooks/codex/hooks.example.json +0 -26
- package/skills/archify/SKILL.md +0 -137
- package/skills/archify/assets/template.html +0 -14937
- package/skills/archify/bin/archify.mjs +0 -2139
- package/skills/archify/bin/open-artifact.mjs +0 -86
- package/skills/archify/bin/preview.mjs +0 -653
- package/skills/archify/bin/visual-check.mjs +0 -829
- package/skills/archify/brand-marks/README.md +0 -31
- package/skills/archify/brand-marks/catalog.json +0 -131
- package/skills/archify/delta/architecture-delta.mjs +0 -1232
- package/skills/archify/examples/agent-run.lifecycle.json +0 -60
- package/skills/archify/examples/brand-aware-delivery.architecture.json +0 -47
- package/skills/archify/examples/cache-miss-request.sequence.json +0 -82
- package/skills/archify/examples/checkout-platform.base.architecture.json +0 -31
- package/skills/archify/examples/checkout-platform.head.architecture.json +0 -31
- package/skills/archify/examples/dataflow-product-analytics.html +0 -15048
- package/skills/archify/examples/event-stream.dataflow.json +0 -57
- package/skills/archify/examples/incident-response.workflow.json +0 -64
- package/skills/archify/examples/lifecycle-agent-run.html +0 -14983
- package/skills/archify/examples/production-deployment.architecture.json +0 -71
- package/skills/archify/examples/release-delivery.workflow.json +0 -62
- package/skills/archify/examples/sequence-cache-miss-request.html +0 -15063
- package/skills/archify/examples/web-app-rendered.html +0 -15012
- package/skills/archify/examples/workflow-agent-tool-call-rendered.html +0 -15054
- package/skills/archify/migrations/workflow-v2.mjs +0 -279
- package/skills/archify/package-lock.json +0 -149
- package/skills/archify/package.json +0 -39
- package/skills/archify/recipes/scenarios.mjs +0 -391
- package/skills/archify/references/authoring-contract.md +0 -247
- package/skills/archify/references/brand-marks.md +0 -65
- package/skills/archify/references/delivery-contract.md +0 -138
- package/skills/archify/references/viewer-runtime.md +0 -45
- package/skills/archify/renderers/architecture/grid.mjs +0 -62
- package/skills/archify/renderers/architecture/render-architecture.mjs +0 -1078
- package/skills/archify/renderers/dataflow/README.md +0 -104
- package/skills/archify/renderers/dataflow/render-dataflow.mjs +0 -483
- package/skills/archify/renderers/lifecycle/README.md +0 -115
- package/skills/archify/renderers/lifecycle/render-lifecycle.mjs +0 -561
- package/skills/archify/renderers/sequence/README.md +0 -114
- package/skills/archify/renderers/sequence/render-sequence.mjs +0 -464
- package/skills/archify/renderers/shared/brand-marks.mjs +0 -563
- package/skills/archify/renderers/shared/cli.mjs +0 -218
- package/skills/archify/renderers/shared/desktop-readability.mjs +0 -26
- package/skills/archify/renderers/shared/diagnostics.mjs +0 -160
- package/skills/archify/renderers/shared/engineering-profiles.mjs +0 -157
- package/skills/archify/renderers/shared/generated-brand-marks.mjs +0 -2003
- package/skills/archify/renderers/shared/generated-validators.mjs +0 -13
- package/skills/archify/renderers/shared/geometry.mjs +0 -1423
- package/skills/archify/renderers/shared/i18n.mjs +0 -595
- package/skills/archify/renderers/shared/layout-report.mjs +0 -40
- package/skills/archify/renderers/shared/legend.mjs +0 -217
- package/skills/archify/renderers/shared/output-path.mjs +0 -340
- package/skills/archify/renderers/shared/repository-evidence.mjs +0 -239
- package/skills/archify/renderers/shared/repository-location.mjs +0 -58
- package/skills/archify/renderers/shared/text-fit.mjs +0 -49
- package/skills/archify/renderers/shared/utils.mjs +0 -232
- package/skills/archify/renderers/shared/validator.mjs +0 -86
- package/skills/archify/renderers/workflow/README.md +0 -223
- package/skills/archify/renderers/workflow/render-workflow.mjs +0 -35
- package/skills/archify/renderers/workflow/workflow-compiler.mjs +0 -4400
- package/skills/archify/renderers/workflow/workflow-migration-geometry.mjs +0 -144
- package/skills/archify/schemas/README.md +0 -211
- package/skills/archify/schemas/architecture.schema.json +0 -178
- package/skills/archify/schemas/common.schema.json +0 -115
- package/skills/archify/scripts/check-render-output.mjs +0 -916
- package/skills/archify/scripts/check-update.mjs +0 -1667
- package/skills/archify/scripts/generate-brand-marks.mjs +0 -141
- package/skills/archify/scripts/generate-validators.mjs +0 -66
- package/skills/archify/scripts/render-examples.mjs +0 -26
- package/skills/archify/scripts/update-contract.mjs +0 -182
- package/skills/archify/skill-release.json +0 -10
- package/skills/archify/test/adaptive-reader-layout.test.mjs +0 -86
- package/skills/archify/test/animation.test.mjs +0 -179
- package/skills/archify/test/architecture-compare-recovery.test.mjs +0 -157
- package/skills/archify/test/architecture-delta-markers.test.mjs +0 -137
- package/skills/archify/test/architecture-delta.test.mjs +0 -705
- package/skills/archify/test/artifact-receipt-flush.test.mjs +0 -126
- package/skills/archify/test/authored-reachability.test.mjs +0 -95
- package/skills/archify/test/authoring-safety-contract.test.mjs +0 -54
- package/skills/archify/test/automatic-port-spread.test.mjs +0 -376
- package/skills/archify/test/base-input-compatibility.test.mjs +0 -42
- package/skills/archify/test/brand-marks.test.mjs +0 -678
- package/skills/archify/test/chapter-delta-preview.test.mjs +0 -157
- package/skills/archify/test/chapter-handoff.test.mjs +0 -97
- package/skills/archify/test/chapter-rail.test.mjs +0 -86
- package/skills/archify/test/checkout-line-endings.test.mjs +0 -72
- package/skills/archify/test/ci-scope.test.mjs +0 -59
- package/skills/archify/test/clean-skill-staging.test.mjs +0 -440
- package/skills/archify/test/cli-output-types.test.mjs +0 -201
- package/skills/archify/test/cli.test.mjs +0 -986
- package/skills/archify/test/community-proof-intake.test.mjs +0 -125
- package/skills/archify/test/cursor-onboarding.test.mjs +0 -74
- package/skills/archify/test/degraded.test.mjs +0 -161
- package/skills/archify/test/delivery-contract.test.mjs +0 -52
- package/skills/archify/test/desktop-reader-browser.test.mjs +0 -80
- package/skills/archify/test/diagram-guide.test.mjs +0 -92
- package/skills/archify/test/engineering-profile.test.mjs +0 -209
- package/skills/archify/test/export-browser.test.mjs +0 -305
- package/skills/archify/test/export-cleanup-browser.test.mjs +0 -294
- package/skills/archify/test/finder-browser.test.mjs +0 -274
- package/skills/archify/test/finder.test.mjs +0 -104
- package/skills/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json +0 -40
- package/skills/archify/test/fixtures/fail-migration-cleanup.mjs +0 -17
- package/skills/archify/test/fixtures/issue-126/custom-widths.workflow.json +0 -18
- package/skills/archify/test/fixtures/issue-126/explicit-route.workflow.json +0 -28
- package/skills/archify/test/fixtures/issue-126/explicit-viewbox.workflow.json +0 -19
- package/skills/archify/test/fixtures/issue-126/labels.workflow.json +0 -18
- package/skills/archify/test/fixtures/v1-baseline/agent-run.lifecycle.json +0 -64
- package/skills/archify/test/fixtures/v1-baseline/agent-tool-call.workflow.json +0 -88
- package/skills/archify/test/fixtures/v1-baseline/cache-miss-request.sequence.json +0 -75
- package/skills/archify/test/fixtures/v1-baseline/event-stream.dataflow.json +0 -57
- package/skills/archify/test/fixtures/v1-baseline/product-analytics.dataflow.json +0 -70
- package/skills/archify/test/fixtures/v1-baseline/production-deployment.architecture.json +0 -71
- package/skills/archify/test/fixtures/v1-workflow-700x400.workflow.json +0 -22
- package/skills/archify/test/fixtures/v1-workflow-explicit-coordinates.workflow.json +0 -47
- package/skills/archify/test/focus-browser.test.mjs +0 -226
- package/skills/archify/test/gallery.test.mjs +0 -130
- package/skills/archify/test/generate-validators.test.mjs +0 -59
- package/skills/archify/test/generate-viewer.test.mjs +0 -165
- package/skills/archify/test/generated-artifact-xml.test.mjs +0 -88
- package/skills/archify/test/geometry.test.mjs +0 -739
- package/skills/archify/test/golden.mjs +0 -207
- package/skills/archify/test/grid.test.mjs +0 -47
- package/skills/archify/test/guide-page.test.mjs +0 -85
- package/skills/archify/test/guide.test.mjs +0 -81
- package/skills/archify/test/guided-views-browser.test.mjs +0 -460
- package/skills/archify/test/guided-views.test.mjs +0 -144
- package/skills/archify/test/helpers/desktop-browser.mjs +0 -48
- package/skills/archify/test/helpers/offline-fonts.mjs +0 -76
- package/skills/archify/test/helpers/viewer-click.mjs +0 -72
- package/skills/archify/test/helpers/xml.mjs +0 -37
- package/skills/archify/test/i18n.test.mjs +0 -422
- package/skills/archify/test/intent-trace-browser.test.mjs +0 -284
- package/skills/archify/test/intent-trace.test.mjs +0 -111
- package/skills/archify/test/landing.test.mjs +0 -97
- package/skills/archify/test/layout-rules.test.mjs +0 -1498
- package/skills/archify/test/legend-contract.test.mjs +0 -404
- package/skills/archify/test/motion-governor-browser.test.mjs +0 -342
- package/skills/archify/test/motion-governor.test.mjs +0 -111
- package/skills/archify/test/offline-font-browser.test.mjs +0 -210
- package/skills/archify/test/offline-self-containment.test.mjs +0 -80
- package/skills/archify/test/open-artifact.test.mjs +0 -118
- package/skills/archify/test/ordinary-model-floor.test.mjs +0 -1052
- package/skills/archify/test/output-path.test.mjs +0 -587
- package/skills/archify/test/presentation.test.mjs +0 -71
- package/skills/archify/test/preset-tryon.test.mjs +0 -113
- package/skills/archify/test/preview-contract.test.mjs +0 -40
- package/skills/archify/test/preview.test.mjs +0 -530
- package/skills/archify/test/proof-aperture.test.mjs +0 -78
- package/skills/archify/test/reach-share-card.test.mjs +0 -149
- package/skills/archify/test/reader-layout-browser.test.mjs +0 -320
- package/skills/archify/test/readme-showcase.test.mjs +0 -319
- package/skills/archify/test/real-repository-proof.test.mjs +0 -209
- package/skills/archify/test/relationship-direct-explorer.test.mjs +0 -115
- package/skills/archify/test/relationship-lens.test.mjs +0 -128
- package/skills/archify/test/relationship-permalink.test.mjs +0 -130
- package/skills/archify/test/relationship-pulse.test.mjs +0 -122
- package/skills/archify/test/release-identity.test.mjs +0 -476
- package/skills/archify/test/release-package-gates.test.mjs +0 -750
- package/skills/archify/test/render-output-checks.test.mjs +0 -588
- package/skills/archify/test/renderer-diagnostic-boundary.test.mjs +0 -107
- package/skills/archify/test/repair-receipt.test.mjs +0 -181
- package/skills/archify/test/repository-evidence-replacement.test.mjs +0 -136
- package/skills/archify/test/repository-evidence.test.mjs +0 -605
- package/skills/archify/test/repository-language-metadata.test.mjs +0 -67
- package/skills/archify/test/route-journey.test.mjs +0 -125
- package/skills/archify/test/route-probe-browser.test.mjs +0 -363
- package/skills/archify/test/route-probe.test.mjs +0 -114
- package/skills/archify/test/route-share-card.test.mjs +0 -163
- package/skills/archify/test/semantic-camera.test.mjs +0 -88
- package/skills/archify/test/semantic-flow.test.mjs +0 -90
- package/skills/archify/test/semantic-legend-gateway.test.mjs +0 -156
- package/skills/archify/test/semantic-lens-browser.test.mjs +0 -372
- package/skills/archify/test/semantic-lens.test.mjs +0 -103
- package/skills/archify/test/semantic-passport.test.mjs +0 -99
- package/skills/archify/test/semantic-radar.test.mjs +0 -735
- package/skills/archify/test/semantic-zoom.test.mjs +0 -86
- package/skills/archify/test/sequence-column-fit.test.mjs +0 -137
- package/skills/archify/test/settled-flow.test.mjs +0 -97
- package/skills/archify/test/share-card-export.test.mjs +0 -132
- package/skills/archify/test/site-language-continuity.test.mjs +0 -569
- package/skills/archify/test/site-language-integration.mjs +0 -9
- package/skills/archify/test/skill-metadata.test.mjs +0 -84
- package/skills/archify/test/stable-update-manifest.test.mjs +0 -167
- package/skills/archify/test/start-page.test.mjs +0 -312
- package/skills/archify/test/story-beat-navigator.test.mjs +0 -103
- package/skills/archify/test/story-carrier.test.mjs +0 -90
- package/skills/archify/test/story-director-strip.test.mjs +0 -91
- package/skills/archify/test/story-follow-camera.test.mjs +0 -103
- package/skills/archify/test/story-horizon.test.mjs +0 -91
- package/skills/archify/test/story-moment-link.test.mjs +0 -93
- package/skills/archify/test/story-shelf.test.mjs +0 -84
- package/skills/archify/test/story-trail.test.mjs +0 -81
- package/skills/archify/test/toolbar-polish.test.mjs +0 -57
- package/skills/archify/test/update-contract.test.mjs +0 -133
- package/skills/archify/test/update-notifier.test.mjs +0 -3317
- package/skills/archify/test/v1-compatibility.test.mjs +0 -329
- package/skills/archify/test/vertical-edge.test.mjs +0 -68
- package/skills/archify/test/viewer-camera-browser.test.mjs +0 -395
- package/skills/archify/test/viewer-chrome-layout.test.mjs +0 -1104
- package/skills/archify/test/viewer-identifiers-browser.test.mjs +0 -135
- package/skills/archify/test/visual-check.test.mjs +0 -400
- package/skills/archify/test/webm-artifact.smoke.mjs +0 -1855
- package/skills/archify/test/workflow-compiler-hard-contract.test.mjs +0 -2136
- package/skills/archify/test/workflow-compiler.test.mjs +0 -1163
- package/skills/archify/test/workflow-migration.test.mjs +0 -620
- package/skills/archify/test/workflow-semantic-contract.test.mjs +0 -131
- /package/{skills/archify/THIRD_PARTY_NOTICES.md → dist/phoenix-diagram/THIRD-PARTY-LICENSES/0b7fb59365dc21c93b0f62526d74ee913aeec9ae532c112bc76afa7edcd56e14.txt} +0 -0
- /package/{skills/archify/LICENSE → dist/phoenix-diagram/THIRD-PARTY-LICENSES/b799ab081703e7821ae5096d2c1abdf14bbdc75e8ea1c4045998c36ed6db9706.txt} +0 -0
- /package/{skills/archify/assets/JetBrainsMono-OFL.txt → dist/phoenix-diagram/THIRD-PARTY-LICENSES/c1ab7c666206842a02b35b30770dac0d7a10156ed401c9defc3f02a754d89e90.txt} +0 -0
- /package/{skills/archify/examples/agent-tool-call.workflow.json → dist/phoenix-diagram/bundle/examples/legacy.agent-tool-call.workflow.json} +0 -0
- /package/{skills/archify/examples/async-job-roundtrip.sequence.json → dist/phoenix-diagram/bundle/examples/legacy.async-job-roundtrip.sequence.json} +0 -0
- /package/{skills/archify/examples/deployment-release.lifecycle.json → dist/phoenix-diagram/bundle/examples/legacy.deployment-release.lifecycle.json} +0 -0
- /package/{skills/archify/examples/product-analytics.dataflow.json → dist/phoenix-diagram/bundle/examples/legacy.product-analytics.dataflow.json} +0 -0
- /package/{skills/archify/examples/web-app.architecture.json → dist/phoenix-diagram/bundle/examples/legacy.web-app.architecture.json} +0 -0
|
@@ -1,2139 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawnSync } from 'node:child_process';
|
|
4
|
-
import { createHash } from 'node:crypto';
|
|
5
|
-
import fs from 'node:fs';
|
|
6
|
-
import os from 'node:os';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
9
|
-
|
|
10
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
const skillRoot = path.resolve(__dirname, '..');
|
|
12
|
-
|
|
13
|
-
const TYPES = new Set(['architecture', 'workflow', 'sequence', 'dataflow', 'lifecycle']);
|
|
14
|
-
|
|
15
|
-
function usage() {
|
|
16
|
-
return `Usage:
|
|
17
|
-
archify render <type> <input.json> [output.html] [--quality standard|showcase] [--repo-root path (architecture only)]
|
|
18
|
-
archify compare architecture <base.json> <head.json> [output.html] [--receipt path] [--json] [--quality standard|showcase] [--repo-root path]
|
|
19
|
-
archify deliver <type> <input.json> [output.html] [--json] [--open] [--quality standard|showcase] [--repo-root path (architecture only)]
|
|
20
|
-
archify preview <type> <input.json> [output.html] [--no-open] [--quality standard|showcase] [--repo-root path (architecture only)]
|
|
21
|
-
archify validate <type> <input.json> [--json] [--layout-json] [--quality standard|showcase] [--repo-root path (architecture only)]
|
|
22
|
-
archify migrate workflow <old.json> <new.json> --to-schema 2 [--json]
|
|
23
|
-
archify inspect <type> <input.json>
|
|
24
|
-
archify check <output.html>
|
|
25
|
-
archify visual-check <output.html> [--json]
|
|
26
|
-
archify guide [scenario or question] [--json] [--lang en|zh]
|
|
27
|
-
archify brands [name, alias, domain, or category] [--json]
|
|
28
|
-
archify brands capture <url> [--json]
|
|
29
|
-
archify examples
|
|
30
|
-
archify doctor
|
|
31
|
-
archify demo [output-directory]
|
|
32
|
-
|
|
33
|
-
Types:
|
|
34
|
-
architecture, workflow, sequence, dataflow, lifecycle
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function fail(message, code = 2) {
|
|
39
|
-
console.error(message);
|
|
40
|
-
process.exit(code);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function rejectCliArgument(message, details = {}) {
|
|
44
|
-
const error = new Error(message);
|
|
45
|
-
error.archifyArgument = {
|
|
46
|
-
code: details.code || 'cli/invalid-arguments',
|
|
47
|
-
subject: details.subject || {},
|
|
48
|
-
evidence: details.evidence || {},
|
|
49
|
-
supportedFixes: details.supportedFixes || ['correct the command arguments and retry'],
|
|
50
|
-
};
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function rendererPath(type) {
|
|
55
|
-
if (!TYPES.has(type)) {
|
|
56
|
-
rejectCliArgument(`Unknown diagram type "${type}". Expected one of: ${[...TYPES].join(', ')}`, {
|
|
57
|
-
code: 'cli/unknown-diagram-type',
|
|
58
|
-
subject: { type },
|
|
59
|
-
evidence: { supportedTypes: [...TYPES] },
|
|
60
|
-
supportedFixes: [`use one of: ${[...TYPES].join(', ')}`],
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return path.join(skillRoot, 'renderers', type, `render-${type}.mjs`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function runNode(args, options = {}) {
|
|
67
|
-
return spawnSync(process.execPath, args, {
|
|
68
|
-
cwd: options.cwd || process.cwd(),
|
|
69
|
-
encoding: 'utf8',
|
|
70
|
-
stdio: options.stdio || 'inherit',
|
|
71
|
-
env: options.env ? { ...process.env, ...options.env } : process.env,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function extractQualityArgs(args) {
|
|
76
|
-
const rest = [];
|
|
77
|
-
let quality;
|
|
78
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
79
|
-
const arg = args[index];
|
|
80
|
-
if (arg === '--quality') {
|
|
81
|
-
quality = args[index + 1];
|
|
82
|
-
if (!quality || quality.startsWith('--')) rejectCliArgument('--quality requires standard or showcase.', {
|
|
83
|
-
code: 'cli/missing-option-value',
|
|
84
|
-
subject: { option: '--quality' },
|
|
85
|
-
supportedFixes: ['provide --quality standard or --quality showcase'],
|
|
86
|
-
});
|
|
87
|
-
index += 1;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (arg.startsWith('--quality=')) {
|
|
91
|
-
quality = arg.slice('--quality='.length);
|
|
92
|
-
if (!quality) rejectCliArgument('--quality requires standard or showcase.', {
|
|
93
|
-
code: 'cli/missing-option-value',
|
|
94
|
-
subject: { option: '--quality' },
|
|
95
|
-
supportedFixes: ['provide --quality standard or --quality showcase'],
|
|
96
|
-
});
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
rest.push(arg);
|
|
100
|
-
}
|
|
101
|
-
if (quality !== undefined && !['standard', 'showcase'].includes(quality)) {
|
|
102
|
-
rejectCliArgument(`Unknown quality profile "${quality}". Expected standard or showcase.`, {
|
|
103
|
-
code: 'cli/invalid-option-value',
|
|
104
|
-
subject: { option: '--quality' },
|
|
105
|
-
evidence: { value: quality, supportedValues: ['standard', 'showcase'] },
|
|
106
|
-
supportedFixes: ['use --quality standard or --quality showcase'],
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return { rest, quality };
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function extractRepoRootArgs(args) {
|
|
113
|
-
const rest = [];
|
|
114
|
-
let repoRoot;
|
|
115
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
116
|
-
const arg = args[index];
|
|
117
|
-
if (arg === '--repo-root') {
|
|
118
|
-
repoRoot = args[index + 1];
|
|
119
|
-
if (!repoRoot || repoRoot.startsWith('--')) rejectCliArgument('--repo-root requires a repository path.', {
|
|
120
|
-
code: 'cli/missing-option-value',
|
|
121
|
-
subject: { option: '--repo-root' },
|
|
122
|
-
supportedFixes: ['provide one repository path after --repo-root'],
|
|
123
|
-
});
|
|
124
|
-
index += 1;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
if (arg.startsWith('--repo-root=')) {
|
|
128
|
-
repoRoot = arg.slice('--repo-root='.length);
|
|
129
|
-
if (!repoRoot) rejectCliArgument('--repo-root requires a repository path.', {
|
|
130
|
-
code: 'cli/missing-option-value',
|
|
131
|
-
subject: { option: '--repo-root' },
|
|
132
|
-
supportedFixes: ['provide one repository path after --repo-root'],
|
|
133
|
-
});
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
rest.push(arg);
|
|
137
|
-
}
|
|
138
|
-
return { rest, repoRoot: repoRoot ? path.resolve(repoRoot) : undefined };
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function rendererEnv(quality, repoRoot, diagnosticJson = false) {
|
|
142
|
-
return {
|
|
143
|
-
...(quality ? { ARCHIFY_QUALITY_PROFILE: quality } : {}),
|
|
144
|
-
...(repoRoot ? { ARCHIFY_REPO_ROOT: repoRoot } : {}),
|
|
145
|
-
...(diagnosticJson ? { ARCHIFY_DIAGNOSTIC_FORMAT: 'json' } : {}),
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function diagnostic({ code, message, subject = {}, evidence = {}, supportedFixes = [], severity = 'error' }) {
|
|
150
|
-
return {
|
|
151
|
-
code,
|
|
152
|
-
severity,
|
|
153
|
-
message,
|
|
154
|
-
subject,
|
|
155
|
-
evidence,
|
|
156
|
-
supportedFixes,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function inputDiagnostic(error, inputPath) {
|
|
161
|
-
const isSyntax = error instanceof SyntaxError;
|
|
162
|
-
return diagnostic({
|
|
163
|
-
code: isSyntax ? 'input/json-parse' : 'input/read',
|
|
164
|
-
message: isSyntax
|
|
165
|
-
? `Input JSON could not be parsed: ${error.message}`
|
|
166
|
-
: `Input could not be read: ${error.message}`,
|
|
167
|
-
subject: { input: inputPath },
|
|
168
|
-
evidence: {
|
|
169
|
-
...(error?.code ? { systemCode: error.code } : {}),
|
|
170
|
-
reason: error.message,
|
|
171
|
-
},
|
|
172
|
-
supportedFixes: [isSyntax
|
|
173
|
-
? 'repair the JSON syntax and run validation again'
|
|
174
|
-
: 'provide one readable JSON input file'],
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function rendererFailure(result) {
|
|
179
|
-
if (result.error) {
|
|
180
|
-
return {
|
|
181
|
-
error: 'Renderer process could not start.',
|
|
182
|
-
diagnostics: [diagnostic({
|
|
183
|
-
code: 'internal/renderer-process',
|
|
184
|
-
message: 'Renderer process could not start.',
|
|
185
|
-
evidence: { reason: result.error.message },
|
|
186
|
-
})],
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
try {
|
|
190
|
-
const payload = JSON.parse((result.stderr || '').trim());
|
|
191
|
-
if (payload?.ok === false && Array.isArray(payload.diagnostics) && payload.diagnostics.length) {
|
|
192
|
-
return {
|
|
193
|
-
error: payload.error || payload.diagnostics[0].message,
|
|
194
|
-
diagnostics: payload.diagnostics,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
} catch {
|
|
198
|
-
// The diagnostic boundary is intentionally fail-closed. Never copy a raw
|
|
199
|
-
// Node stack into a machine receipt when a renderer exits unexpectedly.
|
|
200
|
-
}
|
|
201
|
-
return {
|
|
202
|
-
error: 'Renderer failed before emitting a structured diagnostic.',
|
|
203
|
-
diagnostics: [diagnostic({
|
|
204
|
-
code: 'internal/unclassified',
|
|
205
|
-
message: 'Renderer failed before emitting a structured diagnostic.',
|
|
206
|
-
evidence: { exitCode: result.status ?? 1 },
|
|
207
|
-
})],
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const COMPOSITION_CHECKS = new Set([
|
|
212
|
-
'label_route_clearance',
|
|
213
|
-
'relationship_crossings',
|
|
214
|
-
'relationship_corridors',
|
|
215
|
-
'container_border_runs',
|
|
216
|
-
'route_rhythm',
|
|
217
|
-
]);
|
|
218
|
-
|
|
219
|
-
const CHECK_FIXES = {
|
|
220
|
-
single_svg: ['remove additional SVG roots so the artifact contains exactly one diagram SVG'],
|
|
221
|
-
finite_svg: ['replace non-finite coordinates before rendering again'],
|
|
222
|
-
orthogonal_arrows: ['use renderer-supported orthogonal routing controls'],
|
|
223
|
-
legend_clearance: ['move the route or enlarge the viewBox so relationships do not enter the legend'],
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const COMPOSITION_FIXES = {
|
|
227
|
-
'composition/proper-crossing': ['adjust route/via or channel coordinates so unrelated relationships use separate corridors'],
|
|
228
|
-
'composition/ambiguous-corridor': ['adjust route/via or channel coordinates so unrelated relationships do not visually merge'],
|
|
229
|
-
'composition/container-border-run': ['route across the frame perpendicularly through a clear opening'],
|
|
230
|
-
'composition/label-route-clearance': ['adjust labelAt, labelDx, labelDy, labelSegment, message y, or the other relationship route'],
|
|
231
|
-
'composition/desktop-readability': ['reduce the viewBox width, shorten node copy, widen affected nodes, or split the diagram so node context remains at least 6px at a 1440px desktop viewport'],
|
|
232
|
-
'composition/micro-segment': ['move the route/channel/via point so every visible segment is at least 8px'],
|
|
233
|
-
'composition/short-interior-segment': ['move the route/channel/via point so every interior turn has at least 16px'],
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
function checkerDiagnostics(checker) {
|
|
237
|
-
const diagnostics = [];
|
|
238
|
-
for (const issue of checker?.composition?.issues || []) {
|
|
239
|
-
if (issue.severity !== 'error') continue;
|
|
240
|
-
const { severity, code, relationship, ...evidence } = issue;
|
|
241
|
-
diagnostics.push(diagnostic({
|
|
242
|
-
code,
|
|
243
|
-
severity,
|
|
244
|
-
message: `Final artifact failed ${code}.`,
|
|
245
|
-
subject: relationship ? { relationship } : { check: 'composition' },
|
|
246
|
-
evidence,
|
|
247
|
-
supportedFixes: COMPOSITION_FIXES[code] || [],
|
|
248
|
-
}));
|
|
249
|
-
}
|
|
250
|
-
for (const check of checker?.checks || []) {
|
|
251
|
-
if (check.ok || COMPOSITION_CHECKS.has(check.name)) continue;
|
|
252
|
-
diagnostics.push(diagnostic({
|
|
253
|
-
code: `artifact/${check.name.replaceAll('_', '-')}`,
|
|
254
|
-
message: (check.details || []).find(Boolean) || `Final artifact failed ${check.name}.`,
|
|
255
|
-
subject: { check: check.name },
|
|
256
|
-
evidence: { details: check.details || [] },
|
|
257
|
-
supportedFixes: CHECK_FIXES[check.name] || [],
|
|
258
|
-
}));
|
|
259
|
-
}
|
|
260
|
-
return diagnostics.length ? diagnostics : [diagnostic({
|
|
261
|
-
code: 'artifact/check-failed',
|
|
262
|
-
message: 'Final artifact check failed without a classified diagnostic.',
|
|
263
|
-
subject: { check: 'unknown' },
|
|
264
|
-
evidence: {},
|
|
265
|
-
})];
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function formatDiagnostics(error, diagnostics = []) {
|
|
269
|
-
if (!diagnostics.length) return error;
|
|
270
|
-
return [
|
|
271
|
-
error,
|
|
272
|
-
...diagnostics.map((entry) => {
|
|
273
|
-
const fix = entry.supportedFixes?.length ? ` Fix: ${entry.supportedFixes.join('; ')}.` : '';
|
|
274
|
-
return `[${entry.code}] ${entry.message}${fix}`;
|
|
275
|
-
}),
|
|
276
|
-
].join('\n');
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function assertEvidenceType(type, repoRoot) {
|
|
280
|
-
if (repoRoot && type !== 'architecture') {
|
|
281
|
-
rejectCliArgument('--repo-root is currently supported for architecture diagrams only.', {
|
|
282
|
-
code: 'cli/unsupported-option',
|
|
283
|
-
subject: { option: '--repo-root', type },
|
|
284
|
-
supportedFixes: ['remove --repo-root or use an architecture diagram'],
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function exitFrom(result) {
|
|
290
|
-
if (result.error) fail(result.error.message, 1);
|
|
291
|
-
process.exit(result.status ?? 1);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
function reportCompareFailure({ json, stage, error, code = 'delta/internal', details = {}, status = 1 }) {
|
|
295
|
-
const receipt = {
|
|
296
|
-
schemaVersion: 1,
|
|
297
|
-
ok: false,
|
|
298
|
-
command: 'compare',
|
|
299
|
-
type: 'architecture',
|
|
300
|
-
stage,
|
|
301
|
-
error,
|
|
302
|
-
diagnostics: [{
|
|
303
|
-
code,
|
|
304
|
-
severity: 'error',
|
|
305
|
-
message: error,
|
|
306
|
-
subject: details.side ? { side: details.side, ...(details.path ? { path: details.path } : {}) } : {},
|
|
307
|
-
evidence: Object.fromEntries(Object.entries(details).filter(([key]) => !['side', 'path', 'supportedFixes'].includes(key))),
|
|
308
|
-
supportedFixes: details.supportedFixes || [],
|
|
309
|
-
}],
|
|
310
|
-
};
|
|
311
|
-
if (json) console.log(JSON.stringify(receipt, null, 2));
|
|
312
|
-
else console.error(formatDiagnostics(error, receipt.diagnostics));
|
|
313
|
-
process.exitCode = status;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function extractCompareOptions(args) {
|
|
317
|
-
const positional = [];
|
|
318
|
-
let receipt;
|
|
319
|
-
let json = false;
|
|
320
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
321
|
-
const arg = args[index];
|
|
322
|
-
if (arg === '--json') {
|
|
323
|
-
json = true;
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
if (arg === '--receipt') {
|
|
327
|
-
receipt = args[index + 1];
|
|
328
|
-
if (!receipt || receipt.startsWith('--')) fail('--receipt requires a JSON output path.');
|
|
329
|
-
index += 1;
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
if (arg.startsWith('--receipt=')) {
|
|
333
|
-
receipt = arg.slice('--receipt='.length);
|
|
334
|
-
if (!receipt) fail('--receipt requires a JSON output path.');
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
if (arg.startsWith('--')) fail(`Unknown compare option "${arg}".`);
|
|
338
|
-
positional.push(arg);
|
|
339
|
-
}
|
|
340
|
-
return { positional, receipt, json };
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
function compareReceiptPath(outputPath) {
|
|
344
|
-
const extension = path.extname(outputPath);
|
|
345
|
-
return extension ? `${outputPath.slice(0, -extension.length)}.receipt.json` : `${outputPath}.receipt.json`;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
function compareCommitError(message, code, details = {}) {
|
|
349
|
-
const error = new Error(message);
|
|
350
|
-
error.compareStage = 'commit';
|
|
351
|
-
error.compareCode = code;
|
|
352
|
-
error.compareDetails = details;
|
|
353
|
-
return error;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
function commitComparePair({ htmlCandidate, receiptCandidate, outputPath, receiptPath, stagingDirectory }) {
|
|
357
|
-
const targets = [
|
|
358
|
-
{ label: 'HTML artifact', target: outputPath, candidate: htmlCandidate, backup: path.join(stagingDirectory, '.previous-output') },
|
|
359
|
-
{ label: 'receipt', target: receiptPath, candidate: receiptCandidate, backup: path.join(stagingDirectory, '.previous-receipt') },
|
|
360
|
-
];
|
|
361
|
-
|
|
362
|
-
// Preflight the whole pair before moving either trusted target. This avoids
|
|
363
|
-
// replacing the HTML and only then discovering that its receipt destination
|
|
364
|
-
// cannot be committed (for example, because it is a directory).
|
|
365
|
-
for (const item of targets) {
|
|
366
|
-
if (!fs.existsSync(item.target)) continue;
|
|
367
|
-
const existing = fs.lstatSync(item.target);
|
|
368
|
-
if (!existing.isFile()) {
|
|
369
|
-
throw compareCommitError(
|
|
370
|
-
`Could not commit Architecture Delta: existing ${item.label} target is not a regular file.`,
|
|
371
|
-
'delta/commit-target',
|
|
372
|
-
{
|
|
373
|
-
target: path.basename(item.target),
|
|
374
|
-
targetType: existing.isDirectory() ? 'directory' : 'non-file',
|
|
375
|
-
supportedFixes: [`choose a regular-file path for the ${item.label}`],
|
|
376
|
-
},
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
const backedUp = [];
|
|
382
|
-
const committed = [];
|
|
383
|
-
try {
|
|
384
|
-
for (const item of targets) {
|
|
385
|
-
if (!fs.existsSync(item.target)) continue;
|
|
386
|
-
fs.renameSync(item.target, item.backup);
|
|
387
|
-
backedUp.push(item);
|
|
388
|
-
}
|
|
389
|
-
for (const item of targets) {
|
|
390
|
-
fs.renameSync(item.candidate, item.target);
|
|
391
|
-
committed.push(item);
|
|
392
|
-
}
|
|
393
|
-
} catch (cause) {
|
|
394
|
-
const rollbackErrors = [];
|
|
395
|
-
const recoveryFiles = [];
|
|
396
|
-
for (const item of [...committed].reverse()) {
|
|
397
|
-
try {
|
|
398
|
-
fs.rmSync(item.target, { force: true });
|
|
399
|
-
} catch (error) {
|
|
400
|
-
rollbackErrors.push(`${item.label}: remove failed (${error.message})`);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
for (const item of [...backedUp].reverse()) {
|
|
404
|
-
try {
|
|
405
|
-
if (fs.existsSync(item.target)) fs.rmSync(item.target, { force: true });
|
|
406
|
-
fs.renameSync(item.backup, item.target);
|
|
407
|
-
} catch (error) {
|
|
408
|
-
rollbackErrors.push(`${item.label}: restore failed (${error.message})`);
|
|
409
|
-
// Track failed restoration rather than probing existence: a permission
|
|
410
|
-
// error must not make cleanup discard a potentially recoverable backup.
|
|
411
|
-
recoveryFiles.push({ backup: item.backup, target: item.target });
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
throw compareCommitError(
|
|
415
|
-
(rollbackErrors.length
|
|
416
|
-
? 'Architecture Delta pair commit failed and its previous files could not be fully restored.'
|
|
417
|
-
: 'Architecture Delta pair commit failed; the previous files were restored.')
|
|
418
|
-
+ (recoveryFiles.length ? ` Recovery directory retained at ${stagingDirectory}.` : ''),
|
|
419
|
-
rollbackErrors.length ? 'delta/commit-rollback-failed' : 'delta/commit-failed',
|
|
420
|
-
{
|
|
421
|
-
reason: cause.message,
|
|
422
|
-
...(rollbackErrors.length ? { rollbackErrors } : {}),
|
|
423
|
-
...(recoveryFiles.length ? { recoveryDirectory: stagingDirectory, recoveryFiles } : {}),
|
|
424
|
-
supportedFixes: recoveryFiles.length
|
|
425
|
-
? [
|
|
426
|
-
...recoveryFiles.map(({ backup, target }) => `resolve the filesystem error, inspect the current target, then restore ${JSON.stringify(backup)} to ${JSON.stringify(target)} before retrying`),
|
|
427
|
-
'remove the recovery directory only after the previous files have been recovered and verified',
|
|
428
|
-
]
|
|
429
|
-
: ['check that both output paths are writable regular files, then retry'],
|
|
430
|
-
},
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot) {
|
|
436
|
-
const render = runNode([rendererPath('architecture'), inputPath, outputPath], {
|
|
437
|
-
stdio: 'pipe',
|
|
438
|
-
env: rendererEnv(quality, repoRoot, true),
|
|
439
|
-
});
|
|
440
|
-
if (render.status !== 0) {
|
|
441
|
-
const failure = rendererFailure(render);
|
|
442
|
-
const error = new Error(failure.error);
|
|
443
|
-
error.compareStage = 'input';
|
|
444
|
-
error.compareStatus = render.status ?? 1;
|
|
445
|
-
error.diagnostics = failure.diagnostics;
|
|
446
|
-
throw error;
|
|
447
|
-
}
|
|
448
|
-
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), outputPath], { stdio: 'pipe' });
|
|
449
|
-
if (check.status !== 0) {
|
|
450
|
-
const error = new Error('Validated snapshot failed final artifact checks.');
|
|
451
|
-
error.compareStage = 'check';
|
|
452
|
-
error.compareStatus = check.status ?? 1;
|
|
453
|
-
try {
|
|
454
|
-
error.checker = JSON.parse(check.stdout);
|
|
455
|
-
error.diagnostics = checkerDiagnostics(error.checker);
|
|
456
|
-
} catch {
|
|
457
|
-
error.diagnostics = [];
|
|
458
|
-
}
|
|
459
|
-
throw error;
|
|
460
|
-
}
|
|
461
|
-
const artifact = fs.readFileSync(outputPath);
|
|
462
|
-
return {
|
|
463
|
-
artifact,
|
|
464
|
-
html: artifact.toString('utf8'),
|
|
465
|
-
checks: JSON.parse(check.stdout),
|
|
466
|
-
sourceEvidence: sourceEvidenceFromArtifact(artifact),
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
async function commandCompare(args) {
|
|
471
|
-
const { resolveOutputPath } = await import('../renderers/shared/output-path.mjs');
|
|
472
|
-
const qualityArgs = extractQualityArgs(args);
|
|
473
|
-
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
|
|
474
|
-
const options = extractCompareOptions(repoArgs.rest);
|
|
475
|
-
const [type, baseInput, headInput, requestedOutput] = options.positional;
|
|
476
|
-
if (type !== 'architecture' || !baseInput || !headInput || options.positional.length > 4) fail(usage());
|
|
477
|
-
let deltaRuntime;
|
|
478
|
-
try {
|
|
479
|
-
deltaRuntime = await import(pathToFileURL(path.join(skillRoot, 'delta/architecture-delta.mjs')).href);
|
|
480
|
-
} catch (error) {
|
|
481
|
-
reportCompareFailure({ json: options.json, stage: 'prepare', error: 'Architecture compare runtime is unavailable.', code: 'delta/runtime-missing', details: { reason: error.message, supportedFixes: ['install the complete Archify skill package'] } });
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
const {
|
|
485
|
-
ArchitectureDeltaError,
|
|
486
|
-
annotateArchitectureSideSvg,
|
|
487
|
-
buildDeltaSvg,
|
|
488
|
-
canonicalArchitecture,
|
|
489
|
-
canonicalArchitectureJson,
|
|
490
|
-
compareArchitecture,
|
|
491
|
-
extractArchitectureSvg,
|
|
492
|
-
extractArtifactCss,
|
|
493
|
-
renderArchitectureDeltaHtml,
|
|
494
|
-
validateArchitectureDeltaHtml,
|
|
495
|
-
} = deltaRuntime;
|
|
496
|
-
|
|
497
|
-
const basePath = path.resolve(baseInput);
|
|
498
|
-
const headPath = path.resolve(headInput);
|
|
499
|
-
const receiptTarget = options.receipt || compareReceiptPath(path.resolve(requestedOutput || 'architecture-delta.html'));
|
|
500
|
-
let outputPath;
|
|
501
|
-
try {
|
|
502
|
-
({ outputPath } = resolveOutputPath({
|
|
503
|
-
requestedOutput,
|
|
504
|
-
defaultOutput: 'architecture-delta.html',
|
|
505
|
-
inputPaths: [basePath, headPath],
|
|
506
|
-
otherOutputPaths: [path.resolve(receiptTarget)],
|
|
507
|
-
}));
|
|
508
|
-
} catch (error) {
|
|
509
|
-
const outputDiagnostic = error.archifyDiagnostics?.[0];
|
|
510
|
-
reportCompareFailure({
|
|
511
|
-
json: options.json,
|
|
512
|
-
stage: 'prepare',
|
|
513
|
-
error: error.message,
|
|
514
|
-
code: outputDiagnostic?.code || 'output/path-resolution',
|
|
515
|
-
details: {
|
|
516
|
-
...(outputDiagnostic?.subject || {}),
|
|
517
|
-
...(outputDiagnostic?.evidence || {}),
|
|
518
|
-
supportedFixes: outputDiagnostic?.supportedFixes || ['choose a safe output path and retry'],
|
|
519
|
-
},
|
|
520
|
-
});
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
let receiptPath;
|
|
524
|
-
try {
|
|
525
|
-
({ outputPath: receiptPath } = resolveOutputPath({
|
|
526
|
-
requestedOutput: options.receipt || compareReceiptPath(outputPath),
|
|
527
|
-
defaultOutput: compareReceiptPath(outputPath),
|
|
528
|
-
requiredExtension: '.json',
|
|
529
|
-
inputPaths: [basePath, headPath],
|
|
530
|
-
otherOutputPaths: [outputPath],
|
|
531
|
-
}));
|
|
532
|
-
} catch (error) {
|
|
533
|
-
const outputDiagnostic = error.archifyDiagnostics?.[0];
|
|
534
|
-
reportCompareFailure({
|
|
535
|
-
json: options.json,
|
|
536
|
-
stage: 'prepare',
|
|
537
|
-
error: error.message,
|
|
538
|
-
code: outputDiagnostic?.code || 'output/path-resolution',
|
|
539
|
-
details: {
|
|
540
|
-
...(outputDiagnostic?.subject || {}),
|
|
541
|
-
...(outputDiagnostic?.evidence || {}),
|
|
542
|
-
supportedFixes: outputDiagnostic?.supportedFixes || ['choose a safe receipt path and retry'],
|
|
543
|
-
},
|
|
544
|
-
});
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
let baseBuffer;
|
|
548
|
-
let headBuffer;
|
|
549
|
-
let base;
|
|
550
|
-
let head;
|
|
551
|
-
try {
|
|
552
|
-
baseBuffer = fs.readFileSync(basePath);
|
|
553
|
-
base = JSON.parse(baseBuffer.toString('utf8'));
|
|
554
|
-
} catch (error) {
|
|
555
|
-
reportCompareFailure({ json: options.json, stage: 'input', error: `Could not read base input: ${error.message}`, code: 'delta/base-input', details: { side: 'base', reason: error.message } });
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
try {
|
|
559
|
-
headBuffer = fs.readFileSync(headPath);
|
|
560
|
-
head = JSON.parse(headBuffer.toString('utf8'));
|
|
561
|
-
} catch (error) {
|
|
562
|
-
reportCompareFailure({ json: options.json, stage: 'input', error: `Could not read head input: ${error.message}`, code: 'delta/head-input', details: { side: 'head', reason: error.message } });
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
const outputDirectory = path.dirname(outputPath);
|
|
567
|
-
if (path.dirname(receiptPath) !== outputDirectory) {
|
|
568
|
-
reportCompareFailure({ json: options.json, stage: 'prepare', error: 'The compare receipt must be written beside the HTML artifact.', code: 'delta/receipt-directory', details: { supportedFixes: ['choose a --receipt path in the same directory as output.html'] } });
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
try {
|
|
572
|
-
fs.mkdirSync(outputDirectory, { recursive: true });
|
|
573
|
-
} catch (error) {
|
|
574
|
-
reportCompareFailure({ json: options.json, stage: 'prepare', error: `Could not create compare output directory: ${error.message}`, code: 'delta/output-directory', details: { reason: error.message } });
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
let stagingDirectory;
|
|
579
|
-
try {
|
|
580
|
-
stagingDirectory = fs.mkdtempSync(path.join(outputDirectory, '.archify-compare-'));
|
|
581
|
-
} catch (error) {
|
|
582
|
-
reportCompareFailure({ json: options.json, stage: 'prepare', error: `Could not create compare candidate: ${error.message}`, code: 'delta/candidate-directory', details: { reason: error.message } });
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
const baseCandidate = path.join(stagingDirectory, 'base.html');
|
|
587
|
-
const headCandidate = path.join(stagingDirectory, 'head.html');
|
|
588
|
-
const rawBaseCandidate = path.join(stagingDirectory, 'base.raw.html');
|
|
589
|
-
const rawHeadCandidate = path.join(stagingDirectory, 'head.raw.html');
|
|
590
|
-
const rawBaseInput = path.join(stagingDirectory, 'base.snapshot.json');
|
|
591
|
-
const rawHeadInput = path.join(stagingDirectory, 'head.snapshot.json');
|
|
592
|
-
const canonicalBaseInput = path.join(stagingDirectory, 'base.architecture.json');
|
|
593
|
-
const canonicalHeadInput = path.join(stagingDirectory, 'head.architecture.json');
|
|
594
|
-
const htmlCandidate = path.join(stagingDirectory, path.basename(outputPath));
|
|
595
|
-
const receiptCandidate = path.join(stagingDirectory, path.basename(receiptPath));
|
|
596
|
-
let preserveRecoveryDirectory = false;
|
|
597
|
-
|
|
598
|
-
try {
|
|
599
|
-
let baseResult;
|
|
600
|
-
let headResult;
|
|
601
|
-
for (const { side, snapshotPath, buffer } of [
|
|
602
|
-
{ side: 'base', snapshotPath: rawBaseInput, buffer: baseBuffer },
|
|
603
|
-
{ side: 'head', snapshotPath: rawHeadInput, buffer: headBuffer },
|
|
604
|
-
]) {
|
|
605
|
-
try {
|
|
606
|
-
fs.writeFileSync(snapshotPath, buffer, { flag: 'wx' });
|
|
607
|
-
} catch (error) {
|
|
608
|
-
const message = `Could not freeze ${side} compare snapshot: ${error.message}`;
|
|
609
|
-
reportCompareFailure({
|
|
610
|
-
json: options.json,
|
|
611
|
-
stage: 'prepare',
|
|
612
|
-
error: message,
|
|
613
|
-
code: 'delta/freeze-snapshot',
|
|
614
|
-
details: {
|
|
615
|
-
side,
|
|
616
|
-
...(error?.code ? { systemCode: error.code } : {}),
|
|
617
|
-
reason: error.message,
|
|
618
|
-
supportedFixes: ['choose a writable compare output directory on the target filesystem'],
|
|
619
|
-
},
|
|
620
|
-
});
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
try {
|
|
625
|
-
renderValidatedArchitecture(rawBaseInput, rawBaseCandidate, qualityArgs.quality, repoArgs.repoRoot);
|
|
626
|
-
} catch (error) {
|
|
627
|
-
const diagnosticEntry = error.diagnostics?.[0];
|
|
628
|
-
reportCompareFailure({
|
|
629
|
-
json: options.json,
|
|
630
|
-
stage: error.compareStage || 'validate',
|
|
631
|
-
error: `Base snapshot failed validation: ${error.message}`,
|
|
632
|
-
code: diagnosticEntry?.code || 'delta/base-validation',
|
|
633
|
-
details: { side: 'base', ...(diagnosticEntry?.subject?.path ? { path: diagnosticEntry.subject.path } : {}), ...(diagnosticEntry?.evidence || {}), supportedFixes: diagnosticEntry?.supportedFixes || [] },
|
|
634
|
-
status: error.compareStatus || 1,
|
|
635
|
-
});
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
try {
|
|
639
|
-
renderValidatedArchitecture(rawHeadInput, rawHeadCandidate, qualityArgs.quality, repoArgs.repoRoot);
|
|
640
|
-
} catch (error) {
|
|
641
|
-
const diagnosticEntry = error.diagnostics?.[0];
|
|
642
|
-
reportCompareFailure({
|
|
643
|
-
json: options.json,
|
|
644
|
-
stage: error.compareStage || 'validate',
|
|
645
|
-
error: `Head snapshot failed validation: ${error.message}`,
|
|
646
|
-
code: diagnosticEntry?.code || 'delta/head-validation',
|
|
647
|
-
details: { side: 'head', ...(diagnosticEntry?.subject?.path ? { path: diagnosticEntry.subject.path } : {}), ...(diagnosticEntry?.evidence || {}), supportedFixes: diagnosticEntry?.supportedFixes || [] },
|
|
648
|
-
status: error.compareStatus || 1,
|
|
649
|
-
});
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
// Validation must see the exact authored inputs. Only after both sides
|
|
654
|
-
// pass do we canonicalize their collection order for deterministic SVG
|
|
655
|
-
// geometry and stable artifact bytes.
|
|
656
|
-
fs.writeFileSync(canonicalBaseInput, JSON.stringify(canonicalArchitecture(base)));
|
|
657
|
-
fs.writeFileSync(canonicalHeadInput, JSON.stringify(canonicalArchitecture(head)));
|
|
658
|
-
baseResult = renderValidatedArchitecture(canonicalBaseInput, baseCandidate, qualityArgs.quality, repoArgs.repoRoot);
|
|
659
|
-
headResult = renderValidatedArchitecture(canonicalHeadInput, headCandidate, qualityArgs.quality, repoArgs.repoRoot);
|
|
660
|
-
|
|
661
|
-
const semanticHash = (diagram) => createHash('sha256').update(canonicalArchitectureJson(diagram)).digest('hex');
|
|
662
|
-
let compareIr;
|
|
663
|
-
try {
|
|
664
|
-
compareIr = compareArchitecture(base, head, {
|
|
665
|
-
baseRawSha256: createHash('sha256').update(baseBuffer).digest('hex'),
|
|
666
|
-
headRawSha256: createHash('sha256').update(headBuffer).digest('hex'),
|
|
667
|
-
baseSemanticSha256: semanticHash(base),
|
|
668
|
-
headSemanticSha256: semanticHash(head),
|
|
669
|
-
baseBytes: baseBuffer.byteLength,
|
|
670
|
-
headBytes: headBuffer.byteLength,
|
|
671
|
-
baseVerified: Boolean(baseResult.sourceEvidence),
|
|
672
|
-
headVerified: Boolean(headResult.sourceEvidence),
|
|
673
|
-
});
|
|
674
|
-
} catch (error) {
|
|
675
|
-
if (!(error instanceof ArchitectureDeltaError)) throw error;
|
|
676
|
-
reportCompareFailure({ json: options.json, stage: 'compare', error: error.message, code: error.code, details: error.details });
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
const baseSourceSvg = extractArchitectureSvg(baseResult.html);
|
|
681
|
-
const headSourceSvg = extractArchitectureSvg(headResult.html);
|
|
682
|
-
const baseSvg = annotateArchitectureSideSvg(baseSourceSvg, compareIr, 'base');
|
|
683
|
-
const headSvg = annotateArchitectureSideSvg(headSourceSvg, compareIr, 'head');
|
|
684
|
-
const deltaSvg = buildDeltaSvg(baseSourceSvg, headSourceSvg, compareIr);
|
|
685
|
-
// Raw input hashes and byte counts belong in the sidecar receipt, not the
|
|
686
|
-
// artifact. Keeping them out makes formatting-only input rewrites produce
|
|
687
|
-
// the exact same canonical review HTML and artifact hash.
|
|
688
|
-
const artifactIr = {
|
|
689
|
-
...compareIr,
|
|
690
|
-
base: Object.fromEntries(Object.entries(compareIr.base).filter(([key]) => !['rawSha256', 'bytes'].includes(key))),
|
|
691
|
-
head: Object.fromEntries(Object.entries(compareIr.head).filter(([key]) => !['rawSha256', 'bytes'].includes(key))),
|
|
692
|
-
};
|
|
693
|
-
const html = renderArchitectureDeltaHtml({
|
|
694
|
-
receipt: artifactIr,
|
|
695
|
-
baseSvg,
|
|
696
|
-
deltaSvg,
|
|
697
|
-
headSvg,
|
|
698
|
-
baseHtml: baseResult.html,
|
|
699
|
-
headHtml: headResult.html,
|
|
700
|
-
artifactCss: extractArtifactCss(headResult.html),
|
|
701
|
-
});
|
|
702
|
-
const deltaValidation = validateArchitectureDeltaHtml(html, artifactIr);
|
|
703
|
-
fs.writeFileSync(htmlCandidate, html);
|
|
704
|
-
const artifact = fs.readFileSync(htmlCandidate);
|
|
705
|
-
const baseChecks = baseResult.checks.checks.filter((check) => check.ok).length;
|
|
706
|
-
const headChecks = headResult.checks.checks.filter((check) => check.ok).length;
|
|
707
|
-
const finalReceipt = {
|
|
708
|
-
...compareIr,
|
|
709
|
-
artifact: { sha256: createHash('sha256').update(artifact).digest('hex'), bytes: artifact.byteLength },
|
|
710
|
-
validation: {
|
|
711
|
-
checksPassed: baseChecks + headChecks + deltaValidation.checksPassed,
|
|
712
|
-
checkCount: baseResult.checks.checks.length + headResult.checks.checks.length + deltaValidation.checkCount,
|
|
713
|
-
baseComposition: baseResult.checks.composition.status,
|
|
714
|
-
headComposition: headResult.checks.composition.status,
|
|
715
|
-
},
|
|
716
|
-
};
|
|
717
|
-
fs.writeFileSync(receiptCandidate, `${JSON.stringify(finalReceipt, null, 2)}\n`);
|
|
718
|
-
|
|
719
|
-
try {
|
|
720
|
-
const currentOutput = resolveOutputPath({
|
|
721
|
-
requestedOutput,
|
|
722
|
-
defaultOutput: 'architecture-delta.html',
|
|
723
|
-
inputPaths: [basePath, headPath],
|
|
724
|
-
otherOutputPaths: [receiptPath],
|
|
725
|
-
}).outputPath;
|
|
726
|
-
resolveOutputPath({
|
|
727
|
-
requestedOutput: options.receipt || compareReceiptPath(currentOutput),
|
|
728
|
-
defaultOutput: compareReceiptPath(currentOutput),
|
|
729
|
-
requiredExtension: '.json',
|
|
730
|
-
inputPaths: [basePath, headPath],
|
|
731
|
-
otherOutputPaths: [currentOutput],
|
|
732
|
-
});
|
|
733
|
-
} catch (error) {
|
|
734
|
-
const outputDiagnostic = error.archifyDiagnostics?.[0];
|
|
735
|
-
reportCompareFailure({
|
|
736
|
-
json: options.json,
|
|
737
|
-
stage: 'commit',
|
|
738
|
-
error: error.message,
|
|
739
|
-
code: outputDiagnostic?.code || 'output/path-resolution',
|
|
740
|
-
details: {
|
|
741
|
-
...(outputDiagnostic?.subject || {}),
|
|
742
|
-
...(outputDiagnostic?.evidence || {}),
|
|
743
|
-
supportedFixes: outputDiagnostic?.supportedFixes || ['restore safe output paths and retry'],
|
|
744
|
-
},
|
|
745
|
-
});
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
commitComparePair({ htmlCandidate, receiptCandidate, outputPath, receiptPath, stagingDirectory });
|
|
750
|
-
if (options.json) console.log(JSON.stringify(finalReceipt, null, 2));
|
|
751
|
-
else {
|
|
752
|
-
console.log(`compared architecture ${outputPath}`);
|
|
753
|
-
console.log(`${finalReceipt.validation.checksPassed}/${finalReceipt.validation.checkCount} checks; completeness ${finalReceipt.completeness}; ${finalReceipt.proofLevel}; sha256 ${finalReceipt.artifact.sha256.slice(0, 12)}`);
|
|
754
|
-
console.log(`receipt ${receiptPath}`);
|
|
755
|
-
}
|
|
756
|
-
} catch (error) {
|
|
757
|
-
if (error instanceof ArchitectureDeltaError) {
|
|
758
|
-
reportCompareFailure({ json: options.json, stage: 'artifact', error: error.message, code: error.code, details: error.details });
|
|
759
|
-
} else if (error.compareStage === 'commit') {
|
|
760
|
-
preserveRecoveryDirectory = Boolean(error.compareDetails?.recoveryFiles?.length);
|
|
761
|
-
reportCompareFailure({
|
|
762
|
-
json: options.json,
|
|
763
|
-
stage: error.compareStage,
|
|
764
|
-
error: error.message,
|
|
765
|
-
code: error.compareCode,
|
|
766
|
-
details: error.compareDetails,
|
|
767
|
-
});
|
|
768
|
-
} else {
|
|
769
|
-
reportCompareFailure({ json: options.json, stage: 'internal', error: 'Architecture compare failed before commit.', code: 'delta/internal', details: { reason: error.message } });
|
|
770
|
-
}
|
|
771
|
-
} finally {
|
|
772
|
-
try {
|
|
773
|
-
if (!preserveRecoveryDirectory) fs.rmSync(stagingDirectory, { recursive: true, force: true });
|
|
774
|
-
} catch (error) {
|
|
775
|
-
console.error(`Warning: could not remove compare staging directory: ${error.message}`);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
function commandRender(args) {
|
|
781
|
-
const qualityArgs = extractQualityArgs(args);
|
|
782
|
-
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
|
|
783
|
-
// render takes no options of its own once --quality and --repo-root are
|
|
784
|
-
// stripped, so anything left starting with -- is a typo. Without this a
|
|
785
|
-
// mistyped flag was taken as the output path: `render architecture spec.json
|
|
786
|
-
// --json out.html` wrote a file literally named `--json` and never wrote
|
|
787
|
-
// out.html, exiting 0. Every sibling subcommand already guards this.
|
|
788
|
-
const unknown = repoArgs.rest.filter((arg) => arg.startsWith('--'));
|
|
789
|
-
if (unknown.length) fail(`Unknown render option "${unknown[0]}".`);
|
|
790
|
-
const [type, input, output] = repoArgs.rest;
|
|
791
|
-
if (!type || !input || repoArgs.rest.length > 3) fail(usage());
|
|
792
|
-
assertEvidenceType(type, repoArgs.repoRoot);
|
|
793
|
-
const result = runNode([rendererPath(type), input, ...(output ? [output] : [])], {
|
|
794
|
-
env: rendererEnv(qualityArgs.quality, repoArgs.repoRoot),
|
|
795
|
-
});
|
|
796
|
-
if (result.status !== 0) exitFrom(result);
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
function reportArtifactFailure({ command, json, stage, type, input, output, error, diagnostics = [], status = 1, checker }) {
|
|
800
|
-
const receipt = {
|
|
801
|
-
schemaVersion: 1,
|
|
802
|
-
ok: false,
|
|
803
|
-
command,
|
|
804
|
-
stage,
|
|
805
|
-
type,
|
|
806
|
-
input,
|
|
807
|
-
...(output === undefined ? {} : { output }),
|
|
808
|
-
error,
|
|
809
|
-
diagnostics,
|
|
810
|
-
...(checker ? { checker } : {}),
|
|
811
|
-
};
|
|
812
|
-
if (json) console.log(JSON.stringify(receipt, null, 2));
|
|
813
|
-
else console.error(formatDiagnostics(error, diagnostics));
|
|
814
|
-
process.exitCode = status;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
function reportDeliveryFailure(options) {
|
|
818
|
-
reportArtifactFailure({ ...options, command: 'deliver' });
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
function reportValidateFailure(options) {
|
|
822
|
-
reportArtifactFailure({ ...options, command: 'validate' });
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
function reportArtifactArgumentFailure(command, error) {
|
|
826
|
-
const details = error.archifyArgument || {};
|
|
827
|
-
reportArtifactFailure({
|
|
828
|
-
command,
|
|
829
|
-
json: true,
|
|
830
|
-
stage: 'arguments',
|
|
831
|
-
error: error.message,
|
|
832
|
-
diagnostics: [diagnostic({
|
|
833
|
-
code: details.code || 'cli/invalid-arguments',
|
|
834
|
-
message: error.message,
|
|
835
|
-
subject: { command, ...(details.subject || {}) },
|
|
836
|
-
evidence: details.evidence || {},
|
|
837
|
-
supportedFixes: details.supportedFixes || ['correct the command arguments and retry'],
|
|
838
|
-
})],
|
|
839
|
-
status: 2,
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
function sourceEvidenceFromArtifact(artifact) {
|
|
844
|
-
const html = artifact.toString('utf8');
|
|
845
|
-
const match = html.match(/<script id="archify-source-evidence-data" type="application\/json">([\s\S]*?)<\/script>/);
|
|
846
|
-
if (!match) return null;
|
|
847
|
-
const evidence = JSON.parse(match[1]);
|
|
848
|
-
if (evidence?.verified !== true || !evidence.repository?.url || !evidence.repository?.revision || !Number.isInteger(evidence.referenceCount)) {
|
|
849
|
-
throw new Error('Rendered source evidence receipt is incomplete.');
|
|
850
|
-
}
|
|
851
|
-
return evidence;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
function engineeringProfileFromArtifact(artifact) {
|
|
855
|
-
const match = artifact.toString('utf8').match(/<svg[^>]*\sdata-engineering-profile="([^"]+)"/);
|
|
856
|
-
return match ? match[1] : null;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
async function commandDeliver(args) {
|
|
860
|
-
const qualityArgs = extractQualityArgs(args);
|
|
861
|
-
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
|
|
862
|
-
const json = repoArgs.rest.includes('--json');
|
|
863
|
-
const open = repoArgs.rest.includes('--open');
|
|
864
|
-
const knownOptions = new Set(['--json', '--open']);
|
|
865
|
-
const unknown = repoArgs.rest.filter((arg) => arg.startsWith('--') && !knownOptions.has(arg));
|
|
866
|
-
if (unknown.length) rejectCliArgument(`Unknown deliver option "${unknown[0]}".`, {
|
|
867
|
-
code: 'cli/unknown-option',
|
|
868
|
-
subject: { option: unknown[0] },
|
|
869
|
-
supportedFixes: ['remove the unknown option and retry'],
|
|
870
|
-
});
|
|
871
|
-
const positional = repoArgs.rest.filter((arg) => !knownOptions.has(arg));
|
|
872
|
-
const [type, input, requestedOutput] = positional;
|
|
873
|
-
if (!type || !input || positional.length > 3) rejectCliArgument(usage(), {
|
|
874
|
-
code: 'cli/usage',
|
|
875
|
-
supportedFixes: ['use: archify deliver <type> <input.json> [output.html] [options]'],
|
|
876
|
-
});
|
|
877
|
-
assertEvidenceType(type, repoArgs.repoRoot);
|
|
878
|
-
const renderer = rendererPath(type);
|
|
879
|
-
const { resolveOutputPath } = await import('../renderers/shared/output-path.mjs');
|
|
880
|
-
const inputPath = path.resolve(input);
|
|
881
|
-
let specification;
|
|
882
|
-
let diagram;
|
|
883
|
-
try {
|
|
884
|
-
specification = fs.readFileSync(inputPath);
|
|
885
|
-
diagram = JSON.parse(specification.toString('utf8'));
|
|
886
|
-
} catch (error) {
|
|
887
|
-
const repair = inputDiagnostic(error, inputPath);
|
|
888
|
-
reportDeliveryFailure({
|
|
889
|
-
json,
|
|
890
|
-
stage: 'input',
|
|
891
|
-
type,
|
|
892
|
-
input: inputPath,
|
|
893
|
-
output: path.resolve(requestedOutput || `${type}.html`),
|
|
894
|
-
error: `Could not read delivery input "${inputPath}": ${error.message}`,
|
|
895
|
-
diagnostics: [repair],
|
|
896
|
-
});
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
const authoredOutput = typeof diagram?.meta?.output === 'string' && diagram.meta.output
|
|
901
|
-
? diagram.meta.output
|
|
902
|
-
: undefined;
|
|
903
|
-
let outputPath;
|
|
904
|
-
try {
|
|
905
|
-
({ outputPath } = resolveOutputPath({
|
|
906
|
-
requestedOutput,
|
|
907
|
-
authoredOutput,
|
|
908
|
-
defaultOutput: `${type}.html`,
|
|
909
|
-
inputPaths: [inputPath],
|
|
910
|
-
}));
|
|
911
|
-
} catch (error) {
|
|
912
|
-
const attemptedOutput = path.resolve(requestedOutput || authoredOutput || `${type}.html`);
|
|
913
|
-
reportDeliveryFailure({
|
|
914
|
-
json,
|
|
915
|
-
stage: 'prepare',
|
|
916
|
-
type,
|
|
917
|
-
input: inputPath,
|
|
918
|
-
output: attemptedOutput,
|
|
919
|
-
error: error.message,
|
|
920
|
-
diagnostics: error.archifyDiagnostics || [diagnostic({
|
|
921
|
-
code: 'output/path-resolution',
|
|
922
|
-
message: error.message,
|
|
923
|
-
subject: { output: attemptedOutput },
|
|
924
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}) },
|
|
925
|
-
supportedFixes: ['choose a safe output path and retry'],
|
|
926
|
-
})],
|
|
927
|
-
});
|
|
928
|
-
return;
|
|
929
|
-
}
|
|
930
|
-
const outputDirectory = path.dirname(outputPath);
|
|
931
|
-
try {
|
|
932
|
-
fs.mkdirSync(outputDirectory, { recursive: true });
|
|
933
|
-
} catch (error) {
|
|
934
|
-
const message = `Could not create delivery directory "${outputDirectory}": ${error.message}`;
|
|
935
|
-
reportDeliveryFailure({
|
|
936
|
-
json,
|
|
937
|
-
stage: 'prepare',
|
|
938
|
-
type,
|
|
939
|
-
input: inputPath,
|
|
940
|
-
output: outputPath,
|
|
941
|
-
error: message,
|
|
942
|
-
diagnostics: [diagnostic({
|
|
943
|
-
code: 'delivery/prepare-directory',
|
|
944
|
-
message,
|
|
945
|
-
subject: { outputDirectory },
|
|
946
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
947
|
-
supportedFixes: ['choose a writable output directory'],
|
|
948
|
-
})],
|
|
949
|
-
});
|
|
950
|
-
return;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
// Keep the candidate beside the target so the final rename is one
|
|
954
|
-
// same-filesystem commit. A render or artifact-check failure never touches
|
|
955
|
-
// an existing trusted output.
|
|
956
|
-
let stagingDirectory;
|
|
957
|
-
try {
|
|
958
|
-
stagingDirectory = fs.mkdtempSync(path.join(outputDirectory, '.archify-delivery-'));
|
|
959
|
-
} catch (error) {
|
|
960
|
-
const message = `Could not create a delivery candidate beside "${outputPath}": ${error.message}`;
|
|
961
|
-
reportDeliveryFailure({
|
|
962
|
-
json,
|
|
963
|
-
stage: 'prepare',
|
|
964
|
-
type,
|
|
965
|
-
input: inputPath,
|
|
966
|
-
output: outputPath,
|
|
967
|
-
error: message,
|
|
968
|
-
diagnostics: [diagnostic({
|
|
969
|
-
code: 'delivery/prepare-candidate',
|
|
970
|
-
message,
|
|
971
|
-
subject: { output: outputPath },
|
|
972
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
973
|
-
supportedFixes: ['choose a writable output directory on the target filesystem'],
|
|
974
|
-
})],
|
|
975
|
-
});
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
const candidatePath = path.join(stagingDirectory, path.basename(outputPath));
|
|
979
|
-
const specificationSnapshotPath = path.join(stagingDirectory, 'specification.snapshot.json');
|
|
980
|
-
|
|
981
|
-
try {
|
|
982
|
-
try {
|
|
983
|
-
fs.writeFileSync(specificationSnapshotPath, specification, { flag: 'wx' });
|
|
984
|
-
} catch (error) {
|
|
985
|
-
const message = `Could not freeze the delivery specification: ${error.message}`;
|
|
986
|
-
reportDeliveryFailure({
|
|
987
|
-
json,
|
|
988
|
-
stage: 'prepare',
|
|
989
|
-
type,
|
|
990
|
-
input: inputPath,
|
|
991
|
-
output: outputPath,
|
|
992
|
-
error: message,
|
|
993
|
-
diagnostics: [diagnostic({
|
|
994
|
-
code: 'delivery/freeze-specification',
|
|
995
|
-
message,
|
|
996
|
-
subject: { input: inputPath },
|
|
997
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
998
|
-
supportedFixes: ['choose a writable output directory on the target filesystem'],
|
|
999
|
-
})],
|
|
1000
|
-
});
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
const render = runNode([renderer, specificationSnapshotPath, candidatePath], {
|
|
1005
|
-
stdio: 'pipe',
|
|
1006
|
-
env: rendererEnv(qualityArgs.quality, repoArgs.repoRoot, true),
|
|
1007
|
-
});
|
|
1008
|
-
if (render.status !== 0) {
|
|
1009
|
-
const failure = rendererFailure(render);
|
|
1010
|
-
reportDeliveryFailure({
|
|
1011
|
-
json,
|
|
1012
|
-
stage: 'render',
|
|
1013
|
-
type,
|
|
1014
|
-
input: inputPath,
|
|
1015
|
-
output: outputPath,
|
|
1016
|
-
error: failure.error,
|
|
1017
|
-
diagnostics: failure.diagnostics,
|
|
1018
|
-
status: render.status ?? 1,
|
|
1019
|
-
});
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), candidatePath], {
|
|
1024
|
-
stdio: 'pipe',
|
|
1025
|
-
});
|
|
1026
|
-
if (check.status !== 0) {
|
|
1027
|
-
if (check.stderr) process.stderr.write(check.stderr);
|
|
1028
|
-
let checker;
|
|
1029
|
-
try {
|
|
1030
|
-
checker = JSON.parse(check.stdout);
|
|
1031
|
-
checker.file = outputPath;
|
|
1032
|
-
} catch {
|
|
1033
|
-
checker = { ok: false, file: outputPath, diagnostic: check.stdout.trim() };
|
|
1034
|
-
}
|
|
1035
|
-
reportDeliveryFailure({
|
|
1036
|
-
json,
|
|
1037
|
-
stage: 'check',
|
|
1038
|
-
type,
|
|
1039
|
-
input: inputPath,
|
|
1040
|
-
output: outputPath,
|
|
1041
|
-
error: 'Final artifact check failed; the previous artifact was preserved.',
|
|
1042
|
-
diagnostics: checkerDiagnostics(checker),
|
|
1043
|
-
status: check.status ?? 1,
|
|
1044
|
-
checker,
|
|
1045
|
-
});
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
let result;
|
|
1050
|
-
try {
|
|
1051
|
-
result = JSON.parse(check.stdout);
|
|
1052
|
-
} catch (error) {
|
|
1053
|
-
const message = `Could not parse the successful artifact-check receipt: ${error.message}`;
|
|
1054
|
-
reportDeliveryFailure({
|
|
1055
|
-
json,
|
|
1056
|
-
stage: 'receipt',
|
|
1057
|
-
type,
|
|
1058
|
-
input: inputPath,
|
|
1059
|
-
output: outputPath,
|
|
1060
|
-
error: message,
|
|
1061
|
-
diagnostics: [diagnostic({
|
|
1062
|
-
code: 'delivery/receipt-invalid',
|
|
1063
|
-
message,
|
|
1064
|
-
subject: { output: outputPath },
|
|
1065
|
-
evidence: { reason: error.message },
|
|
1066
|
-
})],
|
|
1067
|
-
});
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
let artifact;
|
|
1071
|
-
try {
|
|
1072
|
-
artifact = fs.readFileSync(candidatePath);
|
|
1073
|
-
} catch (error) {
|
|
1074
|
-
const message = `Could not read the verified delivery candidate: ${error.message}`;
|
|
1075
|
-
reportDeliveryFailure({
|
|
1076
|
-
json,
|
|
1077
|
-
stage: 'receipt',
|
|
1078
|
-
type,
|
|
1079
|
-
input: inputPath,
|
|
1080
|
-
output: outputPath,
|
|
1081
|
-
error: message,
|
|
1082
|
-
diagnostics: [diagnostic({
|
|
1083
|
-
code: 'delivery/candidate-unreadable',
|
|
1084
|
-
message,
|
|
1085
|
-
subject: { output: outputPath },
|
|
1086
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
1087
|
-
})],
|
|
1088
|
-
});
|
|
1089
|
-
return;
|
|
1090
|
-
}
|
|
1091
|
-
let sourceEvidence;
|
|
1092
|
-
try {
|
|
1093
|
-
sourceEvidence = sourceEvidenceFromArtifact(artifact);
|
|
1094
|
-
} catch (error) {
|
|
1095
|
-
const message = `Could not read the repository evidence receipt: ${error.message}`;
|
|
1096
|
-
reportDeliveryFailure({
|
|
1097
|
-
json,
|
|
1098
|
-
stage: 'receipt',
|
|
1099
|
-
type,
|
|
1100
|
-
input: inputPath,
|
|
1101
|
-
output: outputPath,
|
|
1102
|
-
error: message,
|
|
1103
|
-
diagnostics: [diagnostic({
|
|
1104
|
-
code: 'delivery/evidence-receipt-invalid',
|
|
1105
|
-
message,
|
|
1106
|
-
subject: { output: outputPath },
|
|
1107
|
-
evidence: { reason: error.message },
|
|
1108
|
-
})],
|
|
1109
|
-
});
|
|
1110
|
-
return;
|
|
1111
|
-
}
|
|
1112
|
-
const engineeringProfile = engineeringProfileFromArtifact(artifact);
|
|
1113
|
-
const receipt = {
|
|
1114
|
-
schemaVersion: 1,
|
|
1115
|
-
ok: true,
|
|
1116
|
-
command: 'deliver',
|
|
1117
|
-
type,
|
|
1118
|
-
input: inputPath,
|
|
1119
|
-
output: outputPath,
|
|
1120
|
-
specification: {
|
|
1121
|
-
sha256: createHash('sha256').update(specification).digest('hex'),
|
|
1122
|
-
bytes: specification.byteLength,
|
|
1123
|
-
},
|
|
1124
|
-
artifact: {
|
|
1125
|
-
sha256: createHash('sha256').update(artifact).digest('hex'),
|
|
1126
|
-
bytes: artifact.byteLength,
|
|
1127
|
-
},
|
|
1128
|
-
validation: {
|
|
1129
|
-
checksPassed: result.checks.filter((checkItem) => checkItem.ok).length,
|
|
1130
|
-
checkCount: result.checks.length,
|
|
1131
|
-
compositionProfile: result.composition.profile,
|
|
1132
|
-
compositionStatus: result.composition.status,
|
|
1133
|
-
...(engineeringProfile ? { engineeringProfile } : {}),
|
|
1134
|
-
errors: result.composition.summary.errors,
|
|
1135
|
-
warnings: result.composition.summary.warnings,
|
|
1136
|
-
},
|
|
1137
|
-
...(sourceEvidence ? {
|
|
1138
|
-
evidence: {
|
|
1139
|
-
verified: true,
|
|
1140
|
-
repository: sourceEvidence.repository.url,
|
|
1141
|
-
revision: sourceEvidence.repository.revision,
|
|
1142
|
-
references: sourceEvidence.referenceCount,
|
|
1143
|
-
...(sourceEvidence.repository.linkMode ? { linkMode: sourceEvidence.repository.linkMode } : {}),
|
|
1144
|
-
},
|
|
1145
|
-
} : {}),
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
try {
|
|
1149
|
-
resolveOutputPath({
|
|
1150
|
-
requestedOutput,
|
|
1151
|
-
authoredOutput,
|
|
1152
|
-
defaultOutput: `${type}.html`,
|
|
1153
|
-
inputPaths: [inputPath],
|
|
1154
|
-
});
|
|
1155
|
-
} catch (error) {
|
|
1156
|
-
reportDeliveryFailure({
|
|
1157
|
-
json,
|
|
1158
|
-
stage: 'commit',
|
|
1159
|
-
type,
|
|
1160
|
-
input: inputPath,
|
|
1161
|
-
output: outputPath,
|
|
1162
|
-
error: error.message,
|
|
1163
|
-
diagnostics: error.archifyDiagnostics || [diagnostic({
|
|
1164
|
-
code: 'output/path-resolution',
|
|
1165
|
-
message: error.message,
|
|
1166
|
-
subject: { output: outputPath },
|
|
1167
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}) },
|
|
1168
|
-
supportedFixes: ['restore a safe output path and retry'],
|
|
1169
|
-
})],
|
|
1170
|
-
});
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
try {
|
|
1175
|
-
fs.renameSync(candidatePath, outputPath);
|
|
1176
|
-
} catch (error) {
|
|
1177
|
-
const message = `Could not commit verified delivery "${outputPath}": ${error.message}`;
|
|
1178
|
-
reportDeliveryFailure({
|
|
1179
|
-
json,
|
|
1180
|
-
stage: 'commit',
|
|
1181
|
-
type,
|
|
1182
|
-
input: inputPath,
|
|
1183
|
-
output: outputPath,
|
|
1184
|
-
error: message,
|
|
1185
|
-
diagnostics: [diagnostic({
|
|
1186
|
-
code: 'delivery/commit',
|
|
1187
|
-
message,
|
|
1188
|
-
subject: { output: outputPath },
|
|
1189
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
1190
|
-
supportedFixes: ['choose a replaceable file target on the same writable filesystem'],
|
|
1191
|
-
})],
|
|
1192
|
-
});
|
|
1193
|
-
return;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
if (open) {
|
|
1197
|
-
try {
|
|
1198
|
-
const { openArtifact } = await import('./open-artifact.mjs');
|
|
1199
|
-
receipt.open = openArtifact(outputPath);
|
|
1200
|
-
} catch {
|
|
1201
|
-
receipt.open = {
|
|
1202
|
-
requested: true,
|
|
1203
|
-
status: 'unsupported',
|
|
1204
|
-
target: outputPath,
|
|
1205
|
-
method: null,
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
if (receipt.open.status !== 'opened') {
|
|
1209
|
-
console.error(`Could not open the verified artifact (${receipt.open.status}). Open it manually: ${outputPath}`);
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
if (json) {
|
|
1214
|
-
console.log(JSON.stringify(receipt, null, 2));
|
|
1215
|
-
} else {
|
|
1216
|
-
console.log(`delivered ${type} ${outputPath}`);
|
|
1217
|
-
const engineering = receipt.validation.engineeringProfile
|
|
1218
|
-
? `; engineering ${receipt.validation.engineeringProfile}: pass`
|
|
1219
|
-
: '';
|
|
1220
|
-
console.log(`${receipt.validation.checksPassed}/${receipt.validation.checkCount} artifact checks; composition ${receipt.validation.compositionProfile}: ${receipt.validation.compositionStatus}${engineering}; sha256 ${receipt.artifact.sha256.slice(0, 12)}`);
|
|
1221
|
-
if (receipt.open?.status === 'opened') console.log(`opened ${outputPath}`);
|
|
1222
|
-
}
|
|
1223
|
-
} finally {
|
|
1224
|
-
try {
|
|
1225
|
-
fs.rmSync(stagingDirectory, { recursive: true, force: true });
|
|
1226
|
-
} catch (error) {
|
|
1227
|
-
console.error(`Warning: could not remove delivery staging directory "${stagingDirectory}": ${error.message}`);
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
async function commandPreview(args) {
|
|
1233
|
-
const qualityArgs = extractQualityArgs(args);
|
|
1234
|
-
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
|
|
1235
|
-
const noOpen = repoArgs.rest.includes('--no-open');
|
|
1236
|
-
const knownOptions = new Set(['--no-open']);
|
|
1237
|
-
const unknown = repoArgs.rest.filter((arg) => arg.startsWith('--') && !knownOptions.has(arg));
|
|
1238
|
-
if (unknown.length) fail(`Unknown preview option "${unknown[0]}".`);
|
|
1239
|
-
const positional = repoArgs.rest.filter((arg) => !knownOptions.has(arg));
|
|
1240
|
-
const [type, input, output] = positional;
|
|
1241
|
-
if (!type || !input || positional.length > 3) fail(usage());
|
|
1242
|
-
assertEvidenceType(type, repoArgs.repoRoot);
|
|
1243
|
-
rendererPath(type);
|
|
1244
|
-
|
|
1245
|
-
let runPreview;
|
|
1246
|
-
try {
|
|
1247
|
-
({ runPreview } = await import('./preview.mjs'));
|
|
1248
|
-
} catch (error) {
|
|
1249
|
-
fail(`Could not load live preview: ${error.message}`, 1);
|
|
1250
|
-
}
|
|
1251
|
-
try {
|
|
1252
|
-
await runPreview({
|
|
1253
|
-
type,
|
|
1254
|
-
input,
|
|
1255
|
-
output,
|
|
1256
|
-
quality: qualityArgs.quality,
|
|
1257
|
-
repoRoot: repoArgs.repoRoot,
|
|
1258
|
-
open: !noOpen,
|
|
1259
|
-
});
|
|
1260
|
-
} catch (error) {
|
|
1261
|
-
fail(`Could not start live preview: ${error.message}`, 1);
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
function commandCheck(args) {
|
|
1266
|
-
const unknown = args.find((arg) => arg.startsWith('--'));
|
|
1267
|
-
if (unknown) fail(`Unknown check option "${unknown}".`);
|
|
1268
|
-
const [html] = args;
|
|
1269
|
-
if (!html || args.length !== 1) fail(usage());
|
|
1270
|
-
const result = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), html]);
|
|
1271
|
-
if (result.status !== 0) exitFrom(result);
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
async function commandVisualCheck(args) {
|
|
1275
|
-
const json = args.includes('--json');
|
|
1276
|
-
const knownOptions = new Set(['--json']);
|
|
1277
|
-
const unknown = args.filter((arg) => arg.startsWith('--') && !knownOptions.has(arg));
|
|
1278
|
-
if (unknown.length) fail(`Unknown visual-check option "${unknown[0]}".`, 1);
|
|
1279
|
-
const positional = args.filter((arg) => !knownOptions.has(arg));
|
|
1280
|
-
if (positional.length !== 1) fail(usage(), 1);
|
|
1281
|
-
|
|
1282
|
-
let runVisualCheck;
|
|
1283
|
-
try {
|
|
1284
|
-
({ runVisualCheck } = await import('./visual-check.mjs'));
|
|
1285
|
-
} catch (error) {
|
|
1286
|
-
fail(`Could not load visual-check: ${error.message}`, 1);
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
let result;
|
|
1290
|
-
try {
|
|
1291
|
-
result = await runVisualCheck({ artifactPath: positional[0] });
|
|
1292
|
-
} catch (error) {
|
|
1293
|
-
if (json) {
|
|
1294
|
-
console.log(JSON.stringify({
|
|
1295
|
-
schemaVersion: 1,
|
|
1296
|
-
ok: false,
|
|
1297
|
-
command: 'visual-check',
|
|
1298
|
-
evidenceKind: 'automated-browser',
|
|
1299
|
-
status: 'fail',
|
|
1300
|
-
visualReview: 'pending',
|
|
1301
|
-
artifact: { path: path.resolve(positional[0]) },
|
|
1302
|
-
error: error.message,
|
|
1303
|
-
}, null, 2));
|
|
1304
|
-
} else {
|
|
1305
|
-
console.error(`automated browser evidence failed: ${error.message}`);
|
|
1306
|
-
console.error('perceptual visual review pending');
|
|
1307
|
-
}
|
|
1308
|
-
process.exitCode = 1;
|
|
1309
|
-
return;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
if (json) {
|
|
1313
|
-
console.log(JSON.stringify(result.receipt, null, 2));
|
|
1314
|
-
} else {
|
|
1315
|
-
console.log(`automated browser evidence ${result.receipt.status}: ${result.receipt.artifact.path}`);
|
|
1316
|
-
console.log(`visual-check containment ${result.receipt.containment.status}; captures ${result.receipt.captures.status}; perceptual visual review pending`);
|
|
1317
|
-
console.log(`receipt ${path.join(path.dirname(result.receipt.artifact.path), result.receipt.sidecars.receipt)}`);
|
|
1318
|
-
if (result.receipt.captures.contactSheet) {
|
|
1319
|
-
console.log(`contact sheet ${path.join(path.dirname(result.receipt.artifact.path), result.receipt.captures.contactSheet)}`);
|
|
1320
|
-
}
|
|
1321
|
-
if (result.receipt.error) console.error(result.receipt.error);
|
|
1322
|
-
}
|
|
1323
|
-
process.exitCode = result.exitCode;
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
function commandExamples(args) {
|
|
1327
|
-
const unknown = args.find((arg) => arg.startsWith('--'));
|
|
1328
|
-
if (unknown) fail(`Unknown examples option "${unknown}".`);
|
|
1329
|
-
if (args.length) fail(usage());
|
|
1330
|
-
const result = runNode([path.join(skillRoot, 'scripts/render-examples.mjs')], { cwd: skillRoot });
|
|
1331
|
-
if (result.status !== 0) exitFrom(result);
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
async function commandDoctor(args) {
|
|
1335
|
-
const unknown = args.find((arg) => arg.startsWith('--'));
|
|
1336
|
-
if (unknown) fail(`Unknown doctor option "${unknown}".`);
|
|
1337
|
-
if (args.length) fail(usage());
|
|
1338
|
-
const checks = [];
|
|
1339
|
-
const nodeMajor = Number.parseInt(process.versions.node.split('.')[0], 10);
|
|
1340
|
-
checks.push({
|
|
1341
|
-
label: `Node.js v${process.versions.node} (requires >=18)`,
|
|
1342
|
-
ok: nodeMajor >= 18,
|
|
1343
|
-
missing: 0,
|
|
1344
|
-
failureLabel: 'unsupported',
|
|
1345
|
-
});
|
|
1346
|
-
|
|
1347
|
-
const template = path.join(skillRoot, 'assets/template.html');
|
|
1348
|
-
checks.push({
|
|
1349
|
-
label: 'Core template',
|
|
1350
|
-
ok: fs.existsSync(template),
|
|
1351
|
-
missing: fs.existsSync(template) ? 0 : 1,
|
|
1352
|
-
});
|
|
1353
|
-
|
|
1354
|
-
const examplesRenderer = path.join(skillRoot, 'scripts/render-examples.mjs');
|
|
1355
|
-
checks.push({
|
|
1356
|
-
label: 'Example renderer',
|
|
1357
|
-
ok: fs.existsSync(examplesRenderer),
|
|
1358
|
-
missing: fs.existsSync(examplesRenderer) ? 0 : 1,
|
|
1359
|
-
});
|
|
1360
|
-
|
|
1361
|
-
const previewRuntime = path.join(skillRoot, 'bin/preview.mjs');
|
|
1362
|
-
checks.push({
|
|
1363
|
-
label: 'Live preview runtime',
|
|
1364
|
-
ok: fs.existsSync(previewRuntime),
|
|
1365
|
-
missing: fs.existsSync(previewRuntime) ? 0 : 1,
|
|
1366
|
-
});
|
|
1367
|
-
|
|
1368
|
-
const visualCheckRuntime = path.join(skillRoot, 'bin/visual-check.mjs');
|
|
1369
|
-
checks.push({
|
|
1370
|
-
label: 'Visual-check runtime',
|
|
1371
|
-
ok: fs.existsSync(visualCheckRuntime),
|
|
1372
|
-
missing: fs.existsSync(visualCheckRuntime) ? 0 : 1,
|
|
1373
|
-
});
|
|
1374
|
-
|
|
1375
|
-
const outputPathRuntime = path.join(skillRoot, 'renderers/shared/output-path.mjs');
|
|
1376
|
-
checks.push({
|
|
1377
|
-
label: 'Output path safety runtime',
|
|
1378
|
-
ok: fs.existsSync(outputPathRuntime),
|
|
1379
|
-
missing: fs.existsSync(outputPathRuntime) ? 0 : 1,
|
|
1380
|
-
});
|
|
1381
|
-
|
|
1382
|
-
const scenarioGuide = path.join(skillRoot, 'recipes/scenarios.mjs');
|
|
1383
|
-
checks.push({
|
|
1384
|
-
label: 'Scenario recipe guide',
|
|
1385
|
-
ok: fs.existsSync(scenarioGuide),
|
|
1386
|
-
missing: fs.existsSync(scenarioGuide) ? 0 : 1,
|
|
1387
|
-
});
|
|
1388
|
-
|
|
1389
|
-
const authoringReferences = [
|
|
1390
|
-
path.join(skillRoot, 'references', 'authoring-contract.md'),
|
|
1391
|
-
path.join(skillRoot, 'references', 'viewer-runtime.md'),
|
|
1392
|
-
path.join(skillRoot, 'references', 'delivery-contract.md'),
|
|
1393
|
-
];
|
|
1394
|
-
const authoringReferencesMissing = authoringReferences.filter((file) => !fs.existsSync(file)).length;
|
|
1395
|
-
checks.push({
|
|
1396
|
-
label: 'Progressive authoring references',
|
|
1397
|
-
ok: authoringReferencesMissing === 0,
|
|
1398
|
-
missing: authoringReferencesMissing,
|
|
1399
|
-
});
|
|
1400
|
-
|
|
1401
|
-
const compareRuntime = path.join(skillRoot, 'delta/architecture-delta.mjs');
|
|
1402
|
-
const compareFixtures = [
|
|
1403
|
-
path.join(skillRoot, 'examples/checkout-platform.base.architecture.json'),
|
|
1404
|
-
path.join(skillRoot, 'examples/checkout-platform.head.architecture.json'),
|
|
1405
|
-
];
|
|
1406
|
-
const compareMissing = [compareRuntime, ...compareFixtures].filter((file) => !fs.existsSync(file)).length;
|
|
1407
|
-
checks.push({
|
|
1408
|
-
label: 'Architecture compare runtime and proof fixtures',
|
|
1409
|
-
ok: compareMissing === 0,
|
|
1410
|
-
missing: compareMissing,
|
|
1411
|
-
});
|
|
1412
|
-
|
|
1413
|
-
const validators = path.join(skillRoot, 'renderers/shared/generated-validators.mjs');
|
|
1414
|
-
const validatorsExist = fs.existsSync(validators);
|
|
1415
|
-
let validatorsValid = false;
|
|
1416
|
-
if (validatorsExist) {
|
|
1417
|
-
try {
|
|
1418
|
-
const module = await import(`${pathToFileURL(validators).href}?doctor=${Date.now()}`);
|
|
1419
|
-
validatorsValid = [...TYPES].every((type) => typeof module[type] === 'function');
|
|
1420
|
-
} catch {
|
|
1421
|
-
validatorsValid = false;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
checks.push({
|
|
1425
|
-
label: 'Standalone schema validators',
|
|
1426
|
-
ok: validatorsValid,
|
|
1427
|
-
missing: validatorsExist ? 0 : 1,
|
|
1428
|
-
invalid: validatorsExist && !validatorsValid ? 1 : 0,
|
|
1429
|
-
failureLabel: validatorsExist ? 'invalid' : 'missing',
|
|
1430
|
-
});
|
|
1431
|
-
|
|
1432
|
-
const examples = {
|
|
1433
|
-
architecture: 'web-app.architecture.json',
|
|
1434
|
-
workflow: 'agent-tool-call.workflow.json',
|
|
1435
|
-
sequence: 'cache-miss-request.sequence.json',
|
|
1436
|
-
dataflow: 'product-analytics.dataflow.json',
|
|
1437
|
-
lifecycle: 'agent-run.lifecycle.json',
|
|
1438
|
-
};
|
|
1439
|
-
|
|
1440
|
-
for (const type of TYPES) {
|
|
1441
|
-
const required = [
|
|
1442
|
-
path.join(skillRoot, 'renderers', type, `render-${type}.mjs`),
|
|
1443
|
-
path.join(skillRoot, 'schemas', `${type}.schema.json`),
|
|
1444
|
-
path.join(skillRoot, 'examples', examples[type]),
|
|
1445
|
-
];
|
|
1446
|
-
const missing = required.filter((file) => !fs.existsSync(file)).length;
|
|
1447
|
-
checks.push({
|
|
1448
|
-
label: `${type} renderer, schema, and example`,
|
|
1449
|
-
ok: missing === 0,
|
|
1450
|
-
missing,
|
|
1451
|
-
});
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
console.log('Archify doctor\n');
|
|
1455
|
-
for (const check of checks) {
|
|
1456
|
-
console.log(`[${check.ok ? 'ok' : (check.failureLabel || 'missing')}] ${check.label}`);
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
const nodeFailed = checks[0].ok ? 0 : 1;
|
|
1460
|
-
const missingFiles = checks.reduce((count, check) => count + check.missing, 0);
|
|
1461
|
-
const invalidRuntime = checks.reduce((count, check) => count + (check.invalid || 0), 0);
|
|
1462
|
-
if (nodeFailed === 0 && missingFiles === 0 && invalidRuntime === 0) {
|
|
1463
|
-
console.log('\nArchify is ready.');
|
|
1464
|
-
return;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
const problems = [];
|
|
1468
|
-
if (nodeFailed) problems.push('Node.js 18 or newer is required');
|
|
1469
|
-
if (missingFiles) problems.push(`${missingFiles} required file${missingFiles === 1 ? '' : 's'} missing`);
|
|
1470
|
-
if (invalidRuntime) problems.push(`${invalidRuntime} runtime check${invalidRuntime === 1 ? '' : 's'} failed`);
|
|
1471
|
-
console.error(`\nArchify is not ready: ${problems.join('; ')}.`);
|
|
1472
|
-
process.exitCode = 1;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
async function commandGuide(args) {
|
|
1476
|
-
let lang;
|
|
1477
|
-
let json = false;
|
|
1478
|
-
const queryParts = [];
|
|
1479
|
-
|
|
1480
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
1481
|
-
const arg = args[index];
|
|
1482
|
-
if (arg === '--json') {
|
|
1483
|
-
json = true;
|
|
1484
|
-
} else if (arg === '--lang') {
|
|
1485
|
-
const value = args[index + 1];
|
|
1486
|
-
if (value !== 'en' && value !== 'zh') fail('--lang must be "en" or "zh".');
|
|
1487
|
-
lang = value;
|
|
1488
|
-
index += 1;
|
|
1489
|
-
} else if (arg.startsWith('--lang=')) {
|
|
1490
|
-
const value = arg.slice('--lang='.length);
|
|
1491
|
-
if (value !== 'en' && value !== 'zh') fail('--lang must be "en" or "zh".');
|
|
1492
|
-
lang = value;
|
|
1493
|
-
} else if (arg.startsWith('--')) {
|
|
1494
|
-
fail(`Unknown guide option "${arg}".`);
|
|
1495
|
-
} else {
|
|
1496
|
-
queryParts.push(arg);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
const guidePath = path.join(skillRoot, 'recipes/scenarios.mjs');
|
|
1501
|
-
let guide;
|
|
1502
|
-
try {
|
|
1503
|
-
guide = await import(pathToFileURL(guidePath).href);
|
|
1504
|
-
} catch (error) {
|
|
1505
|
-
fail(`Could not load the scenario recipe guide: ${error.message}`, 1);
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
const query = queryParts.join(' ').trim();
|
|
1509
|
-
if (!query) {
|
|
1510
|
-
const selectedLang = lang || 'en';
|
|
1511
|
-
if (json) {
|
|
1512
|
-
console.log(JSON.stringify({
|
|
1513
|
-
ok: true,
|
|
1514
|
-
mode: 'list',
|
|
1515
|
-
lang: selectedLang,
|
|
1516
|
-
recipes: guide.listScenarioRecipes(selectedLang),
|
|
1517
|
-
}, null, 2));
|
|
1518
|
-
} else {
|
|
1519
|
-
console.log(guide.formatScenarioList(selectedLang));
|
|
1520
|
-
}
|
|
1521
|
-
return;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
const result = guide.recommendScenario(query, lang ? { lang } : {});
|
|
1525
|
-
console.log(json ? JSON.stringify(result, null, 2) : guide.formatScenarioRecommendation(result));
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
async function commandBrands(args) {
|
|
1529
|
-
const json = args.includes('--json');
|
|
1530
|
-
const unknown = args.filter((arg) => arg.startsWith('--') && arg !== '--json');
|
|
1531
|
-
if (unknown.length) fail(`Unknown brands option "${unknown[0]}".`);
|
|
1532
|
-
const positional = args.filter((arg) => arg !== '--json');
|
|
1533
|
-
if (positional[0] === 'capture') {
|
|
1534
|
-
if (positional.length !== 2) fail('Usage: archify brands capture <url> [--json]');
|
|
1535
|
-
const { captureBrandReference } = await import('../renderers/shared/brand-marks.mjs');
|
|
1536
|
-
let capture;
|
|
1537
|
-
try {
|
|
1538
|
-
capture = await captureBrandReference(positional[1]);
|
|
1539
|
-
} catch (error) {
|
|
1540
|
-
fail(error.message);
|
|
1541
|
-
}
|
|
1542
|
-
const result = {
|
|
1543
|
-
schemaVersion: 1,
|
|
1544
|
-
ok: true,
|
|
1545
|
-
command: 'brands capture',
|
|
1546
|
-
brand: capture.brand,
|
|
1547
|
-
evidence: {
|
|
1548
|
-
status: capture.resolved.status,
|
|
1549
|
-
source: capture.resolved.sourceUrl,
|
|
1550
|
-
...(capture.resolved.sha256 ? { sha256: capture.resolved.sha256 } : {}),
|
|
1551
|
-
...(capture.resolved.contentType ? { contentType: capture.resolved.contentType } : {}),
|
|
1552
|
-
},
|
|
1553
|
-
};
|
|
1554
|
-
console.log(json ? JSON.stringify(result, null, 2) : JSON.stringify(result.brand));
|
|
1555
|
-
return;
|
|
1556
|
-
}
|
|
1557
|
-
const query = positional.join(' ').trim();
|
|
1558
|
-
const { listBrandMarks } = await import('../renderers/shared/brand-marks.mjs');
|
|
1559
|
-
const marks = listBrandMarks(query);
|
|
1560
|
-
if (json) {
|
|
1561
|
-
console.log(JSON.stringify({
|
|
1562
|
-
schemaVersion: 1,
|
|
1563
|
-
ok: true,
|
|
1564
|
-
command: 'brands',
|
|
1565
|
-
query,
|
|
1566
|
-
count: marks.length,
|
|
1567
|
-
marks,
|
|
1568
|
-
fallback: 'Run "archify brands capture <url> --json", then use the returned digest-pinned brand value.',
|
|
1569
|
-
}, null, 2));
|
|
1570
|
-
return;
|
|
1571
|
-
}
|
|
1572
|
-
if (!marks.length) {
|
|
1573
|
-
console.log(`No built-in brand matched "${query}". Run "archify brands capture <url> --json", then use the returned digest-pinned brand value.`);
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
const grouped = Map.groupBy
|
|
1577
|
-
? Map.groupBy(marks, (mark) => mark.category)
|
|
1578
|
-
: marks.reduce((map, mark) => map.set(mark.category, [...(map.get(mark.category) || []), mark]), new Map());
|
|
1579
|
-
for (const [category, entries] of grouped) {
|
|
1580
|
-
console.log(`${category}: ${entries.map((mark) => mark.id).join(', ')}`);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
function commandDemo(args) {
|
|
1585
|
-
const unknown = args.find((arg) => arg.startsWith('--'));
|
|
1586
|
-
if (unknown) fail(`Unknown demo option "${unknown}".`);
|
|
1587
|
-
if (args.length > 1) fail(usage());
|
|
1588
|
-
|
|
1589
|
-
const outputDirectory = path.resolve(args[0] || process.cwd());
|
|
1590
|
-
const output = path.join(outputDirectory, 'archify-demo.html');
|
|
1591
|
-
const input = path.join(skillRoot, 'examples/web-app.architecture.json');
|
|
1592
|
-
|
|
1593
|
-
try {
|
|
1594
|
-
fs.mkdirSync(outputDirectory, { recursive: true });
|
|
1595
|
-
} catch (error) {
|
|
1596
|
-
fail(`Could not create demo directory "${outputDirectory}": ${error.message}`, 1);
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
const result = runNode([rendererPath('architecture'), input, output]);
|
|
1600
|
-
if (result.status !== 0) exitFrom(result);
|
|
1601
|
-
|
|
1602
|
-
console.log(`\nDemo ready: ${output}`);
|
|
1603
|
-
console.log('Next: open the HTML in your browser, then render your own diagram:');
|
|
1604
|
-
console.log(' archify render architecture <input.json> <output.html>');
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
function migrationPathDiagnostics(error, sourcePath, destinationPath) {
|
|
1608
|
-
if (Array.isArray(error?.archifyDiagnostics) && error.archifyDiagnostics.length) {
|
|
1609
|
-
return error.archifyDiagnostics.map((entry) => ({
|
|
1610
|
-
...entry,
|
|
1611
|
-
subject: { ...(entry.subject || {}) },
|
|
1612
|
-
evidence: { ...(entry.evidence || {}) },
|
|
1613
|
-
supportedFixes: [...(entry.supportedFixes || [])],
|
|
1614
|
-
}));
|
|
1615
|
-
}
|
|
1616
|
-
return [diagnostic({
|
|
1617
|
-
code: 'migration/path-preflight',
|
|
1618
|
-
message: 'Could not verify that the workflow migration paths are distinct.',
|
|
1619
|
-
subject: { source: sourcePath, destination: destinationPath },
|
|
1620
|
-
evidence: {
|
|
1621
|
-
...(error?.code ? { systemCode: error.code } : {}),
|
|
1622
|
-
reason: error?.message || String(error),
|
|
1623
|
-
},
|
|
1624
|
-
supportedFixes: ['remove unsafe path aliases or choose a different destination path'],
|
|
1625
|
-
})];
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
function migrationReport({
|
|
1629
|
-
ok,
|
|
1630
|
-
sourcePath,
|
|
1631
|
-
destinationPath,
|
|
1632
|
-
sourceBytes,
|
|
1633
|
-
destinationBytes,
|
|
1634
|
-
fromSchemaVersion,
|
|
1635
|
-
preExistingDiagnostics = [],
|
|
1636
|
-
migrationDiagnostics = [],
|
|
1637
|
-
newSchemaDiagnostics = [],
|
|
1638
|
-
changedCoordinates = [],
|
|
1639
|
-
oldRequiredViewBox = null,
|
|
1640
|
-
newRequiredViewBox = null,
|
|
1641
|
-
}) {
|
|
1642
|
-
const report = {
|
|
1643
|
-
ok,
|
|
1644
|
-
command: 'migrate',
|
|
1645
|
-
type: 'workflow',
|
|
1646
|
-
source: {
|
|
1647
|
-
path: sourcePath,
|
|
1648
|
-
...(sourceBytes ? {
|
|
1649
|
-
sha256: createHash('sha256').update(sourceBytes).digest('hex'),
|
|
1650
|
-
bytes: sourceBytes.length,
|
|
1651
|
-
} : {}),
|
|
1652
|
-
},
|
|
1653
|
-
destination: {
|
|
1654
|
-
path: destinationPath,
|
|
1655
|
-
...(destinationBytes ? {
|
|
1656
|
-
sha256: createHash('sha256').update(destinationBytes).digest('hex'),
|
|
1657
|
-
bytes: destinationBytes.length,
|
|
1658
|
-
} : {}),
|
|
1659
|
-
},
|
|
1660
|
-
fromSchemaVersion: fromSchemaVersion ?? null,
|
|
1661
|
-
toSchemaVersion: 2,
|
|
1662
|
-
preExistingDiagnostics,
|
|
1663
|
-
migrationDiagnostics,
|
|
1664
|
-
newSchemaDiagnostics,
|
|
1665
|
-
changedCoordinates,
|
|
1666
|
-
oldRequiredViewBox,
|
|
1667
|
-
newRequiredViewBox,
|
|
1668
|
-
};
|
|
1669
|
-
if (!ok) {
|
|
1670
|
-
report.diagnostics = [
|
|
1671
|
-
...migrationDiagnostics,
|
|
1672
|
-
...newSchemaDiagnostics,
|
|
1673
|
-
...preExistingDiagnostics,
|
|
1674
|
-
];
|
|
1675
|
-
if (!report.diagnostics.length) {
|
|
1676
|
-
report.diagnostics.push(diagnostic({
|
|
1677
|
-
code: 'migration/internal',
|
|
1678
|
-
message: 'Workflow migration failed without a classified diagnostic.',
|
|
1679
|
-
}));
|
|
1680
|
-
}
|
|
1681
|
-
report.error = report.diagnostics[0].message;
|
|
1682
|
-
}
|
|
1683
|
-
return report;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
function extractMigrationOptions(args) {
|
|
1687
|
-
const positional = [];
|
|
1688
|
-
let json = false;
|
|
1689
|
-
let toSchema;
|
|
1690
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
1691
|
-
const arg = args[index];
|
|
1692
|
-
if (arg === '--json') {
|
|
1693
|
-
json = true;
|
|
1694
|
-
continue;
|
|
1695
|
-
}
|
|
1696
|
-
if (arg === '--to-schema') {
|
|
1697
|
-
toSchema = args[index + 1];
|
|
1698
|
-
if (!toSchema || toSchema.startsWith('--')) fail('--to-schema requires a schema version.');
|
|
1699
|
-
index += 1;
|
|
1700
|
-
continue;
|
|
1701
|
-
}
|
|
1702
|
-
if (arg.startsWith('--to-schema=')) {
|
|
1703
|
-
toSchema = arg.slice('--to-schema='.length);
|
|
1704
|
-
if (!toSchema) fail('--to-schema requires a schema version.');
|
|
1705
|
-
continue;
|
|
1706
|
-
}
|
|
1707
|
-
if (arg.startsWith('--')) fail(`Unknown migrate option "${arg}".`);
|
|
1708
|
-
positional.push(arg);
|
|
1709
|
-
}
|
|
1710
|
-
return { positional, json, toSchema };
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
async function commandMigrate(args) {
|
|
1714
|
-
const options = extractMigrationOptions(args);
|
|
1715
|
-
const [type, sourceArgument, destinationArgument] = options.positional;
|
|
1716
|
-
if (
|
|
1717
|
-
type !== 'workflow'
|
|
1718
|
-
|| !sourceArgument
|
|
1719
|
-
|| !destinationArgument
|
|
1720
|
-
|| options.positional.length !== 3
|
|
1721
|
-
|| options.toSchema !== '2'
|
|
1722
|
-
) {
|
|
1723
|
-
fail('Usage: archify migrate workflow <old.json> <new.json> --to-schema 2 [--json]');
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
const sourcePath = path.resolve(sourceArgument);
|
|
1727
|
-
const destinationPath = path.resolve(destinationArgument);
|
|
1728
|
-
let sourceBytes;
|
|
1729
|
-
let sourceDocument;
|
|
1730
|
-
const reportMigrationFailure = ({ status = 1, ...details }) => {
|
|
1731
|
-
const report = migrationReport({
|
|
1732
|
-
...details,
|
|
1733
|
-
ok: false,
|
|
1734
|
-
sourcePath,
|
|
1735
|
-
destinationPath,
|
|
1736
|
-
sourceBytes,
|
|
1737
|
-
fromSchemaVersion: sourceDocument?.schema_version,
|
|
1738
|
-
});
|
|
1739
|
-
if (options.json) console.log(JSON.stringify(report, null, 2));
|
|
1740
|
-
else console.error(formatDiagnostics(report.error, report.diagnostics));
|
|
1741
|
-
process.exitCode = status;
|
|
1742
|
-
};
|
|
1743
|
-
try {
|
|
1744
|
-
sourceBytes = fs.readFileSync(sourcePath);
|
|
1745
|
-
sourceDocument = JSON.parse(sourceBytes.toString('utf8'));
|
|
1746
|
-
} catch (error) {
|
|
1747
|
-
reportMigrationFailure({
|
|
1748
|
-
preExistingDiagnostics: [inputDiagnostic(error, sourcePath)],
|
|
1749
|
-
});
|
|
1750
|
-
return;
|
|
1751
|
-
}
|
|
1752
|
-
// Unlike render/validate, migrate has no --quality override. Pin every stage
|
|
1753
|
-
// to the document's durable policy and scrub any ambient profile from the
|
|
1754
|
-
// staged renderer by passing this value explicitly.
|
|
1755
|
-
const activeQualityProfile = sourceDocument?.meta?.quality_profile || 'standard';
|
|
1756
|
-
|
|
1757
|
-
const { pathsAlias } = await import('../renderers/shared/output-path.mjs');
|
|
1758
|
-
let sourceDestinationAlias;
|
|
1759
|
-
try {
|
|
1760
|
-
sourceDestinationAlias = pathsAlias(sourcePath, destinationPath);
|
|
1761
|
-
} catch (error) {
|
|
1762
|
-
reportMigrationFailure({
|
|
1763
|
-
migrationDiagnostics: migrationPathDiagnostics(error, sourcePath, destinationPath),
|
|
1764
|
-
});
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
if (sourceDestinationAlias) {
|
|
1768
|
-
reportMigrationFailure({
|
|
1769
|
-
migrationDiagnostics: [diagnostic({
|
|
1770
|
-
code: 'migration/source-destination',
|
|
1771
|
-
message: 'Workflow migration source and destination must be different files.',
|
|
1772
|
-
subject: { source: sourcePath, destination: destinationPath },
|
|
1773
|
-
supportedFixes: ['choose a different destination path and keep the source unchanged'],
|
|
1774
|
-
})],
|
|
1775
|
-
});
|
|
1776
|
-
return;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
const { migrateWorkflowDocument, serializeMigratedWorkflow } = await import('../migrations/workflow-v2.mjs');
|
|
1780
|
-
let migration;
|
|
1781
|
-
try {
|
|
1782
|
-
migration = migrateWorkflowDocument(sourceDocument);
|
|
1783
|
-
} catch (error) {
|
|
1784
|
-
migration = {
|
|
1785
|
-
ok: false,
|
|
1786
|
-
migrationDiagnostics: [diagnostic({
|
|
1787
|
-
code: 'migration/internal',
|
|
1788
|
-
message: 'Workflow migration failed unexpectedly.',
|
|
1789
|
-
evidence: { reason: error.message },
|
|
1790
|
-
supportedFixes: ['report the source workflow and this diagnostic to the Archify maintainers'],
|
|
1791
|
-
})],
|
|
1792
|
-
};
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
if (!migration.ok) {
|
|
1796
|
-
reportMigrationFailure(migration);
|
|
1797
|
-
return;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
if (fs.existsSync(destinationPath) && !fs.lstatSync(destinationPath).isFile()) {
|
|
1801
|
-
reportMigrationFailure({
|
|
1802
|
-
...migration,
|
|
1803
|
-
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
|
|
1804
|
-
code: 'migration/destination-type',
|
|
1805
|
-
message: 'Workflow migration destination must be a regular file path.',
|
|
1806
|
-
subject: { destination: destinationPath },
|
|
1807
|
-
supportedFixes: ['choose a destination path that is absent or names a regular file'],
|
|
1808
|
-
})],
|
|
1809
|
-
});
|
|
1810
|
-
return;
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
const destinationDirectory = path.dirname(destinationPath);
|
|
1814
|
-
let stagingDirectory;
|
|
1815
|
-
try {
|
|
1816
|
-
fs.mkdirSync(destinationDirectory, { recursive: true });
|
|
1817
|
-
stagingDirectory = fs.mkdtempSync(path.join(destinationDirectory, '.archify-migration-'));
|
|
1818
|
-
} catch (error) {
|
|
1819
|
-
reportMigrationFailure({
|
|
1820
|
-
...migration,
|
|
1821
|
-
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
|
|
1822
|
-
code: 'migration/prepare-destination',
|
|
1823
|
-
message: 'Could not prepare the workflow migration destination.',
|
|
1824
|
-
subject: { destination: destinationPath },
|
|
1825
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
1826
|
-
supportedFixes: ['choose a writable destination directory'],
|
|
1827
|
-
})],
|
|
1828
|
-
});
|
|
1829
|
-
return;
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
const candidatePath = path.join(stagingDirectory, 'candidate.workflow.json');
|
|
1833
|
-
const artifactPath = path.join(stagingDirectory, 'migration-check.html');
|
|
1834
|
-
const destinationBytes = Buffer.from(serializeMigratedWorkflow(migration.document));
|
|
1835
|
-
try {
|
|
1836
|
-
fs.writeFileSync(candidatePath, destinationBytes, { flag: 'wx' });
|
|
1837
|
-
const render = runNode([rendererPath('workflow'), candidatePath, artifactPath], {
|
|
1838
|
-
stdio: 'pipe',
|
|
1839
|
-
env: rendererEnv(activeQualityProfile, undefined, true),
|
|
1840
|
-
});
|
|
1841
|
-
if (render.status !== 0) {
|
|
1842
|
-
const failure = rendererFailure(render);
|
|
1843
|
-
reportMigrationFailure({
|
|
1844
|
-
...migration,
|
|
1845
|
-
newSchemaDiagnostics: [...migration.newSchemaDiagnostics, ...failure.diagnostics],
|
|
1846
|
-
status: render.status ?? 1,
|
|
1847
|
-
});
|
|
1848
|
-
return;
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), artifactPath], {
|
|
1852
|
-
stdio: 'pipe',
|
|
1853
|
-
});
|
|
1854
|
-
if (check.status !== 0) {
|
|
1855
|
-
let checker;
|
|
1856
|
-
try {
|
|
1857
|
-
checker = JSON.parse(check.stdout);
|
|
1858
|
-
} catch {
|
|
1859
|
-
checker = null;
|
|
1860
|
-
}
|
|
1861
|
-
reportMigrationFailure({
|
|
1862
|
-
...migration,
|
|
1863
|
-
newSchemaDiagnostics: [
|
|
1864
|
-
...migration.newSchemaDiagnostics,
|
|
1865
|
-
...checkerDiagnostics(checker),
|
|
1866
|
-
],
|
|
1867
|
-
status: check.status ?? 1,
|
|
1868
|
-
});
|
|
1869
|
-
return;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
if (pathsAlias(sourcePath, destinationPath)) {
|
|
1873
|
-
reportMigrationFailure({
|
|
1874
|
-
...migration,
|
|
1875
|
-
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
|
|
1876
|
-
code: 'migration/source-destination',
|
|
1877
|
-
message: 'Workflow migration source and destination resolved to the same file before commit.',
|
|
1878
|
-
subject: { source: sourcePath, destination: destinationPath },
|
|
1879
|
-
supportedFixes: ['choose a different destination path and retry'],
|
|
1880
|
-
})],
|
|
1881
|
-
});
|
|
1882
|
-
return;
|
|
1883
|
-
}
|
|
1884
|
-
const currentSourceBytes = fs.readFileSync(sourcePath);
|
|
1885
|
-
if (!currentSourceBytes.equals(sourceBytes)) {
|
|
1886
|
-
reportMigrationFailure({
|
|
1887
|
-
...migration,
|
|
1888
|
-
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
|
|
1889
|
-
code: 'migration/source-changed',
|
|
1890
|
-
message: 'Workflow migration source changed while the destination was being verified.',
|
|
1891
|
-
subject: { source: sourcePath },
|
|
1892
|
-
supportedFixes: ['retry the migration from a stable workflow source file'],
|
|
1893
|
-
})],
|
|
1894
|
-
});
|
|
1895
|
-
return;
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
fs.renameSync(candidatePath, destinationPath);
|
|
1899
|
-
const report = migrationReport({
|
|
1900
|
-
...migration,
|
|
1901
|
-
sourcePath,
|
|
1902
|
-
destinationPath,
|
|
1903
|
-
sourceBytes,
|
|
1904
|
-
destinationBytes,
|
|
1905
|
-
fromSchemaVersion: sourceDocument.schema_version,
|
|
1906
|
-
});
|
|
1907
|
-
if (options.json) console.log(JSON.stringify(report, null, 2));
|
|
1908
|
-
else if (sourceDocument.schema_version === 1) {
|
|
1909
|
-
console.log(`migrated workflow schema v1→v2: ${sourcePath} → ${destinationPath}`);
|
|
1910
|
-
} else {
|
|
1911
|
-
console.log(`verified workflow schema v2 migration: ${sourcePath} → ${destinationPath}`);
|
|
1912
|
-
}
|
|
1913
|
-
} catch (error) {
|
|
1914
|
-
const migrationDiagnostics = Array.isArray(error?.archifyDiagnostics)
|
|
1915
|
-
? migrationPathDiagnostics(error, sourcePath, destinationPath)
|
|
1916
|
-
: [diagnostic({
|
|
1917
|
-
code: 'migration/commit',
|
|
1918
|
-
message: 'Could not commit the verified workflow migration.',
|
|
1919
|
-
subject: { destination: destinationPath },
|
|
1920
|
-
evidence: { ...(error?.code ? { systemCode: error.code } : {}), reason: error.message },
|
|
1921
|
-
supportedFixes: ['choose a writable regular-file destination and retry'],
|
|
1922
|
-
})];
|
|
1923
|
-
reportMigrationFailure({
|
|
1924
|
-
...migration,
|
|
1925
|
-
migrationDiagnostics: [...migration.migrationDiagnostics, ...migrationDiagnostics],
|
|
1926
|
-
});
|
|
1927
|
-
} finally {
|
|
1928
|
-
try {
|
|
1929
|
-
fs.rmSync(stagingDirectory, { recursive: true, force: true });
|
|
1930
|
-
} catch (error) {
|
|
1931
|
-
console.error(`Warning: could not remove workflow migration staging directory "${stagingDirectory}": ${error.message}`);
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
function commandValidate(args) {
|
|
1937
|
-
const qualityArgs = extractQualityArgs(args);
|
|
1938
|
-
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
|
|
1939
|
-
args = repoArgs.rest;
|
|
1940
|
-
const quality = qualityArgs.quality;
|
|
1941
|
-
const repoRoot = repoArgs.repoRoot;
|
|
1942
|
-
const knownOptions = new Set(['--json', '--layout-json']);
|
|
1943
|
-
const unknown = args.filter((arg) => arg.startsWith('--') && !knownOptions.has(arg));
|
|
1944
|
-
if (unknown.length) rejectCliArgument(`Unknown validate option "${unknown[0]}".`, {
|
|
1945
|
-
code: 'cli/unknown-option',
|
|
1946
|
-
subject: { option: unknown[0] },
|
|
1947
|
-
supportedFixes: ['remove the unknown option and retry'],
|
|
1948
|
-
});
|
|
1949
|
-
const json = args.includes('--json');
|
|
1950
|
-
const layoutJson = args.includes('--layout-json');
|
|
1951
|
-
const rest = args.filter((arg) => !knownOptions.has(arg));
|
|
1952
|
-
const [type, input] = rest;
|
|
1953
|
-
if (!type || !input || rest.length !== 2) rejectCliArgument(usage(), {
|
|
1954
|
-
code: 'cli/usage',
|
|
1955
|
-
supportedFixes: ['use: archify validate <type> <input.json> [options]'],
|
|
1956
|
-
});
|
|
1957
|
-
assertEvidenceType(type, repoRoot);
|
|
1958
|
-
const renderer = rendererPath(type);
|
|
1959
|
-
|
|
1960
|
-
if (layoutJson && !['architecture', 'workflow'].includes(type)) {
|
|
1961
|
-
rejectCliArgument('--layout-json is currently supported for architecture and workflow diagrams only.', {
|
|
1962
|
-
code: 'cli/unsupported-option',
|
|
1963
|
-
subject: { option: '--layout-json', type },
|
|
1964
|
-
supportedFixes: ['remove --layout-json or use an architecture or workflow diagram'],
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
if (layoutJson) {
|
|
1969
|
-
// Layout mode emits JSON without writing HTML; keep its unused target typed.
|
|
1970
|
-
const layoutOutput = path.join(os.tmpdir(), `archify-layout-${process.pid}-${type}.html`);
|
|
1971
|
-
const result = runNode([renderer, input, layoutOutput, '--layout-json'], {
|
|
1972
|
-
stdio: 'pipe',
|
|
1973
|
-
env: rendererEnv(quality, repoRoot, true),
|
|
1974
|
-
});
|
|
1975
|
-
if (result.status !== 0) {
|
|
1976
|
-
try {
|
|
1977
|
-
const receipt = JSON.parse(result.stdout);
|
|
1978
|
-
if (receipt?.contract && Array.isArray(receipt.diagnostics)) {
|
|
1979
|
-
process.stdout.write(`${JSON.stringify(receipt, null, 2)}\n`);
|
|
1980
|
-
process.exitCode = result.status ?? 1;
|
|
1981
|
-
return;
|
|
1982
|
-
}
|
|
1983
|
-
} catch {
|
|
1984
|
-
// Fall through to the renderer failure contract when no compiler
|
|
1985
|
-
// receipt was produced (for example, input JSON could not be read).
|
|
1986
|
-
}
|
|
1987
|
-
const failure = rendererFailure(result);
|
|
1988
|
-
reportValidateFailure({
|
|
1989
|
-
json,
|
|
1990
|
-
stage: failure.diagnostics.some((entry) => entry.code.startsWith('input/')) ? 'input' : 'render',
|
|
1991
|
-
type,
|
|
1992
|
-
input: path.resolve(input),
|
|
1993
|
-
error: failure.error,
|
|
1994
|
-
diagnostics: failure.diagnostics,
|
|
1995
|
-
status: result.status ?? 1,
|
|
1996
|
-
});
|
|
1997
|
-
return;
|
|
1998
|
-
}
|
|
1999
|
-
process.stdout.write(result.stdout);
|
|
2000
|
-
return;
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-validate-'));
|
|
2004
|
-
const out = path.join(tmp, `${type}.html`);
|
|
2005
|
-
let exitCode = 0;
|
|
2006
|
-
|
|
2007
|
-
try {
|
|
2008
|
-
const render = runNode([renderer, input, out], {
|
|
2009
|
-
stdio: 'pipe',
|
|
2010
|
-
env: rendererEnv(quality, repoRoot, true),
|
|
2011
|
-
});
|
|
2012
|
-
if (render.status !== 0) {
|
|
2013
|
-
const failure = rendererFailure(render);
|
|
2014
|
-
reportValidateFailure({
|
|
2015
|
-
json,
|
|
2016
|
-
stage: failure.diagnostics.some((entry) => entry.code.startsWith('input/')) ? 'input' : 'render',
|
|
2017
|
-
type,
|
|
2018
|
-
input: path.resolve(input),
|
|
2019
|
-
error: failure.error,
|
|
2020
|
-
diagnostics: failure.diagnostics,
|
|
2021
|
-
status: render.status ?? 1,
|
|
2022
|
-
});
|
|
2023
|
-
exitCode = render.status ?? 1;
|
|
2024
|
-
} else {
|
|
2025
|
-
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), out], { stdio: 'pipe' });
|
|
2026
|
-
if (check.status !== 0) {
|
|
2027
|
-
let checker;
|
|
2028
|
-
try {
|
|
2029
|
-
checker = JSON.parse(check.stdout);
|
|
2030
|
-
checker.file = path.resolve(input);
|
|
2031
|
-
} catch {
|
|
2032
|
-
checker = { ok: false, diagnostic: 'Artifact checker failed without a parseable receipt.' };
|
|
2033
|
-
}
|
|
2034
|
-
reportValidateFailure({
|
|
2035
|
-
json,
|
|
2036
|
-
stage: 'check',
|
|
2037
|
-
type,
|
|
2038
|
-
input: path.resolve(input),
|
|
2039
|
-
error: 'Final artifact check failed.',
|
|
2040
|
-
diagnostics: checkerDiagnostics(checker),
|
|
2041
|
-
checker,
|
|
2042
|
-
status: check.status ?? 1,
|
|
2043
|
-
});
|
|
2044
|
-
exitCode = check.status ?? 1;
|
|
2045
|
-
} else {
|
|
2046
|
-
const result = JSON.parse(check.stdout);
|
|
2047
|
-
const engineeringProfile = engineeringProfileFromArtifact(fs.readFileSync(out));
|
|
2048
|
-
if (json) {
|
|
2049
|
-
console.log(JSON.stringify({
|
|
2050
|
-
schemaVersion: 1,
|
|
2051
|
-
ok: true,
|
|
2052
|
-
command: 'validate',
|
|
2053
|
-
type,
|
|
2054
|
-
input: path.resolve(input),
|
|
2055
|
-
checks: result.checks,
|
|
2056
|
-
composition: result.composition,
|
|
2057
|
-
...(engineeringProfile ? { engineeringProfile } : {}),
|
|
2058
|
-
}, null, 2));
|
|
2059
|
-
} else {
|
|
2060
|
-
const engineering = engineeringProfile
|
|
2061
|
-
? `; engineering ${engineeringProfile}: pass`
|
|
2062
|
-
: '';
|
|
2063
|
-
console.log(`ok ${type} ${path.resolve(input)} (${result.checks.length} artifact checks; composition ${result.composition.profile}: ${result.composition.summary.errors} errors, ${result.composition.summary.warnings} warnings${engineering})`);
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
} finally {
|
|
2068
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
if (exitCode !== 0) process.exitCode = exitCode;
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
const [command, ...args] = process.argv.slice(2);
|
|
2075
|
-
|
|
2076
|
-
try {
|
|
2077
|
-
switch (command) {
|
|
2078
|
-
case undefined:
|
|
2079
|
-
case '-h':
|
|
2080
|
-
case '--help':
|
|
2081
|
-
case 'help':
|
|
2082
|
-
console.log(usage());
|
|
2083
|
-
break;
|
|
2084
|
-
case 'render':
|
|
2085
|
-
commandRender(args);
|
|
2086
|
-
break;
|
|
2087
|
-
case 'compare':
|
|
2088
|
-
await commandCompare(args);
|
|
2089
|
-
break;
|
|
2090
|
-
case 'deliver':
|
|
2091
|
-
await commandDeliver(args);
|
|
2092
|
-
break;
|
|
2093
|
-
case 'preview':
|
|
2094
|
-
await commandPreview(args);
|
|
2095
|
-
break;
|
|
2096
|
-
case 'validate':
|
|
2097
|
-
commandValidate(args);
|
|
2098
|
-
break;
|
|
2099
|
-
case 'migrate':
|
|
2100
|
-
await commandMigrate(args);
|
|
2101
|
-
break;
|
|
2102
|
-
case 'inspect':
|
|
2103
|
-
if (args[0] !== 'architecture') {
|
|
2104
|
-
fail('inspect is currently supported for architecture diagrams only.');
|
|
2105
|
-
}
|
|
2106
|
-
commandValidate([...args, '--layout-json']);
|
|
2107
|
-
break;
|
|
2108
|
-
case 'check':
|
|
2109
|
-
commandCheck(args);
|
|
2110
|
-
break;
|
|
2111
|
-
case 'visual-check':
|
|
2112
|
-
await commandVisualCheck(args);
|
|
2113
|
-
break;
|
|
2114
|
-
case 'guide':
|
|
2115
|
-
await commandGuide(args);
|
|
2116
|
-
break;
|
|
2117
|
-
case 'brands':
|
|
2118
|
-
await commandBrands(args);
|
|
2119
|
-
break;
|
|
2120
|
-
case 'examples':
|
|
2121
|
-
commandExamples(args);
|
|
2122
|
-
break;
|
|
2123
|
-
case 'doctor':
|
|
2124
|
-
await commandDoctor(args);
|
|
2125
|
-
break;
|
|
2126
|
-
case 'demo':
|
|
2127
|
-
commandDemo(args);
|
|
2128
|
-
break;
|
|
2129
|
-
default:
|
|
2130
|
-
fail(`Unknown command "${command}".\n\n${usage()}`);
|
|
2131
|
-
}
|
|
2132
|
-
} catch (error) {
|
|
2133
|
-
if (!error.archifyArgument) throw error;
|
|
2134
|
-
if (['validate', 'deliver'].includes(command) && args.includes('--json')) {
|
|
2135
|
-
reportArtifactArgumentFailure(command, error);
|
|
2136
|
-
} else {
|
|
2137
|
-
fail(error.message);
|
|
2138
|
-
}
|
|
2139
|
-
}
|