@litfamily/lithermes 1.0.26 → 1.0.28

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 (96) hide show
  1. package/README.md +10 -9
  2. package/README_Ko-KR.md +10 -9
  3. package/assets/lithermes-plugin/README.md +28 -9
  4. package/assets/lithermes-plugin/__init__.py +8 -3
  5. package/assets/lithermes-plugin/auto_update.py +17 -3
  6. package/assets/lithermes-plugin/core.py +41 -2
  7. package/assets/lithermes-plugin/core_contexts.py +27 -9
  8. package/assets/lithermes-plugin/core_contract.py +7 -2
  9. package/assets/lithermes-plugin/core_review.py +144 -3
  10. package/assets/lithermes-plugin/core_routing.py +10 -0
  11. package/assets/lithermes-plugin/core_workflow_commands.py +3 -2
  12. package/assets/lithermes-plugin/deliverable_hedge_guard.py +171 -48
  13. package/assets/lithermes-plugin/diagnostics.py +5 -3
  14. package/assets/lithermes-plugin/humanizer_detector.py +117 -5
  15. package/assets/lithermes-plugin/lit_reentry.py +233 -0
  16. package/assets/lithermes-plugin/payload-version.json +184 -52
  17. package/assets/lithermes-plugin/plugin.yaml +1 -1
  18. package/assets/lithermes-plugin/rules/__init__.py +2 -0
  19. package/assets/lithermes-plugin/rules/bundled-rules/lit-humanizer.md +2 -0
  20. package/assets/lithermes-plugin/rules/engine.py +26 -11
  21. package/assets/lithermes-plugin/skills/deep-interview/SKILL.md +2 -1
  22. package/assets/lithermes-plugin/skills/frontend-ui-ux/references/complete-contract.md +3 -3
  23. package/assets/lithermes-plugin/skills/frontend-ui-ux/scripts/hostexec.mjs +118 -0
  24. package/assets/lithermes-plugin/skills/frontend-ui-ux/scripts/probe.mjs +6 -5
  25. package/assets/lithermes-plugin/skills/lit-brainstorm/SKILL.md +408 -0
  26. package/assets/lithermes-plugin/skills/lit-diagram-drawer/scripts/doctor.mjs +3 -3
  27. package/assets/lithermes-plugin/skills/lit-diagram-drawer/scripts/export.mjs +5 -5
  28. package/assets/lithermes-plugin/skills/lit-diagram-drawer/scripts/hostexec.mjs +118 -0
  29. package/assets/lithermes-plugin/skills/lit-docx/scripts/convert_md_to_pdf.py +38 -4
  30. package/assets/lithermes-plugin/skills/lit-docx/templates/latex/acs/template.tex +3 -0
  31. package/assets/lithermes-plugin/skills/lit-docx/templates/latex/elsevier/template.tex +3 -0
  32. package/assets/lithermes-plugin/skills/lit-docx/templates/latex/ieee/template.tex +3 -0
  33. package/assets/lithermes-plugin/skills/lit-docx/templates/latex/korean-generic/template.tex +3 -0
  34. package/assets/lithermes-plugin/skills/lit-docx/templates/latex/nature/template.tex +3 -0
  35. package/assets/lithermes-plugin/skills/lit-humanizer/SKILL.md +2 -0
  36. package/assets/lithermes-plugin/skills/lit-pptx/bin/hostexec.mjs +118 -0
  37. package/assets/lithermes-plugin/skills/lit-pptx/bin/office.mjs +16 -9
  38. package/assets/lithermes-plugin/skills/lit-typographic-motion/SKILL.md +13 -12
  39. package/assets/lithermes-plugin/skills/lit-typographic-motion/bin/motion.mjs +19 -6
  40. package/assets/lithermes-plugin/skills/lit-typographic-motion/bin/runtime.mjs +25 -19
  41. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +2 -0
  42. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/browser.mjs +11 -4
  43. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/constants.mjs +29 -0
  44. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-assets.mjs +87 -0
  45. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-capture.mjs +189 -0
  46. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-gate.mjs +263 -0
  47. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-image.mjs +103 -0
  48. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-init.js +36 -0
  49. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-png.mjs +77 -0
  50. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-sheet.mjs +70 -0
  51. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-treatment.mjs +104 -0
  52. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-webp.mjs +112 -0
  53. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover-worker.mjs +19 -0
  54. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/cover.mjs +338 -0
  55. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/encode.mjs +1 -1
  56. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/hostexec.mjs +118 -0
  57. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/look.mjs +103 -7
  58. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/loop-kit.js +80 -0
  59. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/sound.mjs +1 -1
  60. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/stage.mjs +8 -2
  61. package/assets/lithermes-plugin/skills/lit-typographic-motion/engine/treatment.mjs +1 -0
  62. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/expected.json +49 -0
  63. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/index.html +37 -0
  64. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/expected.json +49 -0
  65. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/index.html +27 -0
  66. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/expected.json +51 -0
  67. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/index.html +29 -0
  68. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/expected.json +51 -0
  69. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/index.html +37 -0
  70. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +68 -0
  71. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/orbit-loop/index.html +112 -0
  72. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +96 -0
  73. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/painted-light/index.html +208 -0
  74. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +68 -0
  75. package/assets/lithermes-plugin/skills/lit-typographic-motion/recipes/weight-tide/index.html +81 -0
  76. package/assets/lithermes-plugin/skills/lit-typographic-motion/references/cover.md +458 -0
  77. package/assets/lithermes-plugin/skills/lit-typographic-motion/references/craft-loop.md +4 -1
  78. package/assets/lithermes-plugin/skills/lit-typographic-motion/references/runtime.md +13 -5
  79. package/assets/lithermes-plugin/skills/lit-typographic-motion/references/stage.md +4 -2
  80. package/assets/lithermes-plugin/skills/lit-typographic-motion/references/treatment.md +6 -0
  81. package/assets/lithermes-plugin/skills/lit-typographic-motion/runtime/fonts.json +11 -0
  82. package/assets/lithermes-plugin/skills/lit-typographic-motion/runtime/requirements.lock +72 -0
  83. package/assets/lithermes-plugin/skills/litgoal/SKILL.md +19 -1
  84. package/assets/lithermes-plugin/skills/lsp-setup/scripts/verify-lsp.ts +16 -3
  85. package/assets/lithermes-plugin/skills/review-work/SKILL.md +38 -16
  86. package/assets/lithermes-plugin/skills/visual-qa/references/complete-contract.md +3 -3
  87. package/package.json +2 -1
  88. package/readme-assets/badge-version.svg +1 -1
  89. package/readme-assets/cover-motion-still.webp +0 -0
  90. package/readme-assets/cover-motion.webp +0 -0
  91. package/src/cli.js +2 -2
  92. package/src/lib/check.js +9 -6
  93. package/src/lib/hermesDiscovery.js +2 -2
  94. package/src/lib/hostExec.js +81 -0
  95. package/src/lib/skillPayload.js +1 -1
  96. package/src/lib/updateNotifier.js +14 -4
@@ -5,6 +5,7 @@ const path = require("node:path");
5
5
  const crypto = require("node:crypto");
6
6
  const { spawn, spawnSync } = require("node:child_process");
7
7
  const { writeFileAtomic } = require("./files");
8
+ const { describeSpawnFailure, prepareSpawn } = require("./hostExec");
8
9
  const { defaultHermesHome } = require("./hermesDiscovery");
9
10
 
10
11
  const PACKAGE_NAME = "@litfamily/lithermes";
@@ -650,7 +651,9 @@ function sanitizeNpmEnvironment(source = process.env, { hermesHome } = {}) {
650
651
  // Keep only process plumbing needed to resolve npx and write temporary
651
652
  // files. In particular, do not inherit npm config, proxies, NODE_OPTIONS,
652
653
  // or any token-bearing environment key into the child installer.
653
- for (const key of ["PATH", "HOME", "USERPROFILE", "TMPDIR", "TEMP", "TMP", "LANG", "LC_ALL", "LC_CTYPE", "TERM"]) {
654
+ // The Windows keys (SystemRoot, PATHEXT, ComSpec, APPDATA, LOCALAPPDATA) carry no secrets and
655
+ // npx cannot start without them.
656
+ for (const key of ["PATH", "HOME", "USERPROFILE", "TMPDIR", "TEMP", "TMP", "LANG", "LC_ALL", "LC_CTYPE", "TERM", "SystemRoot", "windir", "PATHEXT", "ComSpec", "APPDATA", "LOCALAPPDATA"]) {
654
657
  if (typeof source?.[key] === "string" && source[key].length > 0) safe[key] = source[key];
655
658
  }
656
659
  if (typeof source?.NODE_EXTRA_CA_CERTS === "string" && source.NODE_EXTRA_CA_CERTS.length > 0) {
@@ -843,7 +846,9 @@ function rollbackFailure(reason, rollback) {
843
846
  function safeNpmFailure(result) {
844
847
  if (!result || result.signal) return result?.signal ? `npm installer interrupted (${result.signal})` : "npm installer returned no status";
845
848
  if (result.error?.code === "ETIMEDOUT") return "npm installer timed out";
846
- return `npm installer exited with status ${result.status}`;
849
+ if (result.error) return describeSpawnFailure("npm installer", result);
850
+ const reason = describeSpawnFailure("npm installer", result);
851
+ return reason === `npm installer exited ${result.status}` ? `npm installer exited with status ${result.status}` : reason.replace("exited ", "exited with status ");
847
852
  }
848
853
 
849
854
  function runAutomaticUpdate({
@@ -854,6 +859,7 @@ function runAutomaticUpdate({
854
859
  now = Date.now,
855
860
  fetchLatestVersionFn = fetchLatestVersion,
856
861
  spawnSync: spawnSyncFn = spawnSync,
862
+ platform = process.platform,
857
863
  doctor,
858
864
  packageName = PACKAGE_NAME,
859
865
  timeoutMs = AUTO_UPDATE_TIMEOUT_MS,
@@ -894,6 +900,7 @@ function runAutomaticUpdate({
894
900
  now,
895
901
  fetchLatestVersionFn,
896
902
  spawnSyncFn,
903
+ platform,
897
904
  doctor,
898
905
  packageName,
899
906
  timeoutMs,
@@ -917,6 +924,7 @@ function runAutomaticUpdate({
917
924
  env,
918
925
  now,
919
926
  spawnSyncFn,
927
+ platform,
920
928
  doctor,
921
929
  packageName,
922
930
  timeoutMs,
@@ -949,6 +957,7 @@ function performAutomaticUpdateTransaction({
949
957
  env = process.env,
950
958
  now = Date.now,
951
959
  spawnSyncFn = spawnSync,
960
+ platform = process.platform,
952
961
  doctor,
953
962
  packageName = PACKAGE_NAME,
954
963
  timeoutMs = AUTO_UPDATE_TIMEOUT_MS,
@@ -1050,7 +1059,7 @@ function performAutomaticUpdateTransaction({
1050
1059
  writeJournal("installing");
1051
1060
  const argv = buildAutoUpdateArgv({ latestVersion, hermesHome, packageName });
1052
1061
  checkState();
1053
- const result = spawnSyncFn("npx", argv, {
1062
+ const npx = prepareSpawn("npx", argv, {
1054
1063
  cwd,
1055
1064
  env: sanitizeNpmEnvironment(env, { hermesHome }),
1056
1065
  encoding: "utf8",
@@ -1058,7 +1067,8 @@ function performAutomaticUpdateTransaction({
1058
1067
  maxBuffer: MAX_RESPONSE_BYTES,
1059
1068
  stdio: ["ignore", "pipe", "pipe"],
1060
1069
  windowsHide: true,
1061
- });
1070
+ }, { platform });
1071
+ const result = spawnSyncFn(npx.command, npx.args, npx.options);
1062
1072
  if (!result || result.status !== 0 || result.signal || result.error) {
1063
1073
  const reason = safeNpmFailure(result);
1064
1074
  const rollback = restoreSnapshot(snapshot, hermesHome, checkState);