oh-my-opencode 5.1.61 → 5.1.62

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 (120) hide show
  1. package/.agents/command/remove-deadcode.md +1 -1
  2. package/.agents/skills/remove-deadcode/SKILL.md +1 -1
  3. package/.opencode/command/remove-deadcode.md +1 -1
  4. package/dist/cli/index.js +154 -27
  5. package/dist/cli/service-auth/index.d.ts +2 -1
  6. package/dist/cli/service-auth/session.d.ts +27 -0
  7. package/dist/cli/service-auth/sync-pin-retire.d.ts +7 -0
  8. package/dist/cli-node/index.js +154 -27
  9. package/dist/config/schema/agent-names.d.ts +1 -0
  10. package/dist/index.js +645 -189
  11. package/dist/skills/browser/references/owned-engine/README.md +1 -1
  12. package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
  13. package/dist/skills/frontend/SKILL.md +2 -2
  14. package/dist/skills/frontend/references/design/README.md +2 -2
  15. package/dist/skills/frontend/references/design/component-catalogs.md +1 -1
  16. package/dist/skills/frontend/references/design/design-system-architecture.md +1 -1
  17. package/dist/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  18. package/dist/skills/frontend/references/designpowers/lane-a-direction.md +5 -5
  19. package/dist/skills/frontend/references/designpowers/routing.md +2 -2
  20. package/dist/skills/frontend/references/perfection/README.md +1 -1
  21. package/dist/skills/programming/references/python/libraries.md +3 -3
  22. package/dist/skills/programming/references/python/one-liners.md +1 -1
  23. package/dist/skills/programming/references/python/pyproject-strict.md +1 -1
  24. package/dist/skills/programming/references/rust/libraries.md +2 -2
  25. package/dist/skills/refactor/SKILL.md +1 -1
  26. package/dist/skills/ultimate-browsing/SKILL.md +1 -1
  27. package/dist/skills/ultimate-browsing/references/insane-search/README.md +1 -1
  28. package/dist/skills/ulw-execute/SKILL.md +1 -1
  29. package/dist/skills/ulw-research/SKILL.md +2 -2
  30. package/dist/tui.js +15 -14
  31. package/package.json +14 -14
  32. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  33. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  34. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  35. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  36. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  37. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  38. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  39. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  40. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  41. package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +1 -1
  42. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  43. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  44. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  45. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  46. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  47. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  48. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  49. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  50. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  51. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  52. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  54. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  56. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  57. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  58. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  59. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  60. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  61. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  62. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  63. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  64. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  65. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  66. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  67. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  68. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  69. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  70. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  71. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  72. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  73. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  78. package/packages/omo-codex/plugin/package-lock.json +12 -12
  79. package/packages/omo-codex/plugin/package.json +1 -1
  80. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +1 -1
  81. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  82. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +2 -2
  83. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +2 -2
  84. package/packages/omo-codex/plugin/skills/frontend/references/design/component-catalogs.md +1 -1
  85. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +1 -1
  86. package/packages/omo-codex/plugin/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  87. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +5 -5
  88. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +2 -2
  89. package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +1 -1
  90. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +1 -1
  91. package/packages/omo-codex/plugin/skills/programming/references/python/libraries.md +3 -3
  92. package/packages/omo-codex/plugin/skills/programming/references/python/one-liners.md +1 -1
  93. package/packages/omo-codex/plugin/skills/programming/references/python/pyproject-strict.md +1 -1
  94. package/packages/omo-codex/plugin/skills/programming/references/rust/libraries.md +2 -2
  95. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +1 -1
  96. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +1 -1
  97. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +1 -1
  98. package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
  99. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +2 -2
  100. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  101. package/packages/shared-skills/skills/browser/references/owned-engine/README.md +1 -1
  102. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
  103. package/packages/shared-skills/skills/frontend/SKILL.md +2 -2
  104. package/packages/shared-skills/skills/frontend/references/design/README.md +2 -2
  105. package/packages/shared-skills/skills/frontend/references/design/component-catalogs.md +1 -1
  106. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +1 -1
  107. package/packages/shared-skills/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  108. package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +5 -5
  109. package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +2 -2
  110. package/packages/shared-skills/skills/frontend/references/perfection/README.md +1 -1
  111. package/packages/shared-skills/skills/programming/references/python/libraries.md +3 -3
  112. package/packages/shared-skills/skills/programming/references/python/one-liners.md +1 -1
  113. package/packages/shared-skills/skills/programming/references/python/pyproject-strict.md +1 -1
  114. package/packages/shared-skills/skills/programming/references/rust/libraries.md +2 -2
  115. package/packages/shared-skills/skills/refactor/SKILL.md +1 -1
  116. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +1 -1
  117. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +1 -1
  118. package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
  119. package/packages/shared-skills/skills/ulw-research/SKILL.md +2 -2
  120. package/.opencode/skills/hyperplan/SKILL.md +0 -450
@@ -2133,7 +2133,7 @@ var package_default;
2133
2133
  var init_package = __esm(() => {
2134
2134
  package_default = {
2135
2135
  name: "oh-my-opencode",
2136
- version: "5.1.61",
2136
+ version: "5.1.62",
2137
2137
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2138
2138
  main: "./dist/index.js",
2139
2139
  types: "dist/index.d.ts",
@@ -2320,7 +2320,7 @@ var init_package = __esm(() => {
2320
2320
  },
2321
2321
  devDependencies: {
2322
2322
  "@clack/prompts": "^1.8.1",
2323
- "@code-yeongyu/senpi": "2026.11.3-3",
2323
+ "@code-yeongyu/senpi": "2026.11.5-1",
2324
2324
  "@modelcontextprotocol/sdk": "^1.30.0",
2325
2325
  "@oh-my-opencode/agents-md-core": "workspace:*",
2326
2326
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
@@ -2385,18 +2385,18 @@ var init_package = __esm(() => {
2385
2385
  typescript: "^7.0.2"
2386
2386
  },
2387
2387
  optionalDependencies: {
2388
- "oh-my-opencode-darwin-arm64": "5.1.61",
2389
- "oh-my-opencode-darwin-x64": "5.1.61",
2390
- "oh-my-opencode-darwin-x64-baseline": "5.1.61",
2391
- "oh-my-opencode-linux-arm64": "5.1.61",
2392
- "oh-my-opencode-linux-arm64-musl": "5.1.61",
2393
- "oh-my-opencode-linux-x64": "5.1.61",
2394
- "oh-my-opencode-linux-x64-baseline": "5.1.61",
2395
- "oh-my-opencode-linux-x64-musl": "5.1.61",
2396
- "oh-my-opencode-linux-x64-musl-baseline": "5.1.61",
2397
- "oh-my-opencode-windows-arm64": "5.1.61",
2398
- "oh-my-opencode-windows-x64": "5.1.61",
2399
- "oh-my-opencode-windows-x64-baseline": "5.1.61"
2388
+ "oh-my-opencode-darwin-arm64": "5.1.62",
2389
+ "oh-my-opencode-darwin-x64": "5.1.62",
2390
+ "oh-my-opencode-darwin-x64-baseline": "5.1.62",
2391
+ "oh-my-opencode-linux-arm64": "5.1.62",
2392
+ "oh-my-opencode-linux-arm64-musl": "5.1.62",
2393
+ "oh-my-opencode-linux-x64": "5.1.62",
2394
+ "oh-my-opencode-linux-x64-baseline": "5.1.62",
2395
+ "oh-my-opencode-linux-x64-musl": "5.1.62",
2396
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.62",
2397
+ "oh-my-opencode-windows-arm64": "5.1.62",
2398
+ "oh-my-opencode-windows-x64": "5.1.62",
2399
+ "oh-my-opencode-windows-x64-baseline": "5.1.62"
2400
2400
  },
2401
2401
  overrides: {
2402
2402
  hono: "^4.13.8",
@@ -92789,7 +92789,7 @@ var package_default2;
92789
92789
  var init_package2 = __esm(() => {
92790
92790
  package_default2 = {
92791
92791
  name: "@oh-my-opencode/omo-codex",
92792
- version: "5.1.61",
92792
+ version: "5.1.62",
92793
92793
  type: "module",
92794
92794
  private: true,
92795
92795
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -104452,6 +104452,7 @@ var BuiltinSkillNameSchema = _enum([
104452
104452
  "debugging",
104453
104453
  "security-research",
104454
104454
  "security-review",
104455
+ "hyperplan",
104455
104456
  "visual-qa",
104456
104457
  "team-mode"
104457
104458
  ]);
@@ -109550,8 +109551,8 @@ var package_default3 = {
109550
109551
  },
109551
109552
  dependencies: {
109552
109553
  "@clack/prompts": "^1.8.1",
109553
- "@code-yeongyu/senpi": "2026.11.3-3",
109554
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.3-3",
109554
+ "@code-yeongyu/senpi": "2026.11.5-1",
109555
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.5-1",
109555
109556
  "@modelcontextprotocol/sdk": "^1.30.0",
109556
109557
  "@oh-my-opencode/agents-md-core": "workspace:*",
109557
109558
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -112823,6 +112824,24 @@ function retryOnEintrSync(operation) {
112823
112824
 
112824
112825
  // packages/memory-core/src/fs/rename-contention.ts
112825
112826
  var CONTENTION_CODES = new Set(["EPERM", "EBUSY", "EACCES"]);
112827
+ var CONTENTION_DELAYS_MS = [10, 25, 50, 100, 200, 400];
112828
+ var sleepFor = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
112829
+ async function renameWithContentionRetry(from, to, deps) {
112830
+ const delays = deps.platform === "win32" ? deps.delaysMs ?? CONTENTION_DELAYS_MS : [];
112831
+ const sleep = deps.sleep ?? sleepFor;
112832
+ for (let attempt = 0;; attempt += 1) {
112833
+ try {
112834
+ await retryOnEintr(() => deps.admit === undefined ? deps.rename(from, to) : deps.admit(() => deps.rename(from, to)));
112835
+ return;
112836
+ } catch (error) {
112837
+ const delay = delays[attempt];
112838
+ const code = fsErrorCode(error);
112839
+ if (delay === undefined || code === undefined || !CONTENTION_CODES.has(code))
112840
+ throw error;
112841
+ await sleep(delay);
112842
+ }
112843
+ }
112844
+ }
112826
112845
 
112827
112846
  // packages/memory-core/src/fs/resilient.ts
112828
112847
  function isFunction2(value) {
@@ -112855,6 +112874,13 @@ function resilientNamespace(namespace, kind) {
112855
112874
  }
112856
112875
  var IDEMPOTENT_HANDLE_METHODS = new Set(["stat", "sync", "datasync", "chmod", "chown", "utimes", "truncate"]);
112857
112876
  var promises = resilientNamespace(fsp, "async");
112877
+ function rename8(from, to, admit) {
112878
+ return renameWithContentionRetry(from, to, {
112879
+ rename: (source, target) => fsp.rename(source, target),
112880
+ platform: process.platform,
112881
+ ...admit === undefined ? {} : { admit }
112882
+ });
112883
+ }
112858
112884
  var sync = resilientNamespace(fsSync, "sync");
112859
112885
  var {
112860
112886
  access: access3,
@@ -113750,15 +113776,60 @@ async function loginLoopback(session, options) {
113750
113776
  }
113751
113777
  }
113752
113778
 
113753
- // packages/omo-opencode/src/cli/service-auth/session.ts
113779
+ // packages/memory-core/src/sync/device-retire.ts
113780
+ import { createHash as createHash14, randomBytes as randomBytes6 } from "node:crypto";
113781
+ import { join as join109 } from "node:path";
113782
+
113783
+ // packages/memory-core/src/identity/layout.ts
113754
113784
  import { homedir as homedir32 } from "node:os";
113785
+ import { join as join107, resolve as resolve31 } from "node:path";
113786
+ var MEMORY_ROOT_ENV_VAR = "OMO_MEMORY_HOME";
113787
+ function defaultMemoryRoot() {
113788
+ return join107(homedir32(), ".omo", "memory");
113789
+ }
113790
+ function resolveMemoryRoot(env, cwd) {
113791
+ const override = env[MEMORY_ROOT_ENV_VAR];
113792
+ if (override === undefined || override.trim() === "") {
113793
+ return defaultMemoryRoot();
113794
+ }
113795
+ return resolve31(cwd, override);
113796
+ }
113797
+ // packages/memory-core/src/sync/pin-dir.ts
113798
+ import { join as join108 } from "node:path";
113799
+ var syncPinDir = (memoryRoot) => join108(memoryRoot, "sync-device");
113800
+
113801
+ // packages/memory-core/src/sync/device-retire.ts
113802
+ var trustAnchorRoot = (pinDir) => join109(pinDir, "trust-anchor");
113803
+ var trustAnchorKey = (account) => createHash14("sha256").update(account, "utf8").digest("base64url");
113804
+ var trustAnchorDir = (pinDir, account) => join109(trustAnchorRoot(pinDir), trustAnchorKey(account));
113805
+ var hasLiveTrustAnchor = async (pinDir) => {
113806
+ try {
113807
+ return (await readdir17(trustAnchorRoot(pinDir))).some((name) => !name.includes(".retired-"));
113808
+ } catch (error) {
113809
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
113810
+ return false;
113811
+ throw error;
113812
+ }
113813
+ };
113814
+ var retireSyncDevice = async (input) => {
113815
+ const dir = trustAnchorDir(input.pinDir, input.account);
113816
+ try {
113817
+ await rename8(dir, `${dir}.retired-${Date.now()}-${randomBytes6(4).toString("hex")}`);
113818
+ } catch (error) {
113819
+ if (!(error instanceof Error && ("code" in error) && error.code === "ENOENT"))
113820
+ throw error;
113821
+ }
113822
+ };
113823
+
113824
+ // packages/omo-opencode/src/cli/service-auth/session.ts
113825
+ import { homedir as homedir33 } from "node:os";
113755
113826
 
113756
113827
  // packages/omo-opencode/src/cli/service-auth/signed-out-marker.ts
113757
113828
  init_zod();
113758
- import { mkdir as mkdir12, readFile as readFile35, rename as rename8, rm as rm17, writeFile as writeFile17 } from "node:fs/promises";
113759
- import { dirname as dirname43, join as join107 } from "node:path";
113829
+ import { mkdir as mkdir12, readFile as readFile35, rename as rename9, rm as rm17, writeFile as writeFile17 } from "node:fs/promises";
113830
+ import { dirname as dirname43, join as join110 } from "node:path";
113760
113831
  var markerSchema = object({ device: string2().nullable(), at: string2() });
113761
- var signedOutMarkerPath = (home, credential) => join107(home, ".omo", "account-state", `${credential}.signed-out.json`);
113832
+ var signedOutMarkerPath = (home, credential) => join110(home, ".omo", "account-state", `${credential}.signed-out.json`);
113762
113833
  async function readSignedOutMarker(path) {
113763
113834
  const text = await readFile35(path, "utf8").catch(() => null);
113764
113835
  if (text === null)
@@ -113776,7 +113847,7 @@ async function writeSignedOutMarker(path, device) {
113776
113847
  await mkdir12(dirname43(path), { recursive: true, mode: 448 });
113777
113848
  const staging = `${path}.${process.pid}.tmp`;
113778
113849
  await writeFile17(staging, JSON.stringify({ device, at: new Date().toISOString() }), { mode: 384 });
113779
- await rename8(staging, path);
113850
+ await rename9(staging, path);
113780
113851
  }
113781
113852
  var clearSignedOutMarker = (path) => rm17(path, { force: true });
113782
113853
 
@@ -113791,11 +113862,18 @@ class SessionEnded extends SignInError {
113791
113862
  }
113792
113863
  }
113793
113864
  var DEVICE_REVOKING_REFUSALS = new Set(["account_deleted", "reauth_required", "device_revoked"]);
113865
+ var discardedOf = (credentials, cause) => ({
113866
+ kind: "credential",
113867
+ deviceId: credentials.device.id,
113868
+ accountId: credentials.accountId,
113869
+ owner: credentials.owner,
113870
+ cause
113871
+ });
113794
113872
  function createSession(options) {
113795
113873
  const api = serviceOrigin(options.api);
113796
113874
  const now = options.now ?? Date.now;
113797
- const { store, signal } = options;
113798
- const markerPath = signedOutMarkerPath(options.home ?? homedir32(), credentialId(api));
113875
+ const { store, signal, beforeKeysDiscarded } = options;
113876
+ const markerPath = signedOutMarkerPath(options.home ?? homedir33(), credentialId(api));
113799
113877
  async function locked(action) {
113800
113878
  signal?.throwIfAborted();
113801
113879
  return withCredentialLock(api, async () => {
@@ -113804,6 +113882,11 @@ function createSession(options) {
113804
113882
  }, options.home);
113805
113883
  }
113806
113884
  const request = (path, init) => requestApi(api, path, init, signal);
113885
+ const accountOf = async (access) => {
113886
+ const body = await request("/v1/me", { headers: { authorization: `Bearer ${access}` } }).catch(() => null);
113887
+ const id = typeof body === "object" && body !== null && "account" in body && typeof body.account === "object" && body.account !== null && "id" in body.account ? body.account.id : undefined;
113888
+ return typeof id === "string" && id !== "" ? id : undefined;
113889
+ };
113807
113890
  async function refreshed(current) {
113808
113891
  if (current.refreshState === "uncertain" || current.refreshAttempt !== undefined) {
113809
113892
  throw new SessionEnded(`Refresh recovery can no longer be proved safe. ${signInHint("again")}`, false, "refresh_recovery_expired");
@@ -113820,6 +113903,7 @@ function createSession(options) {
113820
113903
  if (error instanceof CredentialStoreError)
113821
113904
  throw error;
113822
113905
  if (error instanceof ApiRefusal && error.status < 500 && ["unauthorized", "account_deleted", "reauth_required", "invalid_grant", "device_revoked"].includes(error.code)) {
113906
+ await beforeKeysDiscarded(discardedOf(current, "refused"));
113823
113907
  await store.clear();
113824
113908
  throw new SessionEnded(error.code === "reauth_required" ? `This session was ended because its refresh token was reused. ${signInHint("again")}` : refusalMessage(refusalGuidance(error.code, error.status)), DEVICE_REVOKING_REFUSALS.has(error.code), error.code);
113825
113909
  }
@@ -113845,6 +113929,17 @@ function createSession(options) {
113845
113929
  },
113846
113930
  async save(value) {
113847
113931
  await locked(async () => {
113932
+ let stored;
113933
+ try {
113934
+ stored = await store.readAuthoritative();
113935
+ } catch (error) {
113936
+ if (!(error instanceof InvalidCredentialState))
113937
+ throw error;
113938
+ await beforeKeysDiscarded({ kind: "unreadable" });
113939
+ stored = null;
113940
+ }
113941
+ if (stored !== null && stored.device.id !== value.device.id)
113942
+ await beforeKeysDiscarded(discardedOf(stored, "replaced"));
113848
113943
  await store.write(value);
113849
113944
  await clearSignedOutMarker(markerPath);
113850
113945
  });
@@ -113871,12 +113966,16 @@ function createSession(options) {
113871
113966
  async logout() {
113872
113967
  return locked(async () => {
113873
113968
  let current = null;
113969
+ let account;
113874
113970
  try {
113875
113971
  current = await store.readAuthoritative();
113876
113972
  if (current !== null) {
113877
113973
  if (current.refreshState === "uncertain")
113878
113974
  return false;
113879
113975
  const access = Date.parse(current.accessTokenExpiresAt) <= now() ? (await refreshed(current)).accessToken : current.accessToken;
113976
+ if (current.accountId === undefined && current.owner === undefined && await beforeKeysDiscarded.wantsAccount?.() === true) {
113977
+ account = await accountOf(access);
113978
+ }
113880
113979
  await request(`/v1/devices/${encodeURIComponent(current.device.id)}`, {
113881
113980
  method: "DELETE",
113882
113981
  headers: { authorization: `Bearer ${access}` }
@@ -113891,6 +113990,9 @@ function createSession(options) {
113891
113990
  throw error;
113892
113991
  } finally {
113893
113992
  await writeSignedOutMarker(markerPath, current?.device.id ?? null);
113993
+ const stored = current === null ? null : await store.read().catch(() => current);
113994
+ if (stored !== null)
113995
+ await beforeKeysDiscarded(discardedOf(stored.accountId === undefined && account !== undefined ? { ...stored, accountId: account } : stored, "logout"));
113894
113996
  await store.clear();
113895
113997
  }
113896
113998
  });
@@ -113927,6 +114029,26 @@ function createSession(options) {
113927
114029
  };
113928
114030
  }
113929
114031
 
114032
+ // packages/omo-opencode/src/cli/service-auth/sync-pin-retire.ts
114033
+ var reason = (error) => error instanceof Error && ("code" in error) && typeof error.code === "string" ? error.code : "unknown";
114034
+ function retireSyncPinOnDiscard(options) {
114035
+ const hook = async (discarded) => {
114036
+ if (discarded.kind === "unreadable") {
114037
+ options.log("memory sync: a stored sign-in could not be read while it was replaced; its sync pin was left in place");
114038
+ return;
114039
+ }
114040
+ const account = discarded.owner?.accountId ?? discarded.accountId;
114041
+ if (account === undefined)
114042
+ return;
114043
+ try {
114044
+ await retireSyncDevice({ pinDir: options.pinDir(), account });
114045
+ } catch (error) {
114046
+ options.log(`memory sync: the sync pin could not be retired (${reason(error)}); it was left in place`);
114047
+ }
114048
+ };
114049
+ return Object.assign(hook, { wantsAccount: () => hasLiveTrustAnchor(options.pinDir()).catch(() => false) });
114050
+ }
114051
+
113930
114052
  // packages/omo-opencode/src/cli/service-auth/commands.ts
113931
114053
  async function ensureServiceAvailable(session, api) {
113932
114054
  try {
@@ -113969,7 +114091,12 @@ async function run2(action, options) {
113969
114091
  try {
113970
114092
  const api = serviceOrigin(options.api ?? process.env.OMO_SERVICE_API_URL ?? "https://api.omo.dev");
113971
114093
  const store = createCredentialStore(api, { wait: INTERACTIVE_READ_WAIT });
113972
- const session = createSession({ api, store, signal: controller.signal });
114094
+ const session = createSession({
114095
+ api,
114096
+ store,
114097
+ signal: controller.signal,
114098
+ beforeKeysDiscarded: retireSyncPinOnDiscard({ pinDir: () => syncPinDir(resolveMemoryRoot(process.env, process.cwd())), log: (line) => console.error(line) })
114099
+ });
113973
114100
  if (action === "logout") {
113974
114101
  const revoked = await session.logout();
113975
114102
  console.log("Signed out of OmO. Stored credentials and device keys were removed.");
@@ -114237,11 +114364,11 @@ async function boulder(options) {
114237
114364
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
114238
114365
  import { spawn as spawn6 } from "node:child_process";
114239
114366
  import { existsSync as existsSync67, readFileSync as readFileSync45, realpathSync as realpathSync14 } from "node:fs";
114240
- import { homedir as homedir33 } from "node:os";
114367
+ import { homedir as homedir34 } from "node:os";
114241
114368
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
114242
114369
  function resolveCodexUlwLoopCommand(input = {}) {
114243
114370
  const env = input.env ?? process.env;
114244
- const homeDir = input.homeDir ?? homedir33();
114371
+ const homeDir = input.homeDir ?? homedir34();
114245
114372
  const localComponentBin = resolveLocalUlwLoopBin(env, homeDir);
114246
114373
  if (localComponentBin !== null)
114247
114374
  return { executable: localComponentBin, argsPrefix: [] };
@@ -17,6 +17,7 @@ export declare const BuiltinSkillNameSchema: z.ZodEnum<{
17
17
  "dev-browser": "dev-browser";
18
18
  frontend: "frontend";
19
19
  "git-master": "git-master";
20
+ hyperplan: "hyperplan";
20
21
  "init-deep": "init-deep";
21
22
  playwright: "playwright";
22
23
  "remove-ai-slops": "remove-ai-slops";