@litfamily/litcodex 1.0.17 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README-Ko-KR.md +46 -147
  2. package/README.md +46 -150
  3. package/dist/auto-update.d.ts +2 -1
  4. package/dist/auto-update.js +2 -1
  5. package/dist/cli.d.ts +1 -1
  6. package/dist/cli.js +85 -5
  7. package/dist/config-migration/multi-agent-v2-guard.js +10 -21
  8. package/dist/config-migration/root-settings.js +30 -31
  9. package/dist/config-migration/toml-lines.d.ts +12 -0
  10. package/dist/config-migration/toml-lines.js +113 -0
  11. package/dist/config-migration/toml-shape.js +8 -15
  12. package/dist/install/codex.js +6 -3
  13. package/dist/install/doctor-render.js +19 -0
  14. package/dist/install/doctor-tui.d.ts +7 -0
  15. package/dist/install/doctor-tui.js +65 -0
  16. package/dist/install/doctor.js +2 -0
  17. package/dist/install/generated-skill-payload-hashes.d.ts +26 -25
  18. package/dist/install/generated-skill-payload-hashes.js +26 -25
  19. package/dist/install/index.d.ts +6 -1
  20. package/dist/install/index.js +16 -2
  21. package/dist/install/office-runtime.d.ts +1 -0
  22. package/dist/install/office-runtime.js +2 -2
  23. package/dist/install/types.d.ts +10 -0
  24. package/dist/install/uninstall.d.ts +2 -0
  25. package/dist/install/uninstall.js +12 -1
  26. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  27. package/marketplace/plugins/litcodex/components/auto-update/dist/auto-update.d.ts +16 -1
  28. package/marketplace/plugins/litcodex/components/auto-update/dist/auto-update.js +99 -13
  29. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  30. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  31. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  32. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  33. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  34. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.d.ts +6 -0
  35. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.js +10 -29
  36. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  37. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  38. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  39. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  40. package/marketplace/plugins/litcodex/hooks/hooks.json +1 -1
  41. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_design.py +1 -1
  42. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/brief.yaml +0 -1
  43. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/journal.yaml +0 -1
  44. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/manual.yaml +0 -1
  45. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/memo.yaml +0 -1
  46. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/proposal.yaml +0 -1
  47. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/report.yaml +0 -1
  48. package/marketplace/plugins/litcodex/skills/lit-pptx/FORBIDDEN_TERMS.json +55 -0
  49. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/atlas.md +4 -4
  50. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/chalk.md +4 -4
  51. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/gazette.md +4 -4
  52. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/ledger.md +6 -6
  53. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/night.md +4 -4
  54. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/paper.md +4 -4
  55. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/signal.md +4 -4
  56. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/studio.md +4 -4
  57. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +1 -1
  58. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/validate_pptx.py +13 -3
  59. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +0 -13
  60. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +0 -13
  61. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +0 -13
  62. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -14
  63. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/night/pack.yaml +0 -13
  64. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/paper/pack.yaml +0 -13
  65. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/signal/pack.yaml +0 -13
  66. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/studio/pack.yaml +0 -13
  67. package/node_modules/@litcodex/lit-loop/README.md +1 -1
  68. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  69. package/package.json +12 -4
  70. package/readme-assets/badge-version.svg +1 -1
@@ -719,7 +719,7 @@ export declare const DOCX_PAYLOAD_HASHES: {
719
719
  readonly "scripts/convert_md_to_pdf.py": "23cbc66128baa47ed9ad805c0211068d3580bcd1954bd507874545afc45e2cd0";
720
720
  readonly "scripts/convert_pdf.py": "383b01f74dd2696b7a02c5e97bb42bb49105bae41ed2c5a74188ce9d93e4aa13";
721
721
  readonly "scripts/docx_craft.py": "434257bd8a89bd42290f29b03ad16921d0d539fdec23afb95627bac0c4d63e62";
722
- readonly "scripts/docx_design.py": "28e9853e71112d58df8256ab2b677fa1bfb3a49362b51951125e46cec192e02f";
722
+ readonly "scripts/docx_design.py": "e11dc7725e35dc4c8ee3991eaf01a36e87fe1b3c1a81eb142d165c472bd1dc89";
723
723
  readonly "scripts/docx_layout.py": "b1b6429a34e721315303acb9bcb3e997b60ae90e4d2fef7cb7c3cdf40b32705a";
724
724
  readonly "scripts/edit_docx.py": "ef0c9ac7afa535e118192e8c49db312b9c75ae0f41f8b988d4fab39c30368e74";
725
725
  readonly "scripts/embed_images.py": "481f2bb54a6f4a1d3fae7c66f3d6b1f56676a30030154131ffe866e23ea68db1";
@@ -742,14 +742,15 @@ export declare const DOCX_PAYLOAD_HASHES: {
742
742
  readonly "templates/latex/nature/README.md": "b0ff9e258e3aabc9c9bed8c26d7c9373b4bca83a85c54c5bd9c937132a829cbb";
743
743
  readonly "templates/latex/nature/template.tex": "74437009d7fe894b8e2c8c256f300181081195e1f9831e922e20af6606704265";
744
744
  readonly "templates/registry.yaml": "950c0adf003f773c84756e73df352bc29c771a8399f91c8ee93c14c39b6b9c7d";
745
- readonly "templates/tonalities/brief.yaml": "82de6c6d8c822ce881354df8d64f36b2a0fb5918335a6962b5df9dbfab4e48cd";
746
- readonly "templates/tonalities/journal.yaml": "14a818f052a5f69237de6af7c6aee5f1b96730be8b7d253566742ddf9bfe48ea";
747
- readonly "templates/tonalities/manual.yaml": "2e62a62632f1829598c756ced0daa7ae3495c7bdf843d60584914ebe9f253308";
748
- readonly "templates/tonalities/memo.yaml": "555cf0a61528bebb7dd8a77fe873f866581db645951a77f382b7713796d3e001";
749
- readonly "templates/tonalities/proposal.yaml": "dac1b0e13a4ddb78f732b1c048cc978467aa74972547321c737525b5bea63442";
750
- readonly "templates/tonalities/report.yaml": "291b353ac2d5d14481287e34b6dd7363b995e73f819496ee99a970ff8d7fcd18";
745
+ readonly "templates/tonalities/brief.yaml": "1d99d859dd93b6fa2f8b409b698b7be617cff1b694d44b981c36d826c280d2e9";
746
+ readonly "templates/tonalities/journal.yaml": "694118ebd8f1a1447172349b3b176f305f3197fcd6eee6a705eecd84b0874a81";
747
+ readonly "templates/tonalities/manual.yaml": "3423de5ebfb7ac2e10b8f1d64c6c90500bf5ed04a624e1046f243083372a8098";
748
+ readonly "templates/tonalities/memo.yaml": "d824d0cdaa34740351ae085fc6967412076355be5854ae0ec40d354964c236f8";
749
+ readonly "templates/tonalities/proposal.yaml": "6125b6908672cc8fc460c9061b3b622a3f1a2700dfc8136303bb2cbfddd968fe";
750
+ readonly "templates/tonalities/report.yaml": "e7466e9d68e524d0da154014547baad0e4bdf87ab13db8c706a718758026cb34";
751
751
  };
752
752
  export declare const PPTX_PAYLOAD_HASHES: {
753
+ readonly "FORBIDDEN_TERMS.json": "8ef78f42a519c513c9291d8145dedd6180d4130e31553d1036821f1afd61cc81";
753
754
  readonly NOTICE: "806c7aebcaf70ee5c24307f956d9ea0fd4626b63576da7522cbb94040bf08002";
754
755
  readonly "SKILL.md": "19934a409373352f15f82c2d33cfb573f5b8b059e933cdf21c45cddc80f1ef12";
755
756
  readonly "agents/analyst.md": "93ab81384b223da9a4b63427d161081b45b89b2a7323b57c514f9a1206eb88d1";
@@ -795,14 +796,14 @@ export declare const PPTX_PAYLOAD_HASHES: {
795
796
  readonly "references/interview-protocol.md": "8b8b3bba7b14127702a20b734b05418c794c620b5df4d222d2da873d02398ed0";
796
797
  readonly "references/layout-families.md": "7d35a3356d505bbbc67b19759fa8e23eb0b4d01e9fcfa321811ec1ee732ca5d2";
797
798
  readonly "references/title-treatments.md": "81b36f9b8a7ececf23bf236f75581d3fe15a41c5825792442308ee17b251694a";
798
- readonly "references/tonalities/atlas.md": "e4b03fe78a992a5d5c7c93382e6aeb7f71f1d742d0d349b45998704ed90e2338";
799
- readonly "references/tonalities/chalk.md": "110d7ec4cbadabeb2a6992799199e0f1f0c3afc5480309f56ed003d6626b0412";
800
- readonly "references/tonalities/gazette.md": "3e43a76c959624ea43cc74477505121dac2db6867edbf43f25adc20424e30c6b";
801
- readonly "references/tonalities/ledger.md": "e6a5091a964c83c4895e133618a74b8ea9b4cd37edeefa2270b2878e508bb3b2";
802
- readonly "references/tonalities/night.md": "b2ae314c4f7a0d0d91dfd0e1080f87112c2b874f8659d8686a9e46eea1877504";
803
- readonly "references/tonalities/paper.md": "a3612a6430a56619fb0824e4586d579d9335ce3d5f0798788919ee06075dd4ea";
804
- readonly "references/tonalities/signal.md": "9ab9b11f621781f89383d67ec281e1bf89c3195533f185519e581ed824bd9929";
805
- readonly "references/tonalities/studio.md": "700cb806c437a262da08784ace59350951ec63e8fcb9e4bf82850a25557359c8";
799
+ readonly "references/tonalities/atlas.md": "3a55bd1026cad5925fd041802137236bc6609249b3ca36030b0ab1769295dcba";
800
+ readonly "references/tonalities/chalk.md": "d4f69d23bd477db61803e00464c18e4de3ed10368e2618c2d1e3833a5623adce";
801
+ readonly "references/tonalities/gazette.md": "60937365ee08e539caf876dbd9244b67004a07c3248c47fbb00ec8367374c791";
802
+ readonly "references/tonalities/ledger.md": "12c51f654ce9b1b831be3f434c648c907a0d9dcf8789e535d840dd46af6f0e9c";
803
+ readonly "references/tonalities/night.md": "34365a6a71559cc7fa3569436f975df8a382aa1fd2e44283b896aa2c2625a1d0";
804
+ readonly "references/tonalities/paper.md": "39973f22a4021c5dc1a4210ef123d7444b2dd279352418314caaabb8ae5d669e";
805
+ readonly "references/tonalities/signal.md": "3c52945f7c4d513b97ae382b6bd544f9cf1daf5780b6f462ac947284b1d38285";
806
+ readonly "references/tonalities/studio.md": "cca577f4458a6be2306995d996dd99e2d605b7f2a80cbc256c7eff776b65858f";
806
807
  readonly "runtime/package-lock.json": "73cd3f54d979460757603c8a44c395e777cc0655d7f1c54dfb9512a9c77b8acd";
807
808
  readonly "runtime/package.json": "700e183641eff75aa87b963d68d96b9c8e0bb21516a3b413c94b70bea10fbd55";
808
809
  readonly "runtime/requirements.in": "893e4232e7e69e731053a8c3b3383eb22fb3f82affd6d96ad96d3a8ef8321656";
@@ -826,11 +827,11 @@ export declare const PPTX_PAYLOAD_HASHES: {
826
827
  readonly "scripts/lib/render-pack.js": "92fdead997916fff277bb2ab25a297c1bd5f39b0f54d58940228d950aad00e9d";
827
828
  readonly "scripts/lib/slide-ast.js": "a4fca91df696b43e5dcffa1b4f6116c8dfe7f8fc13de8c804dda8fbddf1ede9c";
828
829
  readonly "scripts/lib/spec-validator.js": "0869ff328654de5c8c6eb36a22e9865683ba667b11eba6a85bd3e5428a3fccf3";
829
- readonly "scripts/lib/template-registry.js": "5c2a86e15a319afd8cc2635521802c508a400bc27390fedb6ec0a61f3f3498e9";
830
+ readonly "scripts/lib/template-registry.js": "a90ef33bc2ff0821bc62a49ac6724a6ebee0761de7d95b764c42b73bf82b740f";
830
831
  readonly "scripts/office-run.mjs": "272f9bd74db9456fe5f5cce8f1dbf04fac60469f470a41c6571afafc5f444508";
831
832
  readonly "scripts/package.json": "dbf8353f77358bc12169b7bb7301e1978d5b503e002ee927229a8993672818fc";
832
833
  readonly "scripts/qa_deck.py": "dbde757b72dffe3f5b31def40dc5f7b92444a2b768ac3c91879fc959c30a2edc";
833
- readonly "scripts/validate_pptx.py": "6f949c03be972f1128b03d5d3c83ce6c23e3a7aa33e1c6e90cbb3a8855de165e";
834
+ readonly "scripts/validate_pptx.py": "2d3ddd0fd2564dab93f1bd74832c602d8df4f31e2856fd8a3b1e2c3e089d4ec4";
834
835
  readonly "specs/markdown-slide-spec-v1.md": "eb9b04d070d9f2774746e65a34e5e6833fefd097ea7e01fc32327934ca8ee42b";
835
836
  readonly "specs/markdown-slide-spec-v2.md": "3a7a91dfb21418711d5ad28f7a542603bc2f145051950478be0d2107f7fa5458";
836
837
  readonly "specs/slide-ast-v1.schema.json": "d6d244bd30b6747645bd4a4f81cf0e2a3d12aa5aa4d0d11f2fb8b5f93dca1187";
@@ -850,14 +851,14 @@ export declare const PPTX_PAYLOAD_HASHES: {
850
851
  readonly "templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml": "fa601f72a8561ffb56b8c006ffab200a86d56b7978b616542fd2d5a551a989b0";
851
852
  readonly "templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml": "3c155ca56b20719b1726930431ba15ab2c9fac0048eba58aabf78f931daf93e5";
852
853
  readonly "templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml": "16945ab42ce05fb39e08cfc8c76f82eaf749c3da69ac41256a3790e978f5d2da";
853
- readonly "templates/tonalities/atlas/pack.yaml": "fe8335d026ff0ccf9401a5362abe8a56f5d2fe7f616bc293c66c154f332d1a4e";
854
- readonly "templates/tonalities/chalk/pack.yaml": "69d53491983ca26612847aafa2a65e017b4029a8a5910e56caa1c3416cdb69f1";
855
- readonly "templates/tonalities/gazette/pack.yaml": "00015ad64b7790e9b6d98ea77ea608f50552d6eb3da6e658f64a7b5e00e63c80";
856
- readonly "templates/tonalities/ledger/pack.yaml": "62f6bc6a8d70db497f2a91e2ac6b69f3c8cb4366dc6951e97c5b7a2b64fc24a1";
857
- readonly "templates/tonalities/night/pack.yaml": "ee6460bf4e1df03b7f674d5b91ddcf9b21ae0468abe3c6384b91311d7ab2ec70";
858
- readonly "templates/tonalities/paper/pack.yaml": "06d98a0da3d15868d24c9aa0cb0434a56ea922fe52d48aab0ba3a324a98da150";
859
- readonly "templates/tonalities/signal/pack.yaml": "0e651b4e0a4a4a58471867eb07058c7b4fa2a428aaed8c64515db4b0ad6825da";
860
- readonly "templates/tonalities/studio/pack.yaml": "ba7b4aada30294971fd756ad7451cfc568b85b2fc7e1b3ab2175c7bfdbc72dcc";
854
+ readonly "templates/tonalities/atlas/pack.yaml": "4889cabb4afe497d5182a2d8645a48d71c50ecdb7672d83183a7f525f5f214f1";
855
+ readonly "templates/tonalities/chalk/pack.yaml": "0aa9946b1f01fb4d4973d289faa43ebe1f6712afe4b33376f1b79f3ae0c7feb2";
856
+ readonly "templates/tonalities/gazette/pack.yaml": "edc4a09aa1b53179e376bd0e5513cacf7f6a549d9c8e37a28c99fbfa64afba22";
857
+ readonly "templates/tonalities/ledger/pack.yaml": "3bdd4390ec058559fce62b238b6600540c698bce646040bbd216fa0d4000fc9c";
858
+ readonly "templates/tonalities/night/pack.yaml": "07425e9a47e8b7a08aba8d4dafe9c337343986ca0f26c43a75a6c07c763e2b8a";
859
+ readonly "templates/tonalities/paper/pack.yaml": "4cf8b399fe6f94933465005baaffbd3b08828e2718e8872ab8a97ee8b10284e7";
860
+ readonly "templates/tonalities/signal/pack.yaml": "bfead2e9edd2b4f3748a710a98378efd9c30a1050a891bb65df61fbb2b213275";
861
+ readonly "templates/tonalities/studio/pack.yaml": "9a9cf1a07bdd3d00ce3833f8c673a40a8fdf57e59f5fdfc2c283c893566b5da6";
861
862
  };
862
863
  export declare const MOTION_PAYLOAD_HASHES: {
863
864
  readonly "SKILL.md": "95e57c079a74c1e7cae5b035f22f9c0d395d1bc4377920717a20d370eda36a47";
@@ -720,7 +720,7 @@ export const DOCX_PAYLOAD_HASHES = {
720
720
  "scripts/convert_md_to_pdf.py": "23cbc66128baa47ed9ad805c0211068d3580bcd1954bd507874545afc45e2cd0",
721
721
  "scripts/convert_pdf.py": "383b01f74dd2696b7a02c5e97bb42bb49105bae41ed2c5a74188ce9d93e4aa13",
722
722
  "scripts/docx_craft.py": "434257bd8a89bd42290f29b03ad16921d0d539fdec23afb95627bac0c4d63e62",
723
- "scripts/docx_design.py": "28e9853e71112d58df8256ab2b677fa1bfb3a49362b51951125e46cec192e02f",
723
+ "scripts/docx_design.py": "e11dc7725e35dc4c8ee3991eaf01a36e87fe1b3c1a81eb142d165c472bd1dc89",
724
724
  "scripts/docx_layout.py": "b1b6429a34e721315303acb9bcb3e997b60ae90e4d2fef7cb7c3cdf40b32705a",
725
725
  "scripts/edit_docx.py": "ef0c9ac7afa535e118192e8c49db312b9c75ae0f41f8b988d4fab39c30368e74",
726
726
  "scripts/embed_images.py": "481f2bb54a6f4a1d3fae7c66f3d6b1f56676a30030154131ffe866e23ea68db1",
@@ -743,14 +743,15 @@ export const DOCX_PAYLOAD_HASHES = {
743
743
  "templates/latex/nature/README.md": "b0ff9e258e3aabc9c9bed8c26d7c9373b4bca83a85c54c5bd9c937132a829cbb",
744
744
  "templates/latex/nature/template.tex": "74437009d7fe894b8e2c8c256f300181081195e1f9831e922e20af6606704265",
745
745
  "templates/registry.yaml": "950c0adf003f773c84756e73df352bc29c771a8399f91c8ee93c14c39b6b9c7d",
746
- "templates/tonalities/brief.yaml": "82de6c6d8c822ce881354df8d64f36b2a0fb5918335a6962b5df9dbfab4e48cd",
747
- "templates/tonalities/journal.yaml": "14a818f052a5f69237de6af7c6aee5f1b96730be8b7d253566742ddf9bfe48ea",
748
- "templates/tonalities/manual.yaml": "2e62a62632f1829598c756ced0daa7ae3495c7bdf843d60584914ebe9f253308",
749
- "templates/tonalities/memo.yaml": "555cf0a61528bebb7dd8a77fe873f866581db645951a77f382b7713796d3e001",
750
- "templates/tonalities/proposal.yaml": "dac1b0e13a4ddb78f732b1c048cc978467aa74972547321c737525b5bea63442",
751
- "templates/tonalities/report.yaml": "291b353ac2d5d14481287e34b6dd7363b995e73f819496ee99a970ff8d7fcd18",
746
+ "templates/tonalities/brief.yaml": "1d99d859dd93b6fa2f8b409b698b7be617cff1b694d44b981c36d826c280d2e9",
747
+ "templates/tonalities/journal.yaml": "694118ebd8f1a1447172349b3b176f305f3197fcd6eee6a705eecd84b0874a81",
748
+ "templates/tonalities/manual.yaml": "3423de5ebfb7ac2e10b8f1d64c6c90500bf5ed04a624e1046f243083372a8098",
749
+ "templates/tonalities/memo.yaml": "d824d0cdaa34740351ae085fc6967412076355be5854ae0ec40d354964c236f8",
750
+ "templates/tonalities/proposal.yaml": "6125b6908672cc8fc460c9061b3b622a3f1a2700dfc8136303bb2cbfddd968fe",
751
+ "templates/tonalities/report.yaml": "e7466e9d68e524d0da154014547baad0e4bdf87ab13db8c706a718758026cb34",
752
752
  };
753
753
  export const PPTX_PAYLOAD_HASHES = {
754
+ "FORBIDDEN_TERMS.json": "8ef78f42a519c513c9291d8145dedd6180d4130e31553d1036821f1afd61cc81",
754
755
  NOTICE: "806c7aebcaf70ee5c24307f956d9ea0fd4626b63576da7522cbb94040bf08002",
755
756
  "SKILL.md": "19934a409373352f15f82c2d33cfb573f5b8b059e933cdf21c45cddc80f1ef12",
756
757
  "agents/analyst.md": "93ab81384b223da9a4b63427d161081b45b89b2a7323b57c514f9a1206eb88d1",
@@ -796,14 +797,14 @@ export const PPTX_PAYLOAD_HASHES = {
796
797
  "references/interview-protocol.md": "8b8b3bba7b14127702a20b734b05418c794c620b5df4d222d2da873d02398ed0",
797
798
  "references/layout-families.md": "7d35a3356d505bbbc67b19759fa8e23eb0b4d01e9fcfa321811ec1ee732ca5d2",
798
799
  "references/title-treatments.md": "81b36f9b8a7ececf23bf236f75581d3fe15a41c5825792442308ee17b251694a",
799
- "references/tonalities/atlas.md": "e4b03fe78a992a5d5c7c93382e6aeb7f71f1d742d0d349b45998704ed90e2338",
800
- "references/tonalities/chalk.md": "110d7ec4cbadabeb2a6992799199e0f1f0c3afc5480309f56ed003d6626b0412",
801
- "references/tonalities/gazette.md": "3e43a76c959624ea43cc74477505121dac2db6867edbf43f25adc20424e30c6b",
802
- "references/tonalities/ledger.md": "e6a5091a964c83c4895e133618a74b8ea9b4cd37edeefa2270b2878e508bb3b2",
803
- "references/tonalities/night.md": "b2ae314c4f7a0d0d91dfd0e1080f87112c2b874f8659d8686a9e46eea1877504",
804
- "references/tonalities/paper.md": "a3612a6430a56619fb0824e4586d579d9335ce3d5f0798788919ee06075dd4ea",
805
- "references/tonalities/signal.md": "9ab9b11f621781f89383d67ec281e1bf89c3195533f185519e581ed824bd9929",
806
- "references/tonalities/studio.md": "700cb806c437a262da08784ace59350951ec63e8fcb9e4bf82850a25557359c8",
800
+ "references/tonalities/atlas.md": "3a55bd1026cad5925fd041802137236bc6609249b3ca36030b0ab1769295dcba",
801
+ "references/tonalities/chalk.md": "d4f69d23bd477db61803e00464c18e4de3ed10368e2618c2d1e3833a5623adce",
802
+ "references/tonalities/gazette.md": "60937365ee08e539caf876dbd9244b67004a07c3248c47fbb00ec8367374c791",
803
+ "references/tonalities/ledger.md": "12c51f654ce9b1b831be3f434c648c907a0d9dcf8789e535d840dd46af6f0e9c",
804
+ "references/tonalities/night.md": "34365a6a71559cc7fa3569436f975df8a382aa1fd2e44283b896aa2c2625a1d0",
805
+ "references/tonalities/paper.md": "39973f22a4021c5dc1a4210ef123d7444b2dd279352418314caaabb8ae5d669e",
806
+ "references/tonalities/signal.md": "3c52945f7c4d513b97ae382b6bd544f9cf1daf5780b6f462ac947284b1d38285",
807
+ "references/tonalities/studio.md": "cca577f4458a6be2306995d996dd99e2d605b7f2a80cbc256c7eff776b65858f",
807
808
  "runtime/package-lock.json": "73cd3f54d979460757603c8a44c395e777cc0655d7f1c54dfb9512a9c77b8acd",
808
809
  "runtime/package.json": "700e183641eff75aa87b963d68d96b9c8e0bb21516a3b413c94b70bea10fbd55",
809
810
  "runtime/requirements.in": "893e4232e7e69e731053a8c3b3383eb22fb3f82affd6d96ad96d3a8ef8321656",
@@ -827,11 +828,11 @@ export const PPTX_PAYLOAD_HASHES = {
827
828
  "scripts/lib/render-pack.js": "92fdead997916fff277bb2ab25a297c1bd5f39b0f54d58940228d950aad00e9d",
828
829
  "scripts/lib/slide-ast.js": "a4fca91df696b43e5dcffa1b4f6116c8dfe7f8fc13de8c804dda8fbddf1ede9c",
829
830
  "scripts/lib/spec-validator.js": "0869ff328654de5c8c6eb36a22e9865683ba667b11eba6a85bd3e5428a3fccf3",
830
- "scripts/lib/template-registry.js": "5c2a86e15a319afd8cc2635521802c508a400bc27390fedb6ec0a61f3f3498e9",
831
+ "scripts/lib/template-registry.js": "a90ef33bc2ff0821bc62a49ac6724a6ebee0761de7d95b764c42b73bf82b740f",
831
832
  "scripts/office-run.mjs": "272f9bd74db9456fe5f5cce8f1dbf04fac60469f470a41c6571afafc5f444508",
832
833
  "scripts/package.json": "dbf8353f77358bc12169b7bb7301e1978d5b503e002ee927229a8993672818fc",
833
834
  "scripts/qa_deck.py": "dbde757b72dffe3f5b31def40dc5f7b92444a2b768ac3c91879fc959c30a2edc",
834
- "scripts/validate_pptx.py": "6f949c03be972f1128b03d5d3c83ce6c23e3a7aa33e1c6e90cbb3a8855de165e",
835
+ "scripts/validate_pptx.py": "2d3ddd0fd2564dab93f1bd74832c602d8df4f31e2856fd8a3b1e2c3e089d4ec4",
835
836
  "specs/markdown-slide-spec-v1.md": "eb9b04d070d9f2774746e65a34e5e6833fefd097ea7e01fc32327934ca8ee42b",
836
837
  "specs/markdown-slide-spec-v2.md": "3a7a91dfb21418711d5ad28f7a542603bc2f145051950478be0d2107f7fa5458",
837
838
  "specs/slide-ast-v1.schema.json": "d6d244bd30b6747645bd4a4f81cf0e2a3d12aa5aa4d0d11f2fb8b5f93dca1187",
@@ -851,14 +852,14 @@ export const PPTX_PAYLOAD_HASHES = {
851
852
  "templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml": "fa601f72a8561ffb56b8c006ffab200a86d56b7978b616542fd2d5a551a989b0",
852
853
  "templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml": "3c155ca56b20719b1726930431ba15ab2c9fac0048eba58aabf78f931daf93e5",
853
854
  "templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml": "16945ab42ce05fb39e08cfc8c76f82eaf749c3da69ac41256a3790e978f5d2da",
854
- "templates/tonalities/atlas/pack.yaml": "fe8335d026ff0ccf9401a5362abe8a56f5d2fe7f616bc293c66c154f332d1a4e",
855
- "templates/tonalities/chalk/pack.yaml": "69d53491983ca26612847aafa2a65e017b4029a8a5910e56caa1c3416cdb69f1",
856
- "templates/tonalities/gazette/pack.yaml": "00015ad64b7790e9b6d98ea77ea608f50552d6eb3da6e658f64a7b5e00e63c80",
857
- "templates/tonalities/ledger/pack.yaml": "62f6bc6a8d70db497f2a91e2ac6b69f3c8cb4366dc6951e97c5b7a2b64fc24a1",
858
- "templates/tonalities/night/pack.yaml": "ee6460bf4e1df03b7f674d5b91ddcf9b21ae0468abe3c6384b91311d7ab2ec70",
859
- "templates/tonalities/paper/pack.yaml": "06d98a0da3d15868d24c9aa0cb0434a56ea922fe52d48aab0ba3a324a98da150",
860
- "templates/tonalities/signal/pack.yaml": "0e651b4e0a4a4a58471867eb07058c7b4fa2a428aaed8c64515db4b0ad6825da",
861
- "templates/tonalities/studio/pack.yaml": "ba7b4aada30294971fd756ad7451cfc568b85b2fc7e1b3ab2175c7bfdbc72dcc",
855
+ "templates/tonalities/atlas/pack.yaml": "4889cabb4afe497d5182a2d8645a48d71c50ecdb7672d83183a7f525f5f214f1",
856
+ "templates/tonalities/chalk/pack.yaml": "0aa9946b1f01fb4d4973d289faa43ebe1f6712afe4b33376f1b79f3ae0c7feb2",
857
+ "templates/tonalities/gazette/pack.yaml": "edc4a09aa1b53179e376bd0e5513cacf7f6a549d9c8e37a28c99fbfa64afba22",
858
+ "templates/tonalities/ledger/pack.yaml": "3bdd4390ec058559fce62b238b6600540c698bce646040bbd216fa0d4000fc9c",
859
+ "templates/tonalities/night/pack.yaml": "07425e9a47e8b7a08aba8d4dafe9c337343986ca0f26c43a75a6c07c763e2b8a",
860
+ "templates/tonalities/paper/pack.yaml": "4cf8b399fe6f94933465005baaffbd3b08828e2718e8872ab8a97ee8b10284e7",
861
+ "templates/tonalities/signal/pack.yaml": "bfead2e9edd2b4f3748a710a98378efd9c30a1050a891bb65df61fbb2b213275",
862
+ "templates/tonalities/studio/pack.yaml": "9a9cf1a07bdd3d00ce3833f8c673a40a8fdf57e59f5fdfc2c283c893566b5da6",
862
863
  };
863
864
  export const MOTION_PAYLOAD_HASHES = {
864
865
  "SKILL.md": "95e57c079a74c1e7cae5b035f22f9c0d395d1bc4377920717a20d370eda36a47",
@@ -23,5 +23,10 @@ export declare function runInstallCli(args: readonly string[], io?: RouteIo): Pr
23
23
  * side-effect-free.
24
24
  */
25
25
  export declare function runDoctorCli(args: readonly string[], io?: RouteIo): number;
26
- /** `litcodex uninstall [--json]` — remove the registered plugin via `codex plugin remove`. */
26
+ /** Shared text for a `--dry-run` of a state-changing route: the title, then numbered steps. */
27
+ export declare function renderDryRunPlan(title: string, steps: readonly string[]): string;
28
+ /**
29
+ * `litcodex uninstall [--json] [--dry-run]` — remove the registered plugin via `codex plugin remove`.
30
+ * With `--dry-run` it prints the removal plan, runs no `codex` and changes no file.
31
+ */
27
32
  export declare function runUninstallCli(args: readonly string[], io?: RouteIo): number;
@@ -25,7 +25,7 @@ import { resolveBundledMarketplaceSource } from "./package-root.js";
25
25
  import { buildInstallPlan } from "./plan.js";
26
26
  import { renderInstallPlan } from "./render-plan.js";
27
27
  import { createBlockingSpinnerMotion } from "./spinner-motion.js";
28
- import { runUninstall } from "./uninstall.js";
28
+ import { runUninstall, uninstallPlanSteps } from "./uninstall.js";
29
29
  export { renderDoctorText, runDoctor } from "./doctor.js";
30
30
  export { INSTALL_ERROR_CODES, InstallError, toErrorJson } from "./errors.js";
31
31
  export { executeInstallPlan } from "./execute.js";
@@ -382,11 +382,25 @@ export function runDoctorCli(args, io = defaultIo()) {
382
382
  }
383
383
  return report.ok ? 0 : 4;
384
384
  }
385
- /** `litcodex uninstall [--json]` — remove the registered plugin via `codex plugin remove`. */
385
+ /** Shared text for a `--dry-run` of a state-changing route: the title, then numbered steps. */
386
+ export function renderDryRunPlan(title, steps) {
387
+ return `${title} plan (dry run: nothing was changed)\n${steps.map((step, index) => `${index + 1}. ${step}`).join("\n")}\n`;
388
+ }
389
+ /**
390
+ * `litcodex uninstall [--json] [--dry-run]` — remove the registered plugin via `codex plugin remove`.
391
+ * With `--dry-run` it prints the removal plan, runs no `codex` and changes no file.
392
+ */
386
393
  export function runUninstallCli(args, io = defaultIo()) {
387
394
  const json = args.includes("--json");
388
395
  writeCommandBanner(io, args);
389
396
  const codexHome = resolveCodexHome(io.env);
397
+ if (args.includes("--dry-run")) {
398
+ const steps = uninstallPlanSteps(codexHome);
399
+ io.stdout.write(json
400
+ ? `${JSON.stringify({ ok: true, dryRun: true, codexHome, steps })}\n`
401
+ : renderDryRunPlan("litcodex uninstall", steps));
402
+ return 0;
403
+ }
390
404
  const env = io.env;
391
405
  const codexBin = env["CODEX_BIN"]?.trim() && existsSync(env["CODEX_BIN"].trim()) ? env["CODEX_BIN"].trim() : "codex";
392
406
  const result = runUninstall({
@@ -6,6 +6,7 @@ type Spawn = (command: string, args: readonly string[], options: {
6
6
  stdout?: string | null;
7
7
  error?: Error;
8
8
  };
9
+ export declare function officeRuntimeScript(codexHome: string): string;
9
10
  export declare function officeRuntimeStatus(codexHome: string, spawn?: Spawn, env?: NodeJS.ProcessEnv): {
10
11
  ready: boolean;
11
12
  pptx: boolean;
@@ -3,11 +3,11 @@ import { existsSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { managedMarketplaceRoot } from "./marketplace.js";
5
5
  const RETRY = "npm exec --package @litfamily/litcodex -- litcodex office-runtime install";
6
- function runner(codexHome) {
6
+ export function officeRuntimeScript(codexHome) {
7
7
  return join(managedMarketplaceRoot(codexHome), "plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs");
8
8
  }
9
9
  function invoke(codexHome, command, spawn, env) {
10
- const path = runner(codexHome);
10
+ const path = officeRuntimeScript(codexHome);
11
11
  if (!existsSync(path))
12
12
  return { status: null, stdout: "", error: new Error("Office skill payload is missing") };
13
13
  return spawn(process.execPath, [path, command], { encoding: "utf8", env });
@@ -93,6 +93,16 @@ export interface DoctorReport {
93
93
  readonly jevSkillHint?: JevSkillHintState;
94
94
  /** Opt-in automatic handoff: off by default; the percent comes from the user. */
95
95
  readonly autoHandoff?: AutoHandoffDoctorReport;
96
+ /** Built-in Codex status line / terminal title snippet; null when the config already sets both. */
97
+ readonly tuiSuggestion?: TuiSuggestion | null;
98
+ }
99
+ export type TuiSuggestionKey = "status_line" | "terminal_title";
100
+ export interface TuiSuggestion {
101
+ readonly missing: readonly TuiSuggestionKey[];
102
+ /** Where the snippet goes: a new `[tui]` table, under the existing one, or as root `tui.` keys. */
103
+ readonly placement: "new-table" | "existing-table" | "root-dotted";
104
+ readonly configPath: string;
105
+ readonly snippet: string;
96
106
  }
97
107
  export interface AutoHandoffDoctorReport {
98
108
  readonly state: "on" | "off";
@@ -26,3 +26,5 @@ export declare function runUninstall(deps: UninstallDeps): {
26
26
  readonly ok: boolean;
27
27
  readonly codexHome: string;
28
28
  };
29
+ /** The steps `runUninstall` would take, for `--dry-run`. Pure: reads and writes nothing. */
30
+ export declare function uninstallPlanSteps(codexHome: string): readonly string[];
@@ -6,6 +6,7 @@ import { unsafeEffectiveRoute } from "../config-migration/gpt56-policy.js";
6
6
  import { removeSubagentDefaults } from "../config-migration/multi-agent-v2-guard.js";
7
7
  import { ensureNativeDefaultAgentConfig } from "../config-migration/native-default-route.js";
8
8
  import { GPT56_PROFILE_FILE_NAMES, isManagedGpt56ProfileContent } from "../config-migration/profile-files.js";
9
+ import { isTomlTableHeader } from "../config-migration/toml-lines.js";
9
10
  import { NATIVE_DEFAULT_AGENT_FILE } from "./agent-routing.js";
10
11
  import { prepareAgentSources } from "./agents-install.js";
11
12
  import { isSafeManagedMarketplaceRoot, LITCODEX_MARKETPLACE, LITCODEX_PLUGIN_REF, managedMarketplaceRoot, } from "./marketplace.js";
@@ -31,6 +32,16 @@ export function runUninstall(deps) {
31
32
  removeManagedProfileFiles(deps);
32
33
  return { ok: pluginOk && marketplaceOk, codexHome: deps.codexHome };
33
34
  }
35
+ /** The steps `runUninstall` would take, for `--dry-run`. Pure: reads and writes nothing. */
36
+ export function uninstallPlanSteps(codexHome) {
37
+ return [
38
+ `Remove the plugin: codex plugin remove ${LITCODEX_PLUGIN_REF}`,
39
+ `Remove the marketplace: codex plugin marketplace remove ${LITCODEX_MARKETPLACE}, then delete ${managedMarketplaceRoot(codexHome)} only if the marketplace removal succeeds`,
40
+ `Remove LitCodex agent roles from ${join(codexHome, "agents")} and the native default route ${join(codexHome, NATIVE_DEFAULT_AGENT_FILE)}, when they still match what LitCodex installed`,
41
+ `Remove the managed [agents] defaults from ${join(codexHome, "config.toml")} and LitCodex-generated profile files from ${codexHome}`,
42
+ `If the marketplace root or config.toml is a symlink or otherwise unsafe, uninstall refuses to change anything`,
43
+ ];
44
+ }
34
45
  function isSafeUninstallPaths(deps) {
35
46
  if (!isSafeManagedMarketplaceRoot(deps.codexHome, deps.fs))
36
47
  return false;
@@ -252,7 +263,7 @@ function withoutGeneratedNativeBinding(config, target) {
252
263
  const trimmed = line.trim();
253
264
  if (trimmed === "")
254
265
  continue;
255
- if (trimmed.startsWith("[") && trimmed.endsWith("]"))
266
+ if (isTomlTableHeader(trimmed))
256
267
  break;
257
268
  return null;
258
269
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litcodex",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "LitCodex Codex plugin: the lit-loop activation, durable loop runtime, and local review-gated knowledge.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -1,5 +1,13 @@
1
1
  export declare const AUTO_UPDATE_PACKAGE: "@litfamily/litcodex";
2
2
  export declare const DEFAULT_AUTO_UPDATE_TIMEOUT_MS = 10000;
3
+ /**
4
+ * Limit for each install step: the global npm install, the target's Codex install, and both rollbacks.
5
+ * Measured on 2026-10-11 against the public registry from an empty npm cache: the global install with its
6
+ * postinstall pre-warm took 1.7-5.6 s and the target's Codex install took 7.9-14.1 s, so the old shared
7
+ * 10 s limit could cut the Codex step. Sixty seconds is about ten times the slowest npm install and four
8
+ * times the slowest Codex install, while one stuck step still cannot hold a session for long.
9
+ */
10
+ export declare const DEFAULT_AUTO_UPDATE_INSTALL_TIMEOUT_MS = 60000;
3
11
  export declare const DEFAULT_AUTO_UPDATE_INTERVAL_MS: number;
4
12
  export declare const DEFAULT_AUTO_UPDATE_RETRY_INTERVAL_MS: number;
5
13
  export declare const DEFAULT_AUTO_UPDATE_LOCK_STALE_MS: number;
@@ -27,6 +35,7 @@ export interface AutoUpdateVerification {
27
35
  readonly observedVersion?: string | undefined;
28
36
  readonly doctorStatus: AutoUpdateDoctorStatus;
29
37
  readonly doctorDetail?: string | undefined;
38
+ readonly codexInstallAttempted?: boolean | undefined;
30
39
  readonly detail: string;
31
40
  }
32
41
  export interface AutoUpdateSpawnOptions {
@@ -48,6 +57,7 @@ export interface AutoUpdateVerifyOptions {
48
57
  readonly cwd: string;
49
58
  readonly env: NodeJS.ProcessEnv;
50
59
  readonly timeout: number;
60
+ readonly installTimeout?: number;
51
61
  readonly spawn: AutoUpdateSpawn;
52
62
  }
53
63
  export type AutoUpdateVerify = (expectedVersion: string, options: AutoUpdateVerifyOptions) => AutoUpdateVerification;
@@ -77,6 +87,7 @@ export interface AutoUpdateRunOptions extends AutoUpdatePlanOptions {
77
87
  readonly stateRoot?: string;
78
88
  readonly cwd?: string;
79
89
  readonly timeoutMs?: number;
90
+ readonly installTimeoutMs?: number;
80
91
  readonly lockStaleMs?: number;
81
92
  readonly spawn?: AutoUpdateSpawn;
82
93
  readonly verifyInstalled?: AutoUpdateVerify;
@@ -110,8 +121,12 @@ export declare function resolveAutoUpdatePlan(options: AutoUpdatePlanOptions): A
110
121
  /**
111
122
  * Prove that npm's global executable resolves to the exact version that the install command targeted.
112
123
  * npm can return exit 0 for a no-op, warning, or partially successful lifecycle, so the install result
113
- * is never treated as committed until this independent version probe agrees.
124
+ * is never treated as committed until this independent version probe agrees. Only that exact package
125
+ * then installs itself into Codex (managed marketplace and plugin cache); its doctor runs last, because
126
+ * the doctor fails while Codex still holds the previous plugin version.
114
127
  */
115
128
  export declare function verifyInstalledVersion(expectedVersion: string, options: AutoUpdateVerifyOptions): AutoUpdateVerification;
116
129
  export declare function runForegroundAutoUpdate(options: AutoUpdateRunOptions): AutoUpdateResult;
130
+ /** The longest one transaction can run: three probes plus four install steps (two forward, two back). */
131
+ export declare function autoUpdateWorstCaseMs(timeout?: number, installTimeout?: number): number;
117
132
  export declare function readAutoUpdateReceipt(stateRoot?: string): AutoUpdateReceipt | null;
@@ -5,6 +5,14 @@ import { homedir, tmpdir } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
  export const AUTO_UPDATE_PACKAGE = "@litfamily/litcodex";
7
7
  export const DEFAULT_AUTO_UPDATE_TIMEOUT_MS = 10_000;
8
+ /**
9
+ * Limit for each install step: the global npm install, the target's Codex install, and both rollbacks.
10
+ * Measured on 2026-10-11 against the public registry from an empty npm cache: the global install with its
11
+ * postinstall pre-warm took 1.7-5.6 s and the target's Codex install took 7.9-14.1 s, so the old shared
12
+ * 10 s limit could cut the Codex step. Sixty seconds is about ten times the slowest npm install and four
13
+ * times the slowest Codex install, while one stuck step still cannot hold a session for long.
14
+ */
15
+ export const DEFAULT_AUTO_UPDATE_INSTALL_TIMEOUT_MS = 60_000;
8
16
  export const DEFAULT_AUTO_UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1000;
9
17
  export const DEFAULT_AUTO_UPDATE_RETRY_INTERVAL_MS = 30 * 60 * 1000;
10
18
  export const DEFAULT_AUTO_UPDATE_LOCK_STALE_MS = 10 * 60 * 1000;
@@ -36,6 +44,14 @@ const SAFE_ENV_KEYS = [
36
44
  "LANG",
37
45
  "LC_ALL",
38
46
  ];
47
+ // These name the Codex host being managed. The target package's install, version probe and doctor
48
+ // must act on the same host as the session that started the update, so only those children get them.
49
+ const CODEX_HOST_ENV_KEYS = [
50
+ "CODEX_HOME",
51
+ "CODEX_BIN",
52
+ "LITCODEX_DATA_ROOT",
53
+ "LITCODEX_AUTO_UPDATE_STATE_ROOT",
54
+ ];
39
55
  function parseStableVersion(version) {
40
56
  if (typeof version !== "string")
41
57
  return null;
@@ -118,6 +134,23 @@ function withSanitizedNpmEnvironment(env, operation) {
118
134
  rmSync(sandbox.root, { recursive: true, force: true });
119
135
  }
120
136
  }
137
+ function withCodexHost(safe, env) {
138
+ const host = { ...safe };
139
+ for (const key of CODEX_HOST_ENV_KEYS) {
140
+ const value = env[key];
141
+ if (value !== undefined)
142
+ host[key] = value;
143
+ }
144
+ return host;
145
+ }
146
+ function installIntoCodex(command, options, timeout) {
147
+ return options.spawn(command, ["exec", "--global", "--", "litcodex", "install", "--no-auto-update"], {
148
+ cwd: options.cwd,
149
+ env: options.env,
150
+ timeout,
151
+ stdio: "ignore",
152
+ });
153
+ }
121
154
  export function sanitizeNpmEnvironment(env = process.env) {
122
155
  // This public inspection helper intentionally returns the generated paths so callers/tests can
123
156
  // prove that user npm state was not reused. Runtime subprocesses use withSanitizedNpmEnvironment,
@@ -325,7 +358,9 @@ function latestFromRegistry(env, spawn, cwd, timeout) {
325
358
  /**
326
359
  * Prove that npm's global executable resolves to the exact version that the install command targeted.
327
360
  * npm can return exit 0 for a no-op, warning, or partially successful lifecycle, so the install result
328
- * is never treated as committed until this independent version probe agrees.
361
+ * is never treated as committed until this independent version probe agrees. Only that exact package
362
+ * then installs itself into Codex (managed marketplace and plugin cache); its doctor runs last, because
363
+ * the doctor fails while Codex still holds the previous plugin version.
329
364
  */
330
365
  export function verifyInstalledVersion(expectedVersion, options) {
331
366
  const versionArgs = ["exec", "--global", "--", "litcodex", "--version"];
@@ -365,6 +400,17 @@ export function verifyInstalledVersion(expectedVersion, options) {
365
400
  detail: `global litcodex resolved ${observedVersion}; expected ${expectedVersion}`,
366
401
  };
367
402
  }
403
+ const codexInstall = installIntoCodex(options.command, options, positiveTimeout(options.installTimeout, DEFAULT_AUTO_UPDATE_INSTALL_TIMEOUT_MS));
404
+ if (!spawnSucceeded(codexInstall)) {
405
+ return {
406
+ status: "unavailable",
407
+ expectedVersion,
408
+ observedVersion,
409
+ doctorStatus: "not-run",
410
+ codexInstallAttempted: true,
411
+ detail: `target litcodex install exited ${String(codexInstall.status)}`,
412
+ };
413
+ }
368
414
  const doctorArgs = ["exec", "--global", "--", "litcodex", "doctor", "--json", "--no-auto-update"];
369
415
  const doctorResult = options.spawn(options.command, doctorArgs, {
370
416
  cwd: options.cwd,
@@ -379,6 +425,7 @@ export function verifyInstalledVersion(expectedVersion, options) {
379
425
  observedVersion,
380
426
  doctorStatus: "failed",
381
427
  doctorDetail: `target litcodex doctor --json exited ${String(doctorResult.status)}`,
428
+ codexInstallAttempted: true,
382
429
  detail: `global litcodex resolved exact ${expectedVersion}, but target doctor did not pass`,
383
430
  };
384
431
  }
@@ -402,6 +449,7 @@ export function verifyInstalledVersion(expectedVersion, options) {
402
449
  observedVersion,
403
450
  doctorStatus: "failed",
404
451
  doctorDetail: "target litcodex doctor --json reported unhealthy or malformed output",
452
+ codexInstallAttempted: true,
405
453
  detail: `global litcodex resolved exact ${expectedVersion}, but target doctor did not pass`,
406
454
  };
407
455
  }
@@ -411,7 +459,8 @@ export function verifyInstalledVersion(expectedVersion, options) {
411
459
  observedVersion,
412
460
  doctorStatus: "passed",
413
461
  doctorDetail: "target litcodex doctor --json passed",
414
- detail: `global litcodex resolved exact ${expectedVersion}; target doctor passed`,
462
+ codexInstallAttempted: true,
463
+ detail: `global litcodex resolved exact ${expectedVersion}; installed into Codex; target doctor passed`,
415
464
  };
416
465
  }
417
466
  export function runForegroundAutoUpdate(options) {
@@ -425,29 +474,37 @@ export function runForegroundAutoUpdate(options) {
425
474
  const spawn = options.spawn ?? defaultSpawn;
426
475
  const cwd = options.cwd ?? process.cwd();
427
476
  const timeout = positiveTimeout(options.timeoutMs, positiveInteger(env["LITCODEX_AUTO_UPDATE_TIMEOUT_MS"], DEFAULT_AUTO_UPDATE_TIMEOUT_MS));
477
+ const installTimeout = positiveTimeout(options.installTimeoutMs, positiveInteger(env["LITCODEX_AUTO_UPDATE_INSTALL_TIMEOUT_MS"], DEFAULT_AUTO_UPDATE_INSTALL_TIMEOUT_MS));
428
478
  const state = readState(statePath);
429
- const latestVersion = options.latestVersion ?? env["LITCODEX_LATEST_VERSION"] ?? latestFromRegistry(env, spawn, cwd, timeout);
430
- const plan = resolveAutoUpdatePlan({
479
+ const planOptions = {
431
480
  ...options,
432
481
  env,
433
482
  now,
434
- latestVersion,
435
483
  lastCheckedAt: state.lastCheckedAt,
436
484
  lastAttemptedAt: state.lastAttemptedAt,
437
485
  lastStatus: state.lastStatus,
438
- });
486
+ };
487
+ // Every opt-out and throttle is decided before the registry is asked, so a throttled session never
488
+ // spends a network round trip. The registry is consulted only when nothing else stopped the run.
489
+ let plan = resolveAutoUpdatePlan(planOptions);
490
+ if (plan.reason === "unknown-latest" && (options.latestVersion ?? env["LITCODEX_LATEST_VERSION"]) === undefined) {
491
+ plan = resolveAutoUpdatePlan({ ...planOptions, latestVersion: latestFromRegistry(env, spawn, cwd, timeout) });
492
+ }
439
493
  if (!plan.shouldRun) {
440
494
  const result = noRunResult(plan, stateRoot, startedAt);
495
+ const earlierFailure = unresolvedFailure(readAutoUpdateReceipt(stateRoot), plan);
441
496
  if (options.writeReceipt !== false) {
442
497
  atomicJson(journalPath, { phase: "skipped", ...result });
443
- atomicJson(receiptPath, result);
498
+ if (!earlierFailure)
499
+ atomicJson(receiptPath, result);
500
+ }
501
+ if (plan.reason === "up-to-date") {
502
+ atomicJson(statePath, { ...state, lastCheckedAt: now, ...(earlierFailure ? {} : { lastStatus: "success" }) });
444
503
  }
445
- if (plan.reason === "up-to-date")
446
- atomicJson(statePath, { ...state, lastCheckedAt: now, lastStatus: "success" });
447
504
  return result;
448
505
  }
449
506
  const lockPath = join(stateRoot, "lock");
450
- const lockToken = acquireLock(lockPath, now, Math.max(positiveInteger(env["LITCODEX_AUTO_UPDATE_LOCK_STALE_MS"], DEFAULT_AUTO_UPDATE_LOCK_STALE_MS), timeout * 5 + 30_000));
507
+ const lockToken = acquireLock(lockPath, now, Math.max(positiveInteger(env["LITCODEX_AUTO_UPDATE_LOCK_STALE_MS"], DEFAULT_AUTO_UPDATE_LOCK_STALE_MS), autoUpdateWorstCaseMs(timeout, installTimeout) + 30_000));
451
508
  if (lockToken === null) {
452
509
  const result = noRunResult({ ...plan, shouldRun: false, reason: "locked" }, stateRoot, startedAt);
453
510
  if (options.writeReceipt !== false)
@@ -479,7 +536,7 @@ export function runForegroundAutoUpdate(options) {
479
536
  const result = withSanitizedNpmEnvironment(env, (safeEnv) => spawn(command, args, {
480
537
  cwd,
481
538
  env: safeEnv,
482
- timeout,
539
+ timeout: installTimeout,
483
540
  stdio: "ignore",
484
541
  }));
485
542
  let verification = {
@@ -494,8 +551,9 @@ export function runForegroundAutoUpdate(options) {
494
551
  verification = withSanitizedNpmEnvironment(env, (safeEnv) => (options.verifyInstalled ?? verifyInstalledVersion)(plan.latestVersion, {
495
552
  command,
496
553
  cwd,
497
- env: safeEnv,
554
+ env: withCodexHost(safeEnv, env),
498
555
  timeout,
556
+ installTimeout,
499
557
  spawn,
500
558
  }));
501
559
  }
@@ -560,13 +618,25 @@ export function runForegroundAutoUpdate(options) {
560
618
  const rollback = withSanitizedNpmEnvironment(env, (safeEnv) => spawn(command, ["install", "--global", "--no-fund", "--no-audit", `${AUTO_UPDATE_PACKAGE}@${plan.currentVersion}`], {
561
619
  cwd,
562
620
  env: safeEnv,
563
- timeout,
621
+ timeout: installTimeout,
564
622
  stdio: "ignore",
565
623
  }));
566
624
  rollbackStatus = rollback.status;
567
625
  rollbackSignal = rollback.signal;
568
626
  rollbackError = rollback.error;
569
627
  rollbackSucceeded = spawnSucceeded(rollback);
628
+ if (rollbackSucceeded && verification.codexInstallAttempted === true) {
629
+ // The target already wrote its plugin into Codex, so the restored package reinstalls its own.
630
+ const restore = withSanitizedNpmEnvironment(env, (safeEnv) => installIntoCodex(command, { cwd, env: withCodexHost(safeEnv, env), spawn }, installTimeout));
631
+ rollbackStatus = restore.status;
632
+ rollbackSignal = restore.signal;
633
+ rollbackError =
634
+ restore.error ??
635
+ (spawnSucceeded(restore)
636
+ ? undefined
637
+ : new Error(`restoring the ${plan.currentVersion} Codex plugin exited ${String(restore.status)}`));
638
+ rollbackSucceeded = spawnSucceeded(restore);
639
+ }
570
640
  }
571
641
  catch (error) {
572
642
  rollbackError = error instanceof Error ? error : new Error("rollback probe failed");
@@ -619,6 +689,22 @@ export function runForegroundAutoUpdate(options) {
619
689
  releaseLock(lockPath, lockToken);
620
690
  }
621
691
  }
692
+ /** The longest one transaction can run: three probes plus four install steps (two forward, two back). */
693
+ export function autoUpdateWorstCaseMs(timeout = DEFAULT_AUTO_UPDATE_TIMEOUT_MS, installTimeout = DEFAULT_AUTO_UPDATE_INSTALL_TIMEOUT_MS) {
694
+ return timeout * 3 + installTimeout * 4;
695
+ }
696
+ /**
697
+ * A failed or unknown-state receipt stays the visible receipt until an update attempt replaces it, or
698
+ * until an up-to-date check proves the failed target is installed, which makes that failure history.
699
+ */
700
+ function unresolvedFailure(previous, plan) {
701
+ if (previous?.status !== "failed" && previous?.status !== "unknown-state")
702
+ return false;
703
+ if (plan.reason !== "up-to-date" || previous.latestVersion === undefined || plan.currentVersion === undefined) {
704
+ return true;
705
+ }
706
+ return compareStableVersions(plan.currentVersion, previous.latestVersion) < 0;
707
+ }
622
708
  export function readAutoUpdateReceipt(stateRoot = resolveAutoUpdateStateRoot()) {
623
709
  const path = join(stateRoot, "receipt.json");
624
710
  if (!existsSync(path))
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litcodex/auto-update",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "LitCodex foreground update barrier for the SessionStart and management lifecycles.",
5
5
  "type": "module",
6
6
  "private": true,