crivo-web / examples /basic /input.ts
dizyann's picture
feat: expose typed decide brick and terminal CLI
3f7a9b2
Raw History Blame Contribute Delete
1.49 kB
import type { DecideInput } from '../../src/index.js'
export const input = {
state: {
message: 'My card was charged twice for the same order. Please refund the duplicate charge.',
order: { status: 'paid', paymentCount: 2 }
},
decisions: [
{
id: 'intent',
type: 'choice',
instruction: 'Identify the primary intent of the customer.',
options: [
{ value: 'refund', description: 'The customer wants to recover money charged.' },
{ value: 'cancel', description: 'The customer wants to cancel an order.' },
{ value: 'other', description: 'The request does not match the other intents.' }
]
},
{
id: 'duplicateCharge',
type: 'noul',
instruction: 'The customer was charged twice for the same order.',
outcomes: {
false: { description: 'There was one charge or the charges were for different orders.' },
true: { description: 'The same order was charged more than once.' }
}
},
{
id: 'urgency',
type: 'score',
instruction: 'Rate the urgency of this support request using the ordered levels.',
levels: [
{ value: 'low', description: 'An informational question without loss or blocked work.' },
{ value: 'medium', description: 'A limited loss or a problem with a workaround.' },
{ value: 'high', description: 'Major loss or blocked work requiring immediate action.' }
]
}
]
} as const satisfies DecideInput