@revealui/harnesses 0.1.7 → 0.1.9
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/LICENSE +104 -17
- package/README.md +6 -6
- package/dist/{chunk-DGUM43GV.js → chunk-3RG5ZIWI.js} +0 -1
- package/dist/chunk-ANX4L2PF.js +651 -0
- package/dist/{chunk-JG6CAG4A.js → chunk-Y4FFO3TO.js} +29 -8
- package/dist/chunk-YYAYTCRM.js +3016 -0
- package/dist/{chunk-XXEKWC6F.js → chunk-ZNIQELKZ.js} +189 -345
- package/dist/cli.js +44 -9
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +2 -3
- package/dist/index-w5ashbfb.d.ts +266 -0
- package/dist/index.d.ts +770 -85
- package/dist/index.js +39 -10
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +9 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +0 -1
- package/dist/workboard/index.d.ts +26 -14
- package/dist/workboard/index.js +2 -3
- package/package.json +30 -7
- package/LICENSE.commercial +0 -111
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-JG6CAG4A.js.map +0 -1
- package/dist/chunk-XLIKSLM3.js +0 -1105
- package/dist/chunk-XLIKSLM3.js.map +0 -1
- package/dist/chunk-XXEKWC6F.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/content/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/workboard/index.js.map +0 -1
|
@@ -77,7 +77,8 @@ async function withLockAsync(lockPath, fn, timeoutMs) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
function atomicWriteSync(filePath, content) {
|
|
80
|
-
const
|
|
80
|
+
const suffix = `${process.pid}.${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
81
|
+
const tmpPath = `${filePath}.tmp.${suffix}`;
|
|
81
82
|
writeFileSync(tmpPath, content, "utf8");
|
|
82
83
|
renameSync(tmpPath, filePath);
|
|
83
84
|
}
|
|
@@ -88,11 +89,31 @@ function lockPathFor(workboardPath) {
|
|
|
88
89
|
// src/workboard/session-identity.ts
|
|
89
90
|
import { readFileSync as readFileSync2 } from "fs";
|
|
90
91
|
function detectSessionType() {
|
|
92
|
+
const vaughnId = process.env.VAUGHN_AGENT_ID;
|
|
93
|
+
if (vaughnId) {
|
|
94
|
+
const tool = vaughnId.split("-")[0]?.toLowerCase();
|
|
95
|
+
if (tool === "claude") return "claude";
|
|
96
|
+
if (tool === "codex") return "codex";
|
|
97
|
+
if (tool === "cursor") return "cursor";
|
|
98
|
+
if (tool === "zed") return "zed";
|
|
99
|
+
return "terminal";
|
|
100
|
+
}
|
|
101
|
+
if (process.env.CLAUDE_AGENT_ROLE) return "claude";
|
|
102
|
+
try {
|
|
103
|
+
const cachePath = `/tmp/vaughn-session-${process.ppid}.id`;
|
|
104
|
+
const cached = readFileSync2(cachePath, "utf8").trim();
|
|
105
|
+
if (cached === "claude" || cached === "codex" || cached === "zed" || cached === "cursor") {
|
|
106
|
+
return cached;
|
|
107
|
+
}
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
91
110
|
try {
|
|
92
111
|
let pid = process.ppid;
|
|
93
112
|
for (let depth = 0; depth < 8; depth++) {
|
|
94
113
|
if (!pid || pid <= 1) break;
|
|
95
114
|
const cmdline = readFileSync2(`/proc/${pid}/cmdline`, "utf8").replace(/\0/g, " ").toLowerCase();
|
|
115
|
+
if (cmdline.includes("claude")) return "claude";
|
|
116
|
+
if (cmdline.includes("codex")) return "codex";
|
|
96
117
|
if (cmdline.includes("zed")) return "zed";
|
|
97
118
|
if (cmdline.includes("cursor")) return "cursor";
|
|
98
119
|
const status = readFileSync2(`/proc/${pid}/status`, "utf8");
|
|
@@ -157,7 +178,7 @@ function parseTable(lines) {
|
|
|
157
178
|
for (let j = 0; j < columns.length; j++) {
|
|
158
179
|
const col = columns[j];
|
|
159
180
|
const raw = (cells[j] || "").trim();
|
|
160
|
-
row[col] = raw === "
|
|
181
|
+
row[col] = raw === "-" ? "" : raw;
|
|
161
182
|
}
|
|
162
183
|
rows.push(row);
|
|
163
184
|
}
|
|
@@ -203,13 +224,13 @@ function parseWorkboard(content) {
|
|
|
203
224
|
return state;
|
|
204
225
|
}
|
|
205
226
|
function padCell(value, width) {
|
|
206
|
-
const str = String(value || "
|
|
227
|
+
const str = String(value || " - ");
|
|
207
228
|
return str.length >= width ? str : str + " ".repeat(width - str.length);
|
|
208
229
|
}
|
|
209
230
|
function serializeTable(headers, rows) {
|
|
210
231
|
if (headers.length === 0) return "(none)";
|
|
211
232
|
const widths = headers.map((h) => {
|
|
212
|
-
const dataMax = rows.reduce((max, row) => Math.max(max, String(row[h] || "
|
|
233
|
+
const dataMax = rows.reduce((max, row) => Math.max(max, String(row[h] || " - ").length), 0);
|
|
213
234
|
return Math.max(h.length, dataMax, 3);
|
|
214
235
|
});
|
|
215
236
|
const headerLine = `| ${headers.map((h, i) => padCell(h, widths[i])).join(" | ")} |`;
|
|
@@ -286,6 +307,7 @@ var WorkboardManager = class {
|
|
|
286
307
|
}
|
|
287
308
|
this.lockPath = lockPathFor(resolved);
|
|
288
309
|
}
|
|
310
|
+
workboardPath;
|
|
289
311
|
lockPath;
|
|
290
312
|
// ---- Read/Write ----
|
|
291
313
|
read() {
|
|
@@ -525,6 +547,8 @@ var registerSession = WorkboardManager.prototype.registerAgent;
|
|
|
525
547
|
var unregisterSession = WorkboardManager.prototype.unregisterAgent;
|
|
526
548
|
|
|
527
549
|
export {
|
|
550
|
+
detectSessionType,
|
|
551
|
+
deriveSessionId,
|
|
528
552
|
acquireLock,
|
|
529
553
|
releaseLock,
|
|
530
554
|
withLock,
|
|
@@ -533,8 +557,5 @@ export {
|
|
|
533
557
|
lockPathFor,
|
|
534
558
|
WorkboardManager,
|
|
535
559
|
registerSession,
|
|
536
|
-
unregisterSession
|
|
537
|
-
detectSessionType,
|
|
538
|
-
deriveSessionId
|
|
560
|
+
unregisterSession
|
|
539
561
|
};
|
|
540
|
-
//# sourceMappingURL=chunk-JG6CAG4A.js.map
|