opencode-autoresearch 3.1.0-beta.2 → 3.3.0
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/.opencode-plugin/plugin.json +1 -1
- package/AGENTS.md +42 -0
- package/README.md +246 -30
- package/VERSION +1 -0
- package/dist/cli.js +508 -15
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -5
- package/dist/constants.js.map +1 -1
- package/dist/helpers.d.ts +1 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +19 -10
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/run-manager.d.ts +2 -2
- package/dist/run-manager.d.ts.map +1 -1
- package/dist/run-manager.js +18 -16
- package/dist/run-manager.js.map +1 -1
- package/dist/subagent-pool.d.ts +6 -0
- package/dist/subagent-pool.d.ts.map +1 -1
- package/dist/subagent-pool.js +12 -2
- package/dist/subagent-pool.js.map +1 -1
- package/dist/types.d.ts +15 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +2 -1
- package/dist/wizard.js.map +1 -1
- package/docs/ARCHITECTURE.md +134 -28
- package/docs/RELEASE.md +54 -25
- package/hooks/init.sh +6 -2
- package/hooks/status.sh +4 -3
- package/hooks/stop.sh +10 -6
- package/hooks/verify-package.sh +78 -0
- package/package.json +34 -14
- package/skills/autoresearch/SKILL.md +29 -4
- package/skills/autoresearch/references/core-principles.md +3 -3
- package/skills/autoresearch/references/interaction-wizard.md +1 -1
- package/skills/autoresearch/references/loop-workflow.md +4 -4
- package/skills/autoresearch/references/plan-workflow.md +2 -2
- package/skills/autoresearch/references/results-logging.md +1 -1
- package/skills/autoresearch/references/self-improve-loop.md +255 -0
- package/skills/autoresearch/references/state-management.md +3 -3
- package/skills/autoresearch/references/subagent-orchestration.md +1 -1
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,GAAG;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ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,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY/C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiDzB"}
|
package/dist/wizard.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { basename } from "path";
|
|
1
2
|
import { resolveRepo, normalizeDirection, normalizeMode, parseDurationSeconds, normalizeLabels, inferVerifyCommand, } from "./helpers.js";
|
|
2
3
|
import { buildSubagentPoolPlan, buildContinuationPolicy } from "./subagent-pool.js";
|
|
3
4
|
export function buildSetupSummary(repo, config) {
|
|
@@ -5,7 +6,7 @@ export function buildSetupSummary(repo, config) {
|
|
|
5
6
|
const direction = normalizeDirection(config.direction);
|
|
6
7
|
const mode = normalizeMode(config.mode);
|
|
7
8
|
const durationSeconds = parseDurationSeconds(config.duration);
|
|
8
|
-
const scope = config.scope ?? resolveRepo(repo)
|
|
9
|
+
const scope = config.scope ?? (basename(resolveRepo(repo)) || "current repository");
|
|
9
10
|
const subagentPool = buildSubagentPoolPlan({
|
|
10
11
|
goal: config.goal ?? "pending",
|
|
11
12
|
scope,
|
package/dist/wizard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,uBAAuB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8DAA8D,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAC,CAAC;IAEpL,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,uBAAuB;QAChD,SAAS;QACT,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI;QACJ,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,gBAAgB,EAAE,eAAe;QACjC,aAAa,EAAE,YAAY;QAC3B,mBAAmB,EAAE,kBAAkB;QACvC,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;QACxE,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;QACxE,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,aAAa,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAChF,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,yDAAyD;QACxG,gBAAgB,EAAE,eAAe;QACjC,SAAS;KACV,CAAC;AACJ,CAAC"}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1,48 +1,103 @@
|
|
|
1
1
|
# Auto Research Architecture
|
|
2
2
|
|
|
3
|
-
> Current reference for v3.
|
|
3
|
+
> Current reference for v3.2.0.
|
|
4
4
|
|
|
5
|
-
Auto Research is
|
|
5
|
+
Auto Research is an OpenCode-only npm package with recursive self-improvement capabilities. The runtime is Node.js ESM. All workflow semantics are preserved from earlier releases.
|
|
6
6
|
|
|
7
|
-
## Package
|
|
7
|
+
## Package Layout
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
src/index.ts # Main plugin entry
|
|
11
|
-
src/cli.ts
|
|
12
|
-
src/constants.ts
|
|
13
|
-
src/types.ts
|
|
14
|
-
src/helpers.ts
|
|
15
|
-
src/wizard.ts
|
|
11
|
+
src/cli.ts # CLI entry point
|
|
12
|
+
src/constants.ts # Package constants (version, names, paths)
|
|
13
|
+
src/types.ts # TypeScript type definitions
|
|
14
|
+
src/helpers.ts # Runtime helpers (state, results, paths)
|
|
15
|
+
src/wizard.ts # Setup wizard
|
|
16
16
|
src/subagent-pool.ts # Subagent pool builder
|
|
17
17
|
src/run-manager.ts # Run lifecycle (init, record, status, stop, resume, complete)
|
|
18
18
|
commands/autoresearch.md # Main command
|
|
19
19
|
commands/autoresearch/*.md # Mode commands (plan, debug, fix, learn, etc.)
|
|
20
|
-
skills/autoresearch/
|
|
21
|
-
skills/autoresearch/references
|
|
22
|
-
hooks/init.sh
|
|
23
|
-
hooks/status.sh
|
|
24
|
-
hooks/stop.sh
|
|
25
|
-
|
|
26
|
-
docs/
|
|
27
|
-
|
|
28
|
-
.
|
|
20
|
+
skills/autoresearch/ # OpenCode skill bundle
|
|
21
|
+
skills/autoresearch/references/# Workflow and runtime references
|
|
22
|
+
hooks/init.sh # SessionStart hook
|
|
23
|
+
hooks/status.sh # Status hook
|
|
24
|
+
hooks/stop.sh # Stop hook
|
|
25
|
+
hooks/verify-package.sh # Package verification
|
|
26
|
+
docs/OPENCODE_INSTALL.md # OpenCode install guide
|
|
27
|
+
docs/ARCHITECTURE.md # This document
|
|
28
|
+
docs/RELEASE.md # Release process
|
|
29
|
+
.opencode-plugin/plugin.json # OpenCode plugin manifest
|
|
30
|
+
.autoresearch/ # Runtime state directory (created at runtime)
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
##
|
|
33
|
+
## High-Level Architecture
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart LR
|
|
37
|
+
A[OpenCode /autoresearch] --> B[CLI]
|
|
38
|
+
B --> C[Run Manager]
|
|
39
|
+
C --> D[State JSON]
|
|
40
|
+
C --> E[Results TSV]
|
|
41
|
+
C --> F[Subagent Pool]
|
|
42
|
+
F --> G[Orchestrator]
|
|
43
|
+
F --> H[Scout]
|
|
44
|
+
F --> I[Analyst]
|
|
45
|
+
F --> J[Verifier]
|
|
46
|
+
F --> K[Synthesizer]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Core Loop
|
|
50
|
+
|
|
51
|
+
```mermaid
|
|
52
|
+
flowchart TD
|
|
53
|
+
A[Goal + Metric + Verify] --> B[Baseline]
|
|
54
|
+
B --> C[Standing Pool Init]
|
|
55
|
+
C --> D[Iteration N]
|
|
56
|
+
D --> E[Subagent Context]
|
|
57
|
+
E --> F[Focused Change]
|
|
58
|
+
F --> G[Mechanical Verify]
|
|
59
|
+
G --> H{Strict Improvement?}
|
|
60
|
+
H -->|yes| I[Keep + Record]
|
|
61
|
+
H -->|no| J[Discard + Reset]
|
|
62
|
+
I --> K{Stop Condition?}
|
|
63
|
+
J --> K
|
|
64
|
+
K -->|no| D
|
|
65
|
+
K -->|yes| L[Report + Memory]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Self-Improvement Loop
|
|
69
|
+
|
|
70
|
+
```mermaid
|
|
71
|
+
flowchart TD
|
|
72
|
+
A[Meta-Goal] --> B[Run Child Loop]
|
|
73
|
+
B --> C[Measure: Tests pass? Docs improved?]
|
|
74
|
+
C --> D{Child Success?}
|
|
75
|
+
D -->|yes| E[Update Memory + Strategy]
|
|
76
|
+
D -->|no| F[Adapt Approach]
|
|
77
|
+
E --> G[Persist Learnings]
|
|
78
|
+
F --> B
|
|
79
|
+
G --> H[Meta-Report]
|
|
80
|
+
H --> I{Meta-Stop?}
|
|
81
|
+
I -->|no| B
|
|
82
|
+
I -->|yes| J[Archive Run]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Source of Truth
|
|
32
86
|
|
|
33
87
|
`src/` is authoritative for runtime behavior. `commands/` and `skills/` define the OpenCode surfaces.
|
|
34
88
|
|
|
35
|
-
## Runtime
|
|
89
|
+
## Runtime Artifacts
|
|
36
90
|
|
|
37
91
|
| Artifact | Purpose |
|
|
38
92
|
| --- | --- |
|
|
39
93
|
| `.autoresearch/state.json` | Current run checkpoint |
|
|
40
94
|
| `autoresearch-results.tsv` | Iteration log |
|
|
41
|
-
|
|
|
95
|
+
| `.autoresearch/launch.json` | Background launch request |
|
|
42
96
|
| `autoresearch-report.md` | End-of-run report |
|
|
43
97
|
| `autoresearch-memory.md` | Reusable run memory |
|
|
98
|
+
| `.autoresearch/self-improvement.md` | Self-improvement run state |
|
|
44
99
|
|
|
45
|
-
## Command
|
|
100
|
+
## Command Surface
|
|
46
101
|
|
|
47
102
|
| Command | Workflow |
|
|
48
103
|
| --- | --- |
|
|
@@ -56,7 +111,7 @@ docs/RELEASE.md # Release process
|
|
|
56
111
|
| `/autoresearch:security` | Security review |
|
|
57
112
|
| `/autoresearch:ship` | Ship-readiness workflow |
|
|
58
113
|
|
|
59
|
-
## CLI
|
|
114
|
+
## CLI Commands
|
|
60
115
|
|
|
61
116
|
| Command | Purpose |
|
|
62
117
|
| --- | --- |
|
|
@@ -68,21 +123,72 @@ docs/RELEASE.md # Release process
|
|
|
68
123
|
| `autoresearch resume` | Resume background run |
|
|
69
124
|
| `autoresearch complete` | Mark run complete |
|
|
70
125
|
| `autoresearch record` | Record iteration result |
|
|
126
|
+
| `autoresearch doctor` | Verify installation |
|
|
127
|
+
|
|
128
|
+
## Subagent Pool
|
|
129
|
+
|
|
130
|
+
```mermaid
|
|
131
|
+
flowchart LR
|
|
132
|
+
A[Subagent Pool] --> B[Orchestrator]
|
|
133
|
+
A --> C[Scout]
|
|
134
|
+
A --> D[Analyst]
|
|
135
|
+
A --> E[Verifier]
|
|
136
|
+
A --> F[Synthesizer]
|
|
137
|
+
A --> G[Specialists]
|
|
138
|
+
G --> H[Security Reviewer]
|
|
139
|
+
G --> I[Debugger]
|
|
140
|
+
G --> J[Release Guard]
|
|
141
|
+
G --> K[Research Tracker]
|
|
142
|
+
G --> L[Meta Orchestrator]
|
|
143
|
+
```
|
|
71
144
|
|
|
72
|
-
|
|
145
|
+
The standing pool provides:
|
|
73
146
|
|
|
74
|
-
|
|
147
|
+
| Role | Purpose |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| `orchestrator` | Owns goal, state, and keep/discard decisions |
|
|
150
|
+
| `scout` | Gathers context and surfaces opportunities |
|
|
151
|
+
| `analyst` | Challenges hypotheses and identifies risks |
|
|
152
|
+
| `verifier` | Runs mechanical verification independently |
|
|
153
|
+
| `synthesizer` | Compiles findings into next iteration plan |
|
|
154
|
+
| `security_reviewer` | Security-focused review variant |
|
|
155
|
+
| `debugger` | Debug workflow specialization |
|
|
156
|
+
| `release_guard` | Ship-readiness verification |
|
|
157
|
+
| `research_tracker` | Pattern tracking across iterations |
|
|
158
|
+
| `meta_orchestrator` | Owns meta-goal and child loop decisions (self-improvement) |
|
|
75
159
|
|
|
76
160
|
## Validation
|
|
77
161
|
|
|
78
162
|
1. `npm run typecheck` — TypeScript strict checks.
|
|
79
|
-
2. `npm
|
|
80
|
-
3.
|
|
163
|
+
2. `npm run build` — Compile to `dist/`.
|
|
164
|
+
3. `npm run verify:pack` — Package contents verification.
|
|
165
|
+
4. `npm test` — Run test suite.
|
|
166
|
+
5. Package install and `autoresearch doctor` verification.
|
|
167
|
+
|
|
168
|
+
## Release Pipeline
|
|
169
|
+
|
|
170
|
+
```mermaid
|
|
171
|
+
flowchart LR
|
|
172
|
+
A[Tag Push] --> B[Build]
|
|
173
|
+
B --> C[Type Check]
|
|
174
|
+
C --> D[Verify Pack]
|
|
175
|
+
D --> E[Tests]
|
|
176
|
+
E --> F[GitHub Release]
|
|
177
|
+
E --> G[npm Publish]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The release workflow is automated via GitHub Actions:
|
|
181
|
+
|
|
182
|
+
1. Push a `v*.*.*` tag
|
|
183
|
+
2. GitHub Actions builds, type-checks, verifies package, runs tests
|
|
184
|
+
3. Creates a GitHub Release with CHANGELOG section
|
|
185
|
+
4. Publishes to npm automatically
|
|
81
186
|
|
|
82
|
-
## Migration from
|
|
187
|
+
## Migration from Earlier Releases
|
|
83
188
|
|
|
84
189
|
- Results log is now `autoresearch-results.tsv` only (dropped `research-results.tsv`).
|
|
85
190
|
- State is now in `.autoresearch/state.json` (was `autoresearch-state.json` at root).
|
|
86
191
|
- Runtime helpers are TypeScript (`src/helpers.ts`) not Python.
|
|
87
192
|
- Plugin format is `.opencode-plugin/plugin.json`.
|
|
88
|
-
- The Claude and Codex plugin bundles (`plugins/autoresearch/`, `plugins/codex-autoresearch/`) are no longer shipped.
|
|
193
|
+
- The Claude and Codex plugin bundles (`plugins/autoresearch/`, `plugins/codex-autoresearch/`) are no longer shipped.
|
|
194
|
+
- Self-improvement loop added in v3.2.0.
|
package/docs/RELEASE.md
CHANGED
|
@@ -1,56 +1,81 @@
|
|
|
1
1
|
# Release Process
|
|
2
2
|
|
|
3
|
-
This package uses npm publish for releases.
|
|
3
|
+
This package uses npm publish for releases. GitHub Actions automates the full release pipeline.
|
|
4
4
|
|
|
5
5
|
## Version Alignment
|
|
6
6
|
|
|
7
|
-
`VERSION`
|
|
7
|
+
`VERSION`, `package.json`, `src/constants.ts`, and `.opencode-plugin/plugin.json` must all stay aligned. The `VERSION` file is the canonical source of truth.
|
|
8
8
|
|
|
9
9
|
## Release Steps
|
|
10
10
|
|
|
11
11
|
### 1. Update version
|
|
12
12
|
|
|
13
|
-
Bump the version in `package.json` and `src/constants.ts`.
|
|
14
|
-
|
|
15
13
|
```bash
|
|
16
|
-
# Update
|
|
17
|
-
|
|
14
|
+
# Update VERSION file
|
|
15
|
+
echo "3.2.0" > VERSION
|
|
16
|
+
|
|
17
|
+
# Sync to package.json
|
|
18
|
+
npm version 3.2.0 --no-git-tag-version
|
|
18
19
|
|
|
19
20
|
# Sync to src/constants.ts
|
|
20
|
-
|
|
21
|
+
# Update the VERSION export manually or use sed
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
### 2. Build
|
|
24
|
+
### 2. Build and verify
|
|
24
25
|
|
|
25
26
|
```bash
|
|
27
|
+
npm ci
|
|
26
28
|
npm run build
|
|
29
|
+
npm run typecheck
|
|
30
|
+
npm run verify:pack
|
|
31
|
+
npm test
|
|
27
32
|
```
|
|
28
33
|
|
|
29
|
-
### 3.
|
|
34
|
+
### 3. Update CHANGELOG
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
Add a new section for the version in `CHANGELOG.md`:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## [3.2.0] - YYYY-MM-DD
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- Recursive self-improvement loop support
|
|
43
|
+
- Mermaid diagrams in documentation
|
|
44
|
+
- Enhanced subagent pool with meta-orchestrator role
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- Updated README with banner and visual diagrams
|
|
48
|
+
- Improved wiki pages with architecture charts
|
|
33
49
|
```
|
|
34
50
|
|
|
35
|
-
### 4.
|
|
51
|
+
### 4. Commit and tag
|
|
36
52
|
|
|
37
53
|
```bash
|
|
38
|
-
|
|
54
|
+
git add -A
|
|
55
|
+
git commit -m "Release v3.2.0"
|
|
56
|
+
git tag v3.2.0
|
|
57
|
+
git push origin main v3.2.0
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
### 5. Automated release
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
GitHub Actions will:
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
1. Build and type-check
|
|
65
|
+
2. Verify package contents
|
|
66
|
+
3. Run tests
|
|
67
|
+
4. Create a GitHub Release with CHANGELOG section
|
|
68
|
+
5. Publish to npm
|
|
69
|
+
|
|
70
|
+
## Manual publish (fallback)
|
|
48
71
|
|
|
49
|
-
|
|
72
|
+
If you need to publish manually:
|
|
50
73
|
|
|
51
74
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
npm run build
|
|
76
|
+
npm run typecheck
|
|
77
|
+
npm run verify:pack
|
|
78
|
+
npm publish --access public
|
|
54
79
|
```
|
|
55
80
|
|
|
56
81
|
## Package Contents
|
|
@@ -61,7 +86,11 @@ The shipped package includes:
|
|
|
61
86
|
- `commands/` — OpenCode command surfaces (`autoresearch.md`, `autoresearch/*.md`)
|
|
62
87
|
- `skills/autoresearch/` — Skill bundle with references
|
|
63
88
|
- `hooks/` — Shell hooks for session lifecycle
|
|
64
|
-
- `docs/` — Installation and
|
|
65
|
-
- `.opencode-plugin/plugin.json` —
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
- `docs/` — Installation, architecture, and release docs
|
|
90
|
+
- `.opencode-plugin/plugin.json` — OpenCode plugin manifest
|
|
91
|
+
- `AGENTS.md` — Agent guide
|
|
92
|
+
- `VERSION` — Version marker
|
|
93
|
+
- `README.md` — Product overview
|
|
94
|
+
- `LICENSE` — MIT license
|
|
95
|
+
|
|
96
|
+
Runtime artifacts (`.autoresearch/`) and Node modules are **not** included.
|
package/hooks/init.sh
CHANGED
|
@@ -14,8 +14,12 @@ checklist() {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
if [ -f ".autoresearch/state.json" ]; then
|
|
17
|
-
status=$(node -e "
|
|
17
|
+
status=$(node --input-type=module -e "
|
|
18
|
+
import { readFileSync } from 'fs';
|
|
19
|
+
const s = JSON.parse(readFileSync('.autoresearch/state.json', 'utf8'));
|
|
20
|
+
console.log(s.status || '');
|
|
21
|
+
" 2>/dev/null || true)
|
|
18
22
|
if [ "$status" = "running" ] || [ "$status" = "initialized" ]; then
|
|
19
23
|
checklist
|
|
20
24
|
fi
|
|
21
|
-
fi
|
|
25
|
+
fi
|
package/hooks/status.sh
CHANGED
|
@@ -7,8 +7,9 @@ set -e
|
|
|
7
7
|
STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
|
|
8
8
|
|
|
9
9
|
if [ -f "$STATUS_FILE" ]; then
|
|
10
|
-
node -e "
|
|
11
|
-
|
|
10
|
+
node --input-type=module -e "
|
|
11
|
+
import { readFileSync } from 'fs';
|
|
12
|
+
const s = JSON.parse(readFileSync('$STATUS_FILE', 'utf8'));
|
|
12
13
|
console.log('Auto Research run: ' + s.run_id);
|
|
13
14
|
console.log('Status: ' + s.status);
|
|
14
15
|
console.log('Mode: ' + s.mode);
|
|
@@ -20,4 +21,4 @@ if [ -f "$STATUS_FILE" ]; then
|
|
|
20
21
|
" 2>/dev/null || echo "No active run."
|
|
21
22
|
else
|
|
22
23
|
echo "No active run."
|
|
23
|
-
fi
|
|
24
|
+
fi
|
package/hooks/stop.sh
CHANGED
|
@@ -7,16 +7,20 @@ set -e
|
|
|
7
7
|
STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
|
|
8
8
|
|
|
9
9
|
if [ -f "$STATUS_FILE" ]; then
|
|
10
|
-
mode=$(node -e "
|
|
10
|
+
mode=$(node --input-type=module -e "
|
|
11
|
+
import { readFileSync } from 'fs';
|
|
12
|
+
const s = JSON.parse(readFileSync('$STATUS_FILE', 'utf8'));
|
|
13
|
+
console.log(s.mode || '');
|
|
14
|
+
" 2>/dev/null || true)
|
|
11
15
|
if [ "$mode" = "background" ]; then
|
|
12
|
-
node -e "
|
|
13
|
-
|
|
14
|
-
const s = JSON.parse(
|
|
16
|
+
node --input-type=module -e "
|
|
17
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
18
|
+
const s = JSON.parse(readFileSync('$STATUS_FILE', 'utf8'));
|
|
15
19
|
s.updated_at = new Date().toISOString();
|
|
16
20
|
s.flags.stop_requested = true;
|
|
17
21
|
s.flags.background_active = false;
|
|
18
22
|
s.status = 'stopping';
|
|
19
|
-
|
|
23
|
+
writeFileSync('$STATUS_FILE', JSON.stringify(s, null, 2) + '\n');
|
|
20
24
|
console.log('Stop requested for run: ' + s.run_id);
|
|
21
25
|
" 2>/dev/null || echo "Could not update state."
|
|
22
26
|
else
|
|
@@ -24,4 +28,4 @@ if [ -f "$STATUS_FILE" ]; then
|
|
|
24
28
|
fi
|
|
25
29
|
else
|
|
26
30
|
echo "No active run."
|
|
27
|
-
fi
|
|
31
|
+
fi
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
TMP_DIR="$(mktemp -d)"
|
|
5
|
+
trap 'rm -rf "$TMP_DIR"' EXIT
|
|
6
|
+
|
|
7
|
+
PACK_JSON="$TMP_DIR/npm-pack-dry-run.json"
|
|
8
|
+
npm pack --dry-run --json --ignore-scripts > "$PACK_JSON"
|
|
9
|
+
|
|
10
|
+
node --input-type=module - "$PACK_JSON" <<'NODE'
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
|
|
13
|
+
const packJsonPath = process.argv[2];
|
|
14
|
+
const raw = fs.readFileSync(packJsonPath, "utf8");
|
|
15
|
+
const packResult = JSON.parse(raw);
|
|
16
|
+
const entries = Array.isArray(packResult) ? packResult : [packResult];
|
|
17
|
+
const files = entries.flatMap((entry) => Array.isArray(entry.files) ? entry.files : []);
|
|
18
|
+
|
|
19
|
+
const allowedRoots = new Set(["dist", "hooks", "commands", "skills", "docs", ".opencode-plugin"]);
|
|
20
|
+
const allowedFiles = new Set(["package.json", "README.md", "LICENSE", "AGENTS.md", "VERSION"]);
|
|
21
|
+
const requiredFiles = [
|
|
22
|
+
".opencode-plugin/plugin.json",
|
|
23
|
+
"hooks/init.sh",
|
|
24
|
+
"skills/autoresearch/SKILL.md",
|
|
25
|
+
"commands/autoresearch.md",
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const normalizePath = (filePath) => filePath.replace(/^package\//, "");
|
|
29
|
+
const isForbidden = (filePath) => filePath === ".autoresearch" || filePath.startsWith(".autoresearch/");
|
|
30
|
+
const isAllowed = (filePath) => {
|
|
31
|
+
if (allowedFiles.has(filePath)) return true;
|
|
32
|
+
const [root] = filePath.split("/");
|
|
33
|
+
return allowedRoots.has(root);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const violations = [];
|
|
37
|
+
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
38
|
+
|
|
39
|
+
if (packageJson.bin?.["opencode-autoresearch"] !== "dist/cli.js") {
|
|
40
|
+
violations.push("package.json bin.opencode-autoresearch must be dist/cli.js for npm global installs");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (packageJson.repository?.url !== "git+https://github.com/Maleick/AutoResearch.git") {
|
|
44
|
+
violations.push("package.json repository.url must use the npm-normalized git+https URL");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
for (const file of files) {
|
|
48
|
+
const filePath = normalizePath(String(file.path || ""));
|
|
49
|
+
if (!filePath) continue;
|
|
50
|
+
|
|
51
|
+
if (isForbidden(filePath)) {
|
|
52
|
+
violations.push(`${filePath} is runtime state and must not be published`);
|
|
53
|
+
} else if (!isAllowed(filePath)) {
|
|
54
|
+
violations.push(`${filePath} is not in the package allowlist`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (files.length === 0) {
|
|
59
|
+
violations.push("npm pack dry-run returned no package files");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const packagedPaths = new Set(files.map((file) => normalizePath(String(file.path || ""))).filter(Boolean));
|
|
63
|
+
for (const requiredFile of requiredFiles) {
|
|
64
|
+
if (!packagedPaths.has(requiredFile)) {
|
|
65
|
+
violations.push(`${requiredFile} is required in the package`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (violations.length > 0) {
|
|
70
|
+
console.error("FAIL: npm package contains unexpected files:");
|
|
71
|
+
for (const violation of violations) {
|
|
72
|
+
console.error(`- ${violation}`);
|
|
73
|
+
}
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log(`Package dry-run verified ${files.length} files`);
|
|
78
|
+
NODE
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-autoresearch",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "Autonomous recursive self-improvement engine for OpenCode. Subagent-first iteration loop with standing-pool orchestration and mechanical verification.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Maleick",
|
|
7
7
|
"url": "https://github.com/Maleick"
|
|
@@ -11,36 +11,56 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/Maleick/AutoResearch.git"
|
|
13
13
|
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/Maleick/AutoResearch/issues"
|
|
16
|
+
},
|
|
14
17
|
"license": "MIT",
|
|
15
18
|
"keywords": [
|
|
16
19
|
"opencode",
|
|
17
20
|
"plugin",
|
|
18
21
|
"autoresearch",
|
|
19
22
|
"automation",
|
|
20
|
-
"workflows"
|
|
23
|
+
"workflows",
|
|
24
|
+
"self-improvement",
|
|
25
|
+
"iteration"
|
|
21
26
|
],
|
|
22
27
|
"type": "module",
|
|
23
|
-
"main": "dist/index.js",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
24
30
|
"bin": {
|
|
25
|
-
"autoresearch": "dist/cli.js"
|
|
31
|
+
"autoresearch": "dist/cli.js",
|
|
32
|
+
"opencode-autoresearch": "dist/cli.js"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
}
|
|
26
39
|
},
|
|
27
40
|
"files": [
|
|
28
|
-
"dist
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"docs
|
|
33
|
-
".opencode-plugin
|
|
41
|
+
"dist",
|
|
42
|
+
"hooks",
|
|
43
|
+
"commands",
|
|
44
|
+
"skills",
|
|
45
|
+
"docs",
|
|
46
|
+
".opencode-plugin",
|
|
47
|
+
"AGENTS.md",
|
|
48
|
+
"VERSION",
|
|
49
|
+
"README.md",
|
|
50
|
+
"LICENSE"
|
|
34
51
|
],
|
|
35
52
|
"scripts": {
|
|
36
53
|
"build": "tsc",
|
|
37
54
|
"typecheck": "tsc --noEmit",
|
|
38
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
39
|
-
"pack": "
|
|
40
|
-
"
|
|
55
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.config.json",
|
|
56
|
+
"verify:pack": "bash hooks/verify-package.sh",
|
|
57
|
+
"prepack": "tsc"
|
|
41
58
|
},
|
|
42
59
|
"devDependencies": {
|
|
60
|
+
"@types/jest": "^30.0.0",
|
|
43
61
|
"@types/node": "^20.0.0",
|
|
62
|
+
"jest": "^30.3.0",
|
|
63
|
+
"ts-jest": "^29.4.9",
|
|
44
64
|
"typescript": "^5.9.3"
|
|
45
65
|
},
|
|
46
66
|
"engines": {
|