surgent 0.7.0-alpha.4 → 0.8.0-alpha.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 (41) hide show
  1. package/README.md +2 -2
  2. package/bin/surgent.js +4 -3
  3. package/dist/optimizer/index.js +1062 -94
  4. package/dist/optimizer/index.js.map +4 -4
  5. package/dist/optimizer/package.json +1 -1
  6. package/package.json +8 -7
  7. package/src/agent/built-in/documenter.md +42 -39
  8. package/src/agent/built-in/general.md +1 -2
  9. package/src/agent/built-in/planner.md +56 -45
  10. package/src/agent/built-in/scout.md +40 -74
  11. package/src/agent/index.ts +63 -2
  12. package/src/agent/storage.ts +7 -9
  13. package/src/checkpoint/index.ts +30 -15
  14. package/src/cleanup/permission.ts +4 -2
  15. package/src/commands/helpers.ts +25 -20
  16. package/src/commands/index.ts +3 -2
  17. package/src/mcp-client/command.ts +2 -2
  18. package/src/mcp-client/storage.ts +2 -2
  19. package/src/optimizer/compactor/bash.ts +0 -18
  20. package/src/optimizer/compactor/grep.ts +73 -5
  21. package/src/optimizer/compactor/index.ts +55 -32
  22. package/src/optimizer/mapper/files.ts +3 -12
  23. package/src/permission/command.ts +2 -20
  24. package/src/permission/components/prompt.ts +18 -21
  25. package/src/permission/components/rules-list.ts +8 -15
  26. package/src/permission/constants.ts +1 -2
  27. package/src/permission/helpers.ts +22 -33
  28. package/src/permission/index.ts +67 -107
  29. package/src/permission/pattern.ts +12 -14
  30. package/src/permission/piignore.ts +53 -90
  31. package/src/permission/precedence.ts +67 -33
  32. package/src/permission/resolution.ts +141 -72
  33. package/src/permission/storage.ts +57 -8
  34. package/src/permission/types.ts +39 -12
  35. package/src/questionnaire/index.ts +51 -57
  36. package/src/state.ts +64 -0
  37. package/src/subagent/helpers.ts +1 -38
  38. package/src/subagent/index.ts +2 -0
  39. package/src/subagent/sdk.ts +126 -0
  40. package/src/subagent/subsession.ts +9 -86
  41. package/src/subagent/types.ts +2 -0
package/README.md CHANGED
@@ -223,7 +223,7 @@ Use `Ctrl+Alt+B` to cycle persistently between prompt input, context-included sh
223
223
  | ----------------------- | ------------------------------------------------------------- |
224
224
  | `/init` | Create or update repository-specific `AGENTS.md` instructions |
225
225
  | `/plan [request]` | Start, refine, save, or resume an isolated planning session |
226
- | `/agent` | Select, create, edit, or remove agent profiles |
226
+ | `/agents` | Select, create, edit, or remove agent profiles |
227
227
  | `/permissions` | View and manage file, shell, web, and MCP permission rules |
228
228
  | `/mcp` | Add, edit, enable, disable, or remove MCP servers |
229
229
  | `/web-login [provider]` | Configure credentials for web search and fetch providers |
@@ -237,7 +237,7 @@ The bundled agent profiles cover these common roles:
237
237
  | `scout` | Read-only codebase research and execution tracing |
238
238
  | `documenter` | User-facing Markdown and project documentation |
239
239
 
240
- Use `/agent` to start a new session with a specialist or create a project-specific or global profile. Profiles can constrain tools, files, shell commands, MCP servers, models, and thinking levels.
240
+ Use `/agents` to start a new session with a specialist or create a project-specific or global profile. Profiles can constrain tools, files, shell commands, MCP servers, models, and thinking levels.
241
241
 
242
242
  ## Command-line essentials
243
243
 
package/bin/surgent.js CHANGED
@@ -14,16 +14,17 @@ const args = process.argv.slice(2);
14
14
  const PACKAGE_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..");
15
15
  const AGENT_ENTRY_URL = import.meta.resolve("@earendil-works/pi-coding-agent");
16
16
  const LOCAL_PI_SUBDIRS = ["agents", "plans"];
17
+ const BASE_TOOLS = ["ls", "find", "grep", "code_map", "inspect", "read"];
17
18
  const BUILT_IN_META = {
18
19
  documenter: {
19
- tools: ["code_map", "inspect", "read", "find", "grep", "ls", "edit", "write", "questionnaire"],
20
+ tools: [...BASE_TOOLS, "edit", "write", "questionnaire"],
20
21
  "files.write": ["**/*.md"],
21
22
  },
22
23
  planner: {
23
- tools: ["read", "grep", "find", "ls", "web_fetch", "web_search", "questionnaire"],
24
+ tools: [...BASE_TOOLS, "web_fetch", "web_search", "questionnaire"],
24
25
  },
25
26
  scout: {
26
- tools: ["ls", "find", "grep", "code_map", "inspect", "read", "web_fetch", "web_search"],
27
+ tools: [...BASE_TOOLS, "web_fetch", "web_search"],
27
28
  },
28
29
  };
29
30