@shawnstack/quickforge 1.5.1 → 1.5.3

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.
Files changed (45) hide show
  1. package/README.md +10 -10
  2. package/dist/assets/AgentProfilesPage-BToo_R3Y.js +1 -0
  3. package/dist/assets/ChatPanelHost-BTqhhkWK.js +242 -0
  4. package/dist/assets/{PluginsPage-kRzB5k8J.js → PluginsPage-DwzV2vQ4.js} +1 -1
  5. package/dist/assets/ScheduledTasksPage-Cbm6LVk3.js +2 -0
  6. package/dist/assets/{SharedConversationPage-EQdZgWCM.js → SharedConversationPage-CHE9qABz.js} +1 -1
  7. package/dist/assets/TerminalDock-Loi8A4pJ.js +2 -0
  8. package/dist/assets/WorkspaceInspector-Nf5xELW7.js +3 -0
  9. package/dist/assets/{WorkspaceReaderDialog-BwzZ8Tgv.js → WorkspaceReaderDialog-Bai7v3V0.js} +1 -1
  10. package/dist/assets/{diff-line-counts-CeZC7b0z.js → diff-line-counts-CCPYa_e0.js} +1 -1
  11. package/dist/assets/icons-DzxBk7tb.js +1 -0
  12. package/dist/assets/index-Bt_dRvdG.js +1476 -0
  13. package/dist/assets/{index-DuTUuAMk.css → index-BzaZg9Br.css} +1 -1
  14. package/dist/assets/{monaco-CNEfYIy1.js → monaco-dMY7_GLO.js} +1 -1
  15. package/dist/assets/{react-vendor-CZCcjpSR.js → react-vendor-DsAeMFcm.js} +1 -1
  16. package/dist/index.html +4 -4
  17. package/package.json +1 -1
  18. package/server/acp/server.mjs +1 -0
  19. package/server/agent-manager.mjs +6 -6
  20. package/server/agent-profile-files.mjs +2 -1
  21. package/server/channels/process-channel.mjs +1 -0
  22. package/server/channels/providers/wechat.mjs +1 -0
  23. package/server/custom-commands.mjs +4 -3
  24. package/server/mcp/config.mjs +20 -20
  25. package/server/plugins/registry.mjs +1 -1
  26. package/server/project-config.mjs +2 -2
  27. package/server/routes/agent.mjs +0 -1
  28. package/server/routes/backup.mjs +84 -20
  29. package/server/routes/project.mjs +3 -2
  30. package/server/routes/scheduled-tasks.mjs +13 -121
  31. package/server/routes/static.mjs +1 -1
  32. package/server/routes/storage.mjs +13 -7
  33. package/server/session-utils.mjs +2 -1
  34. package/server/skills.mjs +3 -2
  35. package/server/storage.mjs +182 -49
  36. package/server/utils/logger.mjs +0 -1
  37. package/server/utils/package-update.mjs +2 -2
  38. package/server/utils/scheduled-tasks.mjs +127 -0
  39. package/dist/assets/AgentProfilesPage-BIwd5Nzg.js +0 -1
  40. package/dist/assets/ChatPanelHost-De-DMjx5.js +0 -242
  41. package/dist/assets/ScheduledTasksPage-ZnjohaPS.js +0 -2
  42. package/dist/assets/TerminalDock-P2pJH_tx.js +0 -2
  43. package/dist/assets/WorkspaceInspector-CkLAqYQ6.js +0 -3
  44. package/dist/assets/icons-DJqt-rnw.js +0 -1
  45. package/dist/assets/index-CcGy4TXo.js +0 -1354
@@ -0,0 +1,127 @@
1
+ export const minuteMs = 60 * 1000
2
+ export const hourMs = 60 * minuteMs
3
+ export const dayMs = 24 * hourMs
4
+
5
+ function requestError(message, statusCode = 400) {
6
+ const error = new Error(message)
7
+ error.statusCode = statusCode
8
+ return error
9
+ }
10
+
11
+ function pad(value) {
12
+ return String(value).padStart(2, '0')
13
+ }
14
+
15
+ export function formatLocalDateTime(date) {
16
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`
17
+ }
18
+
19
+ export function timeFromDate(value) {
20
+ const date = value ? new Date(value) : null
21
+ if (!date || Number.isNaN(date.getTime())) return undefined
22
+ return `${pad(date.getHours())}:${pad(date.getMinutes())}`
23
+ }
24
+
25
+ export function normalizeExecutionMode(value) {
26
+ if (value === undefined || value === null || value === '') return 'serial'
27
+ const mode = String(value)
28
+ if (mode === 'serial' || mode === 'parallel') return mode
29
+ throw requestError('executionMode must be serial or parallel')
30
+ }
31
+
32
+ export function parseExecuteTime(value) {
33
+ const text = String(value ?? '').trim()
34
+ const match = text.match(/^(\d{1,2}):(\d{2})$/)
35
+ if (!match) throw requestError('executeTime must use HH:mm format')
36
+ const hours = Number(match[1])
37
+ const minutes = Number(match[2])
38
+ if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59) {
39
+ throw requestError('executeTime is out of range')
40
+ }
41
+ return `${pad(hours)}:${pad(minutes)}`
42
+ }
43
+
44
+ function dateWithTime(base, executeTime) {
45
+ const [hours, minutes] = parseExecuteTime(executeTime).split(':').map(Number)
46
+ const date = new Date(base)
47
+ date.setHours(hours, minutes, 0, 0)
48
+ return date
49
+ }
50
+
51
+ export function nextDailyRun(executeTime, base = new Date()) {
52
+ const next = dateWithTime(base, executeTime)
53
+ if (next.getTime() <= base.getTime()) next.setDate(next.getDate() + 1)
54
+ return next
55
+ }
56
+
57
+ export function nextWeeklyRun(weekDay, executeTime, base = new Date()) {
58
+ const targetDay = Number(weekDay)
59
+ if (!Number.isInteger(targetDay) || targetDay < 0 || targetDay > 6) {
60
+ throw requestError('weekDay must be between 0 and 6')
61
+ }
62
+ const next = dateWithTime(base, executeTime)
63
+ let daysToAdd = (targetDay - next.getDay() + 7) % 7
64
+ if (daysToAdd === 0 && next.getTime() <= base.getTime()) daysToAdd = 7
65
+ next.setDate(next.getDate() + daysToAdd)
66
+ return next
67
+ }
68
+
69
+ function monthlyCandidate(year, month, monthDay, executeTime) {
70
+ const targetDay = Number(monthDay)
71
+ if (!Number.isInteger(targetDay) || targetDay < 1 || targetDay > 31) {
72
+ throw requestError('monthDay must be between 1 and 31')
73
+ }
74
+ const [hours, minutes] = parseExecuteTime(executeTime).split(':').map(Number)
75
+ const lastDay = new Date(year, month + 1, 0).getDate()
76
+ return new Date(year, month, Math.min(targetDay, lastDay), hours, minutes, 0, 0)
77
+ }
78
+
79
+ export function nextMonthlyRun(monthDay, executeTime, base = new Date()) {
80
+ let next = monthlyCandidate(base.getFullYear(), base.getMonth(), monthDay, executeTime)
81
+ if (next.getTime() <= base.getTime()) {
82
+ next = monthlyCandidate(base.getFullYear(), base.getMonth() + 1, monthDay, executeTime)
83
+ }
84
+ return next
85
+ }
86
+
87
+ function parseCronField(field, min, max) {
88
+ if (field === '*') return { any: true, values: [] }
89
+ const values = new Set()
90
+ for (const part of field.split(',')) {
91
+ if (/^\*\/\d+$/.test(part)) {
92
+ const step = Number(part.slice(2))
93
+ for (let value = min; value <= max; value += step) values.add(value)
94
+ } else if (/^\d+-\d+$/.test(part)) {
95
+ const [start, end] = part.split('-').map(Number)
96
+ for (let value = Math.max(start, min); value <= Math.min(end, max); value += 1) values.add(value)
97
+ } else if (/^\d+$/.test(part)) {
98
+ const value = Number(part)
99
+ if (value >= min && value <= max) values.add(value)
100
+ }
101
+ }
102
+ return { any: false, values: [...values] }
103
+ }
104
+
105
+ export function cronMatches(date, cronExpression) {
106
+ const fields = String(cronExpression || '').trim().split(/\s+/)
107
+ if (fields.length !== 5) return false
108
+ const checks = [
109
+ [date.getMinutes(), parseCronField(fields[0], 0, 59)],
110
+ [date.getHours(), parseCronField(fields[1], 0, 23)],
111
+ [date.getDate(), parseCronField(fields[2], 1, 31)],
112
+ [date.getMonth() + 1, parseCronField(fields[3], 1, 12)],
113
+ [date.getDay(), parseCronField(fields[4], 0, 6)],
114
+ ]
115
+ return checks.every(([value, rule]) => rule.any || rule.values.includes(value))
116
+ }
117
+
118
+ export function nextCronRun(cronExpression, base = new Date()) {
119
+ const cursor = new Date(base.getTime() + minuteMs)
120
+ cursor.setSeconds(0, 0)
121
+ const maxChecks = 366 * 24 * 60
122
+ for (let index = 0; index < maxChecks; index += 1) {
123
+ if (cronMatches(cursor, cronExpression)) return cursor
124
+ cursor.setMinutes(cursor.getMinutes() + 1)
125
+ }
126
+ return null
127
+ }
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ct as t,c as n,xt as r}from"./icons-DJqt-rnw.js";import{n as i}from"./react-vendor-CZCcjpSR.js";import{D as a,E as o,I as s,M as c,N as l,O as u,P as d,T as f,k as p}from"./index-CcGy4TXo.js";var m=e(t(),1),h=i();function g(){return{name:``,label:``,description:``,systemPrompt:``,allowedTools:[`read_file`,`grep_files`],maxRuntimeMs:`1800000`,maxToolCalls:`300`,enabledAsSubagent:!0}}function _(e){return{name:e.name,label:e.label,description:e.description??``,systemPrompt:e.systemPrompt??``,allowedTools:e.allowedTools??[],maxRuntimeMs:String(e.maxRuntimeMs??18e5),maxToolCalls:String(e.maxToolCalls??300),enabledAsSubagent:e.enabledAsSubagent}}function v(e){return{name:e.name.trim().toLowerCase(),label:e.label.trim(),description:e.description.trim(),systemPrompt:e.systemPrompt.trim(),allowedTools:e.allowedTools,maxRuntimeMs:Number(e.maxRuntimeMs||18e5),maxToolCalls:Number(e.maxToolCalls||300),enabledAsSubagent:e.enabledAsSubagent}}function y(e){return!!(e.name.trim()&&e.label.trim()&&e.allowedTools.length>0)}async function b(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`请求失败`);return r}function x(){let[e,t]=(0,m.useState)([]),[i,x]=(0,m.useState)([]),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(null),[E,D]=(0,m.useState)(()=>g()),[O,k]=(0,m.useState)(!1),[A,j]=(0,m.useState)(``),[M,N]=(0,m.useState)(!1),[P,F]=(0,m.useState)(),[I,L]=(0,m.useState)(`off`),[R,z]=(0,m.useState)(``);async function B(){let[e,n]=await Promise.all([b(`/api/agent-profiles`),b(`/api/agent-profiles/available-tools`)]);t(e.agents),x(n.tools)}(0,m.useEffect)(()=>{let e=!1;async function n(){try{let[n,r]=await Promise.all([b(`/api/agent-profiles`),b(`/api/agent-profiles/available-tools`)]);if(e)return;t(n.agents),x(r.tools)}catch(t){e||z(t instanceof Error?t.message:s(`requestFailed`))}}return n(),()=>{e=!0}},[]),(0,m.useEffect)(()=>{let e=!1;async function t(){try{let t=await a(),n=await o(t),r=await u(t),i=r.model??await p(t)??n[0];if(e)return;F(i),L(r.thinkingLevel??f(i))}catch{}}return t(),()=>{e=!0}},[]);let V=(0,m.useMemo)(()=>e.find(e=>e.id===w)??null,[e,w]);function H(e,t){D(n=>({...n,[e]:t}))}function U(e){D(t=>({...t,allowedTools:t.allowedTools.includes(e)?t.allowedTools.filter(t=>t!==e):[...t.allowedTools,e]}))}function W(){T(null),D(g()),j(``),z(``),C(!0)}function G(e){T(e.id),D(_(e)),j(``),z(``),C(!0)}function K(){O||M||(C(!1),T(null),D(g()),j(``))}async function q(){let e=A.trim();if(!e){z(s(`aiFillAgentInputRequired`));return}if(!P){z(s(`aiFillAgentNoModel`));return}N(!0),z(``);try{let t=await b(`/api/agent-profiles/ai-fill`,{method:`POST`,body:JSON.stringify({instruction:e,model:P,thinkingLevel:I})});D(e=>({...e,name:t.agent.name,label:t.agent.label,description:t.agent.description,systemPrompt:t.agent.systemPrompt}))}catch(e){z(e instanceof Error?e.message:s(`aiFillAgentFailed`))}finally{N(!1)}}async function J(){if(y(E)){k(!0),z(``);try{let e=v(E);w?await b(`/api/agent-profiles/${encodeURIComponent(w)}`,{method:`PATCH`,body:JSON.stringify(e)}):await b(`/api/agent-profiles`,{method:`POST`,body:JSON.stringify(e)}),K(),await B()}catch(e){z(e instanceof Error?e.message:s(`requestFailed`))}finally{k(!1)}}}async function Y(e){if(!(e.builtin||e.readonly)&&await c({description:s(`confirmDeleteAgent`),confirmLabel:s(`confirmDelete`),cancelLabel:s(`cancel`),variant:`destructive`})){z(``);try{await b(`/api/agent-profiles/${encodeURIComponent(e.id)}`,{method:`DELETE`}),await B()}catch(e){z(e instanceof Error?e.message:s(`requestFailed`))}}}return(0,h.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,h.jsx)(r,{className:`size-5`})}),(0,h.jsx)(`div`,{children:(0,h.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[s(`agentsTab`),(0,h.jsx)(l,{label:s(`agentsDescription`)})]})})]}),(0,h.jsx)(d,{onClick:W,children:s(`createAgent`)})]})}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[R&&!S?(0,h.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:R}):null,(0,h.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:e.map(e=>(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.label}),e.builtin?(0,h.jsx)(`span`,{className:`rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary`,children:s(`builtinAgent`)}):null,e.enabledAsSubagent?(0,h.jsx)(`span`,{className:`rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs text-emerald-700`,children:s(`enabledAsSubagent`)}):null]}),(0,h.jsx)(`p`,{className:`mt-1 font-mono text-xs text-muted-foreground`,children:e.name}),e.source&&!e.builtin?(0,h.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.source,e.relativePath?` · ${e.relativePath}`:``]}):null,(0,h.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description||s(`noDescription`)})]}),(0,h.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,h.jsx)(d,{variant:`outline`,size:`sm`,disabled:e.builtin||e.readonly,onClick:()=>G(e),children:s(`editTask`)}),(0,h.jsx)(d,{variant:`destructive`,size:`sm`,disabled:e.builtin||e.readonly,onClick:()=>void Y(e),children:s(`delete`)})]})]}),(0,h.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:e.allowedTools.map(e=>(0,h.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground`,children:e},e))}),(0,h.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,h.jsxs)(`span`,{children:[s(`maxRuntimeMs`),e.maxRuntimeMs??`-`]}),(0,h.jsxs)(`span`,{children:[s(`maxToolCalls`),e.maxToolCalls??`-`]})]})]},e.id))})]})}),S?(0,h.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&K()},children:(0,h.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,h.jsxs)(`div`,{className:`shrink-0 border-b border-border px-5 py-4`,children:[(0,h.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:s(V?`editAgent`:`createAgent`)}),V?.readonly?(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:s(`builtinAgentReadonly`)}):null]}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`rounded-2xl border border-border bg-muted/20 p-3`,children:[(0,h.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,h.jsx)(n,{className:`size-4 text-primary`}),s(`aiFillAgent`),(0,h.jsx)(l,{label:s(`aiFillAgentDescription`)})]}),(0,h.jsx)(`textarea`,{className:`min-h-20 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring disabled:opacity-60`,value:A,disabled:!!V?.readonly||M,onChange:e=>j(e.target.value),placeholder:s(`aiFillAgentPlaceholder`)}),(0,h.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,h.jsxs)(d,{variant:`outline`,size:`sm`,onClick:()=>void q(),disabled:!!V?.readonly||M||!A.trim(),children:[(0,h.jsx)(n,{className:`mr-1 size-3.5`}),s(M?`aiFillAgentLoading`:`aiFillAgent`)]})})]}),(0,h.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`agentName`),(0,h.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.name,disabled:!!V?.readonly,onChange:e=>H(`name`,e.target.value),placeholder:`reviewer`})]}),(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`agentLabel`),(0,h.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.label,disabled:!!V?.readonly,onChange:e=>H(`label`,e.target.value),placeholder:s(`agentLabelPlaceholder`)})]})]}),(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`agentDescription`),(0,h.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.description,disabled:!!V?.readonly,onChange:e=>H(`description`,e.target.value)})]}),(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`agentSystemPrompt`),(0,h.jsx)(`textarea`,{className:`mt-1 min-h-36 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.systemPrompt,disabled:!!V?.readonly,onChange:e=>H(`systemPrompt`,e.target.value)})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-2 text-sm font-medium text-foreground`,children:s(`allowedTools`)}),(0,h.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:i.map(e=>(0,h.jsxs)(`label`,{className:`flex items-start gap-2 rounded-xl border border-border bg-muted/20 p-3 text-sm disabled:opacity-60`,children:[(0,h.jsx)(`input`,{type:`checkbox`,className:`mt-1`,disabled:!!V?.readonly,checked:E.allowedTools.includes(e.name),onChange:()=>U(e.name)}),(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,h.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:e.name}),e.riskLevel===`dangerous`?(0,h.jsx)(`span`,{className:`ml-2 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-700`,children:s(`highRiskTool`)}):null,(0,h.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]})]},e.name))})]}),(0,h.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`maxRuntimeMs`),(0,h.jsx)(`input`,{type:`number`,className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.maxRuntimeMs,disabled:!!V?.readonly,onChange:e=>H(`maxRuntimeMs`,e.target.value)})]}),(0,h.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[s(`maxToolCalls`),(0,h.jsx)(`input`,{type:`number`,className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:E.maxToolCalls,disabled:!!V?.readonly,onChange:e=>H(`maxToolCalls`,e.target.value)})]})]}),(0,h.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:E.enabledAsSubagent,disabled:!!V?.readonly,onChange:e=>H(`enabledAsSubagent`,e.target.checked)}),s(`enabledAsSubagent`)]}),R?(0,h.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:R}):null]})}),(0,h.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,h.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,h.jsx)(d,{variant:`outline`,onClick:K,disabled:O||M,children:s(`cancel`)}),(0,h.jsx)(d,{onClick:J,disabled:O||M||!!V?.readonly||!y(E),children:s(`save`)})]})})]})}):null]})}export{x as AgentProfilesPage};