fix: resolve prompt files from package root instead of dist #74

Merged
xiaomo merged 2 commits from fix/prompt-path into main 2026-06-04 00:38:14 +00:00
5 changed files with 12 additions and 3 deletions
+4
View File
@@ -14,6 +14,10 @@
"bin": {
"ocas": "dist/index.js"
},
"files": [
"dist",
"prompts"
],
"dependencies": {
"@ocas/core": "workspace:*",
"@ocas/fs": "workspace:*"
+2 -2
View File
@@ -1234,7 +1234,7 @@ switch (cmd) {
switch (sub) {
case "usage": {
const content = readFileSync(
join(__dirname, "prompts", "usage.md"),
join(__dirname, "..", "prompts", "usage.md"),
"utf-8",
);
process.stdout.write(content);
@@ -1242,7 +1242,7 @@ switch (cmd) {
}
case "setup": {
const content = readFileSync(
join(__dirname, "prompts", "setup.md"),
join(__dirname, "..", "prompts", "setup.md"),
"utf-8",
);
process.stdout.write(content);
1
@@ -466,5 +466,5 @@ Flags:
--epsilon <n> Cutoff threshold for render (default: 0.01)
--pipe, -p Read from stdin (put/hash: raw JSON payload; render: { type, value } envelope)
Agent: If you have not installed the ocas skill for this version (0.3.0), run \`ocas prompt setup\` and follow the instructions."
Agent: If you have not installed the ocas skill for this version (0.3.1), run \`ocas prompt setup\` and follow the instructions."
`;
+3
View File
@@ -52,6 +52,7 @@ describe("Phase 7: Edge Cases", () => {
{
encoding: "utf-8",
timeout: 10000,
env: { ...process.env, NODE_NO_WARNINGS: "1" },
},
);
return { stdout: stdout.trim(), stderr: "", exitCode: 0 };
@@ -177,6 +178,7 @@ describe("Phase 3: Variable System", () => {
{
encoding: "utf-8",
timeout: 10000,
env: { ...process.env, NODE_NO_WARNINGS: "1" },
},
);
return { stdout: stdout.trim(), stderr: "", exitCode: 0 };
@@ -379,6 +381,7 @@ describe("Phase 4: Template System", () => {
{
encoding: "utf-8",
timeout: 10000,
env: { ...process.env, NODE_NO_WARNINGS: "1" },
},
);
return { stdout: stdout.trim(), stderr: "", exitCode: 0 };
@@ -610,6 +610,7 @@ describe("Phase 2: Schema Validation", () => {
{
encoding: "utf-8",
timeout: 10000,
env: { ...process.env, NODE_NO_WARNINGS: "1" },
},
).trim();
} catch (e: unknown) {
@@ -635,6 +636,7 @@ describe("Phase 2: Schema Validation", () => {
{
encoding: "utf-8",
timeout: 10000,
env: { ...process.env, NODE_NO_WARNINGS: "1" },
},
);
} catch (e: unknown) {