-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed.sql
More file actions
119 lines (115 loc) · 4.27 KB
/
Copy pathseed.sql
File metadata and controls
119 lines (115 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-- Tempest Webs Database Seed Script
-- Populates the database with a default workspace, specialized agents, and a test workflow.
-- 1. Create a Default Workspace
INSERT INTO workspaces (id, name, description)
VALUES (
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Engineering Sandbox',
'Default workspace for multi-agent autonomous testing and execution.'
) ON CONFLICT (id) DO NOTHING;
-- 2. Create Specialized Agents
INSERT INTO agents (id, workspace_id, name, role, system_prompt, model_provider, model_name, temperature, tools)
VALUES
(
'a1111111-1111-1111-1111-111111111111',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Research Agent',
'Researcher',
'You are a research agent. Your task is to gather details, search API documents, and compile summaries.',
'gemini',
'gemini-1.5-flash',
0.2,
'["read_workspace_file"]'::jsonb
),
(
'a2222222-2222-2222-2222-222222222222',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Planning Agent',
'Planner',
'You are a planning agent. You break down complex user instructions into concrete task schedules.',
'gemini',
'gemini-1.5-pro',
0.1,
'[]'::jsonb
),
(
'a3333333-3333-3333-3333-333333333333',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Coding Agent',
'Coder',
'You are a coding agent. You write and edit clean, syntax-valid source code files.',
'gemini',
'gemini-1.5-flash',
0.2,
'["write_workspace_file"]'::jsonb
),
(
'a4444444-4444-4444-4444-444444444444',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Security Agent',
'Auditor',
'You are a security auditor. You review code scripts, inspect dependencies, and verify execution safety.',
'gemini',
'gemini-1.5-pro',
0.1,
'["run_local_command"]'::jsonb
)
ON CONFLICT (id) DO NOTHING;
-- 3. Create a Test Workflow (State Graph representing code review pipeline)
INSERT INTO workflows (id, workspace_id, name, nodes, edges)
VALUES (
'f5555555-5555-5555-5555-555555555555',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'Autonomous Security Audit Pipeline',
-- Visual nodes configuration array
'[
{"id": "start", "type": "manualTrigger", "position": {"x": 50, "y": 200}, "data": {}},
{
"id": "research-step",
"type": "agentNode",
"position": {"x": 250, "y": 200},
"data": {"agentId": "a1111111-1111-1111-1111-111111111111", "promptOverride": "Search the local workspace for README configurations."}
},
{
"id": "write-script",
"type": "agentNode",
"position": {"x": 480, "y": 200},
"data": {"agentId": "a3333333-3333-3333-3333-333333333333", "promptOverride": "Generate a test script based on the research summary."}
},
{
"id": "audit-script",
"type": "agentNode",
"position": {"x": 710, "y": 200},
"data": {"agentId": "a4444444-4444-4444-4444-444444444444", "promptOverride": "Audit the generated test script for safety violations."}
},
{
"id": "check-audit",
"type": "conditionNode",
"position": {"x": 940, "y": 200},
"data": {"expression": "state.get(''results'', {}).get(''audit-script'', {}).get(''status'') === ''success''"}
},
{
"id": "run-test",
"type": "toolNode",
"position": {"x": 1150, "y": 200},
"data": {"toolName": "run_local_command", "arguments": {"command": "echo \"Workflow Audit Successful!\""}}
}
]'::jsonb,
-- Connections and edges transition paths
'[
{"source": "start", "target": "research-step"},
{"source": "research-step", "target": "write-script"},
{"source": "write-script", "target": "audit-script"},
{"source": "audit-script", "target": "check-audit"},
{"source": "check-audit", "target": "run-test", "condition": "true"}
]'::jsonb
) ON CONFLICT (id) DO NOTHING;
-- 4. Create an Initial Execution (Pending status)
INSERT INTO executions (id, workflow_id, status, current_node_id, context_data)
VALUES (
'e9999999-9999-9999-9999-999999999999',
'f5555555-5555-5555-5555-555555555555',
'pending',
'start',
'{"value": 42, "results": {}}'::jsonb
) ON CONFLICT (id) DO NOTHING;