@vibe-forge/client 0.7.4 → 0.8.1
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.
- package/cli.cjs +16 -17
- package/dist/assets/{arc-DXs6SvQX.js → arc-D8jtzr3m.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-h-xVkbzT.js → blockDiagram-c4efeb88-BJgpwJDu.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-DEumwLCr.js → c4Diagram-c83219d4-D1tglS7Y.js} +1 -1
- package/dist/assets/channel-5WTe7pNn.js +1 -0
- package/dist/assets/{classDiagram-beda092f-Dh_6VL8e.js → classDiagram-beda092f-D0yKhAEF.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-D9hG_V5y.js → classDiagram-v2-2358418a-HMGLB-Su.js} +1 -1
- package/dist/assets/clone-LappdaLy.js +1 -0
- package/dist/assets/{createText-1719965b-DGO5tdKk.js → createText-1719965b-CdcVoxJT.js} +1 -1
- package/dist/assets/{edges-96097737-63FzeZDk.js → edges-96097737-D8eSYgyp.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-jN2RzBTN.js → erDiagram-0228fc6a-Cz1bZvQg.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-CvND0Kz-.js → flowDb-c6c81e3f-2Q7aPB-q.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-jtMtLi5z.js → flowDiagram-50d868cf-CADXtRSY.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-VWENAHeD.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-Dic1wweO.js → flowchart-elk-definition-6af322e1-H7s8F7AZ.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-BLbYj7ru.js → ganttDiagram-a2739b55-ByPQlmCo.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-Dm4ee53U.js → gitGraphDiagram-82fe8481-BZVM0Fl8.js} +1 -1
- package/dist/assets/{graph-BnzAin3i.js → graph-ClMJH_U-.js} +1 -1
- package/dist/assets/{index-5325376f-gU7GGRnq.js → index-5325376f-HWUtfpil.js} +1 -1
- package/dist/assets/{index-BRIfON-w.css → index-DGEAe87I.css} +1 -1
- package/dist/assets/index-NlU1ELyk.js +557 -0
- package/dist/assets/{infoDiagram-8eee0895-BI_1UH70.js → infoDiagram-8eee0895-wi7-H9nz.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-Xc6td0Nk.js → journeyDiagram-c64418c1-CZCyqk1X.js} +1 -1
- package/dist/assets/{layout-PHWoi3a3.js → layout-CONWz1Dx.js} +1 -1
- package/dist/assets/{line-BJPgSD92.js → line-ugjigc8g.js} +1 -1
- package/dist/assets/{linear-DYKGy-mG.js → linear-CziOoP7o.js} +1 -1
- package/dist/assets/material-symbols-rounded-Cc81OfR0.woff2 +0 -0
- package/dist/assets/{mermaid.core-H3QJi-7A.js → mermaid.core-8jQ7wVtv.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-UC--JAZa.js → mindmap-definition-8da855dc-74YgrTXA.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-BTI_-cYX.js → pieDiagram-a8764435-9MHYBe77.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-C4Gf_SaX.js → quadrantDiagram-1e28029f-T47Rsmlf.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-BKwfGAsO.js → requirementDiagram-08caed73-DxX3Lp0B.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-DTp2p2pD.js → sankeyDiagram-a04cb91d-DtlrXeOV.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-CLuNEegU.js → sequenceDiagram-c5b8d532-0e8o5pPE.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-BUofUUM6.js → stateDiagram-1ecb1508-Uif8hYjc.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-BATuZH_y.js → stateDiagram-v2-c2b004d7-D8sWSYsQ.js} +1 -1
- package/dist/assets/{styles-b4e223ce-CVO41uVV.js → styles-b4e223ce-D43vhmWC.js} +1 -1
- package/dist/assets/{styles-ca3715f6-fFE_-gsH.js → styles-ca3715f6-DWma2mkN.js} +1 -1
- package/dist/assets/{styles-d45a18b0-BeG4Dd2L.js → styles-d45a18b0-kT58cZYw.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-D6PZVIuy.js → svgDrawCommon-b86b1483-D5ltvlh8.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-CTFMc2GO.js → timeline-definition-faaaa080-PXG_aexc.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-wWcw3yKn.js → xychartDiagram-f5964ef8-qTUp7CdK.js} +1 -1
- package/dist/index.html +2 -12
- package/index.html +0 -10
- package/package.json +10 -8
- package/src/App.tsx +1 -1
- package/src/api/base.ts +7 -7
- package/src/api/benchmark.ts +7 -3
- package/src/api/config.ts +2 -1
- package/src/api.ts +1 -1
- package/src/assets/fonts/material-symbols-rounded.woff2 +0 -0
- package/src/components/ArchiveView.tsx +1 -1
- package/src/components/ConfigView.tsx +18 -6
- package/src/components/MarkdownContent.tsx +1 -1
- package/src/components/Sidebar.tsx +2 -2
- package/src/components/automation-view/RuleFormPanel.tsx +7 -5
- package/src/components/automation-view/TaskList.tsx +8 -5
- package/src/components/automation-view/TriggerList.tsx +25 -15
- package/src/components/automation-view/types.ts +1 -1
- package/src/components/benchmark-view/BenchmarkCasePanel.tsx +94 -94
- package/src/components/benchmark-view/BenchmarkSidebar.scss +8 -6
- package/src/components/benchmark-view/BenchmarkSidebar.tsx +43 -30
- package/src/components/benchmark-view/index.tsx +4 -2
- package/src/components/benchmark-view/types.ts +3 -2
- package/src/components/benchmark-view/utils.ts +1 -2
- package/src/components/chat/ChatHeader.tsx +1 -1
- package/src/components/chat/ChatHistoryView.tsx +3 -2
- package/src/components/chat/CurrentTodoList.tsx +2 -3
- package/src/components/chat/messages/MessageItem.tsx +15 -14
- package/src/components/chat/messages/message-utils.ts +1 -1
- package/src/components/chat/sender/Sender.scss +8 -3
- package/src/components/chat/sender/Sender.tsx +71 -22
- package/src/components/chat/session-timeline-panel/git-graph.ts +8 -1
- package/src/components/chat/session-timeline-panel/index.scss +2 -2
- package/src/components/chat/tools/DefaultTool.tsx +3 -3
- package/src/components/chat/tools/adapter-claude/BashTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/GlobTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/GrepTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/LSTool.tsx +4 -4
- package/src/components/chat/tools/adapter-claude/ReadTool.scss +1 -2
- package/src/components/chat/tools/adapter-claude/ReadTool.tsx +3 -3
- package/src/components/chat/tools/adapter-claude/TodoTool.tsx +1 -1
- package/src/components/chat/tools/adapter-claude/WriteTool.tsx +2 -2
- package/src/components/chat/tools/adapter-claude/components/FileList.scss +4 -2
- package/src/components/chat/tools/core/ToolCallBox.scss +34 -35
- package/src/components/chat/tools/core/ToolGroup.tsx +5 -5
- package/src/components/chat/tools/plugin-chrome-devtools/ChromeDevtoolsTool.tsx +1 -1
- package/src/components/chat/tools/task/GetTaskInfoTool.tsx +1 -1
- package/src/components/chat/tools/task/StartTasksTool.tsx +2 -2
- package/src/components/chat/tools/task/components/TaskRow.tsx +4 -4
- package/src/components/chat/tools/task/components/TaskToolCard.tsx +4 -4
- package/src/components/config/ConfigAboutSection.tsx +1 -1
- package/src/components/config/ConfigSectionForm.tsx +2 -1
- package/src/components/config/ConfigSectionPanel.tsx +1 -1
- package/src/components/config/ConfigShortcutInput.scss +1 -1
- package/src/components/config/ConfigSourceSwitch.tsx +1 -1
- package/src/components/config/configSchema.ts +16 -1
- package/src/components/config/index.tsx +1 -1
- package/src/components/config/record-editors/McpServersRecordEditor.tsx +125 -123
- package/src/components/config/record-editors/ModelServicesRecordEditor.tsx +138 -136
- package/src/components/config/record-editors/RecordJsonEditor.tsx +31 -29
- package/src/components/config/record-editors/index.tsx +1 -1
- package/src/components/knowledge-base/components/EmptyState.tsx +1 -1
- package/src/components/knowledge-base/components/EntitiesTab.tsx +2 -2
- package/src/components/knowledge-base/components/EntityItem.tsx +1 -1
- package/src/components/knowledge-base/components/EntityList.tsx +1 -1
- package/src/components/knowledge-base/components/FilterBar.tsx +2 -2
- package/src/components/knowledge-base/components/FlowsTab.tsx +1 -1
- package/src/components/knowledge-base/components/KnowledgeList.tsx +1 -1
- package/src/components/knowledge-base/components/MetaList.tsx +1 -1
- package/src/components/knowledge-base/components/RuleItem.tsx +1 -1
- package/src/components/knowledge-base/components/RuleList.tsx +1 -1
- package/src/components/knowledge-base/components/RulesTab.tsx +3 -3
- package/src/components/knowledge-base/components/SectionHeader.tsx +1 -1
- package/src/components/knowledge-base/components/SkillsTab.tsx +3 -3
- package/src/components/knowledge-base/components/SpecItem.tsx +1 -1
- package/src/components/knowledge-base/components/SpecList.tsx +1 -1
- package/src/components/knowledge-base/components/TabContent.tsx +1 -1
- package/src/components/knowledge-base/components/TabLabel.tsx +1 -1
- package/src/components/sidebar/SessionItem.scss +0 -1
- package/src/components/sidebar/SessionItem.tsx +1 -1
- package/src/hooks/chat/model-selector.ts +115 -121
- package/src/hooks/chat/use-chat-adapter.ts +3 -3
- package/src/hooks/chat/use-chat-interaction.ts +1 -1
- package/src/hooks/chat/use-chat-model-adapter-selection.tsx +549 -0
- package/src/hooks/chat/use-chat-models.tsx +7 -2
- package/src/hooks/chat/use-chat-permission-mode.ts +5 -1
- package/src/hooks/chat/use-chat-session-messages.ts +2 -2
- package/src/hooks/chat/use-chat-session.ts +14 -12
- package/src/hooks/chat/use-chat-view.ts +1 -1
- package/src/hooks/use-app-preferences.ts +14 -4
- package/src/hooks/use-session-subscription.ts +17 -6
- package/src/hooks/useQueryParams.ts +8 -6
- package/src/main.tsx +1 -0
- package/src/resources/adapters.ts +8 -2
- package/src/resources/locales/en.json +14 -1
- package/src/resources/locales/zh.json +14 -1
- package/src/routes/ChatRoute.scss +5 -1
- package/src/runtime-config.ts +17 -13
- package/src/styles/material-symbols-rounded.scss +23 -0
- package/src/utils/shortcutUtils.ts +1 -1
- package/vite.config.ts +5 -0
- package/dist/assets/channel-Hxo8SEEx.js +0 -1
- package/dist/assets/clone-Dd_kUYh5.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-CmztIxNZ.js +0 -1
- package/dist/assets/index-Cw-fkktx.js +0 -557
package/dist/assets/{xychartDiagram-f5964ef8-wWcw3yKn.js → xychartDiagram-f5964ef8-qTUp7CdK.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as zt,a as Ft,v as wt,x as Nt,b as Xt,c as Yt,l as St,aH as Ht,e as $t,z as Ut,ap as ot,aJ as Ct,aL as qt,aY as jt,i as Gt}from"./mermaid.core-
|
|
1
|
+
import{s as zt,a as Ft,v as wt,x as Nt,b as Xt,c as Yt,l as St,aH as Ht,e as $t,z as Ut,ap as ot,aJ as Ct,aL as qt,aY as jt,i as Gt}from"./mermaid.core-8jQ7wVtv.js";import{a as Qt}from"./createText-1719965b-CdcVoxJT.js";import"./index-NlU1ELyk.js";import{i as Kt}from"./init-Gi6I4Gst.js";import{o as Jt}from"./ordinal-Cboi1Yqb.js";import{l as ft}from"./linear-CziOoP7o.js";import{l as pt}from"./line-ugjigc8g.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";function Zt(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function st(){var e=Jt().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,c,f=!1,d=0,R=0,_=.5;delete e.unknown;function A(){var m=t().length,T=n<s,S=T?n:s,P=T?s:n;o=(P-S)/Math.max(1,m-d+R*2),f&&(o=Math.floor(o)),S+=(P-S-o*(m-d))*_,c=o*(1-d),f&&(S=Math.round(S),c=Math.round(c));var p=Zt(m).map(function(C){return S+o*C});return i(T?p.reverse():p)}return e.domain=function(m){return arguments.length?(t(m),A()):t()},e.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,A()):[s,n]},e.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,f=!0,A()},e.bandwidth=function(){return c},e.step=function(){return o},e.round=function(m){return arguments.length?(f=!!m,A()):f},e.padding=function(m){return arguments.length?(d=Math.min(1,R=+m),A()):d},e.paddingInner=function(m){return arguments.length?(d=Math.min(1,m),A()):d},e.paddingOuter=function(m){return arguments.length?(R=+m,A()):R},e.align=function(m){return arguments.length?(_=Math.max(0,Math.min(1,m)),A()):_},e.copy=function(){return st(t(),[s,n]).round(f).paddingInner(d).paddingOuter(R).align(_)},Kt.apply(A(),arguments)}var nt=function(){var e=function(V,r,l,u){for(l=l||{},u=V.length;u--;l[V[u]]=r);return l},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],c=[1,7],f=[1,5,10,12,14,16,18,19,21,23,34,35,36],d=[1,25],R=[1,26],_=[1,28],A=[1,29],m=[1,30],T=[1,31],S=[1,32],P=[1,33],p=[1,34],C=[1,35],h=[1,36],L=[1,37],z=[1,43],lt=[1,42],ct=[1,47],$=[1,50],w=[1,10,12,14,16,18,19,21,23,34,35,36],Q=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],v=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],ut=[1,64],K={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(r,l,u,g,b,a,F){var x=a.length-1;switch(b){case 5:g.setOrientation(a[x]);break;case 9:g.setDiagramTitle(a[x].text.trim());break;case 12:g.setLineData({text:"",type:"text"},a[x]);break;case 13:g.setLineData(a[x-1],a[x]);break;case 14:g.setBarData({text:"",type:"text"},a[x]);break;case 15:g.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),g.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),g.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:g.setXAxisTitle(a[x]);break;case 23:g.setXAxisTitle(a[x-1]);break;case 24:g.setXAxisTitle({type:"text",text:""});break;case 25:g.setXAxisBand(a[x]);break;case 26:g.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:g.setYAxisTitle(a[x]);break;case 31:g.setYAxisTitle(a[x-1]);break;case 32:g.setYAxisTitle({type:"text",text:""});break;case 33:g.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:c}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:c}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:c}),{1:[2,3]},e(f,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:c}),{11:23,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:39,13:38,24:z,27:lt,29:40,30:41,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:45,15:44,27:ct,33:46,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:49,17:48,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{11:52,17:51,24:$,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},{20:[1,53]},{22:[1,54]},e(w,[2,18]),{1:[2,2]},e(w,[2,8]),e(w,[2,9]),e(Q,[2,37],{40:55,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L}),e(Q,[2,38]),e(Q,[2,39]),e(v,[2,40]),e(v,[2,42]),e(v,[2,43]),e(v,[2,44]),e(v,[2,45]),e(v,[2,46]),e(v,[2,47]),e(v,[2,48]),e(v,[2,49]),e(v,[2,50]),e(v,[2,51]),e(w,[2,10]),e(w,[2,22],{30:41,29:56,24:z,27:lt}),e(w,[2,24]),e(w,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,11]),e(w,[2,30],{33:60,27:ct}),e(w,[2,32]),{31:[1,61]},e(w,[2,12]),{17:62,24:$},{25:63,27:ut},e(w,[2,14]),{17:65,24:$},e(w,[2,16]),e(w,[2,17]),e(v,[2,41]),e(w,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(w,[2,31]),{27:[1,69]},e(w,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(w,[2,15]),e(w,[2,26]),e(w,[2,27]),{11:59,32:72,37:24,38:d,39:R,40:27,41:_,42:A,43:m,44:T,45:S,46:P,47:p,48:C,49:h,50:L},e(w,[2,33]),e(w,[2,19]),{25:73,27:ut},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(r,l){if(l.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=l,u}},parse:function(r){var l=this,u=[0],g=[],b=[null],a=[],F=this.table,x="",U=0,gt=0,Vt=2,xt=1,Bt=a.slice.call(arguments,1),k=Object.create(this.lexer),B={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(B.yy[Z]=this.yy[Z]);k.setInput(r,B.yy),B.yy.lexer=k,B.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var tt=k.yylloc;a.push(tt);var Wt=k.options&&k.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ot(){var I;return I=g.pop()||k.lex()||xt,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=l.symbols_[I]||I),I}for(var D,W,E,it,O={},q,M,dt,j;;){if(W=u[u.length-1],this.defaultActions[W]?E=this.defaultActions[W]:((D===null||typeof D>"u")&&(D=Ot()),E=F[W]&&F[W][D]),typeof E>"u"||!E.length||!E[0]){var et="";j=[];for(q in F[W])this.terminals_[q]&&q>Vt&&j.push("'"+this.terminals_[q]+"'");k.showPosition?et="Parse error on line "+(U+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+j.join(", ")+", got '"+(this.terminals_[D]||D)+"'":et="Parse error on line "+(U+1)+": Unexpected "+(D==xt?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(et,{text:k.match,token:this.terminals_[D]||D,line:k.yylineno,loc:tt,expected:j})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+D);switch(E[0]){case 1:u.push(D),b.push(k.yytext),a.push(k.yylloc),u.push(E[1]),D=null,gt=k.yyleng,x=k.yytext,U=k.yylineno,tt=k.yylloc;break;case 2:if(M=this.productions_[E[1]][1],O.$=b[b.length-M],O._$={first_line:a[a.length-(M||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(M||1)].first_column,last_column:a[a.length-1].last_column},Wt&&(O._$.range=[a[a.length-(M||1)].range[0],a[a.length-1].range[1]]),it=this.performAction.apply(O,[x,gt,U,B.yy,E[1],b,a].concat(Bt)),typeof it<"u")return it;M&&(u=u.slice(0,-1*M*2),b=b.slice(0,-1*M),a=a.slice(0,-1*M)),u.push(this.productions_[E[1]][0]),b.push(O.$),a.push(O._$),dt=F[u[u.length-2]][u[u.length-1]],u.push(dt);break;case 3:return!0}}return!0}},It=function(){var V={EOF:1,parseError:function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},setInput:function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var l=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===g.length?this.yylloc.first_column:0)+g[g.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -4,18 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Vibe Forge Web</title>
|
|
7
|
-
<
|
|
8
|
-
<link rel="
|
|
9
|
-
<link
|
|
10
|
-
href="https://fonts.googleapis.com/icon?family=Material+Icons+Rounded"
|
|
11
|
-
rel="stylesheet"
|
|
12
|
-
>
|
|
13
|
-
<link
|
|
14
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
|
15
|
-
rel="stylesheet"
|
|
16
|
-
>
|
|
17
|
-
<script type="module" crossorigin src="/__VF_PROJECT_AI_CLIENT_BASE__/assets/index-Cw-fkktx.js"></script>
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/__VF_PROJECT_AI_CLIENT_BASE__/assets/index-BRIfON-w.css">
|
|
7
|
+
<script type="module" crossorigin src="/__VF_PROJECT_AI_CLIENT_BASE__/assets/index-NlU1ELyk.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/__VF_PROJECT_AI_CLIENT_BASE__/assets/index-DGEAe87I.css">
|
|
19
9
|
</head>
|
|
20
10
|
<body>
|
|
21
11
|
<div id="root"></div>
|
package/index.html
CHANGED
|
@@ -4,16 +4,6 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Vibe Forge Web</title>
|
|
7
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
-
<link
|
|
10
|
-
href="https://fonts.googleapis.com/icon?family=Material+Icons+Rounded"
|
|
11
|
-
rel="stylesheet"
|
|
12
|
-
>
|
|
13
|
-
<link
|
|
14
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
|
15
|
-
rel="stylesheet"
|
|
16
|
-
>
|
|
17
7
|
</head>
|
|
18
8
|
<body>
|
|
19
9
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-forge/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#~/*": [
|
|
7
7
|
"./src/*",
|
|
@@ -36,13 +36,15 @@
|
|
|
36
36
|
"swr": "^2.2.5",
|
|
37
37
|
"vite": "^5.4.8",
|
|
38
38
|
"zod": "^3.24.1",
|
|
39
|
-
"@vibe-forge/
|
|
40
|
-
"@vibe-forge/adapter-
|
|
41
|
-
"@vibe-forge/adapter-
|
|
42
|
-
"@vibe-forge/
|
|
43
|
-
"@vibe-forge/
|
|
44
|
-
"@vibe-forge/
|
|
45
|
-
"@vibe-forge/
|
|
39
|
+
"@vibe-forge/adapter-codex": "^0.8.0",
|
|
40
|
+
"@vibe-forge/adapter-claude-code": "^0.8.0",
|
|
41
|
+
"@vibe-forge/adapter-opencode": "^0.8.0",
|
|
42
|
+
"@vibe-forge/channel-lark": "^0.8.0",
|
|
43
|
+
"@vibe-forge/core": "^0.8.0",
|
|
44
|
+
"@vibe-forge/register": "^0.8.0",
|
|
45
|
+
"@vibe-forge/utils": "^0.8.0",
|
|
46
|
+
"@vibe-forge/plugin-chrome-devtools": "^0.8.0",
|
|
47
|
+
"@vibe-forge/types": "^0.8.0"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@types/react": "^18.3.12",
|
package/src/App.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfigProvider } from 'antd'
|
|
2
2
|
|
|
3
3
|
import { AppShell } from '#~/components/layout/AppShell'
|
|
4
|
-
import { useSessionSubscription } from '#~/hooks/use-session-subscription.js'
|
|
5
4
|
import { useAppPreferences } from '#~/hooks/use-app-preferences'
|
|
5
|
+
import { useSessionSubscription } from '#~/hooks/use-session-subscription.js'
|
|
6
6
|
import { useSidebarNavigation } from '#~/hooks/use-sidebar-navigation'
|
|
7
7
|
import { AppRoutes } from '#~/routes/AppRoutes'
|
|
8
8
|
|
package/src/api/base.ts
CHANGED
|
@@ -71,11 +71,11 @@ const isApiSuccessEnvelope = <T>(value: unknown): value is ApiSuccessEnvelope<T>
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const isApiErrorEnvelope = (value: unknown): value is ApiErrorEnvelope => {
|
|
74
|
-
return isRecord(value)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
return isRecord(value) &&
|
|
75
|
+
value.success === false &&
|
|
76
|
+
isRecord(value.error) &&
|
|
77
|
+
typeof value.error.message === 'string' &&
|
|
78
|
+
typeof value.error.code === 'string'
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
const parseResponseBody = async (res: Response): Promise<unknown> => {
|
|
@@ -99,8 +99,8 @@ const toApiError = (status: number, body: unknown, fallbackMessage: string) => {
|
|
|
99
99
|
const message = typeof body.error === 'string'
|
|
100
100
|
? body.error
|
|
101
101
|
: typeof body.message === 'string'
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
? body.message
|
|
103
|
+
: fallbackMessage
|
|
104
104
|
const code = typeof body.code === 'string' ? body.code : 'request_failed'
|
|
105
105
|
return new ApiError(status, {
|
|
106
106
|
code,
|
package/src/api/benchmark.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BenchmarkCase, BenchmarkCategory, BenchmarkResult, BenchmarkRunSummary } from '@vibe-forge/
|
|
1
|
+
import type { BenchmarkCase, BenchmarkCategory, BenchmarkResult, BenchmarkRunSummary } from '@vibe-forge/types'
|
|
2
2
|
|
|
3
3
|
import { createApiUrl, fetchApiJson, fetchApiJsonOrThrow, jsonHeaders } from './base'
|
|
4
4
|
|
|
@@ -25,11 +25,15 @@ export async function listBenchmarkCases(category?: string): Promise<{ cases: Be
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export async function getBenchmarkCase(category: string, title: string): Promise<{ case: BenchmarkCase }> {
|
|
28
|
-
return fetchApiJson<{ case: BenchmarkCase }>(
|
|
28
|
+
return fetchApiJson<{ case: BenchmarkCase }>(
|
|
29
|
+
`/api/benchmark/cases/${encodeURIComponent(category)}/${encodeURIComponent(title)}`
|
|
30
|
+
)
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export async function getBenchmarkResult(category: string, title: string): Promise<{ result: BenchmarkResult }> {
|
|
32
|
-
return fetchApiJson<{ result: BenchmarkResult }>(
|
|
34
|
+
return fetchApiJson<{ result: BenchmarkResult }>(
|
|
35
|
+
`/api/benchmark/results/${encodeURIComponent(category)}/${encodeURIComponent(title)}`
|
|
36
|
+
)
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export async function startBenchmarkRun(payload: BenchmarkRunRequest): Promise<{ run: BenchmarkRunSummary }> {
|
package/src/api/config.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConfigSource } from '@vibe-forge/core'
|
|
2
|
+
import type { ConfigResponse } from '@vibe-forge/types'
|
|
2
3
|
|
|
3
4
|
import { fetchApiJson, fetchApiJsonOrThrow, jsonHeaders } from './base'
|
|
4
5
|
import type { ApiOkResponse } from './types'
|
package/src/api.ts
CHANGED
|
@@ -43,4 +43,4 @@ export {
|
|
|
43
43
|
// 基础响应类型与会话交互类型
|
|
44
44
|
export type { ApiOkResponse, ApiRemoveResponse, SessionInteraction, SessionMessagesResponse } from './api/types'
|
|
45
45
|
|
|
46
|
-
export type { BenchmarkCase, BenchmarkCategory, BenchmarkResult, BenchmarkRunSummary } from '@vibe-forge/
|
|
46
|
+
export type { BenchmarkCase, BenchmarkCategory, BenchmarkResult, BenchmarkRunSummary } from '@vibe-forge/types'
|
|
Binary file
|
|
@@ -246,7 +246,7 @@ export function ArchiveView() {
|
|
|
246
246
|
</span>
|
|
247
247
|
{session.tags && session.tags.length > 0 && (
|
|
248
248
|
<div className='archive-view__item-tags'>
|
|
249
|
-
{session.tags.map(tag => (
|
|
249
|
+
{session.tags.map((tag: string) => (
|
|
250
250
|
<Tag key={tag} className='archive-view__item-tag'>{tag}</Tag>
|
|
251
251
|
))}
|
|
252
252
|
</div>
|
|
@@ -5,7 +5,8 @@ import { useEffect, useMemo, useRef, useState } from 'react'
|
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
6
6
|
import useSWR from 'swr'
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { ConfigSource } from '@vibe-forge/core'
|
|
9
|
+
import type { AboutInfo, ConfigResponse } from '@vibe-forge/types'
|
|
9
10
|
|
|
10
11
|
import { getApiErrorMessage, getConfig, updateConfig } from '../api'
|
|
11
12
|
import { useQueryParams } from '../hooks/useQueryParams'
|
|
@@ -19,7 +20,7 @@ export function ConfigView() {
|
|
|
19
20
|
const { data, isLoading, error, mutate } = useSWR<ConfigResponse>('/api/config', getConfig)
|
|
20
21
|
const { values: queryValues, update: updateQuery, searchParams } = useQueryParams<{ tab: string; source: string }>({
|
|
21
22
|
keys: ['tab', 'source'],
|
|
22
|
-
defaults: { tab: 'general', source: 'project' }
|
|
23
|
+
defaults: { tab: 'general', source: 'project' }
|
|
23
24
|
})
|
|
24
25
|
const sourceKey: ConfigSource = queryValues.source === 'user' ? 'user' : 'project'
|
|
25
26
|
const setSourceKey = (next: ConfigSource) => updateQuery({ source: next })
|
|
@@ -50,6 +51,7 @@ export function ConfigView() {
|
|
|
50
51
|
new Set([
|
|
51
52
|
'general',
|
|
52
53
|
'conversation',
|
|
54
|
+
'models',
|
|
53
55
|
'modelServices',
|
|
54
56
|
'channels',
|
|
55
57
|
'adapters',
|
|
@@ -67,6 +69,12 @@ export function ConfigView() {
|
|
|
67
69
|
label: t('config.sections.conversation'),
|
|
68
70
|
value: currentSource?.conversation
|
|
69
71
|
},
|
|
72
|
+
{
|
|
73
|
+
key: 'models',
|
|
74
|
+
icon: 'tune',
|
|
75
|
+
label: t('config.sections.models'),
|
|
76
|
+
value: currentSource?.models
|
|
77
|
+
},
|
|
70
78
|
{
|
|
71
79
|
key: 'modelServices',
|
|
72
80
|
icon: 'model_training',
|
|
@@ -236,7 +244,7 @@ export function ConfigView() {
|
|
|
236
244
|
mergedAdapters={mergedAdapters as Record<string, unknown>}
|
|
237
245
|
selectedModelService={selectedModelService}
|
|
238
246
|
t={t}
|
|
239
|
-
headerExtra={
|
|
247
|
+
headerExtra={
|
|
240
248
|
<Space size={12}>
|
|
241
249
|
<ConfigSourceSwitch
|
|
242
250
|
value={sourceKey}
|
|
@@ -245,17 +253,21 @@ export function ConfigView() {
|
|
|
245
253
|
{
|
|
246
254
|
value: 'project',
|
|
247
255
|
icon: 'folder',
|
|
248
|
-
label: configPresent?.project === true
|
|
256
|
+
label: configPresent?.project === true
|
|
257
|
+
? t('config.sources.project')
|
|
258
|
+
: t('config.sources.projectMissing')
|
|
249
259
|
},
|
|
250
260
|
{
|
|
251
261
|
value: 'user',
|
|
252
262
|
icon: 'person',
|
|
253
|
-
label: configPresent?.user === true
|
|
263
|
+
label: configPresent?.user === true
|
|
264
|
+
? t('config.sources.user')
|
|
265
|
+
: t('config.sources.userMissing')
|
|
254
266
|
}
|
|
255
267
|
]}
|
|
256
268
|
/>
|
|
257
269
|
</Space>
|
|
258
|
-
|
|
270
|
+
}
|
|
259
271
|
/>
|
|
260
272
|
)}
|
|
261
273
|
</div>
|
|
@@ -6,8 +6,8 @@ import React, { useMemo, useRef, useState } from 'react'
|
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import useSWR from 'swr'
|
|
8
8
|
|
|
9
|
-
import type { Session } from '@vibe-forge/core'
|
|
10
9
|
import { useQueryParams } from '#~/hooks/useQueryParams.js'
|
|
10
|
+
import type { Session } from '@vibe-forge/core'
|
|
11
11
|
import { deleteSession, updateSession } from '../api'
|
|
12
12
|
import { useGlobalShortcut } from '../hooks/useGlobalShortcut'
|
|
13
13
|
import { isSidebarCollapsedAtom, isSidebarResizingAtom } from '../store/index'
|
|
@@ -67,7 +67,7 @@ export function Sidebar({
|
|
|
67
67
|
const query = searchQuery.trim().toLowerCase()
|
|
68
68
|
return sessions.filter((s: Session) => {
|
|
69
69
|
if (tagFilter) {
|
|
70
|
-
const matchesTag = (s.tags ?? []).some((tag) => tag.toLowerCase() === tagFilter.toLowerCase())
|
|
70
|
+
const matchesTag = (s.tags ?? []).some((tag: string) => tag.toLowerCase() === tagFilter.toLowerCase())
|
|
71
71
|
if (!matchesTag) return false
|
|
72
72
|
}
|
|
73
73
|
if (!query) return true
|
|
@@ -193,24 +193,24 @@ export function RuleFormPanel({ mode, rule, submitting, onSubmit, onCancel }: Ru
|
|
|
193
193
|
</div>
|
|
194
194
|
<Form.Item
|
|
195
195
|
name='name'
|
|
196
|
-
label={
|
|
196
|
+
label={
|
|
197
197
|
<span className='automation-view__label'>
|
|
198
198
|
<span className='material-symbols-rounded automation-view__label-icon'>badge</span>
|
|
199
199
|
{t('automation.ruleName')}
|
|
200
200
|
</span>
|
|
201
|
-
|
|
201
|
+
}
|
|
202
202
|
rules={[{ required: true, message: t('automation.ruleNameRequired') }]}
|
|
203
203
|
>
|
|
204
204
|
<Input />
|
|
205
205
|
</Form.Item>
|
|
206
206
|
<Form.Item
|
|
207
207
|
name='description'
|
|
208
|
-
label={
|
|
208
|
+
label={
|
|
209
209
|
<span className='automation-view__label'>
|
|
210
210
|
<span className='material-symbols-rounded automation-view__label-icon'>description</span>
|
|
211
211
|
{t('automation.ruleDescription')}
|
|
212
212
|
</span>
|
|
213
|
-
|
|
213
|
+
}
|
|
214
214
|
>
|
|
215
215
|
<Input.TextArea rows={2} />
|
|
216
216
|
</Form.Item>
|
|
@@ -226,7 +226,9 @@ export function RuleFormPanel({ mode, rule, submitting, onSubmit, onCancel }: Ru
|
|
|
226
226
|
</div>
|
|
227
227
|
<div className='automation-view__toggle-row'>
|
|
228
228
|
<span className='automation-view__toggle-label automation-view__toggle-label--run'>
|
|
229
|
-
<span className='material-symbols-rounded automation-view__label-icon automation-view__label-icon--run'>
|
|
229
|
+
<span className='material-symbols-rounded automation-view__label-icon automation-view__label-icon--run'>
|
|
230
|
+
play_circle
|
|
231
|
+
</span>
|
|
230
232
|
{t('automation.immediateRun')}
|
|
231
233
|
</span>
|
|
232
234
|
<Form.Item name='immediateRun' valuePropName='checked' noStyle>
|
|
@@ -26,10 +26,11 @@ export function TaskList() {
|
|
|
26
26
|
<Button
|
|
27
27
|
className='automation-view__icon-button'
|
|
28
28
|
type='text'
|
|
29
|
-
onClick={() =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
onClick={() =>
|
|
30
|
+
add({
|
|
31
|
+
title: t('automation.taskDefaultTitle', { index: fields.length + 1 }),
|
|
32
|
+
prompt: ''
|
|
33
|
+
})}
|
|
33
34
|
>
|
|
34
35
|
<span className='material-symbols-rounded automation-view__action-icon'>add</span>
|
|
35
36
|
</Button>
|
|
@@ -67,7 +68,9 @@ export function TaskList() {
|
|
|
67
68
|
<Input.TextArea rows={3} />
|
|
68
69
|
</Form.Item>
|
|
69
70
|
<div className='automation-view__task-index'>
|
|
70
|
-
<span className='material-symbols-rounded automation-view__task-index-icon'>
|
|
71
|
+
<span className='material-symbols-rounded automation-view__task-index-icon'>
|
|
72
|
+
format_list_numbered
|
|
73
|
+
</span>
|
|
71
74
|
{t('automation.taskIndex', { index: index + 1 })}
|
|
72
75
|
</div>
|
|
73
76
|
</div>
|
|
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'
|
|
|
7
7
|
|
|
8
8
|
import type { RuleFormValues } from './types'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface TriggerListProps {
|
|
11
11
|
form: FormInstance<RuleFormValues>
|
|
12
12
|
updateWeeklyCron: (index: number, nextDay?: string, nextTime?: string) => void
|
|
13
13
|
getWebhookUrl: (triggerId?: string, webhookKey?: string) => string
|
|
@@ -35,13 +35,14 @@ export function TriggerList({ form, updateWeeklyCron, getWebhookUrl }: TriggerLi
|
|
|
35
35
|
<Button
|
|
36
36
|
className='automation-view__icon-button'
|
|
37
37
|
type='text'
|
|
38
|
-
onClick={() =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
onClick={() =>
|
|
39
|
+
add({
|
|
40
|
+
type: 'interval',
|
|
41
|
+
intervalMinutes: 30,
|
|
42
|
+
cronExpression: '',
|
|
43
|
+
weeklyDay: '1',
|
|
44
|
+
weeklyTime: '09:00'
|
|
45
|
+
})}
|
|
45
46
|
>
|
|
46
47
|
<span className='material-symbols-rounded automation-view__action-icon'>add</span>
|
|
47
48
|
</Button>
|
|
@@ -57,15 +58,21 @@ export function TriggerList({ form, updateWeeklyCron, getWebhookUrl }: TriggerLi
|
|
|
57
58
|
shouldUpdate={(prevValues, nextValues) => {
|
|
58
59
|
const prevTrigger = prevValues.triggers?.[field.name]
|
|
59
60
|
const nextTrigger = nextValues.triggers?.[field.name]
|
|
60
|
-
return prevTrigger?.type !== nextTrigger?.type
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
return prevTrigger?.type !== nextTrigger?.type ||
|
|
62
|
+
prevTrigger?.webhookKey !== nextTrigger?.webhookKey ||
|
|
63
|
+
prevTrigger?.id !== nextTrigger?.id
|
|
63
64
|
}}
|
|
64
65
|
>
|
|
65
66
|
{(formInstance) => {
|
|
66
|
-
const triggerType = formInstance.getFieldValue([
|
|
67
|
+
const triggerType = formInstance.getFieldValue([
|
|
68
|
+
'triggers',
|
|
69
|
+
field.name,
|
|
70
|
+
'type'
|
|
71
|
+
]) as RuleFormValues['triggers'][number]['type']
|
|
67
72
|
const triggerId = formInstance.getFieldValue(['triggers', field.name, 'id']) as string | undefined
|
|
68
|
-
const webhookKey = formInstance.getFieldValue(['triggers', field.name, 'webhookKey']) as
|
|
73
|
+
const webhookKey = formInstance.getFieldValue(['triggers', field.name, 'webhookKey']) as
|
|
74
|
+
| string
|
|
75
|
+
| undefined
|
|
69
76
|
const webhookUrl = getWebhookUrl(triggerId, webhookKey)
|
|
70
77
|
return (
|
|
71
78
|
<div className='automation-view__list-item'>
|
|
@@ -151,7 +158,8 @@ export function TriggerList({ form, updateWeeklyCron, getWebhookUrl }: TriggerLi
|
|
|
151
158
|
{ label: t('automation.cronPresetWeekday9'), value: '0 9 * * 1-5' },
|
|
152
159
|
{ label: t('automation.cronPresetWeekend10'), value: '0 10 * * 6,0' }
|
|
153
160
|
]}
|
|
154
|
-
onChange={(value) =>
|
|
161
|
+
onChange={(value) =>
|
|
162
|
+
form.setFieldValue(['triggers', field.name, 'cronExpression'], value)}
|
|
155
163
|
placeholder={t('automation.cronPresetHint')}
|
|
156
164
|
allowClear
|
|
157
165
|
/>
|
|
@@ -197,7 +205,9 @@ export function TriggerList({ form, updateWeeklyCron, getWebhookUrl }: TriggerLi
|
|
|
197
205
|
void navigator.clipboard.writeText(webhookUrl)
|
|
198
206
|
}}
|
|
199
207
|
>
|
|
200
|
-
<span className='material-symbols-rounded automation-view__action-icon'>
|
|
208
|
+
<span className='material-symbols-rounded automation-view__action-icon'>
|
|
209
|
+
content_copy
|
|
210
|
+
</span>
|
|
201
211
|
</Button>
|
|
202
212
|
</Tooltip>
|
|
203
213
|
</div>
|