توسعه‌دهندگان
ورود ناشر

افزونهٔ نمونه: تعهدات ایمیل

شخص یک ایمیل را در صفحهٔ این افزونه داخل کرسی می‌گذارد. افزونه تعهدهای آن را پیدا می‌کند و به‌جای همان شخص، ایمیل را منبع شخصی او می‌کند، هر تعهد همکار را به‌صورت کار پیشنهادی برای خودش می‌فرستد، برای هر گفتگو یک رکورد «رشتهٔ ایمیل» نگه می‌دارد و هزینه را از کیف پولش می‌دهد. کد کاملش، با تست‌ها و Dockerfile، در مخزن `korsi-plugin-email-commitments` است. هر نقطهٔ تماس افزونه با کرسی در آن هست:

  1. چرخهٔ عمر: POST /korsi/lifecycle، نصب با توکن و secret امضا، یا حذف.
  2. رویدادها: POST /korsi/events، امضاشده با همان secret؛ اول وارسی، بعد باور.
  3. صدا زدن کرسی: صفحهٔ افزونه (/plugin/v1) برای رکوردها، پیشنهادها، منبع‌ها و کیف پول، و سرور MCP کرسی برای خواندن بقیه.
  4. ابزارها: POST /korsi/tools/{name}؛ handle داخل بدنه کرسی را به‌جای همان شخص می‌خواند.
  5. صفحه‌ها: /app و /panels/desk در پوستهٔ کرسی، که Bridge را از همان کرسی بار می‌کنند.
برای شروع افزونهٔ خودتاناین manifest مال ناشر korsi است. اگر آن را الگو می‌کنید، publisher را کلید ناشر خودتان و id را شناسه‌ای زیر دامنهٔ خودتان بگذارید؛ وگرنه کاتالوگ ارسال را نمی‌پذیرد.

manifest افزونه: نوع رکورد «رشتهٔ ایمیل»، پیشنهاد اقدام، ورود پیام، یک ابزار برای کرسیار، اپ و ویجت میزکار، و دو پلن با MU.

# Korsi's sample plugin: commitments out of email.
#
# A person pastes an email into the plugin's page inside Korsi. On their behalf the plugin brings it
# in as their own source, proposes each commitment a colleague made in it as a task to that
# colleague, keeps a "thread" record per conversation -- so Korsyar can answer "what did we promise
# in that thread" -- and pays for the reading from its wallet.
#
# base_url is this machine in development; a deployment publishes a release with its own address.
schema: korsi.plugin/v1
id: ai.korsi.email-commitments
publisher: korsi
version: 0.1.0
plugin_api: ">=1.0,<2.0"
type: intake_connector
names:
  fa: "تعهدات ایمیل"
  en: "Email commitments"
  ar: "التزامات البريد"
summary:
  fa: "تعهدهای ایمیل‌ها را پیدا می‌کند و به‌صورت کار پیشنهادی برای مسئولش می‌فرستد."
  en: "Finds the commitments in email and proposes them as tasks to whoever owes them."
hue: "#1565C0"

runtime:
  placement: external
  base_url: http://localhost:8787

data_handling:
  egress: publisher
  stores: [message_metadata]
  retention_days: 30
  location: IR

scopes:
  required:
    - people.read
    - records.own
    - proposals.action
    - sources.intake.message
    - wallet.consume

record_types:
  - key: thread
    names: { fa: "رشتهٔ ایمیل", en: "Email thread" }
    visibility: personal
    title_field: subject
    schema:
      type: object
      required: [subject]
      properties:
        subject: { type: string, maxLength: 500 }
        participants: { type: array, maxItems: 50, items: { type: string, maxLength: 320 } }
        commitments: { type: integer, minimum: 0 }
        external_commitments: { type: integer, minimum: 0 }
        last_message_at: { type: string, format: date-time }

proposals: [action.create]
intake: [message]
events: []

tools:
  - name: find_commitments
    description:
      fa: "تعهدهایی که در ایمیل‌های یک شخص یا یک موضوع پیدا شده"
      en: "Commitments found in a person's email, or about a subject"
    input_schema:
      type: object
      properties:
        query: { type: string }

ui:
  app:
    entry: /app
    tabs:
      - key: inbox
        names: { fa: "صندوق", en: "Inbox" }
        path: /app/inbox
  panels:
    - point: desk.widget
      entry: /panels/desk
      names: { fa: "تعهدات تازه", en: "New commitments" }

settings_schema:
  type: object
  additionalProperties: false
  properties:
    min_confidence:
      type: number
      minimum: 0
      maximum: 1
      default: 0.5
      description: "Commitments found with less confidence are kept on the plugin's page but not proposed."

services:
  - key: message.read
    names: { fa: "خواندن یک ایمیل", en: "Read one message" }

plans:
  - key: monthly
    names: { fa: "ماهانه", en: "Monthly" }
    period: monthly
    mu: 100
    rates: { message.read: 1 }
  - key: yearly
    names: { fa: "سالانه", en: "Yearly" }
    period: yearly
    mu: 1000
    rates: { message.read: 0.8 }

support:
  contact: plugins@korsi.ai