Skip to content

Commit f357682

Browse files
author
Jicheng Lu
committed
add rule statement
1 parent 950fe9a commit f357682

File tree

6 files changed

+40
-18
lines changed

6 files changed

+40
-18
lines changed

src/lib/helpers/types/agentTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
* @property {boolean} disabled
232232
* @property {any?} [output_args]
233233
* @property {string?} [json_args]
234+
* @property {string?} [statement]
234235
*/
235236

236237

src/routes/page/agent/[agentId]/agent-components/agent-knowledge-base.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@
205205
on:change={e => toggleKnowledgeBase(e, uid)}
206206
/>
207207
</div>
208-
<div
208+
<!-- <div
209209
class="line-align-center"
210210
data-bs-toggle="tooltip"
211211
data-bs-placement="top"
212212
title="Uncheck to disable knowledgebase"
213213
>
214214
<i class="bx bx-info-circle fs-6" />
215-
</div>
215+
</div> -->
216216
</div>
217217
</div>
218218
<div class="utility-value">

src/routes/page/agent/[agentId]/agent-components/agent-mcp-tool.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@
235235
on:change={e => toggleMcp(e, uid)}
236236
/>
237237
</div>
238-
<div
238+
<!-- <div
239239
class="line-align-center fs-6"
240240
data-bs-toggle="tooltip"
241241
data-bs-placement="top"
242242
title="Uncheck to disable MCP"
243243
>
244244
<i class="bx bx-info-circle" />
245-
</div>
245+
</div> -->
246246
</div>
247247
</div>
248248
<div class="utility-value">

src/routes/page/agent/[agentId]/agent-components/agent-rule.svelte

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
name: x.trigger_name,
7878
displayName: "",
7979
output_args: x.output_args,
80-
json_args: x.json_args
80+
json_args: x.json_args,
81+
statement: x.statement
8182
};
8283
}) || [];
8384
ruleOptions = [{
@@ -239,7 +240,8 @@
239240
return {
240241
...x,
241242
output_args: found?.output_args,
242-
json_args: found?.json_args
243+
json_args: found?.json_args,
244+
statement: found?.statement
243245
}
244246
}) || [];
245247
}
@@ -287,14 +289,33 @@
287289
on:change={e => toggleRule(e, uid)}
288290
/>
289291
</div>
290-
<div
291-
class="line-align-center fs-6"
292-
data-bs-toggle="tooltip"
293-
data-bs-placement="top"
294-
title="Uncheck to disable rule"
295-
>
296-
<i class="bx bx-info-circle" />
292+
{#if rule.statement}
293+
<div class="line-align-center">
294+
<i
295+
class="bx bx-info-circle text-primary fs-6"
296+
style="padding-top: 2px;"
297+
id={`rule-statement-${uid}`}
298+
data-bs-toggle="tooltip"
299+
data-bs-placement="top"
300+
title="Rule arguments"
301+
/>
302+
<BotsharpTooltip
303+
containerClasses="agent-utility-desc"
304+
style={`min-width: ${Math.floor(windowWidth*0.3)}px;`}
305+
target={`rule-statement-${uid}`}
306+
placement="top"
307+
persist
308+
>
309+
<Markdown
310+
rawText
311+
scrollable
312+
containerClasses={'markdown-div'}
313+
containerStyles={`max-width: ${Math.floor(windowWidth*0.3)}px;`}
314+
text={rule.statement}
315+
/>
316+
</BotsharpTooltip>
297317
</div>
318+
{/if}
298319
</div>
299320
</div>
300321
<div class="utility-value">
@@ -367,15 +388,15 @@
367388
<div class="line-align-center">
368389
<i
369390
class="bx bxs-info-circle text-primary fs-5"
370-
id={`rule-${uid}`}
391+
id={`rule-args-${uid}`}
371392
data-bs-toggle="tooltip"
372393
data-bs-placement="top"
373394
title="Rule arguments"
374395
/>
375396
<BotsharpTooltip
376397
containerClasses="agent-utility-desc"
377398
style={`min-width: ${Math.floor(windowWidth*0.3)}px;`}
378-
target={`rule-${uid}`}
399+
target={`rule-args-${uid}`}
379400
placement="right"
380401
persist
381402
>

src/routes/page/agent/[agentId]/agent-components/agent-utility.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@
321321
on:change={e => toggleUtility(e, uid)}
322322
/>
323323
</div>
324-
<div
324+
<!-- <div
325325
class="line-align-center"
326326
data-bs-toggle="tooltip"
327327
data-bs-placement="top"
328328
title="Uncheck to disable utility"
329329
>
330330
<i class="bx bx-info-circle fs-6" />
331-
</div>
331+
</div> -->
332332
</div>
333333
</div>
334334
<div class="utility-value">

src/routes/page/agent/[agentId]/agent-tabs.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
];
6161
6262
onMount(() => {
63-
selectedTab = tabs[0]?.name;
63+
selectedTab = tabs[4]?.name;
6464
});
6565
6666
/** @param {string} selected */

0 commit comments

Comments
 (0)