@maestria/opencode 0.4.1 → 0.4.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/dist/index.js +13 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { readFileSync, readdirSync } from "fs";
|
|
|
2
2
|
import { join, dirname, basename } from "path";
|
|
3
3
|
import { parse as parseYaml } from "yaml";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
|
-
import { maestriaOptionsSchema } from "
|
|
6
|
-
import { detectMode, stripKeyword, getModeMarker, getModePrompt } from "
|
|
5
|
+
import { maestriaOptionsSchema } from "@/modes/types.js";
|
|
6
|
+
import { detectMode, stripKeyword, getModeMarker, getModePrompt } from "@/modes/index.js";
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
const agentsDir = join(__dirname, "..", "agents");
|
|
9
9
|
const rulesPath = join(__dirname, "..", "rules", "AGENTS.md");
|
|
@@ -84,17 +84,17 @@ export const MaestriaPlugin = async (_input, options) => {
|
|
|
84
84
|
const result = detectMode(textPart.text, disabledKeywords);
|
|
85
85
|
if (!result)
|
|
86
86
|
return;
|
|
87
|
-
// Strip keyword from text
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
// Strip keyword from text and prepend mode marker + prompt inline.
|
|
88
|
+
// We embed everything in the existing text part rather than injecting
|
|
89
|
+
// a second text part into `parts`, because the OpenCode runtime does
|
|
90
|
+
// not handle multiple text parts per message (causes a hang).
|
|
91
|
+
textPart.text = [
|
|
92
|
+
getModeMarker(result.mode),
|
|
93
|
+
"",
|
|
94
|
+
getModePrompt(result.mode),
|
|
95
|
+
"",
|
|
96
|
+
stripKeyword(textPart.text, result),
|
|
97
|
+
].join("\n");
|
|
98
98
|
},
|
|
99
99
|
};
|
|
100
100
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maestria/opencode",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "OpenCode plugin encoding AI engineering praxis: rules, agents, and workflow discipline.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"node": ">=22.12.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
|
-
"build": "tsc && bash scripts/verify-imports.sh",
|
|
57
|
+
"build": "tsc -p tsconfig.build.json && bash scripts/verify-imports.sh",
|
|
58
58
|
"test": "node ./node_modules/vitest/vitest.mjs run"
|
|
59
59
|
}
|
|
60
60
|
}
|