PageSourceSearch

https://ainize.ai/_next/static/chunks/9023.e36def5f5ab97b7a.js

js ainize.ai collected 2026-10-05 11:48:39 UTC 20,515 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9023],{9023:(e,t,n)=>{n.r(t),n.d(t,{default:()=>T});var a=n(5155),r=n(2115),i=n(9535),s=n(2553),o=n(4975),d=n(352),l=n(9763),c=n(3638),h=n(8490),g=n(1166),p=n(4748),m=n(682),u=n(508),x=n(6541),f=n(4856);let y="/**\n * Tools mode.\n *\n * The node runs an OpenAI function-calling loop (up to 8 rounds) against this agent's model, with the system\n * prompt from the form. Whenever the model asks for one of the tools below, the node calls its run(args, ctx)\n * and hands the return value back to the model. You write the tools; the conversation is handled for you.\n *\n * ctx.fetch(url, init)  — the only way out of the sandbox. Only the \"allowed hosts\" on the form answer.\n * ctx.secret('NAME')    — a value you stored under one of the form's secret names (undefined if unset).\n * ctx.log(...)          — goes to this agent's log, which only you can read.\n */\n\nexport const tools = [\n  {\n    name: 'text_stats',\n    description: 'Count words, sentences and characters in a piece of text.',\n    parameters: {\n      type: 'object',\n      properties: { text: { type: 'string', description: 'The text to measure' } },\n      required: ['text'],\n    },\n    async run(args, ctx) {\n      const text = String(args?.text ?? '');\n      const words = text.trim() ? text.trim().split(/\\s+/).length : 0;\n      const sentences = text.split(/[.!?。]+/).filter((s) => s.trim()).length;\n      ctx.log('text_stats', { words, sentences });\n      return { words, sentences, characters: text.length };\n    },\n  },\n  {\n    name: 'today',\n    description: 'The current date and time in UTC, as ISO 8601.',\n    parameters: { type: 'object', properties: {} },\n    async run() {\n      return { now: new Date().toISOString() };\n    },\n  },\n  // Calling an external API — add its host to \"allowed hosts\" and its key to the secrets first:\n  //\n  // {\n  //   name: 'weather',\n  //   description: 'Current weather for a city.',\n  //   parameters: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'] },\n  //   async run(args, ctx) {\n  //     const res = await ctx.fetch(\n  //       'https://api.example.com/weather?q=' + encodeURIComponent(args.city),\n  //       { headers: { authorization: 'Bearer ' + ctx.secret('WEATHER_API_KEY') } },\n  //     );\n  //     if (!res.ok) return { error: 'weather service answered ' + res.status };\n  //     return await res.json();\n  //   },\n  // },\n];\n",j="/**\n * Handler mode.\n *\n * execute(input, ctx) receives every message and decides the reply itself — no model is called unless you call\n * it. Good for deterministic pipelines: score something, look something up, write something somewhere.\n *\n * input            — the message text (a string); ctx.input also has { text, contextId, history }\n * ctx.llm.chat({ messages, temperature?, max_tokens? }) → { message, finish_reason }, on this agent's model\n * ctx.fetch(url, init) — the only way out of the sandbox. Only the \"allowed hosts\" on the form answer.\n * ctx.secret('NAME')   — a value stored under one of the form's secret names (undefined if unset)\n * ctx.ui               — A2UI helpers: surface(id, components, data), text, column, row, card, divider, list, bind\n * ctx.log(...)         — goes to this agent's log, which only you can read\n *\n * Return a string, or { text, ui }. text is what every client shows; ui is drawn by clients that speak A2UI\n * (tick \"A2UI\" on the form so the agent card says so).\n */\n\nexport async function execute(input, ctx) {\n  const text = String(input ?? '').trim();\n  if (!text) return 'Send me a paragraph and I will score how easy it is to read.';\n\n  // A small, deterministic score: shorter sentences and shorter words read more easily.\n  const sentences = text.split(/[.!?。]+/).map((s) => s.trim()).filter(Boolean);\n  const words = text.split(/\\s+/).filter(Boolean);\n  const wordsPerSentence = words.length / Math.max(1, sentences.length);\n  const lettersPerWord = words.join('').length / Math.max(1, words.length);\n  const score = Math.max(0, Math.min(100, Math.round(120 - wordsPerSentence * 2.5 - lettersPerWord * 6)));\n  const verdict = score >= 70 ? 'Easy to read' : score >= 40 ? 'Takes some effort' : 'Hard going';\n  ctx.log('scored', { score, sentences: sentences.length, words: words.length });\n\n  // Writing the result somewhere — add the host to \"allowed hosts\" and the key to the secrets first:\n  //\n  // await ctx.fetch('https://api.example.com/scores', {\n  //   method: 'POST',\n  //   headers: { 'content-type': 'application/json', authorization: 'Bearer ' + ctx.secret('EXAMPLE_API_KEY') },\n  //   body: JSON.stringify({ score, verdict }),\n  // });\n\n  const ui = ctx.ui.surface('score', [\n    ctx.ui.card('root', 'body'),\n    ctx.ui.column('body', ['title', 'score', 'verdict', 'rule', 'detail']),\n    ctx.ui.text('title', 'Readability', 'h3'),\n    ctx.ui.text('score', ctx.ui.bind('/score'), 'h1'),\n    ctx.ui.text('verdict', ctx.ui.bind('/verdict')),\n    ctx.ui.divider('rule'),\n    ctx.ui.text('detail', ctx.ui.bind('/detail'), 'caption'),\n  ], {\n    score: score 
1+ ' / 100',\n    verdict,\n    detail: sentences.length + ' sentences \xb7 ' + words.length + ' words \xb7 ' + wordsPerSentence.toFixed(1) + ' words per sentence',\n  });\n\n  return { text: 'Readability ' + score + '/100 — ' + verdict + '.', ui };\n}\n";function C(e){return"tools"===e?y:"handler"===e?j:""}let b=s.Ay.form.withConfig({componentId:"sc-dfdeb8c3-0"})(["display:flex;flex-direction:column;gap:24px;margin-top:8px;max-width:880px;"]),v=s.Ay.section.withConfig({componentId:"sc-dfdeb8c3-1"})(["display:flex;flex-direction:column;gap:16px;padding:20px 24px;background:#fff;border:1px solid ",";h2{margin:0;font-size:16px;font-weight:700;color:",";}"],e=>e.theme.color.LIGHT_GREY,e=>e.theme.color.BLACK),w=s.Ay.div.withConfig({componentId:"sc-dfdeb8c3-2"})(["display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;"]),k=s.Ay.div.withConfig({componentId:"sc-dfdeb8c3-3"})(["display:flex;gap:8px;flex-wrap:wrap;"]),E=s.Ay.button.withConfig({componentId:"sc-dfdeb8c3-4"})(["cursor:pointer;font:inherit;font-size:13px;padding:6px 14px;border-radius:999px;text-align:left;border:1px solid ",";background:",";color:",";&:disabled{cursor:not-allowed;opacity:0.45;}"],e=>e.$on?e.theme.color.PRIMARY:e.theme.color.LIGHT_GREY,e=>e.$on?"#f4f1ff":"#fff",e=>e.theme.color.BLACK),_=s.Ay.textarea.withConfig({componentId:"sc-dfdeb8c3-5"})(["width:100%;min-height:380px;padding:14px;border-radius:6px;resize:vertical;tab-size:2;font-family:",";font-size:12.5px;line-height:1.6;white-space:pre;overflow:auto;background:#11131a;color:#e6e8ee;border:1px solid #11131a;&:focus{outline:2px solid ",";}"],e=>e.theme.font.mono,e=>e.theme.color.PRIMARY),I=s.Ay.div.withConfig({componentId:"sc-dfdeb8c3-6"})(["display:flex;justify-content:space-between;align-items:center;gap:12px;"]),A=s.Ay.div.withConfig({componentId:"sc-dfdeb8c3-7"})(["display:grid;grid-template-columns:minmax(140px,1fr) minmax(160px,1.4fr) auto auto;gap:12px;align-items:end;@media (max-width:640px){grid-template-columns:1fr;}"]),S=s.Ay.span.withConfig({componentId:"sc-dfdeb8c3-8"})(["font-size:11px;font-weight:700;padding:2px 8px;border-radius:10px;white-space:nowrap;background:",";color:",";"],e=>e.$set?"#e3f4e8":"#eef1f4",e=>e.$set?"#1c6b34":"#4a5560"),$=s.Ay.div.withConfig({componentId:"sc-dfdeb8c3-9"})(["display:flex;gap:12px;align-items:center;flex-wrap:wrap;"]);function T(){var e,t,n;let{t:s}=(0,u.kj)(),{id:T}=(0,i.g)(),P=!!T,[R]=(0,i.ok)(),F=(0,i.zy)(),M=(0,i.Zp)(),z=(0,c.A)(),D=(0,f.g)();(0,x.K)(P?s("agentCreate.title_edit"):s("agentCreate.title"));let H=null!=(t=R.get("model"))?t:"",L=(0,o.oil)(),K=(0,r.useMemo)(()=>(0,d.A$)((0,l.Zi)(L.data),H||null),[L.data,H]),O=(0,o.ATc)(),U=(0,r.useMemo)(()=>(0,d.OG)([...(0,l.Zi)(L.data),...(0,l.Zi)(O.data)]),[L.data,O.data]),Y=(0,o.mQe)(null!=T?T:"",{skip:!P||!z.principal}),J=(0,r.useMemo)(()=>(0,d.Ku)(Y.data),[Y.data]),[B,q]=(0,r.useState)(()=>({id:"",name:"",description:"",model:H,systemPrompt:"",mode:"prompt",code:"",packageJson:"",a2ui:!1,mediaTranscription:!1,mediaImage:!1,allowedHostsText:"",secrets:[],visibility:"public",orgId:null})),[G,N]=(0,r.useState)(null),[Z,V]=(0,r.useState)(!1),[W,X]=(0,r.useState)(!1),[Q,ee]=(0,r.useState)(null),[et,en]=(0,r.useState)(!1),[ea,er]=(0,r.useState)([]),[ei,es]=(0,r.useState)(!1),[eo]=(0,o.VXV)(),[ed]=(0,o.CAh)(),[el]=(0,o.H6B)();(0,r.useEffect)(()=>{P&&J&&G!==J.id&&(q((0,d.Zs)(J)),N(J.id))},[P,J,G]),(0,r.useEffect)(()=>{if(!P&&!B.model&&K.length){var e;let t=null!=(e=K.find(e=>e.available))?e:K[0];q(e=>e.model?e:{...e,model:t.id})}},[P,B.model,K]);let ec=(0,r.useMemo)(()=>(0,d.Bm)(B,D.orgs),[B,D.orgs]),eh=e=>W?ec.find(t=>t.field===e):void 0,eg=(e,t)=>q(n=>({...n,[e]:t})),ep=async()=>{if(X(!0),ee(null),er([]),!ec.length){es(!0);try{let e=(0,d.tz)(B);try{await (P?ed(e):eo(e)).unwrap()}catch(t){let e=(0,d.I1)(t);"docker_unavailable"===e.code&&en(!0),ee(e);return}let t=[];for(let n of(0,d.fg)(B))try{await el({id:e.id,name:n.name,value:n.value}).unwrap()}catch(e){t.push(n.name)}if(t.length)return void er(t);M("/agent/".concat(encodeURIComponent(e.id)))}finally{es(!1)}}};if(z.loading)return(0,a.jsx)(m.ff,{children:(0,a.jsx)(m.bs,{})});if(!z.principal){let e="".concat(F.pathname).concat(F.search);return(0,a.jsxs)(m.ff,{children:[(0,a.jsx)(m.dR,{children:(0,a.jsx)(m.hE,{children:P?s("agentCreate.title_edit"):s("agentCreate.title")})}),(0,a.jsxs)(m.Sv,{"data-testid":"agent-create-signin",children:[(0,a.jsx)(m.VY,{style:{margin:"0 auto 16px"},children:s("agentCreate.signin.body")}),(0,a.jsx)(m.ah,{to:"/signing?next=".concat(encodeURIComponent(e)),children:s("agentCreate.signin.cta")})]})]})}if(P&&Y.isLoading)return(0,a.jsx)(m.ff,{children:(0,a.jsx)(m.bs,{})});if(P&&(Y.error||!J)){let e=Y.error?(0,d.I1)(Y.error):null,t=(null==e?void 0:e.code)==="forbidden"?"agentCreate.edit.forbidden":(null==e?void 0:e.code)==="not_found"?"agentCreate.edit.not_found":"agentCreate.edit.unreadable";return(0,a.jsxs)(m.ff,{children:[(0,a.jsx)(m.dR,{children:(0,a.jsx)(m.hE,{children:s("agentCreate.title_edit")})}
1),(0,a.jsxs)(m.Sv,{"data-testid":"agent-edit-unavailable",children:[s(t,{id:null!=T?T:""})," ",(0,a.jsx)(m.ah,{to:"/agent/".concat(encodeURIComponent(null!=T?T:"")),children:s("agentCreate.edit.back")})]})]})}let em=(0,d.bp)(B.mode),eu=K.find(e=>e.id===B.model);return(0,a.jsxs)(m.ff,{children:[(0,a.jsx)(m.dR,{children:(0,a.jsx)(m.hE,{children:P?s("agentCreate.title_edit"):s("agentCreate.title")})}),(0,a.jsx)(m.VY,{children:s("agentCreate.lede")}),(0,a.jsxs)(b,{onSubmit:e=>{e.preventDefault(),ep()},noValidate:!0,"data-testid":"agent-create-form",children:[(0,a.jsxs)(v,{children:[(0,a.jsx)("h2",{children:s("agentCreate.section.identity")}),(0,a.jsxs)(w,{children:[(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-name",children:s("agentCreate.field.name")}),(0,a.jsx)(p.pd,{id:"agent-create-name",value:B.name,maxLength:80,onChange:e=>{let t;return t=e.target.value,q(e=>({...e,name:t,id:P||Z?e.id:(0,d.R)(t)}))},"data-testid":"agent-create-name"}),eh("name")&&(0,a.jsx)(p.EE,{$error:!0,children:s(eh("name").key)})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-id",children:s("agentCreate.field.id")}),(0,a.jsx)(p.pd,{id:"agent-create-id",value:B.id,maxLength:40,readOnly:P,disabled:P,"data-testid":"agent-create-id",onChange:e=>{V(!0),eg("id",e.target.value.toLowerCase())}}),(0,a.jsx)(p.EE,{$error:!!eh("id"),children:eh("id")?s(eh("id").key):P?s("agentCreate.field.id_fixed"):s("agentCreate.field.id_help",{id:B.id||"my-agent"})})]})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-description",children:s("agentCreate.field.description")}),(0,a.jsx)(p.TM,{id:"agent-create-description",value:B.description,maxLength:500,style:{minHeight:64},onChange:e=>eg("description",e.target.value)}),eh("description")&&(0,a.jsx)(p.EE,{$error:!0,children:s(eh("description").key)})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-model",children:s("agentCreate.field.model")}),(0,a.jsxs)(p.l6,{id:"agent-create-model",value:B.model,onChange:e=>eg("model",e.target.value),"data-testid":"agent-create-model",children:[!B.model&&(0,a.jsx)("option",{value:"",children:s("agentCreate.field.model_pick")}),K.map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.id,e.available?"":" — ".concat(s("models.unavailable"))]},e.id))]}),(0,a.jsx)(p.EE,{$error:!!eh("model"),children:eh("model")?s(eh("model").key):0===K.length?s("agentCreate.field.model_none"):eu&&!eu.available?s("agentCreate.field.model_down"):(0,a.jsxs)(a.Fragment,{children:[s("agentCreate.field.model_help")," ",B.model&&(0,a.jsx)(m.ah,{to:"/models/".concat(encodeURIComponent(B.model)),children:s("agentCreate.field.model_link")})]})})]})]}),(0,a.jsxs)(v,{children:[(0,a.jsx)("h2",{children:s("agentCreate.section.behaviour")}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-prompt",children:s("agentCreate.field.system_prompt")}),(0,a.jsx)(p.TM,{id:"agent-create-prompt",value:B.systemPrompt,maxLength:8e3,style:{minHeight:140},"data-testid":"agent-create-prompt",placeholder:s("agentCreate.field.system_prompt_placeholder"),onChange:e=>eg("systemPrompt",e.target.value)}),(0,a.jsx)(p.EE,{$error:!!eh("systemPrompt"),children:eh("systemPrompt")?s(eh("systemPrompt").key):s("agentCreate.mode.".concat(B.mode,".prompt_help"))})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{as:"div",children:s("agentCreate.field.mode")}),(0,a.jsx)(k,{role:"tablist",children:d.Xq.map(e=>(0,a.jsx)(E,{type:"button",role:"tab","aria-selected":B.mode===e,$on:B.mode===e,disabled:et&&(0,d.bp)(e),"data-testid":"agent-create-mode-".concat(e),onClick:()=>q(t=>{let n;return{...t,mode:e,code:(0,d.bp)(e)&&(!(n=t.code).trim()||n===y||n===j)?C(e):t.code,a2ui:!("handler"!==e||(0,d.bp)(t.mode))&&!t.a2ui||t.a2ui}}),children:(0,a.jsx)("b",{children:s("agentCreate.mode.".concat(e))})},e))}),(0,a.jsx)(p.EE,{children:s("agentCreate.mode.".concat(B.mode,".help"))}),et&&(0,a.jsx)(p.Fc,{$tone:"warning","data-testid":"agent-create-docker",children:s("agentCreate.docker_unavailable")})]}),em&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(p.D0,{children:[(0,a.jsxs)(I,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-code",children:(0,a.jsx)(m.Kp,{children:d._p})}),(0,a.jsx)(g.$,{type:"button",size:"small",variant:"text",onClick:()=>eg("code",C(B.mode)),children:s("agentCreate.code.reset")})]}),(0,a.jsx)(_,{id:"agent-create-code",value:B.code,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","data-testid":"agent-create-code",onChange:e=>eg("code",e.target.value),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey)return;e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:a}=t;eg("code","".concat(B.code.slice(0,n),"  ").concat(B.code.slice(a))),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=n+2})}}),eh("code")&&(0,a.jsx)(p.EE,{$error:!0,children:s(eh("code").key)}),eh("files")&&(0,a.jsx)(p.EE,{$error:!0,children:s(eh("files").key)})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsxs)(I,{children:[(0,a.jsxs)(p.dh,{htmlFor:"agent-create-package",children:[(0,a.jsx)(m.Kp,{children:"package.json"})," \xb7 ",s("agentCreate.code.optional")]}),!B.packageJson&&(0,a.jsx)(g.$,{type:"button",size:"small",variant:"text",onClick:()=>eg("packageJson",'{\n  "name": "my-agent",\n  "private": true,\n  "type": "module",\n  "depen
1dencies": {}\n}\n'),children:s("agentCreate.code.add_package")})]}),(0,a.jsx)(_,{id:"agent-create-package",value:B.packageJson,spellCheck:!1,style:{minHeight:120},placeholder:s("agentCreate.code.package_placeholder"),onChange:e=>eg("packageJson",e.target.value)}),(0,a.jsx)(p.EE,{$error:!!eh("packageJson"),children:eh("packageJson")?s(eh("packageJson").key):s("agentCreate.code.package_help")})]})]}),(0,a.jsx)(p.Sc,{label:s("agentCreate.field.a2ui"),checked:B.a2ui,"data-testid":"agent-create-a2ui",onChange:e=>eg("a2ui",e.target.checked)}),(0,a.jsx)(p.Sc,{label:s("agentCreate.field.media_transcription"),checked:B.mediaTranscription,"data-testid":"agent-create-media-transcription",disabled:!U.transcription&&!B.mediaTranscription,onChange:e=>eg("mediaTranscription",e.target.checked)}),(0,a.jsx)(p.Sc,{label:s("agentCreate.field.media_image"),checked:B.mediaImage,"data-testid":"agent-create-media-image",disabled:!U.image&&!B.mediaImage,onChange:e=>eg("mediaImage",e.target.checked)}),(!U.transcription||!U.image)&&(0,a.jsx)(p.EE,{children:s("agentCreate.field.media_unavailable")})]}),(0,a.jsxs)(v,{children:[(0,a.jsx)("h2",{children:s("agentCreate.section.sharing")}),(0,a.jsx)(h.q,{visibility:B.visibility,orgId:B.orgId,orgs:D.orgs,activeOrg:D.activeOrg,onChange:e=>q(t=>({...t,...e})),problemKey:null!=(n=null==(e=eh("orgId"))?void 0:e.key)?n:null,idPrefix:"agent-create"}),(0,a.jsx)(p.EE,{children:s("sharing.wire_note")})]}),(0,a.jsxs)(v,{children:[(0,a.jsx)("h2",{children:s("agentCreate.section.access")}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{htmlFor:"agent-create-hosts",children:s("agentCreate.field.hosts")}),(0,a.jsx)(p.TM,{id:"agent-create-hosts",value:B.allowedHostsText,style:{minHeight:64,fontFamily:"monospace"},placeholder:"api.example.com\n*.example.org",onChange:e=>eg("allowedHostsText",e.target.value)}),(0,a.jsx)(p.EE,{children:s("agentCreate.field.hosts_help")})]}),(0,a.jsxs)(p.D0,{children:[(0,a.jsx)(p.dh,{as:"div",children:s("agentCreate.field.secrets")}),(0,a.jsx)(p.EE,{$error:!!eh("secrets"),children:eh("secrets")?s(eh("secrets").key):s("agentCreate.field.secrets_help")}),B.secrets.map((e,t)=>(0,a.jsxs)(A,{children:[(0,a.jsx)(p.pd,{"aria-label":s("agentCreate.secret.name"),placeholder:"API_KEY",value:e.name,readOnly:e.set,onChange:e=>eg("secrets",B.secrets.map((n,a)=>a===t?{...n,name:e.target.value.toUpperCase()}:n))}),(0,a.jsx)(p.pd,{"aria-label":s("agentCreate.secret.value"),type:"password",autoComplete:"off",value:e.value,placeholder:e.set?s("agentCreate.secret.keep"):s("agentCreate.secret.value"),onChange:e=>eg("secrets",B.secrets.map((n,a)=>a===t?{...n,value:e.target.value}:n))}),(0,a.jsx)(S,{$set:e.set,children:e.set?s("agentCreate.secret.set"):s("agentCreate.secret.unset")}),(0,a.jsx)(g.$,{type:"button",size:"small",variant:"text",onClick:()=>eg("secrets",B.secrets.filter((e,n)=>n!==t)),children:s("agentCreate.secret.remove")})]},t)),(0,a.jsx)("div",{children:(0,a.jsx)(g.$,{type:"button",size:"small",onClick:()=>eg("secrets",[...B.secrets,{name:"",value:"",set:!1}]),children:s("agentCreate.secret.add")})})]})]}),Q&&(0,a.jsxs)(p.Fc,{$tone:"error","data-testid":"agent-create-error",children:[(0,a.jsx)("b",{children:s("agentCreate.api.".concat(Q.code))}),Q.message?(0,a.jsxs)(a.Fragment,{children:[" — ",Q.message]}):null]}),ea.length>0&&(0,a.jsxs)(p.Fc,{$tone:"warning","data-testid":"agent-create-secret-failed",children:[s("agentCreate.secret.failed",{names:ea.join(", ")})," ",(0,a.jsx)(i.N_,{to:"/agent/".concat(encodeURIComponent(B.id)),children:s("agentCreate.secret.continue")})]}),W&&ec.length>0&&(0,a.jsx)(p.Fc,{$tone:"error",children:s("agentCreate.err.fix_fields")}),(0,a.jsxs)($,{children:[(0,a.jsx)(g.$,{type:"submit",variant:"contained",size:"large",loading:ei,"data-testid":"agent-create-submit",children:P?s("agentCreate.save"):s("agentCreate.submit")}),(0,a.jsx)(g.$,{type:"button",variant:"text",onClick:()=>M(-1),children:s("agentCreate.cancel")})]})]})]})}},9763:(e,t,n)=>{n.d(t,{Ew:()=>s,QH:()=>a,T6:()=>o,Zi:()=>i});let a=["chat","transcription","image"],r=e=>"string"==typeof e&&a.includes(e);function i(e){let t=null==e?void 0:e.data;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!e||"object"!=typeof e)continue;let{id:t,modality:a,available:i}=e;
1"string"==typeof t&&t&&r(a)&&n.push({id:t,modality:a,available:!0===i})}return n}function s(e){return e?404===("number"==typeof e.status?e.status:e.originalStatus)?"outdated":"offline":"ok"}function o(e){let t=function(e){if(!e||"object"!=typeof e)return null;let[t]=i({data:[e]});if(!t)return null;let n=e.agents;return{...t,agents:"number"==typeof n&&n>=0?n:null}}(e.detail);if(t&&t.id===e.id)return{kind:"ok",model:t};if(e.detailLoading||e.listLoading)return{kind:"loading"};let n=i(e.list).find(t=>t.id===e.id);if(n)return{kind:"ok",model:{...n,agents:null}};let a=s(e.listError);return"offline"===a?{kind:"offline"}:e.detailError?"offline"===s(e.detailError)?{kind:"offline"}:"outdated"===a?{kind:"outdated"}:{kind:"not_served"}:{kind:"not_served"}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.