@xn-intenton-z2a/agentic-lib 7.1.21 → 7.1.22
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/agentic-lib.js
CHANGED
|
@@ -92,7 +92,10 @@ if (TASK_COMMANDS.includes(command)) {
|
|
|
92
92
|
|
|
93
93
|
let purge = flags.includes("--purge");
|
|
94
94
|
let reseed = flags.includes("--reseed") || purge;
|
|
95
|
-
if (command === "reset") {
|
|
95
|
+
if (command === "reset") {
|
|
96
|
+
purge = true;
|
|
97
|
+
reseed = true;
|
|
98
|
+
}
|
|
96
99
|
|
|
97
100
|
if (!ALL_COMMANDS.includes(command)) {
|
|
98
101
|
console.error(`Unknown command: ${command}`);
|
|
@@ -763,6 +766,15 @@ function initReseed() {
|
|
|
763
766
|
if (!dryRun) rmdirSync(oldFeaturesDir);
|
|
764
767
|
console.log(" REMOVE: .github/agentic-lib/features/ (old location)");
|
|
765
768
|
}
|
|
769
|
+
// Clear library directory (generated from SOURCES.md)
|
|
770
|
+
const libraryDir = resolve(target, "library");
|
|
771
|
+
if (existsSync(libraryDir)) {
|
|
772
|
+
for (const f of readdirSync(libraryDir)) {
|
|
773
|
+
if (!dryRun) rmSync(resolve(libraryDir, f));
|
|
774
|
+
console.log(` REMOVE: library/${f}`);
|
|
775
|
+
initChanges++;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
766
778
|
// Remove old getting-started-guide if it exists
|
|
767
779
|
const oldGuideDir = resolve(target, ".github/agentic-lib/getting-started-guide");
|
|
768
780
|
if (existsSync(oldGuideDir)) {
|
|
@@ -778,6 +790,7 @@ function initPurge(seedsDir) {
|
|
|
778
790
|
"zero-main.js": "src/lib/main.js",
|
|
779
791
|
"zero-main.test.js": "tests/unit/main.test.js",
|
|
780
792
|
"zero-MISSION.md": "MISSION.md",
|
|
793
|
+
"zero-SOURCES.md": "SOURCES.md",
|
|
781
794
|
"zero-package.json": "package.json",
|
|
782
795
|
"zero-README.md": "README.md",
|
|
783
796
|
};
|
package/package.json
CHANGED
|
@@ -92,7 +92,7 @@ export async function runCopilotTask({ model, systemMessage, prompt, writablePat
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
core.info("[copilot] Sending prompt and waiting for idle...");
|
|
95
|
-
const response = await session.sendAndWait({ prompt },
|
|
95
|
+
const response = await session.sendAndWait({ prompt }, 600000);
|
|
96
96
|
core.info(`[copilot] sendAndWait resolved`);
|
|
97
97
|
const tokensUsed = response?.data?.usage?.totalTokens || 0;
|
|
98
98
|
const content = response?.data?.content || "";
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// - Retrying failed branches/issues beyond configured limits
|
|
8
8
|
// - Writing to paths outside the allowed set
|
|
9
9
|
|
|
10
|
+
import { resolve } from "path";
|
|
10
11
|
import { logSafetyCheck } from "./logging.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -74,10 +75,12 @@ export async function checkAttemptLimit(octokit, repo, issueNumber, branchPrefix
|
|
|
74
75
|
* @returns {boolean} True if the path is allowed
|
|
75
76
|
*/
|
|
76
77
|
export function isPathWritable(targetPath, writablePaths) {
|
|
78
|
+
const resolvedTarget = resolve(targetPath);
|
|
77
79
|
const writable = writablePaths.some((allowed) => {
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
80
|
+
const resolvedAllowed = resolve(allowed);
|
|
81
|
+
if (resolvedTarget === resolvedAllowed) return true;
|
|
82
|
+
if (allowed.endsWith("/") && resolvedTarget.startsWith(resolvedAllowed)) return true;
|
|
83
|
+
if (resolvedTarget.startsWith(resolvedAllowed + "/")) return true;
|
|
81
84
|
return false;
|
|
82
85
|
});
|
|
83
86
|
logSafetyCheck("path-writable", writable, { targetPath });
|
|
@@ -58,7 +58,7 @@ export function createAgentTools(writablePaths) {
|
|
|
58
58
|
handler: ({ path, content }) => {
|
|
59
59
|
const resolved = resolve(path);
|
|
60
60
|
core.info(`[tool] write_file: ${resolved}`);
|
|
61
|
-
if (!isPathWritable(resolved, writablePaths)
|
|
61
|
+
if (!isPathWritable(resolved, writablePaths)) {
|
|
62
62
|
return { error: `Path is not writable: ${path}. Writable paths: ${writablePaths.join(", ")}` };
|
|
63
63
|
}
|
|
64
64
|
try {
|