@macintacos/caret 0.1.1 → 0.1.3
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/.claude-plugin/plugin.json +1 -1
- package/dist/cli.js +24 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4438,9 +4438,12 @@ function setModeFor(id) {
|
|
|
4438
4438
|
}
|
|
4439
4439
|
|
|
4440
4440
|
// src/adapters/claude/feedback.ts
|
|
4441
|
-
function toHookOutput(input) {
|
|
4441
|
+
function toHookOutput(input, updatedInput) {
|
|
4442
4442
|
if (input.behavior === "allow") {
|
|
4443
4443
|
const decision = { behavior: "allow" };
|
|
4444
|
+
if (updatedInput) {
|
|
4445
|
+
decision.updatedInput = updatedInput;
|
|
4446
|
+
}
|
|
4444
4447
|
const mode = setModeFor(input.acceptMode);
|
|
4445
4448
|
if (mode) {
|
|
4446
4449
|
decision.updatedPermissions = [{ type: "setMode", mode, destination: "session" }];
|
|
@@ -4544,6 +4547,16 @@ function readHookInUserSettings(path) {
|
|
|
4544
4547
|
}
|
|
4545
4548
|
|
|
4546
4549
|
// src/adapters/claude/index.ts
|
|
4550
|
+
function toolInputEcho(input) {
|
|
4551
|
+
if (!input)
|
|
4552
|
+
return;
|
|
4553
|
+
const echo = {};
|
|
4554
|
+
if (input.plan !== undefined)
|
|
4555
|
+
echo.plan = input.plan;
|
|
4556
|
+
if (input.planFilePath !== undefined)
|
|
4557
|
+
echo.planFilePath = input.planFilePath;
|
|
4558
|
+
return Object.keys(echo).length > 0 ? echo : undefined;
|
|
4559
|
+
}
|
|
4547
4560
|
var claudeAdapter = {
|
|
4548
4561
|
approveVariants: APPROVE_VARIANTS,
|
|
4549
4562
|
parseHookInput(stdin) {
|
|
@@ -4560,8 +4573,8 @@ var claudeAdapter = {
|
|
|
4560
4573
|
planFilePath: hook.tool_input?.planFilePath
|
|
4561
4574
|
};
|
|
4562
4575
|
},
|
|
4563
|
-
emitDecision(decision) {
|
|
4564
|
-
return JSON.stringify(toHookOutput(decision));
|
|
4576
|
+
emitDecision(decision, input) {
|
|
4577
|
+
return JSON.stringify(toHookOutput(decision, toolInputEcho(input)));
|
|
4565
4578
|
},
|
|
4566
4579
|
fatalDenyLine(reason) {
|
|
4567
4580
|
return fatalDenyLine(reason);
|
|
@@ -5777,7 +5790,7 @@ import { createHash } from "crypto";
|
|
|
5777
5790
|
// package.json
|
|
5778
5791
|
var package_default = {
|
|
5779
5792
|
name: "@macintacos/caret",
|
|
5780
|
-
version: "0.1.
|
|
5793
|
+
version: "0.1.3",
|
|
5781
5794
|
license: "MIT",
|
|
5782
5795
|
type: "module",
|
|
5783
5796
|
description: "A Claude Code plugin that replaces the terminal plan-approval prompt with a local web UI for inline review, annotation, and approval.",
|
|
@@ -30495,12 +30508,13 @@ async function runReviewSubcommand() {
|
|
|
30495
30508
|
setRedact(loaded.logging.redact);
|
|
30496
30509
|
warnInvalidEnvVars((msg) => logWarn("env", msg));
|
|
30497
30510
|
const adapter = selectAdapter();
|
|
30511
|
+
let hookInput;
|
|
30498
30512
|
let responded = false;
|
|
30499
30513
|
const respond = (decision) => {
|
|
30500
30514
|
if (responded)
|
|
30501
30515
|
return;
|
|
30502
30516
|
responded = true;
|
|
30503
|
-
process.stdout.write(`${adapter.emitDecision(decision)}
|
|
30517
|
+
process.stdout.write(`${adapter.emitDecision(decision, hookInput)}
|
|
30504
30518
|
`);
|
|
30505
30519
|
};
|
|
30506
30520
|
const denyAndExit = (reason) => {
|
|
@@ -30512,6 +30526,11 @@ async function runReviewSubcommand() {
|
|
|
30512
30526
|
process.once("SIGINT", () => denyAndExit("caret: interrupted (SIGINT) \u2014 denying to fail safe."));
|
|
30513
30527
|
process.once("SIGTERM", () => denyAndExit("caret: terminated (SIGTERM) \u2014 denying to fail safe."));
|
|
30514
30528
|
const stdin = await Bun.stdin.text();
|
|
30529
|
+
try {
|
|
30530
|
+
hookInput = adapter.parseHookInput(stdin);
|
|
30531
|
+
} catch {
|
|
30532
|
+
hookInput = undefined;
|
|
30533
|
+
}
|
|
30515
30534
|
const out = await runReview(stdin, prodReviewDeps(loaded, adapter));
|
|
30516
30535
|
respond(out);
|
|
30517
30536
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macintacos/caret",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A Claude Code plugin that replaces the terminal plan-approval prompt with a local web UI for inline review, annotation, and approval.",
|