@opencode_weave/weave 0.5.0 → 0.5.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/README.md +12 -25
- package/dist/index.js +31 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,9 +21,8 @@ Weave is a lean OpenCode plugin with multi-agent orchestration. It provides a co
|
|
|
21
21
|
- [Quick Tasks (No Plan Needed)](#quick-tasks-no-plan-needed)
|
|
22
22
|
- [Installation](#installation)
|
|
23
23
|
- [Prerequisites](#prerequisites)
|
|
24
|
-
- [Step 1:
|
|
25
|
-
- [Step 2:
|
|
26
|
-
- [Step 3: Restart OpenCode](#step-3-restart-opencode)
|
|
24
|
+
- [Step 1: Add to opencode.json](#step-1-add-to-opencodejson)
|
|
25
|
+
- [Step 2: Restart OpenCode](#step-2-restart-opencode)
|
|
27
26
|
- [Troubleshooting](#troubleshooting)
|
|
28
27
|
- [Uninstalling](#uninstalling)
|
|
29
28
|
- [Configuration](#configuration)
|
|
@@ -35,6 +34,7 @@ Weave is a lean OpenCode plugin with multi-agent orchestration. It provides a co
|
|
|
35
34
|
- [Background Agents](#background-agents)
|
|
36
35
|
- [Tool Permissions](#tool-permissions)
|
|
37
36
|
- [Development](#development)
|
|
37
|
+
- [Acknowledgments](#acknowledgments)
|
|
38
38
|
- [License](#license)
|
|
39
39
|
|
|
40
40
|
## Overview
|
|
@@ -148,17 +148,8 @@ This package is published on [npm](https://www.npmjs.com/package/@opencode_weave
|
|
|
148
148
|
### Prerequisites
|
|
149
149
|
|
|
150
150
|
- [OpenCode](https://opencode.ai)
|
|
151
|
-
- Bun or Node.js
|
|
152
151
|
|
|
153
|
-
### Step 1:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
bun add @opencode_weave/weave
|
|
157
|
-
# or
|
|
158
|
-
npm install @opencode_weave/weave
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Step 2: Register in opencode.json
|
|
152
|
+
### Step 1: Add to opencode.json
|
|
162
153
|
|
|
163
154
|
Add the plugin to your `opencode.json` file:
|
|
164
155
|
|
|
@@ -168,9 +159,9 @@ Add the plugin to your `opencode.json` file:
|
|
|
168
159
|
}
|
|
169
160
|
```
|
|
170
161
|
|
|
171
|
-
### Step
|
|
162
|
+
### Step 2: Restart OpenCode
|
|
172
163
|
|
|
173
|
-
The plugin loads automatically upon restart and works with zero configuration out of the box.
|
|
164
|
+
OpenCode automatically installs npm plugins at startup — no manual `bun add` or `npm install` required. The plugin loads automatically upon restart and works with zero configuration out of the box.
|
|
174
165
|
|
|
175
166
|
### Troubleshooting
|
|
176
167
|
|
|
@@ -193,15 +184,7 @@ Delete the `@opencode_weave/weave` entry from the `plugin` array in your `openco
|
|
|
193
184
|
}
|
|
194
185
|
```
|
|
195
186
|
|
|
196
|
-
### Step 2:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
bun remove @opencode_weave/weave
|
|
200
|
-
# or
|
|
201
|
-
npm uninstall @opencode_weave/weave
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Step 3: Clean up project artifacts (optional)
|
|
187
|
+
### Step 2: Clean up project artifacts (optional)
|
|
205
188
|
|
|
206
189
|
Weave may have created plan and state files during usage. Remove them if no longer needed:
|
|
207
190
|
|
|
@@ -215,7 +198,7 @@ You can also remove any project-level configuration if present:
|
|
|
215
198
|
rm -f .opencode/weave-opencode.jsonc .opencode/weave-opencode.json
|
|
216
199
|
```
|
|
217
200
|
|
|
218
|
-
### Step
|
|
201
|
+
### Step 3: Clean up user-level configuration (optional)
|
|
219
202
|
|
|
220
203
|
If you no longer use Weave in any project, remove the global configuration:
|
|
221
204
|
|
|
@@ -312,6 +295,10 @@ Tool access is controlled per-agent to ensure safety and specialized focus. For
|
|
|
312
295
|
- **Typecheck**: `bun run typecheck`
|
|
313
296
|
- **Clean**: `bun run clean`
|
|
314
297
|
|
|
298
|
+
## Acknowledgments
|
|
299
|
+
|
|
300
|
+
Weave was inspired by [Oh My OpenCode](https://github.com/code-yeongyu/oh-my-opencode) by [@code-yeongyu](https://github.com/code-yeongyu) — a pioneering OpenCode plugin that proved multi-agent orchestration, discipline agents, and structured plan-execute workflows could radically improve the developer experience. Many of Weave's core ideas — from category-based task dispatch to background agent parallelism — trace their roots to patterns Oh My OpenCode established. We're grateful for the trailblazing work and the vibrant community around it.
|
|
301
|
+
|
|
315
302
|
## License
|
|
316
303
|
|
|
317
304
|
MIT
|
package/dist/index.js
CHANGED
|
@@ -525,7 +525,7 @@ FORMAT RULES:
|
|
|
525
525
|
- Use /start-work to hand off to Tapestry for todo-list driven execution of multi-step plans
|
|
526
526
|
- Use shuttle for category-specific specialized work
|
|
527
527
|
- Use Weft for reviewing completed work or validating plans before execution
|
|
528
|
-
-
|
|
528
|
+
- MUST use Warp for security audits when changes touch auth, crypto, certificates, tokens, signatures, input validation, secrets, passwords, sessions, CORS, CSP, .env files, or OAuth/OIDC/SAML flows — not optional. When in doubt, invoke Warp — false positives (fast APPROVE) are cheap.
|
|
529
529
|
- Delegate aggressively to keep your context lean
|
|
530
530
|
</Delegation>
|
|
531
531
|
|
|
@@ -568,10 +568,20 @@ For complex tasks that benefit from structured planning before execution:
|
|
|
568
568
|
- SKIP ONLY IF: User explicitly says "skip review"
|
|
569
569
|
- Weft reads the plan, verifies file references, checks executability
|
|
570
570
|
- If Weft rejects, send issues back to Pattern for revision
|
|
571
|
+
- MANDATORY: If the plan touches security-relevant areas (crypto, auth, certificates, tokens, signatures, or input validation) → also run Warp on the plan
|
|
571
572
|
3. EXECUTE: Tell the user to run \`/start-work\` to begin execution
|
|
572
573
|
- /start-work loads the plan, creates work state at \`.weave/state.json\`, and switches to Tapestry
|
|
573
574
|
- Tapestry reads the plan and works through tasks, marking checkboxes as it goes
|
|
574
575
|
4. RESUME: If work was interrupted, \`/start-work\` resumes from the last unchecked task
|
|
576
|
+
5. POST-EXECUTION REVIEW (MANDATORY — NO SKIP CONDITIONS):
|
|
577
|
+
After Tapestry reports all tasks complete, you MUST run this gate before reporting success to the user:
|
|
578
|
+
a. Run \`git diff --stat\` to identify all changed files
|
|
579
|
+
b. Delegate to Weft (quality review) AND Warp (security audit) in parallel
|
|
580
|
+
c. Warp self-triages: if no security-relevant changes, it fast-exits with APPROVE — so always invoke it
|
|
581
|
+
d. If Weft or Warp REJECT → address blocking issues, then re-run the rejecting reviewer
|
|
582
|
+
e. Only report success to the user after BOTH Weft and Warp APPROVE
|
|
583
|
+
- This step has NO skip conditions. Not for small changes, not for user request, not for time pressure.
|
|
584
|
+
- Skipping this step is a workflow violation.
|
|
575
585
|
|
|
576
586
|
When to use this workflow vs. direct execution:
|
|
577
587
|
- USE plan workflow: Large features, multi-file refactors, anything with 5+ steps or architectural decisions
|
|
@@ -579,28 +589,36 @@ When to use this workflow vs. direct execution:
|
|
|
579
589
|
</PlanWorkflow>
|
|
580
590
|
|
|
581
591
|
<ReviewWorkflow>
|
|
582
|
-
|
|
592
|
+
Two review modes — different rules for each:
|
|
593
|
+
|
|
594
|
+
**Post-Plan-Execution Review (after PlanWorkflow Step 5):**
|
|
595
|
+
- ALWAYS mandatory. No skip conditions. See PlanWorkflow Step 5 for the full protocol.
|
|
596
|
+
- ALWAYS delegate to BOTH Weft (quality) AND Warp (security) in parallel
|
|
597
|
+
- Warp self-triages: fast-exits with APPROVE if no security-relevant changes detected
|
|
598
|
+
- Both must APPROVE before reporting success to the user
|
|
599
|
+
|
|
600
|
+
**Ad-Hoc Review (non-plan work):**
|
|
583
601
|
- Delegate to Weft to review the changes
|
|
584
602
|
- Weft is read-only and approval-biased — it rejects only for real problems
|
|
585
603
|
- If Weft approves: proceed confidently
|
|
586
604
|
- If Weft rejects: address the specific blocking issues, then re-review
|
|
587
605
|
|
|
588
|
-
When to invoke Weft:
|
|
589
|
-
- After completing a multi-step plan
|
|
606
|
+
When to invoke ad-hoc Weft:
|
|
590
607
|
- After any task that touches 3+ files
|
|
591
608
|
- Before shipping to the user when quality matters
|
|
592
609
|
- When you're unsure if work meets acceptance criteria
|
|
593
610
|
|
|
594
|
-
When to skip Weft:
|
|
611
|
+
When to skip ad-hoc Weft:
|
|
595
612
|
- Single-file trivial changes
|
|
596
613
|
- User explicitly says "skip review"
|
|
597
614
|
- Simple question-answering (no code changes)
|
|
598
615
|
|
|
599
|
-
|
|
616
|
+
MANDATORY — If ANY changed file touches crypto, auth, certificates, tokens, signatures, or input validation:
|
|
617
|
+
→ MUST run Warp in parallel with Weft. This is NOT optional.
|
|
618
|
+
→ Failure to invoke Warp for security-relevant changes is a workflow violation.
|
|
600
619
|
- Warp is read-only and skeptical-biased — it rejects when security is at risk
|
|
601
620
|
- Warp self-triages: if no security-relevant changes, it fast-exits with APPROVE
|
|
602
621
|
- If Warp rejects: address the specific security issues before shipping
|
|
603
|
-
- Run Warp in parallel with Weft for comprehensive coverage
|
|
604
622
|
</ReviewWorkflow>
|
|
605
623
|
|
|
606
624
|
<Style>
|
|
@@ -686,7 +704,8 @@ When activated by /start-work with a plan file:
|
|
|
686
704
|
d. Mark complete: use Edit tool to change \`- [ ]\` to \`- [x]\` in the plan file
|
|
687
705
|
e. Report: "Completed task N/M: [title]"
|
|
688
706
|
4. CONTINUE to the next unchecked task
|
|
689
|
-
5. When ALL checkboxes are checked, report final summary
|
|
707
|
+
5. When ALL checkboxes are checked, report final summary and include:
|
|
708
|
+
"All tasks complete. **Post-execution review required** — Loom must run Weft and Warp before reporting success."
|
|
690
709
|
|
|
691
710
|
NEVER stop mid-plan unless explicitly told to or completely blocked.
|
|
692
711
|
</PlanExecution>
|
|
@@ -1879,13 +1898,13 @@ function getPlanName(planPath) {
|
|
|
1879
1898
|
}
|
|
1880
1899
|
// src/features/work-state/validation.ts
|
|
1881
1900
|
import { readFileSync as readFileSync5, existsSync as existsSync6 } from "fs";
|
|
1882
|
-
import { resolve as resolve2 } from "path";
|
|
1901
|
+
import { resolve as resolve2, sep } from "path";
|
|
1883
1902
|
function validatePlan(planPath, projectDir) {
|
|
1884
1903
|
const errors = [];
|
|
1885
1904
|
const warnings = [];
|
|
1886
1905
|
const resolvedPlanPath = resolve2(planPath);
|
|
1887
1906
|
const allowedDir = resolve2(projectDir, PLANS_DIR);
|
|
1888
|
-
if (!resolvedPlanPath.startsWith(allowedDir +
|
|
1907
|
+
if (!resolvedPlanPath.startsWith(allowedDir + sep) && resolvedPlanPath !== allowedDir) {
|
|
1889
1908
|
errors.push({
|
|
1890
1909
|
severity: "error",
|
|
1891
1910
|
category: "structure",
|
|
@@ -2065,7 +2084,7 @@ function validateFileReferences(content, projectDir, warnings) {
|
|
|
2065
2084
|
}
|
|
2066
2085
|
const resolvedProject = resolve2(projectDir);
|
|
2067
2086
|
const absolutePath = resolve2(projectDir, filePath);
|
|
2068
|
-
if (!absolutePath.startsWith(resolvedProject +
|
|
2087
|
+
if (!absolutePath.startsWith(resolvedProject + sep) && absolutePath !== resolvedProject) {
|
|
2069
2088
|
warnings.push({
|
|
2070
2089
|
severity: "warning",
|
|
2071
2090
|
category: "file-references",
|
|
@@ -2433,7 +2452,7 @@ Before marking this task complete, verify the work:
|
|
|
2433
2452
|
If uncertain about quality, delegate to \`weft\` agent for a formal review:
|
|
2434
2453
|
\`call_weave_agent(agent="weft", prompt="Review the changes for [task description]")\`
|
|
2435
2454
|
|
|
2436
|
-
If changes touch auth, crypto, tokens, or input validation, delegate to \`warp\` agent for a security audit:
|
|
2455
|
+
MANDATORY: If changes touch auth, crypto, certificates, tokens, signatures, or input validation, you MUST delegate to \`warp\` agent for a security audit — this is NOT optional:
|
|
2437
2456
|
\`call_weave_agent(agent="warp", prompt="Security audit the changes for [task description]")\`
|
|
2438
2457
|
|
|
2439
2458
|
Only mark complete when ALL checks pass.`
|