@nura-js/intents
v0.2.0
Published
Define, validate, and execute AI intents with approvals and JSON policies
Maintainers
Readme
@nura-js/intents
Define, validate, and execute AI intents using Nura’s Intent → Approval → Execute (IAE) loop.
Installation
pnpm add @nura-js/intentsQuick Start
import { registerType, createIntent, getIntentResult } from '@nura-js/intents'
registerType({
type: 'orders.create',
schema: {
type: 'object',
required: ['id'],
properties: { id: { type: 'string' } },
additionalProperties: false,
},
mapper: payload => ({ type: 'ui.open', payload, uiHint: { target: 'orderForm' } })
})
const { id } = await createIntent({ type: 'orders.create', payload: { id: 'o-100' } })
const result = await getIntentResult(id)Policies
requiresApprovalto queue intents pending approvalallowTenantsand role-based gatespredicate(context)for custom approvals
See the module docs for the full API.
