Skip to main content
Version: 1.x

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?

readonly optional data: T

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


error?

readonly optional error: object

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

code

readonly code: string

message

readonly message: string


metadata

readonly metadata: object

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

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: "error" | "success" | "partial"

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