/** * Scenario/Sandbox CEE service example (TypeScript) * * This example shows how a downstream app might expose a small, metadata-only * CEE integration service using the TypeScript SDK. It is intended as * copy-pastable service-layer code for a UI or Scenario/Sandbox backend. * * In the SSOT, this service lives behind PLoT or a backend API layer. The * Scenario UI calls that backend and never calls CEE directly or holds CEE * credentials. * * Notes: * - This file is not executed automatically in CI. * - When consuming the published SDK, replace relative imports such as * "../index.js" with "@olumi/assistants-sdk". */ import { type CeeDecisionReviewPayload } from "../index.js"; import type { CEEDraftGraphResponseV1, CEEOptionsResponseV1, CEEEvidenceHelperResponseV1, CEEBiasCheckResponseV1, CEETeamPerspectivesResponseV1 } from "../ceeTypes.js"; /** * Minimal CEE configuration for a Scenario/Sandbox-style service. */ export interface ScenarioCeeConfig { apiKey: string; baseUrl?: string; timeoutMs?: number; } /** * Minimal decision metadata that a Scenario/Sandbox app would already have. * The CEE layer never needs to see raw briefs or decision text – only these * safe identifiers and timestamps. */ export interface ScenarioDecision { id: string; title: string; createdAt: string; } /** * Product-facing payload wrapping a metadata-only CEE decision review under a * `cee` key, plus app-level identifiers and a safe trace identifier. * * On success, `cee` is populated and `retryable` is typically false. * On failure, `cee` is null and `retryable` / `errorCode` indicate whether the * client may safely retry. * * In production PLoT, this would usually be embedded in or closely mirror the * canonical CEE integration bundle (`CeeIntegrationReviewBundle`) exposed to * the Scenario UI, as defined in the SDK helpers. */ export interface ScenarioCeeDecisionReview { decisionId: string; createdAt: string; cee: CeeDecisionReviewPayload | null; retryable: boolean; errorCode?: string; traceId?: string; } export interface ScenarioCeeEnvelopes { draft?: CEEDraftGraphResponseV1; options?: CEEOptionsResponseV1; evidence?: CEEEvidenceHelperResponseV1; bias?: CEEBiasCheckResponseV1; team?: CEETeamPerspectivesResponseV1; } /** * Pure helper that composes CEE envelopes (or a structured error) into a * ScenarioCeeDecisionReview. This is the easiest entry-point for tests and for * downstream services that already have CEE responses. */ export declare function buildScenarioCeeDecisionReviewFromEnvelopes(decision: ScenarioDecision, envelopes: ScenarioCeeEnvelopes, error?: unknown): ScenarioCeeDecisionReview; /** * Example async service wrapper that a Scenario/Sandbox backend could adapt. * * Behaviour: * - Calls core CEE endpoints via the TypeScript SDK. * - Collapses their metadata into a CeeDecisionReviewPayload. * - Wraps the result (or a structured error) in ScenarioCeeDecisionReview. * * This function is intentionally conservative: * - It never logs or inspects prompts, graphs, or LLM outputs. * - It relies only on structured metadata (error codes, trace IDs, booleans). */ export declare function buildScenarioCeeDecisionReview(decision: ScenarioDecision, config: ScenarioCeeConfig): Promise;