sumo-agents 0.3.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.
Files changed (52) hide show
  1. package/AGENTS.md +8 -6
  2. package/CHANGELOG.md +155 -0
  3. package/README.md +82 -19
  4. package/bin/sumo.mjs +13 -2
  5. package/guides/feature.md +2 -1
  6. package/guides/memory.md +6 -4
  7. package/guides/projects.md +1 -1
  8. package/guides/review.md +1 -1
  9. package/package.json +5 -4
  10. package/prompts/dream.md +6 -0
  11. package/spinner.txt +25 -1
  12. package/src/apply.mjs +146 -18
  13. package/src/auth.mjs +32 -5
  14. package/src/card.mjs +39 -2
  15. package/src/catalog.mjs +6 -3
  16. package/src/chat.mjs +289 -89
  17. package/src/cli.mjs +359 -135
  18. package/src/cost.mjs +67 -8
  19. package/src/db.mjs +106 -3
  20. package/src/dream.mjs +445 -19
  21. package/src/editor.mjs +113 -11
  22. package/src/export.mjs +105 -7
  23. package/src/guard.mjs +57 -11
  24. package/src/guides.mjs +5 -4
  25. package/src/herdr.mjs +9 -4
  26. package/src/hooks.mjs +35 -19
  27. package/src/jobs.mjs +118 -39
  28. package/src/jobtools.mjs +6 -4
  29. package/src/keeper.mjs +77 -0
  30. package/src/local-server.mjs +9 -16
  31. package/src/lock.mjs +2 -1
  32. package/src/logs.mjs +165 -0
  33. package/src/loop.mjs +121 -44
  34. package/src/mcp.mjs +72 -16
  35. package/src/memory.mjs +142 -15
  36. package/src/model.mjs +41 -21
  37. package/src/paths.mjs +38 -0
  38. package/src/prime.mjs +19 -31
  39. package/src/projects.mjs +94 -12
  40. package/src/redact.mjs +10 -0
  41. package/src/render.mjs +2 -1
  42. package/src/route.mjs +39 -25
  43. package/src/sandbox.mjs +82 -3
  44. package/src/scan.mjs +35 -1
  45. package/src/scribe.mjs +10 -22
  46. package/src/sessions.mjs +49 -13
  47. package/src/setup.mjs +425 -76
  48. package/src/text.mjs +100 -1
  49. package/src/tools.mjs +258 -21
  50. package/src/tty.mjs +481 -105
  51. package/src/ui.mjs +1205 -276
  52. 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
- run = spawnSync(`${watcher}${command}`, { cwd: root, shell: true, detached: true, stdio: ['ignore', into, into], timeout: timeoutMs(), killSignal: 'SIGKILL' });
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
  }