inplan 0.3.7 → 0.3.8
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/bin/cli.js +13 -3
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -4037,10 +4037,20 @@ async function relayText(file, text) {
|
|
|
4037
4037
|
} catch {
|
|
4038
4038
|
}
|
|
4039
4039
|
}
|
|
4040
|
+
function relayStatus(obj, hookMode) {
|
|
4041
|
+
if (!hookMode) {
|
|
4042
|
+
output(obj);
|
|
4043
|
+
return;
|
|
4044
|
+
}
|
|
4045
|
+
process.stdout.write("{}\n");
|
|
4046
|
+
if (process.env.INPLAN_RELAY_DEBUG === "1") process.stderr.write(`inplan: relay ${JSON.stringify(obj)}
|
|
4047
|
+
`);
|
|
4048
|
+
}
|
|
4040
4049
|
async function doRelay(args) {
|
|
4050
|
+
const hookMode = args.some((a) => a === "--hook" || a.startsWith("--hook="));
|
|
4041
4051
|
const file = activeDocForCwd(process.cwd());
|
|
4042
4052
|
if (!file) {
|
|
4043
|
-
|
|
4053
|
+
relayStatus({ status: "relay_skipped", reason: "no_active_doc" }, hookMode);
|
|
4044
4054
|
return;
|
|
4045
4055
|
}
|
|
4046
4056
|
const hook = getFlag(args, "hook");
|
|
@@ -4060,11 +4070,11 @@ async function doRelay(args) {
|
|
|
4060
4070
|
}
|
|
4061
4071
|
const clean = notes.map((n) => n.trim().slice(0, 2e3)).filter(Boolean);
|
|
4062
4072
|
if (clean.length === 0) {
|
|
4063
|
-
|
|
4073
|
+
relayStatus({ status: "relay_skipped", reason: "no_text" }, hookMode);
|
|
4064
4074
|
return;
|
|
4065
4075
|
}
|
|
4066
4076
|
for (const n of clean) await relayText(file, n);
|
|
4067
|
-
|
|
4077
|
+
relayStatus({ status: "relayed", count: clean.length }, hookMode);
|
|
4068
4078
|
}
|
|
4069
4079
|
function skillTargets() {
|
|
4070
4080
|
const home = homedir7();
|