oh-my-opencode 5.1.81 → 5.1.83

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 (112) hide show
  1. package/dist/cli/index.js +443 -276
  2. package/dist/cli-node/index.js +443 -276
  3. package/dist/hooks/claude-code-hooks/handlers/empty-hook-config.fixture.d.ts +1 -0
  4. package/dist/index.js +650 -431
  5. package/dist/shared/opencode-message-dir.d.ts +1 -1
  6. package/dist/skills/browser/references/owned-engine/README.md +4 -2
  7. package/dist/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
  8. package/dist/skills/browser/runtime/omowright/index.js +8 -8
  9. package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
  10. package/dist/skills/frontend/SKILL.md +4 -2
  11. package/dist/skills/frontend/references/perfection/state-and-flow.md +120 -0
  12. package/dist/skills/visual-qa/AGENTS.md +2 -1
  13. package/dist/skills/visual-qa/SKILL.md +43 -11
  14. package/dist/skills/visual-qa/references/behaviour-evidence.md +189 -0
  15. package/dist/tui.js +15 -15
  16. package/package.json +15 -15
  17. package/packages/lsp-core/src/lsp/client-key.ts +14 -0
  18. package/packages/lsp-core/src/lsp/client-startup.ts +139 -0
  19. package/packages/lsp-core/src/lsp/client-wrapper.ts +4 -4
  20. package/packages/lsp-core/src/lsp/config-loader.ts +15 -0
  21. package/packages/lsp-core/src/lsp/directory-diagnostics-group-scan.test.ts +388 -0
  22. package/packages/lsp-core/src/lsp/directory-diagnostics-mixed-typescript.test.ts +124 -0
  23. package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +4 -4
  24. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +38 -41
  25. package/packages/lsp-core/src/lsp/directory-group-scan.ts +124 -0
  26. package/packages/lsp-core/src/lsp/directory-server-groups.ts +84 -0
  27. package/packages/lsp-core/src/lsp/manager-acquisition.test.ts +115 -0
  28. package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +9 -9
  29. package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +41 -16
  30. package/packages/lsp-core/src/lsp/manager-reaping.test.ts +119 -0
  31. package/packages/lsp-core/src/lsp/manager-test-support.ts +108 -0
  32. package/packages/lsp-core/src/lsp/manager.ts +80 -249
  33. package/packages/lsp-core/src/lsp/native-typescript.ts +88 -0
  34. package/packages/lsp-core/src/lsp/server-installation.ts +15 -7
  35. package/packages/lsp-core/src/lsp/server-resolution-typescript-native.test.ts +327 -0
  36. package/packages/lsp-core/src/lsp/server-resolution.ts +28 -2
  37. package/packages/lsp-core/src/lsp/timer-provider.ts +17 -0
  38. package/packages/lsp-core/src/lsp/typescript-project-test-support.ts +52 -0
  39. package/packages/lsp-daemon/dist/cli.js +486 -310
  40. package/packages/lsp-daemon/dist/client.js +472 -296
  41. package/packages/lsp-daemon/dist/index.js +476 -300
  42. package/packages/lsp-tools-mcp/dist/cli.js +467 -291
  43. package/packages/lsp-tools-mcp/dist/lsp/manager.js +160 -193
  44. package/packages/lsp-tools-mcp/dist/mcp.js +467 -291
  45. package/packages/lsp-tools-mcp/dist/tools.js +467 -291
  46. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  47. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  48. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  49. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  50. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  51. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  52. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  54. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  56. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +478 -313
  57. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  58. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  59. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  60. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  61. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  62. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  63. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  64. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  65. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  66. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  67. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  68. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  69. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  70. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  71. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  72. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  73. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  92. package/packages/omo-codex/plugin/package-lock.json +12 -12
  93. package/packages/omo-codex/plugin/package.json +1 -1
  94. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +4 -2
  95. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
  96. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +8 -8
  97. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
  98. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +4 -2
  99. package/packages/omo-codex/plugin/skills/frontend/references/perfection/state-and-flow.md +120 -0
  100. package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +2 -1
  101. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +43 -11
  102. package/packages/omo-codex/plugin/skills/visual-qa/references/behaviour-evidence.md +189 -0
  103. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  104. package/packages/shared-skills/skills/browser/references/owned-engine/README.md +4 -2
  105. package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
  106. package/packages/shared-skills/skills/browser/runtime/omowright/index.js +8 -8
  107. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
  108. package/packages/shared-skills/skills/frontend/SKILL.md +4 -2
  109. package/packages/shared-skills/skills/frontend/references/perfection/state-and-flow.md +120 -0
  110. package/packages/shared-skills/skills/visual-qa/AGENTS.md +2 -1
  111. package/packages/shared-skills/skills/visual-qa/SKILL.md +43 -11
  112. package/packages/shared-skills/skills/visual-qa/references/behaviour-evidence.md +189 -0
package/dist/cli/index.js CHANGED
@@ -2132,7 +2132,7 @@ var package_default;
2132
2132
  var init_package = __esm(() => {
2133
2133
  package_default = {
2134
2134
  name: "oh-my-opencode",
2135
- version: "5.1.81",
2135
+ version: "5.1.83",
2136
2136
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2137
2137
  main: "./dist/index.js",
2138
2138
  types: "dist/index.d.ts",
@@ -2332,7 +2332,7 @@ var init_package = __esm(() => {
2332
2332
  },
2333
2333
  devDependencies: {
2334
2334
  "@clack/prompts": "^1.8.1",
2335
- "@code-yeongyu/senpi": "2026.11.19-5",
2335
+ "@code-yeongyu/senpi": "2026.11.23",
2336
2336
  "@modelcontextprotocol/sdk": "^1.30.0",
2337
2337
  "@oh-my-opencode/agents-md-core": "workspace:*",
2338
2338
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2396,7 +2396,7 @@ var init_package = __esm(() => {
2396
2396
  "jsonc-parser": "^3.3.1",
2397
2397
  knip: "6.43.0",
2398
2398
  "node-pty": "^1.1.0",
2399
- omowright: "^0.3.1",
2399
+ omowright: "^0.3.2",
2400
2400
  "oxc-parser": "0.148.0",
2401
2401
  oxlint: "1.89.0",
2402
2402
  picocolors: "^1.1.1",
@@ -2406,18 +2406,18 @@ var init_package = __esm(() => {
2406
2406
  typescript: "^7.0.2"
2407
2407
  },
2408
2408
  optionalDependencies: {
2409
- "oh-my-opencode-darwin-arm64": "5.1.81",
2410
- "oh-my-opencode-darwin-x64": "5.1.81",
2411
- "oh-my-opencode-darwin-x64-baseline": "5.1.81",
2412
- "oh-my-opencode-linux-arm64": "5.1.81",
2413
- "oh-my-opencode-linux-arm64-musl": "5.1.81",
2414
- "oh-my-opencode-linux-x64": "5.1.81",
2415
- "oh-my-opencode-linux-x64-baseline": "5.1.81",
2416
- "oh-my-opencode-linux-x64-musl": "5.1.81",
2417
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.81",
2418
- "oh-my-opencode-windows-arm64": "5.1.81",
2419
- "oh-my-opencode-windows-x64": "5.1.81",
2420
- "oh-my-opencode-windows-x64-baseline": "5.1.81"
2409
+ "oh-my-opencode-darwin-arm64": "5.1.83",
2410
+ "oh-my-opencode-darwin-x64": "5.1.83",
2411
+ "oh-my-opencode-darwin-x64-baseline": "5.1.83",
2412
+ "oh-my-opencode-linux-arm64": "5.1.83",
2413
+ "oh-my-opencode-linux-arm64-musl": "5.1.83",
2414
+ "oh-my-opencode-linux-x64": "5.1.83",
2415
+ "oh-my-opencode-linux-x64-baseline": "5.1.83",
2416
+ "oh-my-opencode-linux-x64-musl": "5.1.83",
2417
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.83",
2418
+ "oh-my-opencode-windows-arm64": "5.1.83",
2419
+ "oh-my-opencode-windows-x64": "5.1.83",
2420
+ "oh-my-opencode-windows-x64-baseline": "5.1.83"
2421
2421
  },
2422
2422
  overrides: {
2423
2423
  hono: "^4.13.8",
@@ -67814,20 +67814,20 @@ var init_hook_message_injector = __esm(() => {
67814
67814
  // packages/omo-opencode/src/shared/opencode-message-dir.ts
67815
67815
  import { existsSync as existsSync12, readdirSync as readdirSync3 } from "fs";
67816
67816
  import { join as join14 } from "path";
67817
- function getMessageDir(sessionID) {
67817
+ function getMessageDir(sessionID, messageStorage = MESSAGE_STORAGE) {
67818
67818
  if (!sessionID.startsWith("ses_"))
67819
67819
  return null;
67820
67820
  if (/[/\\]|\.\./.test(sessionID))
67821
67821
  return null;
67822
- if (!existsSync12(MESSAGE_STORAGE))
67822
+ if (!existsSync12(messageStorage))
67823
67823
  return null;
67824
- const directPath = join14(MESSAGE_STORAGE, sessionID);
67824
+ const directPath = join14(messageStorage, sessionID);
67825
67825
  if (existsSync12(directPath)) {
67826
67826
  return directPath;
67827
67827
  }
67828
67828
  try {
67829
- for (const dir of readdirSync3(MESSAGE_STORAGE)) {
67830
- const sessionPath = join14(MESSAGE_STORAGE, dir, sessionID);
67829
+ for (const dir of readdirSync3(messageStorage)) {
67830
+ const sessionPath = join14(messageStorage, dir, sessionID);
67831
67831
  if (existsSync12(sessionPath)) {
67832
67832
  return sessionPath;
67833
67833
  }
@@ -92950,7 +92950,7 @@ var package_default2;
92950
92950
  var init_package2 = __esm(() => {
92951
92951
  package_default2 = {
92952
92952
  name: "@oh-my-opencode/omo-codex",
92953
- version: "5.1.81",
92953
+ version: "5.1.83",
92954
92954
  type: "module",
92955
92955
  private: true,
92956
92956
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -93949,7 +93949,7 @@ var init_update_toasts = __esm(() => {
93949
93949
  });
93950
93950
 
93951
93951
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
93952
- import { existsSync as existsSync50 } from "fs";
93952
+ import { existsSync as existsSync49 } from "fs";
93953
93953
  import { dirname as dirname36, join as join87 } from "path";
93954
93954
  import { fileURLToPath as fileURLToPath5 } from "url";
93955
93955
  function defaultGetModuleHostingWorkspace() {
@@ -94109,7 +94109,7 @@ var init_background_update_check = __esm(() => {
94109
94109
  init_semver_compare();
94110
94110
  init_update_toasts();
94111
94111
  defaultDeps4 = {
94112
- existsSync: existsSync50,
94112
+ existsSync: existsSync49,
94113
94113
  join: join87,
94114
94114
  runBunInstallWithDetails,
94115
94115
  log: log2,
@@ -94197,6 +94197,7 @@ var init_errors4 = __esm(() => {
94197
94197
  candidates;
94198
94198
  incomplete;
94199
94199
  sign_in_reason;
94200
+ insecure_cause;
94200
94201
  constructor(code, reason, extra = {}) {
94201
94202
  super(`${code}: ${reason}`);
94202
94203
  this.name = "LocalApiError";
@@ -94215,6 +94216,8 @@ var init_errors4 = __esm(() => {
94215
94216
  this.incomplete = extra.incomplete;
94216
94217
  if (extra.sign_in_reason !== undefined)
94217
94218
  this.sign_in_reason = extra.sign_in_reason;
94219
+ if (extra.insecure_cause !== undefined)
94220
+ this.insecure_cause = extra.insecure_cause;
94218
94221
  }
94219
94222
  };
94220
94223
  });
@@ -94288,20 +94291,43 @@ var init_proof = __esm(() => {
94288
94291
  init_errors4();
94289
94292
  });
94290
94293
 
94291
- // packages/device-service-core/src/local-api/dacl.ts
94294
+ // packages/device-service-core/src/local-api/powershell.ts
94292
94295
  import { spawn as spawn6 } from "child_process";
94293
- var runPowerShell = async (script, env) => {
94296
+ var inheritedEnv = () => Object.fromEntries(Object.entries(process.env).filter(([name]) => name.toUpperCase() !== "PSMODULEPATH")), runPowerShell = async (script, env) => {
94294
94297
  const encoded = Buffer.from(script, "utf16le").toString("base64");
94295
- const proc = spawn6("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded], { env: { ...process.env, ...env }, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
94298
+ const proc = spawn6("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded], { env: { ...inheritedEnv(), ...env }, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
94296
94299
  const chunks = [];
94300
+ const errChunks = [];
94297
94301
  proc.stdout.on("data", (chunk) => chunks.push(chunk));
94298
- proc.stderr.resume();
94302
+ proc.stderr.on("data", (chunk) => errChunks.push(chunk));
94299
94303
  const code = await new Promise((resolve, reject) => {
94300
94304
  proc.once("error", reject);
94301
94305
  proc.once("close", (exitCode) => resolve(exitCode ?? -1));
94302
94306
  });
94303
- return { code, out: new TextDecoder().decode(Buffer.concat(chunks)) };
94304
- }, APPLY_DACL_SCRIPT, DESCRIBE_DACL_SCRIPT, CURRENT_USER_SID_SCRIPT = "[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value", ACE_TYPES, DACL_FLAG, SID_TOKEN, aceEnd = (text, start) => {
94307
+ const decoder = new TextDecoder;
94308
+ return {
94309
+ code,
94310
+ out: decoder.decode(Buffer.concat(chunks)),
94311
+ err: decoder.decode(Buffer.concat(errChunks))
94312
+ };
94313
+ }, XML_ENTITIES, clixmlText = (line) => [...line.matchAll(/<S(?: S="[^"]*")?>([^<]*)<\/S>/g)].map((match) => match[1] ?? "").join("").replace(/_x([0-9A-Fa-f]{4})_/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(/&(lt|gt|quot|apos|amp);/g, (_, entity) => XML_ENTITIES[entity] ?? ""), POSITION_LINE, MAX_CHARS = 300, powerShellError = (err) => {
94314
+ const lines = (err ?? "").split(/\r?\n/).filter((text) => !text.trim().startsWith("#< CLIXML")).flatMap((text) => text.trim().startsWith("<") ? clixmlText(text).split(/\r?\n/) : [text]).map((text) => text.trim()).filter((text) => text !== "");
94315
+ const end = lines.findIndex((text) => POSITION_LINE.test(text));
94316
+ return lines.slice(0, end === -1 ? lines.length : end).join(" ").slice(0, MAX_CHARS);
94317
+ };
94318
+ var init_powershell = __esm(() => {
94319
+ XML_ENTITIES = {
94320
+ lt: "<",
94321
+ gt: ">",
94322
+ quot: '"',
94323
+ apos: "'",
94324
+ amp: "&"
94325
+ };
94326
+ POSITION_LINE = /^(?:At line:\d|At .*char:\d|\+ )/;
94327
+ });
94328
+
94329
+ // packages/device-service-core/src/local-api/dacl.ts
94330
+ var APPLY_DACL_SCRIPT, DESCRIBE_DACL_SCRIPT, CURRENT_USER_SID_SCRIPT = "[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value", ACE_TYPES, DACL_FLAG, SID_TOKEN, aceEnd = (text, start) => {
94305
94331
  let depth = 0;
94306
94332
  for (let i = start;i < text.length; i += 1) {
94307
94333
  if (text[i] === '"') {
@@ -94367,19 +94393,35 @@ var runPowerShell = async (script, env) => {
94367
94393
  const { code, out } = await run(CURRENT_USER_SID_SCRIPT, {});
94368
94394
  const sid = out.trim();
94369
94395
  if (code !== 0 || !/^S-1-[0-9-]+$/.test(sid))
94370
- throw new LocalApiError("insecure_state_dir", "the user SID is unreadable");
94396
+ throw new LocalApiError("insecure_state_dir", "the user SID is unreadable", {
94397
+ insecure_cause: "unreadable"
94398
+ });
94371
94399
  return sid;
94400
+ }, applyExactDacl = async (path, userSid, kind, run = runPowerShell) => {
94401
+ const { code, err } = await run(APPLY_DACL_SCRIPT, {
94402
+ LA_PATH: path,
94403
+ LA_SID: userSid,
94404
+ LA_KIND: kind
94405
+ });
94406
+ if (code !== 0) {
94407
+ const line = powerShellError(err);
94408
+ throw new LocalApiError("insecure_state_dir", `the exact DACL could not be applied${line === "" ? "" : `: ${line}`}`, { insecure_cause: "dacl_not_exact" });
94409
+ }
94372
94410
  }, describeDacl = async (path, run = runPowerShell) => {
94373
94411
  const { code, out } = await run(DESCRIBE_DACL_SCRIPT, { LA_PATH: path });
94374
94412
  const dacl = code === 0 ? parseSddl(out.trim()) : undefined;
94375
94413
  if (dacl === undefined)
94376
- throw new LocalApiError("insecure_state_dir", "the DACL could not be read back");
94414
+ throw new LocalApiError("insecure_state_dir", "the DACL could not be read back", {
94415
+ insecure_cause: "unreadable"
94416
+ });
94377
94417
  return dacl;
94378
94418
  };
94379
94419
  var init_dacl = __esm(() => {
94380
94420
  init_errors4();
94421
+ init_powershell();
94381
94422
  APPLY_DACL_SCRIPT = String.raw`
94382
94423
  $ErrorActionPreference = 'Stop'
94424
+ $ProgressPreference = 'SilentlyContinue'
94383
94425
  $sid = New-Object System.Security.Principal.SecurityIdentifier($env:LA_SID)
94384
94426
  if ($env:LA_KIND -eq 'dir') {
94385
94427
  $acl = New-Object System.Security.AccessControl.DirectorySecurity
@@ -94392,9 +94434,10 @@ $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($sid,
94392
94434
  [System.Security.AccessControl.FileSystemRights]::FullControl, $inherit,
94393
94435
  [System.Security.AccessControl.PropagationFlags]::None, [System.Security.AccessControl.AccessControlType]::Allow)
94394
94436
  $acl.SetAccessRuleProtection($true, $false)
94395
- $acl.SetOwner($sid)
94396
94437
  $acl.AddAccessRule($rule)
94397
- Set-Acl -LiteralPath $env:LA_PATH -AclObject $acl
94438
+ $ownerSet = & { $ErrorActionPreference = 'Continue'; & icacls.exe $env:LA_PATH /setowner "*$($env:LA_SID)" 2>&1 | ForEach-Object { "$_" } }
94439
+ if ($LASTEXITCODE -ne 0) { throw "setowner failed: $ownerSet" }
94440
+ (Get-Item -LiteralPath $env:LA_PATH -Force).SetAccessControl($acl)
94398
94441
  Write-Output 'applied'
94399
94442
  `;
94400
94443
  DESCRIBE_DACL_SCRIPT = String.raw`
@@ -94451,36 +94494,51 @@ public static class LaSddl {
94451
94494
  GUID_FIELD = /^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$/;
94452
94495
  });
94453
94496
 
94497
+ // packages/device-service-core/src/local-api/secure-windows.ts
94498
+ var REPARSE_POINT = 1024, LEVEL_READ, ADMINISTRATORS;
94499
+ var init_secure_windows = __esm(() => {
94500
+ init_dacl();
94501
+ init_errors4();
94502
+ LEVEL_READ = String.raw`$attributes = [int](Get-Item -LiteralPath $env:OMO_LEVEL_PATH -Force).Attributes
94503
+ $sddl = ''
94504
+ if (($attributes -band ${REPARSE_POINT}) -eq 0) { $sddl = [LaSddl]::Read($env:OMO_LEVEL_PATH) }
94505
+ ConvertTo-Json -Compress -InputObject ([pscustomobject]@{ attributes = $attributes; sddl = $sddl })`;
94506
+ ADMINISTRATORS = new Set(["BA", "S-1-5-32-544"]);
94507
+ });
94508
+
94454
94509
  // packages/device-service-core/src/local-api/access.ts
94455
94510
  import {
94456
94511
  chmodSync as chmodSync8,
94457
- closeSync as closeSync5,
94458
- lstatSync as lstatSync7,
94459
- openSync as openSync5,
94460
- readFileSync as readFileSync46,
94512
+ closeSync as closeSync6,
94513
+ lstatSync as lstatSync8,
94514
+ mkdirSync as mkdirSync21,
94515
+ openSync as openSync6,
94516
+ readFileSync as readFileSync45,
94461
94517
  renameSync as renameSync10,
94462
94518
  rmSync as rmSync10,
94463
94519
  writeFileSync as writeFileSync18
94464
94520
  } from "fs";
94465
- import { join as join121 } from "path";
94466
- var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecure = (detail) => {
94467
- throw new LocalApiError("insecure_state_dir", detail);
94468
- }, UNIX_ENDPOINT = "unix", tcpEndpoint = (port) => `tcp:${port}`, isMissing = (error) => typeof error === "object" && error !== null && ("code" in error) && (error.code === "ENOENT" || error.code === "ENOTDIR"), currentUid = () => process.getuid?.() ?? insecure("this platform has no uid"), privateEntry = (path, kind, uid, checkMode = true) => {
94521
+ import { dirname as dirname50, join as join121 } from "path";
94522
+ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecure = (detail, cause) => {
94523
+ throw new LocalApiError("insecure_state_dir", detail, {
94524
+ ...cause === undefined ? {} : { insecure_cause: cause }
94525
+ });
94526
+ }, UNIX_ENDPOINT = "unix", tcpEndpoint = (port) => `tcp:${port}`, isMissing = (error) => typeof error === "object" && error !== null && ("code" in error) && (error.code === "ENOENT" || error.code === "ENOTDIR"), currentUid = () => process.getuid?.() ?? insecure("this platform has no uid", "unreadable"), privateEntry = (path, kind, uid, checkMode = true) => {
94469
94527
  let stat;
94470
94528
  try {
94471
- stat = lstatSync7(path);
94529
+ stat = lstatSync8(path);
94472
94530
  } catch (error) {
94473
94531
  if (isMissing(error))
94474
- return insecure(`the ${kind} is missing`);
94532
+ return insecure(`the ${kind} is missing`, "unreadable");
94475
94533
  throw error;
94476
94534
  }
94477
94535
  const isKind = kind === "dir" ? stat.isDirectory() : kind === "socket" ? stat.isSocket() : stat.isFile();
94478
94536
  if (!isKind)
94479
- insecure(`the ${kind} is not a plain ${kind}`);
94537
+ insecure(`the ${kind} is not a plain ${kind}`, "reparse");
94480
94538
  if (stat.uid !== uid)
94481
- insecure(`the ${kind} belongs to another user`);
94539
+ insecure(`the ${kind} belongs to another user`, "owner_other");
94482
94540
  if (checkMode && (stat.mode & 63) !== 0)
94483
- insecure(`the ${kind} is open to group or others`);
94541
+ insecure(`the ${kind} is open to group or others`, "dacl_not_exact");
94484
94542
  }, checkPosixAccess = (stateDir) => {
94485
94543
  const uid = currentUid();
94486
94544
  privateEntry(stateDir, "dir", uid);
@@ -94494,7 +94552,7 @@ var TOKEN_FILE = "token", TOKEN_BYTES = 32, SOCKET_FILE = "service.sock", insecu
94494
94552
  }, readToken = (stateDir) => {
94495
94553
  let value;
94496
94554
  try {
94497
- value = readFileSync46(join121(stateDir, TOKEN_FILE), "utf8");
94555
+ value = readFileSync45(join121(stateDir, TOKEN_FILE), "utf8");
94498
94556
  } catch (error) {
94499
94557
  if (isMissing(error))
94500
94558
  return insecure("the token is missing");
@@ -94512,6 +94570,7 @@ var init_access = __esm(() => {
94512
94570
  init_errors4();
94513
94571
  init_proof();
94514
94572
  init_dacl();
94573
+ init_secure_windows();
94515
94574
  init_proof();
94516
94575
  });
94517
94576
 
@@ -94558,9 +94617,32 @@ var init_limits = __esm(() => {
94558
94617
  encoder2 = new TextEncoder;
94559
94618
  });
94560
94619
 
94620
+ // packages/device-service-core/src/local-api/policy.ts
94621
+ var POLICY_STATES, THIS_DEVICE_STATES, POLICY_WAITING_STATES, POLICY_WAIT_REASONS;
94622
+ var init_policy = __esm(() => {
94623
+ POLICY_STATES = ["off", "pending", "active"];
94624
+ THIS_DEVICE_STATES = [
94625
+ "unclassified",
94626
+ "desktop_unregistered",
94627
+ "indeterminate",
94628
+ "desktop",
94629
+ "cli_only",
94630
+ "acked"
94631
+ ];
94632
+ POLICY_WAITING_STATES = ["reported", "not_reported"];
94633
+ POLICY_WAIT_REASONS = [
94634
+ "not_acked",
94635
+ "discovery_missing",
94636
+ "discovery_incomplete",
94637
+ "inventory_mismatch",
94638
+ "other"
94639
+ ];
94640
+ });
94641
+
94561
94642
  // packages/device-service-core/src/local-api/vocabulary.ts
94562
- var LOCAL_API_VERSION = 1, STATUS_STATES, STATUS_UPDATE_PHASES, POLICY_STATES, THIS_DEVICE_STATES, CAPABILITIES, OPTIONAL_CAPABILITIES, REFUSED_REASONS, ROUND_STATES, ROUND_DEVICE_STATES, LISTING_SOURCES, SESSION_ROW_STATES, FILTER_KEYS, LISTING_SETTLED_BY_KINDS, BLOB_OF, BLOB_ABORT_REASONS, UPLOAD_ABORT_REASONS, DETACH_REASONS, UPDATE_NOTICE_PHASES, UPDATE_POLICIES, ATTACH_PENDING_REASONS, COMMAND_ID_CHARS = 22, COMMAND_STATES, COMMAND_UNCERTAIN_REASONS, COMMAND_REFUSAL_REASONS, RETRYABLE_STATES, ERROR_CODES, ALIAS_INCOMPLETE_REASONS, PATH_REFUSAL_PROBLEMS, MACHINE_OP_STATES, MACHINE_STATES, MACHINE_LOOKUP_STATES, MACHINE_BLOB_ABORT_REASONS, CHANNEL_CLOSED_REASONS;
94643
+ var LOCAL_API_VERSION = 1, STATUS_STATES, STATUS_UPDATE_PHASES, CAPABILITIES, OPTIONAL_CAPABILITIES, REFUSED_REASONS, ROUND_STATES, ROUND_DEVICE_STATES, LISTING_SOURCES, SESSION_ROW_STATES, FILTER_KEYS, LISTING_SETTLED_BY_KINDS, BLOB_OF, BLOB_ABORT_REASONS, UPLOAD_ABORT_REASONS, DETACH_REASONS, UPDATE_NOTICE_PHASES, UPDATE_POLICIES, ATTACH_PENDING_REASONS, COMMAND_ID_CHARS = 22, COMMAND_STATES, COMMAND_UNCERTAIN_REASONS, COMMAND_REFUSAL_REASONS, RETRYABLE_STATES, ERROR_CODES, ALIAS_INCOMPLETE_REASONS, PATH_REFUSAL_PROBLEMS, MACHINE_OP_STATES, MACHINE_STATES, MACHINE_LOOKUP_STATES, MACHINE_BLOB_ABORT_REASONS, CHANNEL_CLOSED_REASONS;
94563
94644
  var init_vocabulary = __esm(() => {
94645
+ init_policy();
94564
94646
  STATUS_STATES = [
94565
94647
  "not_configured",
94566
94648
  "disabled",
@@ -94578,15 +94660,6 @@ var init_vocabulary = __esm(() => {
94578
94660
  "fail_closed"
94579
94661
  ];
94580
94662
  STATUS_UPDATE_PHASES = ["trial", "committed"];
94581
- POLICY_STATES = ["off", "pending", "active"];
94582
- THIS_DEVICE_STATES = [
94583
- "unclassified",
94584
- "desktop_unregistered",
94585
- "indeterminate",
94586
- "desktop",
94587
- "cli_only",
94588
- "acked"
94589
- ];
94590
94663
  CAPABILITIES = ["sessions", "devices", "enforcement", "upgrade", "control"];
94591
94664
  OPTIONAL_CAPABILITIES = ["machine"];
94592
94665
  REFUSED_REASONS = ["version", "data_home_required", "malformed"];
@@ -94688,6 +94761,7 @@ var init_vocabulary = __esm(() => {
94688
94761
  "epoch_step_exceeded",
94689
94762
  "route_unlisted",
94690
94763
  "rate_limited",
94764
+ "unbound",
94691
94765
  "unknown_reason"
94692
94766
  ];
94693
94767
  RETRYABLE_STATES = [
@@ -95023,7 +95097,7 @@ var init_client_listing = __esm(() => {
95023
95097
  });
95024
95098
 
95025
95099
  // packages/device-service-core/src/local-api/session-ref.ts
95026
- var KEY_CHARS = 22, MIN_CHARS, MAX_CHARS, isStreamSessionKey = (v) => {
95100
+ var KEY_CHARS = 22, MIN_CHARS, MAX_CHARS2, isStreamSessionKey = (v) => {
95027
95101
  try {
95028
95102
  validateStreamSessionKey(v);
95029
95103
  return true;
@@ -95035,7 +95109,7 @@ var KEY_CHARS = 22, MIN_CHARS, MAX_CHARS, isStreamSessionKey = (v) => {
95035
95109
  }, parseSessionRef = (v) => {
95036
95110
  if (typeof v !== "string" || !v.isWellFormed())
95037
95111
  return;
95038
- if (v.length < MIN_CHARS || v.length > MAX_CHARS || v[v.length - KEY_CHARS - 1] !== ".")
95112
+ if (v.length < MIN_CHARS || v.length > MAX_CHARS2 || v[v.length - KEY_CHARS - 1] !== ".")
95039
95113
  return;
95040
95114
  const device = v.slice(0, -KEY_CHARS - 1);
95041
95115
  const key = v.slice(-KEY_CHARS);
@@ -95048,7 +95122,7 @@ var KEY_CHARS = 22, MIN_CHARS, MAX_CHARS, isStreamSessionKey = (v) => {
95048
95122
  var init_session_ref = __esm(() => {
95049
95123
  init_spec_proto();
95050
95124
  MIN_CHARS = KEY_CHARS + 2;
95051
- MAX_CHARS = KEY_CHARS + 65;
95125
+ MAX_CHARS2 = KEY_CHARS + 65;
95052
95126
  CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
95053
95127
  });
95054
95128
 
@@ -95137,11 +95211,20 @@ var CODE, ATTACH_ID_MAX = 4294967295, MILLIS_MAX, deviceId = (v, what = "device"
95137
95211
  id: deviceId(m["id"], `${what}.id`),
95138
95212
  name: text(m["name"], LABEL_MAX_CHARS, `${what}.name`)
95139
95213
  };
95214
+ }, blockerOf = (v) => {
95215
+ const m = known(v, ["device", "label", "reason", "action"], [], "policy.blocker");
95216
+ return {
95217
+ device: deviceId(m["device"]),
95218
+ label: text(m["label"], LABEL_MAX_CHARS, "policy.blocker.label", 0),
95219
+ reason: oneOf(POLICY_WAIT_REASONS, m["reason"], "policy.blocker.reason"),
95220
+ action: nullable2(m["action"], (a) => text(a, REASON_MAX_CHARS, "policy.blocker.action"))
95221
+ };
95140
95222
  }, policyOf = (v) => {
95141
- const m = known(v, ["state", "generation", "this_device", "homes_pending", "unacked"], [], "policy");
95223
+ const m = known(v, ["state", "generation", "this_device", "homes_pending", "unacked"], ["waiting", "blocker"], "policy");
95142
95224
  const unacked = m["unacked"];
95143
95225
  if (!Array.isArray(unacked))
95144
95226
  return fail("policy.unacked");
95227
+ const { waiting, blocker } = m;
95145
95228
  return {
95146
95229
  state: oneOf(POLICY_STATES, m["state"], "policy.state"),
95147
95230
  generation: millis(m["generation"], "policy.generation"),
@@ -95153,7 +95236,9 @@ var CODE, ATTACH_ID_MAX = 4294967295, MILLIS_MAX, deviceId = (v, what = "device"
95153
95236
  device: deviceId(entry["device"]),
95154
95237
  label: text(entry["label"], LABEL_MAX_CHARS, "label", 0)
95155
95238
  };
95156
- })
95239
+ }),
95240
+ ...waiting === undefined ? {} : { waiting: oneOf(POLICY_WAITING_STATES, waiting, "policy.waiting") },
95241
+ ...blocker === undefined ? {} : { blocker: blockerOf(blocker) }
95157
95242
  };
95158
95243
  }, statusOf = (v) => {
95159
95244
  const m = known(v, ["state", "since_ms", "device", "origin_configured", "enabled"], ["detail", "policy", "update", "exe"], "status");
@@ -96187,14 +96272,47 @@ var ROW_FIELDS, ROW_KIND, rowLinks = (m) => {
96187
96272
  return fail("settled_by");
96188
96273
  const by = settledByOf(reason);
96189
96274
  return by === undefined ? { settled } : { settled, settled_by: by };
96275
+ }, ENGINE_VERSION_MAX_CHARS = 128, WAIT_KINDS, WAIT_UNTIL_MAX_CHARS = 27, waitUntil = (v) => {
96276
+ const until = text(v, WAIT_UNTIL_MAX_CHARS, "waiting until");
96277
+ const ms = Date.parse(until);
96278
+ return Number.isFinite(ms) && new Date(ms).toISOString() === until ? until : fail("waiting until");
96279
+ }, waitingOf = (v) => {
96280
+ const m = known(v, ["kind", "attempt", "maxAttempts", "delayMs", "until"], [], "waiting");
96281
+ const maxAttempts = uint(m["maxAttempts"], 1, Number.MAX_SAFE_INTEGER, "waiting maxAttempts");
96282
+ return {
96283
+ kind: oneOf(WAIT_KINDS, m["kind"], "waiting kind"),
96284
+ attempt: uint(m["attempt"], 1, maxAttempts, "waiting attempt"),
96285
+ maxAttempts,
96286
+ delayMs: uint(m["delayMs"], 0, Number.MAX_SAFE_INTEGER, "waiting delayMs"),
96287
+ until: waitUntil(m["until"])
96288
+ };
96289
+ }, rowHolder = (m) => {
96290
+ const waiting = m["waiting"];
96291
+ const version = m["engine_version"];
96292
+ return {
96293
+ ...waiting === undefined ? {} : { waiting: waitingOf(waiting) },
96294
+ ...version === undefined ? {} : { engine_version: text(version, ENGINE_VERSION_MAX_CHARS, "engine_version") }
96295
+ };
96190
96296
  }, listingRowOf = (v) => {
96191
- const m = known(v, ROW_FIELDS, ["kind", "parent", "parent_listed", "durable_id", "model", "archived", "settled", "settled_by"], "listing row");
96297
+ const m = known(v, ROW_FIELDS, [
96298
+ "kind",
96299
+ "parent",
96300
+ "parent_listed",
96301
+ "durable_id",
96302
+ "model",
96303
+ "archived",
96304
+ "settled",
96305
+ "settled_by",
96306
+ "waiting",
96307
+ "engine_version"
96308
+ ], "listing row");
96192
96309
  const durable = m["durable_id"];
96193
96310
  const archived = m["archived"];
96194
96311
  return {
96195
96312
  ...rowLinks(m),
96196
96313
  ...rowModel(m["model"]),
96197
96314
  ...rowSettled(m),
96315
+ ...rowHolder(m),
96198
96316
  ...archived === undefined ? {} : { archived: archived === true ? true : fail("archived") },
96199
96317
  ...durable === undefined ? {} : { durable_id: text(durable, SESSION_ID_MAX_CHARS, "durable_id") },
96200
96318
  device: deviceId(m["device"]),
@@ -96225,6 +96343,7 @@ var init_validate_listing_row = __esm(() => {
96225
96343
  "as_of"
96226
96344
  ];
96227
96345
  ROW_KIND = new RegExp(`^[a-z][a-z0-9_-]{0,${SESSION_KIND_MAX_CHARS - 1}}$`);
96346
+ WAIT_KINDS = ["rate_limit", "retry"];
96228
96347
  });
96229
96348
 
96230
96349
  // packages/device-service-core/src/local-api/validate-events.ts
@@ -96434,7 +96553,7 @@ var init_validate_session_wake = __esm(() => {
96434
96553
  });
96435
96554
 
96436
96555
  // packages/device-service-core/src/local-api/validate-requests.ts
96437
- var ENVIRONMENTS_MAX2 = 1024, PKCS8_KEY_BYTES = 48, PKCS8_PREFIX, pkcs8 = (v, algorithm, what) => {
96556
+ var ENVIRONMENTS_MAX2 = 1024, LISTING_ROWS, PKCS8_KEY_BYTES = 48, PKCS8_PREFIX, pkcs8 = (v, algorithm, what) => {
96438
96557
  const bytes = base64Bytes(v, PKCS8_KEY_BYTES, what);
96439
96558
  const prefix = toHex(bytes.subarray(0, 16));
96440
96559
  const exact = bytes.length === PKCS8_KEY_BYTES && prefix === PKCS8_PREFIX[algorithm];
@@ -96482,6 +96601,7 @@ var init_validate_requests = __esm(() => {
96482
96601
  init_validate_session_wake();
96483
96602
  init_validate_update();
96484
96603
  init_vocabulary();
96604
+ LISTING_ROWS = [2, 3, 4, 5, 6, 7];
96485
96605
  PKCS8_PREFIX = {
96486
96606
  ed25519: "302e020100300506032b657004220420",
96487
96607
  x25519: "302e020100300506032b656e04220420"
@@ -96580,13 +96700,11 @@ var init_validate_requests = __esm(() => {
96580
96700
  },
96581
96701
  "sessions.list": (v, id) => {
96582
96702
  const { filter, rows } = requestFields(v, [], ["filter", "rows"]);
96583
- if (rows !== undefined && rows !== 2 && rows !== 3 && rows !== 4 && rows !== 5)
96584
- return fail("rows");
96585
96703
  return {
96586
96704
  id,
96587
96705
  type: "sessions.list",
96588
96706
  ...filter === undefined ? {} : { filter: filterOf(filter) },
96589
- ...rows === undefined ? {} : { rows }
96707
+ ...rows === undefined ? {} : { rows: LISTING_ROWS.find((r) => r === rows) ?? fail("rows") }
96590
96708
  };
96591
96709
  },
96592
96710
  "session.attach": (v, id) => {
@@ -97317,7 +97435,7 @@ var init_client_open = __esm(() => {
97317
97435
  });
97318
97436
 
97319
97437
  // packages/device-service-core/src/local-api/transport.ts
97320
- import { lstatSync as lstatSync8, readFileSync as readFileSync47, unlinkSync as unlinkSync11 } from "fs";
97438
+ import { lstatSync as lstatSync9, readFileSync as readFileSync46, unlinkSync as unlinkSync11 } from "fs";
97321
97439
  import { createConnection, createServer as createServer4 } from "net";
97322
97440
  import { join as join122 } from "path";
97323
97441
  var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
@@ -97352,7 +97470,7 @@ var ENDPOINT_FILE = "endpoint.json", wrap = (socket, endpoint) => {
97352
97470
  }
97353
97471
  };
97354
97472
  }, readEndpointPort = (stateDir) => {
97355
- const parsed = JSON.parse(readFileSync47(join122(stateDir, ENDPOINT_FILE), "utf8"));
97473
+ const parsed = JSON.parse(readFileSync46(join122(stateDir, ENDPOINT_FILE), "utf8"));
97356
97474
  const port = typeof parsed === "object" && parsed !== null ? Reflect.get(parsed, "port") : undefined;
97357
97475
  if (typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535)
97358
97476
  throw new LocalApiError("insecure_state_dir", "endpoint.json holds no port");
@@ -97860,7 +97978,7 @@ var init_refused_before_sending = __esm(() => {
97860
97978
 
97861
97979
  // packages/device-service-core/src/listing-rows.ts
97862
97980
  function newestRowsListing(client) {
97863
- let rows = 4;
97981
+ let rows = 7;
97864
97982
  return async function list(filter, onRevision) {
97865
97983
  for (;; ) {
97866
97984
  try {
@@ -97868,13 +97986,15 @@ function newestRowsListing(client) {
97868
97986
  } catch (error) {
97869
97987
  if (rows === undefined || !(error instanceof LocalApiError) || error.code !== "invalid_request")
97870
97988
  throw error;
97871
- rows = rows === 4 ? 3 : rows === 3 ? 2 : undefined;
97989
+ rows = OLDER[rows];
97872
97990
  }
97873
97991
  }
97874
97992
  };
97875
97993
  }
97994
+ var OLDER;
97876
97995
  var init_listing_rows = __esm(() => {
97877
97996
  init_errors4();
97997
+ OLDER = { 7: 6, 6: 5, 5: 4, 4: 3, 3: 2, 2: undefined };
97878
97998
  });
97879
97999
 
97880
98000
  // packages/device-service-core/src/minimum-in-effect.ts
@@ -97919,9 +98039,9 @@ var init_version2 = __esm(() => {
97919
98039
  });
97920
98040
 
97921
98041
  // packages/device-service-core/src/state-dir.ts
97922
- import { readFileSync as readFileSync48, statSync as statSync10 } from "fs";
98042
+ import { readFileSync as readFileSync47, statSync as statSync10 } from "fs";
97923
98043
  import { homedir as homedir36 } from "os";
97924
- import { dirname as dirname50, join as join124, posix as posix17, win32 as win3212 } from "path";
98044
+ import { dirname as dirname51, join as join124, posix as posix17, win32 as win3212 } from "path";
97925
98045
  function defaultStateDir(platform, env, home) {
97926
98046
  if (platform !== "win32")
97927
98047
  return join124(home, ".omo", "device-service");
@@ -97930,7 +98050,7 @@ function defaultStateDir(platform, env, home) {
97930
98050
  }
97931
98051
  function discoveredStateDir(platform, defaultDir) {
97932
98052
  try {
97933
- const parsed = JSON.parse(readFileSync48(join124(dirname50(defaultDir), LOCATION_FILE), "utf8"));
98053
+ const parsed = JSON.parse(readFileSync47(join124(dirname51(defaultDir), LOCATION_FILE), "utf8"));
97934
98054
  if (typeof parsed !== "object" || parsed === null || !("v" in parsed) || !("state_dir" in parsed))
97935
98055
  return;
97936
98056
  const { v, state_dir: stateDir } = parsed;
@@ -103716,6 +103836,10 @@ var PERMISSION_PRESETS;
103716
103836
  var init_permission_presets = __esm(() => {
103717
103837
  PERMISSION_PRESETS = ["full-access", "workspace", "accept-edits", "auto", "read-only", "ask"];
103718
103838
  });
103839
+
103840
+ // packages/omo-senpi/src/components/thread/remote/ports.ts
103841
+ var init_ports = () => {};
103842
+
103719
103843
  // packages/omo-senpi/src/components/thread/errors.ts
103720
103844
  function isThreadErrorCode(value) {
103721
103845
  return typeof value === "string" && CODE_SET.has(value);
@@ -103834,6 +103958,7 @@ var init_refusals = __esm(() => {
103834
103958
  // packages/omo-senpi/src/components/thread/remote/address-book.ts
103835
103959
  var REMOTE_NOT_SET_UP;
103836
103960
  var init_address_book = __esm(() => {
103961
+ init_ports();
103837
103962
  REMOTE_NOT_SET_UP = new Set(["not_configured", "disabled", "signed_out", "sign_in_required"]);
103838
103963
  });
103839
103964
 
@@ -108822,6 +108947,7 @@ var init_session_host = __esm(() => {
108822
108947
 
108823
108948
  // packages/omo-senpi/src/components/thread/control/relay-session-host.ts
108824
108949
  var init_relay_session_host = __esm(() => {
108950
+ init_ports();
108825
108951
  init_errors5();
108826
108952
  init_initial_skills();
108827
108953
  init_outcome();
@@ -109117,6 +109243,7 @@ var init_find_session = __esm(() => {
109117
109243
  // packages/omo-senpi/src/components/thread/remote/relay-transport.ts
109118
109244
  var ADMIT_UNSUPPORTED, WAITS;
109119
109245
  var init_relay_transport = __esm(() => {
109246
+ init_ports();
109120
109247
  init_errors5();
109121
109248
  init_bindings();
109122
109249
  init_provenance2();
@@ -109200,6 +109327,7 @@ var init_factories = __esm(() => {
109200
109327
  var init_holder = __esm(() => {
109201
109328
  init_account();
109202
109329
  init_outcome();
109330
+ init_ports();
109203
109331
  init_refusals();
109204
109332
  });
109205
109333
 
@@ -109213,6 +109341,7 @@ var init_ladder = __esm(() => {
109213
109341
  var init_probe = __esm(() => {
109214
109342
  init_errors5();
109215
109343
  init_address_book();
109344
+ init_ports();
109216
109345
  init_remote_ops();
109217
109346
  init_account();
109218
109347
  init_refusals();
@@ -115221,14 +115350,69 @@ function nodeErrorCode6(error) {
115221
115350
  // packages/omo-senpi/src/install/install-senpi.ts
115222
115351
  init_resolve_agent_home();
115223
115352
  import { execFile as execFile3 } from "child_process";
115224
- import { existsSync as existsSync31 } from "fs";
115353
+ import { existsSync as existsSync30 } from "fs";
115225
115354
  import { homedir as homedir12 } from "os";
115226
115355
  import { dirname as dirname26, join as join67, resolve as resolve20 } from "path";
115227
115356
  import { fileURLToPath } from "url";
115228
115357
  import { promisify as promisify2 } from "util";
115229
115358
 
115359
+ // packages/omo-senpi/src/install/launcher-ownership.ts
115360
+ import { closeSync as closeSync4, lstatSync as lstatSync4, openSync as openSync4, readSync } from "fs";
115361
+ var SHEBANG = `#!/usr/bin/env node
115362
+ `;
115363
+ var MARKER_TAIL = `: generated by the omo-senpi installer. Delete this file to remove the local launcher.
115364
+ `;
115365
+ var LAUNCHER_HEADER = `${SHEBANG}// omo-local-launcher v2${MARKER_TAIL}`;
115366
+ var LEGACY_LAUNCHER_HEADER = `${SHEBANG}// omo-local-launcher${MARKER_TAIL}`;
115367
+ var OWNED_HEADERS = [LAUNCHER_HEADER, LEGACY_LAUNCHER_HEADER].map((header) => Buffer.from(header, "utf8"));
115368
+ var LAUNCHER_CMD_SHIM = `@echo off\r
115369
+ node "%~dp0omo" %*\r
115370
+ `;
115371
+ var OWNED_CMD = Buffer.from(LAUNCHER_CMD_SHIM, "utf8");
115372
+ var MAX_SHIM_BYTES = 64 * 1024;
115373
+ function readPrefix(path, length) {
115374
+ const fd = openSync4(path, "r");
115375
+ try {
115376
+ const buffer = Buffer.alloc(length);
115377
+ const read = readSync(fd, buffer, 0, length, 0);
115378
+ return buffer.subarray(0, read);
115379
+ } finally {
115380
+ closeSync4(fd);
115381
+ }
115382
+ }
115383
+ function classify(path, isOwned, prefixBytes, io) {
115384
+ let stat;
115385
+ try {
115386
+ stat = lstatSync4(path);
115387
+ } catch (error) {
115388
+ if (error.code === "ENOENT")
115389
+ return { kind: "absent" };
115390
+ return { kind: "foreign", reason: `it cannot be inspected (${error.code ?? "error"})` };
115391
+ }
115392
+ if (stat.isSymbolicLink())
115393
+ return { kind: "foreign", reason: "it is a symbolic link to another file" };
115394
+ if (!stat.isFile())
115395
+ return { kind: "foreign", reason: "it is not a regular file" };
115396
+ if (stat.size > MAX_SHIM_BYTES)
115397
+ return { kind: "foreign", reason: `it is ${stat.size} bytes, larger than any launcher this installer writes` };
115398
+ let prefix;
115399
+ try {
115400
+ prefix = io.readPrefix(path, prefixBytes);
115401
+ } catch (error) {
115402
+ return { kind: "foreign", reason: `it cannot be read (${error.code ?? "error"})` };
115403
+ }
115404
+ return isOwned(prefix, stat.size) ? { kind: "owned" } : { kind: "foreign", reason: "it does not start with this installer's launcher header" };
115405
+ }
115406
+ var HEADER_BYTES = Math.max(...OWNED_HEADERS.map((header) => header.length));
115407
+ function launcherOwnership(path, io = { readPrefix }) {
115408
+ return classify(path, (prefix) => OWNED_HEADERS.some((header) => prefix.subarray(0, header.length).equals(header)), HEADER_BYTES, io);
115409
+ }
115410
+ function launcherCmdOwnership(path, io = { readPrefix }) {
115411
+ return classify(path, (prefix, size) => size === OWNED_CMD.length && prefix.equals(OWNED_CMD), OWNED_CMD.length, io);
115412
+ }
115413
+
115230
115414
  // packages/omo-senpi/src/install/local-launcher.ts
115231
- import { chmodSync as chmodSync4, existsSync as existsSync30, mkdirSync as mkdirSync13, readFileSync as readFileSync15, rmSync as rmSync5, writeFileSync as writeFileSync9 } from "fs";
115415
+ import { chmodSync as chmodSync4, mkdirSync as mkdirSync13, rmSync as rmSync5, writeFileSync as writeFileSync9 } from "fs";
115232
115416
  import { homedir as homedir11 } from "os";
115233
115417
  import { dirname as dirname23, join as join64, resolve as resolve18 } from "path";
115234
115418
 
@@ -115236,7 +115420,6 @@ import { dirname as dirname23, join as join64, resolve as resolve18 } from "path
115236
115420
  var OMO_BRAND_LOGO = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPgogIDxwYXRoIGZpbGw9IiNGNEY0RjQiIGQ9Ik01MTIuMDAgMTAwLjUwIEM1OTEuMTMgMTAwLjUwIDY5Ny42NiAxMDIuMzcgNzQ5LjM5IDEwNi4yNyBDODAxLjExIDExMC4xNyA4MDIuMzUgMTE1Ljg0IDgyMi4zNSAxMjMuOTAgQzg0Mi4zNCAxMzEuOTYgODU2LjQwIDE0MS42OCA4NjkuMzYgMTU0LjY0IEM4ODIuMzIgMTY3LjYwIDg5Mi4wNCAxODEuNjYgOTAwLjEwIDIwMS42NSBDOTA4LjE2IDIyMS42NSA5MTMuODMgMjIyLjg5IDkxNy43MyAyNzQuNjEgQzkyMS42MyAzMjYuMzQgOTIzLjUwIDQzMi44NyA5MjMuNTAgNTEyLjAwIEM5MjMuNTAgNTkxLjEzIDkyMS42MyA2OTcuNjYgOTE3LjczIDc0OS4zOSBDOTEzLjgzIDgwMS4xMSA5MDguMTYgODAyLjM1IDkwMC4xMCA4MjIuMzUgQzg5Mi4wNCA4NDIuMzQgODgyLjMyIDg1Ni40MCA4NjkuMzYgODY5LjM2IEM4NTYuNDAgODgyLjMyIDg0Mi4zNCA4OTIuMDQgODIyLjM1IDkwMC4xMCBDODAyLjM1IDkwOC4xNiA4MDEuMTEgOTEzLjgzIDc0OS4zOSA5MTcuNzMgQzY5Ny42NiA5MjEuNjMgNTkxLjEzIDkyMy41MCA1MTIuMDAgOTIzLjUwIEM0MzIuODcgOTIzLjUwIDMyNi4zNCA5MjEuNjMgMjc0LjYxIDkxNy43MyBDMjIyLjg5IDkxMy44MyAyMjEuNjUgOTA4LjE2IDIwMS42NSA5MDAuMTAgQzE4MS42NiA4OTIuMDQgMTY3LjYwIDg4Mi4zMiAxNTQuNjQgODY5LjM2IEMxNDEuNjggODU2LjQwIDEzMS45NiA4NDIuMzQgMTIzLjkwIDgyMi4zNSBDMTE1Ljg0IDgwMi4zNSAxMTAuMTcgODAxLjExIDEwNi4yNyA3NDkuMzkgQzEwMi4zNyA2OTcuNjYgMTAwLjUwIDU5MS4xMyAxMDAuNTAgNTEyLjAwIEMxMDAuNTAgNDMyLjg3IDEwMi4zNyAzMjYuMzQgMTA2LjI3IDI3NC42MSBDMTEwLjE3IDIyMi44OSAxMTUuODQgMjIxLjY1IDEyMy45MCAyMDEuNjUgQzEzMS45NiAxODEuNjYgMTQxLjY4IDE2Ny42MCAxNTQuNjQgMTU0LjY0IEMxNjcuNjAgMTQxLjY4IDE4MS42NiAxMzEuOTYgMjAxLjY1IDEyMy45MCBDMjIxLjY1IDExNS44NCAyMjIuODkgMTEwLjE3IDI3NC42MSAxMDYuMjcgQzMyNi4zNCAxMDIuMzcgNDMyLjg3IDEwMC41MCA1MTIuMDAgMTAwLjUwWiIvPgogIDxnIHRyYW5zZm9ybT0ic2NhbGUoMC41KSI+CiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCwyMDQ4LjAwMDAwMCkgc2NhbGUoMC4wNTAwMDAsLTAuMDUwMDAwKSI+CiAgICAgIDxwYXRoIGZpbGw9IiMwNDE2MTciIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTkyNzAgMzIxNjcgYy0zMDkgLTY0IC00NTYgLTE1MiAtNjIxIC0zNzMgLTU2MiAtNzQ4IC03NzYgLTI2ODkKLTU0NyAtNDk4NCAxMTggLTExODcgMzI1IC0yNjAwIDU3MCAtMzg5MCAxNDMgLTc1MyAxNTIgLTY1MyAtMTI4IC0xMzgwIC00MDMKLTEwNDUgLTY0MyAtMTg3MyAtODEyIC0yODAwIC04NTMgLTQ2ODkgMTk3OSAtNzk4NiA3ODU4IC05MTQ4IDExNDAgLTIyNSAyNTE0Ci0zOTcgMzIwMiAtNDAwIGwzNjEgLTIgNzkgNTUgYzI2NCAxODIgMjEwIDY0MiAtMTExIDk0MiAtMzg3IDM2MiAtOTUwIDUzMgotMjgwMSA4NDUgLTMwMDQgNTA3IC00MjQ5IDk2NSAtNTUyMCAyMDMwIC0xMzU4IDExMzggLTIwMTIgMjg3OCAtMTgwOSA0ODEwCjU0NSA1MTk1IDY2MTcgODcyNiAxMzUyOSA3ODY2IDU1MDYgLTY4NCA5NDgwIC00MjU1IDk0ODAgLTg1MTggMCAtMjYwNyAtMTQ2MgotNDUyMiAtNDE1NyAtNTQ0OCAtOTI3IC0zMTggLTE1MzQgLTQ1OSAtMzIwMyAtNzQwIC0xODUxIC0zMTMgLTI0MTQgLTQ4MwotMjgwMSAtODQ1IC0zMjEgLTMwMCAtMzc1IC03NjAgLTExMSAtOTQyIGw3OSAtNTUgMzYxIDIgYzY4OCAzIDIwNjIgMTc1IDMyMDIKNDAwIDU4NzkgMTE2MiA4NzExIDQ0NTkgNzg1OCA5MTQ4IC0xNjkgOTI3IC00MDkgMTc1NSAtODEyIDI4MDAgLTI4MCA3MjcKLTI3MSA2MjcgLTEyOCAxMzgwIDI0NSAxMjkwIDQ1MiAyNzAzIDU3MCAzODkwIDI3MSAyNzIwIC03NyA0ODYxIC04NTUgNTI1OQotNzU4IDM4OCAtMjMxMCAtMjM4IC01MDIxIC0yMDI0IC04NjggLTU3MSAtNzY0IC01NTcgLTE0ODkgLTIxMSAtMzI3MSAxNTU4Ci02NzU1IDE1NTggLTEwMDI2IDAgLTcyNSAtMzQ2IC02MjEgLTM2MCAtMTQ4OSAyMTEgLTIzNzEgMTU2MiAtMzk1OSAyMjc4Ci00NzA4IDIxMjJ6IG00MTMyIC0zMzQ1IGMxNzUgLTE3NSAxMjQgLTI2OCAtNDA5IC03MzkgLTEwMjggLTkxMCAtMTk5NSAtMjA1MwotMjcxMyAtMzIwOSAtOTcgLTE1NiAtMjAwIC0zMTggLTIyOCAtMzU5IC0yMjEgLTMyMSAtNjQ2IC03NiAtNDY5IDI3MCAxNTMKMzAxIDg4MyAxMzM0IDEzODggMTk2NSA1NzggNzIzIDE0NjYgMTYxNCAyMDI5IDIwMzUgMTkxIDE0MiAyODggMTUxIDQwMiAzN3oKbTE0NTA3IC0xIGM0OTYgLTM0MSAxNDgyIC0xMzIzIDIwODAgLTIwNzEgNTA1IC02MzEgMTIzNSAtMTY2NCAxMzg4IC0xOTY1CjE3NyAtMzQ2IC0yNDggLTU5MSAtNDY5IC0yNzAgLTI4IDQxIC0xMzEgMjAzIC0yMjggMzU5IC03MTggMTE1NiAtMTY4NSAyMjk5Ci0yNzEzIDMyMDkgLTUzNSA0NzMgLTU4NSA1NjQgLTQwNyA3NDIgMTAwIDEwMCAxOTkgOTkgMzQ5IC00eiBNMTk5MTAgMjUzMDggYy00MDM5IC0yMDUgLTcyMTIgLTE2NjYgLTkwODYgLTQxODQgLTE4NDAgLTI0NzMgLTE3NTMKLTU3OTQgMTk2IC03NTQwIDExNjEgLTEwNDAgMjQ0NyAtMTUxOCA1NDIwIC0yMDE1IDEzNzQgLTIyOSAxOTk4IC0zODAgMjQ1NgotNTkxIDc1NCAtMzQ4IDExNjMgLTEwMDAgMTAzMyAtMTY1MCAtMTAgLTQ5IC0xIC03MiA0NyAtMTI0IGw2MCAtNjQgNDQ0IDAKNDQ0IDAgNjAgNjQgYzQ4IDUyIDU3IDc1IDQ3IDEyNCAtMTMwIDY1MCAyNzkgMTMwMiAxMDMzIDE2NTAgNDU4IDIxMSAxMDgyCjM2MiAyNDU2IDU5MSAyOTczIDQ5NyA0MjU5IDk3NSA1NDIwIDIwMTUgMjA4NCAxODY2IDIwMjYgNTM3NCAtMTMxIDc5NTYKLTIwNjMgMjQ2OSAtNTk5NSAzOTY2IC05ODk5IDM3Njh6IG0tNDY0NCAtNDM3NCBjMTM1NiAtMzYwIDIyNzIgLTE5MDkgMTk5OAotMzM3OCAtNDI2IC0yMjc4IC0yODU2IC0zMTQ0IC00NDI0IC0xNTc2IC0xNDk3IDE0OTYgLTkyNCA0MjE4IDEwMzEgNDg5OSAzOTMKMTM3IDk5NiAxNjEgMTM5NSA1NXogbTExNDgwIDM1IGMxNDkxIC0yNjEgMjUwNCAtMTkyMSAyMTU0IC0zNTMyIC00ODcgLTIyNDcKLTMxMDggLTMwMjQgLTQ1MjUgLTEzNDEgLTE3MTkgMjA0MiAtMTI5IDUzMTAgMjM3MSA0ODczeiBtLTY5NDggLTI5ODAgYzE3MgotNDAgMzQxIC0xMzMgNDk1IC0yNzMgOTUgLTg2IDE0MyAtMTE2IDE4NyAtMTE2IDQ0IDAgOTIgMzAgMTg3IDExNiA3MTggNjUwCjE3MTYgMTg4IDE4NTQgLTg2MCAzNSAtMjY3IDE4IC05NjggLTI1IC0xMDQ4IC0xMTkgLTIxOSAtMzUwIC0yNTEgLTQ5MSAtNjgKLTY4IDg5IC03MyAxMjQgLTg1IDY3MCAtMTMgNjIzIC0yNSA2NzUgLTIwMCA4MzggLTIxMiAxOTggLTUxNiAxOTkgLTczNSAyCi0xODAgLTE2MSAtMTkyIC0yMTIgLTIwNSAtODQwIC0xMiAtNTQ2IC0xNyAtNTgxIC04NSAtNjcwIC0xMjIgLTE1OSAtMzA4Ci0xNTkgLTQzMCAwIC02OCA4OSAtNzMgMTI0IC04NSA2NzAgLTEzIDYyOCAtMjUgNjc5IC0yMDUgODQwIC0yMTkgMTk3IC01MjMKMTk2IC03MzUgLTIgLTE3NSAtMTYzIC0xODcgLTIxNSAtMjAwIC04MzggLTEyIC01NDYgLTE3IC01ODEgLTg1IC02NzAgLTE0MQotMTgzIC0zNzIgLTE1MSAtNDkxIDY4IC03NCAxMzYgLTU0IDEwMzkgMzAgMTMzMiAxNzAgNTk0IDc1OCA5NzggMTMwNCA4NDl6IE0xNDM0MCAyMDI5MCBjLTE4NTggLTM3MiAtMjIzMCAtMzIyOCAtNTQ2IC00MTkxIDEyODAgLTczMiAyNzg2IDMzOAoyNzg2IDE5ODEgMCAxMzkxIC0xMDY4IDI0NDUgLTIyNDAgMjIxMHogTTI1OTkwIDIwMjkxIGMtMTczMyAtMzQzIC0yMjA4IC0yOTgxIC03MzIgLTQwNjkgMTI4NyAtOTQ5IDI5ODEgMTA4CjI5ODIgMTg2MCAwIDEzOTIgLTEwNzAgMjQ0MyAtMjI1MCAyMjA5eiIvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==";
115237
115421
 
115238
115422
  // packages/omo-senpi/src/install/local-launcher.ts
115239
- var MARKER = "omo-local-launcher";
115240
115423
  function localLauncherPath(homeDir = homedir11()) {
115241
115424
  return join64(homeDir, ".local", "bin", "omo");
115242
115425
  }
@@ -115269,9 +115452,7 @@ function renderLocalLauncher(options) {
115269
115452
  changelogUrl: "https://github.com/code-yeongyu/oh-my-openagent/releases"
115270
115453
  }
115271
115454
  };
115272
- return `#!/usr/bin/env node
115273
- // ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
115274
- import { spawn } from "node:child_process"
115455
+ return `${LAUNCHER_HEADER}import { spawn } from "node:child_process"
115275
115456
  import { homedir } from "node:os"
115276
115457
  import { join } from "node:path"
115277
115458
 
@@ -115317,15 +115498,15 @@ child.on("close", (code, signal) => {
115317
115498
  }
115318
115499
  function installLocalLauncher(options) {
115319
115500
  const path = localLauncherPath(options.homeDir);
115320
- if (existsSync30(path) && !readFileSync15(path, "utf8").includes(MARKER))
115501
+ if (launcherOwnership(path).kind === "foreign")
115321
115502
  return;
115322
115503
  mkdirSync13(dirname23(path), { recursive: true });
115323
115504
  writeFileSync9(path, renderLocalLauncher(options));
115324
115505
  chmodSync4(path, 493);
115325
115506
  if ((options.platform ?? process.platform) === "win32") {
115326
- writeFileSync9(localLauncherCmdPath(options.homeDir), `@echo off\r
115327
- node "%~dp0omo" %*\r
115328
- `);
115507
+ const cmd = localLauncherCmdPath(options.homeDir);
115508
+ if (launcherCmdOwnership(cmd).kind !== "foreign")
115509
+ writeFileSync9(cmd, LAUNCHER_CMD_SHIM);
115329
115510
  }
115330
115511
  return path;
115331
115512
  }
@@ -115644,11 +115825,13 @@ async function runSenpiInstaller(options = {}) {
115644
115825
  const launcherPath = installLocalLauncher({
115645
115826
  pluginPath: context.pluginPath,
115646
115827
  senpiCliPath: join67(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
115647
- homeDir: context.homeDir
115828
+ homeDir: context.homeDir,
115829
+ platform: context.platform
115648
115830
  });
115649
115831
  return {
115650
115832
  ok: true,
115651
115833
  action: "install",
115834
+ ...leftAloneReport(context.homeDir, context.platform),
115652
115835
  agentDir: context.agentDir,
115653
115836
  settingsPath: context.settingsPath,
115654
115837
  pluginPath: context.pluginPath,
@@ -115693,14 +115876,38 @@ function findRepoRoot2(importerDir) {
115693
115876
  throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
115694
115877
  }
115695
115878
  function fileExistsSync(path) {
115696
- return existsSync31(path);
115879
+ return existsSync30(path);
115880
+ }
115881
+ function leftAloneReport(homeDir, platform) {
115882
+ const candidates = [
115883
+ {
115884
+ file: "omo",
115885
+ path: localLauncherPath(homeDir),
115886
+ ownership: launcherOwnership(localLauncherPath(homeDir))
115887
+ },
115888
+ ...platform === "win32" ? [
115889
+ {
115890
+ file: "omo.cmd",
115891
+ path: localLauncherCmdPath(homeDir),
115892
+ ownership: launcherCmdOwnership(localLauncherCmdPath(homeDir))
115893
+ }
115894
+ ] : []
115895
+ ];
115896
+ const leftAlone = candidates.flatMap(({ file, path, ownership }) => ownership.kind === "foreign" ? [
115897
+ {
115898
+ file,
115899
+ path,
115900
+ reason: file === "omo.cmd" ? `${path} was left alone: it is not a wrapper this installer wrote (${ownership.reason}); the command omo still resolves to it` : `${path} was left alone: it is not a launcher this installer wrote (${ownership.reason})`
115901
+ }
115902
+ ] : []);
115903
+ return leftAlone.length === 0 ? {} : { launchersLeftAlone: leftAlone };
115697
115904
  }
115698
115905
  // packages/omo-opencode/src/cli/install-native-dev/index.ts
115699
115906
  async function runNativeDevInstaller(options) {
115700
115907
  return runSenpiInstaller(options);
115701
115908
  }
115702
115909
  // packages/omo-opencode/src/cli/install-native/legacy-omo-bin.ts
115703
- import { lstatSync as lstatSync4, readFileSync as readFileSync16, realpathSync as realpathSync8, statSync as statSync4 } from "fs";
115910
+ import { lstatSync as lstatSync5, readFileSync as readFileSync15, realpathSync as realpathSync8, statSync as statSync4 } from "fs";
115704
115911
  import { dirname as dirname27, isAbsolute as isAbsolute12, join as join68, posix as posix9, win32 as win325 } from "path";
115705
115912
  var NATIVE_OMO_PACKAGE = "omo-ai";
115706
115913
  var LEGACY_OMO_BIN_PACKAGES = ["oh-my-openagent", "oh-my-opencode", "lazycodex"];
@@ -115736,7 +115943,7 @@ function scanOmoBins(environment) {
115736
115943
  binPath,
115737
115944
  directory,
115738
115945
  onPath,
115739
- kind: classify(owner),
115946
+ kind: classify2(owner),
115740
115947
  packageName: owner?.name ?? null,
115741
115948
  packageVersion: owner?.version ?? null,
115742
115949
  shimPaths
@@ -115757,7 +115964,7 @@ function nativeOmoBin(entries) {
115757
115964
  function firstOmoBinOnPath(entries) {
115758
115965
  return entries.find((entry) => entry.onPath) ?? null;
115759
115966
  }
115760
- function classify(owner) {
115967
+ function classify2(owner) {
115761
115968
  if (owner === null)
115762
115969
  return "foreign";
115763
115970
  if (owner.name === NATIVE_OMO_PACKAGE)
@@ -115770,7 +115977,7 @@ function omoShimPathsIn(directory, isWindows) {
115770
115977
  }
115771
115978
  function pathExists(path) {
115772
115979
  try {
115773
- lstatSync4(path);
115980
+ lstatSync5(path);
115774
115981
  return true;
115775
115982
  } catch {
115776
115983
  return false;
@@ -115815,7 +116022,7 @@ function bunxEntryPaths(binPath) {
115815
116022
  try {
115816
116023
  if (!statSync4(sidecar).isFile())
115817
116024
  return [];
115818
- contents = readFileSync16(sidecar).toString("utf16le");
116025
+ contents = readFileSync15(sidecar).toString("utf16le");
115819
116026
  } catch {
115820
116027
  return [];
115821
116028
  }
@@ -115874,7 +116081,7 @@ function readShimText(path) {
115874
116081
  }
115875
116082
  function readWholeFile(path) {
115876
116083
  try {
115877
- return readFileSync16(path, "utf8");
116084
+ return readFileSync15(path, "utf8");
115878
116085
  } catch {
115879
116086
  return null;
115880
116087
  }
@@ -116132,12 +116339,12 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
116132
116339
  init_provider_availability();
116133
116340
 
116134
116341
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
116135
- import { existsSync as existsSync33, mkdirSync as mkdirSync14, readFileSync as readFileSync18 } from "fs";
116342
+ import { existsSync as existsSync32, mkdirSync as mkdirSync14, readFileSync as readFileSync17 } from "fs";
116136
116343
  import { join as join70 } from "path";
116137
116344
 
116138
116345
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
116139
116346
  init_shared();
116140
- import { existsSync as existsSync32, readFileSync as readFileSync17 } from "fs";
116347
+ import { existsSync as existsSync31, readFileSync as readFileSync16 } from "fs";
116141
116348
  import { join as join69 } from "path";
116142
116349
  var TUI_SUBPATH = "tui";
116143
116350
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
@@ -116161,10 +116368,10 @@ function fileEntryPackageJsonPath(entry) {
116161
116368
  return join69(path, "package.json");
116162
116369
  }
116163
116370
  function packageJsonExportsTui(pkgJsonPath) {
116164
- if (!existsSync32(pkgJsonPath))
116371
+ if (!existsSync31(pkgJsonPath))
116165
116372
  return null;
116166
116373
  try {
116167
- const parsed = JSON.parse(readFileSync17(pkgJsonPath, "utf-8"));
116374
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
116168
116375
  if (parsed.exports === undefined)
116169
116376
  return null;
116170
116377
  if (typeof parsed.exports === "string")
@@ -116204,9 +116411,9 @@ function isOurFilePluginEntry(entry) {
116204
116411
  return false;
116205
116412
  try {
116206
116413
  const pkgJsonPath = fileEntryPackageJsonPath(entry);
116207
- if (!existsSync32(pkgJsonPath))
116414
+ if (!existsSync31(pkgJsonPath))
116208
116415
  return false;
116209
- const parsed = JSON.parse(readFileSync17(pkgJsonPath, "utf-8"));
116416
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
116210
116417
  return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
116211
116418
  } catch (error) {
116212
116419
  log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -116254,12 +116461,12 @@ function isCanonicalNamedTuiPluginEntry(entry) {
116254
116461
  }
116255
116462
  function detectServerPluginRegistration() {
116256
116463
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
116257
- const configPath = existsSync32(paths.configJsonc) ? paths.configJsonc : existsSync32(paths.configJson) ? paths.configJson : null;
116464
+ const configPath = existsSync31(paths.configJsonc) ? paths.configJsonc : existsSync31(paths.configJson) ? paths.configJson : null;
116258
116465
  if (!configPath) {
116259
116466
  return { registered: false, configPath: null, entry: null, packageExportsTui: null };
116260
116467
  }
116261
116468
  try {
116262
- const parsed = parseJsonc(readFileSync17(configPath, "utf-8"));
116469
+ const parsed = parseJsonc(readFileSync16(configPath, "utf-8"));
116263
116470
  const plugins = parsed.plugin ?? [];
116264
116471
  let serverEntry;
116265
116472
  for (const entry of plugins) {
@@ -116285,7 +116492,7 @@ function detectServerPluginRegistration() {
116285
116492
  }
116286
116493
  function detectTuiPluginRegistration() {
116287
116494
  const tuiJsonPath = join69(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
116288
- if (!existsSync32(tuiJsonPath)) {
116495
+ if (!existsSync31(tuiJsonPath)) {
116289
116496
  return {
116290
116497
  registered: false,
116291
116498
  configPath: tuiJsonPath,
@@ -116297,7 +116504,7 @@ function detectTuiPluginRegistration() {
116297
116504
  };
116298
116505
  }
116299
116506
  try {
116300
- const parsed = parseJsonc(readFileSync17(tuiJsonPath, "utf-8"));
116507
+ const parsed = parseJsonc(readFileSync16(tuiJsonPath, "utf-8"));
116301
116508
  const plugins = parsed.plugin ?? [];
116302
116509
  return {
116303
116510
  registered: plugins.some(isTuiPluginEntry),
@@ -116449,7 +116656,7 @@ init_shared();
116449
116656
  init_write_file_atomically();
116450
116657
  function readConfig(path) {
116451
116658
  try {
116452
- const parsed = parseJsonc(readFileSync18(path, "utf-8"));
116659
+ const parsed = parseJsonc(readFileSync17(path, "utf-8"));
116453
116660
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
116454
116661
  return parsed;
116455
116662
  }
@@ -116461,10 +116668,10 @@ function readConfig(path) {
116461
116668
  }
116462
116669
  function readServerConfig(configDir) {
116463
116670
  const jsoncPath = join70(configDir, "opencode.jsonc");
116464
- if (existsSync33(jsoncPath))
116671
+ if (existsSync32(jsoncPath))
116465
116672
  return readConfig(jsoncPath);
116466
116673
  const jsonPath = join70(configDir, "opencode.json");
116467
- if (existsSync33(jsonPath))
116674
+ if (existsSync32(jsonPath))
116468
116675
  return readConfig(jsonPath);
116469
116676
  return null;
116470
116677
  }
@@ -116499,7 +116706,7 @@ function desiredTuiEntry(serverEntry) {
116499
116706
  return null;
116500
116707
  }
116501
116708
  function readTuiConfig(tuiJsonPath) {
116502
- if (!existsSync33(tuiJsonPath)) {
116709
+ if (!existsSync32(tuiJsonPath)) {
116503
116710
  return { config: {}, malformed: false };
116504
116711
  }
116505
116712
  const config = readConfig(tuiJsonPath);
@@ -116540,15 +116747,15 @@ function ensureTuiPluginEntry(opts = {}) {
116540
116747
  // packages/omo-opencode/src/cli/config-manager/refresh-opencode-plugin-sandbox.ts
116541
116748
  init_shared();
116542
116749
  init_config_context();
116543
- import { existsSync as existsSync34, readFileSync as readFileSync19 } from "fs";
116750
+ import { existsSync as existsSync33, readFileSync as readFileSync18 } from "fs";
116544
116751
  import { join as join71 } from "path";
116545
116752
  function readPluginEntries(configDir) {
116546
116753
  for (const name of ["opencode.jsonc", "opencode.json"]) {
116547
116754
  const configPath = join71(configDir, name);
116548
- if (!existsSync34(configPath))
116755
+ if (!existsSync33(configPath))
116549
116756
  continue;
116550
116757
  try {
116551
- const parsed = parseJsonc(readFileSync19(configPath, "utf-8"));
116758
+ const parsed = parseJsonc(readFileSync18(configPath, "utf-8"));
116552
116759
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
116553
116760
  continue;
116554
116761
  return (parsed.plugin ?? []).filter((entry) => typeof entry === "string");
@@ -116595,12 +116802,12 @@ import { homedir as homedir14 } from "os";
116595
116802
  import { join as join72 } from "path";
116596
116803
 
116597
116804
  // packages/shared-skills/index.mjs
116598
- import { existsSync as existsSync35 } from "fs";
116805
+ import { existsSync as existsSync34 } from "fs";
116599
116806
  import { fileURLToPath as fileURLToPath2 } from "url";
116600
116807
  var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
116601
116808
  function sharedSkillsRootPath() {
116602
116809
  const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
116603
- return candidates.find((candidate) => existsSync35(candidate)) ?? candidates[0];
116810
+ return candidates.find((candidate) => existsSync34(candidate)) ?? candidates[0];
116604
116811
  }
116605
116812
 
116606
116813
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
@@ -119212,7 +119419,7 @@ function getClaudeConfigDir() {
119212
119419
  return join73(getHomeDirectory(), ".claude");
119213
119420
  }
119214
119421
  // packages/skills-loader-core/src/shared/opencode-config-dir.ts
119215
- import { existsSync as existsSync36, realpathSync as realpathSync9 } from "fs";
119422
+ import { existsSync as existsSync35, realpathSync as realpathSync9 } from "fs";
119216
119423
  import { homedir as homedir15 } from "os";
119217
119424
  import { join as join74, posix as posix10, resolve as resolve21, win32 as win326 } from "path";
119218
119425
 
@@ -119264,7 +119471,7 @@ function resolveConfigPath2(pathValue) {
119264
119471
  return posix10.normalize(pathValue);
119265
119472
  }
119266
119473
  const resolvedPath = resolve21(pathValue);
119267
- if (!existsSync36(resolvedPath))
119474
+ if (!existsSync35(resolvedPath))
119268
119475
  return resolvedPath;
119269
119476
  try {
119270
119477
  return realpathSync9(resolvedPath);
@@ -119331,7 +119538,7 @@ function getOpenCodeConfigDir2(options) {
119331
119538
  const legacyDir = getCliConfigDir2();
119332
119539
  const legacyConfig = join74(legacyDir, "opencode.json");
119333
119540
  const legacyConfigC = join74(legacyDir, "opencode.jsonc");
119334
- if (existsSync36(legacyConfig) || existsSync36(legacyConfigC)) {
119541
+ if (existsSync35(legacyConfig) || existsSync35(legacyConfigC)) {
119335
119542
  return legacyDir;
119336
119543
  }
119337
119544
  }
@@ -119339,12 +119546,12 @@ function getOpenCodeConfigDir2(options) {
119339
119546
  }
119340
119547
  // packages/skills-loader-core/src/shared/project-discovery-dirs.ts
119341
119548
  import { execFileSync as execFileSync3 } from "child_process";
119342
- import { existsSync as existsSync37, realpathSync as realpathSync10 } from "fs";
119549
+ import { existsSync as existsSync36, realpathSync as realpathSync10 } from "fs";
119343
119550
  import { dirname as dirname28, join as join75, resolve as resolve22, win32 as win327 } from "path";
119344
119551
  var worktreePathCache2 = new Map;
119345
119552
  function normalizePath(path) {
119346
119553
  const resolvedPath = process.platform !== "win32" && win327.isAbsolute(path) ? path : resolve22(path);
119347
- if (!existsSync37(resolvedPath)) {
119554
+ if (!existsSync36(resolvedPath)) {
119348
119555
  return resolvedPath;
119349
119556
  }
119350
119557
  try {
@@ -119375,7 +119582,7 @@ function detectWorktreePath(directory) {
119375
119582
  }
119376
119583
  let ancestor = normalizePath(resolvedDirectory);
119377
119584
  while (true) {
119378
- if (existsSync37(join75(ancestor, ".git"))) {
119585
+ if (existsSync36(join75(ancestor, ".git"))) {
119379
119586
  worktreePathCache2.set(cacheKey, ancestor);
119380
119587
  return ancestor;
119381
119588
  }
@@ -121338,20 +121545,20 @@ function buildTaskRef(section, label) {
121338
121545
  };
121339
121546
  }
121340
121547
  // packages/boulder-state/src/top-level-task.ts
121341
- import { existsSync as existsSync38, readFileSync as readFileSync20 } from "fs";
121548
+ import { existsSync as existsSync37, readFileSync as readFileSync19 } from "fs";
121342
121549
  function readCurrentTopLevelTask(planPath) {
121343
- if (!existsSync38(planPath)) {
121550
+ if (!existsSync37(planPath)) {
121344
121551
  return null;
121345
121552
  }
121346
121553
  try {
121347
- const content = readFileSync20(planPath, "utf-8");
121554
+ const content = readFileSync19(planPath, "utf-8");
121348
121555
  return parseCurrentTopLevelTask(content);
121349
121556
  } catch {
121350
121557
  return null;
121351
121558
  }
121352
121559
  }
121353
121560
  // packages/boulder-state/src/storage/path.ts
121354
- import { existsSync as existsSync39 } from "fs";
121561
+ import { existsSync as existsSync38 } from "fs";
121355
121562
  import { isAbsolute as isAbsolute14, join as join78, relative as relative9, resolve as resolve24 } from "path";
121356
121563
  function getBoulderFilePath(directory) {
121357
121564
  return join78(directory, BOULDER_DIR, BOULDER_FILE);
@@ -121372,19 +121579,19 @@ function resolveBoulderPlanPath(directory, state) {
121372
121579
  }
121373
121580
  const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
121374
121581
  const worktreePlanPath = resolve24(absoluteWorktreePath, relativePlanPath);
121375
- return existsSync39(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
121582
+ return existsSync38(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
121376
121583
  }
121377
121584
  function resolveBoulderPlanPathForWork(directory, work) {
121378
121585
  return resolveBoulderPlanPath(directory, work);
121379
121586
  }
121380
121587
  // packages/boulder-state/src/storage/plan-progress.ts
121381
- import { existsSync as existsSync40, readFileSync as readFileSync21, readdirSync as readdirSync9, statSync as statSync5 } from "fs";
121588
+ import { existsSync as existsSync39, readFileSync as readFileSync20, readdirSync as readdirSync9, statSync as statSync5 } from "fs";
121382
121589
  function getPlanProgress(planPath) {
121383
- if (!existsSync40(planPath)) {
121590
+ if (!existsSync39(planPath)) {
121384
121591
  return { total: 0, completed: 0, isComplete: false };
121385
121592
  }
121386
121593
  try {
121387
- const content = readFileSync21(planPath, "utf-8");
121594
+ const content = readFileSync20(planPath, "utf-8");
121388
121595
  const checklist = parsePlanChecklist(content);
121389
121596
  return {
121390
121597
  total: checklist.total,
@@ -121463,14 +121670,14 @@ function selectMirrorWork(state) {
121463
121670
  return sorted[0] ?? null;
121464
121671
  }
121465
121672
  // packages/boulder-state/src/storage/read-state.ts
121466
- import { existsSync as existsSync41, readFileSync as readFileSync22 } from "fs";
121673
+ import { existsSync as existsSync40, readFileSync as readFileSync21 } from "fs";
121467
121674
  function readBoulderState(directory) {
121468
121675
  const filePath = getBoulderFilePath(directory);
121469
- if (!existsSync41(filePath)) {
121676
+ if (!existsSync40(filePath)) {
121470
121677
  return null;
121471
121678
  }
121472
121679
  try {
121473
- const content = readFileSync22(filePath, "utf-8");
121680
+ const content = readFileSync21(filePath, "utf-8");
121474
121681
  const parsed = JSON.parse(content);
121475
121682
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.keys(parsed).length === 0) {
121476
121683
  return null;
@@ -121538,17 +121745,17 @@ init_state();
121538
121745
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
121539
121746
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
121540
121747
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
121541
- import { existsSync as existsSync42, mkdirSync as mkdirSync15, readFileSync as readFileSync23, rmSync as rmSync7, writeFileSync as writeFileSync10 } from "fs";
121748
+ import { existsSync as existsSync41, mkdirSync as mkdirSync15, readFileSync as readFileSync22, rmSync as rmSync7, writeFileSync as writeFileSync10 } from "fs";
121542
121749
  import { join as join79 } from "path";
121543
121750
  function getMarkerPath(directory, sessionID) {
121544
121751
  return join79(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
121545
121752
  }
121546
121753
  function readContinuationMarker(directory, sessionID) {
121547
121754
  const markerPath = getMarkerPath(directory, sessionID);
121548
- if (!existsSync42(markerPath))
121755
+ if (!existsSync41(markerPath))
121549
121756
  return null;
121550
121757
  try {
121551
- const raw = readFileSync23(markerPath, "utf-8");
121758
+ const raw = readFileSync22(markerPath, "utf-8");
121552
121759
  const parsed = JSON.parse(raw);
121553
121760
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
121554
121761
  return null;
@@ -121613,7 +121820,7 @@ async function isSessionInBoulderLineage(input) {
121613
121820
  // packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
121614
121821
  init_shared();
121615
121822
  init_compaction_marker();
121616
- import { readFileSync as readFileSync24, readdirSync as readdirSync10 } from "fs";
121823
+ import { readFileSync as readFileSync23, readdirSync as readdirSync10 } from "fs";
121617
121824
  import { join as join80 } from "path";
121618
121825
  var defaultSessionLastAgentDeps = {
121619
121826
  getMessageDir,
@@ -121674,7 +121881,7 @@ async function getLastAgentFromSession(sessionID, client, deps = {}) {
121674
121881
  try {
121675
121882
  const messages = readdirSync10(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
121676
121883
  try {
121677
- const content = readFileSync24(join80(messageDir, fileName), "utf-8");
121884
+ const content = readFileSync23(join80(messageDir, fileName), "utf-8");
121678
121885
  const parsed = JSON.parse(content);
121679
121886
  return {
121680
121887
  fileName,
@@ -121717,7 +121924,7 @@ init_agent_display_names();
121717
121924
 
121718
121925
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
121719
121926
  init_frontmatter2();
121720
- import { existsSync as existsSync43, readFileSync as readFileSync25, writeFileSync as writeFileSync11, unlinkSync as unlinkSync6, mkdirSync as mkdirSync16 } from "fs";
121927
+ import { existsSync as existsSync42, readFileSync as readFileSync24, writeFileSync as writeFileSync11, unlinkSync as unlinkSync6, mkdirSync as mkdirSync16 } from "fs";
121721
121928
  import { dirname as dirname32, join as join81 } from "path";
121722
121929
 
121723
121930
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
@@ -121731,11 +121938,11 @@ function getStateFilePath(directory, customPath) {
121731
121938
  }
121732
121939
  function readState(directory, customPath) {
121733
121940
  const filePath = getStateFilePath(directory, customPath);
121734
- if (!existsSync43(filePath)) {
121941
+ if (!existsSync42(filePath)) {
121735
121942
  return null;
121736
121943
  }
121737
121944
  try {
121738
- const content = readFileSync25(filePath, "utf-8");
121945
+ const content = readFileSync24(filePath, "utf-8");
121739
121946
  const { data, body } = parseFrontmatter(content);
121740
121947
  const active = data.active;
121741
121948
  const iteration = data.iteration;
@@ -122861,12 +123068,12 @@ async function getLocalVersion(options = {}) {
122861
123068
  }
122862
123069
  }
122863
123070
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
122864
- import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
123071
+ import { existsSync as existsSync53, readFileSync as readFileSync34 } from "fs";
122865
123072
 
122866
123073
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
122867
123074
  init_extract_semver();
122868
123075
  init_bun_which_shim();
122869
- import { existsSync as existsSync51, accessSync as accessSync4, constants as constants12 } from "fs";
123076
+ import { existsSync as existsSync50, accessSync as accessSync4, constants as constants12 } from "fs";
122870
123077
  import { homedir as homedir19 } from "os";
122871
123078
  import { join as join88 } from "path";
122872
123079
 
@@ -122991,7 +123198,7 @@ function buildVersionCommand(binaryPath, platform) {
122991
123198
  }
122992
123199
  return [binaryPath, "--version"];
122993
123200
  }
122994
- function findDesktopBinary(platform = process.platform, checkExists = existsSync51) {
123201
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync50) {
122995
123202
  for (const desktopPath of getDesktopAppPaths(platform)) {
122996
123203
  if (checkExists(desktopPath)) {
122997
123204
  return { binary: "opencode", path: desktopPath };
@@ -122999,7 +123206,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
122999
123206
  }
123000
123207
  return null;
123001
123208
  }
123002
- async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync51) {
123209
+ async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync50) {
123003
123210
  for (const binary of OPENCODE_BINARIES2) {
123004
123211
  const path = bunWhich(binary);
123005
123212
  if (path && checkExists(path)) {
@@ -123057,12 +123264,12 @@ function compareVersions3(current, minimum) {
123057
123264
 
123058
123265
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
123059
123266
  init_shared();
123060
- import { existsSync as existsSync52, readFileSync as readFileSync33 } from "fs";
123267
+ import { existsSync as existsSync51, readFileSync as readFileSync32 } from "fs";
123061
123268
  function detectConfigPath() {
123062
123269
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
123063
- if (existsSync52(paths.configJsonc))
123270
+ if (existsSync51(paths.configJsonc))
123064
123271
  return paths.configJsonc;
123065
- if (existsSync52(paths.configJson))
123272
+ if (existsSync51(paths.configJson))
123066
123273
  return paths.configJson;
123067
123274
  return null;
123068
123275
  }
@@ -123110,7 +123317,7 @@ function getPluginInfo() {
123110
123317
  };
123111
123318
  }
123112
123319
  try {
123113
- const content = readFileSync33(configPath, "utf-8");
123320
+ const content = readFileSync32(configPath, "utf-8");
123114
123321
  const parsedConfig = parseJsonc(content);
123115
123322
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
123116
123323
  if (!pluginEntry) {
@@ -123152,7 +123359,7 @@ init_file_utils2();
123152
123359
  init_checker();
123153
123360
  init_auto_update_checker();
123154
123361
  init_package_json_locator();
123155
- import { existsSync as existsSync53, readFileSync as readFileSync34, readdirSync as readdirSync12 } from "fs";
123362
+ import { existsSync as existsSync52, readFileSync as readFileSync33, readdirSync as readdirSync12 } from "fs";
123156
123363
  import { createRequire } from "module";
123157
123364
  import { homedir as homedir20 } from "os";
123158
123365
  import { join as join89 } from "path";
@@ -123171,20 +123378,20 @@ function resolveOpenCodeCacheDir() {
123171
123378
  return join89(xdgCacheHome, "opencode");
123172
123379
  const fromShared = getOpenCodeCacheDir();
123173
123380
  const platformDefault = join89(getPlatformDefaultCacheDir(), "opencode");
123174
- if (existsSync53(fromShared) || !existsSync53(platformDefault))
123381
+ if (existsSync52(fromShared) || !existsSync52(platformDefault))
123175
123382
  return fromShared;
123176
123383
  return platformDefault;
123177
123384
  }
123178
123385
  function resolveExistingDir(dirPath) {
123179
- if (!existsSync53(dirPath))
123386
+ if (!existsSync52(dirPath))
123180
123387
  return dirPath;
123181
123388
  return resolveSymlink(dirPath);
123182
123389
  }
123183
123390
  function readPackageJson(filePath) {
123184
- if (!existsSync53(filePath))
123391
+ if (!existsSync52(filePath))
123185
123392
  return null;
123186
123393
  try {
123187
- const content = readFileSync34(filePath, "utf-8");
123394
+ const content = readFileSync33(filePath, "utf-8");
123188
123395
  return parseJsonc(content);
123189
123396
  } catch (error) {
123190
123397
  if (!(error instanceof Error)) {
@@ -123207,7 +123414,7 @@ function createPackageCandidates(rootDir) {
123207
123414
  }
123208
123415
  function createTaggedInstallCandidates(rootDir) {
123209
123416
  const packagesDir = join89(rootDir, "packages");
123210
- if (!existsSync53(packagesDir))
123417
+ if (!existsSync52(packagesDir))
123211
123418
  return [];
123212
123419
  const candidates = [];
123213
123420
  for (const entryName of readdirSync12(packagesDir).sort()) {
@@ -123229,7 +123436,7 @@ function createTaggedInstallCandidates(rootDir) {
123229
123436
  return candidates;
123230
123437
  }
123231
123438
  function selectInstalledPackage(candidate) {
123232
- return candidate.packageCandidates.find((packageCandidate) => existsSync53(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
123439
+ return candidate.packageCandidates.find((packageCandidate) => existsSync52(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
123233
123440
  }
123234
123441
  function getExpectedVersion(cachePackage, packageName) {
123235
123442
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -123240,7 +123447,7 @@ function resolveInstalledPackageJsonPath() {
123240
123447
  for (const packageName of ACCEPTED_PACKAGE_NAMES) {
123241
123448
  try {
123242
123449
  const packageJsonPath = require2.resolve(`${packageName}/package.json`);
123243
- if (existsSync53(packageJsonPath)) {
123450
+ if (existsSync52(packageJsonPath)) {
123244
123451
  return { packageName, packageJsonPath };
123245
123452
  }
123246
123453
  } catch {
@@ -123277,11 +123484,11 @@ function getLoadedPluginVersion() {
123277
123484
  },
123278
123485
  ...createTaggedInstallCandidates(cacheDir)
123279
123486
  ];
123280
- const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync53(packageCandidate.installedPackagePath))) ?? candidates[0];
123487
+ const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync52(packageCandidate.installedPackagePath))) ?? candidates[0];
123281
123488
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
123282
123489
  const selectedPackage = selectInstalledPackage(selectedCandidate);
123283
123490
  const candidateInstalledPath = selectedPackage.installedPackagePath;
123284
- const candidateExists = existsSync53(candidateInstalledPath);
123491
+ const candidateExists = existsSync52(candidateInstalledPath);
123285
123492
  const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
123286
123493
  const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
123287
123494
  const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
@@ -123317,8 +123524,8 @@ var defaultDeps5 = {
123317
123524
  getLoadedPluginVersion,
123318
123525
  getLatestPluginVersion,
123319
123526
  getSuggestedInstallTag,
123320
- configExists: existsSync54,
123321
- readConfigFile: (path) => readFileSync35(path, "utf-8"),
123527
+ configExists: existsSync53,
123528
+ readConfigFile: (path) => readFileSync34(path, "utf-8"),
123322
123529
  parseConfigContent: (content) => parseJsonc(content)
123323
123530
  };
123324
123531
  function isConfigValid(configPath, deps) {
@@ -123457,7 +123664,7 @@ async function checkSystem(deps = defaultDeps5) {
123457
123664
 
123458
123665
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
123459
123666
  init_shared();
123460
- import { existsSync as existsSync55, readFileSync as readFileSync36 } from "fs";
123667
+ import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
123461
123668
  import { homedir as homedir21 } from "os";
123462
123669
  import { join as join90 } from "path";
123463
123670
  function getUserConfigDir2() {
@@ -123470,10 +123677,10 @@ function loadCustomProviderNames() {
123470
123677
  const configDir = getUserConfigDir2();
123471
123678
  const candidatePaths = [join90(configDir, "opencode.json"), join90(configDir, "opencode.jsonc")];
123472
123679
  for (const configPath of candidatePaths) {
123473
- if (!existsSync55(configPath))
123680
+ if (!existsSync54(configPath))
123474
123681
  continue;
123475
123682
  try {
123476
- const content = readFileSync36(configPath, "utf-8");
123683
+ const content = readFileSync35(configPath, "utf-8");
123477
123684
  const data = parseJsonc(content);
123478
123685
  if (data?.provider && typeof data.provider === "object") {
123479
123686
  return Object.keys(data.provider);
@@ -123490,14 +123697,14 @@ function loadCustomProviderNames() {
123490
123697
  function loadAvailableModelsFromCache() {
123491
123698
  const cacheFile = join90(getOpenCodeCacheDir(), "models.json");
123492
123699
  const customProviders = loadCustomProviderNames();
123493
- if (!existsSync55(cacheFile)) {
123700
+ if (!existsSync54(cacheFile)) {
123494
123701
  if (customProviders.length > 0) {
123495
123702
  return { providers: customProviders, modelCount: 0, cacheExists: true };
123496
123703
  }
123497
123704
  return { providers: [], modelCount: 0, cacheExists: false };
123498
123705
  }
123499
123706
  try {
123500
- const content = readFileSync36(cacheFile, "utf-8");
123707
+ const content = readFileSync35(cacheFile, "utf-8");
123501
123708
  const data = parseJsonc(content);
123502
123709
  const cacheProviders = Object.keys(data);
123503
123710
  let modelCount = 0;
@@ -123939,7 +124146,7 @@ async function checkBrowserProvider() {
123939
124146
  init_src4();
123940
124147
  init_main();
123941
124148
  init_config_migration();
123942
- import { existsSync as existsSync56, readFileSync as readFileSync37 } from "fs";
124149
+ import { existsSync as existsSync55, readFileSync as readFileSync36 } from "fs";
123943
124150
  import { join as join92 } from "path";
123944
124151
  var CANONICAL_REPLACEMENT = new Map([
123945
124152
  ["variant", "reasoning"],
@@ -124007,10 +124214,10 @@ async function checkDeprecatedReasoningKeys() {
124007
124214
  const issues = [];
124008
124215
  const scanned = [];
124009
124216
  for (const configPath of userConfigPaths()) {
124010
- if (!existsSync56(configPath))
124217
+ if (!existsSync55(configPath))
124011
124218
  continue;
124012
124219
  scanned.push(configPath);
124013
- const parsed = parse2(readFileSync37(configPath, "utf-8"));
124220
+ const parsed = parse2(readFileSync36(configPath, "utf-8"));
124014
124221
  issues.push(...collectIssues(configPath, parsed, "", migrateFixSuffix(parsed)));
124015
124222
  }
124016
124223
  return {
@@ -124023,7 +124230,7 @@ async function checkDeprecatedReasoningKeys() {
124023
124230
  }
124024
124231
 
124025
124232
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
124026
- import { existsSync as existsSync57 } from "fs";
124233
+ import { existsSync as existsSync56 } from "fs";
124027
124234
  import { createRequire as createRequire3 } from "module";
124028
124235
  import { homedir as homedir23 } from "os";
124029
124236
  import { join as join97 } from "path";
@@ -124043,10 +124250,10 @@ function commentCheckerCacheDir(input) {
124043
124250
  return join93(base, input.cacheDirName, "bin");
124044
124251
  }
124045
124252
  // packages/comment-checker-core/src/cached-release.ts
124046
- import { readFileSync as readFileSync38, writeFileSync as writeFileSync14 } from "fs";
124253
+ import { readFileSync as readFileSync37, writeFileSync as writeFileSync14 } from "fs";
124047
124254
  import { join as join94 } from "path";
124048
124255
  var COMMENT_CHECKER_VERSION_MARKER = "comment-checker.version";
124049
- function isCachedCommentCheckerCurrent(cacheDir, readFile = (path) => readFileSync38(path, "utf-8")) {
124256
+ function isCachedCommentCheckerCurrent(cacheDir, readFile = (path) => readFileSync37(path, "utf-8")) {
124050
124257
  try {
124051
124258
  return readFile(join94(cacheDir, COMMENT_CHECKER_VERSION_MARKER)).trim() === COMMENT_CHECKER_RELEASE_VERSION;
124052
124259
  } catch {
@@ -124183,7 +124390,7 @@ function findCommentCheckerPackageBinary2(baseDirOverride, resolvePackageJsonPat
124183
124390
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
124184
124391
  try {
124185
124392
  const packageJsonPath = baseDirOverride === undefined ? resolvePackageJsonPath() : join97(baseDirOverride, "package.json");
124186
- return findCommentCheckerPackageBinary({ packageJsonPath, binaryName, existsSync: existsSync57 });
124393
+ return findCommentCheckerPackageBinary({ packageJsonPath, binaryName, existsSync: existsSync56 });
124187
124394
  } catch (error) {
124188
124395
  if (!(error instanceof Error) && !isModuleResolutionFailure(error))
124189
124396
  throw error;
@@ -124332,7 +124539,7 @@ async function getGhCliInfo(dependencies = {}) {
124332
124539
  // packages/omo-opencode/src/mcp/lsp.ts
124333
124540
  init_zod();
124334
124541
  init_opencode_config_dir();
124335
- import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
124542
+ import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
124336
124543
  import { delimiter as delimiter3, dirname as dirname39, resolve as resolve26 } from "path";
124337
124544
  import { fileURLToPath as fileURLToPath7 } from "url";
124338
124545
 
@@ -124476,7 +124683,7 @@ function findBootstrapRoot(candidates, pathExists) {
124476
124683
  }
124477
124684
  function readDaemonPackageVersion(root) {
124478
124685
  try {
124479
- const packageJson = JSON.parse(readFileSync39(resolve26(root, PACKAGE_REL, "package.json"), "utf-8"));
124686
+ const packageJson = JSON.parse(readFileSync38(resolve26(root, PACKAGE_REL, "package.json"), "utf-8"));
124480
124687
  return DaemonPackageSchema.parse(packageJson).version;
124481
124688
  } catch (error) {
124482
124689
  if (!(error instanceof Error))
@@ -124498,7 +124705,7 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
124498
124705
  };
124499
124706
  }
124500
124707
  function resolveLspCommand(options = {}) {
124501
- const pathExists = options.exists ?? existsSync58;
124708
+ const pathExists = options.exists ?? existsSync57;
124502
124709
  const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
124503
124710
  const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
124504
124711
  const candidates = moduleDirectory ? createAncestorCliCandidates({
@@ -124559,7 +124766,7 @@ function getInstalledLspServers(options = {}) {
124559
124766
 
124560
124767
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
124561
124768
  init_shared();
124562
- import { existsSync as existsSync59, readFileSync as readFileSync40 } from "fs";
124769
+ import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
124563
124770
  import { homedir as homedir24 } from "os";
124564
124771
  import { join as join98 } from "path";
124565
124772
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -124573,10 +124780,10 @@ function getMcpConfigPaths() {
124573
124780
  function loadUserMcpConfig() {
124574
124781
  const servers = {};
124575
124782
  for (const configPath of getMcpConfigPaths()) {
124576
- if (!existsSync59(configPath))
124783
+ if (!existsSync58(configPath))
124577
124784
  continue;
124578
124785
  try {
124579
- const content = readFileSync40(configPath, "utf-8");
124786
+ const content = readFileSync39(configPath, "utf-8");
124580
124787
  const config = parseJsonc(content);
124581
124788
  if (config.mcpServers) {
124582
124789
  Object.assign(servers, config.mcpServers);
@@ -124711,17 +124918,17 @@ async function checkTools() {
124711
124918
 
124712
124919
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
124713
124920
  init_src5();
124714
- import { existsSync as existsSync60, readFileSync as readFileSync41 } from "fs";
124921
+ import { existsSync as existsSync59, readFileSync as readFileSync40 } from "fs";
124715
124922
  function isTelemetryState(value) {
124716
124923
  return value !== null && typeof value === "object" && !Array.isArray(value);
124717
124924
  }
124718
124925
  function readLastActiveDay(stateFilePath) {
124719
- if (!existsSync60(stateFilePath)) {
124926
+ if (!existsSync59(stateFilePath)) {
124720
124927
  return "never";
124721
124928
  }
124722
124929
  let parsed;
124723
124930
  try {
124724
- parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
124931
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
124725
124932
  } catch (error) {
124726
124933
  if (error instanceof Error) {
124727
124934
  return "unreadable";
@@ -124846,7 +125053,7 @@ async function pathExists2(dir) {
124846
125053
 
124847
125054
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
124848
125055
  init_src();
124849
- import { existsSync as existsSync61 } from "fs";
125056
+ import { existsSync as existsSync60 } from "fs";
124850
125057
  import { lstat as lstat17, readdir as readdir15, readFile as readFile31 } from "fs/promises";
124851
125058
  import { homedir as homedir26 } from "os";
124852
125059
  import { basename as basename13, join as join99, resolve as resolve27 } from "path";
@@ -124866,6 +125073,10 @@ var package_default3 = {
124866
125073
  types: "./src/cli/service-auth/index.ts",
124867
125074
  import: "./src/cli/service-auth/index.ts"
124868
125075
  },
125076
+ "./account-home": {
125077
+ types: "./src/cli/service-auth/account-home.ts",
125078
+ import: "./src/cli/service-auth/account-home.ts"
125079
+ },
124869
125080
  "./binary-downloader": {
124870
125081
  types: "./src/shared/binary-downloader.ts",
124871
125082
  import: "./src/shared/binary-downloader.ts"
@@ -124876,8 +125087,8 @@ var package_default3 = {
124876
125087
  },
124877
125088
  dependencies: {
124878
125089
  "@clack/prompts": "^1.8.1",
124879
- "@code-yeongyu/senpi": "2026.11.19-5",
124880
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.19-5",
125090
+ "@code-yeongyu/senpi": "2026.11.23",
125091
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.23",
124881
125092
  "@modelcontextprotocol/sdk": "^1.30.0",
124882
125093
  "@oh-my-opencode/agents-md-core": "workspace:*",
124883
125094
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -125055,14 +125266,14 @@ function buildCodexIssues(summary) {
125055
125266
  }
125056
125267
  async function resolveInstalledPluginRoot(codexHome) {
125057
125268
  const pluginRoot = join99(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME3);
125058
- if (!existsSync61(pluginRoot))
125269
+ if (!existsSync60(pluginRoot))
125059
125270
  return null;
125060
125271
  const versions = await readdir15(pluginRoot, { withFileTypes: true });
125061
125272
  const candidates = versions.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
125062
125273
  return candidates.length === 0 ? null : join99(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
125063
125274
  }
125064
125275
  async function readCodexConfigSummary(configPath) {
125065
- if (!existsSync61(configPath)) {
125276
+ if (!existsSync60(configPath)) {
125066
125277
  return {
125067
125278
  exists: false,
125068
125279
  marketplaceConfigured: false,
@@ -125094,7 +125305,7 @@ async function readLinkedBins(binDir) {
125094
125305
  }
125095
125306
  async function readLinkedAgents(codexHome) {
125096
125307
  const agentsDir = join99(codexHome, "agents");
125097
- if (!existsSync61(agentsDir))
125308
+ if (!existsSync60(agentsDir))
125098
125309
  return [];
125099
125310
  const entries = await readdir15(agentsDir, { withFileTypes: true });
125100
125311
  return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
@@ -125507,7 +125718,7 @@ function isRecord18(value) {
125507
125718
  }
125508
125719
 
125509
125720
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
125510
- import { existsSync as existsSync62 } from "fs";
125721
+ import { existsSync as existsSync61 } from "fs";
125511
125722
  import { readFile as readFile33 } from "fs/promises";
125512
125723
  import { homedir as homedir28 } from "os";
125513
125724
  import { join as join101, resolve as resolve29 } from "path";
@@ -125527,7 +125738,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
125527
125738
  const issues = [];
125528
125739
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
125529
125740
  const targetPath = parseRuntimeTargetPath(wrapper);
125530
- if (targetPath !== null && !existsSync62(targetPath)) {
125741
+ if (targetPath !== null && !existsSync61(targetPath)) {
125531
125742
  issues.push({
125532
125743
  title: "omo-agent-toolkit runtime wrapper target is missing",
125533
125744
  description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
@@ -126089,10 +126300,10 @@ init_commander();
126089
126300
  import { createHash as createHash8 } from "crypto";
126090
126301
  import {
126091
126302
  chmodSync as chmodSync6,
126092
- existsSync as existsSync65,
126303
+ existsSync as existsSync64,
126093
126304
  mkdirSync as mkdirSync18,
126094
126305
  readdirSync as readdirSync13,
126095
- readFileSync as readFileSync43,
126306
+ readFileSync as readFileSync42,
126096
126307
  renameSync as renameSync8,
126097
126308
  unlinkSync as unlinkSync9,
126098
126309
  writeFileSync as writeFileSync16
@@ -126100,12 +126311,12 @@ import {
126100
126311
  import { basename as basename14, dirname as dirname41, join as join104 } from "path";
126101
126312
 
126102
126313
  // packages/mcp-client-core/src/config-dir.ts
126103
- import { existsSync as existsSync63, realpathSync as realpathSync12 } from "fs";
126314
+ import { existsSync as existsSync62, realpathSync as realpathSync12 } from "fs";
126104
126315
  import { homedir as homedir29 } from "os";
126105
126316
  import { join as join102, resolve as resolve30 } from "path";
126106
126317
  function resolveConfigPath3(pathValue) {
126107
126318
  const resolvedPath = resolve30(pathValue);
126108
- if (!existsSync63(resolvedPath))
126319
+ if (!existsSync62(resolvedPath))
126109
126320
  return resolvedPath;
126110
126321
  try {
126111
126322
  return realpathSync12(resolvedPath);
@@ -126125,7 +126336,7 @@ function getOpenCodeCliConfigDir(env = process.env) {
126125
126336
  }
126126
126337
 
126127
126338
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
126128
- import { chmodSync as chmodSync5, existsSync as existsSync64, readFileSync as readFileSync42, renameSync as renameSync7, writeFileSync as writeFileSync15 } from "fs";
126339
+ import { chmodSync as chmodSync5, existsSync as existsSync63, readFileSync as readFileSync41, renameSync as renameSync7, writeFileSync as writeFileSync15 } from "fs";
126129
126340
  import { join as join103 } from "path";
126130
126341
  var INDEX_FILE_NAME = "index.json";
126131
126342
  function isTokenIndex(value) {
@@ -126138,10 +126349,10 @@ function getIndexPath(storageDir) {
126138
126349
  }
126139
126350
  function readTokenIndex(storageDir) {
126140
126351
  const indexPath = getIndexPath(storageDir);
126141
- if (!existsSync64(indexPath))
126352
+ if (!existsSync63(indexPath))
126142
126353
  return {};
126143
126354
  try {
126144
- const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
126355
+ const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
126145
126356
  return isTokenIndex(parsed) ? parsed : {};
126146
126357
  } catch (readError) {
126147
126358
  if (!(readError instanceof Error))
@@ -126252,10 +126463,10 @@ function isOAuthTokenData(value) {
126252
126463
  return clientSecret === undefined || typeof clientSecret === "string";
126253
126464
  }
126254
126465
  function readTokenFile(filePath) {
126255
- if (!existsSync65(filePath))
126466
+ if (!existsSync64(filePath))
126256
126467
  return null;
126257
126468
  try {
126258
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
126469
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
126259
126470
  return isOAuthTokenData(parsed) ? parsed : null;
126260
126471
  } catch (readError) {
126261
126472
  if (!(readError instanceof Error))
@@ -126265,10 +126476,10 @@ function readTokenFile(filePath) {
126265
126476
  }
126266
126477
  function readLegacyStore() {
126267
126478
  const filePath = getLegacyStoragePath();
126268
- if (!existsSync65(filePath))
126479
+ if (!existsSync64(filePath))
126269
126480
  return null;
126270
126481
  try {
126271
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
126482
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
126272
126483
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
126273
126484
  return null;
126274
126485
  const result = {};
@@ -126286,7 +126497,7 @@ function readLegacyStore() {
126286
126497
  function writeTokenFile(filePath, token) {
126287
126498
  try {
126288
126499
  const dir = dirname41(filePath);
126289
- if (!existsSync65(dir)) {
126500
+ if (!existsSync64(dir)) {
126290
126501
  mkdirSync18(dir, { recursive: true });
126291
126502
  }
126292
126503
  const tempPath = `${filePath}.tmp.${Date.now()}`;
@@ -126310,7 +126521,7 @@ function saveToken(serverHost, resource, token) {
126310
126521
  }
126311
126522
  function deleteToken(serverHost, resource) {
126312
126523
  const filePath = getMcpOauthStoragePath(serverHost, resource);
126313
- if (!existsSync65(filePath))
126524
+ if (!existsSync64(filePath))
126314
126525
  return deleteLegacyToken(serverHost, resource);
126315
126526
  try {
126316
126527
  unlinkSync9(filePath);
@@ -126334,7 +126545,7 @@ function deleteLegacyToken(serverHost, resource) {
126334
126545
  if (Object.keys(store).length === 0) {
126335
126546
  try {
126336
126547
  const filePath = getLegacyStoragePath();
126337
- if (existsSync65(filePath))
126548
+ if (existsSync64(filePath))
126338
126549
  unlinkSync9(filePath);
126339
126550
  return true;
126340
126551
  } catch (deleteError) {
@@ -126381,7 +126592,7 @@ function listTokensByHost(serverHost) {
126381
126592
  function listAllTokens() {
126382
126593
  const result = { ...readLegacyStore() ?? {} };
126383
126594
  const dir = getMcpOauthStorageDir();
126384
- if (!existsSync65(dir))
126595
+ if (!existsSync64(dir))
126385
126596
  return result;
126386
126597
  const index = readTokenIndex(dir);
126387
126598
  for (const entry of readdirSync13(dir, { withFileTypes: true })) {
@@ -128250,9 +128461,9 @@ var {
128250
128461
  chmodSync: chmodSync7,
128251
128462
  fsyncSync: fsyncSync3,
128252
128463
  linkSync,
128253
- lstatSync: lstatSync5,
128464
+ lstatSync: lstatSync6,
128254
128465
  mkdirSync: mkdirSync19,
128255
- readFileSync: readFileSync44,
128466
+ readFileSync: readFileSync43,
128256
128467
  readdirSync: readdirSync14,
128257
128468
  realpathSync: realpathSync13,
128258
128469
  statSync: statSync8,
@@ -128327,7 +128538,7 @@ import { join as join111 } from "path";
128327
128538
 
128328
128539
  // packages/omo-opencode/src/cli/service-auth/account-home.ts
128329
128540
  import { execFileSync as execFileSync5 } from "child_process";
128330
- import { accessSync as accessSync6, constants as constants13, mkdirSync as mkdirSync20, readFileSync as readFileSync45, statSync as statSync9 } from "fs";
128541
+ import { accessSync as accessSync6, constants as constants13, mkdirSync as mkdirSync20, readFileSync as readFileSync44, statSync as statSync9 } from "fs";
128331
128542
  import { homedir as homedir31 } from "os";
128332
128543
  import { join as join106, posix as posix13, win32 as win3210 } from "path";
128333
128544
  var lockDirectoryIn = (home) => join106(home, ".omo", "session-locks");
@@ -128397,7 +128608,7 @@ var systemPlatformFacts = {
128397
128608
  platform: process.platform,
128398
128609
  uid: process.getuid?.(),
128399
128610
  env: process.env,
128400
- readFile: (path) => readFileSync45(path, "utf8"),
128611
+ readFile: (path) => readFileSync44(path, "utf8"),
128401
128612
  isFile: (path) => statSync9(path, { throwIfNoEntry: false })?.isFile() ?? false,
128402
128613
  run: (command, args) => execFileSync5(command, args, {
128403
128614
  encoding: "utf8",
@@ -128942,7 +129153,7 @@ var processApprovalCache = () => {
128942
129153
  };
128943
129154
 
128944
129155
  // packages/omo-opencode/src/cli/service-auth/keychain-helper/dedicated-store.ts
128945
- import { lstatSync as lstatSync6 } from "fs";
129156
+ import { lstatSync as lstatSync7 } from "fs";
128946
129157
  import { userInfo as userInfo2 } from "os";
128947
129158
  import { join as join109 } from "path";
128948
129159
  var DEDICATED_STORE_DIRECTORY = join109("Library", "Application Support", "OmO", "credential-keychain");
@@ -128950,7 +129161,7 @@ var accountHomeDirectory = () => userInfo2().homedir;
128950
129161
  var dedicatedStoreRoot = (home = accountHomeDirectory()) => join109(home, DEDICATED_STORE_DIRECTORY);
128951
129162
  var exists7 = (path) => {
128952
129163
  try {
128953
- lstatSync6(path);
129164
+ lstatSync7(path);
128954
129165
  return true;
128955
129166
  } catch {
128956
129167
  return false;
@@ -132160,7 +132371,7 @@ function configureServiceAuthCommands(program, open = serviceAccountsOpen(), hoo
132160
132371
  }
132161
132372
 
132162
132373
  // packages/omo-native/device-service-handoff.ts
132163
- import { existsSync as existsSync68 } from "fs";
132374
+ import { existsSync as existsSync67 } from "fs";
132164
132375
 
132165
132376
  // packages/device-service-core/src/index.ts
132166
132377
  init_device_service2();
@@ -132170,12 +132381,12 @@ init_client4();
132170
132381
  init_background_transport();
132171
132382
  init_device_service2();
132172
132383
  // packages/device-service-core/src/bootstrap.ts
132173
- import { existsSync as existsSync67 } from "fs";
132384
+ import { existsSync as existsSync66 } from "fs";
132174
132385
  init_device_service2();
132175
132386
 
132176
132387
  // packages/device-service-core/src/hand-device-keys.ts
132177
132388
  init_device_service2();
132178
- import { existsSync as existsSync66 } from "fs";
132389
+ import { existsSync as existsSync65 } from "fs";
132179
132390
  var DEAD_ENDPOINT_CODES = new Set(["ENOENT", "ECONNREFUSED", "ECONNRESET", "EPIPE"]);
132180
132391
  var connectFailure = (error) => {
132181
132392
  const detail = error instanceof Error ? error.message : String(error);
@@ -132202,7 +132413,7 @@ var connectOrNotRunning = async (connect, log) => {
132202
132413
  };
132203
132414
  var adopted = (status) => status.device !== null && status.state !== "sign_in_required";
132204
132415
  var handDeviceKeys = async (options) => {
132205
- if (!existsSync66(deviceServiceEndpointPath(options.stateDir)))
132416
+ if (!existsSync65(deviceServiceEndpointPath(options.stateDir)))
132206
132417
  return "not_running";
132207
132418
  const service = await connectOrNotRunning(options.connect, options.log);
132208
132419
  if (service === "not_running")
@@ -132220,7 +132431,7 @@ var handDeviceKeys = async (options) => {
132220
132431
  // packages/device-service-core/src/bootstrap.ts
132221
132432
  init_version2();
132222
132433
  var forgetDeviceService = async (options) => {
132223
- if (!existsSync67(deviceServiceEndpointPath(options.stateDir)))
132434
+ if (!existsSync66(deviceServiceEndpointPath(options.stateDir)))
132224
132435
  return "not_running";
132225
132436
  const service = await connectOrNotRunning(options.connect, options.log);
132226
132437
  if (service === "not_running")
@@ -132247,34 +132458,11 @@ init_dacl();
132247
132458
  // packages/device-service-core/src/release/windows-dacl.ts
132248
132459
  init_errors4();
132249
132460
  init_dacl();
132250
- import { spawn as spawn7 } from "child_process";
132251
132461
  var SID_TOKEN_SCRIPT = String.raw`
132252
132462
  $ErrorActionPreference = 'Stop'
132253
132463
  (New-Object System.Security.AccessControl.RawSecurityDescriptor("O:$env:LA_SID")).GetSddlForm('Owner')
132254
132464
  `;
132255
- var runPowerShell2 = async (script, env) => {
132256
- const encoded = Buffer.from(script, "utf16le").toString("base64");
132257
- const proc = spawn7("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded], { env: { ...process.env, ...env }, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
132258
- const chunks = [];
132259
- const errChunks = [];
132260
- proc.stdout.on("data", (chunk) => chunks.push(chunk));
132261
- proc.stderr.on("data", (chunk) => errChunks.push(chunk));
132262
- const code = await new Promise((resolve, reject) => {
132263
- proc.once("error", reject);
132264
- proc.once("close", (exitCode) => resolve(exitCode ?? -1));
132265
- });
132266
- return { code, out: Buffer.concat(chunks).toString("utf8"), err: Buffer.concat(errChunks).toString("utf8") };
132267
- };
132268
- var XML_ENTITIES = { lt: "<", gt: ">", quot: '"', apos: "'", amp: "&" };
132269
- var clixmlText = (line) => [...line.matchAll(/<S(?: S="[^"]*")?>([^<]*)<\/S>/g)].map((match) => match[1] ?? "").join("").replace(/_x([0-9A-Fa-f]{4})_/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(/&(lt|gt|quot|apos|amp);/g, (_, entity) => XML_ENTITIES[entity] ?? "");
132270
- var POSITION_LINE = /^(?:At line:\d|At .*char:\d|\+ )/;
132271
- var errorMessage = (err) => {
132272
- const lines = (err ?? "").split(/\r?\n/).filter((text) => !text.trim().startsWith("#< CLIXML")).flatMap((text) => text.trim().startsWith("<") ? clixmlText(text).split(/\r?\n/) : [text]).map((text) => text.trim()).filter((text) => text !== "");
132273
- const end = lines.findIndex((text) => POSITION_LINE.test(text));
132274
- const message = lines.slice(0, end === -1 ? lines.length : end).join(" ");
132275
- return message === "" ? "" : `: ${message.slice(0, 300)}`;
132276
- };
132277
- var userSidToken = async (userSid, run = runPowerShell2) => {
132465
+ var userSidToken = async (userSid, run = runPowerShell) => {
132278
132466
  const { code, out } = await run(SID_TOKEN_SCRIPT, { LA_SID: userSid });
132279
132467
  const match = code === 0 ? /^O:(S-1-\d+(?:-\d+)+|[A-Z]{2})$/.exec(out.trim()) : null;
132280
132468
  return match?.[1];
@@ -132283,28 +132471,7 @@ var aliasedDaclVerdict = (dacl, userSid, kind, userAlias) => {
132283
132471
  const asSid = (token) => userAlias !== undefined && token === userAlias ? userSid : token;
132284
132472
  return exactDaclVerdict({ ...dacl, owner: asSid(dacl.owner), aces: dacl.aces.map((ace) => ({ ...ace, sid: asSid(ace.sid) })) }, userSid, kind);
132285
132473
  };
132286
- var OWNER_LINE = `$acl.SetOwner($sid)
132287
- `;
132288
- var SET_ACL_LINE = `Set-Acl -LiteralPath $env:LA_PATH -AclObject $acl
132289
- `;
132290
- var SET_DACL_LINE = `(Get-Item -LiteralPath $env:LA_PATH -Force).SetAccessControl($acl)
132291
- `;
132292
- var RUNNER_PREFIX = String.raw`$ProgressPreference = 'SilentlyContinue'
132293
- $ErrorActionPreference = 'Stop'
132294
- $ownerSet = & icacls.exe $env:LA_PATH /setowner "*$($env:LA_SID)" 2>&1
132295
- if ($LASTEXITCODE -ne 0) { throw "setowner failed: $ownerSet" }
132296
- `;
132297
- if (!APPLY_DACL_SCRIPT.includes(OWNER_LINE) || !APPLY_DACL_SCRIPT.includes(SET_ACL_LINE)) {
132298
- throw new Error("the vendored DACL script no longer sets the owner and the ACL on their own lines");
132299
- }
132300
- var RUNNER_APPLY_SCRIPT = APPLY_DACL_SCRIPT.replace(`$ErrorActionPreference = 'Stop'
132301
- `, RUNNER_PREFIX).replace(OWNER_LINE, "").replace(SET_ACL_LINE, SET_DACL_LINE);
132302
- var applyExactDacl2 = async (path, userSid, kind, run = runPowerShell2) => {
132303
- const { code, err } = await run(RUNNER_APPLY_SCRIPT, { LA_PATH: path, LA_SID: userSid, LA_KIND: kind });
132304
- if (code !== 0)
132305
- throw new LocalApiError("insecure_state_dir", `the exact DACL could not be applied${errorMessage(err)}`);
132306
- };
132307
- var verifyExactDacl2 = async (path, userSid, kind, run = runPowerShell2) => {
132474
+ var verifyExactDacl2 = async (path, userSid, kind, run = runPowerShell) => {
132308
132475
  let dacl;
132309
132476
  try {
132310
132477
  dacl = await describeDacl(path, run);
@@ -132315,9 +132482,9 @@ var verifyExactDacl2 = async (path, userSid, kind, run = runPowerShell2) => {
132315
132482
  }
132316
132483
  return aliasedDaclVerdict(dacl, userSid, kind, await userSidToken(userSid, run));
132317
132484
  };
132318
- var windowsSecureFile2 = (userSid, run = runPowerShell2) => async (path, kind) => {
132485
+ var windowsSecureFile2 = (userSid, run = runPowerShell) => async (path, kind) => {
132319
132486
  const target = kind === "dir" ? "dir" : "file";
132320
- await applyExactDacl2(path, userSid, target, run);
132487
+ await applyExactDacl(path, userSid, target, run);
132321
132488
  if (!await verifyExactDacl2(path, userSid, target, run))
132322
132489
  throw new LocalApiError("insecure_state_dir", "the DACL is not exactly one ACE for the user");
132323
132490
  };
@@ -132390,7 +132557,7 @@ var DEVICE_SERVICE_RELEASE_KEYS = parseReleaseKeySet(release_key_default);
132390
132557
 
132391
132558
  // packages/device-service-core/src/release/acquire.ts
132392
132559
  init_version2();
132393
- var platformSecure = process.platform === "win32" ? async (path, kind) => windowsSecureFile2(await currentUserSid())(path, kind) : posixSecureFile;
132560
+ var platformSecure = process.platform === "win32" ? async (path, kind, origin) => windowsSecureFile2(await currentUserSid())(path, kind, origin) : posixSecureFile;
132394
132561
  // packages/device-service-core/src/registrant.ts
132395
132562
  init_device_service2();
132396
132563
  var NONE2 = Symbol("none registered");
@@ -132400,7 +132567,7 @@ init_timers();
132400
132567
  // packages/omo-native/package.json
132401
132568
  var package_default4 = {
132402
132569
  name: "omo-ai",
132403
- version: "5.1.81",
132570
+ version: "5.1.83",
132404
132571
  type: "module",
132405
132572
  description: "OmO Native - the standalone omo command with the OMO extension built in: bun add -g omo-ai",
132406
132573
  bin: {
@@ -132417,7 +132584,7 @@ var package_default4 = {
132417
132584
  postinstall: "node bin/senpi-patch.mjs"
132418
132585
  },
132419
132586
  dependencies: {
132420
- "@code-yeongyu/senpi": "2026.11.19-5"
132587
+ "@code-yeongyu/senpi": "2026.11.23"
132421
132588
  },
132422
132589
  repository: {
132423
132590
  type: "git",
@@ -132449,7 +132616,7 @@ function cliDeviceServiceHandoff(options) {
132449
132616
  };
132450
132617
  return {
132451
132618
  adopt: async (credentials) => {
132452
- if (!existsSync68(deviceServiceEndpointPath(stateDir)))
132619
+ if (!existsSync67(deviceServiceEndpointPath(stateDir)))
132453
132620
  return;
132454
132621
  try {
132455
132622
  const account = await accountOf(options.api, credentials, doFetch);
@@ -132470,7 +132637,7 @@ function cliDeviceServiceHandoff(options) {
132470
132637
  }
132471
132638
  },
132472
132639
  machineDevice: async () => {
132473
- if (!existsSync68(deviceServiceEndpointPath(stateDir)))
132640
+ if (!existsSync67(deviceServiceEndpointPath(stateDir)))
132474
132641
  return { kind: "absent" };
132475
132642
  let failure;
132476
132643
  const service = await connectOrNotRunning(connect, (line) => {
@@ -132792,7 +132959,7 @@ function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION
132792
132959
  init_commander();
132793
132960
 
132794
132961
  // packages/omo-opencode/src/cli/boulder/boulder.ts
132795
- import { existsSync as existsSync69 } from "fs";
132962
+ import { existsSync as existsSync68 } from "fs";
132796
132963
 
132797
132964
  // packages/omo-opencode/src/cli/boulder/formatter.ts
132798
132965
  var import_picocolors22 = __toESM(require_picocolors(), 1);
@@ -132929,10 +133096,10 @@ async function boulder(options) {
132929
133096
  const boulderFilePath = getBoulderFilePath(directory);
132930
133097
  const state = readBoulderState(directory);
132931
133098
  if (!state) {
132932
- const message = existsSync69(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
133099
+ const message = existsSync68(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
132933
133100
  process.stderr.write(`${message}
132934
133101
  `);
132935
- return existsSync69(boulderFilePath) ? 2 : 1;
133102
+ return existsSync68(boulderFilePath) ? 2 : 1;
132936
133103
  }
132937
133104
  const works = getBoulderWorks(state);
132938
133105
  const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
@@ -132949,8 +133116,8 @@ async function boulder(options) {
132949
133116
  return 0;
132950
133117
  }
132951
133118
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
132952
- import { spawn as spawn8 } from "child_process";
132953
- import { existsSync as existsSync70, readFileSync as readFileSync49, realpathSync as realpathSync14 } from "fs";
133119
+ import { spawn as spawn7 } from "child_process";
133120
+ import { existsSync as existsSync69, readFileSync as readFileSync48, realpathSync as realpathSync14 } from "fs";
132954
133121
  import { homedir as homedir37 } from "os";
132955
133122
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
132956
133123
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -132979,7 +133146,7 @@ async function codexUlwLoop(args) {
132979
133146
  return 1;
132980
133147
  }
132981
133148
  const { promise, resolve } = Promise.withResolvers();
132982
- const child = spawn8(command.executable, [...command.argsPrefix, ...args], {
133149
+ const child = spawn7(command.executable, [...command.argsPrefix, ...args], {
132983
133150
  stdio: "inherit",
132984
133151
  env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
132985
133152
  });
@@ -132992,15 +133159,15 @@ async function codexUlwLoop(args) {
132992
133159
  }
132993
133160
  function resolveLocalUlwLoopBin(env, homeDir) {
132994
133161
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env, homeDir });
132995
- return candidates.find((candidate) => existsSync70(candidate)) ?? null;
133162
+ return candidates.find((candidate) => existsSync69(candidate)) ?? null;
132996
133163
  }
132997
133164
  function resolveLegacyLocalOmoBin(env, homeDir, currentExecutablePaths) {
132998
133165
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env, homeDir });
132999
- return candidates.find((candidate) => existsSync70(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
133166
+ return candidates.find((candidate) => existsSync69(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
133000
133167
  }
133001
133168
  function isGeneratedRuntimeWrapper(candidate) {
133002
133169
  try {
133003
- return readFileSync49(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
133170
+ return readFileSync48(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
133004
133171
  } catch (error) {
133005
133172
  if (error instanceof Error)
133006
133173
  return false;
@@ -133194,7 +133361,7 @@ function linkedWorktrees(records) {
133194
133361
  return records.slice(1);
133195
133362
  }
133196
133363
  // packages/omo-opencode/src/cli/worktree-sweep/sweep.ts
133197
- import { existsSync as existsSync71 } from "fs";
133364
+ import { existsSync as existsSync70 } from "fs";
133198
133365
  import { stat as stat12 } from "fs/promises";
133199
133366
  import os7 from "os";
133200
133367
  import { normalize as normalize2 } from "path";
@@ -133274,7 +133441,7 @@ async function isOlderThan(worktreePath, days, now) {
133274
133441
  }
133275
133442
  }
133276
133443
  async function classifyRecord(repo, record, defaultBranch, options) {
133277
- const pathExists = existsSync71(record.path);
133444
+ const pathExists = existsSync70(record.path);
133278
133445
  const external = isExcludedPath(record.path, options.excludePrefixes, options.home);
133279
133446
  const current = options.currentWorktree !== undefined && record.path === options.currentWorktree;
133280
133447
  if (record.locked || !pathExists || external || current) {
@@ -133303,7 +133470,7 @@ async function sweepRepo(repo, options) {
133303
133470
  const records = linkedWorktrees(allRecords);
133304
133471
  const startedInLinked = records.some((record) => record.path === toplevel);
133305
133472
  const mainWorktree = allRecords[0]?.path;
133306
- const root = startedInLinked && mainWorktree !== undefined && existsSync71(mainWorktree) ? mainWorktree : toplevel;
133473
+ const root = startedInLinked && mainWorktree !== undefined && existsSync70(mainWorktree) ? mainWorktree : toplevel;
133307
133474
  const currentWorktree = startedInLinked ? toplevel : undefined;
133308
133475
  const classifications = [];
133309
133476
  for (const record of records) {