Agent tooling
Connect TypeSafe Jev to Grok Bot as a cheap decision layer - usage gates, skill template, examples
from typesafe_sdk import TypeSafeClientThe link points at the commit we read, so the line number still holds.
These question sets are lifted from this project's source exactly as written.
from src/router.py:54
intentchoiceWhat kind of work does this request mainly need?
chat — Short answer or conversation; no tools neededlookup — Known file/API/status check; mostly deterministicresearch — Need web/search and synthesisbrowser — Need interactive browser clickscoding — Edit code / tests / repo workwrite — Draft long prose/email/docaccount — Send, publish, pay, delete, change permissionsreuse_cachetrue/falseIs there already a fresh enough cached result that should be reused instead of doing new heavy work?
needs_subagenttrue/falseDoes this clearly need an extra specialized bot (research/browser/coding) beyond one Grok Bot turn?
stop_retrytrue/falseGiven prior_error and same_error_count, should we STOP retrying the same approach?
complexityscoreHow much Grok Bot effort is justified?
0 — Trivial — one step or cached1 — Normal — short tool use2 — Heavy — multi-step research/browser/codingimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'choice', instructions: 'What kind of work does this request mainly need?',
criteria: { chat: 'Short answer or conversation; no tools needed', lookup: 'Known file/API/status check; mostly deterministic', research: 'Need web/search and synthesis', browser: 'Need interactive browser clicks', coding: 'Edit code / tests / repo work', write: 'Draft long prose/email/doc', account: 'Send, publish, pay, delete, change permissions' } },
reuse_cache: { type: 'boolean', instructions: 'Is there already a fresh enough cached result that should be reused instead of doing new heavy work?' },
needs_subagent: { type: 'boolean', instructions: 'Does this clearly need an extra specialized bot (research/browser/coding) beyond one Grok Bot turn?' },
stop_retry: { type: 'boolean', instructions: 'Given prior_error and same_error_count, should we STOP retrying the same approach?' },
complexity: { type: 'score', instructions: 'How much Grok Bot effort is justified?',
criteria: ['Trivial — one step or cached', 'Normal — short tool use', 'Heavy — multi-step research/browser/coding'] },
},
});