bros-harness 0.1.3 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4 - 2026-06-03
4
+
5
+ - Fixed packaged command config to use OpenCode's `template` field.
6
+ - Fixed frontmatter parsing for quoted permission keys containing `:`.
7
+
3
8
  ## 0.1.3 - 2026-06-03
4
9
 
5
10
  - Fixed OpenCode 1.15 plugin loading by exporting the V1 plugin module shape with `id` and `server`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bros-harness",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Package-first OpenCode plugin for disciplined BROS agent harness assets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/plugin.mjs CHANGED
@@ -32,14 +32,14 @@ export async function verifyBrosHarnessAssets() {
32
32
  function parseCommandMarkdown(markdown) {
33
33
  const match = markdown.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
34
34
  if (!match) {
35
- return { description: "BROS Harness command.", prompt: markdown.trim() };
35
+ return { description: "BROS Harness command.", template: markdown.trim() };
36
36
  }
37
37
 
38
38
  const descriptionMatch = match[1].match(/^description:\s*(.+)$/m);
39
39
  const description = descriptionMatch?.[1]?.replace(/^['\"]|['\"]$/g, "").trim();
40
40
  return {
41
41
  description: description || "BROS Harness command.",
42
- prompt: match[2].trim()
42
+ template: match[2].trim()
43
43
  };
44
44
  }
45
45
 
@@ -54,6 +54,22 @@ function parseYamlScalar(value) {
54
54
  return trimmed;
55
55
  }
56
56
 
57
+ function parseYamlKeyValue(line) {
58
+ let quote = "";
59
+ for (let index = 0; index < line.length; index += 1) {
60
+ const char = line[index];
61
+ if ((char === '"' || char === "'") && line[index - 1] !== "\\") {
62
+ quote = quote === char ? "" : quote || char;
63
+ continue;
64
+ }
65
+
66
+ if (char === ":" && !quote) {
67
+ return [line.slice(0, index), line.slice(index + 1)];
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+
57
73
  function parseSimpleYamlObject(yaml) {
58
74
  const root = {};
59
75
  const stack = [{ indent: -1, value: root }];
@@ -63,11 +79,11 @@ function parseSimpleYamlObject(yaml) {
63
79
 
64
80
  const indent = rawLine.match(/^ */)?.[0].length ?? 0;
65
81
  const line = rawLine.trim();
66
- const match = line.match(/^(.+?):(?:\s*(.*))?$/);
67
- if (!match) continue;
82
+ const parsedLine = parseYamlKeyValue(line);
83
+ if (!parsedLine) continue;
68
84
 
69
- const key = match[1].trim().replace(/^['"]|['"]$/g, "");
70
- const rawValue = match[2] ?? "";
85
+ const key = parsedLine[0].trim().replace(/^['"]|['"]$/g, "");
86
+ const rawValue = parsedLine[1]?.trimStart() ?? "";
71
87
 
72
88
  while (stack.length > 1 && indent <= stack[stack.length - 1].indent) {
73
89
  stack.pop();