cpee 2.1.116 → 2.1.119
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.
- checksums.yaml +4 -4
- data/cockpit/config.json.example +2 -1
- data/cockpit/js/instance.js +9 -12
- data/cockpit/js/llm.js +2 -2
- data/cockpit/js/ui.js +3 -0
- data/cockpit/templates/Readonly Local.xml +228 -0
- data/cpee.gemspec +1 -2
- data/lib/cpee/implementation.rb +1 -1
- data/lib/cpee/implementation_callbacks.rb +9 -9
- data/lib/cpee/implementation_notifications.rb +1 -1
- data/lib/cpee/message.rb +10 -12
- data/lib/cpee/persistence.rb +5 -5
- data/server/executionhandlers/eval/connection.rb +7 -2
- data/server/executionhandlers/eval/controller.rb +9 -5
- data/server/executionhandlers/ruby/connection.rb +6 -3
- data/server/executionhandlers/ruby/controller.rb +5 -6
- data/server/routing/end.pid +1 -1
- data/server/routing/end.rb +5 -5
- data/server/routing/forward-events-00.pid +1 -1
- data/server/routing/forward-events.rb +28 -22
- data/server/routing/forward-votes.pid +1 -1
- data/server/routing/forward-votes.rb +5 -5
- data/server/routing/persist.pid +1 -1
- data/server/routing/persist.rb +4 -4
- metadata +2 -23
- data/cockpit/js/llm_alternative.js +0 -90
- data/cockpit/llm_alternative.html +0 -294
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39d6640351bbed07ebe4e967a8b83d625e90cf26c23af8b5f56772408c982fd5
|
|
4
|
+
data.tar.gz: b1e0f77cfee4cd79623d29e6adf2530b65ae6bfb28533fad8404691c089f7f46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33877d90270783fd4ff34ad76ce821314bb2cf6fd772afa3fff60d1d1926c49f48a51bd0746376b20ad5a678e7d449e70a9ba1df22249e99c8a8a3eb279a2c29
|
|
7
|
+
data.tar.gz: 1747c6805c4b8707860050a88d2562843076179e9736362bbc1ce888f14a0817eb0ba36be869f1836b9fea617aa31bcf318d7dceb11237ece96ca26151da27ee
|
data/cockpit/config.json.example
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
"templates-url": "https://cpee.org/design/server/Templates.dir/?stage=developm
|
|
4
4
|
"res-url": "https://cpee.org/flow/resources/",
|
|
5
5
|
"base-url": "https://cpee.org/flow/engine/",
|
|
6
|
-
"save-url": "https://cpee.org/design/server/"
|
|
6
|
+
"save-url": "https://cpee.org/design/server/",
|
|
7
|
+
"llm-url": "https://cpee.org/llm/"
|
|
7
8
|
}
|
data/cockpit/js/instance.js
CHANGED
|
@@ -799,22 +799,19 @@ function monitor_instance_pos() {// {{{
|
|
|
799
799
|
}// }}}
|
|
800
800
|
|
|
801
801
|
function monitor_instance_running(content,event) {// {{{
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
if (!save['activity_red_states'][content['activity-uuid']]) {
|
|
809
|
-
save['activity_red_states'][content['activity-uuid']] = true
|
|
810
|
-
format_visual_add(content.activity,"active")
|
|
802
|
+
let uuid = content['activity-uuid'];
|
|
803
|
+
let cur = save['activity_red_states'][uuid];
|
|
804
|
+
if (event == "calling" || event == "manipulating") {
|
|
805
|
+
if (!cur && save['instance_pos'].filter( (_,e) => { return e.nodeName == content.activity }).length == 0) {
|
|
806
|
+
save['activity_red_states'][uuid] = { position: content.activity, state: 'active' };
|
|
807
|
+
format_visual_add(content.activity,"active");
|
|
811
808
|
}
|
|
812
809
|
} else if (event == "done") {
|
|
813
|
-
if (save['
|
|
810
|
+
if ((cur && cur.state == 'active') || save['instance_pos'].filter( (_,e) => { return e.nodeName == content.activity }).length > 0) {
|
|
814
811
|
format_visual_remove(content.activity,"active");
|
|
815
812
|
}
|
|
816
|
-
save['activity_red_states'][
|
|
817
|
-
setTimeout(() => {delete save['activity_red_states'][
|
|
813
|
+
save['activity_red_states'][uuid] = { position: content.activity, state: 'done' };
|
|
814
|
+
setTimeout(() => {delete save['activity_red_states'][uuid]},1000);
|
|
818
815
|
}
|
|
819
816
|
} // }}}
|
|
820
817
|
function monitor_instance_pos_change(content) {// {{{
|
data/cockpit/js/llm.js
CHANGED
|
@@ -42,7 +42,7 @@ function call_llm_service(status_id,prompt_id,llm_id) {
|
|
|
42
42
|
formData.append("llm", blob3);
|
|
43
43
|
|
|
44
44
|
jQuery.ajax({
|
|
45
|
-
url: '
|
|
45
|
+
url: $('body').attr('current-llm-service'),
|
|
46
46
|
data: formData,
|
|
47
47
|
cache: false,
|
|
48
48
|
contentType: false,
|
|
@@ -80,7 +80,7 @@ function call_llm_text_service(status_id,prompt_id,llm_id,action) {
|
|
|
80
80
|
formData.append("llm", second);
|
|
81
81
|
|
|
82
82
|
jQuery.ajax({
|
|
83
|
-
url: '
|
|
83
|
+
url: $('body').attr('current-llm-service') + '/text/llm/',
|
|
84
84
|
data: formData,
|
|
85
85
|
cache: false,
|
|
86
86
|
contentType: false,
|
data/cockpit/js/ui.js
CHANGED
|
@@ -38,6 +38,9 @@ $(document).ready(function() {
|
|
|
38
38
|
if (res['log-url']) { // just leave it out when it is not configured
|
|
39
39
|
$("body").attr('current-logs',res['log-url'].replace("%host",window.location.host));
|
|
40
40
|
}
|
|
41
|
+
if (res['llm-url']) { // just leave it out when it is not configured
|
|
42
|
+
$("body").attr('current-llm-service',res['llm-url'].replace("%host",window.location.host));
|
|
43
|
+
}
|
|
41
44
|
if (res['res-url']) {
|
|
42
45
|
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
|
43
46
|
} else {
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<testset xmlns="http://cpee.org/ns/properties/2.0">
|
|
3
|
+
<executionhandler>ruby</executionhandler>
|
|
4
|
+
<dataelements>
|
|
5
|
+
<a>2</a>
|
|
6
|
+
<b>{"a":2,"b":12}</b>
|
|
7
|
+
<c>{"a":2}</c>
|
|
8
|
+
</dataelements>
|
|
9
|
+
<endpoints>
|
|
10
|
+
<user>https-post://cpee.org/services/timeout-user.php</user>
|
|
11
|
+
<auto>https-post://cpee.org/services/timeout-auto.php</auto>
|
|
12
|
+
<timeout>https-post://cpee.org/services/timeout.php</timeout>
|
|
13
|
+
<subprocess>https-post://cpee.org/flow/start/url/</subprocess>
|
|
14
|
+
<send>https-post://cpee.org/ing/correlators/message/send/</send>
|
|
15
|
+
<receive>https-get://cpee.org/ing/correlators/message/receive/</receive>
|
|
16
|
+
</endpoints>
|
|
17
|
+
<attributes>
|
|
18
|
+
<guarded>none</guarded>
|
|
19
|
+
<info>Readonly Local</info>
|
|
20
|
+
<modeltype>CPEE</modeltype>
|
|
21
|
+
<theme>preset</theme>
|
|
22
|
+
<creator>Christine Ashcreek</creator>
|
|
23
|
+
<guarded_id/>
|
|
24
|
+
<author>Christine Ashcreek</author>
|
|
25
|
+
<model_uuid>5b08fb27-26dd-4d18-8cc1-7907e79af97c</model_uuid>
|
|
26
|
+
<model_version/>
|
|
27
|
+
<design_dir>Templates.dir</design_dir>
|
|
28
|
+
<design_stage>development</design_stage>
|
|
29
|
+
</attributes>
|
|
30
|
+
<description>
|
|
31
|
+
<description xmlns="http://cpee.org/ns/description/1.0">
|
|
32
|
+
<manipulate id="a1" label="Set data.a to 2">
|
|
33
|
+
<code>data.a = 2</code>
|
|
34
|
+
<annotations>
|
|
35
|
+
<_logging_behavior>
|
|
36
|
+
<_exclude>false</_exclude>
|
|
37
|
+
</_logging_behavior>
|
|
38
|
+
<_context_data_analysis>
|
|
39
|
+
<probes/>
|
|
40
|
+
</_context_data_analysis>
|
|
41
|
+
</annotations>
|
|
42
|
+
</manipulate>
|
|
43
|
+
<parallel eid="e1" wait="-1" cancel="last">
|
|
44
|
+
<parallel_branch>
|
|
45
|
+
<call id="a3" endpoint="timeout">
|
|
46
|
+
<parameters>
|
|
47
|
+
<label>Wait 2</label>
|
|
48
|
+
<color/>
|
|
49
|
+
<arguments>
|
|
50
|
+
<timeout>2</timeout>
|
|
51
|
+
<data/>
|
|
52
|
+
</arguments>
|
|
53
|
+
</parameters>
|
|
54
|
+
<annotations>
|
|
55
|
+
<_generic/>
|
|
56
|
+
<_logging_behavior>
|
|
57
|
+
<_exclude>false</_exclude>
|
|
58
|
+
<_include>false</_include>
|
|
59
|
+
</_logging_behavior>
|
|
60
|
+
<_timing>
|
|
61
|
+
<_timing_weight/>
|
|
62
|
+
<_timing_avg/>
|
|
63
|
+
<explanations/>
|
|
64
|
+
</_timing>
|
|
65
|
+
<_shifting>
|
|
66
|
+
<_shifting_type>Duration</_shifting_type>
|
|
67
|
+
</_shifting>
|
|
68
|
+
<_context_data_analysis>
|
|
69
|
+
<probes/>
|
|
70
|
+
<ips/>
|
|
71
|
+
</_context_data_analysis>
|
|
72
|
+
<report>
|
|
73
|
+
<url/>
|
|
74
|
+
</report>
|
|
75
|
+
<_notes>
|
|
76
|
+
<_notes_general/>
|
|
77
|
+
</_notes>
|
|
78
|
+
</annotations>
|
|
79
|
+
<documentation>
|
|
80
|
+
<input/>
|
|
81
|
+
<output/>
|
|
82
|
+
<implementation>
|
|
83
|
+
<description/>
|
|
84
|
+
</implementation>
|
|
85
|
+
</documentation>
|
|
86
|
+
</call>
|
|
87
|
+
<choose eid="e2" mode="exclusive" label="">
|
|
88
|
+
<alternative eid="e3" condition="local.a == 2">
|
|
89
|
+
<call id="a2" endpoint="timeout">
|
|
90
|
+
<parameters>
|
|
91
|
+
<label>local.a as param</label>
|
|
92
|
+
<color/>
|
|
93
|
+
<arguments>
|
|
94
|
+
<timeout>1</timeout>
|
|
95
|
+
<data>
|
|
96
|
+
<a>!local.a</a>
|
|
97
|
+
<b>12</b>
|
|
98
|
+
</data>
|
|
99
|
+
</arguments>
|
|
100
|
+
</parameters>
|
|
101
|
+
<code>
|
|
102
|
+
<signal>false</signal>
|
|
103
|
+
<prepare/>
|
|
104
|
+
<finalize output="result">data.b = result</finalize>
|
|
105
|
+
<update output="result"/>
|
|
106
|
+
<rescue output="result"/>
|
|
107
|
+
</code>
|
|
108
|
+
<annotations>
|
|
109
|
+
<_generic/>
|
|
110
|
+
<_logging_behavior>
|
|
111
|
+
<_exclude>false</_exclude>
|
|
112
|
+
<_include>false</_include>
|
|
113
|
+
</_logging_behavior>
|
|
114
|
+
<_timing>
|
|
115
|
+
<_timing_weight/>
|
|
116
|
+
<_timing_avg/>
|
|
117
|
+
<explanations/>
|
|
118
|
+
</_timing>
|
|
119
|
+
<_shifting>
|
|
120
|
+
<_shifting_type>Duration</_shifting_type>
|
|
121
|
+
</_shifting>
|
|
122
|
+
<_context_data_analysis>
|
|
123
|
+
<probes/>
|
|
124
|
+
<ips/>
|
|
125
|
+
</_context_data_analysis>
|
|
126
|
+
<report>
|
|
127
|
+
<url/>
|
|
128
|
+
</report>
|
|
129
|
+
<_notes>
|
|
130
|
+
<_notes_general/>
|
|
131
|
+
</_notes>
|
|
132
|
+
</annotations>
|
|
133
|
+
<documentation>
|
|
134
|
+
<input/>
|
|
135
|
+
<output/>
|
|
136
|
+
<implementation>
|
|
137
|
+
<description/>
|
|
138
|
+
</implementation>
|
|
139
|
+
<code>
|
|
140
|
+
<description/>
|
|
141
|
+
</code>
|
|
142
|
+
</documentation>
|
|
143
|
+
</call>
|
|
144
|
+
<_probability>
|
|
145
|
+
<_probability_min/>
|
|
146
|
+
<_probability_max/>
|
|
147
|
+
<_probability_avg/>
|
|
148
|
+
</_probability>
|
|
149
|
+
</alternative>
|
|
150
|
+
<otherwise/>
|
|
151
|
+
</choose>
|
|
152
|
+
</parallel_branch>
|
|
153
|
+
<parallel_branch>
|
|
154
|
+
<manipulate id="a4" label="Set local.a to 1">
|
|
155
|
+
<code>local.a = 1</code>
|
|
156
|
+
<annotations>
|
|
157
|
+
<_logging_behavior>
|
|
158
|
+
<_exclude>false</_exclude>
|
|
159
|
+
</_logging_behavior>
|
|
160
|
+
<_context_data_analysis>
|
|
161
|
+
<probes/>
|
|
162
|
+
</_context_data_analysis>
|
|
163
|
+
</annotations>
|
|
164
|
+
</manipulate>
|
|
165
|
+
<call id="a5" endpoint="timeout">
|
|
166
|
+
<parameters>
|
|
167
|
+
<label>local.a as param</label>
|
|
168
|
+
<color/>
|
|
169
|
+
<arguments>
|
|
170
|
+
<timeout/>
|
|
171
|
+
<data>
|
|
172
|
+
<a>!local.a</a>
|
|
173
|
+
</data>
|
|
174
|
+
</arguments>
|
|
175
|
+
</parameters>
|
|
176
|
+
<code>
|
|
177
|
+
<signal>false</signal>
|
|
178
|
+
<prepare/>
|
|
179
|
+
<finalize output="result">data.c = result</finalize>
|
|
180
|
+
<update output="result"/>
|
|
181
|
+
<rescue output="result"/>
|
|
182
|
+
</code>
|
|
183
|
+
<annotations>
|
|
184
|
+
<_generic/>
|
|
185
|
+
<_logging_behavior>
|
|
186
|
+
<_exclude>false</_exclude>
|
|
187
|
+
<_include>false</_include>
|
|
188
|
+
</_logging_behavior>
|
|
189
|
+
<_timing>
|
|
190
|
+
<_timing_weight/>
|
|
191
|
+
<_timing_avg/>
|
|
192
|
+
<explanations/>
|
|
193
|
+
</_timing>
|
|
194
|
+
<_shifting>
|
|
195
|
+
<_shifting_type>Duration</_shifting_type>
|
|
196
|
+
</_shifting>
|
|
197
|
+
<_context_data_analysis>
|
|
198
|
+
<probes/>
|
|
199
|
+
<ips/>
|
|
200
|
+
</_context_data_analysis>
|
|
201
|
+
<report>
|
|
202
|
+
<url/>
|
|
203
|
+
</report>
|
|
204
|
+
<_notes>
|
|
205
|
+
<_notes_general/>
|
|
206
|
+
</_notes>
|
|
207
|
+
</annotations>
|
|
208
|
+
<documentation>
|
|
209
|
+
<input/>
|
|
210
|
+
<output/>
|
|
211
|
+
<implementation>
|
|
212
|
+
<description/>
|
|
213
|
+
</implementation>
|
|
214
|
+
<code>
|
|
215
|
+
<description/>
|
|
216
|
+
</code>
|
|
217
|
+
</documentation>
|
|
218
|
+
</call>
|
|
219
|
+
</parallel_branch>
|
|
220
|
+
</parallel>
|
|
221
|
+
</description>
|
|
222
|
+
</description>
|
|
223
|
+
<transformation>
|
|
224
|
+
<description type="copy"/>
|
|
225
|
+
<dataelements type="none"/>
|
|
226
|
+
<endpoints type="none"/>
|
|
227
|
+
</transformation>
|
|
228
|
+
</testset>
|
data/cpee.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "cpee"
|
|
3
|
-
s.version = "2.1.
|
|
3
|
+
s.version = "2.1.119"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
|
6
6
|
s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
|
@@ -32,6 +32,5 @@ Gem::Specification.new do |s|
|
|
|
32
32
|
s.add_runtime_dependency 'mimemagic', '~>0'
|
|
33
33
|
s.add_runtime_dependency 'get_process_mem', '~>0.2'
|
|
34
34
|
s.add_runtime_dependency 'webrick', '~>1.7'
|
|
35
|
-
s.add_runtime_dependency 'cpee-eval-ruby', '~> 1.0', '>= 1.0.4'
|
|
36
35
|
s.add_runtime_dependency 'by', '~> 1.1', '>= 1.1.0'
|
|
37
36
|
end
|
data/lib/cpee/implementation.rb
CHANGED
|
@@ -399,7 +399,7 @@ module CPEE
|
|
|
399
399
|
end
|
|
400
400
|
subs.each do |s|
|
|
401
401
|
begin
|
|
402
|
-
NewInstance::sub(multi,id,s.to_doc,s.attributes['id'] ||
|
|
402
|
+
NewInstance::sub(multi,id,s.to_doc,s.attributes['id'] || SecureRandom.hex(16))
|
|
403
403
|
end
|
|
404
404
|
end
|
|
405
405
|
|
|
@@ -58,11 +58,11 @@ module CPEE
|
|
|
58
58
|
|
|
59
59
|
if CPEE::Persistence::is_member?(id,opts,'callbacks',callback)
|
|
60
60
|
res = {}
|
|
61
|
-
res[:uuid] = CPEE::Persistence::extract_item(id,opts,"
|
|
62
|
-
res[:type] = CPEE::Persistence::extract_item(id,opts,"
|
|
63
|
-
res[:position] = CPEE::Persistence::extract_item(id,opts,"
|
|
64
|
-
res[:label] = CPEE::Persistence::extract_item(id,opts,"
|
|
65
|
-
if sub = CPEE::Persistence::extract_item(id,opts,"
|
|
61
|
+
res[:uuid] = CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/uuid")
|
|
62
|
+
res[:type] = CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/type")
|
|
63
|
+
res[:position] = CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/position")
|
|
64
|
+
res[:label] = CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/label")
|
|
65
|
+
if sub = CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/subscription")
|
|
66
66
|
res[:subscription] = sub
|
|
67
67
|
end
|
|
68
68
|
|
|
@@ -82,7 +82,7 @@ module CPEE
|
|
|
82
82
|
if opts[:statemachine].final? id
|
|
83
83
|
@status = 410
|
|
84
84
|
else
|
|
85
|
-
if CPEE::Persistence::extract_item(id,opts,"
|
|
85
|
+
if CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/type") == 'callback'
|
|
86
86
|
CPEE::Message::send(
|
|
87
87
|
:'callback-end',
|
|
88
88
|
callback,
|
|
@@ -93,7 +93,7 @@ module CPEE
|
|
|
93
93
|
{},
|
|
94
94
|
opts[:redis]
|
|
95
95
|
)
|
|
96
|
-
elsif CPEE::Persistence::extract_item(id,opts,"
|
|
96
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/type") == 'vote'
|
|
97
97
|
CPEE::Message::send(
|
|
98
98
|
:'vote-response',
|
|
99
99
|
callback,
|
|
@@ -128,7 +128,7 @@ module CPEE
|
|
|
128
128
|
if opts[:statemachine].final? id
|
|
129
129
|
@status = 410
|
|
130
130
|
else
|
|
131
|
-
if CPEE::Persistence::extract_item(id,opts,"
|
|
131
|
+
if CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/type") == 'callback'
|
|
132
132
|
ret = {}
|
|
133
133
|
ret['values'] = @p.map{ |e|
|
|
134
134
|
# bei complex wenn kleiner 500KiB statt e.value.path e.value.read
|
|
@@ -159,7 +159,7 @@ module CPEE
|
|
|
159
159
|
ret,
|
|
160
160
|
opts[:redis]
|
|
161
161
|
)
|
|
162
|
-
elsif CPEE::Persistence::extract_item(id,opts,"
|
|
162
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callbacks/#{callback}/type") == 'vote'
|
|
163
163
|
if @p.length == 1 && @p[0].name == 'continue' && @p[0].class == Riddl::Parameter::Simple
|
|
164
164
|
CPEE::Message::send(
|
|
165
165
|
:'vote-response',
|
|
@@ -129,7 +129,7 @@ module CPEE
|
|
|
129
129
|
if opts[:statemachine].final? id
|
|
130
130
|
@status = 410
|
|
131
131
|
else
|
|
132
|
-
key = @p[0].name == 'id' ? @p.shift.value :
|
|
132
|
+
key = @p[0].name == 'id' ? @p.shift.value : SecureRandom.hex(16)
|
|
133
133
|
url = @p[0].name == 'url' ? @p.shift.value : nil
|
|
134
134
|
values = []
|
|
135
135
|
while @p.length > 0
|
data/lib/cpee/message.rb
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
module CPEE
|
|
16
16
|
|
|
17
17
|
module Message
|
|
18
|
+
@@mutex = Mutex.new
|
|
18
19
|
@@who = 'cpee'
|
|
19
20
|
@@type = 'instance'
|
|
20
21
|
@@tworkers = 1
|
|
@@ -39,19 +40,19 @@ module CPEE
|
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
def self::target
|
|
42
|
-
@@last < @@tworkers-1 ? @@last += 1 : @@last = 0
|
|
43
|
+
@@mutex.synchronize { @@last < @@tworkers-1 ? @@last += 1 : @@last = 0 }
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
def self::wait(backend,sub,tt=nil)
|
|
46
47
|
target = '%02i' % (tt || CPEE::Message::target)
|
|
47
|
-
wid =
|
|
48
|
+
wid = SecureRandom.hex(16)
|
|
48
49
|
begin
|
|
49
|
-
sub.subscribe_with_timeout(2,
|
|
50
|
+
sub.subscribe_with_timeout(2,"event:#{target}:transaction/finished") do |on|
|
|
50
51
|
on.message do |what,message|
|
|
51
52
|
mess = message[0...message.index(' ')]
|
|
52
|
-
sub.unsubscribe(
|
|
53
|
+
sub.unsubscribe("event:#{target}:transaction/finished") if mess == wid
|
|
53
54
|
end
|
|
54
|
-
backend.publish(
|
|
55
|
+
backend.publish("event:#{target}:transaction/start","#{wid} {}")
|
|
55
56
|
end
|
|
56
57
|
rescue => e
|
|
57
58
|
puts "timeout error"
|
|
@@ -65,7 +66,7 @@ module CPEE
|
|
|
65
66
|
name = ::File::basename(event)
|
|
66
67
|
payload = {
|
|
67
68
|
@@who => cpee,
|
|
68
|
-
@@type
|
|
69
|
+
"#{@@type}-url" => File.join(cpee,instance.to_s),
|
|
69
70
|
@@type => instance,
|
|
70
71
|
'topic' => topic,
|
|
71
72
|
'type' => type,
|
|
@@ -73,13 +74,10 @@ module CPEE
|
|
|
73
74
|
'timestamp' => Time.now.xmlschema(6),
|
|
74
75
|
'content' => content
|
|
75
76
|
}
|
|
76
|
-
payload[@@type
|
|
77
|
-
payload[@@type
|
|
77
|
+
payload["#{@@type}-uuid"] = instance_uuid if instance_uuid
|
|
78
|
+
payload["#{@@type}-name"] = instance_name if instance_name
|
|
78
79
|
|
|
79
|
-
backend.publish(type
|
|
80
|
-
instance.to_s + ',' + instance_uuid.to_s + ' ' +
|
|
81
|
-
JSON::generate(payload)
|
|
82
|
-
)
|
|
80
|
+
backend.publish("#{type}:#{target}:#{event}", "#{instance},#{instance_uuid} #{JSON::generate(payload)}")
|
|
83
81
|
end
|
|
84
82
|
|
|
85
83
|
def self::send_url(type, event, cpee, content={}, backend)
|
data/lib/cpee/persistence.rb
CHANGED
|
@@ -152,11 +152,11 @@ module CPEE
|
|
|
152
152
|
res += cbs
|
|
153
153
|
res += Persistence::keys_extract_name(opts,id,'callbacks')
|
|
154
154
|
cbs.each do |c|
|
|
155
|
-
|
|
156
|
-
res <<
|
|
157
|
-
res <<
|
|
158
|
-
res <<
|
|
159
|
-
res <<
|
|
155
|
+
res << "#{c}/position"
|
|
156
|
+
res << "#{c}/label"
|
|
157
|
+
res << "#{c}/uuid"
|
|
158
|
+
res << "#{c}/type"
|
|
159
|
+
res << "#{c}/subscription"
|
|
160
160
|
end
|
|
161
161
|
res += Persistence::keys_extract_name(opts,id,'dsl')
|
|
162
162
|
res += Persistence::keys_extract_name(opts,id,'dslx')
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
require 'charlock_holmes'
|
|
16
16
|
require 'mimemagic'
|
|
17
17
|
require 'base64'
|
|
18
|
+
require 'securerandom'
|
|
18
19
|
require 'cpee-eval-ruby/translation'
|
|
19
20
|
|
|
20
21
|
class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
@@ -36,6 +37,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
36
37
|
# TODO extract spot (code) where error happened for better error handling (ruby 3.1 only)
|
|
37
38
|
# https://github.com/rails/rails/pull/45818/commits/3beb2aff3be712e44c34a588fbf35b79c0246ca5
|
|
38
39
|
controller = arguments[0]
|
|
40
|
+
puts err.message
|
|
41
|
+
puts err.backtrace
|
|
39
42
|
begin
|
|
40
43
|
controller.notify("description/error", :message => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):\s(.*)/)[4] + err.message, :line => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):/)[3], :where => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):/)[1])
|
|
41
44
|
rescue => e
|
|
@@ -44,6 +47,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
44
47
|
end# }}}
|
|
45
48
|
def self::inform_connectionwrapper_error(arguments,err) # {{{
|
|
46
49
|
controller = arguments[0]
|
|
50
|
+
puts err.message
|
|
51
|
+
puts err.backtrace
|
|
47
52
|
begin
|
|
48
53
|
if err.backtrace[0] !~ /, Line/
|
|
49
54
|
controller.notify("executionhandler/error", :message => err.backtrace[0].gsub(/(Activity a\d+)/,'\1:'), :line => -1, :where => err.backtrace[0].match(/Activity a\d+/)[0])
|
|
@@ -68,7 +73,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
68
73
|
@handler_continue = continue
|
|
69
74
|
@handler_position = position
|
|
70
75
|
@handler_passthrough = nil
|
|
71
|
-
@handler_activity_uuid =
|
|
76
|
+
@handler_activity_uuid = SecureRandom.hex(16)
|
|
72
77
|
@label = ''
|
|
73
78
|
@guard_files = []
|
|
74
79
|
@guard_items = []
|
|
@@ -93,7 +98,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
93
98
|
|
|
94
99
|
def proto_curl(parameters) #{{{
|
|
95
100
|
params = []
|
|
96
|
-
callback =
|
|
101
|
+
callback = SecureRandom.hex(16)
|
|
97
102
|
(parameters[:arguments] || []).each do |s|
|
|
98
103
|
if s.respond_to?(:mimetype)
|
|
99
104
|
params << Riddl::Parameter::Complex.new(s.name.to_s,v.mimetype,v.value)
|
|
@@ -47,6 +47,7 @@ class Controller
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
@attributes_helper = AttributesHelper.new
|
|
50
|
+
@attributes_translated = @attributes_helper.translate(attributes,dataelements,endpoints)
|
|
50
51
|
@thread = nil
|
|
51
52
|
@opts = opts
|
|
52
53
|
@instance = nil
|
|
@@ -87,20 +88,23 @@ class Controller
|
|
|
87
88
|
sleep 1
|
|
88
89
|
retry
|
|
89
90
|
end
|
|
91
|
+
Thread.new do
|
|
92
|
+
while true
|
|
93
|
+
notify("status/resource_utilization", :mib => GetProcessMem.new.mb, **Process.times.to_h)
|
|
94
|
+
sleep 3
|
|
95
|
+
end
|
|
96
|
+
end
|
|
90
97
|
end
|
|
91
98
|
|
|
92
99
|
attr_reader :id
|
|
93
100
|
attr_reader :attributes
|
|
94
101
|
attr_reader :loop_guard
|
|
102
|
+
attr_reader :attributes_translated
|
|
95
103
|
|
|
96
104
|
def uuid
|
|
97
105
|
@attributes['uuid']
|
|
98
106
|
end
|
|
99
107
|
|
|
100
|
-
def attributes_translated
|
|
101
|
-
@attributes_helper.translate(attributes,dataelements,endpoints)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
108
|
def host
|
|
105
109
|
@opts[:host]
|
|
106
110
|
end
|
|
@@ -178,7 +182,7 @@ class Controller
|
|
|
178
182
|
votes = []
|
|
179
183
|
|
|
180
184
|
CPEE::Persistence::extract_handler(id,@opts,handler).each do |client|
|
|
181
|
-
voteid =
|
|
185
|
+
voteid = SecureRandom.hex(16)
|
|
182
186
|
content[:key] = voteid
|
|
183
187
|
content[:attributes] = attributes_translated
|
|
184
188
|
content[:subscription] = client
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
require 'charlock_holmes'
|
|
16
16
|
require 'mimemagic'
|
|
17
17
|
require 'base64'
|
|
18
|
+
require 'securerandom'
|
|
18
19
|
require 'cpee-eval-ruby/translation'
|
|
19
20
|
|
|
20
21
|
class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
@@ -36,6 +37,8 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
36
37
|
# TODO extract spot (code) where error happened for better error handling (ruby 3.1 only)
|
|
37
38
|
# https://github.com/rails/rails/pull/45818/commits/3beb2aff3be712e44c34a588fbf35b79c0246ca5
|
|
38
39
|
controller = arguments[0]
|
|
40
|
+
puts err.message
|
|
41
|
+
puts err.backtrace
|
|
39
42
|
begin
|
|
40
43
|
controller.notify("description/error", :message => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):\s(.*)/)[4] + err.message, :line => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):/)[3], :where => err.backtrace[0].match(/(.*?)(, Line |:)(\d+):/)[1])
|
|
41
44
|
rescue => e
|
|
@@ -44,7 +47,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
44
47
|
end# }}}
|
|
45
48
|
def self::inform_connectionwrapper_error(arguments,err) # {{{
|
|
46
49
|
controller = arguments[0]
|
|
47
|
-
|
|
50
|
+
puts err.message
|
|
48
51
|
puts err.backtrace
|
|
49
52
|
begin
|
|
50
53
|
if err.backtrace[0] !~ /, Line/
|
|
@@ -70,7 +73,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
70
73
|
@handler_continue = continue
|
|
71
74
|
@handler_position = position
|
|
72
75
|
@handler_passthrough = nil
|
|
73
|
-
@handler_activity_uuid =
|
|
76
|
+
@handler_activity_uuid = SecureRandom.hex(16)
|
|
74
77
|
@label = ''
|
|
75
78
|
@guard_files = []
|
|
76
79
|
@guard_items = []
|
|
@@ -95,7 +98,7 @@ class ConnectionWrapper < WEEL::ConnectionWrapperBase
|
|
|
95
98
|
|
|
96
99
|
def proto_curl(parameters) #{{{
|
|
97
100
|
params = []
|
|
98
|
-
callback =
|
|
101
|
+
callback = SecureRandom.hex(16)
|
|
99
102
|
(parameters[:arguments] || []).each do |s|
|
|
100
103
|
if s.respond_to?(:mimetype)
|
|
101
104
|
params << Riddl::Parameter::Complex.new(s.name.to_s,v.mimetype,v.value)
|
|
@@ -100,14 +100,13 @@ class Controller
|
|
|
100
100
|
attr_reader :attributes
|
|
101
101
|
attr_reader :loop_guard
|
|
102
102
|
|
|
103
|
-
def uuid
|
|
104
|
-
@attributes['uuid']
|
|
105
|
-
end
|
|
106
|
-
|
|
107
103
|
def attributes_translated
|
|
108
|
-
@attributes_helper.translate(attributes,dataelements,endpoints)
|
|
104
|
+
@attributes_translated || @attributes_translated = @attributes_helper.translate(attributes,dataelements,endpoints)
|
|
109
105
|
end
|
|
110
106
|
|
|
107
|
+
def uuid
|
|
108
|
+
@attributes['uuid']
|
|
109
|
+
end
|
|
111
110
|
def host
|
|
112
111
|
@opts[:host]
|
|
113
112
|
end
|
|
@@ -185,7 +184,7 @@ class Controller
|
|
|
185
184
|
votes = []
|
|
186
185
|
|
|
187
186
|
CPEE::Persistence::extract_handler(id,@opts,handler).each do |client|
|
|
188
|
-
voteid =
|
|
187
|
+
voteid = SecureRandom.hex(16)
|
|
189
188
|
content[:key] = voteid
|
|
190
189
|
content[:attributes] = attributes_translated
|
|
191
190
|
content[:subscription] = client
|
data/server/routing/end.pid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1672922
|
data/server/routing/end.rb
CHANGED
|
@@ -41,11 +41,11 @@ Daemonite.new do |opts|
|
|
|
41
41
|
instance, uuid = message[0...index].split(',')
|
|
42
42
|
opts[:redis].multi do |multi|
|
|
43
43
|
multi.srem("instance:#{instance}/callbacks",key)
|
|
44
|
-
multi.del("instance:#{instance}/
|
|
45
|
-
multi.del("instance:#{instance}/
|
|
46
|
-
multi.del("instance:#{instance}/
|
|
47
|
-
multi.del("instance:#{instance}/
|
|
48
|
-
multi.del("instance:#{instance}/
|
|
44
|
+
multi.del("instance:#{instance}/callbacks/#{key}/uuid")
|
|
45
|
+
multi.del("instance:#{instance}/callbacks/#{key}/label")
|
|
46
|
+
multi.del("instance:#{instance}/callbacks/#{key}/position")
|
|
47
|
+
multi.del("instance:#{instance}/callbacks/#{key}/type")
|
|
48
|
+
multi.del("instance:#{instance}/callbacks/#{key}/subscription")
|
|
49
49
|
end
|
|
50
50
|
rescue => e
|
|
51
51
|
puts e.message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1672940
|
|
@@ -16,9 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
require 'redis'
|
|
18
18
|
require 'daemonite'
|
|
19
|
+
require 'concurrent-ruby'
|
|
19
20
|
require 'riddl/client'
|
|
20
21
|
require_relative '../../lib/cpee/redis'
|
|
21
22
|
|
|
23
|
+
HTTP_POOL = Concurrent::FixedThreadPool.new(32)
|
|
24
|
+
|
|
22
25
|
Daemonite.new do |opts|
|
|
23
26
|
opts[:runtime_opts] += [
|
|
24
27
|
["--url=URL", "-uURL", "Specify redis url", ->(p){ opts[:redis_url] = p }],
|
|
@@ -48,32 +51,35 @@ Daemonite.new do |opts|
|
|
|
48
51
|
topic = ::File::dirname(event)
|
|
49
52
|
name = ::File::basename(event)
|
|
50
53
|
long = File.join(topic,type,name)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
|
|
55
|
+
keys = opts[:redis].smembers("instance:#{instance}/handlers")
|
|
56
|
+
checks = opts[:redis].pipelined { |p| keys.each { |k| p.sismember("instance:#{instance}/handlers/#{k}", long) } }
|
|
57
|
+
matched = keys.zip(checks).select { |_, hit| hit }.map(&:first)
|
|
58
|
+
urls = opts[:redis].pipelined { |p| matched.each { |k| p.get("instance:#{instance}/handlers/#{k}/url") } }
|
|
59
|
+
matched.zip(urls).each do |key, url|
|
|
60
|
+
if url.nil? || url == ""
|
|
61
|
+
opts[:redis].publish("forward:#{instance}/#{key}",mess)
|
|
62
|
+
else
|
|
63
|
+
# Ractor.new(url,type,topic,name,mess) do |url,type,topic,name,mess|
|
|
64
|
+
# sadly typhoes does not support ractors
|
|
65
|
+
HTTP_POOL.post do
|
|
66
|
+
Riddl::Client.new(url).post [
|
|
67
|
+
Riddl::Header.new("CPEE-INSTANCE",instance),
|
|
68
|
+
Riddl::Header.new("CPEE-INSTANCE-UUID",uuid),
|
|
69
|
+
Riddl::Parameter::Simple::new('type',type),
|
|
70
|
+
Riddl::Parameter::Simple::new('topic',topic),
|
|
71
|
+
Riddl::Parameter::Simple::new('event',name),
|
|
72
|
+
Riddl::Parameter::Complex::new('notification','application/json',mess)
|
|
73
|
+
]
|
|
69
74
|
end
|
|
70
75
|
end
|
|
71
76
|
end
|
|
72
77
|
unless opts[:redis].exists?("instance:#{instance}/state")
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
### delete everything under instance
|
|
79
|
+
### how can there be stuff under an instance (handlers, subscriptions)? Are they created later?
|
|
80
|
+
empt = []
|
|
81
|
+
opts[:redis].scan_each("instance:#{instance}/*") { |k| empt << k }
|
|
82
|
+
opts[:redis].del(*empt) unless empt.empty?
|
|
77
83
|
end
|
|
78
84
|
rescue => e
|
|
79
85
|
puts e.message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1672934
|
|
@@ -24,11 +24,11 @@ require_relative '../../lib/cpee/redis'
|
|
|
24
24
|
def persist_handler(instance,key,mess,redis) #{{{
|
|
25
25
|
redis.multi do |multi|
|
|
26
26
|
multi.sadd("instance:#{instance}/callbacks",key)
|
|
27
|
-
multi.set("instance:#{instance}/
|
|
28
|
-
multi.set("instance:#{instance}/
|
|
29
|
-
multi.set("instance:#{instance}/
|
|
30
|
-
multi.set("instance:#{instance}/
|
|
31
|
-
multi.set("instance:#{instance}/
|
|
27
|
+
multi.set("instance:#{instance}/callbacks/#{key}/subscription",mess.dig('content','subscription'))
|
|
28
|
+
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'))
|
|
29
|
+
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'))
|
|
30
|
+
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'))
|
|
31
|
+
multi.set("instance:#{instance}/callbacks/#{key}/type",'vote')
|
|
32
32
|
end
|
|
33
33
|
end #}}}
|
|
34
34
|
|
data/server/routing/persist.pid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1672928
|
data/server/routing/persist.rb
CHANGED
|
@@ -66,10 +66,10 @@ Daemonite.new do |opts|
|
|
|
66
66
|
key = mess.dig('content','key')
|
|
67
67
|
opts[:redis].multi do |multi|
|
|
68
68
|
multi.sadd("instance:#{instance}/callbacks",key)
|
|
69
|
-
multi.set("instance:#{instance}/
|
|
70
|
-
multi.set("instance:#{instance}/
|
|
71
|
-
multi.set("instance:#{instance}/
|
|
72
|
-
multi.set("instance:#{instance}/
|
|
69
|
+
multi.set("instance:#{instance}/callbacks/#{key}/uuid",mess.dig('content','activity-uuid'))
|
|
70
|
+
multi.set("instance:#{instance}/callbacks/#{key}/label",mess.dig('content','label'))
|
|
71
|
+
multi.set("instance:#{instance}/callbacks/#{key}/position",mess.dig('content','activity'))
|
|
72
|
+
multi.set("instance:#{instance}/callbacks/#{key}/type",'callback')
|
|
73
73
|
end
|
|
74
74
|
when /event:\d+:state\/change/
|
|
75
75
|
opts[:redis].multi do |multi|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cpee
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.119
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -171,26 +171,6 @@ dependencies:
|
|
|
171
171
|
- - "~>"
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
173
|
version: '1.7'
|
|
174
|
-
- !ruby/object:Gem::Dependency
|
|
175
|
-
name: cpee-eval-ruby
|
|
176
|
-
requirement: !ruby/object:Gem::Requirement
|
|
177
|
-
requirements:
|
|
178
|
-
- - "~>"
|
|
179
|
-
- !ruby/object:Gem::Version
|
|
180
|
-
version: '1.0'
|
|
181
|
-
- - ">="
|
|
182
|
-
- !ruby/object:Gem::Version
|
|
183
|
-
version: 1.0.4
|
|
184
|
-
type: :runtime
|
|
185
|
-
prerelease: false
|
|
186
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
187
|
-
requirements:
|
|
188
|
-
- - "~>"
|
|
189
|
-
- !ruby/object:Gem::Version
|
|
190
|
-
version: '1.0'
|
|
191
|
-
- - ">="
|
|
192
|
-
- !ruby/object:Gem::Version
|
|
193
|
-
version: 1.0.4
|
|
194
174
|
- !ruby/object:Gem::Dependency
|
|
195
175
|
name: by
|
|
196
176
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -253,7 +233,6 @@ files:
|
|
|
253
233
|
- cockpit/js/extended_columns.js
|
|
254
234
|
- cockpit/js/instance.js
|
|
255
235
|
- cockpit/js/llm.js
|
|
256
|
-
- cockpit/js/llm_alternative.js
|
|
257
236
|
- cockpit/js/model.js
|
|
258
237
|
- cockpit/js/modifiers.js
|
|
259
238
|
- cockpit/js/parameters.js
|
|
@@ -261,7 +240,6 @@ files:
|
|
|
261
240
|
- cockpit/js/ui.js
|
|
262
241
|
- cockpit/js/wfadaptor.js
|
|
263
242
|
- cockpit/llm.html
|
|
264
|
-
- cockpit/llm_alternative.html
|
|
265
243
|
- cockpit/model.html
|
|
266
244
|
- cockpit/only_llm.html
|
|
267
245
|
- cockpit/rngs/attributes.rng
|
|
@@ -316,6 +294,7 @@ files:
|
|
|
316
294
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml
|
|
317
295
|
- cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml
|
|
318
296
|
- cockpit/templates/ML-pipe-multi.xml
|
|
297
|
+
- cockpit/templates/Readonly Local.xml
|
|
319
298
|
- cockpit/templates/Subprocess.xml
|
|
320
299
|
- cockpit/templates/Subprocess.xml.attrs
|
|
321
300
|
- cockpit/templates/Track Test Local.xml
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
function clean_llm_ui(status_id) {
|
|
2
|
-
status_div = $(`#${status_id}`);
|
|
3
|
-
status_div.empty();
|
|
4
|
-
status_div.removeClass('error').removeClass('success');
|
|
5
|
-
return
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function add_prompt(prompt_id,content) {
|
|
9
|
-
let input = $(`#${prompt_id}`);
|
|
10
|
-
const range = document.createRange();
|
|
11
|
-
const selection = window.getSelection();
|
|
12
|
-
range.selectNodeContents(input[0]);
|
|
13
|
-
selection.removeAllRanges();
|
|
14
|
-
selection.addRange(range);
|
|
15
|
-
document.execCommand('insertText', false, content);
|
|
16
|
-
return ;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function call_llm_service(status_id,prompt_id) {
|
|
20
|
-
let input = $(`#${prompt_id}`);
|
|
21
|
-
let text = input[0].innerText;
|
|
22
|
-
|
|
23
|
-
const formData = new FormData();
|
|
24
|
-
const blob1 = new Blob([save['dslx']], { type: "text/xml" });
|
|
25
|
-
formData.append("rpst_xml", blob1);
|
|
26
|
-
const blob2 = new Blob([text], { type: "text/plain" });
|
|
27
|
-
formData.append("user_input", blob2);
|
|
28
|
-
const blob3 = new Blob(['gemini-2.5-flash'], { type: "text/plain" });
|
|
29
|
-
formData.append("llm", blob3);
|
|
30
|
-
|
|
31
|
-
jQuery.ajax({
|
|
32
|
-
url: '/llm/',
|
|
33
|
-
data: formData,
|
|
34
|
-
cache: false,
|
|
35
|
-
contentType: false,
|
|
36
|
-
processData: false,
|
|
37
|
-
method: 'POST',
|
|
38
|
-
success: function(data){
|
|
39
|
-
$.ajax({
|
|
40
|
-
type: "PUT",
|
|
41
|
-
url: url + "/properties/description/",
|
|
42
|
-
contentType: 'text/xml',
|
|
43
|
-
headers: { 'Content-ID': 'description' },
|
|
44
|
-
data: data.output_cpee
|
|
45
|
-
});
|
|
46
|
-
$(`#${status_id}`).text(data.status);
|
|
47
|
-
$(`#${status_id}`).addClass('success');
|
|
48
|
-
},
|
|
49
|
-
error: function(xhr, status, data) {
|
|
50
|
-
$(`#${status_id}`).text(xhr.responseJSON.error);
|
|
51
|
-
$(`#${status_id}`).addClass('error');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
input.empty();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function load_file_content(files) {
|
|
59
|
-
if (typeof window.FileReader !== 'function') {
|
|
60
|
-
console.log('FileReader not yet supported');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
var reader = new FileReader();
|
|
64
|
-
reader.onload = function(){
|
|
65
|
-
clean_llm_ui('status');
|
|
66
|
-
add_prompt('prompt',reader.result);
|
|
67
|
-
}
|
|
68
|
-
reader.onerror = function(){ console.log("reader error"); }
|
|
69
|
-
reader.onabort = function(){ console.log("reader abort"); }
|
|
70
|
-
reader.readAsText(files[0]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
$(document).ready(function() {
|
|
75
|
-
$(document).on('keydown','#prompt',function(e){
|
|
76
|
-
clean_llm_ui('status');
|
|
77
|
-
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
78
|
-
call_llm_service('status',this.id);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
$(document).on('click','#prompt_submit_button',function(e) {
|
|
82
|
-
clean_llm_ui('status');
|
|
83
|
-
call_llm_service('status','prompt');
|
|
84
|
-
});
|
|
85
|
-
$('#prompt').on('drop',function(e) {
|
|
86
|
-
e.preventDefault();
|
|
87
|
-
e.stopPropagation();
|
|
88
|
-
load_file_content(e.originalEvent.dataTransfer.files);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
This file is part of CPEE.
|
|
3
|
-
|
|
4
|
-
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
6
|
-
either version 3 of the License, or (at your option) any later version.
|
|
7
|
-
|
|
8
|
-
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
|
-
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
11
|
-
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file COPYING in the main directory). If not, see
|
|
14
|
-
<http://www.gnu.org/licenses/>.
|
|
15
|
-
-->
|
|
16
|
-
|
|
17
|
-
<!DOCTYPE html>
|
|
18
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
19
|
-
<head>
|
|
20
|
-
<meta charset="utf-8"/>
|
|
21
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
22
|
-
<title>CPEE Cockpit</title>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<!-- libs, do not modify. When local than load local libs. -->
|
|
26
|
-
<script type="text/javascript" src="/js_libs/jquery.min.js"></script>
|
|
27
|
-
<script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
|
|
28
|
-
<script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
|
|
29
|
-
<script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
|
|
30
|
-
<script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
|
|
31
|
-
<script type="text/javascript" src="/js_libs/util.js"></script>
|
|
32
|
-
<script type="text/javascript" src="/js_libs/printf.js"></script>
|
|
33
|
-
<script type="text/javascript" src="/js_libs/strftime.min.js"></script>
|
|
34
|
-
<script type="text/javascript" src="/js_libs/parsequery.js"></script>
|
|
35
|
-
<script type="text/javascript" src="/js_libs/underscore.min.js"></script>
|
|
36
|
-
<script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
|
|
37
|
-
<script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
|
|
38
|
-
|
|
39
|
-
<script type="text/javascript" src="/js_libs/relaxngui.js"></script>
|
|
40
|
-
|
|
41
|
-
<script type="text/javascript" src="/js_libs/uidash.js"></script>
|
|
42
|
-
<script type="text/javascript" src="/js_libs/custommenu.js"></script>
|
|
43
|
-
|
|
44
|
-
<link rel="stylesheet" href="/js_libs/custommenu.css" type="text/css"/>
|
|
45
|
-
<link rel="stylesheet" href="/js_libs/uidash.css" type="text/css"/>
|
|
46
|
-
|
|
47
|
-
<link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
|
|
48
|
-
|
|
49
|
-
<!-- modelling ui -->
|
|
50
|
-
<script type="text/javascript" src="js/wfadaptor.js"></script>
|
|
51
|
-
<link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
|
|
52
|
-
|
|
53
|
-
<script type="text/javascript" src="js/llm_alternative.js"></script>
|
|
54
|
-
<link rel="stylesheet" href="css/llm.css" type="text/css"/>
|
|
55
|
-
|
|
56
|
-
<!-- custom stuff, play arround -->
|
|
57
|
-
<script type="text/javascript" src="js/ui.js"></script>
|
|
58
|
-
<script type="text/javascript" src="js/instance.js"></script>
|
|
59
|
-
<script type="text/javascript" src="js/details.js"></script>
|
|
60
|
-
<script type="text/javascript" src="js/parameters.js"></script>
|
|
61
|
-
<script type="text/javascript" src="js/extended_columns.js"></script>
|
|
62
|
-
<script type="text/javascript" src="js/modifiers.js"></script>
|
|
63
|
-
<script type="text/javascript" src="themes/base.js"></script>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
|
67
|
-
<link rel="stylesheet" href="css/extended_columns-label.css" type="text/css"/>
|
|
68
|
-
<link rel="stylesheet" href="css/extended_columns-svg.css" type="text/css" data-include-export="true"/>
|
|
69
|
-
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
|
70
|
-
<style>
|
|
71
|
-
/* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
|
|
72
|
-
/* shit balls, no elegance is left in this world */
|
|
73
|
-
</style>
|
|
74
|
-
</head>
|
|
75
|
-
<body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
|
|
76
|
-
<div id='disclaimer' class='hidden'> <!--{{{-->
|
|
77
|
-
<h1>Disclaimer</h1>
|
|
78
|
-
|
|
79
|
-
<p>
|
|
80
|
-
We use reasonable care in creating and presenting the functionality
|
|
81
|
-
found in this demonstrator. It is provided purely for demonstration purposes
|
|
82
|
-
and you should seek further guidance and make independent enquiries
|
|
83
|
-
before relying upon it.
|
|
84
|
-
</p>
|
|
85
|
-
|
|
86
|
-
<p>
|
|
87
|
-
All functionality included in this demonstrator is subject to change
|
|
88
|
-
without notice. We make no representation or warranty whatsoever
|
|
89
|
-
regarding the completeness, accuracy, adequacy, suitability or
|
|
90
|
-
operation of this demonstrator, or of the results it produces.
|
|
91
|
-
</p>
|
|
92
|
-
|
|
93
|
-
<p>
|
|
94
|
-
We assume no responsibility for process instances created with this
|
|
95
|
-
demonstrator and disclaim all liability arising from negligence or
|
|
96
|
-
otherwise in respect of such process instances. We will not be liable
|
|
97
|
-
for any damages (including, without limitation, damages for any
|
|
98
|
-
consequential loss or loss of business opportunities or projects, or
|
|
99
|
-
loss of profits) howsoever arising from use of or inability to use
|
|
100
|
-
this demonstrator, or from any action or omission taken as a result of
|
|
101
|
-
using this demonstrator.
|
|
102
|
-
</p>
|
|
103
|
-
|
|
104
|
-
<p>
|
|
105
|
-
This demonstrator is hosted in Austria. All liability is excluded to the extent
|
|
106
|
-
permitted by law including any implied terms. Any interpretation of its
|
|
107
|
-
content, claims or disputes (of whatever nature and not limited to contractual
|
|
108
|
-
issues) shall be subject to the exclusive jurisdiction of the Austrian Courts
|
|
109
|
-
under Austrian law.
|
|
110
|
-
</p>
|
|
111
|
-
|
|
112
|
-
<p>
|
|
113
|
-
All actions performed while using this demonstrator will be logged, including
|
|
114
|
-
the IP address of the user.
|
|
115
|
-
</p>
|
|
116
|
-
|
|
117
|
-
<p>
|
|
118
|
-
<input id='iagree' type='checkbox'/><label for='iagree'><strong>OK, I Agree with this terms. I will be a happy person, and do no evil.</strong></label>
|
|
119
|
-
</p>
|
|
120
|
-
<p>
|
|
121
|
-
<button id='icontinue' disabled='disabled'>Continue</button>
|
|
122
|
-
</p>
|
|
123
|
-
</div> <!--}}}-->
|
|
124
|
-
|
|
125
|
-
<div class='hidden' id='relaxngworker'></div>
|
|
126
|
-
|
|
127
|
-
<div class='menu' id='templates'></div>
|
|
128
|
-
<div class='menu' id='modeltypes'></div>
|
|
129
|
-
|
|
130
|
-
<template id="label">
|
|
131
|
-
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;" class="displaylabel">
|
|
132
|
-
<g transform="translate(1 %%1) rotate(-%%2)">
|
|
133
|
-
<rect class="displaylabel" width="200" height="14" x="8" y="0" rx="5" ry="5"/>
|
|
134
|
-
<path class="displaylabel" d="M10,13 0,13 8,8"/>
|
|
135
|
-
<path class="displaylabelinner" d="M10,11.5 8.5,11.5 8.5,9.5 10,9.5"/>
|
|
136
|
-
<text class="label" x="18" y="10">aaaa</text>
|
|
137
|
-
</g>
|
|
138
|
-
</svg>
|
|
139
|
-
</template>
|
|
140
|
-
|
|
141
|
-
<ui-tabbed id="instance">
|
|
142
|
-
<ui-tabbar>
|
|
143
|
-
<ui-tab class="switch" ></ui-tab>
|
|
144
|
-
<ui-tab class="" data-tab="new" id="tabnew" >New</ui-tab>
|
|
145
|
-
<ui-tab class="inactive hidden" data-tab="instance" id="tabinstance" >Instance</ui-tab>
|
|
146
|
-
<ui-tab class="inactive hidden" data-tab="execution" id="tabexecution">Execution</ui-tab>
|
|
147
|
-
<ui-behind ><a style='display:none' target='_blank' id='current-instance'></a><a style='display:none' target='_blank' id='current-instance-properties'>P</a><a style='display:none' target='_blank' id='current-instance-subscriptions'>S</a><a style='display:none' target='_blank' id='current-instance-callbacks'>C</a></ui-behind>
|
|
148
|
-
<ui-last ><a class="logo" href=".."></a></ui-last>
|
|
149
|
-
</ui-tabbar>
|
|
150
|
-
<ui-content>
|
|
151
|
-
<ui-area data-belongs-to-tab="new" id="areanew"> <!--{{{-->
|
|
152
|
-
<table class='x-ui-layout'>
|
|
153
|
-
<tr>
|
|
154
|
-
<td>Resources:</td>
|
|
155
|
-
<td><input name="res-url" type="text" value=""/></td>
|
|
156
|
-
<td></td>
|
|
157
|
-
</tr>
|
|
158
|
-
<tr>
|
|
159
|
-
<td>Engine:</td>
|
|
160
|
-
<td><input name="base-url" type="text" value=""/></td>
|
|
161
|
-
<td><button name="base">create new instance</button></td>
|
|
162
|
-
</tr>
|
|
163
|
-
<tr>
|
|
164
|
-
<td>Instance:</td>
|
|
165
|
-
<td><input name="instance-url" type="text" value=""/></td>
|
|
166
|
-
<td><button name="instance">monitor instance</button></td>
|
|
167
|
-
</tr>
|
|
168
|
-
</table>
|
|
169
|
-
</ui-area> <!--}}}-->
|
|
170
|
-
<ui-area data-belongs-to-tab="instance" id="areainstance" class="inactive"> <!--{{{-->
|
|
171
|
-
<div>
|
|
172
|
-
<div class='section'>
|
|
173
|
-
<div>
|
|
174
|
-
<form id='fuckchrome'>
|
|
175
|
-
<input type='file' name='testsetfile' id='testsetfile'/>
|
|
176
|
-
</form>
|
|
177
|
-
<button title='a template includes various settings, subscriptions or a (partial) model' name="loadtestset">load template</button><button title='a testset includes various settings, subscriptions or a model' name="loadtestsetfile">load testset</button>
|
|
178
|
-
</div>
|
|
179
|
-
<div>
|
|
180
|
-
<input type='file' name='modelfile' id='modelfile'/>
|
|
181
|
-
<button title='a standalone process model is only loadable if the currently loaded testset sucessfully prepared the current instance for the type of model' name="loadmodelfile">load model</button>
|
|
182
|
-
</div>
|
|
183
|
-
</div><div class='section'>
|
|
184
|
-
<a id="savetestsetfile" href="" download=""></a>
|
|
185
|
-
<a id="savesvgfile" href="" download=""></a>
|
|
186
|
-
<button title='a testset includes various settings, subscriptions and a model' name="savetestsetfile">save<br>testset</button>
|
|
187
|
-
<button title='a testset includes various settings, subscriptions and a model' name="savesvgfile">save svg<br>graph</button>
|
|
188
|
-
</div><div class='section' id='modifiers'>
|
|
189
|
-
<template id="item">
|
|
190
|
-
<div>
|
|
191
|
-
<div class='title'><strong></strong></div>
|
|
192
|
-
<div class='select'><select></select></div>
|
|
193
|
-
<div class='additional'></div>
|
|
194
|
-
</div>
|
|
195
|
-
</template>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
</ui-area> <!--}}}-->
|
|
199
|
-
<ui-area data-belongs-to-tab="execution" id="areaexecution" class='inactive'> <!--{{{-->
|
|
200
|
-
<table class='x-ui-compact'>
|
|
201
|
-
<tbody class='debug'>
|
|
202
|
-
<tr>
|
|
203
|
-
<td>Debugging:</td>
|
|
204
|
-
<td><input type="checkbox" name="votecontinue"/></td>
|
|
205
|
-
</tr>
|
|
206
|
-
</tbody>
|
|
207
|
-
<tbody class='exe'>
|
|
208
|
-
<tr>
|
|
209
|
-
<td>State:</td>
|
|
210
|
-
<td id='state'>
|
|
211
|
-
<span id="state_text"></span>
|
|
212
|
-
<span id="state_any" style='display:none'>
|
|
213
|
-
<span> ⇒ </span>
|
|
214
|
-
<button name="state_start" title='start' style='display:none'>Start</button>
|
|
215
|
-
<button name="state_stop" title='stop' style='display:none'>Stop</button>
|
|
216
|
-
<span id="state_extended" style='display:none'>
|
|
217
|
-
<span> / </span>
|
|
218
|
-
<button name="state_abandon" title='abandon' style='display:none'>Abandon</button>
|
|
219
|
-
</span>
|
|
220
|
-
</span>
|
|
221
|
-
</td>
|
|
222
|
-
</tr>
|
|
223
|
-
<tr>
|
|
224
|
-
<td>Continue:</td>
|
|
225
|
-
<td id='votes'></td>
|
|
226
|
-
</tr>
|
|
227
|
-
</tbody>
|
|
228
|
-
</table>
|
|
229
|
-
</ui-area> <!--}}}-->
|
|
230
|
-
</ui-content>
|
|
231
|
-
</ui-tabbed>
|
|
232
|
-
|
|
233
|
-
<ui-tabbed class="hidden" id='parameters'>
|
|
234
|
-
<ui-tabbar>
|
|
235
|
-
<ui-tab class="switch" ></ui-tab>
|
|
236
|
-
<ui-tab class="" data-tab="dataelements" id="tabdataelements">Data Objects</ui-tab>
|
|
237
|
-
<ui-tab class="inactive" data-tab="endpoints" id="tabendpoints" >Endpoints</ui-tab>
|
|
238
|
-
<ui-tab class="inactive" data-tab="attributes" id="tabattributes" >Attributes</ui-tab>
|
|
239
|
-
<ui-behind ></ui-behind>
|
|
240
|
-
</ui-tabbar>
|
|
241
|
-
<ui-content>
|
|
242
|
-
<ui-area data-belongs-to-tab="dataelements" id="areadataelements"> <!--{{{-->
|
|
243
|
-
<button title='add entry'><span>New</span></button>
|
|
244
|
-
<div id="dat_dataelements"></div>
|
|
245
|
-
</ui-area> <!--}}}-->
|
|
246
|
-
<ui-area data-belongs-to-tab="endpoints" id="areaendpoints" class="inactive"> <!--{{{-->
|
|
247
|
-
<button title='add entry'><span>New</span></button>
|
|
248
|
-
<div id="dat_endpoints"></div>
|
|
249
|
-
</ui-area> <!--}}}-->
|
|
250
|
-
<ui-area data-belongs-to-tab="attributes" id="areaattributes" class="inactive"> <!--{{{-->
|
|
251
|
-
<button title='add entry'><span>New</span></button>
|
|
252
|
-
<div id="dat_attributes"></div>
|
|
253
|
-
</ui-area> <!--}}}-->
|
|
254
|
-
</ui-content>
|
|
255
|
-
</ui-tabbed>
|
|
256
|
-
|
|
257
|
-
<ui-resizehandle class="hidden">drag to resize</ui-resizehandle>
|
|
258
|
-
|
|
259
|
-
<ui-rest id="main" class="hidden">
|
|
260
|
-
<ui-tabbar>
|
|
261
|
-
<ui-before ></ui-before>
|
|
262
|
-
<ui-tab class="" data-tab="details" id="tabdetails">Graph</ui-tab>
|
|
263
|
-
<ui-tab class="inactive" data-tab="dsl" id="tabdsl" >Description</ui-tab>
|
|
264
|
-
<ui-tab class="inactive" data-tab="log" id="tablog" >Log</ui-tab>
|
|
265
|
-
<ui-behind ><a style='display:none' target='_blank' id='current-track'>T</a><a style='display:none' target='_blank' id='current-graph'>G</a></ui-behind>
|
|
266
|
-
</ui-tabbar>
|
|
267
|
-
<ui-content>
|
|
268
|
-
<ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
|
|
269
|
-
<div id="modelling">
|
|
270
|
-
<div id='graphgrid'>
|
|
271
|
-
<div class="resource-label" style="display: none"></div>
|
|
272
|
-
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' class='graphcolumn' width='1' height='1'></svg>
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
<div id='status'></div>
|
|
276
|
-
<div id='prompt_container'>
|
|
277
|
-
<div id='prompt' contenteditable="true" title="Please enter your modelling instructions here... CTRL-ENTER or press '➤' to submit ..." placeholder="Please enter your modelling instructions here... CTRL-ENTER or press '➤' to submit ..."></div>
|
|
278
|
-
<div id='prompt_submit_container'><button id='prompt_submit_button'>➤</button></div>
|
|
279
|
-
</div>
|
|
280
|
-
</ui-area>
|
|
281
|
-
<ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
|
|
282
|
-
<ui-area data-belongs-to-tab="details" id="detailcolumn">
|
|
283
|
-
<div id="dat_details" class='x-ui-layout'></div>
|
|
284
|
-
</ui-area>
|
|
285
|
-
<ui-area data-belongs-to-tab="dsl" id="areadsl" class="inactive"></ui-area>
|
|
286
|
-
<ui-area data-belongs-to-tab="log" id="arealog" class="inactive"> <!--{{{-->
|
|
287
|
-
<div>Persistent Log: <a style='display:none' target='_blank' id='current-log'></a> [<a style='display:none' target='_blank' id='shifted-log'>S</a>]</div>
|
|
288
|
-
<table id="dat_log" class="x-ui-layout"></table>
|
|
289
|
-
</ui-area> <!--}}}-->
|
|
290
|
-
</ui-content>
|
|
291
|
-
</ui-rest>
|
|
292
|
-
|
|
293
|
-
</body>
|
|
294
|
-
</html>
|