feat(testkit): deterministic fake platform ports + fixtures + replay oracle
Fakes for all 7 IiosPlatformPorts (deny/timeout/ambiguous controls), portal + unknown-email fixtures, replayTwice idempotency oracle. Adds ingest request contract. Vitest alias resolves workspace packages to source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export * from './scope';
|
||||
export * from './enums';
|
||||
export * from './ingest';
|
||||
export * from './ports';
|
||||
export * from './events';
|
||||
export * from './commands';
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { ScopeVector } from './scope';
|
||||
import type { HandleKind, InteractionKind, MessagePartKind } from './enums';
|
||||
|
||||
/**
|
||||
* The ingest API contract (Data Model §11 OpenAPI `IngestInteractionRequest`).
|
||||
* A trusted host app or channel adapter posts this to `/v1/interactions/ingest`.
|
||||
*/
|
||||
export interface IngestInteractionRequest {
|
||||
scope: ScopeVector;
|
||||
channel: {
|
||||
type: string; // PORTAL, EMAIL, WHATSAPP, ...
|
||||
externalChannelId?: string;
|
||||
capabilityContract?: Record<string, unknown>;
|
||||
};
|
||||
source: {
|
||||
handleKind: HandleKind;
|
||||
externalId: string;
|
||||
displayName?: string;
|
||||
};
|
||||
kind?: InteractionKind;
|
||||
thread?: {
|
||||
externalThreadId?: string;
|
||||
subject?: string;
|
||||
};
|
||||
parts: Array<{
|
||||
kind: MessagePartKind;
|
||||
bodyText?: string;
|
||||
contentRef?: string;
|
||||
mimeType?: string;
|
||||
}>;
|
||||
occurredAt: string;
|
||||
providerEventId?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface IngestInteractionResponse {
|
||||
interactionId: string;
|
||||
sourceHandleId: string;
|
||||
threadId: string;
|
||||
state: string;
|
||||
next: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user