@saltcorn/agents 0.4.5 → 0.4.6
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.
- package/agent-view.js +19 -10
- package/common.js +2 -0
- package/package.json +1 -1
package/agent-view.js
CHANGED
|
@@ -93,6 +93,7 @@ const configuration_workflow = (req) =>
|
|
|
93
93
|
name: "stream",
|
|
94
94
|
label: "Stream response",
|
|
95
95
|
type: "Bool",
|
|
96
|
+
sublabel: "Requires dynamic update (Event settings)",
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
name: "placeholder",
|
|
@@ -346,10 +347,14 @@ const run = async (
|
|
|
346
347
|
}),
|
|
347
348
|
input({
|
|
348
349
|
type: "hidden",
|
|
349
|
-
class: "form-control ",
|
|
350
350
|
name: "run_id",
|
|
351
351
|
value: state.run_id ? +state.run_id : undefined,
|
|
352
352
|
}),
|
|
353
|
+
input({
|
|
354
|
+
type: "hidden",
|
|
355
|
+
name: "page_load_tag",
|
|
356
|
+
value: "",
|
|
357
|
+
}),
|
|
353
358
|
input({
|
|
354
359
|
type: "hidden",
|
|
355
360
|
class: "form-control ",
|
|
@@ -500,15 +505,15 @@ const run = async (
|
|
|
500
505
|
),
|
|
501
506
|
script(
|
|
502
507
|
`
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
508
|
+
function close_session_list() {
|
|
509
|
+
$("div.prev-runs-list").hide().parents(".col-3").removeClass("col-3").addClass("was-col-3").parent().children(".col-9").removeClass("col-9").addClass("col-12")
|
|
510
|
+
$("div.open-prev-runs").show()
|
|
511
|
+
}
|
|
512
|
+
function open_session_list() {
|
|
513
|
+
$("div.prev-runs-list").show().parents(".was-col-3").removeClass(["was-col-3","col-0","d-none"]).addClass("col-3").parent().children(".col-12").removeClass("col-12").addClass("col-9")
|
|
514
|
+
$("div.open-prev-runs").hide()
|
|
515
|
+
}
|
|
516
|
+
function processCopilotResponse(res) {
|
|
512
517
|
const hadFile = $("input#attach_agent_image").val();
|
|
513
518
|
$("span.filename-label").text("");
|
|
514
519
|
$("input#attach_agent_image").val(null);
|
|
@@ -582,6 +587,10 @@ const run = async (
|
|
|
582
587
|
function spin_send_button() {
|
|
583
588
|
$("#sendbuttonicon").attr("class","fas fa-spinner fa-spin");
|
|
584
589
|
};`,
|
|
590
|
+
stream &&
|
|
591
|
+
domReady(
|
|
592
|
+
`$('form.agent-view input[name=page_load_tag]').val(window._sc_pageloadtag)`
|
|
593
|
+
),
|
|
585
594
|
initial_q && domReady("$('form.copilot').submit()")
|
|
586
595
|
)
|
|
587
596
|
)
|
package/common.js
CHANGED
|
@@ -228,6 +228,7 @@ const process_interaction = async (
|
|
|
228
228
|
eval_js: `$('form.agent-view div.next_response_scratch').append(${JSON.stringify(
|
|
229
229
|
content
|
|
230
230
|
)})`,
|
|
231
|
+
page_load_tag: req.body.page_load_tag,
|
|
231
232
|
},
|
|
232
233
|
[req.user.id]
|
|
233
234
|
);
|
|
@@ -319,6 +320,7 @@ const process_interaction = async (
|
|
|
319
320
|
eval_js: `$('form.agent-view div.next_response_scratch').append(${JSON.stringify(
|
|
320
321
|
content
|
|
321
322
|
)})`,
|
|
323
|
+
page_load_tag: req.body.page_load_tag,
|
|
322
324
|
},
|
|
323
325
|
[req.user.id]
|
|
324
326
|
);
|