Interface: IntentResult<T>
Standard result envelope for all SAP intent domain operations.
Intent
Return a consistent result shape from every intent function.
Capability
intent.core.fillField
Example
import type { IntentResult } from '#intents/types.js';
const result: IntentResult<string> = {
status: 'success',
data: 'PO-1000012345',
metadata: {
duration: 1234,
retryable: false,
suggestions: [],
intentName: 'createPurchaseOrder',
sapModule: 'MM',
stepsExecuted: ['navigate', 'fillVendor', 'fillMaterial', 'save'],
},
};
Type Parameters
T
T = void
Payload type for the data field (defaults to void).
Properties
data?
readonlyoptionaldata?:T
error?
readonlyoptionalerror?:object
code
readonlycode:string
message
readonlymessage:string
metadata
readonlymetadata:object
duration
readonlyduration:number
intentName
readonlyintentName:string
model?
readonlyoptionalmodel?:string
retryable
readonlyretryable:boolean
sapModule
readonlysapModule:string
stepsExecuted
readonlystepsExecuted:string[]
suggestions
readonlysuggestions:string[]
tokens?
readonlyoptionaltokens?:number
status
readonlystatus:"error"|"success"|"partial"