theclawbay 0.3.39 → 0.3.41
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/dist/commands/setup.js +32 -15
- package/dist/lib/codex-vscode-patch.js +68 -19
- package/package.json +1 -1
package/dist/commands/setup.js
CHANGED
|
@@ -8,7 +8,6 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
8
8
|
const node_os_1 = __importDefault(require("node:os"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const node_readline_1 = require("node:readline");
|
|
11
|
-
const promises_2 = require("node:readline/promises");
|
|
12
11
|
const node_child_process_1 = require("node:child_process");
|
|
13
12
|
const core_1 = require("@oclif/core");
|
|
14
13
|
const yaml_1 = require("yaml");
|
|
@@ -751,7 +750,6 @@ async function promptForSetupClients(clients) {
|
|
|
751
750
|
stdin.off("keypress", onKeypress);
|
|
752
751
|
if (stdin.isTTY)
|
|
753
752
|
stdin.setRawMode(Boolean(wasRaw));
|
|
754
|
-
stdin.pause();
|
|
755
753
|
stdout.write("\x1b[?25h");
|
|
756
754
|
clearScreen();
|
|
757
755
|
const finalSelection = new Set(options.filter((option) => option.checked).map((option) => option.id));
|
|
@@ -852,19 +850,38 @@ function resolveSetupClientSelection(params) {
|
|
|
852
850
|
async function promptForCodexUsageUiPatch() {
|
|
853
851
|
if (!process.stdin.isTTY || !process.stdout.isTTY)
|
|
854
852
|
return false;
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
|
|
853
|
+
const stdin = process.stdin;
|
|
854
|
+
const stdout = process.stdout;
|
|
855
|
+
const wasRaw = stdin.isRaw;
|
|
856
|
+
stdin.resume();
|
|
857
|
+
return new Promise((resolve) => {
|
|
858
|
+
const finish = (enabled) => {
|
|
859
|
+
stdin.off("data", onData);
|
|
860
|
+
if (stdin.isTTY)
|
|
861
|
+
stdin.setRawMode(Boolean(wasRaw));
|
|
862
|
+
stdout.write("\n");
|
|
863
|
+
resolve(enabled);
|
|
864
|
+
};
|
|
865
|
+
const onData = (chunk) => {
|
|
866
|
+
const key = chunk.toString("utf8");
|
|
867
|
+
if (key === "\u0003") {
|
|
868
|
+
stdout.write("\x1b[?25h");
|
|
869
|
+
process.exit(130);
|
|
870
|
+
}
|
|
871
|
+
const normalized = key.trim().toLowerCase();
|
|
872
|
+
if (normalized === "y" || normalized === "yes") {
|
|
873
|
+
finish(true);
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
if (!normalized || normalized === "n" || normalized === "no") {
|
|
877
|
+
finish(false);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
process.stdout.write("\nPatch Codex to show The Claw Bay usage remaining? [y/N] ");
|
|
881
|
+
if (stdin.isTTY)
|
|
882
|
+
stdin.setRawMode(true);
|
|
883
|
+
stdin.on("data", onData);
|
|
858
884
|
});
|
|
859
|
-
try {
|
|
860
|
-
process.stdout.write("\n");
|
|
861
|
-
process.stdout.write("Patch Codex to show The Claw Bay usage remaining in the CLI/app footer and add a logout card in installed Codex VS Code settings? [y/N] ");
|
|
862
|
-
const answer = (await rl.question("")).trim().toLowerCase();
|
|
863
|
-
return answer === "y" || answer === "yes";
|
|
864
|
-
}
|
|
865
|
-
finally {
|
|
866
|
-
rl.close();
|
|
867
|
-
}
|
|
868
885
|
}
|
|
869
886
|
async function resolveCodexUsageUiSelection(params) {
|
|
870
887
|
if (!params.codexSelected)
|
|
@@ -2263,7 +2280,7 @@ SetupCommand.flags = {
|
|
|
2263
2280
|
"codex-usage-ui": core_1.Flags.boolean({
|
|
2264
2281
|
required: false,
|
|
2265
2282
|
allowNo: true,
|
|
2266
|
-
description: "Patch Codex to show The Claw Bay usage remaining
|
|
2283
|
+
description: "Patch Codex to show The Claw Bay usage remaining.",
|
|
2267
2284
|
}),
|
|
2268
2285
|
"debug-output": core_1.Flags.boolean({
|
|
2269
2286
|
required: false,
|
|
@@ -244,7 +244,7 @@ function buildWebviewPatch() {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
function isAgentSettingsRoute() {
|
|
247
|
-
return currentRoute().includes("/settings/agent");
|
|
247
|
+
return currentRoute().includes("/settings/general") || currentRoute().includes("/settings/agent");
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
function ensureStyle() {
|
|
@@ -253,28 +253,29 @@ function buildWebviewPatch() {
|
|
|
253
253
|
style.id = styleId;
|
|
254
254
|
style.textContent = \`
|
|
255
255
|
#\${cardId} {
|
|
256
|
-
margin:
|
|
256
|
+
margin: 20px 0 28px;
|
|
257
257
|
border: 1px solid var(--vscode-panel-border, rgba(255,255,255,0.12));
|
|
258
258
|
border-radius: 12px;
|
|
259
259
|
background: var(--vscode-editorWidget-background, rgba(255,255,255,0.03));
|
|
260
260
|
color: var(--vscode-foreground, inherit);
|
|
261
261
|
overflow: hidden;
|
|
262
262
|
}
|
|
263
|
-
#\${cardId}
|
|
264
|
-
width: 100%;
|
|
265
|
-
}
|
|
266
|
-
#\${cardId} summary {
|
|
263
|
+
#\${cardId} .theclawbay-header {
|
|
267
264
|
display: flex;
|
|
268
265
|
align-items: center;
|
|
269
266
|
justify-content: space-between;
|
|
270
267
|
gap: 12px;
|
|
271
268
|
padding: 14px 16px;
|
|
272
|
-
cursor: pointer;
|
|
273
|
-
font-weight: 600;
|
|
274
|
-
list-style: none;
|
|
275
269
|
}
|
|
276
|
-
#\${cardId}
|
|
277
|
-
|
|
270
|
+
#\${cardId} .theclawbay-title {
|
|
271
|
+
font-size: 14px;
|
|
272
|
+
font-weight: 700;
|
|
273
|
+
color: var(--vscode-foreground, inherit);
|
|
274
|
+
}
|
|
275
|
+
#\${cardId} .theclawbay-topline {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
gap: 10px;
|
|
278
279
|
}
|
|
279
280
|
#\${cardId} .theclawbay-badge {
|
|
280
281
|
border-radius: 999px;
|
|
@@ -309,6 +310,27 @@ function buildWebviewPatch() {
|
|
|
309
310
|
#\${cardId} .theclawbay-button:hover {
|
|
310
311
|
background: var(--vscode-button-hoverBackground, #1177bb);
|
|
311
312
|
}
|
|
313
|
+
#\${cardId} .theclawbay-row {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: space-between;
|
|
317
|
+
gap: 16px;
|
|
318
|
+
flex-wrap: wrap;
|
|
319
|
+
}
|
|
320
|
+
#\${cardId} .theclawbay-toggle {
|
|
321
|
+
display: inline-flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 10px;
|
|
324
|
+
font-size: 13px;
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
color: var(--vscode-foreground, inherit);
|
|
327
|
+
}
|
|
328
|
+
#\${cardId} .theclawbay-toggle input {
|
|
329
|
+
width: 34px;
|
|
330
|
+
height: 18px;
|
|
331
|
+
accent-color: var(--vscode-button-background, #0e639c);
|
|
332
|
+
cursor: pointer;
|
|
333
|
+
}
|
|
312
334
|
\`;
|
|
313
335
|
document.head.appendChild(style);
|
|
314
336
|
}
|
|
@@ -336,33 +358,60 @@ function buildWebviewPatch() {
|
|
|
336
358
|
const wrapper = document.createElement("section");
|
|
337
359
|
wrapper.id = cardId;
|
|
338
360
|
|
|
339
|
-
const
|
|
340
|
-
|
|
361
|
+
const header = document.createElement("div");
|
|
362
|
+
header.className = "theclawbay-header";
|
|
363
|
+
|
|
364
|
+
const topline = document.createElement("div");
|
|
365
|
+
topline.className = "theclawbay-topline";
|
|
341
366
|
const title = document.createElement("span");
|
|
367
|
+
title.className = "theclawbay-title";
|
|
342
368
|
title.textContent = "The Claw Bay";
|
|
343
369
|
const badge = document.createElement("span");
|
|
344
370
|
badge.className = "theclawbay-badge";
|
|
345
371
|
badge.textContent = "Patched";
|
|
346
|
-
|
|
372
|
+
topline.append(title, badge);
|
|
373
|
+
header.appendChild(topline);
|
|
347
374
|
|
|
348
375
|
const body = document.createElement("div");
|
|
349
376
|
body.className = "theclawbay-body";
|
|
350
377
|
|
|
351
378
|
const copy = document.createElement("p");
|
|
352
379
|
copy.className = "theclawbay-copy";
|
|
353
|
-
copy.textContent = "Shows The Claw Bay usage remaining inside Codex
|
|
380
|
+
copy.textContent = "Shows The Claw Bay usage remaining inside Codex.";
|
|
381
|
+
|
|
382
|
+
const row = document.createElement("div");
|
|
383
|
+
row.className = "theclawbay-row";
|
|
384
|
+
|
|
385
|
+
const toggleLabel = document.createElement("label");
|
|
386
|
+
toggleLabel.className = "theclawbay-toggle";
|
|
387
|
+
|
|
388
|
+
const toggle = document.createElement("input");
|
|
389
|
+
toggle.type = "checkbox";
|
|
390
|
+
toggle.checked = true;
|
|
391
|
+
toggle.addEventListener("change", () => {
|
|
392
|
+
if (!toggle.checked) {
|
|
393
|
+
vscodeApi?.postMessage({ type: "open-vscode-command", command: commandId, args: [] });
|
|
394
|
+
}
|
|
395
|
+
window.setTimeout(() => {
|
|
396
|
+
toggle.checked = true;
|
|
397
|
+
}, 0);
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
const toggleText = document.createElement("span");
|
|
401
|
+
toggleText.textContent = "Usage remaining patch";
|
|
402
|
+
toggleLabel.append(toggle, toggleText);
|
|
354
403
|
|
|
355
404
|
const button = document.createElement("button");
|
|
356
405
|
button.type = "button";
|
|
357
406
|
button.className = "theclawbay-button";
|
|
358
|
-
button.textContent = "
|
|
407
|
+
button.textContent = "Remove patch";
|
|
359
408
|
button.addEventListener("click", () => {
|
|
360
409
|
vscodeApi?.postMessage({ type: "open-vscode-command", command: commandId, args: [] });
|
|
361
410
|
});
|
|
362
411
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
wrapper.
|
|
412
|
+
row.append(toggleLabel, button);
|
|
413
|
+
body.append(copy, row);
|
|
414
|
+
wrapper.append(header, body);
|
|
366
415
|
return wrapper;
|
|
367
416
|
}
|
|
368
417
|
|
package/package.json
CHANGED