@sandclaw/prompts-plugin 0.0.5
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 +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/promptLoader.d.ts +6 -0
- package/dist/promptLoader.d.ts.map +1 -0
- package/dist/promptLoader.js +34 -0
- package/dist/promptLoader.js.map +1 -0
- package/dist/tools.d.ts +33 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +145 -0
- package/dist/tools.js.map +1 -0
- package/package.json +20 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MuteworkerEnvironment } from "@sandclaw/muteworker-plugin-api";
|
|
2
|
+
export { createPromptTools } from "./tools";
|
|
3
|
+
export { loadPromptsPrompt } from "./promptLoader";
|
|
4
|
+
export interface PromptsPluginConfig {
|
|
5
|
+
promptsDir: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createPromptsPlugin(config: PromptsPluginConfig): {
|
|
8
|
+
id: "prompts";
|
|
9
|
+
registerGateway(): void;
|
|
10
|
+
registerMuteworker(env: MuteworkerEnvironment): void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAI7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB;;;4BAMnC,qBAAqB;EAkBhD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadPromptsPrompt = exports.createPromptTools = void 0;
|
|
4
|
+
exports.createPromptsPlugin = createPromptsPlugin;
|
|
5
|
+
const muteworker_plugin_api_1 = require("@sandclaw/muteworker-plugin-api");
|
|
6
|
+
const tools_1 = require("./tools");
|
|
7
|
+
const promptLoader_1 = require("./promptLoader");
|
|
8
|
+
var tools_2 = require("./tools");
|
|
9
|
+
Object.defineProperty(exports, "createPromptTools", { enumerable: true, get: function () { return tools_2.createPromptTools; } });
|
|
10
|
+
var promptLoader_2 = require("./promptLoader");
|
|
11
|
+
Object.defineProperty(exports, "loadPromptsPrompt", { enumerable: true, get: function () { return promptLoader_2.loadPromptsPrompt; } });
|
|
12
|
+
function createPromptsPlugin(config) {
|
|
13
|
+
return {
|
|
14
|
+
id: "prompts",
|
|
15
|
+
registerGateway() { },
|
|
16
|
+
registerMuteworker(env) {
|
|
17
|
+
env.registerInit({
|
|
18
|
+
deps: { hooks: muteworker_plugin_api_1.muteworkerDeps.hooks, tools: muteworker_plugin_api_1.muteworkerDeps.tools },
|
|
19
|
+
init({ hooks, tools }) {
|
|
20
|
+
tools.registerTools((ctx) => (0, tools_1.createPromptTools)(ctx, config.promptsDir));
|
|
21
|
+
hooks.register({
|
|
22
|
+
"muteworker:build-system-prompt": async (prev) => {
|
|
23
|
+
const promptsSection = await (0, promptLoader_1.loadPromptsPrompt)(config.promptsDir);
|
|
24
|
+
return promptsSection ? `${prev}\n${promptsSection}` : prev;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAYA,kDAwBC;AApCD,2EAAiE;AAEjE,mCAA4C;AAC5C,iDAAmD;AAEnD,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAM1B,SAAgB,mBAAmB,CAAC,MAA2B;IAC7D,OAAO;QACL,EAAE,EAAE,SAAkB;QAEtB,eAAe,KAAI,CAAC;QAEpB,kBAAkB,CAAC,GAA0B;YAC3C,GAAG,CAAC,YAAY,CAAC;gBACf,IAAI,EAAE,EAAE,KAAK,EAAE,sCAAc,CAAC,KAAK,EAAE,KAAK,EAAE,sCAAc,CAAC,KAAK,EAAE;gBAClE,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;oBACnB,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1B,IAAA,yBAAiB,EAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,CAC1C,CAAC;oBAEF,KAAK,CAAC,QAAQ,CAAC;wBACb,gCAAgC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;4BAC/C,MAAM,cAAc,GAAG,MAAM,IAAA,gCAAiB,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;4BAClE,OAAO,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;wBAC9D,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptLoader.d.ts","sourceRoot":"","sources":["../src/promptLoader.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW3E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadPromptsPrompt = loadPromptsPrompt;
|
|
7
|
+
const promises_1 = require("node:fs/promises");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
async function tryReadFile(filePath) {
|
|
10
|
+
return (0, promises_1.readFile)(filePath, "utf8").catch((error) => {
|
|
11
|
+
if (error.code === "ENOENT")
|
|
12
|
+
return null;
|
|
13
|
+
throw error;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function wrapPrompt(filename, content) {
|
|
17
|
+
const name = filename.endsWith(".md") ? filename.slice(0, -3) : filename;
|
|
18
|
+
return `File: ${name}\n<PROMPTS>\n${content.trim()}\n</PROMPTS>`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Loads the core prompt files (IDENTITY.md, SYSTEM.md, SOUL.md, USER.md)
|
|
22
|
+
* from `promptsDir` and wraps each in `<PROMPTS>` tags.
|
|
23
|
+
*/
|
|
24
|
+
async function loadPromptsPrompt(promptsDir) {
|
|
25
|
+
const coreFiles = ["IDENTITY.md", "SYSTEM.md", "SOUL.md", "USER.md"];
|
|
26
|
+
const corePrompts = await Promise.all(coreFiles.map(async (filename) => {
|
|
27
|
+
const content = await tryReadFile(node_path_1.default.join(promptsDir, filename));
|
|
28
|
+
if (!content)
|
|
29
|
+
return null;
|
|
30
|
+
return wrapPrompt(filename, content);
|
|
31
|
+
}));
|
|
32
|
+
return corePrompts.filter((p) => p !== null).join("\n");
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=promptLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptLoader.js","sourceRoot":"","sources":["../src/promptLoader.ts"],"names":[],"mappings":";;;;;AAmBA,8CAWC;AA9BD,+CAA4C;AAC5C,0DAA6B;AAE7B,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
import { TSchema } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { MuteworkerPluginContext } from "@sandclaw/muteworker-plugin-api";
|
|
3
|
+
export declare function createPromptTools(ctx: MuteworkerPluginContext, promptsDir: string): ({
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
parameters: TSchema;
|
|
8
|
+
execute: () => Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
details: {
|
|
14
|
+
files: string[] | never[];
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
} | {
|
|
18
|
+
name: string;
|
|
19
|
+
label: string;
|
|
20
|
+
description: string;
|
|
21
|
+
parameters: TSchema;
|
|
22
|
+
execute: (_toolCallId: string, params: any) => Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
details: {
|
|
28
|
+
path: string;
|
|
29
|
+
bytes: number;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
})[];
|
|
33
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,uBAAuB,EAC5B,UAAU,EAAE,MAAM;;;;gBAYE,OAAO;;;;;;;;;;;;;;gBA8BP,OAAO;2BACM,MAAM,UAAU,GAAG;;;;;;;;;;KAiFrD"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createPromptTools = createPromptTools;
|
|
7
|
+
const promises_1 = require("node:fs/promises");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
function createPromptTools(ctx, promptsDir) {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
name: "list_prompt_files",
|
|
13
|
+
label: "List Prompt Files",
|
|
14
|
+
description: "List all files available under prompts/. Use this before reading or writing prompt files.",
|
|
15
|
+
parameters: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {},
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
execute: async () => {
|
|
21
|
+
const files = await listDir(promptsDir).catch((error) => {
|
|
22
|
+
if (error.code === "ENOENT")
|
|
23
|
+
return [];
|
|
24
|
+
throw error;
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: "text",
|
|
30
|
+
text: files.length > 0
|
|
31
|
+
? files.join("\n")
|
|
32
|
+
: "No prompt files found in prompts/.",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
details: { files },
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "read_prompt_file",
|
|
41
|
+
label: "Read Prompt File",
|
|
42
|
+
description: "Read a UTF-8 text file from prompts/. Path must be relative to prompts/.",
|
|
43
|
+
parameters: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: { path: { type: "string" } },
|
|
46
|
+
required: ["path"],
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
},
|
|
49
|
+
execute: async (_toolCallId, params) => {
|
|
50
|
+
const relativePath = validateRelativePath(String(params.path), promptsDir, "prompts/");
|
|
51
|
+
const absolutePath = node_path_1.default.join(promptsDir, relativePath);
|
|
52
|
+
const contents = await (0, promises_1.readFile)(absolutePath, "utf8");
|
|
53
|
+
ctx.artifacts.push({
|
|
54
|
+
type: "text",
|
|
55
|
+
label: "Prompt Read",
|
|
56
|
+
value: relativePath,
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: "text", text: contents }],
|
|
60
|
+
details: {
|
|
61
|
+
path: relativePath,
|
|
62
|
+
bytes: Buffer.byteLength(contents, "utf8"),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "write_prompt_file",
|
|
69
|
+
label: "Write Prompt File",
|
|
70
|
+
description: "Write UTF-8 text to a file in prompts/. Path must be relative to prompts/.",
|
|
71
|
+
parameters: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
path: { type: "string" },
|
|
75
|
+
content: { type: "string" },
|
|
76
|
+
append: { type: "boolean" },
|
|
77
|
+
},
|
|
78
|
+
required: ["path", "content"],
|
|
79
|
+
additionalProperties: false,
|
|
80
|
+
},
|
|
81
|
+
execute: async (_toolCallId, params) => {
|
|
82
|
+
const relativePath = validateRelativePath(String(params.path), promptsDir, "prompts/");
|
|
83
|
+
const absolutePath = node_path_1.default.join(promptsDir, relativePath);
|
|
84
|
+
const contents = String(params.content);
|
|
85
|
+
const append = Boolean(params.append);
|
|
86
|
+
await (0, promises_1.mkdir)(node_path_1.default.dirname(absolutePath), { recursive: true });
|
|
87
|
+
if (append) {
|
|
88
|
+
const current = await (0, promises_1.readFile)(absolutePath, "utf8").catch((error) => {
|
|
89
|
+
if (error.code === "ENOENT")
|
|
90
|
+
return "";
|
|
91
|
+
throw error;
|
|
92
|
+
});
|
|
93
|
+
await (0, promises_1.writeFile)(absolutePath, `${current}${contents}`, "utf8");
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
await (0, promises_1.writeFile)(absolutePath, contents, "utf8");
|
|
97
|
+
}
|
|
98
|
+
ctx.artifacts.push({
|
|
99
|
+
type: "text",
|
|
100
|
+
label: "Prompt Write",
|
|
101
|
+
value: relativePath,
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: `Wrote ${Buffer.byteLength(contents, "utf8")} bytes to prompts/${relativePath}`,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
details: {
|
|
111
|
+
path: relativePath,
|
|
112
|
+
append,
|
|
113
|
+
bytes: Buffer.byteLength(contents, "utf8"),
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
function validateRelativePath(inputPath, rootDir, label) {
|
|
121
|
+
const normalized = inputPath.trim().replaceAll("\\", "/");
|
|
122
|
+
if (!normalized)
|
|
123
|
+
throw new Error(`${label} file path cannot be empty`);
|
|
124
|
+
if (node_path_1.default.isAbsolute(normalized))
|
|
125
|
+
throw new Error(`${label} file path must be relative`);
|
|
126
|
+
const absolute = node_path_1.default.resolve(rootDir, normalized);
|
|
127
|
+
const relative = node_path_1.default.relative(rootDir, absolute);
|
|
128
|
+
if (!relative || relative.startsWith("..") || node_path_1.default.isAbsolute(relative)) {
|
|
129
|
+
throw new Error(`Path escapes ${label} and is not allowed`);
|
|
130
|
+
}
|
|
131
|
+
return relative.replaceAll("\\", "/");
|
|
132
|
+
}
|
|
133
|
+
async function listDir(dirPath) {
|
|
134
|
+
const entries = await (0, promises_1.readdir)(dirPath, { withFileTypes: true });
|
|
135
|
+
const files = await Promise.all(entries.map(async (entry) => {
|
|
136
|
+
const abs = node_path_1.default.join(dirPath, entry.name);
|
|
137
|
+
if (entry.isDirectory()) {
|
|
138
|
+
const sub = await listDir(abs);
|
|
139
|
+
return sub.map((f) => `${entry.name}/${f}`);
|
|
140
|
+
}
|
|
141
|
+
return entry.isFile() ? [entry.name] : [];
|
|
142
|
+
}));
|
|
143
|
+
return files.flat().sort((a, b) => a.localeCompare(b));
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;;;;AAKA,8CA8HC;AAlID,+CAAuE;AACvE,0DAA6B;AAG7B,SAAgB,iBAAiB,CAC/B,GAA4B,EAC5B,UAAkB;IAElB,OAAO;QACL;YACE,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,2FAA2F;YAC7F,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE;gBACd,oBAAoB,EAAE,KAAK;aACN;YACvB,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACtD,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;wBAAE,OAAO,EAAE,CAAC;oBAClE,MAAM,KAAK,CAAC;gBACd,CAAC,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,KAAK,CAAC,MAAM,GAAG,CAAC;gCACd,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gCAClB,CAAC,CAAC,oCAAoC;yBAC3C;qBACF;oBACD,OAAO,EAAE,EAAE,KAAK,EAAE;iBACnB,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,0EAA0E;YAC5E,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBACxC,QAAQ,EAAE,CAAC,MAAM,CAAC;gBAClB,oBAAoB,EAAE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EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/B,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC,CAAC,CACH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sandclaw/prompts-plugin",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Sandclaw Prompts plugin — agent prompt file tools and system prompt hook",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc -p tsconfig.build.json"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@sandclaw/gatekeeper-plugin-api": "^0.0.5",
|
|
18
|
+
"@sandclaw/muteworker-plugin-api": "^0.0.5"
|
|
19
|
+
}
|
|
20
|
+
}
|