omo-ai 5.1.51 → 5.1.54

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 (240) hide show
  1. package/bin/darwin/omo-keychain +0 -0
  2. package/bin/lib/bun-runtime.js +4 -2
  3. package/bin/lib/launcher.js +4 -2
  4. package/bin/lib/private-fd-table.js +65 -0
  5. package/bin/lib/private-fds.js +12 -0
  6. package/bin/lib/provider-map.json +1 -1
  7. package/bin/lib/service-auth.generated.js +12 -9
  8. package/bin/lib/setup-summary.js +8 -3
  9. package/bin/omo.js +1 -0
  10. package/package.json +2 -2
  11. package/plugin/CHANGELOG.md +122 -118
  12. package/plugin/extensions/assets.generated.json +5 -5
  13. package/plugin/extensions/dream-persona.md +1 -0
  14. package/plugin/extensions/gateway-store-worker.mjs +1 -1
  15. package/plugin/extensions/memory-run-supervisor.mjs +3 -3
  16. package/plugin/extensions/omo-claim-receipt.js +2 -2
  17. package/plugin/extensions/omo-computer-use.js +2 -2
  18. package/plugin/extensions/omo-desktop-toolkit.js +2 -0
  19. package/plugin/extensions/omo-device-account.js +2 -2
  20. package/plugin/extensions/omo-feedback.js +2 -2
  21. package/plugin/extensions/omo-init-deep-advisor.js +2 -2
  22. package/plugin/extensions/omo-member.js +2 -2
  23. package/plugin/extensions/omo-memory-commands.js +3 -3
  24. package/plugin/extensions/omo-memory-doctor.js +3 -3
  25. package/plugin/extensions/omo-memory-memfs.js +3 -3
  26. package/plugin/extensions/omo-memory-palace.js +3 -3
  27. package/plugin/extensions/omo-memory-sync.js +2 -2
  28. package/plugin/extensions/omo-onboarding-scan.js +3 -3
  29. package/plugin/extensions/omo-recall-store.js +2 -2
  30. package/plugin/extensions/omo-session-history.js +1 -1
  31. package/plugin/extensions/omo-side-panel.js +3 -3
  32. package/plugin/extensions/omo-task.js +2 -2
  33. package/plugin/extensions/omo-telemetry-otlp.js +2 -2
  34. package/plugin/extensions/omo-telemetry-posthog.js +1 -1
  35. package/plugin/extensions/omo-telemetry-recovery.js +1 -1
  36. package/plugin/extensions/omo-thread-client.js +2 -2
  37. package/plugin/extensions/omo.js +3 -3
  38. package/plugin/extensions/reflection-persona.md +2 -0
  39. package/plugin/package.json +3 -1
  40. package/plugin/runtime/agent-toolkit-sdk/sdk.js +2 -2
  41. package/plugin/runtime/ast-grep-mcp/manifest.json +1 -1
  42. package/plugin/runtime/category-coverage/assets.generated.json +5 -5
  43. package/plugin/runtime/category-coverage/index.js +5 -5
  44. package/plugin/runtime/lsp-daemon/dist/.omo-runtime-manifest.json +4 -4
  45. package/plugin/runtime/lsp-daemon/dist/cli.js +81 -15
  46. package/plugin/runtime/lsp-daemon/dist/client.js +74 -8
  47. package/plugin/runtime/lsp-daemon/dist/index.js +76 -10
  48. package/plugin/runtime/rollback-migrate.js +1 -1
  49. package/plugin/runtime/task-config/index.js +1 -1
  50. package/plugin/runtime/thread-sdk/sdk.js +2 -2
  51. package/plugin/scripts/install.mjs +1 -0
  52. package/plugin/skills/browser/runtime/omowright/index.js +24 -33
  53. package/plugin/skills/browser/runtime/omowright/manifest.json +3 -3
  54. package/plugin/skills/frontend/ATTRIBUTION.md +104 -1
  55. package/plugin/skills/frontend/SKILL.md +7 -3
  56. package/plugin/skills/frontend/references/design/design-system-architecture.md +3 -3
  57. package/plugin/skills/frontend/references/perfection/craft-floor.md +59 -0
  58. package/plugin/skills/frontend/references/perfection/detect.md +52 -0
  59. package/plugin/skills/frontend/scripts/detect/cli.ts +70 -0
  60. package/plugin/skills/frontend/scripts/detect/config.ts +53 -0
  61. package/plugin/skills/frontend/scripts/detect/core/characters.ts +2 -0
  62. package/plugin/skills/frontend/scripts/detect/core/color.ts +150 -0
  63. package/plugin/skills/frontend/scripts/detect/core/page.ts +84 -0
  64. package/plugin/skills/frontend/scripts/detect/core/shadow.ts +40 -0
  65. package/plugin/skills/frontend/scripts/detect/core/source.ts +33 -0
  66. package/plugin/skills/frontend/scripts/detect/detect.ts +77 -0
  67. package/plugin/skills/frontend/scripts/detect/index.ts +23 -0
  68. package/plugin/skills/frontend/scripts/detect/lint.ts +98 -0
  69. package/plugin/skills/frontend/scripts/detect/render/probe-placement.ts +50 -0
  70. package/plugin/skills/frontend/scripts/detect/render/renderer.ts +37 -0
  71. package/plugin/skills/frontend/scripts/detect/render/webview.ts +71 -0
  72. package/plugin/skills/frontend/scripts/detect/report.ts +29 -0
  73. package/plugin/skills/frontend/scripts/detect/rule.ts +42 -0
  74. package/plugin/skills/frontend/scripts/detect/rules/color/ai-color-palette.ts +83 -0
  75. package/plugin/skills/frontend/scripts/detect/rules/color/cream-palette.ts +35 -0
  76. package/plugin/skills/frontend/scripts/detect/rules/color/dark-glow.ts +44 -0
  77. package/plugin/skills/frontend/scripts/detect/rules/color/design-system-color.ts +35 -0
  78. package/plugin/skills/frontend/scripts/detect/rules/color/gradient-text.ts +59 -0
  79. package/plugin/skills/frontend/scripts/detect/rules/color/gray-on-color.ts +38 -0
  80. package/plugin/skills/frontend/scripts/detect/rules/color/index.ts +15 -0
  81. package/plugin/skills/frontend/scripts/detect/rules/color/low-contrast.ts +57 -0
  82. package/plugin/skills/frontend/scripts/detect/rules/color/radial-halo.ts +31 -0
  83. package/plugin/skills/frontend/scripts/detect/rules/color/radial-spotlight-glow.ts +33 -0
  84. package/plugin/skills/frontend/scripts/detect/rules/color/support/animation-opacity.ts +78 -0
  85. package/plugin/skills/frontend/scripts/detect/rules/color/support/color-path.ts +15 -0
  86. package/plugin/skills/frontend/scripts/detect/rules/color/support/contrast-pairs.ts +54 -0
  87. package/plugin/skills/frontend/scripts/detect/rules/color/support/contrast-role.ts +76 -0
  88. package/plugin/skills/frontend/scripts/detect/rules/color/support/glow-forms.ts +56 -0
  89. package/plugin/skills/frontend/scripts/detect/rules/color/support/gradient-samples.ts +134 -0
  90. package/plugin/skills/frontend/scripts/detect/rules/color/support/gradients.ts +91 -0
  91. package/plugin/skills/frontend/scripts/detect/rules/color/support/mockup-roots.ts +63 -0
  92. package/plugin/skills/frontend/scripts/detect/rules/color/support/page-ignore.ts +7 -0
  93. package/plugin/skills/frontend/scripts/detect/rules/color/support/painted-text.ts +141 -0
  94. package/plugin/skills/frontend/scripts/detect/rules/color/support/palette-roles.ts +58 -0
  95. package/plugin/skills/frontend/scripts/detect/rules/color/support/placeholder-contrast.ts +25 -0
  96. package/plugin/skills/frontend/scripts/detect/rules/color/support/stock-accent.ts +31 -0
  97. package/plugin/skills/frontend/scripts/detect/rules/color/support/text-colors.ts +80 -0
  98. package/plugin/skills/frontend/scripts/detect/rules/copy/aphoristic-cadence.ts +20 -0
  99. package/plugin/skills/frontend/scripts/detect/rules/copy/broken-image.ts +17 -0
  100. package/plugin/skills/frontend/scripts/detect/rules/copy/em-dash-overuse.ts +46 -0
  101. package/plugin/skills/frontend/scripts/detect/rules/copy/index.ts +15 -0
  102. package/plugin/skills/frontend/scripts/detect/rules/copy/marketing-buzzword.ts +33 -0
  103. package/plugin/skills/frontend/scripts/detect/rules/copy/numbered-section-labels.ts +34 -0
  104. package/plugin/skills/frontend/scripts/detect/rules/copy/repeated-container-text.ts +56 -0
  105. package/plugin/skills/frontend/scripts/detect/rules/copy/script-error.ts +38 -0
  106. package/plugin/skills/frontend/scripts/detect/rules/copy/skipped-heading.ts +81 -0
  107. package/plugin/skills/frontend/scripts/detect/rules/copy/support/numbered-label.ts +94 -0
  108. package/plugin/skills/frontend/scripts/detect/rules/copy/support/page-text.ts +37 -0
  109. package/plugin/skills/frontend/scripts/detect/rules/copy/theater-slop-phrase.ts +21 -0
  110. package/plugin/skills/frontend/scripts/detect/rules/decoration/blinking-cursor.ts +48 -0
  111. package/plugin/skills/frontend/scripts/detect/rules/decoration/border-accent-on-rounded.ts +14 -0
  112. package/plugin/skills/frontend/scripts/detect/rules/decoration/bounce-easing.ts +83 -0
  113. package/plugin/skills/frontend/scripts/detect/rules/decoration/buried-raster.ts +72 -0
  114. package/plugin/skills/frontend/scripts/detect/rules/decoration/codex-grid-background.ts +34 -0
  115. package/plugin/skills/frontend/scripts/detect/rules/decoration/design-system-radius.ts +31 -0
  116. package/plugin/skills/frontend/scripts/detect/rules/decoration/gpt-thin-border-wide-shadow.ts +66 -0
  117. package/plugin/skills/frontend/scripts/detect/rules/decoration/hard-offset-shadow.ts +31 -0
  118. package/plugin/skills/frontend/scripts/detect/rules/decoration/hero-eyebrow-chip.ts +19 -0
  119. package/plugin/skills/frontend/scripts/detect/rules/decoration/icon-tile-stack.ts +92 -0
  120. package/plugin/skills/frontend/scripts/detect/rules/decoration/index.ts +38 -0
  121. package/plugin/skills/frontend/scripts/detect/rules/decoration/kicker-above-heading.ts +69 -0
  122. package/plugin/skills/frontend/scripts/detect/rules/decoration/marquee.ts +51 -0
  123. package/plugin/skills/frontend/scripts/detect/rules/decoration/organic-clip-path.ts +41 -0
  124. package/plugin/skills/frontend/scripts/detect/rules/decoration/pulsing-dot.ts +72 -0
  125. package/plugin/skills/frontend/scripts/detect/rules/decoration/repeating-stripes-gradient.ts +25 -0
  126. package/plugin/skills/frontend/scripts/detect/rules/decoration/shape-assembled-illustration.ts +58 -0
  127. package/plugin/skills/frontend/scripts/detect/rules/decoration/side-tab.ts +17 -0
  128. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/appearance.ts +110 -0
  129. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/assert-cases.ts +25 -0
  130. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/borders.ts +150 -0
  131. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/clip-geometry.ts +151 -0
  132. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/css-candidates.ts +66 -0
  133. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/curve-samples.ts +55 -0
  134. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/gradient-pattern.ts +40 -0
  135. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/keyframes.ts +134 -0
  136. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/labels.ts +85 -0
  137. package/plugin/skills/frontend/scripts/detect/rules/decoration/support/raster-state.ts +51 -0
  138. package/plugin/skills/frontend/scripts/detect/rules/index.ts +16 -0
  139. package/plugin/skills/frontend/scripts/detect/rules/layout/body-text-viewport-edge.ts +62 -0
  140. package/plugin/skills/frontend/scripts/detect/rules/layout/clipped-overflow-container.ts +15 -0
  141. package/plugin/skills/frontend/scripts/detect/rules/layout/content-hidden-at-rest.ts +63 -0
  142. package/plugin/skills/frontend/scripts/detect/rules/layout/cramped-padding.ts +97 -0
  143. package/plugin/skills/frontend/scripts/detect/rules/layout/edge-flush-cards.ts +47 -0
  144. package/plugin/skills/frontend/scripts/detect/rules/layout/first-viewport-column-overflow.ts +43 -0
  145. package/plugin/skills/frontend/scripts/detect/rules/layout/heading-rhythm.ts +30 -0
  146. package/plugin/skills/frontend/scripts/detect/rules/layout/index.ts +21 -0
  147. package/plugin/skills/frontend/scripts/detect/rules/layout/monotonous-spacing.ts +32 -0
  148. package/plugin/skills/frontend/scripts/detect/rules/layout/nested-cards.ts +38 -0
  149. package/plugin/skills/frontend/scripts/detect/rules/layout/straggler.ts +28 -0
  150. package/plugin/skills/frontend/scripts/detect/rules/layout/support/cards.ts +114 -0
  151. package/plugin/skills/frontend/scripts/detect/rules/layout/support/clipping.ts +71 -0
  152. package/plugin/skills/frontend/scripts/detect/rules/layout/support/declared-mockups.ts +46 -0
  153. package/plugin/skills/frontend/scripts/detect/rules/layout/support/geometry.ts +73 -0
  154. package/plugin/skills/frontend/scripts/detect/rules/layout/support/hidden-interface.ts +35 -0
  155. package/plugin/skills/frontend/scripts/detect/rules/layout/support/layout-cases.ts +23 -0
  156. package/plugin/skills/frontend/scripts/detect/rules/layout/support/line-breaks.ts +32 -0
  157. package/plugin/skills/frontend/scripts/detect/rules/layout/support/motion.ts +77 -0
  158. package/plugin/skills/frontend/scripts/detect/rules/layout/support/padding.ts +93 -0
  159. package/plugin/skills/frontend/scripts/detect/rules/layout/support/rhythm.ts +161 -0
  160. package/plugin/skills/frontend/scripts/detect/rules/layout/text-occlusion.ts +84 -0
  161. package/plugin/skills/frontend/scripts/detect/rules/layout/text-overflow.ts +72 -0
  162. package/plugin/skills/frontend/scripts/detect/rules/layout/unbalanced-heading.ts +22 -0
  163. package/plugin/skills/frontend/scripts/detect/rules/layout/viewport-reflow.ts +33 -0
  164. package/plugin/skills/frontend/scripts/detect/rules/source/ai-color-palette.ts +11 -0
  165. package/plugin/skills/frontend/scripts/detect/rules/source/aphoristic-cadence.ts +14 -0
  166. package/plugin/skills/frontend/scripts/detect/rules/source/border-accent-on-rounded.ts +20 -0
  167. package/plugin/skills/frontend/scripts/detect/rules/source/bounce-easing.ts +21 -0
  168. package/plugin/skills/frontend/scripts/detect/rules/source/broken-image.ts +16 -0
  169. package/plugin/skills/frontend/scripts/detect/rules/source/codex-grid-background.ts +18 -0
  170. package/plugin/skills/frontend/scripts/detect/rules/source/dark-glow.ts +21 -0
  171. package/plugin/skills/frontend/scripts/detect/rules/source/em-dash-overuse.ts +15 -0
  172. package/plugin/skills/frontend/scripts/detect/rules/source/gradient-text.ts +11 -0
  173. package/plugin/skills/frontend/scripts/detect/rules/source/gray-on-color.ts +13 -0
  174. package/plugin/skills/frontend/scripts/detect/rules/source/index.ts +19 -0
  175. package/plugin/skills/frontend/scripts/detect/rules/source/marketing-buzzword.ts +17 -0
  176. package/plugin/skills/frontend/scripts/detect/rules/source/marquee.ts +12 -0
  177. package/plugin/skills/frontend/scripts/detect/rules/source/monotonous-spacing.ts +22 -0
  178. package/plugin/skills/frontend/scripts/detect/rules/source/overused-font.ts +16 -0
  179. package/plugin/skills/frontend/scripts/detect/rules/source/radial-halo.ts +14 -0
  180. package/plugin/skills/frontend/scripts/detect/rules/source/side-tab.ts +58 -0
  181. package/plugin/skills/frontend/scripts/detect/rules/source/support/accent-scans.ts +78 -0
  182. package/plugin/skills/frontend/scripts/detect/rules/source/support/check-source.ts +6 -0
  183. package/plugin/skills/frontend/scripts/detect/rules/source/support/corners.ts +105 -0
  184. package/plugin/skills/frontend/scripts/detect/rules/source/support/css-effects.ts +81 -0
  185. package/plugin/skills/frontend/scripts/detect/rules/source/support/css-scopes.ts +131 -0
  186. package/plugin/skills/frontend/scripts/detect/rules/source/support/image-tags.ts +113 -0
  187. package/plugin/skills/frontend/scripts/detect/rules/source/support/js-punctuation.ts +34 -0
  188. package/plugin/skills/frontend/scripts/detect/rules/source/support/markup-scope.ts +44 -0
  189. package/plugin/skills/frontend/scripts/detect/rules/source/support/source-color.ts +42 -0
  190. package/plugin/skills/frontend/scripts/detect/rules/source/support/source-shadow.ts +15 -0
  191. package/plugin/skills/frontend/scripts/detect/rules/source/support/source-text.ts +110 -0
  192. package/plugin/skills/frontend/scripts/detect/rules/typography/all-caps-body.ts +15 -0
  193. package/plugin/skills/frontend/scripts/detect/rules/typography/design-system-font-size.ts +23 -0
  194. package/plugin/skills/frontend/scripts/detect/rules/typography/design-system-font.ts +24 -0
  195. package/plugin/skills/frontend/scripts/detect/rules/typography/extreme-negative-tracking.ts +18 -0
  196. package/plugin/skills/frontend/scripts/detect/rules/typography/flat-type-hierarchy.ts +26 -0
  197. package/plugin/skills/frontend/scripts/detect/rules/typography/index.ts +21 -0
  198. package/plugin/skills/frontend/scripts/detect/rules/typography/italic-serif-display.ts +24 -0
  199. package/plugin/skills/frontend/scripts/detect/rules/typography/justified-text.ts +32 -0
  200. package/plugin/skills/frontend/scripts/detect/rules/typography/line-length.ts +28 -0
  201. package/plugin/skills/frontend/scripts/detect/rules/typography/oversized-h1.ts +20 -0
  202. package/plugin/skills/frontend/scripts/detect/rules/typography/overused-font.ts +45 -0
  203. package/plugin/skills/frontend/scripts/detect/rules/typography/support/drawn-enlargement.ts +48 -0
  204. package/plugin/skills/frontend/scripts/detect/rules/typography/support/fading-text.ts +48 -0
  205. package/plugin/skills/frontend/scripts/detect/rules/typography/support/flex-runs.ts +16 -0
  206. package/plugin/skills/frontend/scripts/detect/rules/typography/support/font-family.ts +28 -0
  207. package/plugin/skills/frontend/scripts/detect/rules/typography/support/painted-text.ts +81 -0
  208. package/plugin/skills/frontend/scripts/detect/rules/typography/support/svg-size.ts +57 -0
  209. package/plugin/skills/frontend/scripts/detect/rules/typography/support/text-context.ts +112 -0
  210. package/plugin/skills/frontend/scripts/detect/rules/typography/support/text-lines.ts +43 -0
  211. package/plugin/skills/frontend/scripts/detect/rules/typography/support/type-hierarchy.ts +48 -0
  212. package/plugin/skills/frontend/scripts/detect/rules/typography/tight-leading.ts +47 -0
  213. package/plugin/skills/frontend/scripts/detect/rules/typography/tiny-text.ts +23 -0
  214. package/plugin/skills/frontend/scripts/detect/rules/typography/undersized-ui-text.ts +28 -0
  215. package/plugin/skills/frontend/scripts/detect/rules/typography/wide-tracking.ts +26 -0
  216. package/plugin/skills/frontend/scripts/detect/snapshot/collect.ts +158 -0
  217. package/plugin/skills/frontend/scripts/detect/snapshot/style-props.ts +25 -0
  218. package/plugin/skills/frontend/scripts/detect/testing/build-snapshot.ts +78 -0
  219. package/plugin/skills/frontend/scripts/detect/tsconfig.json +19 -0
  220. package/plugin/skills/frontend/scripts/detect/types.ts +124 -0
  221. package/plugin/skills/programming/SKILL.md +15 -74
  222. package/plugin/skills/programming/references/go/README.md +1 -1
  223. package/plugin/skills/programming/references/go/bootstrap.md +2 -2
  224. package/plugin/skills/programming/references/python/README.md +4 -4
  225. package/plugin/skills/programming/references/python/one-liners.md +5 -5
  226. package/plugin/skills/programming/references/testing/README.md +82 -0
  227. package/plugin/skills/programming/references/testing/junk-classes.md +56 -0
  228. package/plugin/skills/programming/references/typescript/README.md +1 -2
  229. package/plugin/skills/programming/scripts/go/new-project.ts +197 -0
  230. package/plugin/skills/programming/scripts/python/new-project.ts +231 -0
  231. package/plugin/skills/programming/scripts/python/new-script.ts +134 -0
  232. package/plugin/skills/programming/scripts/rust/new-project.ts +215 -0
  233. package/plugin/skills/programming/scripts/shared/run-tool.ts +19 -0
  234. package/plugin/skills/visual-qa/SKILL.md +12 -1
  235. package/plugin/telemetry-schema.json +97 -1
  236. package/plugin/telemetry-schema.omo-cloud.json +97 -1
  237. package/plugin/skills/programming/scripts/go/new-project.py +0 -138
  238. package/plugin/skills/programming/scripts/python/new-project.py +0 -172
  239. package/plugin/skills/programming/scripts/python/new-script.py +0 -116
  240. package/plugin/skills/programming/scripts/rust/new-project.py +0 -178
Binary file
@@ -3,6 +3,7 @@ import { existsSync, realpathSync } from "node:fs"
3
3
  import { homedir as osHomedir } from "node:os"
4
4
  import { posix, win32 } from "node:path"
5
5
  import { propagateResult, runChild } from "./child-process.js"
6
+ import { privateFdHandoff } from "./private-fds.js"
6
7
 
7
8
  // A bun global install lives under <BUN_ROOT>/install/global/, and `bun add -g` links the launcher
8
9
  // into <BUN_ROOT>/bin. The link TARGET is what identifies the install, so every comparison below
@@ -267,7 +268,8 @@ export async function maybeReexecUnderBun(input) {
267
268
  const target = decision.nodePath ?? decision.bunPath
268
269
  // A hand-off to node is pinned there so the node launch never re-execs the old bun again.
269
270
  const childEnv = decision.nodePath ? { ...process.env, OMO_RUNTIME: "node" } : process.env
270
- if ((input.platform ?? process.platform) !== "win32" && typeof execve === "function") {
271
+ const handoff = privateFdHandoff(childEnv)
272
+ if (handoff === undefined && (input.platform ?? process.platform) !== "win32" && typeof execve === "function") {
271
273
  try {
272
274
  execve(target, [target, input.scriptPath, ...argv.slice(2)], childEnv)
273
275
  return true
@@ -278,7 +280,7 @@ export async function maybeReexecUnderBun(input) {
278
280
  const result = await run(target, [input.scriptPath, ...argv.slice(2)], {
279
281
  stdio: "inherit",
280
282
  windowsHide: true,
281
- ...(decision.nodePath ? { env: childEnv } : {}),
283
+ ...(handoff ?? (decision.nodePath ? { env: childEnv } : {})),
282
284
  })
283
285
  propagate(result)
284
286
  return true
@@ -3,6 +3,7 @@ import { existsSync } from "node:fs"
3
3
  import { join } from "node:path"
4
4
  import { isEngineCommand } from "./engine-commands.js"
5
5
  import { spawnNode } from "./child-process.js"
6
+ import { privateFdHandoff } from "./private-fds.js"
6
7
  import { doctorCoverageLines } from "./category-coverage.js"
7
8
  import { runDoctorModels } from "./model-chains.js"
8
9
  import { doctorComputerUseLines } from "./computer-use-doctor.js"
@@ -52,7 +53,8 @@ async function spawnSenpi(args, withExtension) {
52
53
  : args
53
54
  const env = senpiEnvironment(senpi.packageRoot)
54
55
  if (withExtension) withHerdrAgentHint(env, args)
55
- if (process.platform !== "win32" && typeof process.execve === "function") {
56
+ const handoff = privateFdHandoff(env)
57
+ if (handoff === undefined && process.platform !== "win32" && typeof process.execve === "function") {
56
58
  try {
57
59
  process.execve(process.execPath, [process.execPath, senpi.cliPath, ...finalArgs], env)
58
60
  return
@@ -60,7 +62,7 @@ async function spawnSenpi(args, withExtension) {
60
62
  // A failed replacement still uses the signal-aware child path below.
61
63
  }
62
64
  }
63
- await spawnNode(senpi.cliPath, finalArgs, { env })
65
+ await spawnNode(senpi.cliPath, finalArgs, handoff ?? { env })
64
66
  }
65
67
 
66
68
  // Routine launch notices go straight to stderr: Bun renders every console.error line red on a
@@ -0,0 +1,65 @@
1
+ import { fstatSync } from "node:fs"
2
+
3
+ // senpi#4749: SENPI_PRIVATE_FDS maps each channel name to an inherited descriptor or null. Measured on
4
+ // Node 24/26 and Bun 1.4: process.execve does not keep inherited descriptors in the new image (all four
5
+ // hop/target pairs), and Node on Linux leaks descriptors from 24 up into every child while every runtime
6
+ // marks 5..21 close-on-exec at startup. So a launch that carries a table always reaches the engine as a
7
+ // child whose stdio lists the descriptors it forwards, and only an unshared socket in 5..15 that is not
8
+ // the runtime's own IPC channel is forwarded. Every other entry still travels as null, so the engine
9
+ // keeps the name declared (never a CLI fallback). Windows forwards declarations only.
10
+ export const PRIVATE_FDS_ENV = "SENPI_PRIVATE_FDS"
11
+ const ADOPTABLE_MAX = 15
12
+
13
+ function ipcDescriptor() {
14
+ const channel = process.channel
15
+ if (typeof channel !== "object" || channel === null) return null
16
+ return typeof channel.fd === "number" ? channel.fd : undefined
17
+ }
18
+
19
+ function isSocket(fd) {
20
+ try {
21
+ return fstatSync(fd).isSocket()
22
+ } catch {
23
+ return false
24
+ }
25
+ }
26
+
27
+ /** The table to hand on, the descriptors it forwards, and named sockets this process must close. */
28
+ export function inspectPrivateFdTable(table, platform = process.platform) {
29
+ let value
30
+ try {
31
+ value = JSON.parse(table)
32
+ } catch {
33
+ return { table, fds: [], discard: [] }
34
+ }
35
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return { table, fds: [], discard: [] }
36
+ const ipc = ipcDescriptor()
37
+ const counts = new Map()
38
+ for (const fd of Object.values(value)) counts.set(fd, (counts.get(fd) ?? 0) + 1)
39
+ const forwarded = {}
40
+ const fds = []
41
+ const discard = []
42
+ for (const [name, fd] of Object.entries(value)) {
43
+ forwarded[name] = null
44
+ const inRange = Number.isSafeInteger(fd) && fd >= 5 && fd <= 64
45
+ if (!inRange || platform === "win32" || ipc === undefined || fd === ipc || !isSocket(fd)) continue
46
+ if (counts.get(fd) > 1 || fd > ADOPTABLE_MAX) discard.push(fd)
47
+ else {
48
+ forwarded[name] = fd
49
+ fds.push(fd)
50
+ }
51
+ }
52
+ return { table: JSON.stringify(forwarded), fds, discard: [...new Set(discard)] }
53
+ }
54
+
55
+ /** Child-spawn options that carry this launch's table and descriptors, or undefined when it has no table. */
56
+ export function privateFdHandoffFor(env, table, platform = process.platform) {
57
+ if (!table) return undefined
58
+ const inspected = inspectPrivateFdTable(table, platform)
59
+ const stdio = ["inherit", "inherit", "inherit"]
60
+ for (const fd of inspected.fds) {
61
+ while (stdio.length <= fd) stdio.push("ignore")
62
+ stdio[fd] = fd
63
+ }
64
+ return { env: { ...env, [PRIVATE_FDS_ENV]: inspected.table }, stdio }
65
+ }
@@ -0,0 +1,12 @@
1
+ import { closeSync } from "node:fs"
2
+ import { inspectPrivateFdTable, PRIVATE_FDS_ENV, privateFdHandoffFor } from "./private-fd-table.js"
3
+
4
+ // The npm launcher captures the table before anything spawns, so its helper children never see it,
5
+ // and closes named sockets it can never forward so no child inherits them.
6
+ const table = process.env[PRIVATE_FDS_ENV]
7
+ delete process.env[PRIVATE_FDS_ENV]
8
+ if (table) for (const fd of inspectPrivateFdTable(table).discard) closeSync(fd)
9
+
10
+ export function privateFdHandoff(env) {
11
+ return privateFdHandoffFor(env, table)
12
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "_comment": "Derived from @code-yeongyu/senpi 2026.10.27-1 builtinProviders(). builtinProviderIds and oauthProviderIds are the engine registry verbatim; providers maps a source harness id onto the omo provider that serves the same endpoint; oauthLogins maps a source OAuth id onto the omo provider to run /login for. Re-derive all four whenever the senpi pin changes.",
2
+ "_comment": "Derived from @code-yeongyu/senpi 2026.10.30-1 builtinProviders(). builtinProviderIds and oauthProviderIds are the engine registry verbatim; providers maps a source harness id onto the omo provider that serves the same endpoint; oauthLogins maps a source OAuth id onto the omo provider to run /login for. Re-derive all four whenever the senpi pin changes.",
3
3
  "builtinProviderIds": [
4
4
  "alibaba-token-plan",
5
5
  "amazon-bedrock",