Interface: IntentResult<T>
Defined in: src/intents/types.ts:46
Standard result envelope for all SAP intent domain operations.
Intent
Return a consistent result shape from every intent function.
Capability
Carry execution metadata (duration, steps, SAP module) alongside business data.
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
Defined in: src/intents/types.ts:48
error?
readonlyoptionalerror:object
Defined in: src/intents/types.ts:49
code
readonlycode:string
message
readonlymessage:string
metadata
readonlymetadata:object
Defined in: src/intents/types.ts:50
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"
Defined in: src/intents/types.ts:47