@ycodium-ai/plugin-redteam-model 0.2.5029 → 0.2.5177

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/assets/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- var Z=window.__ycodiumPluginHost.react;var{Activity:ye,Children:fe,Component:he,Fragment:be,Profiler:xe,PureComponent:ve,StrictMode:Se,Suspense:Ne,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:we,__COMPILER_RUNTIME:Pe,act:ke,cache:Me,cacheSignal:Re,captureOwnerStack:Ie,cloneElement:Ce,createContext:z,createElement:P,createRef:De,forwardRef:Ee,isValidElement:ze,lazy:Be,memo:Oe,startTransition:Ae,unstable_useCacheRefresh:_e,use:B,useActionState:Te,useCallback:k,useContext:Ue,useDebugValue:He,useDeferredValue:$e,useEffect:M,useEffectEvent:Ve,useId:Le,useImperativeHandle:Fe,useInsertionEffect:Ge,useLayoutEffect:je,useMemo:Xe,useOptimistic:Ye,useReducer:Ke,useRef:O,useState:y,useSyncExternalStore:qe,useTransition:Je,version:We}=Z;var{jsx:t,jsxs:a,Fragment:Ze}=window.__ycodiumPluginHost.jsxRuntime;var A=z(null);function S(e){return t(A,{value:e.bridge,children:e.children})}var ee=new Set(["Collapsible","CollapsiblePanel","CollapsibleTrigger"]);function f(e){let n=o=>{let r=B(A)?.ui?.[e];return r===void 0?ee.has(e)?P("div",{className:o.className},o.children):null:P(r,o)};return n.displayName=e,n}var u=f("Button"),_=f("Collapsible"),T=f("CollapsibleTrigger"),U=f("CollapsiblePanel"),c=f("EmptyInline"),H=f("ChevronDown");var h="redteam-model",m=["authorization","scope","evidence","report"],$=[{id:"redteam",group:"general"},{id:"pentest",group:"professional"},{id:"code-audit",group:"professional"},{id:"binary-analysis",group:"professional"},{id:"attack-defense",group:"professional"},{id:"av-evasion",group:"professional"},{id:"incident-response",group:"professional"},{id:"cloud-security",group:"professional"},{id:"ctf-solver",group:"professional"},{id:"asset-mapping",group:"professional"}],ne={redteam:{displayName:"Researcher",detail:"General session. Gates are optional."},pentest:{displayName:"Assessment",detail:"Authorized review."},"code-audit":{displayName:"Code review",detail:"Source review."},"binary-analysis":{displayName:"Binary review",detail:"Binary review."},"attack-defense":{displayName:"Exercise",detail:"Authorized exercise."},"av-evasion":{displayName:"Detection review",detail:"Detection review. No evasion steps, payloads, or refusal bypass."},"incident-response":{displayName:"Incident review",detail:"Incident review."},"cloud-security":{displayName:"Cloud review",detail:"Cloud review."},"ctf-solver":{displayName:"Puzzle workspace",detail:"Puzzle workspace."},"asset-mapping":{displayName:"Asset inventory",detail:"Inventory workflow."}};function te(e){let n=$.find(s=>s.id===e);if(n===void 0)return null;let o=ne[n.id];return{id:n.id,group:n.group,...o}}function R(){return $.map(e=>te(e.id)).filter(e=>e!==null)}var V="board",rn={gates:`${h}_gates_list`,goal:`${h}_operation_goal`,progress:`${h}_operation_progress`,publish:`${h}_publish`,probe:`${h}_probe`,note:`${h}_ledger_note`};function L(e){let{t:n}=e,[o,s]=y(e.initialProfessionalOpen===!0),[i,r]=y(e.presetId??null),[l,p]=y(!1),b=R(),N=b.filter(d=>d.group==="general"),g=b.filter(d=>d.group==="professional");M(()=>{r(e.presetId??null)},[e.presetId]),M(()=>{let d=v=>{let E=v.detail;r(typeof E?.presetId=="string"?E.presetId:null)};return window.addEventListener("ycodium-draft-preset",d),()=>window.removeEventListener("ycodium-draft-preset",d)},[]);let w=d=>{if(r(d),!e.deployed)return;if(typeof e.onSelectPreset=="function"){e.onSelectPreset(d),p(!1);return}let v=e.bridge.agentPreset?.select;if(v!==void 0){v(d),p(!1);return}p(!0)};return a("section",{className:"rm-hero",children:[t("p",{className:"rm-kicker",children:n("hero.title")}),e.deployed?null:t("p",{className:"rm-banner",children:n("hero.deployFirst")}),e.selectable===!1?t("p",{className:"rm-muted",children:n("hero.readOnly")}):null,l?t("p",{className:"rm-muted",children:n("hero.unwired")}):null,a("div",{className:"rm-modes",children:[N.map(d=>t(u,{size:"xs",type:"button",variant:i===d.id?"default":"outline",disabled:!e.deployed,"aria-pressed":i===d.id,onClick:()=>w(d.id),children:n(`mode.${d.id}.name`)},d.id)),t(u,{size:"xs",variant:"outline",type:"button","aria-expanded":o,onClick:()=>s(d=>!d),children:n(o?"hero.hideProfessional":"hero.professional")}),i===null?null:t(u,{size:"xs",variant:"outline",type:"button",disabled:!e.deployed,onClick:()=>w(null),children:n("hero.clear")})]}),o?t("div",{className:"rm-modes",children:g.map(d=>t(u,{size:"xs",type:"button",variant:i===d.id?"default":"outline",disabled:!e.deployed,"aria-pressed":i===d.id,onClick:()=>w(d.id),children:t("span",{children:n(`mode.${d.id}.name`)})},d.id))}):null,i===null?null:t("p",{className:"rm-muted",children:n("hero.selected")})]})}var oe=12,re=20;function I(e=null){return{modeId:e,phase:"authorization",goal:"",done:0,total:m.length,reportOpen:!1,authorizationRecorded:!1,denials:[],notes:[]}}function F(e){if(typeof e!="object"||e===null)return null;let n=e;return typeof n.deployed!="boolean"||!Array.isArray(n.modules)||!Array.isArray(n.modes)?null:n}function ae(e){return m.includes(e)}function G(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e){return!G(e)||typeof e.tool!="string"||typeof e.reason!="string"?null:{tool:e.tool,code:typeof e.code=="string"?e.code:"denied",reason:e.reason,at:typeof e.at=="string"?e.at:""}}function j(e){if(!G(e))return I();let n=typeof e.phase=="string"&&ae(e.phase)?e.phase:"authorization",o=Array.isArray(e.denials)?e.denials.flatMap(i=>{let r=ie(i);return r===null?[]:[r]}):[],s=Array.isArray(e.notes)?e.notes.filter(i=>typeof i=="string").slice(0,re):[];return{modeId:typeof e.modeId=="string"?e.modeId:null,phase:n,goal:typeof e.goal=="string"?e.goal:"",done:typeof e.done=="number"?e.done:0,total:typeof e.total=="number"?e.total:m.length,reportOpen:e.reportOpen===!0,authorizationRecorded:e.authorizationRecorded===!0,denials:o.slice(0,oe),notes:s}}var se={};function x(e){return e.i18n.usePluginTranslation()}function le(e,n){return e!==null?{next:e,claimed:!1}:{next:n,claimed:!0}}function X(e){return{disabled:e!==null,labelKey:e==="deploy"?"settings.deploying":"settings.deploy"}}function C(e){let n=e.commands.useSubscription("live",se),o=n.data,s=o?.board===void 0?null:F(o.board),i=O(null),[r,l]=y(null),p=k(async(b,N={})=>{let g=le(i.current,b);if(!(!g.claimed||g.next===null)){i.current=g.next,l(g.next);try{await e.commands.invoke(b,N)}finally{i.current=null,l(null)}}},[e]);return{board:s,pending:n.isPending,error:n.error,runningCommand:r,run:p}}function D(e,n){let o=e.sessionProjections.useProjection(V,n||null),s=o,i=n===null||n.length===0?null:s.present?j(s.value):I(),r=k(async(l,p={})=>{await e.commands.invoke(l,{threadId:n??"",...p})},[e,n]);return{session:i,pending:o.isPending,isUnavailable:o.isUnavailable,error:o.error,run:r}}function Y(e){let{t:n,board:o}=e,s=e.runningCommand!==null,i=X(e.runningCommand);return o===null?t("section",{className:"rm-root",children:t(c,{title:e.pending?n("common.loading"):n("common.empty")})}):a("section",{className:"rm-root",children:[a("header",{className:"rm-head",children:[t("div",{children:t("h2",{className:"rm-title",children:n("settings.title")})}),t("span",{className:o.deployed?"rm-pill rm-pill-ok":"rm-pill",children:o.deployed?n("settings.deployed"):n("settings.notDeployed")})]}),a("div",{className:"rm-card",children:[a("div",{className:"rm-actions",children:[t(u,{size:"xs",variant:"default",type:"button",onClick:e.onDeploy,disabled:i.disabled,children:n(i.labelKey)}),t(u,{size:"xs",variant:"outline",type:"button",onClick:e.onRemove,disabled:!o.deployed||s,children:n("settings.remove")}),t(u,{size:"xs",variant:"outline",type:"button",onClick:e.onRepair,disabled:s,children:n("settings.repair")}),t(u,{size:"xs",variant:"outline",type:"button",onClick:()=>e.onProbe(!o.probeDenial),disabled:s,children:o.probeDenial?n("settings.probeHold"):n("settings.probeAllow")})]}),t("p",{className:"rm-lead",children:n("settings.routing")}),o.lastDenial===null?t("p",{className:"rm-muted",children:n("settings.noDenial")}):a("p",{className:"rm-banner",role:"status",children:[n("settings.denial")," ",o.lastDenial.tool,": ",o.lastDenial.reason]})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.modes")}),["general","professional"].map(r=>a("div",{children:[t("p",{className:"rm-kicker",children:n(`group.${r}`)}),t("p",{className:"rm-muted",children:n(`group.${r}Note`)}),t("div",{className:"rm-modes",children:o.modes.filter(l=>l.group===r).map(l=>a("article",{className:"rm-card",children:[t("strong",{children:n(`mode.${l.id}.name`)}),l.id==="av-evasion"?t("p",{className:"rm-muted",children:n("mode.av-evasion.detail")}):null]},l.id))})]},r))]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.modules")}),t("p",{className:"rm-lead",children:n("settings.withheldNote")}),o.modules.map(r=>a("div",{className:"rm-module",children:[a("div",{children:[t("strong",{children:n(`module.${r.id}`)}),a("p",{className:"rm-muted",children:[n(`availability.${r.availability}`),","," ",r.installed?n("common.installed"):n("common.absent")]})]}),a("div",{className:"rm-actions",children:[t(u,{size:"xs",variant:"outline",type:"button",disabled:s,onClick:()=>e.onInstall(r.id),children:n("settings.install")}),t(u,{size:"xs",variant:"outline",type:"button",disabled:!r.installed||s,onClick:()=>e.onUpdate(r.id),children:n("settings.update")}),t(u,{size:"xs",variant:"outline",type:"button",disabled:!r.installed||s,onClick:()=>e.onUninstall(r.id),children:n("settings.uninstall")})]})]},r.id)),t("p",{className:"rm-muted",children:n("settings.mcpNote")})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.operations")}),o.operations.length===0?t("p",{className:"rm-muted",children:n("settings.noOperations")}):t("ul",{className:"rm-log",children:o.operations.map(r=>a("li",{children:[a("span",{children:[r.kind,", ",n(`op.${r.status}`)]}),t("span",{className:"rm-muted",children:r.detail})]},r.id))})]})]})}function K(e){return{authorization:e.authorizationRecorded?"secondary":"primary",report:e.authorizationRecorded&&!e.reportOpen?"primary":"secondary"}}function q(e){let{t:n,session:o}=e;if(e.threadId===null||e.threadId.length===0||o===null||o.modeId===null)return null;let s=Math.min(o.done,m.length),i=K(o);return a(_,{className:"rm-seat",defaultOpen:!0,children:[a(T,{className:"rm-seat-trigger",children:[t(H,{className:"rm-seat-chevron"}),n("session.title")]}),t(U,{children:t("div",{className:"rm-seat-body",children:a("section",{className:"rm-session",children:[a("header",{className:"rm-head",children:[t("div",{children:t("p",{className:"rm-muted",children:n(`mode.${o.modeId}.name`)})}),a("span",{className:"rm-pill",children:[n("session.progress")," ",o.done,"/",o.total]})]}),t("div",{className:"rm-rail","aria-label":n("session.phase"),children:m.map(r=>t(u,{size:"xs",type:"button",variant:o.phase===r?"default":"outline","aria-pressed":o.phase===r,onClick:()=>e.onPhase(r),children:n(`phase.${r}`)},r))}),t("div",{className:"rm-dots","aria-label":n("session.coverage"),children:m.map((r,l)=>t("span",{className:"rm-dot","data-on":l<s?"true":"false"},r))}),t("p",{className:"rm-lead",children:o.goal.length===0?n("session.noGoal"):o.goal}),a("div",{className:"rm-actions",children:[a("div",{className:"rm-action",children:[t(u,{size:"xs",type:"button",variant:i.authorization==="primary"?"default":"outline","data-tone":i.authorization,onClick:e.onAuthorize,disabled:o.authorizationRecorded,children:o.authorizationRecorded?n("session.authorizationDone"):n("session.authorization")}),t("p",{className:"rm-hint",children:n("session.authorizationHint")})]}),t("div",{className:"rm-action",children:t(u,{size:"xs",type:"button",variant:i.report==="primary"?"default":"outline","data-tone":i.report,onClick:e.onReport,disabled:o.reportOpen,children:o.reportOpen?n("session.reportOpen"):n("session.report")})}),a("div",{className:"rm-action",children:[t(u,{size:"xs",type:"button",variant:"outline","data-tone":"secondary",onClick:e.onRemind,children:n("session.reminder")}),t("p",{className:"rm-hint",children:n("session.reminderHint")})]})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("session.denials")}),o.denials.length===0?t(c,{title:n("session.noDenials")}):o.denials.map(r=>a("p",{className:"rm-banner",role:"status",children:[r.tool,": ",r.reason]},`${r.at}-${r.tool}`))]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("session.notes")}),o.notes.length===0?t(c,{title:n("session.noNotes")}):t("ul",{className:"rm-note",children:o.notes.map(r=>t("li",{children:r},r))})]})]})})})]})}function J(e){if(e.threadId===null||e.threadId.length===0||e.session===null||e.session.modeId===null)return null;let n=e.session.total>0&&e.session.done>=e.session.total;return a("span",{className:"rm-chip","data-done":n?"true":"false",children:[a("span",{children:[e.t("header.progress")," ",e.session.done,"/",e.session.total]}),a("span",{children:[e.t("header.denials")," ",e.session.denials.length]})]})}var de=`
1
+ var Z=window.__ycodiumPluginHost.react;var{Activity:ye,Children:fe,Component:he,Fragment:be,Profiler:ve,PureComponent:xe,StrictMode:Se,Suspense:Ne,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:we,__COMPILER_RUNTIME:ke,act:Pe,cache:Me,cacheSignal:Re,captureOwnerStack:Ce,cloneElement:Ie,createContext:z,createElement:N,createRef:De,forwardRef:Ee,isValidElement:ze,lazy:Be,memo:Oe,startTransition:Ae,unstable_useCacheRefresh:_e,use:B,useActionState:Te,useCallback:P,useContext:Ue,useDebugValue:He,useDeferredValue:Ve,useEffect:M,useEffectEvent:$e,useId:Le,useImperativeHandle:Fe,useInsertionEffect:Ge,useLayoutEffect:je,useMemo:Xe,useOptimistic:Ye,useReducer:Ke,useRef:O,useState:f,useSyncExternalStore:qe,useTransition:Je,version:We}=Z;var A=z(null);function v(e){return N(A,{value:e.bridge},e.children)}var ee=new Set(["Collapsible","CollapsiblePanel","CollapsibleTrigger"]);function g(e){let n=o=>{let r=B(A)?.ui?.[e];return r===void 0?ee.has(e)?N("div",{className:o.className},o.children):null:N(r,o)};return n.displayName=e,n}var u=g("Button"),_=g("Collapsible"),T=g("CollapsibleTrigger"),U=g("CollapsiblePanel"),c=g("EmptyInline"),H=g("ChevronDown");var h="redteam-model",m=["authorization","scope","evidence","report"],V=[{id:"redteam",group:"general"},{id:"pentest",group:"professional"},{id:"code-audit",group:"professional"},{id:"binary-analysis",group:"professional"},{id:"attack-defense",group:"professional"},{id:"av-evasion",group:"professional"},{id:"incident-response",group:"professional"},{id:"cloud-security",group:"professional"},{id:"ctf-solver",group:"professional"},{id:"asset-mapping",group:"professional"}],ne={redteam:{displayName:"Researcher",detail:"General session. Gates are optional."},pentest:{displayName:"Assessment",detail:"Authorized review."},"code-audit":{displayName:"Code review",detail:"Source review."},"binary-analysis":{displayName:"Binary review",detail:"Binary review."},"attack-defense":{displayName:"Exercise",detail:"Authorized exercise."},"av-evasion":{displayName:"Detection review",detail:"Detection review. No evasion steps, payloads, or refusal bypass."},"incident-response":{displayName:"Incident review",detail:"Incident review."},"cloud-security":{displayName:"Cloud review",detail:"Cloud review."},"ctf-solver":{displayName:"Puzzle workspace",detail:"Puzzle workspace."},"asset-mapping":{displayName:"Asset inventory",detail:"Inventory workflow."}};function te(e){let n=V.find(l=>l.id===e);if(n===void 0)return null;let o=ne[n.id];return{id:n.id,group:n.group,...o}}function R(){return V.map(e=>te(e.id)).filter(e=>e!==null)}var $="board",rn={gates:`${h}_gates_list`,goal:`${h}_operation_goal`,progress:`${h}_operation_progress`,publish:`${h}_publish`,probe:`${h}_probe`,note:`${h}_ledger_note`};var{jsx:t,jsxs:a,Fragment:ln}=window.__ycodiumPluginHost.jsxRuntime;function L(e){let{t:n}=e,[o,l]=f(e.initialProfessionalOpen===!0),[i,r]=f(e.presetId??null),[s,p]=f(!1),b=R(),w=b.filter(d=>d.group==="general"),y=b.filter(d=>d.group==="professional");M(()=>{r(e.presetId??null)},[e.presetId]),M(()=>{let d=S=>{let E=S.detail;r(typeof E?.presetId=="string"?E.presetId:null)};return window.addEventListener("ycodium-draft-preset",d),()=>window.removeEventListener("ycodium-draft-preset",d)},[]);let k=d=>{if(r(d),!e.deployed)return;if(typeof e.onSelectPreset=="function"){e.onSelectPreset(d),p(!1);return}let S=e.bridge.agentPreset?.select;if(S!==void 0){S(d),p(!1);return}p(!0)};return a("section",{className:"rm-hero",children:[t("p",{className:"rm-kicker",children:n("hero.title")}),e.deployed?null:t("p",{className:"rm-banner",children:n("hero.deployFirst")}),e.selectable===!1?t("p",{className:"rm-muted",children:n("hero.readOnly")}):null,s?t("p",{className:"rm-muted",children:n("hero.unwired")}):null,a("div",{className:"rm-modes",children:[w.map(d=>t(u,{size:"xs",type:"button",variant:i===d.id?"default":"outline",disabled:!e.deployed,"aria-pressed":i===d.id,onClick:()=>k(d.id),children:n(`mode.${d.id}.name`)},d.id)),t(u,{size:"xs",variant:"outline",type:"button","aria-expanded":o,onClick:()=>l(d=>!d),children:n(o?"hero.hideProfessional":"hero.professional")}),i===null?null:t(u,{size:"xs",variant:"outline",type:"button",disabled:!e.deployed,onClick:()=>k(null),children:n("hero.clear")})]}),o?t("div",{className:"rm-modes",children:y.map(d=>t(u,{size:"xs",type:"button",variant:i===d.id?"default":"outline",disabled:!e.deployed,"aria-pressed":i===d.id,onClick:()=>k(d.id),children:t("span",{children:n(`mode.${d.id}.name`)})},d.id))}):null,i===null?null:t("p",{className:"rm-muted",children:n("hero.selected")})]})}var oe=12,re=20;function C(e=null){return{modeId:e,phase:"authorization",goal:"",done:0,total:m.length,reportOpen:!1,authorizationRecorded:!1,denials:[],notes:[]}}function F(e){if(typeof e!="object"||e===null)return null;let n=e;return typeof n.deployed!="boolean"||!Array.isArray(n.modules)||!Array.isArray(n.modes)?null:n}function ae(e){return m.includes(e)}function G(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e){return!G(e)||typeof e.tool!="string"||typeof e.reason!="string"?null:{tool:e.tool,code:typeof e.code=="string"?e.code:"denied",reason:e.reason,at:typeof e.at=="string"?e.at:""}}function j(e){if(!G(e))return C();let n=typeof e.phase=="string"&&ae(e.phase)?e.phase:"authorization",o=Array.isArray(e.denials)?e.denials.flatMap(i=>{let r=ie(i);return r===null?[]:[r]}):[],l=Array.isArray(e.notes)?e.notes.filter(i=>typeof i=="string").slice(0,re):[];return{modeId:typeof e.modeId=="string"?e.modeId:null,phase:n,goal:typeof e.goal=="string"?e.goal:"",done:typeof e.done=="number"?e.done:0,total:typeof e.total=="number"?e.total:m.length,reportOpen:e.reportOpen===!0,authorizationRecorded:e.authorizationRecorded===!0,denials:o.slice(0,oe),notes:l}}var le={};function x(e){return e.i18n.usePluginTranslation()}function se(e,n){return e!==null?{next:e,claimed:!1}:{next:n,claimed:!0}}function X(e){return{disabled:e!==null,labelKey:e==="deploy"?"settings.deploying":"settings.deploy"}}function I(e){let n=e.commands.useSubscription("live",le),o=n.data,l=o?.board===void 0?null:F(o.board),i=O(null),[r,s]=f(null),p=P(async(b,w={})=>{let y=se(i.current,b);if(!(!y.claimed||y.next===null)){i.current=y.next,s(y.next);try{await e.commands.invoke(b,w)}finally{i.current=null,s(null)}}},[e]);return{board:l,pending:n.isPending,error:n.error,runningCommand:r,run:p}}function D(e,n){let o=e.sessionProjections.useProjection($,n||null),l=o,i=n===null||n.length===0?null:l.present?j(l.value):C(),r=P(async(s,p={})=>{await e.commands.invoke(s,{threadId:n??"",...p})},[e,n]);return{session:i,pending:o.isPending,isUnavailable:o.isUnavailable,error:o.error,run:r}}function Y(e){let{t:n,board:o}=e,l=e.runningCommand!==null,i=X(e.runningCommand);return o===null?t("section",{className:"rm-root",children:t(c,{title:e.pending?n("common.loading"):n("common.empty")})}):a("section",{className:"rm-root",children:[a("header",{className:"rm-head",children:[t("div",{children:t("h2",{className:"rm-title",children:n("settings.title")})}),t("span",{className:o.deployed?"rm-pill rm-pill-ok":"rm-pill",children:o.deployed?n("settings.deployed"):n("settings.notDeployed")})]}),a("div",{className:"rm-card",children:[a("div",{className:"rm-actions",children:[t(u,{size:"xs",variant:"default",type:"button",onClick:e.onDeploy,disabled:i.disabled,children:n(i.labelKey)}),t(u,{size:"xs",variant:"outline",type:"button",onClick:e.onRemove,disabled:!o.deployed||l,children:n("settings.remove")}),t(u,{size:"xs",variant:"outline",type:"button",onClick:e.onRepair,disabled:l,children:n("settings.repair")}),t(u,{size:"xs",variant:"outline",type:"button",onClick:()=>e.onProbe(!o.probeDenial),disabled:l,children:o.probeDenial?n("settings.probeHold"):n("settings.probeAllow")})]}),t("p",{className:"rm-lead",children:n("settings.routing")}),o.lastDenial===null?t("p",{className:"rm-muted",children:n("settings.noDenial")}):a("p",{className:"rm-banner",role:"status",children:[n("settings.denial")," ",o.lastDenial.tool,": ",o.lastDenial.reason]})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.modes")}),["general","professional"].map(r=>a("div",{children:[t("p",{className:"rm-kicker",children:n(`group.${r}`)}),t("p",{className:"rm-muted",children:n(`group.${r}Note`)}),t("div",{className:"rm-modes",children:o.modes.filter(s=>s.group===r).map(s=>a("article",{className:"rm-card",children:[t("strong",{children:n(`mode.${s.id}.name`)}),s.id==="av-evasion"?t("p",{className:"rm-muted",children:n("mode.av-evasion.detail")}):null]},s.id))})]},r))]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.modules")}),t("p",{className:"rm-lead",children:n("settings.withheldNote")}),o.modules.map(r=>a("div",{className:"rm-module",children:[a("div",{children:[t("strong",{children:n(`module.${r.id}`)}),a("p",{className:"rm-muted",children:[n(`availability.${r.availability}`),","," ",r.installed?n("common.installed"):n("common.absent")]})]}),a("div",{className:"rm-actions",children:[t(u,{size:"xs",variant:"outline",type:"button",disabled:l,onClick:()=>e.onInstall(r.id),children:n("settings.install")}),t(u,{size:"xs",variant:"outline",type:"button",disabled:!r.installed||l,onClick:()=>e.onUpdate(r.id),children:n("settings.update")}),t(u,{size:"xs",variant:"outline",type:"button",disabled:!r.installed||l,onClick:()=>e.onUninstall(r.id),children:n("settings.uninstall")})]})]},r.id)),t("p",{className:"rm-muted",children:n("settings.mcpNote")})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("settings.operations")}),o.operations.length===0?t("p",{className:"rm-muted",children:n("settings.noOperations")}):t("ul",{className:"rm-log",children:o.operations.map(r=>a("li",{children:[a("span",{children:[r.kind,", ",n(`op.${r.status}`)]}),t("span",{className:"rm-muted",children:r.detail})]},r.id))})]})]})}function K(e){return{authorization:e.authorizationRecorded?"secondary":"primary",report:e.authorizationRecorded&&!e.reportOpen?"primary":"secondary"}}function q(e){let{t:n,session:o}=e;if(e.threadId===null||e.threadId.length===0||o===null||o.modeId===null)return null;let l=Math.min(o.done,m.length),i=K(o);return a(_,{className:"rm-seat",defaultOpen:!0,children:[a(T,{className:"rm-seat-trigger",children:[t(H,{className:"rm-seat-chevron"}),n("session.title")]}),t(U,{children:t("div",{className:"rm-seat-body",children:a("section",{className:"rm-session",children:[a("header",{className:"rm-head",children:[t("div",{children:t("p",{className:"rm-muted",children:n(`mode.${o.modeId}.name`)})}),a("span",{className:"rm-pill",children:[n("session.progress")," ",o.done,"/",o.total]})]}),t("div",{className:"rm-rail","aria-label":n("session.phase"),children:m.map(r=>t(u,{size:"xs",type:"button",variant:o.phase===r?"default":"outline","aria-pressed":o.phase===r,onClick:()=>e.onPhase(r),children:n(`phase.${r}`)},r))}),t("div",{className:"rm-dots","aria-label":n("session.coverage"),children:m.map((r,s)=>t("span",{className:"rm-dot","data-on":s<l?"true":"false"},r))}),t("p",{className:"rm-lead",children:o.goal.length===0?n("session.noGoal"):o.goal}),a("div",{className:"rm-actions",children:[a("div",{className:"rm-action",children:[t(u,{size:"xs",type:"button",variant:i.authorization==="primary"?"default":"outline","data-tone":i.authorization,onClick:e.onAuthorize,disabled:o.authorizationRecorded,children:o.authorizationRecorded?n("session.authorizationDone"):n("session.authorization")}),t("p",{className:"rm-hint",children:n("session.authorizationHint")})]}),t("div",{className:"rm-action",children:t(u,{size:"xs",type:"button",variant:i.report==="primary"?"default":"outline","data-tone":i.report,onClick:e.onReport,disabled:o.reportOpen,children:o.reportOpen?n("session.reportOpen"):n("session.report")})}),a("div",{className:"rm-action",children:[t(u,{size:"xs",type:"button",variant:"outline","data-tone":"secondary",onClick:e.onRemind,children:n("session.reminder")}),t("p",{className:"rm-hint",children:n("session.reminderHint")})]})]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("session.denials")}),o.denials.length===0?t(c,{title:n("session.noDenials")}):o.denials.map(r=>a("p",{className:"rm-banner",role:"status",children:[r.tool,": ",r.reason]},`${r.at}-${r.tool}`))]}),a("div",{className:"rm-card",children:[t("h3",{className:"rm-title",children:n("session.notes")}),o.notes.length===0?t(c,{title:n("session.noNotes")}):t("ul",{className:"rm-note",children:o.notes.map(r=>t("li",{children:r},r))})]})]})})})]})}function J(e){if(e.threadId===null||e.threadId.length===0||e.session===null||e.session.modeId===null)return null;let n=e.session.total>0&&e.session.done>=e.session.total;return a("span",{className:"rm-chip","data-done":n?"true":"false",children:[a("span",{children:[e.t("header.progress")," ",e.session.done,"/",e.session.total]}),a("span",{children:[e.t("header.denials")," ",e.session.denials.length]})]})}var de=`
2
2
  .rm-root, .rm-hero, .rm-session, .rm-chip {
3
3
  color: var(--foreground);
4
4
  font: inherit;
@@ -105,4 +105,4 @@ html[data-fit-content] .rm-seat-body { max-height: 240px; }
105
105
  .rm-rail { grid-template-columns: 1fr 1fr; }
106
106
  .rm-root { padding: 12px; }
107
107
  }
108
- `,W=!1;function Q(){if(W||typeof document>"u")return;W=!0;let e=document.createElement("style");e.dataset.redteamModel="1",e.textContent=de,document.head.appendChild(e)}function ue(e){let n=x(e.bridge),{board:o,pending:s,runningCommand:i,run:r}=C(e.bridge);return t(S,{bridge:e.bridge,children:t(Y,{t:n,board:o,pending:s,runningCommand:i,onDeploy:()=>{r("deploy")},onRemove:()=>{r("remove")},onRepair:()=>{r("repair")},onInstall:l=>{r("module.install",{id:l})},onUpdate:l=>{r("module.update",{id:l})},onUninstall:l=>{r("module.uninstall",{id:l})},onProbe:l=>{r("fields.set",{probeDenial:l})}})})}function pe(e){let n=x(e.bridge),{board:o}=C(e.bridge);return t(S,{bridge:e.bridge,children:t(L,{bridge:e.bridge,t:n,deployed:o?.deployed===!0,presetId:e.presetId,selectable:e.selectable,onSelectPreset:e.onSelectPreset})})}function ce(e){let n=x(e.bridge),o=e.threadId??null,{session:s,run:i,isUnavailable:r,error:l}=D(e.bridge,o);return t(S,{bridge:e.bridge,children:r?t(c,{title:n("projection.unavailable")}):l!==null?t(c,{title:n("projection.readFailed")}):t(q,{t:n,session:s,threadId:o,onPhase:p=>{i("phase.set",{phase:p})},onAuthorize:()=>{i("authorization.record")},onReport:()=>{i("report.open")},onRemind:()=>{i("reminder")}})})}function me(e){let n=x(e.bridge),o=e.threadId??null,{session:s}=D(e.bridge,o);return t(J,{t:n,session:s,threadId:o})}function ge(e){return Q(),{slots:[{name:"settings.section",order:40,component(){return t(ue,{bridge:e})}},{name:"conversation.hero.agentPreset",order:10,component(n){return t(pe,{bridge:e,...n})}},{name:"conversation.view",order:30,component(n){return t(ce,{bridge:e,threadId:n.threadId})}},{name:"conversation.session.header.actions",order:30,component(n){return t(me,{bridge:e,threadId:n.threadId})}}]}}export{ge as default};
108
+ `,W=!1;function Q(){if(W||typeof document>"u")return;W=!0;let e=document.createElement("style");e.dataset.redteamModel="1",e.textContent=de,document.head.appendChild(e)}function ue(e){let n=x(e.bridge),{board:o,pending:l,runningCommand:i,run:r}=I(e.bridge);return t(v,{bridge:e.bridge,children:t(Y,{t:n,board:o,pending:l,runningCommand:i,onDeploy:()=>{r("deploy")},onRemove:()=>{r("remove")},onRepair:()=>{r("repair")},onInstall:s=>{r("module.install",{id:s})},onUpdate:s=>{r("module.update",{id:s})},onUninstall:s=>{r("module.uninstall",{id:s})},onProbe:s=>{r("fields.set",{probeDenial:s})}})})}function pe(e){let n=x(e.bridge),{board:o}=I(e.bridge);return t(v,{bridge:e.bridge,children:t(L,{bridge:e.bridge,t:n,deployed:o?.deployed===!0,presetId:e.presetId,selectable:e.selectable,onSelectPreset:e.onSelectPreset})})}function ce(e){let n=x(e.bridge),o=e.threadId??null,{session:l,run:i,isUnavailable:r,error:s}=D(e.bridge,o);return t(v,{bridge:e.bridge,children:r?t(c,{title:n("projection.unavailable")}):s!==null?t(c,{title:n("projection.readFailed")}):t(q,{t:n,session:l,threadId:o,onPhase:p=>{i("phase.set",{phase:p})},onAuthorize:()=>{i("authorization.record")},onReport:()=>{i("report.open")},onRemind:()=>{i("reminder")}})})}function me(e){let n=x(e.bridge),o=e.threadId??null,{session:l}=D(e.bridge,o);return t(J,{t:n,session:l,threadId:o})}function ge(e){return Q(),{slots:[{name:"settings.section",order:40,component(){return t(ue,{bridge:e})}},{name:"conversation.hero.agentPreset",order:10,component(n){return t(pe,{bridge:e,...n})}},{name:"conversation.view",order:30,component(n){return t(ce,{bridge:e,threadId:n.threadId})}},{name:"conversation.session.header.actions",order:30,component(n){return t(me,{bridge:e,threadId:n.threadId})}}]}}export{ge as default};
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { definePlugin } from "@ycodium-ai/plugin-api";
3
3
 
4
4
  // ../../packages/plugin-api/src/version.ts
5
- var PLUGIN_API_VERSION = 143;
5
+ var PLUGIN_API_VERSION = 152;
6
6
 
7
7
  // src/catalog.ts
8
8
  var PLUGIN_ID = "redteam-model";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-redteam-model",
3
- "version": "0.2.5029",
3
+ "version": "0.2.5177",
4
4
  "description": "Deploys ten session modes, a gate rail, and a tool guard. The executor keeps the model connection.",
5
5
  "keywords": [
6
6
  "redteam-model",
@@ -25,8 +25,10 @@
25
25
  "react": "19.2.6",
26
26
  "typescript": "~6.0.3",
27
27
  "vite-plus": "0.2.2",
28
- "@ycodium-ai/plugin-api": "0.2.5029",
29
- "@ycodium/contracts": "0.0.33"
28
+ "@ycodium/contracts": "0.0.33",
29
+ "@ycodium-ai/plugin-api": "0.2.5177",
30
+ "ycodium-plugin-testing": "0.0.0",
31
+ "ycodium-ui-hooks": "0.0.0"
30
32
  },
31
33
  "ycodium": {
32
34
  "plugin": "./dist/index.js",