From adc25e57f44170a8973ddb5802f680ebd91cee17 Mon Sep 17 00:00:00 2001 From: karti Date: Mon, 13 Apr 2026 16:59:59 -0700 Subject: [PATCH] feat: initial release --- .gitignore | 4 +++ AGENTS.md | 53 +++++++++++++++++++++++++++++++++ README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 34 +++++++++++++++++++++ src/index.ts | 42 ++++++++++++++++++++++++++ tsconfig.json | 19 ++++++++++++ 6 files changed, 234 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 README.md create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c01763c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +*.log +.env +dist/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..2c23fb4 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,53 @@ +# KartiCode — Agent Configuration + +**Karti.ai's OpenCode Plugin** + +## Overview + +KartiCode wraps oh-my-opencode and provides the same 11 built-in agents: + +| Agent | Mode | Purpose | +|-------|------|---------| +| Sisyphus | all | Main orchestrator, plans + delegates | +| Hephaestus | all | Autonomous deep worker | +| Oracle | subagent | Read-only consultant | +| Librarian | subagent | External docs/code search | +| Explore | subagent | Contextual grep | +| Atlas | primary | Todo-list orchestrator | +| Metis | subagent | Pre-planning consultant | +| Momus | subagent | Plan reviewer | +| Multimodal-Looker | subagent | PDF/image analysis | +| Prometheus | — | Strategic planner (internal) | +| Sisyphus-Junior | all | Category-spawned executor | + +## Custom Agents + +You can add custom agents via your KartiCode config at `~/.config/opencode/karticode.jsonc`: + +```jsonc +{ + "agents": { + "my-custom-agent": { + "model": "fireworks/kimi-k2p5-turbo", + "instructions": "You are a specialized agent for...", + "temperature": 0.1 + } + } +} +``` + +## MCP Servers + +KartiCode auto-configures these MCPs: + +| MCP | Type | Path | +|-----|------|------| +| search | local | `mcp-servers/search-mcp-server/dist/index.js` | +| mattermost | local | `mcp-servers/mattermost-mcp-server/mattermost-mcp-server` | +| caddy | local | `mcp-servers/caddy-mcp-server/dist/index.js` | +| gitea | local | `mcp-servers/gitea-mcp-server/dist/index.js` | + +## Related + +- `oh-my-opencode` - Base plugin that KartiCode wraps +- `~/.config/opencode/oh-my-openagent.jsonc` - Shared config location diff --git a/README.md b/README.md new file mode 100644 index 0000000..d991907 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# KartiCode + +Karti.ai's OpenCode plugin - wraps [oh-my-opencode](https://github.com/code-yeongyu/oh-my-openagent) with custom MCPs and team features. + +## What it includes + +### Base: oh-my-opencode +- 11 agents (Sisyphus, Oracle, Librarian, etc.) +- 26 tools +- 52 lifecycle hooks +- Background agent system +- Skill/command/MCP system + +### KartiCode additions: +- **Search MCP** - SearXNG-based web search +- **Mattermost MCP** - Team chat integration +- **Caddy MCP** - Reverse proxy management +- **Gitea MCP** - Self-hosted Git management + +## Installation + +```bash +# From npm (when published) +npm install -g karticode + +# From local source +cd karticode +npm link +``` + +## Configuration + +Add to your `~/.config/opencode/opencode.json`: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "plugin": ["karticode"] +} +``` + +Or for a specific project, add to `.opencode/opencode.json`. + +## Environment Variables + +Some MCPs require environment variables: + +```bash +# Mattermost (optional) +export MATTERMOST_HOST="https://your-mattermost-server.com" +export MATTERMOST_BOT_TOKEN="your-bot-token" +export MATTERMOST_PAT="your-personal-access-token" + +# Gitea (optional) +export GITEA_URL="https://your-gitea-server.com" +export GITEA_TOKEN="your-token" +``` + +## Structure + +``` +karticode/ +├── src/ +│ └── index.ts # Plugin entry point +├── dist/ # Compiled output +├── package.json +└── tsconfig.json +``` + +## Development + +```bash +# Build +npm run build + +# Watch mode (if you add a watch script) +npm run dev +``` + +## License + +MIT diff --git a/package.json b/package.json new file mode 100644 index 0000000..34b5b72 --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "karticode", + "version": "1.0.0", + "description": "Karti.ai's OpenCode plugin - wraps oh-my-opencode with custom MCPs and agents", + "main": "./dist/index.js", + "types": "dist/index.d.ts", + "type": "module", + "files": [ + "dist", + "assets" + ], + "scripts": { + "build": "tsc", + "prepare": "npm run build" + }, + "keywords": [ + "opencode", + "plugin", + "karticode", + "kartiai", + "mcp" + ], + "author": "Karti.ai", + "license": "MIT", + "dependencies": { + "oh-my-opencode": "^3.15.3", + "@opencode-ai/plugin": "^1.4.0", + "@opencode-ai/sdk": "^1.4.0" + }, + "devDependencies": { + "typescript": "^5.7.3", + "@types/node": "^20.0.0" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3c21233 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,42 @@ +import OhMyOpenCodePlugin from "oh-my-opencode" + +/** + * KartiCode Plugin - Karti.ai's OpenCode extension + * + * This is a thin wrapper around oh-my-opencode that: + * - Provides Karti.ai branding + * - Works with KartiCode-specific configuration + * - Is designed to work with ~/.config/opencode/karticode.jsonc + * + * The actual MCPs and customizations are configured via: + * - ~/.config/opencode/karticode.jsonc (user config) + * - .opencode/karticode.jsonc (project config) + */ + +const KartiCodePlugin = async (ctx: unknown) => { + // Initialize oh-my-opencode + const omoPlugin = await OhMyOpenCodePlugin(ctx as Parameters[0]) + + // Log KartiCode activation + process.stderr.write("[KartiCode] Plugin activated\n") + + // Return with KartiCode branding but all oh-my-opencode functionality + return { + ...omoPlugin, + name: "karticode", + } +} + +export default KartiCodePlugin + +// Re-export all types from oh-my-opencode +export type { + OhMyOpenCodeConfig, + AgentName, + AgentOverrideConfig, + AgentOverrides, + McpName, + HookName, + BuiltinCommandName, + ConfigLoadError, +} from "oh-my-opencode" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5888557 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "outDir": "./dist", + "rootDir": "./src", + "types": ["node"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +}