chainlesschain 0.43.0 → 0.43.2

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 (2) hide show
  1. package/README.md +65 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -200,7 +200,9 @@ chainlesschain agent --provider openai --api-key sk-...
200
200
 
201
201
  Built-in tools: `read_file`, `write_file`, `edit_file`, `run_shell`, `search_files`, `list_dir`, `run_skill`, `list_skills`, `run_code`
202
202
 
203
- Agent slash commands: `/plan` (plan mode), `/plan interactive <request>` (LLM-driven planning with skill recommendations), `/model`, `/provider`, `/clear`, `/compact`, `/task`, `/session`, `/stats`, `/auto` (autonomous agent), `/cowork` (multi-agent collaboration)
203
+ Agent slash commands: `/plan` (plan mode), `/plan interactive <request>` (LLM-driven planning with skill recommendations), `/model`, `/provider`, `/clear`, `/compact`, `/task`, `/session`, `/stats`, `/auto` (autonomous agent), `/cowork` (multi-agent collaboration), `/sub-agents` (show active/completed sub-agents)
204
+
205
+ **Sub-Agent Isolation v2** (v0.43.0): Complex tasks are automatically decomposed into isolated sub-agents, each with its own namespaced memory, scoped context, and lifecycle tracking. Use `/sub-agents` inside an agent session to inspect active and completed sub-agents, token usage, and average durations.
204
206
 
205
207
  ### `chainlesschain skill <action>`
206
208
 
@@ -831,6 +833,62 @@ chainlesschain cli-anything remove <name> # Remove registered tool
831
833
 
832
834
  ---
833
835
 
836
+ ## Sub-Agent Isolation v2
837
+
838
+ Introduced in v0.43.0: complex agent tasks are automatically decomposed into isolated **sub-agents**, each running in its own sandboxed context — namespaced memory, scoped context engineering, and full lifecycle tracking.
839
+
840
+ ### Architecture
841
+
842
+ | Component | Description |
843
+ | -------------------------- | ------------------------------------------------------------------------ |
844
+ | `SubAgentRegistry` | Singleton registry tracking active/completed sub-agents with stats |
845
+ | `NamespacedMemory` | Per-sub-agent memory namespace, isolated from main session |
846
+ | `ScopedContextEngineering` | Context window scoped to each sub-agent's task |
847
+ | `SubAgentContext` | Execution context carrying role, task, iteration count, and token budget |
848
+
849
+ ### Agent Slash Commands
850
+
851
+ Inside a `chainlesschain agent` session:
852
+
853
+ ```
854
+ /sub-agents Show active sub-agents, completed history, token usage, and avg duration
855
+ ```
856
+
857
+ ### How It Works
858
+
859
+ When the agent encounters a complex multi-step task, it spawns one or more sub-agents:
860
+
861
+ ```
862
+ Main Agent
863
+ ├── SubAgent [analyzer] — reads codebase, writes findings to namespaced memory
864
+ ├── SubAgent [planner] — reads findings, proposes implementation plan
865
+ └── SubAgent [executor] — implements plan with isolated context
866
+ ```
867
+
868
+ Each sub-agent:
869
+
870
+ - Has its own memory namespace (no cross-contamination with other sub-agents)
871
+ - Carries a scoped context slice (not the full conversation history)
872
+ - Is registered with `SubAgentRegistry` for observability
873
+ - Reports back to the main agent upon completion
874
+
875
+ ### Example Output of `/sub-agents`
876
+
877
+ ```
878
+ Sub-Agent Registry:
879
+ Active: 1 Completed: 3 Tokens: 4821 Avg Duration: 1243ms
880
+
881
+ Active Sub-Agents:
882
+ sa-7f3a [executor] Implement the authentication module (iter: 2)
883
+
884
+ Recent History (last 10):
885
+ ✓ sa-1a2b [analyzer] Analyzed 12 files, found 3 issues
886
+ ✓ sa-3c4d [planner] Generated 5-step implementation plan
887
+ ✗ sa-5e6f [executor] Failed: missing dependency crypto-utils
888
+ ```
889
+
890
+ ---
891
+
834
892
  ## WebSocket Server Interface
835
893
 
836
894
  ### `chainlesschain serve`
@@ -845,7 +903,7 @@ chainlesschain serve --allow-remote --token <secret> # Allow remote + auth
845
903
  chainlesschain serve --project /path/to/project # Default project root for sessions
846
904
  ```
847
905
 
848
- **Session Protocol** (v0.41.0): WebSocket clients can create stateful agent/chat sessions via `session-create`, send messages via `session-message`, resume previous sessions via `session-resume`, and manage sessions via `session-list`/`session-close`. Supports `slash-command` for in-session commands and `session-answer` for interactive Q&A (SlotFiller/Planner).
906
+ **Session Protocol** (v0.43.0): WebSocket clients can create stateful agent/chat sessions via `session-create`, send messages via `session-message`, resume previous sessions via `session-resume`, and manage sessions via `session-list`/`session-close`. Supports `slash-command` for in-session commands and `session-answer` for interactive Q&A (SlotFiller/Planner).
849
907
 
850
908
  ---
851
909
 
@@ -922,7 +980,7 @@ Configuration is stored at `~/.chainlesschain/config.json`. The CLI creates and
922
980
  ```bash
923
981
  cd packages/cli
924
982
  npm install
925
- npm test # Run all tests (2503 tests across 113 files)
983
+ npm test # Run all tests (2748 tests across 124 files)
926
984
  npm run test:unit # Unit tests only
927
985
  npm run test:integration # Integration tests
928
986
  npm run test:e2e # End-to-end tests
@@ -932,15 +990,15 @@ npm run test:e2e # End-to-end tests
932
990
 
933
991
  | Category | Files | Tests | Status |
934
992
  | ------------------------ | ------- | -------- | --------------- |
935
- | Unit — lib modules | 56 | 1200+ | All passing |
993
+ | Unit — lib modules | 63 | 1380+ | All passing |
936
994
  | Unit — commands | 15 | 350+ | All passing |
937
995
  | Unit — runtime | 1 | 6 | All passing |
938
- | Integration | 5 | 30+ | All passing |
939
- | E2E | 14 | 150+ | All passing |
996
+ | Integration | 6 | 40+ | All passing |
997
+ | E2E | 15 | 160+ | All passing |
940
998
  | Core packages (external) | — | 118 | All passing |
941
999
  | Unit — WS sessions | 9 | 156 | All passing |
942
1000
  | Integration — WS session | 1 | 12 | All passing |
943
- | **CLI Total** | **113** | **2503** | **All passing** |
1001
+ | **CLI Total** | **124** | **2748** | **All passing** |
944
1002
 
945
1003
  ## License
946
1004
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chainlesschain",
3
- "version": "0.43.0",
3
+ "version": "0.43.2",
4
4
  "description": "CLI for ChainlessChain - install, configure, and manage your personal AI management system",
5
5
  "type": "module",
6
6
  "bin": {