@mirrowel/opencode-openshare 0.3.0-dev.14 → 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 +9 -5
- package/dist/config.js +11 -4
- package/dist/core.js +5 -1
- package/package.json +4 -3
- package/src/config.ts +11 -4
- package/src/core.ts +5 -1
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
|
|
455
|
-
const
|
|
456
|
-
const
|
|
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 ===
|
|
467
|
+
if (sane && current.toLowerCase() === worktreeLower)
|
|
465
468
|
break;
|
|
466
469
|
const parent = dirname(current);
|
|
467
470
|
if (parent === current)
|
|
@@ -1393,10 +1396,11 @@ function createEngine(deps) {
|
|
|
1393
1396
|
const scheduleBindingWrite = (st) => {
|
|
1394
1397
|
if (st.metaTimer)
|
|
1395
1398
|
return;
|
|
1399
|
+
const debounce = Number(process.env.OPENSHARE_BINDING_WRITE_MS) > 0 ? Number(process.env.OPENSHARE_BINDING_WRITE_MS) : 30000;
|
|
1396
1400
|
st.metaTimer = setTimeout(() => {
|
|
1397
1401
|
st.metaTimer = null;
|
|
1398
1402
|
chain = chain.then(() => writeBinding(st)).catch(() => {});
|
|
1399
|
-
},
|
|
1403
|
+
}, debounce);
|
|
1400
1404
|
};
|
|
1401
1405
|
const h8 = (url) => {
|
|
1402
1406
|
let h = 5381;
|
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
|
-
|
|
612
|
-
|
|
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
|
-
(
|
|
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 ===
|
|
631
|
+
if (sane && current.toLowerCase() === worktreeLower)
|
|
625
632
|
break;
|
|
626
633
|
const parent = dirname(current);
|
|
627
634
|
if (parent === current)
|
package/dist/core.js
CHANGED
|
@@ -778,10 +778,14 @@ export function createEngine(deps) {
|
|
|
778
778
|
const scheduleBindingWrite = (st) => {
|
|
779
779
|
if (st.metaTimer)
|
|
780
780
|
return;
|
|
781
|
+
// env knob exists for the mock suites: their two-remote scenarios
|
|
782
|
+
// assert the SETTLED binding, and waiting out the production 30s
|
|
783
|
+
// coalescing window per scenario would dominate suite time
|
|
784
|
+
const debounce = Number(process.env.OPENSHARE_BINDING_WRITE_MS) > 0 ? Number(process.env.OPENSHARE_BINDING_WRITE_MS) : 30000;
|
|
781
785
|
st.metaTimer = setTimeout(() => {
|
|
782
786
|
st.metaTimer = null;
|
|
783
787
|
chain = chain.then(() => writeBinding(st)).catch(() => { });
|
|
784
|
-
},
|
|
788
|
+
}, debounce);
|
|
785
789
|
};
|
|
786
790
|
// ---- spool (temporary buffer for unacked frames) ----------------------
|
|
787
791
|
// One spool per session per server: `<sid>.<h8(url)>.meta/queue`. The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirrowel/opencode-openshare",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
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.
|
|
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
|
-
|
|
621
|
-
|
|
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
|
-
(
|
|
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 ===
|
|
640
|
+
if (sane && current.toLowerCase() === worktreeLower) break
|
|
634
641
|
const parent = dirname(current)
|
|
635
642
|
if (parent === current) break
|
|
636
643
|
current = parent
|
package/src/core.ts
CHANGED
|
@@ -925,10 +925,14 @@ export function createEngine(deps: EngineDeps): Engine {
|
|
|
925
925
|
|
|
926
926
|
const scheduleBindingWrite = (st: SessionState) => {
|
|
927
927
|
if (st.metaTimer) return
|
|
928
|
+
// env knob exists for the mock suites: their two-remote scenarios
|
|
929
|
+
// assert the SETTLED binding, and waiting out the production 30s
|
|
930
|
+
// coalescing window per scenario would dominate suite time
|
|
931
|
+
const debounce = Number(process.env.OPENSHARE_BINDING_WRITE_MS) > 0 ? Number(process.env.OPENSHARE_BINDING_WRITE_MS) : 30000
|
|
928
932
|
st.metaTimer = setTimeout(() => {
|
|
929
933
|
st.metaTimer = null
|
|
930
934
|
chain = chain.then(() => writeBinding(st)).catch(() => {})
|
|
931
|
-
},
|
|
935
|
+
}, debounce)
|
|
932
936
|
}
|
|
933
937
|
|
|
934
938
|
// ---- spool (temporary buffer for unacked frames) ----------------------
|