omo-ai 5.1.54 → 5.1.56

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 (58) hide show
  1. package/bin/darwin/omo-keychain +0 -0
  2. package/bin/lib/child-process.js +22 -8
  3. package/bin/lib/engine-prepare.js +0 -2
  4. package/bin/lib/launcher.js +7 -0
  5. package/bin/lib/private-fd-table.js +57 -8
  6. package/bin/lib/private-fds.js +2 -1
  7. package/bin/lib/remote-attach-launch.js +15 -0
  8. package/bin/lib/service-auth.generated.js +69 -1
  9. package/bin/lib/setup-commandcode.js +98 -0
  10. package/bin/lib/setup-guidance.js +11 -0
  11. package/bin/lib/setup-providers-import.js +1 -1
  12. package/bin/lib/setup-stream.js +4 -2
  13. package/bin/lib/setup-summary.js +10 -1
  14. package/bin/omo.js +18 -1
  15. package/package.json +1 -1
  16. package/plugin/CHANGELOG.md +66 -0
  17. package/plugin/extensions/assets.generated.json +1 -1
  18. package/plugin/extensions/gateway-store-worker.mjs +1 -1
  19. package/plugin/extensions/memory-run-supervisor.mjs +3 -3
  20. package/plugin/extensions/omo-claim-receipt.js +1 -1
  21. package/plugin/extensions/omo-computer-use.js +1 -1
  22. package/plugin/extensions/omo-desktop-toolkit.js +2 -2
  23. package/plugin/extensions/omo-device-account.js +2 -2
  24. package/plugin/extensions/omo-feedback.js +2 -2
  25. package/plugin/extensions/omo-init-deep-advisor.js +1 -1
  26. package/plugin/extensions/omo-member.js +2 -2
  27. package/plugin/extensions/omo-memory-commands.js +3 -3
  28. package/plugin/extensions/omo-memory-doctor.js +3 -3
  29. package/plugin/extensions/omo-memory-memfs.js +3 -3
  30. package/plugin/extensions/omo-memory-palace.js +3 -3
  31. package/plugin/extensions/omo-memory-sync.js +2 -2
  32. package/plugin/extensions/omo-onboarding-scan.js +3 -3
  33. package/plugin/extensions/omo-recall-store.js +1 -1
  34. package/plugin/extensions/omo-session-history.js +1 -1
  35. package/plugin/extensions/omo-side-panel.js +2 -2
  36. package/plugin/extensions/omo-task.js +2 -2
  37. package/plugin/extensions/omo-telemetry-otlp.js +2 -2
  38. package/plugin/extensions/omo-telemetry-posthog.js +1 -1
  39. package/plugin/extensions/omo-telemetry-recovery.js +1 -1
  40. package/plugin/extensions/omo-thread-client.js +1 -1
  41. package/plugin/extensions/omo.js +3 -3
  42. package/plugin/package.json +1 -1
  43. package/plugin/runtime/agent-toolkit-sdk/sdk.js +2 -2
  44. package/plugin/runtime/ast-grep-mcp/manifest.json +1 -1
  45. package/plugin/runtime/category-coverage/assets.generated.json +1 -1
  46. package/plugin/runtime/category-coverage/index.js +3 -3
  47. package/plugin/runtime/rollback-migrate.js +2 -2
  48. package/plugin/runtime/task-config/index.js +1 -1
  49. package/plugin/runtime/thread-sdk/sdk.js +2 -2
  50. package/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  51. package/plugin/skills/programming/SKILL.md +2 -0
  52. package/plugin/skills/programming/references/testing/README.md +2 -2
  53. package/plugin/skills/programming/scripts/typescript/check-test-junk-rules.ts +140 -0
  54. package/plugin/skills/programming/scripts/typescript/check-test-junk.ts +148 -0
  55. package/plugin/skills/programming/scripts/typescript/mutation-proof.ts +179 -0
  56. package/plugin/skills/remove-ai-slops/SKILL.md +32 -20
  57. package/plugin/skills/ulw-research/scripts/source-commands.mjs +3 -1
  58. package/bin/lib/claude-code-floor.js +0 -57
Binary file
@@ -1,5 +1,6 @@
1
1
  import { spawn } from "node:child_process"
2
2
  import { StringDecoder } from "node:string_decoder"
3
+ import { PRIVATE_FDS_ENV, privateFdHandoffFor } from "./private-fd-table.js"
3
4
 
4
5
  // POSIX launchers prefer execve and leave no wrapper. This async fallback remains for Windows
5
6
  // and missing/failed execve.
@@ -47,16 +48,29 @@ export function propagateResult(result) {
47
48
  * would terminate the child abruptly, so nothing is forwarded and the wait is the whole behavior.
48
49
  */
49
50
  export function runChild(command, args, options = {}) {
50
- const { captureStderr = false, ...spawnOptions } = options
51
+ const { captureStderr = false, onSpawn, ...spawnOptions } = options
51
52
  const env = spawnOptions.env ?? process.env
53
+ const shellHandoff = spawnOptions.shell
54
+ ? privateFdHandoffFor(env, env[PRIVATE_FDS_ENV], process.platform, { shell: true })
55
+ : undefined
56
+ const baseStdio = shellHandoff?.stdio ?? spawnOptions.stdio ?? "inherit"
57
+ const capturedStdio = typeof baseStdio === "string" ? [baseStdio, baseStdio, "pipe"] : [...baseStdio]
58
+ capturedStdio[2] = "pipe"
52
59
  return new Promise((resolve, reject) => {
53
- const child = spawn(command, args, {
54
- stdio: "inherit",
55
- windowsHide: true,
56
- ...spawnOptions,
57
- // A captured stderr is still shown live; the caller also gets its tail to classify the failure.
58
- ...(captureStderr ? { stdio: ["inherit", "inherit", "pipe"] } : {}),
59
- })
60
+ let child
61
+ try {
62
+ child = spawn(command, args, {
63
+ stdio: "inherit",
64
+ windowsHide: true,
65
+ ...spawnOptions,
66
+ ...(shellHandoff ? { env: shellHandoff.env, stdio: shellHandoff.stdio } : {}),
67
+ // A captured stderr is still shown live; the caller also gets its tail to classify the failure.
68
+ ...(captureStderr ? { stdio: capturedStdio } : {}),
69
+ })
70
+ } finally {
71
+ const closeOwned = onSpawn ?? shellHandoff?.onSpawn
72
+ closeOwned?.()
73
+ }
60
74
  let stderr = ""
61
75
  if (captureStderr) {
62
76
  // The decoder keeps a multi-byte character split across chunks whole; the echo stays raw bytes.
@@ -1,6 +1,5 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from "node:fs"
2
2
  import { join } from "node:path"
3
- import { floorClaudeCodeVersion } from "./claude-code-floor.js"
4
3
  import { prepareCompileSafeEngine } from "./compile-safe-engine.js"
5
4
  import { LAUNCH_SPEC_FILENAME, normalizeLaunchSpecMode } from "./launch-spec-mode.js"
6
5
  import { prepareRpcStreamErrors } from "./rpc-stream-errors.js"
@@ -9,7 +8,6 @@ import { prepareRpcStreamErrors } from "./rpc-stream-errors.js"
9
8
  export const ENGINE_PREPARED_STAMP = ".omo-engine-prepared"
10
9
 
11
10
  export function prepareInstalledEngine(senpiRoot) {
12
- floorClaudeCodeVersion(senpiRoot)
13
11
  prepareCompileSafeEngine(senpiRoot)
14
12
  prepareRpcStreamErrors(senpiRoot)
15
13
  }
@@ -65,6 +65,13 @@ async function spawnSenpi(args, withExtension) {
65
65
  await spawnNode(senpi.cliPath, finalArgs, handoff ?? { env })
66
66
  }
67
67
 
68
+ // `omo remote attach`: the engine's attach TUI runs as a signal-forwarding child, never an execve replacement,
69
+ // because this process serves the endpoint the TUI is attached to until the TUI exits.
70
+ export async function runAttachTui(args) {
71
+ const senpi = preparedSenpi()
72
+ await spawnNode(senpi.cliPath, args, { env: senpiEnvironment(senpi.packageRoot) })
73
+ }
74
+
68
75
  // Routine launch notices go straight to stderr: Bun renders every console.error line red on a
69
76
  // color terminal, which made a healthy startup look like a failure (#8442).
70
77
  function notice(line) {
@@ -1,4 +1,4 @@
1
- import { fstatSync } from "node:fs"
1
+ import { closeSync, fstatSync } from "node:fs"
2
2
 
3
3
  // senpi#4749: SENPI_PRIVATE_FDS maps each channel name to an inherited descriptor or null. Measured on
4
4
  // Node 24/26 and Bun 1.4: process.execve does not keep inherited descriptors in the new image (all four
@@ -6,7 +6,8 @@ import { fstatSync } from "node:fs"
6
6
  // marks 5..21 close-on-exec at startup. So a launch that carries a table always reaches the engine as a
7
7
  // child whose stdio lists the descriptors it forwards, and only an unshared socket in 5..15 that is not
8
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.
9
+ // keeps the name declared (never a CLI fallback). Windows instead carries two distinct pipe halves
10
+ // in 5..64, atomically, on their original stdio slots (#11955). senpi owns receipt-side inherit clearing.
10
11
  export const PRIVATE_FDS_ENV = "SENPI_PRIVATE_FDS"
11
12
  const ADOPTABLE_MAX = 15
12
13
 
@@ -24,6 +25,23 @@ function isSocket(fd) {
24
25
  }
25
26
  }
26
27
 
28
+ function inRange(fd) {
29
+ return Number.isSafeInteger(fd) && fd >= 5 && fd <= 64
30
+ }
31
+
32
+ // Node and Bun on Windows report an anonymous pipe with mode S_IFIFO (0o010000), but Stats.isFIFO()
33
+ // returns false there because the platform defines no S_IFIFO constant. Compare the file-type bits directly.
34
+ const S_IFMT = 0o170000
35
+ const S_IFIFO = 0o010000
36
+
37
+ function isPipe(fd) {
38
+ try {
39
+ return (fstatSync(fd).mode & S_IFMT) === S_IFIFO
40
+ } catch {
41
+ return false
42
+ }
43
+ }
44
+
27
45
  /** The table to hand on, the descriptors it forwards, and named sockets this process must close. */
28
46
  export function inspectPrivateFdTable(table, platform = process.platform) {
29
47
  let value
@@ -35,14 +53,32 @@ export function inspectPrivateFdTable(table, platform = process.platform) {
35
53
  if (typeof value !== "object" || value === null || Array.isArray(value)) return { table, fds: [], discard: [] }
36
54
  const ipc = ipcDescriptor()
37
55
  const counts = new Map()
38
- for (const fd of Object.values(value)) counts.set(fd, (counts.get(fd) ?? 0) + 1)
56
+ for (const fd of Object.values(value)) {
57
+ // Preserve #11786's POSIX alias behavior. On Windows even a malformed third half
58
+ // participates, so it cannot alias another name's otherwise valid pair.
59
+ const descriptors = platform === "win32" && Array.isArray(fd) ? fd : [fd]
60
+ for (const descriptor of descriptors) counts.set(descriptor, (counts.get(descriptor) ?? 0) + 1)
61
+ }
39
62
  const forwarded = {}
40
63
  const fds = []
41
64
  const discard = []
42
65
  for (const [name, fd] of Object.entries(value)) {
43
66
  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
67
+ if (platform === "win32") {
68
+ const usable = Array.isArray(fd) && fd.length === 2 && fd.every(inRange) && fd[0] !== fd[1] &&
69
+ ipc !== undefined && !fd.some(descriptor => descriptor === ipc || counts.get(descriptor) > 1) && fd.every(isPipe)
70
+ if (usable) {
71
+ forwarded[name] = fd
72
+ fds.push(...fd)
73
+ } else if (ipc !== undefined) {
74
+ // Like POSIX, a refused entry's open pipes are closed so the hop never keeps them.
75
+ for (const descriptor of Array.isArray(fd) ? fd : [fd]) {
76
+ if (inRange(descriptor) && descriptor !== ipc && isPipe(descriptor)) discard.push(descriptor)
77
+ }
78
+ }
79
+ continue
80
+ }
81
+ if (!inRange(fd) || ipc === undefined || fd === ipc || !isSocket(fd)) continue
46
82
  if (counts.get(fd) > 1 || fd > ADOPTABLE_MAX) discard.push(fd)
47
83
  else {
48
84
  forwarded[name] = fd
@@ -53,13 +89,26 @@ export function inspectPrivateFdTable(table, platform = process.platform) {
53
89
  }
54
90
 
55
91
  /** 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) {
92
+ export function privateFdHandoffFor(env, table, platform = process.platform, { shell = false } = {}) {
57
93
  if (!table) return undefined
58
94
  const inspected = inspectPrivateFdTable(table, platform)
59
95
  const stdio = ["inherit", "inherit", "inherit"]
60
- for (const fd of inspected.fds) {
96
+ for (const fd of shell ? [] : inspected.fds) {
61
97
  while (stdio.length <= fd) stdio.push("ignore")
62
98
  stdio[fd] = fd
63
99
  }
64
- return { env: { ...env, [PRIVATE_FDS_ENV]: inspected.table }, stdio }
100
+ const forwarded = shell && inspected.fds.length > 0
101
+ ? JSON.stringify(Object.fromEntries(Object.keys(JSON.parse(inspected.table)).map(name => [name, null])))
102
+ : inspected.table
103
+ return {
104
+ env: { ...env, [PRIVATE_FDS_ENV]: forwarded },
105
+ stdio,
106
+ // Unlike POSIX's protected sockets, Windows pipes must not remain in the waiting parent.
107
+ // runChild invokes this immediately after spawn, including a synchronous spawn failure.
108
+ ...(platform === "win32" && inspected.fds.length > 0 ? {
109
+ onSpawn() {
110
+ for (const fd of inspected.fds) closeSync(fd)
111
+ },
112
+ } : {}),
113
+ }
65
114
  }
@@ -2,7 +2,8 @@ import { closeSync } from "node:fs"
2
2
  import { inspectPrivateFdTable, PRIVATE_FDS_ENV, privateFdHandoffFor } from "./private-fd-table.js"
3
3
 
4
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.
5
+ // and closes named sockets it can never forward so no child inherits them. Windows pairs are
6
+ // transferred on explicit hops only; their waiting parent's copies close immediately after spawn.
6
7
  const table = process.env[PRIVATE_FDS_ENV]
7
8
  delete process.env[PRIVATE_FDS_ENV]
8
9
  if (table) for (const fd of inspectPrivateFdTable(table).discard) closeSync(fd)
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `omo remote attach` holds a device-service connection and a local endpoint open while the engine's
3
+ * attach TUI runs. The launcher therefore leaves through `exit` on every path: a TUI that cannot start
4
+ * (missing engine, spawn error) would otherwise leave both open, and the command would never return.
5
+ */
6
+ export async function runRemoteAttachLaunch({ prepare, runTui, reportError, exit }) {
7
+ try {
8
+ const engineArgs = await prepare()
9
+ if (engineArgs) await runTui(engineArgs)
10
+ } catch (error) {
11
+ reportError(error)
12
+ } finally {
13
+ exit()
14
+ }
15
+ }