@red-hat-developer-hub/backstage-plugin-augment-common 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2095 @@
1
+ import * as _backstage_plugin_permission_common from '@backstage/plugin-permission-common';
2
+
3
+ /**
4
+ * Permission to access the Augment plugin.
5
+ *
6
+ * Controls access to ALL Augment features. If a user has this
7
+ * permission, they get full access. If not, they are blocked entirely.
8
+ *
9
+ * @public
10
+ */
11
+ declare const augmentAccessPermission: _backstage_plugin_permission_common.BasicPermission;
12
+ /**
13
+ * Permission to access admin features of the Augment plugin.
14
+ *
15
+ * Controls access to admin-only features such as document management,
16
+ * swim lane/prompt editing, system prompt configuration, and branding.
17
+ * Users with this permission see additional admin tabs in the UI.
18
+ *
19
+ * @public
20
+ */
21
+ declare const augmentAdminPermission: _backstage_plugin_permission_common.BasicPermission;
22
+ /**
23
+ * List of all Augment permissions.
24
+ *
25
+ * To restrict access to a Keycloak group, configure RBAC policies in app-config.yaml:
26
+ *
27
+ * @example
28
+ * ```yaml
29
+ * permission:
30
+ * enabled: true
31
+ * rbac:
32
+ * policies:
33
+ * - g, group:default/augment-users, role:default/augment-user
34
+ * - p, role:default/augment-user, augment.access, read, allow
35
+ * - g, group:default/augment-admins, role:default/augment-admin
36
+ * - p, role:default/augment-admin, augment.access, read, allow
37
+ * - p, role:default/augment-admin, augment.admin, update, allow
38
+ * ```
39
+ *
40
+ * @public
41
+ */
42
+ declare const augmentPermissions: _backstage_plugin_permission_common.BasicPermission[];
43
+
44
+ /**
45
+ * Token usage reported by the inference server for a single response turn.
46
+ *
47
+ * Mirrors the OpenAI Responses API `ResponseUsage` object.
48
+ * Llama Stack implements the same schema, so this type is
49
+ * the single source of truth for both frontend and backend.
50
+ *
51
+ * @see https://platform.openai.com/docs/api-reference/responses/object
52
+ * @public
53
+ */
54
+ interface ResponseUsage {
55
+ /** Total input tokens (cumulative across all internal agentic calls) */
56
+ input_tokens: number;
57
+ /** Total output tokens (cumulative across all internal agentic calls) */
58
+ output_tokens: number;
59
+ /** Sum of input_tokens + output_tokens (may include internal overhead) */
60
+ total_tokens: number;
61
+ /**
62
+ * Breakdown of input tokens.
63
+ * Present when the server supports prompt caching.
64
+ */
65
+ input_tokens_details?: InputTokensDetails;
66
+ /**
67
+ * Breakdown of output tokens.
68
+ * Llama Stack may return `null` when the model does not emit reasoning tokens.
69
+ */
70
+ output_tokens_details?: OutputTokensDetails | null;
71
+ }
72
+ /**
73
+ * Detailed breakdown of input tokens.
74
+ * @public
75
+ */
76
+ interface InputTokensDetails {
77
+ /** Tokens retrieved from the KV-cache (no additional compute cost) */
78
+ cached_tokens?: number;
79
+ }
80
+ /**
81
+ * Detailed breakdown of output tokens.
82
+ * @public
83
+ */
84
+ interface OutputTokensDetails {
85
+ /** Internal chain-of-thought tokens used by reasoning models (e.g. o3, o4-mini) */
86
+ reasoning_tokens?: number;
87
+ }
88
+ /**
89
+ * Chat message in a conversation
90
+ * @public
91
+ */
92
+ interface ChatMessage {
93
+ role: 'system' | 'user' | 'assistant';
94
+ content: string;
95
+ }
96
+ /**
97
+ * Tool call information
98
+ * @public
99
+ */
100
+ interface ToolCallInfo {
101
+ id: string;
102
+ name: string;
103
+ serverLabel: string;
104
+ arguments: string;
105
+ output?: string;
106
+ error?: string;
107
+ }
108
+ /**
109
+ * RAG source information from file_search_call.results
110
+ * This comes directly from Llama Stack Responses API when include: ['file_search_call.results']
111
+ * @public
112
+ */
113
+ interface RAGSource {
114
+ /** Filename or document identifier */
115
+ filename: string;
116
+ /** Relevant text snippet from the document */
117
+ text?: string;
118
+ /** Relevance score (0-1) if provided by the API */
119
+ score?: number;
120
+ /** File ID for reference */
121
+ fileId?: string;
122
+ /** Document title from attributes (for display in citations) */
123
+ title?: string;
124
+ /** Source URL from attributes (for clickable citations) */
125
+ sourceUrl?: string;
126
+ /** Content type from attributes */
127
+ contentType?: string;
128
+ /** Raw attributes object from Llama Stack */
129
+ attributes?: Record<string, unknown>;
130
+ }
131
+ /**
132
+ * Aggregated evaluation result for a response
133
+ * @public
134
+ */
135
+ interface EvaluationResult {
136
+ /** Overall quality score (0-1) */
137
+ overallScore: number;
138
+ /** Individual scores by function */
139
+ scores: Record<string, number>;
140
+ /** Whether the response passed quality threshold */
141
+ passedThreshold: boolean;
142
+ /** Human-readable quality assessment */
143
+ qualityLevel: 'excellent' | 'good' | 'fair' | 'poor';
144
+ /** Timestamp of evaluation */
145
+ evaluatedAt: string;
146
+ /** Error message if evaluation failed */
147
+ error?: string;
148
+ /** True when evaluation was skipped (e.g. not available) rather than run */
149
+ skipped?: boolean;
150
+ }
151
+ /**
152
+ * File format enum
153
+ * @public
154
+ */
155
+ declare enum FileFormat {
156
+ YAML = "yaml",
157
+ PDF = "pdf",
158
+ TEXT = "text",
159
+ MARKDOWN = "markdown",
160
+ JSON = "json"
161
+ }
162
+ /**
163
+ * Information about an uploaded document
164
+ * @public
165
+ */
166
+ interface DocumentInfo {
167
+ id: string;
168
+ fileName: string;
169
+ format: FileFormat;
170
+ fileSize: number;
171
+ uploadedAt: string;
172
+ status: 'completed' | 'in_progress' | 'failed' | 'cancelled';
173
+ }
174
+ /**
175
+ * Provider status information
176
+ * @public
177
+ */
178
+ interface ProviderStatus {
179
+ id: string;
180
+ model: string;
181
+ baseUrl: string;
182
+ connected: boolean;
183
+ error?: string;
184
+ }
185
+ /**
186
+ * Vector store status information
187
+ * @public
188
+ */
189
+ interface VectorStoreStatus {
190
+ id: string;
191
+ connected: boolean;
192
+ totalDocuments?: number;
193
+ error?: string;
194
+ }
195
+ /**
196
+ * MCP server status information
197
+ * @public
198
+ */
199
+ interface MCPToolInfo {
200
+ name: string;
201
+ description?: string;
202
+ }
203
+ /**
204
+ * @public
205
+ */
206
+ interface MCPServerStatus {
207
+ id: string;
208
+ name: string;
209
+ url: string;
210
+ connected: boolean;
211
+ error?: string;
212
+ /** Tools available on this MCP server (populated when connected) */
213
+ tools?: MCPToolInfo[];
214
+ /** Total number of tools (convenience field) */
215
+ toolCount?: number;
216
+ /** Whether this server was defined in YAML (true) or added via admin UI (false) */
217
+ source?: 'yaml' | 'admin';
218
+ }
219
+ /**
220
+ * Security mode for Augment
221
+ * @public
222
+ */
223
+ type SecurityMode = 'none' | 'plugin-only' | 'full';
224
+ /**
225
+ * Combined status for Augment
226
+ * @public
227
+ */
228
+ interface AugmentStatus {
229
+ /** Active provider identifier (e.g., 'llamastack', 'googleadk') */
230
+ providerId: string;
231
+ provider: ProviderStatus;
232
+ vectorStore: VectorStoreStatus;
233
+ mcpServers: MCPServerStatus[];
234
+ /** Current security mode: 'none' | 'plugin-only' | 'full' */
235
+ securityMode: SecurityMode;
236
+ timestamp: string;
237
+ /** Whether the plugin is ready to handle requests (AI provider connected) */
238
+ ready: boolean;
239
+ /** Blocking configuration errors that prevent the plugin from working */
240
+ configurationErrors: string[];
241
+ /** Whether the current user has admin privileges */
242
+ isAdmin?: boolean;
243
+ /** Optional capability status — these are not required for basic chat */
244
+ capabilities?: {
245
+ chat: boolean;
246
+ rag: {
247
+ available: boolean;
248
+ reason?: string;
249
+ };
250
+ mcpTools: {
251
+ available: boolean;
252
+ reason?: string;
253
+ };
254
+ /** Whether this provider supports listing agents for the catalog */
255
+ agentCatalog?: boolean;
256
+ /** Whether the user must select an agent before chatting */
257
+ agentSelection?: boolean;
258
+ /** Whether agents have rich metadata (cards, skills) */
259
+ agentCards?: boolean;
260
+ };
261
+ /** Summary of configured agents (multi-agent only) */
262
+ agents?: Array<{
263
+ key: string;
264
+ name: string;
265
+ isDefault: boolean;
266
+ }>;
267
+ /** Tool execution mode: 'direct' or 'backend' */
268
+ toolExecutionMode?: 'direct' | 'backend';
269
+ /** Error from last agent graph resolution attempt, if any */
270
+ agentGraphError?: string;
271
+ }
272
+ /**
273
+ * Information about an available vector store
274
+ * @public
275
+ */
276
+ interface VectorStoreInfo {
277
+ id: string;
278
+ name: string;
279
+ status: string;
280
+ fileCount: number;
281
+ createdAt: number;
282
+ embeddingModel?: string;
283
+ embeddingDimension?: number;
284
+ providerType?: string;
285
+ usageBytes?: number;
286
+ lastActiveAt?: number;
287
+ fileCounts?: {
288
+ completed: number;
289
+ inProgress: number;
290
+ failed: number;
291
+ cancelled: number;
292
+ total: number;
293
+ };
294
+ }
295
+ /**
296
+ * Quick prompt configuration
297
+ * @public
298
+ */
299
+ interface QuickPrompt {
300
+ title: string;
301
+ description: string;
302
+ prompt: string;
303
+ category: string;
304
+ }
305
+ /**
306
+ * A single step within a workflow
307
+ * @public
308
+ */
309
+ interface WorkflowStep {
310
+ /** Step title shown in UI */
311
+ title: string;
312
+ /** Prompt to send to chat when this step is executed */
313
+ prompt: string;
314
+ /** Optional description for the step */
315
+ description?: string;
316
+ }
317
+ /**
318
+ * A workflow template - multi-step guided experience
319
+ * @public
320
+ */
321
+ interface Workflow {
322
+ /** Unique identifier */
323
+ id: string;
324
+ /** Display name */
325
+ name: string;
326
+ /** Short description */
327
+ description: string;
328
+ /** Icon name (material icons) */
329
+ icon?: string;
330
+ /** Category for grouping */
331
+ category?: string;
332
+ /** Ordered list of steps */
333
+ steps: WorkflowStep[];
334
+ /** Whether this workflow is coming soon (disabled, non-clickable) */
335
+ comingSoon?: boolean;
336
+ /** Custom coming soon label (defaults to "Coming Soon") */
337
+ comingSoonLabel?: string;
338
+ }
339
+ /**
340
+ * Quick action - single click prompt
341
+ * @public
342
+ */
343
+ interface QuickAction {
344
+ /** Display title */
345
+ title: string;
346
+ /** Short description */
347
+ description?: string;
348
+ /** Prompt to send to chat */
349
+ prompt: string;
350
+ /** Icon name */
351
+ icon?: string;
352
+ /** Category for grouping */
353
+ category?: string;
354
+ /** Whether this action is coming soon (disabled, non-clickable) */
355
+ comingSoon?: boolean;
356
+ /** Custom coming soon label (defaults to "Coming Soon") */
357
+ comingSoonLabel?: string;
358
+ }
359
+ /**
360
+ * A clickable prompt card within a prompt group on the welcome screen
361
+ * @public
362
+ */
363
+ interface PromptCard {
364
+ /** Display title */
365
+ title: string;
366
+ /** Short description */
367
+ description?: string;
368
+ /** Prompt to send to chat */
369
+ prompt: string;
370
+ /** Icon name */
371
+ icon?: string;
372
+ /** Agent to auto-select when this card is clicked (e.g. "namespace/agentName") */
373
+ agentId?: string;
374
+ /** Whether this feature is coming soon (disabled, non-clickable) */
375
+ comingSoon?: boolean;
376
+ /** Custom coming soon label (defaults to "Coming Soon") */
377
+ comingSoonLabel?: string;
378
+ }
379
+ /**
380
+ * Per-agent chat experience configuration set by admins.
381
+ * Controls which agents are visible to end users and how they appear.
382
+ * @public
383
+ */
384
+ interface ChatAgentConfig {
385
+ /** Agent identifier: "namespace/name" */
386
+ agentId: string;
387
+ /** Whether this agent is published to the end-user catalog (derived from lifecycleStage === 'published') */
388
+ published: boolean;
389
+ /** Whether this agent appears in end-user chat (only applies when published) */
390
+ visible: boolean;
391
+ /** Whether this agent is featured prominently on the welcome screen */
392
+ featured: boolean;
393
+ /** Lifecycle stage: draft → pending → published → archived */
394
+ lifecycleStage?: AgentLifecycleStage;
395
+ /** Pending action when in 'pending' stage (e.g. publish or unpublish) */
396
+ pendingAction?: 'publish' | 'unpublish';
397
+ /** Promotion version — incremented each time the agent is promoted forward */
398
+ version?: number;
399
+ /** ISO timestamp of last promotion */
400
+ promotedAt?: string;
401
+ /** User ref of who last promoted this agent */
402
+ promotedBy?: string;
403
+ /** User ref of who originally created/registered this agent in the lifecycle */
404
+ createdBy?: string;
405
+ /** ISO timestamp of when the agent was first registered in the lifecycle */
406
+ createdAt?: string;
407
+ /** Reason the agent was rejected (set on review → draft demotion, cleared on re-promote) */
408
+ rejectionReason?: string;
409
+ /** User ref of who rejected the agent */
410
+ rejectedBy?: string;
411
+ /** ISO timestamp of when the agent was rejected */
412
+ rejectedAt?: string;
413
+ /** SonataFlow process instance id while awaiting admin approval */
414
+ approvalWorkflowInstanceId?: string;
415
+ /** Display order (lower first) */
416
+ order?: number;
417
+ /** Override display name */
418
+ displayName?: string;
419
+ /** Override description */
420
+ description?: string;
421
+ /** Custom avatar image URL */
422
+ avatarUrl?: string;
423
+ /** Per-agent accent color (hex) */
424
+ accentColor?: string;
425
+ /** Greeting message shown as first bot message on new conversation */
426
+ greeting?: string;
427
+ /** Suggested prompts shown on the agent card and below the input */
428
+ conversationStarters?: string[];
429
+ /** Direct chat endpoint URL for skill agents (e.g. http://agent.ns.svc:8000) */
430
+ chatEndpoint?: string;
431
+ /** K8s namespace where the skill agent is deployed */
432
+ namespace?: string;
433
+ }
434
+ /**
435
+ * Per-tool lifecycle configuration set by admins.
436
+ * Controls which tools are published to end users, mirroring the agent lifecycle.
437
+ * @public
438
+ */
439
+ interface ChatToolConfig {
440
+ /** Tool identifier: "namespace/name" */
441
+ toolId: string;
442
+ /** Whether this tool is published to the end-user catalog (derived from lifecycleStage === 'published') */
443
+ published: boolean;
444
+ /** Whether this tool appears in end-user listings (only applies when published) */
445
+ visible: boolean;
446
+ /** Lifecycle stage: draft → pending → published → archived */
447
+ lifecycleStage?: AgentLifecycleStage;
448
+ /** Promotion version — incremented each time the tool is promoted forward */
449
+ version?: number;
450
+ /** ISO timestamp of last promotion */
451
+ promotedAt?: string;
452
+ /** User ref of who last promoted this tool */
453
+ promotedBy?: string;
454
+ /** User ref of who created this tool */
455
+ createdBy?: string;
456
+ /** ISO timestamp of creation */
457
+ createdAt?: string;
458
+ }
459
+ /**
460
+ * A group of related prompts displayed on the welcome screen
461
+ * @public
462
+ */
463
+ interface PromptGroup {
464
+ /** Unique identifier */
465
+ id: string;
466
+ /** Display title */
467
+ title: string;
468
+ /** Description of this prompt group */
469
+ description?: string;
470
+ /** Icon name */
471
+ icon?: string;
472
+ /** Theme color (hex) */
473
+ color?: string;
474
+ /** Display order (lower numbers appear first, defaults to array order if not specified) */
475
+ order?: number;
476
+ /** Cards within this prompt group */
477
+ cards: PromptCard[];
478
+ }
479
+ /**
480
+ * Lifecycle stage of an agent in the promotion pipeline.
481
+ *
482
+ * draft → review → staging → production → retired
483
+ *
484
+ * - **draft**: Under development. Visible only to creator/admin.
485
+ * - **review**: Submitted for admin review. Appears in the Review Queue.
486
+ * - **staging**: Approved, available for internal testing. Not visible to end users.
487
+ * - **published**: Live in the end-user marketplace/catalog.
488
+ * - **archived**: Removed from production, preserved for audit/history.
489
+ * @public
490
+ */
491
+ type AgentLifecycleStage = 'draft' | 'pending' | 'published' | 'archived';
492
+ /** Human-readable action name for a lifecycle transition. @public */
493
+ type AgentLifecycleAction = 'submit' | 'approve' | 'reject' | 'publish' | 'unpublish' | 'archive' | 'reactivate' | 'withdraw' | 'request-unpublish' | 'approve-unpublish' | 'reject-unpublish';
494
+ /** A single allowed lifecycle transition. @public */
495
+ interface AgentLifecycleTransition {
496
+ from: AgentLifecycleStage;
497
+ to: AgentLifecycleStage;
498
+ action: AgentLifecycleAction;
499
+ label: string;
500
+ }
501
+ /** Ordered list of lifecycle stages for pipeline display. @public */
502
+ declare const LIFECYCLE_STAGE_ORDER: readonly AgentLifecycleStage[];
503
+ /** All valid lifecycle transitions with human-readable labels. @public */
504
+ declare const LIFECYCLE_TRANSITIONS: readonly AgentLifecycleTransition[];
505
+ /**
506
+ * Maps old stage names to new ones for backward compatibility.
507
+ * @public
508
+ */
509
+ declare const LEGACY_STAGE_MAP: Record<string, AgentLifecycleStage>;
510
+ /** Returns the valid forward transitions from a given stage. @public */
511
+ declare function getAvailableTransitions(stage: AgentLifecycleStage): AgentLifecycleTransition[];
512
+ /** Checks whether a transition from one stage to another is valid. @public */
513
+ declare function isValidTransition(from: AgentLifecycleStage, to: AgentLifecycleStage): boolean;
514
+ /** Normalizes a legacy stage name to the current stage name. @public */
515
+ declare function normalizeLifecycleStage(stage: string | undefined): AgentLifecycleStage;
516
+ /**
517
+ * Provider-agnostic representation of a chat agent.
518
+ * Used by the agent catalog/gallery to display agents from any provider
519
+ * (Kagenti, Llama Stack config-driven, or custom).
520
+ * @public
521
+ */
522
+ interface ChatAgent {
523
+ /** Unique agent identifier (e.g. "namespace/name" for Kagenti, agent key for Llama Stack) */
524
+ id: string;
525
+ /** Display name */
526
+ name: string;
527
+ /** Human-readable description */
528
+ description?: string;
529
+ /** Runtime status (e.g. "Ready", "Pending", "config") */
530
+ status: string;
531
+ /** Whether this is the default/entry agent */
532
+ isDefault?: boolean;
533
+ /** Provider that owns this agent */
534
+ providerType: string;
535
+ /** Conversation starters / example prompts */
536
+ starters?: string[];
537
+ /** Avatar image URL */
538
+ avatarUrl?: string;
539
+ /** Agent creation timestamp */
540
+ createdAt?: string;
541
+ /** Agent framework label (e.g. "a2a", "llamastack") */
542
+ framework?: string;
543
+ /** Protocol labels (e.g. "A2A", "MCP") */
544
+ protocols?: string[];
545
+ /** Whether this agent is published to the end-user catalog (derived: lifecycleStage === 'published') */
546
+ published?: boolean;
547
+ /** Origin of this agent: 'kagenti' | 'orchestration' | 'external' */
548
+ source?: string;
549
+ /** Namespace the agent belongs to (for Kagenti agents) */
550
+ namespace?: string;
551
+ /** Current lifecycle stage in the promotion pipeline */
552
+ lifecycleStage?: AgentLifecycleStage;
553
+ /** Pending action when in 'pending' stage (e.g. publish or unpublish) */
554
+ pendingAction?: 'publish' | 'unpublish';
555
+ /** Promotion version (increments each time the agent is promoted) */
556
+ version?: number;
557
+ /** When this agent was last promoted */
558
+ promotedAt?: string;
559
+ /** Who promoted this agent */
560
+ promotedBy?: string;
561
+ /** User ref of who originally created/registered this agent in the lifecycle */
562
+ createdBy?: string;
563
+ /** Reason the agent was rejected (set on review → draft demotion, cleared on re-promote) */
564
+ rejectionReason?: string;
565
+ /** User ref of who rejected the agent */
566
+ rejectedBy?: string;
567
+ /** ISO timestamp of when the agent was rejected */
568
+ rejectedAt?: string;
569
+ /** Role of this agent in the orchestration topology */
570
+ agentRole?: AgentRole;
571
+ /**
572
+ * True when a chatAgents lifecycle entry exists for this agent.
573
+ * False for runtime-only agents (Kagenti/orchestration) not yet in governance.
574
+ */
575
+ governanceRegistered?: boolean;
576
+ /** Direct chat endpoint URL for skill agents (e.g. http://agent.ns.svc:8000) */
577
+ chatEndpoint?: string;
578
+ }
579
+ /**
580
+ * Possible roles an agent can have in the orchestration topology.
581
+ * Always auto-derived from connections, never manually set.
582
+ * @public
583
+ */
584
+ type AgentRole = 'router' | 'specialist' | 'standalone';
585
+ /**
586
+ * Minimal agent shape required for topology-based role derivation.
587
+ * Both frontend form data and backend config objects satisfy this.
588
+ * @public
589
+ */
590
+ interface AgentTopologyNode {
591
+ handoffs?: string[];
592
+ asTools?: string[];
593
+ }
594
+ /**
595
+ * Derives an agent's role from the multi-agent topology.
596
+ * This is the single source of truth for role derivation across
597
+ * both frontend and backend.
598
+ *
599
+ * Rules:
600
+ * - Has outgoing handoffs or asTools -> 'router'
601
+ * - Is a target of another agent's handoffs or asTools -> 'specialist'
602
+ * - Neither -> 'standalone'
603
+ *
604
+ * @public
605
+ */
606
+ declare function deriveRoleFromTopology(agentKey: string, allAgents: Record<string, AgentTopologyNode | null | undefined>): AgentRole;
607
+ /**
608
+ * Conversation summary for UI display.
609
+ * Derived from stored responses.
610
+ * @public
611
+ */
612
+ interface ConversationSummary {
613
+ /** Response ID — use to continue this conversation */
614
+ responseId: string;
615
+ /** Preview of the conversation (first user message or assistant response) */
616
+ preview: string;
617
+ /** When the conversation was created */
618
+ createdAt: Date;
619
+ /** Model used */
620
+ model: string;
621
+ /** Status */
622
+ status: 'completed' | 'failed' | 'in_progress';
623
+ /** Llama Stack conversation ID (present for new-style conversations) */
624
+ conversationId?: string;
625
+ /** Previous response ID for chain deduplication */
626
+ previousResponseId?: string;
627
+ }
628
+ /**
629
+ * Base response from the chat endpoint, shared between frontend and backend.
630
+ * Frontend extends this with additional fields (filtered, evaluation, etc.).
631
+ * @public
632
+ */
633
+ interface ChatResponse {
634
+ role: 'assistant';
635
+ content: string;
636
+ ragContext?: string[];
637
+ /** @deprecated Use ragSources instead */
638
+ filesSearched?: string[];
639
+ ragSources?: RAGSource[];
640
+ toolCalls?: ToolCallInfo[];
641
+ responseId?: string;
642
+ usage?: ResponseUsage;
643
+ /** Name of the agent that produced the final response (multi-agent only) */
644
+ agentName?: string;
645
+ /** Ordered list of agent keys visited during handoffs, e.g. ["triage", "billing"] */
646
+ handoffPath?: string[];
647
+ /** Present when a backend-executed tool requires HITL approval before execution */
648
+ pendingApproval?: PendingApprovalInfo;
649
+ /** All pending approvals when multiple backend tools need HITL approval */
650
+ pendingApprovals?: PendingApprovalInfo[];
651
+ /** Structured output validation error (G5). Present when the agent's outputSchema validation failed. */
652
+ outputValidationError?: string;
653
+ /** Reasoning/thinking summaries from the model's chain-of-thought. */
654
+ reasoning?: ReasoningSummary[];
655
+ }
656
+ /**
657
+ * Summary of model reasoning from chain-of-thought output.
658
+ * @public
659
+ */
660
+ interface ReasoningSummary {
661
+ id: string;
662
+ text: string;
663
+ }
664
+ /**
665
+ * Information about a single pending HITL approval.
666
+ * @public
667
+ */
668
+ interface PendingApprovalInfo {
669
+ approvalRequestId: string;
670
+ toolName: string;
671
+ serverLabel?: string;
672
+ arguments?: string;
673
+ }
674
+ /**
675
+ * Result of a document sync operation.
676
+ * @public
677
+ */
678
+ interface SyncResult {
679
+ added: number;
680
+ removed: number;
681
+ updated: number;
682
+ failed: number;
683
+ unchanged: number;
684
+ errors: string[];
685
+ }
686
+ /**
687
+ * Detailed tool information for the capabilities-aware prompt generator.
688
+ * Used by the frontend capabilities selector to send tool descriptions
689
+ * to the backend so the meta-prompt can reference what each tool does.
690
+ * @public
691
+ */
692
+ interface ToolCapabilityInfo {
693
+ name: string;
694
+ description?: string;
695
+ serverLabel?: string;
696
+ }
697
+ /**
698
+ * User-selected capabilities to emphasize when generating agent instructions.
699
+ * Sent to the backend so the meta-prompt includes specific tool descriptions
700
+ * and contextual detail about the agent's environment.
701
+ * @public
702
+ */
703
+ interface PromptCapabilities {
704
+ tools?: ToolCapabilityInfo[];
705
+ enableWebSearch?: boolean;
706
+ enableCodeInterpreter?: boolean;
707
+ ragEnabled?: boolean;
708
+ vectorStoreNames?: string[];
709
+ safetyEnabled?: boolean;
710
+ safetyShields?: string[];
711
+ }
712
+
713
+ /** Response has been created, streaming is starting. @public */
714
+ interface StreamStartedEvent {
715
+ type: 'stream.started';
716
+ responseId: string;
717
+ model?: string;
718
+ /** Server-side creation timestamp (Unix epoch seconds) */
719
+ createdAt?: number;
720
+ }
721
+ /** A chunk of generated text. @public */
722
+ interface StreamTextDeltaEvent {
723
+ type: 'stream.text.delta';
724
+ delta: string;
725
+ }
726
+ /** Text generation is complete for this response. @public */
727
+ interface StreamTextDoneEvent {
728
+ type: 'stream.text.done';
729
+ text: string;
730
+ }
731
+ /** A chunk of reasoning/thinking text (models with chain-of-thought). @public */
732
+ interface StreamReasoningDeltaEvent {
733
+ type: 'stream.reasoning.delta';
734
+ delta: string;
735
+ }
736
+ /** Reasoning text is complete. @public */
737
+ interface StreamReasoningDoneEvent {
738
+ type: 'stream.reasoning.done';
739
+ text: string;
740
+ }
741
+ /** Provider is discovering available tools (e.g., listing MCP server tools). @public */
742
+ interface StreamToolDiscoveryEvent {
743
+ type: 'stream.tool.discovery';
744
+ serverLabel?: string;
745
+ status: 'in_progress' | 'completed';
746
+ toolCount?: number;
747
+ }
748
+ /** A tool call has started. @public */
749
+ interface StreamToolStartedEvent {
750
+ type: 'stream.tool.started';
751
+ callId: string;
752
+ name: string;
753
+ serverLabel?: string;
754
+ }
755
+ /** Tool call arguments are streaming in. @public */
756
+ interface StreamToolDeltaEvent {
757
+ type: 'stream.tool.delta';
758
+ callId: string;
759
+ delta: string;
760
+ }
761
+ /** Tool call completed with output. @public */
762
+ interface StreamToolCompletedEvent {
763
+ type: 'stream.tool.completed';
764
+ callId: string;
765
+ name: string;
766
+ serverLabel?: string;
767
+ output?: string;
768
+ error?: string;
769
+ }
770
+ /** Tool call failed. @public */
771
+ interface StreamToolFailedEvent {
772
+ type: 'stream.tool.failed';
773
+ callId: string;
774
+ name: string;
775
+ serverLabel?: string;
776
+ error: string;
777
+ }
778
+ /** Tool call requires human approval (HITL). @public */
779
+ interface StreamToolApprovalEvent {
780
+ type: 'stream.tool.approval';
781
+ callId: string;
782
+ name: string;
783
+ serverLabel?: string;
784
+ arguments?: string;
785
+ /** Response ID for this approval request, for reliable approval submission. */
786
+ responseId?: string;
787
+ }
788
+ /** Backend is executing tool calls on behalf of the LLM. @public */
789
+ interface StreamBackendToolExecutingEvent {
790
+ type: 'stream.backend_tool.executing';
791
+ toolCount: number;
792
+ tools: string[];
793
+ }
794
+ /** RAG search results arrived. @public */
795
+ interface StreamRagResultsEvent {
796
+ type: 'stream.rag.results';
797
+ sources: Array<{
798
+ filename: string;
799
+ fileId?: string;
800
+ text?: string;
801
+ score?: number;
802
+ title?: string;
803
+ sourceUrl?: string;
804
+ contentType?: string;
805
+ attributes?: Record<string, unknown>;
806
+ }>;
807
+ filesSearched?: string[];
808
+ }
809
+ /** The response is fully complete. @public */
810
+ interface StreamCompletedEvent {
811
+ type: 'stream.completed';
812
+ responseId?: string;
813
+ usage?: ResponseUsage;
814
+ /** Display name of the agent that produced the final response (multi-agent only) */
815
+ agentName?: string;
816
+ /** Output validation error when structured output schema validation failed */
817
+ outputValidationError?: string;
818
+ }
819
+ /** An agent handoff occurred during multi-agent streaming. @public */
820
+ interface StreamAgentHandoffEvent {
821
+ type: 'stream.agent.handoff';
822
+ fromAgent?: string;
823
+ toAgent: string;
824
+ /** Optional reason provided by the model for the handoff */
825
+ reason?: string;
826
+ }
827
+ /** A form field descriptor for input-required forms. @public */
828
+ interface StreamFormField {
829
+ name: string;
830
+ type?: string;
831
+ label?: string;
832
+ description?: string;
833
+ required?: boolean;
834
+ defaultValue?: unknown;
835
+ options?: Array<{
836
+ label: string;
837
+ value: string;
838
+ }>;
839
+ [key: string]: unknown;
840
+ }
841
+ /** Shape of a form render request from an A2A agent. @public */
842
+ interface StreamFormDescriptor {
843
+ title?: string;
844
+ description?: string;
845
+ fields?: StreamFormField[];
846
+ [key: string]: unknown;
847
+ }
848
+ /** Agent requests structured form input from the user (A2A INPUT_REQUIRED). @public */
849
+ interface StreamFormRequestEvent {
850
+ type: 'stream.form.request';
851
+ taskId?: string;
852
+ contextId?: string;
853
+ form: StreamFormDescriptor;
854
+ }
855
+ /** Shape of a secret demand from an A2A agent. @public */
856
+ interface StreamSecretDemand {
857
+ name: string;
858
+ description?: string;
859
+ [key: string]: unknown;
860
+ }
861
+ /** Agent requires authentication (A2A AUTH_REQUIRED -- OAuth or secrets). @public */
862
+ interface StreamAuthRequiredEvent {
863
+ type: 'stream.auth.required';
864
+ taskId?: string;
865
+ authType: 'oauth' | 'secret';
866
+ url?: string;
867
+ demands?: {
868
+ secrets?: StreamSecretDemand[];
869
+ [key: string]: unknown;
870
+ };
871
+ }
872
+ /** Agent is streaming an artifact (code, file, document). @public */
873
+ interface StreamArtifactEvent {
874
+ type: 'stream.artifact';
875
+ artifactId: string;
876
+ name?: string;
877
+ description?: string;
878
+ content: string;
879
+ append?: boolean;
880
+ lastChunk?: boolean;
881
+ }
882
+ /** A single citation reference. @public */
883
+ interface StreamCitationReference {
884
+ title?: string;
885
+ url?: string;
886
+ snippet?: string;
887
+ [key: string]: unknown;
888
+ }
889
+ /** Agent provides source citations for its response. @public */
890
+ interface StreamCitationEvent {
891
+ type: 'stream.citation';
892
+ citations: StreamCitationReference[];
893
+ }
894
+ /** An error occurred during streaming. @public */
895
+ interface StreamErrorEvent {
896
+ type: 'stream.error';
897
+ error: string;
898
+ code?: string;
899
+ title?: string;
900
+ context?: Record<string, unknown>;
901
+ }
902
+ /**
903
+ * Union of all normalized streaming events.
904
+ *
905
+ * This is the single source of truth for the streaming contract
906
+ * between the backend and frontend. Both the backend's EventNormalizer
907
+ * and the frontend's StreamingMessage reducer use this type.
908
+ * @public
909
+ */
910
+ type NormalizedStreamEvent = StreamStartedEvent | StreamTextDeltaEvent | StreamTextDoneEvent | StreamReasoningDeltaEvent | StreamReasoningDoneEvent | StreamToolDiscoveryEvent | StreamToolStartedEvent | StreamToolDeltaEvent | StreamToolCompletedEvent | StreamToolFailedEvent | StreamToolApprovalEvent | StreamBackendToolExecutingEvent | StreamRagResultsEvent | StreamAgentHandoffEvent | StreamFormRequestEvent | StreamAuthRequiredEvent | StreamArtifactEvent | StreamCitationEvent | StreamCompletedEvent | StreamErrorEvent;
911
+
912
+ /**
913
+ * Branding configuration loaded from app-config.yaml.
914
+ * Shared across frontend and backend.
915
+ * @public
916
+ */
917
+ interface BrandingConfig {
918
+ appName: string;
919
+ tagline: string;
920
+ inputPlaceholder: string;
921
+ primaryColor: string;
922
+ secondaryColor: string;
923
+ successColor: string;
924
+ warningColor: string;
925
+ errorColor: string;
926
+ infoColor: string;
927
+ logoUrl?: string;
928
+ faviconUrl?: string;
929
+ botAvatarUrl?: string;
930
+ themePreset?: string;
931
+ }
932
+ /**
933
+ * Single source of truth for branding defaults.
934
+ * Used by both frontend hooks and backend API routes.
935
+ * @public
936
+ */
937
+ declare const DEFAULT_BRANDING: BrandingConfig;
938
+
939
+ /**
940
+ * Allowed keys for admin-managed configuration stored in the database.
941
+ *
942
+ * Keys fall into three categories:
943
+ * - `activeProvider`: which provider is currently active
944
+ * - Global keys: shared across all providers (branding, promptGroups, etc.)
945
+ * - Provider-scoped keys: namespaced per provider in storage (model, baseUrl, etc.)
946
+ *
947
+ * @public
948
+ */
949
+ type AdminConfigKey = 'activeProvider' | 'promptGroups' | 'systemPrompt' | 'branding' | 'safetyPatterns' | 'vectorStoreConfig' | 'activeVectorStoreIds' | 'model' | 'baseUrl' | 'kagentiBaseUrl' | 'toolChoice' | 'enableWebSearch' | 'enableCodeInterpreter' | 'mcpServers' | 'disabledMcpServerIds' | 'safetyEnabled' | 'inputShields' | 'outputShields' | 'safetyOnError' | 'evaluationEnabled' | 'scoringFunctions' | 'minScoreThreshold' | 'evaluationOnError' | 'agents' | 'defaultAgent' | 'maxAgentTurns' | 'maxToolCalls' | 'maxOutputTokens' | 'temperature' | 'safetyIdentifier' | 'chatAgents' | 'chatTools' | 'devSpacesApiUrl' | 'devSpacesToken' | 'devSpacesNamespace' | 'workflows' | 'workflowVersions' | 'workflowTestSuites' | 'workflowEvaluations';
950
+ /**
951
+ * A single admin config entry stored in the database.
952
+ * @public
953
+ */
954
+ interface AdminConfigEntry {
955
+ configKey: AdminConfigKey;
956
+ configValue: unknown;
957
+ updatedAt: string;
958
+ updatedBy: string;
959
+ }
960
+ /**
961
+ * A single chunk returned from a RAG test query.
962
+ * @public
963
+ */
964
+ interface RagTestChunk {
965
+ text: string;
966
+ score?: number;
967
+ fileId?: string;
968
+ fileName?: string;
969
+ vectorStoreId?: string;
970
+ }
971
+ /**
972
+ * Result of a RAG test query against the vector store.
973
+ * @public
974
+ */
975
+ interface RagTestResult {
976
+ query: string;
977
+ chunks: RagTestChunk[];
978
+ vectorStoreId: string;
979
+ totalResults: number;
980
+ }
981
+ /**
982
+ * Result of an end-to-end RAG generation test: retrieval + LLM answer.
983
+ * @public
984
+ */
985
+ interface RagGenerateResult {
986
+ query: string;
987
+ answer: string;
988
+ chunks: RagTestChunk[];
989
+ model: string;
990
+ totalResults: number;
991
+ }
992
+ /**
993
+ * Result of uploading a document to the vector store.
994
+ * @public
995
+ */
996
+ interface UploadResult {
997
+ fileId: string;
998
+ fileName: string;
999
+ status: string;
1000
+ }
1001
+ /**
1002
+ * Vector store configuration editable from the admin panel.
1003
+ * Fields mirror the vector store section of the active provider's app-config.
1004
+ * @public
1005
+ */
1006
+ interface VectorStoreConfig {
1007
+ vectorStoreName: string;
1008
+ embeddingModel: string;
1009
+ embeddingDimension: number;
1010
+ searchMode?: 'semantic' | 'keyword' | 'hybrid';
1011
+ bm25Weight?: number;
1012
+ semanticWeight?: number;
1013
+ chunkingStrategy: 'auto' | 'static';
1014
+ maxChunkSizeTokens: number;
1015
+ chunkOverlapTokens: number;
1016
+ fileSearchMaxResults?: number;
1017
+ fileSearchScoreThreshold?: number;
1018
+ }
1019
+ /**
1020
+ * Result of creating a vector store.
1021
+ * @public
1022
+ */
1023
+ interface VectorStoreCreateResult {
1024
+ vectorStoreId: string;
1025
+ vectorStoreName: string;
1026
+ created: boolean;
1027
+ embeddingModel: string;
1028
+ embeddingDimension?: number;
1029
+ }
1030
+ /**
1031
+ * Current status of the vector store.
1032
+ * @public
1033
+ */
1034
+ interface VectorStoreStatusResult {
1035
+ exists: boolean;
1036
+ vectorStoreId?: string;
1037
+ vectorStoreName?: string;
1038
+ documentCount?: number;
1039
+ embeddingModel?: string;
1040
+ ready: boolean;
1041
+ }
1042
+
1043
+ /** @public */
1044
+ interface KagentiSecretKeyRef {
1045
+ name: string;
1046
+ key: string;
1047
+ }
1048
+ /** @public */
1049
+ interface KagentiConfigMapKeyRef {
1050
+ name: string;
1051
+ key: string;
1052
+ }
1053
+ /** @public */
1054
+ interface KagentiEnvVarSource {
1055
+ secretKeyRef?: KagentiSecretKeyRef;
1056
+ configMapKeyRef?: KagentiConfigMapKeyRef;
1057
+ }
1058
+ /** @public */
1059
+ interface KagentiEnvVar {
1060
+ name: string;
1061
+ value?: string;
1062
+ valueFrom?: KagentiEnvVarSource;
1063
+ }
1064
+ /** @public */
1065
+ interface KagentiServicePort {
1066
+ name?: string;
1067
+ port: number;
1068
+ targetPort?: number;
1069
+ protocol?: string;
1070
+ }
1071
+ /** @public */
1072
+ interface KagentiResourceLabels {
1073
+ protocol?: string | string[];
1074
+ framework?: string;
1075
+ type?: string;
1076
+ }
1077
+ /** @public */
1078
+ interface KagentiAgentSummary {
1079
+ name: string;
1080
+ namespace: string;
1081
+ description: string;
1082
+ status: string;
1083
+ labels: KagentiResourceLabels;
1084
+ workloadType?: string;
1085
+ createdAt?: string;
1086
+ }
1087
+ /** @public */
1088
+ interface KagentiAgentDetail {
1089
+ metadata: Record<string, unknown>;
1090
+ spec: Record<string, unknown>;
1091
+ status: Record<string, unknown>;
1092
+ workloadType?: string;
1093
+ readyStatus?: string;
1094
+ service?: Record<string, unknown>;
1095
+ }
1096
+ /** @public */
1097
+ interface KagentiAgentCardSkill {
1098
+ id?: string;
1099
+ name?: string;
1100
+ description?: string;
1101
+ examples?: string[];
1102
+ }
1103
+ /** @public */
1104
+ interface KagentiAgentCard {
1105
+ name: string;
1106
+ description?: string;
1107
+ version: string;
1108
+ url: string;
1109
+ streaming: boolean;
1110
+ defaultInputModes?: string[];
1111
+ skills: KagentiAgentCardSkill[];
1112
+ }
1113
+ /** @public */
1114
+ interface KagentiShipwrightConfig {
1115
+ buildStrategy?: string;
1116
+ dockerfile?: string;
1117
+ buildArgs?: string[];
1118
+ buildTimeout?: string;
1119
+ }
1120
+ /** @public */
1121
+ interface KagentiCreateAgentRequest {
1122
+ name: string;
1123
+ namespace: string;
1124
+ protocol?: string;
1125
+ framework?: string;
1126
+ envVars?: KagentiEnvVar[];
1127
+ workloadType?: 'deployment' | 'statefulset' | 'job';
1128
+ deploymentMethod?: 'source' | 'image';
1129
+ gitUrl?: string;
1130
+ gitPath?: string;
1131
+ gitBranch?: string;
1132
+ imageTag?: string;
1133
+ registryUrl?: string;
1134
+ registrySecret?: string;
1135
+ startCommand?: string;
1136
+ containerImage?: string;
1137
+ imagePullSecret?: string;
1138
+ servicePorts?: KagentiServicePort[];
1139
+ createHttpRoute?: boolean;
1140
+ authBridgeEnabled?: boolean;
1141
+ spireEnabled?: boolean;
1142
+ shipwrightConfig?: KagentiShipwrightConfig;
1143
+ }
1144
+ /** @public */
1145
+ interface KagentiCreateAgentResponse {
1146
+ success: boolean;
1147
+ name: string;
1148
+ namespace: string;
1149
+ message: string;
1150
+ }
1151
+ /** @public */
1152
+ interface KagentiFinalizeAgentBuildRequest {
1153
+ protocol?: string;
1154
+ framework?: string;
1155
+ envVars?: KagentiEnvVar[];
1156
+ servicePorts?: KagentiServicePort[];
1157
+ createHttpRoute?: boolean;
1158
+ authBridgeEnabled?: boolean;
1159
+ imagePullSecret?: string;
1160
+ }
1161
+ /** @public */
1162
+ interface KagentiToolSummary {
1163
+ name: string;
1164
+ namespace: string;
1165
+ description: string;
1166
+ status: string;
1167
+ labels: KagentiResourceLabels;
1168
+ createdAt?: string;
1169
+ workloadType?: string;
1170
+ }
1171
+ /** @public */
1172
+ interface KagentiToolDetail {
1173
+ metadata: Record<string, unknown>;
1174
+ spec: Record<string, unknown>;
1175
+ status: Record<string, unknown>;
1176
+ workloadType?: string;
1177
+ service?: Record<string, unknown>;
1178
+ }
1179
+ /** @public */
1180
+ interface KagentiCreateToolRequest {
1181
+ name: string;
1182
+ namespace: string;
1183
+ protocol?: string;
1184
+ framework?: string;
1185
+ description?: string;
1186
+ envVars?: KagentiEnvVar[];
1187
+ servicePorts?: KagentiServicePort[];
1188
+ workloadType?: 'deployment' | 'statefulset';
1189
+ persistentStorage?: KagentiPersistentStorageConfig;
1190
+ deploymentMethod?: 'image' | 'source';
1191
+ containerImage?: string;
1192
+ imagePullSecret?: string;
1193
+ gitUrl?: string;
1194
+ gitRevision?: string;
1195
+ contextDir?: string;
1196
+ registryUrl?: string;
1197
+ registrySecret?: string;
1198
+ imageTag?: string;
1199
+ shipwrightConfig?: KagentiShipwrightConfig;
1200
+ createHttpRoute?: boolean;
1201
+ authBridgeEnabled?: boolean;
1202
+ spireEnabled?: boolean;
1203
+ }
1204
+ /** @public */
1205
+ interface KagentiCreateToolResponse {
1206
+ success: boolean;
1207
+ name: string;
1208
+ namespace: string;
1209
+ message: string;
1210
+ }
1211
+ /** @public */
1212
+ interface KagentiPersistentStorageConfig {
1213
+ enabled: boolean;
1214
+ size: string;
1215
+ }
1216
+ /** @public */
1217
+ interface KagentiFinalizeToolBuildRequest {
1218
+ protocol?: string;
1219
+ framework?: string;
1220
+ workloadType?: string;
1221
+ persistentStorage?: KagentiPersistentStorageConfig;
1222
+ envVars?: KagentiEnvVar[];
1223
+ servicePorts?: KagentiServicePort[];
1224
+ createHttpRoute?: boolean;
1225
+ authBridgeEnabled?: boolean;
1226
+ spireEnabled?: boolean;
1227
+ imagePullSecret?: string;
1228
+ }
1229
+ /** @public */
1230
+ interface KagentiMcpInvokeResponse {
1231
+ result: unknown;
1232
+ }
1233
+ /** @public */
1234
+ interface KagentiMcpToolSchema {
1235
+ name: string;
1236
+ description?: string;
1237
+ input_schema?: Record<string, unknown>;
1238
+ }
1239
+ /** @public */
1240
+ interface KagentiFeatureFlags {
1241
+ sandbox: boolean;
1242
+ integrations: boolean;
1243
+ triggers: boolean;
1244
+ }
1245
+ /** @public */
1246
+ interface KagentiDashboardConfig {
1247
+ traces?: string;
1248
+ network?: string;
1249
+ mcpInspector?: string;
1250
+ mcpProxy?: string;
1251
+ keycloakConsole?: string;
1252
+ domainName?: string;
1253
+ }
1254
+ /**
1255
+ * Kagenti server's user-facing SSO / Keycloak configuration.
1256
+ *
1257
+ * **This is NOT the Backstage service credentials** configured in
1258
+ * `augment.kagenti.auth` (which uses OAuth2 client-credentials grant
1259
+ * for backend-to-Kagenti API authentication). This type represents
1260
+ * the Kagenti server's own authentication settings for end users,
1261
+ * as returned by the `GET /api/v1/auth/config` endpoint.
1262
+ *
1263
+ * @public
1264
+ */
1265
+ interface KagentiAuthConfig {
1266
+ enabled: boolean;
1267
+ keycloak_url?: string;
1268
+ realm?: string;
1269
+ client_id?: string;
1270
+ redirect_uri?: string;
1271
+ }
1272
+ /** @public */
1273
+ interface KagentiBuildListItem {
1274
+ name: string;
1275
+ namespace: string;
1276
+ resourceType?: string;
1277
+ registered: boolean;
1278
+ strategy?: string;
1279
+ gitUrl?: string;
1280
+ gitRevision?: string;
1281
+ contextDir?: string;
1282
+ outputImage?: string;
1283
+ creationTimestamp?: string;
1284
+ }
1285
+ /** @public */
1286
+ interface KagentiResourceConfigFromBuild {
1287
+ protocol?: string;
1288
+ framework?: string;
1289
+ createHttpRoute?: boolean;
1290
+ registrySecret?: string;
1291
+ envVars?: KagentiEnvVar[];
1292
+ servicePorts?: KagentiServicePort[];
1293
+ }
1294
+ /** @public */
1295
+ interface KagentiBuildInfo {
1296
+ name: string;
1297
+ namespace: string;
1298
+ buildRegistered: boolean;
1299
+ buildReason?: string;
1300
+ buildMessage?: string;
1301
+ outputImage: string;
1302
+ strategy: string;
1303
+ gitUrl: string;
1304
+ gitRevision: string;
1305
+ contextDir: string;
1306
+ hasBuildRun: boolean;
1307
+ buildRunName?: string;
1308
+ buildRunPhase?: string;
1309
+ buildRunStartTime?: string;
1310
+ buildRunCompletionTime?: string;
1311
+ buildRunOutputImage?: string;
1312
+ buildRunOutputDigest?: string;
1313
+ buildRunFailureMessage?: string;
1314
+ agentConfig?: KagentiResourceConfigFromBuild;
1315
+ toolConfig?: KagentiResourceConfigFromBuild;
1316
+ }
1317
+ /** @public */
1318
+ interface KagentiBuildStrategy {
1319
+ name: string;
1320
+ description?: string;
1321
+ }
1322
+ /** @public */
1323
+ interface KagentiRouteStatus {
1324
+ hasRoute: boolean;
1325
+ /** Present when the API exposes a public URL for the route. */
1326
+ url?: string;
1327
+ /** Additional fields returned by the Kagenti API (e.g. ready, status). */
1328
+ [key: string]: unknown;
1329
+ }
1330
+ /** @public */
1331
+ interface KagentiTriggerBuildRunResponse {
1332
+ success: boolean;
1333
+ buildRunName: string;
1334
+ namespace: string;
1335
+ buildName: string;
1336
+ message?: string;
1337
+ }
1338
+ /** @public */
1339
+ interface KagentiMigratableAgent {
1340
+ name: string;
1341
+ namespace: string;
1342
+ status: string;
1343
+ has_deployment: boolean;
1344
+ labels: KagentiResourceLabels;
1345
+ description?: string;
1346
+ }
1347
+ /** @public */
1348
+ interface KagentiMigrateAgentResponse {
1349
+ success: boolean;
1350
+ migrated: boolean;
1351
+ name: string;
1352
+ namespace: string;
1353
+ message: string;
1354
+ deployment_created: boolean;
1355
+ service_created: boolean;
1356
+ agent_crd_deleted: boolean;
1357
+ }
1358
+ /** @public */
1359
+ interface KagentiMigrateAllResponse {
1360
+ namespace: string;
1361
+ dry_run: boolean;
1362
+ delete_old: boolean;
1363
+ total: number;
1364
+ migrated: unknown[];
1365
+ skipped: unknown[];
1366
+ failed: unknown[];
1367
+ }
1368
+ /** @public */
1369
+ interface KagentiSandboxSession {
1370
+ contextId: string;
1371
+ agentName?: string;
1372
+ status: string;
1373
+ title?: string;
1374
+ visibility?: 'private' | 'namespace';
1375
+ createdAt?: string;
1376
+ updatedAt?: string;
1377
+ }
1378
+ /** @public */
1379
+ interface KagentiSandboxAgentInfo {
1380
+ name: string;
1381
+ namespace: string;
1382
+ sessionCount?: number;
1383
+ [key: string]: unknown;
1384
+ }
1385
+ /** @public */
1386
+ interface KagentiSandboxCreateRequest {
1387
+ [key: string]: unknown;
1388
+ }
1389
+ /** @public */
1390
+ interface KagentiSidecar {
1391
+ sidecarType: string;
1392
+ enabled: boolean;
1393
+ config?: Record<string, unknown>;
1394
+ }
1395
+ /** @public */
1396
+ interface KagentiSessionTokenUsage {
1397
+ contextId: string;
1398
+ totalTokens?: number;
1399
+ totalCost?: number;
1400
+ models?: Array<{
1401
+ model: string;
1402
+ tokens: number;
1403
+ cost?: number;
1404
+ }>;
1405
+ }
1406
+ /** @public */
1407
+ interface KagentiIntegration {
1408
+ name: string;
1409
+ namespace: string;
1410
+ conditions?: Array<{
1411
+ type: string;
1412
+ status: string;
1413
+ message?: string;
1414
+ }>;
1415
+ [key: string]: unknown;
1416
+ }
1417
+ /** @public */
1418
+ interface KagentiCreateIntegrationRequest {
1419
+ name: string;
1420
+ namespace: string;
1421
+ [key: string]: unknown;
1422
+ }
1423
+ /** @public */
1424
+ interface KagentiLlmTeam {
1425
+ teamId: string;
1426
+ namespace: string;
1427
+ [key: string]: unknown;
1428
+ }
1429
+ /** @public */
1430
+ interface KagentiLlmKey {
1431
+ alias?: string;
1432
+ agent?: string;
1433
+ namespace?: string;
1434
+ [key: string]: unknown;
1435
+ }
1436
+ /** @public */
1437
+ interface KagentiCreateTeamRequest {
1438
+ namespace: string;
1439
+ [key: string]: unknown;
1440
+ }
1441
+ /** @public */
1442
+ interface KagentiCreateKeyRequest {
1443
+ namespace: string;
1444
+ agentName: string;
1445
+ [key: string]: unknown;
1446
+ }
1447
+ /** @public */
1448
+ interface KagentiTriggerRequest {
1449
+ type: 'cron' | 'webhook' | 'alert';
1450
+ namespace: string;
1451
+ skill?: string;
1452
+ schedule?: string;
1453
+ ttl_hours?: number;
1454
+ [key: string]: unknown;
1455
+ }
1456
+ /** Request body for creating a Dev Spaces workspace. @public */
1457
+ interface DevSpacesCreateWorkspaceRequest {
1458
+ namespace: string;
1459
+ git_repo: string;
1460
+ memory_limit?: string;
1461
+ cpu_limit?: string;
1462
+ }
1463
+ /** Response from the Dev Spaces workspace creation API. @public */
1464
+ interface DevSpacesCreateWorkspaceResponse {
1465
+ name: string;
1466
+ namespace: string;
1467
+ phase: string;
1468
+ message?: string;
1469
+ url?: string;
1470
+ created_at?: string;
1471
+ }
1472
+ /** Health check response for the Dev Spaces API. @public */
1473
+ interface DevSpacesHealthResponse {
1474
+ ok: boolean;
1475
+ configured: boolean;
1476
+ message: string;
1477
+ apiUrl?: string;
1478
+ responseTimeMs?: number;
1479
+ }
1480
+ /** A single workspace entry returned by list/get operations. @public */
1481
+ interface DevSpacesWorkspace {
1482
+ name: string;
1483
+ namespace: string;
1484
+ phase: string;
1485
+ url?: string;
1486
+ created_at?: string;
1487
+ started_at?: string;
1488
+ stopped_at?: string;
1489
+ git_repo?: string;
1490
+ memory_limit?: string;
1491
+ cpu_limit?: string;
1492
+ }
1493
+ /** Response from the list-workspaces endpoint. @public */
1494
+ interface DevSpacesListWorkspacesResponse {
1495
+ workspaces: DevSpacesWorkspace[];
1496
+ namespace: string;
1497
+ }
1498
+ /** Request to stop a workspace. @public */
1499
+ interface DevSpacesStopWorkspaceRequest {
1500
+ namespace: string;
1501
+ name: string;
1502
+ }
1503
+ /** Request to delete a workspace. @public */
1504
+ interface DevSpacesDeleteWorkspaceRequest {
1505
+ namespace: string;
1506
+ name: string;
1507
+ }
1508
+
1509
+ /**
1510
+ * Status of a workflow in its lifecycle.
1511
+ * @public
1512
+ */
1513
+ type WorkflowStatus = 'draft' | 'published' | 'archived';
1514
+ /**
1515
+ * Discriminated node types available in the workflow canvas.
1516
+ * @public
1517
+ */
1518
+ type WorkflowNodeType = 'start' | 'agent' | 'tool' | 'guardrail' | 'logic' | 'user_interaction' | 'classify' | 'end' | 'note' | 'transform' | 'set_state' | 'file_search' | 'mcp';
1519
+ /**
1520
+ * Position on the canvas for visual layout.
1521
+ * @public
1522
+ */
1523
+ interface NodePosition {
1524
+ x: number;
1525
+ y: number;
1526
+ }
1527
+ /**
1528
+ * Data for the Start node -- defines the workflow's input contract.
1529
+ * @public
1530
+ */
1531
+ interface StartNodeData {
1532
+ inputDescription?: string;
1533
+ inputSchema?: Record<string, unknown>;
1534
+ }
1535
+ /**
1536
+ * Data for an Agent node -- carries the full agent configuration.
1537
+ * @public
1538
+ */
1539
+ interface AgentNodeData {
1540
+ agentKey: string;
1541
+ name: string;
1542
+ instructions: string;
1543
+ handoffDescription?: string;
1544
+ model?: string;
1545
+ mcpServers?: string[];
1546
+ enableRAG?: boolean;
1547
+ vectorStoreIds?: string[];
1548
+ enableWebSearch?: boolean;
1549
+ enableCodeInterpreter?: boolean;
1550
+ functions?: AgentFunctionDef[];
1551
+ toolChoice?: string;
1552
+ temperature?: number;
1553
+ maxOutputTokens?: number;
1554
+ maxToolCalls?: number;
1555
+ reasoning?: {
1556
+ effort?: string;
1557
+ };
1558
+ guardrails?: string[];
1559
+ outputSchema?: Record<string, unknown>;
1560
+ toolUseBehavior?: string;
1561
+ resetToolChoice?: boolean;
1562
+ handoffInputFilter?: string;
1563
+ handoffInputSchema?: Record<string, unknown>;
1564
+ nestHandoffHistory?: boolean;
1565
+ truncation?: string;
1566
+ promptRef?: {
1567
+ id: string;
1568
+ version?: number;
1569
+ variables?: Record<string, string>;
1570
+ };
1571
+ enabled?: boolean;
1572
+ }
1573
+ /**
1574
+ * A custom function definition attached to an agent.
1575
+ * @public
1576
+ */
1577
+ interface AgentFunctionDef {
1578
+ name: string;
1579
+ description: string;
1580
+ parameters: Record<string, unknown>;
1581
+ }
1582
+ /**
1583
+ * Tool type discriminator for ToolNodeData.
1584
+ * @public
1585
+ */
1586
+ type ToolNodeKind = 'mcp_server' | 'file_search' | 'web_search' | 'code_interpreter' | 'custom_function';
1587
+ /**
1588
+ * Data for a Tool node -- references an external capability.
1589
+ * @public
1590
+ */
1591
+ interface ToolNodeData {
1592
+ kind: ToolNodeKind;
1593
+ label: string;
1594
+ mcpServerId?: string;
1595
+ mcpToolFilter?: string[];
1596
+ vectorStoreIds?: string[];
1597
+ functionDef?: AgentFunctionDef;
1598
+ requireApproval?: boolean;
1599
+ }
1600
+ /**
1601
+ * Data for a Guardrail node -- safety checks on input/output.
1602
+ * @public
1603
+ */
1604
+ interface GuardrailNodeData {
1605
+ guardType: 'input' | 'output';
1606
+ shieldIds?: string[];
1607
+ customRules?: GuardrailRule[];
1608
+ onFailure: 'block' | 'warn' | 'fallback';
1609
+ fallbackMessage?: string;
1610
+ }
1611
+ /**
1612
+ * A custom guardrail rule (regex, keyword, or LLM-graded).
1613
+ * @public
1614
+ */
1615
+ interface GuardrailRule {
1616
+ id: string;
1617
+ name: string;
1618
+ type: 'regex' | 'keyword_block' | 'llm_grader';
1619
+ pattern?: string;
1620
+ keywords?: string[];
1621
+ graderPrompt?: string;
1622
+ }
1623
+ /**
1624
+ * Logic node sub-type.
1625
+ * @public
1626
+ */
1627
+ type LogicNodeKind = 'if_else' | 'while_loop' | 'switch';
1628
+ /**
1629
+ * Data for a Logic node -- conditional routing and loops.
1630
+ * @public
1631
+ */
1632
+ interface LogicNodeData {
1633
+ kind: LogicNodeKind;
1634
+ condition: string;
1635
+ cases?: Array<{
1636
+ label: string;
1637
+ condition: string;
1638
+ }>;
1639
+ maxIterations?: number;
1640
+ }
1641
+ /**
1642
+ * Data for a User Interaction node -- HITL approval gates and forms.
1643
+ * @public
1644
+ */
1645
+ interface UserInteractionNodeData {
1646
+ interactionType: 'approval_gate' | 'form_input' | 'confirmation';
1647
+ prompt: string;
1648
+ formFields?: UserInteractionField[];
1649
+ timeoutSeconds?: number;
1650
+ defaultAction?: 'approve' | 'reject' | 'skip';
1651
+ }
1652
+ /**
1653
+ * A field in a user interaction form.
1654
+ * @public
1655
+ */
1656
+ interface UserInteractionField {
1657
+ id: string;
1658
+ label: string;
1659
+ type: 'text' | 'select' | 'boolean' | 'number';
1660
+ required?: boolean;
1661
+ options?: string[];
1662
+ defaultValue?: string;
1663
+ }
1664
+ /**
1665
+ * Data for a Classify node -- routes to different branches based on LLM classification.
1666
+ * @public
1667
+ */
1668
+ interface ClassifyNodeData {
1669
+ classifications: Array<{
1670
+ label: string;
1671
+ description: string;
1672
+ }>;
1673
+ instructions?: string;
1674
+ model?: string;
1675
+ }
1676
+ /**
1677
+ * Data for an End node -- terminates the workflow execution.
1678
+ * @public
1679
+ */
1680
+ interface EndNodeData {
1681
+ outputExpression?: string;
1682
+ }
1683
+ /**
1684
+ * Data for a Note node -- annotation-only, no execution semantics.
1685
+ * @public
1686
+ */
1687
+ interface NoteNodeData {
1688
+ text: string;
1689
+ }
1690
+ /**
1691
+ * Data for a Transform node -- transforms data between steps using expressions.
1692
+ * @public
1693
+ */
1694
+ interface TransformNodeData {
1695
+ expression: string;
1696
+ outputVariable?: string;
1697
+ }
1698
+ /**
1699
+ * Data for a Set State node -- assigns values to workflow state variables.
1700
+ * @public
1701
+ */
1702
+ interface SetStateNodeData {
1703
+ assignments: Record<string, string>;
1704
+ }
1705
+ /**
1706
+ * Data for a File Search node -- configures vector store search.
1707
+ * @public
1708
+ */
1709
+ interface FileSearchNodeData {
1710
+ vectorStoreIds?: string[];
1711
+ maxResults?: number;
1712
+ scoreThreshold?: number;
1713
+ }
1714
+ /**
1715
+ * Data for an MCP node -- configures a Model Context Protocol server.
1716
+ * @public
1717
+ */
1718
+ interface McpNodeData {
1719
+ serverUrl: string;
1720
+ serverLabel: string;
1721
+ requireApproval?: 'always' | 'never' | 'auto';
1722
+ allowedTools?: string[];
1723
+ headers?: Record<string, string>;
1724
+ }
1725
+ /**
1726
+ * Union of all node data payloads, discriminated by the parent node's `type`.
1727
+ * @public
1728
+ */
1729
+ type WorkflowNodeData = StartNodeData | AgentNodeData | ToolNodeData | GuardrailNodeData | LogicNodeData | UserInteractionNodeData | ClassifyNodeData | EndNodeData | NoteNodeData | TransformNodeData | SetStateNodeData | FileSearchNodeData | McpNodeData;
1730
+ /**
1731
+ * A single node in the workflow graph.
1732
+ * @public
1733
+ */
1734
+ interface WorkflowNode {
1735
+ id: string;
1736
+ type: WorkflowNodeType;
1737
+ position: NodePosition;
1738
+ data: WorkflowNodeData;
1739
+ label?: string;
1740
+ }
1741
+ /**
1742
+ * Edge type determines the connection semantics.
1743
+ * @public
1744
+ */
1745
+ type WorkflowEdgeType = 'handoff' | 'tool_binding' | 'guardrail_binding' | 'sequence' | 'conditional';
1746
+ /**
1747
+ * A connection between two nodes in the workflow graph.
1748
+ * @public
1749
+ */
1750
+ interface WorkflowEdge {
1751
+ id: string;
1752
+ source: string;
1753
+ target: string;
1754
+ sourceHandle?: string;
1755
+ targetHandle?: string;
1756
+ type?: WorkflowEdgeType;
1757
+ label?: string;
1758
+ condition?: string;
1759
+ }
1760
+ /**
1761
+ * Global settings that apply to the entire workflow.
1762
+ * @public
1763
+ */
1764
+ interface WorkflowSettings {
1765
+ maxTurns?: number;
1766
+ defaultModel?: string;
1767
+ globalGuardrails?: string[];
1768
+ conversationPersistence?: boolean;
1769
+ tracingEnabled?: boolean;
1770
+ timeoutSeconds?: number;
1771
+ }
1772
+ /**
1773
+ * A published, immutable version snapshot of a workflow.
1774
+ * @public
1775
+ */
1776
+ interface WorkflowVersion {
1777
+ version: number;
1778
+ publishedAt: string;
1779
+ publishedBy: string;
1780
+ changelog?: string;
1781
+ definition: WorkflowDefinition;
1782
+ }
1783
+ /**
1784
+ * The complete workflow definition -- the top-level serializable artifact.
1785
+ *
1786
+ * This is persisted in the admin config store and exchanged between the
1787
+ * frontend canvas editor and the backend hydration engine.
1788
+ * @public
1789
+ */
1790
+ interface WorkflowDefinition {
1791
+ id: string;
1792
+ name: string;
1793
+ description: string;
1794
+ version: number;
1795
+ createdAt: string;
1796
+ updatedAt: string;
1797
+ createdBy?: string;
1798
+ updatedBy?: string;
1799
+ status: WorkflowStatus;
1800
+ nodes: WorkflowNode[];
1801
+ edges: WorkflowEdge[];
1802
+ settings: WorkflowSettings;
1803
+ tags?: string[];
1804
+ }
1805
+ /**
1806
+ * Status of a workflow execution run.
1807
+ * @public
1808
+ */
1809
+ type WorkflowRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'interrupted' | 'cancelled';
1810
+ /**
1811
+ * A record of a single node's execution within a run.
1812
+ * @public
1813
+ */
1814
+ interface NodeExecutionRecord {
1815
+ nodeId: string;
1816
+ nodeType: WorkflowNodeType;
1817
+ nodeName: string;
1818
+ startedAt: string;
1819
+ completedAt?: string;
1820
+ status: 'running' | 'completed' | 'failed' | 'skipped';
1821
+ input?: unknown;
1822
+ output?: unknown;
1823
+ error?: string;
1824
+ tokenUsage?: {
1825
+ inputTokens: number;
1826
+ outputTokens: number;
1827
+ };
1828
+ durationMs?: number;
1829
+ }
1830
+ /**
1831
+ * A complete execution trace for a workflow run.
1832
+ * @public
1833
+ */
1834
+ interface WorkflowRunTrace {
1835
+ runId: string;
1836
+ workflowId: string;
1837
+ workflowVersion: number;
1838
+ status: WorkflowRunStatus;
1839
+ startedAt: string;
1840
+ completedAt?: string;
1841
+ nodeExecutions: NodeExecutionRecord[];
1842
+ totalTokenUsage?: {
1843
+ inputTokens: number;
1844
+ outputTokens: number;
1845
+ };
1846
+ totalDurationMs?: number;
1847
+ error?: string;
1848
+ }
1849
+ /**
1850
+ * A single test case for evaluating a workflow.
1851
+ * @public
1852
+ */
1853
+ interface WorkflowTestCase {
1854
+ id: string;
1855
+ name: string;
1856
+ input: string;
1857
+ expectedOutput?: string;
1858
+ expectedAgent?: string;
1859
+ criteria?: EvaluationCriterion[];
1860
+ tags?: string[];
1861
+ }
1862
+ /**
1863
+ * A criterion for grading a workflow run.
1864
+ * @public
1865
+ */
1866
+ interface EvaluationCriterion {
1867
+ id: string;
1868
+ name: string;
1869
+ type: 'exact_match' | 'contains' | 'regex' | 'llm_graded' | 'custom';
1870
+ weight: number;
1871
+ pattern?: string;
1872
+ graderPrompt?: string;
1873
+ scoringFunction?: string;
1874
+ threshold?: number;
1875
+ }
1876
+ /**
1877
+ * Result of evaluating a single test case.
1878
+ * @public
1879
+ */
1880
+ interface TestCaseResult {
1881
+ testCaseId: string;
1882
+ passed: boolean;
1883
+ score: number;
1884
+ actualOutput: string;
1885
+ actualAgent?: string;
1886
+ criterionResults: Array<{
1887
+ criterionId: string;
1888
+ passed: boolean;
1889
+ score: number;
1890
+ details?: string;
1891
+ }>;
1892
+ trace: WorkflowRunTrace;
1893
+ durationMs: number;
1894
+ }
1895
+ /**
1896
+ * Result of an evaluation run across multiple test cases.
1897
+ * @public
1898
+ */
1899
+ interface WorkflowEvaluationResult {
1900
+ evaluationId: string;
1901
+ workflowId: string;
1902
+ workflowVersion: number;
1903
+ ranAt: string;
1904
+ ranBy?: string;
1905
+ testCaseResults: TestCaseResult[];
1906
+ overallScore: number;
1907
+ passRate: number;
1908
+ totalDurationMs: number;
1909
+ }
1910
+ /**
1911
+ * A stored set of test cases for repeatable evaluation.
1912
+ * @public
1913
+ */
1914
+ interface WorkflowTestSuite {
1915
+ id: string;
1916
+ name: string;
1917
+ workflowId: string;
1918
+ testCases: WorkflowTestCase[];
1919
+ createdAt: string;
1920
+ updatedAt: string;
1921
+ }
1922
+ /**
1923
+ * Creates a default empty workflow definition.
1924
+ */
1925
+ declare function createDefaultWorkflow(id: string, name: string, createdBy?: string): WorkflowDefinition;
1926
+ /**
1927
+ * Type guard for AgentNodeData.
1928
+ */
1929
+ declare function isAgentNodeData(data: WorkflowNodeData): data is AgentNodeData;
1930
+ /**
1931
+ * Type guard for ToolNodeData.
1932
+ */
1933
+ declare function isToolNodeData(data: WorkflowNodeData): data is ToolNodeData;
1934
+ /**
1935
+ * Type guard for GuardrailNodeData.
1936
+ */
1937
+ declare function isGuardrailNodeData(data: WorkflowNodeData): data is GuardrailNodeData;
1938
+ /**
1939
+ * Type guard for LogicNodeData.
1940
+ */
1941
+ declare function isLogicNodeData(data: WorkflowNodeData): data is LogicNodeData;
1942
+ /**
1943
+ * Type guard for UserInteractionNodeData.
1944
+ */
1945
+ declare function isUserInteractionNodeData(data: WorkflowNodeData): data is UserInteractionNodeData;
1946
+
1947
+ declare const WORKFLOW_TEMPLATES: WorkflowDefinition[];
1948
+
1949
+ /**
1950
+ * Built-in AI provider identifiers shipped with the plugin.
1951
+ * @public
1952
+ */
1953
+ type BuiltInProviderType = 'llamastack' | 'googleadk' | 'kagenti';
1954
+ /**
1955
+ * All accepted provider identifiers.
1956
+ *
1957
+ * Built-in types (`llamastack`, `googleadk`) are autocompleted,
1958
+ * but arbitrary string IDs from extension-registered providers
1959
+ * are also accepted via the `(string & {})` widening pattern.
1960
+ *
1961
+ * @public
1962
+ */
1963
+ type ProviderType = BuiltInProviderType | (string & {});
1964
+ /**
1965
+ * Capability categories that a provider may support.
1966
+ *
1967
+ * Used by the admin panel to conditionally render config tabs
1968
+ * and by the backend to gate API endpoints.
1969
+ *
1970
+ * @public
1971
+ */
1972
+ interface ProviderCapabilities {
1973
+ readonly chat: boolean;
1974
+ readonly rag: boolean;
1975
+ readonly safety: boolean;
1976
+ readonly evaluation: boolean;
1977
+ readonly conversations: boolean;
1978
+ readonly mcpTools: boolean;
1979
+ readonly tools: boolean;
1980
+ /** Provider manages tool lifecycle (build, deploy, route) */
1981
+ readonly toolLifecycle: boolean;
1982
+ /** Provider manages agent lifecycle (build, deploy, migrate) */
1983
+ readonly agentLifecycle: boolean;
1984
+ /** Provider supports DevSpaces integration */
1985
+ readonly devSpaces: boolean;
1986
+ /** Provider needs context hydrated from DB on non-streaming paths */
1987
+ readonly contextHydration: boolean;
1988
+ /** Provider registers its own sub-routes (e.g. kagenti-specific endpoints) */
1989
+ readonly providerRoutes: boolean;
1990
+ }
1991
+ /**
1992
+ * Definition of a single provider-specific config field.
1993
+ *
1994
+ * The admin panel uses these to render dynamic forms based
1995
+ * on which provider is active.
1996
+ *
1997
+ * @public
1998
+ */
1999
+ interface ProviderConfigField {
2000
+ /** Config key (matches AdminConfigKey) */
2001
+ readonly key: string;
2002
+ /** Human-readable label for the form field */
2003
+ readonly label: string;
2004
+ /** Field type determines the form control rendered */
2005
+ readonly type: 'string' | 'boolean' | 'number' | 'select';
2006
+ /** Whether the field is required for the provider to function */
2007
+ readonly required: boolean;
2008
+ /** Help text shown below the field */
2009
+ readonly description?: string;
2010
+ /** Options for 'select' type fields */
2011
+ readonly options?: readonly string[];
2012
+ /** Placeholder text for text inputs */
2013
+ readonly placeholder?: string;
2014
+ /** Whether the field value is sensitive (passwords, secrets) and should be masked in UI */
2015
+ readonly sensitive?: boolean;
2016
+ }
2017
+ /**
2018
+ * Describes an AI provider's identity, capabilities, and config shape.
2019
+ *
2020
+ * The provider registry holds one descriptor per known provider,
2021
+ * including placeholders for providers that are not yet implemented.
2022
+ *
2023
+ * @public
2024
+ */
2025
+ interface ProviderDescriptor {
2026
+ /** Unique provider identifier */
2027
+ readonly id: ProviderType;
2028
+ /** Human-readable display name (e.g., "Llama Stack") */
2029
+ readonly displayName: string;
2030
+ /** Short description of the provider */
2031
+ readonly description: string;
2032
+ /** Whether this provider has a working implementation */
2033
+ readonly implemented: boolean;
2034
+ /** Which capability categories this provider supports */
2035
+ readonly capabilities: ProviderCapabilities;
2036
+ /** Provider-specific config field definitions for the admin panel */
2037
+ readonly configFields: readonly ProviderConfigField[];
2038
+ }
2039
+ /**
2040
+ * Config keys that are shared across all providers.
2041
+ *
2042
+ * These are stored without a provider prefix and apply
2043
+ * regardless of which provider is active.
2044
+ *
2045
+ * @public
2046
+ */
2047
+ declare const GLOBAL_CONFIG_KEYS: readonly ["systemPrompt", "branding", "promptGroups", "safetyPatterns", "mcpServers", "disabledMcpServerIds", "agents", "defaultAgent", "maxAgentTurns", "devSpacesApiUrl"];
2048
+ /**
2049
+ * Config keys that are scoped per provider.
2050
+ *
2051
+ * When stored in the database, these are prefixed with the
2052
+ * provider ID (e.g., `llamastack::model`). This allows each
2053
+ * provider to retain its own settings when switching.
2054
+ *
2055
+ * @public
2056
+ */
2057
+ declare const PROVIDER_SCOPED_KEYS: readonly ["model", "baseUrl", "kagentiBaseUrl", "toolChoice", "enableWebSearch", "enableCodeInterpreter", "safetyEnabled", "inputShields", "outputShields", "safetyOnError", "evaluationEnabled", "scoringFunctions", "minScoreThreshold", "evaluationOnError", "vectorStoreConfig", "activeVectorStoreIds", "maxToolCalls", "maxOutputTokens", "temperature", "safetyIdentifier"];
2058
+ /**
2059
+ * Type-safe element of {@link GLOBAL_CONFIG_KEYS}.
2060
+ * @public
2061
+ */
2062
+ type GlobalConfigKey = (typeof GLOBAL_CONFIG_KEYS)[number];
2063
+ /**
2064
+ * Type-safe element of {@link PROVIDER_SCOPED_KEYS}.
2065
+ * @public
2066
+ */
2067
+ type ProviderScopedKey = (typeof PROVIDER_SCOPED_KEYS)[number];
2068
+ /**
2069
+ * Build a provider-scoped config key for database storage.
2070
+ *
2071
+ * @param provider - The provider ID to scope under
2072
+ * @param key - The base config key
2073
+ * @returns A scoped key in the format `provider::key`
2074
+ * @public
2075
+ */
2076
+ declare function scopedConfigKey(provider: ProviderType, key: string): string;
2077
+ /**
2078
+ * Check whether a config key is provider-scoped.
2079
+ *
2080
+ * @param key - The config key to check
2081
+ * @returns `true` if the key should be stored per-provider
2082
+ * @public
2083
+ */
2084
+ declare function isProviderScopedKey(key: string): key is ProviderScopedKey;
2085
+ /**
2086
+ * Check whether a config key is global (shared across providers).
2087
+ *
2088
+ * @param key - The config key to check
2089
+ * @returns `true` if the key is shared across all providers
2090
+ * @public
2091
+ */
2092
+ declare function isGlobalConfigKey(key: string): key is GlobalConfigKey;
2093
+
2094
+ export { DEFAULT_BRANDING, FileFormat, GLOBAL_CONFIG_KEYS, LEGACY_STAGE_MAP, LIFECYCLE_STAGE_ORDER, LIFECYCLE_TRANSITIONS, PROVIDER_SCOPED_KEYS, WORKFLOW_TEMPLATES, augmentAccessPermission, augmentAdminPermission, augmentPermissions, createDefaultWorkflow, deriveRoleFromTopology, getAvailableTransitions, isAgentNodeData, isGlobalConfigKey, isGuardrailNodeData, isLogicNodeData, isProviderScopedKey, isToolNodeData, isUserInteractionNodeData, isValidTransition, normalizeLifecycleStage, scopedConfigKey };
2095
+ export type { AdminConfigEntry, AdminConfigKey, AgentFunctionDef, AgentLifecycleAction, AgentLifecycleStage, AgentLifecycleTransition, AgentNodeData, AgentRole, AgentTopologyNode, AugmentStatus, BrandingConfig, BuiltInProviderType, ChatAgent, ChatAgentConfig, ChatMessage, ChatResponse, ChatToolConfig, ClassifyNodeData, ConversationSummary, DevSpacesCreateWorkspaceRequest, DevSpacesCreateWorkspaceResponse, DevSpacesDeleteWorkspaceRequest, DevSpacesHealthResponse, DevSpacesListWorkspacesResponse, DevSpacesStopWorkspaceRequest, DevSpacesWorkspace, DocumentInfo, EndNodeData, EvaluationCriterion, EvaluationResult, FileSearchNodeData, GlobalConfigKey, GuardrailNodeData, GuardrailRule, InputTokensDetails, KagentiAgentCard, KagentiAgentCardSkill, KagentiAgentDetail, KagentiAgentSummary, KagentiAuthConfig, KagentiBuildInfo, KagentiBuildListItem, KagentiBuildStrategy, KagentiConfigMapKeyRef, KagentiCreateAgentRequest, KagentiCreateAgentResponse, KagentiCreateIntegrationRequest, KagentiCreateKeyRequest, KagentiCreateTeamRequest, KagentiCreateToolRequest, KagentiCreateToolResponse, KagentiDashboardConfig, KagentiEnvVar, KagentiEnvVarSource, KagentiFeatureFlags, KagentiFinalizeAgentBuildRequest, KagentiFinalizeToolBuildRequest, KagentiIntegration, KagentiLlmKey, KagentiLlmTeam, KagentiMcpInvokeResponse, KagentiMcpToolSchema, KagentiMigratableAgent, KagentiMigrateAgentResponse, KagentiMigrateAllResponse, KagentiPersistentStorageConfig, KagentiResourceConfigFromBuild, KagentiResourceLabels, KagentiRouteStatus, KagentiSandboxAgentInfo, KagentiSandboxCreateRequest, KagentiSandboxSession, KagentiSecretKeyRef, KagentiServicePort, KagentiSessionTokenUsage, KagentiShipwrightConfig, KagentiSidecar, KagentiToolDetail, KagentiToolSummary, KagentiTriggerBuildRunResponse, KagentiTriggerRequest, LogicNodeData, LogicNodeKind, MCPServerStatus, MCPToolInfo, McpNodeData, NodeExecutionRecord, NodePosition, NormalizedStreamEvent, NoteNodeData, OutputTokensDetails, PendingApprovalInfo, PromptCapabilities, PromptCard, PromptGroup, ProviderCapabilities, ProviderConfigField, ProviderDescriptor, ProviderScopedKey, ProviderStatus, ProviderType, QuickAction, QuickPrompt, RAGSource, RagGenerateResult, RagTestChunk, RagTestResult, ReasoningSummary, ResponseUsage, SecurityMode, SetStateNodeData, StartNodeData, StreamAgentHandoffEvent, StreamArtifactEvent, StreamAuthRequiredEvent, StreamBackendToolExecutingEvent, StreamCitationEvent, StreamCitationReference, StreamCompletedEvent, StreamErrorEvent, StreamFormDescriptor, StreamFormField, StreamFormRequestEvent, StreamRagResultsEvent, StreamReasoningDeltaEvent, StreamReasoningDoneEvent, StreamSecretDemand, StreamStartedEvent, StreamTextDeltaEvent, StreamTextDoneEvent, StreamToolApprovalEvent, StreamToolCompletedEvent, StreamToolDeltaEvent, StreamToolDiscoveryEvent, StreamToolFailedEvent, StreamToolStartedEvent, SyncResult, TestCaseResult, ToolCallInfo, ToolCapabilityInfo, ToolNodeData, ToolNodeKind, TransformNodeData, UploadResult, UserInteractionField, UserInteractionNodeData, VectorStoreConfig, VectorStoreCreateResult, VectorStoreInfo, VectorStoreStatus, VectorStoreStatusResult, Workflow, WorkflowDefinition, WorkflowEdge, WorkflowEdgeType, WorkflowEvaluationResult, WorkflowNode, WorkflowNodeData, WorkflowNodeType, WorkflowRunStatus, WorkflowRunTrace, WorkflowSettings, WorkflowStatus, WorkflowStep, WorkflowTestCase, WorkflowTestSuite, WorkflowVersion };