Agent 工具

pi-jev

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

基于 TypeSafe Jev,为 Pi 编码 agent 提供语义工具路由和类型化的 System One 决策。

英文原文

Semantic tool routing and typed System One decisions for the Pi coding agent using TypeSafe Jev

TheoOliveira/pi-jev

它在哪儿调用了 Jev

import { TypeSafeClient, choice, noul, score } from "@typesafe-ai/sdk";

src/jev.ts:1

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

它问 Jev 的问题

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

取自 src/commands.ts:93

  1. is_billing是/否

    Is this message related to a billing issue?

  2. category选项

    Which category does this issue fall into?

    • billingBilling, invoices, card issues
    • bugSoftware bug or crash
    • otherGeneral questions

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    is_billing: { type: 'boolean', instructions: 'Is this message related to a billing issue?' },
    category: { type: 'choice', instructions: 'Which category does this issue fall into?',
      criteria: { billing: 'Billing, invoices, card issues', bug: 'Software bug or crash', other: 'General questions' } },
  },
});

取自 src/gate.ts:149

  1. gate_passed是/否

    Does the provided code/output satisfy this acceptance criteria: "${options.criteria}"?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    gate_passed: { type: 'boolean', instructions: 'Does the provided code/output satisfy this acceptance criteria: "${options.criteria}"?' },
  },
});

取自 src/orchestrator.ts:41

  1. topology选项

    What type of workflow is best suited for this task?

    • implementationCode change, bugfix, refactoring, feature implementation, or file modifications
    • researchInvestigating codebase, external research, architectural analysis, or exploration
    • reviewCode review, security audit, checking compliance or reviewing a pull request
    • generalGeneral question or task not requiring multi-stage implementation

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    topology: { type: 'choice', instructions: 'What type of workflow is best suited for this task?',
      criteria: { implementation: 'Code change, bugfix, refactoring, feature implementation, or file modifications', research: 'Investigating codebase, external research, architectural analysis, or exploration', review: 'Code review, security audit, checking compliance or reviewing a pull request', general: 'General question or task not requiring multi-stage implementation' } },
  },
});

取自 test/commands.test.ts:86

  1. is_risky是/否

    Is this risky?

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    is_risky: { type: 'boolean', instructions: 'Is this risky?' },
  },
});

同类的其他项目