@weaveio/weave-adapter-opencode 0.0.0-preview-20260708131242 → 0.0.0-preview-20260710143728
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 +18 -6
- package/dist/index.js +33 -25
- package/dist/plugin.js +33 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,19 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
OpenCode adapter for Weave.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Add the adapter as a plugin in your `opencode.json` (or `opencode.jsonc`). Use the **full versioned package specifier**:
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
11
|
"plugin": [
|
|
12
|
-
"@weaveio/weave-adapter-opencode
|
|
12
|
+
"@weaveio/weave-adapter-opencode@0.0.1"
|
|
13
13
|
]
|
|
14
14
|
}
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
For
|
|
17
|
+
For preview/snapshot versions:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"plugin": [
|
|
22
|
+
"@weaveio/weave-adapter-opencode@0.0.0-preview-20260708134505"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
OpenCode resolves the plugin from npm at startup, so the version must be pinned explicitly in the `plugin` array. There is no separate `npm install` step — OpenCode handles package fetching.
|
|
28
|
+
|
|
29
|
+
## Local development
|
|
30
|
+
|
|
31
|
+
For local development, point OpenCode at the built `dist/plugin.js` via a file URL:
|
|
18
32
|
|
|
19
33
|
```json
|
|
20
34
|
{
|
|
@@ -30,8 +44,6 @@ Rebuild the package before using a `dist/` file path so the plugin bundle matche
|
|
|
30
44
|
bun run --filter @weaveio/weave-adapter-opencode build
|
|
31
45
|
```
|
|
32
46
|
|
|
33
|
-
Do **not** use the bare package entry (`@weaveio/weave-adapter-opencode`) or `dist/index.js` as a plugin target. The bare entry is the programmatic barrel and exports non-plugin values in addition to the plugin function, which is incompatible with OpenCode's legacy plugin loader.
|
|
34
|
-
|
|
35
47
|
## Isolated OpenCode validation
|
|
36
48
|
|
|
37
49
|
OpenCode merges global config, project config, explicit config, and plugin directories. `OPENCODE_CONFIG` and `OPENCODE_CONFIG_CONTENT` add config; they do not replace every other source by themselves.
|
package/dist/index.js
CHANGED
|
@@ -19807,7 +19807,8 @@ function refinePromptFileSafe(field) {
|
|
|
19807
19807
|
var ToolPermissionSchema = exports_external.enum(["allow", "deny", "ask"]);
|
|
19808
19808
|
var DelegationTriggerSchema = exports_external.object({
|
|
19809
19809
|
domain: exports_external.string(),
|
|
19810
|
-
trigger: exports_external.string()
|
|
19810
|
+
trigger: exports_external.string(),
|
|
19811
|
+
routing_hint: exports_external.string().optional()
|
|
19811
19812
|
});
|
|
19812
19813
|
var ToolPolicySchema = exports_external.object({
|
|
19813
19814
|
read: ToolPermissionSchema.optional(),
|
|
@@ -20166,7 +20167,7 @@ When to delegate to each specialist:
|
|
|
20166
20167
|
|
|
20167
20168
|
{{#delegation.targets}}
|
|
20168
20169
|
- **{{name}}** \u2014 {{description}}{{#triggers}}
|
|
20169
|
-
- {{
|
|
20170
|
+
- {{routing_hint}}{{/triggers}}
|
|
20170
20171
|
{{/delegation.targets}}
|
|
20171
20172
|
|
|
20172
20173
|
Delegate aggressively to keep your context lean. Thread and Spindle are cheap (read-only); use them liberally for evidence gathering before routing to implementation agents.
|
|
@@ -20974,10 +20975,10 @@ agent shuttle {
|
|
|
20974
20975
|
}
|
|
20975
20976
|
|
|
20976
20977
|
triggers [
|
|
20977
|
-
{ domain "Implementation" trigger "Bounded coding tasks, file edits, feature work" }
|
|
20978
|
-
{ domain "Testing" trigger "Writing and running tests" }
|
|
20979
|
-
{ domain "Debugging" trigger "Diagnosing and fixing bugs in a specific area" }
|
|
20980
|
-
{ domain "Refactoring" trigger "Improving code structure without changing behavior" }
|
|
20978
|
+
{ domain "Implementation" trigger "Bounded coding tasks, file edits, feature work" routing_hint "Use for single-file changes, bug fixes, or clearly scoped implementation tasks" }
|
|
20979
|
+
{ domain "Testing" trigger "Writing and running tests" routing_hint "Use when tests need to be written, updated, or debugged" }
|
|
20980
|
+
{ domain "Debugging" trigger "Diagnosing and fixing bugs in a specific area" routing_hint "Use when a bug needs investigation and fixing in a known area" }
|
|
20981
|
+
{ domain "Refactoring" trigger "Improving code structure without changing behavior" routing_hint "Use for code cleanup, renaming, or restructuring without functional changes" }
|
|
20981
20982
|
]
|
|
20982
20983
|
}
|
|
20983
20984
|
|
|
@@ -20997,9 +20998,9 @@ agent pattern {
|
|
|
20997
20998
|
}
|
|
20998
20999
|
|
|
20999
21000
|
triggers [
|
|
21000
|
-
{ domain "Planning" trigger "Creating structured implementation plans before execution" }
|
|
21001
|
-
{ domain "Architecture" trigger "Designing system structure, component boundaries, and data flow" }
|
|
21002
|
-
{ domain "Decomposition" trigger "Breaking complex goals into discrete, sequenced tasks" }
|
|
21001
|
+
{ domain "Planning" trigger "Creating structured implementation plans before execution" routing_hint "Use for multi-file features, complex refactors, or work spanning 5+ steps" }
|
|
21002
|
+
{ domain "Architecture" trigger "Designing system structure, component boundaries, and data flow" routing_hint "Use when system design decisions need to be made before implementation" }
|
|
21003
|
+
{ domain "Decomposition" trigger "Breaking complex goals into discrete, sequenced tasks" routing_hint "Use when a large goal needs to be broken into an actionable plan" }
|
|
21003
21004
|
]
|
|
21004
21005
|
}
|
|
21005
21006
|
|
|
@@ -21019,9 +21020,9 @@ agent thread {
|
|
|
21019
21020
|
}
|
|
21020
21021
|
|
|
21021
21022
|
triggers [
|
|
21022
|
-
{ domain "Exploration" trigger "Tracing symbols, call graphs, and data flow across the codebase" }
|
|
21023
|
-
{ domain "Discovery" trigger "Locating where a concept, pattern, or behavior is implemented" }
|
|
21024
|
-
{ domain "Audit" trigger "Surveying existing code before planning a change" }
|
|
21023
|
+
{ domain "Exploration" trigger "Tracing symbols, call graphs, and data flow across the codebase" routing_hint "Use for fast codebase exploration \u2014 read-only and cheap" }
|
|
21024
|
+
{ domain "Discovery" trigger "Locating where a concept, pattern, or behavior is implemented" routing_hint "Use when answering 'where is X' or 'how does Y work' questions" }
|
|
21025
|
+
{ domain "Audit" trigger "Surveying existing code before planning a change" routing_hint "Use to gather evidence before routing to implementation agents" }
|
|
21025
21026
|
]
|
|
21026
21027
|
}
|
|
21027
21028
|
|
|
@@ -21041,9 +21042,9 @@ agent spindle {
|
|
|
21041
21042
|
}
|
|
21042
21043
|
|
|
21043
21044
|
triggers [
|
|
21044
|
-
{ domain "Research" trigger "Fetching external documentation, API references, or library guides" }
|
|
21045
|
-
{ domain "Verification" trigger "Confirming facts, versions, or behaviors against authoritative sources" }
|
|
21046
|
-
{ domain "Discovery" trigger "Finding relevant third-party tools, packages, or standards" }
|
|
21045
|
+
{ domain "Research" trigger "Fetching external documentation, API references, or library guides" routing_hint "Use for external docs and research \u2014 read-only" }
|
|
21046
|
+
{ domain "Verification" trigger "Confirming facts, versions, or behaviors against authoritative sources" routing_hint "Use when facts need verification against official sources" }
|
|
21047
|
+
{ domain "Discovery" trigger "Finding relevant third-party tools, packages, or standards" routing_hint "Use when exploring external options, libraries, or standards" }
|
|
21047
21048
|
]
|
|
21048
21049
|
}
|
|
21049
21050
|
|
|
@@ -21063,9 +21064,9 @@ agent weft {
|
|
|
21063
21064
|
}
|
|
21064
21065
|
|
|
21065
21066
|
triggers [
|
|
21066
|
-
{ domain "Code Review" trigger "Reviewing code quality, correctness, and maintainability" }
|
|
21067
|
-
{ domain "Gate" trigger "Approving or requesting changes before a task is considered complete" }
|
|
21068
|
-
{ domain "Feedback" trigger "Providing structured critique on a plan, design, or implementation" }
|
|
21067
|
+
{ domain "Code Review" trigger "Reviewing code quality, correctness, and maintainability" routing_hint "Use after non-trivial changes (3+ files, or when quality matters)" }
|
|
21068
|
+
{ domain "Gate" trigger "Approving or requesting changes before a task is considered complete" routing_hint "Use as a quality gate before considering work complete" }
|
|
21069
|
+
{ domain "Feedback" trigger "Providing structured critique on a plan, design, or implementation" routing_hint "Use when structured feedback is needed on plans or designs" }
|
|
21069
21070
|
]
|
|
21070
21071
|
}
|
|
21071
21072
|
|
|
@@ -21085,9 +21086,9 @@ agent warp {
|
|
|
21085
21086
|
}
|
|
21086
21087
|
|
|
21087
21088
|
triggers [
|
|
21088
|
-
{ domain "Security" trigger "Auditing code for vulnerabilities, misconfigurations, or unsafe patterns" }
|
|
21089
|
-
{ domain "Gate" trigger "Security approval checkpoint before shipping or merging" }
|
|
21090
|
-
{ domain "Threat Modeling" trigger "Identifying attack surfaces and risk areas in a design or implementation" }
|
|
21089
|
+
{ domain "Security" trigger "Auditing code for vulnerabilities, misconfigurations, or unsafe patterns" routing_hint "MANDATORY when changes touch auth, crypto, tokens, secrets, sessions, CORS, CSP, or input validation" }
|
|
21090
|
+
{ domain "Gate" trigger "Security approval checkpoint before shipping or merging" routing_hint "Use as security gate before shipping security-sensitive changes" }
|
|
21091
|
+
{ domain "Threat Modeling" trigger "Identifying attack surfaces and risk areas in a design or implementation" routing_hint "Use when security implications of a design need analysis" }
|
|
21091
21092
|
]
|
|
21092
21093
|
}
|
|
21093
21094
|
|
|
@@ -21505,6 +21506,7 @@ var ALLOWED_TEMPLATE_PATHS = new Set([
|
|
|
21505
21506
|
"delegation.targets.triggers",
|
|
21506
21507
|
"delegation.targets.triggers.domain",
|
|
21507
21508
|
"delegation.targets.triggers.trigger",
|
|
21509
|
+
"delegation.targets.triggers.routing_hint",
|
|
21508
21510
|
"delegation.targets.isCategory",
|
|
21509
21511
|
"delegation.targets.isCategory.name",
|
|
21510
21512
|
"delegation.targets.isCategory.description",
|
|
@@ -21519,10 +21521,16 @@ function projectDelegationTarget(target) {
|
|
|
21519
21521
|
domains.push(trigger.domain);
|
|
21520
21522
|
}
|
|
21521
21523
|
}
|
|
21522
|
-
const triggers = target.triggers.map((t) =>
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
|
|
21524
|
+
const triggers = target.triggers.map((t) => {
|
|
21525
|
+
const entry2 = {
|
|
21526
|
+
domain: t.domain,
|
|
21527
|
+
trigger: t.trigger
|
|
21528
|
+
};
|
|
21529
|
+
if (t.routing_hint !== undefined) {
|
|
21530
|
+
entry2.routing_hint = t.routing_hint;
|
|
21531
|
+
}
|
|
21532
|
+
return entry2;
|
|
21533
|
+
});
|
|
21526
21534
|
const entry = {
|
|
21527
21535
|
name: target.name,
|
|
21528
21536
|
domains,
|
package/dist/plugin.js
CHANGED
|
@@ -19810,7 +19810,8 @@ function refinePromptFileSafe(field) {
|
|
|
19810
19810
|
var ToolPermissionSchema = exports_external.enum(["allow", "deny", "ask"]);
|
|
19811
19811
|
var DelegationTriggerSchema = exports_external.object({
|
|
19812
19812
|
domain: exports_external.string(),
|
|
19813
|
-
trigger: exports_external.string()
|
|
19813
|
+
trigger: exports_external.string(),
|
|
19814
|
+
routing_hint: exports_external.string().optional()
|
|
19814
19815
|
});
|
|
19815
19816
|
var ToolPolicySchema = exports_external.object({
|
|
19816
19817
|
read: ToolPermissionSchema.optional(),
|
|
@@ -20169,7 +20170,7 @@ When to delegate to each specialist:
|
|
|
20169
20170
|
|
|
20170
20171
|
{{#delegation.targets}}
|
|
20171
20172
|
- **{{name}}** \u2014 {{description}}{{#triggers}}
|
|
20172
|
-
- {{
|
|
20173
|
+
- {{routing_hint}}{{/triggers}}
|
|
20173
20174
|
{{/delegation.targets}}
|
|
20174
20175
|
|
|
20175
20176
|
Delegate aggressively to keep your context lean. Thread and Spindle are cheap (read-only); use them liberally for evidence gathering before routing to implementation agents.
|
|
@@ -20977,10 +20978,10 @@ agent shuttle {
|
|
|
20977
20978
|
}
|
|
20978
20979
|
|
|
20979
20980
|
triggers [
|
|
20980
|
-
{ domain "Implementation" trigger "Bounded coding tasks, file edits, feature work" }
|
|
20981
|
-
{ domain "Testing" trigger "Writing and running tests" }
|
|
20982
|
-
{ domain "Debugging" trigger "Diagnosing and fixing bugs in a specific area" }
|
|
20983
|
-
{ domain "Refactoring" trigger "Improving code structure without changing behavior" }
|
|
20981
|
+
{ domain "Implementation" trigger "Bounded coding tasks, file edits, feature work" routing_hint "Use for single-file changes, bug fixes, or clearly scoped implementation tasks" }
|
|
20982
|
+
{ domain "Testing" trigger "Writing and running tests" routing_hint "Use when tests need to be written, updated, or debugged" }
|
|
20983
|
+
{ domain "Debugging" trigger "Diagnosing and fixing bugs in a specific area" routing_hint "Use when a bug needs investigation and fixing in a known area" }
|
|
20984
|
+
{ domain "Refactoring" trigger "Improving code structure without changing behavior" routing_hint "Use for code cleanup, renaming, or restructuring without functional changes" }
|
|
20984
20985
|
]
|
|
20985
20986
|
}
|
|
20986
20987
|
|
|
@@ -21000,9 +21001,9 @@ agent pattern {
|
|
|
21000
21001
|
}
|
|
21001
21002
|
|
|
21002
21003
|
triggers [
|
|
21003
|
-
{ domain "Planning" trigger "Creating structured implementation plans before execution" }
|
|
21004
|
-
{ domain "Architecture" trigger "Designing system structure, component boundaries, and data flow" }
|
|
21005
|
-
{ domain "Decomposition" trigger "Breaking complex goals into discrete, sequenced tasks" }
|
|
21004
|
+
{ domain "Planning" trigger "Creating structured implementation plans before execution" routing_hint "Use for multi-file features, complex refactors, or work spanning 5+ steps" }
|
|
21005
|
+
{ domain "Architecture" trigger "Designing system structure, component boundaries, and data flow" routing_hint "Use when system design decisions need to be made before implementation" }
|
|
21006
|
+
{ domain "Decomposition" trigger "Breaking complex goals into discrete, sequenced tasks" routing_hint "Use when a large goal needs to be broken into an actionable plan" }
|
|
21006
21007
|
]
|
|
21007
21008
|
}
|
|
21008
21009
|
|
|
@@ -21022,9 +21023,9 @@ agent thread {
|
|
|
21022
21023
|
}
|
|
21023
21024
|
|
|
21024
21025
|
triggers [
|
|
21025
|
-
{ domain "Exploration" trigger "Tracing symbols, call graphs, and data flow across the codebase" }
|
|
21026
|
-
{ domain "Discovery" trigger "Locating where a concept, pattern, or behavior is implemented" }
|
|
21027
|
-
{ domain "Audit" trigger "Surveying existing code before planning a change" }
|
|
21026
|
+
{ domain "Exploration" trigger "Tracing symbols, call graphs, and data flow across the codebase" routing_hint "Use for fast codebase exploration \u2014 read-only and cheap" }
|
|
21027
|
+
{ domain "Discovery" trigger "Locating where a concept, pattern, or behavior is implemented" routing_hint "Use when answering 'where is X' or 'how does Y work' questions" }
|
|
21028
|
+
{ domain "Audit" trigger "Surveying existing code before planning a change" routing_hint "Use to gather evidence before routing to implementation agents" }
|
|
21028
21029
|
]
|
|
21029
21030
|
}
|
|
21030
21031
|
|
|
@@ -21044,9 +21045,9 @@ agent spindle {
|
|
|
21044
21045
|
}
|
|
21045
21046
|
|
|
21046
21047
|
triggers [
|
|
21047
|
-
{ domain "Research" trigger "Fetching external documentation, API references, or library guides" }
|
|
21048
|
-
{ domain "Verification" trigger "Confirming facts, versions, or behaviors against authoritative sources" }
|
|
21049
|
-
{ domain "Discovery" trigger "Finding relevant third-party tools, packages, or standards" }
|
|
21048
|
+
{ domain "Research" trigger "Fetching external documentation, API references, or library guides" routing_hint "Use for external docs and research \u2014 read-only" }
|
|
21049
|
+
{ domain "Verification" trigger "Confirming facts, versions, or behaviors against authoritative sources" routing_hint "Use when facts need verification against official sources" }
|
|
21050
|
+
{ domain "Discovery" trigger "Finding relevant third-party tools, packages, or standards" routing_hint "Use when exploring external options, libraries, or standards" }
|
|
21050
21051
|
]
|
|
21051
21052
|
}
|
|
21052
21053
|
|
|
@@ -21066,9 +21067,9 @@ agent weft {
|
|
|
21066
21067
|
}
|
|
21067
21068
|
|
|
21068
21069
|
triggers [
|
|
21069
|
-
{ domain "Code Review" trigger "Reviewing code quality, correctness, and maintainability" }
|
|
21070
|
-
{ domain "Gate" trigger "Approving or requesting changes before a task is considered complete" }
|
|
21071
|
-
{ domain "Feedback" trigger "Providing structured critique on a plan, design, or implementation" }
|
|
21070
|
+
{ domain "Code Review" trigger "Reviewing code quality, correctness, and maintainability" routing_hint "Use after non-trivial changes (3+ files, or when quality matters)" }
|
|
21071
|
+
{ domain "Gate" trigger "Approving or requesting changes before a task is considered complete" routing_hint "Use as a quality gate before considering work complete" }
|
|
21072
|
+
{ domain "Feedback" trigger "Providing structured critique on a plan, design, or implementation" routing_hint "Use when structured feedback is needed on plans or designs" }
|
|
21072
21073
|
]
|
|
21073
21074
|
}
|
|
21074
21075
|
|
|
@@ -21088,9 +21089,9 @@ agent warp {
|
|
|
21088
21089
|
}
|
|
21089
21090
|
|
|
21090
21091
|
triggers [
|
|
21091
|
-
{ domain "Security" trigger "Auditing code for vulnerabilities, misconfigurations, or unsafe patterns" }
|
|
21092
|
-
{ domain "Gate" trigger "Security approval checkpoint before shipping or merging" }
|
|
21093
|
-
{ domain "Threat Modeling" trigger "Identifying attack surfaces and risk areas in a design or implementation" }
|
|
21092
|
+
{ domain "Security" trigger "Auditing code for vulnerabilities, misconfigurations, or unsafe patterns" routing_hint "MANDATORY when changes touch auth, crypto, tokens, secrets, sessions, CORS, CSP, or input validation" }
|
|
21093
|
+
{ domain "Gate" trigger "Security approval checkpoint before shipping or merging" routing_hint "Use as security gate before shipping security-sensitive changes" }
|
|
21094
|
+
{ domain "Threat Modeling" trigger "Identifying attack surfaces and risk areas in a design or implementation" routing_hint "Use when security implications of a design need analysis" }
|
|
21094
21095
|
]
|
|
21095
21096
|
}
|
|
21096
21097
|
|
|
@@ -21412,6 +21413,7 @@ var ALLOWED_TEMPLATE_PATHS = new Set([
|
|
|
21412
21413
|
"delegation.targets.triggers",
|
|
21413
21414
|
"delegation.targets.triggers.domain",
|
|
21414
21415
|
"delegation.targets.triggers.trigger",
|
|
21416
|
+
"delegation.targets.triggers.routing_hint",
|
|
21415
21417
|
"delegation.targets.isCategory",
|
|
21416
21418
|
"delegation.targets.isCategory.name",
|
|
21417
21419
|
"delegation.targets.isCategory.description",
|
|
@@ -21426,10 +21428,16 @@ function projectDelegationTarget(target) {
|
|
|
21426
21428
|
domains.push(trigger.domain);
|
|
21427
21429
|
}
|
|
21428
21430
|
}
|
|
21429
|
-
const triggers = target.triggers.map((t) =>
|
|
21430
|
-
|
|
21431
|
-
|
|
21432
|
-
|
|
21431
|
+
const triggers = target.triggers.map((t) => {
|
|
21432
|
+
const entry2 = {
|
|
21433
|
+
domain: t.domain,
|
|
21434
|
+
trigger: t.trigger
|
|
21435
|
+
};
|
|
21436
|
+
if (t.routing_hint !== undefined) {
|
|
21437
|
+
entry2.routing_hint = t.routing_hint;
|
|
21438
|
+
}
|
|
21439
|
+
return entry2;
|
|
21440
|
+
});
|
|
21433
21441
|
const entry = {
|
|
21434
21442
|
name: target.name,
|
|
21435
21443
|
domains,
|