Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07cc816969 | ||
|
|
b0d0914ca0 | ||
|
|
b33334620a | ||
|
|
ebc4fe57d7 | ||
|
|
5909cf36b9 | ||
|
|
e3a97b96d9 | ||
|
|
4942f3af0f | ||
|
|
ad44e32910 | ||
|
|
b0b77aae88 | ||
|
|
007f8c9222 | ||
|
|
dbd5a76cb0 | ||
|
|
630b256aee | ||
|
|
e170bc397d | ||
|
|
d2f033aee5 | ||
|
|
8f12b47b6d | ||
|
|
e8b382e8ed |
No files matched your search
@@ -1,26 +0,0 @@
|
|||||||
# detect-secrets exclusion patterns (regex)
|
|
||||||
#
|
|
||||||
# Note: detect-secrets does not read this file by default. If you want these
|
|
||||||
# applied, wire them into your scan command (e.g. translate to --exclude-files
|
|
||||||
# / --exclude-lines) or into a baseline's filters_used.
|
|
||||||
|
|
||||||
[exclude-files]
|
|
||||||
# pnpm lockfiles contain lots of high-entropy package integrity blobs.
|
|
||||||
pattern = (^|/)pnpm-lock\.yaml$
|
|
||||||
|
|
||||||
[exclude-lines]
|
|
||||||
# Fastlane checks for private key marker; not a real key.
|
|
||||||
pattern = key_content\.include\?\("BEGIN PRIVATE KEY"\)
|
|
||||||
# UI label string for Anthropic auth mode.
|
|
||||||
pattern = case \.apiKeyEnv: "API key \(env var\)"
|
|
||||||
# CodingKeys mapping uses apiKey literal.
|
|
||||||
pattern = case apikey = "apiKey"
|
|
||||||
# Schema labels referencing password fields (not actual secrets).
|
|
||||||
pattern = "gateway\.remote\.password"
|
|
||||||
pattern = "gateway\.auth\.password"
|
|
||||||
# Schema label for talk API key (label text only).
|
|
||||||
pattern = "talk\.apiKey"
|
|
||||||
# checking for typeof is not something we care about.
|
|
||||||
pattern = === "string"
|
|
||||||
# specific optional-chaining password check that didn't match the line above.
|
|
||||||
pattern = typeof remote\?\.password === "string"
|
|
||||||
@@ -74,9 +74,9 @@ jobs:
|
|||||||
- runtime: node
|
- runtime: node
|
||||||
task: protocol
|
task: protocol
|
||||||
command: pnpm protocol:check
|
command: pnpm protocol:check
|
||||||
- runtime: node
|
- runtime: bun
|
||||||
task: format
|
task: lint
|
||||||
command: pnpm format
|
command: bunx biome check src
|
||||||
- runtime: bun
|
- runtime: bun
|
||||||
task: test
|
task: test
|
||||||
command: bunx vitest run
|
command: bunx vitest run
|
||||||
@@ -141,31 +141,6 @@ jobs:
|
|||||||
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
|
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
|
||||||
run: ${{ matrix.command }}
|
run: ${{ matrix.command }}
|
||||||
|
|
||||||
secrets:
|
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: false
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Install detect-secrets
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
python -m pip install detect-secrets==1.5.0
|
|
||||||
|
|
||||||
- name: Detect secrets
|
|
||||||
run: |
|
|
||||||
if ! detect-secrets scan --baseline .secrets.baseline; then
|
|
||||||
echo "::error::Secret scanning failed. See docs/gateway/security.md#secret-scanning-detect-secrets"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
checks-windows:
|
checks-windows:
|
||||||
runs-on: blacksmith-4vcpu-windows-2025
|
runs-on: blacksmith-4vcpu-windows-2025
|
||||||
defaults:
|
defaults:
|
||||||
|
|||||||
@@ -29,5 +29,4 @@ jobs:
|
|||||||
CLAWDBOT_INSTALL_CLI_URL: https://clawd.bot/install-cli.sh
|
CLAWDBOT_INSTALL_CLI_URL: https://clawd.bot/install-cli.sh
|
||||||
CLAWDBOT_NO_ONBOARD: "1"
|
CLAWDBOT_NO_ONBOARD: "1"
|
||||||
CLAWDBOT_INSTALL_SMOKE_SKIP_CLI: "1"
|
CLAWDBOT_INSTALL_SMOKE_SKIP_CLI: "1"
|
||||||
CLAWDBOT_INSTALL_SMOKE_PREVIOUS: "2026.1.11-4"
|
|
||||||
run: pnpm test:install:smoke
|
run: pnpm test:install:smoke
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
||||||
"indentWidth": 2,
|
|
||||||
"printWidth": 100
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/oxlintrc",
|
|
||||||
"extends": ["recommended"]
|
|
||||||
}
|
|
||||||
@@ -1,518 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.5.0",
|
|
||||||
"plugins_used": [
|
|
||||||
{
|
|
||||||
"name": "ArtifactoryDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AWSKeyDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AzureStorageKeyDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Base64HighEntropyString",
|
|
||||||
"limit": 4.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "BasicAuthDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "CloudantDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DiscordBotTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GitHubTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GitLabTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "HexHighEntropyString",
|
|
||||||
"limit": 3.0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "IbmCloudIamDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "IbmCosHmacDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "IPPublicDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "JwtTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "KeywordDetector",
|
|
||||||
"keyword_exclude": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MailchimpDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "NpmDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "OpenAIDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PrivateKeyDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "PypiTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SendGridDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SlackDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SoftlayerDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SquareOAuthDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "StripeDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "TelegramBotTokenDetector"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "TwilioKeyDetector"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"filters_used": [
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.common.is_baseline_file",
|
|
||||||
"filename": ".secrets.baseline"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
|
|
||||||
"min_level": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_lock_file"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_sequential_string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_swagger_file"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.heuristic.is_templated_secret"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.regex.should_exclude_file",
|
|
||||||
"pattern": [
|
|
||||||
"(^|/)pnpm-lock\\.yaml$"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "detect_secrets.filters.regex.should_exclude_line",
|
|
||||||
"pattern": [
|
|
||||||
"key_content\\.include\\?\\(\"BEGIN PRIVATE KEY\"\\)",
|
|
||||||
"case \\.apiKeyEnv: \"API key \\(env var\\)\"",
|
|
||||||
"case apikey = \"apiKey\"",
|
|
||||||
"\"gateway\\.remote\\.password\"",
|
|
||||||
"\"gateway\\.auth\\.password\"",
|
|
||||||
"\"talk\\.apiKey\"",
|
|
||||||
"=== \"string\"",
|
|
||||||
"typeof remote\\?\\.password === \"string\""
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"results": {
|
|
||||||
".env.example": [
|
|
||||||
{
|
|
||||||
"type": "Twilio API Key",
|
|
||||||
"filename": ".env.example",
|
|
||||||
"hashed_secret": "3c7206eff845bc69cf12d904d0f95f9aec15535e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"appcast.xml": [
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "appcast.xml",
|
|
||||||
"hashed_secret": "1b1c2b73eca84e441a823c37a06c71c9fadcfe24",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 19
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "appcast.xml",
|
|
||||||
"hashed_secret": "5c47736fee5151b26b3bb61bb38955da0e8937c6",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 35
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "appcast.xml",
|
|
||||||
"hashed_secret": "bbbca47179268f154c63affa0ca441c6e49e650f",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 52
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"apps/macos/Tests/ClawdbotIPCTests/AnthropicAuthResolverTests.swift": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "apps/macos/Tests/ClawdbotIPCTests/AnthropicAuthResolverTests.swift",
|
|
||||||
"hashed_secret": "e761624445731fcb8b15da94343c6b92e507d190",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 26
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "apps/macos/Tests/ClawdbotIPCTests/AnthropicAuthResolverTests.swift",
|
|
||||||
"hashed_secret": "a23c8630c8a5fbaa21f095e0269c135c20d21689",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 42
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"apps/macos/Tests/ClawdbotIPCTests/ConnectionsSettingsSmokeTests.swift": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "apps/macos/Tests/ClawdbotIPCTests/ConnectionsSettingsSmokeTests.swift",
|
|
||||||
"hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 83
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"apps/macos/Tests/ClawdbotIPCTests/TailscaleIntegrationSectionTests.swift": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "apps/macos/Tests/ClawdbotIPCTests/TailscaleIntegrationSectionTests.swift",
|
|
||||||
"hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 27
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/configuration.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 268
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "1188d5a8ed7edcff5144a9472af960243eacf12e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 465
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "22af290a1a3d5e941193a41a3d3a9e4ca8da5e27",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 718
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "16c249e04e2be318050cb883c40137361c0c7209",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 760
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "c1e6ee547fd492df1441ac492e8bb294974712bd",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 859
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/configuration.md",
|
|
||||||
"hashed_secret": "45d676e7c6ab44cf4b8fa366ef2d8fccd3e6d6e6",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 982
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/faq.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/faq.md",
|
|
||||||
"hashed_secret": "a219d7693c25cd2d93313512e200ff3eb374d281",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 593
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/faq.md",
|
|
||||||
"hashed_secret": "ec3810e10fb78db55ce38b9c18d1c3eb1db739e0",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 650
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/skills-config.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/skills-config.md",
|
|
||||||
"hashed_secret": "c1e6ee547fd492df1441ac492e8bb294974712bd",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 28
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/skills.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/skills.md",
|
|
||||||
"hashed_secret": "c1e6ee547fd492df1441ac492e8bb294974712bd",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 97
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/tailscale.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/tailscale.md",
|
|
||||||
"hashed_secret": "9cb0dc5383312aa15b9dc6745645bde18ff5ade9",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 52
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/talk.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/talk.md",
|
|
||||||
"hashed_secret": "1188d5a8ed7edcff5144a9472af960243eacf12e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 50
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"docs/telegram.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "docs/telegram.md",
|
|
||||||
"hashed_secret": "e9fe51f94eadabf54dbf2fbbd57188b9abee436e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 57
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"skills/local-places/SERVER_README.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "skills/local-places/SERVER_README.md",
|
|
||||||
"hashed_secret": "6d9c68c603e465077bdd49c62347fe54717f83a3",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 28
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"skills/openai-whisper-api/SKILL.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "skills/openai-whisper-api/SKILL.md",
|
|
||||||
"hashed_secret": "1077361f94d70e1ddcc7c6dc581a489532a81d03",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 39
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"skills/trello/SKILL.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "skills/trello/SKILL.md",
|
|
||||||
"hashed_secret": "11fa7c37d697f30e6aee828b4426a10f83ab2380",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 18
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/agents/models-config.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/models-config.test.ts",
|
|
||||||
"hashed_secret": "7cf31e8b6cda49f70c31f1f25af05d46f924142d",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 25
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/models-config.test.ts",
|
|
||||||
"hashed_secret": "3a81eb091f80c845232225be5663d270e90dacb7",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 90
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/agents/skills.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/skills.test.ts",
|
|
||||||
"hashed_secret": "3acfb2c2b433c0ea7ff107e33df91b18e52f960f",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 158
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/skills.test.ts",
|
|
||||||
"hashed_secret": "7a85f4764bbd6daf1c3545efbbf0f279a6dc0beb",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 265
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/skills.test.ts",
|
|
||||||
"hashed_secret": "5df3a673d724e8a1eb673a8baf623e183940804d",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 462
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/agents/skills.test.ts",
|
|
||||||
"hashed_secret": "8921daaa546693e52bc1f9c40bdcf15e816e0448",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 490
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/browser/target-id.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Hex High Entropy String",
|
|
||||||
"filename": "src/browser/target-id.test.ts",
|
|
||||||
"hashed_secret": "4e126c049580d66ca1549fa534d95a7263f27f46",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 16
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/commands/antigravity-oauth.ts": [
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "src/commands/antigravity-oauth.ts",
|
|
||||||
"hashed_secret": "709d0f232b6ac4f8d24dec3e4fabfdb14257174f",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 17
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "src/commands/antigravity-oauth.ts",
|
|
||||||
"hashed_secret": "3848603b8e866f62d07c206ff622279b9dcb0238",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 20
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/commands/onboard-auth.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/commands/onboard-auth.ts",
|
|
||||||
"hashed_secret": "16c249e04e2be318050cb883c40137361c0c7209",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 50
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/config/config.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/config/config.test.ts",
|
|
||||||
"hashed_secret": "bea2f7b64fab8d1d414d0449530b1e088d36d5b1",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 520
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/gateway/server.auth.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/gateway/server.auth.test.ts",
|
|
||||||
"hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 89
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/gateway/server.auth.test.ts",
|
|
||||||
"hashed_secret": "a4b48a81cdab1e1a5dd37907d6c85ca1c61ddc7c",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 109
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/infra/env.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/infra/env.test.ts",
|
|
||||||
"hashed_secret": "df98a117ddabf85991b9fe0e268214dc0e1254dc",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/infra/env.test.ts",
|
|
||||||
"hashed_secret": "6d811dc1f59a55ca1a3d38b5042a062b9f79e8ec",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 25
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/infra/shell-env.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/infra/shell-env.test.ts",
|
|
||||||
"hashed_secret": "65c10dc3549fe07424148a8a4790a3341ecbc253",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 35
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "src/infra/shell-env.test.ts",
|
|
||||||
"hashed_secret": "64db6bf7f0e5a0491df4419f0eb1bbcc402989e8",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 56
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "src/infra/shell-env.test.ts",
|
|
||||||
"hashed_secret": "e013ffda590d2178607c16d11b1ea42f75ceb0e7",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 73
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Base64 High Entropy String",
|
|
||||||
"filename": "src/infra/shell-env.test.ts",
|
|
||||||
"hashed_secret": "be6ee9a6bf9f2dad84a5a67d6c0576a5bacc391e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 75
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"src/web/qr-image.test.ts": [
|
|
||||||
{
|
|
||||||
"type": "Hex High Entropy String",
|
|
||||||
"filename": "src/web/qr-image.test.ts",
|
|
||||||
"hashed_secret": "564666dc1ca6e7318b2d5feeb1ce7b5bf717411e",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 12
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"vendor/a2ui/README.md": [
|
|
||||||
{
|
|
||||||
"type": "Secret Keyword",
|
|
||||||
"filename": "vendor/a2ui/README.md",
|
|
||||||
"hashed_secret": "2619a5397a5d054dab3fe24e6a8da1fbd76ec3a6",
|
|
||||||
"is_verified": false,
|
|
||||||
"line_number": 123
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"generated_at": "2026-01-05T13:01:00Z"
|
|
||||||
}
|
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
- Run CLI in dev: `pnpm clawdbot ...` (bun) or `pnpm dev`.
|
- Run CLI in dev: `pnpm clawdbot ...` (bun) or `pnpm dev`.
|
||||||
- Node remains supported for running built output (`dist/*`) and production installs.
|
- Node remains supported for running built output (`dist/*`) and production installs.
|
||||||
- Type-check/build: `pnpm build` (tsc)
|
- Type-check/build: `pnpm build` (tsc)
|
||||||
- Lint/format: `pnpm lint` (oxlint), `pnpm format` (oxfmt)
|
- Lint/format: `pnpm lint` (biome check), `pnpm format` (biome format)
|
||||||
- Tests: `pnpm test` (vitest); coverage: `pnpm test:coverage`
|
- Tests: `pnpm test` (vitest); coverage: `pnpm test:coverage`
|
||||||
|
|
||||||
## Coding Style & Naming Conventions
|
## Coding Style & Naming Conventions
|
||||||
- Language: TypeScript (ESM). Prefer strict typing; avoid `any`.
|
- Language: TypeScript (ESM). Prefer strict typing; avoid `any`.
|
||||||
- Formatting/linting via Oxlint and Oxfmt; run `pnpm lint` before commits.
|
- Formatting/linting via Biome; run `pnpm lint` before commits.
|
||||||
- Add brief code comments for tricky or non-obvious logic.
|
- Add brief code comments for tricky or non-obvious logic.
|
||||||
- Keep files concise; extract helpers instead of “V2” copies. Use existing patterns for CLI options and dependency injection via `createDefaultDeps`.
|
- Keep files concise; extract helpers instead of “V2” copies. Use existing patterns for CLI options and dependency injection via `createDefaultDeps`.
|
||||||
- Aim to keep files under ~700 LOC; guideline only (not a hard guardrail). Split/refactor when it improves clarity or testability.
|
- Aim to keep files under ~700 LOC; guideline only (not a hard guardrail). Split/refactor when it improves clarity or testability.
|
||||||
@@ -76,7 +76,6 @@
|
|||||||
- Vocabulary: "makeup" = "mac app".
|
- Vocabulary: "makeup" = "mac app".
|
||||||
- When answering questions, respond with high-confidence answers only: verify in code; do not guess.
|
- When answering questions, respond with high-confidence answers only: verify in code; do not guess.
|
||||||
- Never update the Carbon dependency.
|
- Never update the Carbon dependency.
|
||||||
- Any dependency with `pnpm.patchedDependencies` must use an exact version (no `^`/`~`).
|
|
||||||
- CLI progress: use `src/cli/progress.ts` (`osc-progress` + `@clack/prompts` spinner); don’t hand-roll spinners/bars.
|
- CLI progress: use `src/cli/progress.ts` (`osc-progress` + `@clack/prompts` spinner); don’t hand-roll spinners/bars.
|
||||||
- Status output: keep tables + ANSI-safe wrapping (`src/terminal/table.ts`); `status --all` = read-only/pasteable, `status --deep` = probes.
|
- Status output: keep tables + ANSI-safe wrapping (`src/terminal/table.ts`); `status --all` = read-only/pasteable, `status --deep` = probes.
|
||||||
- Gateway currently runs only as the menubar app; there is no separate LaunchAgent/helper label installed. Restart via the Clawdbot Mac app or `scripts/restart-mac.sh`; to verify/kill use `launchctl print gui/$UID | grep clawdbot` rather than assuming a fixed label. **When debugging on macOS, start/stop the gateway via the app, not ad-hoc tmux sessions; kill any temporary tunnels before handoff.**
|
- Gateway currently runs only as the menubar app; there is no separate LaunchAgent/helper label installed. Restart via the Clawdbot Mac app or `scripts/restart-mac.sh`; to verify/kill use `launchctl print gui/$UID | grep clawdbot` rather than assuming a fixed label. **When debugging on macOS, start/stop the gateway via the app, not ad-hoc tmux sessions; kill any temporary tunnels before handoff.**
|
||||||
|
|||||||
+26
-115
@@ -1,132 +1,43 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 2026.1.14 (unreleased)
|
## 2025.1.12 (Unreleased)
|
||||||
|
|
||||||
### Changes
|
|
||||||
- Docs: clarify per-agent auth stores, sandboxed skill binaries, and elevated semantics.
|
|
||||||
- Daemon: support profile-aware service names for multi-gateway setups. (#671) — thanks @bjesuiter.
|
|
||||||
- Docs: add FAQ entries for missing provider auth after adding agents and Gemini thinking signature errors.
|
|
||||||
- Agents: add optional auth-profile copy prompt on `agents add` and improve auth error messaging.
|
|
||||||
- Security: add `clawdbot security audit` (`--deep`, `--fix`) and surface it in `status --all` and `doctor`.
|
|
||||||
- Security: add `clawdbot security audit` (`--deep`, `--fix`) and surface it in `status --all` and `doctor` (includes browser control exposure checks).
|
|
||||||
- Plugins: add Zalo channel plugin with gateway HTTP hooks and onboarding install prompt. (#854) — thanks @longmaba.
|
|
||||||
- Onboarding: add a security checkpoint prompt (docs link + sandboxing hint); require `--accept-risk` for `--non-interactive`.
|
|
||||||
- Docs: expand gateway security hardening guidance and incident response checklist.
|
|
||||||
- Docs: document DM history limits for channel DMs. (#883) — thanks @pkrmf.
|
|
||||||
- Security: add detect-secrets CI scan and baseline guidance. (#227) — thanks @Hyaxia.
|
|
||||||
- Tools: add `web_search`/`web_fetch` (Brave API), auto-enable `web_fetch` for sandboxed sessions, and remove the `brave-search` skill.
|
|
||||||
- CLI/Docs: add a web tools configure section for storing Brave API keys and update onboarding tips.
|
|
||||||
- Browser: add Chrome extension relay takeover mode (toolbar button), plus `clawdbot browser extension install/path` and remote browser control via `clawdbot browser serve` + `browser.controlToken`.
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
- Browser: add tests for snapshot labels/efficient query params and labeled image responses.
|
|
||||||
- Google: downgrade unsigned thinking blocks before send to avoid missing signature errors.
|
|
||||||
- Agents: cap tool call IDs for OpenAI/OpenRouter to avoid request rejections. (#875) — thanks @j1philli.
|
|
||||||
- Doctor: avoid re-adding WhatsApp config when only legacy ack reactions are set. (#927, fixes #900) — thanks @grp06.
|
|
||||||
- Agents: scrub tuple `items` schemas for Gemini tool calls. (#926, fixes #746) — thanks @grp06.
|
|
||||||
- Agents: stabilize sub-agent announce status from runtime outcomes and normalize Result/Notes. (#835) — thanks @roshanasingh4.
|
|
||||||
- Embedded runner: suppress raw API error payloads from replies. (#924) — thanks @grp06.
|
|
||||||
- Auth: normalize Claude Code CLI profile mode to oauth and auto-migrate config. (#855) — thanks @sebslight.
|
|
||||||
- Daemon: clear persisted launchd disabled state before bootstrap (fixes `daemon install` after uninstall). (#849) — thanks @ndraiman.
|
|
||||||
- Logging: tolerate `EIO` from console writes to avoid gateway crashes. (#925, fixes #878) — thanks @grp06.
|
|
||||||
- Sandbox: restore `docker.binds` config validation for custom bind mounts. (#873) — thanks @akonyer.
|
|
||||||
- Sandbox: preserve configured PATH for `docker exec` so custom tools remain available. (#873) — thanks @akonyer.
|
|
||||||
- Slack: respect `channels.slack.requireMention` default when resolving channel mention gating. (#850) — thanks @evalexpr.
|
|
||||||
- Telegram: aggregate split inbound messages into one prompt (reduces “one reply per fragment”).
|
|
||||||
- Auto-reply: treat trailing `NO_REPLY` tokens as silent replies.
|
|
||||||
- Config: prevent partial config writes from clobbering unrelated settings (base hash guard + merge patch for connection saves).
|
|
||||||
|
|
||||||
## 2026.1.14
|
|
||||||
|
|
||||||
### Changes
|
|
||||||
- Usage: add MiniMax coding plan usage tracking.
|
|
||||||
- Auth: label Claude Code CLI auth options. (#915) — thanks @SeanZoR.
|
|
||||||
- Docs: standardize Claude Code CLI naming across docs and prompts. (follow-up to #915)
|
|
||||||
- Telegram: add message delete action in the message tool. (#903) — thanks @sleontenko.
|
|
||||||
- Config: add `channels.<provider>.configWrites` gating for channel-initiated config writes; migrate Slack channel IDs.
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
- Mac: pass auth token/password to dashboard URL for authenticated access. (#918) — thanks @rahthakor.
|
|
||||||
- UI: use application-defined WebSocket close code (browser compatibility). (#918) — thanks @rahthakor.
|
|
||||||
- TUI: render picker overlays via the overlay stack so /models and /settings display. (#921) — thanks @grizzdank.
|
|
||||||
- TUI: add a bright spinner + elapsed time in the status line for send/stream/run states.
|
|
||||||
- Gateway/Dev: ensure `pnpm gateway:dev` always uses the dev profile config + state (`~/.clawdbot-dev`).
|
|
||||||
- macOS: fix cron preview/testing payload to use `channel` key. (#867) — thanks @wes-davis.
|
|
||||||
- Telegram: honor `channels.telegram.timeoutSeconds` for grammY API requests. (#863) — thanks @Snaver.
|
|
||||||
- Telegram: split long captions into media + follow-up text messages. (#907) - thanks @jalehman.
|
|
||||||
- Telegram: migrate group config when supergroups change chat IDs. (#906) — thanks @sleontenko.
|
|
||||||
- Messaging: unify markdown formatting + format-first chunking for Slack/Telegram/Signal. (#920) — thanks @TheSethRose.
|
|
||||||
- Slack: drop Socket Mode events with mismatched `api_app_id`/`team_id`. (#889) — thanks @roshanasingh4.
|
|
||||||
- Discord: isolate autoThread thread context. (#856) — thanks @davidguttman.
|
|
||||||
- WhatsApp: fix context isolation using wrong ID (was bot's number, now conversation ID). (#911) — thanks @tristanmanchester.
|
|
||||||
- WhatsApp: normalize user JIDs with device suffix for allowlist checks in groups. (#838) — thanks @peschee.
|
|
||||||
|
|
||||||
## 2026.1.13
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
- Postinstall: treat already-applied pnpm patches as no-ops to avoid npm/bun install failures.
|
|
||||||
- Packaging: pin `@mariozechner/pi-ai` to 0.45.7 and refresh patched dependency to match npm resolution.
|
|
||||||
|
|
||||||
## 2026.1.12-2
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
- Packaging: include `dist/memory/**` in the npm tarball (fixes `ERR_MODULE_NOT_FOUND` for `dist/memory/index.js`).
|
|
||||||
- Agents: persist sub-agent registry across gateway restarts and resume announce flow safely. (#831) — thanks @roshanasingh4.
|
|
||||||
|
|
||||||
## 2026.1.12-1
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
- Packaging: include `dist/channels/**` in the npm tarball (fixes `ERR_MODULE_NOT_FOUND` for `dist/channels/registry.js`).
|
|
||||||
|
|
||||||
## 2026.1.12
|
|
||||||
|
|
||||||
### Highlights
|
### Highlights
|
||||||
- **BREAKING:** rename chat “providers” (Slack/Telegram/WhatsApp/…) to **channels** across CLI/RPC/config; legacy config keys auto-migrate on load (and are written back as `channels.*`).
|
|
||||||
- Memory: add vector search for agent memories (Markdown-only) with SQLite index, chunking, lazy sync + file watch, and per-agent enablement/fallback.
|
- Memory: add vector search for agent memories (Markdown-only) with SQLite index, chunking, lazy sync + file watch, and per-agent enablement/fallback.
|
||||||
- Plugins: restore full voice-call plugin parity (Telnyx/Twilio, streaming, inbound policies, tools/CLI).
|
- Plugins: restore full voice-call plugin parity (Telnyx/Twilio, streaming, inbound policies, tools/CLI).
|
||||||
- Models: add Synthetic provider plus Moonshot Kimi K2 0905 + turbo/thinking variants (with docs). (#811) — thanks @siraht; (#818) — thanks @mickahouan.
|
- Models: add Synthetic provider plus Moonshot Kimi K2 0905 + turbo/thinking variants (with docs).
|
||||||
- Cron: one-shot schedules accept ISO timestamps (UTC) with optional delete-after-run; cron jobs can target a specific agent (CLI + macOS/Control UI).
|
- Cron: one-shot schedules accept ISO timestamps (UTC) with optional delete-after-run; cron jobs can target a specific agent (CLI + macOS/Control UI).
|
||||||
- Agents: add compaction mode config with optional safeguard summarization and per-agent model fallbacks. (#700) — thanks @thewilloftheshadow; (#583) — thanks @mitschabaude-bot.
|
- Agents: add compaction mode config with optional safeguard summarization and per-agent model fallbacks.
|
||||||
|
|
||||||
### New & Improved
|
### New & Improved
|
||||||
- Memory: add custom OpenAI-compatible embedding endpoints; support OpenAI/local `node-llama-cpp` embeddings with per-agent overrides and provider metadata in tools/CLI. (#819) — thanks @mukhtharcm.
|
- Memory: add custom OpenAI-compatible embedding endpoints; support OpenAI/local `node-llama-cpp` embeddings with per-agent overrides and provider metadata in tools/CLI.
|
||||||
- Memory: new `clawdbot memory` CLI plus `memory_search`/`memory_get` tools with snippets + line ranges; index stored under `~/.clawdbot/memory/{agentId}.sqlite` with watch-on-by-default.
|
- Memory: new `clawdbot memory` CLI plus `memory_search`/`memory_get` tools with snippets + line ranges; index stored under `~/.clawdbot/memory/{agentId}.sqlite` with watch-on-by-default.
|
||||||
- Agents: strengthen memory recall guidance; make workspace bootstrap truncation configurable (default 20k) with warnings; add default sub-agent model config.
|
- Agents: strengthen memory recall guidance; make workspace bootstrap truncation configurable (default 20k) with warnings; add default sub-agent model config.
|
||||||
- Tools/Sandbox: add tool profiles + group shorthands; support tool-policy groups in `tools.sandbox.tools`; drop legacy `memory` shorthand; allow Docker bind mounts via `docker.binds`. (#790) — thanks @akonyer.
|
- Tools/Sandbox: add tool profiles + group shorthands; support tool-policy groups in `tools.sandbox.tools`; drop legacy `memory` shorthand; allow Docker bind mounts via `docker.binds`.
|
||||||
- Tools: add provider/model-specific tool policy overrides (`tools.byProvider`) to trim tool exposure per provider.
|
- Tools: add browser `scrollintoview` action; allow Claude/Gemini tool param aliases; allow thinking `xhigh` for GPT-5.2/Codex with safe downgrades.
|
||||||
- Tools: add browser `scrollintoview` action; allow Claude/Gemini tool param aliases; allow thinking `xhigh` for GPT-5.2/Codex with safe downgrades. (#793) — thanks @hsrvc; (#444) — thanks @grp06.
|
- Gateway/CLI: add Tailscale binary discovery, custom bind mode, and probe auth retry; add `clawdbot dashboard` auto-open flow; default native slash commands to `"auto"` with per-provider overrides.
|
||||||
- Gateway/CLI: add Tailscale binary discovery, custom bind mode, and probe auth retry; add `clawdbot dashboard` auto-open flow; default native slash commands to `"auto"` with per-provider overrides. (#740) — thanks @jeffersonwarrior.
|
- Auth/Onboarding: add Chutes OAuth (PKCE + refresh + onboarding choice); normalize API key inputs; default TUI onboarding to `deliver: false`.
|
||||||
- Auth/Onboarding: add Chutes OAuth (PKCE + refresh + onboarding choice); normalize API key inputs; default TUI onboarding to `deliver: false`. (#726) — thanks @FrieSei; (#791) — thanks @roshanasingh4.
|
- Providers: add `discord.allowBots`; trim legacy MiniMax M2 from default catalogs; route MiniMax vision to the Coding Plan VLM endpoint (also accepts `@/path/to/file.png` inputs).
|
||||||
- Providers: add `discord.allowBots`; trim legacy MiniMax M2 from default catalogs; route MiniMax vision to the Coding Plan VLM endpoint (also accepts `@/path/to/file.png` inputs). (#802) — thanks @zknicker.
|
- Gateway: allow Tailscale Serve identity headers to satisfy token auth; rebuild Control UI assets when protocol schema is newer.
|
||||||
- Gateway: allow Tailscale Serve identity headers to satisfy token auth; rebuild Control UI assets when protocol schema is newer. (#823) — thanks @roshanasingh4; (#786) — thanks @meaningfool.
|
|
||||||
- Heartbeat: default `ackMaxChars` to 300 so short `HEARTBEAT_OK` replies stay internal.
|
- Heartbeat: default `ackMaxChars` to 300 so short `HEARTBEAT_OK` replies stay internal.
|
||||||
|
|
||||||
### Installer
|
|
||||||
- Install: run `clawdbot doctor --non-interactive` after git installs/updates and nudge daemon restarts when detected.
|
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Doctor: warn on pnpm workspace mismatches, missing Control UI assets, and missing tsx binaries; offer UI rebuilds.
|
- Models/Providers: treat credential validation failures as auth errors to trigger fallback; normalize `${ENV_VAR}` apiKey values and auto-fill missing provider keys; preserve explicit GitHub Copilot provider config + agent-dir auth profiles.
|
||||||
- Tools: apply global tool allow/deny even when agent-specific tool policy is set.
|
- Gemini: normalize Gemini 3 ids to preview variants; strip Gemini CLI tool call/response ids; downgrade missing `thought_signature`; strip Claude `msg_*` thought_signature fields to avoid base64 decode errors.
|
||||||
- Models/Providers: treat credential validation failures as auth errors to trigger fallback; normalize `${ENV_VAR}` apiKey values and auto-fill missing provider keys; preserve explicit GitHub Copilot provider config + agent-dir auth profiles. (#822) — thanks @sebslight; (#705) — thanks @TAGOOZ.
|
- MiniMax: strip malformed tool invocation XML; include `MiniMax-VL-01` in implicit provider for image pairing.
|
||||||
- Auth: drop invalid auth profiles from ordering so environment keys can still be used for providers like MiniMax.
|
- Anthropic: merge consecutive user turns (preserve newest metadata) before validation to avoid incorrect role errors.
|
||||||
- Gemini: normalize Gemini 3 ids to preview variants; strip Gemini CLI tool call/response ids; downgrade missing `thought_signature`; strip Claude `msg_*` thought_signature fields to avoid base64 decode errors. (#795) — thanks @thewilloftheshadow; (#783) — thanks @ananth-vardhan-cn; (#793) — thanks @hsrvc; (#805) — thanks @marcmarg.
|
- Messaging: enforce context isolation for message tool sends; keep typing indicators alive during tool execution.
|
||||||
- Agents: auto-recover from compaction context overflow by resetting the session and retrying; propagate overflow details from embedded runs so callers can recover.
|
- Auto-reply: `/status` allowlist behavior, reasoning-tag enforcement on fallback, and system-event enqueueing for elevated/reasoning toggles.
|
||||||
- MiniMax: strip malformed tool invocation XML; include `MiniMax-VL-01` in implicit provider for image pairing. (#809) — thanks @latitudeki5223.
|
- Auto-reply: explain how to enable `/bash` when it’s disabled; add security notes + FAQ. (#722) — thanks @vrknetha.
|
||||||
- Onboarding/Auth: honor `CLAWDBOT_AGENT_DIR` / `PI_CODING_AGENT_DIR` when writing auth profiles (MiniMax). (#829) — thanks @roshanasingh4.
|
|
||||||
- Anthropic: handle `overloaded_error` with a friendly message and failover classification. (#832) — thanks @danielz1z.
|
|
||||||
- Anthropic: merge consecutive user turns (preserve newest metadata) before validation to avoid incorrect role errors. (#804) — thanks @ThomsenDrake.
|
|
||||||
- Messaging: enforce context isolation for message tool sends; keep typing indicators alive during tool execution. (#793) — thanks @hsrvc; (#450, #447) — thanks @thewilloftheshadow.
|
|
||||||
- Auto-reply: `/status` allowlist behavior, reasoning-tag enforcement on fallback, and system-event enqueueing for elevated/reasoning toggles. (#810) — thanks @mcinteerj.
|
|
||||||
- System events: include local timestamps when events are injected into prompts. (#245) — thanks @thewilloftheshadow.
|
|
||||||
- Auto-reply: resolve ambiguous `/model` matches; fix streaming block reply media handling; keep >300 char heartbeat replies instead of dropping.
|
- Auto-reply: resolve ambiguous `/model` matches; fix streaming block reply media handling; keep >300 char heartbeat replies instead of dropping.
|
||||||
- Discord/Slack: centralize reply-thread planning; fix autoThread routing + add per-channel autoThread; avoid duplicate listeners; keep reasoning italics intact; allow clearing channel parents via message tool. (#800, #807) — thanks @davidguttman; (#744) — thanks @thewilloftheshadow.
|
- Discord/Slack: centralize reply-thread planning; fix autoThread routing + add per-channel autoThread; avoid duplicate listeners; keep reasoning italics intact; allow clearing channel parents via message tool.
|
||||||
- Telegram: preserve forum topic thread ids, persist polling offsets, respect account bindings in webhook mode, and show typing indicator in General topics. (#727, #739) — thanks @thewilloftheshadow; (#821) — thanks @gumadeiras; (#779) — thanks @azade-c.
|
- Telegram: preserve forum topic thread ids, persist polling offsets, respect account bindings in webhook mode, and show typing indicator in General topics.
|
||||||
- Slack: accept slash commands with or without leading `/` for custom command configs. (#798) — thanks @thewilloftheshadow.
|
- Slack: accept slash commands with or without leading `/` for custom command configs.
|
||||||
- Cron: persist disabled jobs correctly; accept `jobId` aliases for update/run/remove params. (#205, #252) — thanks @thewilloftheshadow.
|
- Cron: persist disabled jobs correctly; accept `jobId` aliases for update/run/remove params.
|
||||||
- Gateway/CLI: honor `CLAWDBOT_LAUNCHD_LABEL` / `CLAWDBOT_SYSTEMD_UNIT` overrides; `agents.list` respects explicit config; reduce noisy loopback WS logs during tests; run `clawdbot doctor --non-interactive` during updates. (#781) — thanks @ronyrus.
|
- Gateway/CLI: honor `CLAWDBOT_LAUNCHD_LABEL` / `CLAWDBOT_SYSTEMD_UNIT` overrides; `agents.list` respects explicit config; reduce noisy loopback WS logs during tests; run `clawdbot doctor --non-interactive` during updates.
|
||||||
- Onboarding/Control UI: refuse invalid configs (run doctor first); quote Windows browser URLs for OAuth; keep chat scroll position unless the user is near the bottom. (#764) — thanks @mukhtharcm; (#794) — thanks @roshanasingh4; (#217) — thanks @thewilloftheshadow.
|
- Onboarding/Control UI: refuse invalid configs (run doctor first); quote Windows browser URLs for OAuth; keep chat scroll position unless the user is near the bottom.
|
||||||
- Tools/UI: harden tool input schemas for strict providers; drop null-only union variants for Gemini schema cleanup; treat `maxChars: 0` as unlimited; keep TUI last streamed response instead of "(no output)". (#782) — thanks @AbhisekBasu1; (#796) — thanks @gabriel-trigo; (#747) — thanks @thewilloftheshadow.
|
- Tools/UI: harden tool input schemas for strict providers; drop null-only union variants for Gemini schema cleanup; treat `maxChars: 0` as unlimited; keep TUI last streamed response instead of "(no output)".
|
||||||
- Connections UI: polish multi-account account cards. (#816) — thanks @steipete.
|
- Connections UI: polish multi-account account cards.
|
||||||
|
|
||||||
### Maintenance
|
### Maintenance
|
||||||
- Dependencies: bump Pi packages to 0.45.3 and refresh patched pi-ai.
|
- Dependencies: bump Pi packages to 0.45.3 and refresh patched pi-ai.
|
||||||
@@ -372,7 +283,7 @@
|
|||||||
- Dependencies: Pi 0.40.0 bump (#543) — thanks @mcinteerj.
|
- Dependencies: Pi 0.40.0 bump (#543) — thanks @mcinteerj.
|
||||||
- Build: Docker build cache layer (#605) — thanks @zknicker.
|
- Build: Docker build cache layer (#605) — thanks @zknicker.
|
||||||
|
|
||||||
- Auth: enable OAuth token refresh for Claude Code CLI credentials (`anthropic:claude-cli`) with bidirectional sync back to Claude Code storage (file on Linux/Windows, Keychain on macOS). This allows long-running agents to operate autonomously without manual re-authentication (#654 — thanks @radek-paclt).
|
- Auth: enable OAuth token refresh for Claude CLI credentials (`anthropic:claude-cli`) with bidirectional sync back to Claude Code storage (file on Linux/Windows, Keychain on macOS). This allows long-running agents to operate autonomously without manual re-authentication (#654 — thanks @radek-paclt).
|
||||||
|
|
||||||
## 2026.1.8
|
## 2026.1.8
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ Welcome to the lobster tank! 🦞
|
|||||||
- GitHub: [@steipete](https://github.com/steipete) · X: [@steipete](https://x.com/steipete)
|
- GitHub: [@steipete](https://github.com/steipete) · X: [@steipete](https://x.com/steipete)
|
||||||
|
|
||||||
- **Shadow** - Discord + Slack subsystem
|
- **Shadow** - Discord + Slack subsystem
|
||||||
- GitHub: [@thewilloftheshadow](https://github.com/thewilloftheshadow) · X: [@4shad0wed](https://x.com/4shad0wed)
|
- GitHub: [@4shadowed](https://github.com/4shadowed) · X: [@4shad0wed](https://x.com/4shad0wed)
|
||||||
|
|
||||||
- **Jos** - Telegram, API, Nix mode
|
- **Jos** - Telegram, API, Nix mode
|
||||||
- GitHub: [@joshp123](https://github.com/joshp123) · X: [@jjpcodes](https://x.com/jjpcodes)
|
- GitHub: [@joshp123](https://github.com/joshp123) · X: [@jjpcodes](https://x.com/jjpcodes)
|
||||||
|
|||||||
+1
-1
Submodule Peekaboo updated: 95ad7532c1...c1243a7978.
@@ -16,13 +16,13 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
**Clawdbot** is a *personal AI assistant* you run on your own devices.
|
**Clawdbot** is a *personal AI assistant* you run on your own devices.
|
||||||
It answers you on the channels you already use (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, WebChat), can speak and listen on macOS/iOS/Android, and can render a live Canvas you control. The Gateway is just the control plane — the product is the assistant.
|
It answers you on the providers you already use (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, WebChat), can speak and listen on macOS/iOS/Android, and can render a live Canvas you control. The Gateway is just the control plane — the product is the assistant.
|
||||||
|
|
||||||
If you want a personal, single-user assistant that feels local, fast, and always-on, this is it.
|
If you want a personal, single-user assistant that feels local, fast, and always-on, this is it.
|
||||||
|
|
||||||
[Website](https://clawdbot.com) · [Docs](https://docs.clawd.bot) · [Getting Started](https://docs.clawd.bot/start/getting-started) · [Updating](https://docs.clawd.bot/install/updating) · [Showcase](https://docs.clawd.bot/start/showcase) · [FAQ](https://docs.clawd.bot/start/faq) · [Wizard](https://docs.clawd.bot/start/wizard) · [Nix](https://github.com/clawdbot/nix-clawdbot) · [Docker](https://docs.clawd.bot/install/docker) · [Discord](https://discord.gg/clawd)
|
[Website](https://clawdbot.com) · [Docs](https://docs.clawd.bot) · [Getting Started](https://docs.clawd.bot/start/getting-started) · [Updating](https://docs.clawd.bot/install/updating) · [Showcase](https://docs.clawd.bot/start/showcase) · [FAQ](https://docs.clawd.bot/start/faq) · [Wizard](https://docs.clawd.bot/start/wizard) · [Nix](https://github.com/clawdbot/nix-clawdbot) · [Docker](https://docs.clawd.bot/install/docker) · [Discord](https://discord.gg/clawd)
|
||||||
|
|
||||||
Preferred setup: run the onboarding wizard (`clawdbot onboard`). It walks through gateway, workspace, channels, and skills. The CLI wizard is the recommended path and works on **macOS, Linux, and Windows (via WSL2; strongly recommended)**.
|
Preferred setup: run the onboarding wizard (`clawdbot onboard`). It walks through gateway, workspace, providers, and skills. The CLI wizard is the recommended path and works on **macOS, Linux, and Windows (via WSL2; strongly recommended)**.
|
||||||
Works with npm, pnpm, or bun.
|
Works with npm, pnpm, or bun.
|
||||||
New install? Start here: [Getting started](https://docs.clawd.bot/start/getting-started)
|
New install? Start here: [Getting started](https://docs.clawd.bot/start/getting-started)
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ The wizard installs the Gateway daemon (launchd/systemd user service) so it stay
|
|||||||
|
|
||||||
Runtime: **Node ≥22**.
|
Runtime: **Node ≥22**.
|
||||||
|
|
||||||
Full beginner guide (auth, pairing, channels): [Getting started](https://docs.clawd.bot/start/getting-started)
|
Full beginner guide (auth, pairing, providers): [Getting started](https://docs.clawd.bot/start/getting-started)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot onboard --install-daemon
|
clawdbot onboard --install-daemon
|
||||||
@@ -97,17 +97,17 @@ Clawdbot connects to real messaging surfaces. Treat inbound DMs as **untrusted i
|
|||||||
Full security guide: [Security](https://docs.clawd.bot/gateway/security)
|
Full security guide: [Security](https://docs.clawd.bot/gateway/security)
|
||||||
|
|
||||||
Default behavior on Telegram/WhatsApp/Signal/iMessage/Microsoft Teams/Discord/Slack:
|
Default behavior on Telegram/WhatsApp/Signal/iMessage/Microsoft Teams/Discord/Slack:
|
||||||
- **DM pairing** (`dmPolicy="pairing"` / `channels.discord.dm.policy="pairing"` / `channels.slack.dm.policy="pairing"`): unknown senders receive a short pairing code and the bot does not process their message.
|
- **DM pairing** (`dmPolicy="pairing"` / `discord.dm.policy="pairing"` / `slack.dm.policy="pairing"`): unknown senders receive a short pairing code and the bot does not process their message.
|
||||||
- Approve with: `clawdbot pairing approve <channel> <code>` (then the sender is added to a local allowlist store).
|
- Approve with: `clawdbot pairing approve <provider> <code>` (then the sender is added to a local allowlist store).
|
||||||
- Public inbound DMs require an explicit opt-in: set `dmPolicy="open"` and include `"*"` in the channel allowlist (`allowFrom` / `channels.discord.dm.allowFrom` / `channels.slack.dm.allowFrom`).
|
- Public inbound DMs require an explicit opt-in: set `dmPolicy="open"` and include `"*"` in the provider allowlist (`allowFrom` / `discord.dm.allowFrom` / `slack.dm.allowFrom`).
|
||||||
|
|
||||||
Run `clawdbot doctor` to surface risky/misconfigured DM policies.
|
Run `clawdbot doctor` to surface risky/misconfigured DM policies.
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
- **[Local-first Gateway](https://docs.clawd.bot/gateway)** — single control plane for sessions, channels, tools, and events.
|
- **[Local-first Gateway](https://docs.clawd.bot/gateway)** — single control plane for sessions, providers, tools, and events.
|
||||||
- **[Multi-channel inbox](https://docs.clawd.bot/channels)** — WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, WebChat, macOS, iOS/Android.
|
- **[Multi-provider inbox](https://docs.clawd.bot/providers)** — WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, WebChat, macOS, iOS/Android.
|
||||||
- **[Multi-agent routing](https://docs.clawd.bot/gateway/configuration)** — route inbound channels/accounts/peers to isolated agents (workspaces + per-agent sessions).
|
- **[Multi-agent routing](https://docs.clawd.bot/gateway/configuration)** — route inbound providers/accounts/peers to isolated agents (workspaces + per-agent sessions).
|
||||||
- **[Voice Wake](https://docs.clawd.bot/nodes/voicewake) + [Talk Mode](https://docs.clawd.bot/nodes/talk)** — always-on speech for macOS/iOS/Android with ElevenLabs.
|
- **[Voice Wake](https://docs.clawd.bot/nodes/voicewake) + [Talk Mode](https://docs.clawd.bot/nodes/talk)** — always-on speech for macOS/iOS/Android with ElevenLabs.
|
||||||
- **[Live Canvas](https://docs.clawd.bot/platforms/mac/canvas)** — agent-driven visual workspace with [A2UI](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui).
|
- **[Live Canvas](https://docs.clawd.bot/platforms/mac/canvas)** — agent-driven visual workspace with [A2UI](https://docs.clawd.bot/platforms/mac/canvas#canvas-a2ui).
|
||||||
- **[First-class tools](https://docs.clawd.bot/tools)** — browser, canvas, nodes, cron, sessions, and Discord/Slack actions.
|
- **[First-class tools](https://docs.clawd.bot/tools)** — browser, canvas, nodes, cron, sessions, and Discord/Slack actions.
|
||||||
@@ -127,9 +127,9 @@ Run `clawdbot doctor` to surface risky/misconfigured DM policies.
|
|||||||
- [Session model](https://docs.clawd.bot/concepts/session): `main` for direct chats, group isolation, activation modes, queue modes, reply-back. Group rules: [Groups](https://docs.clawd.bot/concepts/groups).
|
- [Session model](https://docs.clawd.bot/concepts/session): `main` for direct chats, group isolation, activation modes, queue modes, reply-back. Group rules: [Groups](https://docs.clawd.bot/concepts/groups).
|
||||||
- [Media pipeline](https://docs.clawd.bot/nodes/images): images/audio/video, transcription hooks, size caps, temp file lifecycle. Audio details: [Audio](https://docs.clawd.bot/nodes/audio).
|
- [Media pipeline](https://docs.clawd.bot/nodes/images): images/audio/video, transcription hooks, size caps, temp file lifecycle. Audio details: [Audio](https://docs.clawd.bot/nodes/audio).
|
||||||
|
|
||||||
### Channels
|
### Providers
|
||||||
- [Channels](https://docs.clawd.bot/channels): [WhatsApp](https://docs.clawd.bot/channels/whatsapp) (Baileys), [Telegram](https://docs.clawd.bot/channels/telegram) (grammY), [Slack](https://docs.clawd.bot/channels/slack) (Bolt), [Discord](https://docs.clawd.bot/channels/discord) (discord.js), [Signal](https://docs.clawd.bot/channels/signal) (signal-cli), [iMessage](https://docs.clawd.bot/channels/imessage) (imsg), [Microsoft Teams](https://docs.clawd.bot/channels/msteams) (Bot Framework), [WebChat](https://docs.clawd.bot/web/webchat).
|
- [Providers](https://docs.clawd.bot/providers): [WhatsApp](https://docs.clawd.bot/providers/whatsapp) (Baileys), [Telegram](https://docs.clawd.bot/providers/telegram) (grammY), [Slack](https://docs.clawd.bot/providers/slack) (Bolt), [Discord](https://docs.clawd.bot/providers/discord) (discord.js), [Signal](https://docs.clawd.bot/providers/signal) (signal-cli), [iMessage](https://docs.clawd.bot/providers/imessage) (imsg), [Microsoft Teams](https://docs.clawd.bot/providers/msteams) (Bot Framework), [WebChat](https://docs.clawd.bot/web/webchat).
|
||||||
- [Group routing](https://docs.clawd.bot/concepts/group-messages): mention gating, reply tags, per-channel chunking and routing. Channel rules: [Channels](https://docs.clawd.bot/channels).
|
- [Group routing](https://docs.clawd.bot/concepts/group-messages): mention gating, reply tags, per-provider chunking and routing. Provider rules: [Providers](https://docs.clawd.bot/providers).
|
||||||
|
|
||||||
### Apps + nodes
|
### Apps + nodes
|
||||||
- [macOS app](https://docs.clawd.bot/platforms/macos): menu bar control plane, [Voice Wake](https://docs.clawd.bot/nodes/voicewake)/PTT, [Talk Mode](https://docs.clawd.bot/nodes/talk) overlay, [WebChat](https://docs.clawd.bot/web/webchat), debug tools, [remote gateway](https://docs.clawd.bot/gateway/remote) control.
|
- [macOS app](https://docs.clawd.bot/platforms/macos): menu bar control plane, [Voice Wake](https://docs.clawd.bot/nodes/voicewake)/PTT, [Talk Mode](https://docs.clawd.bot/nodes/talk) overlay, [WebChat](https://docs.clawd.bot/web/webchat), debug tools, [remote gateway](https://docs.clawd.bot/gateway/remote) control.
|
||||||
@@ -145,10 +145,10 @@ Run `clawdbot doctor` to surface risky/misconfigured DM policies.
|
|||||||
- [Skills platform](https://docs.clawd.bot/tools/skills): bundled, managed, and workspace skills with install gating + UI.
|
- [Skills platform](https://docs.clawd.bot/tools/skills): bundled, managed, and workspace skills with install gating + UI.
|
||||||
|
|
||||||
### Runtime + safety
|
### Runtime + safety
|
||||||
- [Channel routing](https://docs.clawd.bot/concepts/channel-routing), [retry policy](https://docs.clawd.bot/concepts/retry), and [streaming/chunking](https://docs.clawd.bot/concepts/streaming).
|
- [Provider routing](https://docs.clawd.bot/concepts/provider-routing), [retry policy](https://docs.clawd.bot/concepts/retry), and [streaming/chunking](https://docs.clawd.bot/concepts/streaming).
|
||||||
- [Presence](https://docs.clawd.bot/concepts/presence), [typing indicators](https://docs.clawd.bot/concepts/typing-indicators), and [usage tracking](https://docs.clawd.bot/concepts/usage-tracking).
|
- [Presence](https://docs.clawd.bot/concepts/presence), [typing indicators](https://docs.clawd.bot/concepts/typing-indicators), and [usage tracking](https://docs.clawd.bot/concepts/usage-tracking).
|
||||||
- [Models](https://docs.clawd.bot/concepts/models), [model failover](https://docs.clawd.bot/concepts/model-failover), and [session pruning](https://docs.clawd.bot/concepts/session-pruning).
|
- [Models](https://docs.clawd.bot/concepts/models), [model failover](https://docs.clawd.bot/concepts/model-failover), and [session pruning](https://docs.clawd.bot/concepts/session-pruning).
|
||||||
- [Security](https://docs.clawd.bot/gateway/security) and [troubleshooting](https://docs.clawd.bot/channels/troubleshooting).
|
- [Security](https://docs.clawd.bot/gateway/security) and [troubleshooting](https://docs.clawd.bot/providers/troubleshooting).
|
||||||
|
|
||||||
### Ops + packaging
|
### Ops + packaging
|
||||||
- [Control UI](https://docs.clawd.bot/web) + [WebChat](https://docs.clawd.bot/web/webchat) served directly from the Gateway.
|
- [Control UI](https://docs.clawd.bot/web) + [WebChat](https://docs.clawd.bot/web/webchat) served directly from the Gateway.
|
||||||
@@ -204,7 +204,7 @@ Details: [Tailscale guide](https://docs.clawd.bot/gateway/tailscale) · [Web sur
|
|||||||
|
|
||||||
It’s perfectly fine to run the Gateway on a small Linux instance. Clients (macOS app, CLI, WebChat) can connect over **Tailscale Serve/Funnel** or **SSH tunnels**, and you can still pair device nodes (macOS/iOS/Android) to execute device‑local actions when needed.
|
It’s perfectly fine to run the Gateway on a small Linux instance. Clients (macOS app, CLI, WebChat) can connect over **Tailscale Serve/Funnel** or **SSH tunnels**, and you can still pair device nodes (macOS/iOS/Android) to execute device‑local actions when needed.
|
||||||
|
|
||||||
- **Gateway host** runs the exec tool and channel connections by default.
|
- **Gateway host** runs the exec tool and provider connections by default.
|
||||||
- **Device nodes** run device‑local actions (`system.run`, camera, screen recording, notifications) via `node.invoke`.
|
- **Device nodes** run device‑local actions (`system.run`, camera, screen recording, notifications) via `node.invoke`.
|
||||||
In short: exec runs where the Gateway lives; device actions run where the device lives.
|
In short: exec runs where the Gateway lives; device actions run where the device lives.
|
||||||
|
|
||||||
@@ -315,56 +315,52 @@ Minimal `~/.clawdbot/clawdbot.json` (model + defaults):
|
|||||||
|
|
||||||
Details: [Security guide](https://docs.clawd.bot/gateway/security) · [Docker + sandboxing](https://docs.clawd.bot/install/docker) · [Sandbox config](https://docs.clawd.bot/gateway/configuration)
|
Details: [Security guide](https://docs.clawd.bot/gateway/security) · [Docker + sandboxing](https://docs.clawd.bot/install/docker) · [Sandbox config](https://docs.clawd.bot/gateway/configuration)
|
||||||
|
|
||||||
### [WhatsApp](https://docs.clawd.bot/channels/whatsapp)
|
### [WhatsApp](https://docs.clawd.bot/providers/whatsapp)
|
||||||
|
|
||||||
- Link the device: `pnpm clawdbot channels login` (stores creds in `~/.clawdbot/credentials`).
|
- Link the device: `pnpm clawdbot providers login` (stores creds in `~/.clawdbot/credentials`).
|
||||||
- Allowlist who can talk to the assistant via `channels.whatsapp.allowFrom`.
|
- Allowlist who can talk to the assistant via `whatsapp.allowFrom`.
|
||||||
- If `channels.whatsapp.groups` is set, it becomes a group allowlist; include `"*"` to allow all.
|
- If `whatsapp.groups` is set, it becomes a group allowlist; include `"*"` to allow all.
|
||||||
|
|
||||||
### [Telegram](https://docs.clawd.bot/channels/telegram)
|
### [Telegram](https://docs.clawd.bot/providers/telegram)
|
||||||
|
|
||||||
- Set `TELEGRAM_BOT_TOKEN` or `channels.telegram.botToken` (env wins).
|
- Set `TELEGRAM_BOT_TOKEN` or `telegram.botToken` (env wins).
|
||||||
- Optional: set `channels.telegram.groups` (with `channels.telegram.groups."*".requireMention`); when set, it is a group allowlist (include `"*"` to allow all). Also `channels.telegram.allowFrom` or `channels.telegram.webhookUrl` as needed.
|
- Optional: set `telegram.groups` (with `telegram.groups."*".requireMention`); when set, it is a group allowlist (include `"*"` to allow all). Also `telegram.allowFrom` or `telegram.webhookUrl` as needed.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
telegram: {
|
telegram: {
|
||||||
botToken: "123456:ABCDEF"
|
botToken: "123456:ABCDEF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Slack](https://docs.clawd.bot/channels/slack)
|
### [Slack](https://docs.clawd.bot/providers/slack)
|
||||||
|
|
||||||
- Set `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN` (or `channels.slack.botToken` + `channels.slack.appToken`).
|
- Set `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN` (or `slack.botToken` + `slack.appToken`).
|
||||||
|
|
||||||
### [Discord](https://docs.clawd.bot/channels/discord)
|
### [Discord](https://docs.clawd.bot/providers/discord)
|
||||||
|
|
||||||
- Set `DISCORD_BOT_TOKEN` or `channels.discord.token` (env wins).
|
- Set `DISCORD_BOT_TOKEN` or `discord.token` (env wins).
|
||||||
- Optional: set `commands.native`, `commands.text`, or `commands.useAccessGroups`, plus `channels.discord.dm.allowFrom`, `channels.discord.guilds`, or `channels.discord.mediaMaxMb` as needed.
|
- Optional: set `commands.native`, `commands.text`, or `commands.useAccessGroups`, plus `discord.dm.allowFrom`, `discord.guilds`, or `discord.mediaMaxMb` as needed.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
discord: {
|
discord: {
|
||||||
token: "1234abcd"
|
token: "1234abcd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Signal](https://docs.clawd.bot/channels/signal)
|
### [Signal](https://docs.clawd.bot/providers/signal)
|
||||||
|
|
||||||
- Requires `signal-cli` and a `channels.signal` config section.
|
- Requires `signal-cli` and a `signal` config section.
|
||||||
|
|
||||||
### [iMessage](https://docs.clawd.bot/channels/imessage)
|
### [iMessage](https://docs.clawd.bot/providers/imessage)
|
||||||
|
|
||||||
- macOS only; Messages must be signed in.
|
- macOS only; Messages must be signed in.
|
||||||
- If `channels.imessage.groups` is set, it becomes a group allowlist; include `"*"` to allow all.
|
- If `imessage.groups` is set, it becomes a group allowlist; include `"*"` to allow all.
|
||||||
|
|
||||||
### [Microsoft Teams](https://docs.clawd.bot/channels/msteams)
|
### [Microsoft Teams](https://docs.clawd.bot/providers/msteams)
|
||||||
|
|
||||||
- Configure a Teams app + Bot Framework, then add a `msteams` config section.
|
- Configure a Teams app + Bot Framework, then add a `msteams` config section.
|
||||||
- Allowlist who can talk via `msteams.allowFrom`; group access via `msteams.groupAllowFrom` or `msteams.groupPolicy: "open"`.
|
- Allowlist who can talk via `msteams.allowFrom`; group access via `msteams.groupAllowFrom` or `msteams.groupPolicy: "open"`.
|
||||||
@@ -399,7 +395,7 @@ Use these when you’re past the onboarding flow and want the deeper reference.
|
|||||||
- [Set up Gmail Pub/Sub triggers.](https://docs.clawd.bot/automation/gmail-pubsub)
|
- [Set up Gmail Pub/Sub triggers.](https://docs.clawd.bot/automation/gmail-pubsub)
|
||||||
- [Learn the macOS menu bar companion details.](https://docs.clawd.bot/platforms/mac/menu-bar)
|
- [Learn the macOS menu bar companion details.](https://docs.clawd.bot/platforms/mac/menu-bar)
|
||||||
- [Platform guides: Windows (WSL2)](https://docs.clawd.bot/platforms/windows), [Linux](https://docs.clawd.bot/platforms/linux), [macOS](https://docs.clawd.bot/platforms/macos), [iOS](https://docs.clawd.bot/platforms/ios), [Android](https://docs.clawd.bot/platforms/android)
|
- [Platform guides: Windows (WSL2)](https://docs.clawd.bot/platforms/windows), [Linux](https://docs.clawd.bot/platforms/linux), [macOS](https://docs.clawd.bot/platforms/macos), [iOS](https://docs.clawd.bot/platforms/ios), [Android](https://docs.clawd.bot/platforms/android)
|
||||||
- [Debug common failures with the troubleshooting guide.](https://docs.clawd.bot/channels/troubleshooting)
|
- [Debug common failures with the troubleshooting guide.](https://docs.clawd.bot/providers/troubleshooting)
|
||||||
- [Review security guidance before exposing anything.](https://docs.clawd.bot/gateway/security)
|
- [Review security guidance before exposing anything.](https://docs.clawd.bot/gateway/security)
|
||||||
|
|
||||||
## Advanced docs (discovery + control)
|
## Advanced docs (discovery + control)
|
||||||
@@ -472,21 +468,20 @@ Thanks to all clawtributors:
|
|||||||
|
|
||||||
<p align="left">
|
<p align="left">
|
||||||
<a href="https://github.com/steipete"><img src="https://avatars.githubusercontent.com/u/58493?v=4&s=48" width="48" height="48" alt="steipete" title="steipete"/></a> <a href="https://github.com/joaohlisboa"><img src="https://avatars.githubusercontent.com/u/8200873?v=4&s=48" width="48" height="48" alt="joaohlisboa" title="joaohlisboa"/></a> <a href="https://github.com/mneves75"><img src="https://avatars.githubusercontent.com/u/2423436?v=4&s=48" width="48" height="48" alt="mneves75" title="mneves75"/></a> <a href="https://github.com/rahthakor"><img src="https://avatars.githubusercontent.com/u/8470553?v=4&s=48" width="48" height="48" alt="rahthakor" title="rahthakor"/></a> <a href="https://github.com/joshp123"><img src="https://avatars.githubusercontent.com/u/1497361?v=4&s=48" width="48" height="48" alt="joshp123" title="joshp123"/></a> <a href="https://github.com/mukhtharcm"><img src="https://avatars.githubusercontent.com/u/56378562?v=4&s=48" width="48" height="48" alt="mukhtharcm" title="mukhtharcm"/></a> <a href="https://github.com/maxsumrall"><img src="https://avatars.githubusercontent.com/u/628843?v=4&s=48" width="48" height="48" alt="maxsumrall" title="maxsumrall"/></a> <a href="https://github.com/xadenryan"><img src="https://avatars.githubusercontent.com/u/165437834?v=4&s=48" width="48" height="48" alt="xadenryan" title="xadenryan"/></a> <a href="https://github.com/tobiasbischoff"><img src="https://avatars.githubusercontent.com/u/711564?v=4&s=48" width="48" height="48" alt="Tobias Bischoff" title="Tobias Bischoff"/></a> <a href="https://github.com/hsrvc"><img src="https://avatars.githubusercontent.com/u/129702169?v=4&s=48" width="48" height="48" alt="hsrvc" title="hsrvc"/></a>
|
<a href="https://github.com/steipete"><img src="https://avatars.githubusercontent.com/u/58493?v=4&s=48" width="48" height="48" alt="steipete" title="steipete"/></a> <a href="https://github.com/joaohlisboa"><img src="https://avatars.githubusercontent.com/u/8200873?v=4&s=48" width="48" height="48" alt="joaohlisboa" title="joaohlisboa"/></a> <a href="https://github.com/mneves75"><img src="https://avatars.githubusercontent.com/u/2423436?v=4&s=48" width="48" height="48" alt="mneves75" title="mneves75"/></a> <a href="https://github.com/rahthakor"><img src="https://avatars.githubusercontent.com/u/8470553?v=4&s=48" width="48" height="48" alt="rahthakor" title="rahthakor"/></a> <a href="https://github.com/joshp123"><img src="https://avatars.githubusercontent.com/u/1497361?v=4&s=48" width="48" height="48" alt="joshp123" title="joshp123"/></a> <a href="https://github.com/mukhtharcm"><img src="https://avatars.githubusercontent.com/u/56378562?v=4&s=48" width="48" height="48" alt="mukhtharcm" title="mukhtharcm"/></a> <a href="https://github.com/maxsumrall"><img src="https://avatars.githubusercontent.com/u/628843?v=4&s=48" width="48" height="48" alt="maxsumrall" title="maxsumrall"/></a> <a href="https://github.com/xadenryan"><img src="https://avatars.githubusercontent.com/u/165437834?v=4&s=48" width="48" height="48" alt="xadenryan" title="xadenryan"/></a> <a href="https://github.com/tobiasbischoff"><img src="https://avatars.githubusercontent.com/u/711564?v=4&s=48" width="48" height="48" alt="Tobias Bischoff" title="Tobias Bischoff"/></a> <a href="https://github.com/hsrvc"><img src="https://avatars.githubusercontent.com/u/129702169?v=4&s=48" width="48" height="48" alt="hsrvc" title="hsrvc"/></a>
|
||||||
<a href="https://github.com/magimetal"><img src="https://avatars.githubusercontent.com/u/36491250?v=4&s=48" width="48" height="48" alt="magimetal" title="magimetal"/></a> <a href="https://github.com/meaningfool"><img src="https://avatars.githubusercontent.com/u/2862331?v=4&s=48" width="48" height="48" alt="meaningfool" title="meaningfool"/></a> <a href="https://github.com/NicholasSpisak"><img src="https://avatars.githubusercontent.com/u/129075147?v=4&s=48" width="48" height="48" alt="NicholasSpisak" title="NicholasSpisak"/></a> <a href="https://github.com/AbhisekBasu1"><img src="https://avatars.githubusercontent.com/u/40645221?v=4&s=48" width="48" height="48" alt="abhisekbasu1" title="abhisekbasu1"/></a> <a href="https://github.com/claude"><img src="https://avatars.githubusercontent.com/u/81847?v=4&s=48" width="48" height="48" alt="claude" title="claude"/></a> <a href="https://github.com/jamesgroat"><img src="https://avatars.githubusercontent.com/u/2634024?v=4&s=48" width="48" height="48" alt="jamesgroat" title="jamesgroat"/></a> <a href="https://github.com/dantelex"><img src="https://avatars.githubusercontent.com/u/631543?v=4&s=48" width="48" height="48" alt="dantelex" title="dantelex"/></a> <a href="https://github.com/daveonkels"><img src="https://avatars.githubusercontent.com/u/533642?v=4&s=48" width="48" height="48" alt="daveonkels" title="daveonkels"/></a> <a href="https://github.com/vrknetha"><img src="https://avatars.githubusercontent.com/u/20596261?v=4&s=48" width="48" height="48" alt="vrknetha" title="vrknetha"/></a> <a href="https://github.com/radek-paclt"><img src="https://avatars.githubusercontent.com/u/50451445?v=4&s=48" width="48" height="48" alt="radek-paclt" title="radek-paclt"/></a>
|
<a href="https://github.com/magimetal"><img src="https://avatars.githubusercontent.com/u/36491250?v=4&s=48" width="48" height="48" alt="magimetal" title="magimetal"/></a> <a href="https://github.com/NicholasSpisak"><img src="https://avatars.githubusercontent.com/u/129075147?v=4&s=48" width="48" height="48" alt="NicholasSpisak" title="NicholasSpisak"/></a> <a href="https://github.com/AbhisekBasu1"><img src="https://avatars.githubusercontent.com/u/40645221?v=4&s=48" width="48" height="48" alt="abhisekbasu1" title="abhisekbasu1"/></a> <a href="https://github.com/claude"><img src="https://avatars.githubusercontent.com/u/81847?v=4&s=48" width="48" height="48" alt="claude" title="claude"/></a> <a href="https://github.com/jamesgroat"><img src="https://avatars.githubusercontent.com/u/2634024?v=4&s=48" width="48" height="48" alt="jamesgroat" title="jamesgroat"/></a> <a href="https://github.com/dantelex"><img src="https://avatars.githubusercontent.com/u/631543?v=4&s=48" width="48" height="48" alt="dantelex" title="dantelex"/></a> <a href="https://github.com/daveonkels"><img src="https://avatars.githubusercontent.com/u/533642?v=4&s=48" width="48" height="48" alt="daveonkels" title="daveonkels"/></a> <a href="https://github.com/radek-paclt"><img src="https://avatars.githubusercontent.com/u/50451445?v=4&s=48" width="48" height="48" alt="radek-paclt" title="radek-paclt"/></a> <a href="https://github.com/jeffersonwarrior"><img src="https://avatars.githubusercontent.com/u/89030989?v=4&s=48" width="48" height="48" alt="jeffersonwarrior" title="jeffersonwarrior"/></a> <a href="https://github.com/mteam88"><img src="https://avatars.githubusercontent.com/u/84196639?v=4&s=48" width="48" height="48" alt="mteam88" title="mteam88"/></a>
|
||||||
<a href="https://github.com/mteam88"><img src="https://avatars.githubusercontent.com/u/84196639?v=4&s=48" width="48" height="48" alt="mteam88" title="mteam88"/></a> <a href="https://github.com/omniwired"><img src="https://avatars.githubusercontent.com/u/322761?v=4&s=48" width="48" height="48" alt="Eng. Juan Combetto" title="Eng. Juan Combetto"/></a> <a href="https://github.com/dbhurley"><img src="https://avatars.githubusercontent.com/u/5251425?v=4&s=48" width="48" height="48" alt="dbhurley" title="dbhurley"/></a> <a href="https://github.com/mbelinky"><img src="https://avatars.githubusercontent.com/u/132747814?v=4&s=48" width="48" height="48" alt="Mariano Belinky" title="Mariano Belinky"/></a> <a href="https://github.com/julianengel"><img src="https://avatars.githubusercontent.com/u/10634231?v=4&s=48" width="48" height="48" alt="julianengel" title="julianengel"/></a> <a href="https://github.com/benithors"><img src="https://avatars.githubusercontent.com/u/20652882?v=4&s=48" width="48" height="48" alt="benithors" title="benithors"/></a> <a href="https://github.com/sreekaransrinath"><img src="https://avatars.githubusercontent.com/u/50989977?v=4&s=48" width="48" height="48" alt="sreekaransrinath" title="sreekaransrinath"/></a> <a href="https://github.com/gupsammy"><img src="https://avatars.githubusercontent.com/u/20296019?v=4&s=48" width="48" height="48" alt="gupsammy" title="gupsammy"/></a> <a href="https://github.com/cristip73"><img src="https://avatars.githubusercontent.com/u/24499421?v=4&s=48" width="48" height="48" alt="cristip73" title="cristip73"/></a> <a href="https://github.com/nachoiacovino"><img src="https://avatars.githubusercontent.com/u/50103937?v=4&s=48" width="48" height="48" alt="nachoiacovino" title="nachoiacovino"/></a>
|
<a href="https://github.com/omniwired"><img src="https://avatars.githubusercontent.com/u/322761?v=4&s=48" width="48" height="48" alt="Eng. Juan Combetto" title="Eng. Juan Combetto"/></a> <a href="https://github.com/dbhurley"><img src="https://avatars.githubusercontent.com/u/5251425?v=4&s=48" width="48" height="48" alt="dbhurley" title="dbhurley"/></a> <a href="https://github.com/mbelinky"><img src="https://avatars.githubusercontent.com/u/132747814?v=4&s=48" width="48" height="48" alt="Mariano Belinky" title="Mariano Belinky"/></a> <a href="https://github.com/julianengel"><img src="https://avatars.githubusercontent.com/u/10634231?v=4&s=48" width="48" height="48" alt="julianengel" title="julianengel"/></a> <a href="https://github.com/benithors"><img src="https://avatars.githubusercontent.com/u/20652882?v=4&s=48" width="48" height="48" alt="benithors" title="benithors"/></a> <a href="https://github.com/sreekaransrinath"><img src="https://avatars.githubusercontent.com/u/50989977?v=4&s=48" width="48" height="48" alt="sreekaransrinath" title="sreekaransrinath"/></a> <a href="https://github.com/gupsammy"><img src="https://avatars.githubusercontent.com/u/20296019?v=4&s=48" width="48" height="48" alt="gupsammy" title="gupsammy"/></a> <a href="https://github.com/cristip73"><img src="https://avatars.githubusercontent.com/u/24499421?v=4&s=48" width="48" height="48" alt="cristip73" title="cristip73"/></a> <a href="https://github.com/nachoiacovino"><img src="https://avatars.githubusercontent.com/u/50103937?v=4&s=48" width="48" height="48" alt="nachoiacovino" title="nachoiacovino"/></a> <a href="https://github.com/vsabavat"><img src="https://avatars.githubusercontent.com/u/50385532?v=4&s=48" width="48" height="48" alt="Vasanth Rao Naik Sabavat" title="Vasanth Rao Naik Sabavat"/></a>
|
||||||
<a href="https://github.com/vsabavat"><img src="https://avatars.githubusercontent.com/u/50385532?v=4&s=48" width="48" height="48" alt="Vasanth Rao Naik Sabavat" title="Vasanth Rao Naik Sabavat"/></a> <a href="https://github.com/lc0rp"><img src="https://avatars.githubusercontent.com/u/2609441?v=4&s=48" width="48" height="48" alt="lc0rp" title="lc0rp"/></a> <a href="https://github.com/scald"><img src="https://avatars.githubusercontent.com/u/1215913?v=4&s=48" width="48" height="48" alt="scald" title="scald"/></a> <a href="https://github.com/andranik-sahakyan"><img src="https://avatars.githubusercontent.com/u/8908029?v=4&s=48" width="48" height="48" alt="andranik-sahakyan" title="andranik-sahakyan"/></a> <a href="https://github.com/Nachx639"><img src="https://avatars.githubusercontent.com/u/71144023?v=4&s=48" width="48" height="48" alt="nachx639" title="nachx639"/></a> <a href="https://github.com/davidguttman"><img src="https://avatars.githubusercontent.com/u/431696?v=4&s=48" width="48" height="48" alt="davidguttman" title="davidguttman"/></a> <a href="https://github.com/sircrumpet"><img src="https://avatars.githubusercontent.com/u/4436535?v=4&s=48" width="48" height="48" alt="sircrumpet" title="sircrumpet"/></a> <a href="https://github.com/peschee"><img src="https://avatars.githubusercontent.com/u/63866?v=4&s=48" width="48" height="48" alt="peschee" title="peschee"/></a> <a href="https://github.com/ratulsarna"><img src="https://avatars.githubusercontent.com/u/105903728?v=4&s=48" width="48" height="48" alt="ratulsarna" title="ratulsarna"/></a> <a href="https://github.com/lutr0"><img src="https://avatars.githubusercontent.com/u/76906369?v=4&s=48" width="48" height="48" alt="lutr0" title="lutr0"/></a>
|
<a href="https://github.com/lc0rp"><img src="https://avatars.githubusercontent.com/u/2609441?v=4&s=48" width="48" height="48" alt="lc0rp" title="lc0rp"/></a> <a href="https://github.com/scald"><img src="https://avatars.githubusercontent.com/u/1215913?v=4&s=48" width="48" height="48" alt="scald" title="scald"/></a> <a href="https://github.com/andranik-sahakyan"><img src="https://avatars.githubusercontent.com/u/8908029?v=4&s=48" width="48" height="48" alt="andranik-sahakyan" title="andranik-sahakyan"/></a> <a href="https://github.com/Nachx639"><img src="https://avatars.githubusercontent.com/u/71144023?v=4&s=48" width="48" height="48" alt="nachx639" title="nachx639"/></a> <a href="https://github.com/davidguttman"><img src="https://avatars.githubusercontent.com/u/431696?v=4&s=48" width="48" height="48" alt="davidguttman" title="davidguttman"/></a> <a href="https://github.com/sircrumpet"><img src="https://avatars.githubusercontent.com/u/4436535?v=4&s=48" width="48" height="48" alt="sircrumpet" title="sircrumpet"/></a> <a href="https://github.com/peschee"><img src="https://avatars.githubusercontent.com/u/63866?v=4&s=48" width="48" height="48" alt="peschee" title="peschee"/></a> <a href="https://github.com/rafaelreis-r"><img src="https://avatars.githubusercontent.com/u/57492577?v=4&s=48" width="48" height="48" alt="rafaelreis-r" title="rafaelreis-r"/></a> <a href="https://github.com/meaningfool"><img src="https://avatars.githubusercontent.com/u/2862331?v=4&s=48" width="48" height="48" alt="meaningfool" title="meaningfool"/></a> <a href="https://github.com/ratulsarna"><img src="https://avatars.githubusercontent.com/u/105903728?v=4&s=48" width="48" height="48" alt="ratulsarna" title="ratulsarna"/></a>
|
||||||
<a href="https://github.com/thewilloftheshadow"><img src="https://avatars.githubusercontent.com/u/35580099?v=4&s=48" width="48" height="48" alt="thewilloftheshadow" title="thewilloftheshadow"/></a> <a href="https://github.com/emanuelst"><img src="https://avatars.githubusercontent.com/u/9994339?v=4&s=48" width="48" height="48" alt="emanuelst" title="emanuelst"/></a> <a href="https://github.com/KristijanJovanovski"><img src="https://avatars.githubusercontent.com/u/8942284?v=4&s=48" width="48" height="48" alt="KristijanJovanovski" title="KristijanJovanovski"/></a> <a href="https://github.com/osolmaz"><img src="https://avatars.githubusercontent.com/u/2453968?v=4&s=48" width="48" height="48" alt="osolmaz" title="osolmaz"/></a> <a href="https://github.com/kiranjd"><img src="https://avatars.githubusercontent.com/u/25822851?v=4&s=48" width="48" height="48" alt="kiranjd" title="kiranjd"/></a> <a href="https://github.com/sebslight"><img src="https://avatars.githubusercontent.com/u/19554889?v=4&s=48" width="48" height="48" alt="Sebastian Barrios" title="Sebastian Barrios"/></a> <a href="https://github.com/search?q=sheeek"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="sheeek" title="sheeek"/></a> <a href="https://github.com/onutc"><img src="https://avatars.githubusercontent.com/u/152018508?v=4&s=48" width="48" height="48" alt="onutc" title="onutc"/></a> <a href="https://github.com/CashWilliams"><img src="https://avatars.githubusercontent.com/u/613573?v=4&s=48" width="48" height="48" alt="CashWilliams" title="CashWilliams"/></a> <a href="https://github.com/ManuelHettich"><img src="https://avatars.githubusercontent.com/u/17690367?v=4&s=48" width="48" height="48" alt="manuelhettich" title="manuelhettich"/></a>
|
<a href="https://github.com/lutr0"><img src="https://avatars.githubusercontent.com/u/76906369?v=4&s=48" width="48" height="48" alt="lutr0" title="lutr0"/></a> <a href="https://github.com/thewilloftheshadow"><img src="https://avatars.githubusercontent.com/u/35580099?v=4&s=48" width="48" height="48" alt="thewilloftheshadow" title="thewilloftheshadow"/></a> <a href="https://github.com/emanuelst"><img src="https://avatars.githubusercontent.com/u/9994339?v=4&s=48" width="48" height="48" alt="emanuelst" title="emanuelst"/></a> <a href="https://github.com/KristijanJovanovski"><img src="https://avatars.githubusercontent.com/u/8942284?v=4&s=48" width="48" height="48" alt="KristijanJovanovski" title="KristijanJovanovski"/></a> <a href="https://github.com/osolmaz"><img src="https://avatars.githubusercontent.com/u/2453968?v=4&s=48" width="48" height="48" alt="osolmaz" title="osolmaz"/></a> <a href="https://github.com/kiranjd"><img src="https://avatars.githubusercontent.com/u/25822851?v=4&s=48" width="48" height="48" alt="kiranjd" title="kiranjd"/></a> <a href="https://github.com/sebslight"><img src="https://avatars.githubusercontent.com/u/19554889?v=4&s=48" width="48" height="48" alt="Sebastian Barrios" title="Sebastian Barrios"/></a> <a href="https://github.com/search?q=sheeek"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="sheeek" title="sheeek"/></a> <a href="https://github.com/onutc"><img src="https://avatars.githubusercontent.com/u/152018508?v=4&s=48" width="48" height="48" alt="onutc" title="onutc"/></a> <a href="https://github.com/CashWilliams"><img src="https://avatars.githubusercontent.com/u/613573?v=4&s=48" width="48" height="48" alt="CashWilliams" title="CashWilliams"/></a>
|
||||||
<a href="https://github.com/minghinmatthewlam"><img src="https://avatars.githubusercontent.com/u/14224566?v=4&s=48" width="48" height="48" alt="minghinmatthewlam" title="minghinmatthewlam"/></a> <a href="https://github.com/myfunc"><img src="https://avatars.githubusercontent.com/u/19294627?v=4&s=48" width="48" height="48" alt="myfunc" title="myfunc"/></a> <a href="https://github.com/buddyh"><img src="https://avatars.githubusercontent.com/u/31752869?v=4&s=48" width="48" height="48" alt="buddyh" title="buddyh"/></a> <a href="https://github.com/mcinteerj"><img src="https://avatars.githubusercontent.com/u/3613653?v=4&s=48" width="48" height="48" alt="mcinteerj" title="mcinteerj"/></a> <a href="https://github.com/timkrase"><img src="https://avatars.githubusercontent.com/u/38947626?v=4&s=48" width="48" height="48" alt="timkrase" title="timkrase"/></a> <a href="https://github.com/obviyus"><img src="https://avatars.githubusercontent.com/u/22031114?v=4&s=48" width="48" height="48" alt="obviyus" title="obviyus"/></a> <a href="https://github.com/azade-c"><img src="https://avatars.githubusercontent.com/u/252790079?v=4&s=48" width="48" height="48" alt="azade-c" title="azade-c"/></a> <a href="https://github.com/danielz1z"><img src="https://avatars.githubusercontent.com/u/235270390?v=4&s=48" width="48" height="48" alt="danielz1z" title="danielz1z"/></a> <a href="https://github.com/bjesuiter"><img src="https://avatars.githubusercontent.com/u/2365676?v=4&s=48" width="48" height="48" alt="bjesuiter" title="bjesuiter"/></a> <a href="https://github.com/superman32432432"><img src="https://avatars.githubusercontent.com/u/7228420?v=4&s=48" width="48" height="48" alt="superman32432432" title="superman32432432"/></a>
|
<a href="https://github.com/ManuelHettich"><img src="https://avatars.githubusercontent.com/u/17690367?v=4&s=48" width="48" height="48" alt="manuelhettich" title="manuelhettich"/></a> <a href="https://github.com/minghinmatthewlam"><img src="https://avatars.githubusercontent.com/u/14224566?v=4&s=48" width="48" height="48" alt="minghinmatthewlam" title="minghinmatthewlam"/></a> <a href="https://github.com/myfunc"><img src="https://avatars.githubusercontent.com/u/19294627?v=4&s=48" width="48" height="48" alt="myfunc" title="myfunc"/></a> <a href="https://github.com/buddyh"><img src="https://avatars.githubusercontent.com/u/31752869?v=4&s=48" width="48" height="48" alt="buddyh" title="buddyh"/></a> <a href="https://github.com/mcinteerj"><img src="https://avatars.githubusercontent.com/u/3613653?v=4&s=48" width="48" height="48" alt="mcinteerj" title="mcinteerj"/></a> <a href="https://github.com/timkrase"><img src="https://avatars.githubusercontent.com/u/38947626?v=4&s=48" width="48" height="48" alt="timkrase" title="timkrase"/></a> <a href="https://github.com/obviyus"><img src="https://avatars.githubusercontent.com/u/22031114?v=4&s=48" width="48" height="48" alt="obviyus" title="obviyus"/></a> <a href="https://github.com/azade-c"><img src="https://avatars.githubusercontent.com/u/252790079?v=4&s=48" width="48" height="48" alt="azade-c" title="azade-c"/></a> <a href="https://github.com/bjesuiter"><img src="https://avatars.githubusercontent.com/u/2365676?v=4&s=48" width="48" height="48" alt="bjesuiter" title="bjesuiter"/></a> <a href="https://github.com/superman32432432"><img src="https://avatars.githubusercontent.com/u/7228420?v=4&s=48" width="48" height="48" alt="superman32432432" title="superman32432432"/></a>
|
||||||
<a href="https://github.com/search?q=Yurii%20Chukhlib"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Yurii Chukhlib" title="Yurii Chukhlib"/></a> <a href="https://github.com/antons"><img src="https://avatars.githubusercontent.com/u/129705?v=4&s=48" width="48" height="48" alt="antons" title="antons"/></a> <a href="https://github.com/austinm911"><img src="https://avatars.githubusercontent.com/u/31991302?v=4&s=48" width="48" height="48" alt="austinm911" title="austinm911"/></a> <a href="https://github.com/apps/blacksmith-sh"><img src="https://avatars.githubusercontent.com/in/807020?v=4&s=48" width="48" height="48" alt="blacksmith-sh[bot]" title="blacksmith-sh[bot]"/></a> <a href="https://github.com/HeimdallStrategy"><img src="https://avatars.githubusercontent.com/u/223014405?v=4&s=48" width="48" height="48" alt="HeimdallStrategy" title="HeimdallStrategy"/></a> <a href="https://github.com/imfing"><img src="https://avatars.githubusercontent.com/u/5097752?v=4&s=48" width="48" height="48" alt="imfing" title="imfing"/></a> <a href="https://github.com/jarvis-medmatic"><img src="https://avatars.githubusercontent.com/u/252428873?v=4&s=48" width="48" height="48" alt="jarvis-medmatic" title="jarvis-medmatic"/></a> <a href="https://github.com/mahmoudashraf93"><img src="https://avatars.githubusercontent.com/u/9130129?v=4&s=48" width="48" height="48" alt="mahmoudashraf93" title="mahmoudashraf93"/></a> <a href="https://github.com/petter-b"><img src="https://avatars.githubusercontent.com/u/62076402?v=4&s=48" width="48" height="48" alt="petter-b" title="petter-b"/></a> <a href="https://github.com/pkrmf"><img src="https://avatars.githubusercontent.com/u/1714267?v=4&s=48" width="48" height="48" alt="pkrmf" title="pkrmf"/></a>
|
<a href="https://github.com/search?q=Yurii%20Chukhlib"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Yurii Chukhlib" title="Yurii Chukhlib"/></a> <a href="https://github.com/antons"><img src="https://avatars.githubusercontent.com/u/129705?v=4&s=48" width="48" height="48" alt="antons" title="antons"/></a> <a href="https://github.com/austinm911"><img src="https://avatars.githubusercontent.com/u/31991302?v=4&s=48" width="48" height="48" alt="austinm911" title="austinm911"/></a> <a href="https://github.com/apps/blacksmith-sh"><img src="https://avatars.githubusercontent.com/in/807020?v=4&s=48" width="48" height="48" alt="blacksmith-sh[bot]" title="blacksmith-sh[bot]"/></a> <a href="https://github.com/imfing"><img src="https://avatars.githubusercontent.com/u/5097752?v=4&s=48" width="48" height="48" alt="imfing" title="imfing"/></a> <a href="https://github.com/jarvis-medmatic"><img src="https://avatars.githubusercontent.com/u/252428873?v=4&s=48" width="48" height="48" alt="jarvis-medmatic" title="jarvis-medmatic"/></a> <a href="https://github.com/mahmoudashraf93"><img src="https://avatars.githubusercontent.com/u/9130129?v=4&s=48" width="48" height="48" alt="mahmoudashraf93" title="mahmoudashraf93"/></a> <a href="https://github.com/petter-b"><img src="https://avatars.githubusercontent.com/u/62076402?v=4&s=48" width="48" height="48" alt="petter-b" title="petter-b"/></a> <a href="https://github.com/pkrmf"><img src="https://avatars.githubusercontent.com/u/1714267?v=4&s=48" width="48" height="48" alt="pkrmf" title="pkrmf"/></a> <a href="https://github.com/RandyVentures"><img src="https://avatars.githubusercontent.com/u/149904821?v=4&s=48" width="48" height="48" alt="RandyVentures" title="RandyVentures"/></a>
|
||||||
<a href="https://github.com/RandyVentures"><img src="https://avatars.githubusercontent.com/u/149904821?v=4&s=48" width="48" height="48" alt="RandyVentures" title="RandyVentures"/></a> <a href="https://github.com/dan-dr"><img src="https://avatars.githubusercontent.com/u/6669808?v=4&s=48" width="48" height="48" alt="dan-dr" title="dan-dr"/></a> <a href="https://github.com/jalehman"><img src="https://avatars.githubusercontent.com/u/550978?v=4&s=48" width="48" height="48" alt="jalehman" title="jalehman"/></a> <a href="https://github.com/jonasjancarik"><img src="https://avatars.githubusercontent.com/u/2459191?v=4&s=48" width="48" height="48" alt="jonasjancarik" title="jonasjancarik"/></a> <a href="https://github.com/search?q=Keith%20the%20Silly%20Goose"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Keith the Silly Goose" title="Keith the Silly Goose"/></a> <a href="https://github.com/search?q=L36%20Server"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="L36 Server" title="L36 Server"/></a> <a href="https://github.com/mitschabaude-bot"><img src="https://avatars.githubusercontent.com/u/247582884?v=4&s=48" width="48" height="48" alt="mitschabaude-bot" title="mitschabaude-bot"/></a> <a href="https://github.com/neist"><img src="https://avatars.githubusercontent.com/u/1029724?v=4&s=48" width="48" height="48" alt="neist" title="neist"/></a> <a href="https://github.com/roshanasingh4"><img src="https://avatars.githubusercontent.com/u/88576930?v=4&s=48" width="48" height="48" alt="roshanasingh4" title="roshanasingh4"/></a> <a href="https://github.com/search?q=Friederike%20Seiler"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Friederike Seiler" title="Friederike Seiler"/></a>
|
<a href="https://github.com/dan-dr"><img src="https://avatars.githubusercontent.com/u/6669808?v=4&s=48" width="48" height="48" alt="dan-dr" title="dan-dr"/></a> <a href="https://github.com/HeimdallStrategy"><img src="https://avatars.githubusercontent.com/u/223014405?v=4&s=48" width="48" height="48" alt="HeimdallStrategy" title="HeimdallStrategy"/></a> <a href="https://github.com/jalehman"><img src="https://avatars.githubusercontent.com/u/550978?v=4&s=48" width="48" height="48" alt="jalehman" title="jalehman"/></a> <a href="https://github.com/jonasjancarik"><img src="https://avatars.githubusercontent.com/u/2459191?v=4&s=48" width="48" height="48" alt="jonasjancarik" title="jonasjancarik"/></a> <a href="https://github.com/search?q=Keith%20the%20Silly%20Goose"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Keith the Silly Goose" title="Keith the Silly Goose"/></a> <a href="https://github.com/search?q=L36%20Server"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="L36 Server" title="L36 Server"/></a> <a href="https://github.com/neist"><img src="https://avatars.githubusercontent.com/u/1029724?v=4&s=48" width="48" height="48" alt="neist" title="neist"/></a> <a href="https://github.com/gabriel-trigo"><img src="https://avatars.githubusercontent.com/u/38991125?v=4&s=48" width="48" height="48" alt="gabriel-trigo" title="gabriel-trigo"/></a> <a href="https://github.com/Iamadig"><img src="https://avatars.githubusercontent.com/u/102129234?v=4&s=48" width="48" height="48" alt="iamadig" title="iamadig"/></a> <a href="https://github.com/search?q=Kit"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Kit" title="Kit"/></a>
|
||||||
<a href="https://github.com/gabriel-trigo"><img src="https://avatars.githubusercontent.com/u/38991125?v=4&s=48" width="48" height="48" alt="gabriel-trigo" title="gabriel-trigo"/></a> <a href="https://github.com/Iamadig"><img src="https://avatars.githubusercontent.com/u/102129234?v=4&s=48" width="48" height="48" alt="iamadig" title="iamadig"/></a> <a href="https://github.com/search?q=Kit"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Kit" title="Kit"/></a> <a href="https://github.com/koala73"><img src="https://avatars.githubusercontent.com/u/996596?v=4&s=48" width="48" height="48" alt="koala73" title="koala73"/></a> <a href="https://github.com/manmal"><img src="https://avatars.githubusercontent.com/u/142797?v=4&s=48" width="48" height="48" alt="manmal" title="manmal"/></a> <a href="https://github.com/ngutman"><img src="https://avatars.githubusercontent.com/u/1540134?v=4&s=48" width="48" height="48" alt="ngutman" title="ngutman"/></a> <a href="https://github.com/ogulcancelik"><img src="https://avatars.githubusercontent.com/u/7064011?v=4&s=48" width="48" height="48" alt="ogulcancelik" title="ogulcancelik"/></a> <a href="https://github.com/pasogott"><img src="https://avatars.githubusercontent.com/u/23458152?v=4&s=48" width="48" height="48" alt="pasogott" title="pasogott"/></a> <a href="https://github.com/petradonka"><img src="https://avatars.githubusercontent.com/u/7353770?v=4&s=48" width="48" height="48" alt="petradonka" title="petradonka"/></a> <a href="https://github.com/VACInc"><img src="https://avatars.githubusercontent.com/u/3279061?v=4&s=48" width="48" height="48" alt="VACInc" title="VACInc"/></a>
|
<a href="https://github.com/koala73"><img src="https://avatars.githubusercontent.com/u/996596?v=4&s=48" width="48" height="48" alt="koala73" title="koala73"/></a> <a href="https://github.com/manmal"><img src="https://avatars.githubusercontent.com/u/142797?v=4&s=48" width="48" height="48" alt="manmal" title="manmal"/></a> <a href="https://github.com/ogulcancelik"><img src="https://avatars.githubusercontent.com/u/7064011?v=4&s=48" width="48" height="48" alt="ogulcancelik" title="ogulcancelik"/></a> <a href="https://github.com/pasogott"><img src="https://avatars.githubusercontent.com/u/23458152?v=4&s=48" width="48" height="48" alt="pasogott" title="pasogott"/></a> <a href="https://github.com/petradonka"><img src="https://avatars.githubusercontent.com/u/7353770?v=4&s=48" width="48" height="48" alt="petradonka" title="petradonka"/></a> <a href="https://github.com/VACInc"><img src="https://avatars.githubusercontent.com/u/3279061?v=4&s=48" width="48" height="48" alt="VACInc" title="VACInc"/></a> <a href="https://github.com/zats"><img src="https://avatars.githubusercontent.com/u/2688806?v=4&s=48" width="48" height="48" alt="zats" title="zats"/></a> <a href="https://github.com/search?q=Chris%20Taylor"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Chris Taylor" title="Chris Taylor"/></a> <a href="https://github.com/djangonavarro220"><img src="https://avatars.githubusercontent.com/u/251162586?v=4&s=48" width="48" height="48" alt="Django Navarro" title="Django Navarro"/></a> <a href="https://github.com/ngutman"><img src="https://avatars.githubusercontent.com/u/1540134?v=4&s=48" width="48" height="48" alt="ngutman" title="ngutman"/></a>
|
||||||
<a href="https://github.com/zats"><img src="https://avatars.githubusercontent.com/u/2688806?v=4&s=48" width="48" height="48" alt="zats" title="zats"/></a> <a href="https://github.com/search?q=Chris%20Taylor"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Chris Taylor" title="Chris Taylor"/></a> <a href="https://github.com/djangonavarro220"><img src="https://avatars.githubusercontent.com/u/251162586?v=4&s=48" width="48" height="48" alt="Django Navarro" title="Django Navarro"/></a> <a href="https://github.com/pcty-nextgen-service-account"><img src="https://avatars.githubusercontent.com/u/112553441?v=4&s=48" width="48" height="48" alt="pcty-nextgen-service-account" title="pcty-nextgen-service-account"/></a> <a href="https://github.com/rubyrunsstuff"><img src="https://avatars.githubusercontent.com/u/246602379?v=4&s=48" width="48" height="48" alt="rubyrunsstuff" title="rubyrunsstuff"/></a> <a href="https://github.com/Syhids"><img src="https://avatars.githubusercontent.com/u/671202?v=4&s=48" width="48" height="48" alt="Syhids" title="Syhids"/></a> <a href="https://github.com/search?q=Aaron%20Konyer"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Aaron Konyer" title="Aaron Konyer"/></a> <a href="https://github.com/erik-agens"><img src="https://avatars.githubusercontent.com/u/80908960?v=4&s=48" width="48" height="48" alt="erik-agens" title="erik-agens"/></a> <a href="https://github.com/erikpr1994"><img src="https://avatars.githubusercontent.com/u/6299331?v=4&s=48" width="48" height="48" alt="erikpr1994" title="erikpr1994"/></a> <a href="https://github.com/fcatuhe"><img src="https://avatars.githubusercontent.com/u/17382215?v=4&s=48" width="48" height="48" alt="fcatuhe" title="fcatuhe"/></a>
|
<a href="https://github.com/pcty-nextgen-service-account"><img src="https://avatars.githubusercontent.com/u/112553441?v=4&s=48" width="48" height="48" alt="pcty-nextgen-service-account" title="pcty-nextgen-service-account"/></a> <a href="https://github.com/rubyrunsstuff"><img src="https://avatars.githubusercontent.com/u/246602379?v=4&s=48" width="48" height="48" alt="rubyrunsstuff" title="rubyrunsstuff"/></a> <a href="https://github.com/Syhids"><img src="https://avatars.githubusercontent.com/u/671202?v=4&s=48" width="48" height="48" alt="Syhids" title="Syhids"/></a> <a href="https://github.com/search?q=Aaron%20Konyer"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Aaron Konyer" title="Aaron Konyer"/></a> <a href="https://github.com/danielz1z"><img src="https://avatars.githubusercontent.com/u/235270390?v=4&s=48" width="48" height="48" alt="danielz1z" title="danielz1z"/></a> <a href="https://github.com/erik-agens"><img src="https://avatars.githubusercontent.com/u/80908960?v=4&s=48" width="48" height="48" alt="erik-agens" title="erik-agens"/></a> <a href="https://github.com/erikpr1994"><img src="https://avatars.githubusercontent.com/u/6299331?v=4&s=48" width="48" height="48" alt="erikpr1994" title="erikpr1994"/></a> <a href="https://github.com/fcatuhe"><img src="https://avatars.githubusercontent.com/u/17382215?v=4&s=48" width="48" height="48" alt="fcatuhe" title="fcatuhe"/></a> <a href="https://github.com/henrino3"><img src="https://avatars.githubusercontent.com/u/4260288?v=4&s=48" width="48" height="48" alt="henrino3" title="henrino3"/></a> <a href="https://github.com/jayhickey"><img src="https://avatars.githubusercontent.com/u/1676460?v=4&s=48" width="48" height="48" alt="jayhickey" title="jayhickey"/></a>
|
||||||
<a href="https://github.com/gumadeiras"><img src="https://avatars.githubusercontent.com/u/5599352?v=4&s=48" width="48" height="48" alt="gumadeiras" title="gumadeiras"/></a> <a href="https://github.com/henrino3"><img src="https://avatars.githubusercontent.com/u/4260288?v=4&s=48" width="48" height="48" alt="henrino3" title="henrino3"/></a> <a href="https://github.com/jayhickey"><img src="https://avatars.githubusercontent.com/u/1676460?v=4&s=48" width="48" height="48" alt="jayhickey" title="jayhickey"/></a> <a href="https://github.com/jeffersonwarrior"><img src="https://avatars.githubusercontent.com/u/89030989?v=4&s=48" width="48" height="48" alt="jeffersonwarrior" title="jeffersonwarrior"/></a> <a href="https://github.com/search?q=jeffersonwarrior"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="jeffersonwarrior" title="jeffersonwarrior"/></a> <a href="https://github.com/jdrhyne"><img src="https://avatars.githubusercontent.com/u/7828464?v=4&s=48" width="48" height="48" alt="Jonathan D. Rhyne (DJ-D)" title="Jonathan D. Rhyne (DJ-D)"/></a> <a href="https://github.com/juanpablodlc"><img src="https://avatars.githubusercontent.com/u/92012363?v=4&s=48" width="48" height="48" alt="juanpablodlc" title="juanpablodlc"/></a> <a href="https://github.com/jverdi"><img src="https://avatars.githubusercontent.com/u/345050?v=4&s=48" width="48" height="48" alt="jverdi" title="jverdi"/></a> <a href="https://github.com/mickahouan"><img src="https://avatars.githubusercontent.com/u/31423109?v=4&s=48" width="48" height="48" alt="mickahouan" title="mickahouan"/></a> <a href="https://github.com/mjrussell"><img src="https://avatars.githubusercontent.com/u/1641895?v=4&s=48" width="48" height="48" alt="mjrussell" title="mjrussell"/></a>
|
<a href="https://github.com/jdrhyne"><img src="https://avatars.githubusercontent.com/u/7828464?v=4&s=48" width="48" height="48" alt="Jonathan D. Rhyne (DJ-D)" title="Jonathan D. Rhyne (DJ-D)"/></a> <a href="https://github.com/juanpablodlc"><img src="https://avatars.githubusercontent.com/u/92012363?v=4&s=48" width="48" height="48" alt="juanpablodlc" title="juanpablodlc"/></a> <a href="https://github.com/jverdi"><img src="https://avatars.githubusercontent.com/u/345050?v=4&s=48" width="48" height="48" alt="jverdi" title="jverdi"/></a> <a href="https://github.com/mickahouan"><img src="https://avatars.githubusercontent.com/u/31423109?v=4&s=48" width="48" height="48" alt="mickahouan" title="mickahouan"/></a> <a href="https://github.com/mitschabaude-bot"><img src="https://avatars.githubusercontent.com/u/247582884?v=4&s=48" width="48" height="48" alt="mitschabaude-bot" title="mitschabaude-bot"/></a> <a href="https://github.com/mjrussell"><img src="https://avatars.githubusercontent.com/u/1641895?v=4&s=48" width="48" height="48" alt="mjrussell" title="mjrussell"/></a> <a href="https://github.com/oswalpalash"><img src="https://avatars.githubusercontent.com/u/6431196?v=4&s=48" width="48" height="48" alt="oswalpalash" title="oswalpalash"/></a> <a href="https://github.com/p6l-richard"><img src="https://avatars.githubusercontent.com/u/18185649?v=4&s=48" width="48" height="48" alt="p6l-richard" title="p6l-richard"/></a> <a href="https://github.com/philipp-spiess"><img src="https://avatars.githubusercontent.com/u/458591?v=4&s=48" width="48" height="48" alt="philipp-spiess" title="philipp-spiess"/></a> <a href="https://github.com/roshanasingh4"><img src="https://avatars.githubusercontent.com/u/88576930?v=4&s=48" width="48" height="48" alt="roshanasingh4" title="roshanasingh4"/></a>
|
||||||
<a href="https://github.com/oswalpalash"><img src="https://avatars.githubusercontent.com/u/6431196?v=4&s=48" width="48" height="48" alt="oswalpalash" title="oswalpalash"/></a> <a href="https://github.com/p6l-richard"><img src="https://avatars.githubusercontent.com/u/18185649?v=4&s=48" width="48" height="48" alt="p6l-richard" title="p6l-richard"/></a> <a href="https://github.com/philipp-spiess"><img src="https://avatars.githubusercontent.com/u/458591?v=4&s=48" width="48" height="48" alt="philipp-spiess" title="philipp-spiess"/></a> <a href="https://github.com/robaxelsen"><img src="https://avatars.githubusercontent.com/u/13132899?v=4&s=48" width="48" height="48" alt="robaxelsen" title="robaxelsen"/></a> <a href="https://github.com/search?q=Sash%20Catanzarite"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Sash Catanzarite" title="Sash Catanzarite"/></a> <a href="https://github.com/search?q=VAC"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="VAC" title="VAC"/></a> <a href="https://github.com/zknicker"><img src="https://avatars.githubusercontent.com/u/1164085?v=4&s=48" width="48" height="48" alt="zknicker" title="zknicker"/></a> <a href="https://github.com/adam91holt"><img src="https://avatars.githubusercontent.com/u/9592417?v=4&s=48" width="48" height="48" alt="adam91holt" title="adam91holt"/></a> <a href="https://github.com/search?q=alejandro%20maza"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="alejandro maza" title="alejandro maza"/></a> <a href="https://github.com/andrewting19"><img src="https://avatars.githubusercontent.com/u/10536704?v=4&s=48" width="48" height="48" alt="andrewting19" title="andrewting19"/></a>
|
<a href="https://github.com/search?q=Sash%20Catanzarite"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Sash Catanzarite" title="Sash Catanzarite"/></a> <a href="https://github.com/search?q=VAC"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="VAC" title="VAC"/></a> <a href="https://github.com/zknicker"><img src="https://avatars.githubusercontent.com/u/1164085?v=4&s=48" width="48" height="48" alt="zknicker" title="zknicker"/></a> <a href="https://github.com/adam91holt"><img src="https://avatars.githubusercontent.com/u/9592417?v=4&s=48" width="48" height="48" alt="adam91holt" title="adam91holt"/></a> <a href="https://github.com/search?q=alejandro%20maza"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="alejandro maza" title="alejandro maza"/></a> <a href="https://github.com/andrewting19"><img src="https://avatars.githubusercontent.com/u/10536704?v=4&s=48" width="48" height="48" alt="andrewting19" title="andrewting19"/></a> <a href="https://github.com/Asleep123"><img src="https://avatars.githubusercontent.com/u/122379135?v=4&s=48" width="48" height="48" alt="Asleep123" title="Asleep123"/></a> <a href="https://github.com/bolismauro"><img src="https://avatars.githubusercontent.com/u/771999?v=4&s=48" width="48" height="48" alt="bolismauro" title="bolismauro"/></a> <a href="https://github.com/cash-echo-bot"><img src="https://avatars.githubusercontent.com/u/252747386?v=4&s=48" width="48" height="48" alt="cash-echo-bot" title="cash-echo-bot"/></a> <a href="https://github.com/search?q=Clawd"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Clawd" title="Clawd"/></a>
|
||||||
<a href="https://github.com/Asleep123"><img src="https://avatars.githubusercontent.com/u/122379135?v=4&s=48" width="48" height="48" alt="Asleep123" title="Asleep123"/></a> <a href="https://github.com/bolismauro"><img src="https://avatars.githubusercontent.com/u/771999?v=4&s=48" width="48" height="48" alt="bolismauro" title="bolismauro"/></a> <a href="https://github.com/cash-echo-bot"><img src="https://avatars.githubusercontent.com/u/252747386?v=4&s=48" width="48" height="48" alt="cash-echo-bot" title="cash-echo-bot"/></a> <a href="https://github.com/search?q=Clawd"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Clawd" title="Clawd"/></a> <a href="https://github.com/conhecendocontato"><img src="https://avatars.githubusercontent.com/u/82890727?v=4&s=48" width="48" height="48" alt="conhecendocontato" title="conhecendocontato"/></a> <a href="https://github.com/search?q=Drake%20Thomsen"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Drake Thomsen" title="Drake Thomsen"/></a> <a href="https://github.com/evalexpr"><img src="https://avatars.githubusercontent.com/u/23485511?v=4&s=48" width="48" height="48" alt="evalexpr" title="evalexpr"/></a> <a href="https://github.com/grp06"><img src="https://avatars.githubusercontent.com/u/1573959?v=4&s=48" width="48" height="48" alt="grp06" title="grp06"/></a> <a href="https://github.com/gtsifrikas"><img src="https://avatars.githubusercontent.com/u/8904378?v=4&s=48" width="48" height="48" alt="gtsifrikas" title="gtsifrikas"/></a> <a href="https://github.com/HazAT"><img src="https://avatars.githubusercontent.com/u/363802?v=4&s=48" width="48" height="48" alt="HazAT" title="HazAT"/></a>
|
<a href="https://github.com/conhecendocontato"><img src="https://avatars.githubusercontent.com/u/82890727?v=4&s=48" width="48" height="48" alt="conhecendocontato" title="conhecendocontato"/></a> <a href="https://github.com/search?q=Drake%20Thomsen"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Drake Thomsen" title="Drake Thomsen"/></a> <a href="https://github.com/evalexpr"><img src="https://avatars.githubusercontent.com/u/23485511?v=4&s=48" width="48" height="48" alt="evalexpr" title="evalexpr"/></a> <a href="https://github.com/gtsifrikas"><img src="https://avatars.githubusercontent.com/u/8904378?v=4&s=48" width="48" height="48" alt="gtsifrikas" title="gtsifrikas"/></a> <a href="https://github.com/HazAT"><img src="https://avatars.githubusercontent.com/u/363802?v=4&s=48" width="48" height="48" alt="HazAT" title="HazAT"/></a> <a href="https://github.com/hrdwdmrbl"><img src="https://avatars.githubusercontent.com/u/554881?v=4&s=48" width="48" height="48" alt="hrdwdmrbl" title="hrdwdmrbl"/></a> <a href="https://github.com/hugobarauna"><img src="https://avatars.githubusercontent.com/u/2719?v=4&s=48" width="48" height="48" alt="hugobarauna" title="hugobarauna"/></a> <a href="https://github.com/search?q=Jarvis"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Jarvis" title="Jarvis"/></a> <a href="https://github.com/kitze"><img src="https://avatars.githubusercontent.com/u/1160594?v=4&s=48" width="48" height="48" alt="kitze" title="kitze"/></a> <a href="https://github.com/kkarimi"><img src="https://avatars.githubusercontent.com/u/875218?v=4&s=48" width="48" height="48" alt="kkarimi" title="kkarimi"/></a>
|
||||||
<a href="https://github.com/hrdwdmrbl"><img src="https://avatars.githubusercontent.com/u/554881?v=4&s=48" width="48" height="48" alt="hrdwdmrbl" title="hrdwdmrbl"/></a> <a href="https://github.com/hugobarauna"><img src="https://avatars.githubusercontent.com/u/2719?v=4&s=48" width="48" height="48" alt="hugobarauna" title="hugobarauna"/></a> <a href="https://github.com/search?q=Jarvis"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Jarvis" title="Jarvis"/></a> <a href="https://github.com/search?q=Jefferson%20Nunn"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Jefferson Nunn" title="Jefferson Nunn"/></a> <a href="https://github.com/kitze"><img src="https://avatars.githubusercontent.com/u/1160594?v=4&s=48" width="48" height="48" alt="kitze" title="kitze"/></a> <a href="https://github.com/kkarimi"><img src="https://avatars.githubusercontent.com/u/875218?v=4&s=48" width="48" height="48" alt="kkarimi" title="kkarimi"/></a> <a href="https://github.com/levifig"><img src="https://avatars.githubusercontent.com/u/1605?v=4&s=48" width="48" height="48" alt="levifig" title="levifig"/></a> <a href="https://github.com/search?q=Lloyd"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Lloyd" title="Lloyd"/></a> <a href="https://github.com/loukotal"><img src="https://avatars.githubusercontent.com/u/18210858?v=4&s=48" width="48" height="48" alt="loukotal" title="loukotal"/></a> <a href="https://github.com/search?q=Marc"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Marc" title="Marc"/></a>
|
<a href="https://github.com/levifig"><img src="https://avatars.githubusercontent.com/u/1605?v=4&s=48" width="48" height="48" alt="levifig" title="levifig"/></a> <a href="https://github.com/search?q=Lloyd"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Lloyd" title="Lloyd"/></a> <a href="https://github.com/loukotal"><img src="https://avatars.githubusercontent.com/u/18210858?v=4&s=48" width="48" height="48" alt="loukotal" title="loukotal"/></a> <a href="https://github.com/martinpucik"><img src="https://avatars.githubusercontent.com/u/5503097?v=4&s=48" width="48" height="48" alt="martinpucik" title="martinpucik"/></a> <a href="https://github.com/search?q=Miles"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Miles" title="Miles"/></a> <a href="https://github.com/mrdbstn"><img src="https://avatars.githubusercontent.com/u/58957632?v=4&s=48" width="48" height="48" alt="mrdbstn" title="mrdbstn"/></a> <a href="https://github.com/MSch"><img src="https://avatars.githubusercontent.com/u/7475?v=4&s=48" width="48" height="48" alt="MSch" title="MSch"/></a> <a href="https://github.com/search?q=Mustafa%20Tag%20Eldeen"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Mustafa Tag Eldeen" title="Mustafa Tag Eldeen"/></a> <a href="https://github.com/nexty5870"><img src="https://avatars.githubusercontent.com/u/3869659?v=4&s=48" width="48" height="48" alt="nexty5870" title="nexty5870"/></a> <a href="https://github.com/prathamdby"><img src="https://avatars.githubusercontent.com/u/134331217?v=4&s=48" width="48" height="48" alt="prathamdby" title="prathamdby"/></a>
|
||||||
<a href="https://github.com/martinpucik"><img src="https://avatars.githubusercontent.com/u/5503097?v=4&s=48" width="48" height="48" alt="martinpucik" title="martinpucik"/></a> <a href="https://github.com/search?q=Miles"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Miles" title="Miles"/></a> <a href="https://github.com/mrdbstn"><img src="https://avatars.githubusercontent.com/u/58957632?v=4&s=48" width="48" height="48" alt="mrdbstn" title="mrdbstn"/></a> <a href="https://github.com/MSch"><img src="https://avatars.githubusercontent.com/u/7475?v=4&s=48" width="48" height="48" alt="MSch" title="MSch"/></a> <a href="https://github.com/search?q=Mustafa%20Tag%20Eldeen"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Mustafa Tag Eldeen" title="Mustafa Tag Eldeen"/></a> <a href="https://github.com/nexty5870"><img src="https://avatars.githubusercontent.com/u/3869659?v=4&s=48" width="48" height="48" alt="nexty5870" title="nexty5870"/></a> <a href="https://github.com/prathamdby"><img src="https://avatars.githubusercontent.com/u/134331217?v=4&s=48" width="48" height="48" alt="prathamdby" title="prathamdby"/></a> <a href="https://github.com/reeltimeapps"><img src="https://avatars.githubusercontent.com/u/637338?v=4&s=48" width="48" height="48" alt="reeltimeapps" title="reeltimeapps"/></a> <a href="https://github.com/RLTCmpe"><img src="https://avatars.githubusercontent.com/u/10762242?v=4&s=48" width="48" height="48" alt="RLTCmpe" title="RLTCmpe"/></a> <a href="https://github.com/search?q=Rony%20Kelner"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Rony Kelner" title="Rony Kelner"/></a>
|
<a href="https://github.com/reeltimeapps"><img src="https://avatars.githubusercontent.com/u/637338?v=4&s=48" width="48" height="48" alt="reeltimeapps" title="reeltimeapps"/></a> <a href="https://github.com/RLTCmpe"><img src="https://avatars.githubusercontent.com/u/10762242?v=4&s=48" width="48" height="48" alt="RLTCmpe" title="RLTCmpe"/></a> <a href="https://github.com/search?q=Rolf%20Fredheim"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Rolf Fredheim" title="Rolf Fredheim"/></a> <a href="https://github.com/search?q=Rony%20Kelner"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Rony Kelner" title="Rony Kelner"/></a> <a href="https://github.com/search?q=Samrat%20Jha"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Samrat Jha" title="Samrat Jha"/></a> <a href="https://github.com/siraht"><img src="https://avatars.githubusercontent.com/u/73152895?v=4&s=48" width="48" height="48" alt="siraht" title="siraht"/></a> <a href="https://github.com/snopoke"><img src="https://avatars.githubusercontent.com/u/249606?v=4&s=48" width="48" height="48" alt="snopoke" title="snopoke"/></a> <a href="https://github.com/search?q=The%20Admiral"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="The Admiral" title="The Admiral"/></a> <a href="https://github.com/wes-davis"><img src="https://avatars.githubusercontent.com/u/16506720?v=4&s=48" width="48" height="48" alt="wes-davis" title="wes-davis"/></a> <a href="https://github.com/wstock"><img src="https://avatars.githubusercontent.com/u/1394687?v=4&s=48" width="48" height="48" alt="wstock" title="wstock"/></a>
|
||||||
<a href="https://github.com/search?q=Samrat%20Jha"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Samrat Jha" title="Samrat Jha"/></a> <a href="https://github.com/siraht"><img src="https://avatars.githubusercontent.com/u/73152895?v=4&s=48" width="48" height="48" alt="siraht" title="siraht"/></a> <a href="https://github.com/sleontenko"><img src="https://avatars.githubusercontent.com/u/7135949?v=4&s=48" width="48" height="48" alt="sleontenko" title="sleontenko"/></a> <a href="https://github.com/snopoke"><img src="https://avatars.githubusercontent.com/u/249606?v=4&s=48" width="48" height="48" alt="snopoke" title="snopoke"/></a> <a href="https://github.com/search?q=The%20Admiral"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="The Admiral" title="The Admiral"/></a> <a href="https://github.com/wes-davis"><img src="https://avatars.githubusercontent.com/u/16506720?v=4&s=48" width="48" height="48" alt="wes-davis" title="wes-davis"/></a> <a href="https://github.com/wstock"><img src="https://avatars.githubusercontent.com/u/1394687?v=4&s=48" width="48" height="48" alt="wstock" title="wstock"/></a> <a href="https://github.com/YuriNachos"><img src="https://avatars.githubusercontent.com/u/19365375?v=4&s=48" width="48" height="48" alt="YuriNachos" title="YuriNachos"/></a> <a href="https://github.com/search?q=Zach%20Knickerbocker"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Zach Knickerbocker" title="Zach Knickerbocker"/></a> <a href="https://github.com/search?q=Azade"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Azade" title="Azade"/></a>
|
<a href="https://github.com/YuriNachos"><img src="https://avatars.githubusercontent.com/u/19365375?v=4&s=48" width="48" height="48" alt="YuriNachos" title="YuriNachos"/></a> <a href="https://github.com/search?q=Zach%20Knickerbocker"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Zach Knickerbocker" title="Zach Knickerbocker"/></a> <a href="https://github.com/search?q=Azade"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Azade" title="Azade"/></a> <a href="https://github.com/carlulsoe"><img src="https://avatars.githubusercontent.com/u/34673973?v=4&s=48" width="48" height="48" alt="carlulsoe" title="carlulsoe"/></a> <a href="https://github.com/search?q=ddyo"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="ddyo" title="ddyo"/></a> <a href="https://github.com/search?q=Erik"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Erik" title="Erik"/></a> <a href="https://github.com/latitudeki5223"><img src="https://avatars.githubusercontent.com/u/119656367?v=4&s=48" width="48" height="48" alt="latitudeki5223" title="latitudeki5223"/></a> <a href="https://github.com/search?q=Manuel%20Maly"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Manuel Maly" title="Manuel Maly"/></a> <a href="https://github.com/search?q=Mourad%20Boustani"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Mourad Boustani" title="Mourad Boustani"/></a> <a href="https://github.com/pcty-nextgen-ios-builder"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="pcty-nextgen-ios-builder" title="pcty-nextgen-ios-builder"/></a>
|
||||||
<a href="https://github.com/carlulsoe"><img src="https://avatars.githubusercontent.com/u/34673973?v=4&s=48" width="48" height="48" alt="carlulsoe" title="carlulsoe"/></a> <a href="https://github.com/search?q=ddyo"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="ddyo" title="ddyo"/></a> <a href="https://github.com/search?q=Erik"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Erik" title="Erik"/></a> <a href="https://github.com/latitudeki5223"><img src="https://avatars.githubusercontent.com/u/119656367?v=4&s=48" width="48" height="48" alt="latitudeki5223" title="latitudeki5223"/></a> <a href="https://github.com/search?q=Manuel%20Maly"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Manuel Maly" title="Manuel Maly"/></a> <a href="https://github.com/search?q=Mourad%20Boustani"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Mourad Boustani" title="Mourad Boustani"/></a> <a href="https://github.com/pcty-nextgen-ios-builder"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="pcty-nextgen-ios-builder" title="pcty-nextgen-ios-builder"/></a> <a href="https://github.com/search?q=Quentin"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Quentin" title="Quentin"/></a> <a href="https://github.com/rafaelreis-r"><img src="https://avatars.githubusercontent.com/u/57492577?v=4&s=48" width="48" height="48" alt="rafaelreis-r" title="rafaelreis-r"/></a> <a href="https://github.com/search?q=Randy%20Torres"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Randy Torres" title="Randy Torres"/></a>
|
<a href="https://github.com/search?q=Quentin"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Quentin" title="Quentin"/></a> <a href="https://github.com/search?q=Randy%20Torres"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Randy Torres" title="Randy Torres"/></a> <a href="https://github.com/thesash"><img src="https://avatars.githubusercontent.com/u/1166151?v=4&s=48" width="48" height="48" alt="thesash" title="thesash"/></a> <a href="https://github.com/search?q=William%20Stock"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="William Stock" title="William Stock"/></a>
|
||||||
<a href="https://github.com/search?q=Rolf%20Fredheim"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="Rolf Fredheim" title="Rolf Fredheim"/></a> <a href="https://github.com/thesash"><img src="https://avatars.githubusercontent.com/u/1166151?v=4&s=48" width="48" height="48" alt="thesash" title="thesash"/></a> <a href="https://github.com/search?q=William%20Stock"><img src="assets/avatar-placeholder.svg" width="48" height="48" alt="William Stock" title="William Stock"/></a>
|
|
||||||
</p>
|
</p>
|
||||||
@@ -34,7 +34,8 @@ extension AttributedString {
|
|||||||
var ranges: [Range<AttributedString.Index>] = []
|
var ranges: [Range<AttributedString.Index>] = []
|
||||||
for wordRange in wordRanges {
|
for wordRange in wordRanges {
|
||||||
if let lastRange = ranges.last,
|
if let lastRange = ranges.last,
|
||||||
self[lastRange].characters.count + self[wordRange].characters.count <= maxLength {
|
self[lastRange].characters.count + self[wordRange].characters.count <= maxLength
|
||||||
|
{
|
||||||
ranges[ranges.count - 1] = lastRange.lowerBound..<wordRange.upperBound
|
ranges[ranges.count - 1] = lastRange.lowerBound..<wordRange.upperBound
|
||||||
} else {
|
} else {
|
||||||
ranges.append(wordRange)
|
ranges.append(wordRange)
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ public actor TranscriptsStore {
|
|||||||
try? FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
|
try? FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
|
||||||
fileURL = dir.appendingPathComponent("transcripts.log")
|
fileURL = dir.appendingPathComponent("transcripts.log")
|
||||||
if let data = try? Data(contentsOf: fileURL),
|
if let data = try? Data(contentsOf: fileURL),
|
||||||
let text = String(data: data, encoding: .utf8) {
|
let text = String(data: data, encoding: .utf8)
|
||||||
|
{
|
||||||
entries = text.split(separator: "\n").map(String.init).suffix(limit)
|
entries = text.split(separator: "\n").map(String.init).suffix(limit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ public struct WakeWordGateConfig: Sendable, Equatable {
|
|||||||
public init(
|
public init(
|
||||||
triggers: [String],
|
triggers: [String],
|
||||||
minPostTriggerGap: TimeInterval = 0.45,
|
minPostTriggerGap: TimeInterval = 0.45,
|
||||||
minCommandLength: Int = 1) {
|
minCommandLength: Int = 1)
|
||||||
|
{
|
||||||
self.triggers = triggers
|
self.triggers = triggers
|
||||||
self.minPostTriggerGap = minPostTriggerGap
|
self.minPostTriggerGap = minPostTriggerGap
|
||||||
self.minCommandLength = minCommandLength
|
self.minCommandLength = minCommandLength
|
||||||
@@ -56,12 +57,6 @@ public enum WakeWordGate {
|
|||||||
let tokens: [String]
|
let tokens: [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct MatchCandidate {
|
|
||||||
let index: Int
|
|
||||||
let triggerEnd: TimeInterval
|
|
||||||
let gap: TimeInterval
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func match(
|
public static func match(
|
||||||
transcript: String,
|
transcript: String,
|
||||||
segments: [WakeWordSegment],
|
segments: [WakeWordSegment],
|
||||||
@@ -73,7 +68,7 @@ public enum WakeWordGate {
|
|||||||
let tokens = normalizeSegments(segments)
|
let tokens = normalizeSegments(segments)
|
||||||
guard !tokens.isEmpty else { return nil }
|
guard !tokens.isEmpty else { return nil }
|
||||||
|
|
||||||
var best: MatchCandidate?
|
var best: (index: Int, triggerEnd: TimeInterval, gap: TimeInterval)?
|
||||||
|
|
||||||
for trigger in triggerTokens {
|
for trigger in triggerTokens {
|
||||||
let count = trigger.tokens.count
|
let count = trigger.tokens.count
|
||||||
@@ -89,7 +84,7 @@ public enum WakeWordGate {
|
|||||||
|
|
||||||
if let best, i <= best.index { continue }
|
if let best, i <= best.index { continue }
|
||||||
|
|
||||||
best = MatchCandidate(index: i, triggerEnd: triggerEnd, gap: gap)
|
best = (i, triggerEnd, gap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ enum CLIRegistry {
|
|||||||
subcommands: [
|
subcommands: [
|
||||||
descriptor(for: ServiceInstall.self),
|
descriptor(for: ServiceInstall.self),
|
||||||
descriptor(for: ServiceUninstall.self),
|
descriptor(for: ServiceUninstall.self),
|
||||||
descriptor(for: ServiceStatus.self)
|
descriptor(for: ServiceStatus.self),
|
||||||
])
|
])
|
||||||
let doctorDesc = descriptor(for: DoctorCommand.self)
|
let doctorDesc = descriptor(for: DoctorCommand.self)
|
||||||
let setupDesc = descriptor(for: SetupCommand.self)
|
let setupDesc = descriptor(for: SetupCommand.self)
|
||||||
@@ -54,7 +54,7 @@ enum CLIRegistry {
|
|||||||
startDesc,
|
startDesc,
|
||||||
stopDesc,
|
stopDesc,
|
||||||
restartDesc,
|
restartDesc,
|
||||||
statusDesc
|
statusDesc,
|
||||||
])
|
])
|
||||||
return [root]
|
return [root]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ private enum LaunchdHelper {
|
|||||||
"Label": label,
|
"Label": label,
|
||||||
"ProgramArguments": [executable, "serve"],
|
"ProgramArguments": [executable, "serve"],
|
||||||
"RunAtLoad": true,
|
"RunAtLoad": true,
|
||||||
"KeepAlive": true
|
"KeepAlive": true,
|
||||||
]
|
]
|
||||||
let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0)
|
let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0)
|
||||||
try data.write(to: plistURL)
|
try data.write(to: plistURL)
|
||||||
|
|||||||
@@ -25,101 +25,33 @@ private func dispatch(invocation: CommandInvocation) async throws {
|
|||||||
|
|
||||||
switch first {
|
switch first {
|
||||||
case "swabble":
|
case "swabble":
|
||||||
try await dispatchSwabble(parsed: parsed, path: path)
|
guard path.count >= 2 else { throw CommanderProgramError.missingSubcommand(command: "swabble") }
|
||||||
default:
|
let sub = path[1]
|
||||||
throw CommanderProgramError.unknownCommand(first)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(macOS 26.0, *)
|
|
||||||
@MainActor
|
|
||||||
private func dispatchSwabble(parsed: ParsedValues, path: [String]) async throws {
|
|
||||||
let sub = try subcommand(path, index: 1, command: "swabble")
|
|
||||||
switch sub {
|
switch sub {
|
||||||
case "mic":
|
case "serve":
|
||||||
try await dispatchMic(parsed: parsed, path: path)
|
|
||||||
case "service":
|
|
||||||
try await dispatchService(path: path)
|
|
||||||
default:
|
|
||||||
let handlers = swabbleHandlers(parsed: parsed)
|
|
||||||
guard let handler = handlers[sub] else {
|
|
||||||
throw CommanderProgramError.unknownSubcommand(command: "swabble", name: sub)
|
|
||||||
}
|
|
||||||
try await handler()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(macOS 26.0, *)
|
|
||||||
@MainActor
|
|
||||||
private func swabbleHandlers(parsed: ParsedValues) -> [String: () async throws -> Void] {
|
|
||||||
[
|
|
||||||
"serve": {
|
|
||||||
var cmd = ServeCommand(parsed: parsed)
|
var cmd = ServeCommand(parsed: parsed)
|
||||||
try await cmd.run()
|
try await cmd.run()
|
||||||
},
|
case "transcribe":
|
||||||
"transcribe": {
|
|
||||||
var cmd = TranscribeCommand(parsed: parsed)
|
var cmd = TranscribeCommand(parsed: parsed)
|
||||||
try await cmd.run()
|
try await cmd.run()
|
||||||
},
|
case "test-hook":
|
||||||
"test-hook": {
|
|
||||||
var cmd = TestHookCommand(parsed: parsed)
|
var cmd = TestHookCommand(parsed: parsed)
|
||||||
try await cmd.run()
|
try await cmd.run()
|
||||||
},
|
case "mic":
|
||||||
"doctor": {
|
guard path.count >= 3 else { throw CommanderProgramError.missingSubcommand(command: "mic") }
|
||||||
var cmd = DoctorCommand(parsed: parsed)
|
let micSub = path[2]
|
||||||
try await cmd.run()
|
if micSub == "list" {
|
||||||
},
|
|
||||||
"setup": {
|
|
||||||
var cmd = SetupCommand(parsed: parsed)
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"health": {
|
|
||||||
var cmd = HealthCommand(parsed: parsed)
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"tail-log": {
|
|
||||||
var cmd = TailLogCommand(parsed: parsed)
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"start": {
|
|
||||||
var cmd = StartCommand()
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"stop": {
|
|
||||||
var cmd = StopCommand()
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"restart": {
|
|
||||||
var cmd = RestartCommand()
|
|
||||||
try await cmd.run()
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
var cmd = StatusCommand()
|
|
||||||
try await cmd.run()
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(macOS 26.0, *)
|
|
||||||
@MainActor
|
|
||||||
private func dispatchMic(parsed: ParsedValues, path: [String]) async throws {
|
|
||||||
let micSub = try subcommand(path, index: 2, command: "mic")
|
|
||||||
switch micSub {
|
|
||||||
case "list":
|
|
||||||
var cmd = MicList(parsed: parsed)
|
var cmd = MicList(parsed: parsed)
|
||||||
try await cmd.run()
|
try await cmd.run()
|
||||||
case "set":
|
} else if micSub == "set" {
|
||||||
var cmd = MicSet(parsed: parsed)
|
var cmd = MicSet(parsed: parsed)
|
||||||
try await cmd.run()
|
try await cmd.run()
|
||||||
default:
|
} else {
|
||||||
throw CommanderProgramError.unknownSubcommand(command: "mic", name: micSub)
|
throw CommanderProgramError.unknownSubcommand(command: "mic", name: micSub)
|
||||||
}
|
}
|
||||||
}
|
case "service":
|
||||||
|
guard path.count >= 3 else { throw CommanderProgramError.missingSubcommand(command: "service") }
|
||||||
@available(macOS 26.0, *)
|
let svcSub = path[2]
|
||||||
@MainActor
|
|
||||||
private func dispatchService(path: [String]) async throws {
|
|
||||||
let svcSub = try subcommand(path, index: 2, command: "service")
|
|
||||||
switch svcSub {
|
switch svcSub {
|
||||||
case "install":
|
case "install":
|
||||||
var cmd = ServiceInstall()
|
var cmd = ServiceInstall()
|
||||||
@@ -133,13 +65,36 @@ private func dispatchService(path: [String]) async throws {
|
|||||||
default:
|
default:
|
||||||
throw CommanderProgramError.unknownSubcommand(command: "service", name: svcSub)
|
throw CommanderProgramError.unknownSubcommand(command: "service", name: svcSub)
|
||||||
}
|
}
|
||||||
|
case "doctor":
|
||||||
|
var cmd = DoctorCommand(parsed: parsed)
|
||||||
|
try await cmd.run()
|
||||||
|
case "setup":
|
||||||
|
var cmd = SetupCommand(parsed: parsed)
|
||||||
|
try await cmd.run()
|
||||||
|
case "health":
|
||||||
|
var cmd = HealthCommand(parsed: parsed)
|
||||||
|
try await cmd.run()
|
||||||
|
case "tail-log":
|
||||||
|
var cmd = TailLogCommand(parsed: parsed)
|
||||||
|
try await cmd.run()
|
||||||
|
case "start":
|
||||||
|
var cmd = StartCommand()
|
||||||
|
try await cmd.run()
|
||||||
|
case "stop":
|
||||||
|
var cmd = StopCommand()
|
||||||
|
try await cmd.run()
|
||||||
|
case "restart":
|
||||||
|
var cmd = RestartCommand()
|
||||||
|
try await cmd.run()
|
||||||
|
case "status":
|
||||||
|
var cmd = StatusCommand()
|
||||||
|
try await cmd.run()
|
||||||
|
default:
|
||||||
|
throw CommanderProgramError.unknownSubcommand(command: "swabble", name: sub)
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
private func subcommand(_ path: [String], index: Int, command: String) throws -> String {
|
throw CommanderProgramError.unknownCommand(first)
|
||||||
guard path.count > index else {
|
|
||||||
throw CommanderProgramError.missingSubcommand(command: command)
|
|
||||||
}
|
}
|
||||||
return path[index]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if #available(macOS 26.0, *) {
|
if #available(macOS 26.0, *) {
|
||||||
|
|||||||
+16
-16
@@ -2,22 +2,6 @@
|
|||||||
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
|
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
|
||||||
<channel>
|
<channel>
|
||||||
<title>Clawdbot</title>
|
<title>Clawdbot</title>
|
||||||
<item>
|
|
||||||
<title>2026.1.12-2</title>
|
|
||||||
<pubDate>Tue, 13 Jan 2026 10:05:25 +0000</pubDate>
|
|
||||||
<link>https://raw.githubusercontent.com/clawdbot/clawdbot/main/appcast.xml</link>
|
|
||||||
<sparkle:version>5534</sparkle:version>
|
|
||||||
<sparkle:shortVersionString>2026.1.12-2</sparkle:shortVersionString>
|
|
||||||
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
|
||||||
<description><![CDATA[<h2>Clawdbot 2026.1.12-2</h2>
|
|
||||||
<h3>Fixes</h3>
|
|
||||||
<ul>
|
|
||||||
<li>Packaging: include <code>dist/memory/**</code> in the npm tarball (fixes <code>ERR_MODULE_NOT_FOUND</code> for <code>dist/memory/index.js</code>).</li>
|
|
||||||
</ul>
|
|
||||||
<p><a href="https://github.com/clawdbot/clawdbot/blob/main/CHANGELOG.md">View full changelog</a></p>
|
|
||||||
]]></description>
|
|
||||||
<enclosure url="https://github.com/clawdbot/clawdbot/releases/download/v2026.1.12-2/Clawdbot-2026.1.12-2.zip" length="19854203" type="application/octet-stream" sparkle:edSignature="CVpUofNS+pl6Smk/K0Q8q35saRuuFx90s4sePABORFvGcAF1biajC8zpiImKuXpqD0ENb+VTwDJ1ul1Oxh3wDA=="/>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<title>2026.1.11-3</title>
|
<title>2026.1.11-3</title>
|
||||||
<pubDate>Mon, 12 Jan 2026 10:40:23 +0000</pubDate>
|
<pubDate>Mon, 12 Jan 2026 10:40:23 +0000</pubDate>
|
||||||
@@ -52,5 +36,21 @@
|
|||||||
]]></description>
|
]]></description>
|
||||||
<enclosure url="https://github.com/clawdbot/clawdbot/releases/download/v2026.1.11-2/Clawdbot-2026.1.11-2.zip" length="19860732" type="application/octet-stream" sparkle:edSignature="0UG+d9v3Qf5F9vs/KozUB404WpHjFBQRVoRuhwtzF8kpU7jJmmGlQzh1c61E+LMN4fHcljpxIwHHrvvIfRyrCw=="/>
|
<enclosure url="https://github.com/clawdbot/clawdbot/releases/download/v2026.1.11-2/Clawdbot-2026.1.11-2.zip" length="19860732" type="application/octet-stream" sparkle:edSignature="0UG+d9v3Qf5F9vs/KozUB404WpHjFBQRVoRuhwtzF8kpU7jJmmGlQzh1c61E+LMN4fHcljpxIwHHrvvIfRyrCw=="/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<title>2026.1.11-1</title>
|
||||||
|
<pubDate>Mon, 12 Jan 2026 09:53:46 +0000</pubDate>
|
||||||
|
<link>https://raw.githubusercontent.com/clawdbot/clawdbot/main/appcast.xml</link>
|
||||||
|
<sparkle:version>5207</sparkle:version>
|
||||||
|
<sparkle:shortVersionString>2026.1.11-1</sparkle:shortVersionString>
|
||||||
|
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
||||||
|
<description><![CDATA[<h2>Clawdbot 2026.1.11-1</h2>
|
||||||
|
<h3>Fixes</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Installer: include <code>patches/</code> in the npm package so postinstall patching works for npm/bun installs.</li>
|
||||||
|
</ul>
|
||||||
|
<p><a href="https://github.com/clawdbot/clawdbot/blob/main/CHANGELOG.md">View full changelog</a></p>
|
||||||
|
]]></description>
|
||||||
|
<enclosure url="https://github.com/clawdbot/clawdbot/releases/download/v2026.1.11-1/Clawdbot-2026.1.11-1.zip" length="19860761" type="application/octet-stream" sparkle:edSignature="CXKzzha/s6cGBeF0TMz+cV8/pfqoAL9ZyNVacYRLnnHEwA1cMbOWRftpGRhYe4HknVQYYBgNQqZK2lBxpOZgBg=="/>
|
||||||
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
@@ -187,7 +187,7 @@ actor BridgeServer {
|
|||||||
thinking: "low",
|
thinking: "low",
|
||||||
deliver: false,
|
deliver: false,
|
||||||
to: nil,
|
to: nil,
|
||||||
channel: .last))
|
provider: .last))
|
||||||
|
|
||||||
case "agent.request":
|
case "agent.request":
|
||||||
guard let json = evt.payloadJSON, let data = json.data(using: .utf8) else {
|
guard let json = evt.payloadJSON, let data = json.data(using: .utf8) else {
|
||||||
@@ -205,7 +205,7 @@ actor BridgeServer {
|
|||||||
?? "node-\(nodeId)"
|
?? "node-\(nodeId)"
|
||||||
let thinking = link.thinking?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty
|
let thinking = link.thinking?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty
|
||||||
let to = link.to?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty
|
let to = link.to?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty
|
||||||
let channel = GatewayAgentChannel(raw: link.channel)
|
let provider = GatewayAgentProvider(raw: link.channel)
|
||||||
|
|
||||||
_ = await GatewayConnection.shared.sendAgent(GatewayAgentInvocation(
|
_ = await GatewayConnection.shared.sendAgent(GatewayAgentInvocation(
|
||||||
message: message,
|
message: message,
|
||||||
@@ -213,7 +213,7 @@ actor BridgeServer {
|
|||||||
thinking: thinking,
|
thinking: thinking,
|
||||||
deliver: link.deliver,
|
deliver: link.deliver,
|
||||||
to: to,
|
to: to,
|
||||||
channel: channel))
|
provider: provider))
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ final class CanvasA2UIActionMessageHandler: NSObject, WKScriptMessageHandler {
|
|||||||
thinking: "low",
|
thinking: "low",
|
||||||
deliver: false,
|
deliver: false,
|
||||||
to: nil,
|
to: nil,
|
||||||
channel: .last,
|
provider: .last,
|
||||||
idempotencyKey: actionId))
|
idempotencyKey: actionId))
|
||||||
|
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ enum ConfigStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static let overrideStore = OverrideStore()
|
private static let overrideStore = OverrideStore()
|
||||||
@MainActor private static var lastHash: String?
|
|
||||||
|
|
||||||
private static func isRemoteMode() async -> Bool {
|
private static func isRemoteMode() async -> Bool {
|
||||||
let overrides = await self.overrideStore.overrides
|
let overrides = await self.overrideStore.overrides
|
||||||
@@ -76,7 +75,6 @@ enum ConfigStore {
|
|||||||
method: .configGet,
|
method: .configGet,
|
||||||
params: nil,
|
params: nil,
|
||||||
timeoutMs: 8000)
|
timeoutMs: 8000)
|
||||||
self.lastHash = snap.hash
|
|
||||||
return snap.config?.mapValues { $0.foundationValue } ?? [:]
|
return snap.config?.mapValues { $0.foundationValue } ?? [:]
|
||||||
} catch {
|
} catch {
|
||||||
return nil
|
return nil
|
||||||
@@ -85,24 +83,17 @@ enum ConfigStore {
|
|||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
private static func saveToGateway(_ root: [String: Any]) async throws {
|
private static func saveToGateway(_ root: [String: Any]) async throws {
|
||||||
if self.lastHash == nil {
|
|
||||||
_ = await self.loadFromGateway()
|
|
||||||
}
|
|
||||||
let data = try JSONSerialization.data(withJSONObject: root, options: [.prettyPrinted, .sortedKeys])
|
let data = try JSONSerialization.data(withJSONObject: root, options: [.prettyPrinted, .sortedKeys])
|
||||||
guard let raw = String(data: data, encoding: .utf8) else {
|
guard let raw = String(data: data, encoding: .utf8) else {
|
||||||
throw NSError(domain: "ConfigStore", code: 1, userInfo: [
|
throw NSError(domain: "ConfigStore", code: 1, userInfo: [
|
||||||
NSLocalizedDescriptionKey: "Failed to encode config.",
|
NSLocalizedDescriptionKey: "Failed to encode config.",
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
var params: [String: AnyCodable] = ["raw": AnyCodable(raw)]
|
let params: [String: AnyCodable] = ["raw": AnyCodable(raw)]
|
||||||
if let baseHash = self.lastHash {
|
|
||||||
params["baseHash"] = AnyCodable(baseHash)
|
|
||||||
}
|
|
||||||
_ = try await GatewayConnection.shared.requestRaw(
|
_ = try await GatewayConnection.shared.requestRaw(
|
||||||
method: .configSet,
|
method: .configSet,
|
||||||
params: params,
|
params: params,
|
||||||
timeoutMs: 10000)
|
timeoutMs: 10000)
|
||||||
_ = await self.loadFromGateway()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
+3
-3
@@ -11,9 +11,9 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
func channelHeaderActions(_ channel: ConnectionChannel) -> some View {
|
func providerHeaderActions(_ provider: ConnectionProvider) -> some View {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
if channel == .whatsapp {
|
if provider == .whatsapp {
|
||||||
Button("Logout") {
|
Button("Logout") {
|
||||||
Task { await self.store.logoutWhatsApp() }
|
Task { await self.store.logoutWhatsApp() }
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ extension ConnectionsSettings {
|
|||||||
.disabled(self.store.whatsappBusy)
|
.disabled(self.store.whatsappBusy)
|
||||||
}
|
}
|
||||||
|
|
||||||
if channel == .telegram {
|
if provider == .telegram {
|
||||||
Button("Logout") {
|
Button("Logout") {
|
||||||
Task { await self.store.logoutTelegram() }
|
Task { await self.store.logoutTelegram() }
|
||||||
}
|
}
|
||||||
+62
-62
@@ -1,15 +1,15 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
extension ConnectionsSettings {
|
extension ConnectionsSettings {
|
||||||
private func channelStatus<T: Decodable>(
|
private func providerStatus<T: Decodable>(
|
||||||
_ id: String,
|
_ id: String,
|
||||||
as type: T.Type) -> T?
|
as type: T.Type) -> T?
|
||||||
{
|
{
|
||||||
self.store.snapshot?.decodeChannel(id, as: type)
|
self.store.snapshot?.decodeProvider(id, as: type)
|
||||||
}
|
}
|
||||||
|
|
||||||
var whatsAppTint: Color {
|
var whatsAppTint: Color {
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return .secondary }
|
else { return .secondary }
|
||||||
if !status.configured { return .secondary }
|
if !status.configured { return .secondary }
|
||||||
if !status.linked { return .red }
|
if !status.linked { return .red }
|
||||||
@@ -20,7 +20,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var telegramTint: Color {
|
var telegramTint: Color {
|
||||||
guard let status = self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)
|
guard let status = self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)
|
||||||
else { return .secondary }
|
else { return .secondary }
|
||||||
if !status.configured { return .secondary }
|
if !status.configured { return .secondary }
|
||||||
if status.lastError != nil { return .orange }
|
if status.lastError != nil { return .orange }
|
||||||
@@ -30,7 +30,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var discordTint: Color {
|
var discordTint: Color {
|
||||||
guard let status = self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)
|
guard let status = self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)
|
||||||
else { return .secondary }
|
else { return .secondary }
|
||||||
if !status.configured { return .secondary }
|
if !status.configured { return .secondary }
|
||||||
if status.lastError != nil { return .orange }
|
if status.lastError != nil { return .orange }
|
||||||
@@ -40,7 +40,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var signalTint: Color {
|
var signalTint: Color {
|
||||||
guard let status = self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)
|
guard let status = self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)
|
||||||
else { return .secondary }
|
else { return .secondary }
|
||||||
if !status.configured { return .secondary }
|
if !status.configured { return .secondary }
|
||||||
if status.lastError != nil { return .orange }
|
if status.lastError != nil { return .orange }
|
||||||
@@ -50,7 +50,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var imessageTint: Color {
|
var imessageTint: Color {
|
||||||
guard let status = self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)
|
guard let status = self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)
|
||||||
else { return .secondary }
|
else { return .secondary }
|
||||||
if !status.configured { return .secondary }
|
if !status.configured { return .secondary }
|
||||||
if status.lastError != nil { return .orange }
|
if status.lastError != nil { return .orange }
|
||||||
@@ -60,7 +60,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var whatsAppSummary: String {
|
var whatsAppSummary: String {
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return "Checking…" }
|
else { return "Checking…" }
|
||||||
if !status.linked { return "Not linked" }
|
if !status.linked { return "Not linked" }
|
||||||
if status.connected { return "Connected" }
|
if status.connected { return "Connected" }
|
||||||
@@ -69,7 +69,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var telegramSummary: String {
|
var telegramSummary: String {
|
||||||
guard let status = self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)
|
guard let status = self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)
|
||||||
else { return "Checking…" }
|
else { return "Checking…" }
|
||||||
if !status.configured { return "Not configured" }
|
if !status.configured { return "Not configured" }
|
||||||
if status.running { return "Running" }
|
if status.running { return "Running" }
|
||||||
@@ -77,7 +77,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var discordSummary: String {
|
var discordSummary: String {
|
||||||
guard let status = self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)
|
guard let status = self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)
|
||||||
else { return "Checking…" }
|
else { return "Checking…" }
|
||||||
if !status.configured { return "Not configured" }
|
if !status.configured { return "Not configured" }
|
||||||
if status.running { return "Running" }
|
if status.running { return "Running" }
|
||||||
@@ -85,7 +85,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var signalSummary: String {
|
var signalSummary: String {
|
||||||
guard let status = self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)
|
guard let status = self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)
|
||||||
else { return "Checking…" }
|
else { return "Checking…" }
|
||||||
if !status.configured { return "Not configured" }
|
if !status.configured { return "Not configured" }
|
||||||
if status.running { return "Running" }
|
if status.running { return "Running" }
|
||||||
@@ -93,7 +93,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var imessageSummary: String {
|
var imessageSummary: String {
|
||||||
guard let status = self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)
|
guard let status = self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)
|
||||||
else { return "Checking…" }
|
else { return "Checking…" }
|
||||||
if !status.configured { return "Not configured" }
|
if !status.configured { return "Not configured" }
|
||||||
if status.running { return "Running" }
|
if status.running { return "Running" }
|
||||||
@@ -101,7 +101,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var whatsAppDetails: String? {
|
var whatsAppDetails: String? {
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
var lines: [String] = []
|
var lines: [String] = []
|
||||||
if let e164 = status.`self`?.e164 ?? status.`self`?.jid {
|
if let e164 = status.`self`?.e164 ?? status.`self`?.jid {
|
||||||
@@ -132,7 +132,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var telegramDetails: String? {
|
var telegramDetails: String? {
|
||||||
guard let status = self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)
|
guard let status = self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
var lines: [String] = []
|
var lines: [String] = []
|
||||||
if let source = status.tokenSource {
|
if let source = status.tokenSource {
|
||||||
@@ -164,7 +164,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var discordDetails: String? {
|
var discordDetails: String? {
|
||||||
guard let status = self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)
|
guard let status = self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
var lines: [String] = []
|
var lines: [String] = []
|
||||||
if let source = status.tokenSource {
|
if let source = status.tokenSource {
|
||||||
@@ -193,7 +193,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var signalDetails: String? {
|
var signalDetails: String? {
|
||||||
guard let status = self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)
|
guard let status = self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
var lines: [String] = []
|
var lines: [String] = []
|
||||||
lines.append("Base URL: \(status.baseUrl)")
|
lines.append("Base URL: \(status.baseUrl)")
|
||||||
@@ -220,7 +220,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var imessageDetails: String? {
|
var imessageDetails: String? {
|
||||||
guard let status = self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)
|
guard let status = self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
var lines: [String] = []
|
var lines: [String] = []
|
||||||
if let cliPath = status.cliPath, !cliPath.isEmpty {
|
if let cliPath = status.cliPath, !cliPath.isEmpty {
|
||||||
@@ -243,68 +243,68 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var isTelegramTokenLocked: Bool {
|
var isTelegramTokenLocked: Bool {
|
||||||
self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)?.tokenSource == "env"
|
self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)?.tokenSource == "env"
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDiscordTokenLocked: Bool {
|
var isDiscordTokenLocked: Bool {
|
||||||
self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)?.tokenSource == "env"
|
self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)?.tokenSource == "env"
|
||||||
}
|
}
|
||||||
|
|
||||||
var orderedChannels: [ConnectionChannel] {
|
var orderedProviders: [ConnectionProvider] {
|
||||||
ConnectionChannel.allCases.sorted { lhs, rhs in
|
ConnectionProvider.allCases.sorted { lhs, rhs in
|
||||||
let lhsEnabled = self.channelEnabled(lhs)
|
let lhsEnabled = self.providerEnabled(lhs)
|
||||||
let rhsEnabled = self.channelEnabled(rhs)
|
let rhsEnabled = self.providerEnabled(rhs)
|
||||||
if lhsEnabled != rhsEnabled { return lhsEnabled && !rhsEnabled }
|
if lhsEnabled != rhsEnabled { return lhsEnabled && !rhsEnabled }
|
||||||
return lhs.sortOrder < rhs.sortOrder
|
return lhs.sortOrder < rhs.sortOrder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var enabledChannels: [ConnectionChannel] {
|
var enabledProviders: [ConnectionProvider] {
|
||||||
self.orderedChannels.filter { self.channelEnabled($0) }
|
self.orderedProviders.filter { self.providerEnabled($0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var availableChannels: [ConnectionChannel] {
|
var availableProviders: [ConnectionProvider] {
|
||||||
self.orderedChannels.filter { !self.channelEnabled($0) }
|
self.orderedProviders.filter { !self.providerEnabled($0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
func ensureSelection() {
|
func ensureSelection() {
|
||||||
guard let selected = self.selectedChannel else {
|
guard let selected = self.selectedProvider else {
|
||||||
self.selectedChannel = self.orderedChannels.first
|
self.selectedProvider = self.orderedProviders.first
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !self.orderedChannels.contains(selected) {
|
if !self.orderedProviders.contains(selected) {
|
||||||
self.selectedChannel = self.orderedChannels.first
|
self.selectedProvider = self.orderedProviders.first
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelEnabled(_ channel: ConnectionChannel) -> Bool {
|
func providerEnabled(_ provider: ConnectionProvider) -> Bool {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.configured || status.linked || status.running
|
return status.configured || status.linked || status.running
|
||||||
case .telegram:
|
case .telegram:
|
||||||
guard let status = self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)
|
guard let status = self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.configured || status.running
|
return status.configured || status.running
|
||||||
case .discord:
|
case .discord:
|
||||||
guard let status = self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)
|
guard let status = self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.configured || status.running
|
return status.configured || status.running
|
||||||
case .signal:
|
case .signal:
|
||||||
guard let status = self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)
|
guard let status = self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.configured || status.running
|
return status.configured || status.running
|
||||||
case .imessage:
|
case .imessage:
|
||||||
guard let status = self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)
|
guard let status = self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.configured || status.running
|
return status.configured || status.running
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
func channelSection(_ channel: ConnectionChannel) -> some View {
|
func providerSection(_ provider: ConnectionProvider) -> some View {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
self.whatsAppSection
|
self.whatsAppSection
|
||||||
case .telegram:
|
case .telegram:
|
||||||
@@ -318,8 +318,8 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelTint(_ channel: ConnectionChannel) -> Color {
|
func providerTint(_ provider: ConnectionProvider) -> Color {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
self.whatsAppTint
|
self.whatsAppTint
|
||||||
case .telegram:
|
case .telegram:
|
||||||
@@ -333,8 +333,8 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelSummary(_ channel: ConnectionChannel) -> String {
|
func providerSummary(_ provider: ConnectionProvider) -> String {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
self.whatsAppSummary
|
self.whatsAppSummary
|
||||||
case .telegram:
|
case .telegram:
|
||||||
@@ -348,8 +348,8 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelDetails(_ channel: ConnectionChannel) -> String? {
|
func providerDetails(_ provider: ConnectionProvider) -> String? {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
self.whatsAppDetails
|
self.whatsAppDetails
|
||||||
case .telegram:
|
case .telegram:
|
||||||
@@ -363,55 +363,55 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelLastCheckText(_ channel: ConnectionChannel) -> String {
|
func providerLastCheckText(_ provider: ConnectionProvider) -> String {
|
||||||
guard let date = self.channelLastCheck(channel) else { return "never" }
|
guard let date = self.providerLastCheck(provider) else { return "never" }
|
||||||
return relativeAge(from: date)
|
return relativeAge(from: date)
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelLastCheck(_ channel: ConnectionChannel) -> Date? {
|
func providerLastCheck(_ provider: ConnectionProvider) -> Date? {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return nil }
|
else { return nil }
|
||||||
return self.date(fromMs: status.lastEventAt ?? status.lastMessageAt ?? status.lastConnectedAt)
|
return self.date(fromMs: status.lastEventAt ?? status.lastMessageAt ?? status.lastConnectedAt)
|
||||||
case .telegram:
|
case .telegram:
|
||||||
return self
|
return self
|
||||||
.date(fromMs: self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)?
|
.date(fromMs: self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)?
|
||||||
.lastProbeAt)
|
.lastProbeAt)
|
||||||
case .discord:
|
case .discord:
|
||||||
return self
|
return self
|
||||||
.date(fromMs: self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)?
|
.date(fromMs: self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)?
|
||||||
.lastProbeAt)
|
.lastProbeAt)
|
||||||
case .signal:
|
case .signal:
|
||||||
return self
|
return self
|
||||||
.date(fromMs: self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)?.lastProbeAt)
|
.date(fromMs: self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)?.lastProbeAt)
|
||||||
case .imessage:
|
case .imessage:
|
||||||
return self
|
return self
|
||||||
.date(fromMs: self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)?
|
.date(fromMs: self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)?
|
||||||
.lastProbeAt)
|
.lastProbeAt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func channelHasError(_ channel: ConnectionChannel) -> Bool {
|
func providerHasError(_ provider: ConnectionProvider) -> Bool {
|
||||||
switch channel {
|
switch provider {
|
||||||
case .whatsapp:
|
case .whatsapp:
|
||||||
guard let status = self.channelStatus("whatsapp", as: ChannelsStatusSnapshot.WhatsAppStatus.self)
|
guard let status = self.providerStatus("whatsapp", as: ProvidersStatusSnapshot.WhatsAppStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.lastError?.isEmpty == false || status.lastDisconnect?.loggedOut == true
|
return status.lastError?.isEmpty == false || status.lastDisconnect?.loggedOut == true
|
||||||
case .telegram:
|
case .telegram:
|
||||||
guard let status = self.channelStatus("telegram", as: ChannelsStatusSnapshot.TelegramStatus.self)
|
guard let status = self.providerStatus("telegram", as: ProvidersStatusSnapshot.TelegramStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
||||||
case .discord:
|
case .discord:
|
||||||
guard let status = self.channelStatus("discord", as: ChannelsStatusSnapshot.DiscordStatus.self)
|
guard let status = self.providerStatus("discord", as: ProvidersStatusSnapshot.DiscordStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
||||||
case .signal:
|
case .signal:
|
||||||
guard let status = self.channelStatus("signal", as: ChannelsStatusSnapshot.SignalStatus.self)
|
guard let status = self.providerStatus("signal", as: ProvidersStatusSnapshot.SignalStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
||||||
case .imessage:
|
case .imessage:
|
||||||
guard let status = self.channelStatus("imessage", as: ChannelsStatusSnapshot.IMessageStatus.self)
|
guard let status = self.providerStatus("imessage", as: ProvidersStatusSnapshot.IMessageStatus.self)
|
||||||
else { return false }
|
else { return false }
|
||||||
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
return status.lastError?.isEmpty == false || status.probe?.ok == false
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ extension ConnectionsSettings {
|
|||||||
self.store.start()
|
self.store.start()
|
||||||
self.ensureSelection()
|
self.ensureSelection()
|
||||||
}
|
}
|
||||||
.onChange(of: self.orderedChannels) { _, _ in
|
.onChange(of: self.orderedProviders) { _, _ in
|
||||||
self.ensureSelection()
|
self.ensureSelection()
|
||||||
}
|
}
|
||||||
.onDisappear { self.store.stop() }
|
.onDisappear { self.store.stop() }
|
||||||
@@ -20,17 +20,17 @@ extension ConnectionsSettings {
|
|||||||
private var sidebar: some View {
|
private var sidebar: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(alignment: .leading, spacing: 8) {
|
LazyVStack(alignment: .leading, spacing: 8) {
|
||||||
if !self.enabledChannels.isEmpty {
|
if !self.enabledProviders.isEmpty {
|
||||||
self.sidebarSectionHeader("Configured")
|
self.sidebarSectionHeader("Configured")
|
||||||
ForEach(self.enabledChannels) { channel in
|
ForEach(self.enabledProviders) { provider in
|
||||||
self.sidebarRow(channel)
|
self.sidebarRow(provider)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.availableChannels.isEmpty {
|
if !self.availableProviders.isEmpty {
|
||||||
self.sidebarSectionHeader("Available")
|
self.sidebarSectionHeader("Available")
|
||||||
ForEach(self.availableChannels) { channel in
|
ForEach(self.availableProviders) { provider in
|
||||||
self.sidebarRow(channel)
|
self.sidebarRow(provider)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,8 +46,8 @@ extension ConnectionsSettings {
|
|||||||
|
|
||||||
private var detail: some View {
|
private var detail: some View {
|
||||||
Group {
|
Group {
|
||||||
if let channel = self.selectedChannel {
|
if let provider = self.selectedProvider {
|
||||||
self.channelDetail(channel)
|
self.providerDetail(provider)
|
||||||
} else {
|
} else {
|
||||||
self.emptyDetail
|
self.emptyDetail
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ extension ConnectionsSettings {
|
|||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("Connections")
|
Text("Connections")
|
||||||
.font(.title3.weight(.semibold))
|
.font(.title3.weight(.semibold))
|
||||||
Text("Select a channel to view status and settings.")
|
Text("Select a provider to view status and settings.")
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
@@ -67,12 +67,12 @@ extension ConnectionsSettings {
|
|||||||
.padding(.vertical, 18)
|
.padding(.vertical, 18)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func channelDetail(_ channel: ConnectionChannel) -> some View {
|
private func providerDetail(_ provider: ConnectionProvider) -> some View {
|
||||||
ScrollView(.vertical) {
|
ScrollView(.vertical) {
|
||||||
VStack(alignment: .leading, spacing: 16) {
|
VStack(alignment: .leading, spacing: 16) {
|
||||||
self.detailHeader(for: channel)
|
self.detailHeader(for: provider)
|
||||||
Divider()
|
Divider()
|
||||||
self.channelSection(channel)
|
self.providerSection(provider)
|
||||||
Spacer(minLength: 0)
|
Spacer(minLength: 0)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
@@ -81,18 +81,18 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func sidebarRow(_ channel: ConnectionChannel) -> some View {
|
private func sidebarRow(_ provider: ConnectionProvider) -> some View {
|
||||||
let isSelected = self.selectedChannel == channel
|
let isSelected = self.selectedProvider == provider
|
||||||
return Button {
|
return Button {
|
||||||
self.selectedChannel = channel
|
self.selectedProvider = provider
|
||||||
} label: {
|
} label: {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
Circle()
|
Circle()
|
||||||
.fill(self.channelTint(channel))
|
.fill(self.providerTint(provider))
|
||||||
.frame(width: 8, height: 8)
|
.frame(width: 8, height: 8)
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
Text(channel.title)
|
Text(provider.title)
|
||||||
Text(self.channelSummary(channel))
|
Text(self.providerSummary(provider))
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
@@ -119,23 +119,23 @@ extension ConnectionsSettings {
|
|||||||
.padding(.top, 2)
|
.padding(.top, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func detailHeader(for channel: ConnectionChannel) -> some View {
|
private func detailHeader(for provider: ConnectionProvider) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
HStack(alignment: .firstTextBaseline, spacing: 10) {
|
HStack(alignment: .firstTextBaseline, spacing: 10) {
|
||||||
Label(channel.detailTitle, systemImage: channel.systemImage)
|
Label(provider.detailTitle, systemImage: provider.systemImage)
|
||||||
.font(.title3.weight(.semibold))
|
.font(.title3.weight(.semibold))
|
||||||
self.statusBadge(
|
self.statusBadge(
|
||||||
self.channelSummary(channel),
|
self.providerSummary(provider),
|
||||||
color: self.channelTint(channel))
|
color: self.providerTint(provider))
|
||||||
Spacer()
|
Spacer()
|
||||||
self.channelHeaderActions(channel)
|
self.providerHeaderActions(provider)
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack(spacing: 10) {
|
HStack(spacing: 10) {
|
||||||
Text("Last check \(self.channelLastCheckText(channel))")
|
Text("Last check \(self.providerLastCheckText(provider))")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
if self.channelHasError(channel) {
|
if self.providerHasError(provider) {
|
||||||
Text("Error")
|
Text("Error")
|
||||||
.font(.caption2.weight(.semibold))
|
.font(.caption2.weight(.semibold))
|
||||||
.padding(.horizontal, 6)
|
.padding(.horizontal, 6)
|
||||||
@@ -146,7 +146,7 @@ extension ConnectionsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let details = self.channelDetails(channel) {
|
if let details = self.providerDetails(provider) {
|
||||||
Text(details)
|
Text(details)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import AppKit
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct ConnectionsSettings: View {
|
struct ConnectionsSettings: View {
|
||||||
enum ConnectionChannel: String, CaseIterable, Identifiable, Hashable {
|
enum ConnectionProvider: String, CaseIterable, Identifiable, Hashable {
|
||||||
case whatsapp
|
case whatsapp
|
||||||
case telegram
|
case telegram
|
||||||
case discord
|
case discord
|
||||||
@@ -53,7 +53,7 @@ struct ConnectionsSettings: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bindable var store: ConnectionsStore
|
@Bindable var store: ConnectionsStore
|
||||||
@State var selectedChannel: ConnectionChannel?
|
@State var selectedProvider: ConnectionProvider?
|
||||||
@State var showTelegramToken = false
|
@State var showTelegramToken = false
|
||||||
@State var showDiscordToken = false
|
@State var showDiscordToken = false
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ extension ConnectionsStore {
|
|||||||
? "Config invalid; fix it in ~/.clawdbot/clawdbot.json."
|
? "Config invalid; fix it in ~/.clawdbot/clawdbot.json."
|
||||||
: nil
|
: nil
|
||||||
self.configRoot = snap.config?.mapValues { $0.foundationValue } ?? [:]
|
self.configRoot = snap.config?.mapValues { $0.foundationValue } ?? [:]
|
||||||
self.configHash = snap.hash
|
|
||||||
self.configLoaded = true
|
self.configLoaded = true
|
||||||
|
|
||||||
self.applyUIConfig(snap)
|
self.applyUIConfig(snap)
|
||||||
@@ -35,22 +34,10 @@ extension ConnectionsStore {
|
|||||||
AppStateStore.shared.seamColorHex = rawSeam.isEmpty ? nil : rawSeam
|
AppStateStore.shared.seamColorHex = rawSeam.isEmpty ? nil : rawSeam
|
||||||
}
|
}
|
||||||
|
|
||||||
private func resolveChannelConfig(_ snap: ConfigSnapshot, key: String) -> [String: AnyCodable]? {
|
|
||||||
if let channels = snap.config?["channels"]?.dictionaryValue,
|
|
||||||
let entry = channels[key]?.dictionaryValue {
|
|
||||||
return entry
|
|
||||||
}
|
|
||||||
return snap.config?[key]?.dictionaryValue
|
|
||||||
}
|
|
||||||
|
|
||||||
private func applyTelegramConfig(_ snap: ConfigSnapshot) {
|
private func applyTelegramConfig(_ snap: ConfigSnapshot) {
|
||||||
let telegram = self.resolveChannelConfig(snap, key: "telegram")
|
let telegram = snap.config?["telegram"]?.dictionaryValue
|
||||||
self.telegramToken = telegram?["botToken"]?.stringValue ?? ""
|
self.telegramToken = telegram?["botToken"]?.stringValue ?? ""
|
||||||
let groups = telegram?["groups"]?.dictionaryValue
|
self.telegramRequireMention = telegram?["requireMention"]?.boolValue ?? true
|
||||||
let defaultGroup = groups?["*"]?.dictionaryValue
|
|
||||||
self.telegramRequireMention = defaultGroup?["requireMention"]?.boolValue
|
|
||||||
?? telegram?["requireMention"]?.boolValue
|
|
||||||
?? true
|
|
||||||
self.telegramAllowFrom = self.stringList(from: telegram?["allowFrom"]?.arrayValue)
|
self.telegramAllowFrom = self.stringList(from: telegram?["allowFrom"]?.arrayValue)
|
||||||
self.telegramProxy = telegram?["proxy"]?.stringValue ?? ""
|
self.telegramProxy = telegram?["proxy"]?.stringValue ?? ""
|
||||||
self.telegramWebhookUrl = telegram?["webhookUrl"]?.stringValue ?? ""
|
self.telegramWebhookUrl = telegram?["webhookUrl"]?.stringValue ?? ""
|
||||||
@@ -59,7 +46,7 @@ extension ConnectionsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func applyDiscordConfig(_ snap: ConfigSnapshot) {
|
private func applyDiscordConfig(_ snap: ConfigSnapshot) {
|
||||||
let discord = self.resolveChannelConfig(snap, key: "discord")
|
let discord = snap.config?["discord"]?.dictionaryValue
|
||||||
self.discordEnabled = discord?["enabled"]?.boolValue ?? true
|
self.discordEnabled = discord?["enabled"]?.boolValue ?? true
|
||||||
self.discordToken = discord?["token"]?.stringValue ?? ""
|
self.discordToken = discord?["token"]?.stringValue ?? ""
|
||||||
|
|
||||||
@@ -135,7 +122,7 @@ extension ConnectionsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func applySignalConfig(_ snap: ConfigSnapshot) {
|
private func applySignalConfig(_ snap: ConfigSnapshot) {
|
||||||
let signal = self.resolveChannelConfig(snap, key: "signal")
|
let signal = snap.config?["signal"]?.dictionaryValue
|
||||||
self.signalEnabled = signal?["enabled"]?.boolValue ?? true
|
self.signalEnabled = signal?["enabled"]?.boolValue ?? true
|
||||||
self.signalAccount = signal?["account"]?.stringValue ?? ""
|
self.signalAccount = signal?["account"]?.stringValue ?? ""
|
||||||
self.signalHttpUrl = signal?["httpUrl"]?.stringValue ?? ""
|
self.signalHttpUrl = signal?["httpUrl"]?.stringValue ?? ""
|
||||||
@@ -152,7 +139,7 @@ extension ConnectionsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func applyIMessageConfig(_ snap: ConfigSnapshot) {
|
private func applyIMessageConfig(_ snap: ConfigSnapshot) {
|
||||||
let imessage = self.resolveChannelConfig(snap, key: "imessage")
|
let imessage = snap.config?["imessage"]?.dictionaryValue
|
||||||
self.imessageEnabled = imessage?["enabled"]?.boolValue ?? true
|
self.imessageEnabled = imessage?["enabled"]?.boolValue ?? true
|
||||||
self.imessageCliPath = imessage?["cliPath"]?.stringValue ?? ""
|
self.imessageCliPath = imessage?["cliPath"]?.stringValue ?? ""
|
||||||
self.imessageDbPath = imessage?["dbPath"]?.stringValue ?? ""
|
self.imessageDbPath = imessage?["dbPath"]?.stringValue ?? ""
|
||||||
@@ -163,15 +150,6 @@ extension ConnectionsStore {
|
|||||||
self.imessageMediaMaxMb = self.numberString(from: imessage?["mediaMaxMb"])
|
self.imessageMediaMaxMb = self.numberString(from: imessage?["mediaMaxMb"])
|
||||||
}
|
}
|
||||||
|
|
||||||
private func channelConfigRoot(for key: String) -> [String: Any] {
|
|
||||||
if let channels = self.configRoot["channels"] as? [String: Any],
|
|
||||||
let entry = channels[key] as? [String: Any]
|
|
||||||
{
|
|
||||||
return entry
|
|
||||||
}
|
|
||||||
return self.configRoot[key] as? [String: Any] ?? [:]
|
|
||||||
}
|
|
||||||
|
|
||||||
func saveTelegramConfig() async {
|
func saveTelegramConfig() async {
|
||||||
guard !self.isSavingConfig else { return }
|
guard !self.isSavingConfig else { return }
|
||||||
self.isSavingConfig = true
|
self.isSavingConfig = true
|
||||||
@@ -180,24 +158,30 @@ extension ConnectionsStore {
|
|||||||
await self.loadConfig()
|
await self.loadConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
var telegram: [String: Any] = [:]
|
var telegram: [String: Any] = (self.configRoot["telegram"] as? [String: Any]) ?? [:]
|
||||||
if !self.isTelegramTokenLocked {
|
let token = self.trimmed(self.telegramToken)
|
||||||
self.setPatchString(&telegram, key: "botToken", value: self.telegramToken)
|
if token.isEmpty {
|
||||||
|
telegram.removeValue(forKey: "botToken")
|
||||||
|
} else {
|
||||||
|
telegram["botToken"] = token
|
||||||
}
|
}
|
||||||
telegram["requireMention"] = NSNull()
|
|
||||||
telegram["groups"] = [
|
|
||||||
"*": [
|
|
||||||
"requireMention": self.telegramRequireMention,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
let allow = self.splitCsv(self.telegramAllowFrom)
|
|
||||||
self.setPatchList(&telegram, key: "allowFrom", values: allow)
|
|
||||||
self.setPatchString(&telegram, key: "proxy", value: self.telegramProxy)
|
|
||||||
self.setPatchString(&telegram, key: "webhookUrl", value: self.telegramWebhookUrl)
|
|
||||||
self.setPatchString(&telegram, key: "webhookSecret", value: self.telegramWebhookSecret)
|
|
||||||
self.setPatchString(&telegram, key: "webhookPath", value: self.telegramWebhookPath)
|
|
||||||
|
|
||||||
await self.persistChannelPatch("telegram", payload: telegram)
|
telegram["requireMention"] = self.telegramRequireMention
|
||||||
|
|
||||||
|
let allow = self.splitCsv(self.telegramAllowFrom)
|
||||||
|
if allow.isEmpty {
|
||||||
|
telegram.removeValue(forKey: "allowFrom")
|
||||||
|
} else {
|
||||||
|
telegram["allowFrom"] = allow
|
||||||
|
}
|
||||||
|
|
||||||
|
self.setOptionalString(&telegram, key: "proxy", value: self.telegramProxy)
|
||||||
|
self.setOptionalString(&telegram, key: "webhookUrl", value: self.telegramWebhookUrl)
|
||||||
|
self.setOptionalString(&telegram, key: "webhookSecret", value: self.telegramWebhookSecret)
|
||||||
|
self.setOptionalString(&telegram, key: "webhookPath", value: self.telegramWebhookPath)
|
||||||
|
|
||||||
|
self.setSection("telegram", payload: telegram)
|
||||||
|
await self.persistConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveDiscordConfig() async {
|
func saveDiscordConfig() async {
|
||||||
@@ -208,9 +192,9 @@ extension ConnectionsStore {
|
|||||||
await self.loadConfig()
|
await self.loadConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
let base = self.channelConfigRoot(for: "discord")
|
let discord = self.buildDiscordConfig()
|
||||||
let discord = self.buildDiscordPatch(base: base)
|
self.setSection("discord", payload: discord)
|
||||||
await self.persistChannelPatch("discord", payload: discord)
|
await self.persistConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveSignalConfig() async {
|
func saveSignalConfig() async {
|
||||||
@@ -221,23 +205,42 @@ extension ConnectionsStore {
|
|||||||
await self.loadConfig()
|
await self.loadConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
var signal: [String: Any] = [:]
|
var signal: [String: Any] = (self.configRoot["signal"] as? [String: Any]) ?? [:]
|
||||||
self.setPatchBool(&signal, key: "enabled", value: self.signalEnabled, defaultValue: true)
|
if self.signalEnabled {
|
||||||
self.setPatchString(&signal, key: "account", value: self.signalAccount)
|
signal.removeValue(forKey: "enabled")
|
||||||
self.setPatchString(&signal, key: "httpUrl", value: self.signalHttpUrl)
|
} else {
|
||||||
self.setPatchString(&signal, key: "httpHost", value: self.signalHttpHost)
|
signal["enabled"] = false
|
||||||
self.setPatchNumber(&signal, key: "httpPort", value: self.signalHttpPort)
|
}
|
||||||
self.setPatchString(&signal, key: "cliPath", value: self.signalCliPath)
|
|
||||||
self.setPatchBool(&signal, key: "autoStart", value: self.signalAutoStart, defaultValue: true)
|
|
||||||
self.setPatchString(&signal, key: "receiveMode", value: self.signalReceiveMode)
|
|
||||||
self.setPatchBool(&signal, key: "ignoreAttachments", value: self.signalIgnoreAttachments, defaultValue: false)
|
|
||||||
self.setPatchBool(&signal, key: "ignoreStories", value: self.signalIgnoreStories, defaultValue: false)
|
|
||||||
self.setPatchBool(&signal, key: "sendReadReceipts", value: self.signalSendReadReceipts, defaultValue: false)
|
|
||||||
let allow = self.splitCsv(self.signalAllowFrom)
|
|
||||||
self.setPatchList(&signal, key: "allowFrom", values: allow)
|
|
||||||
self.setPatchNumber(&signal, key: "mediaMaxMb", value: self.signalMediaMaxMb)
|
|
||||||
|
|
||||||
await self.persistChannelPatch("signal", payload: signal)
|
self.setOptionalString(&signal, key: "account", value: self.signalAccount)
|
||||||
|
self.setOptionalString(&signal, key: "httpUrl", value: self.signalHttpUrl)
|
||||||
|
self.setOptionalString(&signal, key: "httpHost", value: self.signalHttpHost)
|
||||||
|
self.setOptionalNumber(&signal, key: "httpPort", value: self.signalHttpPort)
|
||||||
|
self.setOptionalString(&signal, key: "cliPath", value: self.signalCliPath)
|
||||||
|
|
||||||
|
if self.signalAutoStart {
|
||||||
|
signal.removeValue(forKey: "autoStart")
|
||||||
|
} else {
|
||||||
|
signal["autoStart"] = false
|
||||||
|
}
|
||||||
|
|
||||||
|
self.setOptionalString(&signal, key: "receiveMode", value: self.signalReceiveMode)
|
||||||
|
|
||||||
|
self.setOptionalBool(&signal, key: "ignoreAttachments", value: self.signalIgnoreAttachments)
|
||||||
|
self.setOptionalBool(&signal, key: "ignoreStories", value: self.signalIgnoreStories)
|
||||||
|
self.setOptionalBool(&signal, key: "sendReadReceipts", value: self.signalSendReadReceipts)
|
||||||
|
|
||||||
|
let allow = self.splitCsv(self.signalAllowFrom)
|
||||||
|
if allow.isEmpty {
|
||||||
|
signal.removeValue(forKey: "allowFrom")
|
||||||
|
} else {
|
||||||
|
signal["allowFrom"] = allow
|
||||||
|
}
|
||||||
|
|
||||||
|
self.setOptionalNumber(&signal, key: "mediaMaxMb", value: self.signalMediaMaxMb)
|
||||||
|
|
||||||
|
self.setSection("signal", payload: signal)
|
||||||
|
await self.persistConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveIMessageConfig() async {
|
func saveIMessageConfig() async {
|
||||||
@@ -248,168 +251,147 @@ extension ConnectionsStore {
|
|||||||
await self.loadConfig()
|
await self.loadConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
var imessage: [String: Any] = [:]
|
var imessage: [String: Any] = (self.configRoot["imessage"] as? [String: Any]) ?? [:]
|
||||||
self.setPatchBool(&imessage, key: "enabled", value: self.imessageEnabled, defaultValue: true)
|
if self.imessageEnabled {
|
||||||
self.setPatchString(&imessage, key: "cliPath", value: self.imessageCliPath)
|
imessage.removeValue(forKey: "enabled")
|
||||||
self.setPatchString(&imessage, key: "dbPath", value: self.imessageDbPath)
|
} else {
|
||||||
|
imessage["enabled"] = false
|
||||||
|
}
|
||||||
|
|
||||||
|
self.setOptionalString(&imessage, key: "cliPath", value: self.imessageCliPath)
|
||||||
|
self.setOptionalString(&imessage, key: "dbPath", value: self.imessageDbPath)
|
||||||
|
|
||||||
let service = self.trimmed(self.imessageService)
|
let service = self.trimmed(self.imessageService)
|
||||||
if service.isEmpty || service == "auto" {
|
if service.isEmpty || service == "auto" {
|
||||||
imessage["service"] = NSNull()
|
imessage.removeValue(forKey: "service")
|
||||||
} else {
|
} else {
|
||||||
imessage["service"] = service
|
imessage["service"] = service
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setPatchString(&imessage, key: "region", value: self.imessageRegion)
|
self.setOptionalString(&imessage, key: "region", value: self.imessageRegion)
|
||||||
|
|
||||||
let allow = self.splitCsv(self.imessageAllowFrom)
|
let allow = self.splitCsv(self.imessageAllowFrom)
|
||||||
self.setPatchList(&imessage, key: "allowFrom", values: allow)
|
if allow.isEmpty {
|
||||||
|
imessage.removeValue(forKey: "allowFrom")
|
||||||
self.setPatchBool(
|
} else {
|
||||||
&imessage,
|
imessage["allowFrom"] = allow
|
||||||
key: "includeAttachments",
|
|
||||||
value: self.imessageIncludeAttachments,
|
|
||||||
defaultValue: false)
|
|
||||||
self.setPatchNumber(&imessage, key: "mediaMaxMb", value: self.imessageMediaMaxMb)
|
|
||||||
|
|
||||||
await self.persistChannelPatch("imessage", payload: imessage)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildDiscordPatch(base: [String: Any]) -> [String: Any] {
|
self.setOptionalBool(&imessage, key: "includeAttachments", value: self.imessageIncludeAttachments)
|
||||||
var discord: [String: Any] = [:]
|
self.setOptionalNumber(&imessage, key: "mediaMaxMb", value: self.imessageMediaMaxMb)
|
||||||
self.setPatchBool(&discord, key: "enabled", value: self.discordEnabled, defaultValue: true)
|
|
||||||
if !self.isDiscordTokenLocked {
|
self.setSection("imessage", payload: imessage)
|
||||||
self.setPatchString(&discord, key: "token", value: self.discordToken)
|
await self.persistConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let dm = self.buildDiscordDmPatch() {
|
private func buildDiscordConfig() -> [String: Any] {
|
||||||
|
var discord: [String: Any] = (self.configRoot["discord"] as? [String: Any]) ?? [:]
|
||||||
|
if self.discordEnabled {
|
||||||
|
discord.removeValue(forKey: "enabled")
|
||||||
|
} else {
|
||||||
|
discord["enabled"] = false
|
||||||
|
}
|
||||||
|
self.setOptionalString(&discord, key: "token", value: self.discordToken)
|
||||||
|
|
||||||
|
if let dm = self.buildDiscordDmConfig(base: discord["dm"] as? [String: Any] ?? [:]) {
|
||||||
discord["dm"] = dm
|
discord["dm"] = dm
|
||||||
} else {
|
} else {
|
||||||
discord["dm"] = NSNull()
|
discord.removeValue(forKey: "dm")
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setPatchNumber(&discord, key: "mediaMaxMb", value: self.discordMediaMaxMb)
|
self.setOptionalNumber(&discord, key: "mediaMaxMb", value: self.discordMediaMaxMb)
|
||||||
self.setPatchInt(&discord, key: "historyLimit", value: self.discordHistoryLimit, allowZero: true)
|
self.setOptionalInt(&discord, key: "historyLimit", value: self.discordHistoryLimit, allowZero: true)
|
||||||
self.setPatchInt(&discord, key: "textChunkLimit", value: self.discordTextChunkLimit, allowZero: false)
|
self.setOptionalInt(&discord, key: "textChunkLimit", value: self.discordTextChunkLimit, allowZero: false)
|
||||||
|
|
||||||
let replyToMode = self.trimmed(self.discordReplyToMode)
|
let replyToMode = self.trimmed(self.discordReplyToMode)
|
||||||
if replyToMode.isEmpty || replyToMode == "off" || !["first", "all"].contains(replyToMode) {
|
if replyToMode.isEmpty || replyToMode == "off" {
|
||||||
discord["replyToMode"] = NSNull()
|
discord.removeValue(forKey: "replyToMode")
|
||||||
} else {
|
} else if ["first", "all"].contains(replyToMode) {
|
||||||
discord["replyToMode"] = replyToMode
|
discord["replyToMode"] = replyToMode
|
||||||
|
} else {
|
||||||
|
discord.removeValue(forKey: "replyToMode")
|
||||||
}
|
}
|
||||||
|
|
||||||
let baseGuilds = base["guilds"] as? [String: Any] ?? [:]
|
if let guilds = self.buildDiscordGuildsConfig() {
|
||||||
if let guilds = self.buildDiscordGuildsPatch(base: baseGuilds) {
|
|
||||||
discord["guilds"] = guilds
|
discord["guilds"] = guilds
|
||||||
} else {
|
} else {
|
||||||
discord["guilds"] = NSNull()
|
discord.removeValue(forKey: "guilds")
|
||||||
}
|
}
|
||||||
|
|
||||||
if let actions = self.buildDiscordActionsPatch() {
|
if let actions = self.buildDiscordActionsConfig(base: discord["actions"] as? [String: Any] ?? [:]) {
|
||||||
discord["actions"] = actions
|
discord["actions"] = actions
|
||||||
} else {
|
} else {
|
||||||
discord["actions"] = NSNull()
|
discord.removeValue(forKey: "actions")
|
||||||
}
|
}
|
||||||
|
|
||||||
if let slash = self.buildDiscordSlashPatch() {
|
if let slash = self.buildDiscordSlashConfig(base: discord["slashCommand"] as? [String: Any] ?? [:]) {
|
||||||
discord["slashCommand"] = slash
|
discord["slashCommand"] = slash
|
||||||
} else {
|
} else {
|
||||||
discord["slashCommand"] = NSNull()
|
discord.removeValue(forKey: "slashCommand")
|
||||||
}
|
}
|
||||||
|
|
||||||
return discord
|
return discord
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildDiscordDmPatch() -> [String: Any]? {
|
private func buildDiscordDmConfig(base: [String: Any]) -> [String: Any]? {
|
||||||
var dm: [String: Any] = [:]
|
var dm = base
|
||||||
self.setPatchBool(&dm, key: "enabled", value: self.discordDmEnabled, defaultValue: true)
|
if self.discordDmEnabled {
|
||||||
|
dm.removeValue(forKey: "enabled")
|
||||||
|
} else {
|
||||||
|
dm["enabled"] = false
|
||||||
|
}
|
||||||
let allow = self.splitCsv(self.discordAllowFrom)
|
let allow = self.splitCsv(self.discordAllowFrom)
|
||||||
self.setPatchList(&dm, key: "allowFrom", values: allow)
|
if allow.isEmpty {
|
||||||
self.setPatchBool(&dm, key: "groupEnabled", value: self.discordGroupEnabled, defaultValue: false)
|
dm.removeValue(forKey: "allowFrom")
|
||||||
|
} else {
|
||||||
|
dm["allowFrom"] = allow
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.discordGroupEnabled {
|
||||||
|
dm["groupEnabled"] = true
|
||||||
|
} else {
|
||||||
|
dm.removeValue(forKey: "groupEnabled")
|
||||||
|
}
|
||||||
|
|
||||||
let groupChannels = self.splitCsv(self.discordGroupChannels)
|
let groupChannels = self.splitCsv(self.discordGroupChannels)
|
||||||
self.setPatchList(&dm, key: "groupChannels", values: groupChannels)
|
if groupChannels.isEmpty {
|
||||||
|
dm.removeValue(forKey: "groupChannels")
|
||||||
|
} else {
|
||||||
|
dm["groupChannels"] = groupChannels
|
||||||
|
}
|
||||||
|
|
||||||
return dm.isEmpty ? nil : dm
|
return dm.isEmpty ? nil : dm
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildDiscordGuildsPatch(base: [String: Any]) -> Any? {
|
private func buildDiscordGuildsConfig() -> [String: Any]? {
|
||||||
if self.discordGuilds.isEmpty {
|
let guilds: [String: Any] = self.discordGuilds.reduce(into: [:]) { result, entry in
|
||||||
return NSNull()
|
|
||||||
}
|
|
||||||
var patch: [String: Any] = [:]
|
|
||||||
let baseKeys = Set(base.keys)
|
|
||||||
var formKeys = Set<String>()
|
|
||||||
for entry in self.discordGuilds {
|
|
||||||
let key = self.trimmed(entry.key)
|
let key = self.trimmed(entry.key)
|
||||||
guard !key.isEmpty else { continue }
|
guard !key.isEmpty else { return }
|
||||||
formKeys.insert(key)
|
|
||||||
let baseGuild = base[key] as? [String: Any] ?? [:]
|
|
||||||
patch[key] = self.buildDiscordGuildPatch(entry, base: baseGuild)
|
|
||||||
}
|
|
||||||
for key in baseKeys.subtracting(formKeys) {
|
|
||||||
patch[key] = NSNull()
|
|
||||||
}
|
|
||||||
return patch.isEmpty ? NSNull() : patch
|
|
||||||
}
|
|
||||||
|
|
||||||
private func buildDiscordGuildPatch(_ entry: DiscordGuildForm, base: [String: Any]) -> [String: Any] {
|
|
||||||
var payload: [String: Any] = [:]
|
var payload: [String: Any] = [:]
|
||||||
let slug = self.trimmed(entry.slug)
|
let slug = self.trimmed(entry.slug)
|
||||||
if slug.isEmpty {
|
if !slug.isEmpty { payload["slug"] = slug }
|
||||||
payload["slug"] = NSNull()
|
if entry.requireMention { payload["requireMention"] = true }
|
||||||
} else {
|
if ["off", "own", "all", "allowlist"].contains(entry.reactionNotifications) {
|
||||||
payload["slug"] = slug
|
|
||||||
}
|
|
||||||
if entry.requireMention {
|
|
||||||
payload["requireMention"] = true
|
|
||||||
} else {
|
|
||||||
payload["requireMention"] = NSNull()
|
|
||||||
}
|
|
||||||
if ["off", "all", "allowlist"].contains(entry.reactionNotifications) {
|
|
||||||
payload["reactionNotifications"] = entry.reactionNotifications
|
payload["reactionNotifications"] = entry.reactionNotifications
|
||||||
} else {
|
|
||||||
payload["reactionNotifications"] = NSNull()
|
|
||||||
}
|
}
|
||||||
let users = self.splitCsv(entry.users)
|
let users = self.splitCsv(entry.users)
|
||||||
self.setPatchList(&payload, key: "users", values: users)
|
if !users.isEmpty { payload["users"] = users }
|
||||||
|
let channels: [String: Any] = entry.channels.reduce(into: [:]) { channelsResult, channel in
|
||||||
let baseChannels = base["channels"] as? [String: Any] ?? [:]
|
|
||||||
if let channels = self.buildDiscordChannelsPatch(base: baseChannels, forms: entry.channels) {
|
|
||||||
payload["channels"] = channels
|
|
||||||
} else {
|
|
||||||
payload["channels"] = NSNull()
|
|
||||||
}
|
|
||||||
return payload
|
|
||||||
}
|
|
||||||
|
|
||||||
private func buildDiscordChannelsPatch(base: [String: Any], forms: [DiscordGuildChannelForm]) -> Any? {
|
|
||||||
if forms.isEmpty {
|
|
||||||
return NSNull()
|
|
||||||
}
|
|
||||||
var patch: [String: Any] = [:]
|
|
||||||
let baseKeys = Set(base.keys)
|
|
||||||
var formKeys = Set<String>()
|
|
||||||
for channel in forms {
|
|
||||||
let channelKey = self.trimmed(channel.key)
|
let channelKey = self.trimmed(channel.key)
|
||||||
guard !channelKey.isEmpty else { continue }
|
guard !channelKey.isEmpty else { return }
|
||||||
formKeys.insert(channelKey)
|
|
||||||
var channelPayload: [String: Any] = [:]
|
var channelPayload: [String: Any] = [:]
|
||||||
self.setPatchBool(&channelPayload, key: "allow", value: channel.allow, defaultValue: true)
|
if !channel.allow { channelPayload["allow"] = false }
|
||||||
self.setPatchBool(
|
if channel.requireMention { channelPayload["requireMention"] = true }
|
||||||
&channelPayload,
|
channelsResult[channelKey] = channelPayload
|
||||||
key: "requireMention",
|
|
||||||
value: channel.requireMention,
|
|
||||||
defaultValue: false)
|
|
||||||
patch[channelKey] = channelPayload
|
|
||||||
}
|
}
|
||||||
for key in baseKeys.subtracting(formKeys) {
|
if !channels.isEmpty { payload["channels"] = channels }
|
||||||
patch[key] = NSNull()
|
result[key] = payload
|
||||||
}
|
}
|
||||||
return patch.isEmpty ? NSNull() : patch
|
return guilds.isEmpty ? nil : guilds
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildDiscordActionsPatch() -> [String: Any]? {
|
private func buildDiscordActionsConfig(base: [String: Any]) -> [String: Any]? {
|
||||||
var actions: [String: Any] = [:]
|
var actions = base
|
||||||
self.setAction(&actions, key: "reactions", value: self.discordActionReactions, defaultValue: true)
|
self.setAction(&actions, key: "reactions", value: self.discordActionReactions, defaultValue: true)
|
||||||
self.setAction(&actions, key: "stickers", value: self.discordActionStickers, defaultValue: true)
|
self.setAction(&actions, key: "stickers", value: self.discordActionStickers, defaultValue: true)
|
||||||
self.setAction(&actions, key: "polls", value: self.discordActionPolls, defaultValue: true)
|
self.setAction(&actions, key: "polls", value: self.discordActionPolls, defaultValue: true)
|
||||||
@@ -428,44 +410,52 @@ extension ConnectionsStore {
|
|||||||
return actions.isEmpty ? nil : actions
|
return actions.isEmpty ? nil : actions
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildDiscordSlashPatch() -> [String: Any]? {
|
private func buildDiscordSlashConfig(base: [String: Any]) -> [String: Any]? {
|
||||||
var slash: [String: Any] = [:]
|
var slash = base
|
||||||
self.setPatchBool(&slash, key: "enabled", value: self.discordSlashEnabled, defaultValue: false)
|
if self.discordSlashEnabled {
|
||||||
self.setPatchString(&slash, key: "name", value: self.discordSlashName)
|
slash["enabled"] = true
|
||||||
self.setPatchString(&slash, key: "sessionPrefix", value: self.discordSlashSessionPrefix)
|
} else {
|
||||||
self.setPatchBool(&slash, key: "ephemeral", value: self.discordSlashEphemeral, defaultValue: true)
|
slash.removeValue(forKey: "enabled")
|
||||||
|
}
|
||||||
|
self.setOptionalString(&slash, key: "name", value: self.discordSlashName)
|
||||||
|
self.setOptionalString(&slash, key: "sessionPrefix", value: self.discordSlashSessionPrefix)
|
||||||
|
if self.discordSlashEphemeral {
|
||||||
|
slash.removeValue(forKey: "ephemeral")
|
||||||
|
} else {
|
||||||
|
slash["ephemeral"] = false
|
||||||
|
}
|
||||||
return slash.isEmpty ? nil : slash
|
return slash.isEmpty ? nil : slash
|
||||||
}
|
}
|
||||||
|
|
||||||
private func persistChannelPatch(_ channelId: String, payload: [String: Any]) async {
|
private func persistConfig() async {
|
||||||
do {
|
do {
|
||||||
guard let baseHash = self.configHash else {
|
|
||||||
self.configStatus = "Config hash missing; reload and retry."
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let data = try JSONSerialization.data(
|
let data = try JSONSerialization.data(
|
||||||
withJSONObject: ["channels": [channelId: payload]],
|
withJSONObject: self.configRoot,
|
||||||
options: [.prettyPrinted, .sortedKeys])
|
options: [.prettyPrinted, .sortedKeys])
|
||||||
guard let raw = String(data: data, encoding: .utf8) else {
|
guard let raw = String(data: data, encoding: .utf8) else {
|
||||||
self.configStatus = "Failed to encode config."
|
self.configStatus = "Failed to encode config."
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let params: [String: AnyCodable] = [
|
let params: [String: AnyCodable] = ["raw": AnyCodable(raw)]
|
||||||
"raw": AnyCodable(raw),
|
|
||||||
"baseHash": AnyCodable(baseHash),
|
|
||||||
]
|
|
||||||
_ = try await GatewayConnection.shared.requestRaw(
|
_ = try await GatewayConnection.shared.requestRaw(
|
||||||
method: .configPatch,
|
method: .configSet,
|
||||||
params: params,
|
params: params,
|
||||||
timeoutMs: 10000)
|
timeoutMs: 10000)
|
||||||
self.configStatus = "Saved to ~/.clawdbot/clawdbot.json."
|
self.configStatus = "Saved to ~/.clawdbot/clawdbot.json."
|
||||||
await self.loadConfig()
|
|
||||||
await self.refresh(probe: true)
|
await self.refresh(probe: true)
|
||||||
} catch {
|
} catch {
|
||||||
self.configStatus = error.localizedDescription
|
self.configStatus = error.localizedDescription
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func setSection(_ key: String, payload: [String: Any]) {
|
||||||
|
if payload.isEmpty {
|
||||||
|
self.configRoot.removeValue(forKey: key)
|
||||||
|
} else {
|
||||||
|
self.configRoot[key] = payload
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func stringList(from values: [AnyCodable]?) -> String {
|
private func stringList(from values: [AnyCodable]?) -> String {
|
||||||
guard let values else { return "" }
|
guard let values else { return "" }
|
||||||
let strings = values.compactMap { entry -> String? in
|
let strings = values.compactMap { entry -> String? in
|
||||||
@@ -502,29 +492,25 @@ extension ConnectionsStore {
|
|||||||
value.trimmingCharacters(in: .whitespacesAndNewlines)
|
value.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setPatchString(_ target: inout [String: Any], key: String, value: String) {
|
private func setOptionalString(_ target: inout [String: Any], key: String, value: String) {
|
||||||
let trimmed = self.trimmed(value)
|
let trimmed = self.trimmed(value)
|
||||||
if trimmed.isEmpty {
|
if trimmed.isEmpty {
|
||||||
target[key] = NSNull()
|
target.removeValue(forKey: key)
|
||||||
} else {
|
} else {
|
||||||
target[key] = trimmed
|
target[key] = trimmed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setPatchNumber(_ target: inout [String: Any], key: String, value: String) {
|
private func setOptionalNumber(_ target: inout [String: Any], key: String, value: String) {
|
||||||
let trimmed = self.trimmed(value)
|
let trimmed = self.trimmed(value)
|
||||||
if trimmed.isEmpty {
|
if trimmed.isEmpty {
|
||||||
target[key] = NSNull()
|
target.removeValue(forKey: key)
|
||||||
return
|
} else if let number = Double(trimmed) {
|
||||||
}
|
|
||||||
if let number = Double(trimmed) {
|
|
||||||
target[key] = number
|
target[key] = number
|
||||||
} else {
|
|
||||||
target[key] = NSNull()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setPatchInt(
|
private func setOptionalInt(
|
||||||
_ target: inout [String: Any],
|
_ target: inout [String: Any],
|
||||||
key: String,
|
key: String,
|
||||||
value: String,
|
value: String,
|
||||||
@@ -532,39 +518,26 @@ extension ConnectionsStore {
|
|||||||
{
|
{
|
||||||
let trimmed = self.trimmed(value)
|
let trimmed = self.trimmed(value)
|
||||||
if trimmed.isEmpty {
|
if trimmed.isEmpty {
|
||||||
target[key] = NSNull()
|
target.removeValue(forKey: key)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let number = Int(trimmed) else {
|
guard let number = Int(trimmed) else {
|
||||||
target[key] = NSNull()
|
target.removeValue(forKey: key)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let isValid = allowZero ? number >= 0 : number > 0
|
let isValid = allowZero ? number >= 0 : number > 0
|
||||||
guard isValid else {
|
guard isValid else {
|
||||||
target[key] = NSNull()
|
target.removeValue(forKey: key)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
target[key] = number
|
target[key] = number
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setPatchBool(
|
private func setOptionalBool(_ target: inout [String: Any], key: String, value: Bool) {
|
||||||
_ target: inout [String: Any],
|
if value {
|
||||||
key: String,
|
target[key] = true
|
||||||
value: Bool,
|
|
||||||
defaultValue: Bool)
|
|
||||||
{
|
|
||||||
if value == defaultValue {
|
|
||||||
target[key] = NSNull()
|
|
||||||
} else {
|
} else {
|
||||||
target[key] = value
|
target.removeValue(forKey: key)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func setPatchList(_ target: inout [String: Any], key: String, values: [String]) {
|
|
||||||
if values.isEmpty {
|
|
||||||
target[key] = NSNull()
|
|
||||||
} else {
|
|
||||||
target[key] = values
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,7 +548,7 @@ extension ConnectionsStore {
|
|||||||
defaultValue: Bool)
|
defaultValue: Bool)
|
||||||
{
|
{
|
||||||
if value == defaultValue {
|
if value == defaultValue {
|
||||||
actions[key] = NSNull()
|
actions.removeValue(forKey: key)
|
||||||
} else {
|
} else {
|
||||||
actions[key] = value
|
actions[key] = value
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ extension ConnectionsStore {
|
|||||||
"probe": AnyCodable(probe),
|
"probe": AnyCodable(probe),
|
||||||
"timeoutMs": AnyCodable(8000),
|
"timeoutMs": AnyCodable(8000),
|
||||||
]
|
]
|
||||||
let snap: ChannelsStatusSnapshot = try await GatewayConnection.shared.requestDecoded(
|
let snap: ProvidersStatusSnapshot = try await GatewayConnection.shared.requestDecoded(
|
||||||
method: .channelsStatus,
|
method: .providersStatus,
|
||||||
params: params,
|
params: params,
|
||||||
timeoutMs: 12000)
|
timeoutMs: 12000)
|
||||||
self.snapshot = snap
|
self.snapshot = snap
|
||||||
@@ -101,10 +101,10 @@ extension ConnectionsStore {
|
|||||||
defer { self.whatsappBusy = false }
|
defer { self.whatsappBusy = false }
|
||||||
do {
|
do {
|
||||||
let params: [String: AnyCodable] = [
|
let params: [String: AnyCodable] = [
|
||||||
"channel": AnyCodable("whatsapp"),
|
"provider": AnyCodable("whatsapp"),
|
||||||
]
|
]
|
||||||
let result: ChannelLogoutResult = try await GatewayConnection.shared.requestDecoded(
|
let result: ProviderLogoutResult = try await GatewayConnection.shared.requestDecoded(
|
||||||
method: .channelsLogout,
|
method: .providersLogout,
|
||||||
params: params,
|
params: params,
|
||||||
timeoutMs: 15000)
|
timeoutMs: 15000)
|
||||||
self.whatsappLoginMessage = result.cleared
|
self.whatsappLoginMessage = result.cleared
|
||||||
@@ -123,10 +123,10 @@ extension ConnectionsStore {
|
|||||||
defer { self.telegramBusy = false }
|
defer { self.telegramBusy = false }
|
||||||
do {
|
do {
|
||||||
let params: [String: AnyCodable] = [
|
let params: [String: AnyCodable] = [
|
||||||
"channel": AnyCodable("telegram"),
|
"provider": AnyCodable("telegram"),
|
||||||
]
|
]
|
||||||
let result: ChannelLogoutResult = try await GatewayConnection.shared.requestDecoded(
|
let result: ProviderLogoutResult = try await GatewayConnection.shared.requestDecoded(
|
||||||
method: .channelsLogout,
|
method: .providersLogout,
|
||||||
params: params,
|
params: params,
|
||||||
timeoutMs: 15000)
|
timeoutMs: 15000)
|
||||||
if result.envToken == true {
|
if result.envToken == true {
|
||||||
@@ -154,8 +154,8 @@ private struct WhatsAppLoginWaitResult: Codable {
|
|||||||
let message: String
|
let message: String
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct ChannelLogoutResult: Codable {
|
private struct ProviderLogoutResult: Codable {
|
||||||
let channel: String?
|
let provider: String?
|
||||||
let accountId: String?
|
let accountId: String?
|
||||||
let cleared: Bool
|
let cleared: Bool
|
||||||
let envToken: Bool?
|
let envToken: Bool?
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import ClawdbotProtocol
|
|||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
|
||||||
struct ChannelsStatusSnapshot: Codable {
|
struct ProvidersStatusSnapshot: Codable {
|
||||||
struct WhatsAppSelf: Codable {
|
struct WhatsAppSelf: Codable {
|
||||||
let e164: String?
|
let e164: String?
|
||||||
let jid: String?
|
let jid: String?
|
||||||
@@ -121,7 +121,7 @@ struct ChannelsStatusSnapshot: Codable {
|
|||||||
let lastProbeAt: Double?
|
let lastProbeAt: Double?
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ChannelAccountSnapshot: Codable {
|
struct ProviderAccountSnapshot: Codable {
|
||||||
let accountId: String
|
let accountId: String
|
||||||
let name: String?
|
let name: String?
|
||||||
let enabled: Bool?
|
let enabled: Bool?
|
||||||
@@ -154,14 +154,14 @@ struct ChannelsStatusSnapshot: Codable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let ts: Double
|
let ts: Double
|
||||||
let channelOrder: [String]
|
let providerOrder: [String]
|
||||||
let channelLabels: [String: String]
|
let providerLabels: [String: String]
|
||||||
let channels: [String: AnyCodable]
|
let providers: [String: AnyCodable]
|
||||||
let channelAccounts: [String: [ChannelAccountSnapshot]]
|
let providerAccounts: [String: [ProviderAccountSnapshot]]
|
||||||
let channelDefaultAccountId: [String: String]
|
let providerDefaultAccountId: [String: String]
|
||||||
|
|
||||||
func decodeChannel<T: Decodable>(_ id: String, as type: T.Type) -> T? {
|
func decodeProvider<T: Decodable>(_ id: String, as type: T.Type) -> T? {
|
||||||
guard let value = self.channels[id] else { return nil }
|
guard let value = self.providers[id] else { return nil }
|
||||||
do {
|
do {
|
||||||
let data = try JSONEncoder().encode(value)
|
let data = try JSONEncoder().encode(value)
|
||||||
return try JSONDecoder().decode(type, from: data)
|
return try JSONDecoder().decode(type, from: data)
|
||||||
@@ -180,7 +180,6 @@ struct ConfigSnapshot: Codable {
|
|||||||
let path: String?
|
let path: String?
|
||||||
let exists: Bool?
|
let exists: Bool?
|
||||||
let raw: String?
|
let raw: String?
|
||||||
let hash: String?
|
|
||||||
let parsed: AnyCodable?
|
let parsed: AnyCodable?
|
||||||
let valid: Bool?
|
let valid: Bool?
|
||||||
let config: [String: AnyCodable]?
|
let config: [String: AnyCodable]?
|
||||||
@@ -231,7 +230,7 @@ struct DiscordGuildForm: Identifiable {
|
|||||||
final class ConnectionsStore {
|
final class ConnectionsStore {
|
||||||
static let shared = ConnectionsStore()
|
static let shared = ConnectionsStore()
|
||||||
|
|
||||||
var snapshot: ChannelsStatusSnapshot?
|
var snapshot: ProvidersStatusSnapshot?
|
||||||
var lastError: String?
|
var lastError: String?
|
||||||
var lastSuccess: Date?
|
var lastSuccess: Date?
|
||||||
var isRefreshing = false
|
var isRefreshing = false
|
||||||
@@ -308,7 +307,6 @@ final class ConnectionsStore {
|
|||||||
var pollTask: Task<Void, Never>?
|
var pollTask: Task<Void, Never>?
|
||||||
var configRoot: [String: Any] = [:]
|
var configRoot: [String: Any] = [:]
|
||||||
var configLoaded = false
|
var configLoaded = false
|
||||||
var configHash: String?
|
|
||||||
|
|
||||||
init(isPreview: Bool = ProcessInfo.processInfo.isPreview) {
|
init(isPreview: Bool = ProcessInfo.processInfo.isPreview) {
|
||||||
self.isPreview = isPreview
|
self.isPreview = isPreview
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ extension CronJobEditor {
|
|||||||
case let .systemEvent(text):
|
case let .systemEvent(text):
|
||||||
self.payloadKind = .systemEvent
|
self.payloadKind = .systemEvent
|
||||||
self.systemEventText = text
|
self.systemEventText = text
|
||||||
case let .agentTurn(message, thinking, timeoutSeconds, deliver, channel, to, bestEffortDeliver):
|
case let .agentTurn(message, thinking, timeoutSeconds, deliver, provider, to, bestEffortDeliver):
|
||||||
self.payloadKind = .agentTurn
|
self.payloadKind = .agentTurn
|
||||||
self.agentMessage = message
|
self.agentMessage = message
|
||||||
self.thinking = thinking ?? ""
|
self.thinking = thinking ?? ""
|
||||||
self.timeoutSeconds = timeoutSeconds.map(String.init) ?? ""
|
self.timeoutSeconds = timeoutSeconds.map(String.init) ?? ""
|
||||||
self.deliver = deliver ?? false
|
self.deliver = deliver ?? false
|
||||||
self.channel = GatewayAgentChannel(raw: channel)
|
self.provider = GatewayAgentProvider(raw: provider)
|
||||||
self.to = to ?? ""
|
self.to = to ?? ""
|
||||||
self.bestEffortDeliver = bestEffortDeliver ?? false
|
self.bestEffortDeliver = bestEffortDeliver ?? false
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ extension CronJobEditor {
|
|||||||
if let n = Int(self.timeoutSeconds), n > 0 { payload["timeoutSeconds"] = n }
|
if let n = Int(self.timeoutSeconds), n > 0 { payload["timeoutSeconds"] = n }
|
||||||
payload["deliver"] = self.deliver
|
payload["deliver"] = self.deliver
|
||||||
if self.deliver {
|
if self.deliver {
|
||||||
payload["channel"] = self.channel.rawValue
|
payload["provider"] = self.provider.rawValue
|
||||||
let to = self.to.trimmingCharacters(in: .whitespacesAndNewlines)
|
let to = self.to.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
if !to.isEmpty { payload["to"] = to }
|
if !to.isEmpty { payload["to"] = to }
|
||||||
payload["bestEffortDeliver"] = self.bestEffortDeliver
|
payload["bestEffortDeliver"] = self.bestEffortDeliver
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ extension CronJobEditor {
|
|||||||
self.payloadKind = .agentTurn
|
self.payloadKind = .agentTurn
|
||||||
self.agentMessage = "Run diagnostic"
|
self.agentMessage = "Run diagnostic"
|
||||||
self.deliver = true
|
self.deliver = true
|
||||||
self.channel = .last
|
self.provider = .last
|
||||||
self.to = "+15551230000"
|
self.to = "+15551230000"
|
||||||
self.thinking = "low"
|
self.thinking = "low"
|
||||||
self.timeoutSeconds = "90"
|
self.timeoutSeconds = "90"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ struct CronJobEditor: View {
|
|||||||
static let scheduleKindNote =
|
static let scheduleKindNote =
|
||||||
"“At” runs once, “Every” repeats with a duration, “Cron” uses a 5-field Unix expression."
|
"“At” runs once, “Every” repeats with a duration, “Cron” uses a 5-field Unix expression."
|
||||||
static let isolatedPayloadNote =
|
static let isolatedPayloadNote =
|
||||||
"Isolated jobs always run an agent turn. The result can be delivered to a channel, "
|
"Isolated jobs always run an agent turn. The result can be delivered to a provider, "
|
||||||
+ "and a short summary is posted back to your main chat."
|
+ "and a short summary is posted back to your main chat."
|
||||||
static let mainPayloadNote =
|
static let mainPayloadNote =
|
||||||
"System events are injected into the current main session. Agent turns require an isolated session target."
|
"System events are injected into the current main session. Agent turns require an isolated session target."
|
||||||
@@ -45,7 +45,7 @@ struct CronJobEditor: View {
|
|||||||
@State var systemEventText: String = ""
|
@State var systemEventText: String = ""
|
||||||
@State var agentMessage: String = ""
|
@State var agentMessage: String = ""
|
||||||
@State var deliver: Bool = false
|
@State var deliver: Bool = false
|
||||||
@State var channel: GatewayAgentChannel = .last
|
@State var provider: GatewayAgentProvider = .last
|
||||||
@State var to: String = ""
|
@State var to: String = ""
|
||||||
@State var thinking: String = ""
|
@State var thinking: String = ""
|
||||||
@State var timeoutSeconds: String = ""
|
@State var timeoutSeconds: String = ""
|
||||||
@@ -323,7 +323,7 @@ struct CronJobEditor: View {
|
|||||||
}
|
}
|
||||||
GridRow {
|
GridRow {
|
||||||
self.gridLabel("Deliver")
|
self.gridLabel("Deliver")
|
||||||
Toggle("Deliver result to a channel", isOn: self.$deliver)
|
Toggle("Deliver result to a provider", isOn: self.$deliver)
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.switch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,15 +331,15 @@ struct CronJobEditor: View {
|
|||||||
if self.deliver {
|
if self.deliver {
|
||||||
Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 14, verticalSpacing: 10) {
|
Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 14, verticalSpacing: 10) {
|
||||||
GridRow {
|
GridRow {
|
||||||
self.gridLabel("Channel")
|
self.gridLabel("Provider")
|
||||||
Picker("", selection: self.$channel) {
|
Picker("", selection: self.$provider) {
|
||||||
Text("last").tag(GatewayAgentChannel.last)
|
Text("last").tag(GatewayAgentProvider.last)
|
||||||
Text("whatsapp").tag(GatewayAgentChannel.whatsapp)
|
Text("whatsapp").tag(GatewayAgentProvider.whatsapp)
|
||||||
Text("telegram").tag(GatewayAgentChannel.telegram)
|
Text("telegram").tag(GatewayAgentProvider.telegram)
|
||||||
Text("discord").tag(GatewayAgentChannel.discord)
|
Text("discord").tag(GatewayAgentProvider.discord)
|
||||||
Text("slack").tag(GatewayAgentChannel.slack)
|
Text("slack").tag(GatewayAgentProvider.slack)
|
||||||
Text("signal").tag(GatewayAgentChannel.signal)
|
Text("signal").tag(GatewayAgentProvider.signal)
|
||||||
Text("imessage").tag(GatewayAgentChannel.imessage)
|
Text("imessage").tag(GatewayAgentProvider.imessage)
|
||||||
}
|
}
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ enum CronPayload: Codable, Equatable {
|
|||||||
thinking: String?,
|
thinking: String?,
|
||||||
timeoutSeconds: Int?,
|
timeoutSeconds: Int?,
|
||||||
deliver: Bool?,
|
deliver: Bool?,
|
||||||
channel: String?,
|
provider: String?,
|
||||||
to: String?,
|
to: String?,
|
||||||
bestEffortDeliver: Bool?)
|
bestEffortDeliver: Bool?)
|
||||||
|
|
||||||
enum CodingKeys: String, CodingKey {
|
enum CodingKeys: String, CodingKey {
|
||||||
case kind, text, message, thinking, timeoutSeconds, deliver, channel, provider, to, bestEffortDeliver
|
case kind, text, message, thinking, timeoutSeconds, deliver, provider, to, bestEffortDeliver
|
||||||
}
|
}
|
||||||
|
|
||||||
var kind: String {
|
var kind: String {
|
||||||
@@ -101,8 +101,7 @@ enum CronPayload: Codable, Equatable {
|
|||||||
thinking: container.decodeIfPresent(String.self, forKey: .thinking),
|
thinking: container.decodeIfPresent(String.self, forKey: .thinking),
|
||||||
timeoutSeconds: container.decodeIfPresent(Int.self, forKey: .timeoutSeconds),
|
timeoutSeconds: container.decodeIfPresent(Int.self, forKey: .timeoutSeconds),
|
||||||
deliver: container.decodeIfPresent(Bool.self, forKey: .deliver),
|
deliver: container.decodeIfPresent(Bool.self, forKey: .deliver),
|
||||||
channel: container.decodeIfPresent(String.self, forKey: .channel)
|
provider: container.decodeIfPresent(String.self, forKey: .provider),
|
||||||
?? container.decodeIfPresent(String.self, forKey: .provider),
|
|
||||||
to: container.decodeIfPresent(String.self, forKey: .to),
|
to: container.decodeIfPresent(String.self, forKey: .to),
|
||||||
bestEffortDeliver: container.decodeIfPresent(Bool.self, forKey: .bestEffortDeliver))
|
bestEffortDeliver: container.decodeIfPresent(Bool.self, forKey: .bestEffortDeliver))
|
||||||
default:
|
default:
|
||||||
@@ -119,12 +118,12 @@ enum CronPayload: Codable, Equatable {
|
|||||||
switch self {
|
switch self {
|
||||||
case let .systemEvent(text):
|
case let .systemEvent(text):
|
||||||
try container.encode(text, forKey: .text)
|
try container.encode(text, forKey: .text)
|
||||||
case let .agentTurn(message, thinking, timeoutSeconds, deliver, channel, to, bestEffortDeliver):
|
case let .agentTurn(message, thinking, timeoutSeconds, deliver, provider, to, bestEffortDeliver):
|
||||||
try container.encode(message, forKey: .message)
|
try container.encode(message, forKey: .message)
|
||||||
try container.encodeIfPresent(thinking, forKey: .thinking)
|
try container.encodeIfPresent(thinking, forKey: .thinking)
|
||||||
try container.encodeIfPresent(timeoutSeconds, forKey: .timeoutSeconds)
|
try container.encodeIfPresent(timeoutSeconds, forKey: .timeoutSeconds)
|
||||||
try container.encodeIfPresent(deliver, forKey: .deliver)
|
try container.encodeIfPresent(deliver, forKey: .deliver)
|
||||||
try container.encodeIfPresent(channel, forKey: .channel)
|
try container.encodeIfPresent(provider, forKey: .provider)
|
||||||
try container.encodeIfPresent(to, forKey: .to)
|
try container.encodeIfPresent(to, forKey: .to)
|
||||||
try container.encodeIfPresent(bestEffortDeliver, forKey: .bestEffortDeliver)
|
try container.encodeIfPresent(bestEffortDeliver, forKey: .bestEffortDeliver)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ struct CronSettings_Previews: PreviewProvider {
|
|||||||
thinking: "low",
|
thinking: "low",
|
||||||
timeoutSeconds: 600,
|
timeoutSeconds: 600,
|
||||||
deliver: true,
|
deliver: true,
|
||||||
channel: "last",
|
provider: "last",
|
||||||
to: nil,
|
to: nil,
|
||||||
bestEffortDeliver: true),
|
bestEffortDeliver: true),
|
||||||
isolation: CronIsolation(postToMainPrefix: "Cron"),
|
isolation: CronIsolation(postToMainPrefix: "Cron"),
|
||||||
@@ -76,7 +76,7 @@ extension CronSettings {
|
|||||||
thinking: "low",
|
thinking: "low",
|
||||||
timeoutSeconds: 120,
|
timeoutSeconds: 120,
|
||||||
deliver: true,
|
deliver: true,
|
||||||
channel: "whatsapp",
|
provider: "whatsapp",
|
||||||
to: "+15551234567",
|
to: "+15551234567",
|
||||||
bestEffortDeliver: true),
|
bestEffortDeliver: true),
|
||||||
isolation: CronIsolation(postToMainPrefix: "[cron] "),
|
isolation: CronIsolation(postToMainPrefix: "[cron] "),
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ final class DeepLinkHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let channel = GatewayAgentChannel(raw: link.channel)
|
let provider = GatewayAgentProvider(raw: link.channel)
|
||||||
let explicitSessionKey = link.sessionKey?
|
let explicitSessionKey = link.sessionKey?
|
||||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
.nonEmpty
|
.nonEmpty
|
||||||
@@ -72,9 +72,9 @@ final class DeepLinkHandler {
|
|||||||
message: messagePreview,
|
message: messagePreview,
|
||||||
sessionKey: resolvedSessionKey,
|
sessionKey: resolvedSessionKey,
|
||||||
thinking: link.thinking?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty,
|
thinking: link.thinking?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty,
|
||||||
deliver: channel.shouldDeliver(link.deliver),
|
deliver: provider.shouldDeliver(link.deliver),
|
||||||
to: link.to?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty,
|
to: link.to?.trimmingCharacters(in: .whitespacesAndNewlines).nonEmpty,
|
||||||
channel: channel,
|
provider: provider,
|
||||||
timeoutSeconds: link.timeoutSeconds,
|
timeoutSeconds: link.timeoutSeconds,
|
||||||
idempotencyKey: UUID().uuidString)
|
idempotencyKey: UUID().uuidString)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
enum GatewayAgentChannel: String, CaseIterable, Sendable {
|
||||||
|
case last
|
||||||
|
case webchat
|
||||||
|
case whatsapp
|
||||||
|
case telegram
|
||||||
|
|
||||||
|
init(raw: String?) {
|
||||||
|
let trimmed = raw?
|
||||||
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
.lowercased() ?? ""
|
||||||
|
self = GatewayAgentChannel(rawValue: trimmed) ?? .last
|
||||||
|
}
|
||||||
|
|
||||||
|
func shouldDeliver(_ isLast: Bool) -> Bool {
|
||||||
|
switch self {
|
||||||
|
case .webchat:
|
||||||
|
false
|
||||||
|
case .last:
|
||||||
|
isLast
|
||||||
|
case .whatsapp, .telegram:
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import OSLog
|
|||||||
|
|
||||||
private let gatewayConnectionLogger = Logger(subsystem: "com.clawdbot", category: "gateway.connection")
|
private let gatewayConnectionLogger = Logger(subsystem: "com.clawdbot", category: "gateway.connection")
|
||||||
|
|
||||||
enum GatewayAgentChannel: String, Codable, CaseIterable, Sendable {
|
enum GatewayAgentProvider: String, Codable, CaseIterable, Sendable {
|
||||||
case last
|
case last
|
||||||
case whatsapp
|
case whatsapp
|
||||||
case telegram
|
case telegram
|
||||||
@@ -18,7 +18,7 @@ enum GatewayAgentChannel: String, Codable, CaseIterable, Sendable {
|
|||||||
|
|
||||||
init(raw: String?) {
|
init(raw: String?) {
|
||||||
let normalized = (raw ?? "").trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
let normalized = (raw ?? "").trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
||||||
self = GatewayAgentChannel(rawValue: normalized) ?? .last
|
self = GatewayAgentProvider(rawValue: normalized) ?? .last
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDeliverable: Bool { self != .webchat }
|
var isDeliverable: Bool { self != .webchat }
|
||||||
@@ -32,7 +32,7 @@ struct GatewayAgentInvocation: Sendable {
|
|||||||
var thinking: String?
|
var thinking: String?
|
||||||
var deliver: Bool = false
|
var deliver: Bool = false
|
||||||
var to: String?
|
var to: String?
|
||||||
var channel: GatewayAgentChannel = .last
|
var provider: GatewayAgentProvider = .last
|
||||||
var timeoutSeconds: Int?
|
var timeoutSeconds: Int?
|
||||||
var idempotencyKey: String = UUID().uuidString
|
var idempotencyKey: String = UUID().uuidString
|
||||||
}
|
}
|
||||||
@@ -52,10 +52,9 @@ actor GatewayConnection {
|
|||||||
case setHeartbeats = "set-heartbeats"
|
case setHeartbeats = "set-heartbeats"
|
||||||
case systemEvent = "system-event"
|
case systemEvent = "system-event"
|
||||||
case health
|
case health
|
||||||
case channelsStatus = "channels.status"
|
case providersStatus = "providers.status"
|
||||||
case configGet = "config.get"
|
case configGet = "config.get"
|
||||||
case configSet = "config.set"
|
case configSet = "config.set"
|
||||||
case configPatch = "config.patch"
|
|
||||||
case wizardStart = "wizard.start"
|
case wizardStart = "wizard.start"
|
||||||
case wizardNext = "wizard.next"
|
case wizardNext = "wizard.next"
|
||||||
case wizardCancel = "wizard.cancel"
|
case wizardCancel = "wizard.cancel"
|
||||||
@@ -63,7 +62,7 @@ actor GatewayConnection {
|
|||||||
case talkMode = "talk.mode"
|
case talkMode = "talk.mode"
|
||||||
case webLoginStart = "web.login.start"
|
case webLoginStart = "web.login.start"
|
||||||
case webLoginWait = "web.login.wait"
|
case webLoginWait = "web.login.wait"
|
||||||
case channelsLogout = "channels.logout"
|
case providersLogout = "providers.logout"
|
||||||
case modelsList = "models.list"
|
case modelsList = "models.list"
|
||||||
case chatHistory = "chat.history"
|
case chatHistory = "chat.history"
|
||||||
case chatSend = "chat.send"
|
case chatSend = "chat.send"
|
||||||
@@ -369,7 +368,7 @@ extension GatewayConnection {
|
|||||||
"thinking": AnyCodable(invocation.thinking ?? "default"),
|
"thinking": AnyCodable(invocation.thinking ?? "default"),
|
||||||
"deliver": AnyCodable(invocation.deliver),
|
"deliver": AnyCodable(invocation.deliver),
|
||||||
"to": AnyCodable(invocation.to ?? ""),
|
"to": AnyCodable(invocation.to ?? ""),
|
||||||
"channel": AnyCodable(invocation.channel.rawValue),
|
"provider": AnyCodable(invocation.provider.rawValue),
|
||||||
"idempotencyKey": AnyCodable(invocation.idempotencyKey),
|
"idempotencyKey": AnyCodable(invocation.idempotencyKey),
|
||||||
]
|
]
|
||||||
if let timeout = invocation.timeoutSeconds {
|
if let timeout = invocation.timeoutSeconds {
|
||||||
@@ -390,7 +389,7 @@ extension GatewayConnection {
|
|||||||
sessionKey: String,
|
sessionKey: String,
|
||||||
deliver: Bool,
|
deliver: Bool,
|
||||||
to: String?,
|
to: String?,
|
||||||
channel: GatewayAgentChannel = .last,
|
provider: GatewayAgentProvider = .last,
|
||||||
timeoutSeconds: Int? = nil,
|
timeoutSeconds: Int? = nil,
|
||||||
idempotencyKey: String = UUID().uuidString) async -> (ok: Bool, error: String?)
|
idempotencyKey: String = UUID().uuidString) async -> (ok: Bool, error: String?)
|
||||||
{
|
{
|
||||||
@@ -400,7 +399,7 @@ extension GatewayConnection {
|
|||||||
thinking: thinking,
|
thinking: thinking,
|
||||||
deliver: deliver,
|
deliver: deliver,
|
||||||
to: to,
|
to: to,
|
||||||
channel: channel,
|
provider: provider,
|
||||||
timeoutSeconds: timeoutSeconds,
|
timeoutSeconds: timeoutSeconds,
|
||||||
idempotencyKey: idempotencyKey))
|
idempotencyKey: idempotencyKey))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -388,43 +388,6 @@ actor GatewayEndpointStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension GatewayEndpointStore {
|
|
||||||
static func dashboardURL(for config: GatewayConnection.Config) throws -> URL {
|
|
||||||
guard var components = URLComponents(url: config.url, resolvingAgainstBaseURL: false) else {
|
|
||||||
throw NSError(domain: "Dashboard", code: 1, userInfo: [
|
|
||||||
NSLocalizedDescriptionKey: "Invalid gateway URL",
|
|
||||||
])
|
|
||||||
}
|
|
||||||
switch components.scheme?.lowercased() {
|
|
||||||
case "ws":
|
|
||||||
components.scheme = "http"
|
|
||||||
case "wss":
|
|
||||||
components.scheme = "https"
|
|
||||||
default:
|
|
||||||
components.scheme = "http"
|
|
||||||
}
|
|
||||||
components.path = "/"
|
|
||||||
var queryItems: [URLQueryItem] = []
|
|
||||||
if let token = config.token?.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
||||||
!token.isEmpty
|
|
||||||
{
|
|
||||||
queryItems.append(URLQueryItem(name: "token", value: token))
|
|
||||||
}
|
|
||||||
if let password = config.password?.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
||||||
!password.isEmpty
|
|
||||||
{
|
|
||||||
queryItems.append(URLQueryItem(name: "password", value: password))
|
|
||||||
}
|
|
||||||
components.queryItems = queryItems.isEmpty ? nil : queryItems
|
|
||||||
guard let url = components.url else {
|
|
||||||
throw NSError(domain: "Dashboard", code: 2, userInfo: [
|
|
||||||
NSLocalizedDescriptionKey: "Failed to build dashboard URL",
|
|
||||||
])
|
|
||||||
}
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
extension GatewayEndpointStore {
|
extension GatewayEndpointStore {
|
||||||
static func _testResolveGatewayPassword(
|
static func _testResolveGatewayPassword(
|
||||||
|
|||||||
@@ -211,19 +211,19 @@ final class GatewayProcessManager {
|
|||||||
private func describe(details instance: String?, port: Int, snap: HealthSnapshot?) -> String {
|
private func describe(details instance: String?, port: Int, snap: HealthSnapshot?) -> String {
|
||||||
let instanceText = instance ?? "pid unknown"
|
let instanceText = instance ?? "pid unknown"
|
||||||
if let snap {
|
if let snap {
|
||||||
let linkId = snap.channelOrder?.first(where: {
|
let linkId = snap.providerOrder?.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
}) ?? snap.channels.keys.first(where: {
|
}) ?? snap.providers.keys.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
let linked = linkId.flatMap { snap.channels[$0]?.linked } ?? false
|
let linked = linkId.flatMap { snap.providers[$0]?.linked } ?? false
|
||||||
let authAge = linkId.flatMap { snap.channels[$0]?.authAgeMs }.flatMap(msToAge) ?? "unknown age"
|
let authAge = linkId.flatMap { snap.providers[$0]?.authAgeMs }.flatMap(msToAge) ?? "unknown age"
|
||||||
let label =
|
let label =
|
||||||
linkId.flatMap { snap.channelLabels?[$0] } ??
|
linkId.flatMap { snap.providerLabels?[$0] } ??
|
||||||
linkId?.capitalized ??
|
linkId?.capitalized ??
|
||||||
"channel"
|
"provider"
|
||||||
let linkText = linked ? "linked" : "not linked"
|
let linkText = linked ? "linked" : "not linked"
|
||||||
return "port \(port), \(label) \(linkText), auth \(authAge), \(instanceText)"
|
return "port \(port), \(label) \(linkText), auth \(authAge), \(instanceText)"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -496,18 +496,18 @@ struct GeneralSettings: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let snap = snapshot {
|
if let snap = snapshot {
|
||||||
let linkId = snap.channelOrder?.first(where: {
|
let linkId = snap.providerOrder?.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
}) ?? snap.channels.keys.first(where: {
|
}) ?? snap.providers.keys.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
let linkLabel =
|
let linkLabel =
|
||||||
linkId.flatMap { snap.channelLabels?[$0] } ??
|
linkId.flatMap { snap.providerLabels?[$0] } ??
|
||||||
linkId?.capitalized ??
|
linkId?.capitalized ??
|
||||||
"Link channel"
|
"Link provider"
|
||||||
let linkAge = linkId.flatMap { snap.channels[$0]?.authAgeMs }
|
let linkAge = linkId.flatMap { snap.providers[$0]?.authAgeMs }
|
||||||
Text("\(linkLabel) auth age: \(healthAgeString(linkAge))")
|
Text("\(linkLabel) auth age: \(healthAgeString(linkAge))")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Observation
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct HealthSnapshot: Codable, Sendable {
|
struct HealthSnapshot: Codable, Sendable {
|
||||||
struct ChannelSummary: Codable, Sendable {
|
struct ProviderSummary: Codable, Sendable {
|
||||||
struct Probe: Codable, Sendable {
|
struct Probe: Codable, Sendable {
|
||||||
struct Bot: Codable, Sendable {
|
struct Bot: Codable, Sendable {
|
||||||
let username: String?
|
let username: String?
|
||||||
@@ -44,9 +44,9 @@ struct HealthSnapshot: Codable, Sendable {
|
|||||||
let ok: Bool?
|
let ok: Bool?
|
||||||
let ts: Double
|
let ts: Double
|
||||||
let durationMs: Double
|
let durationMs: Double
|
||||||
let channels: [String: ChannelSummary]
|
let providers: [String: ProviderSummary]
|
||||||
let channelOrder: [String]?
|
let providerOrder: [String]?
|
||||||
let channelLabels: [String: String]?
|
let providerLabels: [String: String]?
|
||||||
let heartbeatSeconds: Int?
|
let heartbeatSeconds: Int?
|
||||||
let sessions: Sessions
|
let sessions: Sessions
|
||||||
}
|
}
|
||||||
@@ -144,13 +144,13 @@ final class HealthStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func isChannelHealthy(_ summary: HealthSnapshot.ChannelSummary) -> Bool {
|
private static func isProviderHealthy(_ summary: HealthSnapshot.ProviderSummary) -> Bool {
|
||||||
guard summary.configured == true else { return false }
|
guard summary.configured == true else { return false }
|
||||||
// If probe is missing, treat it as "configured but unknown health" (not a hard fail).
|
// If probe is missing, treat it as "configured but unknown health" (not a hard fail).
|
||||||
return summary.probe?.ok ?? true
|
return summary.probe?.ok ?? true
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func describeProbeFailure(_ probe: HealthSnapshot.ChannelSummary.Probe) -> String {
|
private static func describeProbeFailure(_ probe: HealthSnapshot.ProviderSummary.Probe) -> String {
|
||||||
let elapsed = probe.elapsedMs.map { "\(Int($0))ms" }
|
let elapsed = probe.elapsedMs.map { "\(Int($0))ms" }
|
||||||
if let error = probe.error, error.lowercased().contains("timeout") || probe.status == nil {
|
if let error = probe.error, error.lowercased().contains("timeout") || probe.status == nil {
|
||||||
if let elapsed { return "Health check timed out (\(elapsed))" }
|
if let elapsed { return "Health check timed out (\(elapsed))" }
|
||||||
@@ -162,28 +162,28 @@ final class HealthStore {
|
|||||||
return "\(reason) (\(code))"
|
return "\(reason) (\(code))"
|
||||||
}
|
}
|
||||||
|
|
||||||
private func resolveLinkChannel(
|
private func resolveLinkProvider(
|
||||||
_ snap: HealthSnapshot) -> (id: String, summary: HealthSnapshot.ChannelSummary)?
|
_ snap: HealthSnapshot) -> (id: String, summary: HealthSnapshot.ProviderSummary)?
|
||||||
{
|
{
|
||||||
let order = snap.channelOrder ?? Array(snap.channels.keys)
|
let order = snap.providerOrder ?? Array(snap.providers.keys)
|
||||||
for id in order {
|
for id in order {
|
||||||
if let summary = snap.channels[id], summary.linked != nil {
|
if let summary = snap.providers[id], summary.linked != nil {
|
||||||
return (id: id, summary: summary)
|
return (id: id, summary: summary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
private func resolveFallbackChannel(
|
private func resolveFallbackProvider(
|
||||||
_ snap: HealthSnapshot,
|
_ snap: HealthSnapshot,
|
||||||
excluding id: String?) -> (id: String, summary: HealthSnapshot.ChannelSummary)?
|
excluding id: String?) -> (id: String, summary: HealthSnapshot.ProviderSummary)?
|
||||||
{
|
{
|
||||||
let order = snap.channelOrder ?? Array(snap.channels.keys)
|
let order = snap.providerOrder ?? Array(snap.providers.keys)
|
||||||
for channelId in order {
|
for providerId in order {
|
||||||
if channelId == id { continue }
|
if providerId == id { continue }
|
||||||
guard let summary = snap.channels[channelId] else { continue }
|
guard let summary = snap.providers[providerId] else { continue }
|
||||||
if Self.isChannelHealthy(summary) {
|
if Self.isProviderHealthy(summary) {
|
||||||
return (id: channelId, summary: summary)
|
return (id: providerId, summary: summary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -194,13 +194,13 @@ final class HealthStore {
|
|||||||
return .degraded(error)
|
return .degraded(error)
|
||||||
}
|
}
|
||||||
guard let snap = self.snapshot else { return .unknown }
|
guard let snap = self.snapshot else { return .unknown }
|
||||||
guard let link = self.resolveLinkChannel(snap) else { return .unknown }
|
guard let link = self.resolveLinkProvider(snap) else { return .unknown }
|
||||||
if link.summary.linked != true {
|
if link.summary.linked != true {
|
||||||
// Linking is optional if any other channel is healthy; don't paint the whole app red.
|
// Linking is optional if any other provider is healthy; don't paint the whole app red.
|
||||||
let fallback = self.resolveFallbackChannel(snap, excluding: link.id)
|
let fallback = self.resolveFallbackProvider(snap, excluding: link.id)
|
||||||
return fallback != nil ? .degraded("Not linked") : .linkingNeeded
|
return fallback != nil ? .degraded("Not linked") : .linkingNeeded
|
||||||
}
|
}
|
||||||
// A channel can be "linked" but still unhealthy (failed probe / cannot connect).
|
// A provider can be "linked" but still unhealthy (failed probe / cannot connect).
|
||||||
if let probe = link.summary.probe, probe.ok == false {
|
if let probe = link.summary.probe, probe.ok == false {
|
||||||
return .degraded(Self.describeProbeFailure(probe))
|
return .degraded(Self.describeProbeFailure(probe))
|
||||||
}
|
}
|
||||||
@@ -211,10 +211,10 @@ final class HealthStore {
|
|||||||
if self.isRefreshing { return "Health check running…" }
|
if self.isRefreshing { return "Health check running…" }
|
||||||
if let error = self.lastError { return "Health check failed: \(error)" }
|
if let error = self.lastError { return "Health check failed: \(error)" }
|
||||||
guard let snap = self.snapshot else { return "Health check pending" }
|
guard let snap = self.snapshot else { return "Health check pending" }
|
||||||
guard let link = self.resolveLinkChannel(snap) else { return "Health check pending" }
|
guard let link = self.resolveLinkProvider(snap) else { return "Health check pending" }
|
||||||
if link.summary.linked != true {
|
if link.summary.linked != true {
|
||||||
if let fallback = self.resolveFallbackChannel(snap, excluding: link.id) {
|
if let fallback = self.resolveFallbackProvider(snap, excluding: link.id) {
|
||||||
let fallbackLabel = snap.channelLabels?[fallback.id] ?? fallback.id.capitalized
|
let fallbackLabel = snap.providerLabels?[fallback.id] ?? fallback.id.capitalized
|
||||||
let fallbackState = (fallback.summary.probe?.ok ?? true) ? "ok" : "degraded"
|
let fallbackState = (fallback.summary.probe?.ok ?? true) ? "ok" : "degraded"
|
||||||
return "\(fallbackLabel) \(fallbackState) · Not linked — run clawdbot login"
|
return "\(fallbackLabel) \(fallbackState) · Not linked — run clawdbot login"
|
||||||
}
|
}
|
||||||
@@ -247,10 +247,10 @@ final class HealthStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func describeFailure(from snap: HealthSnapshot, fallback: String?) -> String {
|
func describeFailure(from snap: HealthSnapshot, fallback: String?) -> String {
|
||||||
if let link = self.resolveLinkChannel(snap), link.summary.linked != true {
|
if let link = self.resolveLinkProvider(snap), link.summary.linked != true {
|
||||||
return "Not linked — run clawdbot login"
|
return "Not linked — run clawdbot login"
|
||||||
}
|
}
|
||||||
if let link = self.resolveLinkChannel(snap), let probe = link.summary.probe, probe.ok == false {
|
if let link = self.resolveLinkProvider(snap), let probe = link.summary.probe, probe.ok == false {
|
||||||
return Self.describeProbeFailure(probe)
|
return Self.describeProbeFailure(probe)
|
||||||
}
|
}
|
||||||
if let fallback, !fallback.isEmpty {
|
if let fallback, !fallback.isEmpty {
|
||||||
|
|||||||
@@ -242,18 +242,18 @@ final class InstancesStore {
|
|||||||
do {
|
do {
|
||||||
let data = try await ControlChannel.shared.health(timeout: 8)
|
let data = try await ControlChannel.shared.health(timeout: 8)
|
||||||
guard let snap = decodeHealthSnapshot(from: data) else { return }
|
guard let snap = decodeHealthSnapshot(from: data) else { return }
|
||||||
let linkId = snap.channelOrder?.first(where: {
|
let linkId = snap.providerOrder?.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
}) ?? snap.channels.keys.first(where: {
|
}) ?? snap.providers.keys.first(where: {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
if let summary = snap.providers[$0] { return summary.linked != nil }
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
let linked = linkId.flatMap { snap.channels[$0]?.linked } ?? false
|
let linked = linkId.flatMap { snap.providers[$0]?.linked } ?? false
|
||||||
let linkLabel =
|
let linkLabel =
|
||||||
linkId.flatMap { snap.channelLabels?[$0] } ??
|
linkId.flatMap { snap.providerLabels?[$0] } ??
|
||||||
linkId?.capitalized ??
|
linkId?.capitalized ??
|
||||||
"channel"
|
"provider"
|
||||||
let entry = InstanceInfo(
|
let entry = InstanceInfo(
|
||||||
id: "health-\(snap.ts)",
|
id: "health-\(snap.ts)",
|
||||||
host: "gateway (health)",
|
host: "gateway (health)",
|
||||||
|
|||||||
@@ -313,7 +313,27 @@ struct MenuContent: View {
|
|||||||
private func openDashboard() async {
|
private func openDashboard() async {
|
||||||
do {
|
do {
|
||||||
let config = try await GatewayEndpointStore.shared.requireConfig()
|
let config = try await GatewayEndpointStore.shared.requireConfig()
|
||||||
let url = try GatewayEndpointStore.dashboardURL(for: config)
|
let wsURL = config.url
|
||||||
|
guard var components = URLComponents(url: wsURL, resolvingAgainstBaseURL: false) else {
|
||||||
|
throw NSError(domain: "Dashboard", code: 1, userInfo: [
|
||||||
|
NSLocalizedDescriptionKey: "Invalid gateway URL",
|
||||||
|
])
|
||||||
|
}
|
||||||
|
switch components.scheme?.lowercased() {
|
||||||
|
case "ws":
|
||||||
|
components.scheme = "http"
|
||||||
|
case "wss":
|
||||||
|
components.scheme = "https"
|
||||||
|
default:
|
||||||
|
components.scheme = "http"
|
||||||
|
}
|
||||||
|
components.path = "/"
|
||||||
|
components.query = nil
|
||||||
|
guard let url = components.url else {
|
||||||
|
throw NSError(domain: "Dashboard", code: 2, userInfo: [
|
||||||
|
NSLocalizedDescriptionKey: "Failed to build dashboard URL",
|
||||||
|
])
|
||||||
|
}
|
||||||
NSWorkspace.shared.open(url)
|
NSWorkspace.shared.open(url)
|
||||||
} catch {
|
} catch {
|
||||||
let alert = NSAlert()
|
let alert = NSAlert()
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ extension OnboardingView {
|
|||||||
systemImage: "bubble.left.and.bubble.right")
|
systemImage: "bubble.left.and.bubble.right")
|
||||||
self.featureActionRow(
|
self.featureActionRow(
|
||||||
title: "Connect WhatsApp or Telegram",
|
title: "Connect WhatsApp or Telegram",
|
||||||
subtitle: "Open Settings → Connections to link channels and monitor status.",
|
subtitle: "Open Settings → Connections to link providers and monitor status.",
|
||||||
systemImage: "link")
|
systemImage: "link")
|
||||||
{
|
{
|
||||||
self.openSettings(tab: .connections)
|
self.openSettings(tab: .connections)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ enum VoiceWakeForwarder {
|
|||||||
var thinking: String = "low"
|
var thinking: String = "low"
|
||||||
var deliver: Bool = true
|
var deliver: Bool = true
|
||||||
var to: String?
|
var to: String?
|
||||||
var channel: GatewayAgentChannel = .last
|
var provider: GatewayAgentProvider = .last
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
@@ -46,14 +46,14 @@ enum VoiceWakeForwarder {
|
|||||||
options: ForwardOptions = ForwardOptions()) async -> Result<Void, VoiceWakeForwardError>
|
options: ForwardOptions = ForwardOptions()) async -> Result<Void, VoiceWakeForwardError>
|
||||||
{
|
{
|
||||||
let payload = Self.prefixedTranscript(transcript)
|
let payload = Self.prefixedTranscript(transcript)
|
||||||
let deliver = options.channel.shouldDeliver(options.deliver)
|
let deliver = options.provider.shouldDeliver(options.deliver)
|
||||||
let result = await GatewayConnection.shared.sendAgent(GatewayAgentInvocation(
|
let result = await GatewayConnection.shared.sendAgent(GatewayAgentInvocation(
|
||||||
message: payload,
|
message: payload,
|
||||||
sessionKey: options.sessionKey,
|
sessionKey: options.sessionKey,
|
||||||
thinking: options.thinking,
|
thinking: options.thinking,
|
||||||
deliver: deliver,
|
deliver: deliver,
|
||||||
to: options.to,
|
to: options.to,
|
||||||
channel: options.channel))
|
provider: options.provider))
|
||||||
|
|
||||||
if result.ok {
|
if result.ok {
|
||||||
self.logger.info("voice wake forward ok")
|
self.logger.info("voice wake forward ok")
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ public struct SendParams: Codable, Sendable {
|
|||||||
public let message: String
|
public let message: String
|
||||||
public let mediaurl: String?
|
public let mediaurl: String?
|
||||||
public let gifplayback: Bool?
|
public let gifplayback: Bool?
|
||||||
public let channel: String?
|
public let provider: String?
|
||||||
public let accountid: String?
|
public let accountid: String?
|
||||||
public let idempotencykey: String
|
public let idempotencykey: String
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ public struct SendParams: Codable, Sendable {
|
|||||||
message: String,
|
message: String,
|
||||||
mediaurl: String?,
|
mediaurl: String?,
|
||||||
gifplayback: Bool?,
|
gifplayback: Bool?,
|
||||||
channel: String?,
|
provider: String?,
|
||||||
accountid: String?,
|
accountid: String?,
|
||||||
idempotencykey: String
|
idempotencykey: String
|
||||||
) {
|
) {
|
||||||
@@ -358,7 +358,7 @@ public struct SendParams: Codable, Sendable {
|
|||||||
self.message = message
|
self.message = message
|
||||||
self.mediaurl = mediaurl
|
self.mediaurl = mediaurl
|
||||||
self.gifplayback = gifplayback
|
self.gifplayback = gifplayback
|
||||||
self.channel = channel
|
self.provider = provider
|
||||||
self.accountid = accountid
|
self.accountid = accountid
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ public struct SendParams: Codable, Sendable {
|
|||||||
case message
|
case message
|
||||||
case mediaurl = "mediaUrl"
|
case mediaurl = "mediaUrl"
|
||||||
case gifplayback = "gifPlayback"
|
case gifplayback = "gifPlayback"
|
||||||
case channel
|
case provider
|
||||||
case accountid = "accountId"
|
case accountid = "accountId"
|
||||||
case idempotencykey = "idempotencyKey"
|
case idempotencykey = "idempotencyKey"
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,7 @@ public struct PollParams: Codable, Sendable {
|
|||||||
public let options: [String]
|
public let options: [String]
|
||||||
public let maxselections: Int?
|
public let maxselections: Int?
|
||||||
public let durationhours: Int?
|
public let durationhours: Int?
|
||||||
public let channel: String?
|
public let provider: String?
|
||||||
public let accountid: String?
|
public let accountid: String?
|
||||||
public let idempotencykey: String
|
public let idempotencykey: String
|
||||||
|
|
||||||
@@ -389,7 +389,7 @@ public struct PollParams: Codable, Sendable {
|
|||||||
options: [String],
|
options: [String],
|
||||||
maxselections: Int?,
|
maxselections: Int?,
|
||||||
durationhours: Int?,
|
durationhours: Int?,
|
||||||
channel: String?,
|
provider: String?,
|
||||||
accountid: String?,
|
accountid: String?,
|
||||||
idempotencykey: String
|
idempotencykey: String
|
||||||
) {
|
) {
|
||||||
@@ -398,7 +398,7 @@ public struct PollParams: Codable, Sendable {
|
|||||||
self.options = options
|
self.options = options
|
||||||
self.maxselections = maxselections
|
self.maxselections = maxselections
|
||||||
self.durationhours = durationhours
|
self.durationhours = durationhours
|
||||||
self.channel = channel
|
self.provider = provider
|
||||||
self.accountid = accountid
|
self.accountid = accountid
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
@@ -408,7 +408,7 @@ public struct PollParams: Codable, Sendable {
|
|||||||
case options
|
case options
|
||||||
case maxselections = "maxSelections"
|
case maxselections = "maxSelections"
|
||||||
case durationhours = "durationHours"
|
case durationhours = "durationHours"
|
||||||
case channel
|
case provider
|
||||||
case accountid = "accountId"
|
case accountid = "accountId"
|
||||||
case idempotencykey = "idempotencyKey"
|
case idempotencykey = "idempotencyKey"
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,7 @@ public struct AgentParams: Codable, Sendable {
|
|||||||
public let thinking: String?
|
public let thinking: String?
|
||||||
public let deliver: Bool?
|
public let deliver: Bool?
|
||||||
public let attachments: [AnyCodable]?
|
public let attachments: [AnyCodable]?
|
||||||
public let channel: String?
|
public let provider: String?
|
||||||
public let timeout: Int?
|
public let timeout: Int?
|
||||||
public let lane: String?
|
public let lane: String?
|
||||||
public let extrasystemprompt: String?
|
public let extrasystemprompt: String?
|
||||||
@@ -438,7 +438,7 @@ public struct AgentParams: Codable, Sendable {
|
|||||||
thinking: String?,
|
thinking: String?,
|
||||||
deliver: Bool?,
|
deliver: Bool?,
|
||||||
attachments: [AnyCodable]?,
|
attachments: [AnyCodable]?,
|
||||||
channel: String?,
|
provider: String?,
|
||||||
timeout: Int?,
|
timeout: Int?,
|
||||||
lane: String?,
|
lane: String?,
|
||||||
extrasystemprompt: String?,
|
extrasystemprompt: String?,
|
||||||
@@ -453,7 +453,7 @@ public struct AgentParams: Codable, Sendable {
|
|||||||
self.thinking = thinking
|
self.thinking = thinking
|
||||||
self.deliver = deliver
|
self.deliver = deliver
|
||||||
self.attachments = attachments
|
self.attachments = attachments
|
||||||
self.channel = channel
|
self.provider = provider
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
self.lane = lane
|
self.lane = lane
|
||||||
self.extrasystemprompt = extrasystemprompt
|
self.extrasystemprompt = extrasystemprompt
|
||||||
@@ -469,7 +469,7 @@ public struct AgentParams: Codable, Sendable {
|
|||||||
case thinking
|
case thinking
|
||||||
case deliver
|
case deliver
|
||||||
case attachments
|
case attachments
|
||||||
case channel
|
case provider
|
||||||
case timeout
|
case timeout
|
||||||
case lane
|
case lane
|
||||||
case extrasystemprompt = "extraSystemPrompt"
|
case extrasystemprompt = "extraSystemPrompt"
|
||||||
@@ -845,67 +845,42 @@ public struct ConfigGetParams: Codable, Sendable {
|
|||||||
|
|
||||||
public struct ConfigSetParams: Codable, Sendable {
|
public struct ConfigSetParams: Codable, Sendable {
|
||||||
public let raw: String
|
public let raw: String
|
||||||
public let basehash: String?
|
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
raw: String,
|
raw: String
|
||||||
basehash: String?
|
|
||||||
) {
|
) {
|
||||||
self.raw = raw
|
self.raw = raw
|
||||||
self.basehash = basehash
|
|
||||||
}
|
}
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case raw
|
case raw
|
||||||
case basehash = "baseHash"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConfigApplyParams: Codable, Sendable {
|
public struct ConfigApplyParams: Codable, Sendable {
|
||||||
public let raw: String
|
public let raw: String
|
||||||
public let basehash: String?
|
|
||||||
public let sessionkey: String?
|
public let sessionkey: String?
|
||||||
public let note: String?
|
public let note: String?
|
||||||
public let restartdelayms: Int?
|
public let restartdelayms: Int?
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
raw: String,
|
raw: String,
|
||||||
basehash: String?,
|
|
||||||
sessionkey: String?,
|
sessionkey: String?,
|
||||||
note: String?,
|
note: String?,
|
||||||
restartdelayms: Int?
|
restartdelayms: Int?
|
||||||
) {
|
) {
|
||||||
self.raw = raw
|
self.raw = raw
|
||||||
self.basehash = basehash
|
|
||||||
self.sessionkey = sessionkey
|
self.sessionkey = sessionkey
|
||||||
self.note = note
|
self.note = note
|
||||||
self.restartdelayms = restartdelayms
|
self.restartdelayms = restartdelayms
|
||||||
}
|
}
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case raw
|
case raw
|
||||||
case basehash = "baseHash"
|
|
||||||
case sessionkey = "sessionKey"
|
case sessionkey = "sessionKey"
|
||||||
case note
|
case note
|
||||||
case restartdelayms = "restartDelayMs"
|
case restartdelayms = "restartDelayMs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConfigPatchParams: Codable, Sendable {
|
|
||||||
public let raw: String
|
|
||||||
public let basehash: String?
|
|
||||||
|
|
||||||
public init(
|
|
||||||
raw: String,
|
|
||||||
basehash: String?
|
|
||||||
) {
|
|
||||||
self.raw = raw
|
|
||||||
self.basehash = basehash
|
|
||||||
}
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
|
||||||
case raw
|
|
||||||
case basehash = "baseHash"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct ConfigSchemaParams: Codable, Sendable {
|
public struct ConfigSchemaParams: Codable, Sendable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1127,7 +1102,7 @@ public struct TalkModeParams: Codable, Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ChannelsStatusParams: Codable, Sendable {
|
public struct ProvidersStatusParams: Codable, Sendable {
|
||||||
public let probe: Bool?
|
public let probe: Bool?
|
||||||
public let timeoutms: Int?
|
public let timeoutms: Int?
|
||||||
|
|
||||||
@@ -1144,52 +1119,52 @@ public struct ChannelsStatusParams: Codable, Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ChannelsStatusResult: Codable, Sendable {
|
public struct ProvidersStatusResult: Codable, Sendable {
|
||||||
public let ts: Int
|
public let ts: Int
|
||||||
public let channelorder: [String]
|
public let providerorder: [String]
|
||||||
public let channellabels: [String: AnyCodable]
|
public let providerlabels: [String: AnyCodable]
|
||||||
public let channels: [String: AnyCodable]
|
public let providers: [String: AnyCodable]
|
||||||
public let channelaccounts: [String: AnyCodable]
|
public let provideraccounts: [String: AnyCodable]
|
||||||
public let channeldefaultaccountid: [String: AnyCodable]
|
public let providerdefaultaccountid: [String: AnyCodable]
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
ts: Int,
|
ts: Int,
|
||||||
channelorder: [String],
|
providerorder: [String],
|
||||||
channellabels: [String: AnyCodable],
|
providerlabels: [String: AnyCodable],
|
||||||
channels: [String: AnyCodable],
|
providers: [String: AnyCodable],
|
||||||
channelaccounts: [String: AnyCodable],
|
provideraccounts: [String: AnyCodable],
|
||||||
channeldefaultaccountid: [String: AnyCodable]
|
providerdefaultaccountid: [String: AnyCodable]
|
||||||
) {
|
) {
|
||||||
self.ts = ts
|
self.ts = ts
|
||||||
self.channelorder = channelorder
|
self.providerorder = providerorder
|
||||||
self.channellabels = channellabels
|
self.providerlabels = providerlabels
|
||||||
self.channels = channels
|
self.providers = providers
|
||||||
self.channelaccounts = channelaccounts
|
self.provideraccounts = provideraccounts
|
||||||
self.channeldefaultaccountid = channeldefaultaccountid
|
self.providerdefaultaccountid = providerdefaultaccountid
|
||||||
}
|
}
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case ts
|
case ts
|
||||||
case channelorder = "channelOrder"
|
case providerorder = "providerOrder"
|
||||||
case channellabels = "channelLabels"
|
case providerlabels = "providerLabels"
|
||||||
case channels
|
case providers
|
||||||
case channelaccounts = "channelAccounts"
|
case provideraccounts = "providerAccounts"
|
||||||
case channeldefaultaccountid = "channelDefaultAccountId"
|
case providerdefaultaccountid = "providerDefaultAccountId"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ChannelsLogoutParams: Codable, Sendable {
|
public struct ProvidersLogoutParams: Codable, Sendable {
|
||||||
public let channel: String
|
public let provider: String
|
||||||
public let accountid: String?
|
public let accountid: String?
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
channel: String,
|
provider: String,
|
||||||
accountid: String?
|
accountid: String?
|
||||||
) {
|
) {
|
||||||
self.channel = channel
|
self.provider = provider
|
||||||
self.accountid = accountid
|
self.accountid = accountid
|
||||||
}
|
}
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case channel
|
case provider
|
||||||
case accountid = "accountId"
|
case accountid = "accountId"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ import Testing
|
|||||||
struct ConnectionsSettingsSmokeTests {
|
struct ConnectionsSettingsSmokeTests {
|
||||||
@Test func connectionsSettingsBuildsBodyWithSnapshot() {
|
@Test func connectionsSettingsBuildsBodyWithSnapshot() {
|
||||||
let store = ConnectionsStore(isPreview: true)
|
let store = ConnectionsStore(isPreview: true)
|
||||||
store.snapshot = ChannelsStatusSnapshot(
|
store.snapshot = ProvidersStatusSnapshot(
|
||||||
ts: 1_700_000_000_000,
|
ts: 1_700_000_000_000,
|
||||||
channelOrder: ["whatsapp", "telegram", "signal", "imessage"],
|
providerOrder: ["whatsapp", "telegram", "signal", "imessage"],
|
||||||
channelLabels: [
|
providerLabels: [
|
||||||
"whatsapp": "WhatsApp",
|
"whatsapp": "WhatsApp",
|
||||||
"telegram": "Telegram",
|
"telegram": "Telegram",
|
||||||
"signal": "Signal",
|
"signal": "Signal",
|
||||||
"imessage": "iMessage",
|
"imessage": "iMessage",
|
||||||
],
|
],
|
||||||
channels: [
|
providers: [
|
||||||
"whatsapp": AnyCodable([
|
"whatsapp": AnyCodable([
|
||||||
"configured": true,
|
"configured": true,
|
||||||
"linked": true,
|
"linked": true,
|
||||||
@@ -72,8 +72,8 @@ struct ConnectionsSettingsSmokeTests {
|
|||||||
"lastProbeAt": 1_700_000_050_000,
|
"lastProbeAt": 1_700_000_050_000,
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
channelAccounts: [:],
|
providerAccounts: [:],
|
||||||
channelDefaultAccountId: [
|
providerDefaultAccountId: [
|
||||||
"whatsapp": "default",
|
"whatsapp": "default",
|
||||||
"telegram": "default",
|
"telegram": "default",
|
||||||
"signal": "default",
|
"signal": "default",
|
||||||
@@ -97,16 +97,16 @@ struct ConnectionsSettingsSmokeTests {
|
|||||||
|
|
||||||
@Test func connectionsSettingsBuildsBodyWithoutSnapshot() {
|
@Test func connectionsSettingsBuildsBodyWithoutSnapshot() {
|
||||||
let store = ConnectionsStore(isPreview: true)
|
let store = ConnectionsStore(isPreview: true)
|
||||||
store.snapshot = ChannelsStatusSnapshot(
|
store.snapshot = ProvidersStatusSnapshot(
|
||||||
ts: 1_700_000_000_000,
|
ts: 1_700_000_000_000,
|
||||||
channelOrder: ["whatsapp", "telegram", "signal", "imessage"],
|
providerOrder: ["whatsapp", "telegram", "signal", "imessage"],
|
||||||
channelLabels: [
|
providerLabels: [
|
||||||
"whatsapp": "WhatsApp",
|
"whatsapp": "WhatsApp",
|
||||||
"telegram": "Telegram",
|
"telegram": "Telegram",
|
||||||
"signal": "Signal",
|
"signal": "Signal",
|
||||||
"imessage": "iMessage",
|
"imessage": "iMessage",
|
||||||
],
|
],
|
||||||
channels: [
|
providers: [
|
||||||
"whatsapp": AnyCodable([
|
"whatsapp": AnyCodable([
|
||||||
"configured": false,
|
"configured": false,
|
||||||
"linked": false,
|
"linked": false,
|
||||||
@@ -148,8 +148,8 @@ struct ConnectionsSettingsSmokeTests {
|
|||||||
"lastProbeAt": 1_700_000_200_000,
|
"lastProbeAt": 1_700_000_200_000,
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
channelAccounts: [:],
|
providerAccounts: [:],
|
||||||
channelDefaultAccountId: [
|
providerDefaultAccountId: [
|
||||||
"whatsapp": "default",
|
"whatsapp": "default",
|
||||||
"telegram": "default",
|
"telegram": "default",
|
||||||
"signal": "default",
|
"signal": "default",
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import Testing
|
|||||||
@Suite struct HealthDecodeTests {
|
@Suite struct HealthDecodeTests {
|
||||||
private let sampleJSON: String = // minimal but complete payload
|
private let sampleJSON: String = // minimal but complete payload
|
||||||
"""
|
"""
|
||||||
{"ts":1733622000,"durationMs":420,"channels":{"whatsapp":{"linked":true,"authAgeMs":120000},"telegram":{"configured":true,"probe":{"ok":true,"elapsedMs":800}}},"channelOrder":["whatsapp","telegram"],"heartbeatSeconds":60,"sessions":{"path":"/tmp/sessions.json","count":1,"recent":[{"key":"abc","updatedAt":1733621900,"age":120000}]}}
|
{"ts":1733622000,"durationMs":420,"providers":{"whatsapp":{"linked":true,"authAgeMs":120000},"telegram":{"configured":true,"probe":{"ok":true,"elapsedMs":800}}},"providerOrder":["whatsapp","telegram"],"heartbeatSeconds":60,"sessions":{"path":"/tmp/sessions.json","count":1,"recent":[{"key":"abc","updatedAt":1733621900,"age":120000}]}}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@Test func decodesCleanJSON() async throws {
|
@Test func decodesCleanJSON() async throws {
|
||||||
let data = Data(sampleJSON.utf8)
|
let data = Data(sampleJSON.utf8)
|
||||||
let snap = decodeHealthSnapshot(from: data)
|
let snap = decodeHealthSnapshot(from: data)
|
||||||
|
|
||||||
#expect(snap?.channels["whatsapp"]?.linked == true)
|
#expect(snap?.providers["whatsapp"]?.linked == true)
|
||||||
#expect(snap?.sessions.count == 1)
|
#expect(snap?.sessions.count == 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ import Testing
|
|||||||
let noisy = "debug: something logged\n" + self.sampleJSON + "\ntrailer"
|
let noisy = "debug: something logged\n" + self.sampleJSON + "\ntrailer"
|
||||||
let snap = decodeHealthSnapshot(from: Data(noisy.utf8))
|
let snap = decodeHealthSnapshot(from: Data(noisy.utf8))
|
||||||
|
|
||||||
#expect(snap?.channels["telegram"]?.probe?.elapsedMs == 800)
|
#expect(snap?.providers["telegram"]?.probe?.elapsedMs == 800)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test func failsWithoutBraces() async throws {
|
@Test func failsWithoutBraces() async throws {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import Testing
|
|||||||
@testable import Clawdbot
|
@testable import Clawdbot
|
||||||
|
|
||||||
@Suite struct HealthStoreStateTests {
|
@Suite struct HealthStoreStateTests {
|
||||||
@Test @MainActor func linkedChannelProbeFailureDegradesState() async throws {
|
@Test @MainActor func linkedProviderProbeFailureDegradesState() async throws {
|
||||||
let snap = HealthSnapshot(
|
let snap = HealthSnapshot(
|
||||||
ok: true,
|
ok: true,
|
||||||
ts: 0,
|
ts: 0,
|
||||||
durationMs: 1,
|
durationMs: 1,
|
||||||
channels: [
|
providers: [
|
||||||
"whatsapp": .init(
|
"whatsapp": .init(
|
||||||
configured: true,
|
configured: true,
|
||||||
linked: true,
|
linked: true,
|
||||||
@@ -22,8 +22,8 @@ import Testing
|
|||||||
webhook: nil),
|
webhook: nil),
|
||||||
lastProbeAt: 0),
|
lastProbeAt: 0),
|
||||||
],
|
],
|
||||||
channelOrder: ["whatsapp"],
|
providerOrder: ["whatsapp"],
|
||||||
channelLabels: ["whatsapp": "WhatsApp"],
|
providerLabels: ["whatsapp": "WhatsApp"],
|
||||||
heartbeatSeconds: 60,
|
heartbeatSeconds: 60,
|
||||||
sessions: .init(path: "/tmp/sessions.json", count: 0, recent: []))
|
sessions: .init(path: "/tmp/sessions.json", count: 0, recent: []))
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ import Testing
|
|||||||
case let .degraded(message):
|
case let .degraded(message):
|
||||||
#expect(!message.isEmpty)
|
#expect(!message.isEmpty)
|
||||||
default:
|
default:
|
||||||
Issue.record("Expected degraded state when probe fails for linked channel")
|
Issue.record("Expected degraded state when probe fails for linked provider")
|
||||||
}
|
}
|
||||||
|
|
||||||
#expect(store.summaryLine.contains("probe degraded"))
|
#expect(store.summaryLine.contains("probe degraded"))
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Clawdbot Chrome Extension (Browser Relay)
|
|
||||||
|
|
||||||
Purpose: attach Clawdbot to an existing Chrome tab so the Gateway can automate it (via the local CDP relay server).
|
|
||||||
|
|
||||||
## Dev / load unpacked
|
|
||||||
|
|
||||||
1. Build/run Clawdbot Gateway with browser control enabled.
|
|
||||||
2. Ensure the relay server is reachable at `http://127.0.0.1:18792/` (default).
|
|
||||||
3. Install the extension to a stable path:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
clawdbot browser extension install
|
|
||||||
clawdbot browser extension path
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Chrome → `chrome://extensions` → enable “Developer mode”.
|
|
||||||
5. “Load unpacked” → select the path printed above.
|
|
||||||
6. Pin the extension. Click the icon on a tab to attach/detach.
|
|
||||||
|
|
||||||
## Options
|
|
||||||
|
|
||||||
- `Relay port`: defaults to `18792`.
|
|
||||||
@@ -1,438 +0,0 @@
|
|||||||
const DEFAULT_PORT = 18792
|
|
||||||
|
|
||||||
const BADGE = {
|
|
||||||
on: { text: 'ON', color: '#FF5A36' },
|
|
||||||
off: { text: '', color: '#000000' },
|
|
||||||
connecting: { text: '…', color: '#F59E0B' },
|
|
||||||
error: { text: '!', color: '#B91C1C' },
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @type {WebSocket|null} */
|
|
||||||
let relayWs = null
|
|
||||||
/** @type {Promise<void>|null} */
|
|
||||||
let relayConnectPromise = null
|
|
||||||
|
|
||||||
let debuggerListenersInstalled = false
|
|
||||||
|
|
||||||
let nextSession = 1
|
|
||||||
|
|
||||||
/** @type {Map<number, {state:'connecting'|'connected', sessionId?:string, targetId?:string, attachOrder?:number}>} */
|
|
||||||
const tabs = new Map()
|
|
||||||
/** @type {Map<string, number>} */
|
|
||||||
const tabBySession = new Map()
|
|
||||||
/** @type {Map<string, number>} */
|
|
||||||
const childSessionToTab = new Map()
|
|
||||||
|
|
||||||
/** @type {Map<number, {resolve:(v:any)=>void, reject:(e:Error)=>void}>} */
|
|
||||||
const pending = new Map()
|
|
||||||
|
|
||||||
function nowStack() {
|
|
||||||
try {
|
|
||||||
return new Error().stack || ''
|
|
||||||
} catch {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getRelayPort() {
|
|
||||||
const stored = await chrome.storage.local.get(['relayPort'])
|
|
||||||
const raw = stored.relayPort
|
|
||||||
const n = Number.parseInt(String(raw || ''), 10)
|
|
||||||
if (!Number.isFinite(n) || n <= 0 || n > 65535) return DEFAULT_PORT
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBadge(tabId, kind) {
|
|
||||||
const cfg = BADGE[kind]
|
|
||||||
void chrome.action.setBadgeText({ tabId, text: cfg.text })
|
|
||||||
void chrome.action.setBadgeBackgroundColor({ tabId, color: cfg.color })
|
|
||||||
void chrome.action.setBadgeTextColor({ tabId, color: '#FFFFFF' }).catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function ensureRelayConnection() {
|
|
||||||
if (relayWs && relayWs.readyState === WebSocket.OPEN) return
|
|
||||||
if (relayConnectPromise) return await relayConnectPromise
|
|
||||||
|
|
||||||
relayConnectPromise = (async () => {
|
|
||||||
const port = await getRelayPort()
|
|
||||||
const httpBase = `http://127.0.0.1:${port}`
|
|
||||||
const wsUrl = `ws://127.0.0.1:${port}/extension`
|
|
||||||
|
|
||||||
// Fast preflight: is the relay server up?
|
|
||||||
try {
|
|
||||||
await fetch(`${httpBase}/`, { method: 'HEAD', signal: AbortSignal.timeout(2000) })
|
|
||||||
} catch (err) {
|
|
||||||
throw new Error(`Relay server not reachable at ${httpBase} (${String(err)})`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const ws = new WebSocket(wsUrl)
|
|
||||||
relayWs = ws
|
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
|
||||||
const t = setTimeout(() => reject(new Error('WebSocket connect timeout')), 5000)
|
|
||||||
ws.onopen = () => {
|
|
||||||
clearTimeout(t)
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
ws.onerror = () => {
|
|
||||||
clearTimeout(t)
|
|
||||||
reject(new Error('WebSocket connect failed'))
|
|
||||||
}
|
|
||||||
ws.onclose = (ev) => {
|
|
||||||
clearTimeout(t)
|
|
||||||
reject(new Error(`WebSocket closed (${ev.code} ${ev.reason || 'no reason'})`))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
ws.onmessage = (event) => void onRelayMessage(String(event.data || ''))
|
|
||||||
ws.onclose = () => onRelayClosed('closed')
|
|
||||||
ws.onerror = () => onRelayClosed('error')
|
|
||||||
|
|
||||||
if (!debuggerListenersInstalled) {
|
|
||||||
debuggerListenersInstalled = true
|
|
||||||
chrome.debugger.onEvent.addListener(onDebuggerEvent)
|
|
||||||
chrome.debugger.onDetach.addListener(onDebuggerDetach)
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
|
|
||||||
try {
|
|
||||||
await relayConnectPromise
|
|
||||||
} finally {
|
|
||||||
relayConnectPromise = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onRelayClosed(reason) {
|
|
||||||
relayWs = null
|
|
||||||
for (const [id, p] of pending.entries()) {
|
|
||||||
pending.delete(id)
|
|
||||||
p.reject(new Error(`Relay disconnected (${reason})`))
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const tabId of tabs.keys()) {
|
|
||||||
void chrome.debugger.detach({ tabId }).catch(() => {})
|
|
||||||
setBadge(tabId, 'connecting')
|
|
||||||
void chrome.action.setTitle({
|
|
||||||
tabId,
|
|
||||||
title: 'Clawdbot Browser Relay: disconnected (click to re-attach)',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
tabs.clear()
|
|
||||||
tabBySession.clear()
|
|
||||||
childSessionToTab.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendToRelay(payload) {
|
|
||||||
const ws = relayWs
|
|
||||||
if (!ws || ws.readyState !== WebSocket.OPEN) {
|
|
||||||
throw new Error('Relay not connected')
|
|
||||||
}
|
|
||||||
ws.send(JSON.stringify(payload))
|
|
||||||
}
|
|
||||||
|
|
||||||
async function maybeOpenHelpOnce() {
|
|
||||||
try {
|
|
||||||
const stored = await chrome.storage.local.get(['helpOnErrorShown'])
|
|
||||||
if (stored.helpOnErrorShown === true) return
|
|
||||||
await chrome.storage.local.set({ helpOnErrorShown: true })
|
|
||||||
await chrome.runtime.openOptionsPage()
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function requestFromRelay(command) {
|
|
||||||
const id = command.id
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
pending.set(id, { resolve, reject })
|
|
||||||
try {
|
|
||||||
sendToRelay(command)
|
|
||||||
} catch (err) {
|
|
||||||
pending.delete(id)
|
|
||||||
reject(err instanceof Error ? err : new Error(String(err)))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onRelayMessage(text) {
|
|
||||||
/** @type {any} */
|
|
||||||
let msg
|
|
||||||
try {
|
|
||||||
msg = JSON.parse(text)
|
|
||||||
} catch {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg && msg.method === 'ping') {
|
|
||||||
try {
|
|
||||||
sendToRelay({ method: 'pong' })
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg && typeof msg.id === 'number' && (msg.result !== undefined || msg.error !== undefined)) {
|
|
||||||
const p = pending.get(msg.id)
|
|
||||||
if (!p) return
|
|
||||||
pending.delete(msg.id)
|
|
||||||
if (msg.error) p.reject(new Error(String(msg.error)))
|
|
||||||
else p.resolve(msg.result)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg && typeof msg.id === 'number' && msg.method === 'forwardCDPCommand') {
|
|
||||||
try {
|
|
||||||
const result = await handleForwardCdpCommand(msg)
|
|
||||||
sendToRelay({ id: msg.id, result })
|
|
||||||
} catch (err) {
|
|
||||||
sendToRelay({ id: msg.id, error: err instanceof Error ? err.message : String(err) })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTabBySessionId(sessionId) {
|
|
||||||
const direct = tabBySession.get(sessionId)
|
|
||||||
if (direct) return { tabId: direct, kind: 'main' }
|
|
||||||
const child = childSessionToTab.get(sessionId)
|
|
||||||
if (child) return { tabId: child, kind: 'child' }
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTabByTargetId(targetId) {
|
|
||||||
for (const [tabId, tab] of tabs.entries()) {
|
|
||||||
if (tab.targetId === targetId) return tabId
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
async function attachTab(tabId, opts = {}) {
|
|
||||||
const debuggee = { tabId }
|
|
||||||
await chrome.debugger.attach(debuggee, '1.3')
|
|
||||||
await chrome.debugger.sendCommand(debuggee, 'Page.enable').catch(() => {})
|
|
||||||
|
|
||||||
const info = /** @type {any} */ (await chrome.debugger.sendCommand(debuggee, 'Target.getTargetInfo'))
|
|
||||||
const targetInfo = info?.targetInfo
|
|
||||||
const targetId = String(targetInfo?.targetId || '').trim()
|
|
||||||
if (!targetId) {
|
|
||||||
throw new Error('Target.getTargetInfo returned no targetId')
|
|
||||||
}
|
|
||||||
|
|
||||||
const sessionId = `cb-tab-${nextSession++}`
|
|
||||||
const attachOrder = nextSession
|
|
||||||
|
|
||||||
tabs.set(tabId, { state: 'connected', sessionId, targetId, attachOrder })
|
|
||||||
tabBySession.set(sessionId, tabId)
|
|
||||||
void chrome.action.setTitle({
|
|
||||||
tabId,
|
|
||||||
title: 'Clawdbot Browser Relay: attached (click to detach)',
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!opts.skipAttachedEvent) {
|
|
||||||
sendToRelay({
|
|
||||||
method: 'forwardCDPEvent',
|
|
||||||
params: {
|
|
||||||
method: 'Target.attachedToTarget',
|
|
||||||
params: {
|
|
||||||
sessionId,
|
|
||||||
targetInfo: { ...targetInfo, attached: true },
|
|
||||||
waitingForDebugger: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
setBadge(tabId, 'on')
|
|
||||||
return { sessionId, targetId }
|
|
||||||
}
|
|
||||||
|
|
||||||
async function detachTab(tabId, reason) {
|
|
||||||
const tab = tabs.get(tabId)
|
|
||||||
if (tab?.sessionId && tab?.targetId) {
|
|
||||||
try {
|
|
||||||
sendToRelay({
|
|
||||||
method: 'forwardCDPEvent',
|
|
||||||
params: {
|
|
||||||
method: 'Target.detachedFromTarget',
|
|
||||||
params: { sessionId: tab.sessionId, targetId: tab.targetId, reason },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tab?.sessionId) tabBySession.delete(tab.sessionId)
|
|
||||||
tabs.delete(tabId)
|
|
||||||
|
|
||||||
for (const [childSessionId, parentTabId] of childSessionToTab.entries()) {
|
|
||||||
if (parentTabId === tabId) childSessionToTab.delete(childSessionId)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await chrome.debugger.detach({ tabId })
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
setBadge(tabId, 'off')
|
|
||||||
void chrome.action.setTitle({
|
|
||||||
tabId,
|
|
||||||
title: 'Clawdbot Browser Relay (click to attach/detach)',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function connectOrToggleForActiveTab() {
|
|
||||||
const [active] = await chrome.tabs.query({ active: true, currentWindow: true })
|
|
||||||
const tabId = active?.id
|
|
||||||
if (!tabId) return
|
|
||||||
|
|
||||||
const existing = tabs.get(tabId)
|
|
||||||
if (existing?.state === 'connected') {
|
|
||||||
await detachTab(tabId, 'toggle')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
tabs.set(tabId, { state: 'connecting' })
|
|
||||||
setBadge(tabId, 'connecting')
|
|
||||||
void chrome.action.setTitle({
|
|
||||||
tabId,
|
|
||||||
title: 'Clawdbot Browser Relay: connecting to local relay…',
|
|
||||||
})
|
|
||||||
|
|
||||||
try {
|
|
||||||
await ensureRelayConnection()
|
|
||||||
await attachTab(tabId)
|
|
||||||
} catch (err) {
|
|
||||||
tabs.delete(tabId)
|
|
||||||
setBadge(tabId, 'error')
|
|
||||||
void chrome.action.setTitle({
|
|
||||||
tabId,
|
|
||||||
title: 'Clawdbot Browser Relay: relay not running (open options for setup)',
|
|
||||||
})
|
|
||||||
void maybeOpenHelpOnce()
|
|
||||||
// Extra breadcrumbs in chrome://extensions service worker logs.
|
|
||||||
const message = err instanceof Error ? err.message : String(err)
|
|
||||||
console.warn('attach failed', message, nowStack())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleForwardCdpCommand(msg) {
|
|
||||||
const method = String(msg?.params?.method || '').trim()
|
|
||||||
const params = msg?.params?.params || undefined
|
|
||||||
const sessionId = typeof msg?.params?.sessionId === 'string' ? msg.params.sessionId : undefined
|
|
||||||
|
|
||||||
// Map command to tab
|
|
||||||
const bySession = sessionId ? getTabBySessionId(sessionId) : null
|
|
||||||
const targetId = typeof params?.targetId === 'string' ? params.targetId : undefined
|
|
||||||
const tabId =
|
|
||||||
bySession?.tabId ||
|
|
||||||
(targetId ? getTabByTargetId(targetId) : null) ||
|
|
||||||
(() => {
|
|
||||||
// No sessionId: pick the first connected tab (stable-ish).
|
|
||||||
for (const [id, tab] of tabs.entries()) {
|
|
||||||
if (tab.state === 'connected') return id
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})()
|
|
||||||
|
|
||||||
if (!tabId) throw new Error(`No attached tab for method ${method}`)
|
|
||||||
|
|
||||||
/** @type {chrome.debugger.DebuggerSession} */
|
|
||||||
const debuggee = { tabId }
|
|
||||||
|
|
||||||
if (method === 'Runtime.enable') {
|
|
||||||
try {
|
|
||||||
await chrome.debugger.sendCommand(debuggee, 'Runtime.disable')
|
|
||||||
await new Promise((r) => setTimeout(r, 50))
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
return await chrome.debugger.sendCommand(debuggee, 'Runtime.enable', params)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (method === 'Target.createTarget') {
|
|
||||||
const url = typeof params?.url === 'string' ? params.url : 'about:blank'
|
|
||||||
const tab = await chrome.tabs.create({ url, active: false })
|
|
||||||
if (!tab.id) throw new Error('Failed to create tab')
|
|
||||||
await new Promise((r) => setTimeout(r, 100))
|
|
||||||
const attached = await attachTab(tab.id)
|
|
||||||
return { targetId: attached.targetId }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (method === 'Target.closeTarget') {
|
|
||||||
const target = typeof params?.targetId === 'string' ? params.targetId : ''
|
|
||||||
const toClose = target ? getTabByTargetId(target) : tabId
|
|
||||||
if (!toClose) return { success: false }
|
|
||||||
try {
|
|
||||||
await chrome.tabs.remove(toClose)
|
|
||||||
} catch {
|
|
||||||
return { success: false }
|
|
||||||
}
|
|
||||||
return { success: true }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (method === 'Target.activateTarget') {
|
|
||||||
const target = typeof params?.targetId === 'string' ? params.targetId : ''
|
|
||||||
const toActivate = target ? getTabByTargetId(target) : tabId
|
|
||||||
if (!toActivate) return {}
|
|
||||||
const tab = await chrome.tabs.get(toActivate).catch(() => null)
|
|
||||||
if (!tab) return {}
|
|
||||||
if (tab.windowId) {
|
|
||||||
await chrome.windows.update(tab.windowId, { focused: true }).catch(() => {})
|
|
||||||
}
|
|
||||||
await chrome.tabs.update(toActivate, { active: true }).catch(() => {})
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
|
|
||||||
const tabState = tabs.get(tabId)
|
|
||||||
const mainSessionId = tabState?.sessionId
|
|
||||||
const debuggerSession =
|
|
||||||
sessionId && mainSessionId && sessionId !== mainSessionId
|
|
||||||
? { ...debuggee, sessionId }
|
|
||||||
: debuggee
|
|
||||||
|
|
||||||
return await chrome.debugger.sendCommand(debuggerSession, method, params)
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDebuggerEvent(source, method, params) {
|
|
||||||
const tabId = source.tabId
|
|
||||||
if (!tabId) return
|
|
||||||
const tab = tabs.get(tabId)
|
|
||||||
if (!tab?.sessionId) return
|
|
||||||
|
|
||||||
if (method === 'Target.attachedToTarget' && params?.sessionId) {
|
|
||||||
childSessionToTab.set(String(params.sessionId), tabId)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (method === 'Target.detachedFromTarget' && params?.sessionId) {
|
|
||||||
childSessionToTab.delete(String(params.sessionId))
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
sendToRelay({
|
|
||||||
method: 'forwardCDPEvent',
|
|
||||||
params: {
|
|
||||||
sessionId: source.sessionId || tab.sessionId,
|
|
||||||
method,
|
|
||||||
params,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDebuggerDetach(source, reason) {
|
|
||||||
const tabId = source.tabId
|
|
||||||
if (!tabId) return
|
|
||||||
if (!tabs.has(tabId)) return
|
|
||||||
void detachTab(tabId, reason)
|
|
||||||
}
|
|
||||||
|
|
||||||
chrome.action.onClicked.addListener(() => void connectOrToggleForActiveTab())
|
|
||||||
|
|
||||||
chrome.runtime.onInstalled.addListener(() => {
|
|
||||||
// Useful: first-time instructions.
|
|
||||||
void chrome.runtime.openOptionsPage()
|
|
||||||
})
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 614 B |
Binary file not shown.
|
Before Width: | Height: | Size: 265 B |
Binary file not shown.
|
Before Width: | Height: | Size: 318 B |
Binary file not shown.
|
Before Width: | Height: | Size: 370 B |
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"manifest_version": 3,
|
|
||||||
"name": "Clawdbot Browser Relay",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"description": "Attach Clawdbot to your existing Chrome tab via a local CDP relay server.",
|
|
||||||
"icons": {
|
|
||||||
"16": "icons/icon16.png",
|
|
||||||
"32": "icons/icon32.png",
|
|
||||||
"48": "icons/icon48.png",
|
|
||||||
"128": "icons/icon128.png"
|
|
||||||
},
|
|
||||||
"permissions": ["debugger", "tabs", "activeTab", "storage"],
|
|
||||||
"host_permissions": ["http://127.0.0.1/*", "http://localhost/*"],
|
|
||||||
"background": { "service_worker": "background.js", "type": "module" },
|
|
||||||
"action": {
|
|
||||||
"default_title": "Clawdbot Browser Relay (click to attach/detach)",
|
|
||||||
"default_icon": {
|
|
||||||
"16": "icons/icon16.png",
|
|
||||||
"32": "icons/icon32.png",
|
|
||||||
"48": "icons/icon48.png",
|
|
||||||
"128": "icons/icon128.png"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"options_ui": { "page": "options.html", "open_in_tab": true }
|
|
||||||
}
|
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<title>Clawdbot Browser Relay</title>
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
color-scheme: light dark;
|
|
||||||
--accent: #ff5a36;
|
|
||||||
--panel: color-mix(in oklab, canvas 92%, canvasText 8%);
|
|
||||||
--border: color-mix(in oklab, canvasText 18%, transparent);
|
|
||||||
--muted: color-mix(in oklab, canvasText 70%, transparent);
|
|
||||||
--shadow: 0 10px 30px color-mix(in oklab, canvasText 18%, transparent);
|
|
||||||
font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Rounded",
|
|
||||||
"SF Pro Display", "Segoe UI", sans-serif;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
min-height: 100vh;
|
|
||||||
background:
|
|
||||||
radial-gradient(1000px 500px at 10% 0%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 70%),
|
|
||||||
radial-gradient(900px 450px at 90% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 75%),
|
|
||||||
canvas;
|
|
||||||
color: canvasText;
|
|
||||||
}
|
|
||||||
.wrap {
|
|
||||||
max-width: 820px;
|
|
||||||
margin: 36px auto;
|
|
||||||
padding: 0 24px 48px 24px;
|
|
||||||
}
|
|
||||||
header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
margin-bottom: 18px;
|
|
||||||
}
|
|
||||||
.logo {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
border-radius: 14px;
|
|
||||||
background: color-mix(in oklab, var(--accent) 18%, transparent);
|
|
||||||
border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
}
|
|
||||||
.logo img {
|
|
||||||
width: 28px;
|
|
||||||
height: 28px;
|
|
||||||
image-rendering: pixelated;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 20px;
|
|
||||||
margin: 0;
|
|
||||||
letter-spacing: -0.01em;
|
|
||||||
}
|
|
||||||
.subtitle {
|
|
||||||
margin: 2px 0 0 0;
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
gap: 14px;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
background: var(--panel);
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 16px;
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
}
|
|
||||||
.card h2 {
|
|
||||||
margin: 0 0 10px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
}
|
|
||||||
.card p {
|
|
||||||
margin: 8px 0 0 0;
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--muted);
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width: 160px;
|
|
||||||
padding: 10px 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
background: color-mix(in oklab, canvas 92%, canvasText 8%);
|
|
||||||
color: canvasText;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
border-color: color-mix(in oklab, var(--accent) 70%, transparent);
|
|
||||||
box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent);
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
padding: 10px 14px;
|
|
||||||
border-radius: 12px;
|
|
||||||
border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
|
|
||||||
background: linear-gradient(
|
|
||||||
180deg,
|
|
||||||
color-mix(in oklab, var(--accent) 80%, white 20%),
|
|
||||||
var(--accent)
|
|
||||||
);
|
|
||||||
color: white;
|
|
||||||
font-weight: 650;
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
button:active {
|
|
||||||
transform: translateY(1px);
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--muted);
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
font-family: ui-monospace, Menlo, Monaco, Consolas, "SF Mono", monospace;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: color-mix(in oklab, var(--accent) 85%, canvasText 15%);
|
|
||||||
}
|
|
||||||
.status {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: color-mix(in oklab, var(--accent) 70%, canvasText 30%);
|
|
||||||
min-height: 16px;
|
|
||||||
}
|
|
||||||
.status[data-kind='ok'] {
|
|
||||||
color: color-mix(in oklab, #16a34a 75%, canvasText 25%);
|
|
||||||
}
|
|
||||||
.status[data-kind='error'] {
|
|
||||||
color: color-mix(in oklab, #ef4444 75%, canvasText 25%);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="wrap">
|
|
||||||
<header>
|
|
||||||
<div class="logo" aria-hidden="true">
|
|
||||||
<img src="icons/icon128.png" alt="" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h1>Clawdbot Browser Relay</h1>
|
|
||||||
<p class="subtitle">Click the toolbar button on a tab to attach / detach.</p>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="grid">
|
|
||||||
<div class="card">
|
|
||||||
<h2>Getting started</h2>
|
|
||||||
<p>
|
|
||||||
If you see a red <code>!</code> badge on the extension icon, the relay server is not reachable.
|
|
||||||
Start Clawdbot’s browser relay on this machine (Gateway or <code>clawdbot browser serve</code>),
|
|
||||||
then click the toolbar button again.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Full guide (install, remote Gateway, security): <a href="https://docs.clawd.bot/tools/chrome-extension" target="_blank" rel="noreferrer">docs.clawd.bot/tools/chrome-extension</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h2>Relay port</h2>
|
|
||||||
<label for="port">Port</label>
|
|
||||||
<div class="row">
|
|
||||||
<input id="port" inputmode="numeric" pattern="[0-9]*" />
|
|
||||||
<button id="save" type="button">Save</button>
|
|
||||||
</div>
|
|
||||||
<div class="hint">
|
|
||||||
Default: <code>18792</code>. Extension connects to: <code id="relay-url">http://127.0.0.1:<port>/</code>.
|
|
||||||
Only change this if your Clawdbot profile uses a different <code>cdpUrl</code> port.
|
|
||||||
</div>
|
|
||||||
<div class="status" id="status"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="module" src="options.js"></script>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
const DEFAULT_PORT = 18792
|
|
||||||
|
|
||||||
function clampPort(value) {
|
|
||||||
const n = Number.parseInt(String(value || ''), 10)
|
|
||||||
if (!Number.isFinite(n)) return DEFAULT_PORT
|
|
||||||
if (n <= 0 || n > 65535) return DEFAULT_PORT
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateRelayUrl(port) {
|
|
||||||
const el = document.getElementById('relay-url')
|
|
||||||
if (!el) return
|
|
||||||
el.textContent = `http://127.0.0.1:${port}/`
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStatus(kind, message) {
|
|
||||||
const status = document.getElementById('status')
|
|
||||||
if (!status) return
|
|
||||||
status.dataset.kind = kind || ''
|
|
||||||
status.textContent = message || ''
|
|
||||||
}
|
|
||||||
|
|
||||||
async function checkRelayReachable(port) {
|
|
||||||
const url = `http://127.0.0.1:${port}/`
|
|
||||||
const ctrl = new AbortController()
|
|
||||||
const t = setTimeout(() => ctrl.abort(), 900)
|
|
||||||
try {
|
|
||||||
const res = await fetch(url, { method: 'HEAD', signal: ctrl.signal })
|
|
||||||
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
||||||
setStatus('ok', `Relay reachable at ${url}`)
|
|
||||||
} catch {
|
|
||||||
setStatus(
|
|
||||||
'error',
|
|
||||||
`Relay not reachable at ${url}. Start Clawdbot’s browser relay on this machine, then click the toolbar button again.`,
|
|
||||||
)
|
|
||||||
} finally {
|
|
||||||
clearTimeout(t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function load() {
|
|
||||||
const stored = await chrome.storage.local.get(['relayPort'])
|
|
||||||
const port = clampPort(stored.relayPort)
|
|
||||||
document.getElementById('port').value = String(port)
|
|
||||||
updateRelayUrl(port)
|
|
||||||
await checkRelayReachable(port)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function save() {
|
|
||||||
const input = document.getElementById('port')
|
|
||||||
const port = clampPort(input.value)
|
|
||||||
await chrome.storage.local.set({ relayPort: port })
|
|
||||||
input.value = String(port)
|
|
||||||
updateRelayUrl(port)
|
|
||||||
await checkRelayReachable(port)
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById('save').addEventListener('click', () => void save())
|
|
||||||
void load()
|
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/biome.json",
|
||||||
|
"formatter": {
|
||||||
|
"enabled": true,
|
||||||
|
"indentWidth": 2,
|
||||||
|
"indentStyle": "space"
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"includes": ["src/**/*.ts", "test/**/*.ts"]
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -41,7 +41,7 @@ nav:
|
|||||||
- title: "Android App"
|
- title: "Android App"
|
||||||
url: "/platforms/android/"
|
url: "/platforms/android/"
|
||||||
- title: "Telegram"
|
- title: "Telegram"
|
||||||
url: "/channels/telegram/"
|
url: "/providers/telegram/"
|
||||||
- title: "Security"
|
- title: "Security"
|
||||||
url: "/gateway/security/"
|
url: "/gateway/security/"
|
||||||
- title: "Troubleshooting"
|
- title: "Troubleshooting"
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ Key behaviors:
|
|||||||
- Prompt is prefixed with `[cron:<jobId> <job name>]` for traceability.
|
- Prompt is prefixed with `[cron:<jobId> <job name>]` for traceability.
|
||||||
- A summary is posted to the main session (prefix `Cron`, configurable).
|
- A summary is posted to the main session (prefix `Cron`, configurable).
|
||||||
- `wakeMode: "now"` triggers an immediate heartbeat after posting the summary.
|
- `wakeMode: "now"` triggers an immediate heartbeat after posting the summary.
|
||||||
- If `payload.deliver: true`, output is delivered to a channel; otherwise it stays internal.
|
- If `payload.deliver: true`, output is delivered to a provider; otherwise it stays internal.
|
||||||
|
|
||||||
Use isolated jobs for noisy, frequent, or "background chores" that shouldn't spam
|
Use isolated jobs for noisy, frequent, or "background chores" that shouldn't spam
|
||||||
your main chat history.
|
your main chat history.
|
||||||
@@ -94,9 +94,9 @@ Common `agentTurn` fields:
|
|||||||
- `message`: required text prompt.
|
- `message`: required text prompt.
|
||||||
- `model` / `thinking`: optional overrides (see below).
|
- `model` / `thinking`: optional overrides (see below).
|
||||||
- `timeoutSeconds`: optional timeout override.
|
- `timeoutSeconds`: optional timeout override.
|
||||||
- `deliver`: `true` to send output to a channel target.
|
- `deliver`: `true` to send output to a provider target.
|
||||||
- `channel`: `last` or a specific channel.
|
- `provider`: `last` or a specific provider.
|
||||||
- `to`: channel-specific target (phone/chat/channel id).
|
- `to`: provider-specific target (phone/chat/channel id).
|
||||||
- `bestEffortDeliver`: avoid failing the job if delivery fails.
|
- `bestEffortDeliver`: avoid failing the job if delivery fails.
|
||||||
|
|
||||||
Isolation options (only for `session=isolated`):
|
Isolation options (only for `session=isolated`):
|
||||||
@@ -116,12 +116,12 @@ Resolution priority:
|
|||||||
2. Hook-specific defaults (e.g., `hooks.gmail.model`)
|
2. Hook-specific defaults (e.g., `hooks.gmail.model`)
|
||||||
3. Agent config default
|
3. Agent config default
|
||||||
|
|
||||||
### Delivery (channel + target)
|
### Delivery (provider + target)
|
||||||
Isolated jobs can deliver output to a channel. The job payload can specify:
|
Isolated jobs can deliver output to a provider. The job payload can specify:
|
||||||
- `channel`: `whatsapp` / `telegram` / `discord` / `slack` / `signal` / `imessage` / `last`
|
- `provider`: `whatsapp` / `telegram` / `discord` / `slack` / `signal` / `imessage` / `last`
|
||||||
- `to`: channel-specific recipient target
|
- `to`: provider-specific recipient target
|
||||||
|
|
||||||
If `channel` or `to` is omitted, cron can fall back to the main session’s “last route”
|
If `provider` or `to` is omitted, cron can fall back to the main session’s “last route”
|
||||||
(the last place the agent replied).
|
(the last place the agent replied).
|
||||||
|
|
||||||
Target format reminders:
|
Target format reminders:
|
||||||
@@ -192,7 +192,7 @@ clawdbot cron add \
|
|||||||
--session isolated \
|
--session isolated \
|
||||||
--message "Summarize inbox + calendar for today." \
|
--message "Summarize inbox + calendar for today." \
|
||||||
--deliver \
|
--deliver \
|
||||||
--channel whatsapp \
|
--provider whatsapp \
|
||||||
--to "+15551234567"
|
--to "+15551234567"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ clawdbot cron add \
|
|||||||
--session isolated \
|
--session isolated \
|
||||||
--message "Summarize today; send to the nightly topic." \
|
--message "Summarize today; send to the nightly topic." \
|
||||||
--deliver \
|
--deliver \
|
||||||
--channel telegram \
|
--provider telegram \
|
||||||
--to "-1001234567890:topic:123"
|
--to "-1001234567890:topic:123"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ clawdbot cron add \
|
|||||||
--model "opus" \
|
--model "opus" \
|
||||||
--thinking high \
|
--thinking high \
|
||||||
--deliver \
|
--deliver \
|
||||||
--channel whatsapp \
|
--provider whatsapp \
|
||||||
--to "+15551234567"
|
--to "+15551234567"
|
||||||
|
|
||||||
Agent selection (multi-agent setups):
|
Agent selection (multi-agent setups):
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Example hook config (enable Gmail preset mapping):
|
|||||||
```
|
```
|
||||||
|
|
||||||
To deliver the Gmail summary to a chat surface, override the preset with a mapping
|
To deliver the Gmail summary to a chat surface, override the preset with a mapping
|
||||||
that sets `deliver` + optional `channel`/`to`:
|
that sets `deliver` + optional `provider`/`to`:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ that sets `deliver` + optional `channel`/`to`:
|
|||||||
"New email from {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}\n{{messages[0].body}}",
|
"New email from {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}\n{{messages[0].body}}",
|
||||||
model: "openai/gpt-5.2-mini",
|
model: "openai/gpt-5.2-mini",
|
||||||
deliver: true,
|
deliver: true,
|
||||||
channel: "last"
|
provider: "last"
|
||||||
// to: "+15551234567"
|
// to: "+15551234567"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -59,7 +59,7 @@ that sets `deliver` + optional `channel`/`to`:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want a fixed channel, set `channel` + `to`. Otherwise `channel: "last"`
|
If you want a fixed channel, set `provider` + `to`. Otherwise `provider: "last"`
|
||||||
uses the last delivery route (falls back to WhatsApp).
|
uses the last delivery route (falls back to WhatsApp).
|
||||||
|
|
||||||
To force a cheaper model for Gmail runs, set `model` in the mapping
|
To force a cheaper model for Gmail runs, set `model` in the mapping
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ read_when:
|
|||||||
# Polls
|
# Polls
|
||||||
|
|
||||||
|
|
||||||
## Supported channels
|
## Supported providers
|
||||||
- WhatsApp (web channel)
|
- WhatsApp (web provider)
|
||||||
- Discord
|
- Discord
|
||||||
- MS Teams (Adaptive Cards)
|
- MS Teams (Adaptive Cards)
|
||||||
|
|
||||||
@@ -22,18 +22,18 @@ clawdbot message poll --to 123456789@g.us \
|
|||||||
--poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi
|
--poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi
|
||||||
|
|
||||||
# Discord
|
# Discord
|
||||||
clawdbot message poll --channel discord --to channel:123456789 \
|
clawdbot message poll --provider discord --to channel:123456789 \
|
||||||
--poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"
|
--poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"
|
||||||
clawdbot message poll --channel discord --to channel:123456789 \
|
clawdbot message poll --provider discord --to channel:123456789 \
|
||||||
--poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48
|
--poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48
|
||||||
|
|
||||||
# MS Teams
|
# MS Teams
|
||||||
clawdbot message poll --channel msteams --to conversation:19:abc@thread.tacv2 \
|
clawdbot message poll --provider msteams --to conversation:19:abc@thread.tacv2 \
|
||||||
--poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"
|
--poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"
|
||||||
```
|
```
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
- `--channel`: `whatsapp` (default), `discord`, or `msteams`
|
- `--provider`: `whatsapp` (default), `discord`, or `msteams`
|
||||||
- `--poll-multi`: allow selecting multiple options
|
- `--poll-multi`: allow selecting multiple options
|
||||||
- `--poll-duration-hours`: Discord-only (defaults to 24 when omitted)
|
- `--poll-duration-hours`: Discord-only (defaults to 24 when omitted)
|
||||||
|
|
||||||
@@ -47,16 +47,16 @@ Params:
|
|||||||
- `options` (string[], required)
|
- `options` (string[], required)
|
||||||
- `maxSelections` (number, optional)
|
- `maxSelections` (number, optional)
|
||||||
- `durationHours` (number, optional)
|
- `durationHours` (number, optional)
|
||||||
- `channel` (string, optional, default: `whatsapp`)
|
- `provider` (string, optional, default: `whatsapp`)
|
||||||
- `idempotencyKey` (string, required)
|
- `idempotencyKey` (string, required)
|
||||||
|
|
||||||
## Channel differences
|
## Provider differences
|
||||||
- WhatsApp: 2-12 options, `maxSelections` must be within option count, ignores `durationHours`.
|
- WhatsApp: 2-12 options, `maxSelections` must be within option count, ignores `durationHours`.
|
||||||
- Discord: 2-10 options, `durationHours` clamped to 1-768 hours (default 24). `maxSelections > 1` enables multi-select; Discord does not support a strict selection count.
|
- Discord: 2-10 options, `durationHours` clamped to 1-768 hours (default 24). `maxSelections > 1` enables multi-select; Discord does not support a strict selection count.
|
||||||
- MS Teams: Adaptive Card polls (Clawdbot-managed). No native poll API; `durationHours` is ignored.
|
- MS Teams: Adaptive Card polls (Clawdbot-managed). No native poll API; `durationHours` is ignored.
|
||||||
|
|
||||||
## Agent tool (Message)
|
## Agent tool (Message)
|
||||||
Use the `message` tool with `poll` action (`to`, `pollQuestion`, `pollOption`, optional `pollMulti`, `pollDurationHours`, `channel`).
|
Use the `message` tool with `poll` action (`to`, `pollQuestion`, `pollOption`, optional `pollMulti`, `pollDurationHours`, `provider`).
|
||||||
|
|
||||||
Note: Discord has no “pick exactly N” mode; `pollMulti` maps to multi-select.
|
Note: Discord has no “pick exactly N” mode; `pollMulti` maps to multi-select.
|
||||||
Teams polls are rendered as Adaptive Cards and require the gateway to stay online
|
Teams polls are rendered as Adaptive Cards and require the gateway to stay online
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Payload:
|
|||||||
"sessionKey": "hook:email:msg-123",
|
"sessionKey": "hook:email:msg-123",
|
||||||
"wakeMode": "now",
|
"wakeMode": "now",
|
||||||
"deliver": true,
|
"deliver": true,
|
||||||
"channel": "last",
|
"provider": "last",
|
||||||
"to": "+15551234567",
|
"to": "+15551234567",
|
||||||
"model": "openai/gpt-5.2-mini",
|
"model": "openai/gpt-5.2-mini",
|
||||||
"thinking": "low",
|
"thinking": "low",
|
||||||
@@ -70,9 +70,9 @@ Payload:
|
|||||||
- `name` optional (string): Human-readable name for the hook (e.g., "GitHub"), used as a prefix in session summaries.
|
- `name` optional (string): Human-readable name for the hook (e.g., "GitHub"), used as a prefix in session summaries.
|
||||||
- `sessionKey` optional (string): The key used to identify the agent's session. Defaults to a random `hook:<uuid>`. Using a consistent key allows for a multi-turn conversation within the hook context.
|
- `sessionKey` optional (string): The key used to identify the agent's session. Defaults to a random `hook:<uuid>`. Using a consistent key allows for a multi-turn conversation within the hook context.
|
||||||
- `wakeMode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check.
|
- `wakeMode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check.
|
||||||
- `deliver` optional (boolean): If `true`, the agent's response will be sent to the messaging channel. Defaults to `true`. Responses that are only heartbeat acknowledgments are automatically skipped.
|
- `deliver` optional (boolean): If `true`, the agent's response will be sent to the messaging provider. Defaults to `true`. Responses that are only heartbeat acknowledgments are automatically skipped.
|
||||||
- `channel` optional (string): The messaging channel for delivery. One of: `last`, `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `msteams`. Defaults to `last`.
|
- `provider` optional (string): The messaging service for delivery. One of: `last`, `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `msteams`. Defaults to `last`.
|
||||||
- `to` optional (string): The recipient identifier for the channel (e.g., phone number for WhatsApp/Signal, chat ID for Telegram, channel ID for Discord/Slack, conversation ID for MS Teams). Defaults to the last recipient in the main session.
|
- `to` optional (string): The recipient identifier for the provider (e.g., phone number for WhatsApp/Signal, chat ID for Telegram, channel ID for Discord/Slack, conversation ID for MS Teams). Defaults to the last recipient in the main session.
|
||||||
- `model` optional (string): Model override (e.g., `anthropic/claude-3-5-sonnet` or an alias). Must be in the allowed model list if restricted.
|
- `model` optional (string): Model override (e.g., `anthropic/claude-3-5-sonnet` or an alias). Must be in the allowed model list if restricted.
|
||||||
- `thinking` optional (string): Thinking level override (e.g., `low`, `medium`, `high`).
|
- `thinking` optional (string): Thinking level override (e.g., `low`, `medium`, `high`).
|
||||||
- `timeoutSeconds` optional (number): Maximum duration for the agent run in seconds.
|
- `timeoutSeconds` optional (number): Maximum duration for the agent run in seconds.
|
||||||
@@ -94,8 +94,8 @@ Mapping options (summary):
|
|||||||
- `hooks.transformsDir` + `transform.module` loads a JS/TS module for custom logic.
|
- `hooks.transformsDir` + `transform.module` loads a JS/TS module for custom logic.
|
||||||
- Use `match.source` to keep a generic ingest endpoint (payload-driven routing).
|
- Use `match.source` to keep a generic ingest endpoint (payload-driven routing).
|
||||||
- TS transforms require a TS loader (e.g. `bun` or `tsx`) or precompiled `.js` at runtime.
|
- TS transforms require a TS loader (e.g. `bun` or `tsx`) or precompiled `.js` at runtime.
|
||||||
- Set `deliver: true` + `channel`/`to` on mappings to route replies to a chat surface
|
- Set `deliver: true` + `provider`/`to` on mappings to route replies to a chat surface
|
||||||
(`channel` defaults to `last` and falls back to WhatsApp).
|
(`provider` defaults to `last` and falls back to WhatsApp).
|
||||||
- `clawdbot hooks gmail setup` writes `hooks.gmail` config for `clawdbot hooks gmail run`.
|
- `clawdbot hooks gmail setup` writes `hooks.gmail` config for `clawdbot hooks gmail run`.
|
||||||
See [Gmail Pub/Sub](/automation/gmail-pubsub) for the full Gmail watch flow.
|
See [Gmail Pub/Sub](/automation/gmail-pubsub) for the full Gmail watch flow.
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ status: experimental
|
|||||||
|
|
||||||
Broadcast Groups enable multiple agents to process and respond to the same message simultaneously. This allows you to create specialized agent teams that work together in a single WhatsApp group or DM — all using one phone number.
|
Broadcast Groups enable multiple agents to process and respond to the same message simultaneously. This allows you to create specialized agent teams that work together in a single WhatsApp group or DM — all using one phone number.
|
||||||
|
|
||||||
Current scope: **WhatsApp only** (web channel).
|
Current scope: **WhatsApp only** (web provider).
|
||||||
|
|
||||||
Broadcast groups are evaluated after channel allowlists and group activation rules. In WhatsApp groups, this means broadcasts happen when Clawdbot would normally reply (for example: on mention, depending on your group settings).
|
Broadcast groups are evaluated after provider allowlists and group activation rules. In WhatsApp groups, this means broadcasts happen when Clawdbot would normally reply (for example: on mention, depending on your group settings).
|
||||||
|
|
||||||
## Use Cases
|
## Use Cases
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ Agents process in order (one waits for previous to finish):
|
|||||||
4. **If not in broadcast list**:
|
4. **If not in broadcast list**:
|
||||||
- Normal routing applies (first matching binding)
|
- Normal routing applies (first matching binding)
|
||||||
|
|
||||||
Note: broadcast groups do not bypass channel allowlists or group activation rules (mentions/commands/etc). They only change *which agents run* when a message is eligible for processing.
|
Note: broadcast groups do not bypass provider allowlists or group activation rules (mentions/commands/etc). They only change *which agents run* when a message is eligible for processing.
|
||||||
|
|
||||||
### Session Isolation
|
### Session Isolation
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ Broadcast groups work alongside existing routing:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bindings": [
|
"bindings": [
|
||||||
{ "match": { "channel": "whatsapp", "peer": { "kind": "group", "id": "GROUP_A" } }, "agentId": "alfred" }
|
{ "match": { "provider": "whatsapp", "peer": { "kind": "group", "id": "GROUP_A" } }, "agentId": "alfred" }
|
||||||
],
|
],
|
||||||
"broadcast": {
|
"broadcast": {
|
||||||
"GROUP_B": ["agent1", "agent2"]
|
"GROUP_B": ["agent1", "agent2"]
|
||||||
@@ -403,5 +403,5 @@ Planned features:
|
|||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
- [Multi-Agent Configuration](/multi-agent-sandbox-tools)
|
- [Multi-Agent Configuration](/multi-agent-sandbox-tools)
|
||||||
- [Routing Configuration](/concepts/channel-routing)
|
- [Routing Configuration](/concepts/provider-routing)
|
||||||
- [Session Management](/concepts/sessions)
|
- [Session Management](/concepts/sessions)
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Messaging platforms Clawdbot can connect to"
|
|
||||||
read_when:
|
|
||||||
- You want to choose a chat channel for Clawdbot
|
|
||||||
- You need a quick overview of supported messaging platforms
|
|
||||||
---
|
|
||||||
# Chat Channels
|
|
||||||
|
|
||||||
Clawdbot can talk to you on any chat app you already use. Each channel connects via the Gateway.
|
|
||||||
Text is supported everywhere; media and reactions vary by channel.
|
|
||||||
|
|
||||||
## Supported channels
|
|
||||||
|
|
||||||
- [WhatsApp](/channels/whatsapp) — Most popular; uses Baileys and requires QR pairing.
|
|
||||||
- [Telegram](/channels/telegram) — Bot API via grammY; supports groups.
|
|
||||||
- [Discord](/channels/discord) — Discord Bot API + Gateway; supports servers, channels, and DMs.
|
|
||||||
- [Slack](/channels/slack) — Bolt SDK; workspace apps.
|
|
||||||
- [Signal](/channels/signal) — signal-cli; privacy-focused.
|
|
||||||
- [iMessage](/channels/imessage) — macOS only; native integration.
|
|
||||||
- [Microsoft Teams](/channels/msteams) — Bot Framework; enterprise support.
|
|
||||||
- [Zalo](/channels/zalo) — Zalo Bot API; Vietnam's popular messenger (plugin).
|
|
||||||
- [WebChat](/web/webchat) — Gateway WebChat UI over WebSocket.
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
- Channels can run simultaneously; configure multiple and Clawdbot will route per chat.
|
|
||||||
- Group behavior varies by channel; see [Groups](/concepts/groups).
|
|
||||||
- DM pairing and allowlists are enforced for safety; see [Security](/gateway/security).
|
|
||||||
- Telegram internals: [grammY notes](/channels/grammy).
|
|
||||||
- Troubleshooting: [Channel troubleshooting](/channels/troubleshooting).
|
|
||||||
- Model providers are documented separately; see [Model Providers](/providers/models).
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Signal support via signal-cli (JSON-RPC + SSE), setup, and number model"
|
|
||||||
read_when:
|
|
||||||
- Setting up Signal support
|
|
||||||
- Debugging Signal send/receive
|
|
||||||
---
|
|
||||||
# Signal (signal-cli)
|
|
||||||
|
|
||||||
|
|
||||||
Status: external CLI integration. Gateway talks to `signal-cli` over HTTP JSON-RPC + SSE.
|
|
||||||
|
|
||||||
## Quick setup (beginner)
|
|
||||||
1) Use a **separate Signal number** for the bot (recommended).
|
|
||||||
2) Install `signal-cli` (Java required).
|
|
||||||
3) Link the bot device and start the daemon:
|
|
||||||
- `signal-cli link -n "Clawdbot"`
|
|
||||||
4) Configure Clawdbot and start the gateway.
|
|
||||||
|
|
||||||
Minimal config:
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: {
|
|
||||||
signal: {
|
|
||||||
enabled: true,
|
|
||||||
account: "+15551234567",
|
|
||||||
cliPath: "signal-cli",
|
|
||||||
dmPolicy: "pairing",
|
|
||||||
allowFrom: ["+15557654321"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## What it is
|
|
||||||
- Signal channel via `signal-cli` (not embedded libsignal).
|
|
||||||
- Deterministic routing: replies always go back to Signal.
|
|
||||||
- DMs share the agent's main session; groups are isolated (`agent:<agentId>:signal:group:<groupId>`).
|
|
||||||
|
|
||||||
## Config writes
|
|
||||||
By default, Signal is allowed to write config updates triggered by `/config set|unset` (requires `commands.config: true`).
|
|
||||||
|
|
||||||
Disable with:
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: { signal: { configWrites: false } }
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## The number model (important)
|
|
||||||
- The gateway connects to a **Signal device** (the `signal-cli` account).
|
|
||||||
- If you run the bot on **your personal Signal account**, it will ignore your own messages (loop protection).
|
|
||||||
- For "I text the bot and it replies," use a **separate bot number**.
|
|
||||||
|
|
||||||
## Setup (fast path)
|
|
||||||
1) Install `signal-cli` (Java required).
|
|
||||||
2) Link a bot account:
|
|
||||||
- `signal-cli link -n "Clawdbot"` then scan the QR in Signal.
|
|
||||||
3) Configure Signal and start the gateway.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: {
|
|
||||||
signal: {
|
|
||||||
enabled: true,
|
|
||||||
account: "+15551234567",
|
|
||||||
cliPath: "signal-cli",
|
|
||||||
dmPolicy: "pairing",
|
|
||||||
allowFrom: ["+15557654321"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Multi-account support: use `channels.signal.accounts` with per-account config and optional `name`. See [`gateway/configuration`](/gateway/configuration#telegramaccounts--discordaccounts--slackaccounts--signalaccounts--imessageaccounts) for the shared pattern.
|
|
||||||
|
|
||||||
## Access control (DMs + groups)
|
|
||||||
DMs:
|
|
||||||
- Default: `channels.signal.dmPolicy = "pairing"`.
|
|
||||||
- Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
|
|
||||||
- Approve via:
|
|
||||||
- `clawdbot pairing list signal`
|
|
||||||
- `clawdbot pairing approve signal <CODE>`
|
|
||||||
- Pairing is the default token exchange for Signal DMs. Details: [Pairing](/start/pairing)
|
|
||||||
- UUID-only senders (from `sourceUuid`) are stored as `uuid:<id>` in `channels.signal.allowFrom`.
|
|
||||||
|
|
||||||
Groups:
|
|
||||||
- `channels.signal.groupPolicy = open | allowlist | disabled`.
|
|
||||||
- `channels.signal.groupAllowFrom` controls who can trigger in groups when `allowlist` is set.
|
|
||||||
|
|
||||||
## How it works (behavior)
|
|
||||||
- `signal-cli` runs as a daemon; the gateway reads events via SSE.
|
|
||||||
- Inbound messages are normalized into the shared channel envelope.
|
|
||||||
- Replies always route back to the same number or group.
|
|
||||||
|
|
||||||
## Media + limits
|
|
||||||
- Outbound text is chunked to `channels.signal.textChunkLimit` (default 4000).
|
|
||||||
- Attachments supported (base64 fetched from `signal-cli`).
|
|
||||||
- Default media cap: `channels.signal.mediaMaxMb` (default 8).
|
|
||||||
- Use `channels.signal.ignoreAttachments` to skip downloading media.
|
|
||||||
- Group history context uses `channels.signal.historyLimit` (or `channels.signal.accounts.*.historyLimit`), falling back to `messages.groupChat.historyLimit`. Set `0` to disable (default 50).
|
|
||||||
|
|
||||||
## Delivery targets (CLI/cron)
|
|
||||||
- DMs: `signal:+15551234567` (or plain E.164).
|
|
||||||
- Groups: `signal:group:<groupId>`.
|
|
||||||
- Usernames: `username:<name>` (if supported by your Signal account).
|
|
||||||
|
|
||||||
## Configuration reference (Signal)
|
|
||||||
Full configuration: [Configuration](/gateway/configuration)
|
|
||||||
|
|
||||||
Provider options:
|
|
||||||
- `channels.signal.enabled`: enable/disable channel startup.
|
|
||||||
- `channels.signal.account`: E.164 for the bot account.
|
|
||||||
- `channels.signal.cliPath`: path to `signal-cli`.
|
|
||||||
- `channels.signal.httpUrl`: full daemon URL (overrides host/port).
|
|
||||||
- `channels.signal.httpHost`, `channels.signal.httpPort`: daemon bind (default 127.0.0.1:8080).
|
|
||||||
- `channels.signal.autoStart`: auto-spawn daemon (default true if `httpUrl` unset).
|
|
||||||
- `channels.signal.receiveMode`: `on-start | manual`.
|
|
||||||
- `channels.signal.ignoreAttachments`: skip attachment downloads.
|
|
||||||
- `channels.signal.ignoreStories`: ignore stories from the daemon.
|
|
||||||
- `channels.signal.sendReadReceipts`: forward read receipts.
|
|
||||||
- `channels.signal.dmPolicy`: `pairing | allowlist | open | disabled` (default: pairing).
|
|
||||||
- `channels.signal.allowFrom`: DM allowlist (E.164 or `uuid:<id>`). `open` requires `"*"`.
|
|
||||||
- `channels.signal.groupPolicy`: `open | allowlist | disabled` (default: allowlist).
|
|
||||||
- `channels.signal.groupAllowFrom`: group sender allowlist.
|
|
||||||
- `channels.signal.historyLimit`: max group messages to include as context (0 disables).
|
|
||||||
- `channels.signal.dmHistoryLimit`: DM history limit in user turns. Per-user overrides: `channels.signal.dms["<phone_or_uuid>"].historyLimit`.
|
|
||||||
- `channels.signal.textChunkLimit`: outbound chunk size (chars).
|
|
||||||
- `channels.signal.mediaMaxMb`: inbound/outbound media cap (MB).
|
|
||||||
|
|
||||||
Related global options:
|
|
||||||
- `agents.list[].groupChat.mentionPatterns` (Signal does not support native mentions).
|
|
||||||
- `messages.groupChat.mentionPatterns` (global fallback).
|
|
||||||
- `messages.responsePrefix`.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Channel-specific troubleshooting shortcuts (Discord/Telegram/WhatsApp)"
|
|
||||||
read_when:
|
|
||||||
- A channel connects but messages don’t flow
|
|
||||||
- Investigating channel misconfiguration (intents, permissions, privacy mode)
|
|
||||||
---
|
|
||||||
# Channel troubleshooting
|
|
||||||
|
|
||||||
Start with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
clawdbot doctor
|
|
||||||
clawdbot channels status --probe
|
|
||||||
```
|
|
||||||
|
|
||||||
`channels status --probe` prints warnings when it can detect common channel misconfigurations, and includes small live checks (credentials, some permissions/membership).
|
|
||||||
|
|
||||||
## Channels
|
|
||||||
- Discord: [/channels/discord#troubleshooting](/channels/discord#troubleshooting)
|
|
||||||
- Telegram: [/channels/telegram#troubleshooting](/channels/telegram#troubleshooting)
|
|
||||||
- WhatsApp: [/channels/whatsapp#troubleshooting-quick](/channels/whatsapp#troubleshooting-quick)
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Zalo bot support status, capabilities, and configuration"
|
|
||||||
read_when:
|
|
||||||
- Working on Zalo features or webhooks
|
|
||||||
---
|
|
||||||
# Zalo (Bot API)
|
|
||||||
|
|
||||||
Status: experimental. Direct messages only; groups coming soon per Zalo docs.
|
|
||||||
|
|
||||||
## Quick setup (beginner)
|
|
||||||
1) Install the Zalo plugin:
|
|
||||||
- From a source checkout: `clawdbot plugins install ./extensions/zalo`
|
|
||||||
- From npm (if published): `clawdbot plugins install @clawdbot/zalo`
|
|
||||||
- Or pick **Zalo** in onboarding and confirm the install prompt
|
|
||||||
2) Set the token:
|
|
||||||
- Env: `ZALO_BOT_TOKEN=...`
|
|
||||||
- Or config: `channels.zalo.botToken: "..."`.
|
|
||||||
3) Restart the gateway (or finish onboarding).
|
|
||||||
4) DM access is pairing by default; approve the pairing code on first contact.
|
|
||||||
|
|
||||||
Minimal config:
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: {
|
|
||||||
zalo: {
|
|
||||||
enabled: true,
|
|
||||||
botToken: "12345689:abc-xyz",
|
|
||||||
dmPolicy: "pairing"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## What it is
|
|
||||||
- A Zalo Bot API channel owned by the Gateway.
|
|
||||||
- Deterministic routing: replies go back to Zalo; the model never chooses channels.
|
|
||||||
- DMs share the agent's main session.
|
|
||||||
- Groups are not yet supported (Zalo docs state "coming soon").
|
|
||||||
|
|
||||||
## Setup (fast path)
|
|
||||||
|
|
||||||
### 1) Create a bot token (Zalo Bot Platform)
|
|
||||||
1) Go to **https://bot.zaloplatforms.com** and sign in.
|
|
||||||
2) Create a new bot and configure its settings.
|
|
||||||
3) Copy the bot token (format: `12345689:abc-xyz`).
|
|
||||||
|
|
||||||
### 2) Configure the token (env or config)
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: {
|
|
||||||
zalo: {
|
|
||||||
enabled: true,
|
|
||||||
botToken: "12345689:abc-xyz",
|
|
||||||
dmPolicy: "pairing"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Env option: `ZALO_BOT_TOKEN=...` (works for the default account only).
|
|
||||||
|
|
||||||
Multi-account support: use `channels.zalo.accounts` with per-account tokens and optional `name`.
|
|
||||||
|
|
||||||
3) Restart the gateway. Zalo starts when a token is resolved (env or config).
|
|
||||||
4) DM access defaults to pairing. Approve the code when the bot is first contacted.
|
|
||||||
|
|
||||||
## How it works (behavior)
|
|
||||||
- Inbound messages are normalized into the shared channel envelope with media placeholders.
|
|
||||||
- Replies always route back to the same Zalo chat.
|
|
||||||
- Long-polling by default; webhook mode available with `channels.zalo.webhookUrl`.
|
|
||||||
|
|
||||||
## Limits
|
|
||||||
- Outbound text is chunked to 2000 characters (Zalo API limit).
|
|
||||||
- Media downloads/uploads are capped by `channels.zalo.mediaMaxMb` (default 5).
|
|
||||||
- Streaming is blocked by default due to the 2000 char limit making streaming less useful.
|
|
||||||
|
|
||||||
## Access control (DMs)
|
|
||||||
|
|
||||||
### DM access
|
|
||||||
- Default: `channels.zalo.dmPolicy = "pairing"`. Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
|
|
||||||
- Approve via:
|
|
||||||
- `clawdbot pairing list zalo`
|
|
||||||
- `clawdbot pairing approve zalo <CODE>`
|
|
||||||
- Pairing is the default token exchange. Details: [Pairing](/start/pairing)
|
|
||||||
- `channels.zalo.allowFrom` accepts numeric user IDs.
|
|
||||||
|
|
||||||
## Long-polling vs webhook
|
|
||||||
- Default: long-polling (no public URL required).
|
|
||||||
- Webhook mode: set `channels.zalo.webhookUrl` and `channels.zalo.webhookSecret`.
|
|
||||||
- The webhook secret must be 8-256 characters.
|
|
||||||
- Webhook URL must use HTTPS.
|
|
||||||
- Zalo sends events with `X-Bot-Api-Secret-Token` header for verification.
|
|
||||||
- Gateway HTTP handles webhook requests at `channels.zalo.webhookPath` (defaults to the webhook URL path).
|
|
||||||
|
|
||||||
**Note:** getUpdates (polling) and webhook are mutually exclusive per Zalo API docs.
|
|
||||||
|
|
||||||
## Supported message types
|
|
||||||
- **Text messages**: Full support with 2000 character chunking.
|
|
||||||
- **Image messages**: Download and process inbound images; send images via `sendPhoto`.
|
|
||||||
- **Stickers**: Logged but not fully processed (no agent response).
|
|
||||||
- **Unsupported types**: Logged (e.g., messages from protected users).
|
|
||||||
|
|
||||||
## Capabilities
|
|
||||||
| Feature | Status |
|
|
||||||
|---------|--------|
|
|
||||||
| Direct messages | ✅ Supported |
|
|
||||||
| Groups | ❌ Coming soon (per Zalo docs) |
|
|
||||||
| Media (images) | ✅ Supported |
|
|
||||||
| Reactions | ❌ Not supported |
|
|
||||||
| Threads | ❌ Not supported |
|
|
||||||
| Polls | ❌ Not supported |
|
|
||||||
| Native commands | ❌ Not supported |
|
|
||||||
| Streaming | ⚠️ Blocked (2000 char limit) |
|
|
||||||
|
|
||||||
## Delivery targets (CLI/cron)
|
|
||||||
- Use a chat id as the target.
|
|
||||||
- Example: `clawdbot message send --channel zalo --to 123456789 --message "hi"`.
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
**Bot doesn't respond:**
|
|
||||||
- Check that the token is valid: `clawdbot channels status --probe`
|
|
||||||
- Verify the sender is approved (pairing or allowFrom)
|
|
||||||
- Check gateway logs: `clawdbot logs --follow`
|
|
||||||
|
|
||||||
**Webhook not receiving events:**
|
|
||||||
- Ensure webhook URL uses HTTPS
|
|
||||||
- Verify secret token is 8-256 characters
|
|
||||||
- Confirm the gateway HTTP endpoint is reachable on the configured path
|
|
||||||
- Check that getUpdates polling is not running (they're mutually exclusive)
|
|
||||||
|
|
||||||
## Configuration reference (Zalo)
|
|
||||||
Full configuration: [Configuration](/gateway/configuration)
|
|
||||||
|
|
||||||
Provider options:
|
|
||||||
- `channels.zalo.enabled`: enable/disable channel startup.
|
|
||||||
- `channels.zalo.botToken`: bot token from Zalo Bot Platform.
|
|
||||||
- `channels.zalo.tokenFile`: read token from file path.
|
|
||||||
- `channels.zalo.dmPolicy`: `pairing | allowlist | open | disabled` (default: pairing).
|
|
||||||
- `channels.zalo.allowFrom`: DM allowlist (user IDs). `open` requires `"*"`.
|
|
||||||
- `channels.zalo.mediaMaxMb`: inbound/outbound media cap (MB, default 5).
|
|
||||||
- `channels.zalo.webhookUrl`: enable webhook mode (HTTPS required).
|
|
||||||
- `channels.zalo.webhookSecret`: webhook secret (8-256 chars).
|
|
||||||
- `channels.zalo.webhookPath`: webhook path on the gateway HTTP server.
|
|
||||||
- `channels.zalo.proxy`: proxy URL for API requests.
|
|
||||||
|
|
||||||
Multi-account options:
|
|
||||||
- `channels.zalo.accounts.<id>.botToken`: per-account token.
|
|
||||||
- `channels.zalo.accounts.<id>.tokenFile`: per-account token file.
|
|
||||||
- `channels.zalo.accounts.<id>.name`: display name.
|
|
||||||
- `channels.zalo.accounts.<id>.enabled`: enable/disable account.
|
|
||||||
- `channels.zalo.accounts.<id>.dmPolicy`: per-account DM policy.
|
|
||||||
- `channels.zalo.accounts.<id>.allowFrom`: per-account allowlist.
|
|
||||||
- `channels.zalo.accounts.<id>.webhookUrl`: per-account webhook URL.
|
|
||||||
- `channels.zalo.accounts.<id>.webhookSecret`: per-account webhook secret.
|
|
||||||
- `channels.zalo.accounts.<id>.webhookPath`: per-account webhook path.
|
|
||||||
- `channels.zalo.accounts.<id>.proxy`: per-account proxy URL.
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ read_when:
|
|||||||
|
|
||||||
# Gateway CLI
|
# Gateway CLI
|
||||||
|
|
||||||
The Gateway is Clawdbot’s WebSocket server (channels, nodes, sessions, hooks).
|
The Gateway is Clawdbot’s WebSocket server (providers, nodes, sessions, hooks).
|
||||||
|
|
||||||
Subcommands in this page live under `clawdbot gateway …`.
|
Subcommands in this page live under `clawdbot gateway …`.
|
||||||
|
|
||||||
|
|||||||
+41
-53
@@ -29,7 +29,7 @@ This page describes the current CLI behavior. If commands change, update this do
|
|||||||
|
|
||||||
Clawdbot uses a lobster palette for CLI output.
|
Clawdbot uses a lobster palette for CLI output.
|
||||||
|
|
||||||
- `accent` (#FF5A2D): headings, labels, primary highlights.
|
- `accent` (#FF5A2D): headings, provider labels, primary highlights.
|
||||||
- `accentBright` (#FF7A3D): command names, emphasis.
|
- `accentBright` (#FF7A3D): command names, emphasis.
|
||||||
- `accentDim` (#D14A22): secondary highlight text.
|
- `accentDim` (#D14A22): secondary highlight text.
|
||||||
- `info` (#FF8A5B): informational values.
|
- `info` (#FF8A5B): informational values.
|
||||||
@@ -48,12 +48,10 @@ clawdbot [--dev] [--profile <name>] <command>
|
|||||||
onboard
|
onboard
|
||||||
configure (alias: config)
|
configure (alias: config)
|
||||||
doctor
|
doctor
|
||||||
security
|
|
||||||
audit
|
|
||||||
reset
|
reset
|
||||||
uninstall
|
uninstall
|
||||||
update
|
update
|
||||||
channels
|
providers
|
||||||
list
|
list
|
||||||
status
|
status
|
||||||
logs
|
logs
|
||||||
@@ -182,12 +180,6 @@ clawdbot [--dev] [--profile <name>] <command>
|
|||||||
|
|
||||||
Note: plugins can add additional top-level commands (for example `clawdbot voicecall`).
|
Note: plugins can add additional top-level commands (for example `clawdbot voicecall`).
|
||||||
|
|
||||||
## Security
|
|
||||||
|
|
||||||
- `clawdbot security audit` — audit config + local state for common security foot-guns.
|
|
||||||
- `clawdbot security audit --deep` — best-effort live Gateway probe.
|
|
||||||
- `clawdbot security audit --fix` — tighten safe defaults and chmod state/config.
|
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
Manage extensions and their config:
|
Manage extensions and their config:
|
||||||
@@ -266,15 +258,15 @@ Options:
|
|||||||
- `--install-daemon`
|
- `--install-daemon`
|
||||||
- `--no-install-daemon` (alias: `--skip-daemon`)
|
- `--no-install-daemon` (alias: `--skip-daemon`)
|
||||||
- `--daemon-runtime <node|bun>`
|
- `--daemon-runtime <node|bun>`
|
||||||
- `--skip-channels`
|
- `--skip-providers`
|
||||||
- `--skip-skills`
|
- `--skip-skills`
|
||||||
- `--skip-health`
|
- `--skip-health`
|
||||||
- `--skip-ui`
|
- `--skip-ui`
|
||||||
- `--node-manager <npm|pnpm|bun>` (pnpm recommended; bun not recommended for Gateway runtime)
|
- `--node-manager <npm|pnpm|bun>`
|
||||||
- `--json`
|
- `--json`
|
||||||
|
|
||||||
### `configure` / `config`
|
### `configure` / `config`
|
||||||
Interactive configuration wizard (models, channels, skills, gateway).
|
Interactive configuration wizard (models, providers, skills, gateway).
|
||||||
|
|
||||||
### `doctor`
|
### `doctor`
|
||||||
Health checks + quick fixes (config + gateway + legacy services).
|
Health checks + quick fixes (config + gateway + legacy services).
|
||||||
@@ -285,41 +277,41 @@ Options:
|
|||||||
- `--non-interactive`: skip prompts; apply safe migrations only.
|
- `--non-interactive`: skip prompts; apply safe migrations only.
|
||||||
- `--deep`: scan system services for extra gateway installs.
|
- `--deep`: scan system services for extra gateway installs.
|
||||||
|
|
||||||
## Channel helpers
|
## Provider helpers
|
||||||
|
|
||||||
### `channels`
|
### `providers`
|
||||||
Manage chat channel accounts (WhatsApp/Telegram/Discord/Slack/Signal/iMessage/MS Teams).
|
Manage chat provider accounts (WhatsApp/Telegram/Discord/Slack/Signal/iMessage/MS Teams).
|
||||||
|
|
||||||
Subcommands:
|
Subcommands:
|
||||||
- `channels list`: show configured channels and auth profiles (Claude Code + Codex CLI OAuth sync included).
|
- `providers list`: show configured chat providers and auth profiles (Claude Code + Codex CLI OAuth sync included).
|
||||||
- `channels status`: check gateway reachability and channel health (`--probe` runs extra checks; use `clawdbot health` or `clawdbot status --deep` for gateway health probes).
|
- `providers status`: check gateway reachability and provider health (`--probe` runs extra checks; use `clawdbot health` or `clawdbot status --deep` for gateway health probes).
|
||||||
- Tip: `channels status` prints warnings with suggested fixes when it can detect common misconfigurations (then points you to `clawdbot doctor`).
|
- Tip: `providers status` prints warnings with suggested fixes when it can detect common misconfigurations (then points you to `clawdbot doctor`).
|
||||||
- `channels logs`: show recent channel logs from the gateway log file.
|
- `providers logs`: show recent provider logs from the gateway log file.
|
||||||
- `channels add`: wizard-style setup when no flags are passed; flags switch to non-interactive mode.
|
- `providers add`: wizard-style setup when no flags are passed; flags switch to non-interactive mode.
|
||||||
- `channels remove`: disable by default; pass `--delete` to remove config entries without prompts.
|
- `providers remove`: disable by default; pass `--delete` to remove config entries without prompts.
|
||||||
- `channels login`: interactive channel login (WhatsApp Web only).
|
- `providers login`: interactive provider login (WhatsApp Web only).
|
||||||
- `channels logout`: log out of a channel session (if supported).
|
- `providers logout`: log out of a provider session (if supported).
|
||||||
|
|
||||||
Common options:
|
Common options:
|
||||||
- `--channel <name>`: `whatsapp|telegram|discord|slack|signal|imessage|msteams`
|
- `--provider <name>`: `whatsapp|telegram|discord|slack|signal|imessage|msteams`
|
||||||
- `--account <id>`: channel account id (default `default`)
|
- `--account <id>`: provider account id (default `default`)
|
||||||
- `--name <label>`: display name for the account
|
- `--name <label>`: display name for the account
|
||||||
|
|
||||||
`channels login` options:
|
`providers login` options:
|
||||||
- `--channel <channel>` (default `whatsapp`; supports `whatsapp`/`web`)
|
- `--provider <provider>` (default `whatsapp`; supports `whatsapp`/`web`)
|
||||||
- `--account <id>`
|
- `--account <id>`
|
||||||
- `--verbose`
|
- `--verbose`
|
||||||
|
|
||||||
`channels logout` options:
|
`providers logout` options:
|
||||||
- `--channel <channel>` (default `whatsapp`)
|
- `--provider <provider>` (default `whatsapp`)
|
||||||
- `--account <id>`
|
- `--account <id>`
|
||||||
|
|
||||||
`channels list` options:
|
`providers list` options:
|
||||||
- `--no-usage`: skip model provider usage/quota snapshots (OAuth/API-backed only).
|
- `--no-usage`: skip provider usage/quota snapshots (OAuth/API-backed only).
|
||||||
- `--json`: output JSON (includes usage unless `--no-usage` is set).
|
- `--json`: output JSON (includes usage unless `--no-usage` is set).
|
||||||
|
|
||||||
`channels logs` options:
|
`providers logs` options:
|
||||||
- `--channel <name|all>` (default `all`)
|
- `--provider <name|all>` (default `all`)
|
||||||
- `--lines <n>` (default `200`)
|
- `--lines <n>` (default `200`)
|
||||||
- `--json`
|
- `--json`
|
||||||
|
|
||||||
@@ -333,10 +325,10 @@ More detail: [/concepts/oauth](/concepts/oauth)
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```bash
|
```bash
|
||||||
clawdbot channels add --channel telegram --account alerts --name "Alerts Bot" --token $TELEGRAM_BOT_TOKEN
|
clawdbot providers add --provider telegram --account alerts --name "Alerts Bot" --token $TELEGRAM_BOT_TOKEN
|
||||||
clawdbot channels add --channel discord --account work --name "Work Bot" --token $DISCORD_BOT_TOKEN
|
clawdbot providers add --provider discord --account work --name "Work Bot" --token $DISCORD_BOT_TOKEN
|
||||||
clawdbot channels remove --channel discord --account work --delete
|
clawdbot providers remove --provider discord --account work --delete
|
||||||
clawdbot channels status --probe
|
clawdbot providers status --probe
|
||||||
clawdbot status --deep
|
clawdbot status --deep
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -356,11 +348,11 @@ Options:
|
|||||||
Tip: use `npx clawdhub` to search, install, and sync skills.
|
Tip: use `npx clawdhub` to search, install, and sync skills.
|
||||||
|
|
||||||
### `pairing`
|
### `pairing`
|
||||||
Approve DM pairing requests across channels.
|
Approve DM pairing requests across providers.
|
||||||
|
|
||||||
Subcommands:
|
Subcommands:
|
||||||
- `pairing list <channel> [--json]`
|
- `pairing list <provider> [--json]`
|
||||||
- `pairing approve <channel> <code> [--notify]`
|
- `pairing approve <provider> <code> [--notify]`
|
||||||
|
|
||||||
### `hooks gmail`
|
### `hooks gmail`
|
||||||
Gmail Pub/Sub hook setup + runner. See [/automation/gmail-pubsub](/automation/gmail-pubsub).
|
Gmail Pub/Sub hook setup + runner. See [/automation/gmail-pubsub](/automation/gmail-pubsub).
|
||||||
@@ -378,7 +370,7 @@ Options:
|
|||||||
## Messaging + agent
|
## Messaging + agent
|
||||||
|
|
||||||
### `message`
|
### `message`
|
||||||
Unified outbound messaging + channel actions.
|
Unified outbound messaging + provider actions.
|
||||||
|
|
||||||
See: [/cli/message](/cli/message)
|
See: [/cli/message](/cli/message)
|
||||||
|
|
||||||
@@ -395,7 +387,7 @@ Subcommands:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
- `clawdbot message send --to +15555550123 --message "Hi"`
|
- `clawdbot message send --to +15555550123 --message "Hi"`
|
||||||
- `clawdbot message poll --channel discord --to channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi`
|
- `clawdbot message poll --provider discord --to channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi`
|
||||||
|
|
||||||
### `agent`
|
### `agent`
|
||||||
Run one agent turn via the Gateway (or `--local` embedded).
|
Run one agent turn via the Gateway (or `--local` embedded).
|
||||||
@@ -408,7 +400,7 @@ Options:
|
|||||||
- `--session-id <id>`
|
- `--session-id <id>`
|
||||||
- `--thinking <off|minimal|low|medium|high|xhigh>` (GPT-5.2 + Codex models only)
|
- `--thinking <off|minimal|low|medium|high|xhigh>` (GPT-5.2 + Codex models only)
|
||||||
- `--verbose <on|off>`
|
- `--verbose <on|off>`
|
||||||
- `--channel <whatsapp|telegram|discord|slack|signal|imessage>`
|
- `--provider <whatsapp|telegram|discord|slack|signal|imessage>`
|
||||||
- `--local`
|
- `--local`
|
||||||
- `--deliver`
|
- `--deliver`
|
||||||
- `--json`
|
- `--json`
|
||||||
@@ -431,11 +423,11 @@ Options:
|
|||||||
- `--workspace <dir>`
|
- `--workspace <dir>`
|
||||||
- `--model <id>`
|
- `--model <id>`
|
||||||
- `--agent-dir <dir>`
|
- `--agent-dir <dir>`
|
||||||
- `--bind <channel[:accountId]>` (repeatable)
|
- `--bind <provider[:accountId]>` (repeatable)
|
||||||
- `--non-interactive`
|
- `--non-interactive`
|
||||||
- `--json`
|
- `--json`
|
||||||
|
|
||||||
Binding specs use `channel[:accountId]`. When `accountId` is omitted for WhatsApp, the default account id is used.
|
Binding specs use `provider[:accountId]`. When `accountId` is omitted for WhatsApp, the default account id is used.
|
||||||
|
|
||||||
#### `agents delete <id>`
|
#### `agents delete <id>`
|
||||||
Delete an agent and prune its workspace + state.
|
Delete an agent and prune its workspace + state.
|
||||||
@@ -450,8 +442,8 @@ Show linked session health and recent recipients.
|
|||||||
Options:
|
Options:
|
||||||
- `--json`
|
- `--json`
|
||||||
- `--all` (full diagnosis; read-only, pasteable)
|
- `--all` (full diagnosis; read-only, pasteable)
|
||||||
- `--deep` (probe channels)
|
- `--deep` (probe providers)
|
||||||
- `--usage` (show model provider usage/quota)
|
- `--usage` (show provider usage/quota)
|
||||||
- `--timeout <ms>`
|
- `--timeout <ms>`
|
||||||
- `--verbose`
|
- `--verbose`
|
||||||
- `--debug` (alias for `--verbose`)
|
- `--debug` (alias for `--verbose`)
|
||||||
@@ -557,7 +549,7 @@ Notes:
|
|||||||
- `daemon status` supports `--no-probe`, `--deep`, and `--json` for scripting.
|
- `daemon status` supports `--no-probe`, `--deep`, and `--json` for scripting.
|
||||||
- `daemon status` also surfaces legacy or extra gateway services when it can detect them (`--deep` adds system-level scans). Profile-named Clawdbot services are treated as first-class and aren't flagged as "extra".
|
- `daemon status` also surfaces legacy or extra gateway services when it can detect them (`--deep` adds system-level scans). Profile-named Clawdbot services are treated as first-class and aren't flagged as "extra".
|
||||||
- `daemon status` prints which config path the CLI uses vs which config the daemon likely uses (service env), plus the resolved probe target URL.
|
- `daemon status` prints which config path the CLI uses vs which config the daemon likely uses (service env), plus the resolved probe target URL.
|
||||||
- `daemon install` defaults to Node runtime; bun is **not recommended** (WhatsApp/Telegram bugs).
|
- `daemon install` defaults to Node runtime; use `--runtime bun` only when WhatsApp is disabled.
|
||||||
- `daemon install` options: `--port`, `--runtime`, `--token`, `--force`.
|
- `daemon install` options: `--port`, `--runtime`, `--token`, `--force`.
|
||||||
|
|
||||||
### `logs`
|
### `logs`
|
||||||
@@ -587,12 +579,8 @@ Subcommands:
|
|||||||
|
|
||||||
Common RPCs:
|
Common RPCs:
|
||||||
- `config.apply` (validate + write config + restart + wake)
|
- `config.apply` (validate + write config + restart + wake)
|
||||||
- `config.patch` (merge a partial update without clobbering unrelated keys)
|
|
||||||
- `update.run` (run update + restart + wake)
|
- `update.run` (run update + restart + wake)
|
||||||
|
|
||||||
Tip: when calling `config.set`/`config.apply`/`config.patch` directly, pass `baseHash` from
|
|
||||||
`config.get` if a config already exists.
|
|
||||||
|
|
||||||
## Models
|
## Models
|
||||||
|
|
||||||
See [/concepts/models](/concepts/models) for fallback behavior and scanning strategy.
|
See [/concepts/models](/concepts/models) for fallback behavior and scanning strategy.
|
||||||
|
|||||||
+31
-31
@@ -1,13 +1,13 @@
|
|||||||
---
|
---
|
||||||
summary: "CLI reference for `clawdbot message` (send + channel actions)"
|
summary: "CLI reference for `clawdbot message` (send + provider actions)"
|
||||||
read_when:
|
read_when:
|
||||||
- Adding or modifying message CLI actions
|
- Adding or modifying message CLI actions
|
||||||
- Changing outbound channel behavior
|
- Changing outbound provider behavior
|
||||||
---
|
---
|
||||||
|
|
||||||
# `clawdbot message`
|
# `clawdbot message`
|
||||||
|
|
||||||
Single outbound command for sending messages and channel actions
|
Single outbound command for sending messages and provider actions
|
||||||
(Discord/Slack/Telegram/WhatsApp/Signal/iMessage/MS Teams).
|
(Discord/Slack/Telegram/WhatsApp/Signal/iMessage/MS Teams).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -16,9 +16,9 @@ Single outbound command for sending messages and channel actions
|
|||||||
clawdbot message <subcommand> [flags]
|
clawdbot message <subcommand> [flags]
|
||||||
```
|
```
|
||||||
|
|
||||||
Channel selection:
|
Provider selection:
|
||||||
- `--channel` required if more than one channel is configured.
|
- `--provider` required if more than one provider is configured.
|
||||||
- If exactly one channel is configured, it becomes the default.
|
- If exactly one provider is configured, it becomes the default.
|
||||||
- Values: `whatsapp|telegram|discord|slack|signal|imessage|msteams`
|
- Values: `whatsapp|telegram|discord|slack|signal|imessage|msteams`
|
||||||
|
|
||||||
Target formats (`--to`):
|
Target formats (`--to`):
|
||||||
@@ -32,7 +32,7 @@ Target formats (`--to`):
|
|||||||
|
|
||||||
## Common flags
|
## Common flags
|
||||||
|
|
||||||
- `--channel <name>`
|
- `--provider <name>`
|
||||||
- `--account <id>`
|
- `--account <id>`
|
||||||
- `--json`
|
- `--json`
|
||||||
- `--dry-run`
|
- `--dry-run`
|
||||||
@@ -43,82 +43,82 @@ Target formats (`--to`):
|
|||||||
### Core
|
### Core
|
||||||
|
|
||||||
- `send`
|
- `send`
|
||||||
- Channels: WhatsApp/Telegram/Discord/Slack/Signal/iMessage/MS Teams
|
- Providers: WhatsApp/Telegram/Discord/Slack/Signal/iMessage/MS Teams
|
||||||
- Required: `--to`, `--message`
|
- Required: `--to`, `--message`
|
||||||
- Optional: `--media`, `--reply-to`, `--thread-id`, `--gif-playback`
|
- Optional: `--media`, `--reply-to`, `--thread-id`, `--gif-playback`
|
||||||
- Telegram only: `--buttons` (requires `"inlineButtons"` in `channels.telegram.capabilities` or `channels.telegram.accounts.<id>.capabilities`)
|
- Telegram only: `--buttons` (requires `"inlineButtons"` in `telegram.capabilities` or `telegram.accounts.<id>.capabilities`)
|
||||||
- Telegram only: `--thread-id` (forum topic id)
|
- Telegram only: `--thread-id` (forum topic id)
|
||||||
- Slack only: `--thread-id` (thread timestamp; `--reply-to` uses the same field)
|
- Slack only: `--thread-id` (thread timestamp; `--reply-to` uses the same field)
|
||||||
- WhatsApp only: `--gif-playback`
|
- WhatsApp only: `--gif-playback`
|
||||||
|
|
||||||
- `poll`
|
- `poll`
|
||||||
- Channels: WhatsApp/Discord/MS Teams
|
- Providers: WhatsApp/Discord/MS Teams
|
||||||
- Required: `--to`, `--poll-question`, `--poll-option` (repeat)
|
- Required: `--to`, `--poll-question`, `--poll-option` (repeat)
|
||||||
- Optional: `--poll-multi`
|
- Optional: `--poll-multi`
|
||||||
- Discord only: `--poll-duration-hours`, `--message`
|
- Discord only: `--poll-duration-hours`, `--message`
|
||||||
|
|
||||||
- `react`
|
- `react`
|
||||||
- Channels: Discord/Slack/Telegram/WhatsApp
|
- Providers: Discord/Slack/Telegram/WhatsApp
|
||||||
- Required: `--message-id`, `--to` or `--channel-id`
|
- Required: `--message-id`, `--to` or `--channel-id`
|
||||||
- Optional: `--emoji`, `--remove`, `--participant`, `--from-me`, `--channel-id`
|
- Optional: `--emoji`, `--remove`, `--participant`, `--from-me`, `--channel-id`
|
||||||
- Note: `--remove` requires `--emoji` (omit `--emoji` to clear own reactions where supported; see /tools/reactions)
|
- Note: `--remove` requires `--emoji` (omit `--emoji` to clear own reactions where supported; see /tools/reactions)
|
||||||
- WhatsApp only: `--participant`, `--from-me`
|
- WhatsApp only: `--participant`, `--from-me`
|
||||||
|
|
||||||
- `reactions`
|
- `reactions`
|
||||||
- Channels: Discord/Slack
|
- Providers: Discord/Slack
|
||||||
- Required: `--message-id`, `--to` or `--channel-id`
|
- Required: `--message-id`, `--to` or `--channel-id`
|
||||||
- Optional: `--limit`, `--channel-id`
|
- Optional: `--limit`, `--channel-id`
|
||||||
|
|
||||||
- `read`
|
- `read`
|
||||||
- Channels: Discord/Slack
|
- Providers: Discord/Slack
|
||||||
- Required: `--to` or `--channel-id`
|
- Required: `--to` or `--channel-id`
|
||||||
- Optional: `--limit`, `--before`, `--after`, `--channel-id`
|
- Optional: `--limit`, `--before`, `--after`, `--channel-id`
|
||||||
- Discord only: `--around`
|
- Discord only: `--around`
|
||||||
|
|
||||||
- `edit`
|
- `edit`
|
||||||
- Channels: Discord/Slack
|
- Providers: Discord/Slack
|
||||||
- Required: `--message-id`, `--message`, `--to` or `--channel-id`
|
- Required: `--message-id`, `--message`, `--to` or `--channel-id`
|
||||||
- Optional: `--channel-id`
|
- Optional: `--channel-id`
|
||||||
|
|
||||||
- `delete`
|
- `delete`
|
||||||
- Channels: Discord/Slack/Telegram
|
- Providers: Discord/Slack
|
||||||
- Required: `--message-id`, `--to` or `--channel-id`
|
- Required: `--message-id`, `--to` or `--channel-id`
|
||||||
- Optional: `--channel-id`
|
- Optional: `--channel-id`
|
||||||
|
|
||||||
- `pin` / `unpin`
|
- `pin` / `unpin`
|
||||||
- Channels: Discord/Slack
|
- Providers: Discord/Slack
|
||||||
- Required: `--message-id`, `--to` or `--channel-id`
|
- Required: `--message-id`, `--to` or `--channel-id`
|
||||||
- Optional: `--channel-id`
|
- Optional: `--channel-id`
|
||||||
|
|
||||||
- `pins` (list)
|
- `pins` (list)
|
||||||
- Channels: Discord/Slack
|
- Providers: Discord/Slack
|
||||||
- Required: `--to` or `--channel-id`
|
- Required: `--to` or `--channel-id`
|
||||||
- Optional: `--channel-id`
|
- Optional: `--channel-id`
|
||||||
|
|
||||||
- `permissions`
|
- `permissions`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--to` or `--channel-id`
|
- Required: `--to` or `--channel-id`
|
||||||
- Optional: `--channel-id`
|
- Optional: `--channel-id`
|
||||||
|
|
||||||
- `search`
|
- `search`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--guild-id`, `--query`
|
- Required: `--guild-id`, `--query`
|
||||||
- Optional: `--channel-id`, `--channel-ids` (repeat), `--author-id`, `--author-ids` (repeat), `--limit`
|
- Optional: `--channel-id`, `--channel-ids` (repeat), `--author-id`, `--author-ids` (repeat), `--limit`
|
||||||
|
|
||||||
### Threads
|
### Threads
|
||||||
|
|
||||||
- `thread create`
|
- `thread create`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--thread-name`, `--to` (channel id) or `--channel-id`
|
- Required: `--thread-name`, `--to` (channel id) or `--channel-id`
|
||||||
- Optional: `--message-id`, `--auto-archive-min`
|
- Optional: `--message-id`, `--auto-archive-min`
|
||||||
|
|
||||||
- `thread list`
|
- `thread list`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--guild-id`
|
- Required: `--guild-id`
|
||||||
- Optional: `--channel-id`, `--include-archived`, `--before`, `--limit`
|
- Optional: `--channel-id`, `--include-archived`, `--before`, `--limit`
|
||||||
|
|
||||||
- `thread reply`
|
- `thread reply`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--to` (thread id), `--message`
|
- Required: `--to` (thread id), `--message`
|
||||||
- Optional: `--media`, `--reply-to`
|
- Optional: `--media`, `--reply-to`
|
||||||
|
|
||||||
@@ -129,19 +129,19 @@ Target formats (`--to`):
|
|||||||
- Slack: no extra flags
|
- Slack: no extra flags
|
||||||
|
|
||||||
- `emoji upload`
|
- `emoji upload`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--guild-id`, `--emoji-name`, `--media`
|
- Required: `--guild-id`, `--emoji-name`, `--media`
|
||||||
- Optional: `--role-ids` (repeat)
|
- Optional: `--role-ids` (repeat)
|
||||||
|
|
||||||
### Stickers
|
### Stickers
|
||||||
|
|
||||||
- `sticker send`
|
- `sticker send`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--to`, `--sticker-id` (repeat)
|
- Required: `--to`, `--sticker-id` (repeat)
|
||||||
- Optional: `--message`
|
- Optional: `--message`
|
||||||
|
|
||||||
- `sticker upload`
|
- `sticker upload`
|
||||||
- Channels: Discord
|
- Providers: Discord
|
||||||
- Required: `--guild-id`, `--sticker-name`, `--sticker-desc`, `--sticker-tags`, `--media`
|
- Required: `--guild-id`, `--sticker-name`, `--sticker-desc`, `--sticker-tags`, `--media`
|
||||||
|
|
||||||
### Roles / Channels / Members / Voice
|
### Roles / Channels / Members / Voice
|
||||||
@@ -170,13 +170,13 @@ Target formats (`--to`):
|
|||||||
|
|
||||||
Send a Discord reply:
|
Send a Discord reply:
|
||||||
```
|
```
|
||||||
clawdbot message send --channel discord \
|
clawdbot message send --provider discord \
|
||||||
--to channel:123 --message "hi" --reply-to 456
|
--to channel:123 --message "hi" --reply-to 456
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a Discord poll:
|
Create a Discord poll:
|
||||||
```
|
```
|
||||||
clawdbot message poll --channel discord \
|
clawdbot message poll --provider discord \
|
||||||
--to channel:123 \
|
--to channel:123 \
|
||||||
--poll-question "Snack?" \
|
--poll-question "Snack?" \
|
||||||
--poll-option Pizza --poll-option Sushi \
|
--poll-option Pizza --poll-option Sushi \
|
||||||
@@ -185,13 +185,13 @@ clawdbot message poll --channel discord \
|
|||||||
|
|
||||||
Send a Teams proactive message:
|
Send a Teams proactive message:
|
||||||
```
|
```
|
||||||
clawdbot message send --channel msteams \
|
clawdbot message send --provider msteams \
|
||||||
--to conversation:19:abc@thread.tacv2 --message "hi"
|
--to conversation:19:abc@thread.tacv2 --message "hi"
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a Teams poll:
|
Create a Teams poll:
|
||||||
```
|
```
|
||||||
clawdbot message poll --channel msteams \
|
clawdbot message poll --provider msteams \
|
||||||
--to conversation:19:abc@thread.tacv2 \
|
--to conversation:19:abc@thread.tacv2 \
|
||||||
--poll-question "Lunch?" \
|
--poll-question "Lunch?" \
|
||||||
--poll-option Pizza --poll-option Sushi
|
--poll-option Pizza --poll-option Sushi
|
||||||
@@ -199,12 +199,12 @@ clawdbot message poll --channel msteams \
|
|||||||
|
|
||||||
React in Slack:
|
React in Slack:
|
||||||
```
|
```
|
||||||
clawdbot message react --channel slack \
|
clawdbot message react --provider slack \
|
||||||
--to C123 --message-id 456 --emoji "✅"
|
--to C123 --message-id 456 --emoji "✅"
|
||||||
```
|
```
|
||||||
|
|
||||||
Send Telegram inline buttons:
|
Send Telegram inline buttons:
|
||||||
```
|
```
|
||||||
clawdbot message send --channel telegram --to @mychat --message "Choose:" \
|
clawdbot message send --provider telegram --to @mychat --message "Choose:" \
|
||||||
--buttons '[ [{"text":"Yes","callback_data":"cmd:yes"}], [{"text":"No","callback_data":"cmd:no"}] ]'
|
--buttons '[ [{"text":"Yes","callback_data":"cmd:yes"}], [{"text":"No","callback_data":"cmd:no"}] ]'
|
||||||
```
|
```
|
||||||
+2
-2
@@ -9,7 +9,7 @@ read_when:
|
|||||||
|
|
||||||
Safely update a **source checkout** (git install) of Clawdbot.
|
Safely update a **source checkout** (git install) of Clawdbot.
|
||||||
|
|
||||||
If you installed via **npm/pnpm** (global install, no git metadata), use the package manager flow in [Updating](/install/updating).
|
If you installed via **npm/pnpm/bun** (global install, no git metadata), use the package manager flow in [Updating](/install/updating).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ High-level:
|
|||||||
|
|
||||||
1. Requires a clean worktree (no uncommitted changes).
|
1. Requires a clean worktree (no uncommitted changes).
|
||||||
2. Fetches and rebases against `@{upstream}`.
|
2. Fetches and rebases against `@{upstream}`.
|
||||||
3. Installs deps (pnpm preferred; npm fallback).
|
3. Installs deps (pnpm/bun/npm depending on the checkout).
|
||||||
4. Builds + builds the Control UI.
|
4. Builds + builds the Control UI.
|
||||||
5. Runs `clawdbot doctor` as the final “safe update” check.
|
5. Runs `clawdbot doctor` as the final “safe update” check.
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Short, exact flow of one agent run.
|
|||||||
- `assistant`: streamed deltas from pi-agent-core
|
- `assistant`: streamed deltas from pi-agent-core
|
||||||
- `tool`: streamed tool events from pi-agent-core
|
- `tool`: streamed tool events from pi-agent-core
|
||||||
|
|
||||||
## Chat channel handling
|
## Chat provider handling
|
||||||
- Assistant deltas are buffered into chat `delta` messages.
|
- Assistant deltas are buffered into chat `delta` messages.
|
||||||
- A chat `final` is emitted on **lifecycle end/error**.
|
- A chat `final` is emitted on **lifecycle end/error**.
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,6 @@ Suggested `.gitignore` starter:
|
|||||||
## Advanced notes
|
## Advanced notes
|
||||||
|
|
||||||
- Multi-agent routing can use different workspaces per agent. See
|
- Multi-agent routing can use different workspaces per agent. See
|
||||||
[Channel routing](/concepts/channel-routing) for routing configuration.
|
[Provider routing](/concepts/provider-routing) for routing configuration.
|
||||||
- If `agents.defaults.sandbox` is enabled, non-main sessions can use per-session sandbox
|
- If `agents.defaults.sandbox` is enabled, non-main sessions can use per-session sandbox
|
||||||
workspaces under `agents.defaults.sandbox.workspaceRoot`.
|
workspaces under `agents.defaults.sandbox.workspaceRoot`.
|
||||||
@@ -92,7 +92,7 @@ Tune the boundary via `agents.defaults.blockStreamingBreak` (`text_end` vs `mess
|
|||||||
Control soft block chunking with `agents.defaults.blockStreamingChunk` (defaults to
|
Control soft block chunking with `agents.defaults.blockStreamingChunk` (defaults to
|
||||||
800–1200 chars; prefers paragraph breaks, then newlines; sentences last).
|
800–1200 chars; prefers paragraph breaks, then newlines; sentences last).
|
||||||
Coalesce streamed chunks with `agents.defaults.blockStreamingCoalesce` to reduce
|
Coalesce streamed chunks with `agents.defaults.blockStreamingCoalesce` to reduce
|
||||||
single-line spam (idle-based merging before send). Non-Telegram channels require
|
single-line spam (idle-based merging before send). Non-Telegram providers require
|
||||||
explicit `*.blockStreaming: true` to enable block replies.
|
explicit `*.blockStreaming: true` to enable block replies.
|
||||||
Verbose tool summaries are emitted at tool start (no debounce); Control UI
|
Verbose tool summaries are emitted at tool start (no debounce); Control UI
|
||||||
streams tool output via agent events when available.
|
streams tool output via agent events when available.
|
||||||
@@ -102,7 +102,7 @@ More details: [Streaming + chunking](/concepts/streaming).
|
|||||||
|
|
||||||
At minimum, set:
|
At minimum, set:
|
||||||
- `agents.defaults.workspace`
|
- `agents.defaults.workspace`
|
||||||
- `channels.whatsapp.allowFrom` (strongly recommended)
|
- `whatsapp.allowFrom` (strongly recommended)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,152 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Context: what the model sees, how it is built, and how to inspect it"
|
|
||||||
read_when:
|
|
||||||
- You want to understand what “context” means in Clawdbot
|
|
||||||
- You are debugging why the model “knows” something (or forgot it)
|
|
||||||
- You want to reduce context overhead (/context, /status, /compact)
|
|
||||||
---
|
|
||||||
# Context
|
|
||||||
|
|
||||||
“Context” is **everything Clawdbot sends to the model for a run**. It is bounded by the model’s **context window** (token limit).
|
|
||||||
|
|
||||||
Beginner mental model:
|
|
||||||
- **System prompt** (Clawdbot-built): rules, tools, skills list, time/runtime, and injected workspace files.
|
|
||||||
- **Conversation history**: your messages + the assistant’s messages for this session.
|
|
||||||
- **Tool calls/results + attachments**: command output, file reads, images/audio, etc.
|
|
||||||
|
|
||||||
Context is *not the same thing* as “memory”: memory can be stored on disk and reloaded later; context is what’s inside the model’s current window.
|
|
||||||
|
|
||||||
## Quick start (inspect context)
|
|
||||||
|
|
||||||
- `/status` → quick “how full is my window?” view + session settings.
|
|
||||||
- `/context list` → what’s injected + rough sizes (per file + totals).
|
|
||||||
- `/context detail` → deeper breakdown: per-file, per-tool schema sizes, per-skill entry sizes, and system prompt size.
|
|
||||||
- `/cost on` → append per-reply usage line to normal replies.
|
|
||||||
- `/compact` → summarize older history into a compact entry to free window space.
|
|
||||||
|
|
||||||
See also: [Slash commands](/tools/slash-commands), [Token use & costs](/token-use), [Compaction](/concepts/compaction).
|
|
||||||
|
|
||||||
## Example output
|
|
||||||
|
|
||||||
Values vary by model, provider, tool policy, and what’s in your workspace.
|
|
||||||
|
|
||||||
### `/context list`
|
|
||||||
|
|
||||||
```
|
|
||||||
🧠 Context breakdown
|
|
||||||
Workspace: <workspaceDir>
|
|
||||||
Bootstrap max/file: 20,000 chars
|
|
||||||
Sandbox: mode=non-main sandboxed=false
|
|
||||||
System prompt (run): 38,412 chars (~9,603 tok) (Project Context 23,901 chars (~5,976 tok))
|
|
||||||
|
|
||||||
Injected workspace files:
|
|
||||||
- AGENTS.md: OK | raw 1,742 chars (~436 tok) | injected 1,742 chars (~436 tok)
|
|
||||||
- SOUL.md: OK | raw 912 chars (~228 tok) | injected 912 chars (~228 tok)
|
|
||||||
- TOOLS.md: TRUNCATED | raw 54,210 chars (~13,553 tok) | injected 20,962 chars (~5,241 tok)
|
|
||||||
- IDENTITY.md: OK | raw 211 chars (~53 tok) | injected 211 chars (~53 tok)
|
|
||||||
- USER.md: OK | raw 388 chars (~97 tok) | injected 388 chars (~97 tok)
|
|
||||||
- HEARTBEAT.md: MISSING | raw 0 | injected 0
|
|
||||||
- BOOTSTRAP.md: OK | raw 0 chars (~0 tok) | injected 0 chars (~0 tok)
|
|
||||||
|
|
||||||
Skills list (system prompt text): 2,184 chars (~546 tok) (12 skills)
|
|
||||||
Tools: read, edit, write, exec, process, browser, message, sessions_send, …
|
|
||||||
Tool list (system prompt text): 1,032 chars (~258 tok)
|
|
||||||
Tool schemas (JSON): 31,988 chars (~7,997 tok) (counts toward context; not shown as text)
|
|
||||||
Tools: (same as above)
|
|
||||||
|
|
||||||
Session tokens (cached): 14,250 total / ctx=32,000
|
|
||||||
```
|
|
||||||
|
|
||||||
### `/context detail`
|
|
||||||
|
|
||||||
```
|
|
||||||
🧠 Context breakdown (detailed)
|
|
||||||
…
|
|
||||||
Top skills (prompt entry size):
|
|
||||||
- frontend-design: 412 chars (~103 tok)
|
|
||||||
- oracle: 401 chars (~101 tok)
|
|
||||||
… (+10 more skills)
|
|
||||||
|
|
||||||
Top tools (schema size):
|
|
||||||
- browser: 9,812 chars (~2,453 tok)
|
|
||||||
- exec: 6,240 chars (~1,560 tok)
|
|
||||||
… (+N more tools)
|
|
||||||
```
|
|
||||||
|
|
||||||
## What counts toward the context window
|
|
||||||
|
|
||||||
Everything the model receives counts, including:
|
|
||||||
- System prompt (all sections).
|
|
||||||
- Conversation history.
|
|
||||||
- Tool calls + tool results.
|
|
||||||
- Attachments/transcripts (images/audio/files).
|
|
||||||
- Compaction summaries and pruning artifacts.
|
|
||||||
- Provider “wrappers” or hidden headers (not visible, still counted).
|
|
||||||
|
|
||||||
## How Clawdbot builds the system prompt
|
|
||||||
|
|
||||||
The system prompt is **Clawdbot-owned** and rebuilt each run. It includes:
|
|
||||||
- Tool list + short descriptions.
|
|
||||||
- Skills list (metadata only; see below).
|
|
||||||
- Workspace location.
|
|
||||||
- Time (UTC + converted user time if configured).
|
|
||||||
- Runtime metadata (host/OS/model/thinking).
|
|
||||||
- Injected workspace bootstrap files under **Project Context**.
|
|
||||||
|
|
||||||
Full breakdown: [System Prompt](/concepts/system-prompt).
|
|
||||||
|
|
||||||
## Injected workspace files (Project Context)
|
|
||||||
|
|
||||||
By default, Clawdbot injects a fixed set of workspace files (if present):
|
|
||||||
- `AGENTS.md`
|
|
||||||
- `SOUL.md`
|
|
||||||
- `TOOLS.md`
|
|
||||||
- `IDENTITY.md`
|
|
||||||
- `USER.md`
|
|
||||||
- `HEARTBEAT.md`
|
|
||||||
- `BOOTSTRAP.md` (first-run only)
|
|
||||||
|
|
||||||
Large files are truncated per-file using `agents.defaults.bootstrapMaxChars` (default `20000` chars). `/context` shows **raw vs injected** sizes and whether truncation happened.
|
|
||||||
|
|
||||||
## Skills: what’s injected vs loaded on-demand
|
|
||||||
|
|
||||||
The system prompt includes a compact **skills list** (name + description + location). This list has real overhead.
|
|
||||||
|
|
||||||
Skill instructions are *not* included by default. The model is expected to `read` the skill’s `SKILL.md` **only when needed**.
|
|
||||||
|
|
||||||
## Tools: there are two costs
|
|
||||||
|
|
||||||
Tools affect context in two ways:
|
|
||||||
1) **Tool list text** in the system prompt (what you see as “Tooling”).
|
|
||||||
2) **Tool schemas** (JSON). These are sent to the model so it can call tools. They count toward context even though you don’t see them as plain text.
|
|
||||||
|
|
||||||
`/context detail` breaks down the biggest tool schemas so you can see what dominates.
|
|
||||||
|
|
||||||
## Commands, directives, and “inline shortcuts”
|
|
||||||
|
|
||||||
Slash commands are handled by the Gateway. There are a few different behaviors:
|
|
||||||
- **Standalone commands**: a message that is only `/...` runs as a command.
|
|
||||||
- **Directives**: `/think`, `/verbose`, `/reasoning`, `/elevated`, `/model`, `/queue` are stripped before the model sees the message.
|
|
||||||
- Directive-only messages persist session settings.
|
|
||||||
- Inline directives in a normal message act as per-message hints.
|
|
||||||
- **Inline shortcuts** (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: “hey /status”), and are stripped before the model sees the remaining text.
|
|
||||||
|
|
||||||
Details: [Slash commands](/tools/slash-commands).
|
|
||||||
|
|
||||||
## Sessions, compaction, and pruning (what persists)
|
|
||||||
|
|
||||||
What persists across messages depends on the mechanism:
|
|
||||||
- **Normal history** persists in the session transcript until compacted/pruned by policy.
|
|
||||||
- **Compaction** persists a summary into the transcript and keeps recent messages intact.
|
|
||||||
- **Pruning** removes old tool results from the *in-memory* prompt for a run, but does not rewrite the transcript.
|
|
||||||
|
|
||||||
Docs: [Session](/concepts/session), [Compaction](/concepts/compaction), [Session pruning](/concepts/session-pruning).
|
|
||||||
|
|
||||||
## What `/context` actually reports
|
|
||||||
|
|
||||||
`/context` prefers the latest **run-built** system prompt report when available:
|
|
||||||
- `System prompt (run)` = captured from the last embedded (tool-capable) run and persisted in the session store.
|
|
||||||
- `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesn’t generate the report).
|
|
||||||
|
|
||||||
Either way, it reports sizes and top contributors; it does **not** dump the full system prompt or tool schemas.
|
|
||||||
|
|
||||||
@@ -3,42 +3,42 @@ summary: "Behavior and config for WhatsApp group message handling (mentionPatter
|
|||||||
read_when:
|
read_when:
|
||||||
- Changing group message rules or mentions
|
- Changing group message rules or mentions
|
||||||
---
|
---
|
||||||
# Group messages (WhatsApp web channel)
|
# Group messages (web provider)
|
||||||
|
|
||||||
Goal: let Clawd sit in WhatsApp groups, wake up only when pinged, and keep that thread separate from the personal DM session.
|
Goal: let Clawd sit in WhatsApp groups, wake up only when pinged, and keep that thread separate from the personal DM session.
|
||||||
|
|
||||||
Note: `agents.list[].groupChat.mentionPatterns` is now used by Telegram/Discord/Slack/iMessage as well; this doc focuses on WhatsApp-specific behavior. For multi-agent setups, set `agents.list[].groupChat.mentionPatterns` per agent (or use `messages.groupChat.mentionPatterns` as a global fallback).
|
Note: `agents.list[].groupChat.mentionPatterns` is now used by Telegram/Discord/Slack/iMessage as well; this doc focuses on WhatsApp-specific behavior. For multi-agent setups, set `agents.list[].groupChat.mentionPatterns` per agent (or use `messages.groupChat.mentionPatterns` as a global fallback).
|
||||||
|
|
||||||
## What’s implemented (2025-12-03)
|
## What’s implemented (2025-12-03)
|
||||||
- Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, regex patterns, or the bot’s E.164 anywhere in the text). `always` wakes the agent on every message but it should reply only when it can add meaningful value; otherwise it returns the silent token `NO_REPLY`. Defaults can be set in config (`channels.whatsapp.groups`) and overridden per group via `/activation`. When `channels.whatsapp.groups` is set, it also acts as a group allowlist (include `"*"` to allow all).
|
- Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, regex patterns, or the bot’s E.164 anywhere in the text). `always` wakes the agent on every message but it should reply only when it can add meaningful value; otherwise it returns the silent token `NO_REPLY`. Defaults can be set in config (`whatsapp.groups`) and overridden per group via `/activation`. When `whatsapp.groups` is set, it also acts as a group allowlist (include `"*"` to allow all).
|
||||||
- Group policy: `channels.whatsapp.groupPolicy` controls whether group messages are accepted (`open|disabled|allowlist`). `allowlist` uses `channels.whatsapp.groupAllowFrom` (fallback: explicit `channels.whatsapp.allowFrom`). Default is `allowlist` (blocked until you add senders).
|
- Group policy: `whatsapp.groupPolicy` controls whether group messages are accepted (`open|disabled|allowlist`). `allowlist` uses `whatsapp.groupAllowFrom` (fallback: explicit `whatsapp.allowFrom`). Default is `allowlist` (blocked until you add senders).
|
||||||
- Per-group sessions: session keys look like `agent:<agentId>:whatsapp:group:<jid>` so commands such as `/verbose on` or `/think high` (sent as standalone messages) are scoped to that group; personal DM state is untouched. Heartbeats are skipped for group threads.
|
- Per-group sessions: session keys look like `agent:<agentId>:whatsapp:group:<jid>` so commands such as `/verbose on` or `/think high` (sent as standalone messages) are scoped to that group; personal DM state is untouched. Heartbeats are skipped for group threads.
|
||||||
- Context injection: last N (default 50) group messages are prefixed under `[Chat messages since your last reply - for context]`, with the triggering line under `[Current message - respond to this]`.
|
- Context injection: last N (default 50) group messages are prefixed under `[Chat messages since your last reply - for context]`, with the triggering line under `[Current message - respond to this]`.
|
||||||
- Sender surfacing: every group batch now ends with `[from: Sender Name (+E164)]` so Pi knows who is speaking.
|
- Sender surfacing: every group batch now ends with `[from: Sender Name (+E164)]` so Pi knows who is speaking.
|
||||||
- Ephemeral/view-once: we unwrap those before extracting text/mentions, so pings inside them still trigger.
|
- Ephemeral/view-once: we unwrap those before extracting text/mentions, so pings inside them still trigger.
|
||||||
- Group system prompt: on the first turn of a group session (and whenever `/activation` changes the mode) we inject a short blurb into the system prompt like `You are replying inside the WhatsApp group "<subject>". Group members: Alice (+44...), Bob (+43...), … Activation: trigger-only … Address the specific sender noted in the message context.` If metadata isn’t available we still tell the agent it’s a group chat.
|
- Group system prompt: on the first turn of a group session (and whenever `/activation` changes the mode) we inject a short blurb into the system prompt like `You are replying inside the WhatsApp group "<subject>". Group members: Alice (+44...), Bob (+43...), … Activation: trigger-only … Address the specific sender noted in the message context.` If metadata isn’t available we still tell the agent it’s a group chat.
|
||||||
|
|
||||||
## Config example (WhatsApp)
|
## Config for Clawd UK (+447700900123)
|
||||||
Add a `groupChat` block to `~/.clawdbot/clawdbot.json` so display-name pings work even when WhatsApp strips the visual `@` in the text body:
|
Add a `groupChat` block to `~/.clawdbot/clawdbot.json` so display-name pings work even when WhatsApp strips the visual `@` in the text body:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
"whatsapp": {
|
||||||
whatsapp: {
|
"groups": {
|
||||||
groups: {
|
"*": { "requireMention": true }
|
||||||
"*": { requireMention: true }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
agents: {
|
"agents": {
|
||||||
list: [
|
"list": [
|
||||||
{
|
{
|
||||||
id: "main",
|
"id": "main",
|
||||||
groupChat: {
|
"groupChat": {
|
||||||
historyLimit: 50,
|
"historyLimit": 50,
|
||||||
mentionPatterns: [
|
"mentionPatterns": [
|
||||||
|
"@?clawd",
|
||||||
|
"@?clawd\\s*uk",
|
||||||
"@?clawdbot",
|
"@?clawdbot",
|
||||||
"\\+?15555550123"
|
"\\+?447700900123"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,8 +48,8 @@ Add a `groupChat` block to `~/.clawdbot/clawdbot.json` so display-name pings wor
|
|||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- The regexes are case-insensitive; they cover a display-name ping like `@clawdbot` and the raw number with or without `+`/spaces.
|
- The regexes are case-insensitive; they cover `@clawd`, `@clawd uk`, `clawdbot`, and the raw number with or without `+`/spaces.
|
||||||
- WhatsApp still sends canonical mentions via `mentionedJids` when someone taps the contact, so the number fallback is rarely needed but is a useful safety net.
|
- WhatsApp still sends canonical mentions via `mentionedJids` when someone taps the contact, so the number fallback is rarely needed but is a good safety net.
|
||||||
|
|
||||||
### Activation command (owner-only)
|
### Activation command (owner-only)
|
||||||
|
|
||||||
@@ -57,11 +57,11 @@ Use the group chat command:
|
|||||||
- `/activation mention`
|
- `/activation mention`
|
||||||
- `/activation always`
|
- `/activation always`
|
||||||
|
|
||||||
Only the owner number (from `channels.whatsapp.allowFrom`, or the bot’s own E.164 when unset) can change this. Send `/status` as a standalone message in the group to see the current activation mode.
|
Only the owner number (from `whatsapp.allowFrom`, or the bot’s own E.164 when unset) can change this. Send `/status` as a standalone message in the group to see the current activation mode.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
1) Add your WhatsApp account (the one running Clawdbot) to the group.
|
1) Add Clawd UK (`+447700900123`) to the group.
|
||||||
2) Say `@clawdbot …` (or include the number). Only allowlisted senders can trigger it unless you set `groupPolicy: "open"`.
|
2) Say `@clawd …` (or `@clawd uk`, `@clawdbot`, or include the number). Only allowlisted senders can trigger it unless you set `groupPolicy: "open"`.
|
||||||
3) The agent prompt will include recent group context plus the trailing `[from: …]` marker so it can address the right person.
|
3) The agent prompt will include recent group context plus the trailing `[from: …]` marker so it can address the right person.
|
||||||
4) Session-level directives (`/verbose on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that group’s session; send them as standalone messages so they register. Your personal DM session remains independent.
|
4) Session-level directives (`/verbose on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that group’s session; send them as standalone messages so they register. Your personal DM session remains independent.
|
||||||
|
|
||||||
|
|||||||
+12
-86
@@ -41,85 +41,20 @@ If you want...
|
|||||||
| Only you can trigger in groups | `groupPolicy: "allowlist"`, `groupAllowFrom: ["+1555..."]` |
|
| Only you can trigger in groups | `groupPolicy: "allowlist"`, `groupAllowFrom: ["+1555..."]` |
|
||||||
|
|
||||||
## Session keys
|
## Session keys
|
||||||
- Group sessions use `agent:<agentId>:<channel>:group:<id>` session keys (rooms/channels use `agent:<agentId>:<channel>:channel:<id>`).
|
- Group sessions use `agent:<agentId>:<provider>:group:<id>` session keys (rooms/channels use `agent:<agentId>:<provider>:channel:<id>`).
|
||||||
- Telegram forum topics add `:topic:<threadId>` to the group id so each topic has its own session.
|
- Telegram forum topics add `:topic:<threadId>` to the group id so each topic has its own session.
|
||||||
- Direct chats use the main session (or per-sender if configured).
|
- Direct chats use the main session (or per-sender if configured).
|
||||||
- Heartbeats are skipped for group sessions.
|
- Heartbeats are skipped for group sessions.
|
||||||
|
|
||||||
## Pattern: personal DMs + public groups (single agent)
|
|
||||||
|
|
||||||
Yes — this works well if your “personal” traffic is **DMs** and your “public” traffic is **groups**.
|
|
||||||
|
|
||||||
Why: in single-agent mode, DMs typically land in the **main** session key (`agent:main:main`), while groups always use **non-main** session keys (`agent:main:<channel>:group:<id>`). If you enable sandboxing with `mode: "non-main"`, those group sessions run in Docker while your main DM session stays on-host.
|
|
||||||
|
|
||||||
This gives you one agent “brain” (shared workspace + memory), but two execution postures:
|
|
||||||
- **DMs**: full tools (host)
|
|
||||||
- **Groups**: sandbox + restricted tools (Docker)
|
|
||||||
|
|
||||||
> If you need truly separate workspaces/personas (“personal” and “public” must never mix), use a second agent + bindings. See [Multi-Agent Routing](/concepts/multi-agent).
|
|
||||||
|
|
||||||
Example (DMs on host, groups sandboxed + messaging-only tools):
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
agents: {
|
|
||||||
defaults: {
|
|
||||||
sandbox: {
|
|
||||||
mode: "non-main", // groups/channels are non-main -> sandboxed
|
|
||||||
scope: "session", // strongest isolation (one container per group/channel)
|
|
||||||
workspaceAccess: "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tools: {
|
|
||||||
sandbox: {
|
|
||||||
tools: {
|
|
||||||
// If allow is non-empty, everything else is blocked (deny still wins).
|
|
||||||
allow: ["group:messaging", "group:sessions"],
|
|
||||||
deny: ["group:runtime", "group:fs", "group:ui", "nodes", "cron", "gateway"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Want “groups can only see folder X” instead of “no host access”? Keep `workspaceAccess: "none"` and mount only allowlisted paths into the sandbox:
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
agents: {
|
|
||||||
defaults: {
|
|
||||||
sandbox: {
|
|
||||||
mode: "non-main",
|
|
||||||
scope: "session",
|
|
||||||
workspaceAccess: "none",
|
|
||||||
docker: {
|
|
||||||
binds: [
|
|
||||||
// hostPath:containerPath:mode
|
|
||||||
"~/FriendsShared:/data:ro"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Related:
|
|
||||||
- Configuration keys and defaults: [Gateway configuration](/gateway/configuration#agentsdefaultssandbox)
|
|
||||||
- Debugging why a tool is blocked: [Sandbox vs Tool Policy vs Elevated](/gateway/sandbox-vs-tool-policy-vs-elevated)
|
|
||||||
- Bind mounts details: [Sandboxing](/gateway/sandboxing#custom-bind-mounts)
|
|
||||||
|
|
||||||
## Display labels
|
## Display labels
|
||||||
- UI labels use `displayName` when available, formatted as `<channel>:<token>`.
|
- UI labels use `displayName` when available, formatted as `<provider>:<token>`.
|
||||||
- `#room` is reserved for rooms/channels; group chats use `g-<slug>` (lowercase, spaces -> `-`, keep `#@+._-`).
|
- `#room` is reserved for rooms/channels; group chats use `g-<slug>` (lowercase, spaces -> `-`, keep `#@+._-`).
|
||||||
|
|
||||||
## Group policy
|
## Group policy
|
||||||
Control how group/room messages are handled per channel:
|
Control how group/room messages are handled per provider:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groupPolicy: "disabled", // "open" | "disabled" | "allowlist"
|
groupPolicy: "disabled", // "open" | "disabled" | "allowlist"
|
||||||
groupAllowFrom: ["+15551234567"]
|
groupAllowFrom: ["+15551234567"]
|
||||||
@@ -151,7 +86,6 @@ Control how group/room messages are handled per channel:
|
|||||||
channels: { "#general": { allow: true } }
|
channels: { "#general": { allow: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
| Policy | Behavior |
|
| Policy | Behavior |
|
||||||
@@ -163,15 +97,15 @@ Control how group/room messages are handled per channel:
|
|||||||
Notes:
|
Notes:
|
||||||
- `groupPolicy` is separate from mention-gating (which requires @mentions).
|
- `groupPolicy` is separate from mention-gating (which requires @mentions).
|
||||||
- WhatsApp/Telegram/Signal/iMessage/Microsoft Teams: use `groupAllowFrom` (fallback: explicit `allowFrom`).
|
- WhatsApp/Telegram/Signal/iMessage/Microsoft Teams: use `groupAllowFrom` (fallback: explicit `allowFrom`).
|
||||||
- Discord: allowlist uses `channels.discord.guilds.<id>.channels`.
|
- Discord: allowlist uses `discord.guilds.<id>.channels`.
|
||||||
- Slack: allowlist uses `channels.slack.channels`.
|
- Slack: allowlist uses `slack.channels`.
|
||||||
- Group DMs are controlled separately (`channels.discord.dm.*`, `channels.slack.dm.*`).
|
- Group DMs are controlled separately (`discord.dm.*`, `slack.dm.*`).
|
||||||
- Telegram allowlist can match user IDs (`"123456789"`, `"telegram:123456789"`, `"tg:123456789"`) or usernames (`"@alice"` or `"alice"`); prefixes are case-insensitive.
|
- Telegram allowlist can match user IDs (`"123456789"`, `"telegram:123456789"`, `"tg:123456789"`) or usernames (`"@alice"` or `"alice"`); prefixes are case-insensitive.
|
||||||
- Default is `groupPolicy: "allowlist"`; if your group allowlist is empty, group messages are blocked.
|
- Default is `groupPolicy: "allowlist"`; if your group allowlist is empty, group messages are blocked.
|
||||||
|
|
||||||
Quick mental model (evaluation order for group messages):
|
Quick mental model (evaluation order for group messages):
|
||||||
1) `groupPolicy` (open/disabled/allowlist)
|
1) `groupPolicy` (open/disabled/allowlist)
|
||||||
2) group allowlists (`*.groups`, `*.groupAllowFrom`, channel-specific allowlist)
|
2) group allowlists (`*.groups`, `*.groupAllowFrom`, provider-specific allowlist)
|
||||||
3) mention gating (`requireMention`, `/activation`)
|
3) mention gating (`requireMention`, `/activation`)
|
||||||
|
|
||||||
## Mention gating (default)
|
## Mention gating (default)
|
||||||
@@ -179,7 +113,6 @@ Group messages require a mention unless overridden per group. Defaults live per
|
|||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groups: {
|
groups: {
|
||||||
"*": { requireMention: true },
|
"*": { requireMention: true },
|
||||||
@@ -197,7 +130,6 @@ Group messages require a mention unless overridden per group. Defaults live per
|
|||||||
"*": { requireMention: true },
|
"*": { requireMention: true },
|
||||||
"123": { requireMention: false }
|
"123": { requireMention: false }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
agents: {
|
agents: {
|
||||||
list: [
|
list: [
|
||||||
@@ -218,25 +150,24 @@ Notes:
|
|||||||
- Surfaces that provide explicit mentions still pass; patterns are a fallback.
|
- Surfaces that provide explicit mentions still pass; patterns are a fallback.
|
||||||
- Per-agent override: `agents.list[].groupChat.mentionPatterns` (useful when multiple agents share a group).
|
- Per-agent override: `agents.list[].groupChat.mentionPatterns` (useful when multiple agents share a group).
|
||||||
- Mention gating is only enforced when mention detection is possible (native mentions or `mentionPatterns` are configured).
|
- Mention gating is only enforced when mention detection is possible (native mentions or `mentionPatterns` are configured).
|
||||||
- Discord defaults live in `channels.discord.guilds."*"` (overridable per guild/channel).
|
- Discord defaults live in `discord.guilds."*"` (overridable per guild/channel).
|
||||||
- Group history context is wrapped uniformly across channels; use `messages.groupChat.historyLimit` for the global default and `channels.<channel>.historyLimit` (or `channels.<channel>.accounts.*.historyLimit`) for overrides. Set `0` to disable.
|
- Group history context is wrapped uniformly across providers; use `messages.groupChat.historyLimit` for the global default and `<provider>.historyLimit` (or `<provider>.accounts.*.historyLimit`) for overrides. Set `0` to disable.
|
||||||
|
|
||||||
## Group allowlists
|
## Group allowlists
|
||||||
When `channels.whatsapp.groups`, `channels.telegram.groups`, or `channels.imessage.groups` is configured, the keys act as a group allowlist. Use `"*"` to allow all groups while still setting default mention behavior.
|
When `whatsapp.groups`, `telegram.groups`, or `imessage.groups` is configured, the keys act as a group allowlist. Use `"*"` to allow all groups while still setting default mention behavior.
|
||||||
|
|
||||||
Common intents (copy/paste):
|
Common intents (copy/paste):
|
||||||
|
|
||||||
1) Disable all group replies
|
1) Disable all group replies
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: { whatsapp: { groupPolicy: "disabled" } }
|
whatsapp: { groupPolicy: "disabled" }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Allow only specific groups (WhatsApp)
|
2) Allow only specific groups (WhatsApp)
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groups: {
|
groups: {
|
||||||
"123@g.us": { requireMention: true },
|
"123@g.us": { requireMention: true },
|
||||||
@@ -244,31 +175,26 @@ Common intents (copy/paste):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3) Allow all groups but require mention (explicit)
|
3) Allow all groups but require mention (explicit)
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groups: { "*": { requireMention: true } }
|
groups: { "*": { requireMention: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4) Only the owner can trigger in groups (WhatsApp)
|
4) Only the owner can trigger in groups (WhatsApp)
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groupPolicy: "allowlist",
|
groupPolicy: "allowlist",
|
||||||
groupAllowFrom: ["+15551234567"],
|
groupAllowFrom: ["+15551234567"],
|
||||||
groups: { "*": { requireMention: true } }
|
groups: { "*": { requireMention: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Activation (owner-only)
|
## Activation (owner-only)
|
||||||
@@ -276,7 +202,7 @@ Group owners can toggle per-group activation:
|
|||||||
- `/activation mention`
|
- `/activation mention`
|
||||||
- `/activation always`
|
- `/activation always`
|
||||||
|
|
||||||
Owner is determined by `channels.whatsapp.allowFrom` (or the bot’s self E.164 when unset). Send the command as a standalone message. Other surfaces currently ignore `/activation`.
|
Owner is determined by `whatsapp.allowFrom` (or the bot’s self E.164 when unset). Send the command as a standalone message. Other surfaces currently ignore `/activation`.
|
||||||
|
|
||||||
## Context fields
|
## Context fields
|
||||||
Group inbound payloads set:
|
Group inbound payloads set:
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
---
|
|
||||||
summary: "Markdown formatting pipeline for outbound channels"
|
|
||||||
read_when:
|
|
||||||
- You are changing markdown formatting or chunking for outbound channels
|
|
||||||
- You are adding a new channel formatter or style mapping
|
|
||||||
- You are debugging formatting regressions across channels
|
|
||||||
---
|
|
||||||
# Markdown formatting
|
|
||||||
|
|
||||||
Clawdbot formats outbound Markdown by converting it into a shared intermediate
|
|
||||||
representation (IR) before rendering channel-specific output. The IR keeps the
|
|
||||||
source text intact while carrying style/link spans so chunking and rendering can
|
|
||||||
stay consistent across channels.
|
|
||||||
|
|
||||||
## Goals
|
|
||||||
|
|
||||||
- **Consistency:** one parse step, multiple renderers.
|
|
||||||
- **Safe chunking:** split text before rendering so inline formatting never
|
|
||||||
breaks across chunks.
|
|
||||||
- **Channel fit:** map the same IR to Slack mrkdwn, Telegram HTML, and Signal
|
|
||||||
style ranges without re-parsing Markdown.
|
|
||||||
|
|
||||||
## Pipeline
|
|
||||||
|
|
||||||
1. **Parse Markdown -> IR**
|
|
||||||
- IR is plain text plus style spans (bold/italic/strike/code/spoiler) and link spans.
|
|
||||||
- Offsets are UTF-16 code units so Signal style ranges align with its API.
|
|
||||||
2. **Chunk IR (format-first)**
|
|
||||||
- Chunking happens on the IR text before rendering.
|
|
||||||
- Inline formatting does not split across chunks; spans are sliced per chunk.
|
|
||||||
3. **Render per channel**
|
|
||||||
- **Slack:** mrkdwn tokens (bold/italic/strike/code), links as `<url|label>`.
|
|
||||||
- **Telegram:** HTML tags (`<b>`, `<i>`, `<s>`, `<code>`, `<pre><code>`, `<a href>`).
|
|
||||||
- **Signal:** plain text + `text-style` ranges; links become `label (url)` when label differs.
|
|
||||||
|
|
||||||
## IR example
|
|
||||||
|
|
||||||
Input Markdown:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Hello **world** — see [docs](https://docs.clawd.bot).
|
|
||||||
```
|
|
||||||
|
|
||||||
IR (schematic):
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"text": "Hello world — see docs.",
|
|
||||||
"styles": [
|
|
||||||
{ "start": 6, "end": 11, "style": "bold" }
|
|
||||||
],
|
|
||||||
"links": [
|
|
||||||
{ "start": 19, "end": 23, "href": "https://docs.clawd.bot" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Where it is used
|
|
||||||
|
|
||||||
- Slack, Telegram, and Signal outbound adapters render from the IR.
|
|
||||||
- Other channels (WhatsApp, iMessage, MS Teams, Discord) still use plain text or
|
|
||||||
their own formatting rules.
|
|
||||||
|
|
||||||
## Chunking rules
|
|
||||||
|
|
||||||
- Chunk limits come from channel adapters/config and are applied to the IR text.
|
|
||||||
- Code fences are preserved as a single block with a trailing newline so channels
|
|
||||||
render them correctly.
|
|
||||||
- List prefixes and blockquote prefixes are part of the IR text, so chunking
|
|
||||||
does not split mid-prefix.
|
|
||||||
- Inline styles (bold/italic/strike/inline-code/spoiler) are never split across
|
|
||||||
chunks; the renderer reopens styles inside each chunk.
|
|
||||||
|
|
||||||
If you need more on chunking behavior across channels, see
|
|
||||||
[Streaming + chunking](/concepts/streaming).
|
|
||||||
|
|
||||||
## Link policy
|
|
||||||
|
|
||||||
- **Slack:** `[label](url)` -> `<url|label>`; bare URLs remain bare. Autolink
|
|
||||||
is disabled during parse to avoid double-linking.
|
|
||||||
- **Telegram:** `[label](url)` -> `<a href="url">label</a>` (HTML parse mode).
|
|
||||||
- **Signal:** `[label](url)` -> `label (url)` unless label matches the URL.
|
|
||||||
|
|
||||||
## Spoilers
|
|
||||||
|
|
||||||
Spoiler markers (`||spoiler||`) are parsed only for Signal, where they map to
|
|
||||||
SPOILER style ranges. Other channels treat them as plain text.
|
|
||||||
|
|
||||||
## How to add or update a channel formatter
|
|
||||||
|
|
||||||
1. **Parse once:** use the shared `markdownToIR(...)` helper with channel-appropriate
|
|
||||||
options (autolink, heading style, blockquote prefix).
|
|
||||||
2. **Render:** implement a renderer with `renderMarkdownWithMarkers(...)` and a
|
|
||||||
style marker map (or Signal style ranges).
|
|
||||||
3. **Chunk:** call `chunkMarkdownIR(...)` before rendering; render each chunk.
|
|
||||||
4. **Wire adapter:** update the channel outbound adapter to use the new chunker
|
|
||||||
and renderer.
|
|
||||||
5. **Test:** add or update format tests and an outbound delivery test if the
|
|
||||||
channel uses chunking.
|
|
||||||
|
|
||||||
## Common gotchas
|
|
||||||
|
|
||||||
- Slack angle-bracket tokens (`<@U123>`, `<#C123>`, `<https://...>`) must be
|
|
||||||
preserved; escape raw HTML safely.
|
|
||||||
- Telegram HTML requires escaping text outside tags to avoid broken markup.
|
|
||||||
- Signal style ranges depend on UTF-16 offsets; do not use code point offsets.
|
|
||||||
- Preserve trailing newlines for fenced code blocks so closing markers land on
|
|
||||||
their own line.
|
|
||||||
+16
-16
@@ -17,20 +17,20 @@ Inbound message
|
|||||||
-> routing/bindings -> session key
|
-> routing/bindings -> session key
|
||||||
-> queue (if a run is active)
|
-> queue (if a run is active)
|
||||||
-> agent run (streaming + tools)
|
-> agent run (streaming + tools)
|
||||||
-> outbound replies (channel limits + chunking)
|
-> outbound replies (provider limits + chunking)
|
||||||
```
|
```
|
||||||
|
|
||||||
Key knobs live in configuration:
|
Key knobs live in configuration:
|
||||||
- `messages.*` for prefixes, queueing, and group behavior.
|
- `messages.*` for prefixes, queueing, and group behavior.
|
||||||
- `agents.defaults.*` for block streaming and chunking defaults.
|
- `agents.defaults.*` for block streaming and chunking defaults.
|
||||||
- Channel overrides (`channels.whatsapp.*`, `channels.telegram.*`, etc.) for caps and streaming toggles.
|
- Provider overrides (`whatsapp.*`, `telegram.*`, etc.) for caps and streaming toggles.
|
||||||
|
|
||||||
See [Configuration](/gateway/configuration) for full schema.
|
See [Configuration](/gateway/configuration) for full schema.
|
||||||
|
|
||||||
## Inbound dedupe
|
## Inbound dedupe
|
||||||
|
|
||||||
Channels can redeliver the same message after reconnects. Clawdbot keeps a
|
Providers can redeliver the same message after reconnects. Clawdbot keeps a
|
||||||
short-lived cache keyed by channel/account/peer/session/message id so duplicate
|
short-lived cache keyed by provider/account/peer/session/message id so duplicate
|
||||||
deliveries do not trigger another agent run.
|
deliveries do not trigger another agent run.
|
||||||
|
|
||||||
## Sessions and devices
|
## Sessions and devices
|
||||||
@@ -40,7 +40,7 @@ Sessions are owned by the gateway, not by clients.
|
|||||||
- Groups/channels get their own session keys.
|
- Groups/channels get their own session keys.
|
||||||
- The session store and transcripts live on the gateway host.
|
- The session store and transcripts live on the gateway host.
|
||||||
|
|
||||||
Multiple devices/channels can map to the same session, but history is not fully
|
Multiple devices/providers can map to the same session, but history is not fully
|
||||||
synced back to every client. Recommendation: use one primary device for long
|
synced back to every client. Recommendation: use one primary device for long
|
||||||
conversations to avoid divergent context. The Control UI and TUI always show the
|
conversations to avoid divergent context. The Control UI and TUI always show the
|
||||||
gateway-backed session transcript, so they are the source of truth.
|
gateway-backed session transcript, so they are the source of truth.
|
||||||
@@ -50,28 +50,28 @@ Details: [Session management](/concepts/session).
|
|||||||
## Inbound bodies and history context
|
## Inbound bodies and history context
|
||||||
|
|
||||||
Clawdbot separates the **prompt body** from the **command body**:
|
Clawdbot separates the **prompt body** from the **command body**:
|
||||||
- `Body`: prompt text sent to the agent. This may include channel envelopes and
|
- `Body`: prompt text sent to the agent. This may include provider envelopes and
|
||||||
optional history wrappers.
|
optional history wrappers.
|
||||||
- `CommandBody`: raw user text for directive/command parsing.
|
- `CommandBody`: raw user text for directive/command parsing.
|
||||||
- `RawBody`: legacy alias for `CommandBody` (kept for compatibility).
|
- `RawBody`: legacy alias for `CommandBody` (kept for compatibility).
|
||||||
|
|
||||||
When a channel supplies history, it uses a shared wrapper:
|
When a provider supplies history, it uses a shared wrapper:
|
||||||
- `[Chat messages since your last reply - for context]`
|
- `[Chat messages since your last reply - for context]`
|
||||||
- `[Current message - respond to this]`
|
- `[Current message - respond to this]`
|
||||||
|
|
||||||
Directive stripping only applies to the **current message** section so history
|
Directive stripping only applies to the **current message** section so history
|
||||||
remains intact. Channels that wrap history should set `CommandBody` (or
|
remains intact. Providers that wrap history should set `CommandBody` (or
|
||||||
`RawBody`) to the original message text and keep `Body` as the combined prompt.
|
`RawBody`) to the original message text and keep `Body` as the combined prompt.
|
||||||
History buffers are configurable via `messages.groupChat.historyLimit` (global
|
History buffers are configurable via `messages.groupChat.historyLimit` (global
|
||||||
default) and per-channel overrides like `channels.slack.historyLimit` or
|
default) and per-provider overrides like `slack.historyLimit` or
|
||||||
`channels.telegram.accounts.<id>.historyLimit` (set `0` to disable).
|
`telegram.accounts.<id>.historyLimit` (set `0` to disable).
|
||||||
|
|
||||||
## Queueing and followups
|
## Queueing and followups
|
||||||
|
|
||||||
If a run is already active, inbound messages can be queued, steered into the
|
If a run is already active, inbound messages can be queued, steered into the
|
||||||
current run, or collected for a followup turn.
|
current run, or collected for a followup turn.
|
||||||
|
|
||||||
- Configure via `messages.queue` (and `messages.queue.byChannel`).
|
- Configure via `messages.queue` (and `messages.queue.byProvider`).
|
||||||
- Modes: `interrupt`, `steer`, `followup`, `collect`, plus backlog variants.
|
- Modes: `interrupt`, `steer`, `followup`, `collect`, plus backlog variants.
|
||||||
|
|
||||||
Details: [Queueing](/concepts/queue).
|
Details: [Queueing](/concepts/queue).
|
||||||
@@ -79,7 +79,7 @@ Details: [Queueing](/concepts/queue).
|
|||||||
## Streaming, chunking, and batching
|
## Streaming, chunking, and batching
|
||||||
|
|
||||||
Block streaming sends partial replies as the model produces text blocks.
|
Block streaming sends partial replies as the model produces text blocks.
|
||||||
Chunking respects channel text limits and avoids splitting fenced code.
|
Chunking respects provider text limits and avoids splitting fenced code.
|
||||||
|
|
||||||
Key settings:
|
Key settings:
|
||||||
- `agents.defaults.blockStreamingDefault` (`on|off`, default off)
|
- `agents.defaults.blockStreamingDefault` (`on|off`, default off)
|
||||||
@@ -87,7 +87,7 @@ Key settings:
|
|||||||
- `agents.defaults.blockStreamingChunk` (`minChars|maxChars|breakPreference`)
|
- `agents.defaults.blockStreamingChunk` (`minChars|maxChars|breakPreference`)
|
||||||
- `agents.defaults.blockStreamingCoalesce` (idle-based batching)
|
- `agents.defaults.blockStreamingCoalesce` (idle-based batching)
|
||||||
- `agents.defaults.humanDelay` (human-like pause between block replies)
|
- `agents.defaults.humanDelay` (human-like pause between block replies)
|
||||||
- Channel overrides: `*.blockStreaming` and `*.blockStreamingCoalesce` (non-Telegram channels require explicit `*.blockStreaming: true`)
|
- Provider overrides: `*.blockStreaming` and `*.blockStreamingCoalesce` (non-Telegram providers require explicit `*.blockStreaming: true`)
|
||||||
|
|
||||||
Details: [Streaming + chunking](/concepts/streaming).
|
Details: [Streaming + chunking](/concepts/streaming).
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ Details: [Thinking + reasoning directives](/tools/thinking) and [Token use](/tok
|
|||||||
## Prefixes, threading, and replies
|
## Prefixes, threading, and replies
|
||||||
|
|
||||||
Outbound message formatting is centralized in `messages`:
|
Outbound message formatting is centralized in `messages`:
|
||||||
- `messages.responsePrefix` (outbound prefix) and `channels.whatsapp.messagePrefix` (WhatsApp inbound prefix)
|
- `messages.responsePrefix` (outbound prefix) and `whatsapp.messagePrefix` (WhatsApp inbound prefix)
|
||||||
- Reply threading via `replyToMode` and per-channel defaults
|
- Reply threading via `replyToMode` and per-provider defaults
|
||||||
|
|
||||||
Details: [Configuration](/gateway/configuration#messages) and channel docs.
|
Details: [Configuration](/gateway/configuration#messages) and provider docs.
|
||||||
@@ -6,7 +6,7 @@ read_when:
|
|||||||
---
|
---
|
||||||
# Model providers
|
# Model providers
|
||||||
|
|
||||||
This page covers **LLM/model providers** (not chat channels like WhatsApp/Telegram).
|
This page covers **LLM/model providers** (not chat providers like WhatsApp/Telegram).
|
||||||
For model selection rules, see [/concepts/models](/concepts/models).
|
For model selection rules, see [/concepts/models](/concepts/models).
|
||||||
|
|
||||||
## Quick rules
|
## Quick rules
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ JSON includes `auth.oauth` (warn window + profiles) and `auth.providers`
|
|||||||
(effective auth per provider).
|
(effective auth per provider).
|
||||||
Use `--check` for automation (exit `1` when missing/expired, `2` when expiring).
|
Use `--check` for automation (exit `1` when missing/expired, `2` when expiring).
|
||||||
|
|
||||||
Preferred Anthropic auth is the Claude Code CLI setup-token (run on the gateway host):
|
Preferred Anthropic auth is the Claude CLI setup-token (run on the gateway host):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
claude setup-token
|
claude setup-token
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
summary: "Multi-agent routing: isolated agents, channel accounts, and bindings"
|
summary: "Multi-agent routing: isolated agents, provider accounts, and bindings"
|
||||||
title: Multi-Agent Routing
|
title: Multi-Agent Routing
|
||||||
read_when: "You want multiple isolated agents (workspaces + auth) in one gateway process."
|
read_when: "You want multiple isolated agents (workspaces + auth) in one gateway process."
|
||||||
status: active
|
status: active
|
||||||
@@ -7,7 +7,7 @@ status: active
|
|||||||
|
|
||||||
# Multi-Agent Routing
|
# Multi-Agent Routing
|
||||||
|
|
||||||
Goal: multiple *isolated* agents (separate workspace + `agentDir` + sessions), plus multiple channel accounts (e.g. two WhatsApps) in one running Gateway. Inbound is routed to an agent via bindings.
|
Goal: multiple *isolated* agents (separate workspace + `agentDir` + sessions), plus multiple provider accounts (e.g. two WhatsApps) in one running Gateway. Inbound is routed to an agent via bindings.
|
||||||
|
|
||||||
## What is “one agent”?
|
## What is “one agent”?
|
||||||
|
|
||||||
@@ -17,16 +17,6 @@ An **agent** is a fully scoped brain with its own:
|
|||||||
- **State directory** (`agentDir`) for auth profiles, model registry, and per-agent config.
|
- **State directory** (`agentDir`) for auth profiles, model registry, and per-agent config.
|
||||||
- **Session store** (chat history + routing state) under `~/.clawdbot/agents/<agentId>/sessions`.
|
- **Session store** (chat history + routing state) under `~/.clawdbot/agents/<agentId>/sessions`.
|
||||||
|
|
||||||
Auth profiles are **per-agent**. Each agent reads from its own:
|
|
||||||
|
|
||||||
```
|
|
||||||
~/.clawdbot/agents/<agentId>/agent/auth-profiles.json
|
|
||||||
```
|
|
||||||
|
|
||||||
Main agent credentials are **not** shared automatically. Never reuse `agentDir`
|
|
||||||
across agents (it causes auth/session collisions). If you want to share creds,
|
|
||||||
copy `auth-profiles.json` into the other agent's `agentDir`.
|
|
||||||
|
|
||||||
Skills are per-agent via each workspace’s `skills/` folder, with shared skills
|
Skills are per-agent via each workspace’s `skills/` folder, with shared skills
|
||||||
available from `~/.clawdbot/skills`. See [Skills: per-agent vs shared](/tools/skills#per-agent-vs-shared-skills).
|
available from `~/.clawdbot/skills`. See [Skills: per-agent vs shared](/tools/skills#per-agent-vs-shared-skills).
|
||||||
|
|
||||||
@@ -74,7 +64,7 @@ clawdbot agents list --bindings
|
|||||||
|
|
||||||
With **multiple agents**, each `agentId` becomes a **fully isolated persona**:
|
With **multiple agents**, each `agentId` becomes a **fully isolated persona**:
|
||||||
|
|
||||||
- **Different phone numbers/accounts** (per channel `accountId`).
|
- **Different phone numbers/accounts** (per provider `accountId`).
|
||||||
- **Different personalities** (per-agent workspace files like `AGENTS.md` and `SOUL.md`).
|
- **Different personalities** (per-agent workspace files like `AGENTS.md` and `SOUL.md`).
|
||||||
- **Separate auth + sessions** (no cross-talk unless explicitly enabled).
|
- **Separate auth + sessions** (no cross-talk unless explicitly enabled).
|
||||||
|
|
||||||
@@ -97,16 +87,14 @@ Example:
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
bindings: [
|
bindings: [
|
||||||
{ agentId: "alex", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551230001" } } },
|
{ agentId: "alex", match: { provider: "whatsapp", peer: { kind: "dm", id: "+15551230001" } } },
|
||||||
{ agentId: "mia", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551230002" } } }
|
{ agentId: "mia", match: { provider: "whatsapp", peer: { kind: "dm", id: "+15551230002" } } }
|
||||||
],
|
],
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
dmPolicy: "allowlist",
|
dmPolicy: "allowlist",
|
||||||
allowFrom: ["+15551230001", "+15551230002"]
|
allowFrom: ["+15551230001", "+15551230002"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
@@ -120,21 +108,21 @@ Bindings are **deterministic** and **most-specific wins**:
|
|||||||
1. `peer` match (exact DM/group/channel id)
|
1. `peer` match (exact DM/group/channel id)
|
||||||
2. `guildId` (Discord)
|
2. `guildId` (Discord)
|
||||||
3. `teamId` (Slack)
|
3. `teamId` (Slack)
|
||||||
4. `accountId` match for a channel
|
4. `accountId` match for a provider
|
||||||
5. channel-level match (`accountId: "*"`)
|
5. provider-level match (`accountId: "*"`)
|
||||||
6. fallback to default agent (`agents.list[].default`, else first list entry, default: `main`)
|
6. fallback to default agent (`agents.list[].default`, else first list entry, default: `main`)
|
||||||
|
|
||||||
## Multiple accounts / phone numbers
|
## Multiple accounts / phone numbers
|
||||||
|
|
||||||
Channels that support **multiple accounts** (e.g. WhatsApp) use `accountId` to identify
|
Providers that support **multiple accounts** (e.g. WhatsApp) use `accountId` to identify
|
||||||
each login. Each `accountId` can be routed to a different agent, so one server can host
|
each login. Each `accountId` can be routed to a different agent, so one server can host
|
||||||
multiple phone numbers without mixing sessions.
|
multiple phone numbers without mixing sessions.
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- `agentId`: one “brain” (workspace, per-agent auth, per-agent session store).
|
- `agentId`: one “brain” (workspace, per-agent auth, per-agent session store).
|
||||||
- `accountId`: one channel account instance (e.g. WhatsApp account `"personal"` vs `"biz"`).
|
- `accountId`: one provider account instance (e.g. WhatsApp account `"personal"` vs `"biz"`).
|
||||||
- `binding`: routes inbound messages to an `agentId` by `(channel, accountId, peer)` and optionally guild/team ids.
|
- `binding`: routes inbound messages to an `agentId` by `(provider, accountId, peer)` and optionally guild/team ids.
|
||||||
- Direct chats collapse to `agent:<agentId>:<mainKey>` (per-agent “main”; `session.mainKey`).
|
- Direct chats collapse to `agent:<agentId>:<mainKey>` (per-agent “main”; `session.mainKey`).
|
||||||
|
|
||||||
## Example: two WhatsApps → two agents
|
## Example: two WhatsApps → two agents
|
||||||
@@ -163,14 +151,14 @@ multiple phone numbers without mixing sessions.
|
|||||||
|
|
||||||
// Deterministic routing: first match wins (most-specific first).
|
// Deterministic routing: first match wins (most-specific first).
|
||||||
bindings: [
|
bindings: [
|
||||||
{ agentId: "home", match: { channel: "whatsapp", accountId: "personal" } },
|
{ agentId: "home", match: { provider: "whatsapp", accountId: "personal" } },
|
||||||
{ agentId: "work", match: { channel: "whatsapp", accountId: "biz" } },
|
{ agentId: "work", match: { provider: "whatsapp", accountId: "biz" } },
|
||||||
|
|
||||||
// Optional per-peer override (example: send a specific group to work agent).
|
// Optional per-peer override (example: send a specific group to work agent).
|
||||||
{
|
{
|
||||||
agentId: "work",
|
agentId: "work",
|
||||||
match: {
|
match: {
|
||||||
channel: "whatsapp",
|
provider: "whatsapp",
|
||||||
accountId: "personal",
|
accountId: "personal",
|
||||||
peer: { kind: "group", id: "1203630...@g.us" },
|
peer: { kind: "group", id: "1203630...@g.us" },
|
||||||
},
|
},
|
||||||
@@ -185,7 +173,6 @@ multiple phone numbers without mixing sessions.
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
accounts: {
|
accounts: {
|
||||||
personal: {
|
personal: {
|
||||||
@@ -198,13 +185,12 @@ multiple phone numbers without mixing sessions.
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example: WhatsApp daily chat + Telegram deep work
|
## Example: WhatsApp daily chat + Telegram deep work
|
||||||
|
|
||||||
Split by channel: route WhatsApp to a fast everyday agent and Telegram to an Opus agent.
|
Split by provider: route WhatsApp to a fast everyday agent and Telegram to an Opus agent.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
@@ -225,17 +211,17 @@ Split by channel: route WhatsApp to a fast everyday agent and Telegram to an Opu
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
bindings: [
|
bindings: [
|
||||||
{ agentId: "chat", match: { channel: "whatsapp" } },
|
{ agentId: "chat", match: { provider: "whatsapp" } },
|
||||||
{ agentId: "opus", match: { channel: "telegram" } }
|
{ agentId: "opus", match: { provider: "telegram" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- If you have multiple accounts for a channel, add `accountId` to the binding (for example `{ channel: "whatsapp", accountId: "personal" }`).
|
- If you have multiple accounts for a provider, add `accountId` to the binding (for example `{ provider: "whatsapp", accountId: "personal" }`).
|
||||||
- To route a single DM/group to Opus while keeping the rest on chat, add a `match.peer` binding for that peer; peer matches always win over channel-wide rules.
|
- To route a single DM/group to Opus while keeping the rest on chat, add a `match.peer` binding for that peer; peer matches always win over provider-wide rules.
|
||||||
|
|
||||||
## Example: same channel, one peer to Opus
|
## Example: same provider, one peer to Opus
|
||||||
|
|
||||||
Keep WhatsApp on the fast agent, but route one DM to Opus:
|
Keep WhatsApp on the fast agent, but route one DM to Opus:
|
||||||
|
|
||||||
@@ -248,13 +234,13 @@ Keep WhatsApp on the fast agent, but route one DM to Opus:
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
bindings: [
|
bindings: [
|
||||||
{ agentId: "opus", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551234567" } } },
|
{ agentId: "opus", match: { provider: "whatsapp", peer: { kind: "dm", id: "+15551234567" } } },
|
||||||
{ agentId: "chat", match: { channel: "whatsapp" } }
|
{ agentId: "chat", match: { provider: "whatsapp" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Peer bindings always win, so keep them above the channel-wide rule.
|
Peer bindings always win, so keep them above the provider-wide rule.
|
||||||
|
|
||||||
## Per-Agent Sandbox and Tool Configuration
|
## Per-Agent Sandbox and Tool Configuration
|
||||||
|
|
||||||
|
|||||||
@@ -56,13 +56,13 @@ How to verify:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot models status
|
clawdbot models status
|
||||||
clawdbot channels list
|
clawdbot providers list
|
||||||
```
|
```
|
||||||
|
|
||||||
Or JSON:
|
Or JSON:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot channels list --json
|
clawdbot providers list --json
|
||||||
```
|
```
|
||||||
|
|
||||||
## OAuth exchange (how login works)
|
## OAuth exchange (how login works)
|
||||||
@@ -148,7 +148,7 @@ Example (session override):
|
|||||||
- `/model Opus@anthropic:work`
|
- `/model Opus@anthropic:work`
|
||||||
|
|
||||||
How to see what profile IDs exist:
|
How to see what profile IDs exist:
|
||||||
- `clawdbot channels list --json` (shows `auth[]`)
|
- `clawdbot providers list --json` (shows `auth[]`)
|
||||||
|
|
||||||
Related docs:
|
Related docs:
|
||||||
- [/concepts/model-failover](/concepts/model-failover) (rotation + cooldown rules)
|
- [/concepts/model-failover](/concepts/model-failover) (rotation + cooldown rules)
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
summary: "Routing rules per channel (WhatsApp, Telegram, Discord, Slack) and shared context"
|
summary: "Routing rules per provider (WhatsApp, Telegram, Discord, Slack) and shared context"
|
||||||
read_when:
|
read_when:
|
||||||
- Changing channel routing or inbox behavior
|
- Changing provider routing or inbox behavior
|
||||||
---
|
---
|
||||||
# Channels & routing
|
# Providers & routing
|
||||||
|
|
||||||
|
|
||||||
Clawdbot routes replies **back to the channel where a message came from**. The
|
Clawdbot routes replies **back to the provider where a message came from**. The
|
||||||
model does not choose a channel; routing is deterministic and controlled by the
|
model does not choose a provider; routing is deterministic and controlled by the
|
||||||
host configuration.
|
host configuration.
|
||||||
|
|
||||||
## Key terms
|
## Key terms
|
||||||
|
|
||||||
- **Channel**: `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `webchat`.
|
- **Provider**: `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `webchat`.
|
||||||
- **AccountId**: per‑channel account instance (when supported).
|
- **AccountId**: per‑provider account instance (when supported).
|
||||||
- **AgentId**: an isolated workspace + session store (“brain”).
|
- **AgentId**: an isolated workspace + session store (“brain”).
|
||||||
- **SessionKey**: the bucket key used to store context and control concurrency.
|
- **SessionKey**: the bucket key used to store context and control concurrency.
|
||||||
|
|
||||||
@@ -23,10 +23,10 @@ Direct messages collapse to the agent’s **main** session:
|
|||||||
|
|
||||||
- `agent:<agentId>:<mainKey>` (default: `agent:main:main`)
|
- `agent:<agentId>:<mainKey>` (default: `agent:main:main`)
|
||||||
|
|
||||||
Groups and channels remain isolated per channel:
|
Groups and channels remain isolated per provider:
|
||||||
|
|
||||||
- Groups: `agent:<agentId>:<channel>:group:<id>`
|
- Groups: `agent:<agentId>:<provider>:group:<id>`
|
||||||
- Channels/rooms: `agent:<agentId>:<channel>:channel:<id>`
|
- Channels/rooms: `agent:<agentId>:<provider>:channel:<id>`
|
||||||
|
|
||||||
Threads:
|
Threads:
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ Routing picks **one agent** for each inbound message:
|
|||||||
1. **Exact peer match** (`bindings` with `peer.kind` + `peer.id`).
|
1. **Exact peer match** (`bindings` with `peer.kind` + `peer.id`).
|
||||||
2. **Guild match** (Discord) via `guildId`.
|
2. **Guild match** (Discord) via `guildId`.
|
||||||
3. **Team match** (Slack) via `teamId`.
|
3. **Team match** (Slack) via `teamId`.
|
||||||
4. **Account match** (`accountId` on the channel).
|
4. **Account match** (`accountId` on the provider).
|
||||||
5. **Channel match** (any account on that channel).
|
5. **Provider match** (any account on that provider).
|
||||||
6. **Default agent** (`agents.list[].default`, else first list entry, fallback to `main`).
|
6. **Default agent** (`agents.list[].default`, else first list entry, fallback to `main`).
|
||||||
|
|
||||||
The matched agent determines which workspace and session store are used.
|
The matched agent determines which workspace and session store are used.
|
||||||
@@ -72,7 +72,7 @@ See: [Broadcast Groups](/broadcast-groups).
|
|||||||
## Config overview
|
## Config overview
|
||||||
|
|
||||||
- `agents.list`: named agent definitions (workspace, model, etc.).
|
- `agents.list`: named agent definitions (workspace, model, etc.).
|
||||||
- `bindings`: map inbound channels/accounts/peers to agents.
|
- `bindings`: map inbound providers/accounts/peers to agents.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ Example:
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
bindings: [
|
bindings: [
|
||||||
{ match: { channel: "slack", teamId: "T123" }, agentId: "support" },
|
{ match: { provider: "slack", teamId: "T123" }, agentId: "support" },
|
||||||
{ match: { channel: "telegram", peer: { kind: "group", id: "-100123" } }, agentId: "support" }
|
{ match: { provider: "telegram", peer: { kind: "group", id: "-100123" } }, agentId: "support" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -102,7 +102,7 @@ You can override the store path via `session.store` and `{agentId}` templating.
|
|||||||
## WebChat behavior
|
## WebChat behavior
|
||||||
|
|
||||||
WebChat attaches to the **selected agent** and defaults to the agent’s main
|
WebChat attaches to the **selected agent** and defaults to the agent’s main
|
||||||
session. Because of this, WebChat lets you see cross‑channel context for that
|
session. Because of this, WebChat lets you see cross‑provider context for that
|
||||||
agent in one place.
|
agent in one place.
|
||||||
|
|
||||||
## Reply context
|
## Reply context
|
||||||
@@ -111,4 +111,4 @@ Inbound replies include:
|
|||||||
- `ReplyToId`, `ReplyToBody`, and `ReplyToSender` when available.
|
- `ReplyToId`, `ReplyToBody`, and `ReplyToSender` when available.
|
||||||
- Quoted context is appended to `Body` as a `[Replying to ...]` block.
|
- Quoted context is appended to `Body` as a `[Replying to ...]` block.
|
||||||
|
|
||||||
This is consistent across channels.
|
This is consistent across providers.
|
||||||
@@ -18,7 +18,7 @@ We now serialize command-based auto-replies (WhatsApp Web listener) through a ti
|
|||||||
- When verbose logging is enabled, queued commands emit a short notice if they waited more than ~2s before starting.
|
- When verbose logging is enabled, queued commands emit a short notice if they waited more than ~2s before starting.
|
||||||
- Typing indicators (`onReplyStart`) still fire immediately on enqueue so user experience is unchanged while we wait our turn.
|
- Typing indicators (`onReplyStart`) still fire immediately on enqueue so user experience is unchanged while we wait our turn.
|
||||||
|
|
||||||
## Queue modes (per channel)
|
## Queue modes (per provider)
|
||||||
Inbound messages can steer the current run, wait for a followup turn, or do both:
|
Inbound messages can steer the current run, wait for a followup turn, or do both:
|
||||||
- `steer`: inject immediately into the current run (cancels pending tool calls after the next tool boundary). If not streaming, falls back to followup.
|
- `steer`: inject immediately into the current run (cancels pending tool calls after the next tool boundary). If not streaming, falls back to followup.
|
||||||
- `followup`: enqueue for the next agent turn after the current run ends.
|
- `followup`: enqueue for the next agent turn after the current run ends.
|
||||||
@@ -30,12 +30,12 @@ Inbound messages can steer the current run, wait for a followup turn, or do both
|
|||||||
Steer-backlog means you can get a followup response after the steered run, so
|
Steer-backlog means you can get a followup response after the steered run, so
|
||||||
streaming surfaces can look like duplicates. Prefer `collect`/`steer` if you want
|
streaming surfaces can look like duplicates. Prefer `collect`/`steer` if you want
|
||||||
one response per inbound message.
|
one response per inbound message.
|
||||||
Send `/queue collect` as a standalone command (per-session) or set `messages.queue.byChannel.discord: "collect"`.
|
Send `/queue collect` as a standalone command (per-session) or set `messages.queue.byProvider.discord: "collect"`.
|
||||||
|
|
||||||
Defaults (when unset in config):
|
Defaults (when unset in config):
|
||||||
- All surfaces → `collect`
|
- All surfaces → `collect`
|
||||||
|
|
||||||
Configure globally or per channel via `messages.queue`:
|
Configure globally or per provider via `messages.queue`:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ Configure globally or per channel via `messages.queue`:
|
|||||||
debounceMs: 1000,
|
debounceMs: 1000,
|
||||||
cap: 20,
|
cap: 20,
|
||||||
drop: "summarize",
|
drop: "summarize",
|
||||||
byChannel: { discord: "collect" }
|
byProvider: { discord: "collect" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ Set retry policy per provider in `~/.clawdbot/clawdbot.json`:
|
|||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
telegram: {
|
telegram: {
|
||||||
retry: {
|
retry: {
|
||||||
attempts: 3,
|
attempts: 3,
|
||||||
@@ -52,7 +51,6 @@ Set retry policy per provider in `~/.clawdbot/clawdbot.json`:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Goal: small, hard-to-misuse tool set so agents can list sessions, fetch history,
|
|||||||
|
|
||||||
## Key Model
|
## Key Model
|
||||||
- Main direct chat bucket is always the literal key `"main"` (resolved to the current agent’s main key).
|
- Main direct chat bucket is always the literal key `"main"` (resolved to the current agent’s main key).
|
||||||
- Group chats use `agent:<agentId>:<channel>:group:<id>` or `agent:<agentId>:<channel>:channel:<id>` (pass the full key).
|
- Group chats use `agent:<agentId>:<provider>:group:<id>` or `agent:<agentId>:<provider>:channel:<id>` (pass the full key).
|
||||||
- Cron jobs use `cron:<job.id>`.
|
- Cron jobs use `cron:<job.id>`.
|
||||||
- Hooks use `hook:<uuid>` unless explicitly set.
|
- Hooks use `hook:<uuid>` unless explicitly set.
|
||||||
- Node bridge uses `node-<nodeId>` unless explicitly set.
|
- Node bridge uses `node-<nodeId>` unless explicitly set.
|
||||||
@@ -40,14 +40,14 @@ Behavior:
|
|||||||
Row shape (JSON):
|
Row shape (JSON):
|
||||||
- `key`: session key (string)
|
- `key`: session key (string)
|
||||||
- `kind`: `main | group | cron | hook | node | other`
|
- `kind`: `main | group | cron | hook | node | other`
|
||||||
- `channel`: `whatsapp | telegram | discord | signal | imessage | webchat | internal | unknown`
|
- `provider`: `whatsapp | telegram | discord | signal | imessage | webchat | internal | unknown`
|
||||||
- `displayName` (group display label if available)
|
- `displayName` (group display label if available)
|
||||||
- `updatedAt` (ms)
|
- `updatedAt` (ms)
|
||||||
- `sessionId`
|
- `sessionId`
|
||||||
- `model`, `contextTokens`, `totalTokens`
|
- `model`, `contextTokens`, `totalTokens`
|
||||||
- `thinkingLevel`, `verboseLevel`, `systemSent`, `abortedLastRun`
|
- `thinkingLevel`, `verboseLevel`, `systemSent`, `abortedLastRun`
|
||||||
- `sendPolicy` (session override if set)
|
- `sendPolicy` (session override if set)
|
||||||
- `lastChannel`, `lastTo`
|
- `lastProvider`, `lastTo`
|
||||||
- `transcriptPath` (best-effort path derived from store dir + sessionId)
|
- `transcriptPath` (best-effort path derived from store dir + sessionId)
|
||||||
- `messages?` (only when `messageLimit > 0`)
|
- `messages?` (only when `messageLimit > 0`)
|
||||||
|
|
||||||
@@ -85,17 +85,17 @@ Behavior:
|
|||||||
- Max turns is `session.agentToAgent.maxPingPongTurns` (0–5, default 5).
|
- Max turns is `session.agentToAgent.maxPingPongTurns` (0–5, default 5).
|
||||||
- Once the loop ends, Clawdbot runs the **agent‑to‑agent announce step** (target agent only):
|
- Once the loop ends, Clawdbot runs the **agent‑to‑agent announce step** (target agent only):
|
||||||
- Reply exactly `ANNOUNCE_SKIP` to stay silent.
|
- Reply exactly `ANNOUNCE_SKIP` to stay silent.
|
||||||
- Any other reply is sent to the target channel.
|
- Any other reply is sent to the target provider.
|
||||||
- Announce step includes the original request + round‑1 reply + latest ping‑pong reply.
|
- Announce step includes the original request + round‑1 reply + latest ping‑pong reply.
|
||||||
|
|
||||||
## Channel Field
|
## Provider Field
|
||||||
- For groups, `channel` is the channel recorded on the session entry.
|
- For groups, `provider` is the provider recorded on the session entry.
|
||||||
- For direct chats, `channel` maps from `lastChannel`.
|
- For direct chats, `provider` maps from `lastProvider`.
|
||||||
- For cron/hook/node, `channel` is `internal`.
|
- For cron/hook/node, `provider` is `internal`.
|
||||||
- If missing, `channel` is `unknown`.
|
- If missing, `provider` is `unknown`.
|
||||||
|
|
||||||
## Security / Send Policy
|
## Security / Send Policy
|
||||||
Policy-based blocking by channel/chat type (not per session id).
|
Policy-based blocking by provider/chat type (not per session id).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ Policy-based blocking by channel/chat type (not per session id).
|
|||||||
"sendPolicy": {
|
"sendPolicy": {
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"match": { "channel": "discord", "chatType": "group" },
|
"match": { "provider": "discord", "chatType": "group" },
|
||||||
"action": "deny"
|
"action": "deny"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -122,7 +122,7 @@ Enforcement points:
|
|||||||
- auto-reply delivery logic
|
- auto-reply delivery logic
|
||||||
|
|
||||||
## sessions_spawn
|
## sessions_spawn
|
||||||
Spawn a sub-agent run in an isolated session and announce the result back to the requester chat channel.
|
Spawn a sub-agent run in an isolated session and announce the result back to the requester chat provider.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- `task` (required)
|
- `task` (required)
|
||||||
@@ -143,9 +143,8 @@ Behavior:
|
|||||||
- Sub-agents default to the full tool set **minus session tools** (configurable via `tools.subagents.tools`).
|
- Sub-agents default to the full tool set **minus session tools** (configurable via `tools.subagents.tools`).
|
||||||
- Sub-agents are not allowed to call `sessions_spawn` (no sub-agent → sub-agent spawning).
|
- Sub-agents are not allowed to call `sessions_spawn` (no sub-agent → sub-agent spawning).
|
||||||
- Always non-blocking: returns `{ status: "accepted", runId, childSessionKey }` immediately.
|
- Always non-blocking: returns `{ status: "accepted", runId, childSessionKey }` immediately.
|
||||||
- After completion, Clawdbot runs a sub-agent **announce step** and posts the result to the requester chat channel.
|
- After completion, Clawdbot runs a sub-agent **announce step** and posts the result to the requester chat provider.
|
||||||
- Reply exactly `ANNOUNCE_SKIP` during the announce step to stay silent.
|
- Reply exactly `ANNOUNCE_SKIP` during the announce step to stay silent.
|
||||||
- Announce replies are normalized to `Status`/`Result`/`Notes`; `Status` comes from runtime outcome (not model text).
|
|
||||||
- Sub-agent sessions are auto-archived after `agents.defaults.subagents.archiveAfterMinutes` (default: 60).
|
- Sub-agent sessions are auto-archived after `agents.defaults.subagents.archiveAfterMinutes` (default: 60).
|
||||||
- Announce replies include a stats line (runtime, tokens, sessionKey/sessionId, transcript path, and optional cost).
|
- Announce replies include a stats line (runtime, tokens, sessionKey/sessionId, transcript path, and optional cost).
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ All session state is **owned by the gateway** (the “master” Clawdbot). UI cl
|
|||||||
- Store file: `~/.clawdbot/agents/<agentId>/sessions/sessions.json` (per agent).
|
- Store file: `~/.clawdbot/agents/<agentId>/sessions/sessions.json` (per agent).
|
||||||
- Transcripts: `~/.clawdbot/agents/<agentId>/sessions/<SessionId>.jsonl` (Telegram topic sessions use `.../<SessionId>-topic-<threadId>.jsonl`).
|
- Transcripts: `~/.clawdbot/agents/<agentId>/sessions/<SessionId>.jsonl` (Telegram topic sessions use `.../<SessionId>-topic-<threadId>.jsonl`).
|
||||||
- The store is a map `sessionKey -> { sessionId, updatedAt, ... }`. Deleting entries is safe; they are recreated on demand.
|
- The store is a map `sessionKey -> { sessionId, updatedAt, ... }`. Deleting entries is safe; they are recreated on demand.
|
||||||
- Group entries may include `displayName`, `channel`, `subject`, `room`, and `space` to label sessions in UIs.
|
- Group entries may include `displayName`, `provider`, `subject`, `room`, and `space` to label sessions in UIs.
|
||||||
- Clawdbot does **not** read legacy Pi/Tau session folders.
|
- Clawdbot does **not** read legacy Pi/Tau session folders.
|
||||||
|
|
||||||
## Session pruning
|
## Session pruning
|
||||||
@@ -33,11 +33,11 @@ the workspace is writable. See [Memory](/concepts/memory) and
|
|||||||
|
|
||||||
## Mapping transports → session keys
|
## Mapping transports → session keys
|
||||||
- Direct chats collapse to the per-agent primary key: `agent:<agentId>:<mainKey>`.
|
- Direct chats collapse to the per-agent primary key: `agent:<agentId>:<mainKey>`.
|
||||||
- Multiple phone numbers and channels can map to the same agent main key; they act as transports into one conversation.
|
- Multiple phone numbers and providers can map to the same agent main key; they act as transports into one conversation.
|
||||||
- Group chats isolate state: `agent:<agentId>:<channel>:group:<id>` (rooms/channels use `agent:<agentId>:<channel>:channel:<id>`).
|
- Group chats isolate state: `agent:<agentId>:<provider>:group:<id>` (rooms/channels use `agent:<agentId>:<provider>:channel:<id>`).
|
||||||
- Telegram forum topics append `:topic:<threadId>` to the group id for isolation.
|
- Telegram forum topics append `:topic:<threadId>` to the group id for isolation.
|
||||||
- Legacy `group:<id>` keys are still recognized for migration.
|
- Legacy `group:<id>` keys are still recognized for migration.
|
||||||
- Inbound contexts may still use `group:<id>`; the channel is inferred from `Provider` and normalized to the canonical `agent:<agentId>:<channel>:group:<id>` form.
|
- Inbound contexts may still use `group:<id>`; the provider is inferred from `Provider` and normalized to the canonical `agent:<agentId>:<provider>:group:<id>` form.
|
||||||
- Other sources:
|
- Other sources:
|
||||||
- Cron jobs: `cron:<job.id>`
|
- Cron jobs: `cron:<job.id>`
|
||||||
- Webhooks: `hook:<uuid>` (unless explicitly set by the hook)
|
- Webhooks: `hook:<uuid>` (unless explicitly set by the hook)
|
||||||
@@ -56,7 +56,7 @@ Block delivery for specific session types without listing individual ids.
|
|||||||
session: {
|
session: {
|
||||||
sendPolicy: {
|
sendPolicy: {
|
||||||
rules: [
|
rules: [
|
||||||
{ action: "deny", match: { channel: "discord", chatType: "group" } },
|
{ action: "deny", match: { provider: "discord", chatType: "group" } },
|
||||||
{ action: "deny", match: { keyPrefix: "cron:" } }
|
{ action: "deny", match: { keyPrefix: "cron:" } }
|
||||||
],
|
],
|
||||||
default: "allow"
|
default: "allow"
|
||||||
@@ -90,7 +90,6 @@ Send these as standalone messages so they register.
|
|||||||
- `pnpm clawdbot sessions --json` — dumps every entry (filter with `--active <minutes>`).
|
- `pnpm clawdbot sessions --json` — dumps every entry (filter with `--active <minutes>`).
|
||||||
- `clawdbot gateway call sessions.list --params '{}'` — fetch sessions from the running gateway (use `--url`/`--token` for remote gateway access).
|
- `clawdbot gateway call sessions.list --params '{}'` — fetch sessions from the running gateway (use `--url`/`--token` for remote gateway access).
|
||||||
- Send `/status` as a standalone message in chat to see whether the agent is reachable, how much of the session context is used, current thinking/verbose toggles, and when your WhatsApp web creds were last refreshed (helps spot relink needs).
|
- Send `/status` as a standalone message in chat to see whether the agent is reachable, how much of the session context is used, current thinking/verbose toggles, and when your WhatsApp web creds were last refreshed (helps spot relink needs).
|
||||||
- Send `/context list` or `/context detail` to see what’s in the system prompt and injected workspace files (and the biggest context contributors).
|
|
||||||
- Send `/stop` as a standalone message to abort the current run.
|
- Send `/stop` as a standalone message to abort the current run.
|
||||||
- Send `/compact` (optional instructions) as a standalone message to summarize older context and free up window space. See [/concepts/compaction](/concepts/compaction).
|
- Send `/compact` (optional instructions) as a standalone message to summarize older context and free up window space. See [/concepts/compaction](/concepts/compaction).
|
||||||
- JSONL transcripts can be opened directly to review full turns.
|
- JSONL transcripts can be opened directly to review full turns.
|
||||||
|
|||||||
+19
-22
@@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
summary: "Streaming + chunking behavior (block replies, draft streaming, limits)"
|
summary: "Streaming + chunking behavior (block replies, draft streaming, limits)"
|
||||||
read_when:
|
read_when:
|
||||||
- Explaining how streaming or chunking works on channels
|
- Explaining how streaming or chunking works on providers
|
||||||
- Changing block streaming or channel chunking behavior
|
- Changing block streaming or provider chunking behavior
|
||||||
- Debugging duplicate/early block replies or draft streaming
|
- Debugging duplicate/early block replies or draft streaming
|
||||||
---
|
---
|
||||||
# Streaming + chunking
|
# Streaming + chunking
|
||||||
|
|
||||||
Clawdbot has two separate “streaming” layers:
|
Clawdbot has two separate “streaming” layers:
|
||||||
- **Block streaming (channels):** emit completed **blocks** as the assistant writes. These are normal channel messages (not token deltas).
|
- **Block streaming (providers):** emit completed **blocks** as the assistant writes. These are normal provider messages (not token deltas).
|
||||||
- **Token-ish streaming (Telegram only):** update a **draft bubble** with partial text while generating; final message is sent at the end.
|
- **Token-ish streaming (Telegram only):** update a **draft bubble** with partial text while generating; final message is sent at the end.
|
||||||
|
|
||||||
There is **no real token streaming** to external channel messages today. Telegram draft streaming is the only partial-stream surface.
|
There is **no real token streaming** to external provider messages today. Telegram draft streaming is the only partial-stream surface.
|
||||||
|
|
||||||
## Block streaming (channel messages)
|
## Block streaming (provider messages)
|
||||||
|
|
||||||
Block streaming sends assistant output in coarse chunks as it becomes available.
|
Block streaming sends assistant output in coarse chunks as it becomes available.
|
||||||
|
|
||||||
@@ -24,21 +24,21 @@ Model output
|
|||||||
│ └─ chunker emits blocks as buffer grows
|
│ └─ chunker emits blocks as buffer grows
|
||||||
└─ (blockStreamingBreak=message_end)
|
└─ (blockStreamingBreak=message_end)
|
||||||
└─ chunker flushes at message_end
|
└─ chunker flushes at message_end
|
||||||
└─ channel send (block replies)
|
└─ provider send (block replies)
|
||||||
```
|
```
|
||||||
Legend:
|
Legend:
|
||||||
- `text_delta/events`: model stream events (may be sparse for non-streaming models).
|
- `text_delta/events`: model stream events (may be sparse for non-streaming models).
|
||||||
- `chunker`: `EmbeddedBlockChunker` applying min/max bounds + break preference.
|
- `chunker`: `EmbeddedBlockChunker` applying min/max bounds + break preference.
|
||||||
- `channel send`: actual outbound messages (block replies).
|
- `provider send`: actual outbound messages (block replies).
|
||||||
|
|
||||||
**Controls:**
|
**Controls:**
|
||||||
- `agents.defaults.blockStreamingDefault`: `"on"`/`"off"` (default off).
|
- `agents.defaults.blockStreamingDefault`: `"on"`/`"off"` (default off).
|
||||||
- Channel overrides: `*.blockStreaming` (and per-account variants) to force `"on"`/`"off"` per channel.
|
- Provider overrides: `*.blockStreaming` (and per-account variants) to force `"on"`/`"off"` per provider.
|
||||||
- `agents.defaults.blockStreamingBreak`: `"text_end"` or `"message_end"`.
|
- `agents.defaults.blockStreamingBreak`: `"text_end"` or `"message_end"`.
|
||||||
- `agents.defaults.blockStreamingChunk`: `{ minChars, maxChars, breakPreference? }`.
|
- `agents.defaults.blockStreamingChunk`: `{ minChars, maxChars, breakPreference? }`.
|
||||||
- `agents.defaults.blockStreamingCoalesce`: `{ minChars?, maxChars?, idleMs? }` (merge streamed blocks before send).
|
- `agents.defaults.blockStreamingCoalesce`: `{ minChars?, maxChars?, idleMs? }` (merge streamed blocks before send).
|
||||||
- Channel hard cap: `*.textChunkLimit` (e.g., `channels.whatsapp.textChunkLimit`).
|
- Provider hard cap: `*.textChunkLimit` (e.g., `whatsapp.textChunkLimit`).
|
||||||
- Discord soft cap: `channels.discord.maxLinesPerMessage` (default 17) splits tall replies to avoid UI clipping.
|
- Discord soft cap: `discord.maxLinesPerMessage` (default 17) splits tall replies to avoid UI clipping.
|
||||||
|
|
||||||
**Boundary semantics:**
|
**Boundary semantics:**
|
||||||
- `text_end`: stream blocks as soon as chunker emits; flush on each `text_end`.
|
- `text_end`: stream blocks as soon as chunker emits; flush on each `text_end`.
|
||||||
@@ -54,7 +54,7 @@ Block chunking is implemented by `EmbeddedBlockChunker`:
|
|||||||
- **Break preference:** `paragraph` → `newline` → `sentence` → `whitespace` → hard break.
|
- **Break preference:** `paragraph` → `newline` → `sentence` → `whitespace` → hard break.
|
||||||
- **Code fences:** never split inside fences; when forced at `maxChars`, close + reopen the fence to keep Markdown valid.
|
- **Code fences:** never split inside fences; when forced at `maxChars`, close + reopen the fence to keep Markdown valid.
|
||||||
|
|
||||||
`maxChars` is clamped to the channel `textChunkLimit`, so you can’t exceed per-channel caps.
|
`maxChars` is clamped to the provider `textChunkLimit`, so you can’t exceed per-provider caps.
|
||||||
|
|
||||||
## Coalescing (merge streamed blocks)
|
## Coalescing (merge streamed blocks)
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ progressive output.
|
|||||||
(final flush always sends remaining text).
|
(final flush always sends remaining text).
|
||||||
- Joiner is derived from `blockStreamingChunk.breakPreference`
|
- Joiner is derived from `blockStreamingChunk.breakPreference`
|
||||||
(`paragraph` → `\n\n`, `newline` → `\n`, `sentence` → space).
|
(`paragraph` → `\n\n`, `newline` → `\n`, `sentence` → space).
|
||||||
- Channel overrides are available via `*.blockStreamingCoalesce` (including per-account configs).
|
- Provider overrides are available via `*.blockStreamingCoalesce` (including per-account configs).
|
||||||
- Default coalesce `minChars` is bumped to 1500 for Signal/Slack/Discord unless overridden.
|
- Default coalesce `minChars` is bumped to 1500 for Signal/Slack/Discord unless overridden.
|
||||||
|
|
||||||
## Human-like pacing between blocks
|
## Human-like pacing between blocks
|
||||||
@@ -84,27 +84,24 @@ more natural.
|
|||||||
## “Stream chunks or everything”
|
## “Stream chunks or everything”
|
||||||
|
|
||||||
This maps to:
|
This maps to:
|
||||||
- **Stream chunks:** `blockStreamingDefault: "on"` + `blockStreamingBreak: "text_end"` (emit as you go). Non-Telegram channels also need `*.blockStreaming: true`.
|
- **Stream chunks:** `blockStreamingDefault: "on"` + `blockStreamingBreak: "text_end"` (emit as you go). Non-Telegram providers also need `*.blockStreaming: true`.
|
||||||
- **Stream everything at end:** `blockStreamingBreak: "message_end"` (flush once, possibly multiple chunks if very long).
|
- **Stream everything at end:** `blockStreamingBreak: "message_end"` (flush once, possibly multiple chunks if very long).
|
||||||
- **No block streaming:** `blockStreamingDefault: "off"` (only final reply).
|
- **No block streaming:** `blockStreamingDefault: "off"` (only final reply).
|
||||||
|
|
||||||
**Channel note:** For non-Telegram channels, block streaming is **off unless**
|
**Provider note:** For non-Telegram providers, block streaming is **off unless**
|
||||||
`*.blockStreaming` is explicitly set to `true`. Telegram can stream drafts
|
`*.blockStreaming` is explicitly set to `true`. Telegram can stream drafts
|
||||||
(`channels.telegram.streamMode`) without block replies.
|
(`telegram.streamMode`) without block replies.
|
||||||
|
|
||||||
Config location reminder: the `blockStreaming*` defaults live under
|
|
||||||
`agents.defaults`, not the root config.
|
|
||||||
|
|
||||||
## Telegram draft streaming (token-ish)
|
## Telegram draft streaming (token-ish)
|
||||||
|
|
||||||
Telegram is the only channel with draft streaming:
|
Telegram is the only provider with draft streaming:
|
||||||
- Uses Bot API `sendMessageDraft` in **private chats with topics**.
|
- Uses Bot API `sendMessageDraft` in **private chats with topics**.
|
||||||
- `channels.telegram.streamMode: "partial" | "block" | "off"`.
|
- `telegram.streamMode: "partial" | "block" | "off"`.
|
||||||
- `partial`: draft updates with the latest stream text.
|
- `partial`: draft updates with the latest stream text.
|
||||||
- `block`: draft updates in chunked blocks (same chunker rules).
|
- `block`: draft updates in chunked blocks (same chunker rules).
|
||||||
- `off`: no draft streaming.
|
- `off`: no draft streaming.
|
||||||
- Draft chunk config (only for `streamMode: "block"`): `channels.telegram.draftChunk` (defaults: `minChars: 200`, `maxChars: 800`).
|
- Draft chunk config (only for `streamMode: "block"`): `telegram.draftChunk` (defaults: `minChars: 200`, `maxChars: 800`).
|
||||||
- Draft streaming is separate from block streaming; block replies are off by default and only enabled by `*.blockStreaming: true` on non-Telegram channels.
|
- Draft streaming is separate from block streaming; block replies are off by default and only enabled by `*.blockStreaming: true` on non-Telegram providers.
|
||||||
- Final reply is still a normal message.
|
- Final reply is still a normal message.
|
||||||
- `/reasoning stream` writes reasoning into the draft bubble (Telegram only).
|
- `/reasoning stream` writes reasoning into the draft bubble (Telegram only).
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ Large files are truncated with a marker. The max per-file size is controlled by
|
|||||||
`agents.defaults.bootstrapMaxChars` (default: 20000). Missing files inject a
|
`agents.defaults.bootstrapMaxChars` (default: 20000). Missing files inject a
|
||||||
short missing-file marker.
|
short missing-file marker.
|
||||||
|
|
||||||
To inspect how much each injected file contributes (raw vs injected, truncation, plus tool schema overhead), use `/context list` or `/context detail`. See [Context](/concepts/context).
|
|
||||||
|
|
||||||
## Time handling
|
## Time handling
|
||||||
|
|
||||||
The Time line is compact and explicit:
|
The Time line is compact and explicit:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ The timestamp in the envelope is **always UTC**, with minutes precision.
|
|||||||
|
|
||||||
## Tool payloads (raw provider data)
|
## Tool payloads (raw provider data)
|
||||||
|
|
||||||
Tool calls (`channels.discord.readMessages`, `channels.slack.readMessages`, etc.) return **raw provider timestamps**.
|
Tool calls (`discord.readMessages`, `slack.readMessages`, etc.) return **raw provider timestamps**.
|
||||||
These are typically UTC ISO strings (Discord) or UTC epoch strings (Slack). We do not rewrite them.
|
These are typically UTC ISO strings (Discord) or UTC epoch strings (Slack). We do not rewrite them.
|
||||||
|
|
||||||
## User timezone for the system prompt
|
## User timezone for the system prompt
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ read_when:
|
|||||||
---
|
---
|
||||||
# Typing indicators
|
# Typing indicators
|
||||||
|
|
||||||
Typing indicators are sent to the chat channel while a run is active. Use
|
Typing indicators are sent to the chat provider while a run is active. Use
|
||||||
`agents.defaults.typingMode` to control **when** typing starts and `typingIntervalSeconds`
|
`agents.defaults.typingMode` to control **when** typing starts and `typingIntervalSeconds`
|
||||||
to control **how often** it refreshes.
|
to control **how often** it refreshes.
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ read_when:
|
|||||||
- `/status` in chats: emoji‑rich status card with session tokens + estimated cost (API key only) and provider quota windows when available.
|
- `/status` in chats: emoji‑rich status card with session tokens + estimated cost (API key only) and provider quota windows when available.
|
||||||
- `/cost on|off` in chats: toggles per‑response usage lines (OAuth shows tokens only).
|
- `/cost on|off` in chats: toggles per‑response usage lines (OAuth shows tokens only).
|
||||||
- CLI: `clawdbot status --usage` prints a full per-provider breakdown.
|
- CLI: `clawdbot status --usage` prints a full per-provider breakdown.
|
||||||
- CLI: `clawdbot channels list` prints the same usage snapshot alongside provider config (use `--no-usage` to skip).
|
- CLI: `clawdbot providers list` prints the same usage snapshot alongside provider config (use `--no-usage` to skip).
|
||||||
- macOS menu bar: “Usage” section under Context (only if available).
|
- macOS menu bar: “Usage” section under Context (only if available).
|
||||||
|
|
||||||
## Providers + credentials
|
## Providers + credentials
|
||||||
@@ -23,7 +23,6 @@ read_when:
|
|||||||
- **Gemini CLI**: OAuth tokens in auth profiles.
|
- **Gemini CLI**: OAuth tokens in auth profiles.
|
||||||
- **Antigravity**: OAuth tokens in auth profiles.
|
- **Antigravity**: OAuth tokens in auth profiles.
|
||||||
- **OpenAI Codex**: OAuth tokens in auth profiles (accountId used when present).
|
- **OpenAI Codex**: OAuth tokens in auth profiles (accountId used when present).
|
||||||
- **MiniMax**: API key (coding plan key; `MINIMAX_CODE_PLAN_KEY` or `MINIMAX_API_KEY`); uses the 5‑hour coding plan window.
|
|
||||||
- **z.ai**: API key via env/config/auth store.
|
- **z.ai**: API key via env/config/auth store.
|
||||||
|
|
||||||
Usage is hidden if no matching OAuth/API credentials exist.
|
Usage is hidden if no matching OAuth/API credentials exist.
|
||||||
+22
-137
@@ -45,14 +45,6 @@
|
|||||||
"source": "/messages/",
|
"source": "/messages/",
|
||||||
"destination": "/concepts/messages"
|
"destination": "/concepts/messages"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/context",
|
|
||||||
"destination": "/concepts/context"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/context/",
|
|
||||||
"destination": "/concepts/context"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/minimax",
|
"source": "/minimax",
|
||||||
"destination": "/providers/minimax"
|
"destination": "/providers/minimax"
|
||||||
@@ -125,86 +117,6 @@
|
|||||||
"source": "/message/",
|
"source": "/message/",
|
||||||
"destination": "/cli/message"
|
"destination": "/cli/message"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "/providers/discord",
|
|
||||||
"destination": "/channels/discord"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/discord/",
|
|
||||||
"destination": "/channels/discord"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/grammy",
|
|
||||||
"destination": "/channels/grammy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/grammy/",
|
|
||||||
"destination": "/channels/grammy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/imessage",
|
|
||||||
"destination": "/channels/imessage"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/imessage/",
|
|
||||||
"destination": "/channels/imessage"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/location",
|
|
||||||
"destination": "/channels/location"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/location/",
|
|
||||||
"destination": "/channels/location"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/msteams",
|
|
||||||
"destination": "/channels/msteams"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/msteams/",
|
|
||||||
"destination": "/channels/msteams"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/signal",
|
|
||||||
"destination": "/channels/signal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/signal/",
|
|
||||||
"destination": "/channels/signal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/slack",
|
|
||||||
"destination": "/channels/slack"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/slack/",
|
|
||||||
"destination": "/channels/slack"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/telegram",
|
|
||||||
"destination": "/channels/telegram"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/telegram/",
|
|
||||||
"destination": "/channels/telegram"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/troubleshooting",
|
|
||||||
"destination": "/channels/troubleshooting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/troubleshooting/",
|
|
||||||
"destination": "/channels/troubleshooting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/whatsapp",
|
|
||||||
"destination": "/channels/whatsapp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/providers/whatsapp/",
|
|
||||||
"destination": "/channels/whatsapp"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "/sandbox",
|
"source": "/sandbox",
|
||||||
"destination": "/cli/sandbox"
|
"destination": "/cli/sandbox"
|
||||||
@@ -319,7 +231,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/discord",
|
"source": "/discord",
|
||||||
"destination": "/channels/discord"
|
"destination": "/providers/discord"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/discovery",
|
"source": "/discovery",
|
||||||
@@ -355,7 +267,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/grammy",
|
"source": "/grammy",
|
||||||
"destination": "/channels/grammy"
|
"destination": "/providers/grammy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/group-messages",
|
"source": "/group-messages",
|
||||||
@@ -383,7 +295,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/imessage",
|
"source": "/imessage",
|
||||||
"destination": "/channels/imessage"
|
"destination": "/providers/imessage"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/ios",
|
"source": "/ios",
|
||||||
@@ -395,7 +307,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/location",
|
"source": "/location",
|
||||||
"destination": "/channels/location"
|
"destination": "/providers/location"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/location-command",
|
"source": "/location-command",
|
||||||
@@ -539,23 +451,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/provider-routing",
|
"source": "/provider-routing",
|
||||||
"destination": "/concepts/channel-routing"
|
"destination": "/concepts/provider-routing"
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/concepts/provider-routing",
|
|
||||||
"destination": "/concepts/channel-routing"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/concepts/provider-routing/",
|
|
||||||
"destination": "/concepts/channel-routing"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/refactor/provider-plugin",
|
|
||||||
"destination": "/refactor/channel-plugin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/refactor/provider-plugin/",
|
|
||||||
"destination": "/refactor/channel-plugin"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/queue",
|
"source": "/queue",
|
||||||
@@ -603,7 +499,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/signal",
|
"source": "/signal",
|
||||||
"destination": "/channels/signal"
|
"destination": "/providers/signal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/skills",
|
"source": "/skills",
|
||||||
@@ -615,7 +511,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/slack",
|
"source": "/slack",
|
||||||
"destination": "/channels/slack"
|
"destination": "/providers/slack"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/slash-commands",
|
"source": "/slash-commands",
|
||||||
@@ -635,7 +531,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/telegram",
|
"source": "/telegram",
|
||||||
"destination": "/channels/telegram"
|
"destination": "/providers/telegram"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/templates/AGENTS",
|
"source": "/templates/AGENTS",
|
||||||
@@ -707,7 +603,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/whatsapp",
|
"source": "/whatsapp",
|
||||||
"destination": "/channels/whatsapp"
|
"destination": "/providers/whatsapp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "/windows",
|
"source": "/windows",
|
||||||
@@ -773,7 +669,6 @@
|
|||||||
"concepts/agent",
|
"concepts/agent",
|
||||||
"concepts/agent-loop",
|
"concepts/agent-loop",
|
||||||
"concepts/system-prompt",
|
"concepts/system-prompt",
|
||||||
"concepts/context",
|
|
||||||
"token-use",
|
"token-use",
|
||||||
"concepts/oauth",
|
"concepts/oauth",
|
||||||
"concepts/agent-workspace",
|
"concepts/agent-workspace",
|
||||||
@@ -785,7 +680,7 @@
|
|||||||
"concepts/sessions",
|
"concepts/sessions",
|
||||||
"concepts/session-tool",
|
"concepts/session-tool",
|
||||||
"concepts/presence",
|
"concepts/presence",
|
||||||
"concepts/channel-routing",
|
"concepts/provider-routing",
|
||||||
"concepts/messages",
|
"concepts/messages",
|
||||||
"concepts/streaming",
|
"concepts/streaming",
|
||||||
"concepts/groups",
|
"concepts/groups",
|
||||||
@@ -841,28 +736,9 @@
|
|||||||
"tui"
|
"tui"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"group": "Channels",
|
|
||||||
"pages": [
|
|
||||||
"channels/index",
|
|
||||||
"channels/whatsapp",
|
|
||||||
"channels/telegram",
|
|
||||||
"channels/grammy",
|
|
||||||
"channels/discord",
|
|
||||||
"channels/slack",
|
|
||||||
"channels/signal",
|
|
||||||
"channels/imessage",
|
|
||||||
"channels/msteams",
|
|
||||||
"broadcast-groups",
|
|
||||||
"channels/troubleshooting",
|
|
||||||
"channels/location"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"group": "Providers",
|
"group": "Providers",
|
||||||
"pages": [
|
"pages": [
|
||||||
"providers/index",
|
|
||||||
"providers/models",
|
|
||||||
"providers/openai",
|
"providers/openai",
|
||||||
"providers/anthropic",
|
"providers/anthropic",
|
||||||
"providers/moonshot",
|
"providers/moonshot",
|
||||||
@@ -870,7 +746,18 @@
|
|||||||
"providers/openrouter",
|
"providers/openrouter",
|
||||||
"providers/opencode",
|
"providers/opencode",
|
||||||
"providers/glm",
|
"providers/glm",
|
||||||
"providers/zai"
|
"providers/zai",
|
||||||
|
"providers/telegram",
|
||||||
|
"providers/grammy",
|
||||||
|
"providers/discord",
|
||||||
|
"providers/slack",
|
||||||
|
"providers/signal",
|
||||||
|
"providers/imessage",
|
||||||
|
"providers/whatsapp",
|
||||||
|
"broadcast-groups",
|
||||||
|
"providers/msteams",
|
||||||
|
"providers/troubleshooting",
|
||||||
|
"providers/location"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -889,11 +776,9 @@
|
|||||||
"tools",
|
"tools",
|
||||||
"plugin",
|
"plugin",
|
||||||
"tools/exec",
|
"tools/exec",
|
||||||
"tools/web",
|
|
||||||
"tools/apply-patch",
|
"tools/apply-patch",
|
||||||
"tools/elevated",
|
"tools/elevated",
|
||||||
"tools/browser",
|
"tools/browser",
|
||||||
"tools/chrome-extension",
|
|
||||||
"tools/browser-linux-troubleshooting",
|
"tools/browser-linux-troubleshooting",
|
||||||
"tools/slash-commands",
|
"tools/slash-commands",
|
||||||
"tools/thinking",
|
"tools/thinking",
|
||||||
|
|||||||
@@ -35,4 +35,4 @@ false negatives when deciding whether to respond in DMs or groups.
|
|||||||
## Related docs
|
## Related docs
|
||||||
|
|
||||||
- [Group Chats](/concepts/groups)
|
- [Group Chats](/concepts/groups)
|
||||||
- [Telegram Provider](/channels/telegram)
|
- [Telegram Provider](/providers/telegram)
|
||||||
@@ -47,10 +47,10 @@ API keys for daemon use: `clawdbot onboard`.
|
|||||||
See [/start/faq](/start/faq) for details on env inheritance (`env.shellEnv`,
|
See [/start/faq](/start/faq) for details on env inheritance (`env.shellEnv`,
|
||||||
`~/.clawdbot/.env`, systemd/launchd).
|
`~/.clawdbot/.env`, systemd/launchd).
|
||||||
|
|
||||||
## Anthropic: Claude Code CLI setup-token (supported)
|
## Anthropic: Claude CLI setup-token (supported)
|
||||||
|
|
||||||
For Anthropic, the recommended path is an **API key**. If you’re already using
|
For Anthropic, the recommended path is an **API key**. If you’re already using
|
||||||
Claude Code CLI, the setup-token flow is also supported.
|
Claude Code, the Claude CLI setup-token is also supported.
|
||||||
Run it on the **gateway host**:
|
Run it on the **gateway host**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -67,10 +67,6 @@ clawdbot doctor
|
|||||||
This should create (or refresh) an auth profile like `anthropic:claude-cli` in
|
This should create (or refresh) an auth profile like `anthropic:claude-cli` in
|
||||||
the agent auth store.
|
the agent auth store.
|
||||||
|
|
||||||
Clawdbot config sets `auth.profiles["anthropic:claude-cli"].mode` to `"oauth"` so
|
|
||||||
the profile accepts both OAuth and setup-token credentials. Older configs that
|
|
||||||
used `"token"` are auto-migrated on load.
|
|
||||||
|
|
||||||
If you see an Anthropic error like:
|
If you see an Anthropic error like:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -142,7 +138,7 @@ Use `--agent <id>` to target a specific agent; omit it to use the configured def
|
|||||||
`~/.clawdbot/agents/<agentId>/agent/auth-profiles.json` when the auth store is
|
`~/.clawdbot/agents/<agentId>/agent/auth-profiles.json` when the auth store is
|
||||||
loaded.
|
loaded.
|
||||||
3. Refreshable OAuth profiles can be refreshed automatically on use. Static
|
3. Refreshable OAuth profiles can be refreshed automatically on use. Static
|
||||||
token profiles (including Claude Code CLI setup-token) are not refreshable by
|
token profiles (including Claude CLI setup-token) are not refreshable by
|
||||||
Clawdbot.
|
Clawdbot.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
summary: "CLI backends: text-only fallback via local AI CLIs"
|
summary: "CLI backends: text-only fallback via local AI CLIs"
|
||||||
read_when:
|
read_when:
|
||||||
- You want a reliable fallback when API providers fail
|
- You want a reliable fallback when API providers fail
|
||||||
- You are running Claude Code CLI or other local AI CLIs and want to reuse them
|
- You are running Claude CLI or other local AI CLIs and want to reuse them
|
||||||
- You need a text-only, tool-free path that still supports sessions and images
|
- You need a text-only, tool-free path that still supports sessions and images
|
||||||
---
|
---
|
||||||
# CLI backends (fallback runtime)
|
# CLI backends (fallback runtime)
|
||||||
@@ -20,7 +20,7 @@ want “always works” text responses without relying on external APIs.
|
|||||||
|
|
||||||
## Beginner-friendly quick start
|
## Beginner-friendly quick start
|
||||||
|
|
||||||
You can use Claude Code CLI **without any config** (Clawdbot ships a built-in default):
|
You can use Claude CLI **without any config** (Clawdbot ships a built-in default):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot agent --message "hi" --model claude-cli/opus-4.5
|
clawdbot agent --message "hi" --model claude-cli/opus-4.5
|
||||||
@@ -162,7 +162,7 @@ imageMode: "repeat"
|
|||||||
Clawdbot will write base64 images to temp files. If `imageArg` is set, those
|
Clawdbot will write base64 images to temp files. If `imageArg` is set, those
|
||||||
paths are passed as CLI args. If `imageArg` is missing, Clawdbot appends the
|
paths are passed as CLI args. If `imageArg` is missing, Clawdbot appends the
|
||||||
file paths to the prompt (path injection), which is enough for CLIs that auto-
|
file paths to the prompt (path injection), which is enough for CLIs that auto-
|
||||||
load local files from plain paths (Claude Code CLI behavior).
|
load local files from plain paths (Claude CLI behavior).
|
||||||
|
|
||||||
## Inputs / outputs
|
## Inputs / outputs
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Examples below are aligned with the current config schema. For the exhaustive re
|
|||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
agent: { workspace: "~/clawd" },
|
agent: { workspace: "~/clawd" },
|
||||||
channels: { whatsapp: { allowFrom: ["+15555550123"] } }
|
whatsapp: { allowFrom: ["+15555550123"] }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -33,13 +33,11 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
workspace: "~/clawd",
|
workspace: "~/clawd",
|
||||||
model: { primary: "anthropic/claude-sonnet-4-5" }
|
model: { primary: "anthropic/claude-sonnet-4-5" }
|
||||||
},
|
},
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
allowFrom: ["+15555550123"],
|
allowFrom: ["+15555550123"],
|
||||||
groups: { "*": { requireMention: true } }
|
groups: { "*": { requireMention: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Expanded example (major options)
|
## Expanded example (major options)
|
||||||
@@ -110,7 +108,7 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
debounceMs: 1000,
|
debounceMs: 1000,
|
||||||
cap: 20,
|
cap: 20,
|
||||||
drop: "summarize",
|
drop: "summarize",
|
||||||
byChannel: {
|
byProvider: {
|
||||||
whatsapp: "collect",
|
whatsapp: "collect",
|
||||||
telegram: "collect",
|
telegram: "collect",
|
||||||
discord: "collect",
|
discord: "collect",
|
||||||
@@ -143,13 +141,12 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
sendPolicy: {
|
sendPolicy: {
|
||||||
default: "allow",
|
default: "allow",
|
||||||
rules: [
|
rules: [
|
||||||
{ action: "deny", match: { channel: "discord", chatType: "group" } }
|
{ action: "deny", match: { provider: "discord", chatType: "group" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Channels
|
// Providers
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
dmPolicy: "pairing",
|
dmPolicy: "pairing",
|
||||||
allowFrom: ["+15555550123"],
|
allowFrom: ["+15555550123"],
|
||||||
@@ -197,7 +194,6 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
sessionPrefix: "slack:slash",
|
sessionPrefix: "slack:slash",
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Agent runtime
|
// Agent runtime
|
||||||
@@ -345,7 +341,7 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
messageTemplate: "From: {{messages[0].from}}\nSubject: {{messages[0].subject}}",
|
messageTemplate: "From: {{messages[0].from}}\nSubject: {{messages[0].subject}}",
|
||||||
textTemplate: "{{messages[0].snippet}}",
|
textTemplate: "{{messages[0].snippet}}",
|
||||||
deliver: true,
|
deliver: true,
|
||||||
channel: "last",
|
provider: "last",
|
||||||
to: "+15555550123",
|
to: "+15555550123",
|
||||||
thinking: "low",
|
thinking: "low",
|
||||||
timeoutSeconds: 300,
|
timeoutSeconds: 300,
|
||||||
@@ -384,7 +380,7 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
},
|
},
|
||||||
|
|
||||||
skills: {
|
skills: {
|
||||||
allowBundled: ["gemini", "peekaboo"],
|
allowBundled: ["brave-search", "gemini"],
|
||||||
load: {
|
load: {
|
||||||
extraDirs: ["~/Projects/agent-scripts/skills"]
|
extraDirs: ["~/Projects/agent-scripts/skills"]
|
||||||
},
|
},
|
||||||
@@ -410,7 +406,6 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
agent: { workspace: "~/clawd" },
|
agent: { workspace: "~/clawd" },
|
||||||
channels: {
|
|
||||||
whatsapp: { allowFrom: ["+15555550123"] },
|
whatsapp: { allowFrom: ["+15555550123"] },
|
||||||
telegram: {
|
telegram: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -423,7 +418,6 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
dm: { allowFrom: ["yourname"] }
|
dm: { allowFrom: ["yourname"] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### OAuth with API key failover
|
### OAuth with API key failover
|
||||||
@@ -466,7 +460,6 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
workspace: "~/work-clawd",
|
workspace: "~/work-clawd",
|
||||||
elevated: { enabled: false }
|
elevated: { enabled: false }
|
||||||
},
|
},
|
||||||
channels: {
|
|
||||||
slack: {
|
slack: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
botToken: "xoxb-...",
|
botToken: "xoxb-...",
|
||||||
@@ -476,7 +469,6 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Local models only
|
### Local models only
|
||||||
@@ -515,4 +507,4 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number.
|
|||||||
- If you set `dmPolicy: "open"`, the matching `allowFrom` list must include `"*"`.
|
- If you set `dmPolicy: "open"`, the matching `allowFrom` list must include `"*"`.
|
||||||
- Provider IDs differ (phone numbers, user IDs, channel IDs). Use the provider docs to confirm the format.
|
- Provider IDs differ (phone numbers, user IDs, channel IDs). Use the provider docs to confirm the format.
|
||||||
- Optional sections to add later: `web`, `browser`, `ui`, `bridge`, `discovery`, `canvasHost`, `talk`, `signal`, `imessage`.
|
- Optional sections to add later: `web`, `browser`, `ui`, `bridge`, `discovery`, `canvasHost`, `talk`, `signal`, `imessage`.
|
||||||
- See [Providers](/channels/whatsapp) and [Troubleshooting](/gateway/troubleshooting) for deeper setup notes.
|
- See [Providers](/providers/whatsapp) and [Troubleshooting](/gateway/troubleshooting) for deeper setup notes.
|
||||||
+75
-220
@@ -8,8 +8,8 @@ read_when:
|
|||||||
Clawdbot reads an optional **JSON5** config from `~/.clawdbot/clawdbot.json` (comments + trailing commas allowed).
|
Clawdbot reads an optional **JSON5** config from `~/.clawdbot/clawdbot.json` (comments + trailing commas allowed).
|
||||||
|
|
||||||
If the file is missing, Clawdbot uses safe-ish defaults (embedded Pi agent + per-sender sessions + workspace `~/clawd`). You usually only need a config to:
|
If the file is missing, Clawdbot uses safe-ish defaults (embedded Pi agent + per-sender sessions + workspace `~/clawd`). You usually only need a config to:
|
||||||
- restrict who can trigger the bot (`channels.whatsapp.allowFrom`, `channels.telegram.allowFrom`, etc.)
|
- restrict who can trigger the bot (`whatsapp.allowFrom`, `telegram.allowFrom`, etc.)
|
||||||
- control group allowlists + mention behavior (`channels.whatsapp.groups`, `channels.telegram.groups`, `channels.discord.guilds`, `agents.list[].groupChat`)
|
- control group allowlists + mention behavior (`whatsapp.groups`, `telegram.groups`, `discord.guilds`, `agents.list[].groupChat`)
|
||||||
- customize message prefixes (`messages`)
|
- customize message prefixes (`messages`)
|
||||||
- set the agent's workspace (`agents.defaults.workspace` or `agents.list[].workspace`)
|
- set the agent's workspace (`agents.defaults.workspace` or `agents.list[].workspace`)
|
||||||
- tune the embedded agent defaults (`agents.defaults`) and session behavior (`session`)
|
- tune the embedded agent defaults (`agents.defaults`) and session behavior (`session`)
|
||||||
@@ -32,50 +32,25 @@ It writes a restart sentinel and pings the last active session after the Gateway
|
|||||||
|
|
||||||
Params:
|
Params:
|
||||||
- `raw` (string) — JSON5 payload for the entire config
|
- `raw` (string) — JSON5 payload for the entire config
|
||||||
- `baseHash` (optional) — config hash from `config.get` (required when a config already exists)
|
|
||||||
- `sessionKey` (optional) — last active session key for the wake-up ping
|
- `sessionKey` (optional) — last active session key for the wake-up ping
|
||||||
- `restartDelayMs` (optional) — delay before restart (default 2000)
|
- `restartDelayMs` (optional) — delay before restart (default 2000)
|
||||||
|
|
||||||
Example (via `gateway call`):
|
Example (via `gateway call`):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot gateway call config.get --params '{}' # capture payload.hash
|
|
||||||
clawdbot gateway call config.apply --params '{
|
clawdbot gateway call config.apply --params '{
|
||||||
"raw": "{\\n agents: { defaults: { workspace: \\"~/clawd\\" } }\\n}\\n",
|
"raw": "{\\n agents: { defaults: { workspace: \\"~/clawd\\" } }\\n}\\n",
|
||||||
"baseHash": "<hash-from-config.get>",
|
|
||||||
"sessionKey": "agent:main:whatsapp:dm:+15555550123",
|
"sessionKey": "agent:main:whatsapp:dm:+15555550123",
|
||||||
"restartDelayMs": 1000
|
"restartDelayMs": 1000
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Partial updates (RPC)
|
|
||||||
|
|
||||||
Use `config.patch` to merge a partial update into the existing config without clobbering
|
|
||||||
unrelated keys. It applies JSON merge patch semantics:
|
|
||||||
- objects merge recursively
|
|
||||||
- `null` deletes a key
|
|
||||||
- arrays replace
|
|
||||||
|
|
||||||
Params:
|
|
||||||
- `raw` (string) — JSON5 payload containing just the keys to change
|
|
||||||
- `baseHash` (required) — config hash from `config.get`
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
clawdbot gateway call config.get --params '{}' # capture payload.hash
|
|
||||||
clawdbot gateway call config.patch --params '{
|
|
||||||
"raw": "{\\n channels: { telegram: { groups: { \\"*\\": { requireMention: false } } } }\\n}\\n",
|
|
||||||
"baseHash": "<hash-from-config.get>"
|
|
||||||
}'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Minimal config (recommended starting point)
|
## Minimal config (recommended starting point)
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
agents: { defaults: { workspace: "~/clawd" } },
|
agents: { defaults: { workspace: "~/clawd" } },
|
||||||
channels: { whatsapp: { allowFrom: ["+15555550123"] } }
|
whatsapp: { allowFrom: ["+15555550123"] }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -99,14 +74,12 @@ To prevent the bot from responding to WhatsApp @-mentions in groups (only respon
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
// Allowlist is DMs only; including your own number enables self-chat mode.
|
// Allowlist is DMs only; including your own number enables self-chat mode.
|
||||||
allowFrom: ["+15555550123"],
|
allowFrom: ["+15555550123"],
|
||||||
groups: { "*": { requireMention: true } }
|
groups: { "*": { requireMention: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Config Includes (`$include`)
|
## Config Includes (`$include`)
|
||||||
@@ -216,7 +189,7 @@ Included files can themselves contain `$include` directives (up to 10 levels dee
|
|||||||
"./clients/schmidt/broadcast.json5"
|
"./clients/schmidt/broadcast.json5"
|
||||||
]},
|
]},
|
||||||
|
|
||||||
channels: { whatsapp: { groupPolicy: "allowlist" } }
|
whatsapp: { groupPolicy: "allowlist" }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -331,10 +304,6 @@ rotation order used for failover.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: `anthropic:claude-cli` should use `mode: "oauth"` even when the stored
|
|
||||||
credential is a setup-token. Clawdbot auto-migrates older configs that used
|
|
||||||
`mode: "token"`.
|
|
||||||
|
|
||||||
### `agents.list[].identity`
|
### `agents.list[].identity`
|
||||||
|
|
||||||
Optional per-agent identity used for defaults and UX. This is written by the macOS onboarding assistant.
|
Optional per-agent identity used for defaults and UX. This is written by the macOS onboarding assistant.
|
||||||
@@ -397,29 +366,28 @@ Metadata written by CLI wizards (`onboard`, `configure`, `doctor`).
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `channels.whatsapp.dmPolicy`
|
### `whatsapp.dmPolicy`
|
||||||
|
|
||||||
Controls how WhatsApp direct chats (DMs) are handled:
|
Controls how WhatsApp direct chats (DMs) are handled:
|
||||||
- `"pairing"` (default): unknown senders get a pairing code; owner must approve
|
- `"pairing"` (default): unknown senders get a pairing code; owner must approve
|
||||||
- `"allowlist"`: only allow senders in `channels.whatsapp.allowFrom` (or paired allow store)
|
- `"allowlist"`: only allow senders in `whatsapp.allowFrom` (or paired allow store)
|
||||||
- `"open"`: allow all inbound DMs (**requires** `channels.whatsapp.allowFrom` to include `"*"`)
|
- `"open"`: allow all inbound DMs (**requires** `whatsapp.allowFrom` to include `"*"`)
|
||||||
- `"disabled"`: ignore all inbound DMs
|
- `"disabled"`: ignore all inbound DMs
|
||||||
|
|
||||||
Pairing codes expire after 1 hour; the bot only sends a pairing code when a new request is created. Pending DM pairing requests are capped at **3 per channel** by default.
|
Pairing codes expire after 1 hour; the bot only sends a pairing code when a new request is created. Pending DM pairing requests are capped at **3 per provider** by default.
|
||||||
|
|
||||||
Pairing approvals:
|
Pairing approvals:
|
||||||
- `clawdbot pairing list whatsapp`
|
- `clawdbot pairing list whatsapp`
|
||||||
- `clawdbot pairing approve whatsapp <code>`
|
- `clawdbot pairing approve whatsapp <code>`
|
||||||
|
|
||||||
### `channels.whatsapp.allowFrom`
|
### `whatsapp.allowFrom`
|
||||||
|
|
||||||
Allowlist of E.164 phone numbers that may trigger WhatsApp auto-replies (**DMs only**).
|
Allowlist of E.164 phone numbers that may trigger WhatsApp auto-replies (**DMs only**).
|
||||||
If empty and `channels.whatsapp.dmPolicy="pairing"`, unknown senders will receive a pairing code.
|
If empty and `whatsapp.dmPolicy="pairing"`, unknown senders will receive a pairing code.
|
||||||
For groups, use `channels.whatsapp.groupPolicy` + `channels.whatsapp.groupAllowFrom`.
|
For groups, use `whatsapp.groupPolicy` + `whatsapp.groupAllowFrom`.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
dmPolicy: "pairing", // pairing | allowlist | open | disabled
|
dmPolicy: "pairing", // pairing | allowlist | open | disabled
|
||||||
allowFrom: ["+15555550123", "+447700900123"],
|
allowFrom: ["+15555550123", "+447700900123"],
|
||||||
@@ -427,16 +395,14 @@ For groups, use `channels.whatsapp.groupPolicy` + `channels.whatsapp.groupAllowF
|
|||||||
mediaMaxMb: 50 // optional inbound media cap (MB)
|
mediaMaxMb: 50 // optional inbound media cap (MB)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `channels.whatsapp.accounts` (multi-account)
|
### `whatsapp.accounts` (multi-account)
|
||||||
|
|
||||||
Run multiple WhatsApp accounts in one gateway:
|
Run multiple WhatsApp accounts in one gateway:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
accounts: {
|
accounts: {
|
||||||
default: {}, // optional; keeps the default id stable
|
default: {}, // optional; keeps the default id stable
|
||||||
@@ -448,20 +414,18 @@ Run multiple WhatsApp accounts in one gateway:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- Outbound commands default to account `default` if present; otherwise the first configured account id (sorted).
|
- Outbound commands default to account `default` if present; otherwise the first configured account id (sorted).
|
||||||
- The legacy single-account Baileys auth dir is migrated by `clawdbot doctor` into `whatsapp/default`.
|
- The legacy single-account Baileys auth dir is migrated by `clawdbot doctor` into `whatsapp/default`.
|
||||||
|
|
||||||
### `channels.telegram.accounts` / `channels.discord.accounts` / `channels.slack.accounts` / `channels.signal.accounts` / `channels.imessage.accounts`
|
### `telegram.accounts` / `discord.accounts` / `slack.accounts` / `signal.accounts` / `imessage.accounts`
|
||||||
|
|
||||||
Run multiple accounts per channel (each account has its own `accountId` and optional `name`):
|
Run multiple accounts per provider (each account has its own `accountId` and optional `name`):
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
telegram: {
|
telegram: {
|
||||||
accounts: {
|
accounts: {
|
||||||
default: {
|
default: {
|
||||||
@@ -475,13 +439,12 @@ Run multiple accounts per channel (each account has its own `accountId` and opti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- `default` is used when `accountId` is omitted (CLI + routing).
|
- `default` is used when `accountId` is omitted (CLI + routing).
|
||||||
- Env tokens only apply to the **default** account.
|
- Env tokens only apply to the **default** account.
|
||||||
- Base channel settings (group policy, mention gating, etc.) apply to all accounts unless overridden per account.
|
- Base provider settings (group policy, mention gating, etc.) apply to all accounts unless overridden per account.
|
||||||
- Use `bindings[].match.accountId` to route each account to a different agents.defaults.
|
- Use `bindings[].match.accountId` to route each account to a different agents.defaults.
|
||||||
|
|
||||||
### Group chat mention gating (`agents.list[].groupChat` + `messages.groupChat`)
|
### Group chat mention gating (`agents.list[].groupChat` + `messages.groupChat`)
|
||||||
@@ -489,7 +452,7 @@ Notes:
|
|||||||
Group messages default to **require mention** (either metadata mention or regex patterns). Applies to WhatsApp, Telegram, Discord, and iMessage group chats.
|
Group messages default to **require mention** (either metadata mention or regex patterns). Applies to WhatsApp, Telegram, Discord, and iMessage group chats.
|
||||||
|
|
||||||
**Mention types:**
|
**Mention types:**
|
||||||
- **Metadata mentions**: Native platform @-mentions (e.g., WhatsApp tap-to-mention). Ignored in WhatsApp self-chat mode (see `channels.whatsapp.allowFrom`).
|
- **Metadata mentions**: Native platform @-mentions (e.g., WhatsApp tap-to-mention). Ignored in WhatsApp self-chat mode (see `whatsapp.allowFrom`).
|
||||||
- **Text patterns**: Regex patterns defined in `agents.list[].groupChat.mentionPatterns`. Always checked regardless of self-chat mode.
|
- **Text patterns**: Regex patterns defined in `agents.list[].groupChat.mentionPatterns`. Always checked regardless of self-chat mode.
|
||||||
- Mention gating is enforced only when mention detection is possible (native mentions or at least one `mentionPattern`).
|
- Mention gating is enforced only when mention detection is possible (native mentions or at least one `mentionPattern`).
|
||||||
|
|
||||||
@@ -506,31 +469,7 @@ Group messages default to **require mention** (either metadata mention or regex
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`messages.groupChat.historyLimit` sets the global default for group history context. Channels can override with `channels.<channel>.historyLimit` (or `channels.<channel>.accounts.*.historyLimit` for multi-account). Set `0` to disable history wrapping.
|
`messages.groupChat.historyLimit` sets the global default for group history context. Providers can override with `<provider>.historyLimit` (or `<provider>.accounts.*.historyLimit` for multi-account). Set `0` to disable history wrapping.
|
||||||
|
|
||||||
#### DM history limits
|
|
||||||
|
|
||||||
DM conversations use session-based history managed by the agent. You can limit the number of user turns retained per DM session:
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
channels: {
|
|
||||||
telegram: {
|
|
||||||
dmHistoryLimit: 30, // limit DM sessions to 30 user turns
|
|
||||||
dms: {
|
|
||||||
"123456789": { historyLimit: 50 } // per-user override (user ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Resolution order:
|
|
||||||
1. Per-DM override: `channels.<provider>.dms[userId].historyLimit`
|
|
||||||
2. Provider default: `channels.<provider>.dmHistoryLimit`
|
|
||||||
3. No limit (all history retained)
|
|
||||||
|
|
||||||
Supported providers: `telegram`, `whatsapp`, `discord`, `slack`, `signal`, `imessage`, `msteams`.
|
|
||||||
|
|
||||||
Per-agent override (takes precedence when set, even `[]`):
|
Per-agent override (takes precedence when set, even `[]`):
|
||||||
```json5
|
```json5
|
||||||
@@ -544,17 +483,15 @@ Per-agent override (takes precedence when set, even `[]`):
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Mention gating defaults live per channel (`channels.whatsapp.groups`, `channels.telegram.groups`, `channels.imessage.groups`, `channels.discord.guilds`). When `*.groups` is set, it also acts as a group allowlist; include `"*"` to allow all groups.
|
Mention gating defaults live per provider (`whatsapp.groups`, `telegram.groups`, `imessage.groups`, `discord.guilds`). When `*.groups` is set, it also acts as a group allowlist; include `"*"` to allow all groups.
|
||||||
|
|
||||||
To respond **only** to specific text triggers (ignoring native @-mentions):
|
To respond **only** to specific text triggers (ignoring native @-mentions):
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
// Include your own number to enable self-chat mode (ignore native @-mentions).
|
// Include your own number to enable self-chat mode (ignore native @-mentions).
|
||||||
allowFrom: ["+15555550123"],
|
allowFrom: ["+15555550123"],
|
||||||
groups: { "*": { requireMention: true } }
|
groups: { "*": { requireMention: true } }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
agents: {
|
agents: {
|
||||||
list: [
|
list: [
|
||||||
@@ -570,13 +507,12 @@ To respond **only** to specific text triggers (ignoring native @-mentions):
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Group policy (per channel)
|
### Group policy (per provider)
|
||||||
|
|
||||||
Use `channels.*.groupPolicy` to control whether group/room messages are accepted at all:
|
Use `*.groupPolicy` to control whether group/room messages are accepted at all:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
groupPolicy: "allowlist",
|
groupPolicy: "allowlist",
|
||||||
groupAllowFrom: ["+15551234567"]
|
groupAllowFrom: ["+15551234567"]
|
||||||
@@ -610,7 +546,6 @@ Use `channels.*.groupPolicy` to control whether group/room messages are accepted
|
|||||||
channels: { "#general": { allow: true } }
|
channels: { "#general": { allow: true } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
@@ -618,7 +553,7 @@ Notes:
|
|||||||
- `"disabled"`: block all group/room messages.
|
- `"disabled"`: block all group/room messages.
|
||||||
- `"allowlist"`: only allow groups/rooms that match the configured allowlist.
|
- `"allowlist"`: only allow groups/rooms that match the configured allowlist.
|
||||||
- WhatsApp/Telegram/Signal/iMessage/Microsoft Teams use `groupAllowFrom` (fallback: explicit `allowFrom`).
|
- WhatsApp/Telegram/Signal/iMessage/Microsoft Teams use `groupAllowFrom` (fallback: explicit `allowFrom`).
|
||||||
- Discord/Slack use channel allowlists (`channels.discord.guilds.*.channels`, `channels.slack.channels`).
|
- Discord/Slack use channel allowlists (`discord.guilds.*.channels`, `slack.channels`).
|
||||||
- Group DMs (Discord/Slack) are still controlled by `dm.groupEnabled` + `dm.groupChannels`.
|
- Group DMs (Discord/Slack) are still controlled by `dm.groupEnabled` + `dm.groupChannels`.
|
||||||
- Default is `groupPolicy: "allowlist"`; if no allowlist is configured, group messages are blocked.
|
- Default is `groupPolicy: "allowlist"`; if no allowlist is configured, group messages are blocked.
|
||||||
|
|
||||||
@@ -655,17 +590,17 @@ Inbound messages are routed to an agent via bindings.
|
|||||||
- `deny`: array of denied tool names (deny wins)
|
- `deny`: array of denied tool names (deny wins)
|
||||||
- `agents.defaults`: shared agent defaults (model, workspace, sandbox, etc.).
|
- `agents.defaults`: shared agent defaults (model, workspace, sandbox, etc.).
|
||||||
- `bindings[]`: routes inbound messages to an `agentId`.
|
- `bindings[]`: routes inbound messages to an `agentId`.
|
||||||
- `match.channel` (required)
|
- `match.provider` (required)
|
||||||
- `match.accountId` (optional; `*` = any account; omitted = default account)
|
- `match.accountId` (optional; `*` = any account; omitted = default account)
|
||||||
- `match.peer` (optional; `{ kind: dm|group|channel, id }`)
|
- `match.peer` (optional; `{ kind: dm|group|channel, id }`)
|
||||||
- `match.guildId` / `match.teamId` (optional; channel-specific)
|
- `match.guildId` / `match.teamId` (optional; provider-specific)
|
||||||
|
|
||||||
Deterministic match order:
|
Deterministic match order:
|
||||||
1) `match.peer`
|
1) `match.peer`
|
||||||
2) `match.guildId`
|
2) `match.guildId`
|
||||||
3) `match.teamId`
|
3) `match.teamId`
|
||||||
4) `match.accountId` (exact, no peer/guild/team)
|
4) `match.accountId` (exact, no peer/guild/team)
|
||||||
5) `match.accountId: "*"` (channel-wide, no peer/guild/team)
|
5) `match.accountId: "*"` (provider-wide, no peer/guild/team)
|
||||||
6) default agent (`agents.list[].default`, else first list entry, else `"main"`)
|
6) default agent (`agents.list[].default`, else first list entry, else `"main"`)
|
||||||
|
|
||||||
Within each match tier, the first matching entry in `bindings` wins.
|
Within each match tier, the first matching entry in `bindings` wins.
|
||||||
@@ -753,10 +688,9 @@ Example: two WhatsApp accounts → two agents:
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
bindings: [
|
bindings: [
|
||||||
{ agentId: "home", match: { channel: "whatsapp", accountId: "personal" } },
|
{ agentId: "home", match: { provider: "whatsapp", accountId: "personal" } },
|
||||||
{ agentId: "work", match: { channel: "whatsapp", accountId: "biz" } }
|
{ agentId: "work", match: { provider: "whatsapp", accountId: "biz" } }
|
||||||
],
|
],
|
||||||
channels: {
|
|
||||||
whatsapp: {
|
whatsapp: {
|
||||||
accounts: {
|
accounts: {
|
||||||
personal: {},
|
personal: {},
|
||||||
@@ -764,7 +698,6 @@ Example: two WhatsApp accounts → two agents:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `tools.agentToAgent` (optional)
|
### `tools.agentToAgent` (optional)
|
||||||
@@ -794,7 +727,7 @@ Controls how inbound messages behave when an agent run is already active.
|
|||||||
debounceMs: 1000,
|
debounceMs: 1000,
|
||||||
cap: 20,
|
cap: 20,
|
||||||
drop: "summarize", // old | new | summarize
|
drop: "summarize", // old | new | summarize
|
||||||
byChannel: {
|
byProvider: {
|
||||||
whatsapp: "collect",
|
whatsapp: "collect",
|
||||||
telegram: "collect",
|
telegram: "collect",
|
||||||
discord: "collect",
|
discord: "collect",
|
||||||
@@ -828,19 +761,18 @@ Controls how chat commands are enabled across connectors.
|
|||||||
Notes:
|
Notes:
|
||||||
- Text commands must be sent as a **standalone** message and use the leading `/` (no plain-text aliases).
|
- Text commands must be sent as a **standalone** message and use the leading `/` (no plain-text aliases).
|
||||||
- `commands.text: false` disables parsing chat messages for commands.
|
- `commands.text: false` disables parsing chat messages for commands.
|
||||||
- `commands.native: "auto"` (default) turns on native commands for Discord/Telegram and leaves Slack off; unsupported channels stay text-only.
|
- `commands.native: "auto"` (default) turns on native commands for Discord/Telegram and leaves Slack off; unsupported providers stay text-only.
|
||||||
- Set `commands.native: true|false` to force all, or override per channel with `channels.discord.commands.native`, `channels.telegram.commands.native`, `channels.slack.commands.native` (bool or `"auto"`). `false` clears previously registered commands on Discord/Telegram at startup; Slack commands are managed in the Slack app.
|
- Set `commands.native: true|false` to force all, or override per provider with `discord.commands.native`, `telegram.commands.native`, `slack.commands.native` (bool or `"auto"`). `false` clears previously registered commands on Discord/Telegram at startup; Slack commands are managed in the Slack app.
|
||||||
- `commands.bash: true` enables `! <cmd>` to run host shell commands (`/bash <cmd>` also works as an alias). Requires `tools.elevated.enabled` and allowlisting the sender in `tools.elevated.allowFrom.<channel>`.
|
- `commands.bash: true` enables `! <cmd>` to run host shell commands (`/bash <cmd>` also works as an alias). Requires `tools.elevated.enabled` and allowlisting the sender in `tools.elevated.allowFrom.<provider>`.
|
||||||
- `commands.bashForegroundMs` controls how long bash waits before backgrounding. While a bash job is running, new `! <cmd>` requests are rejected (one at a time).
|
- `commands.bashForegroundMs` controls how long bash waits before backgrounding. While a bash job is running, new `! <cmd>` requests are rejected (one at a time).
|
||||||
- `commands.config: true` enables `/config` (reads/writes `clawdbot.json`).
|
- `commands.config: true` enables `/config` (reads/writes `clawdbot.json`).
|
||||||
- `channels.<provider>.configWrites` gates config mutations initiated by that channel (default: true). This applies to `/config set|unset` plus provider-specific auto-migrations (Telegram supergroup ID changes, Slack channel ID changes).
|
|
||||||
- `commands.debug: true` enables `/debug` (runtime-only overrides).
|
- `commands.debug: true` enables `/debug` (runtime-only overrides).
|
||||||
- `commands.restart: true` enables `/restart` and the gateway tool restart action.
|
- `commands.restart: true` enables `/restart` and the gateway tool restart action.
|
||||||
- `commands.useAccessGroups: false` allows commands to bypass access-group allowlists/policies.
|
- `commands.useAccessGroups: false` allows commands to bypass access-group allowlists/policies.
|
||||||
|
|
||||||
### `web` (WhatsApp web channel runtime)
|
### `web` (WhatsApp web provider)
|
||||||
|
|
||||||
WhatsApp runs through the gateway’s web channel (Baileys Web). It starts automatically when a linked session exists.
|
WhatsApp runs through the gateway’s web provider. It starts automatically when a linked session exists.
|
||||||
Set `web.enabled: false` to keep it off by default.
|
Set `web.enabled: false` to keep it off by default.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
@@ -859,16 +791,14 @@ Set `web.enabled: false` to keep it off by default.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `channels.telegram` (bot transport)
|
### `telegram` (bot transport)
|
||||||
|
|
||||||
Clawdbot starts Telegram only when a `channels.telegram` config section exists. The bot token is resolved from `TELEGRAM_BOT_TOKEN` or `channels.telegram.botToken`.
|
Clawdbot starts Telegram only when a `telegram` config section exists. The bot token is resolved from `TELEGRAM_BOT_TOKEN` or `telegram.botToken`.
|
||||||
Set `channels.telegram.enabled: false` to disable automatic startup.
|
Set `telegram.enabled: false` to disable automatic startup.
|
||||||
Multi-account support lives under `channels.telegram.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
Multi-account support lives under `telegram.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
||||||
Set `channels.telegram.configWrites: false` to block Telegram-initiated config writes (including supergroup ID migrations and `/config set|unset`).
|
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
telegram: {
|
telegram: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
botToken: "your-bot-token",
|
botToken: "your-bot-token",
|
||||||
@@ -910,7 +840,6 @@ Set `channels.telegram.configWrites: false` to block Telegram-initiated config w
|
|||||||
webhookPath: "/telegram-webhook"
|
webhookPath: "/telegram-webhook"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Draft streaming notes:
|
Draft streaming notes:
|
||||||
@@ -919,14 +848,13 @@ Draft streaming notes:
|
|||||||
- `/reasoning stream` streams reasoning into the draft, then sends the final answer.
|
- `/reasoning stream` streams reasoning into the draft, then sends the final answer.
|
||||||
Retry policy defaults and behavior are documented in [Retry policy](/concepts/retry).
|
Retry policy defaults and behavior are documented in [Retry policy](/concepts/retry).
|
||||||
|
|
||||||
### `channels.discord` (bot transport)
|
### `discord` (bot transport)
|
||||||
|
|
||||||
Configure the Discord bot by setting the bot token and optional gating:
|
Configure the Discord bot by setting the bot token and optional gating:
|
||||||
Multi-account support lives under `channels.discord.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
Multi-account support lives under `discord.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
discord: {
|
discord: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
token: "your-bot-token",
|
token: "your-bot-token",
|
||||||
@@ -986,27 +914,25 @@ Multi-account support lives under `channels.discord.accounts` (see the multi-acc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Clawdbot starts Discord only when a `channels.discord` config section exists. The token is resolved from `DISCORD_BOT_TOKEN` or `channels.discord.token` (unless `channels.discord.enabled` is `false`). Use `user:<id>` (DM) or `channel:<id>` (guild channel) when specifying delivery targets for cron/CLI commands; bare numeric IDs are ambiguous and rejected.
|
Clawdbot starts Discord only when a `discord` config section exists. The token is resolved from `DISCORD_BOT_TOKEN` or `discord.token` (unless `discord.enabled` is `false`). Use `user:<id>` (DM) or `channel:<id>` (guild channel) when specifying delivery targets for cron/CLI commands; bare numeric IDs are ambiguous and rejected.
|
||||||
Guild slugs are lowercase with spaces replaced by `-`; channel keys use the slugged channel name (no leading `#`). Prefer guild ids as keys to avoid rename ambiguity.
|
Guild slugs are lowercase with spaces replaced by `-`; channel keys use the slugged channel name (no leading `#`). Prefer guild ids as keys to avoid rename ambiguity.
|
||||||
Bot-authored messages are ignored by default. Enable with `channels.discord.allowBots` (own messages are still filtered to prevent self-reply loops).
|
Bot-authored messages are ignored by default. Enable with `discord.allowBots` (own messages are still filtered to prevent self-reply loops).
|
||||||
Reaction notification modes:
|
Reaction notification modes:
|
||||||
- `off`: no reaction events.
|
- `off`: no reaction events.
|
||||||
- `own`: reactions on the bot's own messages (default).
|
- `own`: reactions on the bot's own messages (default).
|
||||||
- `all`: all reactions on all messages.
|
- `all`: all reactions on all messages.
|
||||||
- `allowlist`: reactions from `guilds.<id>.users` on all messages (empty list disables).
|
- `allowlist`: reactions from `guilds.<id>.users` on all messages (empty list disables).
|
||||||
Outbound text is chunked by `channels.discord.textChunkLimit` (default 2000). Discord clients can clip very tall messages, so `channels.discord.maxLinesPerMessage` (default 17) splits long multi-line replies even when under 2000 chars.
|
Outbound text is chunked by `discord.textChunkLimit` (default 2000). Discord clients can clip very tall messages, so `discord.maxLinesPerMessage` (default 17) splits long multi-line replies even when under 2000 chars.
|
||||||
Retry policy defaults and behavior are documented in [Retry policy](/concepts/retry).
|
Retry policy defaults and behavior are documented in [Retry policy](/concepts/retry).
|
||||||
|
|
||||||
### `channels.slack` (socket mode)
|
### `slack` (socket mode)
|
||||||
|
|
||||||
Slack runs in Socket Mode and requires both a bot token and app token:
|
Slack runs in Socket Mode and requires both a bot token and app token:
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
slack: {
|
slack: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
botToken: "xoxb-...",
|
botToken: "xoxb-...",
|
||||||
@@ -1051,21 +977,19 @@ Slack runs in Socket Mode and requires both a bot token and app token:
|
|||||||
mediaMaxMb: 20
|
mediaMaxMb: 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Multi-account support lives under `channels.slack.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
Multi-account support lives under `slack.accounts` (see the multi-account section above). Env tokens only apply to the default account.
|
||||||
|
|
||||||
Clawdbot starts Slack when the provider is enabled and both tokens are set (via config or `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN`). Use `user:<id>` (DM) or `channel:<id>` when specifying delivery targets for cron/CLI commands.
|
Clawdbot starts Slack when the provider is enabled and both tokens are set (via config or `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN`). Use `user:<id>` (DM) or `channel:<id>` when specifying delivery targets for cron/CLI commands.
|
||||||
Set `channels.slack.configWrites: false` to block Slack-initiated config writes (including channel ID migrations and `/config set|unset`).
|
|
||||||
|
|
||||||
Bot-authored messages are ignored by default. Enable with `channels.slack.allowBots` or `channels.slack.channels.<id>.allowBots`.
|
Bot-authored messages are ignored by default. Enable with `slack.allowBots` or `slack.channels.<id>.allowBots`.
|
||||||
|
|
||||||
Reaction notification modes:
|
Reaction notification modes:
|
||||||
- `off`: no reaction events.
|
- `off`: no reaction events.
|
||||||
- `own`: reactions on the bot's own messages (default).
|
- `own`: reactions on the bot's own messages (default).
|
||||||
- `all`: all reactions on all messages.
|
- `all`: all reactions on all messages.
|
||||||
- `allowlist`: reactions from `channels.slack.reactionAllowlist` on all messages (empty list disables).
|
- `allowlist`: reactions from `slack.reactionAllowlist` on all messages (empty list disables).
|
||||||
|
|
||||||
Slack action groups (gate `slack` tool actions):
|
Slack action groups (gate `slack` tool actions):
|
||||||
| Action group | Default | Notes |
|
| Action group | Default | Notes |
|
||||||
@@ -1076,35 +1000,32 @@ Slack action groups (gate `slack` tool actions):
|
|||||||
| memberInfo | enabled | Member info |
|
| memberInfo | enabled | Member info |
|
||||||
| emojiList | enabled | Custom emoji list |
|
| emojiList | enabled | Custom emoji list |
|
||||||
|
|
||||||
### `channels.signal` (signal-cli)
|
### `signal` (signal-cli)
|
||||||
|
|
||||||
Signal reactions can emit system events (shared reaction tooling):
|
Signal reactions can emit system events (shared reaction tooling):
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
signal: {
|
signal: {
|
||||||
reactionNotifications: "own", // off | own | all | allowlist
|
reactionNotifications: "own", // off | own | all | allowlist
|
||||||
reactionAllowlist: ["+15551234567", "uuid:123e4567-e89b-12d3-a456-426614174000"],
|
reactionAllowlist: ["+15551234567", "uuid:123e4567-e89b-12d3-a456-426614174000"],
|
||||||
historyLimit: 50 // include last N group messages as context (0 disables)
|
historyLimit: 50 // include last N group messages as context (0 disables)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Reaction notification modes:
|
Reaction notification modes:
|
||||||
- `off`: no reaction events.
|
- `off`: no reaction events.
|
||||||
- `own`: reactions on the bot's own messages (default).
|
- `own`: reactions on the bot's own messages (default).
|
||||||
- `all`: all reactions on all messages.
|
- `all`: all reactions on all messages.
|
||||||
- `allowlist`: reactions from `channels.signal.reactionAllowlist` on all messages (empty list disables).
|
- `allowlist`: reactions from `signal.reactionAllowlist` on all messages (empty list disables).
|
||||||
|
|
||||||
### `channels.imessage` (imsg CLI)
|
### `imessage` (imsg CLI)
|
||||||
|
|
||||||
Clawdbot spawns `imsg rpc` (JSON-RPC over stdio). No daemon or port required.
|
Clawdbot spawns `imsg rpc` (JSON-RPC over stdio). No daemon or port required.
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
channels: {
|
|
||||||
imessage: {
|
imessage: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
cliPath: "imsg",
|
cliPath: "imsg",
|
||||||
@@ -1118,16 +1039,15 @@ Clawdbot spawns `imsg rpc` (JSON-RPC over stdio). No daemon or port required.
|
|||||||
region: "US"
|
region: "US"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Multi-account support lives under `channels.imessage.accounts` (see the multi-account section above).
|
Multi-account support lives under `imessage.accounts` (see the multi-account section above).
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- Requires Full Disk Access to the Messages DB.
|
- Requires Full Disk Access to the Messages DB.
|
||||||
- The first send will prompt for Messages automation permission.
|
- The first send will prompt for Messages automation permission.
|
||||||
- Prefer `chat_id:<id>` targets. Use `imsg chats --limit 20` to list chats.
|
- Prefer `chat_id:<id>` targets. Use `imsg chats --limit 20` to list chats.
|
||||||
- `channels.imessage.cliPath` can point to a wrapper script (e.g. `ssh` to another Mac that runs `imsg rpc`); use SSH keys to avoid password prompts.
|
- `imessage.cliPath` can point to a wrapper script (e.g. `ssh` to another Mac that runs `imsg rpc`); use SSH keys to avoid password prompts.
|
||||||
|
|
||||||
Example wrapper:
|
Example wrapper:
|
||||||
```bash
|
```bash
|
||||||
@@ -1204,19 +1124,19 @@ See [Messages](/concepts/messages) for queueing, sessions, and streaming context
|
|||||||
```
|
```
|
||||||
|
|
||||||
`responsePrefix` is applied to **all outbound replies** (tool summaries, block
|
`responsePrefix` is applied to **all outbound replies** (tool summaries, block
|
||||||
streaming, final replies) across channels unless already present.
|
streaming, final replies) across providers unless already present.
|
||||||
|
|
||||||
If `messages.responsePrefix` is unset, no prefix is applied by default.
|
If `messages.responsePrefix` is unset, no prefix is applied by default.
|
||||||
Set it to `"auto"` to derive `[{identity.name}]` for the routed agent (when set).
|
Set it to `"auto"` to derive `[{identity.name}]` for the routed agent (when set).
|
||||||
|
|
||||||
WhatsApp inbound prefix is configured via `channels.whatsapp.messagePrefix` (deprecated:
|
WhatsApp inbound prefix is configured via `whatsapp.messagePrefix` (deprecated:
|
||||||
`messages.messagePrefix`). Default stays **unchanged**: `"[clawdbot]"` when
|
`messages.messagePrefix`). Default stays **unchanged**: `"[clawdbot]"` when
|
||||||
`channels.whatsapp.allowFrom` is empty, otherwise `""` (no prefix). When using
|
`whatsapp.allowFrom` is empty, otherwise `""` (no prefix). When using
|
||||||
`"[clawdbot]"`, Clawdbot will instead use `[{identity.name}]` when the routed
|
`"[clawdbot]"`, Clawdbot will instead use `[{identity.name}]` when the routed
|
||||||
agent has `identity.name` set.
|
agent has `identity.name` set.
|
||||||
|
|
||||||
`ackReaction` sends a best-effort emoji reaction to acknowledge inbound messages
|
`ackReaction` sends a best-effort emoji reaction to acknowledge inbound messages
|
||||||
on channels that support reactions (Slack/Discord/Telegram). Defaults to the
|
on providers that support reactions (Slack/Discord/Telegram). Defaults to the
|
||||||
active agent’s `identity.emoji` when set, otherwise `"👀"`. Set it to `""` to disable.
|
active agent’s `identity.emoji` when set, otherwise `"👀"`. Set it to `""` to disable.
|
||||||
|
|
||||||
`ackReactionScope` controls when reactions fire:
|
`ackReactionScope` controls when reactions fire:
|
||||||
@@ -1297,27 +1217,6 @@ is already present in `agents.defaults.models`:
|
|||||||
|
|
||||||
If you configure the same alias name (case-insensitive) yourself, your value wins (defaults never override).
|
If you configure the same alias name (case-insensitive) yourself, your value wins (defaults never override).
|
||||||
|
|
||||||
Example: Opus 4.5 primary with MiniMax M2.1 fallback (hosted MiniMax):
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
agents: {
|
|
||||||
defaults: {
|
|
||||||
models: {
|
|
||||||
"anthropic/claude-opus-4-5": { alias: "opus" },
|
|
||||||
"minimax/MiniMax-M2.1": { alias: "minimax" }
|
|
||||||
},
|
|
||||||
model: {
|
|
||||||
primary: "anthropic/claude-opus-4-5",
|
|
||||||
fallbacks: ["minimax/MiniMax-M2.1"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
MiniMax auth: set `MINIMAX_API_KEY` (env) or configure `models.providers.minimax`.
|
|
||||||
|
|
||||||
#### `agents.defaults.cliBackends` (CLI fallback)
|
#### `agents.defaults.cliBackends` (CLI fallback)
|
||||||
|
|
||||||
Optional CLI backends for text-only fallback runs (no tool calls). These are useful as a
|
Optional CLI backends for text-only fallback runs (no tool calls). These are useful as a
|
||||||
@@ -1539,8 +1438,8 @@ Example (tuned):
|
|||||||
|
|
||||||
Block streaming:
|
Block streaming:
|
||||||
- `agents.defaults.blockStreamingDefault`: `"on"`/`"off"` (default off).
|
- `agents.defaults.blockStreamingDefault`: `"on"`/`"off"` (default off).
|
||||||
- Channel overrides: `*.blockStreaming` (and per-account variants) to force block streaming on/off.
|
- Provider overrides: `*.blockStreaming` (and per-account variants) to force block streaming on/off.
|
||||||
Non-Telegram channels require an explicit `*.blockStreaming: true` to enable block replies.
|
Non-Telegram providers require an explicit `*.blockStreaming: true` to enable block replies.
|
||||||
- `agents.defaults.blockStreamingBreak`: `"text_end"` or `"message_end"` (default: text_end).
|
- `agents.defaults.blockStreamingBreak`: `"text_end"` or `"message_end"` (default: text_end).
|
||||||
- `agents.defaults.blockStreamingChunk`: soft chunking for streamed blocks. Defaults to
|
- `agents.defaults.blockStreamingChunk`: soft chunking for streamed blocks. Defaults to
|
||||||
800–1200 chars, prefers paragraph breaks (`\n\n`), then newlines, then sentences.
|
800–1200 chars, prefers paragraph breaks (`\n\n`), then newlines, then sentences.
|
||||||
@@ -1552,11 +1451,11 @@ Block streaming:
|
|||||||
```
|
```
|
||||||
- `agents.defaults.blockStreamingCoalesce`: merge streamed blocks before sending.
|
- `agents.defaults.blockStreamingCoalesce`: merge streamed blocks before sending.
|
||||||
Defaults to `{ idleMs: 1000 }` and inherits `minChars` from `blockStreamingChunk`
|
Defaults to `{ idleMs: 1000 }` and inherits `minChars` from `blockStreamingChunk`
|
||||||
with `maxChars` capped to the channel text limit. Signal/Slack/Discord default
|
with `maxChars` capped to the provider text limit. Signal/Slack/Discord default
|
||||||
to `minChars: 1500` unless overridden.
|
to `minChars: 1500` unless overridden.
|
||||||
Channel overrides: `channels.whatsapp.blockStreamingCoalesce`, `channels.telegram.blockStreamingCoalesce`,
|
Provider overrides: `whatsapp.blockStreamingCoalesce`, `telegram.blockStreamingCoalesce`,
|
||||||
`channels.discord.blockStreamingCoalesce`, `channels.slack.blockStreamingCoalesce`, `channels.signal.blockStreamingCoalesce`,
|
`discord.blockStreamingCoalesce`, `slack.blockStreamingCoalesce`, `signal.blockStreamingCoalesce`,
|
||||||
`channels.imessage.blockStreamingCoalesce`, `channels.msteams.blockStreamingCoalesce` (and per-account variants).
|
`imessage.blockStreamingCoalesce`, `msteams.blockStreamingCoalesce` (and per-account variants).
|
||||||
- `agents.defaults.humanDelay`: randomized pause between **block replies** after the first.
|
- `agents.defaults.humanDelay`: randomized pause between **block replies** after the first.
|
||||||
Modes: `off` (default), `natural` (800–2500ms), `custom` (use `minMs`/`maxMs`).
|
Modes: `off` (default), `natural` (800–2500ms), `custom` (use `minMs`/`maxMs`).
|
||||||
Per-agent override: `agents.list[].humanDelay`.
|
Per-agent override: `agents.list[].humanDelay`.
|
||||||
@@ -1588,8 +1487,8 @@ Z.AI models are available as `zai/<model>` (e.g. `zai/glm-4.7`) and require
|
|||||||
`30m`. Set `0m` to disable.
|
`30m`. Set `0m` to disable.
|
||||||
- `model`: optional override model for heartbeat runs (`provider/model`).
|
- `model`: optional override model for heartbeat runs (`provider/model`).
|
||||||
- `includeReasoning`: when `true`, heartbeats will also deliver the separate `Reasoning:` message when available (same shape as `/reasoning on`). Default: `false`.
|
- `includeReasoning`: when `true`, heartbeats will also deliver the separate `Reasoning:` message when available (same shape as `/reasoning on`). Default: `false`.
|
||||||
- `target`: optional delivery channel (`last`, `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `none`). Default: `last`.
|
- `target`: optional delivery provider (`last`, `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `none`). Default: `last`.
|
||||||
- `to`: optional recipient override (channel-specific id, e.g. E.164 for WhatsApp, chat id for Telegram).
|
- `to`: optional recipient override (provider-specific id, e.g. E.164 for WhatsApp, chat id for Telegram).
|
||||||
- `prompt`: optional override for the heartbeat body (default: `Read HEARTBEAT.md if exists. Consider outstanding tasks. Checkup sometimes on your human during (user local) day time.`). Overrides are sent verbatim; include a `Read HEARTBEAT.md if exists` line if you still want the file read.
|
- `prompt`: optional override for the heartbeat body (default: `Read HEARTBEAT.md if exists. Consider outstanding tasks. Checkup sometimes on your human during (user local) day time.`). Overrides are sent verbatim; include a `Read HEARTBEAT.md if exists` line if you still want the file read.
|
||||||
- `ackMaxChars`: max chars allowed after `HEARTBEAT_OK` before delivery (default: 300).
|
- `ackMaxChars`: max chars allowed after `HEARTBEAT_OK` before delivery (default: 300).
|
||||||
|
|
||||||
@@ -1605,18 +1504,6 @@ of `every`, keep `HEARTBEAT.md` tiny, and/or choose a cheaper `model`.
|
|||||||
Note: `applyPatch` is only under `tools.exec` (no `tools.bash` alias).
|
Note: `applyPatch` is only under `tools.exec` (no `tools.bash` alias).
|
||||||
Legacy: `tools.bash` is still accepted as an alias.
|
Legacy: `tools.bash` is still accepted as an alias.
|
||||||
|
|
||||||
`tools.web` configures web search + fetch tools:
|
|
||||||
- `tools.web.search.enabled` (default: true when key is present)
|
|
||||||
- `tools.web.search.apiKey` (recommended: set via `clawdbot configure --section web`, or use `BRAVE_API_KEY` env var)
|
|
||||||
- `tools.web.search.maxResults` (1–10, default 5)
|
|
||||||
- `tools.web.search.timeoutSeconds` (default 30)
|
|
||||||
- `tools.web.search.cacheTtlMinutes` (default 15)
|
|
||||||
- `tools.web.fetch.enabled` (default false; sandboxed sessions auto-enable unless set to false)
|
|
||||||
- `tools.web.fetch.maxChars` (default 50000)
|
|
||||||
- `tools.web.fetch.timeoutSeconds` (default 30)
|
|
||||||
- `tools.web.fetch.cacheTtlMinutes` (default 15)
|
|
||||||
- `tools.web.fetch.userAgent` (optional override)
|
|
||||||
|
|
||||||
`agents.defaults.subagents` configures sub-agent defaults:
|
`agents.defaults.subagents` configures sub-agent defaults:
|
||||||
- `model`: default model for spawned sub-agents (string or `{ primary, fallbacks }`). If omitted, sub-agents inherit the caller’s model unless overridden per agent or per call.
|
- `model`: default model for spawned sub-agents (string or `{ primary, fallbacks }`). If omitted, sub-agents inherit the caller’s model unless overridden per agent or per call.
|
||||||
- `maxConcurrent`: max concurrent sub-agent runs (default 1)
|
- `maxConcurrent`: max concurrent sub-agent runs (default 1)
|
||||||
@@ -1651,37 +1538,6 @@ Example (coding profile, but deny exec/process everywhere):
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`tools.byProvider` lets you **further restrict** tools for specific providers (or a single `provider/model`).
|
|
||||||
Per-agent override: `agents.list[].tools.byProvider`.
|
|
||||||
|
|
||||||
Order: base profile → provider profile → allow/deny policies.
|
|
||||||
Provider keys accept either `provider` (e.g. `google-antigravity`) or `provider/model`
|
|
||||||
(e.g. `openai/gpt-5.2`).
|
|
||||||
|
|
||||||
Example (keep global coding profile, but minimal tools for Google Antigravity):
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
tools: {
|
|
||||||
profile: "coding",
|
|
||||||
byProvider: {
|
|
||||||
"google-antigravity": { profile: "minimal" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Example (provider/model-specific allowlist):
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
tools: {
|
|
||||||
allow: ["group:fs", "group:runtime", "sessions_list"],
|
|
||||||
byProvider: {
|
|
||||||
"openai/gpt-5.2": { allow: ["group:fs", "sessions_list"] }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
`tools.allow` / `tools.deny` configure a global tool allow/deny policy (deny wins).
|
`tools.allow` / `tools.deny` configure a global tool allow/deny policy (deny wins).
|
||||||
This is applied even when the Docker sandbox is **off**.
|
This is applied even when the Docker sandbox is **off**.
|
||||||
|
|
||||||
@@ -1697,7 +1553,6 @@ Tool groups (shorthands) work in **global** and **per-agent** tool policies:
|
|||||||
- `group:fs`: `read`, `write`, `edit`, `apply_patch`
|
- `group:fs`: `read`, `write`, `edit`, `apply_patch`
|
||||||
- `group:sessions`: `sessions_list`, `sessions_history`, `sessions_send`, `sessions_spawn`, `session_status`
|
- `group:sessions`: `sessions_list`, `sessions_history`, `sessions_send`, `sessions_spawn`, `session_status`
|
||||||
- `group:memory`: `memory_search`, `memory_get`
|
- `group:memory`: `memory_search`, `memory_get`
|
||||||
- `group:web`: `web_search`, `web_fetch`
|
|
||||||
- `group:ui`: `browser`, `canvas`
|
- `group:ui`: `browser`, `canvas`
|
||||||
- `group:automation`: `cron`, `gateway`
|
- `group:automation`: `cron`, `gateway`
|
||||||
- `group:messaging`: `message`
|
- `group:messaging`: `message`
|
||||||
@@ -1706,10 +1561,10 @@ Tool groups (shorthands) work in **global** and **per-agent** tool policies:
|
|||||||
|
|
||||||
`tools.elevated` controls elevated (host) exec access:
|
`tools.elevated` controls elevated (host) exec access:
|
||||||
- `enabled`: allow elevated mode (default true)
|
- `enabled`: allow elevated mode (default true)
|
||||||
- `allowFrom`: per-channel allowlists (empty = disabled)
|
- `allowFrom`: per-provider allowlists (empty = disabled)
|
||||||
- `whatsapp`: E.164 numbers
|
- `whatsapp`: E.164 numbers
|
||||||
- `telegram`: chat ids or usernames
|
- `telegram`: chat ids or usernames
|
||||||
- `discord`: user ids or usernames (falls back to `channels.discord.dm.allowFrom` if omitted)
|
- `discord`: user ids or usernames (falls back to `discord.dm.allowFrom` if omitted)
|
||||||
- `signal`: E.164 numbers
|
- `signal`: E.164 numbers
|
||||||
- `imessage`: handles/chat ids
|
- `imessage`: handles/chat ids
|
||||||
- `webchat`: session ids or usernames
|
- `webchat`: session ids or usernames
|
||||||
@@ -2184,7 +2039,7 @@ Controls session scoping, idle expiry, reset triggers, and where the session sto
|
|||||||
},
|
},
|
||||||
sendPolicy: {
|
sendPolicy: {
|
||||||
rules: [
|
rules: [
|
||||||
{ action: "deny", match: { channel: "discord", chatType: "group" } }
|
{ action: "deny", match: { provider: "discord", chatType: "group" } }
|
||||||
],
|
],
|
||||||
default: "allow"
|
default: "allow"
|
||||||
}
|
}
|
||||||
@@ -2197,7 +2052,7 @@ Fields:
|
|||||||
- Sandbox note: `agents.defaults.sandbox.mode: "non-main"` uses this key to detect the main session. Any session key that does not match `mainKey` (groups/channels) is sandboxed.
|
- Sandbox note: `agents.defaults.sandbox.mode: "non-main"` uses this key to detect the main session. Any session key that does not match `mainKey` (groups/channels) is sandboxed.
|
||||||
- `agentToAgent.maxPingPongTurns`: max reply-back turns between requester/target (0–5, default 5).
|
- `agentToAgent.maxPingPongTurns`: max reply-back turns between requester/target (0–5, default 5).
|
||||||
- `sendPolicy.default`: `allow` or `deny` fallback when no rule matches.
|
- `sendPolicy.default`: `allow` or `deny` fallback when no rule matches.
|
||||||
- `sendPolicy.rules[]`: match by `channel`, `chatType` (`direct|group|room`), or `keyPrefix` (e.g. `cron:`). First deny wins; otherwise allow.
|
- `sendPolicy.rules[]`: match by `provider`, `chatType` (`direct|group|room`), or `keyPrefix` (e.g. `cron:`). First deny wins; otherwise allow.
|
||||||
|
|
||||||
### `skills` (skills config)
|
### `skills` (skills config)
|
||||||
|
|
||||||
@@ -2223,7 +2078,7 @@ Example:
|
|||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
skills: {
|
skills: {
|
||||||
allowBundled: ["gemini", "peekaboo"],
|
allowBundled: ["brave-search", "gemini"],
|
||||||
load: {
|
load: {
|
||||||
extraDirs: [
|
extraDirs: [
|
||||||
"~/Projects/agent-scripts/skills",
|
"~/Projects/agent-scripts/skills",
|
||||||
@@ -2449,8 +2304,8 @@ Hot-applied (no full gateway restart):
|
|||||||
- `browser` (browser control server restart)
|
- `browser` (browser control server restart)
|
||||||
- `cron` (cron service restart + concurrency update)
|
- `cron` (cron service restart + concurrency update)
|
||||||
- `agents.defaults.heartbeat` (heartbeat runner restart)
|
- `agents.defaults.heartbeat` (heartbeat runner restart)
|
||||||
- `web` (WhatsApp web channel restart)
|
- `web` (WhatsApp web provider restart)
|
||||||
- `telegram`, `discord`, `signal`, `imessage` (channel restarts)
|
- `telegram`, `discord`, `signal`, `imessage` (provider restarts)
|
||||||
- `agent`, `models`, `routing`, `messages`, `session`, `whatsapp`, `logging`, `skills`, `ui`, `talk`, `identity`, `wizard` (dynamic reads)
|
- `agent`, `models`, `routing`, `messages`, `session`, `whatsapp`, `logging`, `skills`, `ui`, `talk`, `identity`, `wizard` (dynamic reads)
|
||||||
|
|
||||||
Requires full Gateway restart:
|
Requires full Gateway restart:
|
||||||
@@ -2509,7 +2364,7 @@ Defaults:
|
|||||||
messageTemplate:
|
messageTemplate:
|
||||||
"From: {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}",
|
"From: {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}",
|
||||||
deliver: true,
|
deliver: true,
|
||||||
channel: "last",
|
provider: "last",
|
||||||
model: "openai/gpt-5.2-mini",
|
model: "openai/gpt-5.2-mini",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -2524,7 +2379,7 @@ Requests must include the hook token:
|
|||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
- `POST /hooks/wake` → `{ text, mode?: "now"|"next-heartbeat" }`
|
- `POST /hooks/wake` → `{ text, mode?: "now"|"next-heartbeat" }`
|
||||||
- `POST /hooks/agent` → `{ message, name?, sessionKey?, wakeMode?, deliver?, channel?, to?, model?, thinking?, timeoutSeconds? }`
|
- `POST /hooks/agent` → `{ message, name?, sessionKey?, wakeMode?, deliver?, provider?, to?, model?, thinking?, timeoutSeconds? }`
|
||||||
- `POST /hooks/<name>` → resolved via `hooks.mappings`
|
- `POST /hooks/<name>` → resolved via `hooks.mappings`
|
||||||
|
|
||||||
`/hooks/agent` always posts a summary into the main session (and can optionally trigger an immediate heartbeat via `wakeMode: "now"`).
|
`/hooks/agent` always posts a summary into the main session (and can optionally trigger an immediate heartbeat via `wakeMode: "now"`).
|
||||||
@@ -2534,8 +2389,8 @@ Mapping notes:
|
|||||||
- `match.source` matches a payload field (e.g. `{ source: "gmail" }`) so you can use a generic `/hooks/ingest` path.
|
- `match.source` matches a payload field (e.g. `{ source: "gmail" }`) so you can use a generic `/hooks/ingest` path.
|
||||||
- Templates like `{{messages[0].subject}}` read from the payload.
|
- Templates like `{{messages[0].subject}}` read from the payload.
|
||||||
- `transform` can point to a JS/TS module that returns a hook action.
|
- `transform` can point to a JS/TS module that returns a hook action.
|
||||||
- `deliver: true` sends the final reply to a channel; `channel` defaults to `last` (falls back to WhatsApp).
|
- `deliver: true` sends the final reply to a provider; `provider` defaults to `last` (falls back to WhatsApp).
|
||||||
- If there is no prior delivery route, set `channel` + `to` explicitly (required for Telegram/Discord/Slack/Signal/iMessage/MS Teams).
|
- If there is no prior delivery route, set `provider` + `to` explicitly (required for Telegram/Discord/Slack/Signal/iMessage/MS Teams).
|
||||||
- `model` overrides the LLM for this hook run (`provider/model` or alias; must be allowed if `agents.defaults.models` is set).
|
- `model` overrides the LLM for this hook run (`provider/model` or alias; must be allowed if `agents.defaults.models` is set).
|
||||||
|
|
||||||
Gmail helper config (used by `clawdbot hooks gmail setup` / `run`):
|
Gmail helper config (used by `clawdbot hooks gmail setup` / `run`):
|
||||||
@@ -2674,9 +2529,9 @@ Template placeholders are expanded in `tools.audio.transcription.args` (and any
|
|||||||
| `{{Body}}` | Full inbound message body |
|
| `{{Body}}` | Full inbound message body |
|
||||||
| `{{RawBody}}` | Raw inbound message body (no history/sender wrappers; best for command parsing) |
|
| `{{RawBody}}` | Raw inbound message body (no history/sender wrappers; best for command parsing) |
|
||||||
| `{{BodyStripped}}` | Body with group mentions stripped (best default for agents) |
|
| `{{BodyStripped}}` | Body with group mentions stripped (best default for agents) |
|
||||||
| `{{From}}` | Sender identifier (E.164 for WhatsApp; may differ per channel) |
|
| `{{From}}` | Sender identifier (E.164 for WhatsApp; may differ per provider) |
|
||||||
| `{{To}}` | Destination identifier |
|
| `{{To}}` | Destination identifier |
|
||||||
| `{{MessageSid}}` | Channel message id (when available) |
|
| `{{MessageSid}}` | Provider message id (when available) |
|
||||||
| `{{SessionId}}` | Current session UUID |
|
| `{{SessionId}}` | Current session UUID |
|
||||||
| `{{IsNewSession}}` | `"true"` when a new session was created |
|
| `{{IsNewSession}}` | `"true"` when a new session was created |
|
||||||
| `{{MediaUrl}}` | Inbound media pseudo-URL (if present) |
|
| `{{MediaUrl}}` | Inbound media pseudo-URL (if present) |
|
||||||
|
|||||||
Loaded 100 of 2080 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user