Files
Davide Silvestri cc361e6658 feat(agent): create agents with a setup wizard (#6765)
* feat(agent): create agents with a two-step setup wizard

The create modal asks for a name and what the agent should do, then reviews
instructions, how it starts, the identity it acts as, permissions and extras.
The choices are applied through the endpoints Configuration uses; a choice
that can't be applied is reported and the agent still opens.

The Run as dropdown can also create an identity. Application types supply
their create modal through getCreateModalComponent.

* feat(agent): add tools, model and identity choices to the create wizard

The wizard gains a third screen for the provider, model, reasoning effort and
web search. Review can create an identity and pick tools one by one. Each
suggestion now fills the whole setup: how the agent starts, its schedule,
permissions, web search and actions.

A new endpoint lists the tools an agent created in a workspace can be given,
so they can be picked before the agent exists. The provider, model and effort
fields are one component shared by Configuration and the wizard.

* fix(agent): choose the wizard identity role from workspace tools

* fix(agent): address create wizard review

Skip locked tools in the permission presets, create the identity before
the agent so a rejected name stops the wizard, number suggestion names,
select the prefilled name, report models that can't search the web, show
a failed tools request and fix the Read only icon.

* fix(agent): address second create wizard review

Give a new identity Builder when the agent may change data, reuse the
identity a failed create made, explain why web search stays off and pass
the workspace to the tool picker.
2026-11-20 14:32:37 +01:00

116 lines
3.1 KiB
Vue

<template>
<div
class="dropdown"
:class="{
'dropdown--floating': !showInput,
'dropdown--disabled': disabled,
'dropdown--large': size === 'large',
'dropdown--error': error,
}"
:tabindex="realTabindex"
@focusin="show()"
@focusout="focusout($event)"
>
<a v-if="showInput" class="dropdown__selected" @click="show()">
<slot name="selectedValue">
<template v-if="displayName !== null">
<span class="dropdown__selected-text">{{ displayName }}</span>
</template>
<template v-else>{{
notSelectedText === null ? $t('action.makeChoice') : notSelectedText
}}</template>
</slot>
<i class="dropdown__toggle-icon iconoir-nav-arrow-down"></i>
</a>
<div
ref="itemsContainer"
class="dropdown__items"
:class="{
hidden: !open,
'dropdown__items--fixed': fixedItemsImmutable,
}"
>
<div v-if="showSearch" class="select__search">
<i class="select__search-icon iconoir-search"></i>
<input
ref="search"
v-model="query"
type="text"
class="select__search-input"
tabindex="0"
:placeholder="searchText === null ? $t('action.search') : searchText"
@input="search"
/>
</div>
<ul
ref="items"
v-auto-overflow-scroll
class="select__items"
:class="{ 'select__items--no-max-height': fixedItemsImmutable }"
tabindex="-1"
@scroll="scroll"
>
<DropdownItem
v-if="addEmptyItem"
:name="emptyItemDisplayName"
:value="null"
></DropdownItem>
<slot name="items" :results="results">
<template v-if="resultItemComponent">
<component
:is="resultItemComponent"
v-for="result in results"
:key="result[idName]"
:name="getResultName(result)"
:value="result[idName]"
:result="result"
></component>
</template>
<template v-else>
<DropdownItem
v-for="result in results"
:key="result[idName]"
:name="getResultName(result)"
:value="result[idName]"
></DropdownItem>
</template>
</slot>
<div v-if="loading" class="select__items-loading"></div>
</ul>
<slot name="footer" :hide="hide"></slot>
</div>
</div>
</template>
<script>
import paginatedDropdown from '@baserow/modules/core/mixins/paginatedDropdown'
export default {
name: 'PaginatedDropdown',
mixins: [paginatedDropdown],
props: {
fetchPage: {
type: Function,
required: true,
},
includeDisplayNameInSelectedEvent: {
type: Boolean,
required: false,
default: false,
},
resultItemComponent: {
type: [Object, Function],
required: false,
default: null,
},
},
methods: {
getResultName(result) {
return typeof this.valueName === 'function'
? this.valueName(result)
: result[this.valueName]
},
},
}
</script>