Agent 工具

tenbin

@simota2TypeScriptMIT更新于 2026-09-18可当场跑

基于TypeSafe AI System One API的MCP服务器和agent技能,将判断分解为Choice、Score、Noul问题,进行代码校验和标注数据测量,并设置校准阈值。

英文原文

MCP server and agent skill for the TypeSafe AI System One API (Jev): decompose a judgment into Choice / Score / Noul questions, lint them, measure on labelled data, and put calibrated thresholds in code

simota/tenbin

它在哪儿调用了 Jev

if (err instanceof APIConnectionError) return `Could not reach api.typesafe.ai: ${err.message}. Check network access.`;

tenbin/src/client.ts:167

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 skills/tenbin/templates/questions.py:10

  1. category选项

    What is this support message about?

    • bug_reportSomething in the product behaves wrongly
    • billingCharges, invoices, refunds, payment methods
    • feature_requestAsks for something the product does not do
    • otherNone of the above
  2. bug_severity打分

    If the message reports a bug, how severe is it?

    • 0Cosmetic or wording issue
    • 1Broken feature, but a workaround exists
    • 2Broken feature with no workaround
    • 3Data loss, security exposure or the product is unusable
  3. has_repro_steps是/否

    The message contains steps that would let an engineer reproduce the problem

  4. refund_requested是/否

    The customer asks for money back

  5. frustration打分

    How frustrated is the customer?

    • 0Calm, states facts
    • 1Frustrated but civil
    • 2Very angry, strong language or threatens to leave
    • 3Abusive or threatening

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    category: { type: 'choice', instructions: 'What is this support message about?',
      criteria: { bug_report: 'Something in the product behaves wrongly', billing: 'Charges, invoices, refunds, payment methods', feature_request: 'Asks for something the product does not do', other: 'None of the above' } },
    bug_severity: { type: 'score', instructions: 'If the message reports a bug, how severe is it?',
      criteria: ['Cosmetic or wording issue', 'Broken feature, but a workaround exists', 'Broken feature with no workaround', 'Data loss, security exposure or the product is unusable'] },
    has_repro_steps: { type: 'boolean', instructions: 'The message contains steps that would let an engineer reproduce the problem' },
    refund_requested: { type: 'boolean', instructions: 'The customer asks for money back' },
    frustration: { type: 'score', instructions: 'How frustrated is the customer?',
      criteria: ['Calm, states facts', 'Frustrated but civil', 'Very angry, strong language or threatens to leave', 'Abusive or threatening'] },
  },
});

取自 tenbin/src/server.test.ts:90

  1. sev打分

    Rate severity from 0 to 2

    • 00
    • 11
    • 22

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    sev: { type: 'score', instructions: 'Rate severity from 0 to 2',
      criteria: ['0', '1', '2'] },
  },
});

取自 tenbin/src/server.test.ts:102

  1. department选项

    Which team should handle this?

    • billingPayments
    • technicalBugs
  2. frustration打分

    How frustrated is the customer?

    • 0Calm, just stating facts
    • 1Frustrated but civil
    • 2Very angry, strong language
  3. is_urgent是/否

    Does the message convey urgency?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    department: { type: 'choice', instructions: 'Which team should handle this?',
      criteria: { billing: 'Payments', technical: 'Bugs' } },
    frustration: { type: 'score', instructions: 'How frustrated is the customer?',
      criteria: ['Calm, just stating facts', 'Frustrated but civil', 'Very angry, strong language'] },
    is_urgent: { type: 'boolean', instructions: 'Does the message convey urgency?' },
  },
});

取自 tenbin/src/server.test.ts:132

  1. is_urgent是/否

    Does the message convey urgency?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    is_urgent: { type: 'boolean', instructions: 'Does the message convey urgency?' },
  },
});

同类的其他项目