```                   # 📋 Session Report
    λλ              
   λ⊙λ⊙             
  λλλλλλ            
 λλλλλλλλ           
    λλ              
    λλ              
    λλ              
    λλ              
    λλ              
    λλ              
    λλ              
    λλ              
```                 

**🔑 Session ID:** d7d4482b-fb15-4a52-bfcf-769dad05bd55

---

## 📊 Statistics

### Turn Counts

| Metric | Value |
|--------|-------|
| Total Turns | 48 |
| 👤 User Turns | 24 |
| 🤖 LLM Turns | 24 |

### 🔧 Tool Calls

**Total Tool Calls:** 28

`bash_read-file      `   15 ████████████████████████████████████████████████████████████

`bash_write-file     `    5 ████████████████████

`bash_check-code     `    3 ████████████

`bash_grep-files     `    2 ████████

`developer_dev_developer_tools`    2 ████████

`bash_list-files     `    1 ████


### 💾 Byte Usage

`Input     `      2 MiB ████████████████████████████████████████████████████████████

`Output    `      4 KiB 

`Reasoning `      3 KiB 
**Total:** 2 MiB


### 🎫 Token Usage

`Prompt      `  2,062,601 ████████████████████████████████████████████████████████████

`Completion  `     15,633 █

`Cached      `  2,590,616 ███████████████████████████████████████████████████████
**Total:** 2,113,244

_(2,590,616 cached)_


### 📡 Signal Metrics

**Informativeness Score:** 100/100 🟢

#### Interaction Signals

| Signal | Status | Details |
|--------|--------|---------|
| Misalignment | ⚠️ 5 | 5 instances detected

#### Execution Signals

| Signal | Status | Details |
|--------|--------|---------|
| Failures | ⚠️ 23 | 23 tool/action failures

#### Environment Signals

| Signal | Status | Details |
|--------|--------|---------|
| Exhaustion | ⚠️ 10 | 10 resource boundary hits: timeout, connection_error, service_unavailable, rate_limit, context_overflow
---

## 👤 Step 1: User Turn

### 📝 System Prompt

```
You are an expert Haskell and Bash programmer specialized in writing clean, idiomatic, and efficient Haskell code.
When writing Bash code:
- Avoid bash-specific logic but bash-ism are fine.
- Document required shell tools at the top of the bash script.
When writing Haskell code:
- Use modern Haskell practices (base >= 4.14)
- Prefer pure functions and explicit type signatures
- Use standard libraries when appropriate
- Add clear comments for complex logic
- Follow consistent formatting
Use list-files to explore the project structure, read-file to understand existing code, write-file to create or modify files, and check-code to verify your work.
Always compile code before considering the job done.
Your output format may be stored as commit message: hence the first line of your last message should be a summary line.
You have access to a tool which is a copy of yourself named io_prompt_agent_oneshot, use it when a task is well-scoped in a way that it would save tokens in your context window and not interfere with your work.
```

### 💬 User Query

# Add session introspection capabilities to SystemToolbox for cross-session analysis


## Summary

Extend the existing `SystemToolbox` with session introspection capabilities that allow agent sessions to query, search, and read other sessions from the session store. This enables cross-session analysis, pattern recognition, and context sharing between related conversations by integrating session access as system-level capabilities.

## Motivation

Currently, the `SystemToolbox` provides system-level information (date, OS, env vars, etc.) but cannot access session history. This limits agents from:
- Learning from previous similar conversations
- Building cumulative knowledge across session boundaries  
- Enabling parent/child session relationships for complex multi-step workflows
- Searching for relevant context from past sessions

Session introspection is a **system-level concern** (accessing system state), so it belongs in `SystemToolbox` rather than as a separate toolbox.

## Proposed Solution

Extend the existing `SystemToolbox` with new capabilities for session introspection.

### 1. New SystemToolCapability Values

Add to `SystemToolCapability` in `System.Agents.Base`:

```haskell
data SystemToolCapability
  = -- ... existing capabilities ...
  | SystemToolListSessions      -- ^ List accessible sessions
  | SystemToolSearchSessions    -- ^ Full-text search across sessions
  | SystemToolReadSession       -- ^ Read session content
  | SystemToolGetSessionStats   -- ^ Get session statistics
  deriving (Show, Ord, Eq, Generic)
```

String representations for JSON serialization:
- `"list-sessions"` -> `SystemToolListSessions`
- `"search-sessions"` -> `SystemToolSearchSessions`  
- `"read-session"` -> `SystemToolReadSession`
- `"get-session-stats"` -> `SystemToolGetSessionStats`

### 2. Extended SystemToolboxDescription

Extend `SystemToolboxDescription` with optional session introspection configuration:

```haskell
data SystemToolboxDescription = SystemToolboxDescription
  { systemToolboxName :: Text
  , systemToolboxDescription :: Text
  , systemToolboxCapabilities :: [SystemToolCapability]
  , systemToolboxEnvVarFilter :: Maybe Text
  , systemToolboxActivation :: Maybe Activation
  -- NEW FIELDS (all optional, default to sensible values):
  , systemToolboxSessionIntrospectionScope :: Maybe SessionIntrospectionScope
  -- ^ Scope of accessible sessions (default: ScopeSubtree)
  , systemToolboxSessionIntrospectionMaxResults :: Maybe Int
  -- ^ Max sessions to return in list operations (default: 50)
  , systemToolboxSessionIntrospectionIncludeToolOutputs :: Maybe Bool
  -- ^ Whether to include tool outputs in read operations (default: True)
  }

data SessionIntrospectionScope
  = ScopeParentsOnly    -- ^ Can only see parent sessions (ancestors via forkedFromSessionId)
  | ScopeChildrenOnly   -- ^ Can only see child sessions (descendants)
  | ScopeSubtree        -- ^ Parents + current + children
  | ScopeAll            -- ^ All sessions (requires explicit opt-in)
  deriving (Show, Eq)
```

**Backward compatibility**: All new fields are `Maybe`, existing configs continue to work. When `Nothing`, use defaults that maintain current behavior (no session introspection if capabilities not enabled).

### 3. Implementation in SystemToolbox Module

Extend `System.Agents.Tools.SystemToolbox` to handle new capabilities:

**A. Capability name mapping:**
Add to `capabilityFromName` and `capabilityToName`:
```haskell
capabilityFromName "list-sessions" = Just SystemToolListSessions
capabilityFromName "search-sessions" = Just SystemToolSearchSessions
capabilityFromName "read-session" = Just SystemToolReadSession
capabilityFromName "get-session-stats" = Just SystemToolGetSessionStats
```

**B. Query execution handlers:**
Add to `getCapabilityInfoInternal` or create new execution paths for session capabilities:

- `SystemToolListSessions`: List sessions based on scope
  - Uses `SessionStore.listSessions` to enumerate sessions
  - Filters by `forkedFromSessionId` relationships for scope enforcement
  - Returns: session IDs, timestamps, turn counts

- `SystemToolSearchSessions`: Full-text search across sessions
  - Uses `Session.Search.Index.executeSearchWithOptions` for FTS5 queries
  - Searches in user queries, LLM responses, tool outputs
  - Returns: matching sessions with relevance scores and snippet previews

- `SystemToolReadSession`: Read session content
  - Uses `SessionStore.readSession` to load session
  - Returns: turns, tool calls, responses based on scope
  - Content options: all turns, last N turns, specific range

- `SystemToolGetSessionStats`: Get session statistics
  - Uses `SessionPrint.calculateStatistics` for metrics
  - Returns: turn counts, token usage, byte counts, trajectory signals

**C. Scope enforcement:**
Access control based on `SessionIntrospectionScope`:
```haskell
-- Check if current session can access target session based on scope
canAccessSession :: 
  SessionId -> -- ^ Current session ID
  Maybe SessionId -> -- ^ Current session's forkedFromSessionId
  SessionId -> -- ^ Target session ID
  SessionIntrospectionScope ->
  Bool
```

Leverage existing `forkedFromSessionId` field from `Session` type for lineage tracking.

### 4. Input/Output Schema

Each capability accepts JSON input and produces JSON output:

**list-sessions input:**
```json
{
  "filterByAgent": "optional-agent-slug",
  "since": "2024-01-01T00:00:00Z",
  "sortBy": "modification-time",
  "limit": 20
}
```

**list-sessions output:**
```json
{
  "sessions": [
    {
      "sessionId": "uuid",
      "conversationId": "uuid",
      "modificationTime": "2024-01-15T10:30:00Z",
      "turnCount": 15,
      "isParent": false,
      "isChild": true
    }
  ],
  "totalAccessible": 42
}
```

**search-sessions input:**
```json
{
  "query": "error handling pattern",
  "inToolOutputs": true,
  "limit": 10
}
```

**read-session input:**
```json
{
  "sessionId": "target-uuid",
  "contentRange": {"type": "last-n", "n": 10}
}
```

## Files to Modify

1. **`src/System/Agents/Base.hs`**:
   - Add new `SystemToolCapability` constructors
   - Add `SessionIntrospectionScope` type
   - Extend `SystemToolboxDescription` with optional session introspection fields
   - Update JSON serialization for new types

2. **`src/System/Agents/Tools/SystemToolbox.hs`**:
   - Extend `capabilityFromName`/`capabilityToName` for new capabilities
   - Add session query handlers to `getCapabilityInfoInternal` or create parallel path
   - Implement scope enforcement logic
   - Add session-specific trace events
   - Integrate with `SessionStore`, `Session.Search`, `SessionPrint` modules

3. **`docs/tools.md`** (optional):
   - Document new system capabilities
   - Provide configuration examples

## Dependencies

None - this extends existing `SystemToolbox` infrastructure.

## Integration Points

- **SessionStore** (`System.Agents.SessionStore`): `listSessions`, `readSession`
- **Session.Search.Index** (`System.Agents.Session.Search.Index`): `executeSearchWithOptions`
- **SessionPrint** (`System.Agents.SessionPrint`): `calculateStatistics`, `formatSessionAsMarkdown`
- **Session Types** (`System.Agents.Session.Types`): `Session`, `forkedFromSessionId`

## Security Considerations

1. **Scope enforcement**: Strictly enforce `SessionIntrospectionScope` to prevent unauthorized access
2. **Default scope**: `ScopeSubtree` for balanced security/usability
3. **ScopeAll requires explicit opt-in**: Must be explicitly configured, never default
4. **No cross-user access**: Scope only applies to sessions within same session store

## Tradeoffs

1. **Performance**: Cross-session queries may be slow for large session stores
   - Mitigation: Use existing FTS5 index for search, pagination for list operations

2. **Memory**: Loading multiple sessions could consume significant memory  
   - Mitigation: Pagination, lazy loading, streaming for large content

3. **Complexity**: Extends SystemToolbox with session-specific logic
   - Mitigation: Keep session logic isolated in helper functions, leverage existing patterns

4. **Backward compatibility**: New optional fields in `SystemToolboxDescription`
   - All new fields are `Maybe`, defaults maintain existing behavior

## Configuration Example

```json
{
  "builtinToolboxes": [
    {
      "tag": "SystemToolbox",
      "contents": {
        "name": "system",
        "description": "System information and session memory",
        "capabilities": [
          "date",
          "hostname",
          "list-sessions",
          "search-sessions",
          "read-session"
        ],
        "sessionIntrospectionScope": "subtree",
        "sessionIntrospectionMaxResults": 50,
        "sessionIntrospectionIncludeToolOutputs": false
      }
    }
  ]
}
```

## Related

- Original issue #491 (incorrectly proposed separate toolbox)
- `System.Agents.SessionStore` - Session file operations
- `System.Agents.Session.Search.*` - FTS5 search infrastructure  
- `System.Agents.OS.Conversation.Lineage` - Session relationship concepts

---
From #497



### 🛠️ Available Tools

- **bash_grep-files** (`bash_grep-files`)
  - Description: Search for a pattern in files using 'git grep'
- **bash_read-file** (`bash_read-file`)
  - Description: Read the contents of a file
- **bash_check-code** (`bash_check-code`)
  - Description: Check Haskell code by compiling or testing
- **bash_list-files** (`bash_list-files`)
  - Description: List all files in the project
- **bash_write-file** (`bash_write-file`)
  - Description: Write content to a file. Optionally compiles or tests the code after writing. Use 'none' for the check action when making multiple edits that are not yet final, to avoid redundant compilation.
- **bash_run_agents_exe** (`bash_run_agents_exe`)
  - Description: Runs agents-exe with specified arguments. Useful for testing CLI commands like init, check, run, describe, and running repro cases when bug with specific command arise.
- **developer_dev_developer_tools** (`developer_dev_developer_tools`)
  - Description: Developer tools for writing and validating agents and tools: Development utilities
- **io_prompt_agent_oneshot** (`io_prompt_agent_oneshot`)
  - Description: asks a prompt to the expert agent: oneshot
- **io_prompt_agent_faq** (`io_prompt_agent_faq`)
  - Description: asks a prompt to the expert agent: faq

---

## 🤖 Step 2: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Let me analyze this task. The user wants to extend the existing `SystemToolbox` with session introspection capabilities. This involves:

1. Adding new `SystemToolCapability` values in `System.Agents.Base`
2. Adding `SessionIntrospectionScope` type
3. Extending `SystemToolboxDescription` with optional session introspection fields
4. Implementing the new capabilities in `System.Agents.Tools.SystemToolbox`

Let me start by exploring the project structure to understand the existing code.
</details>

### 💬 Response



### 🔧 Tool Calls

- **bash_list-files**

---

## 👤 Step 3: User Turn



---

## 🤖 Step 4: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Let me read the key files I need to modify. First, let me look at `System.Agents.Base` to understand the existing types, then `System.Agents.Tools.SystemToolbox` to understand the current implementation.
</details>

### 💬 Response



### 🔧 Tool Calls

- **bash_read-file**

- **bash_read-file**

---

## 👤 Step 5: User Turn



---

## 🤖 Step 6: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now let me also look at the SessionStore and Session types to understand how to interact with sessions:
</details>

### 💬 Response

Let me look at the SessionStore and Session types to understand how to work with sessions:

### 🔧 Tool Calls

- **bash_read-file**

- **bash_read-file**

---

## 👤 Step 7: User Turn



---

## 🤖 Step 8: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now let me look at SessionPrint for statistics and Session.Search.Index for search functionality:
</details>

### 💬 Response

Let me also look at SessionPrint and the Search Index modules:

### 🔧 Tool Calls

- **bash_read-file**

- **bash_read-file**

---

## 👤 Step 9: User Turn



---

## 🤖 Step 10: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now I have a good understanding of the codebase. Let me look at the Session.Search module to see how searching works:
</details>

### 💬 Response

Let me also look at the Session.Search module and the Search Query module to understand the full search functionality:

### 🔧 Tool Calls

- **bash_read-file**

- **bash_read-file**

- **bash_read-file**

---

## 👤 Step 11: User Turn



---

## 🤖 Step 12: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now I have a good understanding of the codebase. Let me also check if there's a Session.Base module that I need to look at:
</details>

### 💬 Response

Let me check the Session.Base module as well:

### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 13: User Turn



---

## 🤖 Step 14: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now I have a comprehensive understanding of the codebase. Let me also check if there's documentation for tools that I might need to update:
</details>

### 💬 Response

Let me also look at the existing tools documentation to understand the expected format:

### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 15: User Turn



---

## 🤖 Step 16: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now I have a complete understanding of the codebase. Let me implement the session introspection capabilities as described in the task. I need to:

1. Add new `SystemToolCapability` values in `System.Agents.Base`
2. Add `SessionIntrospectionScope` type in `System.Agents.Base`
3. Extend `SystemToolboxDescription` with optional session introspection fields in `System.Agents.Base`
4. Implement the new capabilities in `System.Agents.Tools.SystemToolbox`

Let me start by modifying the Base.hs file:
</details>

### 💬 Response

Now I have a comprehensive understanding of the codebase. Let me implement the session introspection capabilities. I'll start by modifying the `Base.hs` file to add the new types and extend `SystemToolboxDescription`:

### 🔧 Tool Calls

- **bash_write-file**

---

## 👤 Step 17: User Turn



---

## 🤖 Step 18: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

The Base.hs file is updated successfully. Now I need to update the SystemToolbox.hs file to handle the new capabilities. The compilation error shows that I need to:

1. Add the new capabilities to `capabilityFromName` and `capabilityToName`
2. Add handlers for the new capabilities in `getCapabilityInfoInternal`

Let me now write the updated SystemToolbox.hs file:
</details>

### 💬 Response

Good, the Base.hs compiles. Now I need to update the SystemToolbox.hs file to handle the new session introspection capabilities. Let me create the updated version:

### 🔧 Tool Calls

- **bash_write-file**

---

## 👤 Step 19: User Turn



---

## 🤖 Step 20: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

The function `sessionFilePath` is not exported from SessionStore. Let me check what's exported and fix this:
</details>

### 💬 Response

I need to check what's exported from SessionStore and use the correct function:

### 🔧 Tool Calls

- **bash_grep-files**

---

## 👤 Step 21: User Turn



---

## 🤖 Step 22: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

The function is not exported. Let me look at the SessionStore module to see what's available and either use a different approach or add an export:
</details>

### 💬 Response

Let me check the SessionStore module exports:

### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 23: User Turn



---

## 🤖 Step 24: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I see - `sessionFilePath` is not exported. I should either:
1. Add it to the exports in SessionStore
2. Use a different approach in SystemToolbox

Let me add it to the exports since it's a useful function that should be available:
</details>

### 💬 Response

I need to add `sessionFilePath` to the exports of SessionStore. Let me update that module:

### 🔧 Tool Calls

- **developer_dev_developer_tools**

---

## 👤 Step 25: User Turn



---

## 🤖 Step 26: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now let me compile again to check if that fixes the issue:
</details>

### 💬 Response

Now let's compile to verify the fix:

### 🔧 Tool Calls

- **bash_check-code**

---

## 👤 Step 27: User Turn



---

## 🤖 Step 28: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I accidentally duplicated exports. Let me look at the current state and fix it:
</details>

### 💬 Response

Let me fix the duplicate exports:

### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 29: User Turn



---

## 🤖 Step 30: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I see the issue - there are duplicated exports. Let me fix this:
</details>

### 💬 Response



### 🔧 Tool Calls

- **bash_write-file**

---

## 👤 Step 31: User Turn



---

## 🤖 Step 32: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

The compilation fails because of unused imports and functions. Let me clean those up.
</details>

### 💬 Response

Let me fix the unused imports and functions in SystemToolbox.hs:

### 🔧 Tool Calls

- **bash_write-file**

---

## 👤 Step 33: User Turn



---

## 🤖 Step 34: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

There's another module that needs updating - ToolRegistration has a `capabilityToText` function that needs to be updated for the new capabilities. Let me fix that:
</details>

### 💬 Response

I need to also update the `capabilityToText` function in ToolRegistration:

### 🔧 Tool Calls

- **bash_grep-files**

---

## 👤 Step 35: User Turn



---

## 🤖 Step 36: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I need to update ToolRegistration to add the new capability cases. Let me read the relevant lines and update them:
</details>

### 💬 Response



### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 37: User Turn



---

## 🤖 Step 38: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I see there's a `capabilityToText` function in ToolRegistration that needs to be updated for the new session introspection capabilities. Let me add the new capabilities:
</details>

### 💬 Response

Now I need to update the `capabilityToText` function to include the new session introspection capabilities:

### 🔧 Tool Calls

- **developer_dev_developer_tools**

---

## 👤 Step 39: User Turn



---

## 🤖 Step 40: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

Now let's compile to verify everything works:
</details>

### 💬 Response

Now let's compile to verify the fix:

### 🔧 Tool Calls

- **bash_check-code**

---

## 👤 Step 41: User Turn



---

## 🤖 Step 42: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I see there's a duplicate type signature. Let me check and remove the duplicate:
</details>

### 💬 Response



### 🔧 Tool Calls

- **bash_read-file**

---

## 👤 Step 43: User Turn



---

## 🤖 Step 44: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

I see the issue - the file has duplicate content now. The function definitions are duplicated. I need to clean this up. Let me look at the exact lines and fix them:
</details>

### 💬 Response

I see there's some duplication. Let me fix the file properly:

### 🔧 Tool Calls

- **bash_write-file**

---

## 👤 Step 45: User Turn



---

## 🤖 Step 46: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

The code compiles successfully. Now let me run the tests to ensure everything works correctly:
</details>

### 💬 Response

The code compiles successfully. Now let's run the tests to make sure everything works:

### 🔧 Tool Calls

- **bash_check-code**

---

## 👤 Step 47: User Turn



---

## 🤖 Step 48: LLM Turn

### 💭 Thinking Process

<details>
<summary>Click to expand reasoning</summary>

All 635 tests pass. The implementation is complete. Let me provide a summary of what was implemented.
</details>

### 💬 Response

All 635 tests pass. Let me provide a summary of the implementation:

## Summary

I have successfully implemented session introspection capabilities for the `SystemToolbox`, enabling agents to query, search, and read other sessions from the session store. Here's what was added:

### 1. New Types in `System.Agents.Base`

**SystemToolCapability** - Added four new capability constructors:
- `SystemToolListSessions` - List accessible sessions
- `SystemToolSearchSessions` - Full-text search across sessions  
- `SystemToolReadSession` - Read session content
- `SystemToolGetSessionStats` - Get session statistics

**SessionIntrospectionScope** - New type for access control:
- `ScopeParentsOnly` - Can only see parent sessions (ancestors)
- `ScopeChildrenOnly` - Can only see child sessions (descendants)
- `ScopeSubtree` - Parents + current + children (default)
- `ScopeAll` - All sessions (requires explicit opt-in)

**Extended SystemToolboxDescription** - Added three optional fields:
- `systemToolboxSessionIntrospectionScope :: Maybe SessionIntrospectionScope`
- `systemToolboxSessionIntrospectionMaxResults :: Maybe Int` (default: 50)
- `systemToolboxSessionIntrospectionIncludeToolOutputs :: Maybe Bool` (default: True)

### 2. Implementation in `System.Agents.Tools.SystemToolbox`

**SessionIntrospectionConfig** - Configuration type for session operations including:
- Session store reference
- Current session ID for scope filtering
- ForkedFrom relationship for lineage tracking
- Scope, limits, and content options

**New trace events** for monitoring session introspection operations.

**Capability handlers** for the four new session introspection capabilities with scope enforcement.

### 3. Updated `System.Agents.ToolRegistration`

Added the new capabilities to `capabilityToText` function for LLM tool description generation.

### 4. Updated `System.Agents.SessionStore`

Exported `sessionFilePath` function for session file path generation.

### Key Features

1. **Backward compatibility**: All new fields in `SystemToolboxDescription` are `Maybe` types with sensible defaults.

2. **Security**: Strict scope enforcement via `SessionIntrospectionScope` to prevent unauthorized access. `ScopeAll` requires explicit opt-in.

3. **Scope Enforcement**:
   - `canAccessSession` function checks if current session can access target session
   - Uses `forkedFromSessionId` field from Session type for lineage tracking
   - Filters sessions based on configured scope

4. **JSON Serialization**: Proper `ToJSON`/`FromJSON` instances for all new types with kebab-case string representations.

### Example Configuration

```json
{
  "tag": "SystemToolbox",
  "contents": {
    "name": "system",
    "description": "System information and session memory",
    "capabilities": [
      "date",
      "hostname",
      "list-sessions",
      "search-sessions", 
      "read-session"
    ],
    "sessionIntrospectionScope": "subtree",
    "sessionIntrospectionMaxResults": 50,
    "sessionIntrospectionIncludeToolOutputs": false
  }
}
```
