sumo-agents 0.4.0 → 0.5.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/AGENTS.md +8 -6
- package/CHANGELOG.md +155 -0
- package/README.md +76 -18
- package/bin/sumo.mjs +13 -2
- package/guides/feature.md +2 -1
- package/guides/memory.md +6 -4
- package/guides/projects.md +1 -1
- package/guides/review.md +1 -1
- package/package.json +5 -4
- package/prompts/dream.md +6 -0
- package/spinner.txt +25 -1
- package/src/apply.mjs +146 -18
- package/src/auth.mjs +32 -5
- package/src/card.mjs +39 -2
- package/src/catalog.mjs +6 -3
- package/src/chat.mjs +197 -86
- package/src/cli.mjs +359 -135
- package/src/cost.mjs +67 -8
- package/src/db.mjs +106 -3
- package/src/dream.mjs +445 -19
- package/src/editor.mjs +3 -2
- package/src/export.mjs +105 -7
- package/src/guard.mjs +57 -11
- package/src/guides.mjs +5 -4
- package/src/herdr.mjs +4 -2
- package/src/hooks.mjs +31 -18
- package/src/jobs.mjs +118 -39
- package/src/jobtools.mjs +6 -4
- package/src/keeper.mjs +77 -0
- package/src/local-server.mjs +9 -16
- package/src/lock.mjs +2 -1
- package/src/logs.mjs +165 -0
- package/src/loop.mjs +121 -44
- package/src/mcp.mjs +72 -16
- package/src/memory.mjs +142 -15
- package/src/model.mjs +41 -21
- package/src/paths.mjs +38 -0
- package/src/prime.mjs +19 -31
- package/src/projects.mjs +76 -12
- package/src/redact.mjs +10 -0
- package/src/render.mjs +2 -1
- package/src/route.mjs +16 -22
- package/src/sandbox.mjs +82 -3
- package/src/scan.mjs +35 -1
- package/src/scribe.mjs +10 -22
- package/src/sessions.mjs +46 -11
- package/src/setup.mjs +423 -78
- package/src/text.mjs +100 -1
- package/src/tools.mjs +258 -21
- package/src/tty.mjs +205 -78
- package/src/ui.mjs +869 -293
- package/src/verify.mjs +17 -1
package/src/verify.mjs
CHANGED
|
@@ -144,6 +144,16 @@ function tailOf(file) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
/** The sandbox a job's process hands down for its checks: the wrap's words, or null — none given, or one that is not a list of words. */
|
|
148
|
+
function checksWrapOf(env) {
|
|
149
|
+
try {
|
|
150
|
+
const wrap = JSON.parse(env.SUMO_CHECKS_WRAP ?? 'null');
|
|
151
|
+
return Array.isArray(wrap) && wrap.length > 0 && wrap.every((w) => typeof w === 'string') ? wrap : null;
|
|
152
|
+
} catch {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
147
157
|
/** Runs each command where the project lives and keeps the end of what it printed, which is where runners put the failures. */
|
|
148
158
|
function runChecks(root, commands, dir, prefix) {
|
|
149
159
|
const named = new Map();
|
|
@@ -160,7 +170,13 @@ function runChecks(root, commands, dir, prefix) {
|
|
|
160
170
|
const into = openSync(file, 'w', 0o600);
|
|
161
171
|
let run;
|
|
162
172
|
try {
|
|
163
|
-
|
|
173
|
+
// A job's checks run the project's code, perhaps tests the model wrote: in the sandbox its shell is in, handed down by the
|
|
174
|
+
// job's own process (SUMO_CHECKS_WRAP), while this process — which records the verdict in sumo's memory — stays outside it.
|
|
175
|
+
const wrap = checksWrapOf(process.env);
|
|
176
|
+
const script = `${watcher}${command}`;
|
|
177
|
+
run = wrap
|
|
178
|
+
? spawnSync(wrap[0], [...wrap.slice(1), '/bin/sh', '-c', script], { cwd: root, detached: true, stdio: ['ignore', into, into], timeout: timeoutMs(), killSignal: 'SIGKILL' })
|
|
179
|
+
: spawnSync(script, { cwd: root, shell: true, detached: true, stdio: ['ignore', into, into], timeout: timeoutMs(), killSignal: 'SIGKILL' });
|
|
164
180
|
} finally {
|
|
165
181
|
closeSync(into);
|
|
166
182
|
}
|