Skip to content
Merged

Dev #413

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions mkdocs/docs/core/commands/builtin.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Built-in commands

Every slash command shipped with CraftBot, with its aliases, subcommands, and behavior. All of them work in both [interfaces](../interfaces/index.md). The one marked otherwise says so.
Every slash command shipped with CraftBot, with its aliases, subcommands, and behavior. All of them work in both [interfaces](../interfaces/index.md). The two marked otherwise say so.

At a glance:

| Command | Aliases | What it does |
|---|---|---|
| [`/help [command]`](#help) | `/h`, `/?` | List commands, or detail one |
| [`/clear`](#clear) | `/cls` | Clear the current chat session |
| [`/reset`](#reset) | — | Reset agent state and clear history |
| [`/clear`](#clear) | `/cls` | Clear the chat and action log |
| [`/clear-tasks`](#clear-tasks) | `/cleartasks` | Remove finished tasks from the task panel |
| [`/reset`](#reset) | (none) | Reset agent state and clear history |
| [`/exit`](#exit) | `/quit`, `/q` | Shut down CraftBot |
| [`/menu`](#menu) | | Open the settings menu (browser only) |
| [`/provider [name] [key]`](#provider) | | View or change the LLM provider |
| [`/mcp <subcommand>`](#mcp) | | Manage MCP servers |
| [`/skill <subcommand>`](#skill) | | Manage skills |
| [`/cred <subcommand>`](#cred) | | Credentials and integration status |
| [`/menu`](#menu) | (none) | Open the settings menu (browser only) |
| [`/provider [name] [key]`](#provider) | (none) | View or change the LLM provider |
| [`/mcp <subcommand>`](#mcp) | (none) | Manage MCP servers |
| [`/skill <subcommand>`](#skill) | (none) | Manage skills |
| [`/cred <subcommand>`](#cred) | (none) | Credentials and integration status |
| [`/update [--check]`](#update) | `/upgrade` | Check for and install updates |
| [`/tokens`](#tokens) | | Show this session's token usage |
| [`/tokens`](#tokens) | (none) | Show this session's token usage |

Beyond these, the registry also holds [integration commands](#integration-commands) (`/gmail`, `/slack`, ...) and [skill commands](#skill-commands) (`/pdf`, `/docx`, ...), covered at the end.

Expand All @@ -31,19 +32,23 @@ The leading slash on the argument is optional (`/help mcp` and `/help /mcp` both

## /clear

Clears the conversation of the session it's typed in: the persisted chat messages plus the agent-side session state (event stream, todos, run budgets), so a restart won't resurrect the cleared chat. Other sessions, dashboard data, and the session's lifetime [token counters](#tokens) are unaffected. Use it when one conversation is cluttered. Use [`/reset`](#reset) when the *agent* needs a fresh start.
Clears the chat transcript and the action log in the current interface, and also drops the agent's persisted conversation memory, so a restart won't resurrect the cleared chat. Task history and dashboard data are unaffected. Use it when the conversation is cluttered. Use [`/reset`](#reset) when the *agent* needs a fresh start.

## /clear-tasks

Removes tasks whose status is completed, failed, or cancelled from the task panel, along with their child actions. Running and waiting tasks are preserved, and dashboard usage data and task history are untouched. Requires an action panel, so it's effectively a browser command. In the CLI it reports that no action panel is available.

## /reset

Resets the agent to its initial state: deletes every chat session (a fresh main session is created), clears the action history and conversation context, restores the agent's markdown files in `agent_file_system/` from their templates, rebuilds the memory index, and clears dashboard usage data. Workspace outputs are wiped too, except Living UI projects, which are preserved. Saved settings and credentials are **not** affected. Feedback arrives as system messages while the reset runs in the background.
Resets the agent to its initial state: clears the current task, action history, and conversation context, and wipes the chat view. Saved settings and credentials are **not** affected. Feedback arrives as system messages while the reset runs in the background.

## /exit

Stops the agent cleanly and ends the session. In [service mode](../../start/service-mode.md) the service manager may restart it. Use `python craftbot.py stop` to keep it down.

## /menu

Opens the settings menu. Browser only, and hidden from the `/help` list. In the CLI it points you to `/help` instead. (In practice you'll click **Settings** in the sidebar; the command exists mainly for keyboard-first use.)
Opens the settings menu. Browser only. In the CLI it points you to `/help` instead. (In practice you'll click **Settings** in the sidebar; the command exists mainly for keyboard-first use.)

## /provider

Expand All @@ -55,8 +60,6 @@ View or switch the LLM provider without opening settings.
/provider anthropic sk-ant-... # switch and set the key in one line
```

Bare `/provider` masks the key as its first four and last four characters (`sk-a...abcd`).

Accepted names:

| Name | Provider | Key |
Expand All @@ -72,7 +75,7 @@ Accepted names:
| `openrouter` | OpenRouter | `OPENROUTER_API_KEY` |
| `remote` | Ollama (local) | none |

The change is saved to `settings.json` and the LLM client reinitializes immediately, with no restart — a genuine provider change also resets the per-session model caches, while re-running the command with nothing changed is a no-op. Switching providers clears any model override so the new provider starts on its default model. Model selection, base URLs, and subscription login live in **Settings → Model**; see [LLM providers](../providers/llm.md).
The change is saved to `settings.json` and the LLM reinitializes immediately, with no restart. Model selection, base URLs, and subscription login live in **Settings → Model**; see [LLM providers](../providers/llm.md).

## /mcp

Expand Down Expand Up @@ -105,7 +108,7 @@ Manage [skills](../concepts/skills.md). `/skill` with no arguments prints usage.
|---|---|
| `list [--all]` | List enabled skills; `--all` includes disabled ones |
| `info <name>` | Description, version, author, path, and the skill's actions |
| `enable <name>` / `disable <name>` | Toggle a skill this also registers/unregisters its slash command |
| `enable <name>` / `disable <name>` | Toggle a skill; this also registers/unregisters its slash command |
| `install <path>` | Install from a local directory |
| `install <git-url>` | Install from a GitHub/GitLab URL |
| `create <name> [description]` | Scaffold a new skill |
Expand Down
4 changes: 2 additions & 2 deletions mkdocs/docs/core/commands/cli-anything.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The skill's instructions (`skills/cli-anything/SKILL.md`) contain a routing tabl

6. **Report** in a sentence or two: what was produced and where.

Every step runs as a shell action, so you can watch the whole flow (version checks, installs, the command itself) in the [activity view](../interfaces/browser.md#activity), and it all lands in [logs](../concepts/logs.md).
Every step runs as a shell action, so you can watch the whole flow (version checks, installs, the task command) in the [task panel](../interfaces/browser.md#tasks), and it all lands in [logs](../concepts/logs.md).

The skill hard-bans the failure modes of driving desktop apps directly: no `.exe` suffixes, no hardcoded `C:\Program Files\...` paths, no `&&` command chaining, no raw `soffice`/`gimp`/`blender` invocations. The harness resolves app locations and flags per platform, which is what makes the same task work on all three OSes.

Expand All @@ -73,7 +73,7 @@ CLI-anything is the first choice, not the only one. If a harness command fails a
- **File paths:** give the agent full paths to input files (`C:\Users\you\Desktop\photo.jpg`, `/home/user/photo.jpg`) for the smoothest run.

!!! warning "It installs software"
By design, this skill can install real applications on your machine (silently, with license agreements auto-accepted) and run them with your privileges. Each install is a visible shell action in the activity view, and installs are attempted at most once. If you don't want the agent installing anything, keep the skill disabled or preinstall the apps you care about.
By design, this skill can install real applications on your machine (silently, with license agreements auto-accepted) and run them with your privileges. Each install is a visible shell action in the task panel, and installs are attempted at most once. If you don't want the agent installing anything, keep the skill disabled or preinstall the apps you care about.

## Related

Expand Down
4 changes: 2 additions & 2 deletions mkdocs/docs/core/commands/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commands

Commands are slash-prefixed inputs (`/help`, `/provider anthropic sk-...`, `/skill enable pdf`) that the [UI layer](../interfaces/ui-layer.md) intercepts before anything reaches the agent. They're how you configure providers, integrations, skills, and MCP servers (instantly, without spending tokens or waking the agent) and they work identically in the [browser](../interfaces/browser.md) and the [CLI](../interfaces/cli.md).
Commands are slash-prefixed inputs (`/help`, `/provider anthropic sk-...`, `/skill enable pdf`) that the [UI layer](../interfaces/ui-layer.md) intercepts before anything reaches the agent. They're how you configure providers, integrations, skills, and MCP servers (instantly, without spending tokens or starting a task) and they work identically in the [browser](../interfaces/browser.md) and the [CLI](../interfaces/cli.md).

<div class="grid cards" markdown>

Expand Down Expand Up @@ -32,7 +32,7 @@ The registry is populated from four sources at startup:

| Kind | Examples | Where they come from |
|---|---|---|
| **Built-in** | `/help`, `/provider`, `/mcp`, `/skill`, `/cred`, `/update` | Shipped in `app/ui_layer/commands/builtin/` always present |
| **Built-in** | `/help`, `/provider`, `/mcp`, `/skill`, `/cred`, `/update` | Shipped in `app/ui_layer/commands/builtin/`; always present |
| **Integration** | `/gmail`, `/slack`, `/telegram_bot`, `/notion` | One per available [integration](../../integrations/index.md), each with `connect` / `disconnect` / `status` plus integration-specific subcommands |
| **Skill** | `/pdf`, `/docx`, `/pptx` | One per **enabled** [skill](../concepts/skills.md); registered and unregistered live as you toggle skills |
| **Agent-provided** | varies | Commands the agent runtime registers programmatically, wrapped into the same registry |
Expand Down
14 changes: 7 additions & 7 deletions mkdocs/docs/core/concepts/actions-and-action-sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ An action is a Python function with an `@action` decorator that registers it at
| `description` | What the LLM reads to decide when to pick this action |
| `input_schema` / `output_schema` | Parameter and result contracts, shown to the LLM |
| `action_sets` | Which sets contain this action (an action can be in several) |
| `mode` | Interface visibility which interface contexts offer the action; `"ALL"` means everywhere |
| `mode` | Interface visibility (which interface contexts offer the action); `"ALL"` means everywhere |
| `execution_mode` | `"internal"` (in-process) or `"sandboxed"` (isolated venv) |
| `platforms` | `windows` / `linux` / `darwin` / `all` see platform dispatch below |
| `platforms` | `windows` / `linux` / `darwin` / `all`; see platform dispatch below |
| `requirement` | pip packages the action needs; installed automatically before it runs |
| `parallelizable` | Whether it may run alongside other actions in one turn (`False` for writes, state changes, `send_message`) |
| `irreversible` | Marks side effects that can't be undone once they reach the outside world (send email, post publicly) |
Expand Down Expand Up @@ -58,25 +58,25 @@ When a task starts, one LLM call selects both the [skills](skills.md) and the ac

This compile-once design is deliberate: during execution there is no retrieval step and no searching for tools. The task's vocabulary is a fixed list the router reads directly.

The list can still change, though. Mid-run, the agent can call `list_action_sets`, `add_action_sets`, and `remove_action_sets` (all in `core`, so always available) to expand or trim its own vocabulary when it discovers it needs something. These calls appear in the activity view when a run discovers mid-way that it needs another capability.
The list can still change, though. Mid-task, the agent can call `list_action_sets`, `add_action_sets`, and `remove_action_sets` (all in `core`, so always available) to expand or trim its own vocabulary when it discovers it needs something. These calls appear in the action panel when a task discovers mid-way that it needs another capability.

## Per-turn selection

Every iteration of the [agent loop](agent-loop.md), the router makes **one LLM call** that returns reasoning plus a list of one *or more* actions:

```json
{"reasoning": "...", "actions": [{"action_name": "web_search", "parameters": {...}},
{"action_name": "update_todos", "parameters": {...}}]}
{"action_name": "task_update_todos", "parameters": {...}}]}
```

Rules applied to that list before execution:

- **Parallel execution.** Multiple actions in one decision run concurrently, up to 10 per batch.
- **Non-parallelizable wins alone.** If any selected action has `parallelizable=False`, it runs by itself and the rest are dropped with an error the agent sees next turn.
- **Format errors retry, then abort.** Malformed LLM output gets up to 3 retries with the parse error fed back. After that the run halts rather than wasting tokens.
- **Run-ending actions end the run.** When the only selected actions are a final `send_message` or `end_turn`, the run is over; anything else queues a continuation for the next turn.
- **Format errors retry, then abort.** Malformed LLM output gets up to 3 retries with the parse error fed back. After that the task aborts rather than wasting tokens.
- **Conversation mode is narrow.** Outside a task, the candidates are only `send_message`, `task_start`, `ignore`, plus messaging actions for connected platforms. Real work requires a task.

Each execution logs `action_start` / `action_end` events to the session's [event stream](event-stream.md), which is what the activity view in the browser renders live.
Each execution logs `action_start` / `action_end` events to the task's [event stream](event-stream.md), which is what the action panel in the browser renders live.

## Internal vs sandboxed execution

Expand Down
Loading
Loading