@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,7 @@
1
+ export { augmentAccessPermission, augmentAdminPermission, augmentPermissions } from './permissions.esm.js';
2
+ export { FileFormat, LEGACY_STAGE_MAP, LIFECYCLE_STAGE_ORDER, LIFECYCLE_TRANSITIONS, deriveRoleFromTopology, getAvailableTransitions, isValidTransition, normalizeLifecycleStage } from './types/shared.esm.js';
3
+ export { DEFAULT_BRANDING } from './types/branding.esm.js';
4
+ export { createDefaultWorkflow, isAgentNodeData, isGuardrailNodeData, isLogicNodeData, isToolNodeData, isUserInteractionNodeData } from './types/workflowBuilder.esm.js';
5
+ export { WORKFLOW_TEMPLATES } from './templates/workflowTemplates.esm.js';
6
+ export { GLOBAL_CONFIG_KEYS, PROVIDER_SCOPED_KEYS, isGlobalConfigKey, isProviderScopedKey, scopedConfigKey } from './types/provider.esm.js';
7
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ var pluginPermissionCommon = require('@backstage/plugin-permission-common');
4
+
5
+ const augmentAccessPermission = pluginPermissionCommon.createPermission({
6
+ name: "augment.access",
7
+ attributes: {
8
+ action: "read"
9
+ }
10
+ });
11
+ const augmentAdminPermission = pluginPermissionCommon.createPermission({
12
+ name: "augment.admin",
13
+ attributes: {
14
+ action: "update"
15
+ }
16
+ });
17
+ const augmentPermissions = [
18
+ augmentAccessPermission,
19
+ augmentAdminPermission
20
+ ];
21
+
22
+ exports.augmentAccessPermission = augmentAccessPermission;
23
+ exports.augmentAdminPermission = augmentAdminPermission;
24
+ exports.augmentPermissions = augmentPermissions;
25
+ //# sourceMappingURL=permissions.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.cjs.js","sources":["../src/permissions.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 */\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission to access the Augment plugin.\n *\n * Controls access to ALL Augment features. If a user has this\n * permission, they get full access. If not, they are blocked entirely.\n *\n * @public\n */\nexport const augmentAccessPermission = createPermission({\n name: 'augment.access',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * Permission to access admin features of the Augment plugin.\n *\n * Controls access to admin-only features such as document management,\n * swim lane/prompt editing, system prompt configuration, and branding.\n * Users with this permission see additional admin tabs in the UI.\n *\n * @public\n */\nexport const augmentAdminPermission = createPermission({\n name: 'augment.admin',\n attributes: {\n action: 'update',\n },\n});\n\n/**\n * List of all Augment permissions.\n *\n * To restrict access to a Keycloak group, configure RBAC policies in app-config.yaml:\n *\n * @example\n * ```yaml\n * permission:\n * enabled: true\n * rbac:\n * policies:\n * - g, group:default/augment-users, role:default/augment-user\n * - p, role:default/augment-user, augment.access, read, allow\n * - g, group:default/augment-admins, role:default/augment-admin\n * - p, role:default/augment-admin, augment.access, read, allow\n * - p, role:default/augment-admin, augment.admin, update, allow\n * ```\n *\n * @public\n */\nexport const augmentPermissions = [\n augmentAccessPermission,\n augmentAdminPermission,\n];\n"],"names":["createPermission"],"mappings":";;;;AAyBO,MAAM,0BAA0BA,uCAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAWM,MAAM,yBAAyBA,uCAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAsBM,MAAM,kBAAA,GAAqB;AAAA,EAChC,uBAAA;AAAA,EACA;AACF;;;;;;"}
@@ -0,0 +1,21 @@
1
+ import { createPermission } from '@backstage/plugin-permission-common';
2
+
3
+ const augmentAccessPermission = createPermission({
4
+ name: "augment.access",
5
+ attributes: {
6
+ action: "read"
7
+ }
8
+ });
9
+ const augmentAdminPermission = createPermission({
10
+ name: "augment.admin",
11
+ attributes: {
12
+ action: "update"
13
+ }
14
+ });
15
+ const augmentPermissions = [
16
+ augmentAccessPermission,
17
+ augmentAdminPermission
18
+ ];
19
+
20
+ export { augmentAccessPermission, augmentAdminPermission, augmentPermissions };
21
+ //# sourceMappingURL=permissions.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.esm.js","sources":["../src/permissions.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 */\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission to access the Augment plugin.\n *\n * Controls access to ALL Augment features. If a user has this\n * permission, they get full access. If not, they are blocked entirely.\n *\n * @public\n */\nexport const augmentAccessPermission = createPermission({\n name: 'augment.access',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * Permission to access admin features of the Augment plugin.\n *\n * Controls access to admin-only features such as document management,\n * swim lane/prompt editing, system prompt configuration, and branding.\n * Users with this permission see additional admin tabs in the UI.\n *\n * @public\n */\nexport const augmentAdminPermission = createPermission({\n name: 'augment.admin',\n attributes: {\n action: 'update',\n },\n});\n\n/**\n * List of all Augment permissions.\n *\n * To restrict access to a Keycloak group, configure RBAC policies in app-config.yaml:\n *\n * @example\n * ```yaml\n * permission:\n * enabled: true\n * rbac:\n * policies:\n * - g, group:default/augment-users, role:default/augment-user\n * - p, role:default/augment-user, augment.access, read, allow\n * - g, group:default/augment-admins, role:default/augment-admin\n * - p, role:default/augment-admin, augment.access, read, allow\n * - p, role:default/augment-admin, augment.admin, update, allow\n * ```\n *\n * @public\n */\nexport const augmentPermissions = [\n augmentAccessPermission,\n augmentAdminPermission,\n];\n"],"names":[],"mappings":";;AAyBO,MAAM,0BAA0B,gBAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAWM,MAAM,yBAAyB,gBAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAsBM,MAAM,kBAAA,GAAqB;AAAA,EAChC,uBAAA;AAAA,EACA;AACF;;;;"}
@@ -0,0 +1,333 @@
1
+ 'use strict';
2
+
3
+ function template(id, name, description, nodes, edges) {
4
+ const now = (/* @__PURE__ */ new Date()).toISOString();
5
+ return {
6
+ id,
7
+ name,
8
+ description,
9
+ version: 0,
10
+ createdAt: now,
11
+ updatedAt: now,
12
+ status: "draft",
13
+ nodes,
14
+ edges,
15
+ settings: {
16
+ maxTurns: 10,
17
+ conversationPersistence: true,
18
+ tracingEnabled: true
19
+ }
20
+ };
21
+ }
22
+ const WORKFLOW_TEMPLATES = [
23
+ // 1. Simple Q&A Agent — the simplest working workflow
24
+ template(
25
+ "tpl-simple-qa",
26
+ "Simple Q&A Agent",
27
+ "A basic single-agent workflow that answers questions. The simplest starting point for any new agent.",
28
+ [
29
+ {
30
+ id: "start_1",
31
+ type: "start",
32
+ position: { x: 50, y: 200 },
33
+ data: { inputDescription: "User question" },
34
+ label: "Start"
35
+ },
36
+ {
37
+ id: "agent_1",
38
+ type: "agent",
39
+ position: { x: 300, y: 200 },
40
+ data: {
41
+ name: "Assistant",
42
+ 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)."
43
+ },
44
+ label: "Assistant"
45
+ },
46
+ {
47
+ id: "end_1",
48
+ type: "end",
49
+ position: { x: 560, y: 200 },
50
+ data: {},
51
+ label: "End"
52
+ }
53
+ ],
54
+ [
55
+ { id: "e1", source: "start_1", target: "agent_1", type: "sequence" },
56
+ { id: "e2", source: "agent_1", target: "end_1", type: "sequence" }
57
+ ]
58
+ ),
59
+ // 2. Smart Router — classification + if/else branching
60
+ template(
61
+ "tpl-smart-router",
62
+ "Smart Router",
63
+ "Classifies user input as technical or general, then routes to the appropriate specialist agent using if/else logic.",
64
+ [
65
+ {
66
+ id: "start_1",
67
+ type: "start",
68
+ position: { x: 50, y: 250 },
69
+ data: { inputDescription: "User message" },
70
+ label: "Start"
71
+ },
72
+ {
73
+ id: "classify_1",
74
+ type: "classify",
75
+ position: { x: 270, y: 250 },
76
+ data: {
77
+ classifications: [
78
+ {
79
+ label: "technical",
80
+ description: "Programming, code, APIs, servers, debugging, or technology questions"
81
+ },
82
+ {
83
+ label: "general",
84
+ description: "General conversation, greetings, or non-technical questions"
85
+ }
86
+ ],
87
+ instructions: 'Classify the user input. Choose "technical" if it asks about programming, code, APIs, servers, debugging, or technology. Choose "general" for everything else.'
88
+ },
89
+ label: "Topic Classifier"
90
+ },
91
+ {
92
+ id: "logic_1",
93
+ type: "logic",
94
+ position: { x: 520, y: 250 },
95
+ data: {
96
+ kind: "if_else",
97
+ condition: "classify_1_output && classify_1_output.classification === 'technical'"
98
+ },
99
+ label: "Is Technical?"
100
+ },
101
+ {
102
+ id: "agent_tech",
103
+ type: "agent",
104
+ position: { x: 780, y: 130 },
105
+ data: {
106
+ name: "Tech Expert",
107
+ 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."
108
+ },
109
+ label: "Tech Expert"
110
+ },
111
+ {
112
+ id: "agent_general",
113
+ type: "agent",
114
+ position: { x: 780, y: 370 },
115
+ data: {
116
+ name: "Friendly Assistant",
117
+ instructions: "You are a warm, friendly assistant. Answer general questions in a conversational, approachable tone. Be helpful and brief."
118
+ },
119
+ label: "Friendly Assistant"
120
+ },
121
+ {
122
+ id: "end_1",
123
+ type: "end",
124
+ position: { x: 1040, y: 250 },
125
+ data: {},
126
+ label: "End"
127
+ }
128
+ ],
129
+ [
130
+ { id: "e1", source: "start_1", target: "classify_1", type: "sequence" },
131
+ { id: "e2", source: "classify_1", target: "logic_1", type: "sequence" },
132
+ {
133
+ id: "e3",
134
+ source: "logic_1",
135
+ target: "agent_tech",
136
+ type: "sequence",
137
+ label: "true"
138
+ },
139
+ {
140
+ id: "e4",
141
+ source: "logic_1",
142
+ target: "agent_general",
143
+ type: "sequence",
144
+ label: "false"
145
+ },
146
+ { id: "e5", source: "agent_tech", target: "end_1", type: "sequence" },
147
+ { id: "e6", source: "agent_general", target: "end_1", type: "sequence" }
148
+ ]
149
+ ),
150
+ // 3. Research & Summarize — multi-agent chaining
151
+ template(
152
+ "tpl-research-summarize",
153
+ "Research & Summarize",
154
+ "A two-agent pipeline: the first agent researches a topic in depth, then a second agent distills the findings into a concise summary.",
155
+ [
156
+ {
157
+ id: "start_1",
158
+ type: "start",
159
+ position: { x: 50, y: 200 },
160
+ data: {
161
+ inputDescription: "Research topic or question"
162
+ },
163
+ label: "Start"
164
+ },
165
+ {
166
+ id: "agent_research",
167
+ type: "agent",
168
+ position: { x: 300, y: 200 },
169
+ data: {
170
+ name: "Researcher",
171
+ 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."
172
+ },
173
+ label: "Researcher"
174
+ },
175
+ {
176
+ id: "agent_summarize",
177
+ type: "agent",
178
+ position: { x: 580, y: 200 },
179
+ data: {
180
+ name: "Summarizer",
181
+ 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."
182
+ },
183
+ label: "Summarizer"
184
+ },
185
+ {
186
+ id: "end_1",
187
+ type: "end",
188
+ position: { x: 840, y: 200 },
189
+ data: {},
190
+ label: "End"
191
+ }
192
+ ],
193
+ [
194
+ {
195
+ id: "e1",
196
+ source: "start_1",
197
+ target: "agent_research",
198
+ type: "sequence"
199
+ },
200
+ {
201
+ id: "e2",
202
+ source: "agent_research",
203
+ target: "agent_summarize",
204
+ type: "sequence"
205
+ },
206
+ {
207
+ id: "e3",
208
+ source: "agent_summarize",
209
+ target: "end_1",
210
+ type: "sequence"
211
+ }
212
+ ]
213
+ ),
214
+ // 4. Kubernetes Assistant — MCP tool integration
215
+ template(
216
+ "tpl-k8s-assistant",
217
+ "Kubernetes Assistant",
218
+ "Connects to a Kubernetes MCP server for live cluster operations \u2014 list pods, namespaces, deployments, and more.",
219
+ [
220
+ {
221
+ id: "start_1",
222
+ type: "start",
223
+ position: { x: 50, y: 200 },
224
+ data: {
225
+ inputDescription: "Kubernetes question or command"
226
+ },
227
+ label: "Start"
228
+ },
229
+ {
230
+ id: "mcp_1",
231
+ type: "mcp",
232
+ position: { x: 300, y: 200 },
233
+ data: {
234
+ serverUrl: "https://kubernetes-mcp-server-ocp-mcp-server.apps.ocp.v7hjl.sandbox2288.opentlc.com",
235
+ serverLabel: "k8s",
236
+ requireApproval: "never"
237
+ },
238
+ label: "K8s MCP Server"
239
+ },
240
+ {
241
+ id: "agent_1",
242
+ type: "agent",
243
+ position: { x: 580, y: 200 },
244
+ data: {
245
+ name: "K8s Assistant",
246
+ 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."
247
+ },
248
+ label: "K8s Assistant"
249
+ },
250
+ {
251
+ id: "end_1",
252
+ type: "end",
253
+ position: { x: 840, y: 200 },
254
+ data: {},
255
+ label: "End"
256
+ }
257
+ ],
258
+ [
259
+ { id: "e1", source: "start_1", target: "mcp_1", type: "sequence" },
260
+ { id: "e2", source: "mcp_1", target: "agent_1", type: "sequence" },
261
+ { id: "e3", source: "agent_1", target: "end_1", type: "sequence" }
262
+ ]
263
+ ),
264
+ // 5. Content Moderator — set_state + transform + agent pipeline
265
+ template(
266
+ "tpl-content-moderator",
267
+ "Content Moderator",
268
+ "Demonstrates data flow: sets metadata via state, transforms it into context, then an agent uses that context to moderate content.",
269
+ [
270
+ {
271
+ id: "start_1",
272
+ type: "start",
273
+ position: { x: 50, y: 200 },
274
+ data: { inputDescription: "Content to moderate" },
275
+ label: "Start"
276
+ },
277
+ {
278
+ id: "set_state_1",
279
+ type: "set_state",
280
+ position: { x: 280, y: 200 },
281
+ data: {
282
+ assignments: {
283
+ content_type: "'user_generated'",
284
+ platform: "'public_forum'",
285
+ policy_version: "'v2.1'"
286
+ }
287
+ },
288
+ label: "Set Metadata"
289
+ },
290
+ {
291
+ id: "transform_1",
292
+ type: "transform",
293
+ position: { x: 520, y: 200 },
294
+ data: {
295
+ expression: "`Content type: ${content_type}, Platform: ${platform}, Policy: ${policy_version}`",
296
+ outputVariable: "moderation_context"
297
+ },
298
+ label: "Build Context"
299
+ },
300
+ {
301
+ id: "agent_1",
302
+ type: "agent",
303
+ position: { x: 780, y: 200 },
304
+ data: {
305
+ name: "Moderator",
306
+ 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"
307
+ },
308
+ label: "Moderator"
309
+ },
310
+ {
311
+ id: "end_1",
312
+ type: "end",
313
+ position: { x: 1040, y: 200 },
314
+ data: {},
315
+ label: "End"
316
+ }
317
+ ],
318
+ [
319
+ { id: "e1", source: "start_1", target: "set_state_1", type: "sequence" },
320
+ {
321
+ id: "e2",
322
+ source: "set_state_1",
323
+ target: "transform_1",
324
+ type: "sequence"
325
+ },
326
+ { id: "e3", source: "transform_1", target: "agent_1", type: "sequence" },
327
+ { id: "e4", source: "agent_1", target: "end_1", type: "sequence" }
328
+ ]
329
+ )
330
+ ];
331
+
332
+ exports.WORKFLOW_TEMPLATES = WORKFLOW_TEMPLATES;
333
+ //# sourceMappingURL=workflowTemplates.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowTemplates.cjs.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,EAA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