Files
windmill/frontend/src/lib/components/ModulePreview.svelte
T
a78beff743 feat: dynamic AI agent toolsets (#11050)
* feat: dynamic ai agent toolsets, and memory as a step input

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: address review round 1 on dynamic ai agent toolsets

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: tag enabled_tools and drop the memory step input

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: let an mcp server entry be named by the path the roster shows

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: keep $res: out of the tool names the enabled tools picker offers

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: name an mcp server by its bare path on the one side that can hold it

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: count the enabled tool names that matched nothing instead of logging them

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: narrow an agent's roster in one pass, by whole entries

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: pin that an mcp summary is rejected against a name that is not

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: regenerate the copilot flow schema after the merge

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: shorten the enabled tools list hint

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: take enabled_tools back to a plain list of tool names

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: keep the enabled tools add-menu hint describing the unset field

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: name a websearch tool that carries no summary of its own

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: reserve the name web search is enabled by so no tool can share it

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: spell the reserved web search name with a hyphen

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: reserve __wm_web_search as the name web search is enabled by

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: advance ee-repo-ref past the git sync ci check work

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: shorten the enabled tools description the run form shows

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: update ee-repo-ref to e4c1b794d6c5e6e390987341b2840587bbb40348

This commit updates the EE repository reference after PR #785 was merged in windmill-ee-private.

Previous ee-repo-ref: af668462f0f06b02a5f4e0c22e6156858487a518

New ee-repo-ref: e4c1b794d6c5e6e390987341b2840587bbb40348

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-09-15 11:34:30 +02:00

96 lines
2.5 KiB
Svelte

<script lang="ts">
import type { Schema } from '$lib/common'
import { type FlowModule, type Job } from '$lib/gen'
import { CornerDownLeft, Loader2 } from 'lucide-svelte'
import Button from './common/button/Button.svelte'
import ModulePreviewForm from './ModulePreviewForm.svelte'
import type { PickableProperties } from './flows/previousResults'
import ModuleTest from './ModuleTest.svelte'
import { getContext } from 'svelte'
import type { FlowEditorContext } from './flows/types'
interface Props {
mod: FlowModule
schema: Schema | { properties?: Record<string, any> }
pickableProperties: PickableProperties | undefined
testJob?: Job | undefined
testIsLoading?: boolean
noEditor?: boolean
scriptProgress?: any
focusArg?: string
class?: string
onJobDone?: () => void
hideRunButton?: boolean
/** Passed through to the form: the step whose agent form this preview accompanies. */
openFieldsKey?: string
/** Passed through to the form: fields it must offer whatever the step holds. */
runInputKeys?: readonly string[]
}
let {
mod,
schema,
pickableProperties,
testJob = $bindable(undefined),
testIsLoading = $bindable(false),
noEditor = false,
scriptProgress = $bindable(undefined),
focusArg = undefined,
class: className = '',
onJobDone,
hideRunButton = false,
openFieldsKey = undefined,
runInputKeys = undefined
}: Props = $props()
const { flowStore } = getContext<FlowEditorContext>('FlowEditorContext')
let moduleTest: ModuleTest | undefined = $state()
export function runTestWithStepArgs() {
moduleTest?.runTestWithStepArgs()
}
</script>
<ModuleTest
{mod}
{noEditor}
bind:testJob
bind:testIsLoading
bind:scriptProgress
bind:this={moduleTest}
{onJobDone}
/>
<div class="p-4 {className}">
{#if flowStore.val.value.same_worker}
<div class="mb-1 bg-yellow-100 text-yellow-700 p-1 text-xs"
>The `./shared` folder is not passed across individual "Test this step"</div
>
{/if}
{#if !hideRunButton}
<div class="w-full justify-center flex">
{#if testIsLoading}
<Button size="sm" on:click={moduleTest?.cancelJob} btnClasses="w-full" color="red">
<Loader2 size={16} class="animate-spin mr-1" />
Cancel
</Button>
{:else}
<Button
variant="accent"
btnClasses="truncate"
size="sm"
on:click={runTestWithStepArgs}
shortCut={{
Icon: CornerDownLeft
}}
>
Run
</Button>
{/if}
</div>
{/if}
<ModulePreviewForm {pickableProperties} {mod} {schema} {focusArg} {openFieldsKey} {runInputKeys} />
</div>