Skip to main content

Interface: IntentResult<T>

Defined in: src/intents/types.ts:37

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?​

readonly optional data: T

Defined in: src/intents/types.ts:39


error?​

readonly optional error: object

Defined in: src/intents/types.ts:40

code​

readonly code: string

message​

readonly message: string


metadata​

readonly metadata: object

Defined in: src/intents/types.ts:41

duration​

readonly duration: number

intentName​

readonly intentName: string

model?​

readonly optional model: string

retryable​

readonly retryable: boolean

sapModule​

readonly sapModule: string

stepsExecuted​

readonly stepsExecuted: string[]

suggestions​

readonly suggestions: string[]

tokens?​

readonly optional tokens: number


status​

readonly status: "success" | "error" | "partial"

Defined in: src/intents/types.ts:38