@rowan-agent/agent 0.9.0 → 0.9.1
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/index.d.ts +4 -0
- package/dist/index.js +6 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -590,6 +590,10 @@ type AgentContext = {
|
|
|
590
590
|
phases?: PhaseRegistry;
|
|
591
591
|
};
|
|
592
592
|
|
|
593
|
+
/**
|
|
594
|
+
* `root` anchors relative paths and the Bash working directory. It is not a
|
|
595
|
+
* filesystem sandbox: core Tools use the permissions of the host process.
|
|
596
|
+
*/
|
|
593
597
|
type CoreToolContext = {
|
|
594
598
|
root?: string;
|
|
595
599
|
maxReadBytes?: number;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/harness/tools/index.ts
|
|
2
2
|
import { mkdir, readFile as readFile2, stat, writeFile } from "fs/promises";
|
|
3
|
-
import { basename as basename2, dirname as dirname2,
|
|
3
|
+
import { basename as basename2, dirname as dirname2, relative as relative2, resolve as resolve2 } from "path";
|
|
4
4
|
import Type2 from "typebox";
|
|
5
5
|
import Schema from "typebox/schema";
|
|
6
6
|
|
|
@@ -308,9 +308,6 @@ function resolveCoreToolPath(context, path = ".") {
|
|
|
308
308
|
const inputPath = normalizeCoreToolInputPath(path);
|
|
309
309
|
const absolutePath = resolve2(root, inputPath);
|
|
310
310
|
const relativePath = relative2(root, absolutePath);
|
|
311
|
-
if (relativePath === ".." || relativePath.startsWith(`..${sep2}`) || isAbsolute2(relativePath)) {
|
|
312
|
-
throw new Error(`Path escapes workspace root: ${path}`);
|
|
313
|
-
}
|
|
314
311
|
return {
|
|
315
312
|
root,
|
|
316
313
|
inputPath,
|
|
@@ -465,7 +462,7 @@ async function captureStream(stream, maxBytes) {
|
|
|
465
462
|
function createReadTool(context) {
|
|
466
463
|
return {
|
|
467
464
|
name: "read",
|
|
468
|
-
description: "Read a file
|
|
465
|
+
description: "Read a file using the host process filesystem permissions.",
|
|
469
466
|
parameters: ReadArgsSchema,
|
|
470
467
|
promptSnippet: "Read file contents.",
|
|
471
468
|
promptGuidelines: ["Read files before editing them."],
|
|
@@ -536,7 +533,7 @@ function createReadTool(context) {
|
|
|
536
533
|
function createWriteTool(context) {
|
|
537
534
|
return {
|
|
538
535
|
name: "write",
|
|
539
|
-
description: "Create or overwrite a file
|
|
536
|
+
description: "Create or overwrite a file using the host process filesystem permissions.",
|
|
540
537
|
parameters: WriteArgsSchema,
|
|
541
538
|
promptSnippet: "Create or overwrite files.",
|
|
542
539
|
promptGuidelines: ["Use edit for partial changes."],
|
|
@@ -588,7 +585,7 @@ function applyEditReplacements(current, edits) {
|
|
|
588
585
|
function createEditTool(context) {
|
|
589
586
|
return {
|
|
590
587
|
name: "edit",
|
|
591
|
-
description: "Apply exact text replacements
|
|
588
|
+
description: "Apply exact text replacements using the host process filesystem permissions.",
|
|
592
589
|
parameters: EditArgsSchema,
|
|
593
590
|
promptSnippet: "Apply exact text replacements.",
|
|
594
591
|
promptGuidelines: ["Read the file first; each oldText must match exactly once."],
|
|
@@ -624,7 +621,7 @@ function createEditTool(context) {
|
|
|
624
621
|
function createBashTool(context) {
|
|
625
622
|
return {
|
|
626
623
|
name: "bash",
|
|
627
|
-
description: "Run a bash command
|
|
624
|
+
description: "Run a bash command with the host process filesystem permissions; root is the working directory.",
|
|
628
625
|
parameters: BashArgsSchema,
|
|
629
626
|
promptSnippet: "Run shell commands.",
|
|
630
627
|
promptGuidelines: ["Use read/write/edit for file operations."],
|
|
@@ -1540,7 +1537,7 @@ function buildSystemPrompt(options) {
|
|
|
1540
1537
|
}
|
|
1541
1538
|
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
|
|
1542
1539
|
const skillsSection = skillsBlock ? `The following skills provide specialized instructions for specific tasks.
|
|
1543
|
-
|
|
1540
|
+
Use the read tool to load a skill's file when the task matches its description.
|
|
1544
1541
|
When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md) and use that absolute path in tool commands.
|
|
1545
1542
|
|
|
1546
1543
|
${skillsBlock}
|