@supporterino/ai-factory 0.2.0 → 0.3.1
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 +16 -0
- package/README.md +47 -28
- package/dist/cli.js +1825 -359
- package/dist/package.json +3 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes per release. `ai-factory update` applies them to an installed workspace (see [docs/cli.md](docs/cli.md#update)).
|
|
4
4
|
|
|
5
|
+
## 0.3.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 4ba83db: Keep polling opencode's `/wait` in 60 s slices so an agent turn longer than 5 minutes no longer fails with "opencode server unreachable" (Node's `fetch` headers timeout), and report client-side timeouts as such instead.
|
|
10
|
+
|
|
11
|
+
## 0.3.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 7d6bb18: Add config schema v3: project instructions, skills and MCP permissions, custom agents with path routing, per-repo and per-agent models, conditional/generated gates, generated/CRD/IPC/custom contracts, Swift, `refine`/`run --interactive`, `quick`, gitmoji commits, legacy setup archiving and release/CI detection. Existing v2 configs keep working and `update` migrates them to v3.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- c0937d5: Ship `dist/package.json` with the CLI bundle so Node 20 parses `dist/cli.js` as ESM instead of failing with `Cannot use import statement outside a module`.
|
|
20
|
+
|
|
5
21
|
## 0.2.0
|
|
6
22
|
|
|
7
23
|
### Breaking (handled by `update`)
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A repo-local AI software factory. You describe a change; the factory writes an [
|
|
|
6
6
|
- **One human gate:** the spec approval. Everything after it runs on its own, and pauses with a report when it cannot finish.
|
|
7
7
|
- **Local commits only.** Nothing is pushed and no merge request is opened. You review the `change/<id>` branches and push them yourself.
|
|
8
8
|
- **Two layouts:** a single repo, or an "AI repo" that holds your code repos as git submodules.
|
|
9
|
-
- **Language profiles** (stackable per repo): TypeScript/JavaScript, React, Python, Go, Rust, Helm, Tauri v2.
|
|
9
|
+
- **Language profiles** (stackable per repo): TypeScript/JavaScript, React, Python, Go, Rust, Swift, Helm, Tauri v2.
|
|
10
10
|
|
|
11
11
|
How it works inside: [ARCHITECTURE.md](ARCHITECTURE.md). Every command: [docs/cli.md](docs/cli.md). Design decisions: [docs/decisions/](docs/decisions/). Changes per version: [CHANGELOG.md](CHANGELOG.md).
|
|
12
12
|
|
|
@@ -26,12 +26,12 @@ Plus credentials for the model providers you configure, either exported (`ANTHRO
|
|
|
26
26
|
Run the CLI without installing it:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
bunx @supporterino/ai-factory@0.
|
|
29
|
+
bunx @supporterino/ai-factory@0.3.0 init
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
`npx @supporterino/ai-factory@0.
|
|
32
|
+
`npx @supporterino/ai-factory@0.3.0 init` works too. The package is `@supporterino/ai-factory`; its command is `ai-factory`, so after `npm install --global @supporterino/ai-factory` you run `ai-factory init`. Note: the unscoped npm package `ai-factory` is an unrelated project. To run it from a checkout of this repository instead, build it with `bun install && bun run build`, then run `node dist/cli.js` (or `npm link` it).
|
|
33
33
|
|
|
34
|
-
`init` is idempotent. It detects the layout, languages and
|
|
34
|
+
`init` is idempotent. It detects the layout, languages, contracts and existing `opencode.json` instructions, and writes `factory.config.jsonc` from what it found, so edit that file afterwards. It also renders the agents, plugin, standards, skills and OpenSpec's commands into `.opencode/`, installs the `pre-push` hooks, builds the graph, writes `factory.lock.json`, and commits it all as `chore(factory): init vX.Y.Z`. On a first install it archives replaced custom agents, commands and skills under `.factory/legacy/<timestamp>/`; `init --plan` shows that plan without writing. Then check the setup:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
ai-factory doctor
|
|
@@ -89,33 +89,52 @@ While it runs, or after it stops:
|
|
|
89
89
|
|
|
90
90
|
Exit codes: 0 ok, 3 config invalid, 4 precondition, 5 gate failed, 6 paused/aborted, 10 detection drift ([full table](docs/cli.md#exit-codes)).
|
|
91
91
|
|
|
92
|
+
### Refinement and quick tasks
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ai-factory refine "make the imports faster" # ask scope/verification questions, write .factory/requests/<slug>.md
|
|
96
|
+
ai-factory run --request .factory/requests/make-the-imports-faster.md
|
|
97
|
+
ai-factory run "make the imports faster" --interactive
|
|
98
|
+
ai-factory quick "fix the login typo" --repo frontend # add --agent <id> for a custom implementer
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`refine` and `run --interactive` ask a few questions before the architect sees the request; spec approval is still the only hard gate. `quick` is the no-OpenSpec path: it creates a `task/<slug>` branch, implements, runs the gates, runs one review pass, and makes one local commit. It never pushes.
|
|
102
|
+
|
|
92
103
|
## Configuration reference
|
|
93
104
|
|
|
94
105
|
`factory.config.jsonc` (JSONC, validated on every command; the editor schema is `.opencode/schemas/factory.config.schema.json`):
|
|
95
106
|
|
|
96
|
-
| Key | Default | Meaning
|
|
97
|
-
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
98
|
-
| `$schema` | `./.opencode/schemas/factory.config.schema.json` | JSON Schema for editor completion and checks; the factory keeps it current.
|
|
99
|
-
| `schemaVersion` | `
|
|
100
|
-
| `layout` | detected | `"single"` or `"submodules"`.
|
|
101
|
-
| `repos[]` | detected | `{ name, path, role: "code" \| "orchestration", languages[], defaultBranch?, subPaths?[] }`.`languages` stacks profiles (`typescript`, `react`, `python`, `go`, `rust`, `helm`, `tauri`). A Tauri v2 app is detected as `typescript` (plus `react`) for the frontend and `rust` + `tauri` for `src-tauri/`, where the `tauri` profile runs the cargo gates. `subPaths` overrides languages for monorepo packages. In the submodule layout, the AI repo is the one `orchestration` repo at `"."`. |
|
|
102
|
-
| `models.{orchestrator, architect, reviewer, contractReviewer?, implementer, tester, explorer}` | Opus for architect/reviewer, Sonnet for orchestrator/implementer/tester, Haiku for explorer | opencode ids `"provider/model[#variant]"`.`contractReviewer` falls back to `reviewer
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
107
|
+
| Key | Default | Meaning |
|
|
108
|
+
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
109
|
+
| `$schema` | `./.opencode/schemas/factory.config.schema.json` | JSON Schema for editor completion and checks; the factory keeps it current. |
|
|
110
|
+
| `schemaVersion` | `3` | Config format. `ai-factory update` migrates older ones; v2 stays readable until you update. |
|
|
111
|
+
| `layout` | detected | `"single"` or `"submodules"`. |
|
|
112
|
+
| `repos[]` | detected | `{ name, path, role: "code" \| "orchestration", languages[], defaultBranch?, subPaths?[] }`.`languages` stacks profiles (`typescript`, `react`, `python`, `go`, `rust`, `swift`, `helm`, `tauri`). A Tauri v2 app is detected as `typescript` (plus `react`) for the frontend and `rust` + `tauri` for `src-tauri/`, where the `tauri` profile runs the cargo gates. `subPaths` overrides languages for monorepo packages. In the submodule layout, the AI repo is the one `orchestration` repo at `"."`. |
|
|
113
|
+
| `models.{orchestrator, architect, reviewer, contractReviewer?, implementer, tester, explorer}` | Opus for architect/reviewer, Sonnet for orchestrator/implementer/tester, Haiku for explorer | opencode ids `"provider/model[#variant]"`.`contractReviewer` falls back to `reviewer`.`models.roles`, `models.repos.<repo>` and `models.agents.<id>` override the flat entries; `fallback[]` lists alternates. |
|
|
114
|
+
| `instructions.{workspace, repos.<repo>}` | `[]`, `{}` | Project docs (security bars, language bars, API contracts) injected into opencode sessions. The reviewer/tester prompts also name them. |
|
|
115
|
+
| `skills.{sources, roles, repos}` | `[".opencode/skills"]`, `{}`, `{}` | Skill ids each role loads first; the skill tool is enabled for those roles. `sources` is where `doctor` looks for `SKILL.md`. |
|
|
116
|
+
| `mcp.roles.<role>` | `{}` | MCP tool action patterns a role may call (e.g. `["mantine_*"]`). Without an entry MCP tools stay on `ask`, which headless runs reject. |
|
|
117
|
+
| `agents[]`, `routing[]` | `[]`, `[]` | Optional specialist agents (`id`, `phase`, `prompt` or `promptFile`, `model`, `skills`, `edits`, `shell`, `web`, `mcp`) and path-to-agent routing for implementation tasks. |
|
|
118
|
+
| `gates.maxRetries` | `3` | Retries per task after the first attempt. |
|
|
119
|
+
| `gates.scripts` | `format:check`, `lint`, `typecheck`, `test`, `test:affected` | Script or target names looked up in `package.json`, `Makefile`, `justfile` and `Taskfile.yml`. |
|
|
120
|
+
| `gates.overrides.<repo>.<gate>` | `{}` | A literal command, which wins over scripts and profile defaults. `"skip"` turns that gate off. Placeholders: `{files}`, `{testFiles}`, `{packages}`, `{crates}`, `{charts}`, `{base}`. |
|
|
121
|
+
| `gates.extra[]` | `[]` | Conditional gates: `name`, `type`, `phases`, `when.changed`, `command`, `env`, `setup`, `outputs`, `checkOnly`, `timeoutMs`.`outputs` makes it a generated-artifact drift gate. |
|
|
122
|
+
| `contracts[]` | detected | `{ kind: openapi \| proto \| json-schema \| helm-values \| generated \| crd \| ipc \| custom, provider, path, consumers[], command?, outputs?, allowBreaking?, validate?{<consumer>: cmd} }`.`generated`/`crd`/`ipc` contracts run their command and fail on output drift. In `validate` commands, `{contract}` is the absolute path of the provider's new contract. |
|
|
123
|
+
| `commits.{style, scopes}` | `"conventional"`, `false` | `"gitmoji"` keeps the Conventional prefix and adds the emoji; `scopes` adds the repo name to task commits. |
|
|
124
|
+
| `workflow.{refine, quick}` | `true`, `{enabled: true, branchPrefix: "task/"}` | Enables `refine` / `run --interactive` and `ai-factory quick`. |
|
|
125
|
+
| `release.detect` | `true` | Detects release-please, goreleaser, changesets and forge CI, and reports them in `doctor`; no workflow is edited. |
|
|
126
|
+
| `parallel.maxAgents` | `4` | Concurrent agent sessions. |
|
|
127
|
+
| `parallel.maxGateProcesses` | `2` | Concurrent gate processes. |
|
|
128
|
+
| `parallel.withinRepo` | `"worktrees"` | `"serial"` runs one task per repo at a time. |
|
|
129
|
+
| `tokens.contextPackMaxTokens` | `8000` | Cap on each task's context pack. |
|
|
130
|
+
| `tokens.gateOutputMaxLines` | `80` | Compacted gate output fed back to agents. |
|
|
131
|
+
| `tokens.mode` | `"report"` | Usage is reported, never enforced. |
|
|
132
|
+
| `addons.ponytail.{enabled, ref, roles, level, shortcutComments}` | `true`, pinned ref, `["implementer","reviewer"]`, `"full"`, `"report"` | See [Ponytail](#ponytail). |
|
|
133
|
+
| `logs.retentionDays` | `14` | How long logs are kept. |
|
|
134
|
+
| `logs.redact` | `true` | Redacts secrets from the logs. |
|
|
135
|
+
| `graph.exclude` | node_modules, vendor, target, dist, build, coverage, .next, `__pycache__`, .venv, .factory, graphify-out | Paths the graph skips. |
|
|
136
|
+
| `security.sandbox` | `"auto"` | Run agent shells and gates in an OS sandbox: macOS `sandbox-exec` when present. It blocks writes outside the session's worktree, edits to rc and git files, reads of credential files, git credential helpers and ssh. `"off"` disables it. Other platforms have no sandbox yet; `doctor` warns. |
|
|
137
|
+
| `unmanaged[]` | `[]` | Managed files you want to own completely: `update` never touches them. |
|
|
119
138
|
|
|
120
139
|
You can edit the agents in `.opencode/agents/` and the standards in `.opencode/standards/`. `update` merges your edits with new templates. `detect` shows drift between the workspace and the config, and `detect --apply` adds new repos' implementers, scopes and hooks.
|
|
121
140
|
|
|
@@ -139,7 +158,7 @@ bunx @supporterino/ai-factory@<new> rollback # undo it
|
|
|
139
158
|
|
|
140
159
|
| Symptom | Fix |
|
|
141
160
|
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
142
|
-
| `uses config schemaVersion 1; this factory needs
|
|
161
|
+
| `uses config schemaVersion 1; this factory needs 3` | `ai-factory update` (it migrates v1 → v2 → v3 and keeps comments). |
|
|
143
162
|
| `doctor`: `model … is not available to opencode` | The server only sees the credentials of providers named in `models`. Export the provider's key (e.g. `ANTHROPIC_API_KEY`) or run `opencode auth login`, or change the model. |
|
|
144
163
|
| `doctor` / `gate`: `no format gate` or `not found: golangci-lint` | Install the tool, add a script under the name in `gates.scripts`, or set `gates.overrides.<repo>.<gate>` (`"skip"` to turn it off). |
|
|
145
164
|
| `gate is not check-only` | Your format or lint script writes files. Point the gate at the check variant (e.g. `prettier --check`, `biome check`). |
|