@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,331 @@
1
+ function template(id, name, description, nodes, edges) {
2
+ const now = (/* @__PURE__ */ new Date()).toISOString();
3
+ return {
4
+ id,
5
+ name,
6
+ description,
7
+ version: 0,
8
+ createdAt: now,
9
+ updatedAt: now,
10
+ status: "draft",
11
+ nodes,
12
+ edges,
13
+ settings: {
14
+ maxTurns: 10,
15
+ conversationPersistence: true,
16
+ tracingEnabled: true
17
+ }
18
+ };
19
+ }
20
+ const WORKFLOW_TEMPLATES = [
21
+ // 1. Simple Q&A Agent — the simplest working workflow
22
+ template(
23
+ "tpl-simple-qa",
24
+ "Simple Q&A Agent",
25
+ "A basic single-agent workflow that answers questions. The simplest starting point for any new agent.",
26
+ [
27
+ {
28
+ id: "start_1",
29
+ type: "start",
30
+ position: { x: 50, y: 200 },
31
+ data: { inputDescription: "User question" },
32
+ label: "Start"
33
+ },
34
+ {
35
+ id: "agent_1",
36
+ type: "agent",
37
+ position: { x: 300, y: 200 },
38
+ data: {
39
+ name: "Assistant",
40
+ instructions: "You are a helpful, knowledgeable assistant. Answer the user's question clearly and concisely. Use markdown formatting when it helps readability (bullet points, bold, code blocks)."
41
+ },
42
+ label: "Assistant"
43
+ },
44
+ {
45
+ id: "end_1",
46
+ type: "end",
47
+ position: { x: 560, y: 200 },
48
+ data: {},
49
+ label: "End"
50
+ }
51
+ ],
52
+ [
53
+ { id: "e1", source: "start_1", target: "agent_1", type: "sequence" },
54
+ { id: "e2", source: "agent_1", target: "end_1", type: "sequence" }
55
+ ]
56
+ ),
57
+ // 2. Smart Router — classification + if/else branching
58
+ template(
59
+ "tpl-smart-router",
60
+ "Smart Router",
61
+ "Classifies user input as technical or general, then routes to the appropriate specialist agent using if/else logic.",
62
+ [
63
+ {
64
+ id: "start_1",
65
+ type: "start",
66
+ position: { x: 50, y: 250 },
67
+ data: { inputDescription: "User message" },
68
+ label: "Start"
69
+ },
70
+ {
71
+ id: "classify_1",
72
+ type: "classify",
73
+ position: { x: 270, y: 250 },
74
+ data: {
75
+ classifications: [
76
+ {
77
+ label: "technical",
78
+ description: "Programming, code, APIs, servers, debugging, or technology questions"
79
+ },
80
+ {
81
+ label: "general",
82
+ description: "General conversation, greetings, or non-technical questions"
83
+ }
84
+ ],
85
+ instructions: 'Classify the user input. Choose "technical" if it asks about programming, code, APIs, servers, debugging, or technology. Choose "general" for everything else.'
86
+ },
87
+ label: "Topic Classifier"
88
+ },
89
+ {
90
+ id: "logic_1",
91
+ type: "logic",
92
+ position: { x: 520, y: 250 },
93
+ data: {
94
+ kind: "if_else",
95
+ condition: "classify_1_output && classify_1_output.classification === 'technical'"
96
+ },
97
+ label: "Is Technical?"
98
+ },
99
+ {
100
+ id: "agent_tech",
101
+ type: "agent",
102
+ position: { x: 780, y: 130 },
103
+ data: {
104
+ name: "Tech Expert",
105
+ instructions: "You are a senior software engineer. Give concise, technically accurate answers about programming, APIs, DevOps, and technology. Use code examples when helpful. Keep responses brief but precise."
106
+ },
107
+ label: "Tech Expert"
108
+ },
109
+ {
110
+ id: "agent_general",
111
+ type: "agent",
112
+ position: { x: 780, y: 370 },
113
+ data: {
114
+ name: "Friendly Assistant",
115
+ instructions: "You are a warm, friendly assistant. Answer general questions in a conversational, approachable tone. Be helpful and brief."
116
+ },
117
+ label: "Friendly Assistant"
118
+ },
119
+ {
120
+ id: "end_1",
121
+ type: "end",
122
+ position: { x: 1040, y: 250 },
123
+ data: {},
124
+ label: "End"
125
+ }
126
+ ],
127
+ [
128
+ { id: "e1", source: "start_1", target: "classify_1", type: "sequence" },
129
+ { id: "e2", source: "classify_1", target: "logic_1", type: "sequence" },
130
+ {
131
+ id: "e3",
132
+ source: "logic_1",
133
+ target: "agent_tech",
134
+ type: "sequence",
135
+ label: "true"
136
+ },
137
+ {
138
+ id: "e4",
139
+ source: "logic_1",
140
+ target: "agent_general",
141
+ type: "sequence",
142
+ label: "false"
143
+ },
144
+ { id: "e5", source: "agent_tech", target: "end_1", type: "sequence" },
145
+ { id: "e6", source: "agent_general", target: "end_1", type: "sequence" }
146
+ ]
147
+ ),
148
+ // 3. Research & Summarize — multi-agent chaining
149
+ template(
150
+ "tpl-research-summarize",
151
+ "Research & Summarize",
152
+ "A two-agent pipeline: the first agent researches a topic in depth, then a second agent distills the findings into a concise summary.",
153
+ [
154
+ {
155
+ id: "start_1",
156
+ type: "start",
157
+ position: { x: 50, y: 200 },
158
+ data: {
159
+ inputDescription: "Research topic or question"
160
+ },
161
+ label: "Start"
162
+ },
163
+ {
164
+ id: "agent_research",
165
+ type: "agent",
166
+ position: { x: 300, y: 200 },
167
+ data: {
168
+ name: "Researcher",
169
+ instructions: "You are a thorough research analyst. Given a topic, provide a comprehensive analysis covering key facts, different perspectives, recent developments, and supporting details. Be detailed and well-organized. Use headers and bullet points."
170
+ },
171
+ label: "Researcher"
172
+ },
173
+ {
174
+ id: "agent_summarize",
175
+ type: "agent",
176
+ position: { x: 580, y: 200 },
177
+ data: {
178
+ name: "Summarizer",
179
+ instructions: "You are an expert editor and summarizer. Take the detailed research provided and distill it into a clear, concise executive summary (3-5 key bullet points). Highlight only the most important takeaways. End with a one-sentence conclusion."
180
+ },
181
+ label: "Summarizer"
182
+ },
183
+ {
184
+ id: "end_1",
185
+ type: "end",
186
+ position: { x: 840, y: 200 },
187
+ data: {},
188
+ label: "End"
189
+ }
190
+ ],
191
+ [
192
+ {
193
+ id: "e1",
194
+ source: "start_1",
195
+ target: "agent_research",
196
+ type: "sequence"
197
+ },
198
+ {
199
+ id: "e2",
200
+ source: "agent_research",
201
+ target: "agent_summarize",
202
+ type: "sequence"
203
+ },
204
+ {
205
+ id: "e3",
206
+ source: "agent_summarize",
207
+ target: "end_1",
208
+ type: "sequence"
209
+ }
210
+ ]
211
+ ),
212
+ // 4. Kubernetes Assistant — MCP tool integration
213
+ template(
214
+ "tpl-k8s-assistant",
215
+ "Kubernetes Assistant",
216
+ "Connects to a Kubernetes MCP server for live cluster operations \u2014 list pods, namespaces, deployments, and more.",
217
+ [
218
+ {
219
+ id: "start_1",
220
+ type: "start",
221
+ position: { x: 50, y: 200 },
222
+ data: {
223
+ inputDescription: "Kubernetes question or command"
224
+ },
225
+ label: "Start"
226
+ },
227
+ {
228
+ id: "mcp_1",
229
+ type: "mcp",
230
+ position: { x: 300, y: 200 },
231
+ data: {
232
+ serverUrl: "https://kubernetes-mcp-server-ocp-mcp-server.apps.ocp.v7hjl.sandbox2288.opentlc.com",
233
+ serverLabel: "k8s",
234
+ requireApproval: "never"
235
+ },
236
+ label: "K8s MCP Server"
237
+ },
238
+ {
239
+ id: "agent_1",
240
+ type: "agent",
241
+ position: { x: 580, y: 200 },
242
+ data: {
243
+ name: "K8s Assistant",
244
+ instructions: "You are a Kubernetes expert assistant with access to a live cluster. Use the available MCP tools to query the cluster and answer the user's question. Format output clearly using markdown tables or lists. Always show the namespace and resource name."
245
+ },
246
+ label: "K8s Assistant"
247
+ },
248
+ {
249
+ id: "end_1",
250
+ type: "end",
251
+ position: { x: 840, y: 200 },
252
+ data: {},
253
+ label: "End"
254
+ }
255
+ ],
256
+ [
257
+ { id: "e1", source: "start_1", target: "mcp_1", type: "sequence" },
258
+ { id: "e2", source: "mcp_1", target: "agent_1", type: "sequence" },
259
+ { id: "e3", source: "agent_1", target: "end_1", type: "sequence" }
260
+ ]
261
+ ),
262
+ // 5. Content Moderator — set_state + transform + agent pipeline
263
+ template(
264
+ "tpl-content-moderator",
265
+ "Content Moderator",
266
+ "Demonstrates data flow: sets metadata via state, transforms it into context, then an agent uses that context to moderate content.",
267
+ [
268
+ {
269
+ id: "start_1",
270
+ type: "start",
271
+ position: { x: 50, y: 200 },
272
+ data: { inputDescription: "Content to moderate" },
273
+ label: "Start"
274
+ },
275
+ {
276
+ id: "set_state_1",
277
+ type: "set_state",
278
+ position: { x: 280, y: 200 },
279
+ data: {
280
+ assignments: {
281
+ content_type: "'user_generated'",
282
+ platform: "'public_forum'",
283
+ policy_version: "'v2.1'"
284
+ }
285
+ },
286
+ label: "Set Metadata"
287
+ },
288
+ {
289
+ id: "transform_1",
290
+ type: "transform",
291
+ position: { x: 520, y: 200 },
292
+ data: {
293
+ expression: "`Content type: ${content_type}, Platform: ${platform}, Policy: ${policy_version}`",
294
+ outputVariable: "moderation_context"
295
+ },
296
+ label: "Build Context"
297
+ },
298
+ {
299
+ id: "agent_1",
300
+ type: "agent",
301
+ position: { x: 780, y: 200 },
302
+ data: {
303
+ name: "Moderator",
304
+ instructions: "You are a content moderation specialist. Review the user-submitted content for policy violations. Consider the moderation context (content type, platform, policy version). Respond with:\n1. **Verdict**: APPROVE or FLAG\n2. **Reason**: Brief explanation\n3. **Category**: If flagged, specify (spam, hate speech, harassment, misinformation, other)\n4. **Confidence**: High / Medium / Low"
305
+ },
306
+ label: "Moderator"
307
+ },
308
+ {
309
+ id: "end_1",
310
+ type: "end",
311
+ position: { x: 1040, y: 200 },
312
+ data: {},
313
+ label: "End"
314
+ }
315
+ ],
316
+ [
317
+ { id: "e1", source: "start_1", target: "set_state_1", type: "sequence" },
318
+ {
319
+ id: "e2",
320
+ source: "set_state_1",
321
+ target: "transform_1",
322
+ type: "sequence"
323
+ },
324
+ { id: "e3", source: "transform_1", target: "agent_1", type: "sequence" },
325
+ { id: "e4", source: "agent_1", target: "end_1", type: "sequence" }
326
+ ]
327
+ )
328
+ ];
329
+
330
+ export { WORKFLOW_TEMPLATES };
331
+ //# sourceMappingURL=workflowTemplates.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowTemplates.esm.js","sources":["../../src/templates/workflowTemplates.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n WorkflowDefinition,\n AgentNodeData,\n StartNodeData,\n ClassifyNodeData,\n LogicNodeData,\n McpNodeData,\n TransformNodeData,\n SetStateNodeData,\n EndNodeData,\n} from '../types/workflowBuilder';\n\nfunction template(\n id: string,\n name: string,\n description: string,\n nodes: WorkflowDefinition['nodes'],\n edges: WorkflowDefinition['edges'],\n): WorkflowDefinition {\n const now = new Date().toISOString();\n return {\n id,\n name,\n description,\n version: 0,\n createdAt: now,\n updatedAt: now,\n status: 'draft',\n nodes,\n edges,\n settings: {\n maxTurns: 10,\n conversationPersistence: true,\n tracingEnabled: true,\n },\n };\n}\n\nexport const WORKFLOW_TEMPLATES: WorkflowDefinition[] = [\n // 1. Simple Q&A Agent — the simplest working workflow\n template(\n 'tpl-simple-qa',\n 'Simple Q&A Agent',\n 'A basic single-agent workflow that answers questions. The simplest starting point for any new agent.',\n [\n {\n id: 'start_1',\n type: 'start',\n position: { x: 50, y: 200 },\n data: { inputDescription: 'User question' } as StartNodeData,\n label: 'Start',\n },\n {\n id: 'agent_1',\n type: 'agent',\n position: { x: 300, y: 200 },\n data: {\n name: 'Assistant',\n instructions:\n \"You are a helpful, knowledgeable assistant. Answer the user's question clearly and concisely. Use markdown formatting when it helps readability (bullet points, bold, code blocks).\",\n } as AgentNodeData,\n label: 'Assistant',\n },\n {\n id: 'end_1',\n type: 'end',\n position: { x: 560, y: 200 },\n data: {} as EndNodeData,\n label: 'End',\n },\n ],\n [\n { id: 'e1', source: 'start_1', target: 'agent_1', type: 'sequence' },\n { id: 'e2', source: 'agent_1', target: 'end_1', type: 'sequence' },\n ],\n ),\n\n // 2. Smart Router — classification + if/else branching\n template(\n 'tpl-smart-router',\n 'Smart Router',\n 'Classifies user input as technical or general, then routes to the appropriate specialist agent using if/else logic.',\n [\n {\n id: 'start_1',\n type: 'start',\n position: { x: 50, y: 250 },\n data: { inputDescription: 'User message' } as StartNodeData,\n label: 'Start',\n },\n {\n id: 'classify_1',\n type: 'classify',\n position: { x: 270, y: 250 },\n data: {\n classifications: [\n {\n label: 'technical',\n description:\n 'Programming, code, APIs, servers, debugging, or technology questions',\n },\n {\n label: 'general',\n description:\n 'General conversation, greetings, or non-technical questions',\n },\n ],\n instructions:\n 'Classify the user input. Choose \"technical\" if it asks about programming, code, APIs, servers, debugging, or technology. Choose \"general\" for everything else.',\n } as ClassifyNodeData,\n label: 'Topic Classifier',\n },\n {\n id: 'logic_1',\n type: 'logic',\n position: { x: 520, y: 250 },\n data: {\n kind: 'if_else',\n condition:\n \"classify_1_output && classify_1_output.classification === 'technical'\",\n } as LogicNodeData,\n label: 'Is Technical?',\n },\n {\n id: 'agent_tech',\n type: 'agent',\n position: { x: 780, y: 130 },\n data: {\n name: 'Tech Expert',\n instructions:\n 'You are a senior software engineer. Give concise, technically accurate answers about programming, APIs, DevOps, and technology. Use code examples when helpful. Keep responses brief but precise.',\n } as AgentNodeData,\n label: 'Tech Expert',\n },\n {\n id: 'agent_general',\n type: 'agent',\n position: { x: 780, y: 370 },\n data: {\n name: 'Friendly Assistant',\n instructions:\n 'You are a warm, friendly assistant. Answer general questions in a conversational, approachable tone. Be helpful and brief.',\n } as AgentNodeData,\n label: 'Friendly Assistant',\n },\n {\n id: 'end_1',\n type: 'end',\n position: { x: 1040, y: 250 },\n data: {} as EndNodeData,\n label: 'End',\n },\n ],\n [\n { id: 'e1', source: 'start_1', target: 'classify_1', type: 'sequence' },\n { id: 'e2', source: 'classify_1', target: 'logic_1', type: 'sequence' },\n {\n id: 'e3',\n source: 'logic_1',\n target: 'agent_tech',\n type: 'sequence',\n label: 'true',\n },\n {\n id: 'e4',\n source: 'logic_1',\n target: 'agent_general',\n type: 'sequence',\n label: 'false',\n },\n { id: 'e5', source: 'agent_tech', target: 'end_1', type: 'sequence' },\n { id: 'e6', source: 'agent_general', target: 'end_1', type: 'sequence' },\n ],\n ),\n\n // 3. Research & Summarize — multi-agent chaining\n template(\n 'tpl-research-summarize',\n 'Research & Summarize',\n 'A two-agent pipeline: the first agent researches a topic in depth, then a second agent distills the findings into a concise summary.',\n [\n {\n id: 'start_1',\n type: 'start',\n position: { x: 50, y: 200 },\n data: {\n inputDescription: 'Research topic or question',\n } as StartNodeData,\n label: 'Start',\n },\n {\n id: 'agent_research',\n type: 'agent',\n position: { x: 300, y: 200 },\n data: {\n name: 'Researcher',\n instructions:\n 'You are a thorough research analyst. Given a topic, provide a comprehensive analysis covering key facts, different perspectives, recent developments, and supporting details. Be detailed and well-organized. Use headers and bullet points.',\n } as AgentNodeData,\n label: 'Researcher',\n },\n {\n id: 'agent_summarize',\n type: 'agent',\n position: { x: 580, y: 200 },\n data: {\n name: 'Summarizer',\n instructions:\n 'You are an expert editor and summarizer. Take the detailed research provided and distill it into a clear, concise executive summary (3-5 key bullet points). Highlight only the most important takeaways. End with a one-sentence conclusion.',\n } as AgentNodeData,\n label: 'Summarizer',\n },\n {\n id: 'end_1',\n type: 'end',\n position: { x: 840, y: 200 },\n data: {} as EndNodeData,\n label: 'End',\n },\n ],\n [\n {\n id: 'e1',\n source: 'start_1',\n target: 'agent_research',\n type: 'sequence',\n },\n {\n id: 'e2',\n source: 'agent_research',\n target: 'agent_summarize',\n type: 'sequence',\n },\n {\n id: 'e3',\n source: 'agent_summarize',\n target: 'end_1',\n type: 'sequence',\n },\n ],\n ),\n\n // 4. Kubernetes Assistant — MCP tool integration\n template(\n 'tpl-k8s-assistant',\n 'Kubernetes Assistant',\n 'Connects to a Kubernetes MCP server for live cluster operations — list pods, namespaces, deployments, and more.',\n [\n {\n id: 'start_1',\n type: 'start',\n position: { x: 50, y: 200 },\n data: {\n inputDescription: 'Kubernetes question or command',\n } as StartNodeData,\n label: 'Start',\n },\n {\n id: 'mcp_1',\n type: 'mcp',\n position: { x: 300, y: 200 },\n data: {\n serverUrl:\n 'https://kubernetes-mcp-server-ocp-mcp-server.apps.ocp.v7hjl.sandbox2288.opentlc.com',\n serverLabel: 'k8s',\n requireApproval: 'never',\n } as McpNodeData,\n label: 'K8s MCP Server',\n },\n {\n id: 'agent_1',\n type: 'agent',\n position: { x: 580, y: 200 },\n data: {\n name: 'K8s Assistant',\n instructions:\n \"You are a Kubernetes expert assistant with access to a live cluster. Use the available MCP tools to query the cluster and answer the user's question. Format output clearly using markdown tables or lists. Always show the namespace and resource name.\",\n } as AgentNodeData,\n label: 'K8s Assistant',\n },\n {\n id: 'end_1',\n type: 'end',\n position: { x: 840, y: 200 },\n data: {} as EndNodeData,\n label: 'End',\n },\n ],\n [\n { id: 'e1', source: 'start_1', target: 'mcp_1', type: 'sequence' },\n { id: 'e2', source: 'mcp_1', target: 'agent_1', type: 'sequence' },\n { id: 'e3', source: 'agent_1', target: 'end_1', type: 'sequence' },\n ],\n ),\n\n // 5. Content Moderator — set_state + transform + agent pipeline\n template(\n 'tpl-content-moderator',\n 'Content Moderator',\n 'Demonstrates data flow: sets metadata via state, transforms it into context, then an agent uses that context to moderate content.',\n [\n {\n id: 'start_1',\n type: 'start',\n position: { x: 50, y: 200 },\n data: { inputDescription: 'Content to moderate' } as StartNodeData,\n label: 'Start',\n },\n {\n id: 'set_state_1',\n type: 'set_state',\n position: { x: 280, y: 200 },\n data: {\n assignments: {\n content_type: \"'user_generated'\",\n platform: \"'public_forum'\",\n policy_version: \"'v2.1'\",\n },\n } as SetStateNodeData,\n label: 'Set Metadata',\n },\n {\n id: 'transform_1',\n type: 'transform',\n position: { x: 520, y: 200 },\n data: {\n expression:\n '`Content type: ${content_type}, Platform: ${platform}, Policy: ${policy_version}`',\n outputVariable: 'moderation_context',\n } as TransformNodeData,\n label: 'Build Context',\n },\n {\n id: 'agent_1',\n type: 'agent',\n position: { x: 780, y: 200 },\n data: {\n name: 'Moderator',\n instructions:\n 'You are a content moderation specialist. Review the user-submitted content for policy violations. Consider the moderation context (content type, platform, policy version). Respond with:\\n1. **Verdict**: APPROVE or FLAG\\n2. **Reason**: Brief explanation\\n3. **Category**: If flagged, specify (spam, hate speech, harassment, misinformation, other)\\n4. **Confidence**: High / Medium / Low',\n } as AgentNodeData,\n label: 'Moderator',\n },\n {\n id: 'end_1',\n type: 'end',\n position: { x: 1040, y: 200 },\n data: {} as EndNodeData,\n label: 'End',\n },\n ],\n [\n { id: 'e1', source: 'start_1', target: 'set_state_1', type: 'sequence' },\n {\n id: 'e2',\n source: 'set_state_1',\n target: 'transform_1',\n type: 'sequence',\n },\n { id: 'e3', source: 'transform_1', target: 'agent_1', type: 'sequence' },\n { id: 'e4', source: 'agent_1', target: 'end_1', type: 'sequence' },\n ],\n ),\n];\n"],"names":[],"mappings":"AA4BA,SAAS,QAAA,CACP,EAAA,EACA,IAAA,EACA,WAAA,EACA,OACA,KAAA,EACoB;AACpB,EAAA,MAAM,GAAA,GAAA,iBAAM,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AACnC,EAAA,OAAO;AAAA,IACL,EAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA,EAAS,CAAA;AAAA,IACT,SAAA,EAAW,GAAA;AAAA,IACX,SAAA,EAAW,GAAA;AAAA,IACX,MAAA,EAAQ,OAAA;AAAA,IACR,KAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACR,QAAA,EAAU,EAAA;AAAA,MACV,uBAAA,EAAyB,IAAA;AAAA,MACzB,cAAA,EAAgB;AAAA;AAClB,GACF;AACF;AAEO,MAAM,kBAAA,GAA2C;AAAA;AAAA,EAEtD,QAAA;AAAA,IACE,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,sGAAA;AAAA,IACA;AAAA,MACE;AAAA,QACE,EAAA,EAAI,SAAA;AAAA,QACJ,IAAA,EAAM,OAAA;AAAA,QACN,QAAA,EAAU,EAAE,CAAA,EAAG,EAAA,EAAI,GAAG,GAAA,EAAI;AAAA,QAC1B,IAAA,EAAM,EAAE,gBAAA,EAAk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AAG,IAAA,EAAM,GAAG,GAAA,EAAI;AAAA,QAC5B,MAAM,EAAC;AAAA,QACP,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA;AAAA,MACE,EAAE,IAAI,IAAA,EAAM,MAAA,EAAQ,WAAW,MAAA,EAAQ,aAAA,EAAe,MAAM,UAAA,EAAW;AAAA,MACvE;AAAA,QACE,EAAA,EAAI,IAAA;AAAA,QACJ,MAAA,EAAQ,aAAA;AAAA,QACR,MAAA,EAAQ,aAAA;AAAA,QACR,IAAA,EAAM;AAAA,OACR;AAAA,MACA,EAAE,IAAI,IAAA,EAAM,MAAA,EAAQ,eAAe,MAAA,EAAQ,SAAA,EAAW,MAAM,UAAA,EAAW;AAAA,MACvE,EAAE,IAAI,IAAA,EAAM,MAAA,EAAQ,WAAW,MAAA,EAAQ,OAAA,EAAS,MAAM,UAAA;AAAW;AACnE;AAEJ;;;;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ const DEFAULT_BRANDING = {
4
+ appName: "Augment",
5
+ tagline: "Your AI-powered platform assistant",
6
+ inputPlaceholder: "Ask me anything...",
7
+ primaryColor: "#1e40af",
8
+ secondaryColor: "#475569",
9
+ successColor: "#10b981",
10
+ warningColor: "#f59e0b",
11
+ errorColor: "#ef4444",
12
+ infoColor: "#0ea5e9",
13
+ themePreset: "default"
14
+ };
15
+
16
+ exports.DEFAULT_BRANDING = DEFAULT_BRANDING;
17
+ //# sourceMappingURL=branding.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branding.cjs.js","sources":["../../src/types/branding.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Branding configuration loaded from app-config.yaml.\n * Shared across frontend and backend.\n * @public\n */\nexport interface BrandingConfig {\n appName: string;\n tagline: string;\n inputPlaceholder: string;\n primaryColor: string;\n secondaryColor: string;\n successColor: string;\n warningColor: string;\n errorColor: string;\n infoColor: string;\n logoUrl?: string;\n faviconUrl?: string;\n botAvatarUrl?: string;\n themePreset?: string;\n}\n\n/**\n * Single source of truth for branding defaults.\n * Used by both frontend hooks and backend API routes.\n * @public\n */\nexport const DEFAULT_BRANDING: BrandingConfig = {\n appName: 'Augment',\n tagline: 'Your AI-powered platform assistant',\n inputPlaceholder: 'Ask me anything...',\n primaryColor: '#1e40af',\n secondaryColor: '#475569',\n successColor: '#10b981',\n warningColor: '#f59e0b',\n errorColor: '#ef4444',\n infoColor: '#0ea5e9',\n themePreset: 'default',\n};\n"],"names":[],"mappings":";;AA0CO,MAAM,gBAAA,GAAmC;AAAA,EAC9C,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,oCAAA;AAAA,EACT,gBAAA,EAAkB,oBAAA;AAAA,EAClB,YAAA,EAAc,SAAA;AAAA,EACd,cAAA,EAAgB,SAAA;AAAA,EAChB,YAAA,EAAc,SAAA;AAAA,EACd,YAAA,EAAc,SAAA;AAAA,EACd,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,SAAA;AAAA,EACX,WAAA,EAAa;AACf;;;;"}
@@ -0,0 +1,15 @@
1
+ const DEFAULT_BRANDING = {
2
+ appName: "Augment",
3
+ tagline: "Your AI-powered platform assistant",
4
+ inputPlaceholder: "Ask me anything...",
5
+ primaryColor: "#1e40af",
6
+ secondaryColor: "#475569",
7
+ successColor: "#10b981",
8
+ warningColor: "#f59e0b",
9
+ errorColor: "#ef4444",
10
+ infoColor: "#0ea5e9",
11
+ themePreset: "default"
12
+ };
13
+
14
+ export { DEFAULT_BRANDING };
15
+ //# sourceMappingURL=branding.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branding.esm.js","sources":["../../src/types/branding.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Branding configuration loaded from app-config.yaml.\n * Shared across frontend and backend.\n * @public\n */\nexport interface BrandingConfig {\n appName: string;\n tagline: string;\n inputPlaceholder: string;\n primaryColor: string;\n secondaryColor: string;\n successColor: string;\n warningColor: string;\n errorColor: string;\n infoColor: string;\n logoUrl?: string;\n faviconUrl?: string;\n botAvatarUrl?: string;\n themePreset?: string;\n}\n\n/**\n * Single source of truth for branding defaults.\n * Used by both frontend hooks and backend API routes.\n * @public\n */\nexport const DEFAULT_BRANDING: BrandingConfig = {\n appName: 'Augment',\n tagline: 'Your AI-powered platform assistant',\n inputPlaceholder: 'Ask me anything...',\n primaryColor: '#1e40af',\n secondaryColor: '#475569',\n successColor: '#10b981',\n warningColor: '#f59e0b',\n errorColor: '#ef4444',\n infoColor: '#0ea5e9',\n themePreset: 'default',\n};\n"],"names":[],"mappings":"AA0CO,MAAM,gBAAA,GAAmC;AAAA,EAC9C,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,oCAAA;AAAA,EACT,gBAAA,EAAkB,oBAAA;AAAA,EAClB,YAAA,EAAc,SAAA;AAAA,EACd,cAAA,EAAgB,SAAA;AAAA,EAChB,YAAA,EAAc,SAAA;AAAA,EACd,YAAA,EAAc,SAAA;AAAA,EACd,UAAA,EAAY,SAAA;AAAA,EACZ,SAAA,EAAW,SAAA;AAAA,EACX,WAAA,EAAa;AACf;;;;"}
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ const GLOBAL_CONFIG_KEYS = [
4
+ "systemPrompt",
5
+ "branding",
6
+ "promptGroups",
7
+ "safetyPatterns",
8
+ "mcpServers",
9
+ "disabledMcpServerIds",
10
+ "agents",
11
+ "defaultAgent",
12
+ "maxAgentTurns",
13
+ "devSpacesApiUrl"
14
+ ];
15
+ const PROVIDER_SCOPED_KEYS = [
16
+ "model",
17
+ "baseUrl",
18
+ "kagentiBaseUrl",
19
+ "toolChoice",
20
+ "enableWebSearch",
21
+ "enableCodeInterpreter",
22
+ "safetyEnabled",
23
+ "inputShields",
24
+ "outputShields",
25
+ "safetyOnError",
26
+ "evaluationEnabled",
27
+ "scoringFunctions",
28
+ "minScoreThreshold",
29
+ "evaluationOnError",
30
+ "vectorStoreConfig",
31
+ "activeVectorStoreIds",
32
+ "maxToolCalls",
33
+ "maxOutputTokens",
34
+ "temperature",
35
+ "safetyIdentifier"
36
+ ];
37
+ function scopedConfigKey(provider, key) {
38
+ return `${provider}::${key}`;
39
+ }
40
+ function isProviderScopedKey(key) {
41
+ return PROVIDER_SCOPED_KEYS.includes(key);
42
+ }
43
+ function isGlobalConfigKey(key) {
44
+ return GLOBAL_CONFIG_KEYS.includes(key);
45
+ }
46
+
47
+ exports.GLOBAL_CONFIG_KEYS = GLOBAL_CONFIG_KEYS;
48
+ exports.PROVIDER_SCOPED_KEYS = PROVIDER_SCOPED_KEYS;
49
+ exports.isGlobalConfigKey = isGlobalConfigKey;
50
+ exports.isProviderScopedKey = isProviderScopedKey;
51
+ exports.scopedConfigKey = scopedConfigKey;
52
+ //# sourceMappingURL=provider.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.cjs.js","sources":["../../src/types/provider.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// =============================================================================\n// Provider Types\n// =============================================================================\n\n/**\n * Built-in AI provider identifiers shipped with the plugin.\n * @public\n */\nexport type BuiltInProviderType = 'llamastack' | 'googleadk' | 'kagenti';\n\n/**\n * All accepted provider identifiers.\n *\n * Built-in types (`llamastack`, `googleadk`) are autocompleted,\n * but arbitrary string IDs from extension-registered providers\n * are also accepted via the `(string & {})` widening pattern.\n *\n * @public\n */\nexport type ProviderType = BuiltInProviderType | (string & {});\n\n/**\n * Capability categories that a provider may support.\n *\n * Used by the admin panel to conditionally render config tabs\n * and by the backend to gate API endpoints.\n *\n * @public\n */\nexport interface ProviderCapabilities {\n readonly chat: boolean;\n readonly rag: boolean;\n readonly safety: boolean;\n readonly evaluation: boolean;\n readonly conversations: boolean;\n readonly mcpTools: boolean;\n readonly tools: boolean;\n /** Provider manages tool lifecycle (build, deploy, route) */\n readonly toolLifecycle: boolean;\n /** Provider manages agent lifecycle (build, deploy, migrate) */\n readonly agentLifecycle: boolean;\n /** Provider supports DevSpaces integration */\n readonly devSpaces: boolean;\n /** Provider needs context hydrated from DB on non-streaming paths */\n readonly contextHydration: boolean;\n /** Provider registers its own sub-routes (e.g. kagenti-specific endpoints) */\n readonly providerRoutes: boolean;\n}\n\n/**\n * Definition of a single provider-specific config field.\n *\n * The admin panel uses these to render dynamic forms based\n * on which provider is active.\n *\n * @public\n */\nexport interface ProviderConfigField {\n /** Config key (matches AdminConfigKey) */\n readonly key: string;\n /** Human-readable label for the form field */\n readonly label: string;\n /** Field type determines the form control rendered */\n readonly type: 'string' | 'boolean' | 'number' | 'select';\n /** Whether the field is required for the provider to function */\n readonly required: boolean;\n /** Help text shown below the field */\n readonly description?: string;\n /** Options for 'select' type fields */\n readonly options?: readonly string[];\n /** Placeholder text for text inputs */\n readonly placeholder?: string;\n /** Whether the field value is sensitive (passwords, secrets) and should be masked in UI */\n readonly sensitive?: boolean;\n}\n\n/**\n * Describes an AI provider's identity, capabilities, and config shape.\n *\n * The provider registry holds one descriptor per known provider,\n * including placeholders for providers that are not yet implemented.\n *\n * @public\n */\nexport interface ProviderDescriptor {\n /** Unique provider identifier */\n readonly id: ProviderType;\n /** Human-readable display name (e.g., \"Llama Stack\") */\n readonly displayName: string;\n /** Short description of the provider */\n readonly description: string;\n /** Whether this provider has a working implementation */\n readonly implemented: boolean;\n /** Which capability categories this provider supports */\n readonly capabilities: ProviderCapabilities;\n /** Provider-specific config field definitions for the admin panel */\n readonly configFields: readonly ProviderConfigField[];\n}\n\n// =============================================================================\n// Config Key Scoping\n// =============================================================================\n\n/**\n * Config keys that are shared across all providers.\n *\n * These are stored without a provider prefix and apply\n * regardless of which provider is active.\n *\n * @public\n */\nexport const GLOBAL_CONFIG_KEYS = [\n 'systemPrompt',\n 'branding',\n 'promptGroups',\n 'safetyPatterns',\n 'mcpServers',\n 'disabledMcpServerIds',\n 'agents',\n 'defaultAgent',\n 'maxAgentTurns',\n 'devSpacesApiUrl',\n] as const;\n\n/**\n * Config keys that are scoped per provider.\n *\n * When stored in the database, these are prefixed with the\n * provider ID (e.g., `llamastack::model`). This allows each\n * provider to retain its own settings when switching.\n *\n * @public\n */\nexport const PROVIDER_SCOPED_KEYS = [\n 'model',\n 'baseUrl',\n 'kagentiBaseUrl',\n 'toolChoice',\n 'enableWebSearch',\n 'enableCodeInterpreter',\n 'safetyEnabled',\n 'inputShields',\n 'outputShields',\n 'safetyOnError',\n 'evaluationEnabled',\n 'scoringFunctions',\n 'minScoreThreshold',\n 'evaluationOnError',\n 'vectorStoreConfig',\n 'activeVectorStoreIds',\n 'maxToolCalls',\n 'maxOutputTokens',\n 'temperature',\n 'safetyIdentifier',\n] as const;\n\n/**\n * Type-safe element of {@link GLOBAL_CONFIG_KEYS}.\n * @public\n */\nexport type GlobalConfigKey = (typeof GLOBAL_CONFIG_KEYS)[number];\n\n/**\n * Type-safe element of {@link PROVIDER_SCOPED_KEYS}.\n * @public\n */\nexport type ProviderScopedKey = (typeof PROVIDER_SCOPED_KEYS)[number];\n\n/**\n * Build a provider-scoped config key for database storage.\n *\n * @param provider - The provider ID to scope under\n * @param key - The base config key\n * @returns A scoped key in the format `provider::key`\n * @public\n */\nexport function scopedConfigKey(provider: ProviderType, key: string): string {\n return `${provider}::${key}`;\n}\n\n/**\n * Check whether a config key is provider-scoped.\n *\n * @param key - The config key to check\n * @returns `true` if the key should be stored per-provider\n * @public\n */\nexport function isProviderScopedKey(key: string): key is ProviderScopedKey {\n return (PROVIDER_SCOPED_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * Check whether a config key is global (shared across providers).\n *\n * @param key - The config key to check\n * @returns `true` if the key is shared across all providers\n * @public\n */\nexport function isGlobalConfigKey(key: string): key is GlobalConfigKey {\n return (GLOBAL_CONFIG_KEYS as readonly string[]).includes(key);\n}\n"],"names":[],"mappings":";;AA+HO,MAAM,kBAAA,GAAqB;AAAA,EAChC,cAAA;AAAA,EACA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,sBAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF;AAWO,MAAM,oBAAA,GAAuB;AAAA,EAClC,OAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,kBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF;AAsBO,SAAS,eAAA,CAAgB,UAAwB,GAAA,EAAqB;AAC3E,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAK,GAAG,CAAA,CAAA;AAC5B;AASO,SAAS,oBAAoB,GAAA,EAAuC;AACzE,EAAA,OAAQ,oBAAA,CAA2C,SAAS,GAAG,CAAA;AACjE;AASO,SAAS,kBAAkB,GAAA,EAAqC;AACrE,EAAA,OAAQ,kBAAA,CAAyC,SAAS,GAAG,CAAA;AAC/D;;;;;;;;"}
@@ -0,0 +1,46 @@
1
+ const GLOBAL_CONFIG_KEYS = [
2
+ "systemPrompt",
3
+ "branding",
4
+ "promptGroups",
5
+ "safetyPatterns",
6
+ "mcpServers",
7
+ "disabledMcpServerIds",
8
+ "agents",
9
+ "defaultAgent",
10
+ "maxAgentTurns",
11
+ "devSpacesApiUrl"
12
+ ];
13
+ const PROVIDER_SCOPED_KEYS = [
14
+ "model",
15
+ "baseUrl",
16
+ "kagentiBaseUrl",
17
+ "toolChoice",
18
+ "enableWebSearch",
19
+ "enableCodeInterpreter",
20
+ "safetyEnabled",
21
+ "inputShields",
22
+ "outputShields",
23
+ "safetyOnError",
24
+ "evaluationEnabled",
25
+ "scoringFunctions",
26
+ "minScoreThreshold",
27
+ "evaluationOnError",
28
+ "vectorStoreConfig",
29
+ "activeVectorStoreIds",
30
+ "maxToolCalls",
31
+ "maxOutputTokens",
32
+ "temperature",
33
+ "safetyIdentifier"
34
+ ];
35
+ function scopedConfigKey(provider, key) {
36
+ return `${provider}::${key}`;
37
+ }
38
+ function isProviderScopedKey(key) {
39
+ return PROVIDER_SCOPED_KEYS.includes(key);
40
+ }
41
+ function isGlobalConfigKey(key) {
42
+ return GLOBAL_CONFIG_KEYS.includes(key);
43
+ }
44
+
45
+ export { GLOBAL_CONFIG_KEYS, PROVIDER_SCOPED_KEYS, isGlobalConfigKey, isProviderScopedKey, scopedConfigKey };
46
+ //# sourceMappingURL=provider.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.esm.js","sources":["../../src/types/provider.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// =============================================================================\n// Provider Types\n// =============================================================================\n\n/**\n * Built-in AI provider identifiers shipped with the plugin.\n * @public\n */\nexport type BuiltInProviderType = 'llamastack' | 'googleadk' | 'kagenti';\n\n/**\n * All accepted provider identifiers.\n *\n * Built-in types (`llamastack`, `googleadk`) are autocompleted,\n * but arbitrary string IDs from extension-registered providers\n * are also accepted via the `(string & {})` widening pattern.\n *\n * @public\n */\nexport type ProviderType = BuiltInProviderType | (string & {});\n\n/**\n * Capability categories that a provider may support.\n *\n * Used by the admin panel to conditionally render config tabs\n * and by the backend to gate API endpoints.\n *\n * @public\n */\nexport interface ProviderCapabilities {\n readonly chat: boolean;\n readonly rag: boolean;\n readonly safety: boolean;\n readonly evaluation: boolean;\n readonly conversations: boolean;\n readonly mcpTools: boolean;\n readonly tools: boolean;\n /** Provider manages tool lifecycle (build, deploy, route) */\n readonly toolLifecycle: boolean;\n /** Provider manages agent lifecycle (build, deploy, migrate) */\n readonly agentLifecycle: boolean;\n /** Provider supports DevSpaces integration */\n readonly devSpaces: boolean;\n /** Provider needs context hydrated from DB on non-streaming paths */\n readonly contextHydration: boolean;\n /** Provider registers its own sub-routes (e.g. kagenti-specific endpoints) */\n readonly providerRoutes: boolean;\n}\n\n/**\n * Definition of a single provider-specific config field.\n *\n * The admin panel uses these to render dynamic forms based\n * on which provider is active.\n *\n * @public\n */\nexport interface ProviderConfigField {\n /** Config key (matches AdminConfigKey) */\n readonly key: string;\n /** Human-readable label for the form field */\n readonly label: string;\n /** Field type determines the form control rendered */\n readonly type: 'string' | 'boolean' | 'number' | 'select';\n /** Whether the field is required for the provider to function */\n readonly required: boolean;\n /** Help text shown below the field */\n readonly description?: string;\n /** Options for 'select' type fields */\n readonly options?: readonly string[];\n /** Placeholder text for text inputs */\n readonly placeholder?: string;\n /** Whether the field value is sensitive (passwords, secrets) and should be masked in UI */\n readonly sensitive?: boolean;\n}\n\n/**\n * Describes an AI provider's identity, capabilities, and config shape.\n *\n * The provider registry holds one descriptor per known provider,\n * including placeholders for providers that are not yet implemented.\n *\n * @public\n */\nexport interface ProviderDescriptor {\n /** Unique provider identifier */\n readonly id: ProviderType;\n /** Human-readable display name (e.g., \"Llama Stack\") */\n readonly displayName: string;\n /** Short description of the provider */\n readonly description: string;\n /** Whether this provider has a working implementation */\n readonly implemented: boolean;\n /** Which capability categories this provider supports */\n readonly capabilities: ProviderCapabilities;\n /** Provider-specific config field definitions for the admin panel */\n readonly configFields: readonly ProviderConfigField[];\n}\n\n// =============================================================================\n// Config Key Scoping\n// =============================================================================\n\n/**\n * Config keys that are shared across all providers.\n *\n * These are stored without a provider prefix and apply\n * regardless of which provider is active.\n *\n * @public\n */\nexport const GLOBAL_CONFIG_KEYS = [\n 'systemPrompt',\n 'branding',\n 'promptGroups',\n 'safetyPatterns',\n 'mcpServers',\n 'disabledMcpServerIds',\n 'agents',\n 'defaultAgent',\n 'maxAgentTurns',\n 'devSpacesApiUrl',\n] as const;\n\n/**\n * Config keys that are scoped per provider.\n *\n * When stored in the database, these are prefixed with the\n * provider ID (e.g., `llamastack::model`). This allows each\n * provider to retain its own settings when switching.\n *\n * @public\n */\nexport const PROVIDER_SCOPED_KEYS = [\n 'model',\n 'baseUrl',\n 'kagentiBaseUrl',\n 'toolChoice',\n 'enableWebSearch',\n 'enableCodeInterpreter',\n 'safetyEnabled',\n 'inputShields',\n 'outputShields',\n 'safetyOnError',\n 'evaluationEnabled',\n 'scoringFunctions',\n 'minScoreThreshold',\n 'evaluationOnError',\n 'vectorStoreConfig',\n 'activeVectorStoreIds',\n 'maxToolCalls',\n 'maxOutputTokens',\n 'temperature',\n 'safetyIdentifier',\n] as const;\n\n/**\n * Type-safe element of {@link GLOBAL_CONFIG_KEYS}.\n * @public\n */\nexport type GlobalConfigKey = (typeof GLOBAL_CONFIG_KEYS)[number];\n\n/**\n * Type-safe element of {@link PROVIDER_SCOPED_KEYS}.\n * @public\n */\nexport type ProviderScopedKey = (typeof PROVIDER_SCOPED_KEYS)[number];\n\n/**\n * Build a provider-scoped config key for database storage.\n *\n * @param provider - The provider ID to scope under\n * @param key - The base config key\n * @returns A scoped key in the format `provider::key`\n * @public\n */\nexport function scopedConfigKey(provider: ProviderType, key: string): string {\n return `${provider}::${key}`;\n}\n\n/**\n * Check whether a config key is provider-scoped.\n *\n * @param key - The config key to check\n * @returns `true` if the key should be stored per-provider\n * @public\n */\nexport function isProviderScopedKey(key: string): key is ProviderScopedKey {\n return (PROVIDER_SCOPED_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * Check whether a config key is global (shared across providers).\n *\n * @param key - The config key to check\n * @returns `true` if the key is shared across all providers\n * @public\n */\nexport function isGlobalConfigKey(key: string): key is GlobalConfigKey {\n return (GLOBAL_CONFIG_KEYS as readonly string[]).includes(key);\n}\n"],"names":[],"mappings":"AA+HO,MAAM,kBAAA,GAAqB;AAAA,EAChC,cAAA;AAAA,EACA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,sBAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF;AAWO,MAAM,oBAAA,GAAuB;AAAA,EAClC,OAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,eAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,kBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF;AAsBO,SAAS,eAAA,CAAgB,UAAwB,GAAA,EAAqB;AAC3E,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAK,GAAG,CAAA,CAAA;AAC5B;AASO,SAAS,oBAAoB,GAAA,EAAuC;AACzE,EAAA,OAAQ,oBAAA,CAA2C,SAAS,GAAG,CAAA;AACjE;AASO,SAAS,kBAAkB,GAAA,EAAqC;AACrE,EAAA,OAAQ,kBAAA,CAAyC,SAAS,GAAG,CAAA;AAC/D;;;;"}
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ var FileFormat = /* @__PURE__ */ ((FileFormat2) => {
4
+ FileFormat2["YAML"] = "yaml";
5
+ FileFormat2["PDF"] = "pdf";
6
+ FileFormat2["TEXT"] = "text";
7
+ FileFormat2["MARKDOWN"] = "markdown";
8
+ FileFormat2["JSON"] = "json";
9
+ return FileFormat2;
10
+ })(FileFormat || {});
11
+ const LIFECYCLE_STAGE_ORDER = [
12
+ "draft",
13
+ "pending",
14
+ "published",
15
+ "archived"
16
+ ];
17
+ const LIFECYCLE_TRANSITIONS = [
18
+ {
19
+ from: "draft",
20
+ to: "pending",
21
+ action: "submit",
22
+ label: "Submit for Review"
23
+ },
24
+ {
25
+ from: "pending",
26
+ to: "published",
27
+ action: "approve",
28
+ label: "Approve and Publish"
29
+ },
30
+ { from: "pending", to: "draft", action: "reject", label: "Reject" },
31
+ { from: "pending", to: "draft", action: "withdraw", label: "Withdraw" },
32
+ {
33
+ from: "published",
34
+ to: "pending",
35
+ action: "request-unpublish",
36
+ label: "Request Unpublish"
37
+ },
38
+ { from: "published", to: "archived", action: "archive", label: "Archive" },
39
+ { from: "archived", to: "draft", action: "reactivate", label: "Reactivate" }
40
+ ];
41
+ const LEGACY_STAGE_MAP = {
42
+ registered: "pending",
43
+ deployed: "published",
44
+ review: "pending",
45
+ staging: "pending",
46
+ production: "published",
47
+ retired: "archived"
48
+ };
49
+ function getAvailableTransitions(stage) {
50
+ return LIFECYCLE_TRANSITIONS.filter((t) => t.from === stage);
51
+ }
52
+ function isValidTransition(from, to) {
53
+ return LIFECYCLE_TRANSITIONS.some((t) => t.from === from && t.to === to);
54
+ }
55
+ function normalizeLifecycleStage(stage) {
56
+ if (!stage) return "draft";
57
+ const trimmed = stage.trim().toLocaleLowerCase("en-US");
58
+ if (!trimmed) return "draft";
59
+ if (Object.hasOwn(LEGACY_STAGE_MAP, trimmed))
60
+ return LEGACY_STAGE_MAP[trimmed];
61
+ if (LIFECYCLE_STAGE_ORDER.includes(trimmed)) {
62
+ return trimmed;
63
+ }
64
+ return "draft";
65
+ }
66
+ function deriveRoleFromTopology(agentKey, allAgents) {
67
+ const agent = allAgents[agentKey];
68
+ if (!agent) return "standalone";
69
+ const hasOutgoing = agent.handoffs && agent.handoffs.length > 0 || agent.asTools && agent.asTools.length > 0;
70
+ if (hasOutgoing) return "router";
71
+ const isTarget = Object.entries(allAgents).some(
72
+ ([k, a]) => k !== agentKey && a !== null && a !== void 0 && ((a.handoffs ?? []).includes(agentKey) || (a.asTools ?? []).includes(agentKey))
73
+ );
74
+ if (isTarget) return "specialist";
75
+ return "standalone";
76
+ }
77
+
78
+ exports.FileFormat = FileFormat;
79
+ exports.LEGACY_STAGE_MAP = LEGACY_STAGE_MAP;
80
+ exports.LIFECYCLE_STAGE_ORDER = LIFECYCLE_STAGE_ORDER;
81
+ exports.LIFECYCLE_TRANSITIONS = LIFECYCLE_TRANSITIONS;
82
+ exports.deriveRoleFromTopology = deriveRoleFromTopology;
83
+ exports.getAvailableTransitions = getAvailableTransitions;
84
+ exports.isValidTransition = isValidTransition;
85
+ exports.normalizeLifecycleStage = normalizeLifecycleStage;
86
+ //# sourceMappingURL=shared.cjs.js.map