@ulrichc1/sparn 1.2.0 → 1.2.2
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/README.md +1 -1
- package/dist/cli/index.cjs +9 -9
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +9 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/hooks/post-tool-result.cjs +66 -11
- package/dist/hooks/post-tool-result.cjs.map +1 -1
- package/dist/hooks/post-tool-result.js +66 -11
- package/dist/hooks/post-tool-result.js.map +1 -1
- package/dist/hooks/pre-prompt.cjs +38 -3
- package/dist/hooks/pre-prompt.cjs.map +1 -1
- package/dist/hooks/pre-prompt.js +39 -4
- package/dist/hooks/pre-prompt.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.cjs +2 -2
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -351,8 +351,8 @@ var init_config = __esm({
|
|
|
351
351
|
},
|
|
352
352
|
autoConsolidate: null,
|
|
353
353
|
realtime: {
|
|
354
|
-
tokenBudget:
|
|
355
|
-
autoOptimizeThreshold:
|
|
354
|
+
tokenBudget: 4e4,
|
|
355
|
+
autoOptimizeThreshold: 6e4,
|
|
356
356
|
watchPatterns: ["**/*.jsonl"],
|
|
357
357
|
pidFile: ".sparn/daemon.pid",
|
|
358
358
|
logFile: ".sparn/daemon.log",
|
|
@@ -1866,8 +1866,8 @@ async function installHooks(settingsPath, prePromptPath, postToolResultPath, glo
|
|
|
1866
1866
|
}
|
|
1867
1867
|
settings["hooks"] = {
|
|
1868
1868
|
...typeof settings["hooks"] === "object" && settings["hooks"] !== null ? settings["hooks"] : {},
|
|
1869
|
-
|
|
1870
|
-
|
|
1869
|
+
prePrompt: `node ${prePromptPath}`,
|
|
1870
|
+
postToolResult: `node ${postToolResultPath}`
|
|
1871
1871
|
};
|
|
1872
1872
|
writeFileSync3(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
1873
1873
|
return {
|
|
@@ -1900,8 +1900,8 @@ async function uninstallHooks(settingsPath, global) {
|
|
|
1900
1900
|
const settings = JSON.parse(settingsJson);
|
|
1901
1901
|
if (settings["hooks"] && typeof settings["hooks"] === "object" && settings["hooks"] !== null) {
|
|
1902
1902
|
const hooks = settings["hooks"];
|
|
1903
|
-
delete hooks["
|
|
1904
|
-
delete hooks["
|
|
1903
|
+
delete hooks["prePrompt"];
|
|
1904
|
+
delete hooks["postToolResult"];
|
|
1905
1905
|
if (Object.keys(hooks).length === 0) {
|
|
1906
1906
|
delete settings["hooks"];
|
|
1907
1907
|
}
|
|
@@ -1931,7 +1931,7 @@ async function hooksStatus(settingsPath, global) {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
const settingsJson = readFileSync4(settingsPath, "utf-8");
|
|
1933
1933
|
const settings = JSON.parse(settingsJson);
|
|
1934
|
-
const hasHooks = settings["hooks"] && typeof settings["hooks"] === "object" && settings["hooks"] !== null && "
|
|
1934
|
+
const hasHooks = settings["hooks"] && typeof settings["hooks"] === "object" && settings["hooks"] !== null && "prePrompt" in settings["hooks"] && "postToolResult" in settings["hooks"];
|
|
1935
1935
|
if (!hasHooks) {
|
|
1936
1936
|
return {
|
|
1937
1937
|
success: true,
|
|
@@ -1945,8 +1945,8 @@ async function hooksStatus(settingsPath, global) {
|
|
|
1945
1945
|
message: global ? "Global hooks active" : "Project hooks active",
|
|
1946
1946
|
installed: true,
|
|
1947
1947
|
hookPaths: {
|
|
1948
|
-
prePrompt: hooks["
|
|
1949
|
-
postToolResult: hooks["
|
|
1948
|
+
prePrompt: hooks["prePrompt"] || "",
|
|
1949
|
+
postToolResult: hooks["postToolResult"] || ""
|
|
1950
1950
|
}
|
|
1951
1951
|
};
|
|
1952
1952
|
} catch (error) {
|