@mirrowel/opencode-openshare 0.3.0-dev.15 → 0.3.0-dev.17

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.
package/ci/openshare.js CHANGED
@@ -451,9 +451,12 @@ function tuiLayerPaths(input) {
451
451
  if (envTui && existsSync(envTui))
452
452
  paths.push(envTui);
453
453
  if (input.directory) {
454
- const dir = normalizePath(input.directory);
455
- const worktree = input.worktree ? normalizePath(input.worktree) : undefined;
456
- const sane = worktree !== undefined && worktree !== "/" && !/^[a-z]:\/$/.test(worktree) && (dir === worktree || dir.startsWith(`${worktree}/`));
454
+ const fwd = (v) => v.replace(/\\/g, "/").replace(/\/+$/, "");
455
+ const dir = fwd(input.directory);
456
+ const worktree = input.worktree ? fwd(input.worktree) : undefined;
457
+ const dirLower = dir.toLowerCase();
458
+ const sane = worktree !== undefined && worktree !== "/" && !/^[a-z]:\/$/.test(worktree) && (dirLower === worktree.toLowerCase() || dirLower.startsWith(`${worktree.toLowerCase()}/`));
459
+ const worktreeLower = worktree?.toLowerCase();
457
460
  let current = dir;
458
461
  for (let guard = 0;guard < 64 && current; guard++) {
459
462
  for (const name of ["tui.json", ".opencode/tui.json"]) {
@@ -461,7 +464,7 @@ function tuiLayerPaths(input) {
461
464
  if (existsSync(candidate) && !paths.includes(candidate))
462
465
  paths.push(candidate);
463
466
  }
464
- if (sane && current === worktree)
467
+ if (sane && current.toLowerCase() === worktreeLower)
465
468
  break;
466
469
  const parent = dirname(current);
467
470
  if (parent === current)
package/dist/config.js CHANGED
@@ -608,12 +608,19 @@ export function tuiLayerPaths(input) {
608
608
  if (envTui && existsSync(envTui))
609
609
  paths.push(envTui);
610
610
  if (input.directory) {
611
- const dir = normalizePath(input.directory);
612
- const worktree = input.worktree ? normalizePath(input.worktree) : undefined;
611
+ // case-preserving separator fix only: the walk probes the FILESYSTEM,
612
+ // and lowercasing the path (fine for spec comparisons) breaks every
613
+ // lookup on case-sensitive filesystems - a mixed-case project dir
614
+ // would silently miss its tui.json and flip manual mode to all
615
+ const fwd = (v) => v.replace(/\\/g, "/").replace(/\/+$/, "");
616
+ const dir = fwd(input.directory);
617
+ const worktree = input.worktree ? fwd(input.worktree) : undefined;
618
+ const dirLower = dir.toLowerCase();
613
619
  const sane = worktree !== undefined &&
614
620
  worktree !== "/" &&
615
621
  !/^[a-z]:\/$/.test(worktree) &&
616
- (dir === worktree || dir.startsWith(`${worktree}/`));
622
+ (dirLower === worktree.toLowerCase() || dirLower.startsWith(`${worktree.toLowerCase()}/`));
623
+ const worktreeLower = worktree?.toLowerCase();
617
624
  let current = dir;
618
625
  for (let guard = 0; guard < 64 && current; guard++) {
619
626
  for (const name of ["tui.json", ".opencode/tui.json"]) {
@@ -621,7 +628,7 @@ export function tuiLayerPaths(input) {
621
628
  if (existsSync(candidate) && !paths.includes(candidate))
622
629
  paths.push(candidate);
623
630
  }
624
- if (sane && current === worktree)
631
+ if (sane && current.toLowerCase() === worktreeLower)
625
632
  break;
626
633
  const parent = dirname(current);
627
634
  if (parent === current)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirrowel/opencode-openshare",
3
- "version": "0.3.0-dev.15",
3
+ "version": "0.3.0-dev.17",
4
4
  "type": "module",
5
5
  "description": "Open(code)Share — re:share: self-hosted session sharing for opencode. Server plugin (single file or package), optional TUI for interactive opt-in sharing.",
6
6
  "license": "MIT",
@@ -85,10 +85,11 @@
85
85
  },
86
86
  "devDependencies": {
87
87
  "@types/node": "^22.0.0",
88
- "typescript": "^5.8.0"
88
+ "typescript": "^5.8.0",
89
+ "wrangler": "4.156.1"
89
90
  },
90
91
  "dependencies": {
91
- "@opencode-ai/plugin": ">=1.14.0",
92
+ "@opencode-ai/plugin": ">=1.18.0",
92
93
  "@opentui/solid": "^0.4.1"
93
94
  },
94
95
  "peerDependencies": {
package/src/config.ts CHANGED
@@ -617,20 +617,27 @@ export function tuiLayerPaths(input: { directory?: string; worktree?: string; en
617
617
  const envTui = env["OPENCODE_TUI_CONFIG"]
618
618
  if (envTui && existsSync(envTui)) paths.push(envTui)
619
619
  if (input.directory) {
620
- const dir = normalizePath(input.directory)
621
- const worktree = input.worktree ? normalizePath(input.worktree) : undefined
620
+ // case-preserving separator fix only: the walk probes the FILESYSTEM,
621
+ // and lowercasing the path (fine for spec comparisons) breaks every
622
+ // lookup on case-sensitive filesystems - a mixed-case project dir
623
+ // would silently miss its tui.json and flip manual mode to all
624
+ const fwd = (v: string) => v.replace(/\\/g, "/").replace(/\/+$/, "")
625
+ const dir = fwd(input.directory)
626
+ const worktree = input.worktree ? fwd(input.worktree) : undefined
627
+ const dirLower = dir.toLowerCase()
622
628
  const sane =
623
629
  worktree !== undefined &&
624
630
  worktree !== "/" &&
625
631
  !/^[a-z]:\/$/.test(worktree) &&
626
- (dir === worktree || dir.startsWith(`${worktree}/`))
632
+ (dirLower === worktree.toLowerCase() || dirLower.startsWith(`${worktree.toLowerCase()}/`))
633
+ const worktreeLower = worktree?.toLowerCase()
627
634
  let current: string | undefined = dir
628
635
  for (let guard = 0; guard < 64 && current; guard++) {
629
636
  for (const name of ["tui.json", ".opencode/tui.json"]) {
630
637
  const candidate = `${current}/${name}`
631
638
  if (existsSync(candidate) && !paths.includes(candidate)) paths.push(candidate)
632
639
  }
633
- if (sane && current === worktree) break
640
+ if (sane && current.toLowerCase() === worktreeLower) break
634
641
  const parent = dirname(current)
635
642
  if (parent === current) break
636
643
  current = parent