@really-knows-ai/foundry 3.2.4 → 3.2.5
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 +20 -23
- package/dist/.opencode/plugins/foundry.js +1 -41
- package/dist/CHANGELOG.md +16 -0
- package/dist/README.md +20 -23
- package/dist/docs/getting-started.md +18 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,9 +103,18 @@ Add the plugin to `opencode.json`:
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Restart OpenCode so the plugin registers
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Restart OpenCode so the plugin registers. On startup, Foundry bootstraps the
|
|
107
|
+
directory structure, generates stage agents, and installs the Foundry guide
|
|
108
|
+
agent automatically.
|
|
109
|
+
|
|
110
|
+
After restart, type **hello foundry**. The assistant will tell you whether a
|
|
111
|
+
further restart is needed and when to switch to the Foundry agent.
|
|
112
|
+
|
|
113
|
+
Optionally, to make the package available to your project's local `node_modules`:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
pnpm add -D @really-knows-ai/foundry
|
|
117
|
+
```
|
|
109
118
|
|
|
110
119
|
---
|
|
111
120
|
|
|
@@ -121,29 +130,17 @@ The upgrade process asks clarifying questions for ambiguous routing, input contr
|
|
|
121
130
|
|
|
122
131
|
### Phase 1 — Install
|
|
123
132
|
|
|
124
|
-
Add the plugin to `opencode.json` (see Install section above)
|
|
125
|
-
|
|
126
|
-
```json
|
|
127
|
-
{
|
|
128
|
-
"$schema": "https://opencode.ai/config.json",
|
|
129
|
-
"plugin": ["@really-knows-ai/foundry"]
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Then restart OpenCode so the plugin registers its tools and skills. You will see new
|
|
134
|
-
tools and skills become available in OpenCode's command palette once the restart
|
|
135
|
-
completes. Flow-management tools are now ready to use.
|
|
133
|
+
Add the plugin to `opencode.json` (see Install section above), then restart
|
|
134
|
+
OpenCode.
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
Type **hello foundry**. The assistant will guide you through any remaining
|
|
137
|
+
setup. If Foundry was just initialised, it will ask you to restart and switch
|
|
138
|
+
to the **Foundry** agent. If Foundry is already set up, it will tell you to
|
|
139
|
+
switch to the Foundry agent directly.
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
a decision tree: if `foundry/` is missing or its VERSION does not match the
|
|
141
|
-
installed plugin version, it bootstraps the directory structure, generates
|
|
142
|
-
`foundry-<model>` stage agent files, installs the user-facing `Foundry` guide
|
|
143
|
-
agent, and tells you to restart again.
|
|
141
|
+
### Phase 2 — Switch to the Foundry agent
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
switch to the **Foundry** agent. The Foundry agent is the normal interface for
|
|
143
|
+
Switch to the **Foundry** agent. The Foundry agent is the normal interface for
|
|
147
144
|
authoring and running Foundry workflows.
|
|
148
145
|
|
|
149
146
|
### Phase 3 — Ask the Foundry agent for a flow
|
|
@@ -153,44 +153,6 @@ function runPluginBootstrap(worktree, pkgRoot) {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
const defaultSleep = ms => new Promise(resolve => { setTimeout(resolve, ms); });
|
|
157
|
-
|
|
158
|
-
function resolveOpt(opts, key, fallback) {
|
|
159
|
-
return (opts && opts[key] !== undefined) ? opts[key] : fallback;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const STARTUP_MSG_MAX_MS = 3000;
|
|
163
|
-
|
|
164
|
-
async function retryUntilReady(fn, opts) {
|
|
165
|
-
const sleep = resolveOpt(opts, 'sleep', defaultSleep);
|
|
166
|
-
const now = resolveOpt(opts, 'now', Date.now);
|
|
167
|
-
const maxMs = resolveOpt(opts, 'maxMs', STARTUP_MSG_MAX_MS);
|
|
168
|
-
const deadline = now() + maxMs;
|
|
169
|
-
while (now() < deadline) {
|
|
170
|
-
try {
|
|
171
|
-
await fn();
|
|
172
|
-
return;
|
|
173
|
-
} catch {
|
|
174
|
-
await sleep(500);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
async function showStartupMessage(needsRestart, directory, client, timerFns) {
|
|
180
|
-
if (!client) return;
|
|
181
|
-
if (needsRestart) {
|
|
182
|
-
await retryUntilReady(() => client.tui.appendPrompt({
|
|
183
|
-
body: { text: 'Foundry initialised. Restart OpenCode so the Foundry agent registers, then switch to it to author and run workflows.' },
|
|
184
|
-
}), timerFns);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (existsSync(path.join(directory, 'foundry'))) {
|
|
188
|
-
await retryUntilReady(() => client.tui.showToast({
|
|
189
|
-
body: { message: 'Foundry is active', variant: 'info' },
|
|
190
|
-
}), timerFns);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
156
|
export { buildCyclePromptExtras } from './foundry-tools/helpers.js';
|
|
195
157
|
|
|
196
158
|
function buildTools(createTool, pending) {
|
|
@@ -227,7 +189,7 @@ function getFirstUserWithParts(output) {
|
|
|
227
189
|
return firstUser;
|
|
228
190
|
}
|
|
229
191
|
|
|
230
|
-
export const FoundryPlugin = async ({ directory
|
|
192
|
+
export const FoundryPlugin = async ({ directory }) => {
|
|
231
193
|
// Pending store is per-plugin-instance (shared across all tool invocations).
|
|
232
194
|
const pending = createPendingStore();
|
|
233
195
|
|
|
@@ -242,8 +204,6 @@ export const FoundryPlugin = async ({ directory, client }) => {
|
|
|
242
204
|
}
|
|
243
205
|
|
|
244
206
|
restartNeeded = runPluginBootstrap(directory, packageRoot);
|
|
245
|
-
// Fire-and-forget: don't block startup. messages.transform is the fallback.
|
|
246
|
-
showStartupMessage(restartNeeded, directory, client);
|
|
247
207
|
},
|
|
248
208
|
|
|
249
209
|
'experimental.chat.messages.transform': async (_input, output) => {
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.2.5] - 2026-05-14
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **Startup flow simplified to "hello foundry".** Removed the TUI client
|
|
8
|
+
retry approach for startup messages. Users now type **hello foundry**
|
|
9
|
+
after restarting; the AI reads the injected `FOUNDRY_CONTEXT` and responds
|
|
10
|
+
with restart instructions or readiness confirmation. This replaces the
|
|
11
|
+
silent double-restart dance.
|
|
12
|
+
- **E2E tests no longer depend on Python or `dd`.** The SIGTERM trap test
|
|
13
|
+
now uses shell builtins (`trap`/`echo`/`while`). The output cap tests use
|
|
14
|
+
small Node.js scripts instead of `dd` piped to `tr`. Tests are faster and
|
|
15
|
+
have no external dependencies.
|
|
16
|
+
- **Install docs updated** (`README.md`, `docs/getting-started.md`) to
|
|
17
|
+
reflect the "hello foundry" flow.
|
|
18
|
+
|
|
3
19
|
## [3.2.4] - 2026-05-14
|
|
4
20
|
|
|
5
21
|
### Fixed
|
package/dist/README.md
CHANGED
|
@@ -103,9 +103,18 @@ Add the plugin to `opencode.json`:
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Restart OpenCode so the plugin registers
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Restart OpenCode so the plugin registers. On startup, Foundry bootstraps the
|
|
107
|
+
directory structure, generates stage agents, and installs the Foundry guide
|
|
108
|
+
agent automatically.
|
|
109
|
+
|
|
110
|
+
After restart, type **hello foundry**. The assistant will tell you whether a
|
|
111
|
+
further restart is needed and when to switch to the Foundry agent.
|
|
112
|
+
|
|
113
|
+
Optionally, to make the package available to your project's local `node_modules`:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
pnpm add -D @really-knows-ai/foundry
|
|
117
|
+
```
|
|
109
118
|
|
|
110
119
|
---
|
|
111
120
|
|
|
@@ -121,29 +130,17 @@ The upgrade process asks clarifying questions for ambiguous routing, input contr
|
|
|
121
130
|
|
|
122
131
|
### Phase 1 — Install
|
|
123
132
|
|
|
124
|
-
Add the plugin to `opencode.json` (see Install section above)
|
|
125
|
-
|
|
126
|
-
```json
|
|
127
|
-
{
|
|
128
|
-
"$schema": "https://opencode.ai/config.json",
|
|
129
|
-
"plugin": ["@really-knows-ai/foundry"]
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Then restart OpenCode so the plugin registers its tools and skills. You will see new
|
|
134
|
-
tools and skills become available in OpenCode's command palette once the restart
|
|
135
|
-
completes. Flow-management tools are now ready to use.
|
|
133
|
+
Add the plugin to `opencode.json` (see Install section above), then restart
|
|
134
|
+
OpenCode.
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
Type **hello foundry**. The assistant will guide you through any remaining
|
|
137
|
+
setup. If Foundry was just initialised, it will ask you to restart and switch
|
|
138
|
+
to the **Foundry** agent. If Foundry is already set up, it will tell you to
|
|
139
|
+
switch to the Foundry agent directly.
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
a decision tree: if `foundry/` is missing or its VERSION does not match the
|
|
141
|
-
installed plugin version, it bootstraps the directory structure, generates
|
|
142
|
-
`foundry-<model>` stage agent files, installs the user-facing `Foundry` guide
|
|
143
|
-
agent, and tells you to restart again.
|
|
141
|
+
### Phase 2 — Switch to the Foundry agent
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
switch to the **Foundry** agent. The Foundry agent is the normal interface for
|
|
143
|
+
Switch to the **Foundry** agent. The Foundry agent is the normal interface for
|
|
147
144
|
authoring and running Foundry workflows.
|
|
148
145
|
|
|
149
146
|
### Phase 3 — Ask the Foundry agent for a flow
|
|
@@ -21,7 +21,12 @@ Add Foundry to `opencode.json`:
|
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Restart OpenCode so the plugin registers. On startup, Foundry bootstraps the
|
|
25
|
+
directory structure, generates stage agents, and installs the Foundry guide
|
|
26
|
+
agent automatically.
|
|
27
|
+
|
|
28
|
+
After restart, type **hello foundry**. The assistant will tell you whether a
|
|
29
|
+
further restart is needed and when to switch to the Foundry agent.
|
|
25
30
|
|
|
26
31
|
Optionally, if you want the package available to your project's local node_modules (for editor tooling or scripts), run:
|
|
27
32
|
|
|
@@ -31,11 +36,20 @@ pnpm add -D @really-knows-ai/foundry
|
|
|
31
36
|
|
|
32
37
|
## Initialise
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
After restarting OpenCode with the plugin, type **hello foundry**. The
|
|
40
|
+
assistant will read the Foundry bootstrap context and respond with guidance:
|
|
41
|
+
|
|
42
|
+
- If Foundry was just initialised: it will tell you to restart again and switch
|
|
43
|
+
to the Foundry agent.
|
|
44
|
+
- If Foundry is already set up: it will tell you to switch to the Foundry agent
|
|
45
|
+
directly.
|
|
35
46
|
|
|
36
|
-
|
|
47
|
+
switch to the **Foundry** agent before authoring flows. The Foundry agent
|
|
48
|
+
understands Foundry's authoring workflow and handles dependent setup such as
|
|
49
|
+
artefact types, laws, validators, appraisers, cycles, and config branches.
|
|
37
50
|
|
|
38
|
-
The `.foundry/` runtime directory (holding `.secret` for stage tokens) is
|
|
51
|
+
The `.foundry/` runtime directory (holding `.secret` for stage tokens) is
|
|
52
|
+
created automatically on first plugin boot and added to `.gitignore`.
|
|
39
53
|
|
|
40
54
|
---
|
|
41
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@really-knows-ai/foundry",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/.opencode/plugins/foundry.js",
|