mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-04-22 17:32:42 +00:00
Compare commits
2 Commits
consolidat
...
daisy/plug
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c5162e4a | ||
|
|
cbfd4c8c82 |
@@ -1,11 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "discord",
|
"name": "discord",
|
||||||
"description": "Discord channel for Claude Code \u2014 messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /discord:access.",
|
"description": "Discord channel for Claude Code \u2014 messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /discord:access.",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"discord",
|
"discord",
|
||||||
"messaging",
|
"messaging",
|
||||||
"channel",
|
"channel",
|
||||||
"mcp"
|
"mcp"
|
||||||
]
|
],
|
||||||
|
"userConfig": {
|
||||||
|
"DISCORD_BOT_TOKEN": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Bot Token",
|
||||||
|
"description": "Bot token from the Discord Developer Portal. Stored in keychain (macOS) or ~/.claude/.credentials.json with 0600 permissions elsewhere. Never written to settings.json.",
|
||||||
|
"required": true,
|
||||||
|
"sensitive": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"discord": {
|
"discord": {
|
||||||
"command": "bun",
|
"command": "bun",
|
||||||
"args": ["run", "--cwd", "${CLAUDE_PLUGIN_ROOT}", "--shell=bun", "--silent", "start"]
|
"args": ["run", "--cwd", "${CLAUDE_PLUGIN_ROOT}", "--shell=bun", "--silent", "start"],
|
||||||
|
"env": {
|
||||||
|
"DISCORD_BOT_TOKEN": "${user_config.DISCORD_BOT_TOKEN}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ const ACCESS_FILE = join(STATE_DIR, 'access.json')
|
|||||||
const APPROVED_DIR = join(STATE_DIR, 'approved')
|
const APPROVED_DIR = join(STATE_DIR, 'approved')
|
||||||
const ENV_FILE = join(STATE_DIR, '.env')
|
const ENV_FILE = join(STATE_DIR, '.env')
|
||||||
|
|
||||||
// Load ~/.claude/channels/discord/.env into process.env. Real env wins.
|
// Token is injected via ${user_config.DISCORD_BOT_TOKEN} from .mcp.json —
|
||||||
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
// prompted at enable time, stored in keychain (macOS) or .credentials.json 0600
|
||||||
|
// elsewhere. The .env file below is a legacy fallback for users configured
|
||||||
|
// before H1 #3617646 — real env wins, so the injected value takes precedence.
|
||||||
try {
|
try {
|
||||||
// Token is a credential — lock to owner. No-op on Windows (would need ACLs).
|
// Defensive chmod for legacy .env files (no-op on Windows).
|
||||||
chmodSync(ENV_FILE, 0o600)
|
chmodSync(ENV_FILE, 0o600)
|
||||||
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
||||||
const m = line.match(/^(\w+)=(.*)$/)
|
const m = line.match(/^(\w+)=(.*)$/)
|
||||||
@@ -56,8 +58,8 @@ const STATIC = process.env.DISCORD_ACCESS_MODE === 'static'
|
|||||||
if (!TOKEN) {
|
if (!TOKEN) {
|
||||||
process.stderr.write(
|
process.stderr.write(
|
||||||
`discord channel: DISCORD_BOT_TOKEN required\n` +
|
`discord channel: DISCORD_BOT_TOKEN required\n` +
|
||||||
` set in ${ENV_FILE}\n` +
|
` re-enter via: /plugin manage → discord → Configure options\n` +
|
||||||
` format: DISCORD_BOT_TOKEN=MTIz...\n`,
|
` (stored in keychain/credentials.json, not settings.json)\n`,
|
||||||
)
|
)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "telegram",
|
"name": "telegram",
|
||||||
"description": "Telegram channel for Claude Code \u2014 messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /telegram:access.",
|
"description": "Telegram channel for Claude Code \u2014 messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /telegram:access.",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"telegram",
|
"telegram",
|
||||||
"messaging",
|
"messaging",
|
||||||
"channel",
|
"channel",
|
||||||
"mcp"
|
"mcp"
|
||||||
]
|
],
|
||||||
|
"userConfig": {
|
||||||
|
"TELEGRAM_BOT_TOKEN": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Bot Token",
|
||||||
|
"description": "Bot token from @BotFather — format is 123456789:AAH... Stored in keychain (macOS) or ~/.claude/.credentials.json with 0600 permissions elsewhere. Never written to settings.json.",
|
||||||
|
"required": true,
|
||||||
|
"sensitive": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"command": "bun",
|
"command": "bun",
|
||||||
"args": ["run", "--cwd", "${CLAUDE_PLUGIN_ROOT}", "--shell=bun", "--silent", "start"]
|
"args": ["run", "--cwd", "${CLAUDE_PLUGIN_ROOT}", "--shell=bun", "--silent", "start"],
|
||||||
|
"env": {
|
||||||
|
"TELEGRAM_BOT_TOKEN": "${user_config.TELEGRAM_BOT_TOKEN}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ const ACCESS_FILE = join(STATE_DIR, 'access.json')
|
|||||||
const APPROVED_DIR = join(STATE_DIR, 'approved')
|
const APPROVED_DIR = join(STATE_DIR, 'approved')
|
||||||
const ENV_FILE = join(STATE_DIR, '.env')
|
const ENV_FILE = join(STATE_DIR, '.env')
|
||||||
|
|
||||||
// Load ~/.claude/channels/telegram/.env into process.env. Real env wins.
|
// Token is injected via ${user_config.TELEGRAM_BOT_TOKEN} from .mcp.json —
|
||||||
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
// prompted at enable time, stored in keychain (macOS) or .credentials.json 0600
|
||||||
|
// elsewhere. The .env file below is a legacy fallback for users configured
|
||||||
|
// before H1 #3617646 — real env wins, so the injected value takes precedence.
|
||||||
try {
|
try {
|
||||||
// Token is a credential — lock to owner. No-op on Windows (would need ACLs).
|
// Defensive chmod for legacy .env files (no-op on Windows).
|
||||||
chmodSync(ENV_FILE, 0o600)
|
chmodSync(ENV_FILE, 0o600)
|
||||||
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
||||||
const m = line.match(/^(\w+)=(.*)$/)
|
const m = line.match(/^(\w+)=(.*)$/)
|
||||||
@@ -45,8 +47,8 @@ const STATIC = process.env.TELEGRAM_ACCESS_MODE === 'static'
|
|||||||
if (!TOKEN) {
|
if (!TOKEN) {
|
||||||
process.stderr.write(
|
process.stderr.write(
|
||||||
`telegram channel: TELEGRAM_BOT_TOKEN required\n` +
|
`telegram channel: TELEGRAM_BOT_TOKEN required\n` +
|
||||||
` set in ${ENV_FILE}\n` +
|
` re-enter via: /plugin manage → telegram → Configure options\n` +
|
||||||
` format: TELEGRAM_BOT_TOKEN=123456789:AAH...\n`,
|
` (stored in keychain/credentials.json, not settings.json)\n`,
|
||||||
)
|
)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user