feat(I): I-MINI-MANIFEST/RENDER/SDK + I-WORK-PROACTIVE/E2E frontend — MiniAppBlock, MiniAppSDK, ProactiveFeed, Workstream page, i18n, tsc clean

This commit is contained in:
Agent Zero
2026-08-19 01:17:00 +02:00
parent df261b1b2c
commit bf5e22f5dc
7 changed files with 984 additions and 2 deletions
+87
View File
@@ -0,0 +1,87 @@
/**
* MiniApp manifest types + workstream block types (Phase I.2 Workstream & MiniApps).
*
* Mirrors backend contracts:
* - app/plugins/manifest.py → MiniAppContribution
* - app/ai/workstream_contract.py → WorkstreamBlock / WorkstreamMessage
* - app/ai/proactive_feed.py → ProactiveSuggestion
*/
// ── MiniApp manifest contribution (backend: MiniAppContribution) ──
export interface MiniAppContribution {
app_id: string;
name: string;
icon: string;
description: string;
render_schema: Record<string, unknown>;
}
/**
* Plugin manifest with optional `miniapps` field.
* Only the fields relevant to MiniApps are declared here; the full manifest
* is typed in store/pluginStore.ts (PluginUiManifest).
*/
export interface PluginManifestWithMiniApps {
name: string;
display_name: string;
version: string;
miniapps?: MiniAppContribution[];
}
// ── Workstream block types (backend: WorkstreamBlock) ──
export type WorkstreamBlockType =
| 'text'
| 'entity_card'
| 'action_card'
| 'evidence_card'
| 'approval_card'
| 'miniapp'
| 'workflow_status'
| 'workflow_handoff'
| 'error';
export interface WorkstreamBlock {
type: WorkstreamBlockType;
content: string;
metadata: Record<string, unknown>;
}
export type WorkstreamActorType = 'human' | 'system' | 'agent' | 'workflow';
export interface WorkstreamMessage {
actor_type: WorkstreamActorType;
actor_id?: string | null;
content: string;
blocks: WorkstreamBlock[];
conversation_id?: string | null;
tenant_id?: string | null;
}
// ── Proactive suggestion (backend: ProactiveSuggestion) ──
export type ProactivePriority = 'low' | 'medium' | 'high' | 'urgent';
export interface ProactiveSuggestion {
id: string;
trigger: string;
title: string;
description: string;
priority: ProactivePriority;
action_type: 'suggestion' | 'action_required' | 'info';
action_url: string;
entity_type?: string | null;
entity_id?: string | null;
blocks: WorkstreamBlock[];
created_at: string;
expires_at?: string | null;
metadata: Record<string, unknown>;
}
export interface ProactiveFeedSettings {
enabled: boolean;
min_priority: ProactivePriority;
max_per_hour: number;
triggers_enabled: Record<string, boolean>;
}