loomrail 0.1.1 → 0.1.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.
- package/apps/cli/dist/index.js +2558 -1005
- package/apps/cli/migrations/0062_agent_run_activity.sql +36 -0
- package/apps/web/dist/assets/index-Dde217zt.js +13 -0
- package/apps/web/dist/assets/index-Dde217zt.js.map +1 -0
- package/apps/web/dist/assets/{index-Ev7mo9dU.css → index-KGk5dftw.css} +1 -1
- package/apps/web/dist/index.html +2 -2
- package/package.json +1 -1
- package/apps/web/dist/assets/index-DnefyhG4.js +0 -13
- package/apps/web/dist/assets/index-DnefyhG4.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{i as t,n,t as r}from"./react-vendor-BicOiEU0.js";import{a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./tanstack-vendor-Do8jh46X.js";import{a as b,c as x,d as S,f as C,g as ee,h as te,i as w,l as T,m as E,n as D,o as O,p as ne,r as re,s as k,t as A,u as j}from"./validation-vendor-BkeqxOpa.js";import{A as ie,B as ae,C as oe,D as se,E as ce,F as le,I as ue,L as de,M as fe,N as pe,O as me,P as he,R as ge,S as _e,T as ve,V as ye,_ as be,a as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,j as ke,k as Ae,l as je,m as Me,n as Ne,o as Pe,p as Fe,r as Ie,s as Le,t as Re,u as ze,v as Be,w as Ve,x as He,y as Ue,z as We}from"./radix-vendor-CRdHXIPR.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var M=e(t(),1),Ge=n(),N=k(1),Ke=k(`v1`),P=C().trim().min(1).max(128).regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/),F=P,I=A({offset:!0}),qe=D([`MOCK`,`CODEX`,`CLAUDE_CODE`]),Je=D([`FAST`,`STANDARD`,`DEEP`]),L=j({type:D([`HUMAN`,`SYSTEM`]),id:P}).strict(),Ye=/^(?:[/\\]|[A-Za-z]:[/\\])/,Xe=C().regex(/^[0-9a-f]{64}$/),Ze=C().trim().min(1).max(80),Qe=C().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/),$e=C().min(1).max(4096).regex(Ye,`An MCP executable path must be absolute`),et=C().min(1).max(2048),tt=j({profileId:P.nullable(),name:Ze,executable:$e,args:w(et).max(32),declaredTools:w(Qe).min(1).max(64)}).strict().superRefine((e,t)=>{e.executable.length+e.args.reduce((e,t)=>e+t.length,0)>16384&&t.addIssue({code:`custom`,message:`The MCP launch recipe exceeds 16 KiB`}),new Set(e.declaredTools).size!==e.declaredTools.length&&t.addIssue({code:`custom`,message:`Declared MCP tool names must be unique`})}),nt=j({schemaVersion:N,challengeId:P,projectId:P,expectedProjectVersion:T().int().positive(),candidate:tt,canonicalDigest:Xe,createdAt:I,expiresAt:I}).strict(),rt=j({schemaVersion:N,id:P,profileId:P,projectId:P,revision:T().int().positive(),name:Ze,executable:$e,args:w(et).max(32),declaredTools:w(Qe).min(1).max(64),canonicalDigest:Xe,createdAt:I}).strict(),it=j({schemaVersion:N,id:P,projectId:P,profileRevisionId:P,canonicalDigest:Xe,ownerId:P,consentedAt:I}).strict(),at=D([`READY`,`SPAWN_FAILED`,`TIMED_OUT`,`INVALID_RESPONSE`,`OUTPUT_LIMIT_REACHED`,`UNSUPPORTED_PROTOCOL`,`PROCESS_EXITED`]),ot=j({schemaVersion:N,id:P,projectId:P,profileRevisionId:P,state:at,protocolVersion:C().min(1).max(80).nullable(),tools:w(Qe).max(64),resources:w(C().min(1).max(256)).max(64),prompts:w(C().min(1).max(256)).max(64),observedAt:I}).strict(),st=j({schemaVersion:N,id:P,projectId:P,profileRevisionId:P,tools:w(Qe).min(1).max(64),enabled:b(),version:T().int().positive(),grantedBy:P,createdAt:I,updatedAt:I,revokedAt:I.nullable()}).strict(),ct=j({schemaVersion:N,id:P,projectId:P,providerSessionId:P,profileRevisionId:P,profileDigest:Xe,grantId:P,grantVersion:T().int().positive(),tools:w(Qe).min(1).max(64),createdAt:I}).strict(),lt=D([`STARTED`,`SUCCEEDED`,`FAILED`,`UNKNOWN_OUTCOME`]),ut=D([`TOOL_NOT_GRANTED`,`GRANT_REVOKED`,`ARGUMENTS_INVALID`,`SERVER_UNAVAILABLE`,`SERVER_ERROR`,`PROTOCOL_ERROR`,`DEADLINE_EXCEEDED`,`OUTPUT_LIMIT_REACHED`,`CONNECTION_LOST`]),dt=j({schemaVersion:N,id:P,projectId:P,providerSessionId:P,sessionSnapshotId:P,profileRevisionId:P,toolName:Qe,inputDigest:Xe,status:lt,failureCode:ut.nullable(),startedAt:I,finishedAt:I.nullable()}).strict().superRefine((e,t)=>{e.status===`STARTED`!=(e.finishedAt===null)&&t.addIssue({code:`custom`,message:`Only a started MCP call has no finish time`}),(e.status===`FAILED`||e.status===`UNKNOWN_OUTCOME`)!=(e.failureCode!==null)&&t.addIssue({code:`custom`,message:`Only failed or uncertain MCP calls carry a failure code`})}),ft=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),pt=ft.extend({type:k(`MCP_PROFILE_CONSENTED`),data:j({revision:rt,consent:it}).strict()}),mt=ft.extend({type:k(`MCP_GRANT_CHANGED`),data:j({grant:st}).strict()}),ht=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),gt=ht.extend({type:k(`CONFIRM_MCP_PROFILE`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),candidate:tt,canonicalDigest:Xe}).strict()}),_t=ht.extend({type:k(`SET_MCP_PROFILE_GRANT`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),profileRevisionId:P,expectedGrantVersion:T().int().positive().nullable(),tools:w(Qe).min(1).max(64),ownerAttestsReadOnly:k(!0)}).strict().superRefine((e,t)=>{new Set(e.tools).size!==e.tools.length&&t.addIssue({code:`custom`,message:`Granted MCP tool names must be unique`})})}),vt=ht.extend({type:k(`REVOKE_MCP_PROFILE_GRANT`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),profileRevisionId:P,expectedGrantVersion:T().int().positive()}).strict()}),yt=ht.extend({type:k(`RECORD_MCP_CAPABILITY_SNAPSHOT`),payload:j({projectId:P,profileRevisionId:P,state:at,protocolVersion:C().min(1).max(80).nullable(),tools:w(Qe).max(64),resources:w(C().min(1).max(256)).max(64),prompts:w(C().min(1).max(256)).max(64)}).strict()}),bt=ht.extend({type:k(`START_MCP_TOOL_CALL`),payload:j({sessionSnapshotId:P,toolName:Qe,inputDigest:Xe}).strict()}),xt=O(`status`,[j({status:k(`SUCCEEDED`)}).strict(),j({status:k(`FAILED`),failureCode:ut}).strict(),j({status:k(`UNKNOWN_OUTCOME`),failureCode:k(`CONNECTION_LOST`)}).strict()]),St=ht.extend({type:k(`FINISH_MCP_TOOL_CALL`),payload:j({callId:P,outcome:xt}).strict()}),Ct=j({schemaVersion:N,replayed:b()}).strict(),wt=Ct.extend({type:k(`MCP_PROFILE_CONSENTED`),revision:rt,consent:it,projectVersion:T().int().positive(),event:pt}),Tt=Ct.extend({type:k(`MCP_GRANT_CHANGED`),grant:st,projectVersion:T().int().positive(),event:mt}),Et=Ct.extend({type:k(`MCP_CAPABILITY_RECORDED`),snapshot:ot}),Dt=Ct.extend({type:k(`MCP_TOOL_CALL_CHANGED`),call:dt});j({schemaVersion:N,expectedProjectVersion:T().int().positive(),candidate:tt}).strict(),j({schemaVersion:N,expectedProjectVersion:T().int().positive()}).strict(),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),challengeId:P,canonicalDigest:Xe}).strict(),j({schemaVersion:N,commandId:P}).strict(),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),expectedGrantVersion:T().int().positive().nullable(),tools:w(Qe).min(1).max(64),ownerAttestsReadOnly:k(!0)}).strict().superRefine((e,t)=>{new Set(e.tools).size!==e.tools.length&&t.addIssue({code:`custom`,message:`Granted MCP tool names must be unique`})}),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),expectedGrantVersion:T().int().positive()}).strict();var Ot=j({revision:rt,consent:it,capability:ot.nullable(),grant:st.nullable()}).strict(),kt=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),profiles:w(Ot)}).strict(),At=e=>{for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1},jt=C().regex(/^[0-9a-f]{64}$/),Mt=D([`LIST_DIRECTORY`,`READ_FILE`,`WRITE_FILE`,`EDIT_FILE`,`DELETE_FILE`,`RUN_RECIPE`]),Nt=C().min(1).max(240).refine(e=>!At(e),`Tool target cannot contain controls`),Pt=D([`STARTED`,`SUCCEEDED`,`DENIED`,`FAILED`,`UNKNOWN_OUTCOME`]),Ft=D([`WORKSPACE_ACCESS_DENIED`,`PATH_INVALID`,`PATH_FORBIDDEN`,`PATH_OUTSIDE_WORKSPACE`,`SYMLINK_FORBIDDEN`,`TARGET_NOT_FOUND`,`TARGET_TYPE_FORBIDDEN`,`CONTENT_CONFLICT`,`CONTENT_INVALID`,`SIZE_LIMIT_REACHED`,`RECIPE_NOT_APPROVED`,`RECIPE_AUTHORITY_CHANGED`,`NETWORK_POLICY_UNAVAILABLE`,`RECIPE_EXITED_NONZERO`,`DEADLINE_EXCEEDED`,`OUTPUT_LIMIT_REACHED`,`CANCELLED`,`PROCESS_TERMINATION_FAILED`,`PROCESS_FAILED`,`REPLAYED_WITHOUT_OUTPUT`,`DAEMON_RESTART`,`INTERNAL_ERROR`]),It=j({schemaVersion:N,id:P,projectId:P,workItemId:P,stageAttemptId:P,agentRunId:P,providerSessionId:P,providerCallKey:jt,operation:Mt,target:Nt,policyDigest:jt,inputDigest:jt,status:Pt,failureCode:Ft.nullable(),outputDigest:jt.nullable(),outputBytes:T().int().nonnegative().max(262144).nullable(),exitCode:T().int().min(-2147483648).max(2147483647).nullable(),startedAt:I,finishedAt:I.nullable()}).strict().superRefine((e,t)=>{e.status===`STARTED`!=(e.finishedAt===null)&&t.addIssue({code:`custom`,message:`Only a started workspace tool call is unfinished`}),e.status===`SUCCEEDED`!=(e.failureCode===null)&&e.status!==`STARTED`&&t.addIssue({code:`custom`,message:`A successful workspace tool call has no failure code and every terminal failure has one`}),e.status===`STARTED`&&e.failureCode!==null&&t.addIssue({code:`custom`,message:`A started workspace tool call has no failure code`})}),Lt=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`WORK_ITEM`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict().extend({type:k(`WORKSPACE_TOOL_CALL_CHANGED`),data:j({call:It}).strict()}),Rt=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),zt=Rt.extend({type:k(`START_WORKSPACE_TOOL_CALL`),payload:j({providerSessionId:P,providerCallKey:jt,operation:Mt,target:Nt,policyDigest:jt,inputDigest:jt}).strict()}),Bt=O(`status`,[j({status:k(`SUCCEEDED`),outputDigest:jt.nullable(),outputBytes:T().int().nonnegative().max(262144).nullable(),exitCode:T().int().min(-2147483648).max(2147483647).nullable()}).strict(),j({status:D([`DENIED`,`FAILED`,`UNKNOWN_OUTCOME`]),failureCode:Ft,outputDigest:jt.nullable(),outputBytes:T().int().nonnegative().max(262144).nullable(),exitCode:T().int().min(-2147483648).max(2147483647).nullable()}).strict()]),Vt=Rt.extend({type:k(`FINISH_WORKSPACE_TOOL_CALL`),payload:j({callId:P,outcome:Bt}).strict()}),Ht=j({schemaVersion:N,type:k(`WORKSPACE_TOOL_CALL_CHANGED`),replayed:b(),call:It,events:w(Lt).max(1)}).strict(),Ut=D([`ISOLATED_WORKTREE`,`SHARED_CURRENT_DIRECTORY`]),Wt=j({schemaVersion:N,projectId:P,strategy:Ut,projectVersion:T().int().positive(),updatedAt:I}).strict(),Gt=j({schemaVersion:N,selection:Wt}).strict(),Kt=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict().extend({type:k(`PROJECT_WORKSPACE_STRATEGY_CHANGED`),data:j({selection:Wt,previousStrategy:Ut}).strict()}),qt=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict().extend({type:k(`SET_PROJECT_WORKSPACE_STRATEGY`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),strategy:Ut}).strict()}),Jt=j({schemaVersion:N,replayed:b(),type:k(`PROJECT_WORKSPACE_STRATEGY_CHANGED`),selection:Wt,event:Kt}).strict();j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),strategy:Ut}).strict();var Yt=C().regex(/^[0-9a-f]{40}$/),Xt=C().trim().min(1).max(255),Zt=C().trim().min(1).max(4e3),Qt=w(C().trim().min(1).max(4096)).max(500),$t=D([`READY`,`ORPHANED`,`REMOVED`]),en=j({schemaVersion:N,id:P,projectId:P,workItemId:P,strategy:Ut.default(`ISOLATED_WORKTREE`),branch:Xt,worktreePath:Zt,baseCommit:Yt.nullable(),snapshotCommit:Yt.nullable(),status:$t,leaseHolder:P.nullable(),createdAt:I,version:T().int().positive()}).strict(),tn=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),nn=tn.extend({type:k(`WORK_ITEM_WORKSPACE_CREATED`),aggregateType:k(`WORK_ITEM`),data:j({workspace:en,carriedPaths:Qt}).strict()}),rn=tn.extend({type:k(`WORK_ITEM_WORKSPACE_ORPHANED`),aggregateType:k(`WORK_ITEM`),data:j({workspace:en,previousStatus:$t}).strict()}),an=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),on=an.extend({type:k(`CREATE_WORK_ITEM_WORKSPACE`),payload:j({workItemId:P,projectId:P,strategy:Ut.optional(),branch:Xt,worktreePath:Zt,baseCommit:Yt.nullable(),snapshotCommit:Yt.nullable(),carriedPaths:Qt,initialLeaseHolder:P.optional()}).strict()}),sn=an.extend({type:k(`ACQUIRE_WORKSPACE_LEASE`),payload:j({workspaceId:P,stageAttemptId:P,expectedVersion:T().int().positive()}).strict()}),cn=an.extend({type:k(`RELEASE_WORKSPACE_LEASE`),payload:j({workspaceId:P,stageAttemptId:P,expectedVersion:T().int().positive()}).strict()}),ln=an.extend({type:k(`MARK_WORKSPACE_ORPHANED`),payload:j({workspaceId:P,expectedVersion:T().int().positive()}).strict()}),un=j({schemaVersion:N,type:k(`WORK_ITEM_WORKSPACE_CREATED`),replayed:b(),workItemId:P,workspace:en,event:nn}).strict(),dn=j({schemaVersion:N,type:k(`WORKSPACE_LEASE_ACQUIRED`),replayed:b(),workItemId:P,workspace:en,events:w(x())}).strict(),fn=j({schemaVersion:N,type:k(`WORKSPACE_LEASE_RELEASED`),replayed:b(),workItemId:P,workspace:en,events:w(x())}).strict(),pn=j({schemaVersion:N,type:k(`WORK_ITEM_WORKSPACE_ORPHANED`),replayed:b(),workItemId:P,workspace:en,event:rn}).strict(),mn=en.omit({leaseHolder:!0,id:!0,projectId:!0,workItemId:!0,createdAt:!0,version:!0}),hn=j({schemaVersion:N,workspace:mn.nullable()}).strict(),gn=D([`ADDED`,`MODIFIED`,`DELETED`,`RENAMED`]),_n=C().min(1).max(4096);Object.freeze({maxFiles:50,maxContentFiles:16,maxPatchBytesPerFile:4096,maxPatchBytesTotal:32768,maxRenderedPathBytes:512});var vn=T().int().nonnegative().nullable(),yn=j({path:_n,previousPath:_n.nullable(),status:gn,insertions:vn,deletions:vn,binary:b()}).strict(),bn=j({schemaVersion:N,baseline:Yt,files:w(yn),truncated:b()}).strict(),xn=j({schemaVersion:N,path:_n,baseline:Yt,binary:b(),patch:C().nullable(),truncated:b(),omittedBytes:T().int().nonnegative()}).strict(),Sn=j({schemaVersion:N,changes:bn.nullable()}).strict(),Cn=j({schemaVersion:N,diff:xn.nullable()}).strict(),wn=12,Tn=D([`PASSED`,`CHANGES_REQUESTED`]),En=D([`LOW`,`MEDIUM`,`HIGH`,`CRITICAL`]),Dn=D([`OPEN`,`RESOLVED`,`WAIVED`,`FALSE_POSITIVE`]),On=D([`WAIVED`,`FALSE_POSITIVE`]),kn=D([`CROSS_PROVIDER`,`SAME_PROVIDER`]),An=C().trim().min(1).max(200),jn=C().trim().min(1).max(4e3),Mn=C().regex(/^[0-9a-f]{40}$/),Nn={severity:En,title:An,description:jn,path:C().trim().min(1).max(1024).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`\\`),`Path must be relative`).refine(e=>!e.includes(`\\`),`Path must use portable forward slashes`).refine(e=>e.split(`/`).every(e=>e.length>0&&e!==`.`&&e!==`..`),`Path must not contain empty, current-directory, or parent-directory segments`).nullable(),startLine:T().int().positive().nullable(),endLine:T().int().positive().nullable(),reproduction:jn,criterion:C().trim().min(1).max(500).nullable(),suggestedFix:jn.nullable()},Pn=(e,t)=>{let n=e.path!==null,r=e.startLine!==null,i=e.endLine!==null;!n&&(r||i)&&t.addIssue({code:`custom`,message:`A line range requires a file path`}),r!==i&&t.addIssue({code:`custom`,message:`A line range requires both start and end`}),e.startLine!==null&&e.endLine!==null&&e.endLine<e.startLine&&t.addIssue({code:`custom`,message:`The finding line range is reversed`})},Fn=j(Nn).strict().superRefine(Pn),In={kind:k(`REVIEW_REPORT`),title:An,summary:jn,checks:w(C().trim().min(1).max(500)).min(1).max(20)},Ln=E([j({...In,verdict:k(`PASSED`),findings:w(Fn).max(0)}).strict(),j({...In,verdict:k(`CHANGES_REQUESTED`),findings:w(Fn).min(1).max(20)}).strict()]),Rn=j({...Nn,schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,correctionRunId:P.nullable(),verificationCorrectionRunId:P.nullable().optional(),reviewArtifactId:P,reviewedTree:Mn,ordinal:T().int().positive().max(20),status:Dn,resolutionReason:jn.nullable(),resolvedBy:L.nullable(),createdAt:I,resolvedAt:I.nullable(),version:T().int().positive()}).strict().superRefine(Pn).superRefine((e,t)=>{e.status!==`OPEN`!=(e.resolutionReason!==null&&e.resolvedBy!==null&&e.resolvedAt!==null)&&t.addIssue({code:`custom`,message:`A terminal finding requires complete resolution attribution and an open one requires none`})}),zn=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,correctionRunId:P.nullable(),verificationCorrectionRunId:P.nullable().optional(),authorAgentRunId:P,reviewerAgentRunId:P,providerRelation:kn,reviewedTree:Mn,round:T().int().positive().max(3),title:An,summary:jn,checks:w(C().trim().min(1).max(500)).min(1).max(20),verdict:Tn,findingIds:w(P).max(20),createdAt:I}).strict().superRefine((e,t)=>{e.authorAgentRunId===e.reviewerAgentRunId&&t.addIssue({code:`custom`,message:`A reviewer AgentRun cannot be the author AgentRun`}),e.verdict===`PASSED`&&e.findingIds.length!==0&&t.addIssue({code:`custom`,message:`A passed review cannot reference findings`}),e.verdict===`CHANGES_REQUESTED`&&e.findingIds.length===0&&t.addIssue({code:`custom`,message:`A changes-requested review requires finding IDs`}),new Set(e.findingIds).size!==e.findingIds.length&&t.addIssue({code:`custom`,message:`A review report cannot repeat a finding ID`})});D([`ADVANCE_TO_QA`,`QUEUE_FIX`,`WAIT_FOR_OWNER`]);var Bn=j({schemaVersion:N,reports:w(zn.extend({authorProvider:qe,reviewerProvider:qe})).max(wn),findings:w(Rn).max(200)}).strict();j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),disposition:On,reason:jn}).strict();var Vn=C().regex(/^[0-9a-f]{64}$/),Hn=e=>{let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r<=127?t+=1:r<=2047?t+=2:r>=55296&&r<=56319&&n+1<e.length&&e.charCodeAt(n+1)>=56320&&e.charCodeAt(n+1)<=57343?(t+=4,n+=1):t+=3}return t},Un=/[<>:"\\|?*]|\p{Cc}/u,Wn=C().min(1).max(240).refine(e=>{if(e===`.`)return!0;if(e.startsWith(`/`)||e.startsWith(`\\`)||/^[A-Za-z]:[/\\]/u.test(e))return!1;let t=e.split(`/`);return e===e.normalize(`NFC`)&&Hn(e)<=240&&t.every(e=>e.length>0&&e!==`.`&&e!==`..`&&!Un.test(e)&&!/[ .]$/u.test(e))},`Verification cwd must be a portable directory below the Project root`),Gn=C().min(1).refine(e=>!e.includes(`\0`),`Verification argv cannot contain NUL`).refine(e=>Hn(e)<=256,`Verification argv items cannot exceed 256 UTF-8 bytes`),Kn=D([`LINT`,`BUILD`,`UNIT`,`INTEGRATION`,`E2E`,`AUDIT`,`SERVE`,`CUSTOM`]),qn=D([`pnpm`,`npm`,`yarn`,`bun`,`node`]),Jn=k(`VERIFICATION_BASELINE`),Yn=D([`INHERIT_HOST`,`DENIED_UNAVAILABLE`]),Xn=D([`lint`,`build`,`test`,`test:unit`,`test:integration`,`test:e2e`,`audit`,`start`,`dev`,`preview`]),Zn=j({source:k(`PACKAGE_JSON_SCRIPT`),manifestPath:k(`package.json`),manifestContentHash:Vn,scriptName:Xn,scriptBodyPreview:C().min(1).max(1024).refine(e=>!e.includes(`\0`))}).strict(),Qn=j({schemaVersion:N,id:P,kind:Kn,label:C().trim().min(1).max(120),required:b(),executable:qn,argv:w(Gn).min(1).max(16),cwd:Wn,timeoutSeconds:T().int().min(1).max(900),outputLimitBytes:T().int().min(1024).max(262144),environmentProfile:Jn,networkPolicy:Yn,provenance:Zn}).strict().superRefine((e,t)=>{e.kind===`SERVE`&&e.required&&t.addIssue({code:`custom`,path:[`required`],message:`A long-running service recipe cannot be part of a finite required verification run`});let n=[`start`,`dev`,`preview`];e.kind===`SERVE`&&!n.includes(e.provenance.scriptName)&&t.addIssue({code:`custom`,path:[`provenance`,`scriptName`],message:`A SERVE recipe must name an approved service package script`}),e.kind!==`SERVE`&&n.includes(e.provenance.scriptName)&&t.addIssue({code:`custom`,path:[`kind`],message:`Service package scripts are reserved for SERVE recipes`}),e.kind===`AUDIT`!=(e.provenance.scriptName===`audit`)&&t.addIssue({code:`custom`,path:[`kind`],message:`The audit package script is reserved for an AUDIT recipe`})}),$n=D([`MANIFEST_ABSENT`,`MANIFEST_INVALID`,`MANIFEST_TOO_LARGE`,`MANIFEST_SYMLINK`,`SCRIPT_LIMIT_REACHED`,`SCRIPT_UNSAFE`,`NO_SUPPORTED_SCRIPTS`,`PLAN_TARGET_BLOCKED`]),er=j({code:$n,path:D([`package.json`,`.loomrail/verification-plan.json`]).nullable(),message:C().trim().min(1).max(500)}).strict(),tr=O(`state`,[j({state:k(`ABSENT`),digest:re()}).strict(),j({state:k(`PRESENT`),digest:Vn}).strict(),j({state:k(`BLOCKED`),digest:re()}).strict()]),nr=j({schemaVersion:N,projectId:P,target:tr,recipes:w(Qn).max(12),warnings:w(er).max(32),proposalHash:Vn}).strict().superRefine((e,t)=>{e.recipes.length>0&&!e.recipes.some(e=>e.required)&&t.addIssue({code:`custom`,path:[`recipes`],message:`A verification proposal must contain at least one required recipe`}),new Set(e.recipes.map(e=>e.id)).size!==e.recipes.length&&t.addIssue({code:`custom`,path:[`recipes`],message:`Verification recipe ids must be unique`})}),rr=D([`ACTIVE`,`DISABLED`]),ir=j({schemaVersion:N,id:P,projectId:P,revision:T().int().positive(),status:rr,recipes:w(Qn).min(1).max(12),sourceProposalHash:Vn,contentHash:Vn,createdAt:I}).strict().superRefine((e,t)=>{e.recipes.some(e=>e.required)||t.addIssue({code:`custom`,path:[`recipes`],message:`A verification plan must contain at least one required recipe`}),new Set(e.recipes.map(e=>e.id)).size!==e.recipes.length&&t.addIssue({code:`custom`,path:[`recipes`],message:`Verification recipe ids must be unique`})}),ar=D([`PENDING`,`APPLIED`,`FAILED`]),or=D([`REPOSITORY_UNAVAILABLE`,`TARGET_OUTSIDE_REPOSITORY`,`TARGET_UNREADABLE`,`TARGET_UNRECOGNIZED`,`TARGET_CHANGED`,`PROPOSAL_CHANGED`,`CONTENT_HASH_MISMATCH`,`WRITE_FAILED`]),sr=j({schemaVersion:N,id:P,projectId:P,planId:P,targetPath:k(`.loomrail/verification-plan.json`),expectedTargetDigest:Vn.nullable(),contentHash:Vn,status:ar,attempts:T().int().nonnegative(),lastErrorCode:or.nullable(),version:T().int().positive(),createdAt:I,updatedAt:I,appliedAt:I.nullable()}).strict(),cr=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),lr=D([`AUTHORIZE_FINAL`,`CANCEL`]),ur=cr.extend({type:k(`ADOPT_VERIFICATION_PLAN`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),proposal:nr}).strict()}),dr=cr.extend({type:k(`DISABLE_VERIFICATION_PLAN`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:Vn,expectedTargetDigest:Vn.nullable()}).strict()}),fr=cr.extend({type:k(`COMPLETE_VERIFICATION_PLAN_PUBLICATION`),payload:j({publicationId:P,expectedVersion:T().int().positive()}).strict()}),pr=cr.extend({type:k(`FAIL_VERIFICATION_PLAN_PUBLICATION`),payload:j({publicationId:P,expectedVersion:T().int().positive(),errorCode:or}).strict()}),mr=cr.extend({type:k(`RETRY_VERIFICATION_PLAN_PUBLICATION`),payload:j({projectId:P,publicationId:P,expectedVersion:T().int().positive()}).strict()}),hr=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),gr=hr.extend({type:k(`VERIFICATION_PLAN_ADOPTED`),data:j({plan:ir,publication:sr,previousPlanRevision:T().int().positive().nullable()}).strict()}),_r=hr.extend({type:k(`VERIFICATION_PLAN_DISABLED`),data:j({plan:ir,publication:sr,previousPlanRevision:T().int().positive()}).strict()}),vr=j({plan:ir,publication:sr}).strict(),yr=hr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_APPLIED`),data:vr}),br=hr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_FAILED`),data:vr}),xr=hr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_RETRIED`),data:vr}),Sr=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_PLAN_ADOPTED`),plan:ir,publication:sr,event:gr}).strict(),Cr=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_PLAN_DISABLED`),plan:ir,publication:sr,event:_r}).strict(),wr=j({schemaVersion:N,replayed:b(),plan:ir,publication:sr}).strict(),Tr=wr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_APPLIED`),event:yr}),Er=wr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_FAILED`),event:br}),Dr=wr.extend({type:k(`VERIFICATION_PLAN_PUBLICATION_RETRIED`),event:xr});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),proposalHash:Vn}).strict(),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:Vn}).strict(),j({schemaVersion:N,commandId:P,publicationId:P,expectedVersion:T().int().positive()}).strict(),j({schemaVersion:N,commandId:P,expectedWorkItemVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:Vn}).strict().extend({retryOfRunId:P,expectedRetryOfRunVersion:T().int().positive()}),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive()}).strict(),j({schemaVersion:N,commandId:P,expectedRequestVersion:T().int().positive(),correctionRunId:P.nullable(),expectedCorrectionVersion:T().int().positive().nullable(),qaCorrectionRunId:P.nullable().optional(),expectedQACorrectionVersion:T().int().positive().nullable().optional(),expectedPipelineRunVersion:T().int().positive(),action:lr}).strict().superRefine((e,t)=>{let n=e.correctionRunId===null==(e.expectedCorrectionVersion===null),r=e.qaCorrectionRunId??null,i=e.expectedQACorrectionVersion??null,a=r===null==(i===null);n||t.addIssue({code:`custom`,message:`A verification correction ID and expected version must be supplied together`}),a||t.addIssue({code:`custom`,message:`A QA correction ID and expected version must be supplied together`}),e.correctionRunId===null&&r===null&&t.addIssue({code:`custom`,message:`A verification gate must identify a current evaluator correction`})});var Or=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),proposal:nr,plan:ir.nullable(),publication:sr.nullable()}).strict().superRefine((e,t)=>{(e.proposal.projectId!==e.projectId||e.plan!==null&&e.plan.projectId!==e.projectId)&&t.addIssue({code:`custom`,path:[`projectId`],message:`Verification settings cannot cross Project identities`}),e.publication!==null&&(e.plan===null||e.publication.projectId!==e.projectId||e.publication.planId!==e.plan.id)&&t.addIssue({code:`custom`,path:[`publication`],message:`Verification publication must belong to the returned Plan`})}),kr=C().regex(/^[0-9a-f]{40}$/),Ar=D([`darwin`,`linux`,`win32`]),jr=D([`QUEUED`,`RUNNING`,`CANCELLING`,`PASSED`,`FAILED`,`ERROR`,`INTERRUPTED`]),Mr=D([`QUEUED`,`RUNNING`,`PASSED`,`FAILED`,`ERROR`,`INTERRUPTED`]),Nr=D([`RECIPE_NOT_APPROVED`,`POLICY_UNAVAILABLE`,`CWD_INVALID`,`EXECUTABLE_NOT_FOUND`,`SPAWN_FAILED`,`OUTPUT_LIMIT_REACHED`,`TIMED_OUT`,`TREE_MUTATED`,`TREE_UNAVAILABLE`,`OUTPUT_WRITE_FAILED`,`PROCESS_TERMINATION_FAILED`,`EXIT_UNOBSERVED`,`RUNNER_INTERNAL_ERROR`]),Pr=D([`ALL_REQUIRED_PASSED`,`REQUIRED_CHECK_FAILED`,`REQUIRED_CHECK_ERROR`,`OWNER_CANCELLED`,`DAEMON_RESTART`]),Fr=D([`CURRENT`,`STALE`]),Ir=D([`PLAN_UNAVAILABLE`,`PLAN_REPLACED`,`PLAN_UNPUBLISHED`,`TREE_CHANGED`]),Lr=j({schemaVersion:N,projectId:P,workItemId:P,pipelineRunId:P,verificationRunId:P,planId:P,planRevision:T().int().positive(),planContentHash:Vn,implementationTree:kr,platform:Ar,requiredCheckIds:w(P).min(1).max(12),optionalFailedCheckIds:w(P).max(12),completedAt:I}).strict().superRefine((e,t)=>{let n=[...e.requiredCheckIds,...e.optionalFailedCheckIds];new Set(n).size!==n.length&&t.addIssue({code:`custom`,path:[`requiredCheckIds`],message:`Verification evidence Check identities must be unique`})}),Rr=j({schemaVersion:N,artifactId:P,sha256:Vn,capturedBytes:T().int().nonnegative().max(262144),stdoutBytes:T().int().nonnegative(),stderrBytes:T().int().nonnegative(),truncated:b(),available:b()}).strict().superRefine((e,t)=>{let n=e.stdoutBytes+e.stderrBytes;e.capturedBytes>n&&t.addIssue({code:`custom`,path:[`capturedBytes`],message:`Captured verification output cannot exceed observed output`}),!e.truncated&&e.capturedBytes<n&&t.addIssue({code:`custom`,path:[`truncated`],message:`Verification output must report truncation when raw bytes were dropped; bounded channel metadata may also require truncation`})}),zr=D([`DELETED`,`ALREADY_ABSENT`]),Br=j({schemaVersion:N,id:P,projectId:P,workItemId:P,runId:P,recipeId:P,ordinal:T().int().min(1).max(12),required:b(),status:Mr,startedAt:I.nullable(),completedAt:I.nullable(),durationMs:T().int().nonnegative().max(2**53-1).nullable(),exitCode:T().int().min(-2147483648).max(2147483647).nullable(),signal:C().regex(/^SIG[A-Z0-9]+$/).max(32).nullable(),errorCode:Nr.nullable(),output:Rr.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{let n=(e,n)=>{t.addIssue({code:`custom`,path:[e],message:n})};if(e.status===`QUEUED`){(e.startedAt!==null||e.completedAt!==null||e.durationMs!==null||e.exitCode!==null||e.signal!==null||e.errorCode!==null||e.output!==null)&&n(`status`,`A queued verification Check cannot carry measured evidence`);return}if(e.status===`RUNNING`){(e.startedAt===null||e.completedAt!==null||e.durationMs!==null||e.exitCode!==null||e.signal!==null||e.errorCode!==null||e.output!==null)&&n(`status`,`A running verification Check can only carry its start time`);return}e.completedAt===null&&n(`completedAt`,`A terminal verification Check must complete`),e.startedAt===null&&n(`startedAt`,`A terminal verification Check must have started`),e.durationMs===null&&n(`durationMs`,`A terminal verification Check needs duration`),e.status===`PASSED`?(e.exitCode!==0||e.signal!==null||e.errorCode!==null||e.output===null)&&n(`status`,`A passing verification Check requires observed exit code zero and output evidence`):e.status===`FAILED`?(e.exitCode===null||e.exitCode===0||e.signal!==null||e.errorCode!==null||e.output===null)&&n(`status`,`A failed verification Check requires an observed non-zero exit and output evidence`):e.status===`ERROR`?e.errorCode===null&&n(`errorCode`,`An errored verification Check needs a typed error`):e.errorCode!==null&&n(`errorCode`,`An interrupted verification Check cannot claim an infrastructure error`)}),Vr=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,workspaceId:P,planId:P,planRevision:T().int().positive(),planContentHash:Vn,implementationTree:kr,ordinal:T().int().positive(),retryOfRunId:P.nullable(),verificationCorrectionRunId:P.nullable().optional(),platform:Ar,status:jr,currentCheckId:P.nullable(),terminalReason:Pr.nullable(),startedAt:I.nullable(),completedAt:I.nullable(),createdAt:I,version:T().int().positive()}).strict().superRefine((e,t)=>{let n=e=>{t.addIssue({code:`custom`,path:[`status`],message:e})};if(e.status===`QUEUED`){(e.currentCheckId!==null||e.terminalReason!==null||e.startedAt!==null||e.completedAt!==null)&&n(`A queued verification Run cannot carry execution state`);return}if(e.status===`RUNNING`){(e.startedAt===null||e.completedAt!==null||e.terminalReason!==null)&&n(`A running verification Run requires a start and no terminal state`);return}if(e.status===`CANCELLING`){(e.completedAt!==null||e.terminalReason!==null)&&n(`A cancelling verification Run keeps its execution state until process stop is confirmed`);return}(e.status!==`INTERRUPTED`&&e.startedAt===null||e.completedAt===null||e.currentCheckId!==null)&&n(`A terminal verification Run requires valid timestamps and no current Check`),e.status===`PASSED`&&e.terminalReason===`ALL_REQUIRED_PASSED`||e.status===`FAILED`&&e.terminalReason===`REQUIRED_CHECK_FAILED`||e.status===`ERROR`&&e.terminalReason===`REQUIRED_CHECK_ERROR`||e.status===`INTERRUPTED`&&(e.terminalReason===`OWNER_CANCELLED`||e.terminalReason===`DAEMON_RESTART`)||n(`A terminal verification Run has a contradictory reason`)}),Hr=D([`REQUIRED_CHECK_FAILED`,`REQUIRED_CHECK_ERROR`,`RUN_INTERRUPTED`,`STALE`]),Ur=D([`ACTIVE`,`PASSED`,`SUPERSEDED`,`EXHAUSTED`,`CANCELLED`]),Wr=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,verificationRunId:P,verificationCheckId:P.nullable(),planId:P,planRevision:T().int().positive(),planContentHash:Vn,implementationTree:kr,reason:Hr,staleReasons:w(Ir).max(4),createdAt:I}).strict().superRefine((e,t)=>{let n=e.reason===`STALE`;n!==e.staleReasons.length>0&&t.addIssue({code:`custom`,path:[`staleReasons`],message:`Only a stale verification failure carries stale reasons`}),(e.reason===`REQUIRED_CHECK_FAILED`||e.reason===`REQUIRED_CHECK_ERROR`)&&e.verificationCheckId===null&&t.addIssue({code:`custom`,path:[`verificationCheckId`],message:`A failed verification Check must identify its measured source`}),n&&e.verificationCheckId!==null&&t.addIssue({code:`custom`,path:[`verificationCheckId`],message:`A stale Run failure is not attributed to one Check`})}),Gr=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,budgetPosition:T().int().min(1).max(3),automatic:b(),sourceFailureId:P,sourceVerificationRunId:P,sourceImplementationTree:kr,resumesQACorrectionRunId:P.nullable().optional(),status:Ur,createdAt:I,completedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{e.automatic!==e.budgetPosition<=2&&t.addIssue({code:`custom`,path:[`automatic`],message:`Only the first two correction positions are automatic`}),(e.status===`PASSED`||e.status===`SUPERSEDED`||e.status===`CANCELLED`)!=(e.completedAt!==null)&&t.addIssue({code:`custom`,path:[`completedAt`],message:`Only a terminal verification correction carries completion time`})}),Kr=O(`status`,[j({status:k(`PASSED`),completedAt:I,durationMs:T().int().nonnegative().max(1e6),exitCode:k(0),signal:re(),output:Rr}).strict(),j({status:k(`FAILED`),completedAt:I,durationMs:T().int().nonnegative().max(1e6),exitCode:T().int().refine(e=>e!==0),signal:re(),output:Rr}).strict(),j({status:k(`ERROR`),completedAt:I,durationMs:T().int().nonnegative().max(1e6),exitCode:T().int().nullable(),signal:C().regex(/^SIG[A-Z0-9]+$/).max(32).nullable(),errorCode:Nr,output:Rr.nullable()}).strict(),j({status:k(`INTERRUPTED`),completedAt:I,durationMs:T().int().nonnegative().max(1e6),exitCode:T().int().nullable(),signal:C().regex(/^SIG[A-Z0-9]+$/).max(32).nullable(),reason:k(`OWNER_CANCELLED`),output:Rr.nullable()}).strict()]),qr=j({workItemId:P,expectedWorkItemVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:Vn,implementationTree:kr,platform:Ar}).strict(),Jr=cr.extend({type:k(`START_VERIFICATION_RUN`),payload:qr}),Yr=cr.extend({type:k(`RETRY_VERIFICATION_RUN`),payload:qr.extend({retryOfRunId:P,expectedRetryOfRunVersion:T().int().positive()})}),Xr=cr.extend({type:k(`MATERIALIZE_STALE_VERIFICATION_FAILURE`),payload:j({workItemId:P,verificationRunId:P,expectedWorkItemVersion:T().int().positive(),expectedPipelineRunVersion:T().int().positive(),expectedStageAttemptVersion:T().int().positive(),expectedVerificationRunVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:Vn,currentTree:kr}).strict()}),Zr=cr.extend({type:k(`START_VERIFICATION_CHECK`),payload:j({runId:P,checkId:P,expectedRunVersion:T().int().positive(),expectedCheckVersion:T().int().positive()}).strict()}),Qr=cr.extend({type:k(`COMPLETE_VERIFICATION_CHECK`),payload:j({runId:P,checkId:P,expectedRunVersion:T().int().positive(),expectedCheckVersion:T().int().positive(),observation:Kr,outputStorageKey:C().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]*\.txt$/).max(255).nullable()}).strict().superRefine((e,t)=>{e.observation.output===null!=(e.outputStorageKey===null)&&t.addIssue({code:`custom`,path:[`outputStorageKey`],message:`Output evidence and its storage key must be recorded together`})})}),$r=cr.extend({type:k(`CANCEL_VERIFICATION_RUN`),payload:j({runId:P,expectedRunVersion:T().int().positive()}).strict()}),ei=cr.extend({type:k(`FINALIZE_VERIFICATION_RUN_CANCELLATION`),payload:j({runId:P,expectedRunVersion:T().int().positive()}).strict()}),ti=cr.extend({type:k(`INTERRUPT_VERIFICATION_RUN`),payload:j({runId:P,expectedRunVersion:T().int().positive(),reason:k(`DAEMON_RESTART`)}).strict()}),ni=cr.extend({type:k(`RECORD_VERIFICATION_OUTPUT_RETENTION`),payload:j({artifactId:P,outcome:zr}).strict()}),ri=cr.extend({type:k(`RESOLVE_VERIFICATION_CORRECTION_GATE`),payload:j({humanRequestId:P,expectedRequestVersion:T().int().positive(),correctionRunId:P.nullable(),expectedCorrectionVersion:T().int().positive().nullable(),qaCorrectionRunId:P.nullable().optional(),expectedQACorrectionVersion:T().int().positive().nullable().optional(),expectedPipelineRunVersion:T().int().positive(),action:lr}).strict().superRefine((e,t)=>{let n=e.correctionRunId===null==(e.expectedCorrectionVersion===null),r=e.qaCorrectionRunId??null,i=e.expectedQACorrectionVersion??null,a=r===null==(i===null);n||t.addIssue({code:`custom`,message:`A verification correction ID and expected version must be supplied together`}),a||t.addIssue({code:`custom`,message:`A QA correction ID and expected version must be supplied together`}),e.correctionRunId===null&&r===null&&t.addIssue({code:`custom`,message:`A verification gate must identify a current evaluator correction`})})}),ii=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`WORK_ITEM`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),ai=ii.extend({type:k(`VERIFICATION_RUN_RESERVED`),data:j({run:Vr,checks:w(Br).min(1).max(12)}).strict()}),oi=ii.extend({type:k(`VERIFICATION_CHECK_STARTED`),data:j({run:Vr,check:Br}).strict()}),si=ii.extend({type:k(`VERIFICATION_CHECK_COMPLETED`),data:j({run:Vr,check:Br}).strict()}),ci=ii.extend({type:k(`VERIFICATION_RUN_INTERRUPTED`),data:j({run:Vr,interruptedCheck:Br.nullable()}).strict()}),li=ii.extend({type:k(`VERIFICATION_RUN_CANCELLATION_REQUESTED`),data:j({run:Vr}).strict()}),ui=ii.extend({type:k(`VERIFICATION_FAILURE_RECORDED`),data:j({failure:Wr}).strict()}),di=ii.extend({type:k(`VERIFICATION_CORRECTION_STARTED`),data:j({correctionRun:Gr}).strict()}),fi=ii.extend({type:k(`VERIFICATION_CORRECTION_PASSED`),data:j({correctionRun:Gr}).strict()}),pi=ii.extend({type:k(`VERIFICATION_CORRECTION_SUPERSEDED`),data:j({correctionRun:Gr}).strict()}),mi=ii.extend({type:k(`VERIFICATION_CORRECTION_EXHAUSTED`),data:j({correctionRun:Gr,canAuthorizeFinal:b()}).strict()}),hi=ii.extend({type:k(`VERIFICATION_CORRECTION_CANCELLED`),data:j({correctionRun:Gr}).strict()}),gi=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_RUN_RESERVED`),run:Vr,checks:w(Br).min(1).max(12),event:ai}).strict(),_i=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_CHECK_STARTED`),run:Vr,check:Br,event:oi}).strict(),vi=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_CHECK_COMPLETED`),run:Vr,check:Br,next:D([`START_NEXT_CHECK`,`TERMINAL`]),event:si}).strict(),yi=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_RUN_INTERRUPTED`),run:Vr,interruptedCheck:Br.nullable(),event:ci}).strict(),bi=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_RUN_CANCELLATION_REQUESTED`),run:Vr,event:li}).strict(),xi=j({schemaVersion:N,replayed:b(),type:k(`VERIFICATION_OUTPUT_RETENTION_RECORDED`),artifactId:P,outcome:zr,recordedAt:I}).strict(),Si=j({schemaVersion:N,run:Vr,plan:ir,checks:w(Br).min(1).max(12),freshness:Fr,staleReasons:w(Ir).max(4)}).strict().superRefine((e,t)=>{(e.plan.id!==e.run.planId||e.plan.projectId!==e.run.projectId||e.plan.revision!==e.run.planRevision||e.plan.contentHash!==e.run.planContentHash)&&t.addIssue({code:`custom`,path:[`plan`],message:`A verification snapshot must carry the exact Plan reserved by its Run`}),e.checks.some(t=>t.runId!==e.run.id||t.projectId!==e.run.projectId||t.workItemId!==e.run.workItemId)&&t.addIssue({code:`custom`,path:[`checks`],message:`Verification Checks cannot cross Run identities`});let n=e.checks.map(e=>e.ordinal);new Set(n).size!==n.length&&t.addIssue({code:`custom`,path:[`checks`],message:`Check ordinals must be unique`}),(e.freshness===`CURRENT`&&e.staleReasons.length!==0||e.freshness===`STALE`&&e.staleReasons.length===0)&&t.addIssue({code:`custom`,path:[`freshness`],message:`Verification freshness must match its reasons`})}),Ci=j({schemaVersion:N,runs:w(Si).max(100),failures:w(Wr).max(100),correctionRuns:w(Gr).max(100)}).strict(),wi=3,Ti=wi*50,Ei=33554432,Di=1073741824,Oi=C().trim().min(1).max(200),ki=C().trim().min(1).max(4e3),Ai=C().trim().min(1).max(1e3),ji=C().regex(/^[0-9a-f]{40}$/),Mi=C().regex(/^sha256:[0-9a-f]{64}$/),Ni=C().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,`Storage key segment is not portable`).refine(e=>!/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(e),`Storage key segment is reserved on Windows`),Pi=e=>{if(e===`localhost`||e===`[::1]`)return!0;let t=e.split(`.`);return t.length!==4||t[0]!==`127`?!1:t.every(e=>/^\d{1,3}$/.test(e)&&Number(e)<=255)},Fi=e=>{for(let t=0;t<e.length;t+=1)if(e.charCodeAt(t)<=31)return!0;return!1},Ii=ee().max(2048).superRefine((e,t)=>{let n=/^(?:https?):\/\/(localhost|127(?:\.\d{1,3}){3}|\[::1\])(?::([1-9]\d{0,4}))?$/.exec(e);if(!n||!Pi(n[1]??``)){t.addIssue({code:`custom`,message:`QA target must be a bare origin without credentials`});return}let r=n[2];r!==void 0&&Number(r)>65535&&t.addIssue({code:`custom`,message:`QA target origin port is outside the valid range`})}),Li=k(`PLAYWRIGHT`),Ri=D([`RUNNING`,`PASSED`,`FAILED`,`ERROR`]),zi=D([`PASSED`,`FAILED`]),Bi=D([`LIGHT`,`DARK`]),Vi=D([`CONSOLE`,`NETWORK`]),Hi=D([`INFO`,`WARNING`,`ERROR`]),Ui=D([`SCREENSHOT`,`TRACE`]),Wi=k(`STANDARD_30_DAYS`),Gi=D([`DELETED`,`ALREADY_ABSENT`]),Ki=D([`LOW`,`MEDIUM`,`HIGH`,`CRITICAL`]),qi=D([`OPEN`,`RESOLVED`,`WAIVED`]),Ji=D([`ACTIVE`,`PASSED`,`SUPERSEDED`,`EXHAUSTED`,`CANCELLED`]),Yi=[`FAILED_CHECK`,`BLOCKING_OBSERVATION`,`OPEN_DEFECT`,`REGRESSION`],Xi=D(Yi),Zi=D([`TARGET_UNHEALTHY`,`DRIVER_CRASHED`,`ORIGIN_FORBIDDEN`,`TIMEOUT`,`EVIDENCE_INVALID`]),Qi=O(`type`,[j({type:k(`FULL`)}).strict(),j({type:k(`RETEST`),correctionRunId:P,retestPlanId:P}).strict()]),$i=j({width:T().int().min(240).max(7680),height:T().int().min(240).max(4320)}).strict(),ea=j({id:P,viewport:$i,locale:C().trim().min(2).max(35).regex(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/),theme:Bi}).strict(),ta=O(`by`,[j({by:k(`ROLE`),role:D([`button`,`checkbox`,`dialog`,`heading`,`link`,`listitem`,`menuitem`,`radio`,`region`,`tab`,`textbox`]),name:Oi}).strict(),j({by:k(`TEST_ID`),value:C().trim().min(1).max(200)}).strict(),j({by:k(`TEXT`),value:Oi}).strict()]),na=C().trim().min(1).max(2048).regex(/^\/(?!\/)[^\\]*$/,`Navigation target must be a same-origin absolute path`).refine(e=>!Fi(e),`Navigation target cannot contain control characters`),ra=O(`type`,[j({type:k(`NAVIGATE`),path:na}).strict(),j({type:k(`CLICK`),locator:ta}).strict(),j({type:k(`PRESS`),locator:ta,key:D([`Tab`,`Shift+Tab`,`Enter`,`Space`,`Escape`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`])}).strict(),j({type:k(`WAIT_FOR_IDLE`)}).strict()]),ia=O(`type`,[j({type:k(`VISIBLE`),locator:ta}).strict(),j({type:k(`TEXT_CONTAINS`),locator:ta,expected:Ai}).strict(),j({type:k(`URL_PATH`),path:na}).strict(),j({type:k(`NO_HORIZONTAL_OVERFLOW`)}).strict(),j({type:k(`FOCUSED`),locator:ta}).strict()]),aa=j({id:P,title:Oi,action:ra}).strict(),oa=j({id:P,title:Oi,rule:ia}).strict(),sa=j({id:P,title:Oi,steps:w(aa).min(1).max(50),assertions:w(oa).min(1).max(50)}).strict().superRefine((e,t)=>{new Set(e.steps.map(({id:e})=>e)).size!==e.steps.length&&t.addIssue({code:`custom`,message:`QA scenario step IDs must be unique`}),new Set(e.assertions.map(({id:e})=>e)).size!==e.assertions.length&&t.addIssue({code:`custom`,message:`QA scenario assertion IDs must be unique`})}),ca=j({schemaVersion:N,revision:T().int().positive(),contentHash:Mi,targets:w(ea).min(1).max(24),scenarios:w(sa).min(1).max(20)}).strict().superRefine((e,t)=>{new Set(e.targets.map(({id:e})=>e)).size!==e.targets.length&&t.addIssue({code:`custom`,message:`QA target IDs must be unique`}),new Set(e.scenarios.map(({id:e})=>e)).size!==e.scenarios.length&&t.addIssue({code:`custom`,message:`QA scenario IDs must be unique`}),e.targets.length*e.scenarios.length+e.targets.length>50&&t.addIssue({code:`custom`,message:`QA matrix is too large for one screenshot per execution and one trace per target`})}),la=j({osFamily:D([`MACOS`,`WINDOWS`,`LINUX`]),runtimeName:k(`NODE`),runtimeVersion:C().trim().min(1).max(100),browserName:D([`CHROMIUM`,`FIREFOX`,`WEBKIT`]),browserVersion:C().trim().min(1).max(100)}).strict(),ua=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,verificationCorrectionRunId:P.nullable().optional(),agentRunId:P,driverId:Li,testedTree:ji,targetOrigin:Ii,plan:ca,scope:Qi,status:Ri,error:j({code:Zi,summary:Ai}).strict().nullable(),startedAt:I,completedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{e.status===`RUNNING`!=(e.completedAt===null)&&t.addIssue({code:`custom`,message:`Only a running QA run can omit completion time`}),e.status===`ERROR`!=(e.error!==null)&&t.addIssue({code:`custom`,message:`Only an errored QA run can carry a driver error`})}),da=j({id:P,status:zi,durationMs:T().int().nonnegative().max(36e5)}).strict(),fa=j({id:P,status:zi,details:Ai.nullable()}).strict(),pa=j({targetId:P,scenarioId:P,durationMs:T().int().nonnegative().max(36e5),steps:w(da).min(1).max(50),assertions:w(fa).min(1).max(50)}).strict(),ma=j({kind:Vi,severity:Hi,blocking:b(),targetId:P,scenarioId:P,summary:Ai}).strict(),ha=j({handle:P,kind:Ui,contentHash:Mi,byteSize:T().int().positive().max(Ei),targetId:P,scenarioId:P,capturedAt:I}).strict(),ga=ha.omit({handle:!0}).extend({schemaVersion:N,id:P,qaRunId:P,byteSize:T().int().positive().max(Di),retentionClass:Wi,storageKey:C().trim().min(1).max(1024).refine(e=>!e.startsWith(`/`)&&!e.includes(`\\`),`Storage key must be relative`).refine(e=>e.split(`/`).every(e=>Ni.safeParse(e).success),`Storage key must contain only portable segments`)}).strict(),_a=ga.omit({storageKey:!0}).strict(),va=j({handle:P,ref:ga}).strict(),ya=j({severity:Ki,title:Oi,description:ki,reproduction:w(Ai).min(1).max(20),targetId:P,scenarioId:P}).strict(),ba=ya.extend({schemaVersion:N,id:P,qaRunId:P,projectId:P,workItemId:P,testedTree:ji,ordinal:T().int().positive().max(50),status:qi,resolutionReason:ki.nullable(),resolvedByQARunId:P.nullable(),createdAt:I,resolvedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{let n=e.status===`OPEN`,r=e.resolutionReason!==null||e.resolvedAt!==null,i=e.resolutionReason!==null&&e.resolvedAt!==null;(n&&r||!n&&!i)&&t.addIssue({code:`custom`,message:`A terminal QA defect requires complete resolution data`}),(e.status===`RESOLVED`&&e.resolvedByQARunId===null||e.status!==`RESOLVED`&&e.resolvedByQARunId!==null)&&t.addIssue({code:`custom`,message:`Only an evidence-resolved QA defect carries its passing QA run identity`})}),xa=j({targetId:P,scenarioId:P,reasons:w(Xi).min(1).max(Yi.length)}).strict().superRefine((e,t)=>{new Set(e.reasons).size!==e.reasons.length&&t.addIssue({code:`custom`,message:`A QA retest cell cannot repeat a scope reason`}),[...e.reasons].sort((e,t)=>Yi.indexOf(e)-Yi.indexOf(t)).some((t,n)=>t!==e.reasons[n])&&t.addIssue({code:`custom`,message:`QA retest cell reasons must use canonical order`})}),Sa=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,correctionRunId:P,baselineQARunId:P,sourceQARunId:P,sourceEvidenceBundleId:P,baselinePlanRevision:T().int().positive(),baselinePlanContentHash:Mi,cells:w(xa).min(1).max(480),createdAt:I}).strict().superRefine((e,t)=>{let n=e.cells.map(({targetId:e,scenarioId:t})=>`${e}\u0000${t}`);new Set(n).size!==n.length&&t.addIssue({code:`custom`,message:`A QA retest plan cannot repeat a target/scenario cell`})}),Ca=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,ordinal:T().int().positive().max(wi),sourceQARunId:P,baselineQARunId:P,sourceEvidenceBundleId:P,sourceTestedTree:ji,defectIds:w(P).min(1).max(Ti),status:Ji,createdAt:I,completedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{new Set(e.defectIds).size!==e.defectIds.length&&t.addIssue({code:`custom`,message:`A QA correction run cannot repeat a defect ID`}),(e.status===`PASSED`||e.status===`SUPERSEDED`||e.status===`CANCELLED`)!=(e.completedAt!==null)&&t.addIssue({code:`custom`,message:`Only a terminal QA correction run can carry a completion time`})}),wa=j({outcome:k(`MEASURED`),environment:la,executions:w(pa).min(1).max(480),observations:w(ma).max(100),attachments:w(ha).max(50),defects:w(ya).max(50)}).strict(),Ta=j({outcome:k(`ERROR`),code:Zi,summary:Ai}).strict(),Ea=O(`outcome`,[wa,Ta]),Da=j({schemaVersion:N,id:P,qaRunId:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,verificationCorrectionRunId:P.nullable().optional(),testedTree:ji,verdict:D([`PASSED`,`FAILED`]),environment:la,executions:w(pa).min(1).max(480),observations:w(ma).max(100),attachmentIds:w(P).max(50),defectIds:w(P).max(50),createdAt:I}).strict().superRefine((e,t)=>{new Set(e.attachmentIds).size!==e.attachmentIds.length&&t.addIssue({code:`custom`,message:`QA evidence cannot repeat an attachment ID`}),new Set(e.defectIds).size!==e.defectIds.length&&t.addIssue({code:`custom`,message:`QA evidence cannot repeat a defect ID`}),e.verdict===`PASSED`&&e.defectIds.length!==0&&t.addIssue({code:`custom`,message:`Passed QA evidence cannot reference defects`}),e.verdict===`FAILED`&&e.defectIds.length===0&&t.addIssue({code:`custom`,message:`Failed QA evidence requires a defect`})}),Oa=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`WORK_ITEM`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),ka=Oa.extend({type:k(`QA_RUN_RESERVED`),data:j({qaRun:ua}).strict()}),Aa=Oa.extend({type:k(`QA_RUN_COMPLETED`),data:j({qaRun:ua,evidenceBundleId:P.nullable(),defectIds:w(P).max(50)}).strict()}),ja=Oa.extend({type:k(`QA_DEFECT_WAIVED`),data:j({defect:ba}).strict()}),Ma=Oa.extend({type:k(`QA_CORRECTION_STARTED`),data:j({correctionRun:Ca,retestPlan:Sa}).strict()}),Na=Oa.extend({type:k(`QA_CORRECTION_EXHAUSTED`),data:j({correctionRun:Ca,canAuthorizeFinal:b()}).strict()}),Pa=Oa.extend({type:k(`QA_CORRECTION_PASSED`),data:j({correctionRun:Ca,resolvedDefects:w(ba).max(Ti)}).strict()}),Fa=Oa.extend({type:k(`QA_CORRECTION_CANCELLED`),data:j({correctionRun:Ca}).strict()}),Ia=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),La=Ia.extend({type:k(`RESERVE_QA_RUN`),payload:j({stageAttemptId:P,agentRunId:P,testedTree:ji,targetOrigin:Ii,plan:ca,scope:Qi}).strict()}),Ra=Ia.extend({type:k(`COMPLETE_QA_RUN`),payload:j({qaRunId:P,expectedVersion:T().int().positive(),currentTree:ji,result:Ea,finalizedAttachments:w(va).max(50),completionMode:D([`FINALIZE_WORKFLOW`,`RECORD_MEASUREMENT`]).optional()}).strict()}),za=Ia.extend({type:k(`RECORD_QA_ATTACHMENT_RETENTION`),payload:j({attachmentId:P,outcome:Gi}).strict()}),Ba=Ia.extend({type:k(`WAIVE_QA_DEFECT`),payload:j({defectId:P,expectedVersion:T().int().positive(),reason:ki}).strict()});j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),reason:ki}).strict();var Va=j({schemaVersion:N,replayed:b()}).strict(),Ha=Va.extend({type:k(`QA_RUN_RESERVED`),workItemId:P,qaRun:ua,event:ka}),Ua=Va.extend({type:k(`QA_RUN_COMPLETED`),workItemId:P,qaRun:ua,evidence:Da.nullable(),attachments:w(ga).max(50),defects:w(ba).max(50),event:Aa}),Wa=Va.extend({type:k(`QA_ATTACHMENT_RETENTION_RECORDED`),attachmentId:P,outcome:Gi,recordedAt:I}),Ga=Va.extend({type:k(`QA_DEFECT_WAIVED`),workItemId:P,defect:ba,event:ja}),Ka=j({schemaVersion:N,runs:w(ua).max(20),evidence:w(Da).max(20),attachments:w(_a).max(1e3),defects:w(ba).max(1e3),correctionRuns:w(Ca).max(wi),retestPlans:w(Sa).max(wi)}).strict(),qa=C().regex(/^[0-9a-f]{40}$/),Ja=D([`DISCOVERY`,`PLAN`,`IMPLEMENT`,`REVIEW`,`QA`,`ACCEPTANCE`]),Ya=D([`RUNNING`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`,`INTERRUPTED`,`SUCCEEDED`,`FAILED`,`CANCELLED`]),Xa=D([`PENDING`,`QUEUED`,`RUNNING`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`,`SUCCEEDED`,`FAILED`,`CANCELLED`,`INTERRUPTED`,`RECOVERING`,`STALE`]),Za=D([`SINGLE_CHOICE`,`MULTIPLE_CHOICE`,`CONFIRMATION`,`FREE_TEXT`]),Qa=D([`OPEN`,`CLAIMED`,`SNOOZED`,`RESOLVED`,`EXPIRED`,`CANCELLED`]),$a=D([`START`,`RESUME`]),eo=D([`PENDING`,`COMPLETED`,`FAILED`]),to=D([`ACTUAL`,`PROVIDER_ESTIMATE`,`LOOMRAIL_ESTIMATE`]),no=k(`ESTIMATED_TOKENS`),ro=D([`SOFT`,`HARD`]),io=k(`DAEMON_RESTART`),ao=D([`REVIEW_REPORT`,`QA_REPORT`]),oo=k(`PASSED`),so=D([`PENDING`,`ACCEPTED`,`RETURNED`,`REJECTED`]),co=D([`ACCEPT`,`RETURN_TO_WORK`,`REJECT`]),lo=D([`RUNNING`,`ENDED`]),uo=D([`COMPLETED`,`HANDOFF`,`CONTEXT_EXHAUSTED`,`INTERRUPTED`,`CANCELLED`]),fo=D([`WORK_ITEM`,`DECISION`,`CHECKPOINT`,`EVIDENCE`,`ACTIVITY`,`STAGE_ATTEMPT`,`AGENT_RUN`,`REVIEW_FINDING`,`QA_CORRECTION_RUN`,`QA_RUN`,`QA_EVIDENCE_BUNDLE`,`QA_RETEST_PLAN`,`QA_DEFECT`,`VERIFICATION_RUN`,`VERIFICATION_CHECK`,`PROJECT_VERIFICATION_PLAN`,`PROJECT_CONSTITUTION_VERSION`]),po=D([`WORKFLOW_TEMPLATE`,`ROLE_PLAYBOOK`]),mo=D([`CONTEXT_BUDGET`,`STAGE_PROJECTION`]),ho=C().trim().min(1).max(200),R=C().trim().min(1).max(4e3),go=T().positive().max(1),_o=D([`WORK_ITEM_BRIEF`,`WORKFLOW_POSITION`,`DECISIONS`,`LATEST_CHECKPOINT`,`REVIEW_INPUT`,`EVIDENCE`,`ACTIVITY`]),vo=j({id:_o,ordinal:T().int().nonnegative(),required:b()}).strict(),yo=j({schemaVersion:N,sections:w(vo).min(1).max(20)}).strict();j({schemaVersion:N,text:C(),contentHash:C().regex(/^sha256:[0-9a-f]{64}$/)}).strict();var bo=j({kind:fo,id:P,version:T().int().positive()}).strict(),xo=j({id:_o,sources:w(bo).max(200),bytes:T().int().nonnegative()}).strict(),So=j({id:_o,reason:mo}).strict(),Co=j({schemaVersion:N,id:P,providerSessionId:P,templateId:P,templateVersion:T().int().positive(),specSource:po,roleProfile:j({id:P,revision:T().int().positive()}).strict().nullable().default(null),sections:w(xo).min(1).max(20),omitted:w(So).max(20),contentHash:C().regex(/^sha256:[0-9a-f]{64}$/),estimatedTokens:T().int().nonnegative(),budgetTokens:T().int().positive(),estimateQuality:to,createdAt:I}).strict(),wo=e=>e.specSource===`ROLE_PLAYBOOK`==(e.roleProfile!==null),To=`A role-playbook recipe must name the exact profile revision and no other recipe may`,Eo=Co.refine(wo,{message:To}),Do=T().int().positive(),Oo=j({schemaVersion:N,id:P,agentRunId:P.nullable().default(null),stageAttemptId:P,ordinal:T().int().positive(),status:lo,endReason:uo.nullable(),handoffRequestedAt:I.nullable(),startedAt:I,endedAt:I.nullable(),version:T().int().positive(),pid:Do.nullable()}).strict().refine(e=>e.status===`ENDED`==(e.endReason!==null),`An ended session must carry an end reason and a running one must not`).refine(e=>e.status===`ENDED`==(e.endedAt!==null),`An ended session must carry an end timestamp and a running one must not`),ko=j({summary:R,completed:w(C().trim().min(1).max(500)).max(50),remaining:w(C().trim().min(1).max(500)).max(50),deadEnds:w(C().trim().min(1).max(500)).max(50),openQuestions:w(C().trim().min(1).max(500)).max(50)}).strict(),Ao=ko.extend({schemaVersion:N,id:P,stageAttemptId:P,providerSessionId:P,ordinal:T().int().positive(),createdAt:I}).strict(),jo=j({usedTokens:T().int().nonnegative(),windowTokens:T().int().positive(),quality:to}).strict().refine(e=>e.usedTokens<=e.windowTokens,`Usage cannot exceed the window`),Mo=j({inputTokens:T().int().nonnegative(),outputTokens:T().int().nonnegative(),cachedInputTokens:T().int().nonnegative().optional(),reasoningOutputTokens:T().int().nonnegative().optional(),costUsd:T().nonnegative().optional(),quality:to}).strict(),No=D([`HARD`,`POST_SESSION`]),Po=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,agentRunId:P,providerSessionId:P,usageRecordId:P.nullable(),inputTokens:T().int().nonnegative(),outputTokens:T().int().nonnegative(),cachedInputTokens:T().int().nonnegative().nullable(),reasoningOutputTokens:T().int().nonnegative().nullable(),totalTokens:T().int().nonnegative(),costUsd:T().nonnegative().nullable(),quality:to,usageDigest:C().regex(/^sha256:[a-f0-9]{64}$/),recordedAt:I}).strict().superRefine((e,t)=>{e.totalTokens!==e.inputTokens+e.outputTokens&&t.addIssue({code:`custom`,path:[`totalTokens`],message:`Total tokens must equal input plus output tokens`}),e.totalTokens===0!=(e.usageRecordId===null)&&t.addIssue({code:`custom`,path:[`usageRecordId`],message:`A positive token total requires exactly one UsageRecord`})}),Fo=j({stage:Ja,ordinal:T().int().nonnegative(),contextPack:yo}).strict(),Io=j({schemaVersion:N,id:P,version:T().int().positive(),name:ho,stages:w(Fo).min(1).max(20)}).strict(),z=j({schemaVersion:N,id:P,projectId:P,workItemId:P,workflowTemplateId:P,workflowVersion:T().int().positive(),status:Ya,currentStageAttemptId:P,version:T().int().positive(),createdAt:I,updatedAt:I,finishedAt:I.nullable()}).strict(),B=j({schemaVersion:N,id:P,pipelineRunId:P,projectId:P,workItemId:P,correctionRunId:P.nullable(),verificationCorrectionRunId:P.nullable().optional(),stage:Ja,attempt:T().int().positive(),status:Xa,version:T().int().positive(),startedAt:I.nullable(),finishedAt:I.nullable(),failureCode:C().trim().min(1).max(100).nullable(),unproductiveSessions:T().int().nonnegative(),packShareBackoffs:T().int().nonnegative(),resultTree:qa.nullable()}).strict(),Lo=[`NO_PROGRESS`,`CONTEXT_FLOOR_EXCEEDED`,`PROVIDER_REJECTED_PACK`,`PROVIDER_START_FAILED`,`PROVIDER_OUTCOME_REJECTED`,`SESSION_LIMIT_REACHED`],Ro=e=>e!==null&&Lo.includes(e),zo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,revision:T().int().positive(),maxEstimatedTokens:T().int().positive(),modelTierOverride:Je.nullable().optional(),agentRunMaxEstimatedTokensOverride:T().int().positive().nullable().optional(),warningThresholds:w(go).min(1).max(10),createdBy:L,createdAt:I}).strict(),Bo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,budgetPolicyId:P,kind:no,amount:T().int().positive(),quality:to,recordedAt:I}).strict(),Vo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,previousStatus:k(`RUNNING`),recoveredStatus:k(`INTERRUPTED`),reason:io,createdAt:I}).strict(),Ho=j({kind:ao,title:ho,summary:R,checks:w(C().trim().min(1).max(500)).min(1).max(20)}).strict(),Uo=Ho.extend({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,correctionRunId:P.nullable(),verificationCorrectionRunId:P.nullable().optional(),stage:D([`REVIEW`,`QA`]),status:oo,provider:qe,reviewReportId:P.optional(),qaRunId:P.optional(),qaEvidenceBundleId:P.optional(),testedTree:qa.optional(),createdAt:I}).strict().superRefine((e,t)=>{let n=[e.qaRunId,e.qaEvidenceBundleId,e.testedTree],r=n.filter(e=>e!==void 0).length,i=[e.reviewReportId,e.testedTree],a=i.filter(e=>e!==void 0).length;e.kind===`QA_REPORT`&&r!==0&&r!==n.length&&t.addIssue({code:`custom`,message:`Measured QA provenance must be complete`}),e.kind===`REVIEW_REPORT`&&a!==0&&a!==i.length&&t.addIssue({code:`custom`,message:`Measured review provenance must be complete`}),(e.qaRunId!==void 0||e.qaEvidenceBundleId!==void 0)&&(e.kind!==`QA_REPORT`||e.stage!==`QA`)&&t.addIssue({code:`custom`,message:`Only QA evidence can reference a measured browser run`}),e.reviewReportId!==void 0&&(e.kind!==`REVIEW_REPORT`||e.stage!==`REVIEW`)&&t.addIssue({code:`custom`,message:`Only review evidence can reference a review report`}),e.correctionRunId!==null&&(e.kind===`REVIEW_REPORT`&&a===i.length||e.kind===`QA_REPORT`&&r===n.length||t.addIssue({code:`custom`,message:`Correction evidence requires complete authority provenance`}))}),Wo=j({criterion:C().trim().min(1).max(500),implementation:R,reviewCheck:C().trim().min(1).max(500),qaCheck:C().trim().min(1).max(500),ownerVerification:R,knownRisk:R.nullable()}).strict(),Go=j({criterion:C().trim().min(1).max(500),implementation:R,reviewArtifactId:P,qaArtifactId:P,reviewCheck:C().trim().min(1).max(500).optional(),qaCheck:C().trim().min(1).max(500).optional(),verificationCheckIds:w(P).min(1).max(12).optional(),verification:R,knownRisk:R.nullable()}).strict().superRefine((e,t)=>{e.reviewCheck===void 0!=(e.qaCheck===void 0)&&t.addIssue({code:`custom`,message:`Criterion evidence must bind both Review and QA checks or be a legacy unbound row`})}),Ko=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,humanRequestId:P,status:so,criteria:w(Go).max(50),verificationEvidence:Lr.nullable().optional(),artifactIds:w(P).min(2).max(20),releaseNote:R,verifyInstructions:w(R).min(1).max(20),version:T().int().positive(),createdAt:I,resolvedAt:I.nullable(),resolvedBy:L.nullable(),resolutionReason:R.nullable()}).strict().superRefine((e,t)=>{let n=e.verificationEvidence,r=e.criteria.map(({verificationCheckIds:e})=>e);if(n==null){r.some(e=>e!==void 0)&&t.addIssue({code:`custom`,path:[`criteria`],message:`Criterion Project checks require package Verification evidence`});return}(n.projectId!==e.projectId||n.workItemId!==e.workItemId||n.pipelineRunId!==e.pipelineRunId)&&t.addIssue({code:`custom`,path:[`verificationEvidence`],message:`Verification evidence cannot cross an AcceptancePackage boundary`});let i=new Set(n.requiredCheckIds);r.some(e=>e?.length!==i.size||e.some(e=>!i.has(e)))&&t.addIssue({code:`custom`,path:[`criteria`],message:`Every criterion must bind the complete required Project verification set`})}),qo=j({id:P,label:ho,consequence:R,recommended:b()}).strict(),Jo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,stageAttemptId:P,kind:Za,blocking:b(),title:ho,context:R,recommendation:R.nullable(),options:w(qo).max(20),allowOther:b(),status:Qa,version:T().int().positive(),createdAt:I,resolvedAt:I.nullable()}).strict(),Yo=O(`type`,[j({type:k(`OPTION`),optionIds:w(P).min(1).max(20)}).strict(),j({type:k(`OTHER`),text:C().trim().min(1).max(2e3)}).strict()]),Xo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,humanRequestId:P,answer:Yo,actor:L,reason:C().trim().min(1).max(2e3).nullable(),createdAt:I}).strict(),Zo=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,mode:$a,status:eo,createdAt:I,completedAt:I.nullable()}).strict(),Qo=Jo.pick({blocking:!0,recommendation:!0}).extend({title:C().trim().min(3).max(200),context:C().trim().min(10).max(4e3)}).strict(),$o=e=>Qo.extend({kind:k(e),options:w(qo).min(1).max(20),allowOther:b()}).strict(),es=E([$o(`SINGLE_CHOICE`),$o(`MULTIPLE_CHOICE`),$o(`CONFIRMATION`),Qo.extend({kind:k(`FREE_TEXT`),options:w(qo).max(0),allowOther:k(!0)}).strict()]),ts=O(`type`,[j({type:k(`NEEDS_HUMAN`),request:es,reason:k(`PROVIDER_RATE_LIMITED`).optional()}).strict(),j({type:k(`COMPLETED`),summary:C().trim().min(1).max(4e3),artifacts:w(Ho).max(5).optional(),reviewReport:Ln.optional()}).strict(),j({type:k(`READY_FOR_ACCEPTANCE`),releaseNote:R,verifyInstructions:w(R).min(1).max(20),criteria:w(Wo).min(1).max(50).optional()}).strict(),j({type:k(`BUDGET_LIMIT_REACHED`),usageIncrements:w(T().int().positive()).min(1).max(100),quality:to}).strict(),j({type:k(`HANDED_OFF`),checkpoint:ko}).strict(),j({type:k(`CONTEXT_EXHAUSTED`),checkpoint:ko.optional()}).strict()]),V=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),ns=V.extend({type:k(`PIPELINE_STARTED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B,budgetPolicy:zo}).strict()}),rs=V.extend({type:k(`STAGE_ATTEMPT_CHANGED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B,previousStatus:Xa}).strict()}),is=V.extend({type:k(`HUMAN_REQUEST_OPENED`),aggregateType:k(`WORK_ITEM`),data:j({request:Jo}).strict()}),as=V.extend({type:k(`HUMAN_REQUEST_RESOLVED`),aggregateType:k(`WORK_ITEM`),data:j({request:Jo,decision:Xo}).strict()}),os=V.extend({type:k(`USAGE_RECORDED`),aggregateType:k(`WORK_ITEM`),data:j({usageRecord:Bo,cumulativeAmount:T().int().positive()}).strict()}),ss=V.extend({type:k(`BUDGET_THRESHOLD_REACHED`),aggregateType:k(`WORK_ITEM`),data:j({budgetPolicy:zo,threshold:go,cumulativeAmount:T().int().nonnegative()}).strict()}),cs=V.extend({type:k(`PIPELINE_PAUSED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B,kind:ro,reason:R}).strict()}),ls=V.extend({type:k(`PIPELINE_RESUMED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B}).strict()}),us=V.extend({type:k(`PIPELINE_CANCELLED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B}).strict()}),ds=V.extend({type:k(`BUDGET_OVERRIDE_APPROVED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,previousStageAttempt:B,stageAttempt:B,budgetPolicy:zo}).strict()}),fs=V.extend({type:k(`RECOVERY_REPORT_CREATED`),aggregateType:k(`WORK_ITEM`),data:j({report:Vo,run:z,stageAttempt:B}).strict()}),ps=V.extend({type:k(`EVIDENCE_ARTIFACT_RECORDED`),aggregateType:k(`WORK_ITEM`),data:j({artifact:Uo}).strict()}),ms=V.extend({type:k(`REVIEW_REPORT_RECORDED`),aggregateType:k(`WORK_ITEM`),data:j({report:zn}).strict()}),hs=V.extend({type:k(`REVIEW_FINDING_RECORDED`),aggregateType:k(`WORK_ITEM`),data:j({finding:Rn}).strict()}),gs=V.extend({type:k(`REVIEW_FINDING_RESOLVED`),aggregateType:k(`WORK_ITEM`),data:j({finding:Rn}).strict()}),_s=V.extend({type:k(`REVIEW_LOOP_EXHAUSTED`),aggregateType:k(`WORK_ITEM`),data:j({report:zn,run:z,stageAttempt:B,request:Jo}).strict()}),vs=V.extend({type:k(`ACCEPTANCE_REQUESTED`),aggregateType:k(`WORK_ITEM`),data:j({acceptancePackage:Ko,request:Jo,run:z,stageAttempt:B}).strict()}),ys=V.extend({type:k(`ACCEPTANCE_RESOLVED`),aggregateType:k(`WORK_ITEM`),data:j({action:co,acceptancePackage:Ko,request:Jo,decision:Xo,run:z,stageAttempt:B}).strict()}),bs=V.extend({type:k(`PIPELINE_COMPLETED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B}).strict()}),xs=V.extend({type:k(`PROVIDER_SESSION_STARTED`),aggregateType:k(`WORK_ITEM`),data:j({session:Oo,recipe:Eo,mcpSnapshots:w(ct).max(64).default([])}).strict()}),Ss=V.extend({type:k(`CHECKPOINT_PUBLISHED`),aggregateType:k(`WORK_ITEM`),data:j({checkpoint:Ao}).strict()}),Cs=V.extend({type:k(`CONTEXT_HANDOFF_REQUESTED`),aggregateType:k(`WORK_ITEM`),data:j({session:Oo,usage:jo}).strict()}),ws=V.extend({type:k(`PROVIDER_SESSION_ENDED`),aggregateType:k(`WORK_ITEM`),data:j({session:Oo}).strict()}),Ts=V.extend({type:k(`CONTEXT_FLOOR_EXCEEDED`),aggregateType:k(`WORK_ITEM`),data:j({run:z,stageAttempt:B,sessionOrdinal:T().int().positive(),requiredBytes:T().int().nonnegative(),budgetBytes:T().int().nonnegative(),budgetTokens:T().int().positive()}).strict()}),H=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Es=j({workItemId:P,expectedVersion:T().int().positive(),template:Io,budget:j({maxEstimatedTokens:T().int().positive(),warningThresholds:w(go).min(1).max(10),modelTierOverride:Je.nullable().optional(),agentRunMaxEstimatedTokensOverride:T().int().positive().nullable().optional()}).strict()}).strict(),Ds=H.extend({type:k(`START_PIPELINE`),payload:Es}),Os=H.extend({type:k(`START_MOCK_PIPELINE`),payload:Es}),ks=H.extend({type:k(`MARK_WORKFLOW_DISPATCH_STARTED`),payload:j({dispatchId:P}).strict()}),As=j({dispatchId:P,provider:qe.optional(),outcome:ts,template:Io,resultTree:qa.nullable(),sessionCompletion:j({providerSessionId:P,usage:Mo.nullable()}).strict().optional()}).strict(),js=H.extend({type:k(`APPLY_PROVIDER_OUTCOME`),payload:As}),Ms=H.extend({type:k(`APPLY_MOCK_PROVIDER_OUTCOME`),payload:As}),Ns=H.extend({type:k(`ANSWER_HUMAN_REQUEST`),payload:j({humanRequestId:P,expectedVersion:T().int().positive(),answer:Yo}).strict()}),Ps=D([`AUTHORIZE_FINAL`,`CANCEL`]),Fs=H.extend({type:k(`RESOLVE_QA_CORRECTION_GATE`),payload:j({humanRequestId:P,expectedRequestVersion:T().int().positive(),correctionRunId:P.nullable(),expectedCorrectionVersion:T().int().positive().nullable(),expectedPipelineRunVersion:T().int().positive(),action:Ps}).strict().refine(({correctionRunId:e,expectedCorrectionVersion:t})=>e===null==(t===null),`A QA correction ID and expected version must be supplied together`)}),Is=j({pipelineRunId:P,expectedVersion:T().int().positive()}).strict(),Ls=H.extend({type:k(`PAUSE_PIPELINE`),payload:Is}),Rs=H.extend({type:k(`RESUME_PIPELINE`),payload:Is}),zs=H.extend({type:k(`CANCEL_PIPELINE`),payload:Is}),Bs=H.extend({type:k(`APPROVE_BUDGET_OVERRIDE`),payload:Is.extend({maxEstimatedTokens:T().int().positive(),modelTierOverride:Je.nullable().optional(),agentRunMaxEstimatedTokensOverride:T().int().positive().nullable().optional()})}),Vs=H.extend({type:k(`RECONCILE_WORKFLOWS`),payload:j({verificationProcessAuthorityReleasedRunIds:w(P).max(1e3).optional(),workspaceToolProcessAuthorityReleasedCallIds:w(P).max(1e3).optional()}).strict()}),Hs=H.extend({type:k(`RESOLVE_ACCEPTANCE`),payload:j({acceptancePackageId:P,expectedVersion:T().int().positive(),expectedRunVersion:T().int().positive(),action:co,reason:R.nullable()}).strict()}),Us=Co.omit({id:!0,providerSessionId:!0,createdAt:!0}).refine(wo,{message:To}),Ws=H.extend({type:k(`START_PROVIDER_SESSION`),payload:j({stageAttemptId:P,recipe:Us,pid:Do.nullable().optional()}).strict()}),Gs=H.extend({type:k(`RECORD_PROVIDER_SESSION_PROCESS`),payload:j({providerSessionId:P,pid:Do}).strict()}),Ks=H.extend({type:k(`RECORD_PROVIDER_USAGE`),payload:j({providerSessionId:P,usage:Mo}).strict()}),qs=H.extend({type:k(`PUBLISH_CHECKPOINT`),payload:j({providerSessionId:P,checkpoint:ko}).strict()}),Js=H.extend({type:k(`END_PROVIDER_SESSION`),payload:j({providerSessionId:P,endReason:uo,providerStarted:b()}).strict().refine(e=>e.providerStarted||e.endReason===`INTERRUPTED`,`A session the provider never started can only have ended as INTERRUPTED`)}),Ys=H.extend({type:k(`REQUEST_CONTEXT_HANDOFF`),payload:j({providerSessionId:P,usage:jo,handoffThreshold:go}).strict()}),Xs=O(`type`,[j({type:k(`CONTEXT_FLOOR_EXCEEDED`),sessionOrdinal:T().int().positive(),requiredBytes:T().int().nonnegative(),budgetBytes:T().int().nonnegative(),budgetTokens:T().int().positive()}).strict(),j({type:k(`PROVIDER_REJECTED_PACK`),sessionOrdinal:T().int().positive()}).strict(),j({type:k(`PROVIDER_START_FAILED`),sessionOrdinal:T().int().positive()}).strict(),j({type:k(`PROVIDER_OUTCOME_REJECTED`),sessionOrdinal:T().int().positive(),errorCode:C().trim().min(1).max(100)}).strict(),j({type:k(`SESSION_LIMIT_REACHED`),sessionOrdinal:T().int().positive(),maxSessions:T().int().positive()}).strict()]),Zs=H.extend({type:k(`REDUCE_CONTEXT_PACK_SHARE`),payload:j({stageAttemptId:P}).strict()}),Qs=H.extend({type:k(`HARD_PAUSE_STAGE_ATTEMPT`),payload:j({stageAttemptId:P,reason:Xs}).strict()}),$s=j({schemaVersion:N,type:k(`PIPELINE_STARTED`),replayed:b(),workItemId:P,run:z,stageAttempt:B,budgetPolicy:zo,dispatch:Zo,events:w(ns)}).strict(),ec=j({schemaVersion:N,type:k(`WORKFLOW_DISPATCH_STARTED`),replayed:b(),workItemId:P,run:z,stageAttempt:B,dispatch:Zo,events:w(rs)}).strict(),tc=O(`type`,[ws,rs,is,os,ss,cs,ps,ms,hs,gs,_s,vs,bs]),nc=j({schemaVersion:N,type:k(`PROVIDER_OUTCOME_APPLIED`),replayed:b(),workItemId:P,run:z,stageAttempt:B,usageRecords:w(Bo),artifacts:w(Uo),acceptancePackage:Ko.nullable(),outcomeRejectionCode:C().trim().min(1).max(100).nullable().optional(),events:w(tc)}).strict(),rc=nc.extend({type:k(`MOCK_PROVIDER_OUTCOME_APPLIED`)}),ic=j({schemaVersion:N,type:k(`HUMAN_REQUEST_ANSWERED`),replayed:b(),workItemId:P,request:Jo,decision:Xo,dispatch:Zo.nullable(),events:w(O(`type`,[as,rs,us]))}).strict(),ac=j({schemaVersion:N,type:k(`QA_CORRECTION_GATE_RESOLVED`),replayed:b(),action:Ps,workItemId:P,request:Jo,decision:Xo,previousCorrection:Ca.nullable(),correctionRun:Ca.nullable(),retestPlan:Sa.nullable(),run:z,stageAttempt:B,dispatch:Zo.nullable(),events:w(O(`type`,[as,rs,Ma,Fa,us]))}).strict(),oc=j({schemaVersion:N,type:k(`VERIFICATION_CORRECTION_GATE_RESOLVED`),replayed:b(),action:lr,workItemId:P,request:Jo,decision:Xo,previousCorrection:Gr.nullable(),qaCorrection:Ca.nullable().optional(),correctionRun:Gr.nullable(),run:z,stageAttempt:B,dispatch:Zo.nullable(),events:w(O(`type`,[as,rs,pi,di,hi,Fa,us]))}).strict(),sc=j({schemaVersion:N,type:k(`VERIFICATION_STALE_FAILURE_MATERIALIZED`),replayed:b(),action:D([`START_CORRECTION`,`WAIT_FOR_OWNER`]),workItemId:P,failure:Wr,correctionRun:Gr.nullable(),request:Jo.nullable(),run:z,stageAttempt:B,dispatch:Zo.nullable(),events:w(O(`type`,[ui,rs,di,is]))}).strict().superRefine((e,t)=>{let n=e.action===`START_CORRECTION`;(n!==(e.correctionRun!==null)||n!==(e.dispatch!==null)||n===(e.request!==null))&&t.addIssue({code:`custom`,message:`A stale verification result must expose exactly one correction or owner-gate continuation`})}),cc=O(`type`,[cs,ls,us,Fa,hi]),lc=j({schemaVersion:N,type:k(`PIPELINE_CONTROL_APPLIED`),replayed:b(),action:D([`PAUSE`,`RESUME`,`CANCEL`]),workItemId:P,run:z,stageAttempt:B,dispatch:Zo.nullable(),events:w(cc)}).strict(),uc=j({schemaVersion:N,type:k(`BUDGET_OVERRIDE_APPROVED`),replayed:b(),workItemId:P,run:z,previousStageAttempt:B,stageAttempt:B,budgetPolicy:zo,dispatch:Zo,events:w(ds)}).strict(),dc=j({schemaVersion:N,type:k(`WORKFLOWS_RECONCILED`),replayed:b(),recoveryReports:w(Vo),interruptedSessions:w(Oo),interruptedVerificationRuns:w(Vr).default([]),interruptedWorkspaceToolCalls:w(It).default([]),orphanedWorkspaces:w(en),events:w(O(`type`,[fs,ws,ci,ui,rs,di,pi,is,rn,Lt]))}).strict(),fc=O(`type`,[as,ys,bs]),pc=j({schemaVersion:N,type:k(`ACCEPTANCE_RESOLVED`),replayed:b(),action:co,workItemId:P,run:z,stageAttempt:B,acceptancePackage:Ko,request:Jo,decision:Xo,events:w(fc)}).strict(),mc=j({schemaVersion:N,type:k(`PROVIDER_SESSION_STARTED`),replayed:b(),workItemId:P,session:Oo,recipe:Eo,mcpSnapshots:w(ct).max(64).default([]),events:w(xs)}).strict(),hc=j({schemaVersion:N,type:k(`PROVIDER_SESSION_PROCESS_RECORDED`),replayed:b(),workItemId:P,session:Oo,events:w(x())}).strict(),gc=j({schemaVersion:N,type:k(`PROVIDER_USAGE_RECORDED`),replayed:b(),workItemId:P,report:Po,usageRecord:Bo.nullable(),cumulativeAmount:T().int().nonnegative(),hardPaused:b(),stageAttempt:B,events:w(O(`type`,[os,ss,rs,cs]))}).strict(),_c=j({schemaVersion:N,type:k(`CHECKPOINT_PUBLISHED`),replayed:b(),workItemId:P,checkpoint:Ao,events:w(Ss)}).strict(),vc=j({schemaVersion:N,type:k(`PROVIDER_SESSION_ENDED`),replayed:b(),workItemId:P,session:Oo,stageAttempt:B,request:Jo.nullable(),nextSessionOrdinal:T().int().positive().nullable(),events:w(O(`type`,[ws,rs,cs,is]))}).strict(),yc=j({schemaVersion:N,type:k(`CONTEXT_HANDOFF_REQUESTED`),replayed:b(),workItemId:P,session:Oo,requested:b(),events:w(Cs)}).strict(),bc=j({schemaVersion:N,type:k(`CONTEXT_PACK_SHARE_REDUCED`),replayed:b(),workItemId:P,stageAttempt:B,events:w(rs)}).strict(),xc=j({schemaVersion:N,type:k(`STAGE_ATTEMPT_HARD_PAUSED`),replayed:b(),workItemId:P,run:z,stageAttempt:B,request:Jo,events:w(O(`type`,[Ts,rs,cs,is]))}).strict();j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),maxEstimatedTokens:T().int().positive().optional(),modelTierOverride:Je.nullable().optional(),agentRunMaxEstimatedTokensOverride:T().int().positive().nullable().optional()}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),answer:Yo}).strict(),j({schemaVersion:N,commandId:P,expectedRequestVersion:T().int().positive(),correctionRunId:P.nullable(),expectedCorrectionVersion:T().int().positive().nullable(),expectedPipelineRunVersion:T().int().positive(),action:Ps}).strict().refine(({correctionRunId:e,expectedCorrectionVersion:t})=>e===null==(t===null),`A QA correction ID and expected version must be supplied together`),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive()}).strict().extend({maxEstimatedTokens:T().int().positive(),modelTierOverride:Je.nullable().optional(),agentRunMaxEstimatedTokensOverride:T().int().positive().nullable().optional()}),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),expectedRunVersion:T().int().positive(),action:co,reason:R.nullable().default(null)}).strict();var Sc=j({schemaVersion:N,run:z.nullable(),stageAttempts:w(B),humanRequests:w(Jo),decisions:w(Xo),budgetPolicies:w(zo),usageRecords:w(Bo),recoveryReports:w(Vo),artifacts:w(Uo),acceptancePackage:Ko.nullable()}).strict(),Cc=j({schemaVersion:N,humanRequests:w(Jo)}).strict(),wc=j({schemaVersion:N,sessions:w(Oo),checkpoints:w(Ao),usageReports:w(Po),peakContextWindowUsage:S(P,jo)}).strict(),Tc=j({schemaVersion:N,provider:C().trim().min(1).max(50),start:b(),stages:w(Ja).min(1).max(20),checkpointOnRequest:b(),contextWindowReporting:b(),costReporting:b(),tokenBudgetEnforcement:No,canReportRateLimits:b().default(!1)}).strict(),Ec=D([`CODEX`,`CLAUDE_CODE`]),Dc=D([`AUTO`,...Ec.options]),Oc=j({schemaVersion:N,projectId:P,preference:Dc,projectVersion:T().int().positive(),updatedAt:I}).strict(),kc=D([`AUTHENTICATED`,`REQUIRED`,`UNKNOWN`]),Ac=D([`BUILT_IN`,`MISSING`,`UNLAUNCHABLE`,`VERSION_UNREADABLE`,`TOO_OLD`,`VERIFIED`,`UNVERIFIED`]),jc=D([`AUTO`,`PROJECT_PREFERENCE`,`ENVIRONMENT_OVERRIDE`]),Mc=D([`NO_READY_LIVE_PROVIDER`,`LIVE_PROVIDER_UNAVAILABLE`]).nullable(),Nc=C().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),Pc=j({FAST:Nc,STANDARD:Nc,DEEP:Nc}).strict(),Fc=j({provider:Ec,installed:b(),authentication:kc,version:C().min(1).max(48).nullable(),compatibility:Ac,ready:b(),stages:w(Ja).min(1).max(20),checkpointOnRequest:b(),contextWindowReporting:b(),costReporting:b(),tokenBudgetEnforcement:No,canReportRateLimits:b().default(!1),models:Pc.nullable()}).strict().superRefine((e,t)=>{if(e.models===null&&t.addIssue({code:`custom`,message:`A real provider must expose its model mapping`}),e.compatibility===`BUILT_IN`){(!e.installed||e.version!==null||e.ready!==(e.authentication===`AUTHENTICATED`))&&t.addIssue({code:`custom`,message:`A built-in adapter is ready exactly when its credential is configured`});return}!e.installed&&e.compatibility!==`MISSING`&&t.addIssue({code:`custom`,message:`A missing live provider must report MISSING`}),[`TOO_OLD`,`VERIFIED`,`UNVERIFIED`].includes(e.compatibility)!==(e.version!==null)&&t.addIssue({code:`custom`,message:`Live provider version presence must match its compatibility state`}),e.authentication!==`UNKNOWN`&&(!e.installed||e.version===null)&&t.addIssue({code:`custom`,message:`Authentication is observed only for an installed, versioned live provider target`}),e.ready!==(e.installed&&e.compatibility===`VERIFIED`&&e.authentication===`AUTHENTICATED`)&&t.addIssue({code:`custom`,message:`Live provider readiness must match install, compatibility and auth state`})}),Ic=j({schemaVersion:N,selection:Oc,effectiveProvider:Ec,source:jc,fallbackReason:Mc,environmentOverride:Ec.nullable(),environmentOverrideLocked:b(),environmentOverrideInvalid:b(),providers:w(Fc).length(2)}).strict(),Lc=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict().extend({type:k(`PROJECT_PROVIDER_PREFERENCE_CHANGED`),data:j({selection:Oc,previousPreference:Dc}).strict()}),Rc=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict().extend({type:k(`SET_PROJECT_PROVIDER_PREFERENCE`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),preference:Dc}).strict()}),zc=j({schemaVersion:N,replayed:b(),type:k(`PROJECT_PROVIDER_PREFERENCE_CHANGED`),selection:Oc,event:Lc}).strict();j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),preference:Dc}).strict(),j({schemaVersion:N}).strict();var Bc=D([`TOOL_CALL`,`AGENT_TEXT`,`FILE_CHANGE`,`PROVIDER_ERROR`]),Vc=j({actionKey:C().trim().min(1).max(200),kind:Bc,label:C().trim().min(1).max(500).nullable(),detail:C().trim().min(1).max(2e3).nullable(),status:C().trim().min(1).max(120).nullable(),terminal:b(),truncated:b()}).strict(),Hc=D([`DAEMON_AUDITED`,`PROVIDER_REPORTED`]),Uc=j({id:C().min(1),seq:T().int().positive(),at:A(),origin:Hc,provider:D([`CODEX`,`CLAUDE_CODE`]),kind:Bc,label:C().max(500).nullable(),detail:C().max(2e3).nullable(),status:C().max(120).nullable(),failureCode:Ft.nullable(),truncated:b(),agentRunId:C().min(1),stage:Ja}).strict(),Wc=j({entries:w(Uc).max(200),nextCursor:C().min(1).nullable(),omittedCount:T().int().nonnegative(),degraded:b(),gap:b()}).strict(),Gc=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Kc=j({schemaVersion:N,replayed:b()}).strict(),qc=Gc.extend({type:k(`RECORD_AGENT_RUN_ACTIVITY`),payload:j({agentRunId:P,providerSessionId:P,provider:Ec,entry:Vc}).strict()}),Jc=Kc.extend({type:k(`AGENT_RUN_ACTIVITY_RECORDED`),entryId:P,seq:T().int().positive(),omittedCount:T().int().nonnegative(),degraded:b()}),Yc=Gc.extend({type:k(`MARK_AGENT_RUN_ACTIVITY_DEGRADED`),payload:j({agentRunId:P}).strict()}),Xc=Kc.extend({type:k(`AGENT_RUN_ACTIVITY_DEGRADED_MARKED`),agentRunId:P}),Zc=Gc.extend({type:k(`DELETE_EXPIRED_AGENT_RUN_ACTIVITY`),payload:j({closedBefore:I,limit:T().int().min(1).max(1e3)}).strict()}),Qc=Kc.extend({type:k(`AGENT_RUN_ACTIVITY_RETENTION_APPLIED`),entriesDeleted:T().int().nonnegative(),stateRowsDeleted:T().int().nonnegative()}),$c=D([`LEAD_PM`,`PRODUCT_ANALYST`,`SOFTWARE_ARCHITECT`,`DEVELOPER`,`CODE_REVIEWER`,`BROWSER_QA`,`ACCEPTANCE_MANAGER`]),el=D([`BUILTIN`,`PROJECT`]),tl=D([`ARTIFACT_WRITE`,`REPOSITORY_READ`,`REPOSITORY_WRITE`,`NETWORK`,`MCP_READ`,`BROWSER_READ`]),nl=D([`DISCOVERY_BRIEF`,`OPEN_QUESTION_SET`,`ARCHITECTURE_PROPOSAL`,`TASK_GRAPH`,`CHANGE_SET`,`TEST_REPORT`,`FINDING_SET`,`QA_EVIDENCE_BUNDLE`,`ACCEPTANCE_PACKAGE`]),rl=C().trim().min(1).max(2e3),il=C().trim().min(1).max(200),al=j({schemaVersion:N,preferredContextSections:w(_o).max(20)}).strict(),ol=j({schemaVersion:N,id:P,revision:T().int().positive(),name:il,role:$c,identity:rl,mission:rl,nonGoals:w(rl).max(20),stages:w(Ja).min(1).max(6),expectedInputs:w(il).max(20),expectedOutputs:w(nl).min(1).max(20),allowedCapabilities:w(tl).max(20),successRubric:w(rl).min(1).max(20),escalationConditions:w(rl).min(1).max(20),handoffContract:rl,defaultProvider:Dc,defaultModelTier:Je,budgetEnvelope:j({maxEstimatedTokens:T().int().positive(),maxProviderSessions:T().int().positive().max(50)}).strict(),playbook:al,provenance:el}).strict().pick({id:!0,revision:!0,role:!0}).strict(),sl=j({stage:Ja,profile:ol}).strict(),cl=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,revision:T().int().positive(),stages:w(sl).min(1).max(6),createdAt:I}).strict(),ll=D([`RUNNING`,`SUCCEEDED`,`FAILED`,`CANCELLED`,`INTERRUPTED`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`]),ul=j({global:T().int().min(0).max(32),project:T().int().min(0).max(32),provider:T().int().min(0).max(32)}).strict(),dl=j({access:D([`NONE`,`READ_ONLY`,`READ_WRITE`]),networkAccess:b()}).strict(),fl=j({schemaVersion:N,assignment:j({id:P,revision:T().int().positive()}).strict(),profile:ol,provider:qe,effectiveCapabilities:w(tl).max(6),modelTier:Je,modelId:Nc.nullable().optional(),projectConstitution:j({id:P,version:T().int().positive(),contentDigest:C().regex(/^[0-9a-f]{64}$/)}).strict().nullable().optional(),claimLimits:ul,budget:j({pipelinePolicyId:P,pipelinePolicyRevision:T().int().positive(),maxEstimatedTokens:T().int().positive(),maxProviderSessions:T().int().positive().max(50)}).strict(),workspace:dl,mcpProfileRevisionIds:w(P).max(64)}).strict().superRefine((e,t)=>{let n=new Set(e.effectiveCapabilities);n.size!==e.effectiveCapabilities.length&&t.addIssue({code:`custom`,message:`Effective capabilities must be unique`}),n.has(`REPOSITORY_WRITE`)&&!n.has(`REPOSITORY_READ`)&&t.addIssue({code:`custom`,message:`Repository write requires repository read`});let r=n.has(`REPOSITORY_WRITE`)?`READ_WRITE`:n.has(`REPOSITORY_READ`)?`READ_ONLY`:`NONE`;e.workspace.access!==r&&t.addIssue({code:`custom`,message:`Workspace access must match effective capabilities`}),e.workspace.networkAccess!==n.has(`NETWORK`)&&t.addIssue({code:`custom`,message:`Network access must match effective capabilities`}),new Set(e.mcpProfileRevisionIds).size!==e.mcpProfileRevisionIds.length&&t.addIssue({code:`custom`,message:`MCP profile revisions must be unique`}),n.has(`MCP_READ`)!==e.mcpProfileRevisionIds.length>0&&t.addIssue({code:`custom`,message:`MCP read requires an exact non-empty revision set`})}),pl=j({schemaVersion:N,id:P,projectId:P,workItemId:P,pipelineRunId:P,stageAttemptId:P,ordinal:T().int().positive(),squadAssignmentId:P,profile:ol,provider:qe,status:ll,policySnapshot:fl.nullable().default(null),policySnapshotHash:C().regex(/^sha256:[0-9a-f]{64}$/),startedAt:I,finishedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{e.status===`RUNNING`!=(e.finishedAt===null)&&t.addIssue({code:`custom`,message:`A running AgentRun must not be finished and every non-running AgentRun must be finished`}),e.policySnapshot!==null&&(e.policySnapshot.assignment.id!==e.squadAssignmentId||e.policySnapshot.profile.id!==e.profile.id||e.policySnapshot.profile.revision!==e.profile.revision||e.policySnapshot.profile.role!==e.profile.role||e.policySnapshot.provider!==e.provider)&&t.addIssue({code:`custom`,message:`The policy snapshot must describe this AgentRun`})}),ml=D([`NOT_READY`,`BUDGET_BLOCKED`,`CHECKPOINT_NOT_STABLE`,`ATTEMPT_ACTIVE`,`GLOBAL_LIMIT`,`PROJECT_LIMIT`,`PROVIDER_LIMIT`,`WORKSPACE_CONFLICT`]),hl=D([`READY`,`WAITING`,`RUNNING`]),gl=j({label:C().trim().min(1).max(500),origin:Hc}).strict(),_l=j({schemaVersion:N,project:j({id:P,name:il}).strict(),workItem:j({id:P,title:il}).strict(),pipelineRunId:P,stageAttemptId:P,dispatchId:P.nullable(),agentRunId:P.nullable(),profile:ol,stage:Ja,provider:qe,status:hl,waitReason:ml.nullable(),startedAt:I.nullable(),latestAction:gl.nullable()}).strict().superRefine((e,t)=>{if(e.status===`RUNNING`){(e.agentRunId===null||e.startedAt===null||e.waitReason!==null)&&t.addIssue({code:`custom`,message:`A running Fleet entry must name its AgentRun`});return}(e.agentRunId!==null||e.startedAt!==null)&&t.addIssue({code:`custom`,message:`A queued Fleet entry cannot name an AgentRun`}),e.status===`WAITING`!=(e.waitReason!==null)&&t.addIssue({code:`custom`,message:`Only a waiting Fleet entry has a wait reason`}),e.latestAction!==null&&t.addIssue({code:`custom`,message:`Only a running Fleet entry -- the one with an AgentRun -- can report a latest action`})}),vl=j({schemaVersion:N,entries:w(_l).max(200),capacity:j({active:T().int().nonnegative().max(200),globalLimit:T().int().min(0).max(32)}).strict()}).strict(),yl=33554432,bl=C().regex(/^[0-9a-f]{64}$/u),xl=C().regex(/^[0-9a-f]{40}$/u),Sl=e=>{for(let t=0;t<e.length;t+=1)if(e.charCodeAt(t)<=31||e.charCodeAt(t)===127)return!0;return!1},Cl=C().trim().min(1).max(2048).regex(/^\/(?!\/)[^\\]*$/u,`Launch measurement paths must be same-origin absolute paths`).refine(e=>!Sl(e),`Launch measurement paths cannot contain control characters`);D([`PERF_WEB_VITALS`,`PERF_BUNDLE_BUDGET`,`SEC_RESPONSE_HEADERS`,`SEC_UNAUTHENTICATED_ROUTES`,`SEC_CLIENT_BUNDLE_SECRETS`,`DEPS_AUDIT`]);var wl=D([`PASSED`,`FAILED`,`ACTION_REQUIRED`,`ERROR`]),Tl=D([`content-security-policy`,`x-content-type-options`,`referrer-policy`,`permissions-policy`]),El=D([`API_KEY`,`AUTH_TOKEN`,`PRIVATE_KEY`,`PASSWORD_ASSIGNMENT`]),Dl=j({lcpMs:T().int().min(100).max(6e4),inpMs:T().int().min(10).max(1e4),cls:T().min(0).max(10),scriptBytes:T().int().min(1024).max(yl)}).strict(),Ol=j({verificationPlanId:P,verificationPlanRevision:T().int().positive(),verificationPlanContentHash:bl,startupRecipeId:P,dependencyAuditRecipeId:P.nullable(),targetOrigin:Ii,healthPath:Cl,probePath:Cl,privateRoutes:w(Cl).max(20),samples:T().int().min(3).max(5),thresholds:Dl,requiredHeaders:w(Tl).min(1).max(4)}).strict().superRefine((e,t)=>{new Set(e.privateRoutes).size!==e.privateRoutes.length&&t.addIssue({code:`custom`,path:[`privateRoutes`],message:`Private routes must be unique`}),new Set(e.requiredHeaders).size!==e.requiredHeaders.length&&t.addIssue({code:`custom`,path:[`requiredHeaders`],message:`Required response headers must be unique`}),e.dependencyAuditRecipeId===e.startupRecipeId&&t.addIssue({code:`custom`,path:[`dependencyAuditRecipeId`],message:`The service and dependency audit must use different recipes`})}),kl=D([`ACTIVE`,`DISABLED`]),Al=j({schemaVersion:N,id:P,projectId:P,revision:T().int().positive(),status:kl,configuration:Ol,contentHash:bl,createdAt:I}).strict(),jl=j({lcpMs:T().nonnegative().max(6e4).nullable(),inpMs:T().nonnegative().max(1e4).nullable(),cls:T().nonnegative().max(10).nullable(),scriptBytes:T().int().nonnegative().max(yl)}).strict(),Ml=j({name:Tl,present:b()}).strict(),Nl=j({path:Cl,statusCode:T().int().min(100).max(599)}).strict(),Pl=j({category:El,count:T().int().nonnegative().max(1e4)}).strict(),Fl=j({samples:w(jl).min(3).max(5),headers:w(Ml).min(1).max(4),privateRoutes:w(Nl).max(20),secrets:w(Pl).max(4),scannedScriptBytes:T().int().nonnegative().max(yl),browserName:k(`CHROMIUM`),browserVersion:C().trim().min(1).max(100)}).strict().superRefine((e,t)=>{new Set(e.headers.map(({name:e})=>e)).size!==e.headers.length&&t.addIssue({code:`custom`,path:[`headers`],message:`Header observations must be unique`}),new Set(e.privateRoutes.map(({path:e})=>e)).size!==e.privateRoutes.length&&t.addIssue({code:`custom`,path:[`privateRoutes`],message:`Private route observations must be unique`}),new Set(e.secrets.map(({category:e})=>e)).size!==e.secrets.length&&t.addIssue({code:`custom`,path:[`secrets`],message:`Secret observations must be unique`})}),Il=j({verificationRunId:P,verificationCheckId:P,recipeId:P,testedTree:xl,status:D([`PASSED`,`FAILED`,`ERROR`,`INTERRUPTED`])}).strict(),Ll={status:wl,summary:C().trim().min(1).max(1e3)},Rl=O(`key`,[j({key:k(`PERF_WEB_VITALS`),...Ll,evidence:j({lcpSamplesMs:w(T().nonnegative().max(6e4)).max(5),inpSamplesMs:w(T().nonnegative().max(1e4)).max(5),clsSamples:w(T().nonnegative().max(10)).max(5),medianLcpMs:T().nonnegative().max(6e4).nullable(),medianInpMs:T().nonnegative().max(1e4).nullable(),medianCls:T().nonnegative().max(10).nullable(),thresholds:Dl.pick({lcpMs:!0,inpMs:!0,cls:!0})}).strict()}).strict(),j({key:k(`PERF_BUNDLE_BUDGET`),...Ll,evidence:j({scriptByteSamples:w(T().int().nonnegative().max(yl)).min(3).max(5),medianScriptBytes:T().int().nonnegative().max(yl),budgetBytes:T().int().positive().max(yl)}).strict()}).strict(),j({key:k(`SEC_RESPONSE_HEADERS`),...Ll,evidence:w(Ml).min(1).max(4)}).strict(),j({key:k(`SEC_UNAUTHENTICATED_ROUTES`),...Ll,evidence:w(Nl).max(20)}).strict(),j({key:k(`SEC_CLIENT_BUNDLE_SECRETS`),...Ll,evidence:j({scannedScriptBytes:T().int().nonnegative().max(yl),findings:w(Pl).max(4)}).strict()}).strict(),j({key:k(`DEPS_AUDIT`),...Ll,evidence:Il.nullable()}).strict()]),zl=D([`PLAN_NOT_ACTIVE`,`VERIFICATION_PLAN_STALE`,`RECIPE_NOT_APPROVED`,`TREE_UNAVAILABLE`,`TREE_MUTATED`,`SERVICE_SPAWN_FAILED`,`SERVICE_EXITED`,`SERVICE_TIMEOUT`,`SERVICE_OUTPUT_LIMIT`,`SERVICE_TERMINATION_FAILED`,`TARGET_UNHEALTHY`,`ORIGIN_FORBIDDEN`,`MEASUREMENT_TIMEOUT`,`EVIDENCE_INVALID`,`OWNER_CANCELLED`,`DAEMON_RESTART`]),Bl=D([`RUNNING`,`CANCELLING`,`BLOCKED`,`PASSED`,`FAILED`,`ERROR`,`INTERRUPTED`]),Vl=j({schemaVersion:N,id:P,projectId:P,planId:P,planRevision:T().int().positive(),planContentHash:bl,verificationPlanId:P,verificationPlanRevision:T().int().positive(),verificationPlanContentHash:bl,testedTree:xl,status:Bl,results:w(Rl).max(6),errorCode:zl.nullable(),startedAt:I,completedAt:I.nullable(),version:T().int().positive()}).strict().superRefine((e,t)=>{(e.status===`RUNNING`||e.status===`CANCELLING`||e.status===`BLOCKED`)!=(e.completedAt===null)&&t.addIssue({code:`custom`,message:`Only an active launch measurement can omit completion time`}),(e.status===`ERROR`||e.status===`INTERRUPTED`||e.status===`BLOCKED`)!=(e.errorCode!==null)&&t.addIssue({code:`custom`,message:`Only blocked or terminal error runs carry an error code`}),e.status===`BLOCKED`&&e.errorCode!==`SERVICE_TERMINATION_FAILED`&&t.addIssue({code:`custom`,message:`A blocked launch measurement must identify an unproved service stop`}),(e.status===`PASSED`||e.status===`FAILED`)!=(e.results.length===6)&&t.addIssue({code:`custom`,message:`A measured terminal run must carry all six gate results`}),new Set(e.results.map(({key:e})=>e)).size!==e.results.length&&t.addIssue({code:`custom`,message:`A launch measurement run cannot repeat a gate result`})}),Hl=j({status:D([`CURRENT`,`STALE`]),reasons:w(D([`TREE_CHANGED`,`PLAN_CHANGED`,`VERIFICATION_PLAN_CHANGED`])).max(3)}).strict(),Ul=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Wl=Ul.extend({type:k(`ADOPT_LAUNCH_MEASUREMENT_PLAN`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),configuration:Ol}).strict()}),Gl=Ul.extend({type:k(`DISABLE_LAUNCH_MEASUREMENT_PLAN`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:bl}).strict()}),Kl=Ul.extend({type:k(`START_LAUNCH_MEASUREMENT_RUN`),payload:j({projectId:P,expectedPlanRevision:T().int().positive(),expectedPlanContentHash:bl,testedTree:xl}).strict()}),ql=Ul.extend({type:k(`CANCEL_LAUNCH_MEASUREMENT_RUN`),payload:j({runId:P,expectedVersion:T().int().positive()}).strict()}),Jl=Ul.extend({type:k(`COMPLETE_LAUNCH_MEASUREMENT_RUN`),payload:j({runId:P,expectedVersion:T().int().positive(),currentTree:xl,browserMeasurement:Fl,dependencyAudit:Il.nullable(),processStopped:k(!0)}).strict()}),Yl=Ul.extend({type:k(`INTERRUPT_LAUNCH_MEASUREMENT_RUN`),payload:j({runId:P,expectedVersion:T().int().positive(),errorCode:zl,processStopped:b()}).strict()}),Xl=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),Zl=Xl.extend({type:k(`LAUNCH_MEASUREMENT_PLAN_CHANGED`),data:j({plan:Al}).strict()}),Ql=Xl.extend({type:k(`LAUNCH_MEASUREMENT_RUN_CHANGED`),data:j({run:Vl}).strict()}),$l=j({schemaVersion:N,replayed:b()}).strict(),eu=$l.extend({type:k(`LAUNCH_MEASUREMENT_PLAN_CHANGED`),plan:Al,projectVersion:T().int().positive(),event:Zl}),tu=$l.extend({type:k(`LAUNCH_MEASUREMENT_RUN_CHANGED`),run:Vl,event:Ql});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),configuration:Ol}).strict(),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),expectedPlanRevision:T().int().positive(),expectedPlanContentHash:bl}).strict(),j({schemaVersion:N,commandId:P,expectedPlanRevision:T().int().positive(),expectedPlanContentHash:bl}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive()}).strict();var nu=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),plan:Al.nullable(),latestRun:Vl.nullable(),freshness:Hl.nullable()}).strict(),ru=524288,iu=C().regex(/^[0-9a-f]{64}$/u),au=C().regex(/^[0-9a-f]{40}$/u),ou=e=>{for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1},su=e=>new Set(e).size===e.length,cu=D([`PREVIEW`,`PRODUCTION`]),lu=k(`WEB_APP_V1`),uu=C().min(1).max(128).regex(/^[A-Z_][A-Z0-9_]*$/u,`Environment variable names must be portable uppercase names`),du=ee().max(2048).superRefine((e,t)=>{let n=/^https:\/\/(?:\[[0-9A-Fa-f:]+\]|[A-Za-z0-9.-]+)(?::([1-9]\d{0,4}))?$/u.exec(e);(n===null||n[1]!==void 0&&Number(n[1])>65535)&&t.addIssue({code:`custom`,message:`The public base URL must be an exact credential-free HTTPS origin`})}),fu=j({kind:cu,name:C().trim().min(1).max(80).refine(e=>e===e.normalize(`NFC`)&&!ou(e)),presetId:lu,presetRevision:k(1),publicBaseUrl:du,healthPath:Cl,requiredEnvironmentVariables:w(uu).max(32)}).strict().refine(({requiredEnvironmentVariables:e})=>su(e),{path:[`requiredEnvironmentVariables`],message:`Environment variable names must be unique`}),pu=fu.extend({schemaVersion:N,id:P,projectId:P,contentHash:iu,version:T().int().positive(),createdAt:I,updatedAt:I}).strict(),mu=D([`READINESS/SECURITY_ACTIVE_CONSTITUTION`,`READINESS/SECURITY_SECRET_PATHS`,`READINESS/SECURITY_ENV_IGNORED`,`READINESS/SECURITY_CI_HARDENING`,`READINESS/LEGAL_LICENSE`,`READINESS/LEGAL_OWNER_REVIEW`,`READINESS/PAYMENTS_OWNER_REVIEW`,`READINESS/ANALYTICS_OWNER_REVIEW`,`READINESS/DEPS_LOCKFILE_PRESENT`,`READINESS/ENV_PROD_SEPARATION`,`READINESS/SECURITY_HEADERS_OWNER_REVIEW`,`READINESS/OPS_HEALTH_ENDPOINT_DECLARED`,`READINESS/OPS_ROLLBACK_PLAN`,`READINESS/OPS_BACKUP`,`VERIFICATION/REQUIRED_RECIPES`,`MEASURED/PERF_WEB_VITALS`,`MEASURED/PERF_BUNDLE_BUDGET`,`MEASURED/SEC_RESPONSE_HEADERS`,`MEASURED/SEC_UNAUTHENTICATED_ROUTES`,`MEASURED/SEC_CLIENT_BUNDLE_SECRETS`,`MEASURED/DEPS_AUDIT`,`REVIEW/SELECTED_WORK_ITEMS`,`QA/SELECTED_WORK_ITEMS`,`ACCEPTANCE/SELECTED_WORK_ITEMS`]),hu=D([`PASSED`,`ACTION_REQUIRED`,`FAILED`,`STALE`]),gu=D([`PROJECT_READINESS_RUN`,`READINESS_CHECK`,`VERIFICATION_PLAN`,`VERIFICATION_RUN`,`LAUNCH_MEASUREMENT_PLAN`,`LAUNCH_MEASUREMENT_RUN`,`ACCEPTANCE_PACKAGE`,`EVIDENCE_ARTIFACT`]),_u=j({kind:gu,id:P,version:T().int().positive().nullable(),testedTree:au.nullable()}).strict(),vu=j({key:mu,status:hu,required:b(),waivable:b(),summary:C().trim().min(1).max(1e3),evidenceRefs:w(_u).max(50)}).strict(),yu=j({readinessRunId:P.nullable(),readinessSourceDigest:iu.nullable(),workingTreeDirty:b().nullable(),verificationPlanId:P.nullable(),verificationPlanRevision:T().int().positive().nullable(),verificationPlanContentHash:iu.nullable(),launchMeasurementPlanId:P.nullable(),launchMeasurementPlanRevision:T().int().positive().nullable(),launchMeasurementPlanContentHash:iu.nullable(),launchMeasurementRunId:P.nullable(),launchMeasurementRunVersion:T().int().positive().nullable()}).strict().superRefine((e,t)=>{[[e.readinessRunId,e.readinessSourceDigest,e.workingTreeDirty],[e.verificationPlanId,e.verificationPlanRevision,e.verificationPlanContentHash],[e.launchMeasurementPlanId,e.launchMeasurementPlanRevision,e.launchMeasurementPlanContentHash],[e.launchMeasurementRunId,e.launchMeasurementRunVersion]].some(e=>e.some(e=>e===null)&&e.some(e=>e!==null))&&t.addIssue({code:`custom`,message:`Release source identities must be complete tuples`})}),bu=j({workItemId:P,pipelineRunId:P.nullable(),acceptancePackageId:P.nullable(),acceptancePackageVersion:T().int().positive().nullable(),acceptanceStatus:D([`PENDING`,`ACCEPTED`,`RETURNED`,`REJECTED`]).nullable(),reviewArtifactId:P.nullable(),qaArtifactId:P.nullable(),verificationRunId:P.nullable(),verificationPlanId:P.nullable(),verificationPlanRevision:T().int().positive().nullable(),verificationPlanContentHash:iu.nullable(),testedTree:au.nullable()}).strict().superRefine((e,t)=>{let n=[e.acceptancePackageId,e.acceptancePackageVersion,e.acceptanceStatus];n.some(e=>e===null)&&n.some(e=>e!==null)&&t.addIssue({code:`custom`,message:`AcceptancePackage id, version and status must be supplied together`});let r=[e.verificationRunId,e.verificationPlanId,e.verificationPlanRevision,e.verificationPlanContentHash];r.some(e=>e===null)&&r.some(e=>e!==null)&&t.addIssue({code:`custom`,message:`Verification Run and Plan identity must be supplied together`}),(e.verificationRunId!==null||e.reviewArtifactId!==null||e.qaArtifactId!==null)&&e.testedTree===null&&t.addIssue({code:`custom`,message:`Authority-bound workflow evidence requires its tree`}),e.pipelineRunId===null&&[e.acceptancePackageId,e.acceptanceStatus,e.reviewArtifactId,e.qaArtifactId,e.verificationRunId,e.verificationPlanId,e.verificationPlanRevision,e.verificationPlanContentHash,e.testedTree].some(e=>e!==null)&&t.addIssue({code:`custom`,message:`Workflow evidence requires its PipelineRun`})}),xu=new Set([`READINESS/SECURITY_SECRET_PATHS`,`READINESS/ENV_PROD_SEPARATION`,`MEASURED/SEC_CLIENT_BUNDLE_SECRETS`]),Su=j({schemaVersion:N,id:P,projectId:P,sourceTree:au,source:yu,environment:pu,selectedWorkItems:w(bu).max(50),gates:w(vu).length(24),requiredGateCount:T().int().min(1).max(24),passedRequiredGateCount:T().int().nonnegative().max(24),contentHash:iu,createdAt:I}).strict().superRefine((e,t)=>{let n=e.gates.map(({key:e})=>e),r=mu.options;(!su(n)||r.some(e=>!n.includes(e)))&&t.addIssue({code:`custom`,path:[`gates`],message:`A Release must contain every gate once`}),su(e.selectedWorkItems.map(({workItemId:e})=>e))||t.addIssue({code:`custom`,path:[`selectedWorkItems`],message:`WorkItems must be unique`}),e.environment.projectId!==e.projectId&&t.addIssue({code:`custom`,path:[`environment`],message:`Environment crosses Project boundary`});let i=e.gates.filter(({required:e})=>e);(e.requiredGateCount!==i.length||e.passedRequiredGateCount!==i.filter(({status:e})=>e===`PASSED`).length)&&t.addIssue({code:`custom`,message:`Release gate counts must match gate snapshots`});for(let n of e.gates)xu.has(n.key)&&n.waivable&&t.addIssue({code:`custom`,path:[`gates`],message:`A non-waivable gate cannot be waived`})}),Cu=j({status:D([`CURRENT`,`STALE`]),reasons:w(D([`TREE_CHANGED`,`ENVIRONMENT_CHANGED`,`READINESS_CHANGED`,`VERIFICATION_PLAN_CHANGED`,`MEASUREMENT_CHANGED`,`ACCEPTANCE_CHANGED`])).max(6)}).strict(),wu=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Tu=wu.extend({type:k(`SAVE_LAUNCH_ENVIRONMENT`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),environmentId:P.nullable(),expectedEnvironmentVersion:T().int().positive().nullable(),configuration:fu}).strict()}).superRefine((e,t)=>{e.payload.environmentId===null!=(e.payload.expectedEnvironmentVersion===null)&&t.addIssue({code:`custom`,path:[`payload`],message:`Environment id and version must be supplied together`})}),Eu=wu.extend({type:k(`CREATE_LAUNCH_RELEASE`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),environmentId:P,expectedEnvironmentVersion:T().int().positive(),expectedEnvironmentContentHash:iu,sourceTree:au,sourceHead:au.nullable(),sourceHeadTree:au.nullable(),workItemIds:w(P).max(50)}).strict().refine(({sourceHead:e,sourceHeadTree:t})=>e===null==(t===null),{message:`Source HEAD and its tree must be supplied together`}).refine(({workItemIds:e})=>su(e),{path:[`workItemIds`],message:`Release WorkItems must be unique`})}),Du=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),Ou=Du.extend({type:k(`LAUNCH_ENVIRONMENT_CHANGED`),data:j({environment:pu}).strict()}),ku=Du.extend({type:k(`LAUNCH_RELEASE_CREATED`),data:j({release:Su}).strict()}),Au=j({schemaVersion:N,replayed:b()}).strict(),ju=Au.extend({type:k(`LAUNCH_ENVIRONMENT_CHANGED`),environment:pu,projectVersion:T().int().positive(),event:Ou}),Mu=Au.extend({type:k(`LAUNCH_RELEASE_CREATED`),release:Su,projectVersion:T().int().positive(),event:ku});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),environmentId:P.nullable(),expectedEnvironmentVersion:T().int().positive().nullable(),configuration:fu}).strict().refine(({environmentId:e,expectedEnvironmentVersion:t})=>e===null==(t===null),{message:`Environment id and version must be supplied together`}),j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),environmentId:P,expectedEnvironmentVersion:T().int().positive(),expectedEnvironmentContentHash:iu,workItemIds:w(P).max(50)}).strict().refine(({workItemIds:e})=>su(e),{path:[`workItemIds`],message:`Release WorkItems must be unique`});var Nu=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),environments:w(pu).max(8),latestRelease:Su.nullable(),freshness:Cu.nullable()}).strict(),Pu=j({schemaVersion:N,releaseId:P,contentType:k(`text/markdown; charset=utf-8`),byteSize:T().int().nonnegative().max(ru),markdown:C().max(ru)}).strict(),U=C().regex(/^[0-9a-f]{64}$/u),Fu=C().regex(/^[0-9a-f]{40}$/u),Iu=e=>{for(let t of e){let e=t.charCodeAt(0);if(e<=32||e===127)return!0}return!1},Lu={repositorySlug:C().min(3).max(201).regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}\/[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/u),branch:C().min(1).max(255).refine(e=>e===e.normalize(`NFC`)&&!e.startsWith(`-`)&&!e.startsWith(`/`)&&!e.endsWith(`/`)&&!e.endsWith(`.`)&&!e.endsWith(`.lock`)&&!e.includes(`..`)&&!e.includes(`@{`)&&!Iu(e)&&!/[~^:?*[\\]/u.test(e),`The deployment branch must be one portable Git ref name`),commitSha:Fu,workflowContentHash:U,argvDigest:U,dispatchTimeoutSeconds:k(30),observeTimeoutSeconds:k(15),outputLimitBytes:k(32768),observeOutputLimitBytes:k(65536)},Ru=j({presetId:k(`GITHUB_ACTIONS_WORKFLOW_V1`),presetRevision:k(1),workflowPath:k(`.github/workflows/deploy-production.yml`),...Lu}).strict(),zu=j({presetId:k(`GITHUB_ACTIONS_ENVIRONMENT_WORKFLOW_V2`),presetRevision:k(2),environmentKind:cu,workflowPath:D([`.github/workflows/deploy-preview.yml`,`.github/workflows/deploy-production.yml`]),...Lu}).strict().superRefine((e,t)=>{let n=e.environmentKind===`PREVIEW`?`.github/workflows/deploy-preview.yml`:`.github/workflows/deploy-production.yml`;e.workflowPath!==n&&t.addIssue({code:`custom`,path:[`workflowPath`],message:`The workflow path must match the deployment Environment kind`})});E([Ru,zu]);var Bu=k(`STANDARD`),Vu=D([`PENDING_APPROVAL`,`APPROVED`,`RUNNING`,`SUCCEEDED`,`FAILED`,`UNKNOWN`]),Hu=D([`DISPATCH_OUTCOME_UNKNOWN`,`DAEMON_RESTARTED`,`REMOTE_FAILURE`,`REMOTE_CANCELLED`,`REMOTE_TIMED_OUT`,`REMOTE_ACTION_REQUIRED`,`OBSERVATION_INVALID`,`PRECONDITION_CHANGED`]),Uu=D([`RELEASE_STALE`,`RELEASE_GATES_BLOCKED`,`ENVIRONMENT_UNSUPPORTED`,`REPOSITORY_UNAVAILABLE`,`REPOSITORY_PATH_NOT_CANONICAL`,`REPOSITORY_OPERATION_IN_PROGRESS`,`SOURCE_DIRTY`,`DETACHED_HEAD`,`REMOTE_INVALID`,`WORKFLOW_MISSING`,`WORKFLOW_NOT_REGULAR`,`WORKFLOW_TRIGGER_MISSING`,`WORKFLOW_TOO_LARGE`,`CLI_UNAVAILABLE`,`AUTH_REQUIRED`,`REMOTE_BRANCH_UNAVAILABLE`,`REMOTE_COMMIT_MISMATCH`,`PREVIEW_PROMOTION_REQUIRED`]),Wu={schemaVersion:N,id:P,projectId:P,releaseId:P,releaseContentHash:U,environmentId:P,environmentContentHash:U,contentHash:U,createdAt:I},Gu=j({...Wu,revision:k(1),target:Ru}).strict(),Ku=j({...Wu,revision:k(2),releaseEvidenceDigest:U,environmentKind:cu,target:zu}).strict().superRefine((e,t)=>{e.environmentKind!==e.target.environmentKind&&t.addIssue({code:`custom`,path:[`target`,`environmentKind`],message:`The Plan and target Environment kinds must match`})}),qu=E([Gu,Ku]),Ju={remoteRunId:T().int().positive(),remoteRunUrl:ee().max(2048).regex(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/actions\/runs\/[1-9]\d*$/u)},Yu={schemaVersion:N,id:P,projectId:P,planId:P,planContentHash:U,releaseId:P,releaseContentHash:U,environmentId:P,environmentContentHash:U,intent:Bu,approvalDigest:U,status:Vu,approvalId:P.nullable(),remoteRunId:Ju.remoteRunId.nullable(),remoteRunUrl:Ju.remoteRunUrl.nullable(),failureCode:Hu.nullable(),createdAt:I,approvedAt:I.nullable(),startedAt:I.nullable(),completedAt:I.nullable(),observedAt:I.nullable(),version:T().int().positive()},Xu=E([j({...Yu,planRevision:k(1)}).strict(),j({...Yu,planRevision:k(2),releaseEvidenceDigest:U,environmentKind:cu}).strict()]).superRefine((e,t)=>{e.remoteRunId===null!=(e.remoteRunUrl===null)&&t.addIssue({code:`custom`,message:`Remote run id and URL must be supplied together`}),e.approvalId===null!=(e.approvedAt===null)&&t.addIssue({code:`custom`,message:`Approval id and timestamp must be supplied together`}),e.status===`PENDING_APPROVAL`&&e.approvalId!==null&&t.addIssue({code:`custom`,message:`A pending Deployment cannot carry an Approval`}),e.status===`PENDING_APPROVAL`&&[e.startedAt,e.completedAt,e.observedAt,e.failureCode,e.remoteRunId].some(e=>e!==null)&&t.addIssue({code:`custom`,message:`A pending Deployment cannot carry execution state`}),[`APPROVED`,`RUNNING`,`SUCCEEDED`,`FAILED`,`UNKNOWN`].includes(e.status)&&e.approvalId===null&&t.addIssue({code:`custom`,message:`An approved Deployment must carry its Approval`}),[`RUNNING`,`SUCCEEDED`,`FAILED`,`UNKNOWN`].includes(e.status)&&e.startedAt===null&&t.addIssue({code:`custom`,message:`A started Deployment must carry startedAt`}),e.status===`APPROVED`&&[e.startedAt,e.completedAt,e.observedAt,e.failureCode,e.remoteRunId].some(e=>e!==null)&&t.addIssue({code:`custom`,message:`An approved Deployment cannot carry execution state`}),e.status===`RUNNING`&&(e.completedAt!==null||e.failureCode!==null)&&t.addIssue({code:`custom`,message:`A running Deployment cannot carry a terminal outcome`}),[`SUCCEEDED`,`FAILED`].includes(e.status)&&e.completedAt===null&&t.addIssue({code:`custom`,message:`A terminal Deployment must carry completedAt`}),[`SUCCEEDED`,`FAILED`,`UNKNOWN`].includes(e.status)&&e.observedAt===null&&t.addIssue({code:`custom`,message:`A settled Deployment must carry observedAt`}),e.status===`UNKNOWN`&&e.completedAt!==null&&t.addIssue({code:`custom`,message:`An unknown Deployment cannot claim completion`}),e.status===`SUCCEEDED`&&e.remoteRunId===null&&t.addIssue({code:`custom`,message:`A successful Deployment requires an exact remote run`}),e.status===`SUCCEEDED`&&e.failureCode!==null&&t.addIssue({code:`custom`,message:`A successful Deployment cannot carry failureCode`}),[`FAILED`,`UNKNOWN`].includes(e.status)&&e.failureCode===null&&t.addIssue({code:`custom`,message:`Failed or unknown Deployment requires failureCode`})}),Zu=j({schemaVersion:N,id:P,projectId:P,deploymentId:P,approvalDigest:U,actorId:P,createdAt:I}).strict(),Qu=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),$u=Qu.extend({type:k(`ADOPT_DEPLOYMENT_PLAN`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),releaseId:P,expectedReleaseContentHash:U,releaseFreshness:Cu,releaseEvidenceDigest:U,target:zu}).strict()}),ed=Qu.extend({type:k(`APPROVE_DEPLOYMENT`),payload:j({deploymentId:P,expectedVersion:T().int().positive(),approvalDigest:U}).strict()}),td=Qu.extend({type:k(`START_DEPLOYMENT`),payload:j({deploymentId:P,expectedVersion:T().int().positive()}).strict()}),nd=O(`type`,[j({type:k(`DISPATCHED`),runId:Ju.remoteRunId,runUrl:Ju.remoteRunUrl}).strict(),j({type:k(`UNKNOWN`)}).strict(),j({type:k(`REFUSED`)}).strict()]),rd=Qu.extend({type:k(`RECORD_DEPLOYMENT_DISPATCH`),payload:j({deploymentId:P,expectedVersion:T().int().positive(),outcome:nd}).strict()}),id=O(`type`,[j({type:k(`RUNNING`)}).strict(),j({type:k(`SUCCEEDED`)}).strict(),j({type:k(`FAILED`),failureCode:D([`REMOTE_FAILURE`,`REMOTE_CANCELLED`,`REMOTE_TIMED_OUT`,`REMOTE_ACTION_REQUIRED`])}).strict(),j({type:k(`UNKNOWN`)}).strict()]),ad=Qu.extend({type:k(`RECORD_DEPLOYMENT_OBSERVATION`),payload:j({deploymentId:P,expectedVersion:T().int().positive(),observedRunId:Ju.remoteRunId,outcome:id}).strict()}),od=Qu.extend({type:k(`RECONCILE_DEPLOYMENT`),payload:j({deploymentId:P,expectedVersion:T().int().positive()}).strict()}),sd=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),cd=sd.extend({type:k(`DEPLOYMENT_PLAN_ADOPTED`),data:j({plan:qu,deployment:Xu}).strict()}),ld=sd.extend({type:k(`DEPLOYMENT_CHANGED`),data:j({deployment:Xu}).strict()}),ud=j({schemaVersion:N,replayed:b()}).strict(),dd=ud.extend({type:k(`DEPLOYMENT_PLAN_ADOPTED`),plan:qu,deployment:Xu,projectVersion:T().int().positive(),event:cd}),fd=ud.extend({type:k(`DEPLOYMENT_CHANGED`),deployment:Xu,approval:Zu.nullable(),event:ld});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),releaseId:P,expectedReleaseContentHash:U}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),approvalDigest:U}).strict(),j({schemaVersion:N,commandId:P}).strict(),j({schemaVersion:N}).strict(),j({schemaVersion:N}).strict();var pd=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),releaseId:P,releaseContentHash:U,releaseEvidenceDigest:U}),md=O(`status`,[pd.extend({status:k(`READY`),target:zu}).strict(),pd.extend({status:k(`BLOCKED`),code:Uu}).strict()]),hd=j({schemaVersion:N,projectId:P,projectVersion:T().int().positive(),latestPlan:qu.nullable(),latestDeployment:Xu.nullable(),rollbackAvailability:k(`UNAVAILABLE`)}).strict(),gd=5e4,_d=k(`BLOCKS`),vd=j({schemaVersion:N,projectId:P,kind:_d,blockerWorkItemId:P,blockedWorkItemId:P,createdAt:I}).strict(),yd=j({schemaVersion:N,commandId:P,correlationId:F,actor:L,type:k(`SET_WORK_ITEM_DEPENDENCIES`),payload:j({workItemId:P,expectedVersion:T().int().positive(),blockerWorkItemIds:w(P).max(51)}).strict()}).strict(),bd=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict().extend({type:k(`WORK_ITEM_DEPENDENCIES_SET`),aggregateType:k(`WORK_ITEM`),data:j({blockedWorkItemId:P,previousBlockerWorkItemIds:w(P).max(50),blockerWorkItemIds:w(P).max(50),workItemVersion:T().int().positive()}).strict()}),xd=j({schemaVersion:N,replayed:b(),type:k(`WORK_ITEM_DEPENDENCIES_SET`),blockedWorkItemId:P,workItemVersion:T().int().positive(),dependencies:w(vd).max(50),event:bd}).strict();j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),blockerWorkItemIds:w(P).max(51)}).strict();var Sd=j({schemaVersion:N,projectId:P,dependencies:w(vd).max(gd)}).strict(),Cd=D([`repository-baseline`,`typescript-node`,`typescript-pnpm-workspace`]),wd=j({schemaVersion:N,id:Cd,version:k(1),name:C().min(1).max(120),description:C().min(1).max(500)}).strict(),Td=j({schemaVersion:N,presets:w(wd).length(3)}).strict(),Ed=D([`AGENT_INSTRUCTIONS`,`README`,`CONSTITUTION`,`PACKAGE_MANIFEST`,`WORKSPACE_MANIFEST`,`PACKAGE_MANAGER_MARKER`,`TOOL_CONFIG`,`CI_WORKFLOW`,`ARCHITECTURE_DOCUMENT`]),Dd=j({path:C().min(1).max(500),kind:Ed,bytes:T().int().nonnegative().max(1e9),digest:C().regex(/^[0-9a-f]{64}$/).nullable()}).strict(),Od=D([`CANDIDATE_LIMIT_REACHED`,`TOTAL_BYTES_LIMIT_REACHED`,`FILE_TOO_LARGE`,`SYMLINK_SKIPPED`,`FILE_UNREADABLE`,`MANIFEST_INVALID`,`SCRIPT_NAME_UNSAFE`]),kd=j({code:Od,path:C().min(1).max(500).nullable(),message:C().min(1).max(500)}).strict(),Ad=D([`PNPM`,`NPM`,`YARN`,`BUN`,`UNKNOWN`]),jd=D([`TYPESCRIPT`,`JAVASCRIPT`]),Md=j({name:C().regex(/^[a-zA-Z0-9][a-zA-Z0-9:_-]{0,99}$/),argv:w(C().min(1).max(120)).min(2).max(4),sourcePath:k(`package.json`)}).strict(),Nd=O(`state`,[j({state:k(`ABSENT`),digest:re()}).strict(),j({state:k(`PRESENT`),digest:C().regex(/^[0-9a-f]{64}$/)}).strict(),j({state:k(`BLOCKED`),digest:re()}).strict()]),Pd=j({schemaVersion:N,sourceDigest:C().regex(/^[0-9a-f]{64}$/),targetConstitution:Nd,files:w(Dd).max(128),warnings:w(kd).max(128),packageManager:Ad,languages:w(jd).max(2),workspace:b(),verificationCommands:w(Md).max(64),instructionPaths:w(C().min(1).max(500)).max(16),architecturePaths:w(C().min(1).max(500)).max(64),ciPaths:w(C().min(1).max(500)).max(32),configPaths:w(C().min(1).max(500)).max(64)}).strict(),Fd=D([`PRODUCT_CONTEXT`,`ARCHITECTURE`,`CODE_STANDARDS`,`AGENT_POLICIES`,`DEFINITION_OF_DONE`,`ROLE_PLAYBOOKS`,`LEARNED_CONVENTIONS`]),Id=D([`PRESET`,`REPOSITORY`,`SCANNER`]),Ld=j({kind:Id,reference:C().min(1).max(500),label:C().min(1).max(500)}).strict(),Rd=j({key:Fd,title:C().min(1).max(120),body:C().min(1).max(2e4),sources:w(Ld).min(1).max(128)}).strict(),zd=D([`PROPOSED`,`ADOPTION_REQUESTED`,`ADOPTED`]),Bd=j({schemaVersion:N,id:P,projectId:P,projectVersion:T().int().positive(),status:zd,presetId:Cd,presetVersion:k(1),recommendedPresetId:Cd,scan:Pd,sections:w(Rd).length(7),renderedMarkdown:C().min(1).max(1e5),contentDigest:C().regex(/^[0-9a-f]{64}$/),version:T().int().positive(),createdAt:I,adoptedAt:I.nullable()}).strict(),Vd=D([`PUBLISHING`,`ACTIVE`,`SUPERSEDED`,`FAILED`]),Hd=j({schemaVersion:N,id:P,projectId:P,proposalId:P,ordinal:T().int().positive(),presetId:Cd,presetVersion:k(1),sourceDigest:C().regex(/^[0-9a-f]{64}$/),contentDigest:C().regex(/^[0-9a-f]{64}$/),renderedMarkdown:C().min(1).max(1e5),status:Vd,version:T().int().positive(),createdAt:I,activatedAt:I.nullable()}).strict(),Ud=D([`PENDING`,`APPLIED`,`FAILED`]),Wd=D([`CONSTITUTION_TARGET_CHANGED`,`CONSTITUTION_TARGET_OUTSIDE_REPOSITORY`,`CONSTITUTION_TARGET_UNREADABLE`,`CONSTITUTION_WRITE_FAILED`,`REPOSITORY_UNAVAILABLE`]),Gd=j({schemaVersion:N,id:P,projectId:P,constitutionVersionId:P,targetPath:k(`.loomrail/constitution.md`),expectedTargetDigest:C().regex(/^[0-9a-f]{64}$/).nullable(),contentDigest:C().regex(/^[0-9a-f]{64}$/),status:Ud,attempts:T().int().nonnegative(),lastErrorCode:Wd.nullable(),version:T().int().positive(),createdAt:I,updatedAt:I,appliedAt:I.nullable()}).strict(),Kd=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),qd=Kd.extend({type:k(`PROJECT_CONSTITUTION_PROPOSED`),data:j({proposal:Bd}).strict()}),Jd=Kd.extend({type:k(`PROJECT_CONSTITUTION_PUBLICATION_REQUESTED`),data:j({proposal:Bd,constitution:Hd,publication:Gd}).strict()}),Yd=Kd.extend({type:k(`PROJECT_CONSTITUTION_ACTIVATED`),data:j({proposal:Bd,constitution:Hd,publication:Gd}).strict()}),Xd=Kd.extend({type:k(`PROJECT_CONSTITUTION_PUBLICATION_FAILED`),data:j({constitution:Hd,publication:Gd}).strict()}),Zd=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Qd=Zd.extend({type:k(`PROPOSE_PROJECT_CONSTITUTION`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),presetId:Cd,recommendedPresetId:Cd,scan:Pd,sections:w(Rd).length(7),renderedMarkdown:C().min(1).max(1e5),contentDigest:C().regex(/^[0-9a-f]{64}$/)}).strict()}),$d=Zd.extend({type:k(`REQUEST_PROJECT_CONSTITUTION_ADOPTION`),payload:j({projectId:P,proposalId:P,expectedProjectVersion:T().int().positive(),expectedProposalVersion:T().int().positive()}).strict()}),ef=Zd.extend({type:k(`COMPLETE_PROJECT_CONSTITUTION_PUBLICATION`),payload:j({publicationId:P,expectedVersion:T().int().positive()}).strict()}),tf=Zd.extend({type:k(`FAIL_PROJECT_CONSTITUTION_PUBLICATION`),payload:j({publicationId:P,expectedVersion:T().int().positive(),errorCode:Wd}).strict()}),nf=Zd.extend({type:k(`RETRY_PROJECT_CONSTITUTION_PUBLICATION`),payload:j({projectId:P,publicationId:P,expectedVersion:T().int().positive()}).strict()}),rf=j({schemaVersion:N,replayed:b()}).strict(),af=rf.extend({type:k(`PROJECT_CONSTITUTION_PROPOSED`),proposal:Bd,event:qd}),of=rf.extend({type:k(`PROJECT_CONSTITUTION_PUBLICATION_REQUESTED`),proposal:Bd,constitution:Hd,publication:Gd,event:Jd}),sf=rf.extend({type:k(`PROJECT_CONSTITUTION_ACTIVATED`),proposal:Bd,constitution:Hd,publication:Gd,event:Yd}),cf=rf.extend({type:k(`PROJECT_CONSTITUTION_PUBLICATION_FAILED`),constitution:Hd,publication:Gd,event:Xd}),lf=rf.extend({type:k(`PROJECT_CONSTITUTION_PUBLICATION_RETRIED`),constitution:Hd,publication:Gd,event:Jd});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive(),presetId:Cd.optional()}).strict(),j({schemaVersion:N,commandId:P,proposalId:P,expectedProjectVersion:T().int().positive(),expectedProposalVersion:T().int().positive()}).strict(),j({schemaVersion:N,commandId:P,publicationId:P,expectedVersion:T().int().positive()}).strict();var uf=j({schemaVersion:N,latestProposal:Bd.nullable(),activeConstitution:Hd.nullable(),pendingConstitution:Hd.nullable(),publication:Gd.nullable()}).strict(),df=D([`SECURITY`,`LEGAL`,`PAYMENTS`,`ANALYTICS`,`DEPENDENCIES`,`ENVIRONMENT`,`OPERATIONS`]),ff=D([`AUTOMATED`,`OWNER`]),pf=D([`PASSED`,`ACTION_REQUIRED`,`CONFIRMED`,`NOT_APPLICABLE`]),mf=D([`ACTION_REQUIRED`,`READY`]),hf=D([`CONFIRMED`,`NOT_APPLICABLE`]),gf=D([`SECURITY_ACTIVE_CONSTITUTION`,`SECURITY_SECRET_PATHS`,`SECURITY_ENV_IGNORED`,`SECURITY_CI_HARDENING`,`LEGAL_LICENSE`,`LEGAL_OWNER_REVIEW`,`PAYMENTS_OWNER_REVIEW`,`ANALYTICS_OWNER_REVIEW`,`DEPS_LOCKFILE_PRESENT`,`ENV_PROD_SEPARATION`,`SECURITY_HEADERS_OWNER_REVIEW`,`OPS_HEALTH_ENDPOINT_DECLARED`,`OPS_ROLLBACK_PLAN`,`OPS_BACKUP`]),_f=D([`CRITICAL`,`HIGH`,`MEDIUM`,`LOW`]),vf=D([`ACTIVE_CONSTITUTION_MISSING`,`TRACKED_SECRET_PATH`,`ENV_NOT_IGNORED`,`CI_PULL_REQUEST_TARGET`,`CI_WRITE_ALL_PERMISSIONS`,`CI_ACTION_NOT_PINNED`,`CI_INPUT_UNVERIFIABLE`,`LICENSE_MISSING`,`LOCKFILE_MISSING`,`LOCKFILE_AMBIGUOUS`,`DEPENDENCY_INPUT_UNVERIFIABLE`,`PROD_ENV_NOT_IGNORED`,`INLINE_SECRET_IN_CI`]),yf=C().regex(/^[0-9a-f]{64}$/),bf=C().regex(/^[0-9a-f]{40,64}$/).nullable(),xf=j({code:vf,severity:_f,path:C().min(1).max(500).nullable(),message:C().min(1).max(500)}).strict(),Sf=j({key:gf,category:df,mode:ff,status:D([`PASSED`,`ACTION_REQUIRED`]),summary:C().min(1).max(500),findings:w(xf).max(128)}).strict(),Cf=j({schemaVersion:N,id:P,projectId:P,repositoryHead:bf,sourceDigest:yf,workingTreeDirty:b(),status:mf,version:T().int().positive(),createdAt:I,updatedAt:I}).strict(),wf=j({schemaVersion:N,id:P,runId:P,projectId:P,key:gf,category:df,mode:ff,status:pf,summary:C().min(1).max(500),version:T().int().positive()}).strict(),Tf=xf.extend({schemaVersion:N,id:P,runId:P,checkId:P,projectId:P}),Ef=j({schemaVersion:N,id:P,runId:P,checkId:P,projectId:P,outcome:hf,rationale:C().trim().min(1).max(2e3),actor:L,createdAt:I}).strict(),Df=j({schemaVersion:N,run:Cf.nullable(),checks:w(wf).max(14),findings:w(Tf).max(1024),attestations:w(Ef).max(1024)}).strict().superRefine((e,t)=>{e.run===null&&(e.checks.length>0||e.findings.length>0||e.attestations.length>0)&&t.addIssue({code:`custom`,message:`An empty readiness snapshot cannot contain child records`})}),Of=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),kf=Of.extend({type:k(`PROJECT_READINESS_ASSESSED`),data:j({run:Cf,checks:w(wf).max(14),findings:w(Tf).max(1024)}).strict()}),Af=Of.extend({type:k(`PROJECT_READINESS_ATTESTED`),data:j({run:Cf,check:wf,attestation:Ef}).strict()}),jf=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Mf=jf.extend({type:k(`RECORD_PROJECT_READINESS_ASSESSMENT`),payload:j({projectId:P,expectedProjectVersion:T().int().positive(),repositoryHead:bf,sourceDigest:yf,workingTreeDirty:b(),checks:w(Sf).length(14)}).strict()}),Nf=jf.extend({type:k(`ATTEST_PROJECT_READINESS_CHECK`),payload:j({projectId:P,runId:P,checkId:P,expectedRunVersion:T().int().positive(),outcome:hf,rationale:C().trim().min(1).max(2e3)}).strict()}),Pf=j({schemaVersion:N,replayed:b()}).strict(),Ff=Pf.extend({type:k(`PROJECT_READINESS_ASSESSED`),run:Cf,checks:w(wf).max(14),findings:w(Tf).max(1024)}),If=Pf.extend({type:k(`PROJECT_READINESS_ATTESTED`),run:Cf,check:wf,attestation:Ef});j({schemaVersion:N,commandId:P,expectedProjectVersion:T().int().positive()}).strict(),j({schemaVersion:N,commandId:P,runId:P,checkId:P,expectedRunVersion:T().int().positive(),outcome:hf,rationale:C().trim().min(1).max(2e3)}).strict(),D([`LIVE`,`STALE`,`UNAVAILABLE`]);var Lf=D([`PRIMARY`,`SECONDARY`,`FIVE_HOUR`,`SEVEN_DAY`,`SPEND_LIMIT`]),Rf=D([`PROVIDER_UNSUPPORTED`,`TARGET_UNVERIFIED`,`NOT_AUTHENTICATED`,`DATA_NOT_PRESENT`,`PROVIDER_SCHEMA_DRIFT`,`PROVIDER_TIMEOUT`,`PROVIDER_UNAVAILABLE`]),zf=T().min(0).max(1e3),Bf=j({id:C().min(1).max(96).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),name:C().trim().min(1).max(96).nullable(),kind:Lf,usedPercent:zf,remainingPercent:T().min(0).max(100),windowDurationMins:T().int().positive().max(527040),resetsAt:I,limitReached:b()}).strict().superRefine((e,t)=>{e.kind!==`SPEND_LIMIT`&&e.usedPercent>100&&t.addIssue({code:`custom`,path:[`usedPercent`],message:`A provider consumption window cannot exceed 100 percent`});let n=Math.max(0,100-e.usedPercent);Math.abs(e.remainingPercent-n)>1e-6&&t.addIssue({code:`custom`,path:[`remainingPercent`],message:`Remaining provider allowance must be derived from used percent`}),e.usedPercent>=100&&!e.limitReached&&t.addIssue({code:`custom`,path:[`limitReached`],message:`An exhausted provider allowance must be marked as reached`})}),Vf=j({schemaVersion:N,provider:Ec,observedAt:I}),Hf=Vf.extend({freshness:D([`LIVE`,`STALE`]),buckets:w(Bf).min(1).max(16),unavailableReason:re()}).strict().superRefine((e,t)=>{new Set(e.buckets.map(e=>e.id)).size!==e.buckets.length&&t.addIssue({code:`custom`,path:[`buckets`],message:`Provider allowance bucket ids must be unique`})}),Uf=Vf.extend({freshness:k(`UNAVAILABLE`),buckets:w(x()).length(0),unavailableReason:Rf}).strict(),Wf=O(`freshness`,[Hf,Uf]),Gf=j({status:D([`CAPACITY_AVAILABLE`,`LOW_CAPACITY`,`LIMIT_REACHED`,`UNKNOWN`]),deferUntil:I.nullable()}).strict(),Kf=j({schemaVersion:N,projectId:C().min(1).max(128),effectiveProvider:Ec,current:Wf,advisory:Gf,providers:w(Wf).length(2)}).strict().superRefine((e,t)=>{let n=[`CODEX`,`CLAUDE_CODE`];e.providers.some((e,t)=>e.provider!==n[t])&&t.addIssue({code:`custom`,path:[`providers`],message:`Provider allowance snapshots must use canonical provider order`}),e.current.provider!==e.effectiveProvider&&t.addIssue({code:`custom`,path:[`current`],message:`Current provider allowance must match the effective provider`})});j({schemaVersion:N}).strict(),j({projectId:P}).strict();var qf=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict().extend({type:k(`RECORD_PROVIDER_ALLOWANCE`),payload:j({projectId:P,snapshot:Wf}).strict()}),Jf=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict().extend({type:k(`PROVIDER_ALLOWANCE_RECORDED`),data:j({snapshot:Wf}).strict()}),Yf=j({schemaVersion:N,replayed:b(),type:k(`PROVIDER_ALLOWANCE_RECORDED`),snapshot:Wf,event:Jf}).strict(),Xf=/^(?:[/\\]|[A-Za-z]:[/\\])/,Zf=C().regex(/^[0-9a-f]{64}$/),Qf=C().min(1).max(240).regex(/^(?:[A-Za-z0-9._-]+\/)*[A-Za-z0-9._-]+$/).refine(e=>e!==`.loomrail/scaffold.json`&&e.split(`/`).every(e=>e!==`.`&&e!==`..`),`A scaffold file path must be portable and cannot replace the system marker`),$f=k(`typescript-node`),ep=j({path:Qf,bytes:T().int().positive().max(65536),contentDigest:Zf}).strict(),tp=j({schemaVersion:N,recipeId:$f,recipeVersion:k(1),targetPath:C().min(1).max(4096).regex(Xf),projectName:C().min(1).max(80),packageName:C().min(1).max(80),files:w(ep).min(1).max(32),systemFiles:ne([k(`.loomrail/scaffold.json`)]),proposalDigest:Zf}).strict(),np=D([`PENDING`,`COMPLETED`,`FAILED`]),rp=D([`TARGET_CONFLICT`,`TARGET_PARENT_UNAVAILABLE`,`RECIPE_CHANGED`,`SCAFFOLD_FILE_CONFLICT`,`GIT_UNAVAILABLE`,`GIT_INIT_FAILED`,`REPOSITORY_INVALID`,`SCAFFOLD_WRITE_FAILED`]),ip=j({schemaVersion:N,id:P,projectId:P,proposal:tp,status:np,attempts:T().int().nonnegative(),lastErrorCode:rp.nullable(),version:T().int().positive(),createdAt:I,updatedAt:I,completedAt:I.nullable()}).strict(),ap=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateType:k(`PROJECT`),aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),op=ap.extend({type:k(`PROJECT_SCAFFOLD_REQUESTED`),data:j({operation:ip}).strict()}),sp=ap.extend({type:k(`PROJECT_SCAFFOLD_COMPLETED`),data:j({operation:ip}).strict()}),cp=ap.extend({type:k(`PROJECT_SCAFFOLD_FAILED`),data:j({operation:ip}).strict()}),lp=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),up=lp.extend({type:k(`REQUEST_PROJECT_SCAFFOLD`),payload:j({proposal:tp}).strict()}),dp=lp.extend({type:k(`COMPLETE_PROJECT_SCAFFOLD`),payload:j({operationId:P,expectedVersion:T().int().positive()}).strict()}),fp=lp.extend({type:k(`FAIL_PROJECT_SCAFFOLD`),payload:j({operationId:P,expectedVersion:T().int().positive(),errorCode:rp}).strict()}),pp=lp.extend({type:k(`RETRY_PROJECT_SCAFFOLD`),payload:j({operationId:P,expectedVersion:T().int().positive()}).strict()}),mp=j({schemaVersion:N,replayed:b()}).strict(),hp=mp.extend({type:k(`PROJECT_SCAFFOLD_REQUESTED`),operation:ip,event:op}),gp=mp.extend({type:k(`PROJECT_SCAFFOLD_COMPLETED`),operation:ip,event:sp}),_p=mp.extend({type:k(`PROJECT_SCAFFOLD_FAILED`),operation:ip,event:cp}),vp=mp.extend({type:k(`PROJECT_SCAFFOLD_RETRIED`),operation:ip,event:op});j({schemaVersion:N,recipeId:$f,targetPath:C().min(1).max(4096)}).strict();var yp=j({schemaVersion:N,proposal:tp}).strict();j({schemaVersion:N,commandId:P,proposal:tp}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive()}).strict();var bp=j({schemaVersion:N,operation:ip.nullable()}).strict(),xp=j({schemaVersion:N,operations:w(ip)}).strict(),Sp=D([`web-app-a`,`api-service-b`]),Cp=D([`PROVISIONING`,`ACTIVE`,`ARCHIVED`]),wp=D([`EPIC`,`FEATURE`,`TASK`,`BUG`,`SPIKE`,`SUBTASK`]),Tp=D([`BACKLOG`,`READY`,`IN_PROGRESS`,`BLOCKED`,`DONE`,`CANCELLED`]),Ep=D([`LOW`,`MEDIUM`,`HIGH`,`URGENT`]),Dp=D([`LOW`,`MEDIUM`,`HIGH`,`CRITICAL`]),Op=C().trim().min(1).max(200),kp=C().trim().max(2e4),Ap=C().min(1).max(4096),jp=Ap.regex(/^(?:[/\\]|[A-Za-z]:[/\\])/,`A repository path must be absolute`),Mp=w(C().trim().min(1).max(500)).max(50),Np=j({schemaVersion:N,id:P,workspaceId:P,fixtureId:Sp.nullable(),name:Op,repositoryPath:jp,providerPreference:Dc.default(`AUTO`),status:Cp,version:T().int().positive(),createdAt:I,updatedAt:I}).strict(),Pp=j({schemaVersion:N,id:P,projectId:P,parentId:P.nullable(),type:wp,title:Op,description:kp,state:Tp,currentStage:Ja.nullable(),priority:Ep,risk:Dp,acceptanceCriteria:Mp,version:T().int().positive(),createdAt:I,updatedAt:I}).strict(),Fp=j({schemaVersion:N,sequence:T().int().positive(),id:P,aggregateId:P,projectId:P,actor:L,occurredAt:I,correlationId:F}).strict(),Ip=Fp.extend({type:k(`PROJECT_REGISTERED`),aggregateType:k(`PROJECT`),data:j({project:Np}).strict()}),Lp=Fp.extend({type:k(`WORK_ITEM_CREATED`),aggregateType:k(`WORK_ITEM`),data:j({workItem:Pp}).strict()}),Rp=D([`title`,`description`,`priority`,`risk`,`acceptanceCriteria`]),zp=Fp.extend({type:k(`WORK_ITEM_UPDATED`),aggregateType:k(`WORK_ITEM`),data:j({workItem:Pp,changedFields:w(Rp).min(1)}).strict()}),Bp=Fp.extend({type:k(`WORK_ITEM_STATE_CHANGED`),aggregateType:k(`WORK_ITEM`),data:j({workItem:Pp,previousState:Tp}).strict()}),Vp=Fp.extend({type:k(`SQUAD_ASSIGNED`),aggregateType:k(`WORK_ITEM`),data:j({assignment:cl}).strict()}),Hp=Fp.extend({type:k(`AGENT_RUN_STARTED`),aggregateType:k(`WORK_ITEM`),data:j({run:pl}).strict()}),Up=Fp.extend({type:k(`AGENT_RUN_FINISHED`),aggregateType:k(`WORK_ITEM`),data:j({run:pl}).strict()}),Wp=O(`type`,[Ip,op,sp,cp,qd,Jd,Yd,Xd,kf,Af,Lc,Kt,Zl,Ql,Ou,ku,cd,ld,gr,_r,yr,br,xr,ai,oi,si,li,ci,ui,hi,mi,fi,di,pi,Jf,pt,mt,Lp,zp,Bp,bd,Vp,Hp,Up,ka,Aa,ja,Ma,Na,Fa,Pa,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,nn,rn,Lt]),Gp=j({schemaVersion:N,commandId:P,correlationId:F,actor:L}).strict(),Kp=Gp.extend({type:k(`REGISTER_PROJECT`),payload:j({id:P,fixtureId:Sp.nullable(),name:Op,repositoryPath:jp}).strict()}),qp=Gp.extend({type:k(`REPOINT_FIXTURE_PROJECT`),payload:j({projectId:P,fixtureId:Sp,expectedRepositoryPath:jp,repositoryPath:jp}).strict()}),Jp=Gp.extend({type:k(`CREATE_WORK_ITEM`),payload:j({projectId:P,parentId:P.nullable().default(null),type:wp,title:Op,description:kp.default(``),priority:Ep.default(`MEDIUM`),risk:Dp.default(`MEDIUM`),acceptanceCriteria:Mp.default([])}).strict()}),Yp=j({title:Op.optional(),description:kp.optional(),priority:Ep.optional(),risk:Dp.optional(),acceptanceCriteria:Mp.optional()}).strict().refine(e=>Object.keys(e).length>0,{message:`At least one field must be updated`}),Xp=Gp.extend({type:k(`UPDATE_WORK_ITEM`),payload:j({workItemId:P,expectedVersion:T().int().positive(),patch:Yp}).strict()}),Zp=Gp.extend({type:k(`MOVE_WORK_ITEM`),payload:j({workItemId:P,expectedVersion:T().int().positive(),targetState:Tp}).strict()}),Qp=Gp.extend({type:k(`START_AGENT_RUN`),payload:j({dispatchId:P,provider:qe,modelMapping:Pc.nullable().optional(),limits:ul}).strict()}),$p=Gp.extend({type:k(`DISPOSE_REVIEW_FINDING`),payload:j({findingId:P,expectedVersion:T().int().positive(),disposition:On,reason:C().trim().min(1).max(4e3)}).strict()});O(`type`,[Kp,qp,up,dp,fp,pp,Qd,$d,ef,tf,nf,Mf,Nf,Rc,qt,Wl,Gl,Kl,ql,Jl,Yl,Tu,Eu,$u,ed,td,rd,ad,od,ur,dr,fr,pr,mr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,qf,gt,_t,vt,yt,bt,St,Jp,Xp,Zp,yd,Qp,La,Ra,za,Ba,$p,Ds,Os,ks,js,Ms,Ns,Fs,ri,Ls,Rs,zs,Bs,Vs,Hs,Ws,Gs,Ks,qs,Js,Ys,Qs,Zs,on,sn,cn,ln,zt,Vt,qc,Yc,Zc]);var em=j({schemaVersion:N,replayed:b()}).strict(),tm=em.extend({type:k(`PROJECT_REGISTERED`),project:Np,event:Ip}),nm=em.extend({type:k(`WORK_ITEM_CREATED`),workItem:Pp,event:Lp}),rm=em.extend({type:k(`WORK_ITEM_UPDATED`),workItem:Pp,event:zp}),im=em.extend({type:k(`WORK_ITEM_MOVED`),workItem:Pp,event:Bp}),am=em.extend({type:k(`AGENT_RUN_STARTED`),workItemId:P,assignment:cl,run:pl,events:w(O(`type`,[Vp,rs,Hp]))}),om=em.extend({type:k(`AGENT_RUN_BUDGET_PARKED`),workItemId:P,run:z,stageAttempt:B,dispatch:Zo,events:w(O(`type`,[rs,cs]))}),sm=em.extend({type:k(`REVIEW_FINDING_DISPOSED`),workItemId:P,finding:Rn,events:w(gs).length(1)}),cm=O(`type`,[tm,hp,gp,_p,vp,af,of,sf,cf,lf,Ff,If,zc,Jt,eu,tu,ju,Mu,dd,fd,Sr,Cr,Tr,Er,Dr,gi,_i,vi,bi,yi,xi,Yf,wt,Tt,Et,Dt,nm,rm,im,xd,am,om,Ha,Ua,Wa,Ga,sm,$s,ec,nc,rc,ic,ac,oc,sc,lc,uc,dc,pc,mc,hc,gc,_c,vc,yc,xc,bc,un,dn,fn,pn,Ht,Jc,Xc,Qc]);j({schemaVersion:N,commandId:P,fixtureId:Sp}).strict(),j({schemaVersion:N,commandId:P,repositoryPath:Ap}).strict(),Jp.shape.payload.omit({projectId:!0}).extend({schemaVersion:N,commandId:P,projectId:P}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),patch:Yp}).strict(),j({schemaVersion:N,commandId:P,expectedVersion:T().int().positive(),targetState:Tp}).strict();var lm=D([`READY`,`UNUSABLE`]),um=Np.extend({repositoryStatus:lm}).strict(),dm=j({schemaVersion:N,projects:w(um)}).strict();j({schemaVersion:N,workItem:Pp}).strict();var fm=j({schemaVersion:N,workItems:w(Pp)}).strict();D([`ASC`,`DESC`]);var pm=j({schemaVersion:N,events:w(Wp),nextSequence:T().int().nonnegative(),hasMore:b()}).strict(),mm=D([`BLOCKING_NOW`,`APPROVALS`,`QUESTIONS`,`MANUAL_ACTIONS`,`SOON`]),hm=D([`APPROVAL`,`QUESTION`,`MANUAL_ACTION`]),gm=D([`ANSWER_REQUEST`,`OPEN_TASK_CONTEXT`,`REVIEW_ACCEPTANCE`]),_m=D([`PROVIDER_RATE_LIMITED`]),vm=j({schemaVersion:N,id:P,request:Jo,project:j({id:P,name:C().trim().min(1).max(200)}).strict(),workItem:j({id:P,title:C().trim().min(1).max(200),priority:Ep,state:Tp}).strict(),stage:j({id:P,name:Ja,status:Xa}).strict(),section:mm,category:hm,reason:_m.nullable(),action:gm,acceptancePackageId:P.nullable(),affectedStages:w(Ja).min(1).max(20)}).strict(),ym=j({schemaVersion:N,items:w(vm).max(200),hasMore:b()}).strict(),bm={schemaVersion:1,id:`guided-real-v1`,fixtureId:`web-app-a`,createCommandId:`guided-activation-v1-create-task`,task:{title:`Render an accessible empty task state`,description:`When the task list is empty, render a concise status message instead of an empty list. Keep non-empty markup and HTML escaping unchanged. Use semantic server-rendered HTML, add focused tests, and do not add dependencies or client-side JavaScript.`,priority:`MEDIUM`,risk:`LOW`,type:`TASK`,acceptanceCriteria:[`An empty input renders exactly one visible status message and no empty ul element.`,`A non-empty input preserves the current list markup and escaped titles.`,`All tests pass with node --test and no install or network step.`]},policy:{maxEstimatedTokens:64e3,agentRunMaxEstimatedTokensOverride:8e3,modelTierOverride:`FAST`},install:{commands:[`mkdir loomrail-evaluation`,`cd loomrail-evaluation`,`npm install --ignore-scripts loomrail@latest`,`npx playwright install chromium`,`npx loomrail try`]}},xm=[`mkdir loomrail-evaluation`,`cd loomrail-evaluation`,`npm install --ignore-scripts loomrail@latest`,`npx playwright install chromium`,`npx loomrail try`],Sm=j({schemaVersion:N,id:k(`guided-real-v1`),fixtureId:Sp,createCommandId:P,task:j({title:C().trim().min(1).max(200),description:C().trim().min(1).max(2e4),priority:Ep,risk:Dp,type:wp,acceptanceCriteria:w(C().trim().min(1).max(500)).min(1).max(50)}).strict(),policy:j({maxEstimatedTokens:T().int().min(100).max(1e7),agentRunMaxEstimatedTokensOverride:T().int().min(100).max(1e6),modelTierOverride:Je}).strict().refine(e=>e.agentRunMaxEstimatedTokensOverride<=e.maxEstimatedTokens,`The per-agent ceiling cannot exceed the whole guided run budget`),install:j({commands:w(D(xm)).length(xm.length)}).strict()}).strict().superRefine((e,t)=>{new Set(e.install.commands).size!==e.install.commands.length&&t.addIssue({code:`custom`,message:`Activation install commands must be unique`}),new Set(e.task.acceptanceCriteria).size!==e.task.acceptanceCriteria.length&&t.addIssue({code:`custom`,message:`Activation acceptance criteria must be unique`}),e.install.commands.some((e,t)=>e!==xm[t])&&t.addIssue({code:`custom`,message:`Activation install commands must keep the reviewed order`})}).parse(bm),W=T().int().nonnegative().max(2**53-1),Cm=T().int().min(0).max(100).nullable(),wm=j({productVersion:C().min(1).max(64).regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/),operatingSystem:D([`MACOS`,`WINDOWS`,`LINUX`,`OTHER`]),architecture:D([`X64`,`ARM64`,`OTHER`]),nodeMajor:T().int().positive().max(999)}).strict(),Tm=j({workItems:j({total:W,accepted:W,cancelled:W,active:W}).strict(),pipelineRuns:j({total:W,succeeded:W,failed:W,interrupted:W,cancelled:W}).strict(),agentRuns:j({total:W,succeeded:W,failed:W,interrupted:W}).strict(),reviews:j({total:W,firstRound:W,firstRoundPassed:W}).strict(),qa:j({total:W,passed:W,failed:W,errored:W,defectsOpen:W,defectsResolved:W,defectsWaived:W}).strict(),humanRequests:j({total:W,resolved:W}).strict(),usage:j({estimatedTokens:W}).strict(),reliability:j({daemonRestartRecoveries:W}).strict()}).strict().superRefine((e,t)=>{let n=(e,n,r)=>{e>n&&t.addIssue({code:`custom`,message:`Count exceeds its total`,path:r})};for(let t of[`accepted`,`cancelled`,`active`])n(e.workItems[t],e.workItems.total,[`workItems`,t]);for(let t of[`succeeded`,`failed`,`interrupted`,`cancelled`])n(e.pipelineRuns[t],e.pipelineRuns.total,[`pipelineRuns`,t]);for(let t of[`succeeded`,`failed`,`interrupted`])n(e.agentRuns[t],e.agentRuns.total,[`agentRuns`,t]);n(e.reviews.firstRound,e.reviews.total,[`reviews`,`firstRound`]),n(e.reviews.firstRoundPassed,e.reviews.firstRound,[`reviews`,`firstRoundPassed`]);for(let t of[`passed`,`failed`,`errored`])n(e.qa[t],e.qa.total,[`qa`,t]);n(e.humanRequests.resolved,e.humanRequests.total,[`humanRequests`,`resolved`])}).extend({rates:j({acceptedCompletionPercent:Cm,firstPassReviewPercent:Cm,terminalQaPassPercent:Cm}).strict()}),Em=j({schemaVersion:N,kind:k(`AGGREGATE`),runtime:wm,metrics:Tm}).strict(),Dm=j({schemaVersion:N,kind:k(`CRASH`),runtime:wm,incident:j({reason:k(`DAEMON_RESTART`),recoveredStatus:k(`INTERRUPTED`),affectedWorkflowCount:T().int().positive().max(2**53-1)}).strict()}).strict(),Om=O(`kind`,[Em,Dm]),km=j({schemaVersion:N,localMetrics:Tm,aggregateReport:Em,crashReport:Dm.nullable()}).strict(),Am=j({projectId:P,aggregateType:D([`PROJECT`,`WORK_ITEM`]),aggregateId:P}).strict();j({status:D([`live`,`ready`]),apiVersion:Ke,timestamp:I}).strict(),j({bootstrapToken:C().min(43).max(128)}).strict();var jm=j({authenticated:k(!0),csrfToken:C().min(43).max(128),expiresAt:I}).strict(),Mm=j({apiVersion:Ke,authenticated:k(!0),daemon:j({status:k(`online`),version:C(),mode:k(`local`),startedAt:I,platform:D([`darwin`,`win32`,`linux`,`other`])}).strict(),foundation:j({phase:k(`phase-0`),milestone:D([`M1`,`M2`,`M3`,`M4`,`M5`,`M6`]),providers:k(`real-api-only`),persistence:D([`not-enabled`,`sqlite`])}).strict()}).strict(),Nm=j({error:j({code:C(),message:C(),correlationId:F,details:S(C(),te()).optional()}).strict()}).strict(),Pm={direction:`desc`,ordering:`priority`,showEmptyColumns:!0},Fm=[`priority`,`created`,`updated`,`title`],Im=e=>typeof e==`string`&&Fm.some(t=>t===e),Lm=e=>e===`asc`||e===`desc`,Rm={LOW:0,MEDIUM:1,HIGH:2,URGENT:3},zm=(e,t,n)=>e===`priority`?Rm[t.priority]-Rm[n.priority]:e===`created`?t.createdAt.localeCompare(n.createdAt):e===`updated`?t.updatedAt.localeCompare(n.updatedAt):t.title.localeCompare(n.title),Bm=(e,{direction:t,ordering:n})=>{let r=t===`asc`?1:-1;return[...e].sort((e,t)=>{let i=zm(n,e,t);if(i!==0)return i*r;let a=e.createdAt.localeCompare(t.createdAt);return a===0?e.id.localeCompare(t.id):a*r})},Vm={active:[`BACKLOG`,`READY`,`IN_PROGRESS`,`BLOCKED`],backlog:[`BACKLOG`],all:[`BACKLOG`,`READY`,`IN_PROGRESS`,`BLOCKED`,`DONE`,`CANCELLED`]},Hm=e=>e===`active`||e===`backlog`||e===`all`,Um=(e,t)=>Vm[e].includes(t),G=r(),Wm={add:[`M12 5v14`,`M5 12h14`],agents:[`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,`M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8`,`M22 21v-2a4 4 0 0 0-3-3.87`,`M16 3.13a4 4 0 0 1 0 7.75`],board:[`M1 2.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C1.76 1 2.04 1 2.6 1h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C7 1.76 7 2.04 7 2.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C6.24 5 5.96 5 5.4 5H2.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C1 4.24 1 3.96 1 3.4v-.8ZM9 2.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 1 10.04 1 10.6 1h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 1.76 15 2.04 15 2.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C14.24 5 13.96 5 13.4 5h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C9 4.24 9 3.96 9 3.4v-.8ZM1 7.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C1.76 6 2.04 6 2.6 6h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C7 6.76 7 7.04 7 7.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C6.24 10 5.96 10 5.4 10H2.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C1 9.24 1 8.96 1 8.4v-.8ZM9 7.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 6 10.04 6 10.6 6h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 6.76 15 7.04 15 7.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C14.24 10 13.96 10 13.4 10h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C9 9.24 9 8.96 9 8.4v-.8ZM1 12.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C1.76 11 2.04 11 2.6 11h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C7 11.76 7 12.04 7 12.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C6.24 15 5.96 15 5.4 15H2.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C1 14.24 1 13.96 1 13.4v-.8ZM9 12.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 11 10.04 11 10.6 11h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 11.76 15 12.04 15 12.6v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C14.24 15 13.96 15 13.4 15h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C9 14.24 9 13.96 9 13.4v-.8Z`],branch:[`M6 3v12`,`M18 9a6 6 0 0 1-6 6H6`,`M6 3a2 2 0 1 0 0 4 2 2 0 0 0 0-4`,`M18 5a2 2 0 1 0 0 4 2 2 0 0 0 0-4`,`M18 17a2 2 0 1 0 0 4 2 2 0 0 0 0-4`],budget:[`M12 2v20`,`M17 5H9.5a3.5 3.5 0 0 0 0 7H14a3.5 3.5 0 0 1 0 7H6`],check:[`m5 12 4 4L19 6`],chevronDown:[`m6 9 6 6 6-6`],chevronLeft:[`m15 18-6-6 6-6`],chevronRight:[`m9 18 6-6-6-6`],clock:[`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20`,`M12 6v6l4 2`],close:[`M6 6l12 12`,`M18 6 6 18`],code:[`m8 9-4 3 4 3`,`m16 9 4 3-4 3`,`m14 5-4 14`],command:[`M18 9h-9a3 3 0 1 1 3-3v12a3 3 0 1 1-3-3h9a3 3 0 1 1-3 3V6a3 3 0 1 1 3 3Z`],error:[`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20`,`m15 9-6 6`,`m9 9 6 6`],edit:[`M12 20h9`,`M16.5 3.5a2.12 2.12 0 0 1 3 3L8 18l-4 1 1-4Z`],external:[`M14 3h7v7`,`m10 14 11-11`,`M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5`],filter:[`M4 6h16`,`M7 12h10`,`M10 18h4`],inbox:[`M4 4h16v16H4z`,`M4 14h4l2 3h4l2-3h4`],info:[`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20`,`M12 11v6`,`M12 7h.01`],insights:[`M4 19V10`,`M10 19V5`,`M16 19v-7`,`M22 19V2`],layers:[`m12 2 9 5-9 5-9-5 9-5Z`,`m3 12 9 5 9-5`,`m3 17 9 5 9-5`],link:[`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`],list:[`M1 1.8c0-.28 0-.42.054-.527a.5.5 0 0 1 .219-.218C1.38 1 1.52 1 1.8 1h12.4c.28 0 .42 0 .527.054a.5.5 0 0 1 .218.219C15 1.38 15 1.52 15 1.8v.4c0 .28 0 .42-.055.527a.5.5 0 0 1-.218.219C14.62 3 14.48 3 14.2 3H1.8c-.28 0-.42 0-.527-.054a.5.5 0 0 1-.218-.219C1 2.62 1 2.48 1 2.2v-.4ZM1 13.8c0-.28 0-.42.054-.527a.5.5 0 0 1 .219-.218C1.38 13 1.52 13 1.8 13h12.4c.28 0 .42 0 .527.055a.5.5 0 0 1 .218.218c.055.107.055.247.055.527v.4c0 .28 0 .42-.055.527a.5.5 0 0 1-.218.218C14.62 15 14.48 15 14.2 15H1.8c-.28 0-.42 0-.527-.055a.5.5 0 0 1-.218-.218C1 14.62 1 14.48 1 14.2v-.4ZM1 9.8c0-.28 0-.42.054-.527a.5.5 0 0 1 .219-.218C1.38 9 1.52 9 1.8 9h12.4c.28 0 .42 0 .527.055a.5.5 0 0 1 .218.218C15 9.38 15 9.52 15 9.8v.4c0 .28 0 .42-.055.527a.5.5 0 0 1-.218.218C14.62 11 14.48 11 14.2 11H1.8c-.28 0-.42 0-.527-.055a.5.5 0 0 1-.218-.218C1 10.62 1 10.48 1 10.2v-.4ZM1 5.8c0-.28 0-.42.054-.527a.5.5 0 0 1 .219-.218C1.38 5 1.52 5 1.8 5h12.4c.28 0 .42 0 .527.054a.5.5 0 0 1 .218.219C15 5.38 15 5.52 15 5.8v.4c0 .28 0 .42-.055.527a.5.5 0 0 1-.218.218C14.62 7 14.48 7 14.2 7H1.8c-.28 0-.42 0-.527-.054a.5.5 0 0 1-.218-.219C1 6.62 1 6.48 1 6.2v-.4Z`],menu:[`M4 7h16`,`M4 12h16`,`M4 17h16`],minus:[`M5 12h14`],monitor:[`M3 4h18v12H3z`,`M8 20h8`,`M12 16v4`],moon:[`M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8Z`],more:[`M5 12h.01`,`M12 12h.01`,`M19 12h.01`],pause:[`M8 5v14`,`M16 5v14`],person:[`M20 21a8 8 0 0 0-16 0`,`M12 13a5 5 0 1 0 0-10 5 5 0 0 0 0 10`],play:[`m7 4 13 8-13 8V4Z`],projects:[`M4 4h6l2 3h8v13H4z`],question:[`M9.1 9a3 3 0 1 1 5.83 1c0 2-3 2-3 4`,`M12 18h.01`,`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20`],search:[`M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16`,`m21 21-4.35-4.35`],sessions:[`M4 4h16v16H4z`,`M8 8h8`,`M8 12h5`,`M8 16h3`],settings:[`M4 7h10`,`M18 7h2`,`M4 17h2`,`M10 17h10`,`M14 4v6`,`M7 14v6`],sortAscending:[`M8.23 3.674a.75.75 0 0 1-.961 1.152l-1.77-1.475V14.25a.75.75 0 0 1-1.5 0V3.351L2.23 4.826a.75.75 0 1 1-.96-1.152l3-2.5a.75.75 0 0 1 .96 0z`,`M6.999 7.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75M6.999 10.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75M6.999 13.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5h-1.5a.75.75 0 0 1-.75-.75`],star:[`m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8-6.2-3.2L5.8 21 7 14.2 2 9.3l6.9-1L12 2Z`],success:[`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20`,`m8 12 3 3 5-6`],sun:[`M12 4V2`,`M12 22v-2`,`m4.93 4.93-1.42-1.42`,`m20.49 20.49-1.42-1.42`,`M4 12H2`,`M22 12h-2`,`m6.34 17.66-1.41 1.41`,`m19.07 4.93-1.41 1.41`,`M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10`],terminal:[`m4 6 4 4-4 4`,`M10 16h6`,`M3 3h18v18H3z`],test:[`M9 2v6l-5 9a3 3 0 0 0 2.6 4.5h10.8A3 3 0 0 0 20 17l-5-9V2`,`M7 14h10`,`M8 2h8`],views:[`m12 3 9 5-9 5-9-5 9-5Z`,`m3 13 9 5 9-5`],viewAdd:[`M6.97358 1.34476C7.57022.885624 8.41055.885024 9.00788 1.3433L14.5499 5.59521C15.15 6.05565 15.15 6.94435 14.5499 7.40478L9.00788 11.6567C8.41055 12.115 7.57022 12.1144 6.97358 11.6552L1.44875 7.40374C.850417 6.94331.850415 6.05669 1.44875 5.59625L6.97358 1.34476ZM8 3.25c.41421 0 .75.33579.75.75v1.75h1.75a.75.75 0 0 1 0 1.5H8.75V9a.75.75 0 0 1-1.5 0V7.25H5.5a.75.75 0 0 1 0-1.5h1.75V4c0-.41421.33579-.75.75-.75Z`,`M1.15024 9.79849c.24384-.33474.69848-.39736 1.01548-.13987l4.34409 3.33628c.78087.6343 1.8682.6343 2.64907 0l4.67552-3.33628c.3169-.25749.7716-.19487 1.0154.13987.2439.33471.1846.81481-.1324 1.07231l-4.6755 3.3363c-1.30145 1.0572-3.11366 1.0572-4.41512 0l-4.34409-3.3363c-.316992-.2575-.376293-.7376-.13245-1.07231Z`],warning:[`m12 3 10 18H2L12 3Z`,`M12 9v4`,`M12 17h.01`]},K=({name:e,size:t=16,...n})=>{if(e===`spinner`)return(0,G.jsxs)(`svg`,{"aria-hidden":`true`,className:`lr-icon lr-icon--spinner`,fill:`none`,height:t,viewBox:`0 0 24 24`,width:t,...n,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,opacity:`0.25`,r:`9`,stroke:`currentColor`,strokeWidth:`2`}),(0,G.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2`})]});if(e===`more`)return(0,G.jsxs)(`svg`,{"aria-hidden":`true`,className:`lr-icon`,fill:`currentColor`,height:t,viewBox:`0 0 24 24`,width:t,...n,children:[(0,G.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1.5`})]});if(e===`board`||e===`list`||e===`sortAscending`||e===`viewAdd`)return(0,G.jsx)(`svg`,{"aria-hidden":`true`,className:`lr-icon`,fill:`currentColor`,height:t,viewBox:`0 0 16 16`,width:t,...n,children:Wm[e].map(e=>(0,G.jsx)(`path`,{d:e},e))});let r=e===`add`||e===`filter`||e===`settings`?2.1:1.7;return(0,G.jsx)(`svg`,{"aria-hidden":`true`,className:`lr-icon`,fill:`none`,height:t,viewBox:`0 0 24 24`,width:t,...n,children:Wm[e].map(e=>(0,G.jsx)(`path`,{d:e,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:r},e))})},q=(...e)=>e.filter(Boolean).join(` `),J=(0,M.forwardRef)(({children:e,className:t,disabled:n,icon:r,loading:i=!1,shape:a=`rounded`,size:o=`md`,trailingIcon:s,variant:c=`ghost`,...l},u)=>(0,G.jsxs)(`button`,{"aria-busy":i,className:q(`lr-button`,`lr-button--${c}`,`lr-button--${a}`,`lr-control--${o}`,i&&`is-loading`,t),disabled:i||n===!0,ref:u,...l,children:[r?(0,G.jsx)(K,{name:i?`spinner`:r}):null,(0,G.jsx)(`span`,{className:q(`lr-button__content`,!r&&i&&`is-visually-loading`),children:e}),s?(0,G.jsx)(K,{name:s}):null,!r&&i?(0,G.jsx)(K,{name:`spinner`}):null]}));J.displayName=`Button`;var Gm=(0,M.forwardRef)(({className:e,disabled:t,label:n,loading:r=!1,name:i,size:a=`md`,variant:o=`ghost`,...s},c)=>(0,G.jsx)(`button`,{"aria-busy":r,"aria-label":n,className:q(`lr-icon-button`,`lr-button--${o}`,`lr-control--${a}`,e),disabled:r||t===!0,ref:c,...s,children:(0,G.jsx)(K,{name:r?`spinner`:i})}));Gm.displayName=`IconButton`;var Km=({className:e,tone:t=`neutral`,...n})=>(0,G.jsx)(`span`,{className:q(`lr-badge`,`lr-badge--${t}`,e),...n}),qm=({className:e,label:t,tone:n,...r})=>(0,G.jsxs)(`span`,{className:q(`lr-status`,`lr-status--${n}`,e),...r,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`lr-status__icon`}),(0,G.jsx)(`span`,{children:t})]}),Jm=({className:e,label:t,tone:n=`neutral`,...r})=>(0,G.jsx)(`span`,{"aria-label":t,className:q(`lr-avatar`,`lr-avatar--${n}`,e),role:`img`,...r,children:t.split(/\s+/).slice(0,2).map(e=>e[0]).join(``).toUpperCase()}),Y=({className:e,width:t,...n})=>(0,G.jsx)(`span`,{className:q(`lr-skeleton`,e),style:t?{width:t}:void 0,...n}),Ym={empty:`inbox`,error:`error`,offline:`monitor`,success:`success`},Xm=({action:e,className:t,description:n,title:r,tone:i=`empty`,...a})=>(0,G.jsxs)(`div`,{className:q(`lr-feedback`,`lr-feedback--${i}`,t),...a,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`lr-feedback__icon`,children:(0,G.jsx)(K,{name:Ym[i],size:18})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:r}),(0,G.jsx)(`p`,{children:n})]}),e?(0,G.jsx)(`div`,{className:`lr-feedback__action`,children:e}):null]}),Zm=({className:e,...t})=>(0,G.jsx)(`kbd`,{className:q(`lr-kbd`,e),...t}),X=({children:e,description:t,error:n,htmlFor:r,label:i,required:a=!1})=>(0,G.jsxs)(`div`,{className:q(`lr-field`,n&&`has-error`),children:[(0,G.jsxs)(`label`,{className:`lr-field__label`,htmlFor:r,children:[i,a?(0,G.jsx)(`span`,{"aria-hidden":`true`,children:` *`}):null]}),e,n?(0,G.jsxs)(`span`,{className:`lr-field__error`,id:`${r}-error`,role:`alert`,children:[(0,G.jsx)(K,{name:`error`,size:13}),n]}):t?(0,G.jsx)(`span`,{className:`lr-field__description`,id:`${r}-description`,children:t}):null]}),Qm=(0,M.forwardRef)(({className:e,icon:t,invalid:n=!1,size:r=`lg`,...i},a)=>(0,G.jsxs)(`span`,{className:q(`lr-text-field`,`lr-control--${r}`,n&&`has-error`,e),children:[t?(0,G.jsx)(K,{name:t}):null,(0,G.jsx)(`input`,{"aria-invalid":n,ref:a,...i})]}));Qm.displayName=`TextField`;var $m=(0,M.forwardRef)(({className:e,invalid:t=!1,...n},r)=>(0,G.jsx)(`textarea`,{"aria-invalid":t,className:q(`lr-textarea`,t&&`has-error`,e),ref:r,...n}));$m.displayName=`Textarea`;var eh=({className:e,description:t,id:n,label:r,...i})=>{let a=(0,M.useId)(),o=n??a;return(0,G.jsxs)(`label`,{className:`lr-check-row`,htmlFor:o,children:[(0,G.jsx)(fe,{className:q(`lr-checkbox`,e),id:o,...i,children:(0,G.jsx)(pe,{children:(0,G.jsx)(K,{name:`check`,size:12})})}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:r}),t?(0,G.jsx)(`small`,{children:t}):null]})]})},th=({className:e,description:t,id:n,label:r,...i})=>{let a=(0,M.useId)(),o=n??a;return(0,G.jsxs)(`label`,{className:`lr-switch-row`,htmlFor:o,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:r}),t?(0,G.jsx)(`small`,{children:t}):null]}),(0,G.jsx)(Le,{className:q(`lr-switch`,e),id:o,...i,children:(0,G.jsx)(Ce,{className:`lr-switch__thumb`})})]})},nh=({className:e,options:t,...n})=>(0,G.jsx)(Ue,{className:q(`lr-radio-group`,e),...n,children:t.map(e=>(0,G.jsxs)(`label`,{className:`lr-radio-row`,children:[(0,G.jsx)(He,{className:`lr-radio`,value:e.value,children:(0,G.jsx)(Se,{className:`lr-radio__indicator`})}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:e.label}),e.description?(0,G.jsx)(`small`,{children:e.description}):null]})]},e.value))}),rh=({ariaLabel:e,contentClassName:t,defaultValue:n,disabled:r=!1,id:i,onValueChange:a,options:o,placeholder:s=`Select…`,size:c=`lg`,value:l,variant:u=`default`})=>{let d={...n===void 0?{}:{defaultValue:n},...a===void 0?{}:{onValueChange:a},...l===void 0?{}:{value:l}};return(0,G.jsxs)(je,{disabled:r,...d,children:[(0,G.jsxs)(Ee,{"aria-label":e,className:q(`lr-select-trigger`,`lr-control--${c}`,u===`compact`&&`lr-select-trigger--compact`),id:i,children:[(0,G.jsx)(be,{placeholder:s}),(0,G.jsx)(we,{children:(0,G.jsx)(K,{name:`chevronDown`,size:13})})]}),(0,G.jsx)(De,{children:(0,G.jsx)(ze,{className:q(`lr-select-content`,u===`compact`&&`lr-select-content--compact`,t),position:`popper`,sideOffset:4,children:(0,G.jsx)(Be,{className:`lr-select-viewport`,children:o.map(e=>(0,G.jsxs)(Te,{className:`lr-select-item`,value:e.value,...e.disabled===void 0?{}:{disabled:e.disabled},children:[(0,G.jsxs)(`span`,{className:`lr-select-item__copy`,children:[(0,G.jsx)(Me,{children:e.label}),e.description?(0,G.jsx)(`small`,{children:e.description}):null]}),(0,G.jsx)(Fe,{className:`lr-select-item__indicator`,children:(0,G.jsx)(K,{name:`check`,size:13})})]},e.value))})})})]})},ih=e=>e.length===0?`root`:e.join(`/`),ah=e=>e.trim().toLocaleLowerCase(),oh=e=>(e.children?.length??0)>0,sh=(e,t)=>`${e.label} ${e.description??``}`.toLocaleLowerCase().includes(t),ch=(e,t,n=!1)=>{let r=ah(t);if(r===``)return e.map(e=>({node:e}));let i=(e,t)=>e.flatMap(e=>sh(e,r)?t?[{node:e,parent:t}]:[{node:e}]:!n||!oh(e)?[]:i(e.children??[],e));return i(e,void 0)},lh=(e,t,n)=>{let r=[],i=e;for(let e of t){let t=[...r],a=ch(i,n[ih(t)]??``,t.length===0).find(t=>t.node.id===e&&!t.parent)?.node;if(!a||!oh(a))break;r.push(e),i=a.children??[]}return r},uh=({children:e,label:t,side:n=`bottom`})=>(0,G.jsx)(Oe,{delayDuration:350,skipDelayDuration:150,children:(0,G.jsxs)(xe,{children:[(0,G.jsx)(Pe,{asChild:!0,onFocus:e=>{e.currentTarget.matches(`:focus-visible`)||e.preventDefault()},children:e}),(0,G.jsx)(Ie,{children:(0,G.jsxs)(Ne,{className:`lr-tooltip`,side:n,sideOffset:6,children:[t,(0,G.jsx)(Re,{className:`lr-tooltip__arrow`})]})})]})}),dh=({align:e=`start`,contentClassName:t,groups:n,side:r=`bottom`,trigger:i,triggerTooltip:a})=>{let o=n.filter(e=>e.length>0);return o.length===0?i:(0,G.jsxs)(Ae,{children:[a?(0,G.jsx)(uh,{label:a,children:(0,G.jsx)(ke,{asChild:!0,children:i})}):(0,G.jsx)(ke,{asChild:!0,children:i}),(0,G.jsx)(me,{children:(0,G.jsx)(ce,{align:e,className:q(`lr-menu`,t),collisionPadding:8,side:r,sideOffset:5,children:o.map((e,t)=>(0,G.jsxs)(`div`,{className:`lr-menu__group`,children:[e.map(e=>(0,G.jsxs)(se,{className:q(`lr-menu__item`,e.icon&&`has-icon`,e.danger&&`is-danger`),disabled:e.disabled===!0||e.onSelect===void 0,...e.onSelect===void 0?{}:{onSelect:e.onSelect},children:[e.icon?(0,G.jsx)(`span`,{className:`lr-menu__item-icon`,children:(0,G.jsx)(K,{name:e.icon,size:14})}):null,(0,G.jsx)(`span`,{children:e.label}),e.shortcut?(0,G.jsx)(Zm,{children:e.shortcut}):null]},e.label)),t<o.length-1?(0,G.jsx)(ie,{className:`lr-menu__separator`}):null]},e.map(e=>e.label).join(`-`)))})})]})},fh=({align:e=`end`,children:t,className:n,label:r,side:i=`bottom`,trigger:a,triggerTooltip:o})=>{let s=(0,M.useRef)(null),[c,l]=(0,M.useState)(!1);return(0,G.jsxs)(Ve,{onOpenChange:l,open:c,children:[o?(0,G.jsx)(uh,{label:o,children:(0,G.jsx)(ve,{asChild:!0,children:a})}):(0,G.jsx)(ve,{asChild:!0,children:a}),(0,G.jsx)(oe,{children:(0,G.jsx)(_e,{align:e,"aria-label":r,className:q(`lr-popover`,n),collisionPadding:8,onKeyDown:e=>{e.key===`Escape`&&e.target instanceof Node&&e.currentTarget.contains(e.target)&&l(!1)},onOpenAutoFocus:e=>{e.preventDefault(),s.current?.focus()},ref:s,side:i,sideOffset:6,children:t})})]})},ph=({children:e,className:t,closeLabel:n=`Close dialog`,description:r,footer:i,onOpenChange:a,open:o,size:s=`md`,title:c,trigger:l,triggerTooltip:u})=>{let d=(0,M.useRef)(null),f={...a===void 0?{}:{onOpenChange:a},...o===void 0?{}:{open:o}};return(0,G.jsxs)(he,{...f,children:[l?u?(0,G.jsx)(uh,{label:u,children:(0,G.jsx)(ye,{asChild:!0,children:l})}):(0,G.jsx)(ye,{asChild:!0,children:l}):null,(0,G.jsxs)(We,{children:[(0,G.jsx)(ge,{className:`lr-dialog-overlay`}),(0,G.jsxs)(ue,{className:q(`lr-dialog`,`lr-dialog--${s}`,t),onOpenAutoFocus:e=>{e.preventDefault(),d.current?.focus()},ref:d,tabIndex:-1,children:[(0,G.jsxs)(`header`,{className:`lr-dialog__header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(ae,{children:c}),r?(0,G.jsx)(de,{children:r}):null]}),(0,G.jsx)(uh,{label:n,children:(0,G.jsx)(le,{asChild:!0,children:(0,G.jsx)(Gm,{label:n,name:`close`,size:`lg`})})})]}),(0,G.jsx)(`div`,{className:`lr-dialog__body`,children:e}),i?(0,G.jsx)(`footer`,{className:`lr-dialog__footer`,children:i}):null]})]})]})},mh={add:`Add`,addFilterPlaceholder:`Add Filter…`,backTo:`Back to`,clear:`Clear`,close:`Close filters`,description:`Choose one or more task properties. Each selection is applied immediately.`,edit:`Edit`,filterPlaceholder:`Filter…`,is:`is`,isAnyOf:`is any of`,noMatchingProperties:`No matching properties`,noMatchingValues:`No matching values`,oneValue:`1 value`,options:`options`,remove:`Remove`,rootTitle:`Filters`,search:`Search`,selectedValues:`selected values`},hh=`(max-width: 760px)`,gh=80,_h=187,vh=197,yh=e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(hh);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},bh=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(hh).matches,xh=()=>!1,Sh=(e,t,n)=>{let r=[{key:`root`,nodes:e,path:[],title:n}],i=e;for(let[e,n]of t.entries()){let a=i.find(e=>e.id===n);if(!a?.children||a.children.length===0)break;let o=t.slice(0,e+1);r.push({key:ih(o),nodes:a.children,path:o,title:a.label}),i=a.children}return r},Ch=e=>Math.min(707,50+e.reduce((e,t)=>e+(t.dividerBefore?12:0)+(t.description?46:32),0)),wh=e=>e.flatMap(e=>e.children&&e.children.length>0?wh(e.children):[e.id]),Th=(e,t)=>wh(e).filter(e=>t.includes(e)),Eh=(e,t)=>{let n=new Map,r=(e,i)=>{e.forEach(e=>{if(e.children&&e.children.length>0){r(e.children,e);return}if(!t.includes(e.id))return;let a=i??e,o=n.get(a.id);n.set(a.id,{icon:a.icon,id:a.id,label:a.label,options:a.children??[e],selected:o?[...o.selected,e]:[e]})})};return r(e,void 0),[...n.values()]},Dh=(e,t)=>{let n=e.currentTarget.closest(`.lr-filter-list`);if(!n)return;let r=Array.from(n.querySelectorAll(`[data-filter-item]`));r[(r.indexOf(e.currentTarget)+t+r.length)%r.length]?.focus()},Oh=(e,t)=>{let n=e.currentTarget.closest(`.lr-filter-list`);if(!n)return;let r=Array.from(n.querySelectorAll(`[data-filter-item]`));(t===`first`?r[0]:r.at(-1))?.focus()},kh=({activeChildId:e,column:t,floatingPosition:n,mobile:r=!1,messages:i,onBack:a,onOpenBranch:o,onQueryChange:s,onToggle:c,query:l,searchRef:u,selected:d})=>{let f=t.path.length===0,p=ah(l)!==``,m=ch(t.nodes,l,f);return(0,G.jsxs)(`section`,{"aria-label":t.title,className:q(`lr-filter-level`,r&&`lr-filter-level--mobile`),"data-filter-column":t.key,"data-filter-depth":t.path.length,style:n,children:[(0,G.jsxs)(`label`,{className:`lr-filter-search`,children:[(0,G.jsxs)(`span`,{className:`lr-visually-hidden`,children:[i.search,` `,t.title]}),(0,G.jsx)(`input`,{"aria-label":`${i.search} ${t.title}`,onChange:e=>{s(t.key,e.currentTarget.value)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),e.currentTarget.closest(`.lr-filter-level`)?.querySelector(`[data-filter-item]`)?.focus())},placeholder:t.path.length===0?i.addFilterPlaceholder:i.filterPlaceholder,ref:u,spellCheck:!1,type:`search`,value:l})]}),(0,G.jsxs)(`div`,{"aria-label":`${t.title} ${i.options}`,className:`lr-filter-list`,role:`menu`,children:[m.map(({node:n,parent:s})=>{let l=!!(n.children&&n.children.length>0),u=l&&e===n.id,f=!l&&d.includes(n.id),m=s?`${s.id}/${n.id}`:n.id,h=s?`${s.label}: ${n.label}`:n.label,g=n.dividerBefore&&!p?(0,G.jsx)(`div`,{className:`lr-filter-separator`,role:`separator`}):null;return l?(0,G.jsxs)(M.Fragment,{children:[g,(0,G.jsxs)(`button`,{"aria-expanded":u,"aria-haspopup":`menu`,className:`lr-filter-item`,"data-active":u,"data-filter-item":!0,"data-filter-node":n.id,onClick:e=>{o(n,t,!0,e.currentTarget)},onPointerEnter:e=>{r||o(n,t,!1,e.currentTarget)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),Dh(e,1)):e.key===`ArrowUp`?(e.preventDefault(),Dh(e,-1)):e.key===`Home`?(e.preventDefault(),Oh(e,`first`)):e.key===`End`?(e.preventDefault(),Oh(e,`last`)):e.key===`ArrowRight`?(e.preventDefault(),o(n,t,!0,e.currentTarget)):e.key===`ArrowLeft`&&t.path.length>0&&(e.preventDefault(),a())},role:`menuitem`,type:`button`,children:[(0,G.jsx)(`span`,{className:`lr-filter-item__icon`,children:n.icon?(0,G.jsx)(K,{name:n.icon,size:14}):null}),(0,G.jsxs)(`span`,{className:`lr-filter-item__copy`,children:[(0,G.jsx)(`span`,{children:n.label}),n.description?(0,G.jsx)(`small`,{children:n.description}):null]}),(0,G.jsx)(`span`,{className:`lr-filter-item__meta`,children:(0,G.jsx)(K,{name:`chevronRight`,size:12})})]})]},m):(0,G.jsxs)(M.Fragment,{children:[g,(0,G.jsxs)(`div`,{className:`lr-filter-choice`,role:`none`,children:[(0,G.jsx)(`button`,{"aria-label":`${f?i.remove:i.add} ${h}`,"aria-pressed":f,className:`lr-filter-choice__checkbox`,onClick:()=>{c(n.id,!1)},type:`button`,children:f?(0,G.jsx)(K,{name:`check`,size:10}):null}),(0,G.jsxs)(`button`,{"aria-checked":f,"aria-label":s?h:void 0,className:`lr-filter-item lr-filter-item--choice`,"data-filter-item":!0,"data-filter-node":n.id,onClick:()=>{c(n.id,!0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),Dh(e,1)):e.key===`ArrowUp`?(e.preventDefault(),Dh(e,-1)):e.key===`Home`?(e.preventDefault(),Oh(e,`first`)):e.key===`End`?(e.preventDefault(),Oh(e,`last`)):e.key===`ArrowLeft`&&t.path.length>0&&(e.preventDefault(),a())},role:`menuitemcheckbox`,type:`button`,children:[(0,G.jsxs)(`span`,{className:`lr-filter-item__copy`,children:[(0,G.jsxs)(`span`,{children:[s?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`lr-filter-item__context`,children:s.label}):null,n.label]}),n.description?(0,G.jsx)(`small`,{children:n.description}):null]}),n.count!==void 0&&!s?(0,G.jsx)(`span`,{className:`lr-filter-item__meta`,children:(0,G.jsx)(`small`,{children:n.count})}):null]})]})]},m)}),m.length===0?(0,G.jsx)(`p`,{className:`lr-filter-empty`,children:f?i.noMatchingProperties:i.noMatchingValues}):null]})]})},Ah=({ariaLabel:e,defaultValue:t=[],messages:n,onValueChange:r,options:i,trigger:a,triggerTooltip:o,value:s})=>{let c={...mh,...n},l=(0,M.useSyncExternalStore)(yh,bh,xh),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(t),m=s??f,[h,g]=(0,M.useState)([]),[_,v]=(0,M.useState)({}),[y,b]=(0,M.useState)({}),x=(0,M.useRef)(null),S=(0,M.useRef)(!1),C=(0,M.useRef)(void 0),ee=(0,M.useRef)(null),te=(0,M.useRef)(null),w=(0,M.cloneElement)(a,{ref:te}),T=Sh(i,h,c.rootTitle),E=T.at(-1)??{key:`root`,nodes:i,path:[],title:c.rootTitle},D=()=>{C.current!==void 0&&(window.clearTimeout(C.current),C.current=void 0)};(0,M.useEffect)(()=>()=>{C.current!==void 0&&window.clearTimeout(C.current)},[]);let O=e=>{D(),e&&(S.current=!1,g([]),v({}),b({})),d(e)},ne=(e,t)=>{D();let n=Th(i,m.includes(e)?m.filter(t=>t!==e):[...m,e]);s===void 0&&p(n),r?.(n),t&&d(!1)},re=(e,t,n=!0,r)=>{D();let i=()=>{C.current=void 0;let i=[...t.path,e.id],a=ih(i);if(!l&&r){let t=r.closest(`.lr-filter-popover`);if(t){let n=t.getBoundingClientRect(),i=r.getBoundingClientRect(),o=Ch(e.children??[]),s=window.innerHeight-n.top-8,c=Math.max(0,s-o),l=Math.min(Math.max(0,i.top-n.top-1),c);v(e=>({...e,[a]:l}))}}g(i),n&&window.requestAnimationFrame(()=>{(l?ee.current:document.querySelector(`.lr-filter-level[data-filter-depth="${i.length.toString()}"] input`))?.focus()})};if(!n&&!l){C.current=window.setTimeout(i,gh);return}i()},k=()=>{let e=h.at(-1),t=h.slice(0,-1);g(t),window.requestAnimationFrame(()=>{if(l){ee.current?.focus();return}e&&document.querySelector(`[data-filter-node="${e}"]`)?.focus()})},A=(e,t)=>{D();let n={...y,[e]:t};b(n),g(e=>lh(i,e,n))};if(l){let t=T.at(-2)?.title??e;return(0,G.jsxs)(he,{onOpenChange:O,open:u,children:[o?(0,G.jsx)(uh,{label:o,children:(0,G.jsx)(ye,{asChild:!0,children:w})}):(0,G.jsx)(ye,{asChild:!0,children:w}),(0,G.jsxs)(We,{children:[(0,G.jsx)(ge,{className:`lr-dialog-overlay`}),(0,G.jsxs)(ue,{className:`lr-filter-dialog`,onOpenAutoFocus:e=>{e.preventDefault(),ee.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),te.current?.focus()},children:[(0,G.jsxs)(`header`,{className:`lr-filter-dialog__header`,children:[(0,G.jsxs)(`div`,{className:`lr-filter-dialog__heading`,children:[h.length>0?(0,G.jsx)(uh,{label:`${c.backTo} ${t}`,children:(0,G.jsx)(Gm,{label:`${c.backTo} ${t}`,name:`chevronLeft`,onClick:k,size:`lg`})}):null,(0,G.jsx)(ae,{children:h.length===0?e:E.title})]}),(0,G.jsx)(uh,{label:c.close,children:(0,G.jsx)(le,{asChild:!0,children:(0,G.jsx)(Gm,{label:c.close,name:`close`,size:`lg`})})})]}),(0,G.jsx)(de,{className:`lr-visually-hidden`,children:c.description}),(0,G.jsx)(`div`,{className:`lr-filter-dialog__body`,children:(0,G.jsx)(kh,{activeChildId:void 0,column:E,mobile:!0,messages:c,onBack:k,onOpenBranch:re,onQueryChange:A,onToggle:ne,query:y[E.key]??``,searchRef:ee,selected:m},E.key)})]})]})]})}return(0,G.jsxs)(Ve,{onOpenChange:O,open:u,children:[o?(0,G.jsx)(uh,{label:o,children:(0,G.jsx)(ve,{asChild:!0,children:w})}):(0,G.jsx)(ve,{asChild:!0,children:w}),(0,G.jsx)(oe,{children:(0,G.jsxs)(_e,{align:`start`,"aria-label":e,className:`lr-filter-popover`,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),x.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),S.current||te.current?.focus(),S.current=!1},onEscapeKeyDown:()=>{S.current=!1},onPointerDownOutside:()=>{S.current=!0},sideOffset:6,children:[(0,G.jsx)(`div`,{className:`lr-filter-main-panel`,children:(0,G.jsx)(kh,{activeChildId:h[0],column:T[0]??{key:`root`,nodes:i,path:[],title:c.rootTitle},messages:c,onBack:k,onOpenBranch:re,onQueryChange:A,onToggle:ne,query:y.root??``,searchRef:x,selected:m})}),(0,G.jsx)(`div`,{className:`lr-filter-submenus`,children:T.slice(1).map(e=>(0,G.jsx)(kh,{activeChildId:h[e.path.length],column:e,floatingPosition:{height:Ch(e.nodes),right:_h+(e.path.length-1)*vh,top:_[e.key]??0},messages:c,onBack:k,onOpenBranch:re,onQueryChange:A,onToggle:ne,query:y[e.key]??``,searchRef:void 0,selected:m},e.path.length))})]})})]})},jh=({group:e,messages:t,onValueChange:n,options:r,value:i})=>{let[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(``),l=(0,M.useRef)(null),u=s.trim().toLocaleLowerCase(),d=e.options.filter(e=>`${e.label} ${e.description??``}`.toLocaleLowerCase().includes(u)),f=e.selected.map(e=>e.id),p=e.selected.length===1?e.selected[0]?.label??t.oneValue:`${e.selected[0]?.label??e.selected.length.toString()} +${(e.selected.length-1).toString()}`,m=(e,t)=>{n(Th(r,i.includes(e)?i.filter(t=>t!==e):[...i,e])),t&&o(!1)};return(0,G.jsxs)(Ve,{onOpenChange:e=>{e&&c(``),o(e)},open:a,children:[(0,G.jsxs)(`div`,{className:`lr-applied-filter`,children:[(0,G.jsx)(ve,{asChild:!0,children:(0,G.jsxs)(`button`,{"aria-label":`${t.edit} ${e.label}`,className:`lr-applied-filter__editor`,type:`button`,children:[(0,G.jsxs)(`span`,{className:`lr-applied-filter__property`,children:[(0,G.jsx)(K,{name:e.icon??`filter`,size:12}),e.label]}),(0,G.jsx)(`span`,{className:`lr-applied-filter__operator`,children:e.selected.length===1?t.is:t.isAnyOf}),(0,G.jsx)(`span`,{className:`lr-applied-filter__value`,children:p})]})}),(0,G.jsx)(`button`,{"aria-label":`${t.remove} ${e.label}`,className:`lr-applied-filter__remove`,onClick:()=>{n(i.filter(e=>!f.includes(e)))},type:`button`,children:(0,G.jsx)(K,{name:`close`,size:12})})]}),(0,G.jsx)(oe,{children:(0,G.jsxs)(_e,{align:`start`,"aria-label":`${t.edit} ${e.label}`,className:`lr-applied-filter-popover`,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),l.current?.focus()},sideOffset:6,children:[(0,G.jsxs)(`label`,{className:`lr-filter-search lr-applied-filter-popover__search`,children:[(0,G.jsxs)(`span`,{className:`lr-visually-hidden`,children:[t.search,` `,e.label]}),(0,G.jsx)(`input`,{"aria-label":`${t.search} ${e.label}`,onChange:e=>{c(e.currentTarget.value)},placeholder:t.filterPlaceholder,ref:l,spellCheck:!1,type:`search`,value:s})]}),(0,G.jsxs)(`div`,{"aria-label":`${e.label} ${t.selectedValues}`,className:`lr-filter-list`,role:`menu`,children:[d.map(e=>{let n=i.includes(e.id);return(0,G.jsxs)(`div`,{className:`lr-filter-choice`,role:`none`,children:[(0,G.jsx)(`button`,{"aria-label":`${n?t.remove:t.add} ${e.label}`,"aria-pressed":n,className:`lr-filter-choice__checkbox`,onClick:()=>{m(e.id,!1)},type:`button`,children:n?(0,G.jsx)(K,{name:`check`,size:12}):null}),(0,G.jsxs)(`button`,{"aria-checked":n,className:`lr-filter-item lr-filter-item--choice`,"data-filter-item":!0,onClick:()=>{m(e.id,!0)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),Dh(e,1)),e.key===`ArrowUp`&&(e.preventDefault(),Dh(e,-1)),e.key===`Home`&&(e.preventDefault(),Oh(e,`first`)),e.key===`End`&&(e.preventDefault(),Oh(e,`last`))},role:`menuitemcheckbox`,type:`button`,children:[(0,G.jsxs)(`span`,{className:`lr-filter-item__copy`,children:[(0,G.jsx)(`span`,{children:e.label}),e.description?(0,G.jsx)(`small`,{children:e.description}):null]}),(0,G.jsx)(`span`,{className:`lr-filter-item__meta`,children:e.count===void 0?null:(0,G.jsx)(`small`,{children:e.count})})]})]},e.id)}),d.length===0?(0,G.jsx)(`p`,{className:`lr-filter-empty`,children:t.noMatchingValues}):null]})]})})]})},Mh=({addFilter:e,ariaLabel:t,className:n,messages:r,onClear:i,onValueChange:a,options:o,supplementalConditions:s,value:c})=>{let l={...mh,...r},u=Eh(o,c);return(0,G.jsxs)(`div`,{"aria-label":t,className:q(`lr-applied-filter-bar`,n),role:`region`,children:[(0,G.jsxs)(`div`,{className:`lr-applied-filter-bar__conditions`,children:[s,u.map(e=>(0,G.jsx)(jh,{group:e,messages:l,onValueChange:a,options:o,value:c},e.id)),(0,G.jsx)(`div`,{className:`lr-applied-filter-bar__add`,children:e})]}),c.length>0||s?(0,G.jsx)(J,{className:`lr-applied-filter-bar__clear`,onClick:()=>{if(i){i();return}a([])},shape:`pill`,children:l.clear}):null]})},Nh=({agent:e,badge:t,className:n,description:r,id:i,meta:a,selected:o=!1,title:s,...c})=>(0,G.jsxs)(`article`,{className:q(`lr-task-card`,o&&`is-selected`,n),...c,children:[(0,G.jsxs)(`div`,{className:`lr-task-card__header`,children:[(0,G.jsx)(`span`,{children:i}),t?(0,G.jsx)(Km,{tone:t.tone??`neutral`,children:t.label}):null]}),(0,G.jsx)(`strong`,{className:`lr-task-card__title`,children:s}),r?(0,G.jsx)(`p`,{children:r}):null,(0,G.jsx)(`footer`,{children:(0,G.jsxs)(`span`,{className:`lr-task-card__agent`,children:[e?(0,G.jsx)(Jm,{label:e}):null,a]})})]}),Ph=({addLabel:e,children:t,count:n,label:r,onAdd:i,tone:a})=>(0,G.jsxs)(`section`,{className:`lr-kanban-column`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(qm,{label:r,tone:a}),(0,G.jsx)(`span`,{className:`lr-kanban-column__count`,children:n}),i?(0,G.jsx)(J,{"aria-label":e??`Add task to ${r}`,className:`lr-kanban-column__add`,onClick:i,size:`sm`,children:(0,G.jsx)(K,{name:`add`,size:13})}):null]}),(0,G.jsx)(`div`,{className:`lr-kanban-column__stack`,children:t})]}),Fh=({detail:e,icon:t=`check`,label:n,time:r,tone:i=`neutral`})=>(0,G.jsxs)(`div`,{className:q(`lr-timeline-event`,`lr-timeline-event--${i}`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`lr-timeline-event__icon`,children:(0,G.jsx)(K,{name:t,size:12})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:n}),e?(0,G.jsx)(`span`,{children:e}):null]}),(0,G.jsx)(`time`,{children:r})]}),Ih=({action:e,children:t,title:n})=>(0,G.jsxs)(`section`,{className:`lr-inspector-section`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(`strong`,{children:n}),e]}),(0,G.jsx)(`div`,{className:`lr-inspector-section__body`,children:t})]}),Lh=({properties:e})=>(0,G.jsx)(`dl`,{className:`lr-run-summary`,children:e.map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e.label}),(0,G.jsx)(`dd`,{children:e.value})]},e.label))}),Rh=({attempt:e,note:t,sessions:n,title:r})=>(0,G.jsxs)(`div`,{className:`lr-session-timeline-panel`,children:[e?(0,G.jsxs)(`div`,{className:`lr-session-timeline__row`,children:[(0,G.jsx)(`strong`,{className:`lr-session-timeline-panel__title`,children:e.heading}),(0,G.jsx)(qm,{label:e.statusLabel,tone:e.tone})]}):null,(0,G.jsx)(`strong`,{className:e?`lr-session-timeline-panel__subtitle`:`lr-session-timeline-panel__title`,children:r}),t?(0,G.jsx)(`p`,{className:`lr-session-timeline-panel__note`,children:t}):null,(0,G.jsx)(`ol`,{className:`lr-session-timeline`,children:n.map(e=>(0,G.jsx)(`li`,{"aria-label":e.ariaLabel,className:`lr-session-timeline__item`,children:(0,G.jsxs)(`div`,{className:`lr-session-timeline__body`,children:[(0,G.jsxs)(`div`,{className:`lr-session-timeline__row`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`lr-session-timeline__ordinal`,children:e.ordinal}),(0,G.jsx)(qm,{label:e.statusLabel,tone:e.tone}),e.handoffRequestedLabel?(0,G.jsx)(Km,{tone:`warning`,children:e.handoffRequestedLabel}):null]}),e.occupancyPercent!==void 0&&e.occupancyLabel!==void 0?(0,G.jsxs)(`div`,{className:`lr-session-timeline__occupancy`,children:[(0,G.jsx)(`progress`,{"aria-hidden":`true`,max:100,value:e.occupancyPercent}),(0,G.jsxs)(`p`,{className:`lr-session-timeline__occupancy-text`,children:[(0,G.jsx)(`span`,{children:e.occupancyLabel}),e.occupancyQualityLabel===void 0?null:(0,G.jsx)(`span`,{className:`lr-session-timeline__occupancy-quality`,children:e.occupancyQualityLabel})]})]}):null,e.usageLabel===void 0?null:(0,G.jsxs)(`p`,{className:`lr-session-timeline__usage`,children:[(0,G.jsx)(`span`,{children:e.usageLabel}),e.usageCostLabel===void 0?null:(0,G.jsx)(`span`,{children:e.usageCostLabel}),e.usageQualityLabel===void 0?null:(0,G.jsx)(`span`,{className:`lr-session-timeline__usage-quality`,children:e.usageQualityLabel})]}),e.checkpoints.length>0?(0,G.jsx)(`ul`,{className:`lr-session-timeline__checkpoints`,children:e.checkpoints.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`details`,{className:`lr-checkpoint-card`,open:e.defaultOpen,children:[(0,G.jsxs)(`summary`,{children:[(0,G.jsx)(K,{"aria-hidden":`true`,className:`lr-checkpoint-card__chevron`,name:`chevronRight`,size:12}),(0,G.jsx)(`span`,{children:e.summary}),(0,G.jsx)(`time`,{children:e.timeLabel})]}),(0,G.jsx)(`div`,{className:`lr-checkpoint-card__body`,children:e.groups.map(e=>e.items.length>0?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e.label}),(0,G.jsx)(`ul`,{children:e.items.map((e,t)=>(0,G.jsx)(`li`,{children:e},`${t.toString()}-${e}`))})]},e.label):null)})]})},e.id))}):e.emptyCheckpointsLabel?(0,G.jsx)(`p`,{className:`lr-session-timeline__empty`,children:e.emptyCheckpointsLabel}):null]})},e.id))})]}),zh=({className:e,size:t=24})=>(0,G.jsxs)(`svg`,{"aria-hidden":`true`,className:e,focusable:`false`,height:t,viewBox:`0 0 96 96`,width:t,children:[(0,G.jsx)(`rect`,{fill:`#5e6ad2`,height:`96`,rx:`24`,width:`96`}),(0,G.jsx)(`path`,{d:`M27 23v46h46`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`10`}),(0,G.jsx)(`path`,{d:`M48 23v25h25`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`10`})]}),Bh=`loomrail.locale`,Vh={en:{"settings.open":`Open settings`,"settings.title":`Settings`,"settings.description":`Appearance stays in this browser. Project execution settings are saved locally by Loomrail.`,"settings.appearance":`Appearance`,"settings.density":`Board density`,"settings.density.description":`Compact tightens the spacing inside and between cards.`,"settings.density.comfortable":`Comfortable`,"settings.density.compact":`Compact`,"layout.resize.sidebar":`Resize the sidebar`,"layout.resize.inspector":`Resize the task inspector`,"settings.layout":`Layout`,"settings.layout.description":`Drag a panel edge to resize it, or nudge it with the arrow keys.`,"settings.layout.reset":`Reset panel widths`,"settings.projects":`Projects`,"settings.projects.register.label":`Register a local repository`,"settings.projects.register.description":`The absolute path to a Git repository on this machine. Its directory name becomes the project name.`,"settings.projects.register.placeholder":`/absolute/path/to/your-repository`,"settings.projects.register.action":`Register repository`,"settings.projects.create.title":`Create a new project`,"settings.projects.create.description":`Start a new local Git repository from Loomrail's reviewed TypeScript baseline.`,"settings.projects.create.recipe":`TypeScript + Node · built in`,"settings.projects.create.path":`New project path`,"settings.projects.create.pathDescription":`Use an absolute path whose parent exists. The final directory must not exist yet and its name uses lowercase letters, digits, dots, hyphens or underscores.`,"settings.projects.create.placeholder":`/absolute/path/to/new-project`,"settings.projects.create.boundary":`Preview only: no directory is created, no template is downloaded and no command is run.`,"settings.projects.create.review":`Review exact files`,"settings.projects.create.target":`Target`,"settings.projects.create.version":`Recipe`,"settings.projects.create.files":`Files to create`,"settings.projects.create.bytes":`{count} B`,"settings.projects.create.marker":`recovery marker`,"settings.projects.create.digest":`Proposal digest`,"settings.projects.create.confirmation":`This creates exactly the files above and initializes Git. It does not install dependencies, run project code, commit, add a remote or push.`,"settings.projects.create.confirm":`Create this project`,"settings.projects.create.completed":`Project created`,"settings.projects.create.next":`Run these commands yourself when you are ready:`,"settings.projects.create.openTerminal":`Open a terminal in`,"settings.projects.create.failed":`Creation stopped safely`,"settings.projects.create.failedDescription":`{code}. Loomrail did not overwrite or delete an existing file. Resolve the local conflict, then retry the same operation.`,"settings.projects.create.pending":`Creation will resume safely`,"settings.projects.create.pendingDescription":`Loomrail recorded this operation before touching the filesystem. Restart the app to reconcile it, or wait for the current attempt to finish.`,"settings.projects.create.retry":`Retry safely`,"settings.projects.create.another":`Create another project`,"settings.projects.repositoryLabel":`Repository`,"settings.projects.unusable":`This path is not a Git repository right now, so any stage that changes files is refused here.`,"settings.projects.repair":`Repair demo repository`,"settings.provider.title":`AI provider`,"settings.provider.description":`Choose which signed-in local agent runs new sessions. Loomrail uses the CLI's existing subscription login and does not need an API key.`,"settings.provider.label":`Provider for new sessions`,"settings.provider.option.auto":`Auto`,"settings.provider.option.auto.description":`Use a compatible, signed-in local CLI`,"settings.provider.loading":`Checking local agent CLIs…`,"settings.provider.effective":`New sessions use {provider}.`,"settings.provider.fallback":`No compatible signed-in local agent is ready. Install or update Codex CLI or Claude Code CLI, then sign in through that CLI.`,"settings.provider.compatibility":`Local agent readiness`,"settings.provider.status.ready":`Ready`,"settings.provider.status.notInstalled":`Not installed`,"settings.provider.status.tooOld":`Too old for managed runs`,"settings.provider.status.unverified":`Version not verified`,"settings.provider.status.versionUnreadable":`Version could not be verified`,"settings.provider.status.authRequired":`Sign in through this CLI`,"settings.provider.status.noHardTokenBudget":`Usage reconciled after the session`,"settings.provider.status.unknown":`Could not verify`,"settings.provider.selectedUnavailable":`This provider is not ready for the requested stage. No session will start.`,"settings.provider.refresh":`Check again`,"settings.provider.override":`LOOMRAIL_PROVIDER currently forces {provider}. Restart without the override to change this here.`,"settings.provider.overrideInvalid":`LOOMRAIL_PROVIDER contains an unknown value. Provider dispatch stays blocked until it is fixed and restarted.`,"settings.workspaceStrategy.title":`Working directory`,"settings.workspaceStrategy.description":`Choose where agents read and change files for this project.`,"settings.workspaceStrategy.label":`Agent workspace`,"settings.workspaceStrategy.isolated":`Separate worktree — recommended`,"settings.workspaceStrategy.isolatedDescription":`Each task gets its own checkout. Your current project folder stays untouched.`,"settings.workspaceStrategy.shared":`This project folder`,"settings.workspaceStrategy.sharedDescription":`Agents work directly in {path}.`,"settings.workspaceStrategy.scope":`Existing task workspaces do not move. This choice applies when Loomrail creates the next workspace.`,"settings.workspaceStrategy.loading":`Loading working directory settings…`,"settings.workspaceStrategy.confirmTitle":`Before Loomrail uses this folder`,"settings.workspaceStrategy.confirmDescription":`New agent work will happen directly in {path}, alongside your own changes.`,"settings.workspaceStrategy.confirmFiles":`Agents can read tracked and untracked files in this repository, including local-only files.`,"settings.workspaceStrategy.confirmExternalTools":`Loomrail cannot lock your editor, terminal, or other tools that may change the same folder.`,"settings.workspaceStrategy.confirmSerial":`Loomrail allows only one of its own writers or verification runs in this project at a time.`,"settings.workspaceStrategy.acknowledge":`I understand the shared-folder risk`,"settings.workspaceStrategy.confirm":`Use this project folder`,"providerAllowance.provider":`Provider`,"providerAllowance.title":`{provider} · Provider allowance`,"providerAllowance.surface.command-center":`{provider} provider allowance in Command Center`,"providerAllowance.surface.task-cockpit":`{provider} provider allowance in Task Cockpit`,"providerAllowance.freshness.live":`Live`,"providerAllowance.freshness.stale":`Stale`,"providerAllowance.freshness.unavailable":`Unavailable`,"providerAllowance.refresh":`Check again`,"providerAllowance.loading":`Loading provider allowance`,"providerAllowance.remaining":`{percent}% remaining`,"providerAllowance.window.minutes":`{count} min window`,"providerAllowance.window.hours":`{count} h window`,"providerAllowance.window.days":`{count} day window`,"providerAllowance.window.weeks":`{count} week window`,"providerAllowance.resets":`Resets {time}`,"providerAllowance.details":`Usage details`,"providerAllowance.used":`{percent}% used`,"providerAllowance.observed":`Observed {time}`,"providerAllowance.bucket.PRIMARY":`Primary window`,"providerAllowance.bucket.SECONDARY":`Secondary window`,"providerAllowance.bucket.FIVE_HOUR":`Five-hour window`,"providerAllowance.bucket.SEVEN_DAY":`Seven-day window`,"providerAllowance.bucket.SPEND_LIMIT":`Spend limit`,"providerAllowance.unavailable.unsupported":`This provider does not expose an allowance signal.`,"providerAllowance.unavailable.unverified":`Allowance is hidden until this exact provider target is verified.`,"providerAllowance.unavailable.notAuthenticated":`Sign in through the provider's local CLI before checking allowance.`,"providerAllowance.unavailable.noData":`No allowance reading has been received yet.`,"providerAllowance.unavailable.schemaDrift":`The provider response changed and was rejected safely.`,"providerAllowance.unavailable.timeout":`The provider did not answer within the bounded check.`,"providerAllowance.unavailable.provider":`The provider is not available on this machine.`,"providerAllowance.unavailable.read":`Provider allowance could not be read.`,"providerAllowance.advisory.available":`Capacity is available for new work. Running work is unaffected.`,"providerAllowance.advisory.low":`Capacity is low. Consider starting new work after {time}; running work is not stopped.`,"providerAllowance.advisory.lowWithoutReset":`Capacity is low. Check again before starting new work; running work is not stopped.`,"providerAllowance.advisory.reached":`The provider limit is reached. Consider resuming after {time}; Loomrail will not resume automatically.`,"providerAllowance.advisory.reachedWithoutReset":`The provider limit is reached. Check again before resuming; Loomrail will not resume automatically.`,"providerAllowance.advisory.unknown":`No scheduling suggestion is available. Loomrail's hard budget is unchanged.`,"providerAllowance.error":`The allowance check failed. Try again.`,"providerAllowance.errorWithSnapshot":`The new check failed. The last reading is still shown.`,"settings.mcp.title":`MCP connections`,"settings.mcp.description":`Connect a local stdio server to new agent sessions through Loomrail's closed tool allowlist.`,"settings.mcp.loading":`Loading MCP connections…`,"settings.mcp.empty":`No MCP connection has been approved for this project.`,"settings.mcp.context7.title":`Context7 documentation`,"settings.mcp.context7.description":`Bundled with Loomrail. No terminal command, global install or npx download is required.`,"settings.mcp.context7.privacy":`Documentation queries leave this machine for Context7. Never include secrets, personal data or proprietary code.`,"settings.mcp.context7.review":`Review bundled Context7`,"settings.mcp.context7.update":`Check bundled Context7 for changes`,"settings.mcp.context7.configured":`Configured below`,"settings.mcp.context7.current":`The approved revision already matches the bundled server.`,"settings.mcp.add":`Add local connection`,"settings.mcp.newRevision":`Review a new connection revision`,"settings.mcp.cancelRevision":`Add another connection`,"settings.mcp.name":`Connection name`,"settings.mcp.executable":`Executable`,"settings.mcp.executableDescription":`An absolute path to an existing local executable. Package launchers and shell commands are refused.`,"settings.mcp.args":`Arguments`,"settings.mcp.argsDescription":`One exact argv element per line. No shell parsing or environment values.`,"settings.mcp.declaredTools":`Declared read-only tools`,"settings.mcp.toolsDescription":`One exact MCP tool name per line. Discovery cannot add access by itself.`,"settings.mcp.review":`Review exact command`,"settings.mcp.consent.title":`This starts a local process with your account permissions`,"settings.mcp.consent.description":`Check every path and argument. Approval allows a bounded capability probe; tools remain blocked until you grant them separately.`,"settings.mcp.consent.expires":`This one-time confirmation expires at {time}.`,"settings.mcp.consent.checkbox":`I checked this exact executable and every argument`,"settings.mcp.consent.checkboxDescription":`I understand the process itself may read or change anything my local account can access.`,"settings.mcp.consent.confirm":`Approve exact command`,"settings.mcp.revision":`Revision {revision}`,"settings.mcp.capability":`Last capability probe`,"settings.mcp.probe.notRun":`Not run`,"settings.mcp.probe.run":`Probe capabilities`,"settings.mcp.probe.again":`Probe again`,"settings.mcp.probe.ready":`Ready`,"settings.mcp.probe.spawnFailed":`Process could not start`,"settings.mcp.probe.timedOut":`Timed out`,"settings.mcp.probe.invalid":`Invalid MCP response`,"settings.mcp.probe.outputLimit":`Output limit reached`,"settings.mcp.probe.unsupported":`Unsupported protocol`,"settings.mcp.probe.exited":`Process exited early`,"settings.mcp.discoveredTools":`Discovered tools`,"settings.mcp.tools.none":`None`,"settings.mcp.revise":`Change command`,"settings.mcp.grant.none":`No tool access`,"settings.mcp.grant.enabled":`Enabled for new sessions`,"settings.mcp.grant.revoked":`Access revoked`,"settings.mcp.grant.choose":`Tools available to new sessions`,"settings.mcp.grant.attestation":`These selected tools are read-only`,"settings.mcp.grant.attestationDescription":`Loomrail cannot prove a server's semantics. Only grant tools you have independently verified.`,"settings.mcp.grant.enable":`Grant selected tools`,"settings.mcp.grant.update":`Update tool access`,"settings.mcp.grant.revoke":`Revoke access`,"settings.mcp.grant.revokedDescription":`This revision stays revoked for audit history. Review a new revision to use the connection again.`,"settings.mcp.limit":`Local stdio only. Context7 is an exact-pinned Loomrail preset; arbitrary package downloads, URLs, OAuth, secrets and environment fields remain unavailable.`,"settings.constitution.title":`Project Constitution`,"settings.constitution.description":`Scan only allowlisted repository metadata, review the seven proposed sections, then publish with explicit approval.`,"settings.constitution.preset":`Constitution preset`,"settings.constitution.presetAuto":`Auto — recommended from repository signals`,"settings.constitution.scan":`Scan and propose`,"settings.constitution.rescan":`Scan again`,"settings.constitution.empty":`No proposal yet. Scanning reads bounded configuration and documentation; it does not execute repository commands or write files.`,"settings.constitution.proposal":`Review proposal`,"settings.constitution.sourceSummary":`{files} allowlisted files · {preset}@1`,"settings.constitution.reviewHint":`Repository text is evidence, not authority. Expand every section before approving the file.`,"settings.constitution.warnings":`Scan notes`,"settings.constitution.sources":`Sources`,"settings.constitution.targetBlocked":`The existing .loomrail target could not be inspected safely. Resolve the path before adoption.`,"settings.constitution.adopt":`Approve and create Constitution`,"settings.constitution.replace":`Approve replacement`,"settings.constitution.activeVersion":`Active v{ordinal}`,"settings.constitution.failed":`Publication did not complete`,"settings.constitution.retry":`Retry publication`,"settings.verification.title":`Project checks`,"settings.verification.description":`Review the exact repository commands Loomrail may run as measured checks. Nothing runs until the Plan is approved and a run is started.`,"settings.verification.loading":`Scanning the bounded package.json preview…`,"settings.verification.list":`Proposed project checks`,"settings.verification.required":`Required`,"settings.verification.optional":`Optional`,"settings.verification.exactCommand":`Exact process launch`,"settings.verification.executable":`Executable`,"settings.verification.argument":`Argument {index}`,"settings.verification.cwd":`Working directory`,"settings.verification.projectRoot":`Project root`,"settings.verification.timeout":`Timeout`,"settings.verification.minutes":`{count} min`,"settings.verification.seconds":`{count} sec`,"settings.verification.output":`Output limit`,"settings.verification.kib":`{count} KiB`,"settings.verification.network":`Network`,"settings.verification.networkHost":`Host network available`,"settings.verification.networkUnavailable":`Cannot run: isolation unavailable`,"settings.verification.environment":`Environment`,"settings.verification.environmentBaseline":`Minimal runtime path · isolated home and cache`,"settings.verification.localExecutionTitle":`Runs as your local user`,"settings.verification.localExecutionNotice":`The worktree is not a security sandbox. Review every command and its network access before approval; owner and provider secrets are not inherited.`,"settings.verification.source":`package.json script “{script}”`,"settings.verification.sourceNotice":`Shown as untrusted source text. The scan did not execute it.`,"settings.verification.empty":`No supported root scripts were found. Loomrail has not created a Plan and cannot run a project check.`,"settings.verification.warnings":`Scan notes`,"settings.verification.targetBlocked":`Resolve the existing .loomrail target before approval.`,"settings.verification.adoptionNotice":`Approval records this complete command set as a new immutable revision and publishes only its Loomrail marker file.`,"settings.verification.enableNotice":`Review the current scan before enabling Project checks again.`,"settings.verification.adopt":`Approve Plan · required checks: {count}`,"settings.verification.enable":`Enable Plan · required checks: {count}`,"settings.verification.replace":`Approve replacement · required checks: {count}`,"settings.verification.active":`Active revision {revision}`,"settings.verification.disabled":`Disabled revision {revision}`,"settings.verification.publishing":`Publishing revision {revision}`,"settings.verification.unpublished":`Revision {revision} needs attention`,"settings.verification.published":`Published to .loomrail/verification-plan.json`,"settings.verification.publicationFailed":`Plan file was not published`,"settings.verification.retry":`Retry publication`,"settings.verification.disable":`Disable Plan`,"settings.launch.title":`Local launch gates`,"settings.launch.description":`Measure performance and security against one owner-approved local service recipe.`,"settings.launch.loading":`Loading local launch measurement…`,"settings.launch.verificationRequired":`Approve a Project checks Plan with an optional start, dev or preview recipe first.`,"settings.launch.planActive":`Active revision {revision}`,"settings.launch.planDisabled":`Disabled revision {revision}`,"settings.launch.localTitle":`Local measurement only`,"settings.launch.localNotice":`This starts the exact reviewed command as your local user. It does not deploy, contact an external site or promise production safety.`,"settings.launch.noService":`The active Project checks Plan has no optional local service recipe.`,"settings.launch.serviceRecipe":`Local service command`,"settings.launch.auditRecipe":`Dependency audit evidence`,"settings.launch.auditNone":`No audit recipe — owner action required`,"settings.launch.origin":`Loopback origin`,"settings.launch.healthPath":`Health path`,"settings.launch.probePath":`Measured page`,"settings.launch.privateRoutes":`Private paths, one per line`,"settings.launch.samples":`Fresh browser samples (3–5)`,"settings.launch.lcp":`LCP limit, ms`,"settings.launch.inp":`INP limit, ms`,"settings.launch.cls":`CLS limit`,"settings.launch.bundle":`JavaScript limit, bytes`,"settings.launch.headers":`Required response headers`,"settings.launch.yes":`present`,"settings.launch.no":`missing`,"settings.launch.verificationIdentity":`Project checks Plan {id} · revision {revision}`,"settings.launch.invalid":`Check the origin, paths, limits and required headers before approval.`,"settings.launch.adopt":`Approve launch gates`,"settings.launch.replace":`Approve replacement`,"settings.launch.run":`Run local measurement`,"settings.launch.disable":`Disable launch gates`,"settings.launch.cancel":`Cancel measurement`,"settings.launch.cancelling":`Cancelling…`,"settings.launch.stopBlocked":`Retry safe stop`,"settings.launch.noRun":`No local launch measurement has been run yet.`,"settings.launch.results":`Local launch gate results`,"settings.launch.tree":`Tree {tree}`,"settings.launch.errorCode":`Measurement state: {code}`,"settings.launch.status.RUNNING":`Measurement running`,"settings.launch.status.CANCELLING":`Measurement cancelling`,"settings.launch.status.BLOCKED":`Service stop unproved — action required`,"settings.launch.status.PASSED":`All launch gates passed`,"settings.launch.status.FAILED":`Launch action required`,"settings.launch.status.ERROR":`Measurement failed safely`,"settings.launch.status.INTERRUPTED":`Measurement interrupted`,"settings.launch.freshness.CURRENT":`Current evidence`,"settings.launch.freshness.STALE":`Stale evidence`,"settings.launch.gateStatus.PASSED":`Passed`,"settings.launch.gateStatus.FAILED":`Failed`,"settings.launch.gateStatus.ACTION_REQUIRED":`Action required`,"settings.launch.gateStatus.ERROR":`Error`,"settings.launch.gate.PERF_WEB_VITALS":`Web Vitals`,"settings.launch.gate.PERF_BUNDLE_BUDGET":`JavaScript budget`,"settings.launch.gate.SEC_RESPONSE_HEADERS":`Response headers`,"settings.launch.gate.SEC_UNAUTHENTICATED_ROUTES":`Private routes without credentials`,"settings.launch.gate.SEC_CLIENT_BUNDLE_SECRETS":`Client bundle secret scan`,"settings.launch.gate.DEPS_AUDIT":`Dependency audit`,"settings.launch.evidence.vitals":`Median LCP {lcp} ms · INP {inp} ms · CLS {cls}`,"settings.launch.evidence.bundle":`Median {measured} B · budget {budget} B`,"settings.launch.evidence.secrets":`Scanned {bytes} B · findings {count}`,"settings.launch.evidence.auditMissing":`No current-tree audit evidence`,"settings.launch.evidence.audit":`Current-tree audit: {status}`,"settings.release.title":`Release evidence`,"settings.release.description":`Freeze the exact launch evidence for one declared public environment and selected tasks.`,"settings.release.loading":`Loading release evidence…`,"settings.release.boundaryTitle":`Evidence, not deployment`,"settings.release.boundaryNotice":`Loomrail records an immutable snapshot. It does not contact this origin, use hosting credentials, approve a release or deploy it.`,"settings.release.kind":`Environment`,"settings.release.kind.PREVIEW":`Preview`,"settings.release.kind.PRODUCTION":`Production`,"settings.release.name":`Environment name`,"settings.release.publicOrigin":`Public HTTPS origin`,"settings.release.healthPath":`Public health path`,"settings.release.variables":`Required variable names, one per line — never values`,"settings.release.invalid":`Enter a name, an exact HTTPS origin, a safe path and portable variable names.`,"settings.release.save":`Save environment`,"settings.release.update":`Update environment`,"settings.release.scope":`Included tasks`,"settings.release.scopeNotice":`Select only tasks whose Review, QA, Project checks and Acceptance evidence should be frozen into this release.`,"settings.release.noWorkItems":`This project has no selectable tasks.`,"settings.release.create":`Create immutable snapshot`,"settings.release.export":`Download evidence package`,"settings.release.none":`No Release snapshot has been created yet.`,"settings.release.results":`Release gate snapshot`,"settings.release.current":`Current snapshot`,"settings.release.stale":`Snapshot is stale`,"settings.release.passed":`Required gates passed: {passed} of {required}`,"settings.release.tree":`Tree {tree}`,"settings.release.gateStatus.PASSED":`Passed`,"settings.release.gateStatus.FAILED":`Failed`,"settings.release.gateStatus.ACTION_REQUIRED":`Action required`,"settings.release.gateStatus.STALE":`Stale`,"settings.deploy.title":`Guided deploy`,"settings.deploy.description":`Run the repository-owned GitHub Actions workflow for an eligible Preview or promoted Production release after two explicit confirmations.`,"settings.deploy.loading":`Checking the exact deployment target…`,"settings.deploy.boundaryTitle":`Existing workflow only`,"settings.deploy.boundaryNotice":`Loomrail can start only the fixed workflow already stored in this repository. It receives no hosting or SSH credentials and never retries or rolls back automatically.`,"settings.deploy.noRelease":`Create a current Preview or Production Release snapshot before preparing a deploy.`,"settings.deploy.environment":`Environment`,"settings.deploy.environment.PREVIEW":`Preview`,"settings.deploy.environment.PRODUCTION":`Production`,"settings.deploy.environment.LEGACY":`Legacy target`,"settings.deploy.repository":`GitHub repository`,"settings.deploy.branch":`Published branch`,"settings.deploy.commit":`Exact commit`,"settings.deploy.workflow":`Workflow`,"settings.deploy.planNotice":`First confirmation: save this exact {environment} repository, branch, commit and workflow as an immutable deployment plan.`,"settings.deploy.adopt":`Confirm exact plan`,"settings.deploy.adoptAgain":`Prepare another exact attempt`,"settings.deploy.approvalNotice":`Second confirmation: this starts one external {environment} GitHub Actions run. Review the target above before continuing.`,"settings.deploy.approve":`Approve and deploy once`,"settings.deploy.approvedNotice":`The exact {environment} attempt is approved but has not started. Start it once; Loomrail will not create a replacement automatically.`,"settings.deploy.startApproved":`Start approved attempt`,"settings.deploy.observe":`Check exact run`,"settings.deploy.openRun":`Open this run on GitHub`,"settings.deploy.unknownNotice":`The outcome is unknown and the workflow may already have started. Do not deploy again. If an exact GitHub run is linked, check that run instead.`,"settings.deploy.failedNotice":`This attempt did not complete successfully ({code}). Review the exact run or prepare a new plan only after the cause is understood.`,"settings.deploy.rollbackUnavailable":`Rollback is unavailable: this repository workflow does not expose a verified rollback action.`,"settings.deploy.status.PENDING_APPROVAL":`Waiting for final approval`,"settings.deploy.status.APPROVED":`Approved, not started`,"settings.deploy.status.RUNNING":`GitHub run started`,"settings.deploy.status.SUCCEEDED":`Deploy succeeded`,"settings.deploy.status.FAILED":`Deploy failed`,"settings.deploy.status.UNKNOWN":`Outcome unknown`,"settings.deploy.block.RELEASE_STALE":`The Release evidence is stale. Refresh the affected checks and create a new Release snapshot.`,"settings.deploy.block.RELEASE_GATES_BLOCKED":`Required release checks are not all passing. Resolve them before preparing a deployment plan.`,"settings.deploy.block.ENVIRONMENT_UNSUPPORTED":`This Environment is not supported by the fixed guided-deploy contract.`,"settings.deploy.block.REPOSITORY_UNAVAILABLE":`The repository cannot be read. Restore access to the registered project folder and check again.`,"settings.deploy.block.REPOSITORY_PATH_NOT_CANONICAL":`The registered folder is a symlink or subfolder. Register the exact physical repository root.`,"settings.deploy.block.REPOSITORY_OPERATION_IN_PROGRESS":`A merge, rebase or other Git operation is still in progress. Finish it before checking again.`,"settings.deploy.block.SOURCE_DIRTY":`The current folder does not exactly match this Release. Commit the intended changes and create a new Release snapshot.`,"settings.deploy.block.DETACHED_HEAD":`The repository is not on a named branch. Check out the branch that should be deployed.`,"settings.deploy.block.REMOTE_INVALID":`The origin is not a credential-free GitHub remote. Fix the repository origin before continuing.`,"settings.deploy.block.WORKFLOW_MISSING":`The fixed workflow for this Environment is missing from the commit. Add and review it before continuing.`,"settings.deploy.block.WORKFLOW_NOT_REGULAR":`The deploy workflow is not a regular committed file. Replace the symlink or special entry with a reviewed file.`,"settings.deploy.block.WORKFLOW_TRIGGER_MISSING":`The fixed workflow has no explicit workflow_dispatch trigger. Add and review that trigger before continuing.`,"settings.deploy.block.WORKFLOW_TOO_LARGE":`The deploy workflow cannot be read within the safety limit. Reduce or repair the committed workflow.`,"settings.deploy.block.CLI_UNAVAILABLE":`GitHub CLI is unavailable on this machine. Install it, then check the target again.`,"settings.deploy.block.AUTH_REQUIRED":`GitHub CLI is not signed in. Sign in locally with gh; Loomrail will not store the token.`,"settings.deploy.block.REMOTE_BRANCH_UNAVAILABLE":`The current branch is not readable on GitHub. Publish the named branch to origin first.`,"settings.deploy.block.REMOTE_COMMIT_MISMATCH":`The GitHub branch does not point to this exact local commit. Publish the commit, then create current Release evidence.`,"settings.deploy.block.PREVIEW_PROMOTION_REQUIRED":`Production is blocked until this exact Release evidence has a successful Preview deployment. Deploy and verify Preview first, then create the Production Release snapshot again.`,"event.launchEnvironmentChanged":`Launch environment saved`,"event.launchEnvironmentChangedDetail":`{kind} declaration · version {version}`,"event.launchReleaseCreated":`Release evidence frozen`,"event.launchReleaseCreatedDetail":`Tree {tree} · required gates {passed} of {required}`,"event.deploymentPlanAdopted":`Deployment plan confirmed`,"event.deploymentPlanAdoptedDetail":`{repository} · {branch} · commit {commit}`,"event.deploymentChanged":`Deployment state changed`,"event.deploymentChangedDetail":`{status}`,"verification.title":`Project verification`,"verification.loading":`Loading project verification`,"verification.intro":`Run the owner-approved commands against the current worktree. Loomrail records duration, exit status and bounded output for each check.`,"verification.required":`Required`,"verification.optional":`Optional`,"verification.status.NOT_RUN":`Not run`,"verification.status.QUEUED":`Queued`,"verification.status.RUNNING":`Running`,"verification.status.CANCELLING":`Cancelling`,"verification.status.PASSED":`Passed`,"verification.status.FAILED":`Failed`,"verification.status.ERROR":`Error`,"verification.status.INTERRUPTED":`Interrupted`,"verification.status.STALE":`Stale`,"verification.runMeta":`Run {ordinal} · Plan r{revision} · {platform}`,"verification.evidenceMeta":`Checks {passed}/{total} passed · tree {tree}`,"verification.evidenceCounts":`Passed {passed} · failed {failed} · errors {errors} · interrupted {interrupted} · remaining {remaining} · tree {tree}`,"verification.currentPlan":`Current active Plan · revision {revision}`,"verification.group":`{kind} checks`,"verification.acceptanceBlocker":`Acceptance is blocked unless every required check passes for the current code and Plan.`,"verification.platform.darwin":`macOS`,"verification.platform.linux":`Linux`,"verification.platform.win32":`Windows`,"verification.duration.ms":`{count} ms`,"verification.duration.seconds":`{count} s`,"verification.measurement":`{duration} · exit {exit}`,"verification.outcome.active":`Checks run in order. The worktree remains reserved until this run finishes or you cancel it.`,"verification.outcome.passed":`All required checks passed for the current code and Plan.`,"verification.outcome.failed":`This run is not passing evidence. Inspect the failed check, fix the code, then run again.`,"verification.outcome.interrupted":`This run stopped before it produced complete evidence. Run it again.`,"verification.outcome.stale":`This result is no longer current: {reasons}. Run the checks again.`,"verification.stale.PLAN_UNAVAILABLE":`the active Plan is unavailable`,"verification.stale.PLAN_REPLACED":`the approved Plan changed`,"verification.stale.PLAN_UNPUBLISHED":`the current Plan is not published`,"verification.stale.TREE_CHANGED":`the worktree changed`,"verification.unavailable.plan":`Approve and publish Project checks in Settings before running them.`,"verification.unavailable.pipeline":`Start the task workflow before running Project verification.`,"verification.unavailable.workspace":`Project verification becomes available after implementation prepares a worktree.`,"verification.run":`Run checks`,"verification.runAgain":`Run again`,"verification.cancel":`Cancel run`,"verification.output.view":`View output`,"verification.output.hide":`Hide output`,"verification.output.loading":`Loading bounded output…`,"verification.history":`Earlier runs ({count})`,"verification.correction.timeline":`Correction history`,"verification.correction.position":`Correction {position}`,"verification.correction.automatic":`Automatic`,"verification.correction.ownerAuthorized":`Owner-authorized final attempt`,"verification.correction.status.ACTIVE":`Active`,"verification.correction.status.PASSED":`Passed`,"verification.correction.status.SUPERSEDED":`Superseded`,"verification.correction.status.EXHAUSTED":`Needs your decision`,"verification.correction.status.CANCELLED":`Cancelled`,"verification.correctionGate.title":`Project verification needs your decision`,"verification.correctionGate.description":`Correction {position} still ended in a measured failure. Inspect the exact check output before choosing what happens next.`,"verification.correctionGate.authorizeFinal":`Authorize one final correction`,"verification.correctionGate.cancel":`Cancel delivery`,"settings.readiness.title":`Launch readiness`,"settings.readiness.description":`A bounded local preflight for repository security plus explicit legal, payments, and analytics decisions.`,"settings.readiness.run":`Run readiness check`,"settings.readiness.rerun":`Run again`,"settings.readiness.empty":`No check yet. Loomrail reads only bounded repository facts and never runs project scripts.`,"settings.readiness.ready":`Ready`,"settings.readiness.actionRequired":`Action required`,"settings.readiness.checkedAt":`Checked {date}`,"settings.readiness.head":`HEAD {head}`,"settings.readiness.noHead":`No commit`,"settings.readiness.dirty":`Working tree changed`,"settings.readiness.clean":`Working tree clean`,"settings.readiness.limit":`This is a local preflight, not a complete security audit or legal advice. Re-run after repository changes.`,"settings.readiness.category.security":`Security`,"settings.readiness.category.legal":`Legal`,"settings.readiness.category.payments":`Payments`,"settings.readiness.category.analytics":`Analytics`,"settings.readiness.category.dependencies":`Dependencies`,"settings.readiness.category.environment":`Environment`,"settings.readiness.category.operations":`Operations`,"settings.readiness.check.activeConstitution":`Owner-approved Constitution`,"settings.readiness.check.secretPaths":`Tracked secret-like paths`,"settings.readiness.check.envIgnored":`Local secret files ignored`,"settings.readiness.check.ciHardening":`CI trust and action pinning`,"settings.readiness.check.license":`Repository license`,"settings.readiness.check.legalOwner":`Legal and privacy review`,"settings.readiness.check.paymentsOwner":`Payments, tax, and refunds`,"settings.readiness.check.analyticsOwner":`Analytics consent and retention`,"settings.readiness.check.lockfile":`Reproducible dependency lockfile`,"settings.readiness.check.envProdSeparation":`Production env files and CI literals`,"settings.readiness.check.securityHeadersOwner":`Security headers decision`,"settings.readiness.check.healthEndpoint":`Health endpoint`,"settings.readiness.check.rollbackPlan":`Rollback plan`,"settings.readiness.check.backup":`Data backup`,"settings.readiness.status.passed":`Passed automatically`,"settings.readiness.status.action":`Needs action`,"settings.readiness.status.confirmed":`Confirmed by owner`,"settings.readiness.status.na":`Not applicable`,"settings.readiness.evidence":`Evidence`,"settings.readiness.rationale":`Decision note`,"settings.readiness.rationalePlaceholder":`What was reviewed, or why this does not apply…`,"settings.readiness.confirm":`Confirm`,"settings.readiness.notApplicable":`Not applicable`,"settings.readiness.finding.activeConstitution":`No active owner-approved Constitution.`,"settings.readiness.finding.secretPath":`Git tracks a filename commonly used for secrets.`,"settings.readiness.finding.envIgnored":`Git ignore coverage is missing or could not be verified.`,"settings.readiness.finding.pullRequestTarget":`CI uses pull_request_target; review the trust boundary.`,"settings.readiness.finding.writeAll":`CI grants write-all permissions.`,"settings.readiness.finding.actionPinned":`A GitHub Action is not pinned to a full commit SHA.`,"settings.readiness.finding.ciUnverifiable":`A CI input could not be inspected within safe bounds.`,"settings.readiness.finding.license":`No regular root LICENSE or COPYING file was found.`,"settings.readiness.finding.lockfileMissing":`A tracked manifest has no lockfile, so installs are not reproducible.`,"settings.readiness.finding.lockfileAmbiguous":`More than one package manager lockfile is tracked.`,"settings.readiness.finding.dependencyUnverifiable":`Dependency inputs could not be inspected within safe bounds.`,"settings.readiness.finding.prodEnvNotIgnored":`A production environment file exists and is not covered by ignore rules.`,"settings.readiness.finding.inlineSecretInCi":`CI assigns a secret-named variable a literal value instead of a managed reference.`,"language.change":`Change language`,"language.english":`English`,"language.russian":`Русский`,"nav.humanRequests":`Human requests`,"nav.attention":`Attention`,"nav.fleet":`Agent Fleet`,"nav.workspace":`Workspace`,"nav.open":`Open navigation`,"nav.yourProjects":`Your projects`,"nav.currentWork":`Current work`,"nav.insights":`Insights`,"nav.guidedDemo":`Guided demo`,"activation.loading":`Loading the guided demo`,"activation.eyebrow":`First local result`,"activation.title":`Guided demo`,"activation.description":`Create one real local task and run it through the signed-in Codex or Claude Code CLI with explicit execution limits.`,"activation.zeroQuota":`Local agent only — no API key or separate API billing. Subscription usage is reported after each CLI session.`,"activation.progress":`Guided demo progress`,"activation.step":`Step {current} of {total}`,"activation.status.complete":`Complete`,"activation.status.current":`Current`,"activation.status.upcoming":`Upcoming`,"activation.phase.workspace":`Prepare the demo workspace`,"activation.phase.provider":`Choose the safe provider`,"activation.phase.task":`Create the guided task`,"activation.phase.ready":`Approve it for work`,"activation.phase.run":`Start the workflow`,"activation.phase.request":`Human Request and provider result`,"activation.phase.review":`Independent review after execution`,"activation.phase.qa":`Measured Browser QA after execution`,"activation.phase.acceptance":`Review the result`,"activation.phase.complete":`Owner decision recorded`,"activation.copy.workspace":`Materialize Loomrail's bundled web-app repository in local application storage.`,"activation.copy.provider":`Return this project to Auto so Loomrail can use a compatible, signed-in Codex or Claude Code CLI. No session starts until a local CLI is ready.`,"activation.copy.task":`Create the exact reviewed sample task. Retrying this action cannot create a duplicate.`,"activation.copy.ready":`Move the task from the backlog to Ready with a recorded state transition.`,"activation.copy.run":`Start the durable workflow with visible time, turn, tool and output limits. The local CLI uses its existing subscription session.`,"activation.copy.request":`Answer provider questions in Attention. Repository reads, edits and approved commands go only through audited Loomrail workspace tools.`,"activation.copy.review":`An independent reviewer checks the implementation before Browser QA. Its findings remain attached to this task.`,"activation.copy.qa":`Browser QA measures the approved scenarios and records its screenshots and trace before acceptance can open.`,"activation.copy.acceptance":`Review the measured Review and Browser QA evidence in the Task Cockpit, then choose Accept, Return, or Reject.`,"activation.copy.complete":`Your final decision is durable. The walkthrough is complete; Loomrail did not decide on its own result.`,"activation.action.workspace":`Prepare demo workspace`,"activation.action.provider":`Use available local CLI`,"activation.action.task":`Create guided task`,"activation.action.ready":`Move task to Ready`,"activation.action.run":`Start guided workflow`,"activation.action.attention":`Answer in Attention`,"activation.action.cockpit":`Open Task Cockpit`,"activation.action.acceptance":`Review and decide`,"activation.providerLocked":`A LOOMRAIL_PROVIDER override is active. Restart without it, then run loomrail try again.`,"activation.recipe.title":`What this run will do`,"activation.recipe.provider":`Provider`,"activation.provider.real":`Codex CLI or Claude Code CLI`,"activation.recipe.model":`Model tier`,"activation.recipe.budget":`Loomrail task budget`,"activation.next.title":`Where to go next`,"activation.next.local":`Continue in Task Cockpit`,"activation.next.repository":`Connect repository or provider`,"activation.next.guidedAction":`Read about Guided Launch`,"activation.next.guided":`Guided Launch support is a planned paid option, not an active purchase flow in this build.`,"insights.loading":`Loading local Insights…`,"insights.title":`Insights`,"insights.description":`Delivery, quality and reliability signals derived from local Loomrail state.`,"insights.localOnly":`Local only`,"insights.outcomes.title":`Outcomes`,"insights.outcomes.description":`Percentages use only completed evidence. No evidence is different from a measured zero.`,"insights.rate.acceptance":`Accepted completion`,"insights.rate.firstReview":`First-pass review`,"insights.rate.qa":`Terminal QA pass`,"insights.noEvidence":`No evidence`,"insights.count.workItems":`Accepted / all work items`,"insights.count.activeWork":`Active work items`,"insights.count.cancelledWork":`Cancelled work items`,"insights.count.pipelines":`Succeeded / all pipelines`,"insights.count.pipelineFailures":`Failed, interrupted or cancelled pipelines`,"insights.count.agentRuns":`Succeeded / all agent runs`,"insights.count.agentFailures":`Failed or interrupted agent runs`,"insights.count.reviews":`Review reports`,"insights.count.qaRuns":`Browser QA runs`,"insights.count.qaDefects":`Open / all QA defects`,"insights.count.humanRequests":`Resolved / all human requests`,"insights.count.tokens":`Estimated tokens recorded`,"insights.count.recoveries":`Daemon-restart recoveries`,"insights.report.title":`Anonymous reports`,"insights.report.description":`Loomrail never sends these automatically. Read the complete JSON first; Download is the one-time opt-in action.`,"insights.report.exclusions":`Excluded by schema: code, prompts, provider responses, logs, names, paths, IDs, timestamps, artifacts and stack traces.`,"insights.report.aggregate":`Aggregate report`,"insights.report.aggregateDescription":`Product and runtime categories plus the local aggregate metrics above.`,"insights.report.crash":`Crash recovery report`,"insights.report.crashDescription":`Available because durable state proves that a running workflow was interrupted by a daemon restart.`,"insights.report.noCrash":`No crash report is available: no daemon-restart recovery was recorded.`,"insights.report.download":`Download this JSON`,"insights.report.previewLabel":`Exact report payload`,"connection.connecting":`Connecting…`,"connection.local":`Local daemon`,"connection.offline":`Offline`,"connection.recovery.retryTitle":`Loomrail is temporarily unreachable`,"connection.recovery.retryDescription":`Check that the local process is still running. You can retry without losing saved work.`,"connection.recovery.reopenTitle":`This local session has ended`,"connection.recovery.reopenDescription":`Stop the old process if needed, then start Loomrail again. A fresh authenticated tab will open automatically.`,"connection.recovery.command":`Run in a terminal`,"connection.recovery.retryAction":`Try again`,"theme.change":`Change color theme`,"theme.light":`Light`,"theme.dark":`Dark`,"theme.system":`System`,"project.switch":`Switch project`,"project.loading":`Loading…`,"project.none":`No projects`,"project.noneSingle":`No project`,search:`Search`,"task.new":`New task`,"task.create.description":`Create the work item first. Loomrail will propose the delivery pipeline after the brief is clear.`,"task.create.title":`Title`,"task.create.titlePlaceholder":`What should the team deliver?`,"task.create.brief":`Brief`,"task.create.briefDescription":`Enough context for the planning agents to ask useful questions.`,"task.create.briefPlaceholder":`Outcome, constraints, relevant files…`,"task.create.criteria":`Acceptance criteria`,"task.create.criteriaDescription":`Write one verifiable outcome per line. At least one is required.`,"task.create.criteriaError":`Use 1–50 unique lines and no more than 500 characters per criterion.`,"task.create.criteriaPlaceholder":`The owner can verify the delivered outcome…`,"task.create.project":`Project`,"task.create.priority":`Priority`,"task.create.type":`Type`,"task.create.parent":`Parent work item`,"task.create.parentDescription":`Optional grouping under an Epic or another work item.`,"task.create.noParent":`No parent`,"task.create.submit":`Create task`,"task.edit":`Edit task`,"task.edit.description":`Update the persisted brief and planning properties for this WorkItem.`,"task.edit.criteriaDescription":`Write one acceptance criterion per line, up to 50.`,"task.edit.criteriaError":`Use no more than 50 lines and 500 characters per criterion.`,"task.edit.submit":`Save changes`,"action.cancel":`Cancel`,"action.back":`Back`,"action.closeDialog":`Close dialog`,"view.active":`Active`,"view.backlog":`Backlog`,"view.allIssues":`All issues`,"view.filter":`Filter tasks`,"view.display":`Display settings`,"view.ordering":`Ordering`,"view.orderBy":`Order tasks by`,"view.boardOptions":`Board options`,"view.showEmptyColumns":`Show empty columns`,"view.direction.asc":`Sort ascending`,"view.direction.desc":`Sort descending`,"view.title":`Title`,"view.updated":`Updated`,"view.created":`Created`,"property.priority":`Priority`,"work.current":`Current work`,"work.boardLabel":`Current work board`,"work.summary.needsYou":`Needs you`,"work.summary.filter":`Quick filter`,"work.summary.clear":`Clear quick filter`,"view.actions":`Open view actions`,"view.copyLink":`Copy view link`,"filter.status":`Status`,"filter.priority":`Priority`,"filter.risk":`Risk`,"filter.rootTitle":`Filters`,"filter.search":`Search`,"filter.addPlaceholder":`Add Filter…`,"filter.placeholder":`Filter…`,"filter.noProperties":`No matching properties`,"filter.noValues":`No matching values`,"filter.add":`Add`,"filter.remove":`Remove`,"filter.options":`options`,"filter.backTo":`Back to`,"filter.close":`Close filters`,"filter.description":`Choose one or more task properties. Each selection is applied immediately.`,"filter.edit":`Edit`,"filter.is":`is`,"filter.isAnyOf":`is any of`,"filter.oneValue":`1 value`,"filter.selectedValues":`selected values`,"filter.clear":`Clear`,"state.BACKLOG":`Backlog`,"state.READY":`Ready`,"state.IN_PROGRESS":`Running`,"state.BLOCKED":`Blocked`,"state.DONE":`Done`,"state.CANCELLED":`Cancelled`,"priority.LOW":`Low`,"priority.MEDIUM":`Medium`,"priority.HIGH":`High`,"priority.URGENT":`Urgent`,"risk.LOW":`Low`,"risk.MEDIUM":`Medium`,"risk.HIGH":`High`,"risk.CRITICAL":`Critical`,"type.EPIC":`Epic`,"type.FEATURE":`Feature`,"type.TASK":`Task`,"type.BUG":`Bug`,"type.SPIKE":`Spike`,"type.SUBTASK":`Subtask`,"stage.DISCOVERY":`Discovery`,"stage.PLAN":`Plan`,"stage.IMPLEMENT":`Implementation`,"stage.REVIEW":`Review`,"stage.QA":`QA`,"stage.ACCEPTANCE":`Acceptance`,"empty.noProjects.title":`No local projects yet`,"empty.noProjects.description":`Register the two bundled, non-executable fixture projects to start a persisted board.`,"empty.noProjects.action":`Initialize demo workspace`,"loading.board.title":`Loading board…`,"loading.inspector.title":`Loading task details…`,"error.board.title":`The local board could not be loaded`,"error.unknown":`Unknown error`,"empty.active.title":`No active tasks`,"empty.active.description":`Create a task, or switch to All issues to see finished work.`,"empty.backlog.title":`The backlog is empty`,"empty.backlog.description":`New tasks wait here until someone moves them to Ready.`,"empty.all.title":`No tasks yet`,"empty.all.description":`Create a task to start tracking delivery in this project.`,"empty.filters.title":`No tasks match these filters`,"empty.filters.description":`Edit a condition above or clear the filter bar.`,"empty.noSelection.title":`No task selected`,"empty.noSelection.description":`Choose a card on the board to inspect its persisted state and activity.`,"task.move":`Move`,"task.moveTo":`Move to {state}`,"task.moveToShort":`To {state}`,"task.overview":`Overview`,"task.state":`State`,"task.stage":`Stage`,"task.type":`Type`,"task.priority":`Priority`,"task.risk":`Risk`,"task.noBrief":`No brief has been added yet.`,"task.acceptanceCriteria":`Acceptance criteria`,"task.noAcceptanceCriteria":`No acceptance criteria have been recorded.`,"dependency.title":`Structure and dependencies`,"dependency.edit":`Edit blockers`,"dependency.editDescription":`Choose the work items that must be Done before this workflow can start. Hierarchy is shown separately.`,"dependency.save":`Save blockers`,"dependency.loading":`Loading structure and dependencies…`,"dependency.parent":`Parent`,"dependency.children":`Children`,"dependency.blockedBy":`Blocked by`,"dependency.blocks":`Blocks`,"dependency.none":`None`,"dependency.noChildren":`No children`,"dependency.noBlockers":`No blockers`,"dependency.blocksNone":`No downstream work`,"dependency.noCandidates":`There are no other work items in this project.`,"dependency.editUnavailable":`Blockers can be changed only before a workflow starts and before this work item is closed.`,"task.activity":`Activity`,"task.loadingActivity":`Loading activity…`,"task.noActivity":`No activity recorded.`,"task.activityCountMore":`{count}+`,"task.loadMoreActivity":`Show more`,"workflow.title":`Workflow`,"workflow.name":`Delivery workflow`,"workflow.start":`Start workflow`,"workflow.startDescription":`Run the bounded Discovery → Acceptance workflow. It may stop for a durable question or owner decision before continuing.`,"workflow.readyRequired":`Move this task to Ready before starting its workflow.`,"workflow.dependencyBlocked":`Finish every blocking work item before starting this workflow.`,"workflow.dependencyLoadFailed":`Loomrail could not verify the dependency graph, so start remains disabled.`,"workflow.containerNotExecutable":`This is a container with child work items. Start the leaf work items instead.`,"workflow.loading":`Loading workflow…`,"workflow.status.RUNNING":`Running`,"workflow.status.WAITING_HUMAN":`Waiting for you`,"workflow.status.SOFT_PAUSED":`Paused`,"workflow.status.HARD_PAUSED":`Budget paused`,"workflow.status.INTERRUPTED":`Interrupted`,"workflow.status.SUCCEEDED":`Completed`,"workflow.status.FAILED":`Failed`,"workflow.status.CANCELLED":`Cancelled`,"workflow.completed":`The bounded delivery workflow completed from its recorded decisions.`,"workflow.stage.QUEUED":`Queued`,"workflow.stage.RUNNING":`Running`,"workflow.stage.WAITING_HUMAN":`Waiting`,"workflow.stage.SOFT_PAUSED":`Paused`,"workflow.stage.HARD_PAUSED":`Budget paused`,"workflow.stage.INTERRUPTED":`Interrupted`,"workflow.stage.CANCELLED":`Cancelled`,"workflow.stage.SUCCEEDED":`Completed`,"workflow.stage.other":`In progress`,"workflow.action.pause":`Pause`,"workflow.action.resume":`Resume`,"workflow.action.cancel":`Cancel run`,"workflow.action.override":`Approve cost policy`,"workflow.budget.title":`Estimated token budget`,"workflow.budget.kind":`Hard budget`,"workflow.budget.input":`Hard token budget`,"workflow.budget.description":`All six stages run, including independent Review, Project verification, Browser QA and owner Acceptance. Tool turns and retries can make even a small task expensive. This is a ceiling, not a forecast: input, output and cache hits are unknown before execution. Local CLI usage is reported after a session; that session can exceed the ceiling, which blocks subsequent work.`,"workflow.budget.invalid":`Enter a positive whole number.`,"workflow.budget.overrideDescription":`Keep at least the current {current}; the limit must stay above recorded usage {used}.`,"workflow.budget.overrideInvalid":`Keep the current limit and stay above recorded usage.`,"workflow.budget.usage":`{used} of {limit}`,"workflow.budget.revision":`Policy revision {revision}`,"workflow.agentRunBudget.input":`Per-agent run ceiling`,"workflow.agentRunBudget.description":`Maximum estimated tokens for each future agent run. It cannot exceed the whole-run limit.`,"workflow.agentRunBudget.invalid":`Enter a positive whole number no higher than the whole-run limit.`,"workflow.agentRunBudget.overrideDescription":`Raise this ceiling to unblock an exhausted agent run, or raise the whole-run limit.`,"workflow.agentRunBudget.overrideInvalid":`Raise this ceiling when the whole-run limit is unchanged.`,"workflow.agentRunBudget.current":`Per agent: {limit}`,"workflow.agentRunBudget.roleDefault":`Role envelope`,"workflow.modelTier.input":`Model tier`,"workflow.modelTier.description":`Applies to future agent runs and is recorded in each immutable policy snapshot.`,"workflow.model.input":`Model`,"workflow.model.autoOption":`{tier} · Auto`,"workflow.model.autoDescription":`Codex CLI: {codex} · Claude Code: {claude}`,"workflow.model.providerDescription":`{provider} · {tier} cost policy`,"workflow.model.loading":`Loading the provider model catalog…`,"workflow.modelTier.current":`Tier: {tier}`,"workflow.modelTier.roleDefault":`Role default`,"workflow.modelTier.FAST":`Fast`,"workflow.modelTier.STANDARD":`Standard`,"workflow.modelTier.DEEP":`Deep`,"workflow.recovery.title":`Recovery report`,"workflow.recovery.description":`A running attempt was interrupted safely after the local daemon restarted.`,"workflow.hardPause.noProgress":`Paused: no progress`,"workflow.hardPause.contextFloor":`Paused: context too large`,"workflow.hardPause.providerRejected":`Paused: provider rejected input`,"workflow.hardPause.providerStartFailed":`Paused: provider unavailable`,"workflow.hardPause.providerOutcomeRejected":`Paused: invalid provider result`,"workflow.hardPause.sessionLimit":`Paused: session limit reached`,"workflow.sessions.title":`Sessions`,"workflow.sessions.attemptHeading":`Attempt {attempt}`,"workflow.sessions.ordinal":`Session {ordinal}`,"workflow.sessions.status.RUNNING":`Running`,"workflow.sessions.status.COMPLETED":`Completed`,"workflow.sessions.status.HANDOFF":`Handed off`,"workflow.sessions.status.CONTEXT_EXHAUSTED":`Context exhausted`,"workflow.sessions.status.INTERRUPTED":`Interrupted`,"workflow.sessions.status.CANCELLED":`Cancelled`,"workflow.sessions.handoffRequested":`Handoff requested`,"workflow.sessions.occupancyPeak":`Peaked at {percent}% of the window`,"workflow.sessions.occupancyAtHandoff":`{percent}% of the window at handoff`,"workflow.sessions.usageQuality.ACTUAL":`(measured)`,"workflow.sessions.usageQuality.PROVIDER_ESTIMATE":`(provider estimate)`,"workflow.sessions.usageQuality.LOOMRAIL_ESTIMATE":`(Loomrail estimate)`,"workflow.sessions.cacheUnknown":`Unknown`,"workflow.sessions.tokenUsage":`{total} tokens used ({input} in · {output} out · {cached} cached in · {uncached} uncached in + out)`,"workflow.sessions.tokenCost":`· {cost}`,"workflow.sessions.noCheckpointOnRequest":`This provider cannot wind down on request — losing recent work when a session is cut is expected for it.`,"workflow.checkpoints.empty":`No checkpoint was published in this session.`,"workflow.checkpoints.completed":`Completed`,"workflow.checkpoints.remaining":`Remaining`,"workflow.checkpoints.deadEnds":`Dead ends`,"workflow.checkpoints.openQuestions":`Open questions`,"workspace.title":`Workspace`,"workspace.state":`State`,"workspace.status.READY":`Ready`,"workspace.status.ORPHANED":`Worktree gone`,"workspace.status.REMOVED":`Removed`,"workspace.repository":`Repository`,"workspace.mode":`Mode`,"workspace.mode.ISOLATED_WORKTREE":`Separate worktree`,"workspace.mode.SHARED_CURRENT_DIRECTORY":`Project folder`,"workspace.branch":`Branch`,"workspace.worktree":`Worktree`,"workspace.workingDirectory":`Working directory`,"workspace.baseCommit":`Base commit`,"workspace.baseCommit.none":`No commit yet`,"workspace.notReady":`The worktree for this task is no longer on disk. Loomrail does not cut a second one, and nothing returns this workspace to service — the branch still holds whatever was committed to it.`,"workspace.sharedNotReady":`The Project's recorded working directory is no longer available. Loomrail will not choose another directory or branch on its own.`,"workspace.uncommitted":`Loomrail has committed nothing. The work sits in this worktree, on this branch, until you keep it or discard it.`,"workspace.sharedUncommitted":`Loomrail has committed nothing. Agent changes are in your project folder alongside any work that was already there.`,"changes.title":`Changes`,"changes.empty":`This task has changed nothing in its worktree yet.`,"changes.truncated":`Only the first {count} changed files are listed. This worktree holds more than Loomrail prints here.`,"changes.binary":`Binary`,"changes.binaryNoPatch":`This is a binary file, so there is no text diff to show for it.`,"changes.renamedFrom":`Renamed from {path}`,"changes.lineCounts":`Lines added: {insertions}; removed: {deletions}`,"changes.diffPending":`Reading this file’s diff…`,"changes.diffUnavailable":`This diff cannot be read: the task no longer has a workspace.`,"changes.patchTruncated":`Loomrail prints only the first part of this diff — {bytes} more bytes are not shown here.`,"changes.status.ADDED":`Added`,"changes.status.MODIFIED":`Modified`,"changes.status.DELETED":`Deleted`,"changes.status.RENAMED":`Renamed`,"changes.error.WORKSPACE_WORKTREE_MISSING":`The worktree for this task is no longer on disk, so there is nothing left to read its changes from.`,"changes.error.WORKSPACE_WORKTREE_UNREADABLE":`Loomrail cannot enter this task’s worktree, so it cannot say what changed. It may still hold the agent’s work, but Loomrail cannot verify that from here.`,"changes.error.WORKSPACE_HAS_NO_BASELINE":`This workspace records no commit to compare against, so there is nothing to measure its changes from.`,"changes.error.CHANGES_UNREADABLE":`Loomrail could not read this worktree against the commit it was cut from, so it is not showing a file list it cannot stand behind.`,"changes.error.GIT_UNAVAILABLE":`Loomrail could not start git on this machine, so it cannot read what this task changed.`,"changes.error.PATH_OUTSIDE_WORKSPACE":`That path lies outside this task’s worktree, so Loomrail did not read it.`,"changes.error.PATH_NOT_A_FILE":`That path does not name a changed file in this worktree.`,"changes.error.PATH_UNRESOLVABLE":`Loomrail could not resolve that path inside this worktree.`,"changes.error.other":`Loomrail could not read what this task changed.`,"review.title":`Independent review`,"review.round":`Review round {round}`,"review.verdict.PASSED":`Passed`,"review.verdict.CHANGES_REQUESTED":`Changes requested`,"review.reviewer":`Reviewer`,"review.relation":`Independence`,"review.relation.CROSS_PROVIDER":`Cross-provider`,"review.relation.SAME_PROVIDER":`Separate run, same provider`,"review.tree":`Reviewed tree`,"review.findings":`Review findings`,"review.noFindings":`No open findings remain.`,"review.severity.LOW":`Low`,"review.severity.MEDIUM":`Medium`,"review.severity.HIGH":`High`,"review.severity.CRITICAL":`Critical`,"review.findingStatus.OPEN":`Open`,"review.findingStatus.RESOLVED":`Resolved`,"review.findingStatus.WAIVED":`Waived`,"review.findingStatus.FALSE_POSITIVE":`False positive`,"review.reproduction":`Reproduction`,"review.waive":`Waive`,"review.falsePositive":`False positive`,"review.reason":`Owner reason`,"review.reasonPlaceholder":`Explain why this finding should not block the delivery…`,"review.confirmWaive":`Record waiver`,"review.confirmFalsePositive":`Mark false positive`,"qa.title":`Browser QA`,"qa.status.RUNNING":`Running`,"qa.status.PASSED":`Passed`,"qa.status.FAILED":`Failed`,"qa.status.ERROR":`Could not verify`,"qa.tree":`Tested tree`,"qa.target":`Target`,"qa.environment":`Environment`,"qa.planRevision":`Plan revision {revision}`,"qa.matrix":`Scenario matrix`,"qa.scenarioProgress":`{steps} steps · {assertions} assertions`,"qa.assertionFailed":`Failed: {title}`,"qa.notRun":`Not measured`,"qa.observations":`Console and network`,"qa.observation.CONSOLE":`Console`,"qa.observation.NETWORK":`Network`,"qa.blocking":`Blocking`,"qa.defects":`QA defects`,"qa.defectStatus.OPEN":`Open`,"qa.defectStatus.RESOLVED":`Resolved by retest`,"qa.defectStatus.WAIVED":`Risk accepted`,"qa.reproduction":`Reproduce`,"qa.waive":`Accept risk`,"qa.waiverReason":`Owner reason`,"qa.waiverReasonPlaceholder":`Explain why this defect should not enter the next fix set…`,"qa.confirmWaive":`Record waiver`,"qa.correctionTimeline":`Correction timeline`,"qa.correction":`Correction {ordinal}`,"qa.correctionStatus.ACTIVE":`Active`,"qa.correctionStatus.PASSED":`Passed`,"qa.correctionStatus.SUPERSEDED":`Superseded`,"qa.correctionStatus.EXHAUSTED":`Limit reached`,"qa.correctionStatus.CANCELLED":`Cancelled`,"qa.correctionSource":`Source failure`,"qa.correctionEvidence":`Source evidence`,"qa.correctionBaseline":`Full baseline`,"qa.correctionTree":`tree {tree}`,"qa.retestScope":`Locked retest scope · {count} cells`,"qa.retestReason.FAILED_CHECK":`failed check`,"qa.retestReason.BLOCKING_OBSERVATION":`blocking observation`,"qa.retestReason.OPEN_DEFECT":`open defect`,"qa.retestReason.REGRESSION":`regression`,"qa.resolvedBy":`Passing retest`,"qa.correctionGate.title":`QA correction decision`,"qa.correctionGate.description":`Correction {ordinal} exhausted its bounded retest. Choose the next audited workflow transition.`,"qa.correctionGate.authorizeFinal":`Authorize final correction`,"qa.correctionGate.cancel":`Cancel delivery`,"qa.attachments":`Evidence files`,"qa.attachment.SCREENSHOT":`Screenshot`,"qa.attachment.TRACE":`Playwright trace`,"qa.openAttachment":`Open evidence`,"acceptance.eyebrow":`Owner gate`,"acceptance.title":`Acceptance package`,"acceptance.evidence":`Recorded evidence`,"acceptance.reviewEvidence":`Review report`,"acceptance.qaEvidence":`QA report`,"acceptance.checks":`{count} verified checks`,"acceptance.evidenceCount":`{count} evidence records`,"acceptance.matrix":`Criterion matrix`,"acceptance.noCriteria":`No explicit criteria were recorded; review the evidence and release note.`,"acceptance.implementation":`Implementation`,"acceptance.reviewCheck":`Selected review check`,"acceptance.qaCheck":`Selected QA check`,"acceptance.ownerVerification":`Owner verification`,"acceptance.knownRisk":`Known risk`,"acceptance.noKnownRisk":`None recorded`,"acceptance.legacyEvidence":`Legacy package — checks are not bound per criterion`,"acceptance.export":`Download release summary`,"acceptance.accept":`Accept delivery`,"acceptance.return":`Return to work`,"acceptance.reject":`Reject`,"acceptance.status.PENDING":`Needs decision`,"acceptance.status.ACCEPTED":`Accepted`,"acceptance.status.RETURNED":`Returned`,"acceptance.status.REJECTED":`Rejected`,"humanRequest.blocking":`Blocking request`,"humanRequest.request":`Request`,"humanRequest.recommendation":`Recommendation`,"humanRequest.recommended":`Recommended`,"humanRequest.other":`Other`,"humanRequest.otherPlaceholder":`Describe the direction to use…`,"humanRequest.answerResume":`Answer & resume`,"humanRequest.chooseAnswer":`Choose an answer before resuming.`,"humanRequest.authorityNotice":`Your answer records information and resumes work. It does not grant new file, command, network, budget, or acceptance permissions.`,"attention.title":`Needs your decision`,"attention.count":`{count} blocking request`,"attention.countMany":`{count} blocking requests`,"attention.inboxTitle":`Attention`,"attention.inboxDescription":`Decisions and approvals waiting across every project.`,"attention.listLabel":`Requests that need your attention`,"attention.loading":`Loading Attention Inbox`,"attention.refreshing":`Updating…`,"attention.emptyTitle":`Nothing needs you right now`,"attention.emptyDescription":`New questions and approvals will appear here without losing their task context.`,"attention.limitReached":`Showing the first 200 requests. Resolve an item to reveal the rest.`,"attention.section.BLOCKING_NOW":`Blocking now`,"attention.section.APPROVALS":`Approvals`,"attention.section.QUESTIONS":`Questions`,"attention.section.MANUAL_ACTIONS":`Manual actions`,"attention.section.SOON":`Soon`,"attention.category.APPROVAL":`Approval`,"attention.category.QUESTION":`Question`,"attention.category.MANUAL_ACTION":`Manual action`,"attention.fact.category":`Type`,"attention.fact.priority":`Priority`,"attention.fact.stage":`Affected stage`,"attention.fact.created":`Waiting since`,"attention.acceptanceTitle":`Review the delivery evidence`,"attention.acceptanceDescription":`Acceptance remains in the Task Cockpit, where the evidence, verification instructions and exact consequence are visible together.`,"attention.reviewAcceptance":`Review acceptance`,"attention.openTask":`Open task context`,"fleet.title":`Agent Fleet`,"fleet.description":`Active roles and scheduler waits across every local project.`,"fleet.capacity":`{active} / {limit} active`,"fleet.loading":`Loading Agent Fleet`,"fleet.refreshing":`Updating…`,"fleet.emptyTitle":`No agent work is queued`,"fleet.emptyDescription":`Start an approved task to see its assigned role and scheduling state here.`,"fleet.column.task":`Task`,"fleet.column.role":`Role`,"fleet.column.stage":`Stage`,"fleet.column.provider":`Provider`,"fleet.column.status":`Status`,"fleet.column.since":`Since`,"fleet.column.latestAction":`Latest action`,"fleet.notStarted":`Not started`,"fleet.noActivity":`No activity yet`,"fleet.latestAction.origin.DAEMON_AUDITED":`Verified`,"fleet.latestAction.origin.PROVIDER_REPORTED":`Provider-reported`,"fleet.status.READY":`Ready`,"fleet.status.WAITING":`Waiting`,"fleet.status.RUNNING":`Running`,"fleet.role.LEAD_PM":`Lead PM`,"fleet.role.PRODUCT_ANALYST":`Product Analyst`,"fleet.role.SOFTWARE_ARCHITECT":`Software Architect`,"fleet.role.DEVELOPER":`Developer`,"fleet.role.CODE_REVIEWER":`Code Reviewer`,"fleet.role.BROWSER_QA":`Browser QA`,"fleet.role.ACCEPTANCE_MANAGER":`Acceptance Manager`,"fleet.wait.NOT_READY":`The stage is not ready`,"fleet.wait.BUDGET_BLOCKED":`Budget approval is required`,"fleet.wait.CHECKPOINT_NOT_STABLE":`Waiting for a stable checkpoint`,"fleet.wait.ATTEMPT_ACTIVE":`This attempt is already active`,"fleet.wait.GLOBAL_LIMIT":`All global slots are occupied`,"fleet.wait.PROJECT_LIMIT":`This project's slots are occupied`,"fleet.wait.PROVIDER_LIMIT":`This provider's slots are occupied`,"fleet.wait.WORKSPACE_CONFLICT":`The workspace is in use`,"event.created":`Task created`,"event.createdDetail":`Added to the project backlog.`,"event.updated":`Task updated`,"event.updatedDetail":`Changed {fields}.`,"event.dependenciesSet":`Dependencies changed`,"event.dependenciesSetDetail":`Incoming blockers: {count}`,"event.stateChanged":`State changed`,"event.stateChangedDetail":`{from} → {to}`,"event.projectRegistered":`Project registered`,"event.projectScaffoldRequested":`Project creation requested`,"event.projectScaffoldCompleted":`Project created`,"event.projectScaffoldFailed":`Project creation stopped`,"event.providerPreferenceChanged":`AI provider changed`,"event.providerPreferenceChangedDetail":`{from} → {to}`,"event.providerAllowanceRecorded":`Provider allowance updated`,"event.providerAllowanceRecordedDetail":`{provider} · {freshness}`,"event.mcpProfileConsented":`MCP command approved`,"event.mcpProfileConsentedDetail":`{name}, revision {revision}`,"event.mcpGrantChanged":`MCP tool access changed`,"event.mcpGrantChangedDetail":`{count} tool(s) · {state}`,"event.mcpGrant.enabled":`enabled`,"event.mcpGrant.revoked":`revoked`,"event.constitutionProposed":`Constitution proposed`,"event.constitutionProposedDetail":`Preset {preset}@1`,"event.constitutionPublicationRequested":`Constitution publication requested`,"event.constitutionPublicationRequestedDetail":`Version {ordinal} is being published`,"event.constitutionActivated":`Constitution activated`,"event.constitutionActivatedDetail":`Version {ordinal} is now authoritative`,"event.constitutionPublicationFailed":`Constitution publication failed`,"event.verificationPlanAdopted":`Project checks approved`,"event.verificationPlanAdoptedDetail":`Revision {revision} · {count} exact command(s)`,"event.verificationPlanDisabled":`Project checks disabled`,"event.verificationPlanDisabledDetail":`Revision {revision} records the disabled state`,"event.verificationPlanPublicationApplied":`Project checks published`,"event.verificationPlanPublicationAppliedDetail":`Revision {revision} is available for measured runs`,"event.verificationPlanPublicationFailed":`Project checks publication failed`,"event.verificationPlanPublicationRetried":`Project checks publication retried`,"event.verificationPlanPublicationRetriedDetail":`Revision {revision} is being reconciled`,"event.launchPlanChanged":`Local launch gates changed`,"event.launchPlanChangedDetail":`Revision {revision} · {status}`,"event.launchRunChanged":`Local launch measurement changed`,"event.launchRunChangedDetail":`{status} · tree {tree}`,"event.verificationRunReserved":`Project verification queued`,"event.verificationRunReservedDetail":`Run {ordinal} · {count} check(s)`,"event.verificationCheckStarted":`Project check started`,"event.verificationCheckStartedDetail":`Check {ordinal}`,"event.verificationCheckCompleted":`Project check finished`,"event.verificationCheckCompletedDetail":`Check {ordinal} · {status}`,"event.verificationRunInterrupted":`Project verification interrupted`,"event.verificationRunInterruptedDetail":`Run {ordinal}`,"event.verificationRunCancellationRequested":`Project verification cancellation requested`,"event.verificationRunCancellationRequestedDetail":`Run {ordinal} is stopping safely`,"event.verificationFailureRecorded":`Project verification blocked delivery`,"event.verificationFailureRecordedDetail":`Measured reason: {reason}`,"event.verificationCorrectionStarted":`Project check correction started`,"event.verificationCorrectionStartedDetail":`Correction {ordinal} returned to implementation`,"event.verificationCorrectionPassed":`Project check correction passed`,"event.verificationCorrectionPassedDetail":`Correction {ordinal} passed its fresh rerun`,"event.verificationCorrectionSuperseded":`Project check correction superseded`,"event.verificationCorrectionSupersededDetail":`Correction {ordinal} still failed measured checks`,"event.verificationCorrectionExhausted":`Project check correction needs a decision`,"event.verificationCorrectionExhaustedDetail":`Correction {ordinal} reached the automatic limit`,"event.verificationCorrectionCancelled":`Project check correction cancelled`,"event.verificationCorrectionCancelledDetail":`Correction {ordinal} stopped without acceptance`,"verification.failure.REQUIRED_CHECK_FAILED":`required check failed`,"verification.failure.REQUIRED_CHECK_ERROR":`required check error`,"verification.failure.RUN_INTERRUPTED":`run interrupted`,"verification.failure.STALE":`evidence became stale`,"event.readinessAssessed":`Project readiness checked`,"event.readinessAssessedDetail":`{count} item(s) need action`,"event.readinessAttested":`Readiness decision recorded`,"event.readinessAttestedDetail":`{check}: {outcome}`,"event.pipelineStarted":`Workflow started`,"event.pipelineStartedDetail":`Delivery workflow entered {stage}.`,"event.stageChanged":`Stage updated`,"event.stageChangedDetail":`{stage}: {status}`,"event.humanRequestOpened":`Decision requested`,"event.humanRequestOpenedDetail":`{title}`,"event.humanRequestResolved":`Decision recorded`,"event.humanRequestResolvedDetail":`The owner's answer was recorded durably.`,"event.usageRecorded":`Usage recorded`,"event.usageRecordedDetail":`+{amount} estimated tokens · {total} total`,"event.budgetThreshold":`Budget threshold reached`,"event.budgetThresholdDetail":`{threshold}% · {total} estimated tokens`,"event.pipelinePaused":`Workflow paused`,"event.pipelinePausedDetail":`{kind} pause at {stage}`,"event.pipelineResumed":`Workflow resumed`,"event.pipelineResumedDetail":`Resumed {stage}`,"event.pipelineCancelled":`Workflow cancelled`,"event.pipelineCancelledDetail":`Execution stopped at {stage}`,"event.budgetOverride":`Budget override approved`,"event.budgetOverrideDetail":`Revision {revision} · {limit} estimated tokens`,"event.recoveryCreated":`Workflow recovered`,"event.recoveryCreatedDetail":`The orphaned {stage} attempt was marked interrupted.`,"event.evidenceRecorded":`Evidence recorded`,"event.evidenceRecordedDetail":`{title}`,"event.reviewReportRecorded":`Independent review recorded`,"event.reviewReportRecordedDetail":`Round {round} · {verdict}`,"event.reviewFindingRecorded":`Review finding opened`,"event.reviewFindingResolved":`Review finding resolved`,"event.reviewLoopExhausted":`Review loop needs a decision`,"event.reviewLoopExhaustedDetail":`Round {round} reached the automatic limit`,"event.acceptanceRequested":`Owner acceptance requested`,"event.acceptanceRequestedDetail":`Review and QA evidence are ready for a final decision.`,"event.acceptanceResolved":`Acceptance resolved`,"event.acceptanceResolvedDetail":`Owner action: {action}`,"event.pipelineCompleted":`Workflow completed`,"event.pipelineCompletedDetail":`The bounded delivery workflow finished.`,"event.squadAssigned":`Agent squad assigned`,"event.squadAssignedDetail":`{count} workflow roles pinned to exact profiles`,"event.agentRunStarted":`Agent run started`,"event.agentRunStartedDetail":`{role} · {provider}`,"event.agentRunFinished":`Agent run finished`,"event.agentRunFinishedDetail":`{role} · {status}`,"event.qaRunReserved":`Browser QA reserved`,"event.qaRunReservedDetail":`Playwright · {targets} targets · {scenarios} scenarios`,"event.qaRunCompleted":`Browser QA completed`,"event.qaRunCompletedDetail":`{status} · {defects} defects`,"event.qaDefectWaived":`QA defect risk accepted`,"event.qaCorrectionStarted":`QA correction started`,"event.qaCorrectionStartedDetail":`Correction {ordinal} · {cells} retest cells`,"event.qaCorrectionExhausted":`QA correction limit reached`,"event.qaCorrectionExhaustedDetail":`Correction {ordinal} needs an owner decision`,"event.qaCorrectionPassed":`QA correction passed`,"event.qaCorrectionPassedDetail":`Correction {ordinal} resolved {defects} defects`,"event.qaCorrectionCancelled":`QA correction cancelled`,"event.qaCorrectionCancelledDetail":`Correction {ordinal} stopped without acceptance`,"agentRun.status.RUNNING":`Running`,"agentRun.status.SUCCEEDED":`Succeeded`,"agentRun.status.FAILED":`Failed`,"agentRun.status.CANCELLED":`Cancelled`,"agentRun.status.INTERRUPTED":`Interrupted`,"agentRun.status.WAITING_HUMAN":`Waiting for owner`,"agentRun.status.SOFT_PAUSED":`Soft paused`,"agentRun.status.HARD_PAUSED":`Hard paused`,"event.providerSessionStarted":`Agent session started`,"event.providerSessionStartedDetail":`Session {ordinal}`,"event.checkpointPublished":`Checkpoint published`,"event.checkpointPublishedDetail":`{summary}`,"event.contextHandoffRequested":`Handoff requested`,"event.contextHandoffRequestedDetail":`Session {ordinal} is wrapping up`,"event.providerSessionEnded":`Agent session ended`,"event.providerSessionEndedDetail":`{reason}`,"event.contextFloorExceeded":`Required context did not fit`,"event.contextFloorExceededDetail":`Session {ordinal} needed {requiredBytes} bytes of {budgetBytes}`,"event.workspaceCreated":`Workspace created`,"event.workspaceCreatedDetail":`{mode} · branch {branch} · carried files: {count}`,"event.workspaceStrategyChanged":`Working directory mode changed`,"event.workspaceStrategyChangedDetail":`New workspaces use {mode}`,"event.workspaceOrphaned":`Workspace orphaned`,"event.workspaceOrphanedDetail":`The worktree is gone or prunable`,"workspaceTool.operation.LIST_DIRECTORY":`List directory`,"workspaceTool.operation.READ_FILE":`Read file`,"workspaceTool.operation.WRITE_FILE":`Write file`,"workspaceTool.operation.EDIT_FILE":`Edit file`,"workspaceTool.operation.DELETE_FILE":`Delete file`,"workspaceTool.operation.RUN_RECIPE":`Run approved check`,"workspaceTool.status.STARTED":`In progress`,"workspaceTool.status.SUCCEEDED":`Succeeded`,"workspaceTool.status.DENIED":`Blocked by safety policy`,"workspaceTool.status.APPROVAL_REQUIRED":`Approval or permission required`,"workspaceTool.status.FAILED":`Failed`,"workspaceTool.status.UNKNOWN_OUTCOME":`Outcome unknown after restart`,"runActivity.title":`Run Activity`,"runActivity.explainer":`Verified by Loomrail actions passed through the daemon's own gateway and are recorded permanently. Provider-reported actions are the provider's own account of itself: unverified, and kept only for a while.`,"runActivity.origin.DAEMON_AUDITED":`Verified by Loomrail`,"runActivity.origin.PROVIDER_REPORTED":`As reported by the provider`,"runActivity.kind.TOOL_CALL":`Tool call`,"runActivity.kind.AGENT_TEXT":`Agent note`,"runActivity.kind.FILE_CHANGE":`File change`,"runActivity.kind.PROVIDER_ERROR":`Provider error`,"runActivity.count":`{count}`,"runActivity.countMore":`{count}+`,"runActivity.loading":`Loading run activity…`,"runActivity.noActivity":`No run activity recorded yet.`,"runActivity.latestApproximate":`more recent activity may exist`,"runActivity.untitled":`Action`,"runActivity.truncated":`Truncated`,"runActivity.degradedBadge":`Incomplete`,"runActivity.degraded":`This feed is incomplete: some of what happened on this task did not reach it.`,"runActivity.gap":`This list may be incomplete: Loomrail cannot confirm that every recorded entry for this task is shown here.`,"runActivity.omitted":`{count} earlier entries were dropped because storage is limited.`,"runActivity.loadMore":`Show more`,"field.title":`title`,"field.description":`description`,"field.priority":`priority`,"field.risk":`risk`,"field.acceptanceCriteria":`acceptance criteria`},ru:{"settings.open":`Открыть настройки`,"settings.title":`Настройки`,"settings.description":`Оформление хранится в браузере. Настройки выполнения проекта Loomrail сохраняет локально.`,"settings.appearance":`Внешний вид`,"settings.density":`Плотность доски`,"settings.density.description":`Компактный режим уменьшает отступы внутри карточек и между ними.`,"settings.density.comfortable":`Обычная`,"settings.density.compact":`Компактная`,"layout.resize.sidebar":`Изменить ширину сайдбара`,"layout.resize.inspector":`Изменить ширину инспектора`,"settings.layout":`Расположение`,"settings.layout.description":`Потяните край панели или подвиньте его стрелками на клавиатуре.`,"settings.layout.reset":`Сбросить ширину панелей`,"settings.projects":`Проекты`,"settings.projects.register.label":`Подключить локальный репозиторий`,"settings.projects.register.description":`Абсолютный путь к Git-репозиторию на этой машине. Имя каталога станет именем проекта.`,"settings.projects.register.placeholder":`/absolute/path/to/your-repository`,"settings.projects.register.action":`Подключить репозиторий`,"settings.projects.create.title":`Создать новый проект`,"settings.projects.create.description":`Создайте новый локальный Git-репозиторий из проверенного TypeScript baseline Loomrail.`,"settings.projects.create.recipe":`TypeScript + Node · встроен`,"settings.projects.create.path":`Путь нового проекта`,"settings.projects.create.pathDescription":`Укажите абсолютный путь с существующим родительским каталогом. Финальный каталог ещё не должен существовать; в имени допустимы строчные латинские буквы, цифры, точки, дефисы и подчёркивания.`,"settings.projects.create.placeholder":`/absolute/path/to/new-project`,"settings.projects.create.boundary":`Это только предпросмотр: каталог не создаётся, шаблон не скачивается, команды не запускаются.`,"settings.projects.create.review":`Проверить точные файлы`,"settings.projects.create.target":`Каталог`,"settings.projects.create.version":`Recipe`,"settings.projects.create.files":`Будут созданы`,"settings.projects.create.bytes":`{count} Б`,"settings.projects.create.marker":`marker восстановления`,"settings.projects.create.digest":`Digest предложения`,"settings.projects.create.confirmation":`Loomrail создаст только перечисленные файлы и инициализирует Git. Dependencies не устанавливаются, код проекта не запускается, commit, remote и push не создаются.`,"settings.projects.create.confirm":`Создать этот проект`,"settings.projects.create.completed":`Проект создан`,"settings.projects.create.next":`Когда будете готовы, выполните сами:`,"settings.projects.create.openTerminal":`Откройте терминал в каталоге`,"settings.projects.create.failed":`Создание безопасно остановлено`,"settings.projects.create.failedDescription":`{code}. Loomrail не перезаписал и не удалил существующие файлы. Устраните локальный конфликт и повторите ту же операцию.`,"settings.projects.create.pending":`Создание будет безопасно продолжено`,"settings.projects.create.pendingDescription":`Loomrail записал операцию до изменения файловой системы. Перезапустите приложение для сверки или дождитесь завершения текущей попытки.`,"settings.projects.create.retry":`Повторить безопасно`,"settings.projects.create.another":`Создать ещё проект`,"settings.projects.repositoryLabel":`Репозиторий`,"settings.projects.unusable":`Сейчас по этому пути нет Git-репозитория, поэтому любая стадия, изменяющая файлы, здесь отклоняется.`,"settings.projects.repair":`Починить demo-репозиторий`,"settings.provider.title":`ИИ-провайдер`,"settings.provider.description":`Выберите локальный агент для новых сессий. Loomrail использует существующий вход CLI по подписке и не требует API-ключ.`,"settings.provider.label":`Провайдер новых сессий`,"settings.provider.option.auto":`Авто`,"settings.provider.option.auto.description":`Использовать совместимый авторизованный локальный CLI`,"settings.provider.loading":`Проверяем локальные CLI агентов…`,"settings.provider.effective":`Новые сессии запускает {provider}.`,"settings.provider.fallback":`Нет готового совместимого локального агента. Установите или обновите Codex CLI либо Claude Code CLI и войдите через этот CLI.`,"settings.provider.compatibility":`Готовность локальных агентов`,"settings.provider.status.ready":`Готов`,"settings.provider.status.notInstalled":`Не установлен`,"settings.provider.status.tooOld":`Слишком старая версия для managed runs`,"settings.provider.status.unverified":`Версия не проверена`,"settings.provider.status.versionUnreadable":`Версию не удалось проверить`,"settings.provider.status.authRequired":`Войдите через этот CLI`,"settings.provider.status.noHardTokenBudget":`Расход сверяется после сессии`,"settings.provider.status.unknown":`Не удалось проверить`,"settings.provider.selectedUnavailable":`Этот провайдер не готов к запрошенной стадии. Сессия не запустится.`,"settings.provider.refresh":`Проверить снова`,"settings.provider.override":`Сейчас LOOMRAIL_PROVIDER принудительно выбирает {provider}. Перезапустите без override, чтобы менять выбор здесь.`,"settings.provider.overrideInvalid":`В LOOMRAIL_PROVIDER указано неизвестное значение. До исправления и перезапуска dispatch провайдера заблокирован.`,"settings.workspaceStrategy.title":`Рабочая папка`,"settings.workspaceStrategy.description":`Выберите, где агенты читают и изменяют файлы этого проекта.`,"settings.workspaceStrategy.label":`Рабочая область агентов`,"settings.workspaceStrategy.isolated":`Отдельный worktree — рекомендуется`,"settings.workspaceStrategy.isolatedDescription":`Каждая задача получает отдельный checkout. Текущая папка проекта остаётся нетронутой.`,"settings.workspaceStrategy.shared":`Эта папка проекта`,"settings.workspaceStrategy.sharedDescription":`Агенты работают прямо в {path}.`,"settings.workspaceStrategy.scope":`Существующие рабочие области задач не перемещаются. Выбор применяется, когда Loomrail создаст следующую рабочую область.`,"settings.workspaceStrategy.loading":`Загружаем настройку рабочей папки…`,"settings.workspaceStrategy.confirmTitle":`Перед работой Loomrail в этой папке`,"settings.workspaceStrategy.confirmDescription":`Новая работа агентов будет идти прямо в {path}, рядом с вашими изменениями.`,"settings.workspaceStrategy.confirmFiles":`Агенты смогут читать отслеживаемые и неотслеживаемые файлы репозитория, включая локальные файлы.`,"settings.workspaceStrategy.confirmExternalTools":`Loomrail не может заблокировать ваш редактор, терминал или другие инструменты, которые меняют ту же папку.`,"settings.workspaceStrategy.confirmSerial":`Loomrail допускает в этом проекте только одного своего автора или один verification run одновременно.`,"settings.workspaceStrategy.acknowledge":`Я понимаю риск общей папки`,"settings.workspaceStrategy.confirm":`Работать в папке проекта`,"providerAllowance.provider":`Провайдер`,"providerAllowance.title":`{provider} · Лимит провайдера`,"providerAllowance.surface.command-center":`Лимит провайдера {provider} в Command Center`,"providerAllowance.surface.task-cockpit":`Лимит провайдера {provider} в Task Cockpit`,"providerAllowance.freshness.live":`Актуально`,"providerAllowance.freshness.stale":`Устарело`,"providerAllowance.freshness.unavailable":`Недоступно`,"providerAllowance.refresh":`Проверить снова`,"providerAllowance.loading":`Загружаем лимит провайдера`,"providerAllowance.remaining":`{percent}% осталось`,"providerAllowance.window.minutes":`окно {count} мин`,"providerAllowance.window.hours":`окно {count} ч`,"providerAllowance.window.days":`окно {count} дн.`,"providerAllowance.window.weeks":`окно {count} нед.`,"providerAllowance.resets":`Сброс {time}`,"providerAllowance.details":`Детали использования`,"providerAllowance.used":`{percent}% использовано`,"providerAllowance.observed":`Получено {time}`,"providerAllowance.bucket.PRIMARY":`Основное окно`,"providerAllowance.bucket.SECONDARY":`Дополнительное окно`,"providerAllowance.bucket.FIVE_HOUR":`Пятичасовое окно`,"providerAllowance.bucket.SEVEN_DAY":`Семидневное окно`,"providerAllowance.bucket.SPEND_LIMIT":`Лимит расходов`,"providerAllowance.unavailable.unsupported":`Этот провайдер не передаёт данные о лимите.`,"providerAllowance.unavailable.unverified":`Лимит скрыт, пока эта точная версия провайдера не проверена.`,"providerAllowance.unavailable.notAuthenticated":`Войдите через локальный CLI провайдера до проверки лимита.`,"providerAllowance.unavailable.noData":`Данные о лимите ещё не получены.`,"providerAllowance.unavailable.schemaDrift":`Ответ провайдера изменился и был безопасно отклонён.`,"providerAllowance.unavailable.timeout":`Провайдер не ответил за отведённое время.`,"providerAllowance.unavailable.provider":`Провайдер недоступен на этом компьютере.`,"providerAllowance.unavailable.read":`Не удалось прочитать лимит провайдера.`,"providerAllowance.advisory.available":`Для новой работы есть ёмкость. Уже запущенная работа не затрагивается.`,"providerAllowance.advisory.low":`Осталось мало. Новую работу лучше начать после {time}; текущая работа не останавливается.`,"providerAllowance.advisory.lowWithoutReset":`Осталось мало. Проверьте снова перед запуском новой работы; текущая работа не останавливается.`,"providerAllowance.advisory.reached":`Лимит провайдера исчерпан. Продолжить лучше после {time}; Loomrail не возобновит работу автоматически.`,"providerAllowance.advisory.reachedWithoutReset":`Лимит провайдера исчерпан. Проверьте снова перед продолжением; Loomrail не возобновит работу автоматически.`,"providerAllowance.advisory.unknown":`Рекомендации по запуску нет. Жёсткий бюджет Loomrail не изменён.`,"providerAllowance.error":`Проверка лимита не удалась. Попробуйте снова.`,"providerAllowance.errorWithSnapshot":`Новая проверка не удалась. Последние данные сохранены на экране.`,"settings.mcp.title":`MCP-подключения`,"settings.mcp.description":`Подключайте локальный stdio server к новым агентским сессиям через закрытый allowlist Loomrail.`,"settings.mcp.loading":`Загружаем MCP-подключения…`,"settings.mcp.empty":`Для этого проекта ещё нет подтверждённых MCP-подключений.`,"settings.mcp.context7.title":`Документация Context7`,"settings.mcp.context7.description":`Поставляется вместе с Loomrail. Не нужны команды в терминале, глобальная установка или загрузка через npx.`,"settings.mcp.context7.privacy":`Запросы документации уходят с этого компьютера в Context7. Не включайте secrets, персональные данные или закрытый код.`,"settings.mcp.context7.review":`Проверить встроенный Context7`,"settings.mcp.context7.update":`Сверить встроенный Context7 с подтверждённым`,"settings.mcp.context7.configured":`Настроен ниже`,"settings.mcp.context7.current":`Подтверждённая ревизия уже совпадает со встроенным сервером.`,"settings.mcp.add":`Добавить локальное подключение`,"settings.mcp.newRevision":`Проверить новую ревизию подключения`,"settings.mcp.cancelRevision":`Добавить другое подключение`,"settings.mcp.name":`Название подключения`,"settings.mcp.executable":`Исполняемый файл`,"settings.mcp.executableDescription":`Абсолютный путь к существующему локальному executable. Package launchers и shell-команды запрещены.`,"settings.mcp.args":`Аргументы`,"settings.mcp.argsDescription":`По одному точному элементу argv на строку. Без shell parsing и env-переменных.`,"settings.mcp.declaredTools":`Заявленные read-only tools`,"settings.mcp.toolsDescription":`По одному точному имени MCP tool на строку. Обнаружение не выдаёт доступ автоматически.`,"settings.mcp.review":`Проверить точную команду`,"settings.mcp.consent.title":`Будет запущен локальный процесс с правами вашей учётной записи`,"settings.mcp.consent.description":`Проверьте каждый путь и аргумент. Подтверждение разрешает ограниченный capability probe; tools останутся заблокированы до отдельного разрешения.`,"settings.mcp.consent.expires":`Одноразовое подтверждение истекает в {time}.`,"settings.mcp.consent.checkbox":`Я проверил этот executable и каждый аргумент`,"settings.mcp.consent.checkboxDescription":`Я понимаю, что сам процесс может читать и менять всё, к чему есть доступ у моей локальной учётной записи.`,"settings.mcp.consent.confirm":`Подтвердить точную команду`,"settings.mcp.revision":`Ревизия {revision}`,"settings.mcp.capability":`Последний capability probe`,"settings.mcp.probe.notRun":`Не запускался`,"settings.mcp.probe.run":`Проверить capabilities`,"settings.mcp.probe.again":`Повторить MCP probe`,"settings.mcp.probe.ready":`Готов`,"settings.mcp.probe.spawnFailed":`Процесс не запустился`,"settings.mcp.probe.timedOut":`Истекло время ожидания`,"settings.mcp.probe.invalid":`Некорректный MCP-ответ`,"settings.mcp.probe.outputLimit":`Превышен лимит вывода`,"settings.mcp.probe.unsupported":`Протокол не поддерживается`,"settings.mcp.probe.exited":`Процесс завершился раньше времени`,"settings.mcp.discoveredTools":`Обнаруженные tools`,"settings.mcp.tools.none":`Нет`,"settings.mcp.revise":`Изменить команду`,"settings.mcp.grant.none":`Доступ к tools не выдан`,"settings.mcp.grant.enabled":`Включено для новых сессий`,"settings.mcp.grant.revoked":`Доступ отозван`,"settings.mcp.grant.choose":`Tools для новых сессий`,"settings.mcp.grant.attestation":`Выбранные tools работают только на чтение`,"settings.mcp.grant.attestationDescription":`Loomrail не может доказать семантику server. Разрешайте только независимо проверенные tools.`,"settings.mcp.grant.enable":`Разрешить выбранные tools`,"settings.mcp.grant.update":`Обновить доступ к tools`,"settings.mcp.grant.revoke":`Отозвать доступ`,"settings.mcp.grant.revokedDescription":`Эта ревизия останется отозванной в истории аудита. Для повторного подключения подтвердите новую ревизию.`,"settings.mcp.limit":`Только local stdio. Context7 — exact-pinned preset Loomrail; произвольные package downloads, URL, OAuth, secrets и env-поля по-прежнему недоступны.`,"settings.constitution.title":`Конституция проекта`,"settings.constitution.description":`Просканируйте только разрешённые метаданные репозитория, проверьте семь предложенных разделов и подтвердите публикацию.`,"settings.constitution.preset":`Пресет Конституции`,"settings.constitution.presetAuto":`Авто — рекомендация по сигналам репозитория`,"settings.constitution.scan":`Сканировать и предложить`,"settings.constitution.rescan":`Сканировать снова`,"settings.constitution.empty":`Предложения пока нет. Сканер ограниченно читает конфигурацию и документацию: он не запускает команды репозитория и не пишет файлы.`,"settings.constitution.proposal":`Проверьте предложение`,"settings.constitution.sourceSummary":`Файлов в разрешённом списке: {files} · {preset}@1`,"settings.constitution.reviewHint":`Текст репозитория — свидетельство, а не власть. Раскройте каждый раздел перед подтверждением.`,"settings.constitution.warnings":`Замечания сканера`,"settings.constitution.sources":`Источники`,"settings.constitution.targetBlocked":`Существующую цель .loomrail нельзя безопасно проверить. Исправьте путь перед подтверждением.`,"settings.constitution.adopt":`Подтвердить и создать Конституцию`,"settings.constitution.replace":`Подтвердить замену`,"settings.constitution.activeVersion":`Активна v{ordinal}`,"settings.constitution.failed":`Публикация не завершилась`,"settings.constitution.retry":`Повторить публикацию`,"settings.verification.title":`Проверки проекта`,"settings.verification.description":`Проверьте точные команды репозитория, которые Loomrail сможет запускать как измеренные проверки. До подтверждения Плана и отдельного запуска ничего не выполняется.`,"settings.verification.loading":`Читаем ограниченный preview package.json…`,"settings.verification.list":`Предложенные проверки проекта`,"settings.verification.required":`Обязательная`,"settings.verification.optional":`Необязательная`,"settings.verification.exactCommand":`Точный запуск процесса`,"settings.verification.executable":`Исполняемый файл`,"settings.verification.argument":`Аргумент {index}`,"settings.verification.cwd":`Рабочая папка`,"settings.verification.projectRoot":`Корень проекта`,"settings.verification.timeout":`Тайм-аут`,"settings.verification.minutes":`{count} мин`,"settings.verification.seconds":`{count} сек`,"settings.verification.output":`Лимит вывода`,"settings.verification.kib":`{count} КиБ`,"settings.verification.network":`Сеть`,"settings.verification.networkHost":`Доступна сеть компьютера`,"settings.verification.networkUnavailable":`Запуск невозможен: изоляция недоступна`,"settings.verification.environment":`Окружение`,"settings.verification.environmentBaseline":`Минимальный runtime PATH · отдельные home и cache`,"settings.verification.localExecutionTitle":`Запускается от имени вашего локального пользователя`,"settings.verification.localExecutionNotice":`Worktree не является защитной песочницей. Перед подтверждением проверьте каждую команду и её доступ к сети; секреты владельца и провайдера не наследуются.`,"settings.verification.source":`Скрипт package.json «{script}»`,"settings.verification.sourceNotice":`Показан как недоверенный исходный текст. Сканер его не выполнял.`,"settings.verification.empty":`Поддерживаемых root-скриптов не найдено. Loomrail не создал План и не может запустить проверку проекта.`,"settings.verification.warnings":`Замечания сканера`,"settings.verification.targetBlocked":`Разрешите конфликт существующей цели .loomrail перед подтверждением.`,"settings.verification.adoptionNotice":`Подтверждение запишет весь этот набор команд новой неизменяемой ревизией и опубликует только marker-файл Loomrail.`,"settings.verification.enableNotice":`Проверьте актуальный скан перед повторным включением проверок проекта.`,"settings.verification.adopt":`Подтвердить обязательных проверок: {count}`,"settings.verification.enable":`Включить План · обязательных проверок: {count}`,"settings.verification.replace":`Подтвердить замену · обязательных проверок: {count}`,"settings.verification.active":`Активна ревизия {revision}`,"settings.verification.disabled":`Отключена ревизия {revision}`,"settings.verification.publishing":`Публикуется ревизия {revision}`,"settings.verification.unpublished":`Ревизия {revision} требует внимания`,"settings.verification.published":`Опубликовано в .loomrail/verification-plan.json`,"settings.verification.publicationFailed":`Файл Плана не опубликован`,"settings.verification.retry":`Повторить публикацию`,"settings.verification.disable":`Отключить План`,"settings.launch.title":`Локальные launch-gates`,"settings.launch.description":`Измерьте производительность и безопасность на одной подтверждённой владельцем локальной команде сервиса.`,"settings.launch.loading":`Загружаем локальные измерения…`,"settings.launch.verificationRequired":`Сначала подтвердите План проверок проекта с необязательной командой start, dev или preview.`,"settings.launch.planActive":`Активна ревизия {revision}`,"settings.launch.planDisabled":`Отключена ревизия {revision}`,"settings.launch.localTitle":`Только локальное измерение`,"settings.launch.localNotice":`Loomrail запускает точную проверенную команду от имени локального пользователя. Он не выполняет deploy, не обращается к внешнему сайту и не обещает безопасность production.`,"settings.launch.noService":`В активном Плане проверок нет необязательной локальной команды сервиса.`,"settings.launch.serviceRecipe":`Команда локального сервиса`,"settings.launch.auditRecipe":`Свидетельство аудита зависимостей`,"settings.launch.auditNone":`Без аудита — требуется действие владельца`,"settings.launch.origin":`Loopback-origin`,"settings.launch.healthPath":`Путь health-check`,"settings.launch.probePath":`Измеряемая страница`,"settings.launch.privateRoutes":`Закрытые пути, по одному в строке`,"settings.launch.samples":`Свежих browser samples (3–5)`,"settings.launch.lcp":`Лимит LCP, мс`,"settings.launch.inp":`Лимит INP, мс`,"settings.launch.cls":`Лимит CLS`,"settings.launch.bundle":`Лимит JavaScript, байт`,"settings.launch.headers":`Обязательные response headers`,"settings.launch.yes":`есть`,"settings.launch.no":`нет`,"settings.launch.verificationIdentity":`План проверок {id} · ревизия {revision}`,"settings.launch.invalid":`Проверьте origin, пути, лимиты и обязательные headers перед подтверждением.`,"settings.launch.adopt":`Подтвердить launch-gates`,"settings.launch.replace":`Подтвердить замену`,"settings.launch.run":`Запустить локальное измерение`,"settings.launch.disable":`Отключить launch-gates`,"settings.launch.cancel":`Отменить измерение`,"settings.launch.cancelling":`Отменяется…`,"settings.launch.stopBlocked":`Повторить безопасную остановку`,"settings.launch.noRun":`Локальные launch-gates ещё не измерялись.`,"settings.launch.results":`Результаты локальных launch-gates`,"settings.launch.tree":`Tree {tree}`,"settings.launch.errorCode":`Состояние измерения: {code}`,"settings.launch.status.RUNNING":`Измерение выполняется`,"settings.launch.status.CANCELLING":`Измерение отменяется`,"settings.launch.status.BLOCKED":`Остановка сервиса не подтверждена — требуется действие`,"settings.launch.status.PASSED":`Все launch-gates пройдены`,"settings.launch.status.FAILED":`Требуется действие перед запуском`,"settings.launch.status.ERROR":`Измерение безопасно остановлено`,"settings.launch.status.INTERRUPTED":`Измерение прервано`,"settings.launch.freshness.CURRENT":`Актуальное свидетельство`,"settings.launch.freshness.STALE":`Устаревшее свидетельство`,"settings.launch.gateStatus.PASSED":`Пройдено`,"settings.launch.gateStatus.FAILED":`Не пройдено`,"settings.launch.gateStatus.ACTION_REQUIRED":`Требуется действие`,"settings.launch.gateStatus.ERROR":`Ошибка`,"settings.launch.gate.PERF_WEB_VITALS":`Web Vitals`,"settings.launch.gate.PERF_BUNDLE_BUDGET":`Бюджет JavaScript`,"settings.launch.gate.SEC_RESPONSE_HEADERS":`Response headers`,"settings.launch.gate.SEC_UNAUTHENTICATED_ROUTES":`Закрытые маршруты без учётных данных`,"settings.launch.gate.SEC_CLIENT_BUNDLE_SECRETS":`Поиск секретов в client bundle`,"settings.launch.gate.DEPS_AUDIT":`Аудит зависимостей`,"settings.launch.evidence.vitals":`Медиана LCP {lcp} мс · INP {inp} мс · CLS {cls}`,"settings.launch.evidence.bundle":`Медиана {measured} Б · бюджет {budget} Б`,"settings.launch.evidence.secrets":`Проверено {bytes} Б · находок {count}`,"settings.launch.evidence.auditMissing":`Нет актуального аудита для текущего tree`,"settings.launch.evidence.audit":`Аудит текущего tree: {status}`,"settings.release.title":`Свидетельства релиза`,"settings.release.description":`Зафиксируйте точные launch-свидетельства для одной публичной среды и выбранных задач.`,"settings.release.loading":`Загружаем свидетельства релиза…`,"settings.release.boundaryTitle":`Свидетельство, а не deploy`,"settings.release.boundaryNotice":`Loomrail создаёт неизменяемый снимок. Он не обращается к этому origin, не использует hosting credentials, не подтверждает релиз и не выполняет deploy.`,"settings.release.kind":`Среда`,"settings.release.kind.PREVIEW":`Preview`,"settings.release.kind.PRODUCTION":`Production`,"settings.release.name":`Название среды`,"settings.release.publicOrigin":`Публичный HTTPS-origin`,"settings.release.healthPath":`Публичный health-path`,"settings.release.variables":`Имена обязательных переменных, по одному в строке — без значений`,"settings.release.invalid":`Укажите название, точный HTTPS-origin, безопасный путь и переносимые имена переменных.`,"settings.release.save":`Сохранить среду`,"settings.release.update":`Обновить среду`,"settings.release.scope":`Включённые задачи`,"settings.release.scopeNotice":`Выберите только задачи, чьи Review, QA, проверки проекта и Acceptance должны попасть в этот релиз.`,"settings.release.noWorkItems":`В проекте нет доступных задач.`,"settings.release.create":`Создать неизменяемый снимок`,"settings.release.export":`Скачать пакет свидетельств`,"settings.release.none":`Снимок Release ещё не создан.`,"settings.release.results":`Снимок release-gates`,"settings.release.current":`Актуальный снимок`,"settings.release.stale":`Снимок устарел`,"settings.release.passed":`Обязательных gates пройдено: {passed} из {required}`,"settings.release.tree":`Tree {tree}`,"settings.release.gateStatus.PASSED":`Пройдено`,"settings.release.gateStatus.FAILED":`Не пройдено`,"settings.release.gateStatus.ACTION_REQUIRED":`Требуется действие`,"settings.release.gateStatus.STALE":`Устарело`,"settings.deploy.title":`Управляемый deploy`,"settings.deploy.description":`Запустите workflow GitHub Actions из репозитория для подходящего Preview-релиза или повышенного Production-релиза после двух явных подтверждений.`,"settings.deploy.loading":`Проверяем точную цель deploy…`,"settings.deploy.boundaryTitle":`Только существующий workflow`,"settings.deploy.boundaryNotice":`Loomrail может запустить только фиксированный workflow, уже сохранённый в репозитории. Он не получает hosting- или SSH-секреты и не делает автоматический retry или rollback.`,"settings.deploy.noRelease":`Сначала создайте актуальный снимок Preview или Production Release.`,"settings.deploy.environment":`Среда`,"settings.deploy.environment.PREVIEW":`Preview`,"settings.deploy.environment.PRODUCTION":`Production`,"settings.deploy.environment.LEGACY":`Устаревшая цель`,"settings.deploy.repository":`Репозиторий GitHub`,"settings.deploy.branch":`Опубликованная ветка`,"settings.deploy.commit":`Точный commit`,"settings.deploy.workflow":`Workflow`,"settings.deploy.planNotice":`Первое подтверждение: сохраните этот точный репозиторий, ветку, commit и workflow для {environment} как неизменяемый план deploy.`,"settings.deploy.adopt":`Подтвердить точный план`,"settings.deploy.adoptAgain":`Подготовить ещё одну точную попытку`,"settings.deploy.approvalNotice":`Второе подтверждение запустит один внешний GitHub Actions run для {environment}. Перед продолжением ещё раз проверьте цель выше.`,"settings.deploy.approve":`Подтвердить и запустить один раз`,"settings.deploy.approvedNotice":`Точная попытка для {environment} подтверждена, но ещё не запущена. Запустите её один раз; Loomrail не создаст замену автоматически.`,"settings.deploy.startApproved":`Запустить подтверждённую попытку`,"settings.deploy.observe":`Проверить точный run`,"settings.deploy.openRun":`Открыть этот run на GitHub`,"settings.deploy.unknownNotice":`Результат неизвестен, и workflow уже мог запуститься. Не запускайте deploy повторно. Если указан точный GitHub run, проверьте именно его.`,"settings.deploy.failedNotice":`Попытка не завершилась успешно ({code}). Проверьте точный run и готовьте новый план только после выяснения причины.`,"settings.deploy.rollbackUnavailable":`Rollback недоступен: workflow этого репозитория не предоставляет проверенное действие отката.`,"settings.deploy.status.PENDING_APPROVAL":`Ожидает финального подтверждения`,"settings.deploy.status.APPROVED":`Подтверждено, не запущено`,"settings.deploy.status.RUNNING":`GitHub run запущен`,"settings.deploy.status.SUCCEEDED":`Deploy завершён успешно`,"settings.deploy.status.FAILED":`Deploy завершился ошибкой`,"settings.deploy.status.UNKNOWN":`Результат неизвестен`,"settings.deploy.block.RELEASE_STALE":`Свидетельства Release устарели. Повторите затронутые проверки и создайте новый снимок Release.`,"settings.deploy.block.RELEASE_GATES_BLOCKED":`Не все обязательные проверки релиза пройдены. Устраните причины до подготовки плана deploy.`,"settings.deploy.block.ENVIRONMENT_UNSUPPORTED":`Эта среда не поддерживается фиксированным контрактом управляемого deploy.`,"settings.deploy.block.REPOSITORY_UNAVAILABLE":`Репозиторий не читается. Восстановите доступ к папке проекта и повторите проверку.`,"settings.deploy.block.REPOSITORY_PATH_NOT_CANONICAL":`Зарегистрирована ссылка или подпапка. Укажите точный физический корень репозитория.`,"settings.deploy.block.REPOSITORY_OPERATION_IN_PROGRESS":`Merge, rebase или другая Git-операция ещё не завершена. Сначала завершите её.`,"settings.deploy.block.SOURCE_DIRTY":`Текущая папка не совпадает с этим Release. Зафиксируйте нужные изменения и создайте новый снимок Release.`,"settings.deploy.block.DETACHED_HEAD":`Репозиторий не находится на именованной ветке. Переключитесь на ветку для deploy.`,"settings.deploy.block.REMOTE_INVALID":`Origin не является GitHub-адресом без credentials. Исправьте origin репозитория.`,"settings.deploy.block.WORKFLOW_MISSING":`В commit нет фиксированного workflow для этой среды. Добавьте и проверьте его перед продолжением.`,"settings.deploy.block.WORKFLOW_NOT_REGULAR":`Deploy workflow не является обычным зафиксированным файлом. Замените ссылку или специальную запись проверенным файлом.`,"settings.deploy.block.WORKFLOW_TRIGGER_MISSING":`В фиксированном workflow нет явного workflow_dispatch trigger. Добавьте и проверьте его перед продолжением.`,"settings.deploy.block.WORKFLOW_TOO_LARGE":`Deploy workflow нельзя прочитать в пределах безопасного лимита. Уменьшите или исправьте файл.`,"settings.deploy.block.CLI_UNAVAILABLE":`GitHub CLI недоступен на этом компьютере. Установите его и повторите проверку.`,"settings.deploy.block.AUTH_REQUIRED":`GitHub CLI не авторизован. Войдите локально через gh; Loomrail не сохранит токен.`,"settings.deploy.block.REMOTE_BRANCH_UNAVAILABLE":`Текущая ветка недоступна на GitHub. Сначала опубликуйте именованную ветку в origin.`,"settings.deploy.block.REMOTE_COMMIT_MISMATCH":`Ветка GitHub не указывает на этот точный локальный commit. Опубликуйте commit и заново создайте актуальный Release.`,"settings.deploy.block.PREVIEW_PROMOTION_REQUIRED":`Production заблокирован, пока эти точные Release-свидетельства не были успешно развёрнуты в Preview. Сначала разверните и проверьте Preview, затем заново создайте снимок Production Release.`,"event.launchEnvironmentChanged":`Launch-среда сохранена`,"event.launchEnvironmentChangedDetail":`Декларация {kind} · версия {version}`,"event.launchReleaseCreated":`Свидетельства релиза зафиксированы`,"event.launchReleaseCreatedDetail":`Tree {tree} · обязательных gates {passed} из {required}`,"event.deploymentPlanAdopted":`План deploy подтверждён`,"event.deploymentPlanAdoptedDetail":`{repository} · {branch} · commit {commit}`,"event.deploymentChanged":`Состояние deploy изменилось`,"event.deploymentChangedDetail":`{status}`,"verification.title":`Проверка проекта`,"verification.loading":`Загружаем проверки проекта`,"verification.intro":`Запустите подтверждённые владельцем команды на текущем worktree. Loomrail запишет длительность, код выхода и ограниченный вывод каждой проверки.`,"verification.required":`Обязательная`,"verification.optional":`Необязательная`,"verification.status.NOT_RUN":`Не запускалась`,"verification.status.QUEUED":`В очереди`,"verification.status.RUNNING":`Выполняется`,"verification.status.CANCELLING":`Отменяется`,"verification.status.PASSED":`Пройдена`,"verification.status.FAILED":`Не пройдена`,"verification.status.ERROR":`Ошибка`,"verification.status.INTERRUPTED":`Прервана`,"verification.status.STALE":`Устарела`,"verification.runMeta":`Запуск {ordinal} · План r{revision} · {platform}`,"verification.evidenceMeta":`Пройдено {passed}/{total} · tree {tree}`,"verification.evidenceCounts":`Пройдено {passed} · не пройдено {failed} · ошибок {errors} · прервано {interrupted} · осталось {remaining} · tree {tree}`,"verification.currentPlan":`Текущий активный План · ревизия {revision}`,"verification.group":`Проверки {kind}`,"verification.acceptanceBlocker":`Acceptance заблокирован, пока все обязательные проверки не пройдут для текущего кода и Плана.`,"verification.platform.darwin":`macOS`,"verification.platform.linux":`Linux`,"verification.platform.win32":`Windows`,"verification.duration.ms":`{count} мс`,"verification.duration.seconds":`{count} с`,"verification.measurement":`{duration} · код выхода {exit}`,"verification.outcome.active":`Проверки выполняются по порядку. Worktree зарезервирован до завершения или отмены запуска.`,"verification.outcome.passed":`Все обязательные проверки пройдены для текущего кода и Плана.`,"verification.outcome.failed":`Этот запуск не является проходящим свидетельством. Откройте вывод, исправьте код и запустите снова.`,"verification.outcome.interrupted":`Запуск остановился до получения полного свидетельства. Запустите его снова.`,"verification.outcome.stale":`Результат больше не актуален: {reasons}. Запустите проверки снова.`,"verification.stale.PLAN_UNAVAILABLE":`активный План недоступен`,"verification.stale.PLAN_REPLACED":`подтверждённый План изменился`,"verification.stale.PLAN_UNPUBLISHED":`текущий План не опубликован`,"verification.stale.TREE_CHANGED":`worktree изменился`,"verification.unavailable.plan":`Сначала подтвердите и опубликуйте «Проверки проекта» в Настройках.`,"verification.unavailable.pipeline":`Сначала запустите workflow задачи.`,"verification.unavailable.workspace":`Проверки станут доступны после того, как реализация подготовит worktree.`,"verification.run":`Запустить проверки`,"verification.runAgain":`Запустить снова`,"verification.cancel":`Отменить запуск`,"verification.output.view":`Показать вывод`,"verification.output.hide":`Скрыть вывод`,"verification.output.loading":`Загружаем ограниченный вывод…`,"verification.history":`Предыдущие запуски ({count})`,"verification.correction.timeline":`История коррекций`,"verification.correction.position":`Коррекция {position}`,"verification.correction.automatic":`Автоматическая`,"verification.correction.ownerAuthorized":`Финальная попытка по решению владельца`,"verification.correction.status.ACTIVE":`В работе`,"verification.correction.status.PASSED":`Пройдена`,"verification.correction.status.SUPERSEDED":`Заменена следующей`,"verification.correction.status.EXHAUSTED":`Нужно ваше решение`,"verification.correction.status.CANCELLED":`Отменена`,"verification.correctionGate.title":`Нужно решение по проверке проекта`,"verification.correctionGate.description":`Коррекция {position} снова завершилась измеренным сбоем. Перед выбором проверьте точный вывод команды.`,"verification.correctionGate.authorizeFinal":`Разрешить одну финальную коррекцию`,"verification.correctionGate.cancel":`Отменить поставку`,"settings.readiness.title":`Готовность к запуску`,"settings.readiness.description":`Ограниченная локальная проверка безопасности репозитория и явных решений по legal, платежам и аналитике.`,"settings.readiness.run":`Проверить готовность`,"settings.readiness.rerun":`Проверить снова`,"settings.readiness.empty":`Проверок пока нет. Loomrail читает только ограниченный набор фактов и не запускает скрипты проекта.`,"settings.readiness.ready":`Готов`,"settings.readiness.actionRequired":`Нужны действия`,"settings.readiness.checkedAt":`Проверено {date}`,"settings.readiness.head":`HEAD {head}`,"settings.readiness.noHead":`Нет коммита`,"settings.readiness.dirty":`Рабочее дерево изменено`,"settings.readiness.clean":`Рабочее дерево чистое`,"settings.readiness.limit":`Это локальный preflight, а не полный аудит безопасности или юридическая консультация. После изменений запустите проверку снова.`,"settings.readiness.category.security":`Безопасность`,"settings.readiness.category.legal":`Legal`,"settings.readiness.category.payments":`Платежи`,"settings.readiness.category.analytics":`Аналитика`,"settings.readiness.category.dependencies":`Зависимости`,"settings.readiness.category.environment":`Окружение`,"settings.readiness.category.operations":`Эксплуатация`,"settings.readiness.check.activeConstitution":`Конституция подтверждена владельцем`,"settings.readiness.check.secretPaths":`Отслеживаемые файлы с секретами`,"settings.readiness.check.envIgnored":`Локальные секретные файлы игнорируются`,"settings.readiness.check.ciHardening":`Доверие CI и фиксация actions`,"settings.readiness.check.license":`Лицензия репозитория`,"settings.readiness.check.legalOwner":`Legal и privacy review`,"settings.readiness.check.paymentsOwner":`Платежи, налоги и возвраты`,"settings.readiness.check.analyticsOwner":`Согласие и хранение данных аналитики`,"settings.readiness.check.lockfile":`Воспроизводимый lockfile зависимостей`,"settings.readiness.check.envProdSeparation":`env-файлы продакшена и литералы в CI`,"settings.readiness.check.securityHeadersOwner":`Решение по security headers`,"settings.readiness.check.healthEndpoint":`Health-эндпоинт`,"settings.readiness.check.rollbackPlan":`План отката`,"settings.readiness.check.backup":`Резервное копирование данных`,"settings.readiness.status.passed":`Проверено автоматически`,"settings.readiness.status.action":`Требует действия`,"settings.readiness.status.confirmed":`Подтверждено владельцем`,"settings.readiness.status.na":`Не применимо`,"settings.readiness.evidence":`Свидетельства`,"settings.readiness.rationale":`Комментарий к решению`,"settings.readiness.rationalePlaceholder":`Что проверено или почему это не применимо…`,"settings.readiness.confirm":`Подтвердить`,"settings.readiness.notApplicable":`Не применимо`,"settings.readiness.finding.activeConstitution":`Нет активной Конституции, подтверждённой владельцем.`,"settings.readiness.finding.secretPath":`Git отслеживает имя файла, обычно используемое для секретов.`,"settings.readiness.finding.envIgnored":`Правило Git ignore отсутствует или его нельзя подтвердить.`,"settings.readiness.finding.pullRequestTarget":`CI использует pull_request_target; проверьте границу доверия.`,"settings.readiness.finding.writeAll":`CI получил права write-all.`,"settings.readiness.finding.actionPinned":`GitHub Action не закреплён полным commit SHA.`,"settings.readiness.finding.ciUnverifiable":`CI-файл нельзя проверить в безопасных пределах.`,"settings.readiness.finding.license":`В корне не найден обычный LICENSE или COPYING.`,"settings.readiness.finding.lockfileMissing":`У отслеживаемого manifest нет lockfile, установка не воспроизводится.`,"settings.readiness.finding.lockfileAmbiguous":`Отслеживается больше одного lockfile разных пакетных менеджеров.`,"settings.readiness.finding.dependencyUnverifiable":`Данные о зависимостях не удалось проверить в безопасных пределах.`,"settings.readiness.finding.prodEnvNotIgnored":`Файл продакшн-окружения существует и не покрыт правилами ignore.`,"settings.readiness.finding.inlineSecretInCi":`CI присваивает переменной с секретным именем литеральное значение вместо ссылки на управляемый секрет.`,"language.change":`Сменить язык`,"language.english":`English`,"language.russian":`Русский`,"nav.humanRequests":`Запросы человеку`,"nav.attention":`Внимание`,"nav.fleet":`Агенты`,"nav.workspace":`Пространство`,"nav.open":`Открыть навигацию`,"nav.yourProjects":`Ваши проекты`,"nav.currentWork":`Текущая работа`,"nav.insights":`Метрики`,"nav.guidedDemo":`Пошаговое демо`,"activation.loading":`Загружаем пошаговое демо`,"activation.eyebrow":`Первый локальный результат`,"activation.title":`Пошаговое демо`,"activation.description":`Создайте настоящую локальную задачу и запустите её через авторизованный Codex или Claude Code CLI с явными execution limits.`,"activation.zeroQuota":`Только локальный агент — без API-ключа и отдельного API-биллинга. Расход подписки сообщается после CLI-сессии.`,"activation.progress":`Прогресс пошагового демо`,"activation.step":`Шаг {current} из {total}`,"activation.status.complete":`Готово`,"activation.status.current":`Сейчас`,"activation.status.upcoming":`Впереди`,"activation.phase.workspace":`Подготовить демо-проект`,"activation.phase.provider":`Выбрать безопасного провайдера`,"activation.phase.task":`Создать демо-задачу`,"activation.phase.ready":`Разрешить работу`,"activation.phase.run":`Запустить процесс`,"activation.phase.request":`Human Request и результат провайдера`,"activation.phase.review":`Независимое ревью после execution`,"activation.phase.qa":`Измеренный Browser QA после execution`,"activation.phase.acceptance":`Проверить результат`,"activation.phase.complete":`Решение владельца записано`,"activation.copy.workspace":`Развернём встроенный репозиторий web-app в локальном хранилище Loomrail.`,"activation.copy.provider":`Верните проект в режим «Авто», чтобы Loomrail мог использовать совместимый авторизованный Codex или Claude Code CLI. Пока локальный CLI не готов, сессия не запустится.`,"activation.copy.task":`Создайте точную проверенную тестовую задачу. Повтор этого действия не создаст дубль.`,"activation.copy.ready":`Переведите задачу из бэклога в Ready отдельным записанным переходом.`,"activation.copy.run":`Запустите durable workflow с видимыми лимитами времени, ходов, tools и вывода. Локальный CLI использует существующую подписочную сессию.`,"activation.copy.request":`Отвечайте на вопросы провайдера во «Внимании». Чтение, правки и разрешённые команды проходят только через audited workspace tools Loomrail.`,"activation.copy.review":`Независимый ревьюер проверяет реализацию до Browser QA. Его findings остаются привязаны к этой задаче.`,"activation.copy.qa":`Browser QA измеряет утверждённые сценарии и записывает screenshots и trace до открытия приёмки.`,"activation.copy.acceptance":`Проверьте измеренные Review- и Browser QA-свидетельства в Task Cockpit, затем выберите Accept, Return или Reject.`,"activation.copy.complete":`Ваше итоговое решение сохранено. Маршрут завершён; Loomrail не решал судьбу собственного результата.`,"activation.action.workspace":`Подготовить демо-проект`,"activation.action.provider":`Использовать доступный локальный CLI`,"activation.action.task":`Создать демо-задачу`,"activation.action.ready":`Перевести задачу в Ready`,"activation.action.run":`Запустить демо-процесс`,"activation.action.attention":`Ответить во «Внимании»`,"activation.action.cockpit":`Открыть Task Cockpit`,"activation.action.acceptance":`Проверить и решить`,"activation.providerLocked":`Активен override LOOMRAIL_PROVIDER. Перезапустите Loomrail без него и снова выполните loomrail try.`,"activation.recipe.title":`Что сделает этот запуск`,"activation.recipe.provider":`Провайдер`,"activation.provider.real":`Codex CLI или Claude Code CLI`,"activation.recipe.model":`Уровень модели`,"activation.recipe.budget":`Бюджет задачи Loomrail`,"activation.next.title":`Что дальше`,"activation.next.local":`Продолжить в Task Cockpit`,"activation.next.repository":`Подключить репозиторий или провайдера`,"activation.next.guidedAction":`Прочитать про Guided Launch`,"activation.next.guided":`Guided Launch задуман как платная помощь, но в этой сборке ещё нет формы покупки.`,"insights.loading":`Загружаем локальные метрики…`,"insights.title":`Метрики`,"insights.description":`Сигналы доставки, качества и надёжности, рассчитанные из локального состояния Loomrail.`,"insights.localOnly":`Только локально`,"insights.outcomes.title":`Результаты`,"insights.outcomes.description":`Проценты учитывают только завершённые свидетельства. Отсутствие данных не равно измеренному нулю.`,"insights.rate.acceptance":`Принятые завершения`,"insights.rate.firstReview":`Review с первого раза`,"insights.rate.qa":`Успешная финальная QA`,"insights.noEvidence":`Нет данных`,"insights.count.workItems":`Принято / всего задач`,"insights.count.activeWork":`Активные задачи`,"insights.count.cancelledWork":`Отменённые задачи`,"insights.count.pipelines":`Успешно / всего конвейеров`,"insights.count.pipelineFailures":`Failed, interrupted или cancelled конвейеры`,"insights.count.agentRuns":`Успешно / всего запусков агентов`,"insights.count.agentFailures":`Failed или interrupted запуски агентов`,"insights.count.reviews":`Review reports`,"insights.count.qaRuns":`Запуски Browser QA`,"insights.count.qaDefects":`Открыто / всего QA-дефектов`,"insights.count.humanRequests":`Решено / всего запросов человеку`,"insights.count.tokens":`Записано оценочных токенов`,"insights.count.recoveries":`Восстановления после restart daemon`,"insights.report.title":`Анонимные отчёты`,"insights.report.description":`Loomrail никогда не отправляет их автоматически. Сначала прочитайте весь JSON; скачивание — одноразовое opt-in действие.`,"insights.report.exclusions":`Схема исключает код, prompts, ответы провайдеров, logs, имена, пути, IDs, timestamps, artifacts и stack traces.`,"insights.report.aggregate":`Агрегированный отчёт`,"insights.report.aggregateDescription":`Категории продукта и runtime вместе с показанными выше локальными aggregate metrics.`,"insights.report.crash":`Отчёт о восстановлении после сбоя`,"insights.report.crashDescription":`Доступен, потому что durable state доказывает прерывание выполнявшегося workflow при restart daemon.`,"insights.report.noCrash":`Crash report недоступен: восстановления после restart daemon не записаны.`,"insights.report.download":`Скачать этот JSON`,"insights.report.previewLabel":`Точный payload отчёта`,"connection.connecting":`Подключение…`,"connection.local":`Local daemon`,"connection.offline":`Нет подключения`,"connection.recovery.retryTitle":`Loomrail временно недоступен`,"connection.recovery.retryDescription":`Проверьте, что локальный процесс ещё работает. Повторная попытка не затронет сохранённые данные.`,"connection.recovery.reopenTitle":`Эта локальная сессия завершилась`,"connection.recovery.reopenDescription":`При необходимости остановите старый процесс, затем запустите Loomrail заново. Новая авторизованная вкладка откроется автоматически.`,"connection.recovery.command":`Выполните в терминале`,"connection.recovery.retryAction":`Повторить`,"theme.change":`Сменить тему`,"theme.light":`Светлая`,"theme.dark":`Тёмная`,"theme.system":`Системная`,"project.switch":`Сменить проект`,"project.loading":`Загрузка…`,"project.none":`Проектов нет`,"project.noneSingle":`Нет проекта`,search:`Поиск`,"task.new":`Новая задача`,"task.create.description":`Сначала создайте задачу. Loomrail предложит конвейер доставки, когда описание станет достаточно ясным.`,"task.create.title":`Название`,"task.create.titlePlaceholder":`Какой результат должна получить команда?`,"task.create.brief":`Описание`,"task.create.briefDescription":`Добавьте контекст, чтобы планирующие агенты могли задать полезные вопросы.`,"task.create.briefPlaceholder":`Результат, ограничения, важные файлы…`,"task.create.criteria":`Критерии приёмки`,"task.create.criteriaDescription":`По одному проверяемому результату в строке. Нужен хотя бы один.`,"task.create.criteriaError":`Укажите 1–50 уникальных строк, не более 500 символов в каждом критерии.`,"task.create.criteriaPlaceholder":`Владелец может проверить полученный результат…`,"task.create.project":`Проект`,"task.create.priority":`Приоритет`,"task.create.type":`Тип`,"task.create.parent":`Родительская работа`,"task.create.parentDescription":`Необязательная группировка внутри Epic или другой работы.`,"task.create.noParent":`Без родителя`,"task.create.submit":`Создать задачу`,"task.edit":`Редактировать задачу`,"task.edit.description":`Обновите сохранённое описание и параметры планирования WorkItem.`,"task.edit.criteriaDescription":`Один критерий приёмки на строку, не более 50.`,"task.edit.criteriaError":`Не более 50 строк и 500 символов в каждом критерии.`,"task.edit.submit":`Сохранить изменения`,"action.cancel":`Отмена`,"action.back":`Назад`,"action.closeDialog":`Закрыть окно`,"view.active":`Активные`,"view.backlog":`Бэклог`,"view.allIssues":`Все задачи`,"view.filter":`Фильтровать задачи`,"view.display":`Настройки отображения`,"view.ordering":`Сортировка`,"view.orderBy":`Сортировать задачи по`,"view.boardOptions":`Настройки доски`,"view.showEmptyColumns":`Показывать пустые колонки`,"view.direction.asc":`Сортировать по возрастанию`,"view.direction.desc":`Сортировать по убыванию`,"view.title":`Название`,"view.updated":`Обновлено`,"view.created":`Создано`,"property.priority":`Приоритет`,"work.current":`Текущая работа`,"work.boardLabel":`Доска текущей работы`,"work.summary.needsYou":`Ждут вас`,"work.summary.filter":`Быстрый фильтр`,"work.summary.clear":`Убрать быстрый фильтр`,"view.actions":`Действия представления`,"view.copyLink":`Копировать ссылку`,"filter.status":`Статус`,"filter.priority":`Приоритет`,"filter.risk":`Риск`,"filter.rootTitle":`Фильтры`,"filter.search":`Поиск`,"filter.addPlaceholder":`Добавить фильтр…`,"filter.placeholder":`Фильтр…`,"filter.noProperties":`Подходящих свойств нет`,"filter.noValues":`Подходящих значений нет`,"filter.add":`Добавить`,"filter.remove":`Убрать`,"filter.options":`варианты`,"filter.backTo":`Назад к`,"filter.close":`Закрыть фильтры`,"filter.description":`Выберите одно или несколько свойств задачи. Изменения применяются сразу.`,"filter.edit":`Изменить`,"filter.is":`равно`,"filter.isAnyOf":`одно из`,"filter.oneValue":`1 значение`,"filter.selectedValues":`выбранные значения`,"filter.clear":`Очистить`,"state.BACKLOG":`Бэклог`,"state.READY":`Готово к работе`,"state.IN_PROGRESS":`В работе`,"state.BLOCKED":`Заблокировано`,"state.DONE":`Завершено`,"state.CANCELLED":`Отменено`,"priority.LOW":`Низкий`,"priority.MEDIUM":`Средний`,"priority.HIGH":`Высокий`,"priority.URGENT":`Срочный`,"risk.LOW":`Низкий`,"risk.MEDIUM":`Средний`,"risk.HIGH":`Высокий`,"risk.CRITICAL":`Критический`,"type.EPIC":`Эпик`,"type.FEATURE":`Функция`,"type.TASK":`Задача`,"type.BUG":`Ошибка`,"type.SPIKE":`Исследование`,"type.SUBTASK":`Подзадача`,"stage.DISCOVERY":`Исследование`,"stage.PLAN":`План`,"stage.IMPLEMENT":`Реализация`,"stage.REVIEW":`Проверка`,"stage.QA":`QA`,"stage.ACCEPTANCE":`Приёмка`,"empty.noProjects.title":`Локальных проектов пока нет`,"empty.noProjects.description":`Зарегистрируйте два встроенных безопасных demo-проекта, чтобы получить сохраняемую доску.`,"empty.noProjects.action":`Инициализировать demo-пространство`,"loading.board.title":`Загружаем доску…`,"loading.inspector.title":`Загружаем детали задачи…`,"error.board.title":`Не удалось загрузить локальную доску`,"error.unknown":`Неизвестная ошибка`,"empty.active.title":`Активных задач нет`,"empty.active.description":`Создайте задачу или откройте «Все задачи», чтобы увидеть завершённые.`,"empty.backlog.title":`Бэклог пуст`,"empty.backlog.description":`Новые задачи ждут здесь, пока их не переведут в «Готово к работе».`,"empty.all.title":`Задач пока нет`,"empty.all.description":`Создайте задачу, чтобы начать вести доставку в этом проекте.`,"empty.filters.title":`Нет задач с такими фильтрами`,"empty.filters.description":`Измените условие выше или очистите строку фильтров.`,"empty.noSelection.title":`Задача не выбрана`,"empty.noSelection.description":`Выберите карточку на доске, чтобы посмотреть её состояние и историю.`,"task.move":`Переместить`,"task.moveTo":`Переместить в «{state}»`,"task.moveToShort":`В «{state}»`,"task.overview":`Обзор`,"task.state":`Состояние`,"task.stage":`Этап`,"task.type":`Тип`,"task.priority":`Приоритет`,"task.risk":`Риск`,"task.noBrief":`Описание ещё не добавлено.`,"task.acceptanceCriteria":`Критерии приёмки`,"task.noAcceptanceCriteria":`Критерии приёмки ещё не записаны.`,"dependency.title":`Структура и зависимости`,"dependency.edit":`Изменить блокеры`,"dependency.editDescription":`Выберите работы, которые должны перейти в Done до запуска этого процесса. Иерархия показана отдельно.`,"dependency.save":`Сохранить блокеры`,"dependency.loading":`Загружаем структуру и зависимости…`,"dependency.parent":`Родитель`,"dependency.children":`Дочерние работы`,"dependency.blockedBy":`Заблокировано работами`,"dependency.blocks":`Блокирует`,"dependency.none":`Нет`,"dependency.noChildren":`Нет дочерних работ`,"dependency.noBlockers":`Нет блокеров`,"dependency.blocksNone":`Нет зависимых работ`,"dependency.noCandidates":`В этом проекте нет других работ.`,"dependency.editUnavailable":`Блокеры можно менять только до запуска процесса и до закрытия этой работы.`,"task.activity":`История`,"task.loadingActivity":`Загружаем историю…`,"task.noActivity":`История пока пуста.`,"task.activityCountMore":`{count}+`,"task.loadMoreActivity":`Показать ещё`,"workflow.title":`Процесс`,"workflow.name":`Процесс поставки`,"workflow.start":`Запустить процесс`,"workflow.startDescription":`Запустить ограниченный процесс «Исследование → Приёмка». Перед продолжением он может остановиться на сохранённом вопросе или решении владельца.`,"workflow.readyRequired":`Перед запуском переведите задачу в состояние «Готово к работе».`,"workflow.dependencyBlocked":`Завершите все блокирующие работы перед запуском этого процесса.`,"workflow.dependencyLoadFailed":`Loomrail не смог проверить граф зависимостей, поэтому запуск остаётся недоступен.`,"workflow.containerNotExecutable":`Это контейнер с дочерними работами. Запускайте процесс у конечных работ.`,"workflow.loading":`Загружаем процесс…`,"workflow.status.RUNNING":`Выполняется`,"workflow.status.WAITING_HUMAN":`Ждёт вас`,"workflow.status.SOFT_PAUSED":`Приостановлен`,"workflow.status.HARD_PAUSED":`Остановлен лимитом`,"workflow.status.INTERRUPTED":`Прерван`,"workflow.status.SUCCEEDED":`Завершён`,"workflow.status.FAILED":`Ошибка`,"workflow.status.CANCELLED":`Отменён`,"workflow.completed":`Ограниченный процесс поставки завершён на основе сохранённых решений.`,"workflow.stage.QUEUED":`В очереди`,"workflow.stage.RUNNING":`Выполняется`,"workflow.stage.WAITING_HUMAN":`Ожидает`,"workflow.stage.SOFT_PAUSED":`Приостановлен`,"workflow.stage.HARD_PAUSED":`Остановлен лимитом`,"workflow.stage.INTERRUPTED":`Прерван`,"workflow.stage.CANCELLED":`Отменён`,"workflow.stage.SUCCEEDED":`Завершено`,"workflow.stage.other":`Выполняется`,"workflow.action.pause":`Приостановить`,"workflow.action.resume":`Продолжить`,"workflow.action.cancel":`Отменить запуск`,"workflow.action.override":`Одобрить политику расходов`,"workflow.budget.title":`Лимит оценочных токенов`,"workflow.budget.kind":`Жёсткий бюджет`,"workflow.budget.input":`Жёсткий лимит токенов`,"workflow.budget.description":`Запускаются все шесть стадий, включая независимый Review, Project verification, Browser QA и Acceptance владельца. Чтения файлов и повторные попытки могут сделать даже небольшую задачу дорогой. Лимит — не прогноз: input, output и cache hits заранее неизвестны. Локальный CLI сообщает расход после сессии; она может превысить лимит, который остановит следующую работу.`,"workflow.budget.invalid":`Введите положительное целое число.`,"workflow.budget.overrideDescription":`Оставьте не меньше текущего {current}; лимит должен быть выше записанного расхода {used}.`,"workflow.budget.overrideInvalid":`Сохраните текущий лимит и значение выше записанного расхода.`,"workflow.budget.usage":`{used} из {limit}`,"workflow.budget.revision":`Ревизия политики {revision}`,"workflow.agentRunBudget.input":`Лимит одного запуска агента`,"workflow.agentRunBudget.description":`Максимум оценочных токенов на каждый будущий запуск агента. Не может превышать общий лимит.`,"workflow.agentRunBudget.invalid":`Введите положительное целое число не выше общего лимита.`,"workflow.agentRunBudget.overrideDescription":`Повысьте этот лимит для исчерпавшего бюджет агента или повысьте общий лимит.`,"workflow.agentRunBudget.overrideInvalid":`Повысьте этот лимит, если общий лимит не меняется.`,"workflow.agentRunBudget.current":`На агента: {limit}`,"workflow.agentRunBudget.roleDefault":`Лимит роли`,"workflow.modelTier.input":`Уровень модели`,"workflow.modelTier.description":`Применяется к будущим запускам агентов и сохраняется в каждом неизменяемом снимке политики.`,"workflow.model.input":`Модель`,"workflow.model.autoOption":`{tier} · Авто`,"workflow.model.autoDescription":`Codex CLI: {codex} · Claude Code: {claude}`,"workflow.model.providerDescription":`{provider} · политика стоимости «{tier}»`,"workflow.model.loading":`Загружаем каталог моделей провайдера…`,"workflow.modelTier.current":`Уровень: {tier}`,"workflow.modelTier.roleDefault":`По умолчанию роли`,"workflow.modelTier.FAST":`Быстрый`,"workflow.modelTier.STANDARD":`Стандартный`,"workflow.modelTier.DEEP":`Глубокий`,"workflow.recovery.title":`Отчёт о восстановлении`,"workflow.recovery.description":`Выполнявшаяся попытка безопасно прервана после перезапуска локального демона.`,"workflow.hardPause.noProgress":`Остановлен: нет прогресса`,"workflow.hardPause.contextFloor":`Остановлен: контекст не помещается`,"workflow.hardPause.providerRejected":`Остановлен: провайдер отклонил вход`,"workflow.hardPause.providerStartFailed":`Остановлен: провайдер недоступен`,"workflow.hardPause.providerOutcomeRejected":`Остановлен: некорректный результат провайдера`,"workflow.hardPause.sessionLimit":`Остановлен: достигнут предел сессий`,"workflow.sessions.title":`Сессии`,"workflow.sessions.attemptHeading":`Попытка {attempt}`,"workflow.sessions.ordinal":`Сессия {ordinal}`,"workflow.sessions.status.RUNNING":`Выполняется`,"workflow.sessions.status.COMPLETED":`Завершена`,"workflow.sessions.status.HANDOFF":`Передана дальше`,"workflow.sessions.status.CONTEXT_EXHAUSTED":`Контекст исчерпан`,"workflow.sessions.status.INTERRUPTED":`Прервана`,"workflow.sessions.status.CANCELLED":`Отменена`,"workflow.sessions.handoffRequested":`Запрошена передача`,"workflow.sessions.occupancyPeak":`Пик — {percent}% окна`,"workflow.sessions.occupancyAtHandoff":`{percent}% окна на момент передачи`,"workflow.sessions.usageQuality.ACTUAL":`(измерено)`,"workflow.sessions.usageQuality.PROVIDER_ESTIMATE":`(оценка провайдера)`,"workflow.sessions.usageQuality.LOOMRAIL_ESTIMATE":`(оценка Loomrail)`,"workflow.sessions.cacheUnknown":`Неизвестно`,"workflow.sessions.tokenUsage":`Использовано токенов: {total} (вход: {input} · выход: {output} · cached input: {cached} · uncached input + output: {uncached})`,"workflow.sessions.tokenCost":`· {cost}`,"workflow.sessions.noCheckpointOnRequest":`Этот провайдер не умеет сворачиваться по запросу — для него штатно терять недавнюю работу при обрыве сессии.`,"workflow.checkpoints.empty":`В этой сессии checkpoint не публиковался.`,"workflow.checkpoints.completed":`Сделано`,"workflow.checkpoints.remaining":`Осталось`,"workflow.checkpoints.deadEnds":`Тупики`,"workflow.checkpoints.openQuestions":`Открытые вопросы`,"workspace.title":`Рабочая область`,"workspace.state":`Состояние`,"workspace.status.READY":`Готова`,"workspace.status.ORPHANED":`Worktree исчез`,"workspace.status.REMOVED":`Удалена`,"workspace.repository":`Репозиторий`,"workspace.mode":`Режим`,"workspace.mode.ISOLATED_WORKTREE":`Отдельный worktree`,"workspace.mode.SHARED_CURRENT_DIRECTORY":`Папка проекта`,"workspace.branch":`Ветка`,"workspace.worktree":`Worktree`,"workspace.workingDirectory":`Рабочая папка`,"workspace.baseCommit":`Базовый коммит`,"workspace.baseCommit.none":`Коммитов ещё не было`,"workspace.notReady":`Каталога worktree этой задачи больше нет на диске. Loomrail не создаёт второй, и вернуть эту рабочую область в строй нечем — ветка по-прежнему хранит всё, что в неё закоммичено.`,"workspace.sharedNotReady":`Записанная рабочая папка проекта больше недоступна. Loomrail не будет сам выбирать другую папку или ветку.`,"workspace.uncommitted":`Loomrail ничего не коммитил. Работа лежит в этом worktree, на этой ветке, пока вы её не сохраните или не удалите.`,"workspace.sharedUncommitted":`Loomrail ничего не коммитил. Изменения агента лежат в папке проекта рядом с работой, которая уже была там.`,"changes.title":`Изменения`,"changes.empty":`Задача пока ничего не изменила в своей рабочей области.`,"changes.truncated":`Показаны только первые {count} изменённых файлов. В этом worktree их больше, чем Loomrail выводит здесь.`,"changes.binary":`Бинарный`,"changes.binaryNoPatch":`Это бинарный файл — текстового диффа для него нет.`,"changes.renamedFrom":`Переименован из {path}`,"changes.lineCounts":`Добавлено строк: {insertions}, удалено: {deletions}`,"changes.diffPending":`Читаем дифф этого файла…`,"changes.diffUnavailable":`Этот дифф прочитать нечем: у задачи больше нет рабочей области.`,"changes.patchTruncated":`Loomrail выводит только начало этого диффа — ещё {bytes} байт здесь не показано.`,"changes.status.ADDED":`Добавлен`,"changes.status.MODIFIED":`Изменён`,"changes.status.DELETED":`Удалён`,"changes.status.RENAMED":`Переименован`,"changes.error.WORKSPACE_WORKTREE_MISSING":`Каталога worktree этой задачи больше нет на диске — читать изменения больше не из чего.`,"changes.error.WORKSPACE_WORKTREE_UNREADABLE":`Loomrail не может войти в worktree этой задачи и поэтому не может сказать, что изменилось. Возможно, работа агента всё ещё там, но Loomrail не может проверить это отсюда.`,"changes.error.WORKSPACE_HAS_NO_BASELINE":`У этой рабочей области не записан коммит для сравнения, поэтому измерять изменения не от чего.`,"changes.error.CHANGES_UNREADABLE":`Loomrail не смог прочитать этот worktree относительно коммита, от которого он отрезан, и не показывает список, за который не может отвечать.`,"changes.error.GIT_UNAVAILABLE":`Loomrail не смог запустить git на этой машине и поэтому не может прочитать, что изменила задача.`,"changes.error.PATH_OUTSIDE_WORKSPACE":`Этот путь лежит за пределами рабочей области задачи, и Loomrail его не читал.`,"changes.error.PATH_NOT_A_FILE":`Этот путь не именует изменённый файл в этом worktree.`,"changes.error.PATH_UNRESOLVABLE":`Loomrail не смог разрешить этот путь внутри этого worktree.`,"changes.error.other":`Loomrail не смог прочитать, что изменила эта задача.`,"review.title":`Независимое ревью`,"review.round":`Раунд ревью {round}`,"review.verdict.PASSED":`Пройдено`,"review.verdict.CHANGES_REQUESTED":`Нужны исправления`,"review.reviewer":`Ревьюер`,"review.relation":`Независимость`,"review.relation.CROSS_PROVIDER":`Другой провайдер`,"review.relation.SAME_PROVIDER":`Отдельный запуск, тот же провайдер`,"review.tree":`Проверенный tree`,"review.findings":`Замечания ревью`,"review.noFindings":`Открытых замечаний не осталось.`,"review.severity.LOW":`Низкая`,"review.severity.MEDIUM":`Средняя`,"review.severity.HIGH":`Высокая`,"review.severity.CRITICAL":`Критическая`,"review.findingStatus.OPEN":`Открыто`,"review.findingStatus.RESOLVED":`Исправлено`,"review.findingStatus.WAIVED":`Риск принят`,"review.findingStatus.FALSE_POSITIVE":`Ложное срабатывание`,"review.reproduction":`Как воспроизвести`,"review.waive":`Принять риск`,"review.falsePositive":`Ложное срабатывание`,"review.reason":`Причина решения владельца`,"review.reasonPlaceholder":`Объясните, почему замечание не должно блокировать поставку…`,"review.confirmWaive":`Зафиксировать риск`,"review.confirmFalsePositive":`Отметить как ложное`,"qa.title":`QA в браузере`,"qa.status.RUNNING":`Выполняется`,"qa.status.PASSED":`Пройдено`,"qa.status.FAILED":`Есть ошибки`,"qa.status.ERROR":`Не удалось проверить`,"qa.tree":`Проверенное дерево`,"qa.target":`Адрес приложения`,"qa.environment":`Среда`,"qa.planRevision":`Ревизия плана {revision}`,"qa.matrix":`Матрица сценариев`,"qa.scenarioProgress":`Шагов: {steps} · проверок: {assertions}`,"qa.assertionFailed":`Не пройдено: {title}`,"qa.notRun":`Не измерено`,"qa.observations":`Консоль и сеть`,"qa.observation.CONSOLE":`Консоль`,"qa.observation.NETWORK":`Сеть`,"qa.blocking":`Блокирует`,"qa.defects":`Дефекты QA`,"qa.defectStatus.OPEN":`Открыт`,"qa.defectStatus.RESOLVED":`Исправлен по retest`,"qa.defectStatus.WAIVED":`Риск принят`,"qa.reproduction":`Как воспроизвести`,"qa.waive":`Принять риск`,"qa.waiverReason":`Причина решения владельца`,"qa.waiverReasonPlaceholder":`Объясните, почему дефект не должен войти в следующий fix set…`,"qa.confirmWaive":`Зафиксировать риск`,"qa.correctionTimeline":`История коррекций`,"qa.correction":`Коррекция {ordinal}`,"qa.correctionStatus.ACTIVE":`Активна`,"qa.correctionStatus.PASSED":`Пройдена`,"qa.correctionStatus.SUPERSEDED":`Заменена следующей`,"qa.correctionStatus.EXHAUSTED":`Лимит исчерпан`,"qa.correctionStatus.CANCELLED":`Отменена`,"qa.correctionSource":`Исходная ошибка`,"qa.correctionEvidence":`Исходное доказательство`,"qa.correctionBaseline":`Полный baseline`,"qa.correctionTree":`tree {tree}`,"qa.retestScope":`Зафиксированный retest · ячеек: {count}`,"qa.retestReason.FAILED_CHECK":`ошибка проверки`,"qa.retestReason.BLOCKING_OBSERVATION":`блокирующее наблюдение`,"qa.retestReason.OPEN_DEFECT":`открытый дефект`,"qa.retestReason.REGRESSION":`регрессия`,"qa.resolvedBy":`Подтверждено retest`,"qa.correctionGate.title":`Решение по коррекции QA`,"qa.correctionGate.description":`Коррекция {ordinal} исчерпала ограниченный retest. Выберите следующий аудируемый переход workflow.`,"qa.correctionGate.authorizeFinal":`Разрешить финальную коррекцию`,"qa.correctionGate.cancel":`Отменить поставку`,"qa.attachments":`Файлы проверки`,"qa.attachment.SCREENSHOT":`Снимок экрана`,"qa.attachment.TRACE":`Трассировка Playwright`,"qa.openAttachment":`Открыть файл`,"acceptance.eyebrow":`Решение владельца`,"acceptance.title":`Пакет приёмки`,"acceptance.evidence":`Сохранённые доказательства`,"acceptance.reviewEvidence":`Отчёт ревью`,"acceptance.qaEvidence":`Отчёт QA`,"acceptance.checks":`Проверок: {count}`,"acceptance.evidenceCount":`Отчётов: {count}`,"acceptance.matrix":`Матрица критериев`,"acceptance.noCriteria":`Явные критерии не заданы — проверьте отчёты и описание релиза.`,"acceptance.implementation":`Реализация`,"acceptance.reviewCheck":`Выбранная проверка ревью`,"acceptance.qaCheck":`Выбранная проверка QA`,"acceptance.ownerVerification":`Проверка владельцем`,"acceptance.knownRisk":`Известный риск`,"acceptance.noKnownRisk":`Не зафиксирован`,"acceptance.legacyEvidence":`Legacy-пакет — проверки не привязаны к каждому критерию`,"acceptance.export":`Скачать итоговый отчёт`,"acceptance.accept":`Принять результат`,"acceptance.return":`Вернуть в работу`,"acceptance.reject":`Отклонить`,"acceptance.status.PENDING":`Нужно решение`,"acceptance.status.ACCEPTED":`Принято`,"acceptance.status.RETURNED":`Возвращено`,"acceptance.status.REJECTED":`Отклонено`,"humanRequest.blocking":`Блокирующий запрос`,"humanRequest.request":`Запрос`,"humanRequest.recommendation":`Рекомендация`,"humanRequest.recommended":`Рекомендуется`,"humanRequest.other":`Другое`,"humanRequest.otherPlaceholder":`Опишите, какое направление использовать…`,"humanRequest.answerResume":`Ответить и продолжить`,"humanRequest.chooseAnswer":`Выберите ответ, чтобы продолжить.`,"humanRequest.authorityNotice":`Ответ сохраняет информацию и продолжает работу. Он не выдаёт новых разрешений на файлы, команды, сеть, бюджет или приёмку.`,"attention.title":`Нужно ваше решение`,"attention.count":`{count} блокирующий запрос`,"attention.countMany":`{count} блокирующих запросов`,"attention.inboxTitle":`Требует внимания`,"attention.inboxDescription":`Решения и приёмки из всех проектов в одном месте.`,"attention.listLabel":`Запросы, которые требуют вашего внимания`,"attention.loading":`Загрузка входящих запросов`,"attention.refreshing":`Обновляем…`,"attention.emptyTitle":`Сейчас от вас ничего не требуется`,"attention.emptyDescription":`Новые вопросы и приёмки появятся здесь вместе с контекстом задачи.`,"attention.limitReached":`Показаны первые 200 запросов. Решите один, чтобы увидеть следующие.`,"attention.section.BLOCKING_NOW":`Блокирует работу`,"attention.section.APPROVALS":`На подтверждение`,"attention.section.QUESTIONS":`Вопросы`,"attention.section.MANUAL_ACTIONS":`Ручные действия`,"attention.section.SOON":`Скоро`,"attention.category.APPROVAL":`Подтверждение`,"attention.category.QUESTION":`Вопрос`,"attention.category.MANUAL_ACTION":`Ручное действие`,"attention.fact.category":`Тип`,"attention.fact.priority":`Приоритет`,"attention.fact.stage":`Затронутый этап`,"attention.fact.created":`Ожидает с`,"attention.acceptanceTitle":`Проверьте свидетельства результата`,"attention.acceptanceDescription":`Приёмка остаётся в Task Cockpit: там вместе видны свидетельства, инструкция проверки и точное последствие решения.`,"attention.reviewAcceptance":`Перейти к приёмке`,"attention.openTask":`Открыть контекст задачи`,"fleet.title":`Команда агентов`,"fleet.description":`Активные роли и ожидания планировщика во всех локальных проектах.`,"fleet.capacity":`Активно: {active} из {limit}`,"fleet.loading":`Загрузка команды агентов`,"fleet.refreshing":`Обновляем…`,"fleet.emptyTitle":`Нет задач для агентов`,"fleet.emptyDescription":`Запустите подтверждённую задачу — здесь появятся её роль и состояние.`,"fleet.column.task":`Задача`,"fleet.column.role":`Роль`,"fleet.column.stage":`Этап`,"fleet.column.provider":`Провайдер`,"fleet.column.status":`Состояние`,"fleet.column.since":`С какого времени`,"fleet.column.latestAction":`Последнее действие`,"fleet.notStarted":`Ещё не запущено`,"fleet.noActivity":`Пока нет действий`,"fleet.latestAction.origin.DAEMON_AUDITED":`Проверено`,"fleet.latestAction.origin.PROVIDER_REPORTED":`Со слов провайдера`,"fleet.status.READY":`Готов`,"fleet.status.WAITING":`Ожидает`,"fleet.status.RUNNING":`В работе`,"fleet.role.LEAD_PM":`Ведущий PM`,"fleet.role.PRODUCT_ANALYST":`Продуктовый аналитик`,"fleet.role.SOFTWARE_ARCHITECT":`Архитектор`,"fleet.role.DEVELOPER":`Разработчик`,"fleet.role.CODE_REVIEWER":`Ревьюер`,"fleet.role.BROWSER_QA":`Браузерный QA`,"fleet.role.ACCEPTANCE_MANAGER":`Координатор приёмки`,"fleet.wait.NOT_READY":`Этап ещё не готов`,"fleet.wait.BUDGET_BLOCKED":`Нужно подтвердить бюджет`,"fleet.wait.CHECKPOINT_NOT_STABLE":`Нет стабильного checkpoint`,"fleet.wait.ATTEMPT_ACTIVE":`Эта попытка уже выполняется`,"fleet.wait.GLOBAL_LIMIT":`Все общие слоты заняты`,"fleet.wait.PROJECT_LIMIT":`Слоты этого проекта заняты`,"fleet.wait.PROVIDER_LIMIT":`Слоты этого провайдера заняты`,"fleet.wait.WORKSPACE_CONFLICT":`Рабочая область занята`,"event.created":`Задача создана`,"event.createdDetail":`Добавлена в бэклог проекта.`,"event.updated":`Задача обновлена`,"event.updatedDetail":`Изменено: {fields}.`,"event.dependenciesSet":`Зависимости изменены`,"event.dependenciesSetDetail":`Входящих блокеров: {count}`,"event.stateChanged":`Состояние изменено`,"event.stateChangedDetail":`{from} → {to}`,"event.projectRegistered":`Проект зарегистрирован`,"event.projectScaffoldRequested":`Запрошено создание проекта`,"event.projectScaffoldCompleted":`Проект создан`,"event.projectScaffoldFailed":`Создание проекта остановлено`,"event.providerPreferenceChanged":`ИИ-провайдер изменён`,"event.providerPreferenceChangedDetail":`{from} → {to}`,"event.providerAllowanceRecorded":`Лимит провайдера обновлён`,"event.providerAllowanceRecordedDetail":`{provider} · {freshness}`,"event.mcpProfileConsented":`MCP-команда подтверждена`,"event.mcpProfileConsentedDetail":`{name}, ревизия {revision}`,"event.mcpGrantChanged":`Доступ к MCP tools изменён`,"event.mcpGrantChangedDetail":`Tools: {count} · {state}`,"event.mcpGrant.enabled":`разрешён`,"event.mcpGrant.revoked":`отозван`,"event.constitutionProposed":`Предложена Конституция`,"event.constitutionProposedDetail":`Пресет {preset}@1`,"event.constitutionPublicationRequested":`Запрошена публикация Конституции`,"event.constitutionPublicationRequestedDetail":`Публикуется версия {ordinal}`,"event.constitutionActivated":`Конституция активирована`,"event.constitutionActivatedDetail":`Версия {ordinal} теперь является основной`,"event.constitutionPublicationFailed":`Публикация Конституции не удалась`,"event.verificationPlanAdopted":`Проверки проекта подтверждены`,"event.verificationPlanAdoptedDetail":`Ревизия {revision} · точных команд: {count}`,"event.verificationPlanDisabled":`Проверки проекта отключены`,"event.verificationPlanDisabledDetail":`Ревизия {revision} фиксирует отключённое состояние`,"event.verificationPlanPublicationApplied":`Проверки проекта опубликованы`,"event.verificationPlanPublicationAppliedDetail":`Ревизия {revision} доступна для измеренных запусков`,"event.verificationPlanPublicationFailed":`Публикация проверок проекта не удалась`,"event.verificationPlanPublicationRetried":`Публикация проверок проекта запущена повторно`,"event.verificationPlanPublicationRetriedDetail":`Ревизия {revision} сверяется повторно`,"event.launchPlanChanged":`Локальные launch-gates изменены`,"event.launchPlanChangedDetail":`Ревизия {revision} · {status}`,"event.launchRunChanged":`Локальное launch-измерение изменено`,"event.launchRunChangedDetail":`{status} · tree {tree}`,"event.verificationRunReserved":`Проверка проекта поставлена в очередь`,"event.verificationRunReservedDetail":`Запуск {ordinal} · проверок: {count}`,"event.verificationCheckStarted":`Проверка проекта запущена`,"event.verificationCheckStartedDetail":`Проверка {ordinal}`,"event.verificationCheckCompleted":`Проверка проекта завершена`,"event.verificationCheckCompletedDetail":`Проверка {ordinal} · {status}`,"event.verificationRunInterrupted":`Проверка проекта прервана`,"event.verificationRunInterruptedDetail":`Запуск {ordinal}`,"event.verificationRunCancellationRequested":`Запрошена отмена проверки проекта`,"event.verificationRunCancellationRequestedDetail":`Запуск {ordinal} безопасно останавливается`,"event.verificationFailureRecorded":`Проверка проекта заблокировала поставку`,"event.verificationFailureRecordedDetail":`Измеренная причина: {reason}`,"event.verificationCorrectionStarted":`Запущено исправление проверки проекта`,"event.verificationCorrectionStartedDetail":`Исправление {ordinal} возвращено в реализацию`,"event.verificationCorrectionPassed":`Исправление проверки проекта подтверждено`,"event.verificationCorrectionPassedDetail":`Исправление {ordinal} прошло свежий повторный прогон`,"event.verificationCorrectionSuperseded":`Исправление проверки проекта заменено следующим`,"event.verificationCorrectionSupersededDetail":`Исправление {ordinal} не прошло измеряемые проверки`,"event.verificationCorrectionExhausted":`По исправлению проверки нужно решение`,"event.verificationCorrectionExhaustedDetail":`Исправление {ordinal} исчерпало автоматический лимит`,"event.verificationCorrectionCancelled":`Исправление проверки проекта отменено`,"event.verificationCorrectionCancelledDetail":`Исправление {ordinal} остановлено без приёмки`,"verification.failure.REQUIRED_CHECK_FAILED":`обязательная проверка не прошла`,"verification.failure.REQUIRED_CHECK_ERROR":`ошибка обязательной проверки`,"verification.failure.RUN_INTERRUPTED":`запуск прерван`,"verification.failure.STALE":`доказательство устарело`,"event.readinessAssessed":`Готовность проекта проверена`,"event.readinessAssessedDetail":`Пунктов требуют действий: {count}`,"event.readinessAttested":`Решение по готовности сохранено`,"event.readinessAttestedDetail":`{check}: {outcome}`,"event.pipelineStarted":`Процесс запущен`,"event.pipelineStartedDetail":`Процесс поставки перешёл к этапу «{stage}».`,"event.stageChanged":`Этап обновлён`,"event.stageChangedDetail":`{stage}: {status}`,"event.humanRequestOpened":`Требуется решение`,"event.humanRequestOpenedDetail":`{title}`,"event.humanRequestResolved":`Решение сохранено`,"event.humanRequestResolvedDetail":`Ответ владельца сохранён в журнале.`,"event.usageRecorded":`Расход записан`,"event.usageRecordedDetail":`+{amount} оценочных токенов · всего {total}`,"event.budgetThreshold":`Достигнут порог бюджета`,"event.budgetThresholdDetail":`{threshold}% · {total} оценочных токенов`,"event.pipelinePaused":`Процесс приостановлен`,"event.pipelinePausedDetail":`Пауза {kind} на этапе «{stage}»`,"event.pipelineResumed":`Процесс продолжен`,"event.pipelineResumedDetail":`Продолжен этап «{stage}»`,"event.pipelineCancelled":`Процесс отменён`,"event.pipelineCancelledDetail":`Выполнение остановлено на этапе «{stage}»`,"event.budgetOverride":`Новый бюджет одобрен`,"event.budgetOverrideDetail":`Ревизия {revision} · {limit} оценочных токенов`,"event.recoveryCreated":`Процесс восстановлен`,"event.recoveryCreatedDetail":`Незавершённая попытка этапа «{stage}» помечена прерванной.`,"event.evidenceRecorded":`Доказательство сохранено`,"event.evidenceRecordedDetail":`{title}`,"event.reviewReportRecorded":`Независимое ревью сохранено`,"event.reviewReportRecordedDetail":`Раунд {round} · {verdict}`,"event.reviewFindingRecorded":`Замечание ревью открыто`,"event.reviewFindingResolved":`Замечание ревью закрыто`,"event.reviewLoopExhausted":`Review-loop ждёт решения`,"event.reviewLoopExhaustedDetail":`Раунд {round} исчерпал автоматический лимит`,"event.acceptanceRequested":`Требуется приёмка владельца`,"event.acceptanceRequestedDetail":`Отчёты ревью и QA готовы для финального решения.`,"event.acceptanceResolved":`Приёмка завершена`,"event.acceptanceResolvedDetail":`Решение владельца: {action}`,"event.pipelineCompleted":`Процесс завершён`,"event.pipelineCompletedDetail":`Ограниченный процесс поставки завершён.`,"event.squadAssigned":`Команда агентов назначена`,"event.squadAssignedDetail":`Ролей с точной версией профиля: {count}`,"event.agentRunStarted":`Запуск агента начат`,"event.agentRunStartedDetail":`{role} · {provider}`,"event.agentRunFinished":`Запуск агента завершён`,"event.agentRunFinishedDetail":`{role} · {status}`,"event.qaRunReserved":`Browser QA зарезервирован`,"event.qaRunReservedDetail":`Playwright · целей: {targets} · сценариев: {scenarios}`,"event.qaRunCompleted":`Browser QA завершён`,"event.qaRunCompletedDetail":`{status} · дефектов: {defects}`,"event.qaDefectWaived":`Риск QA-дефекта принят`,"event.qaCorrectionStarted":`Запущено исправление QA`,"event.qaCorrectionStartedDetail":`Исправление {ordinal} · retest-ячеек: {cells}`,"event.qaCorrectionExhausted":`Лимит исправлений QA исчерпан`,"event.qaCorrectionExhaustedDetail":`Исправлению {ordinal} нужно решение владельца`,"event.qaCorrectionPassed":`Исправление QA прошло проверку`,"event.qaCorrectionPassedDetail":`Исправление {ordinal} закрыло дефектов: {defects}`,"event.qaCorrectionCancelled":`Исправление QA отменено`,"event.qaCorrectionCancelledDetail":`Исправление {ordinal} остановлено без приёмки`,"agentRun.status.RUNNING":`В работе`,"agentRun.status.SUCCEEDED":`Успешно`,"agentRun.status.FAILED":`Ошибка`,"agentRun.status.CANCELLED":`Отменён`,"agentRun.status.INTERRUPTED":`Прерван`,"agentRun.status.WAITING_HUMAN":`Ожидает владельца`,"agentRun.status.SOFT_PAUSED":`Мягкая пауза`,"agentRun.status.HARD_PAUSED":`Жёсткая пауза`,"event.providerSessionStarted":`Сессия агента начата`,"event.providerSessionStartedDetail":`Сессия {ordinal}`,"event.checkpointPublished":`Checkpoint опубликован`,"event.checkpointPublishedDetail":`{summary}`,"event.contextHandoffRequested":`Запрошена передача`,"event.contextHandoffRequestedDetail":`Сессия {ordinal} сворачивается`,"event.providerSessionEnded":`Сессия агента завершена`,"event.providerSessionEndedDetail":`{reason}`,"event.contextFloorExceeded":`Обязательный контекст не поместился`,"event.contextFloorExceededDetail":`Сессии {ordinal} нужно {requiredBytes} байт из {budgetBytes}`,"event.workspaceCreated":`Рабочая область создана`,"event.workspaceCreatedDetail":`{mode} · ветка {branch} · перенесено файлов: {count}`,"event.workspaceStrategyChanged":`Режим рабочей папки изменён`,"event.workspaceStrategyChangedDetail":`Новые рабочие области используют: {mode}`,"event.workspaceOrphaned":`Рабочая область осиротела`,"event.workspaceOrphanedDetail":`Worktree отсутствует или может быть удалён`,"workspaceTool.operation.LIST_DIRECTORY":`Просмотр папки`,"workspaceTool.operation.READ_FILE":`Чтение файла`,"workspaceTool.operation.WRITE_FILE":`Изменение файла`,"workspaceTool.operation.EDIT_FILE":`Точное редактирование файла`,"workspaceTool.operation.DELETE_FILE":`Удаление файла`,"workspaceTool.operation.RUN_RECIPE":`Запуск утверждённой проверки`,"workspaceTool.status.STARTED":`Выполняется`,"workspaceTool.status.SUCCEEDED":`Успешно`,"workspaceTool.status.DENIED":`Заблокировано политикой безопасности`,"workspaceTool.status.APPROVAL_REQUIRED":`Нужно разрешение или подтверждение`,"workspaceTool.status.FAILED":`Ошибка`,"workspaceTool.status.UNKNOWN_OUTCOME":`Результат неизвестен после перезапуска`,"runActivity.title":`Run Activity`,"runActivity.explainer":`Действия, проверенные Loomrail, прошли через собственный шлюз демона и хранятся постоянно. Действия со слов провайдера — его собственный отчёт о себе: ничем не проверен и хранится ограниченное время.`,"runActivity.origin.DAEMON_AUDITED":`Проверено Loomrail`,"runActivity.origin.PROVIDER_REPORTED":`Со слов провайдера`,"runActivity.kind.TOOL_CALL":`Вызов инструмента`,"runActivity.kind.AGENT_TEXT":`Заметка агента`,"runActivity.kind.FILE_CHANGE":`Изменение файла`,"runActivity.kind.PROVIDER_ERROR":`Ошибка провайдера`,"runActivity.count":`{count}`,"runActivity.countMore":`{count}+`,"runActivity.loading":`Загружаем действия агента…`,"runActivity.noActivity":`Действий агента пока не записано.`,"runActivity.latestApproximate":`возможна более новая активность`,"runActivity.untitled":`Действие`,"runActivity.truncated":`Обрезано`,"runActivity.degradedBadge":`Неполно`,"runActivity.degraded":`Эта лента неполна: часть происходившего по этой задаче в неё не попала.`,"runActivity.gap":`Список может быть неполным: Loomrail не может подтвердить, что здесь показаны все записанные действия этой задачи.`,"runActivity.omitted":`{count} более ранних записей были отброшены из-за ограниченного хранения.`,"runActivity.loadMore":`Показать ещё`,"field.title":`название`,"field.description":`описание`,"field.priority":`приоритет`,"field.risk":`риск`,"field.acceptanceCriteria":`критерии приёмки`}},Hh=e=>e===`en`||e===`ru`,Uh=()=>{let e=window.localStorage.getItem(Bh);return Hh(e)?e:window.navigator.language.toLowerCase().startsWith(`ru`)?`ru`:`en`},Wh=e=>{window.localStorage.setItem(Bh,e),document.documentElement.lang=e},Gh=(e,t,n={})=>Object.entries(n).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,String(n)),Vh[e][t]),Kh=(0,M.createContext)(null),qh=({children:e})=>{let[t,n]=(0,M.useState)(()=>{let e=Uh();return Wh(e),e}),r=(0,M.useMemo)(()=>({locale:t,setLocale:e=>{Wh(e),n(e)},t:(e,n)=>Gh(t,e,n)}),[t]);return(0,G.jsx)(Kh.Provider,{value:r,children:e})},Z=()=>{let e=(0,M.useContext)(Kh);if(!e)throw Error(`useI18n must be rendered inside I18nProvider`);return e},Jh=[`sidebar`,`inspector`],Yh={sidebar:{defaultWidth:240,max:360,min:200,property:`--lr-size-sidebar`},inspector:{defaultWidth:344,max:520,min:280,property:`--lr-size-inspector`}},Xh=e=>`loomrail-panel-${e}`,Zh=(e,t)=>{let{max:n,min:r}=Yh[e];return Number.isFinite(t)?Math.min(n,Math.max(r,Math.round(t))):Yh[e].defaultWidth},Qh=e=>{let t=window.localStorage.getItem(Xh(e));return t===null?Yh[e].defaultWidth:Zh(e,Number(t))},$h=(e,t)=>{let{defaultWidth:n,property:r}=Yh[e],i=Zh(e,t);if(i===n){document.documentElement.style.removeProperty(r),window.localStorage.removeItem(Xh(e));return}document.documentElement.style.setProperty(r,`${i.toString()}px`),window.localStorage.setItem(Xh(e),i.toString())},eg=()=>{for(let e of Jh)$h(e,Yh[e].defaultWidth)},tg=()=>Jh.some(e=>window.localStorage.getItem(Xh(e))!==null),ng=16,rg=({edge:e,panel:t})=>{let{t:n}=Z(),[r,i]=(0,M.useState)(()=>Qh(t)),[a,o]=(0,M.useState)(!1),{max:s,min:c}=Yh[t];(0,M.useEffect)(()=>{if(!a)return;let n=n=>{let r=Zh(t,e===`start`?n.clientX:window.innerWidth-n.clientX);i(r),$h(t,r)},r=()=>{o(!1)};return document.body.classList.add(`is-resizing`),window.addEventListener(`pointermove`,n),window.addEventListener(`pointerup`,r),window.addEventListener(`pointercancel`,r),window.addEventListener(`blur`,r),()=>{document.body.classList.remove(`is-resizing`),window.removeEventListener(`pointermove`,n),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,r),window.removeEventListener(`blur`,r)}},[a,e,t]);let l=e=>{let n=Zh(t,r+e);i(n),$h(t,n)};return(0,G.jsx)(`div`,{"aria-label":n(`layout.resize.${t}`),"aria-orientation":`vertical`,"aria-valuemax":s,"aria-valuemin":c,"aria-valuenow":r,className:`panel-resizer`,onDoubleClick:()=>{let{defaultWidth:e}=Yh[t];i(e),$h(t,e)},onKeyDown:t=>{let n=e===`start`?`ArrowRight`:`ArrowLeft`,r=e===`start`?`ArrowLeft`:`ArrowRight`;(t.key===n||t.key===r)&&(t.preventDefault(),l(t.key===n?ng:-16))},onPointerDown:e=>{e.preventDefault(),i(Qh(t)),o(!0)},role:`separator`,tabIndex:0})},ig=`loomrail.csrf-token`,ag=class extends Error{code;correlationId;recovery;status;constructor({code:e,correlationId:t,message:n,recovery:r,status:i}){super(n),this.name=`LocalApiError`,this.code=e,this.correlationId=t,this.recovery=r,this.status=i}},og=(e,t)=>[`BOOTSTRAP_REJECTED`,`CSRF_REJECTED`,`SESSION_REQUIRED`].includes(e)?`reopen`:t===0||t>=500?`retry`:`none`,sg=async e=>{let t=await e.json().catch(()=>void 0),n=Nm.safeParse(t);return n.success?new ag({code:n.data.error.code,correlationId:n.data.error.correlationId,message:n.data.error.message,recovery:og(n.data.error.code,e.status),status:e.status}):new ag({code:`LOCAL_API_ERROR`,message:`Local daemon returned HTTP ${e.status.toString()}`,recovery:og(`LOCAL_API_ERROR`,e.status),status:e.status})},cg=e=>e instanceof ag,lg=()=>new ag({code:`LOCAL_DAEMON_UNAVAILABLE`,message:`The local Loomrail daemon could not be reached`,recovery:`retry`,status:0}),ug=()=>window.sessionStorage.getItem(ig)??void 0,dg=e=>{window.sessionStorage.setItem(ig,e)},fg=async(e,t={},n=`application/json`)=>{let r=(t.method??`GET`).toUpperCase(),i=new Headers(t.headers);if(i.set(`accept`,n),t.body!==void 0&&i.set(`content-type`,`application/json`),![`GET`,`HEAD`,`OPTIONS`].includes(r)){let e=ug();if(!e)throw new ag({code:`LOCAL_SESSION_REQUIRED`,message:`The local session must be reopened before changing data`,recovery:`reopen`,status:0});i.set(`x-loomrail-csrf`,e)}let a;try{a=await fetch(e,{...t,credentials:`same-origin`,headers:i})}catch{throw lg()}if(!a.ok)throw await sg(a);return a},Q=async(e,t,n={})=>{let r=await fg(e,n);return t.parse(await r.json())},pg=async()=>Q(`/api/v1/projects`,dm),mg=async()=>Q(`/api/v1/insights`,km),hg=async()=>Q(`/api/v1/constitution-presets`,Td),gg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/constitution`,uf),_g=async(e,t)=>{let n=await Q(`/api/v1/projects/${encodeURIComponent(e.id)}/constitution/scan`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.version,...t===void 0?{}:{presetId:t}})});if(n.type!==`PROJECT_CONSTITUTION_PROPOSED`)throw Error(`The local daemon returned an unexpected Constitution Proposal result`);return n.proposal},vg=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e.id)}/constitution/adopt`,uf,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),proposalId:t.id,expectedProjectVersion:e.version,expectedProposalVersion:t.version})}),yg=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/constitution/publication/retry`,uf,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),publicationId:t.id,expectedVersion:t.version})}),bg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/verification-plan`,Or),xg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/verification-plan/adopt`,Or,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.projectVersion,proposalHash:e.proposal.proposalHash})}),Sg=async e=>{if(e.plan===null)throw Error(`A current verification Plan is required before it can be disabled`);return Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/verification-plan/disable`,Or,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.projectVersion,expectedPlanRevision:e.plan.revision,expectedPlanContentHash:e.plan.contentHash})})},Cg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/launch-measurement`,nu),wg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.snapshot.projectId)}/launch-measurement/plan`,nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.snapshot.projectVersion,configuration:e.configuration})}),Tg=async e=>{if(e.snapshot.plan===null)throw Error(`An active launch measurement Plan is required`);return Q(`/api/v1/projects/${encodeURIComponent(e.snapshot.projectId)}/launch-measurement/plan/disable`,nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.snapshot.projectVersion,expectedPlanRevision:e.snapshot.plan.revision,expectedPlanContentHash:e.snapshot.plan.contentHash})})},Eg=async e=>{if(e.snapshot.plan===null)throw Error(`An active launch measurement Plan is required`);return Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/launch-measurement/runs`,nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedPlanRevision:e.snapshot.plan.revision,expectedPlanContentHash:e.snapshot.plan.contentHash})})},Dg=async e=>Q(`/api/v1/launch-measurement-runs/${encodeURIComponent(e.run.id)}/cancel`,nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.run.version})}),Og=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/launch-release`,Nu),kg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.snapshot.projectId)}/launch-release/environments`,Nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.snapshot.projectVersion,environmentId:e.environment?.id??null,expectedEnvironmentVersion:e.environment?.version??null,configuration:e.configuration})}),Ag=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.snapshot.projectId)}/launch-release/releases`,Nu,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.snapshot.projectVersion,environmentId:e.environment.id,expectedEnvironmentVersion:e.environment.version,expectedEnvironmentContentHash:e.environment.contentHash,workItemIds:e.workItemIds})}),jg=async e=>Q(`/api/v1/launch-releases/${encodeURIComponent(e)}/evidence-package`,Pu),Mg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/guided-deployment`,hd),Ng=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/guided-deployment/preview?releaseId=${encodeURIComponent(t)}`,md),Pg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.preview.projectId)}/guided-deployment/plans`,hd,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.preview.projectVersion,releaseId:e.preview.releaseId,expectedReleaseContentHash:e.preview.releaseContentHash})}),Fg=async e=>Q(`/api/v1/deployments/${encodeURIComponent(e.deployment.id)}/approve`,hd,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.deployment.version,approvalDigest:e.deployment.approvalDigest})}),Ig=async e=>Q(`/api/v1/deployments/${encodeURIComponent(e.id)}/start`,hd,{method:`POST`,body:JSON.stringify({schemaVersion:1})}),Lg=async e=>Q(`/api/v1/deployments/${encodeURIComponent(e.id)}/observe`,hd,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID()})}),Rg=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/verification-plan/publication/retry`,Or,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),publicationId:t.id,expectedVersion:t.version})}),zg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/readiness`,Df),Bg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e.id)}/readiness/run`,Df,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.version})}),Vg=async(e,t,n,r,i)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/readiness/attest`,Df,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),runId:t.id,checkId:n.id,expectedRunVersion:t.version,outcome:r,rationale:i})}),Hg=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/work-items`,fm),Ug=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/work-item-dependencies`,Sd),Wg=async(e,t,n)=>Q(`/api/v1/events?${new URLSearchParams({aggregateId:t,limit:`30`,order:`DESC`,projectId:e,...n===void 0?{}:{before:n.toString()}}).toString()}`,pm),Gg=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/workflow`,Sc),Kg=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/verification-runs`,Ci),qg=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e.workItem.id)}/verification-runs`,Si,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedWorkItemVersion:e.workItem.version,expectedPlanRevision:e.plan.revision,expectedPlanContentHash:e.plan.contentHash,...e.retryOf===void 0?{}:{retryOfRunId:e.retryOf.id,expectedRetryOfRunVersion:e.retryOf.version}})}),Jg=async e=>Q(`/api/v1/verification-runs/${encodeURIComponent(e.id)}/cancel`,Si,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version})}),Yg=async e=>(await fg(`/api/v1/verification-checks/${encodeURIComponent(e)}/output`,{},`text/plain`)).text(),Xg=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/workspace`,hn),Zg=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/changes`,Sn),Qg=async(e,t)=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/changes/diff?path=${encodeURIComponent(t)}`,Cn),$g=async e=>Q(`/api/v1/stage-attempts/${encodeURIComponent(e)}/sessions`,wc),e_=async()=>Q(`/api/v1/provider/capabilities`,Tc),t_=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/provider-selection`,Ic),n_=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/workspace-strategy`,Gt),r_=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/workspace-strategy`,Gt,{method:`PUT`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.projectVersion,strategy:t})}),i_=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e.id)}/provider-selection`,Ic,{method:`PUT`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.version,preference:t})}),a_=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/provider-selection/refresh`,Ic,{method:`POST`,body:JSON.stringify({schemaVersion:1})}),o_=async e=>Q(`/api/v1/provider/allowance?projectId=${encodeURIComponent(e)}`,Kf),s_=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/provider-allowance/refresh`,Kf,{method:`POST`,body:JSON.stringify({schemaVersion:1})}),c_=async e=>Q(`/api/v1/projects/${encodeURIComponent(e)}/mcp-profiles`,kt),l_=async(e,t,n)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/mcp-profile-proposals`,nt,{method:`POST`,body:JSON.stringify({schemaVersion:1,expectedProjectVersion:t,candidate:n})}),u_=async(e,t)=>Q(`/api/v1/projects/${encodeURIComponent(e)}/mcp-presets/context7/proposal`,nt,{method:`POST`,body:JSON.stringify({schemaVersion:1,expectedProjectVersion:t})}),d_=async e=>{let t=await Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/mcp-profile-proposals/${encodeURIComponent(e.challengeId)}/confirm`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.expectedProjectVersion,challengeId:e.challengeId,canonicalDigest:e.canonicalDigest})});if(t.type!==`MCP_PROFILE_CONSENTED`)throw Error(`The local daemon returned an unexpected MCP consent result`);return t},f_=async(e,t)=>{let n=await Q(`/api/v1/projects/${encodeURIComponent(e)}/mcp-profiles/${encodeURIComponent(t.id)}/probe`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID()})});if(n.type!==`MCP_CAPABILITY_RECORDED`)throw Error(`The local daemon returned an unexpected MCP probe result`);return n.snapshot},p_=async e=>{let t=await Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/mcp-profiles/${encodeURIComponent(e.revision.id)}/grant`,cm,{method:`PUT`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.expectedProjectVersion,expectedGrantVersion:e.expectedGrantVersion,tools:e.tools,ownerAttestsReadOnly:!0})});if(t.type!==`MCP_GRANT_CHANGED`)throw Error(`The local daemon returned an unexpected MCP grant result`);return t},m_=async e=>{let t=await Q(`/api/v1/projects/${encodeURIComponent(e.projectId)}/mcp-profiles/${encodeURIComponent(e.revision.id)}/grant`,cm,{method:`DELETE`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedProjectVersion:e.expectedProjectVersion,expectedGrantVersion:e.expectedGrantVersion})});if(t.type!==`MCP_GRANT_CHANGED`)throw Error(`The local daemon returned an unexpected MCP revoke result`);return t},h_=async e=>Q(`/api/v1/human-requests?${new URLSearchParams({projectId:e,status:`OPEN`}).toString()}`,Cc),g_=async()=>Q(`/api/v1/attention`,ym),__=async()=>Q(`/api/v1/agent-fleet`,vl),v_=async(e,t)=>{let n=t===void 0?``:`?after=${encodeURIComponent(t)}`;return Q(`/api/v1/work-items/${encodeURIComponent(e)}/activity${n}`,Wc)},y_=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/reviews`,Bn),b_=async e=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/qa`,Ka),x_=(e,t)=>`/api/v1/work-items/${encodeURIComponent(e)}/qa/attachments/${encodeURIComponent(t)}`,S_=(e,t)=>`/api/v1/work-items/${encodeURIComponent(e)}/acceptance/${encodeURIComponent(t)}/export`,C_=async e=>{await Q(`/api/v1/projects/fixtures/register`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),fixtureId:e})})},w_=async e=>{await Q(`/api/v1/projects/register`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),repositoryPath:e})})},T_=async e=>(await Q(`/api/v1/scaffolds/propose`,yp,{method:`POST`,body:JSON.stringify({schemaVersion:1,recipeId:`typescript-node`,targetPath:e})})).proposal,E_=async()=>(await Q(`/api/v1/scaffolds`,xp)).operations,D_=async e=>{let t=await Q(`/api/v1/scaffolds/publish`,bp,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),proposal:e})});if(t.operation===null)throw Error(`The local daemon did not return the scaffold operation`);return t.operation},O_=async e=>{let t=await Q(`/api/v1/scaffolds/${encodeURIComponent(e.id)}/retry`,bp,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version})});if(t.operation===null)throw Error(`The local daemon did not return the scaffold operation`);return t.operation},k_=async(e,t=crypto.randomUUID())=>{let n=await Q(`/api/v1/work-items`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:t,projectId:e.projectId,parentId:e.parentId??null,type:e.type,title:e.title,description:e.description,priority:e.priority,risk:e.risk,acceptanceCriteria:e.acceptanceCriteria})});if(n.type!==`WORK_ITEM_CREATED`)throw Error(`The local daemon returned an unexpected create result`);return n.workItem},A_=async(e,t)=>{let n=await Q(`/api/v1/work-items/${encodeURIComponent(e.id)}/dependencies`,cm,{method:`PUT`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,blockerWorkItemIds:t})});if(n.type!==`WORK_ITEM_DEPENDENCIES_SET`)throw Error(`The local daemon returned an unexpected dependency result`);return n.dependencies},j_=async e=>{let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(`${Sm.createCommandId}:${e}`)),n=Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``);return`${Sm.createCommandId}:${n}`},M_=async e=>k_({...Sm.task,projectId:e},await j_(e)),N_=async(e,t)=>{let n=await Q(`/api/v1/work-items/${encodeURIComponent(e.id)}/move`,cm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,targetState:t})});if(n.type!==`WORK_ITEM_MOVED`)throw Error(`The local daemon returned an unexpected move result`);return n.workItem},P_=async(e,t)=>{let n=await Q(`/api/v1/work-items/${encodeURIComponent(e.id)}`,cm,{method:`PATCH`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,patch:t})});if(n.type!==`WORK_ITEM_UPDATED`)throw Error(`The local daemon returned an unexpected update result`);return n.workItem},F_=async(e,t)=>Q(`/api/v1/work-items/${encodeURIComponent(e.id)}/pipeline/start`,Sc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,maxEstimatedTokens:t.maxEstimatedTokens,modelTierOverride:t.modelTierOverride,agentRunMaxEstimatedTokensOverride:t.agentRunMaxEstimatedTokensOverride})}),I_=async(e,t)=>Q(`/api/v1/human-requests/${encodeURIComponent(e.id)}/answer`,Sc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,answer:t})}),L_=async(e,t,n)=>(await Q(`/api/v1/review-findings/${encodeURIComponent(e.id)}/disposition`,sm,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,disposition:t,reason:n})})).finding,R_=async(e,t)=>(await Q(`/api/v1/qa-defects/${encodeURIComponent(e.id)}/waive`,Ga,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:e.version,reason:t})})).defect,z_=async(e,t,n,r)=>Q(`/api/v1/work-items/${encodeURIComponent(e.workItemId)}/qa/correction-gate/${encodeURIComponent(e.id)}`,ac,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedRequestVersion:e.version,correctionRunId:t?.id??null,expectedCorrectionVersion:t?.version??null,expectedPipelineRunVersion:n.version,action:r})}),B_=async(e,t,n,r,i)=>Q(`/api/v1/work-items/${encodeURIComponent(e.workItemId)}/verification/correction-gate/${encodeURIComponent(e.id)}`,oc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedRequestVersion:e.version,correctionRunId:t?.id??null,expectedCorrectionVersion:t?.version??null,qaCorrectionRunId:n?.id??null,expectedQACorrectionVersion:n?.version??null,expectedPipelineRunVersion:r.version,action:i})}),V_=async(e,t,n)=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/pipeline/${n}`,Sc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:t.version})}),H_=async(e,t,n,r,i)=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/pipeline/budget-override`,Sc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:t.version,maxEstimatedTokens:n,modelTierOverride:r,agentRunMaxEstimatedTokensOverride:i})}),U_=async(e,t,n,r,i=null)=>Q(`/api/v1/work-items/${encodeURIComponent(e)}/acceptance/${encodeURIComponent(n.id)}/resolve`,Sc,{method:`POST`,body:JSON.stringify({schemaVersion:1,commandId:crypto.randomUUID(),expectedVersion:n.version,expectedRunVersion:t.version,action:r,reason:i})}),W_=e=>e instanceof Error?e.message:`The local operation could not be completed`,$=({error:e,onRetry:t,retrying:n=!1})=>{let{t:r}=Z(),i=cg(e)?e.recovery:`none`;if(i===`none`)return(0,G.jsx)(`p`,{className:`local-operation-error`,role:`alert`,children:W_(e)});let a=i===`reopen`;return(0,G.jsxs)(`section`,{className:`local-connection-recovery`,role:`alert`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`local-connection-recovery__icon`,children:(0,G.jsx)(K,{name:a?`terminal`:`warning`,size:16})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:r(a?`connection.recovery.reopenTitle`:`connection.recovery.retryTitle`)}),(0,G.jsx)(`p`,{children:r(a?`connection.recovery.reopenDescription`:`connection.recovery.retryDescription`)}),a?(0,G.jsxs)(`div`,{className:`local-connection-recovery__command`,children:[(0,G.jsx)(`span`,{children:r(`connection.recovery.command`)}),(0,G.jsx)(`code`,{children:`npx loomrail`})]}):null]}),!a&&t?(0,G.jsx)(J,{loading:n,onClick:t,size:`sm`,variant:`secondary`,children:r(`connection.recovery.retryAction`)}):null]})},G_=null,K_=async e=>{let t;try{t=await fetch(`/api/session/exchange`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({bootstrapToken:e})})}catch{throw lg()}if(!t.ok)throw await sg(t);dg(jm.parse(await t.json()).csrfToken)},q_=async()=>Q(`/api/v1/status`,Mm),J_=s({queryKey:[`local-daemon`,`connection`],queryFn:async()=>{try{let e=new URLSearchParams(window.location.hash.slice(1)).get(`bootstrap`);return e&&(G_=e,window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}`)),G_&&=(await K_(G_),null),{status:`connected`,daemon:await q_()}}catch(e){cg(e)&&e.recovery!==`retry`&&(G_=null);let t=e instanceof Error?e:Error(`Could not connect to Loomrail`);return{status:`error`,error:t,message:t.message}}},staleTime:1/0}),Y_=1600,X_=(e,t=Y_)=>{let n,r=(()=>{n??=setTimeout(()=>{n=void 0,Promise.resolve().then(e).catch(()=>void 0)},t)});return r.dispose=()=>{n!==void 0&&clearTimeout(n),n=void 0},r},Z_={ADDED:`changes.status.ADDED`,MODIFIED:`changes.status.MODIFIED`,DELETED:`changes.status.DELETED`,RENAMED:`changes.status.RENAMED`},Q_={ADDED:`success`,MODIFIED:`info`,DELETED:`danger`,RENAMED:`accent`},$_={WORKSPACE_WORKTREE_MISSING:`changes.error.WORKSPACE_WORKTREE_MISSING`,WORKSPACE_WORKTREE_UNREADABLE:`changes.error.WORKSPACE_WORKTREE_UNREADABLE`,WORKSPACE_HAS_NO_BASELINE:`changes.error.WORKSPACE_HAS_NO_BASELINE`,CHANGES_UNREADABLE:`changes.error.CHANGES_UNREADABLE`,GIT_UNAVAILABLE:`changes.error.GIT_UNAVAILABLE`,PATH_OUTSIDE_WORKSPACE:`changes.error.PATH_OUTSIDE_WORKSPACE`,PATH_NOT_A_FILE:`changes.error.PATH_NOT_A_FILE`,PATH_UNRESOLVABLE:`changes.error.PATH_UNRESOLVABLE`},ev=e=>(cg(e)?$_[e.code]:void 0)??`changes.error.other`,tv=e=>{switch(e.aggregateType){case`WORK_ITEM`:return[[`attention`],[`agent-fleet`],[`projects`,e.projectId,`work-items`],[`projects`,e.projectId,`human-requests`],[`work-items`,e.aggregateId],[`stage-attempts`]];case`PROJECT`:return[[`attention`],[`agent-fleet`],[`projects`,e.projectId],[`projects`]];default:{let t=e.aggregateType;throw Error(`Unhandled event signal aggregate type: ${String(t)}`)}}},nv=(e,t=50)=>{let n=new Map,r,i=()=>{r=void 0;let t=[...n.values()];n.clear(),t.length>0&&e(t)};return{push:e=>{for(let t of tv(e))n.set(t.join(`/`),t);r??=setTimeout(i,t)},dispose:()=>{r!==void 0&&clearTimeout(r),r=void 0,n.clear()}}},rv=2,iv=[`local-daemon`,`connection`],av=e=>e===`closed`?[iv]:[],ov=e=>{let t=nv(e.invalidateScopes,e.windowMs),n=t=>{let n=av(t);n.length>0&&e.invalidateScopes(n),t===`closed`&&e.onClosed?.()};return e.source.onopen=()=>{n(`live`),e.invalidateAll()},e.source.onmessage=e=>{let n;try{n=JSON.parse(e.data)}catch{return}let r=Am.safeParse(n);r.success&&t.push(r.data)},e.source.onerror=()=>{n(e.source.readyState===rv?`closed`:`connecting`)},()=>{t.dispose(),e.source.close()}},sv=5e3,cv=(e,t)=>t.every((t,n)=>e[n]===t),lv=(e,t)=>e[0]===`work-items`&&e[1]===t&&e[2]===`changes`,uv=(e,t)=>{if(!cv(e,t))return!1;let n=t.length===2&&t[0]===`work-items`?t[1]:void 0;return n===void 0||!lv(e,n)},dv=(e,t=Y_)=>{let n=new Map,r=()=>{for(let e of n.values())e.dispose();n.clear()},i=r=>{let i=n.get(r);i||(i=X_(async()=>{n.delete(r),await e.invalidateQueries({queryKey:[`work-items`,r,`changes`],refetchType:`active`})},t),n.set(r,i)),i()};return{invalidateAll:()=>{r(),e.invalidateQueries()},invalidateScopes:t=>{for(let n of t){let t=n.length===2&&n[0]===`work-items`?n[1]:void 0;if(t!==void 0){e.invalidateQueries({predicate:e=>uv(e.queryKey,n)}),i(t);continue}e.invalidateQueries({queryKey:n})}},dispose:r}},fv=e=>{let t=c(),[n,r]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!e)return;let n=new EventSource(`/api/v1/stream`),i=dv(t),a,o=ov({source:n,invalidateAll:i.invalidateAll,invalidateScopes:i.invalidateScopes,onClosed:()=>{a??=setTimeout(()=>{r(e=>e+1)},sv)}});return()=>{a!==void 0&&clearTimeout(a),o(),i.dispose()}},[e,t,n])},pv=[`projects`],mv=[`attention`],hv=[`agent-fleet`],gv=[`insights`],_v=[`constitution-presets`],vv=e=>[`projects`,e,`constitution`],yv=e=>[`projects`,e,`readiness`],bv=e=>[`projects`,e,`verification-plan`],xv=e=>[`projects`,e,`launch-measurement`],Sv=e=>[`projects`,e,`launch-release`],Cv=e=>[`projects`,e,`guided-deployment`],wv=(e,t)=>[`projects`,e,`guided-deployment`,`preview`,t],Tv=e=>[`projects`,e,`work-items`],Ev=e=>[`projects`,e,`work-items`,`dependencies`],Dv=(e,t)=>[`projects`,e,`work-items`,t,`events`],Ov=e=>[`work-items`,e,`activity`],kv=e=>[`work-items`,e,`workflow`],Av=e=>[`work-items`,e,`verification-runs`],jv=e=>[`work-items`,e,`reviews`],Mv=e=>[`work-items`,e,`qa`],Nv=e=>[`work-items`,e,`workspace`],Pv=e=>[`work-items`,e,`changes`],Fv=(e,t)=>[`work-items`,e,`changes`,`diff`,t],Iv=e=>[`projects`,e,`human-requests`,`OPEN`],Lv=e=>[`stage-attempts`,e,`sessions`],Rv=[`provider`,`capabilities`],zv=e=>[`projects`,e,`provider-selection`],Bv=e=>[`projects`,e,`workspace-strategy`],Vv=e=>[`projects`,e,`provider-allowance`],Hv=e=>[`projects`,e,`mcp-profiles`],Uv=[`project-scaffolds`,`open`],Wv=(0,M.createContext)(null),Gv=({children:e})=>{let t=h(J_),n=t.data?.status===`connected`,r=h({queryKey:pv,queryFn:pg,enabled:n}),[i,a]=(0,M.useState)(null),o=r.data?.projects??[],s=o.find(e=>e.id===i)??o.at(0)??null;fv(n);let c=(0,M.useMemo)(()=>({connection:t.data,connectionPending:t.isPending,error:t.data?.status===`error`?t.data.error:t.error instanceof Error?t.error:r.error instanceof Error?r.error:null,projects:o,projectsPending:n&&r.isPending,retryConnection:()=>{t.refetch().then(e=>{e.data?.status===`connected`&&r.refetch()})},selectedProject:s,selectProject:a}),[n,t.data,t.error,t.isPending,t.refetch,o,r.error,r.isPending,r.refetch,s]);return(0,G.jsx)(Wv.Provider,{value:c,children:e})},Kv=()=>{let e=(0,M.useContext)(Wv);if(!e)throw Error(`useWorkspace must be rendered inside WorkspaceProvider`);return e},qv=e=>h({queryKey:e?Tv(e):[`projects`,`none`,`work-items`],queryFn:()=>{if(!e)throw Error(`A project is required to list work items`);return Hg(e)},enabled:e!==void 0}),Jv=e=>h({queryKey:e?Ev(e):[`projects`,`none`,`work-items`,`dependencies`],queryFn:()=>{if(!e)throw Error(`A project is required to list WorkItem dependencies`);return Ug(e)},enabled:e!==void 0}),Yv=()=>h({queryKey:mv,queryFn:g_}),Xv=()=>h({queryKey:hv,queryFn:__}),Zv=e=>y({queryKey:e?Ov(e):[`work-items`,`none`,`activity`],queryFn:({pageParam:t})=>{if(!e)throw Error(`A WorkItem is required to load its Run Activity`);return v_(e,t)},initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:e!==void 0}),Qv=()=>h({queryKey:gv,queryFn:mg}),$v=(e,t)=>y({queryKey:e&&t?Dv(e,t):[`projects`,`none`,`work-items`,`none`,`events`],queryFn:({pageParam:n})=>{if(!e||!t)throw Error(`A project and work item are required to list activity`);return Wg(e,t,n)},initialPageParam:void 0,getNextPageParam:e=>e.hasMore?e.nextSequence:void 0,enabled:e!==void 0&&t!==void 0}),ey=e=>h({queryKey:e?kv(e):[`work-items`,`none`,`workflow`],queryFn:()=>{if(!e)throw Error(`A work item is required to load its workflow`);return Gg(e)},enabled:e!==void 0}),ty=e=>h({queryKey:e?Av(e):[`work-items`,`none`,`verification-runs`],queryFn:()=>{if(!e)throw Error(`A work item is required to list verification Runs`);return Kg(e)},enabled:e!==void 0}),ny=()=>{let e=c();return o({mutationFn:qg,onSuccess:async t=>{await e.invalidateQueries({queryKey:Av(t.run.workItemId)})}})},ry=()=>{let e=c();return o({mutationFn:e=>Jg(e),onSuccess:async t=>{await e.invalidateQueries({queryKey:Av(t.run.workItemId)})}})},iy=()=>o({mutationFn:Yg}),ay=e=>h({queryKey:e?jv(e):[`work-items`,`none`,`reviews`],queryFn:()=>{if(!e)throw Error(`A work item is required to load review state`);return y_(e)},enabled:e!==void 0}),oy=e=>h({queryKey:e?Mv(e):[`work-items`,`none`,`qa`],queryFn:()=>{if(!e)throw Error(`A work item is required to load Browser QA state`);return b_(e)},enabled:e!==void 0}),sy=e=>h({queryKey:e?Nv(e):[`work-items`,`none`,`workspace`],queryFn:()=>{if(!e)throw Error(`A work item is required to load its workspace`);return Xg(e)},enabled:e!==void 0}),cy=e=>h({queryKey:Pv(e),queryFn:()=>Zg(e)}),ly=(e,t)=>h({queryKey:Fv(e,t),queryFn:()=>Qg(e,t)}),uy=e=>h({queryKey:e?Lv(e):[`stage-attempts`,`none`,`sessions`],queryFn:()=>{if(!e)throw Error(`A stage attempt is required to list its sessions`);return $g(e)},enabled:e!==void 0}),dy=()=>h({queryKey:Rv,queryFn:e_}),fy=e=>h({queryKey:e?zv(e):[`projects`,`none`,`provider-selection`],queryFn:()=>{if(!e)throw Error(`A Project is required to load provider settings`);return t_(e)},enabled:e!==void 0}),py=e=>h({queryKey:e?Bv(e):[`projects`,`none`,`workspace-strategy`],queryFn:()=>{if(!e)throw Error(`A Project is required to load its workspace strategy`);return n_(e)},enabled:e!==void 0}),my=e=>h({queryKey:e?Vv(e):[`projects`,`none`,`provider-allowance`],queryFn:()=>{if(!e)throw Error(`A Project is required to load provider allowance`);return o_(e)},enabled:e!==void 0}),hy=()=>{let e=c();return o({mutationFn:e=>s_(e),onSuccess:t=>{e.setQueryData(Vv(t.projectId),t)}})},gy=()=>{let e=c();return o({mutationFn:({project:e,preference:t})=>i_(e,t),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:pv}),e.setQueryData(zv(t.selection.projectId),t),e.invalidateQueries({queryKey:Rv})])}})},_y=()=>{let e=c();return o({mutationFn:({selection:e,strategy:t})=>r_(e,t),onSuccess:async t=>{e.setQueryData(Bv(t.selection.projectId),t),await e.invalidateQueries({queryKey:pv})}})},vy=()=>{let e=c();return o({mutationFn:e=>a_(e),onSuccess:t=>{e.setQueryData(zv(t.selection.projectId),t)}})},yy=e=>h({queryKey:e?Hv(e):[`projects`,`none`,`mcp-profiles`],queryFn:()=>{if(!e)throw Error(`A Project is required to load MCP profiles`);return c_(e)},enabled:e!==void 0}),by=()=>o({mutationFn:e=>l_(e.projectId,e.expectedProjectVersion,e.candidate)}),xy=()=>o({mutationFn:e=>u_(e.projectId,e.expectedProjectVersion)}),Sy=()=>{let e=c();return async t=>{await Promise.all([e.invalidateQueries({queryKey:pv}),e.invalidateQueries({queryKey:Hv(t)})])}},Cy=()=>{let e=Sy();return o({mutationFn:e=>d_(e),onSuccess:async(t,n)=>e(n.projectId)})},wy=()=>{let e=Sy();return o({mutationFn:e=>f_(e.projectId,e.revision),onSuccess:async(t,n)=>e(n.projectId)})},Ty=()=>{let e=Sy();return o({mutationFn:p_,onSuccess:async(t,n)=>e(n.projectId)})},Ey=()=>{let e=Sy();return o({mutationFn:m_,onSuccess:async(t,n)=>e(n.projectId)})},Dy=e=>h({queryKey:e?Iv(e):[`projects`,`none`,`human-requests`,`OPEN`],queryFn:()=>{if(!e)throw Error(`A project is required to list HumanRequests`);return h_(e)},enabled:e!==void 0}),Oy=()=>{let e=c(),{projects:t}=Kv();return o({mutationFn:async()=>{let e=new Set(t.filter(({repositoryStatus:e})=>e===`READY`).map(({fixtureId:e})=>e));e.has(`web-app-a`)||await C_(`web-app-a`),e.has(`api-service-b`)||await C_(`api-service-b`)},onSuccess:async()=>{await e.invalidateQueries({queryKey:pv})}})},ky=()=>{let e=c();return o({mutationFn:e=>C_(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:pv})}})},Ay=()=>{let e=c();return o({mutationFn:e=>w_(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:pv})}})},jy=()=>o({mutationFn:e=>T_(e)}),My=()=>h({queryKey:Uv,queryFn:E_}),Ny=()=>{let e=c();return o({mutationFn:e=>D_(e),onSuccess:async t=>{await e.invalidateQueries({queryKey:Uv}),t.status===`COMPLETED`&&await e.invalidateQueries({queryKey:pv})}})},Py=()=>{let e=c();return o({mutationFn:e=>O_(e),onSuccess:async t=>{await e.invalidateQueries({queryKey:Uv}),t.status===`COMPLETED`&&await e.invalidateQueries({queryKey:pv})}})},Fy=()=>h({queryKey:_v,queryFn:hg}),Iy=e=>h({queryKey:e?vv(e):[`projects`,`none`,`constitution`],queryFn:()=>{if(!e)throw Error(`A project is required to load its Constitution`);return gg(e)},enabled:e!==void 0}),Ly=()=>{let e=c();return o({mutationFn:({presetId:e,project:t})=>_g(t,e),onSuccess:async t=>{await e.invalidateQueries({queryKey:vv(t.projectId)})}})},Ry=()=>{let e=c();return o({mutationFn:({project:e,proposal:t})=>vg(e,t),onSuccess:async(t,{project:n})=>{await e.invalidateQueries({queryKey:vv(n.id)})}})},zy=()=>{let e=c();return o({mutationFn:({projectId:e,publication:t})=>yg(e,t),onSuccess:async(t,{projectId:n})=>{await e.invalidateQueries({queryKey:vv(n)})}})},By=e=>h({queryKey:e?bv(e):[`projects`,`none`,`verification-plan`],queryFn:()=>{if(!e)throw Error(`A project is required to load its verification Plan`);return bg(e)},enabled:e!==void 0}),Vy=()=>{let e=c();return o({mutationFn:e=>xg(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:bv(t.projectId)}),e.invalidateQueries({queryKey:pv})])}})},Hy=()=>{let e=c();return o({mutationFn:e=>Sg(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:bv(t.projectId)}),e.invalidateQueries({queryKey:pv})])}})},Uy=()=>{let e=c();return o({mutationFn:({projectId:e,publication:t})=>Rg(e,t),onSuccess:async t=>{await e.invalidateQueries({queryKey:bv(t.projectId)})}})},Wy=e=>h({queryKey:e?xv(e):[`projects`,`none`,`launch-measurement`],queryFn:()=>{if(!e)throw Error(`A project is required to load launch measurement`);return Cg(e)},enabled:e!==void 0}),Gy=()=>{let e=c();return o({mutationFn:e=>wg(e),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:xv(n.snapshot.projectId)}),e.invalidateQueries({queryKey:pv})])}})},Ky=()=>{let e=c();return o({mutationFn:e=>Tg(e),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:xv(n.snapshot.projectId)}),e.invalidateQueries({queryKey:pv})])}})},qy=()=>{let e=c();return o({mutationFn:e=>Eg(e),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:xv(n.projectId)})}})},Jy=()=>{let e=c();return o({mutationFn:e=>Dg(e),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:xv(n.projectId)})}})},Yy=e=>h({queryKey:e?Sv(e):[`projects`,`none`,`launch-release`],queryFn:()=>{if(!e)throw Error(`A project is required to load its Launch Release`);return Og(e)},enabled:e!==void 0}),Xy=()=>{let e=c();return o({mutationFn:e=>kg(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Sv(t.projectId)}),e.invalidateQueries({queryKey:pv})])}})},Zy=()=>{let e=c();return o({mutationFn:e=>Ag(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Sv(t.projectId)}),e.invalidateQueries({queryKey:pv})])}})},Qy=()=>o({mutationFn:e=>jg(e)}),$y=e=>h({queryKey:e?Cv(e):[`projects`,`none`,`guided-deployment`],queryFn:()=>{if(!e)throw Error(`A project is required to load Guided Deployment`);return Mg(e)},enabled:e!==void 0}),eb=(e,t)=>h({queryKey:e&&t?wv(e,t):[`projects`,`none`,`guided-deployment`,`preview`],queryFn:()=>{if(!e||!t)throw Error(`A current Release is required for deployment preview`);return Ng(e,t)},enabled:e!==void 0&&t!==void 0}),tb=async(e,t)=>{await Promise.all([e.invalidateQueries({queryKey:Cv(t)}),e.invalidateQueries({queryKey:Sv(t)}),e.invalidateQueries({queryKey:pv})])},nb=()=>{let e=c();return o({mutationFn:e=>Pg({preview:e}),onSuccess:async t=>{await tb(e,t.projectId)}})},rb=()=>{let e=c();return o({mutationFn:e=>Fg({deployment:e}),onSuccess:async t=>{await tb(e,t.projectId)}})},ib=()=>{let e=c();return o({mutationFn:e=>Ig(e),onSuccess:async t=>{await tb(e,t.projectId)}})},ab=()=>{let e=c();return o({mutationFn:e=>Lg(e),onSuccess:async t=>{await tb(e,t.projectId)}})},ob=e=>h({queryKey:e?yv(e):[`projects`,`none`,`readiness`],queryFn:()=>{if(!e)throw Error(`A project is required to load readiness`);return zg(e)},enabled:e!==void 0}),sb=()=>{let e=c();return o({mutationFn:e=>Bg(e),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:yv(n.id)})}})},cb=()=>{let e=c();return o({mutationFn:({check:e,outcome:t,projectId:n,rationale:r,run:i})=>Vg(n,i,e,t,r),onSuccess:async(t,{projectId:n})=>{await e.invalidateQueries({queryKey:yv(n)})}})},lb=()=>{let e=c();return o({mutationFn:e=>k_(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Tv(t.projectId)}),e.invalidateQueries({queryKey:mv})])}})},ub=()=>{let e=c();return o({mutationFn:e=>M_(e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Tv(t.projectId)}),e.invalidateQueries({queryKey:mv})])}})},db=()=>{let e=c();return o({mutationFn:({blockerWorkItemIds:e,workItem:t})=>A_(t,e),onSuccess:async(t,{workItem:n})=>{let r=Ev(n.projectId);e.setQueryData(r,{schemaVersion:1,projectId:n.projectId,dependencies:[...(e.getQueryData(r)?.dependencies??[]).filter(({blockedWorkItemId:e})=>e!==n.id),...t]}),await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.id)})])}})},fb=()=>{let e=c();return o({mutationFn:({targetState:e,workItem:t})=>N_(t,e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Tv(t.projectId)}),e.invalidateQueries({queryKey:Dv(t.projectId,t.id)}),e.invalidateQueries({queryKey:mv})])}})},pb=()=>{let e=c();return o({mutationFn:({patch:e,workItem:t})=>P_(t,e),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Tv(t.projectId)}),e.invalidateQueries({queryKey:Dv(t.projectId,t.id)}),e.invalidateQueries({queryKey:mv})])}})},mb=()=>{let e=c();return o({mutationFn:({policy:e,workItem:t})=>F_(t,e),onSuccess:async(t,{workItem:n})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:kv(n.id)}),e.invalidateQueries({queryKey:Mv(n.id)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.id)}),e.invalidateQueries({queryKey:Iv(n.projectId)}),e.invalidateQueries({queryKey:mv})])}})},hb=()=>{let e=c();return o({mutationFn:({answer:e,request:t})=>I_(t,e),onSuccess:async(t,{request:n})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:kv(n.workItemId)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.workItemId)}),e.invalidateQueries({queryKey:Iv(n.projectId)}),e.invalidateQueries({queryKey:Lv(n.stageAttemptId)}),e.invalidateQueries({queryKey:mv})])}})},gb=()=>{let e=c();return o({mutationFn:({disposition:e,finding:t,reason:n})=>L_(t,e,n),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:jv(t.workItemId)}),e.invalidateQueries({queryKey:Dv(t.projectId,t.workItemId)}),e.invalidateQueries({queryKey:mv})])}})},_b=()=>{let e=c();return o({mutationFn:({defect:e,reason:t})=>R_(e,t),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:Mv(t.workItemId)}),e.invalidateQueries({queryKey:Dv(t.projectId,t.workItemId)}),e.invalidateQueries({queryKey:mv})])}})},vb=()=>{let e=c();return o({mutationFn:({action:e,correctionRun:t,request:n,run:r})=>z_(n,t,r,e),onSuccess:async(t,{request:n})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:kv(n.workItemId)}),e.invalidateQueries({queryKey:Mv(n.workItemId)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.workItemId)}),e.invalidateQueries({queryKey:Iv(n.projectId)}),e.invalidateQueries({queryKey:Lv(n.stageAttemptId)}),e.invalidateQueries({queryKey:mv})])}})},yb=()=>{let e=c();return o({mutationFn:({action:e,correctionRun:t,qaCorrectionRun:n,request:r,run:i})=>B_(r,t,n,i,e),onSuccess:async(t,{request:n})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:kv(n.workItemId)}),e.invalidateQueries({queryKey:Av(n.workItemId)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.workItemId)}),e.invalidateQueries({queryKey:Iv(n.projectId)}),e.invalidateQueries({queryKey:Lv(n.stageAttemptId)}),e.invalidateQueries({queryKey:mv})])}})},bb=()=>{let e=c();return o({mutationFn:({action:e,run:t,workItem:n})=>V_(n.id,t,e),onSuccess:async(t,{run:n,workItem:r})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(r.projectId)}),e.invalidateQueries({queryKey:kv(r.id)}),e.invalidateQueries({queryKey:Mv(r.id)}),e.invalidateQueries({queryKey:Dv(r.projectId,r.id)}),e.invalidateQueries({queryKey:Iv(r.projectId)}),e.invalidateQueries({queryKey:Lv(n.currentStageAttemptId)}),e.invalidateQueries({queryKey:mv})])}})},xb=()=>{let e=c();return o({mutationFn:({maxEstimatedTokens:e,modelTierOverride:t,agentRunMaxEstimatedTokensOverride:n,run:r,workItem:i})=>H_(i.id,r,e,t,n),onSuccess:async(t,{run:n,workItem:r})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(r.projectId)}),e.invalidateQueries({queryKey:kv(r.id)}),e.invalidateQueries({queryKey:Dv(r.projectId,r.id)}),e.invalidateQueries({queryKey:Iv(r.projectId)}),e.invalidateQueries({queryKey:Lv(n.currentStageAttemptId)}),e.invalidateQueries({queryKey:mv})])}})},Sb=()=>{let e=c();return o({mutationFn:({acceptancePackage:e,action:t,run:n,workItem:r})=>U_(r.id,n,e,t),onSuccess:async(t,{workItem:n})=>{await Promise.all([e.invalidateQueries({queryKey:Tv(n.projectId)}),e.invalidateQueries({queryKey:kv(n.id)}),e.invalidateQueries({queryKey:Dv(n.projectId,n.id)}),e.invalidateQueries({queryKey:Iv(n.projectId)}),e.invalidateQueries({queryKey:mv})])}})},Cb=[`content-security-policy`,`x-content-type-options`,`referrer-policy`,`permissions-policy`],wb=(e,t)=>{let n=t.plan?.configuration;return{startupRecipeId:n?.startupRecipeId??e.recipes.find(({kind:e,required:t})=>e===`SERVE`&&!t)?.id??``,dependencyAuditRecipeId:n?.dependencyAuditRecipeId??e.recipes.find(({kind:e})=>e===`AUDIT`)?.id??``,targetOrigin:n?.targetOrigin??`http://127.0.0.1:3000`,healthPath:n?.healthPath??`/health/ready`,probePath:n?.probePath??`/`,privateRoutes:n?.privateRoutes.join(`
|
|
2
|
+
`)??``,samples:(n?.samples??3).toString(),lcpMs:(n?.thresholds.lcpMs??2500).toString(),inpMs:(n?.thresholds.inpMs??200).toString(),cls:(n?.thresholds.cls??.1).toString(),scriptBytes:(n?.thresholds.scriptBytes??512e3).toString(),requiredHeaders:n?.requiredHeaders??Cb}},Tb=(e,t)=>{let n=Ol.safeParse({verificationPlanId:t.id,verificationPlanRevision:t.revision,verificationPlanContentHash:t.contentHash,startupRecipeId:e.startupRecipeId,dependencyAuditRecipeId:e.dependencyAuditRecipeId||null,targetOrigin:e.targetOrigin.trim(),healthPath:e.healthPath.trim(),probePath:e.probePath.trim(),privateRoutes:e.privateRoutes.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(Boolean),samples:Number(e.samples),thresholds:{lcpMs:Number(e.lcpMs),inpMs:Number(e.inpMs),cls:Number(e.cls),scriptBytes:Number(e.scriptBytes)},requiredHeaders:e.requiredHeaders});return n.success?n.data:null},Eb=(e,t)=>{switch(e.key){case`PERF_WEB_VITALS`:return t(`settings.launch.evidence.vitals`,{lcp:e.evidence.medianLcpMs??`—`,inp:e.evidence.medianInpMs??`—`,cls:e.evidence.medianCls??`—`});case`PERF_BUNDLE_BUDGET`:return t(`settings.launch.evidence.bundle`,{measured:e.evidence.medianScriptBytes,budget:e.evidence.budgetBytes});case`SEC_RESPONSE_HEADERS`:return e.evidence.map(({name:e,present:n})=>`${e}: ${t(n?`settings.launch.yes`:`settings.launch.no`)}`).join(` · `);case`SEC_UNAUTHENTICATED_ROUTES`:return e.evidence.map(({path:e,statusCode:t})=>`${e}: ${t.toString()}`).join(` · `);case`SEC_CLIENT_BUNDLE_SECRETS`:return t(`settings.launch.evidence.secrets`,{bytes:e.evidence.scannedScriptBytes,count:e.evidence.findings.reduce((e,t)=>e+t.count,0)});case`DEPS_AUDIT`:return e.evidence===null?t(`settings.launch.evidence.auditMissing`):t(`settings.launch.evidence.audit`,{status:e.evidence.status})}},Db=({adopting:e,cancelling:t,disabling:n,onAdopt:r,onCancel:i,onDisable:a,onRun:o,running:s,snapshot:c,verificationPlan:l})=>{let{t:u}=Z(),[d,f]=(0,M.useState)(()=>wb(l,c)),p=Tb(d,l),m=l.recipes.filter(({kind:e,required:t})=>e===`SERVE`&&!t),h=l.recipes.filter(({kind:e})=>e===`AUDIT`),g=c.latestRun?.status===`RUNNING`||c.latestRun?.status===`CANCELLING`||c.latestRun?.status===`BLOCKED`?c.latestRun:null,_=c.plan?.status===`ACTIVE`&&p!==null&&JSON.stringify(c.plan.configuration)===JSON.stringify(p),v=(e,t)=>{f(n=>({...n,[e]:t}))};return(0,G.jsxs)(`div`,{className:`launch-settings`,children:[(0,G.jsxs)(`div`,{className:`launch-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:u(`settings.launch.title`)}),(0,G.jsx)(`p`,{children:u(`settings.launch.description`)})]}),c.plan===null?null:(0,G.jsxs)(`span`,{className:q(`launch-settings__state`,c.plan.status===`ACTIVE`&&`is-ready`),children:[(0,G.jsx)(K,{name:c.plan.status===`ACTIVE`?`check`:`warning`,size:13}),u(c.plan.status===`ACTIVE`?`settings.launch.planActive`:`settings.launch.planDisabled`,{revision:c.plan.revision})]})]}),(0,G.jsxs)(`div`,{className:`launch-settings__notice`,role:`note`,children:[(0,G.jsx)(`strong`,{children:u(`settings.launch.localTitle`)}),(0,G.jsx)(`p`,{children:u(`settings.launch.localNotice`)})]}),m.length===0?(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:u(`settings.launch.noService`)}):(0,G.jsxs)(`div`,{className:`launch-settings__form`,children:[(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:u(`settings.launch.serviceRecipe`)}),(0,G.jsx)(`select`,{onChange:e=>{v(`startupRecipeId`,e.target.value)},value:d.startupRecipeId,children:m.map(e=>(0,G.jsxs)(`option`,{value:e.id,children:[e.label,`: `,[e.executable,...e.argv].join(` `)]},e.id))})]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:u(`settings.launch.auditRecipe`)}),(0,G.jsxs)(`select`,{onChange:e=>{v(`dependencyAuditRecipeId`,e.target.value)},value:d.dependencyAuditRecipeId,children:[(0,G.jsx)(`option`,{value:``,children:u(`settings.launch.auditNone`)}),h.map(e=>(0,G.jsxs)(`option`,{value:e.id,children:[e.label,`: `,[e.executable,...e.argv].join(` `)]},e.id))]})]}),[[`targetOrigin`,`settings.launch.origin`],[`healthPath`,`settings.launch.healthPath`],[`probePath`,`settings.launch.probePath`]].map(([e,t])=>(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:u(t)}),(0,G.jsx)(`input`,{onChange:t=>{v(e,t.target.value)},type:`text`,value:d[e]})]},e)),(0,G.jsxs)(`label`,{className:`launch-settings__wide`,children:[(0,G.jsx)(`span`,{children:u(`settings.launch.privateRoutes`)}),(0,G.jsx)(`textarea`,{onChange:e=>{v(`privateRoutes`,e.target.value)},rows:2,value:d.privateRoutes})]}),[[`samples`,`settings.launch.samples`,`1`],[`lcpMs`,`settings.launch.lcp`,`100`],[`inpMs`,`settings.launch.inp`,`10`],[`cls`,`settings.launch.cls`,`0.01`],[`scriptBytes`,`settings.launch.bundle`,`1024`]].map(([e,t,n])=>(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:u(t)}),(0,G.jsx)(`input`,{min:`0`,onChange:t=>{v(e,t.target.value)},step:n,type:`number`,value:d[e]})]},e)),(0,G.jsxs)(`fieldset`,{className:`launch-settings__wide`,children:[(0,G.jsx)(`legend`,{children:u(`settings.launch.headers`)}),Cb.map(e=>(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{checked:d.requiredHeaders.includes(e),onChange:t=>{v(`requiredHeaders`,t.target.checked?[...d.requiredHeaders,e]:d.requiredHeaders.filter(t=>t!==e))},type:`checkbox`}),(0,G.jsx)(`span`,{children:e})]},e))]})]}),(0,G.jsx)(`p`,{className:`launch-settings__identity`,children:u(`settings.launch.verificationIdentity`,{id:l.id,revision:l.revision})}),p===null&&m.length>0?(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:u(`settings.launch.invalid`)}):null,(0,G.jsxs)(`div`,{className:`launch-settings__actions`,children:[(0,G.jsx)(J,{disabled:p===null||_||g!==null,loading:e,onClick:()=>{p!==null&&r(p)},type:`button`,variant:`primary`,children:c.plan===null?u(`settings.launch.adopt`):u(`settings.launch.replace`)}),c.plan?.status===`ACTIVE`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{disabled:g!==null,loading:s,onClick:o,type:`button`,children:u(`settings.launch.run`)}),(0,G.jsx)(J,{disabled:g!==null,loading:n,onClick:a,type:`button`,children:u(`settings.launch.disable`)})]}):null,g===null?null:(0,G.jsx)(J,{loading:t,onClick:i,type:`button`,children:u(g.status===`CANCELLING`?`settings.launch.cancelling`:g.status===`BLOCKED`?`settings.launch.stopBlocked`:`settings.launch.cancel`)})]}),c.latestRun===null?(0,G.jsx)(`p`,{className:`settings__note`,children:u(`settings.launch.noRun`)}):(0,G.jsxs)(`section`,{className:`launch-run`,"aria-label":u(`settings.launch.results`),children:[(0,G.jsxs)(`div`,{className:`launch-run__heading`,children:[(0,G.jsx)(`strong`,{children:u(`settings.launch.status.${c.latestRun.status}`)}),(0,G.jsx)(`span`,{children:u(`settings.launch.tree`,{tree:c.latestRun.testedTree.slice(0,8)})}),c.freshness===null?null:(0,G.jsx)(`span`,{children:u(`settings.launch.freshness.${c.freshness.status}`)})]}),c.latestRun.errorCode===null?null:(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:u(`settings.launch.errorCode`,{code:c.latestRun.errorCode})}),c.latestRun.results.length===0?null:(0,G.jsx)(`ul`,{className:`launch-gates`,children:c.latestRun.results.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`span`,{className:q(`launch-gates__status`,`is-${e.status.toLowerCase()}`),children:[(0,G.jsx)(K,{name:e.status===`PASSED`?`check`:`warning`,size:14}),u(`settings.launch.gateStatus.${e.status}`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:u(`settings.launch.gate.${e.key}`)}),(0,G.jsx)(`p`,{children:e.summary}),(0,G.jsx)(`small`,{children:Eb(e,u)})]})]},e.key))})]})]})},Ob=({project:e})=>{let{t}=Z(),n=By(e.id),r=Wy(e.id),i=Gy(),a=Ky(),o=qy(),s=Jy(),c=n.data?.plan,l=r.data,u=i.error instanceof Error?i.error:a.error instanceof Error?a.error:o.error instanceof Error?o.error:s.error instanceof Error?s.error:r.error instanceof Error?r.error:n.error instanceof Error?n.error:null;return c?.status!==`ACTIVE`||l===void 0?(0,G.jsxs)(`div`,{className:`launch-settings`,children:[(0,G.jsx)(`div`,{className:`launch-settings__heading`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:t(`settings.launch.title`)}),(0,G.jsx)(`p`,{children:t(`settings.launch.description`)})]})}),(0,G.jsx)(`p`,{className:u===null?`settings__note`:`launch-settings__error`,children:u?.message??(n.isPending||r.isPending?t(`settings.launch.loading`):t(`settings.launch.verificationRequired`))})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Db,{adopting:i.isPending,cancelling:s.isPending,disabling:a.isPending,onAdopt:e=>{i.mutate({configuration:e,snapshot:l})},onCancel:()=>{l.latestRun!==null&&s.mutate({projectId:e.id,run:l.latestRun})},onDisable:()=>{a.mutate({snapshot:l})},onRun:()=>{o.mutate({projectId:e.id,snapshot:l})},running:o.isPending,snapshot:l,verificationPlan:c},`${c.id}:${l.plan?.id??`new`}`),u===null?null:(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:u.message})]})},kb=(e,t)=>{let n=e.environments.find(e=>e.kind===t);return{kind:t,name:n?.name??``,publicBaseUrl:n?.publicBaseUrl??``,healthPath:n?.healthPath??`/health/ready`,requiredEnvironmentVariables:n?.requiredEnvironmentVariables.join(`
|
|
4
|
+
`)??``}},Ab=e=>{let t=fu.safeParse({kind:e.kind,name:e.name.trim(),presetId:`WEB_APP_V1`,presetRevision:1,publicBaseUrl:e.publicBaseUrl.trim(),healthPath:e.healthPath.trim(),requiredEnvironmentVariables:e.requiredEnvironmentVariables.split(`
|
|
5
|
+
`).map(e=>e.trim()).filter(Boolean)});return t.success?t.data:null},jb=e=>{switch(e){case`PASSED`:return`settings.release.gateStatus.PASSED`;case`FAILED`:return`settings.release.gateStatus.FAILED`;case`ACTION_REQUIRED`:return`settings.release.gateStatus.ACTION_REQUIRED`;case`STALE`:return`settings.release.gateStatus.STALE`}},Mb=e=>{let t=(e.split(`/`).at(-1)??e).toLowerCase().replaceAll(`_`,` `);return`${t.slice(0,1).toUpperCase()}${t.slice(1)}`},Nb=({creating:e,exporting:t,onCreate:n,onExport:r,onSave:i,saving:a,snapshot:o,workItems:s})=>{let{t:c}=Z(),l=o.environments[0]?.kind??`PREVIEW`,[u,d]=(0,M.useState)(()=>kb(o,l)),[f,p]=(0,M.useState)(()=>o.latestRelease?.selectedWorkItems.map(({workItemId:e})=>e)??[]),m=Ab(u),h=o.environments.find(({kind:e})=>e===u.kind)??null,g=m!==null&&h!==null&&JSON.stringify(m)===JSON.stringify({kind:h.kind,name:h.name,presetId:h.presetId,presetRevision:h.presetRevision,publicBaseUrl:h.publicBaseUrl,healthPath:h.healthPath,requiredEnvironmentVariables:h.requiredEnvironmentVariables}),_=(e,t)=>{d(n=>({...n,[e]:t}))};return(0,G.jsxs)(`div`,{className:`launch-settings release-settings`,children:[(0,G.jsxs)(`div`,{className:`launch-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:c(`settings.release.title`)}),(0,G.jsx)(`p`,{children:c(`settings.release.description`)})]}),o.latestRelease===null?null:(0,G.jsxs)(`span`,{className:q(`launch-settings__state`,o.freshness?.status===`CURRENT`&&`is-ready`),children:[(0,G.jsx)(K,{name:o.freshness?.status===`CURRENT`?`check`:`warning`,size:13}),c(o.freshness?.status===`CURRENT`?`settings.release.current`:`settings.release.stale`)]})]}),(0,G.jsxs)(`div`,{className:`launch-settings__notice`,role:`note`,children:[(0,G.jsx)(`strong`,{children:c(`settings.release.boundaryTitle`)}),(0,G.jsx)(`p`,{children:c(`settings.release.boundaryNotice`)})]}),(0,G.jsxs)(`div`,{className:`launch-settings__form`,children:[(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:c(`settings.release.kind`)}),(0,G.jsxs)(`select`,{onChange:e=>{let t=e.target.value;d(kb(o,t))},value:u.kind,children:[(0,G.jsx)(`option`,{value:`PREVIEW`,children:c(`settings.release.kind.PREVIEW`)}),(0,G.jsx)(`option`,{value:`PRODUCTION`,children:c(`settings.release.kind.PRODUCTION`)})]})]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:c(`settings.release.name`)}),(0,G.jsx)(`input`,{onChange:e=>{_(`name`,e.target.value)},type:`text`,value:u.name})]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:c(`settings.release.publicOrigin`)}),(0,G.jsx)(`input`,{onChange:e=>{_(`publicBaseUrl`,e.target.value)},placeholder:`https://preview.example.com`,type:`text`,value:u.publicBaseUrl})]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`span`,{children:c(`settings.release.healthPath`)}),(0,G.jsx)(`input`,{onChange:e=>{_(`healthPath`,e.target.value)},type:`text`,value:u.healthPath})]}),(0,G.jsxs)(`label`,{className:`launch-settings__wide`,children:[(0,G.jsx)(`span`,{children:c(`settings.release.variables`)}),(0,G.jsx)(`textarea`,{onChange:e=>{_(`requiredEnvironmentVariables`,e.target.value)},rows:2,value:u.requiredEnvironmentVariables})]})]}),m===null?(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:c(`settings.release.invalid`)}):null,(0,G.jsx)(`div`,{className:`launch-settings__actions`,children:(0,G.jsx)(J,{disabled:m===null||g||e,loading:a,onClick:()=>{m!==null&&i(m,h)},type:`button`,variant:`primary`,children:c(h===null?`settings.release.save`:`settings.release.update`)})}),(0,G.jsxs)(`fieldset`,{className:`release-scope`,children:[(0,G.jsx)(`legend`,{children:c(`settings.release.scope`)}),(0,G.jsx)(`p`,{children:c(`settings.release.scopeNotice`)}),s.length===0?(0,G.jsx)(`p`,{className:`settings__note`,children:c(`settings.release.noWorkItems`)}):s.map(e=>(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{checked:f.includes(e.id),onChange:t=>{p(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id))},type:`checkbox`}),(0,G.jsx)(`span`,{children:e.title}),(0,G.jsx)(`small`,{children:e.state})]},e.id))]}),(0,G.jsxs)(`div`,{className:`launch-settings__actions`,children:[(0,G.jsx)(J,{disabled:h===null||a,loading:e,onClick:()=>{h!==null&&n(h,f)},type:`button`,children:c(`settings.release.create`)}),o.latestRelease===null?null:(0,G.jsx)(J,{loading:t,onClick:()=>{o.latestRelease!==null&&r(o.latestRelease.id)},type:`button`,children:c(`settings.release.export`)})]}),o.latestRelease===null?(0,G.jsx)(`p`,{className:`settings__note`,children:c(`settings.release.none`)}):(0,G.jsxs)(`section`,{className:`launch-run`,"aria-label":c(`settings.release.results`),children:[(0,G.jsxs)(`div`,{className:`launch-run__heading`,children:[(0,G.jsx)(`strong`,{children:c(`settings.release.passed`,{passed:o.latestRelease.passedRequiredGateCount,required:o.latestRelease.requiredGateCount})}),(0,G.jsx)(`span`,{children:c(`settings.release.tree`,{tree:o.latestRelease.sourceTree.slice(0,8)})})]}),(0,G.jsx)(`ul`,{className:`launch-gates`,children:o.latestRelease.gates.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`span`,{className:q(`launch-gates__status`,`is-${e.status.toLowerCase()}`),children:[(0,G.jsx)(K,{name:e.status===`PASSED`?`check`:`warning`,size:14}),c(jb(e.status))]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:Mb(e.key)}),(0,G.jsx)(`p`,{children:e.summary})]})]},e.key))})]})]})},Pb=e=>{switch(e){case`RELEASE_STALE`:return`settings.deploy.block.RELEASE_STALE`;case`RELEASE_GATES_BLOCKED`:return`settings.deploy.block.RELEASE_GATES_BLOCKED`;case`ENVIRONMENT_UNSUPPORTED`:return`settings.deploy.block.ENVIRONMENT_UNSUPPORTED`;case`REPOSITORY_UNAVAILABLE`:return`settings.deploy.block.REPOSITORY_UNAVAILABLE`;case`REPOSITORY_PATH_NOT_CANONICAL`:return`settings.deploy.block.REPOSITORY_PATH_NOT_CANONICAL`;case`REPOSITORY_OPERATION_IN_PROGRESS`:return`settings.deploy.block.REPOSITORY_OPERATION_IN_PROGRESS`;case`SOURCE_DIRTY`:return`settings.deploy.block.SOURCE_DIRTY`;case`DETACHED_HEAD`:return`settings.deploy.block.DETACHED_HEAD`;case`REMOTE_INVALID`:return`settings.deploy.block.REMOTE_INVALID`;case`WORKFLOW_MISSING`:return`settings.deploy.block.WORKFLOW_MISSING`;case`WORKFLOW_NOT_REGULAR`:return`settings.deploy.block.WORKFLOW_NOT_REGULAR`;case`WORKFLOW_TRIGGER_MISSING`:return`settings.deploy.block.WORKFLOW_TRIGGER_MISSING`;case`WORKFLOW_TOO_LARGE`:return`settings.deploy.block.WORKFLOW_TOO_LARGE`;case`CLI_UNAVAILABLE`:return`settings.deploy.block.CLI_UNAVAILABLE`;case`AUTH_REQUIRED`:return`settings.deploy.block.AUTH_REQUIRED`;case`REMOTE_BRANCH_UNAVAILABLE`:return`settings.deploy.block.REMOTE_BRANCH_UNAVAILABLE`;case`REMOTE_COMMIT_MISMATCH`:return`settings.deploy.block.REMOTE_COMMIT_MISMATCH`;case`PREVIEW_PROMOTION_REQUIRED`:return`settings.deploy.block.PREVIEW_PROMOTION_REQUIRED`}},Fb=({target:e})=>{let{t}=Z();return(0,G.jsxs)(`dl`,{className:`deployment-target`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.deploy.environment`)}),(0,G.jsx)(`dd`,{children:e.presetId===`GITHUB_ACTIONS_ENVIRONMENT_WORKFLOW_V2`?t(`settings.deploy.environment.${e.environmentKind}`):t(`settings.deploy.environment.LEGACY`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.deploy.repository`)}),(0,G.jsx)(`dd`,{children:e.repositorySlug})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.deploy.branch`)}),(0,G.jsx)(`dd`,{children:e.branch})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.deploy.commit`)}),(0,G.jsx)(`dd`,{children:e.commitSha.slice(0,12)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.deploy.workflow`)}),(0,G.jsx)(`dd`,{children:e.workflowPath})]})]})},Ib=({adopting:e,approving:t,observing:n,onAdopt:r,onApprove:i,onObserve:a,onStart:o,preview:s,previewLoading:c,releaseId:l,snapshot:u,starting:d})=>{let{t:f}=Z(),p=u.latestDeployment?.releaseId===l?u.latestDeployment:null,m=p?.planId===u.latestPlan?.id?u.latestPlan:null,h=m?.target??(s?.status===`READY`?s.target:null),g=m?.revision===2?m.environmentKind:s?.status===`READY`?s.target.environmentKind:null,_=s?.status===`READY`&&(p===null||p.status===`FAILED`)&&p?.failureCode!==`DISPATCH_OUTCOME_UNKNOWN`;return(0,G.jsxs)(`section`,{className:`launch-settings deployment-settings`,"aria-label":f(`settings.deploy.title`),children:[(0,G.jsxs)(`div`,{className:`launch-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:f(`settings.deploy.title`)}),(0,G.jsx)(`p`,{children:f(`settings.deploy.description`)})]}),p===null?null:(0,G.jsxs)(`span`,{className:q(`launch-settings__state`,p.status===`SUCCEEDED`&&`is-ready`),children:[(0,G.jsx)(K,{name:p.status===`SUCCEEDED`?`check`:`warning`,size:13}),f(`settings.deploy.status.${p.status}`)]})]}),(0,G.jsxs)(`div`,{className:`launch-settings__notice`,role:`note`,children:[(0,G.jsx)(`strong`,{children:f(`settings.deploy.boundaryTitle`)}),(0,G.jsx)(`p`,{children:f(`settings.deploy.boundaryNotice`)})]}),l===null?(0,G.jsx)(`p`,{className:`settings__note`,children:f(`settings.deploy.noRelease`)}):c?(0,G.jsx)(`p`,{className:`settings__note`,children:f(`settings.deploy.loading`)}):s?.status===`BLOCKED`?(0,G.jsxs)(`div`,{className:`deployment-message`,role:`status`,children:[(0,G.jsx)(K,{name:`warning`,size:16}),(0,G.jsx)(`p`,{children:f(Pb(s.code))})]}):null,h===null?null:(0,G.jsx)(Fb,{target:h}),p?.status===`PENDING_APPROVAL`?(0,G.jsxs)(`div`,{className:`deployment-confirmation`,children:[(0,G.jsx)(`p`,{children:f(`settings.deploy.approvalNotice`,{environment:f(`settings.deploy.environment.${g??`LEGACY`}`)})}),(0,G.jsx)(J,{loading:t,onClick:()=>{i(p)},type:`button`,variant:`primary`,children:f(`settings.deploy.approve`)})]}):null,p?.status===`APPROVED`?(0,G.jsxs)(`div`,{className:`deployment-confirmation`,children:[(0,G.jsx)(`p`,{children:f(`settings.deploy.approvedNotice`,{environment:f(`settings.deploy.environment.${g??`LEGACY`}`)})}),(0,G.jsx)(J,{loading:d,onClick:()=>{o(p)},type:`button`,children:f(`settings.deploy.startApproved`)})]}):null,p?.status===`UNKNOWN`?(0,G.jsxs)(`div`,{className:`deployment-message is-critical`,role:`alert`,children:[(0,G.jsx)(K,{name:`warning`,size:16}),(0,G.jsx)(`p`,{children:f(`settings.deploy.unknownNotice`)})]}):null,p?.status===`FAILED`?(0,G.jsxs)(`div`,{className:`deployment-message`,role:`status`,children:[(0,G.jsx)(K,{name:`warning`,size:16}),(0,G.jsx)(`p`,{children:f(`settings.deploy.failedNotice`,{code:p.failureCode??`UNKNOWN`})})]}):null,p?.remoteRunUrl===null||p===null?null:(0,G.jsx)(`p`,{className:`deployment-run-link`,children:(0,G.jsx)(`a`,{href:p.remoteRunUrl,rel:`noreferrer`,target:`_blank`,children:f(`settings.deploy.openRun`)})}),p!==null&&[`RUNNING`,`UNKNOWN`].includes(p.status)&&p.remoteRunId!==null?(0,G.jsx)(`div`,{className:`launch-settings__actions`,children:(0,G.jsx)(J,{loading:n,onClick:()=>{a(p)},type:`button`,children:f(`settings.deploy.observe`)})}):null,_?(0,G.jsxs)(`div`,{className:`deployment-confirmation`,children:[(0,G.jsx)(`p`,{children:f(`settings.deploy.planNotice`,{environment:f(`settings.deploy.environment.${g??`LEGACY`}`)})}),(0,G.jsx)(J,{loading:e,onClick:()=>{r(s)},type:`button`,children:f(p===null?`settings.deploy.adopt`:`settings.deploy.adoptAgain`)})]}):null,(0,G.jsx)(`p`,{className:`settings__note`,children:f(`settings.deploy.rollbackUnavailable`)})]})},Lb=({projectId:e,releaseId:t})=>{let{t:n}=Z(),r=$y(e),i=eb(e,t??void 0),a=nb(),o=rb(),s=ib(),c=ab(),l=r.data,u=a.error instanceof Error?a.error:o.error instanceof Error?o.error:s.error instanceof Error?s.error:c.error instanceof Error?c.error:r.error instanceof Error?r.error:i.error instanceof Error?i.error:null;return l===void 0?(0,G.jsxs)(`section`,{className:`launch-settings deployment-settings`,children:[(0,G.jsx)(`h4`,{children:n(`settings.deploy.title`)}),(0,G.jsx)(`p`,{className:u===null?`settings__note`:`launch-settings__error`,children:u?.message??n(`settings.deploy.loading`)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ib,{adopting:a.isPending,approving:o.isPending,observing:c.isPending,onAdopt:e=>{a.mutate(e)},onApprove:e=>{o.mutate(e)},onObserve:e=>{c.mutate(e)},onStart:e=>{s.mutate(e)},preview:i.data??null,previewLoading:t!==null&&i.isPending,releaseId:t,snapshot:l,starting:s.isPending}),u===null?null:(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:u.message})]})},Rb=(e,t)=>{let n=URL.createObjectURL(new Blob([t],{type:`text/markdown;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=`loomrail-release-${e}.md`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)},zb=({project:e})=>{let{t}=Z(),n=Yy(e.id),r=qv(e.id),i=Xy(),a=Zy(),o=Qy(),s=n.data,c=i.error instanceof Error?i.error:a.error instanceof Error?a.error:o.error instanceof Error?o.error:n.error instanceof Error?n.error:r.error instanceof Error?r.error:null;return s===void 0||r.data===void 0?(0,G.jsxs)(`div`,{className:`launch-settings release-settings`,children:[(0,G.jsx)(`h4`,{children:t(`settings.release.title`)}),(0,G.jsx)(`p`,{className:c===null?`settings__note`:`launch-settings__error`,children:c?.message??t(`settings.release.loading`)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Nb,{creating:a.isPending,exporting:o.isPending,onCreate:(e,t)=>{a.mutate({environment:e,snapshot:s,workItemIds:t})},onExport:e=>{o.mutate(e,{onSuccess:e=>{Rb(e.releaseId,e.markdown)}})},onSave:(e,t)=>{i.mutate({configuration:e,environment:t,snapshot:s})},saving:i.isPending,snapshot:s,workItems:r.data.workItems.filter(({state:e})=>e!==`CANCELLED`)},`${s.environments.map(({id:e,version:t})=>`${e}:${t.toString()}`).join(`,`)}:${s.latestRelease?.id??`none`}`),(0,G.jsx)(Lb,{projectId:e.id,releaseId:s.latestRelease?.id??null}),c===null?null:(0,G.jsx)(`p`,{className:`launch-settings__error`,role:`alert`,children:c.message})]})},Bb={profileId:null,name:``,executable:``,args:``,declaredTools:``},Vb=e=>e.split(`
|
|
6
|
+
`).map(e=>e.trim()).filter(e=>e!==``),Hb=e=>({profileId:e.profileId,name:e.name.trim(),executable:e.executable.trim(),args:Vb(e.args),declaredTools:Vb(e.declaredTools)}),Ub={READY:`settings.mcp.probe.ready`,SPAWN_FAILED:`settings.mcp.probe.spawnFailed`,TIMED_OUT:`settings.mcp.probe.timedOut`,INVALID_RESPONSE:`settings.mcp.probe.invalid`,OUTPUT_LIMIT_REACHED:`settings.mcp.probe.outputLimit`,UNSUPPORTED_PROTOCOL:`settings.mcp.probe.unsupported`,PROCESS_EXITED:`settings.mcp.probe.exited`},Wb=({candidate:e})=>(0,G.jsx)(`ol`,{className:`mcp-command`,"aria-label":`argv`,children:[e.executable,...e.args].map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:t===0?`executable`:`argv[${t.toString()}]`}),(0,G.jsx)(`code`,{children:e})]},`${t.toString()}-${e}`))}),Gb=({proposal:e,onCancel:t,onConfirmed:n})=>{let{locale:r,t:i}=Z(),a=Cy(),[o,s]=(0,M.useState)(!1);return(0,G.jsxs)(`div`,{className:`mcp-consent`,children:[(0,G.jsxs)(`div`,{className:`mcp-consent__heading`,children:[(0,G.jsx)(K,{name:`warning`,size:16}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:i(`settings.mcp.consent.title`)}),(0,G.jsx)(`p`,{children:i(`settings.mcp.consent.description`)})]})]}),(0,G.jsx)(Wb,{candidate:e.candidate}),(0,G.jsx)(`p`,{className:`mcp-consent__expiry`,children:i(`settings.mcp.consent.expires`,{time:new Intl.DateTimeFormat(r,{timeStyle:`short`}).format(new Date(e.expiresAt))})}),(0,G.jsx)(eh,{checked:o,description:i(`settings.mcp.consent.checkboxDescription`),label:i(`settings.mcp.consent.checkbox`),onCheckedChange:e=>{s(e===!0)}}),(0,G.jsxs)(`div`,{className:`mcp-actions`,children:[(0,G.jsx)(J,{disabled:!o,loading:a.isPending,onClick:()=>{a.mutate(e,{onSuccess:n})},variant:`primary`,children:i(`settings.mcp.consent.confirm`)}),(0,G.jsx)(J,{disabled:a.isPending,onClick:t,children:i(`action.cancel`)})]}),a.error instanceof Error?(0,G.jsx)(`p`,{className:`mcp-settings__error`,role:`alert`,children:a.error.message}):null]})},Kb=({onRevise:e,profile:t,projectId:n,projectVersion:r})=>{let{t:i}=Z(),a=wy(),o=Ty(),s=Ey(),[c,l]=(0,M.useState)(t.grant?.tools??[]),[u,d]=(0,M.useState)(!1),f=t.capability,p=(0,M.useMemo)(()=>{if(f?.state!==`READY`)return[];let e=new Set(f.tools);return t.revision.declaredTools.filter(t=>e.has(t))},[f,t.revision.declaredTools]),m=a.error instanceof Error?a.error:o.error instanceof Error?o.error:s.error instanceof Error?s.error:null;return(0,M.useEffect)(()=>{l(t.grant?.tools??[]),d(!1)},[t.grant]),(0,G.jsxs)(`article`,{className:`mcp-profile`,children:[(0,G.jsxs)(`div`,{className:`mcp-profile__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:t.revision.name}),(0,G.jsx)(`span`,{children:i(`settings.mcp.revision`,{revision:t.revision.revision})})]}),(0,G.jsx)(`span`,{children:t.grant?.enabled===!0?i(`settings.mcp.grant.enabled`):t.grant===null?i(`settings.mcp.grant.none`):i(`settings.mcp.grant.revoked`)})]}),(0,G.jsx)(Wb,{candidate:{...t.revision,profileId:t.revision.profileId}}),(0,G.jsxs)(`div`,{className:`mcp-profile__capability`,children:[(0,G.jsx)(`strong`,{children:i(`settings.mcp.capability`)}),(0,G.jsx)(`span`,{children:i(f===null?`settings.mcp.probe.notRun`:Ub[f.state])})]}),f?.state===`READY`?(0,G.jsxs)(`div`,{className:`mcp-tools`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:i(`settings.mcp.declaredTools`)}),(0,G.jsx)(`span`,{children:t.revision.declaredTools.join(`, `)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:i(`settings.mcp.discoveredTools`)}),(0,G.jsx)(`span`,{children:f.tools.join(`, `)||i(`settings.mcp.tools.none`)})]})]}):null,(0,G.jsxs)(`div`,{className:`mcp-actions`,children:[(0,G.jsx)(J,{loading:a.isPending,onClick:()=>{a.mutate({projectId:n,revision:t.revision})},size:`sm`,children:i(f===null?`settings.mcp.probe.run`:`settings.mcp.probe.again`)}),(0,G.jsx)(J,{onClick:()=>{e(t)},size:`sm`,children:i(`settings.mcp.revise`)})]}),f?.state===`READY`&&t.grant?.enabled!==!1?(0,G.jsxs)(`div`,{className:`mcp-grant`,children:[(0,G.jsx)(`strong`,{children:i(`settings.mcp.grant.choose`)}),p.map(e=>(0,G.jsx)(eh,{checked:c.includes(e),label:e,onCheckedChange:t=>{l(n=>t===!0?[...new Set([...n,e])].sort():n.filter(t=>t!==e))}},e)),(0,G.jsx)(eh,{checked:u,description:i(`settings.mcp.grant.attestationDescription`),label:i(`settings.mcp.grant.attestation`),onCheckedChange:e=>{d(e===!0)}}),(0,G.jsxs)(`div`,{className:`mcp-actions`,children:[(0,G.jsx)(J,{disabled:!u||c.length===0,loading:o.isPending,onClick:()=>{o.mutate({projectId:n,expectedProjectVersion:r,revision:t.revision,expectedGrantVersion:t.grant?.version??null,tools:c})},size:`sm`,variant:`primary`,children:t.grant===null?i(`settings.mcp.grant.enable`):i(`settings.mcp.grant.update`)}),t.grant?.enabled===!0?(0,G.jsx)(J,{loading:s.isPending,onClick:()=>{s.mutate({projectId:n,expectedProjectVersion:r,revision:t.revision,expectedGrantVersion:t.grant?.version??0})},size:`sm`,children:i(`settings.mcp.grant.revoke`)}):null]})]}):t.grant?.enabled===!1?(0,G.jsx)(`p`,{className:`settings__note`,children:i(`settings.mcp.grant.revokedDescription`)}):null,m===null?null:(0,G.jsx)(`p`,{className:`mcp-settings__error`,role:`alert`,children:m.message})]})},qb=({project:e})=>{let{t}=Z(),n=yy(e.id),r=by(),i=xy(),[a,o]=(0,M.useState)(Bb),[s,c]=(0,M.useState)(null),l=n.data?.profiles??[],u=n.data?.projectVersion??e.version,d=l.some(({revision:e})=>e.name===`Context7`),f=i.error instanceof ag&&i.error.code===`PROFILE_UNCHANGED`,p=Hb(a),m=p.name!==``&&p.executable!==``&&p.declaredTools.length>0&&!r.isPending;(0,M.useEffect)(()=>{o(Bb),c(null)},[e.id]);let h=(e,t)=>{o(n=>({...n,[e]:t})),c(null)};return(0,G.jsxs)(`div`,{className:`mcp-settings`,children:[(0,G.jsx)(`div`,{className:`mcp-settings__heading`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:t(`settings.mcp.title`)}),(0,G.jsx)(`p`,{children:t(`settings.mcp.description`)})]})}),(0,G.jsxs)(`div`,{className:`mcp-preset`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:t(`settings.mcp.context7.title`)}),(0,G.jsx)(`p`,{children:t(`settings.mcp.context7.description`)}),(0,G.jsx)(`p`,{children:t(`settings.mcp.context7.privacy`)}),d?(0,G.jsx)(`p`,{children:t(`settings.mcp.context7.configured`)}):null]}),(0,G.jsx)(J,{loading:i.isPending,onClick:()=>{i.mutate({projectId:e.id,expectedProjectVersion:u},{onSuccess:c})},size:`sm`,children:t(d?`settings.mcp.context7.update`:`settings.mcp.context7.review`)})]}),f?(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.mcp.context7.current`)}):null,n.isPending?(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.mcp.loading`)}):l.length===0?(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.mcp.empty`)}):(0,G.jsx)(`div`,{className:`mcp-profiles`,children:l.map(t=>(0,G.jsx)(Kb,{onRevise:e=>{o({profileId:e.revision.profileId,name:e.revision.name,executable:e.revision.executable,args:e.revision.args.join(`
|
|
7
|
+
`),declaredTools:e.revision.declaredTools.join(`
|
|
8
|
+
`)}),c(null)},profile:t,projectId:e.id,projectVersion:u},t.revision.id))}),(0,G.jsxs)(`form`,{className:`mcp-form`,onSubmit:t=>{t.preventDefault(),m&&r.mutate({projectId:e.id,expectedProjectVersion:u,candidate:p},{onSuccess:c})},children:[(0,G.jsxs)(`div`,{className:`mcp-form__heading`,children:[(0,G.jsx)(`strong`,{children:a.profileId===null?t(`settings.mcp.add`):t(`settings.mcp.newRevision`)}),a.profileId===null?null:(0,G.jsx)(J,{onClick:()=>{o(Bb),c(null)},size:`sm`,type:`button`,children:t(`settings.mcp.cancelRevision`)})]}),(0,G.jsx)(X,{htmlFor:`mcp-profile-name`,label:t(`settings.mcp.name`),children:(0,G.jsx)(Qm,{id:`mcp-profile-name`,onChange:e=>{h(`name`,e.target.value)},value:a.name})}),(0,G.jsx)(X,{description:t(`settings.mcp.executableDescription`),htmlFor:`mcp-profile-executable`,label:t(`settings.mcp.executable`),children:(0,G.jsx)(Qm,{autoComplete:`off`,id:`mcp-profile-executable`,onChange:e=>{h(`executable`,e.target.value)},placeholder:`/absolute/path/to/mcp-server`,spellCheck:!1,value:a.executable})}),(0,G.jsx)(X,{description:t(`settings.mcp.argsDescription`),htmlFor:`mcp-profile-args`,label:t(`settings.mcp.args`),children:(0,G.jsx)($m,{id:`mcp-profile-args`,onChange:e=>{h(`args`,e.target.value)},rows:3,spellCheck:!1,value:a.args})}),(0,G.jsx)(X,{description:t(`settings.mcp.toolsDescription`),htmlFor:`mcp-profile-tools`,label:t(`settings.mcp.declaredTools`),required:!0,children:(0,G.jsx)($m,{id:`mcp-profile-tools`,onChange:e=>{h(`declaredTools`,e.target.value)},rows:3,spellCheck:!1,value:a.declaredTools})}),(0,G.jsx)(J,{disabled:!m,loading:r.isPending,type:`submit`,children:t(`settings.mcp.review`)})]}),s===null?null:(0,G.jsx)(Gb,{onCancel:()=>{c(null)},onConfirmed:()=>{c(null),o(Bb)},proposal:s}),r.error instanceof Error?(0,G.jsx)(`p`,{className:`mcp-settings__error`,role:`alert`,children:r.error.message}):i.error instanceof Error&&!f?(0,G.jsx)(`p`,{className:`mcp-settings__error`,role:`alert`,children:i.error.message}):n.error instanceof Error?(0,G.jsx)(`p`,{className:`mcp-settings__error`,role:`alert`,children:n.error.message}):null,(0,G.jsxs)(`p`,{className:`mcp-settings__limit`,children:[(0,G.jsx)(K,{name:`info`,size:14}),(0,G.jsx)(`span`,{children:t(`settings.mcp.limit`)})]})]})},Jb=()=>{let{t:e}=Z(),{selectProject:t}=Kv(),n=(0,M.useId)(),r=(0,M.useId)(),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(null),u=jy(),d=My(),f=Ny(),p=Py(),m=d.data?.at(0)??null,h=i.trim(),g=u.error instanceof Error?u.error.message:f.error instanceof Error?f.error.message:p.error instanceof Error?p.error.message:null,_=e=>{l(e),e.status===`COMPLETED`&&t(e.projectId)};return(0,M.useEffect)(()=>{o===null&&c===null&&m!==null&&(a(m.proposal.targetPath),s(m.proposal),l(m))},[c,o,m]),(0,G.jsxs)(`section`,{"aria-labelledby":r,className:`project-scaffold`,children:[(0,G.jsxs)(`div`,{className:`project-scaffold__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{id:r,children:e(`settings.projects.create.title`)}),(0,G.jsx)(`p`,{children:e(`settings.projects.create.description`)})]}),(0,G.jsx)(`span`,{children:e(`settings.projects.create.recipe`)})]}),o===null?(0,G.jsxs)(`form`,{className:`project-scaffold__form`,onSubmit:e=>{e.preventDefault(),h!==``&&u.mutate(h,{onSuccess:e=>{s(e),l(null)}})},children:[(0,G.jsx)(X,{description:e(`settings.projects.create.pathDescription`),htmlFor:n,label:e(`settings.projects.create.path`),...g===null?{}:{error:g},children:(0,G.jsx)(Qm,{autoComplete:`off`,id:n,invalid:g!==null,onChange:e=>{a(e.target.value),u.reset()},placeholder:e(`settings.projects.create.placeholder`),size:`md`,spellCheck:!1,value:i})}),(0,G.jsx)(`p`,{className:`project-scaffold__boundary`,role:`note`,children:e(`settings.projects.create.boundary`)}),(0,G.jsx)(J,{disabled:h===``,loading:u.isPending,type:`submit`,children:e(`settings.projects.create.review`)})]}):(0,G.jsxs)(`div`,{className:`project-scaffold__review`,children:[(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e(`settings.projects.create.target`)}),(0,G.jsx)(`dd`,{title:o.targetPath,children:o.targetPath})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e(`settings.projects.create.version`)}),(0,G.jsxs)(`dd`,{children:[o.recipeId,`@`,o.recipeVersion]})]})]}),(0,G.jsxs)(`div`,{className:`project-scaffold__files`,children:[(0,G.jsx)(`strong`,{children:e(`settings.projects.create.files`)}),(0,G.jsxs)(`ul`,{children:[o.files.map(t=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`code`,{children:t.path}),(0,G.jsx)(`span`,{children:e(`settings.projects.create.bytes`,{count:t.bytes})})]},t.path)),(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`code`,{children:o.systemFiles[0]}),(0,G.jsx)(`span`,{children:e(`settings.projects.create.marker`)})]})]})]}),(0,G.jsxs)(`p`,{className:`project-scaffold__digest`,children:[(0,G.jsx)(`span`,{children:e(`settings.projects.create.digest`)}),(0,G.jsx)(`code`,{children:o.proposalDigest})]}),(0,G.jsx)(`p`,{className:`project-scaffold__boundary`,role:`note`,children:e(`settings.projects.create.confirmation`)}),c?.status===`COMPLETED`?(0,G.jsxs)(`div`,{"aria-live":`polite`,className:`project-scaffold__result is-complete`,role:`status`,children:[(0,G.jsx)(K,{name:`check`,size:16}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e(`settings.projects.create.completed`)}),(0,G.jsx)(`p`,{children:e(`settings.projects.create.next`)}),(0,G.jsxs)(`ol`,{children:[(0,G.jsxs)(`li`,{children:[e(`settings.projects.create.openTerminal`),` `,(0,G.jsx)(`code`,{children:o.targetPath})]}),(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{children:`pnpm install`})}),(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{children:`pnpm test`})})]})]})]}):c?.status===`FAILED`?(0,G.jsxs)(`div`,{"aria-live":`polite`,className:`project-scaffold__result is-failed`,role:`alert`,children:[(0,G.jsx)(K,{name:`warning`,size:16}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e(`settings.projects.create.failed`)}),(0,G.jsx)(`p`,{children:e(`settings.projects.create.failedDescription`,{code:c.lastErrorCode??`SCAFFOLD_WRITE_FAILED`})})]})]}):c?.status===`PENDING`?(0,G.jsx)(`div`,{"aria-live":`polite`,className:`project-scaffold__result`,role:`status`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e(`settings.projects.create.pending`)}),(0,G.jsx)(`p`,{children:e(`settings.projects.create.pendingDescription`)})]})}):null,g===null?null:(0,G.jsx)(`p`,{className:`project-scaffold__error`,role:`alert`,children:g}),(0,G.jsx)(`div`,{className:`project-scaffold__actions`,children:c===null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{disabled:f.isPending,onClick:()=>{s(null),f.reset()},type:`button`,variant:`secondary`,children:e(`action.back`)}),(0,G.jsx)(J,{loading:f.isPending,onClick:()=>{f.mutate(o,{onSuccess:_})},type:`button`,variant:`primary`,children:e(`settings.projects.create.confirm`)})]}):c.status===`FAILED`?(0,G.jsx)(J,{loading:p.isPending,onClick:()=>{p.mutate(c,{onSuccess:_})},type:`button`,children:e(`settings.projects.create.retry`)}):(0,G.jsx)(J,{onClick:()=>{s(null),l(null),a(``)},type:`button`,variant:`secondary`,children:e(`settings.projects.create.another`)})})]})]})},Yb=({acceptedRisk:e,confirmingShared:t,error:n,onAcceptedRiskChange:r,onCancelShared:i,onConfirmShared:a,onRequestShared:o,onSelectIsolated:s,repositoryPath:c,saving:l,selection:u})=>{let{t:d}=Z();return(0,G.jsxs)(`div`,{className:`workspace-strategy-settings`,children:[(0,G.jsxs)(`div`,{className:`workspace-strategy-settings__heading`,children:[(0,G.jsx)(`h4`,{children:d(`settings.workspaceStrategy.title`)}),(0,G.jsx)(`p`,{children:d(`settings.workspaceStrategy.description`)})]}),(0,G.jsxs)(`fieldset`,{className:`workspace-strategy-settings__choices`,children:[(0,G.jsx)(`legend`,{children:d(`settings.workspaceStrategy.label`)}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{checked:u.strategy===`ISOLATED_WORKTREE`,disabled:l,name:`project-workspace-strategy`,onChange:s,type:`radio`,value:`ISOLATED_WORKTREE`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:d(`settings.workspaceStrategy.isolated`)}),(0,G.jsx)(`small`,{children:d(`settings.workspaceStrategy.isolatedDescription`)})]})]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{checked:u.strategy===`SHARED_CURRENT_DIRECTORY`,disabled:l,name:`project-workspace-strategy`,onChange:o,type:`radio`,value:`SHARED_CURRENT_DIRECTORY`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:d(`settings.workspaceStrategy.shared`)}),(0,G.jsx)(`small`,{children:d(`settings.workspaceStrategy.sharedDescription`,{path:c})})]})]})]}),(0,G.jsx)(`p`,{className:`workspace-strategy-settings__scope`,role:`note`,children:d(`settings.workspaceStrategy.scope`)}),t?(0,G.jsxs)(`div`,{className:`workspace-strategy-settings__confirmation`,role:`note`,children:[(0,G.jsx)(`strong`,{children:d(`settings.workspaceStrategy.confirmTitle`)}),(0,G.jsx)(`p`,{children:d(`settings.workspaceStrategy.confirmDescription`,{path:c})}),(0,G.jsxs)(`ul`,{children:[(0,G.jsx)(`li`,{children:d(`settings.workspaceStrategy.confirmFiles`)}),(0,G.jsx)(`li`,{children:d(`settings.workspaceStrategy.confirmExternalTools`)}),(0,G.jsx)(`li`,{children:d(`settings.workspaceStrategy.confirmSerial`)})]}),(0,G.jsx)(eh,{checked:e,label:d(`settings.workspaceStrategy.acknowledge`),onCheckedChange:e=>{r(e===!0)}}),(0,G.jsxs)(`div`,{className:`workspace-strategy-settings__actions`,children:[(0,G.jsx)(J,{disabled:!e,loading:l,onClick:a,variant:`primary`,children:d(`settings.workspaceStrategy.confirm`)}),(0,G.jsx)(J,{disabled:l,onClick:i,children:d(`action.cancel`)})]})]}):null,n===null?null:(0,G.jsx)(`p`,{className:`workspace-strategy-settings__error`,role:`alert`,children:n})]})},Xb=({project:e})=>{let{t}=Z(),n=py(e.id),r=_y(),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(!1),c=n.data?.selection,l=r.error instanceof Error?r.error.message:n.error instanceof Error?n.error.message:null;return c===void 0?(0,G.jsxs)(`div`,{className:`workspace-strategy-settings`,children:[(0,G.jsxs)(`div`,{className:`workspace-strategy-settings__heading`,children:[(0,G.jsx)(`h4`,{children:t(`settings.workspaceStrategy.title`)}),(0,G.jsx)(`p`,{children:t(`settings.workspaceStrategy.description`)})]}),(0,G.jsx)(`p`,{className:`settings__note`,children:l??t(`settings.workspaceStrategy.loading`)})]}):(0,G.jsx)(Yb,{acceptedRisk:o,confirmingShared:i,error:l,onAcceptedRiskChange:s,onCancelShared:()=>{a(!1),s(!1)},onConfirmShared:()=>{o&&r.mutate({selection:c,strategy:`SHARED_CURRENT_DIRECTORY`},{onSuccess:()=>{a(!1),s(!1)}})},onRequestShared:()=>{c.strategy!==`SHARED_CURRENT_DIRECTORY`&&(r.reset(),s(!1),a(!0))},onSelectIsolated:()=>{a(!1),s(!1),c.strategy!==`ISOLATED_WORKTREE`&&(r.reset(),r.mutate({selection:c,strategy:`ISOLATED_WORKTREE`}))},repositoryPath:e.repositoryPath,saving:r.isPending,selection:c})},Zb=e=>e%60==0?{count:e/60,unit:`minutes`}:{count:e,unit:`seconds`},Qb=({recipe:e})=>{let{t}=Z(),n=Zb(e.timeoutSeconds);return(0,G.jsxs)(`dl`,{className:`verification-recipe__policy`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.verification.cwd`)}),(0,G.jsx)(`dd`,{children:e.cwd===`.`?t(`settings.verification.projectRoot`):e.cwd})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.verification.timeout`)}),(0,G.jsx)(`dd`,{children:t(n.unit===`minutes`?`settings.verification.minutes`:`settings.verification.seconds`,{count:n.count})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.verification.output`)}),(0,G.jsx)(`dd`,{children:t(`settings.verification.kib`,{count:e.outputLimitBytes/1024})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.verification.network`)}),(0,G.jsx)(`dd`,{children:t(e.networkPolicy===`INHERIT_HOST`?`settings.verification.networkHost`:`settings.verification.networkUnavailable`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`settings.verification.environment`)}),(0,G.jsx)(`dd`,{children:t(`settings.verification.environmentBaseline`)})]})]})},$b=({recipe:e})=>{let{t}=Z(),n=[e.executable,...e.argv].join(` `);return(0,G.jsxs)(`article`,{className:`verification-recipe`,children:[(0,G.jsxs)(`div`,{className:`verification-recipe__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e.label}),(0,G.jsx)(`span`,{children:t(e.required?`settings.verification.required`:`settings.verification.optional`)})]}),(0,G.jsx)(`span`,{children:e.kind})]}),(0,G.jsxs)(`div`,{className:`verification-recipe__command`,children:[(0,G.jsx)(`span`,{children:t(`settings.verification.exactCommand`)}),(0,G.jsxs)(`ol`,{"aria-label":n,children:[(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`small`,{children:t(`settings.verification.executable`)}),(0,G.jsx)(`code`,{children:e.executable})]}),e.argv.map((e,n)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`small`,{children:t(`settings.verification.argument`,{index:n+1})}),(0,G.jsx)(`code`,{children:e})]},`${n.toString()}-${e}`))]})]}),(0,G.jsx)(Qb,{recipe:e}),(0,G.jsxs)(`details`,{className:`verification-recipe__source`,children:[(0,G.jsx)(`summary`,{children:t(`settings.verification.source`,{script:e.provenance.scriptName})}),(0,G.jsx)(`code`,{children:e.provenance.scriptBodyPreview}),(0,G.jsx)(`p`,{children:t(`settings.verification.sourceNotice`)})]})]})},ex=({adopting:e,disabling:t,onAdopt:n,onDisable:r,onRetry:i,retrying:a,settings:o})=>{let{t:s}=Z(),{plan:c,proposal:l,publication:u}=o,d=l.recipes.filter(e=>e.required).length,f=c?.status===`ACTIVE`&&JSON.stringify(c.recipes)===JSON.stringify(l.recipes),p=l.target.state===`BLOCKED`,m=p||l.recipes.length===0||d===0,h=!f,g=u?.status===`APPLIED`,_=u?.status===`FAILED`,v=u?.status===`PENDING`;return(0,G.jsxs)(`div`,{className:`verification-settings`,children:[(0,G.jsxs)(`div`,{className:`verification-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:s(`settings.verification.title`)}),(0,G.jsx)(`p`,{children:s(`settings.verification.description`)})]}),c===null?null:(0,G.jsxs)(`span`,{className:q(`verification-settings__state`,g&&c.status===`ACTIVE`&&`is-ready`),children:[(0,G.jsx)(K,{name:g&&c.status===`ACTIVE`?`check`:`warning`,size:13}),g&&c.status===`DISABLED`?s(`settings.verification.disabled`,{revision:c.revision}):s(g?`settings.verification.active`:v?`settings.verification.publishing`:`settings.verification.unpublished`,{revision:c.revision})]})]}),(0,G.jsxs)(`div`,{className:`verification-settings__local-warning`,role:`note`,children:[(0,G.jsx)(`strong`,{children:s(`settings.verification.localExecutionTitle`)}),(0,G.jsx)(`p`,{children:s(`settings.verification.localExecutionNotice`)})]}),l.recipes.length===0?(0,G.jsx)(`p`,{className:`settings__note`,children:s(`settings.verification.empty`)}):(0,G.jsx)(`div`,{className:`verification-recipes`,"aria-label":s(`settings.verification.list`),children:l.recipes.map(e=>(0,G.jsx)($b,{recipe:e},e.id))}),l.warnings.length===0?null:(0,G.jsxs)(`div`,{className:`verification-settings__warnings`,role:`note`,children:[(0,G.jsx)(`strong`,{children:s(`settings.verification.warnings`)}),(0,G.jsx)(`ul`,{children:l.warnings.map((e,t)=>(0,G.jsx)(`li`,{children:e.message},`${e.code}-${t.toString()}`))})]}),p?(0,G.jsx)(`p`,{className:`verification-settings__error`,role:`alert`,children:s(`settings.verification.targetBlocked`)}):null,h?(0,G.jsxs)(`div`,{className:`verification-settings__adoption`,children:[(0,G.jsx)(`p`,{children:s(c?.status===`DISABLED`?`settings.verification.enableNotice`:`settings.verification.adoptionNotice`)}),(0,G.jsx)(J,{disabled:m,loading:e,onClick:n,type:`button`,variant:`primary`,children:c===null?s(`settings.verification.adopt`,{count:d}):c.status===`DISABLED`?s(`settings.verification.enable`,{count:d}):s(`settings.verification.replace`,{count:d})})]}):g?(0,G.jsx)(`div`,{className:`verification-settings__adoption`,children:(0,G.jsxs)(`p`,{className:`verification-settings__published`,children:[(0,G.jsx)(K,{name:`check`,size:14}),(0,G.jsx)(`span`,{children:s(`settings.verification.published`)})]})}):null,c?.status===`ACTIVE`?(0,G.jsx)(`div`,{className:`verification-settings__actions`,children:(0,G.jsx)(J,{loading:t,onClick:r,type:`button`,children:s(`settings.verification.disable`)})}):null,_?(0,G.jsxs)(`div`,{className:`verification-settings__failure`,role:`alert`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:s(`settings.verification.publicationFailed`)}),(0,G.jsx)(`span`,{children:u.lastErrorCode??s(`error.unknown`)})]}),(0,G.jsx)(J,{loading:a,onClick:i,type:`button`,children:s(`settings.verification.retry`)})]}):null]})},tx=({project:e})=>{let{t}=Z(),n=By(e.id),r=Vy(),i=Hy(),a=Uy(),o=n.data,s=r.error instanceof Error?r.error:i.error instanceof Error?i.error:a.error instanceof Error?a.error:n.error instanceof Error?n.error:null;return o===void 0?(0,G.jsxs)(`div`,{className:`verification-settings`,children:[(0,G.jsx)(`div`,{className:`verification-settings__heading`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:t(`settings.verification.title`)}),(0,G.jsx)(`p`,{children:t(`settings.verification.description`)})]})}),(0,G.jsx)(`p`,{className:`settings__note`,children:s===null?t(`settings.verification.loading`):s.message})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ex,{adopting:r.isPending,disabling:i.isPending,onAdopt:()=>{r.mutate(o)},onDisable:()=>{i.mutate(o)},onRetry:()=>{o.publication!==null&&a.mutate({projectId:e.id,publication:o.publication})},retrying:a.isPending,settings:o}),s===null?null:(0,G.jsx)(`p`,{className:`verification-settings__error`,role:`alert`,children:s.message})]})},nx=(0,M.createContext)(null),rx=()=>{let e=(0,M.useContext)(nx);if(e===null)throw Error(`useOpenAppSettings must be used inside AppFrame`);return e},ix=[`comfortable`,`compact`],ax=`loomrail-density`,ox=e=>e!==null&&ix.some(t=>t===e),sx=()=>{let e=window.localStorage.getItem(ax);return ox(e)?e:`comfortable`},cx=e=>{if(e===`comfortable`){document.documentElement.removeAttribute(`data-density`),window.localStorage.removeItem(ax);return}document.documentElement.dataset.density=e,window.localStorage.setItem(ax,e)},lx=[`light`,`dark`,`system`],ux=`loomrail-theme`,dx=e=>e!==null&&lx.some(t=>t===e),fx=()=>{let e=window.localStorage.getItem(ux);return dx(e)?e:`system`},px=e=>{if(e===`system`){document.documentElement.removeAttribute(`data-theme`),window.localStorage.removeItem(ux);return}document.documentElement.dataset.theme=e,window.localStorage.setItem(ux,e)},mx=()=>{let{t:e}=Z(),[t,n]=(0,M.useState)(!1),r=(0,M.useRef)(null),{projects:i,selectedProject:a}=Kv(),o=lb(),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(`MEDIUM`),[d,f]=(0,M.useState)(`TASK`),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(``),[_,v]=(0,M.useState)(``),y=_.split(`
|
|
9
|
+
`).map(e=>e.trim()).filter(Boolean),b=y.length>0&&y.length<=50&&new Set(y).size===y.length&&y.every(e=>e.length<=500),x=i.find(e=>e.id===s)?.id??a?.id??``,S=qv(x||void 0),C=(S.data?.workItems??[]).filter(({state:e})=>e!==`DONE`&&e!==`CANCELLED`);return(0,M.useEffect)(()=>{m(null)},[x]),(0,G.jsx)(ph,{closeLabel:e(`action.closeDialog`),description:e(`task.create.description`),footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{disabled:o.isPending,onClick:()=>{n(!1)},children:e(`action.cancel`)}),(0,G.jsx)(J,{disabled:!h.trim()||!x||!b,loading:o.isPending,onClick:()=>{r.current?.requestSubmit()},type:`button`,variant:`primary`,children:e(`task.create.submit`)})]}),onOpenChange:e=>{e||(g(``),v(``),m(null),f(`TASK`),o.reset()),n(e)},open:t,title:e(`task.new`),trigger:(0,G.jsx)(J,{disabled:!a,icon:`add`,variant:`primary`,children:e(`task.new`)}),children:(0,G.jsxs)(`form`,{className:`new-task-form`,id:`new-task-form`,onSubmit:e=>{e.preventDefault();let t=e.currentTarget,r=new FormData(t),i=r.get(`title`),a=r.get(`description`),s=typeof i==`string`?i.trim():``,c=typeof a==`string`?a.trim():``;!s||!x||!b||o.mutate({acceptanceCriteria:y,description:c,priority:l,projectId:x,parentId:p,risk:`MEDIUM`,title:s,type:d},{onSuccess:()=>{t.reset(),v(``),g(``),m(null),f(`TASK`),n(!1)}})},ref:r,children:[o.error?(0,G.jsx)($,{error:o.error,onRetry:()=>{r.current?.requestSubmit()},retrying:o.isPending}):null,(0,G.jsx)(X,{htmlFor:`new-task-title`,label:e(`task.create.title`),required:!0,children:(0,G.jsx)(Qm,{autoFocus:!0,id:`new-task-title`,name:`title`,onChange:e=>{g(e.currentTarget.value)},placeholder:e(`task.create.titlePlaceholder`),required:!0,value:h})}),(0,G.jsx)(X,{description:e(`task.create.briefDescription`),htmlFor:`new-task-brief`,label:e(`task.create.brief`),children:(0,G.jsx)($m,{"aria-describedby":`new-task-brief-description`,id:`new-task-brief`,name:`description`,placeholder:e(`task.create.briefPlaceholder`),rows:5})}),(0,G.jsx)(X,{description:e(`task.create.criteriaDescription`),..._.trim()&&!b?{error:e(`task.create.criteriaError`)}:{},htmlFor:`new-task-criteria`,label:e(`task.create.criteria`),required:!0,children:(0,G.jsx)($m,{id:`new-task-criteria`,name:`acceptanceCriteria`,onChange:e=>{v(e.currentTarget.value)},placeholder:e(`task.create.criteriaPlaceholder`),required:!0,rows:3,value:_})}),(0,G.jsxs)(`div`,{className:`new-task-form__row`,children:[(0,G.jsx)(X,{htmlFor:`new-task-project`,label:e(`task.create.project`),children:(0,G.jsx)(rh,{ariaLabel:e(`task.create.project`),id:`new-task-project`,onValueChange:c,options:i.map(e=>({label:e.name,value:e.id})),value:x})}),(0,G.jsx)(X,{htmlFor:`new-task-priority`,label:e(`task.create.priority`),children:(0,G.jsx)(rh,{ariaLabel:e(`task.create.priority`),id:`new-task-priority`,onValueChange:e=>{u(Ep.parse(e))},options:[{label:e(`priority.LOW`),value:`LOW`},{label:e(`priority.MEDIUM`),value:`MEDIUM`},{label:e(`priority.HIGH`),value:`HIGH`},{label:e(`priority.URGENT`),value:`URGENT`}],value:l})})]}),(0,G.jsxs)(`div`,{className:`new-task-form__row`,children:[(0,G.jsx)(X,{htmlFor:`new-task-type`,label:e(`task.create.type`),children:(0,G.jsx)(rh,{ariaLabel:e(`task.create.type`),id:`new-task-type`,onValueChange:e=>{f(wp.parse(e))},options:[`EPIC`,`FEATURE`,`TASK`,`BUG`,`SPIKE`,`SUBTASK`].map(t=>({label:e(`type.${t}`),value:t})),value:d})}),(0,G.jsx)(X,{description:e(`task.create.parentDescription`),htmlFor:`new-task-parent`,label:e(`task.create.parent`),children:(0,G.jsx)(rh,{ariaLabel:e(`task.create.parent`),disabled:S.isPending||C.length===0,id:`new-task-parent`,onValueChange:e=>{m(e===`none`?null:e)},options:[{label:e(`task.create.noParent`),value:`none`},...C.map(e=>({label:e.title,value:e.id}))],value:p??`none`})})]})]})})},hx=({description:e,label:t,onChange:n,options:r,value:i})=>{let a=(0,M.useId)();return(0,G.jsxs)(`div`,{className:`setting`,children:[(0,G.jsx)(`span`,{className:`setting__label`,id:a,children:t}),(0,G.jsx)(`div`,{"aria-labelledby":a,className:`setting__choices`,role:`group`,children:r.map(e=>(0,G.jsxs)(`button`,{"aria-pressed":i===e.value,onClick:()=>{n(e.value)},type:`button`,children:[e.icon?(0,G.jsx)(K,{name:e.icon,size:15}):null,(0,G.jsx)(`span`,{children:e.label})]},e.value))}),e?(0,G.jsx)(`small`,{className:`setting__hint`,children:e}):null]})},gx=({project:e})=>{let{t}=Z(),n=ky(),r=e.fixtureId,i=n.error instanceof Error?n.error.message:null;return(0,G.jsxs)(`div`,{className:`settings__project-repair`,children:[(0,G.jsx)(`p`,{className:`settings__note`,role:`note`,children:t(`settings.projects.unusable`)}),r===null?null:(0,G.jsx)(J,{loading:n.isPending,onClick:()=>{n.mutate(r)},children:t(`settings.projects.repair`)}),i===null?null:(0,G.jsx)(`p`,{className:`settings__project-error`,role:`alert`,children:i})]})},_x=()=>{let{t:e}=Z(),t=(0,M.useId)(),[n,r]=(0,M.useState)(``),i=Ay(),a=i.error instanceof Error?i.error.message:null,o=n.trim();return(0,G.jsxs)(`form`,{className:`settings__register`,onSubmit:e=>{e.preventDefault(),o!==``&&i.mutate(o,{onSuccess:()=>{r(``)}})},children:[(0,G.jsx)(X,{description:e(`settings.projects.register.description`),htmlFor:t,label:e(`settings.projects.register.label`),...a===null?{}:{error:a},children:(0,G.jsx)(Qm,{autoComplete:`off`,id:t,invalid:a!==null,onChange:e=>{r(e.target.value)},placeholder:e(`settings.projects.register.placeholder`),size:`md`,spellCheck:!1,value:n})}),(0,G.jsx)(J,{disabled:o===``,loading:i.isPending,type:`submit`,children:e(`settings.projects.register.action`)})]})},vx={MOCK:`Historical test provider`,CODEX:`Codex CLI`,CLAUDE_CODE:`Claude Code CLI`},yx=e=>e?.installed===!1||e?.compatibility===`MISSING`?`settings.provider.status.notInstalled`:e?.compatibility===`TOO_OLD`?`settings.provider.status.tooOld`:e?.compatibility===`UNVERIFIED`?`settings.provider.status.unverified`:e?.compatibility===`UNLAUNCHABLE`||e?.compatibility===`VERSION_UNREADABLE`?`settings.provider.status.versionUnreadable`:e?.authentication===`REQUIRED`?`settings.provider.status.authRequired`:e?.ready===!0?`settings.provider.status.ready`:e?.tokenBudgetEnforcement===`POST_SESSION`?`settings.provider.status.noHardTokenBudget`:`settings.provider.status.unknown`,bx=({project:e})=>{let{t}=Z(),n=fy(e.id),r=gy(),i=vy(),a=n.data,o=a?.providers.find(({provider:e})=>e===a.effectiveProvider),s=r.error instanceof Error?r.error:i.error instanceof Error?i.error:n.error instanceof Error?n.error:null,c=yx(o);return(0,G.jsxs)(`div`,{className:`provider-settings`,children:[(0,G.jsxs)(`div`,{className:`provider-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:t(`settings.provider.title`)}),(0,G.jsx)(`p`,{children:t(`settings.provider.description`)})]}),a===void 0?null:(0,G.jsx)(`span`,{className:o?.ready===!0?`is-ready`:`is-attention`,children:t(c)})]}),(0,G.jsx)(X,{htmlFor:`project-provider-preference`,label:t(`settings.provider.label`),children:(0,G.jsx)(rh,{ariaLabel:t(`settings.provider.label`),disabled:a===void 0||a.environmentOverrideLocked||r.isPending,id:`project-provider-preference`,onValueChange:t=>{r.mutate({project:e,preference:Dc.parse(t)})},options:[{label:t(`settings.provider.option.auto`),description:t(`settings.provider.option.auto.description`),value:`AUTO`},{label:`Codex CLI`,value:`CODEX`},{label:`Claude Code CLI`,value:`CLAUDE_CODE`}],value:a?.selection.preference??e.providerPreference})}),a===void 0?(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.provider.loading`)}):(0,G.jsxs)(`div`,{className:`provider-settings__summary`,children:[(0,G.jsx)(`p`,{children:t(`settings.provider.effective`,{provider:vx[a.effectiveProvider]})}),a.fallbackReason===`NO_READY_LIVE_PROVIDER`?(0,G.jsx)(`p`,{children:t(`settings.provider.fallback`)}):null,a.fallbackReason===`LIVE_PROVIDER_UNAVAILABLE`?(0,G.jsx)(`p`,{role:`alert`,children:t(`settings.provider.selectedUnavailable`)}):null,a.environmentOverrideLocked?(0,G.jsx)(`p`,{role:`note`,children:a.environmentOverrideInvalid?t(`settings.provider.overrideInvalid`):t(`settings.provider.override`,{provider:vx[a.environmentOverride??`CODEX`]})}):null,(0,G.jsx)(`ul`,{"aria-label":t(`settings.provider.compatibility`),className:`provider-settings__compatibility`,children:a.providers.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:vx[e.provider]}),(0,G.jsxs)(`span`,{children:[e.version===null?``:`v${e.version} · `,t(yx(e))]})]},e.provider))})]}),(0,G.jsx)(J,{loading:i.isPending,onClick:()=>{i.mutate(e.id)},size:`sm`,children:t(`settings.provider.refresh`)}),s===null?null:(0,G.jsx)(`p`,{className:`provider-settings__error`,role:`alert`,children:s.message})]})},xx=({project:e})=>{let{t}=Z(),n=Fy(),r=Iy(e.id),i=Ly(),a=Ry(),o=zy(),[s,c]=(0,M.useState)(`AUTO`),l=r.data,u=l?.latestProposal??null,d=l?.publication??null,f=l?.activeConstitution??null,p=u?.scan.targetConstitution.state===`BLOCKED`,m=i.error instanceof Error?i.error:a.error instanceof Error?a.error:o.error instanceof Error?o.error:r.error instanceof Error?r.error:null;return(0,G.jsxs)(`div`,{className:`constitution-settings`,children:[(0,G.jsxs)(`div`,{className:`constitution-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:t(`settings.constitution.title`)}),(0,G.jsx)(`p`,{children:t(`settings.constitution.description`)})]}),f===null?null:(0,G.jsxs)(`span`,{className:`constitution-settings__state`,children:[(0,G.jsx)(K,{name:`check`,size:13}),t(`settings.constitution.activeVersion`,{ordinal:f.ordinal})]})]}),(0,G.jsxs)(`div`,{className:`constitution-settings__scan`,children:[(0,G.jsx)(X,{htmlFor:`constitution-preset`,label:t(`settings.constitution.preset`),children:(0,G.jsx)(rh,{ariaLabel:t(`settings.constitution.preset`),disabled:n.isPending||e.repositoryStatus!==`READY`,id:`constitution-preset`,onValueChange:e=>{c(e===`AUTO`?`AUTO`:Cd.parse(e))},options:[{label:t(`settings.constitution.presetAuto`),value:`AUTO`},...n.data?.presets.map(e=>({description:e.description,label:e.name,value:e.id}))??[]],value:s})}),(0,G.jsx)(J,{disabled:e.repositoryStatus!==`READY`,loading:i.isPending,onClick:()=>{i.mutate({project:e,...s===`AUTO`?{}:{presetId:s}})},children:t(u===null?`settings.constitution.scan`:`settings.constitution.rescan`)})]}),u===null?(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.constitution.empty`)}):(0,G.jsxs)(`div`,{className:`constitution-proposal`,children:[(0,G.jsxs)(`div`,{className:`constitution-proposal__summary`,children:[(0,G.jsx)(`strong`,{children:t(`settings.constitution.proposal`)}),(0,G.jsx)(`span`,{children:t(`settings.constitution.sourceSummary`,{files:u.scan.files.length,preset:u.presetId})})]}),(0,G.jsx)(`p`,{className:`settings__note`,children:t(`settings.constitution.reviewHint`)}),u.scan.warnings.length===0?null:(0,G.jsxs)(`div`,{className:`constitution-proposal__warnings`,role:`note`,children:[(0,G.jsx)(`strong`,{children:t(`settings.constitution.warnings`)}),(0,G.jsx)(`ul`,{children:u.scan.warnings.map((e,t)=>(0,G.jsx)(`li`,{children:e.message},`${e.code}-${t.toString()}`))})]}),(0,G.jsx)(`div`,{className:`constitution-proposal__sections`,children:u.sections.map(e=>(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{children:e.title}),(0,G.jsx)(`pre`,{children:e.body}),(0,G.jsxs)(`small`,{children:[t(`settings.constitution.sources`),`:`,` `,e.sources.map(e=>e.reference).join(`, `)]})]},e.key))}),p?(0,G.jsx)(`p`,{className:`constitution-settings__error`,role:`alert`,children:t(`settings.constitution.targetBlocked`)}):null,u.status===`PROPOSED`?(0,G.jsx)(J,{disabled:p,loading:a.isPending,onClick:()=>{a.mutate({project:e,proposal:u})},variant:`primary`,children:t(f===null?`settings.constitution.adopt`:`settings.constitution.replace`)}):null]}),d?.status===`FAILED`?(0,G.jsxs)(`div`,{className:`constitution-settings__failure`,role:`alert`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:t(`settings.constitution.failed`)}),(0,G.jsx)(`span`,{children:d.lastErrorCode??t(`error.unknown`)})]}),(0,G.jsx)(J,{loading:o.isPending,onClick:()=>{o.mutate({projectId:e.id,publication:d})},children:t(`settings.constitution.retry`)})]}):null,m===null?null:(0,G.jsx)(`p`,{className:`constitution-settings__error`,role:`alert`,children:m.message})]})},Sx={SECURITY:`settings.readiness.category.security`,LEGAL:`settings.readiness.category.legal`,PAYMENTS:`settings.readiness.category.payments`,ANALYTICS:`settings.readiness.category.analytics`,DEPENDENCIES:`settings.readiness.category.dependencies`,ENVIRONMENT:`settings.readiness.category.environment`,OPERATIONS:`settings.readiness.category.operations`},Cx=Object.keys(Sx),wx={SECURITY_ACTIVE_CONSTITUTION:`settings.readiness.check.activeConstitution`,SECURITY_SECRET_PATHS:`settings.readiness.check.secretPaths`,SECURITY_ENV_IGNORED:`settings.readiness.check.envIgnored`,SECURITY_CI_HARDENING:`settings.readiness.check.ciHardening`,LEGAL_LICENSE:`settings.readiness.check.license`,LEGAL_OWNER_REVIEW:`settings.readiness.check.legalOwner`,PAYMENTS_OWNER_REVIEW:`settings.readiness.check.paymentsOwner`,ANALYTICS_OWNER_REVIEW:`settings.readiness.check.analyticsOwner`,DEPS_LOCKFILE_PRESENT:`settings.readiness.check.lockfile`,ENV_PROD_SEPARATION:`settings.readiness.check.envProdSeparation`,SECURITY_HEADERS_OWNER_REVIEW:`settings.readiness.check.securityHeadersOwner`,OPS_HEALTH_ENDPOINT_DECLARED:`settings.readiness.check.healthEndpoint`,OPS_ROLLBACK_PLAN:`settings.readiness.check.rollbackPlan`,OPS_BACKUP:`settings.readiness.check.backup`},Tx={PASSED:`settings.readiness.status.passed`,ACTION_REQUIRED:`settings.readiness.status.action`,CONFIRMED:`settings.readiness.status.confirmed`,NOT_APPLICABLE:`settings.readiness.status.na`},Ex={ACTIVE_CONSTITUTION_MISSING:`settings.readiness.finding.activeConstitution`,TRACKED_SECRET_PATH:`settings.readiness.finding.secretPath`,ENV_NOT_IGNORED:`settings.readiness.finding.envIgnored`,CI_PULL_REQUEST_TARGET:`settings.readiness.finding.pullRequestTarget`,CI_WRITE_ALL_PERMISSIONS:`settings.readiness.finding.writeAll`,CI_ACTION_NOT_PINNED:`settings.readiness.finding.actionPinned`,CI_INPUT_UNVERIFIABLE:`settings.readiness.finding.ciUnverifiable`,LICENSE_MISSING:`settings.readiness.finding.license`,LOCKFILE_MISSING:`settings.readiness.finding.lockfileMissing`,LOCKFILE_AMBIGUOUS:`settings.readiness.finding.lockfileAmbiguous`,DEPENDENCY_INPUT_UNVERIFIABLE:`settings.readiness.finding.dependencyUnverifiable`,PROD_ENV_NOT_IGNORED:`settings.readiness.finding.prodEnvNotIgnored`,INLINE_SECRET_IN_CI:`settings.readiness.finding.inlineSecretInCi`},Dx=({project:e})=>{let{locale:t,t:n}=Z(),r=ob(e.id),i=sb(),a=cb(),[o,s]=(0,M.useState)({}),c=r.data,l=c?.run??null,u=i.error instanceof Error?i.error:a.error instanceof Error?a.error:r.error instanceof Error?r.error:null;return(0,G.jsxs)(`div`,{className:`readiness-settings`,children:[(0,G.jsxs)(`div`,{className:`readiness-settings__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{children:n(`settings.readiness.title`)}),(0,G.jsx)(`p`,{children:n(`settings.readiness.description`)})]}),l===null?null:(0,G.jsxs)(`span`,{className:q(`readiness-settings__state`,l.status===`READY`&&`is-ready`),children:[(0,G.jsx)(K,{name:l.status===`READY`?`check`:`warning`,size:13}),n(l.status===`READY`?`settings.readiness.ready`:`settings.readiness.actionRequired`)]})]}),(0,G.jsxs)(`div`,{className:`readiness-settings__run`,children:[(0,G.jsx)(J,{disabled:e.repositoryStatus!==`READY`,loading:i.isPending,onClick:()=>{i.mutate(e)},variant:`primary`,children:n(l===null?`settings.readiness.run`:`settings.readiness.rerun`)}),l===null?null:(0,G.jsxs)(`div`,{className:`readiness-settings__meta`,children:[(0,G.jsx)(`span`,{children:n(`settings.readiness.checkedAt`,{date:new Intl.DateTimeFormat(t,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(l.createdAt))})}),(0,G.jsx)(`span`,{children:l.repositoryHead===null?n(`settings.readiness.noHead`):n(`settings.readiness.head`,{head:l.repositoryHead.slice(0,8)})}),(0,G.jsx)(`span`,{children:n(l.workingTreeDirty?`settings.readiness.dirty`:`settings.readiness.clean`)})]})]}),l===null||c===void 0?(0,G.jsx)(`p`,{className:`settings__note`,children:n(`settings.readiness.empty`)}):(0,G.jsx)(`div`,{className:`readiness-checklist`,children:Cx.map(t=>{let r=c.checks.filter(e=>e.category===t);return r.length===0?null:(0,G.jsxs)(`section`,{className:`readiness-group`,children:[(0,G.jsx)(`h5`,{children:n(Sx[t])}),(0,G.jsx)(`div`,{className:`readiness-group__checks`,children:r.map(t=>{let r=c.findings.filter(e=>e.checkId===t.id),i=o[t.id]??``,u=c.attestations.filter(e=>e.checkId===t.id).at(-1);return(0,G.jsxs)(`article`,{className:`readiness-check`,children:[(0,G.jsxs)(`div`,{className:q(`readiness-check__summary`,t.status!==`ACTION_REQUIRED`&&`is-passed`),children:[(0,G.jsx)(K,{name:t.status===`ACTION_REQUIRED`?`warning`:`check`,size:15}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:n(wx[t.key])}),(0,G.jsx)(`span`,{children:n(Tx[t.status])})]})]}),r.length===0?null:(0,G.jsxs)(`details`,{className:`readiness-check__evidence`,children:[(0,G.jsxs)(`summary`,{children:[n(`settings.readiness.evidence`),` · `,r.length.toString()]}),(0,G.jsx)(`ul`,{children:r.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:n(Ex[e.code])}),e.path===null?null:(0,G.jsx)(`code`,{children:e.path})]},e.id))})]}),t.mode===`OWNER`&&t.status===`ACTION_REQUIRED`?(0,G.jsxs)(`div`,{className:`readiness-check__attest`,children:[(0,G.jsx)(X,{htmlFor:`readiness-rationale-${t.id}`,label:n(`settings.readiness.rationale`),children:(0,G.jsx)($m,{id:`readiness-rationale-${t.id}`,onChange:e=>{s(n=>({...n,[t.id]:e.target.value}))},placeholder:n(`settings.readiness.rationalePlaceholder`),rows:2,value:i})}),(0,G.jsxs)(`div`,{className:`readiness-check__actions`,children:[(0,G.jsx)(J,{disabled:i.trim()===``||a.isPending,onClick:()=>{a.mutate({check:t,outcome:`CONFIRMED`,projectId:e.id,rationale:i.trim(),run:l})},size:`sm`,children:n(`settings.readiness.confirm`)}),(0,G.jsx)(J,{disabled:i.trim()===``||a.isPending,onClick:()=>{a.mutate({check:t,outcome:`NOT_APPLICABLE`,projectId:e.id,rationale:i.trim(),run:l})},size:`sm`,children:n(`settings.readiness.notApplicable`)})]})]}):u===void 0?null:(0,G.jsx)(`p`,{className:`readiness-check__rationale`,children:u.rationale})]},t.id)})})]},t)})}),(0,G.jsxs)(`p`,{className:`readiness-settings__limit`,children:[(0,G.jsx)(K,{name:`info`,size:14}),(0,G.jsx)(`span`,{children:n(`settings.readiness.limit`)})]}),u===null?null:(0,G.jsx)(`p`,{className:`readiness-settings__error`,role:`alert`,children:u.message})]})},Ox=({onOpenChange:e,open:t})=>{let{locale:n,setLocale:r,t:i}=Z(),{projects:a,selectedProject:o,selectProject:s}=Kv(),[c,l]=(0,M.useState)(fx),[u,d]=(0,M.useState)(sx),[f,p]=(0,M.useState)(tg);return(0,M.useEffect)(()=>{t&&p(tg())},[t]),(0,G.jsx)(ph,{closeLabel:i(`action.closeDialog`),description:i(`settings.description`),onOpenChange:e,open:t,title:i(`settings.title`),children:(0,G.jsxs)(`div`,{className:`settings`,children:[(0,G.jsxs)(`section`,{className:`settings__section`,children:[(0,G.jsx)(`h3`,{children:i(`settings.appearance`)}),(0,G.jsx)(hx,{label:i(`theme.change`),onChange:e=>{l(e),px(e)},options:[{icon:`monitor`,label:i(`theme.system`),value:`system`},{icon:`sun`,label:i(`theme.light`),value:`light`},{icon:`moon`,label:i(`theme.dark`),value:`dark`}],value:c}),(0,G.jsx)(hx,{description:i(`settings.density.description`),label:i(`settings.density`),onChange:e=>{d(e),cx(e)},options:[{icon:`list`,label:i(`settings.density.comfortable`),value:`comfortable`},{icon:`layers`,label:i(`settings.density.compact`),value:`compact`}],value:u}),(0,G.jsx)(hx,{label:i(`language.change`),onChange:r,options:[{label:i(`language.english`),value:`en`},{label:i(`language.russian`),value:`ru`}],value:n})]}),(0,G.jsxs)(`section`,{className:`settings__section`,children:[(0,G.jsx)(`h3`,{children:i(`settings.layout`)}),(0,G.jsx)(`p`,{className:`settings__note`,children:i(`settings.layout.description`)}),(0,G.jsx)(J,{disabled:!f,onClick:()=>{eg(),p(!1)},children:i(`settings.layout.reset`)})]}),(0,G.jsxs)(`section`,{className:`settings__section`,children:[(0,G.jsx)(`h3`,{children:i(`settings.projects`)}),a.length>0?(0,G.jsx)(`ul`,{className:`settings__projects`,children:a.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{"aria-pressed":e.id===o?.id,onClick:()=>{s(e.id)},type:`button`,children:[(0,G.jsx)(`span`,{children:e.name.slice(0,1).toUpperCase()}),(0,G.jsxs)(`span`,{className:`settings__project-copy`,children:[(0,G.jsx)(`strong`,{children:e.name}),(0,G.jsxs)(`small`,{className:`settings__project-path`,title:e.repositoryPath,children:[i(`settings.projects.repositoryLabel`),`: `,e.repositoryPath]})]}),e.id===o?.id?(0,G.jsx)(K,{name:`check`,size:14}):null]}),e.repositoryStatus===`UNUSABLE`?(0,G.jsx)(gx,{project:e}):null]},e.id))}):(0,G.jsx)(`p`,{className:`settings__note`,children:i(`project.none`)}),(0,G.jsx)(Jb,{}),(0,G.jsx)(_x,{}),o===null?null:(0,G.jsx)(Xb,{project:o},o.id),o===null?null:(0,G.jsx)(bx,{project:o}),o===null?null:(0,G.jsx)(qb,{project:o}),o===null?null:(0,G.jsx)(xx,{project:o}),o===null?null:(0,G.jsx)(tx,{project:o}),o===null?null:(0,G.jsx)(Ob,{project:o}),o===null?null:(0,G.jsx)(zb,{project:o}),o===null?null:(0,G.jsx)(Dx,{project:o})]})]})})},kx=({active:e,count:t,countOverflow:n=!1,icon:r,label:i,to:a})=>{let o=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{name:r,size:15}),(0,G.jsx)(`span`,{children:i}),t!==void 0&&t>0?(0,G.jsx)(`em`,{className:`app-nav-link__count`,children:n?`${t.toString()}+`:t}):null]}),s=q(`app-nav-link`,e&&`is-active`);return a===`/`?(0,G.jsx)(_,{className:s,search:{},to:`/`,children:o}):a===`/attention`?(0,G.jsx)(_,{className:s,to:`/attention`,children:o}):a===`/fleet`?(0,G.jsx)(_,{className:s,to:`/fleet`,children:o}):a===`/try`?(0,G.jsx)(_,{className:s,search:{},to:`/try`,children:o}):(0,G.jsx)(_,{className:s,to:`/insights`,children:o})},Ax=e=>{let[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{if(t===null)return;let e=()=>{i(t.scrollWidth>t.clientWidth||t.clientWidth===0)};e();let n=new ResizeObserver(e);return n.observe(t),()=>{n.disconnect()}},[e,t]),{clipped:r,ref:n}},jx=({onNavigate:e,onOpenSettings:t})=>{let{t:n}=Z(),{connection:r,projects:i,selectedProject:a,selectProject:o}=Kv(),s=Yv(),c=Xv(),l=v({select:e=>e.pathname}),u=r?.status===`connected`,d=a?.name.slice(0,1).toUpperCase()??`–`,f=a?.name??``,{clipped:p,ref:m}=Ax(f),h=s.data?.items.length??0,g=l===`/attention`,_=l===`/fleet`,y=l===`/insights`,b=l===`/try`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`app-sidebar__workspace`,children:[(0,G.jsx)(zh,{className:`app-brand-mark`,size:22}),(0,G.jsx)(`strong`,{children:`Loomrail`})]}),(0,G.jsxs)(`div`,{className:`app-nav-group`,children:[(0,G.jsx)(`span`,{children:n(`nav.yourProjects`)}),i.length>0?(0,G.jsx)(dh,{groups:[i.map(t=>({label:t.name,onSelect:()=>{o(t.id),e?.()},shortcut:t.id===a?.id?`✓`:``}))],trigger:(0,G.jsxs)(`button`,{"aria-label":n(`project.switch`),className:`app-project-label`,type:`button`,children:[(0,G.jsx)(`span`,{children:d}),(0,G.jsx)(`strong`,{ref:m,children:f}),(0,G.jsx)(K,{name:`chevronDown`,size:12})]}),...p?{triggerTooltip:f}:{}}):(0,G.jsxs)(`div`,{className:`app-project-label is-empty`,children:[(0,G.jsx)(`span`,{children:`–`}),(0,G.jsx)(`strong`,{children:n(`project.none`)})]}),(0,G.jsxs)(`nav`,{"aria-label":n(`nav.workspace`),className:`app-nav app-nav--nested`,onClick:e,children:[(0,G.jsx)(kx,{active:l===`/`,icon:`board`,label:n(`nav.currentWork`),to:`/`}),(0,G.jsx)(kx,{active:b,icon:`play`,label:n(`nav.guidedDemo`),to:`/try`}),(0,G.jsx)(kx,{active:_,icon:`agents`,label:n(`nav.fleet`),to:`/fleet`,...c.data===void 0?{}:{count:c.data.capacity.active}}),(0,G.jsx)(kx,{active:g,count:h,countOverflow:s.data?.hasMore??!1,icon:`question`,label:n(`nav.attention`),to:`/attention`}),(0,G.jsx)(kx,{active:y,icon:`insights`,label:n(`nav.insights`),to:`/insights`})]})]}),(0,G.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,G.jsxs)(`span`,{className:u?`app-connection is-online`:`app-connection is-offline`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`}),n(u?`connection.local`:`connection.offline`)]}),(0,G.jsx)(uh,{label:n(`settings.open`),children:(0,G.jsx)(Gm,{label:n(`settings.open`),name:`settings`,onClick:()=>{t()}})})]})]})},Mx=()=>{let{t:e}=Z(),{connectionPending:t,projectsPending:n,selectedProject:r}=Kv(),i=v({select:e=>e.pathname}),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),l=(0,M.useCallback)(()=>{c(!0)},[]),d=r?.name.slice(0,1).toUpperCase()??`–`;return t||n?(0,G.jsxs)(`div`,{"aria-busy":`true`,className:`app-shell app-shell--loading`,children:[(0,G.jsx)(`aside`,{"aria-hidden":`true`,className:`app-sidebar app-sidebar--loading`}),(0,G.jsx)(`section`,{className:`app-surface app-surface--loading`,children:(0,G.jsx)(`span`,{"aria-label":e(`connection.connecting`),className:`app-loading-mark`,role:`status`,children:(0,G.jsx)(zh,{className:`app-brand-mark`,size:40})})})]}):(0,G.jsxs)(`div`,{className:`app-shell`,children:[(0,G.jsxs)(`aside`,{className:`app-sidebar`,children:[(0,G.jsx)(jx,{onOpenSettings:l}),(0,G.jsx)(rg,{edge:`start`,panel:`sidebar`})]}),(0,G.jsxs)(`section`,{className:`app-surface`,children:[(0,G.jsxs)(`header`,{className:`app-topbar`,children:[(0,G.jsxs)(`div`,{className:`app-breadcrumbs`,children:[(0,G.jsx)(ph,{className:`app-navigation-drawer`,closeLabel:e(`action.closeDialog`),onOpenChange:o,open:a,title:e(`nav.workspace`),trigger:(0,G.jsx)(Gm,{className:`app-navigation-trigger`,label:e(`nav.open`),name:`menu`,size:`sm`}),children:(0,G.jsx)(jx,{onNavigate:()=>{o(!1)},onOpenSettings:()=>{o(!1),c(!0)}})}),(0,G.jsx)(`span`,{className:`app-project-icon`,children:d}),(0,G.jsx)(`span`,{className:`app-breadcrumbs__project`,children:r?.name??e(`project.noneSingle`)}),(0,G.jsx)(K,{name:`chevronRight`,size:12}),(0,G.jsx)(`strong`,{children:e(i===`/attention`?`attention.inboxTitle`:i===`/fleet`?`fleet.title`:i===`/insights`?`insights.title`:i===`/try`?`activation.title`:`work.current`)})]}),(0,G.jsx)(`div`,{className:`app-topbar__actions`,children:i===`/try`?null:(0,G.jsx)(mx,{})})]}),(0,G.jsx)(`main`,{className:`app-content`,id:`main-content`,children:(0,G.jsx)(nx.Provider,{value:l,children:(0,G.jsx)(u,{})})})]}),(0,G.jsx)(Ox,{onOpenChange:c,open:s})]})},Nx=({file:e,t})=>(0,G.jsxs)(`span`,{className:`changes-row`,children:[(0,G.jsxs)(`span`,{className:`changes-row__head`,children:[(0,G.jsx)(Km,{tone:Q_[e.status],children:t(Z_[e.status])}),(0,G.jsx)(`code`,{className:`changes-row__path`,children:e.path})]}),(0,G.jsxs)(`span`,{className:`changes-row__meta`,children:[e.previousPath===null?null:(0,G.jsx)(`span`,{className:`changes-row__previous`,children:t(`changes.renamedFrom`,{path:e.previousPath})}),e.binary?(0,G.jsx)(Km,{tone:`neutral`,children:t(`changes.binary`)}):null,e.insertions===null||e.deletions===null?null:(0,G.jsxs)(`span`,{"aria-label":t(`changes.lineCounts`,{insertions:e.insertions,deletions:e.deletions}),className:`changes-row__counts`,children:[(0,G.jsxs)(`span`,{className:`changes-row__insertions`,children:[`+`,e.insertions]}),(0,G.jsxs)(`span`,{className:`changes-row__deletions`,children:[`−`,e.deletions]})]})]})]}),Px=({path:e,workItemId:t})=>{let{locale:n,t:r}=Z(),i=ly(t,e);if(i.error)return(0,G.jsx)(`p`,{className:`changes-diff__note`,role:`status`,children:r(ev(i.error))});if(i.isPending)return(0,G.jsx)(`p`,{className:`changes-diff__note`,role:`status`,children:r(`changes.diffPending`)});let a=i.data.diff;return a===null?(0,G.jsx)(`p`,{className:`changes-diff__note`,role:`status`,children:r(`changes.diffUnavailable`)}):a.binary||a.patch===null?(0,G.jsx)(`p`,{className:`changes-diff__note`,children:r(`changes.binaryNoPatch`)}):(0,G.jsxs)(`div`,{className:`changes-diff`,children:[(0,G.jsx)(`pre`,{className:`changes-diff__patch`,children:(0,G.jsx)(`code`,{children:a.patch})}),a.truncated?(0,G.jsx)(`p`,{className:`changes-diff__note`,children:r(`changes.patchTruncated`,{bytes:a.omittedBytes.toLocaleString(n)})}):null]})},Fx=({workItemId:e})=>{let{t}=Z(),[n,r]=(0,M.useState)(null),i=cy(e);if(i.error)return(0,G.jsx)(Ih,{title:t(`changes.title`),children:(0,G.jsx)(`p`,{className:`changes__refusal`,role:`status`,children:t(ev(i.error))})});let a=i.data?.changes??null;return a===null?null:(0,G.jsx)(Ih,{title:t(`changes.title`),children:a.files.length===0?(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(`changes.empty`)}):(0,G.jsxs)(`div`,{className:`changes`,children:[a.truncated?(0,G.jsx)(`p`,{className:`changes__note`,children:t(`changes.truncated`,{count:a.files.length})}):null,(0,G.jsx)(`ul`,{className:`changes-list`,children:a.files.map(i=>{let a=n===i.path;return(0,G.jsxs)(`li`,{className:`changes-list__item`,children:[i.binary?(0,G.jsx)(`div`,{className:`changes-list__row`,children:(0,G.jsx)(Nx,{file:i,t})}):(0,G.jsxs)(`button`,{"aria-expanded":a,className:`changes-list__row changes-list__toggle`,onClick:()=>{r(a?null:i.path)},type:`button`,children:[(0,G.jsx)(K,{"aria-hidden":`true`,className:`changes-list__chevron`,name:a?`chevronDown`:`chevronRight`,size:12}),(0,G.jsx)(Nx,{file:i,t})]}),a?(0,G.jsx)(Px,{path:i.path,workItemId:e}):null]},i.path)})})]})})},Ix=e=>e.type!==`WORKSPACE_TOOL_CALL_CHANGED`,Lx=e=>e.hasLoadedFirstPage&&e.lifecycleEventsLoaded===0&&e.hasNextPage,Rx={CODEX:`Codex CLI`,CLAUDE_CODE:`Claude Code CLI`,MOCK:`Historical provider`},zx={LIVE:`success`,STALE:`clock`,UNAVAILABLE:`warning`},Bx={LIVE:`providerAllowance.freshness.live`,STALE:`providerAllowance.freshness.stale`,UNAVAILABLE:`providerAllowance.freshness.unavailable`},Vx={PROVIDER_UNSUPPORTED:`providerAllowance.unavailable.unsupported`,TARGET_UNVERIFIED:`providerAllowance.unavailable.unverified`,NOT_AUTHENTICATED:`providerAllowance.unavailable.notAuthenticated`,DATA_NOT_PRESENT:`providerAllowance.unavailable.noData`,PROVIDER_SCHEMA_DRIFT:`providerAllowance.unavailable.schemaDrift`,PROVIDER_TIMEOUT:`providerAllowance.unavailable.timeout`,PROVIDER_UNAVAILABLE:`providerAllowance.unavailable.provider`},Hx={CAPACITY_AVAILABLE:`providerAllowance.advisory.available`,LOW_CAPACITY:`providerAllowance.advisory.low`,LIMIT_REACHED:`providerAllowance.advisory.reached`,UNKNOWN:`providerAllowance.advisory.unknown`},Ux=(e,t)=>e%10080==0?t(`providerAllowance.window.weeks`,{count:e/10080}):e%1440==0?t(`providerAllowance.window.days`,{count:e/1440}):e%60==0?t(`providerAllowance.window.hours`,{count:e/60}):t(`providerAllowance.window.minutes`,{count:e}),Wx=(e,t)=>new Intl.NumberFormat(t===`ru`?`ru-RU`:`en-US`,{maximumFractionDigits:1}).format(e),Gx=(e,t)=>new Intl.DateTimeFormat(t===`ru`?`ru-RU`:`en-US`,{day:`numeric`,hour:`2-digit`,minute:`2-digit`,month:`short`}).format(new Date(e)),Kx=({bucket:e,observedAt:t})=>{let{locale:n,t:r}=Z(),i=e.name??r(`providerAllowance.bucket.${e.kind}`);return(0,G.jsxs)(`li`,{className:`provider-allowance__bucket`,children:[(0,G.jsx)(`span`,{className:`provider-allowance__bucket-name`,children:i}),(0,G.jsx)(`strong`,{children:r(`providerAllowance.remaining`,{percent:Wx(e.remainingPercent,n)})}),(0,G.jsx)(`span`,{children:Ux(e.windowDurationMins,r)}),(0,G.jsx)(`span`,{children:r(`providerAllowance.resets`,{time:Gx(e.resetsAt,n)})}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{children:r(`providerAllowance.details`)}),(0,G.jsxs)(`span`,{children:[r(`providerAllowance.used`,{percent:Wx(e.usedPercent,n)}),` ·`,` `,r(`providerAllowance.observed`,{time:Gx(t,n)})]})]})]})},qx=({advisory:e})=>{let{locale:t,t:n}=Z(),r=e.deferUntil===null?void 0:{time:Gx(e.deferUntil,t)},i=e.deferUntil===null&&e.status===`LOW_CAPACITY`?`providerAllowance.advisory.lowWithoutReset`:e.deferUntil===null&&e.status===`LIMIT_REACHED`?`providerAllowance.advisory.reachedWithoutReset`:Hx[e.status];return(0,G.jsxs)(`p`,{className:`provider-allowance__advisory`,children:[(0,G.jsx)(K,{name:`info`,size:13}),(0,G.jsx)(`span`,{children:n(i,r)})]})},Jx=({snapshot:e})=>{let{t}=Z();return e.freshness===`UNAVAILABLE`?(0,G.jsx)(`p`,{className:`provider-allowance__unavailable`,children:t(Vx[e.unavailableReason])}):(0,G.jsx)(`ul`,{className:`provider-allowance__buckets`,children:e.buckets.map(t=>(0,G.jsx)(Kx,{bucket:t,observedAt:e.observedAt},t.id))})},Yx=({error:e,loading:t,onRefresh:n,refreshing:r,response:i,surface:a})=>{let{t:o}=Z(),s=i?.current,c=s===void 0?o(`providerAllowance.provider`):Rx[s.provider],l=s?.freshness??`UNAVAILABLE`,u=t&&i===void 0;return(0,G.jsxs)(`section`,{"aria-label":o(`providerAllowance.surface.${a}`,{provider:c}),"aria-live":`polite`,className:`provider-allowance provider-allowance--${a} ${u?`is-loading`:`is-${l.toLowerCase()}`}`,children:[(0,G.jsxs)(`header`,{className:`provider-allowance__header`,children:[(0,G.jsx)(`strong`,{children:o(`providerAllowance.title`,{provider:c})}),(0,G.jsxs)(`span`,{className:`provider-allowance__freshness`,children:[(0,G.jsx)(K,{name:u?`spinner`:zx[l],size:13}),o(u?`providerAllowance.loading`:Bx[l])]}),(0,G.jsx)(J,{disabled:t||r,loading:r,onClick:n,size:`sm`,type:`button`,children:o(`providerAllowance.refresh`)})]}),u?(0,G.jsxs)(`div`,{"aria-label":o(`providerAllowance.loading`),className:`provider-allowance__loading`,role:`status`,children:[(0,G.jsx)(Y,{width:`96px`}),(0,G.jsx)(Y,{width:`152px`})]}):i===void 0||s===void 0?(0,G.jsx)(`p`,{className:`provider-allowance__unavailable`,children:o(`providerAllowance.unavailable.read`)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Jx,{snapshot:s}),(0,G.jsx)(qx,{advisory:i.advisory})]}),e===null?null:(0,G.jsx)(`p`,{className:`provider-allowance__error`,role:`alert`,children:o(i===void 0?`providerAllowance.error`:`providerAllowance.errorWithSnapshot`)})]})},Xx=({projectId:e,surface:t})=>{let n=my(e),r=hy();return(0,G.jsx)(Yx,{error:r.error??n.error,loading:n.isPending,onRefresh:()=>{r.reset(),r.mutate(e)},refreshing:r.isPending,response:n.data,surface:t})},Zx=new Set([`QUEUED`,`RUNNING`,`CANCELLING`]),Qx=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),$x={ACTIVE:`running`,PASSED:`complete`,SUPERSEDED:`queued`,EXHAUSTED:`paused`,CANCELLED:`paused`},eS={QUEUED:`verification.status.QUEUED`,RUNNING:`verification.status.RUNNING`,CANCELLING:`verification.status.CANCELLING`,PASSED:`verification.status.PASSED`,FAILED:`verification.status.FAILED`,ERROR:`verification.status.ERROR`,INTERRUPTED:`verification.status.INTERRUPTED`},tS={QUEUED:`queued`,RUNNING:`running`,CANCELLING:`running`,PASSED:`complete`,FAILED:`paused`,ERROR:`paused`,INTERRUPTED:`paused`},nS={PLAN_UNAVAILABLE:`verification.stale.PLAN_UNAVAILABLE`,PLAN_REPLACED:`verification.stale.PLAN_REPLACED`,PLAN_UNPUBLISHED:`verification.stale.PLAN_UNPUBLISHED`,TREE_CHANGED:`verification.stale.TREE_CHANGED`},rS=(e,t)=>e===null?`—`:e<1e3?t(`verification.duration.ms`,{count:e}):t(`verification.duration.seconds`,{count:(e/1e3).toFixed(1)}),iS=({recipe:e})=>(0,G.jsxs)(`span`,{"aria-label":[e.executable,...e.argv].join(` `),className:`verification-command`,children:[(0,G.jsx)(`code`,{children:e.executable}),e.argv.map((e,t)=>(0,G.jsx)(`code`,{children:e},`${t.toString()}-${e}`))]}),aS=({check:e,onToggleOutput:t,output:n,recipe:r})=>{let{t:i}=Z(),a=n.checkId===e?.id;return(0,G.jsxs)(`li`,{className:`verification-check`,children:[(0,G.jsxs)(`div`,{className:`verification-check__main`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:r.label}),(0,G.jsxs)(`span`,{children:[i(r.required?`verification.required`:`verification.optional`),` · `,r.kind]})]}),e===void 0?(0,G.jsx)(qm,{label:i(`verification.status.NOT_RUN`),tone:`queued`}):(0,G.jsx)(qm,{label:i(eS[e.status]),tone:tS[e.status]})]}),(0,G.jsx)(iS,{recipe:r}),e===void 0||e.durationMs===null&&e.exitCode===null?null:(0,G.jsx)(`span`,{className:`verification-check__measurement`,children:i(`verification.measurement`,{duration:rS(e.durationMs,i),exit:e.exitCode??`—`})}),e?.output?.available?(0,G.jsxs)(`div`,{className:`verification-output`,children:[(0,G.jsx)(J,{"aria-expanded":a,onClick:()=>{t(e.id)},size:`sm`,type:`button`,children:i(a?`verification.output.hide`:`verification.output.view`)}),a?n.pending?(0,G.jsx)(`p`,{"aria-live":`polite`,children:i(`verification.output.loading`)}):n.error?(0,G.jsx)(`p`,{className:`verification-output__error`,role:`alert`,children:n.error.message}):(0,G.jsx)(`pre`,{tabIndex:0,children:n.text??``}):null]}):null]})},oS=[`UNIT`,`INTEGRATION`,`E2E`,`BUILD`,`LINT`,`AUDIT`,`CUSTOM`],sS=({checks:e,onToggleOutput:t,output:n,recipes:r})=>{let{t:i}=Z();return(0,G.jsx)(G.Fragment,{children:oS.map(a=>{let o=r.filter(e=>e.kind===a);return o.length===0?null:(0,G.jsxs)(`section`,{className:`verification-check-group`,children:[(0,G.jsx)(`h4`,{children:i(`verification.group`,{kind:a})}),(0,G.jsx)(`ol`,{className:`verification-checks`,children:o.map(r=>(0,G.jsx)(aS,{check:e.get(r.id),onToggleOutput:t,output:n,recipe:r},r.id))})]},a)})})},cS=(e,t)=>{if(e.freshness===`STALE`)return t(`verification.outcome.stale`,{reasons:e.staleReasons.map(e=>t(nS[e])).join(`, `)});switch(e.run.status){case`QUEUED`:case`RUNNING`:case`CANCELLING`:return t(`verification.outcome.active`);case`PASSED`:return t(`verification.outcome.passed`);case`FAILED`:case`ERROR`:return t(`verification.outcome.failed`);case`INTERRUPTED`:return t(`verification.outcome.interrupted`);default:{let t=e.run.status;throw Error(`Unhandled verification status: ${String(t)}`)}}},lS=({onToggleOutput:e,output:t,snapshot:n})=>{let{t:r}=Z(),i=new Map(n.checks.map(e=>[e.recipeId,e])),a=n.freshness===`STALE`,o=n.checks.filter(e=>e.status===`PASSED`).length,s=n.checks.filter(e=>e.status===`FAILED`).length,c=n.checks.filter(e=>e.status===`ERROR`).length,l=n.checks.filter(e=>e.status===`INTERRUPTED`).length,u=n.checks.filter(e=>e.status===`QUEUED`||e.status===`RUNNING`).length;return(0,G.jsxs)(`div`,{className:`verification-run`,children:[(0,G.jsxs)(`div`,{className:`verification-run__summary`,children:[(0,G.jsx)(qm,{label:r(a?`verification.status.STALE`:eS[n.run.status]),tone:a?`paused`:tS[n.run.status]}),(0,G.jsx)(`span`,{children:r(`verification.runMeta`,{ordinal:n.run.ordinal,platform:r(`verification.platform.${n.run.platform}`),revision:n.run.planRevision})})]}),(0,G.jsx)(`p`,{className:`verification-run__evidence`,children:r(`verification.evidenceCounts`,{errors:c,failed:s,interrupted:l,passed:o,remaining:u,tree:n.run.implementationTree.slice(0,12)})}),(0,G.jsx)(`p`,{className:`verification-run__outcome`,role:`status`,children:cS(n,r)}),(0,G.jsx)(sS,{checks:i,onToggleOutput:e,output:t,recipes:n.plan.recipes})]})},uS=({actionPending:e,availability:t,correctionGate:n,correctionPendingAction:r,correctionRuns:i,currentPlan:a,loadError:o,loading:s,onCancel:c,onRetryLoad:l,onResolveCorrection:u,onRun:d,onToggleOutput:f,operationError:p,output:m,runs:h})=>{let{t:g}=Z(),_=h[0],v=_!==void 0&&Zx.has(_.run.status)?_:null,y=v!==null&&(v.run.status===`QUEUED`||v.run.status===`RUNNING`);return(0,G.jsx)(Ih,{title:g(`verification.title`),children:(0,G.jsx)(`div`,{className:`project-verification`,children:s?(0,G.jsxs)(`div`,{"aria-label":g(`verification.loading`),className:`verification-loading`,children:[(0,G.jsx)(Y,{width:`42%`}),(0,G.jsx)(Y,{width:`86%`}),(0,G.jsx)(Y,{width:`68%`})]}):o?(0,G.jsx)($,{error:o,onRetry:l,retrying:!1}):(0,G.jsxs)(G.Fragment,{children:[a?(0,G.jsxs)(`div`,{className:`verification-current-plan`,role:`note`,children:[(0,G.jsx)(`strong`,{children:g(`verification.currentPlan`,{revision:a.revision})}),(0,G.jsx)(`p`,{className:`verification-acceptance-blocker`,children:g(`verification.acceptanceBlocker`)})]}):null,_?(0,G.jsx)(lS,{onToggleOutput:f,output:m,snapshot:_}):a?(0,G.jsxs)(`div`,{className:`verification-run`,children:[(0,G.jsx)(`p`,{className:`verification-run__outcome`,children:g(`verification.intro`)}),(0,G.jsx)(sS,{checks:new Map,onToggleOutput:f,output:m,recipes:a.recipes})]}):null,h.length>1?(0,G.jsxs)(`details`,{className:`verification-history`,children:[(0,G.jsx)(`summary`,{children:g(`verification.history`,{count:h.length-1})}),(0,G.jsx)(`div`,{children:h.slice(1).map(e=>(0,G.jsx)(lS,{onToggleOutput:f,output:m,snapshot:e},e.run.id))})]}):null,i.length>0?(0,G.jsxs)(`div`,{className:`verification-corrections`,children:[(0,G.jsx)(`strong`,{children:g(`verification.correction.timeline`)}),(0,G.jsx)(`ol`,{children:i.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:g(`verification.correction.position`,{position:e.budgetPosition})}),(0,G.jsx)(`span`,{children:g(e.automatic?`verification.correction.automatic`:`verification.correction.ownerAuthorized`)})]}),(0,G.jsx)(qm,{label:g(`verification.correction.status.${e.status}`),tone:$x[e.status]})]},e.id))})]}):null,n?(0,G.jsxs)(`div`,{className:`human-request-card verification-correction-gate`,children:[(0,G.jsx)(`h3`,{children:g(`verification.correctionGate.title`)}),(0,G.jsx)(`p`,{children:n.correctionRun===null?n.request.context:g(`verification.correctionGate.description`,{position:n.correctionRun.budgetPosition})}),n.request.recommendation?(0,G.jsxs)(`div`,{className:`human-request-card__recommendation`,children:[(0,G.jsx)(`strong`,{children:g(`humanRequest.recommendation`)}),(0,G.jsx)(`span`,{children:n.request.recommendation})]}):null,(0,G.jsxs)(`div`,{className:`verification-actions`,children:[n.request.options.length===2?(0,G.jsx)(J,{disabled:r!==null,loading:r===`AUTHORIZE_FINAL`,onClick:()=>{u(`AUTHORIZE_FINAL`)},type:`button`,variant:`primary`,children:g(`verification.correctionGate.authorizeFinal`)}):null,(0,G.jsx)(J,{disabled:r!==null,loading:r===`CANCEL`,onClick:()=>{u(`CANCEL`)},type:`button`,variant:`destructive`,children:g(`verification.correctionGate.cancel`)})]})]}):null,t===`READY`||v!==null?null:(0,G.jsx)(`p`,{className:`verification-unavailable`,children:g({PLAN_REQUIRED:`verification.unavailable.plan`,PIPELINE_REQUIRED:`verification.unavailable.pipeline`,WORKSPACE_REQUIRED:`verification.unavailable.workspace`}[t])}),p?(0,G.jsx)(`p`,{className:`verification-operation-error`,role:`alert`,children:p.message}):null,(0,G.jsx)(`div`,{className:`verification-actions`,children:n?null:y?(0,G.jsx)(J,{loading:e,onClick:()=>{c(v.run)},type:`button`,variant:`destructive`,children:g(`verification.cancel`)}):t===`READY`&&a?(0,G.jsx)(J,{loading:e,onClick:()=>{d(_?.run)},type:`button`,variant:`primary`,children:g(_?`verification.runAgain`:`verification.run`)}):null})]})})})},dS=({item:e})=>{let t=ty(e.id),n=By(e.projectId),r=ey(e.id),i=sy(e.id),a=oy(e.id),o=ny(),s=ry(),c=yb(),l=iy(),[u,d]=(0,M.useState)(null),f=n.data?.plan??null,p=n.data?.publication??null,m=f?.status===`ACTIVE`&&p?.status===`APPLIED`&&p.planId===f.id&&p.contentHash===f.contentHash,h=r.data?.run?.status,g=h!==void 0&&!Qx.has(h),_=i.data?.workspace?.status===`READY`,v=r.data?.run??null,y=v===null?null:r.data?.stageAttempts.find(({id:e})=>e===v.currentStageAttemptId)??null,b=y?.stage===`QA`&&y.status===`WAITING_HUMAN`&&y.failureCode===`VERIFICATION_CORRECTION_EXHAUSTED`,x=b&&(y.verificationCorrectionRunId??null)!==null?t.data?.correctionRuns.find(({id:e,status:t})=>e===y.verificationCorrectionRunId&&(t===`EXHAUSTED`||t===`PASSED`))??null:null,S=b&&y.correctionRunId!==null?a.data?.correctionRuns.find(({id:e,status:t})=>e===y.correctionRunId&&t===`ACTIVE`)??null:null,C=b?r.data?.humanRequests.find(({stageAttemptId:e,status:t})=>e===y.id&&t===`OPEN`)??null:null,ee=v!==null&&C!==null&&(x!==null&&(x.resumesQACorrectionRunId??null)===(S?.id??null)||x===null&&S!==null)?{correctionRun:x,qaCorrectionRun:S,request:C,run:v}:null,te=m?g?_?`READY`:`WORKSPACE_REQUIRED`:`PIPELINE_REQUIRED`:`PLAN_REQUIRED`,w=[t.error,n.error,r.error,i.error,a.error].find(e=>e instanceof Error),T=[o.error,s.error,c.error].find(e=>e instanceof Error);return(0,G.jsx)(uS,{actionPending:o.isPending||s.isPending,availability:te,correctionGate:ee,correctionPendingAction:c.isPending?c.variables.action:null,correctionRuns:t.data?.correctionRuns??[],currentPlan:f?.status===`ACTIVE`?f:null,loadError:w??null,loading:t.isPending||n.isPending||r.isPending||i.isPending||a.isPending,onCancel:e=>{s.mutate(e)},onRetryLoad:()=>{Promise.all([t.refetch(),n.refetch(),r.refetch(),i.refetch(),a.refetch()])},onResolveCorrection:e=>{ee!==null&&c.mutate({...ee,action:e})},onRun:t=>{m&&o.mutate({workItem:e,plan:f,...t===void 0?{}:{retryOf:t}})},onToggleOutput:e=>{if(u===e){d(null),l.reset();return}d(e),l.mutate(e)},operationError:T??null,output:{checkId:u,error:l.error instanceof Error?l.error:null,pending:l.isPending,text:l.data},runs:t.data?.runs??[]})},fS=e=>e.some(e=>e.gap),pS=e=>e.some(e=>e.degraded),mS=(e,t)=>e.currentStage!==null||t!==void 0&&t.run!==null,hS=[`LIST_DIRECTORY`,`READ_FILE`,`WRITE_FILE`,`EDIT_FILE`,`DELETE_FILE`,`RUN_RECIPE`],gS=e=>hS.includes(e),_S=[`STARTED`,`SUCCEEDED`,`DENIED`,`FAILED`,`UNKNOWN_OUTCOME`],vS=e=>_S.includes(e),yS=new Set([`WORKSPACE_ACCESS_DENIED`,`RECIPE_NOT_APPROVED`,`RECIPE_AUTHORITY_CHANGED`,`NETWORK_POLICY_UNAVAILABLE`]),bS=e=>`runActivity.origin.${e}`,xS=e=>`runActivity.kind.${e}`,SS=e=>`workspaceTool.operation.${e}`,CS=e=>`stage.${e}`,wS=(e,t)=>e.label===null?``:e.origin===`DAEMON_AUDITED`&&gS(e.label)?t(SS(e.label)):e.label,TS=(e,t)=>e.status===null?null:e.origin===`DAEMON_AUDITED`?e.status===`DENIED`&&e.failureCode!==null&&yS.has(e.failureCode)?t(`workspaceTool.status.APPROVAL_REQUIRED`):vS(e.status)?t(`workspaceTool.status.${e.status}`):e.status:e.status,ES=(e,t)=>{let n=wS(e,t);if(n!==``)return{detail:e.detail,heading:n};if(e.detail!==null)return{detail:null,heading:e.detail};let r=TS(e,t);return r===null?{detail:null,heading:t(`runActivity.untitled`)}:{detail:null,heading:r}},DS=(e,t)=>e.origin===`DAEMON_AUDITED`&&gS(e.label)?t(SS(e.label)):e.label,OS=(e,t)=>new Intl.DateTimeFormat(t===`ru`?`ru-RU`:`en-US`,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),kS=({entry:e,locale:t,t:n})=>{let{detail:r,heading:i}=ES(e,n),a=TS(e,n);return(0,G.jsxs)(`li`,{className:`run-activity__entry`,children:[(0,G.jsx)(`time`,{className:`run-activity__entry-time`,dateTime:e.at,children:OS(e.at,t)}),(0,G.jsxs)(`div`,{className:`run-activity__entry-body`,children:[(0,G.jsxs)(`div`,{className:`run-activity__entry-heading`,children:[(0,G.jsx)(`strong`,{children:i}),(0,G.jsx)(`span`,{className:`run-activity__entry-origin`,"data-origin":e.origin,children:n(bS(e.origin))})]}),r===null?null:(0,G.jsx)(`p`,{className:`run-activity__entry-detail`,children:r}),(0,G.jsxs)(`div`,{className:`run-activity__entry-meta`,children:[(0,G.jsx)(`span`,{className:`run-activity__entry-kind`,children:n(xS(e.kind))}),a===null?null:(0,G.jsx)(`span`,{className:`run-activity__entry-status`,children:a}),e.truncated?(0,G.jsx)(`span`,{className:`run-activity__entry-truncated`,children:n(`runActivity.truncated`)}):null]})]})]})},AS=e=>{let t=[];for(let n of e){let e=t.at(-1);if(e?.agentRunId===n.agentRunId){e.entries.push(n);continue}t.push({agentRunId:n.agentRunId,stage:n.stage,entries:[n]})}return t},jS=({group:e,locale:t,t:n})=>(0,G.jsxs)(`li`,{className:`run-activity__group`,children:[(0,G.jsx)(`div`,{className:`run-activity__group-heading`,children:(0,G.jsx)(`span`,{className:`run-activity__group-stage`,children:n(CS(e.stage))})}),(0,G.jsx)(`ol`,{className:`run-activity__group-entries`,children:e.entries.map(e=>(0,G.jsx)(kS,{entry:e,locale:t,t:n},e.id))})]}),MS=()=>(0,G.jsxs)(`div`,{"aria-hidden":`true`,className:`run-activity__skeleton`,children:[(0,G.jsx)(Y,{width:`62%`}),(0,G.jsx)(Y,{width:`84%`}),(0,G.jsx)(Y,{width:`48%`})]}),NS=({collapsedAction:e,degraded:t,entries:n,error:r,expanded:i,gap:a,hasMore:o,loading:s,loadingMore:c,omittedCount:l,onLoadMore:u,onRetry:d,onToggle:f})=>{let{locale:p,t:m}=Z(),h=n.at(-1),g=e===null?h===void 0?null:{approximate:o,label:ES(h,m).heading,origin:h.origin}:{approximate:!1,label:DS(e,m),origin:e.origin},_=n.length,v=AS(n);return(0,G.jsx)(Ih,{title:m(`runActivity.title`),children:(0,G.jsxs)(`details`,{className:`run-activity`,onToggle:()=>{f()},open:i,children:[(0,G.jsxs)(`summary`,{children:[(0,G.jsx)(K,{"aria-hidden":`true`,className:`run-activity__chevron`,name:`chevronRight`,size:12}),g===null?(0,G.jsx)(`span`,{className:`run-activity__latest run-activity__latest--empty`,children:m(s?`runActivity.loading`:`runActivity.noActivity`)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`run-activity__latest`,children:g.label}),g.approximate?(0,G.jsx)(`span`,{className:`run-activity__latest-note`,children:m(`runActivity.latestApproximate`)}):null,(0,G.jsx)(`span`,{className:`run-activity__entry-origin`,"data-origin":g.origin,children:m(bS(g.origin))})]}),_>0?(0,G.jsx)(`span`,{className:`run-activity__count`,children:m(o?`runActivity.countMore`:`runActivity.count`,{count:_})}):null,t?(0,G.jsx)(Km,{tone:`warning`,children:m(`runActivity.degradedBadge`)}):null]}),i?(0,G.jsxs)(`div`,{className:`run-activity__body`,children:[(0,G.jsx)(`p`,{className:`run-activity__explainer`,children:m(`runActivity.explainer`)}),t?(0,G.jsx)(`p`,{className:`run-activity__notice`,role:`status`,children:m(`runActivity.degraded`)}):null,a?(0,G.jsx)(`p`,{className:`run-activity__notice`,role:`status`,children:m(`runActivity.gap`)}):null,l>0?(0,G.jsx)(`p`,{className:`run-activity__notice`,role:`status`,children:m(`runActivity.omitted`,{count:l})}):null,n.length>0?(0,G.jsx)(`ol`,{className:`run-activity__entries`,children:v.map(e=>(0,G.jsx)(jS,{group:e,locale:p,t:m},e.entries[0]?.id??e.agentRunId))}):s?(0,G.jsx)(MS,{}):r?null:(0,G.jsx)(`p`,{className:`inspector-copy`,children:m(`runActivity.noActivity`)}),r?(0,G.jsx)($,{error:r,onRetry:d,retrying:s}):null,o?(0,G.jsx)(J,{className:`run-activity__more`,disabled:c,loading:c,onClick:u,size:`sm`,children:m(`runActivity.loadMore`)}):null]}):null]})})},PS=({item:e})=>{let[t,n]=(0,M.useState)(!1),r=Xv(),i=ey(e.id),a=r.data?.entries.find(t=>t.workItem.id===e.id)??null,o=Zv(e.id),s=o.data?.pages.flatMap(e=>e.entries)??[],c=o.data?.pages.at(-1),l=o.data?.pages??[],u=fS(l),d=pS(l);return mS(e,i.data)?(0,G.jsx)(NS,{collapsedAction:a===null?null:a.latestAction,degraded:d,entries:s,error:o.error instanceof Error?o.error:null,expanded:t,gap:u,hasMore:o.hasNextPage,loading:o.isPending,loadingMore:o.isFetchingNextPage,omittedCount:c?.omittedCount??0,onLoadMore:()=>{o.fetchNextPage()},onRetry:()=>{o.refetch()},onToggle:()=>{n(e=>!e)}}):null},FS=({onAnswered:e,request:t,showTitle:n=!0})=>{let{t:r}=Z(),i=hb(),[a,o]=(0,M.useState)(``),[s,c]=(0,M.useState)(``),l=a===`__other__`,u=l?s.trim().length>0:a.length>0,d=()=>{u&&i.mutate({request:t,answer:l?{type:`OTHER`,text:s.trim()}:{type:`OPTION`,optionIds:[a]}},{onSuccess:()=>{o(``),c(``),e?.()}})};return(0,G.jsxs)(`div`,{className:`human-request-card`,children:[(0,G.jsxs)(`div`,{className:`human-request-card__eyebrow`,children:[(0,G.jsx)(K,{name:`question`,size:13}),(0,G.jsx)(`span`,{children:r(t.blocking?`humanRequest.blocking`:`humanRequest.request`)})]}),n?(0,G.jsx)(`h3`,{children:t.title}):null,(0,G.jsx)(`p`,{children:t.context}),t.recommendation?(0,G.jsxs)(`div`,{className:`human-request-card__recommendation`,children:[(0,G.jsx)(`strong`,{children:r(`humanRequest.recommendation`)}),(0,G.jsx)(`span`,{children:t.recommendation})]}):null,(0,G.jsx)(`p`,{className:`human-request-card__authority-note`,children:r(`humanRequest.authorityNotice`)}),(0,G.jsx)(nh,{"aria-label":t.title,onValueChange:o,options:[...t.options.map(e=>({value:e.id,label:e.recommended?`${e.label} · ${r(`humanRequest.recommended`)}`:e.label,description:e.consequence})),...t.allowOther?[{value:`__other__`,label:r(`humanRequest.other`)}]:[]],value:a}),l?(0,G.jsx)(Qm,{"aria-label":r(`humanRequest.other`),autoFocus:!0,maxLength:2e3,onChange:e=>{c(e.currentTarget.value)},placeholder:r(`humanRequest.otherPlaceholder`),value:s}):null,!u&&a?(0,G.jsx)(`span`,{className:`human-request-card__hint`,children:r(`humanRequest.chooseAnswer`)}):null,i.error?(0,G.jsx)($,{error:i.error,onRetry:d,retrying:i.isPending}):null,(0,G.jsx)(J,{disabled:!u,loading:i.isPending,onClick:d,variant:`primary`,children:r(`humanRequest.answerResume`)})]})},IS={BACKLOG:[`READY`,`CANCELLED`],READY:[`BACKLOG`,`IN_PROGRESS`,`BLOCKED`,`CANCELLED`],IN_PROGRESS:[`READY`,`BLOCKED`,`CANCELLED`],BLOCKED:[`READY`,`IN_PROGRESS`,`CANCELLED`],DONE:[],CANCELLED:[]},LS={BACKLOG:{primary:`READY`,secondary:null},READY:{primary:`IN_PROGRESS`,secondary:`BACKLOG`},IN_PROGRESS:{primary:null,secondary:`BLOCKED`},BLOCKED:{primary:`IN_PROGRESS`,secondary:`READY`},DONE:{primary:null,secondary:null},CANCELLED:{primary:null,secondary:null}},RS=(e,t)=>t!==null&&IS[e].includes(t)?t:null,zS=(e,t)=>{if(t)return{primary:null,secondary:null};let{primary:n,secondary:r}=LS[e];return{primary:RS(e,n),secondary:RS(e,r)}},BS=1e6,VS=175e3,HS=e=>({budgetLimitInput:String(e.maxEstimatedTokens),agentRunLimitInput:String(e.agentRunMaxEstimatedTokensOverride??175e3),modelTierOverride:e.modelTierOverride??`FAST`}),US=(e,t)=>e.createdAt===t.createdAt?e.id<t.id?-1:+(e.id>t.id):e.createdAt<t.createdAt?-1:1,WS=(e,t,n)=>{let r=new Map(t.map(e=>[e.id,e])),i=n.filter(({blockedWorkItemId:t})=>t===e.id).map(({blockerWorkItemId:e})=>r.get(e)).filter(e=>e!==void 0).sort(US),a=n.filter(({blockerWorkItemId:t})=>t===e.id).map(({blockedWorkItemId:e})=>r.get(e)).filter(e=>e!==void 0).sort(US);return{parent:e.parentId===null?null:r.get(e.parentId)??null,children:t.filter(({parentId:t})=>t===e.id).sort(US),blockers:i,blockedWorkItems:a,unsatisfiedBlockers:i.filter(({state:e})=>e!==`DONE`)}},GS=e=>[{label:e(`property.priority`),value:`priority`},{label:e(`view.created`),value:`created`},{label:e(`view.updated`),value:`updated`},{label:e(`view.title`),value:`title`}],KS=({onViewChange:e,view:t})=>{let{t:n}=Z(),r=t.direction===`asc`?`desc`:`asc`;return(0,G.jsxs)(`div`,{className:`view-settings`,children:[(0,G.jsx)(`div`,{className:`view-settings__controls`,children:(0,G.jsxs)(`div`,{className:`view-settings__row`,children:[(0,G.jsx)(`span`,{children:n(`view.ordering`)}),(0,G.jsxs)(`div`,{className:`view-settings__ordering`,children:[(0,G.jsx)(uh,{label:n(`view.direction.${r}`),children:(0,G.jsx)(Gm,{className:q(`view-settings__direction`,t.direction===`desc`&&`is-descending`),label:n(`view.direction.${r}`),name:`sortAscending`,onClick:()=>{e({...t,direction:r})},size:`sm`})}),(0,G.jsx)(rh,{ariaLabel:n(`view.orderBy`),onValueChange:n=>{Im(n)&&e({...t,ordering:n})},options:GS(n),size:`sm`,value:t.ordering,variant:`compact`})]})]})}),(0,G.jsxs)(`div`,{className:`view-settings__section`,children:[(0,G.jsx)(`span`,{className:`view-settings__section-title`,children:n(`view.boardOptions`)}),(0,G.jsx)(th,{checked:t.showEmptyColumns,label:n(`view.showEmptyColumns`),onCheckedChange:n=>{e({...t,showEmptyColumns:n})}})]})]})},qS=({filters:e,onClearFilters:t,onFiltersChange:n,onScopeChange:r,onSummaryFilterChange:i,onViewChange:a,options:o,scope:s,summaryFilter:c,view:l})=>{let{t:u}=Z(),d=e.length>0||c!==null,f=c?u(`work.summary.${c}`):null,p={add:u(`filter.add`),addFilterPlaceholder:u(`filter.addPlaceholder`),backTo:u(`filter.backTo`),clear:u(`filter.clear`),close:u(`filter.close`),description:u(`filter.description`),edit:u(`filter.edit`),filterPlaceholder:u(`filter.placeholder`),is:u(`filter.is`),isAnyOf:u(`filter.isAnyOf`),noMatchingProperties:u(`filter.noProperties`),noMatchingValues:u(`filter.noValues`),oneValue:u(`filter.oneValue`),options:u(`filter.options`),remove:u(`filter.remove`),rootTitle:u(`filter.rootTitle`),search:u(`filter.search`),selectedValues:u(`filter.selectedValues`)};return(0,G.jsxs)(`div`,{className:`board-toolbar-stack`,children:[(0,G.jsxs)(`div`,{className:`board-toolbar`,children:[(0,G.jsx)(`div`,{className:`board-view-tabs`,children:[{labelKey:`view.active`,value:`active`},{labelKey:`view.backlog`,value:`backlog`},{labelKey:`view.allIssues`,value:`all`}].map(({labelKey:e,value:t})=>(0,G.jsx)(J,{"aria-pressed":s===t,onClick:()=>{r(t)},shape:`pill`,variant:`surface`,children:u(e)},t))}),(0,G.jsxs)(`div`,{className:`board-toolbar__actions`,children:[(0,G.jsx)(Ah,{ariaLabel:u(`view.filter`),messages:p,onValueChange:n,options:o,trigger:(0,G.jsx)(Gm,{label:u(`view.filter`),name:`filter`,variant:`surface`}),triggerTooltip:u(`view.filter`),value:e}),(0,G.jsx)(fh,{className:`view-settings-popover`,label:u(`view.display`),trigger:(0,G.jsx)(Gm,{label:u(`view.display`),name:`settings`,variant:`surface`}),triggerTooltip:u(`view.display`),children:(0,G.jsx)(KS,{onViewChange:a,view:l})}),(0,G.jsx)(dh,{align:`end`,groups:[[{icon:`link`,label:u(`view.copyLink`),onSelect:()=>{navigator.clipboard.writeText(window.location.href)}}]],trigger:(0,G.jsx)(Gm,{label:u(`view.actions`),name:`more`,variant:`surface`}),triggerTooltip:u(`view.actions`)})]})]}),d?(0,G.jsx)(Mh,{addFilter:(0,G.jsx)(Ah,{ariaLabel:u(`view.filter`),messages:p,onValueChange:n,options:o,trigger:(0,G.jsx)(Gm,{className:`board-add-filter`,label:u(`view.filter`),name:`add`,size:`sm`}),triggerTooltip:u(`view.filter`),value:e}),ariaLabel:u(`view.filter`),className:`board-applied-filters`,messages:p,onClear:t,onValueChange:n,options:o,supplementalConditions:c&&f?(0,G.jsxs)(`div`,{className:`lr-applied-filter board-summary-filter`,children:[(0,G.jsxs)(`span`,{className:`lr-applied-filter__property`,children:[(0,G.jsx)(K,{name:`filter`,size:12}),u(`work.summary.filter`)]}),(0,G.jsx)(`span`,{className:`lr-applied-filter__value`,children:f}),(0,G.jsx)(uh,{label:u(`work.summary.clear`),children:(0,G.jsx)(`button`,{"aria-label":u(`work.summary.clear`),className:`lr-applied-filter__remove`,onClick:()=>{i(null)},type:`button`,children:(0,G.jsx)(K,{name:`close`,size:12})})})]}):null,value:e}):null]})},JS=[{labelKey:`state.BACKLOG`,state:`BACKLOG`,tone:`queued`},{labelKey:`state.READY`,state:`READY`,tone:`ready`},{labelKey:`state.IN_PROGRESS`,state:`IN_PROGRESS`,tone:`running`},{labelKey:`state.BLOCKED`,state:`BLOCKED`,tone:`waiting`},{labelKey:`state.DONE`,state:`DONE`,tone:`complete`},{labelKey:`state.CANCELLED`,state:`CANCELLED`,tone:`paused`}],YS=e=>JS.filter(t=>Um(e,t.state)),XS={BACKLOG:`state.BACKLOG`,READY:`state.READY`,IN_PROGRESS:`state.IN_PROGRESS`,BLOCKED:`state.BLOCKED`,DONE:`state.DONE`,CANCELLED:`state.CANCELLED`},ZS=(e,t)=>t(XS[e]),QS={LOW:`priority.LOW`,MEDIUM:`priority.MEDIUM`,HIGH:`priority.HIGH`,URGENT:`priority.URGENT`},$S={LOW:`risk.LOW`,MEDIUM:`risk.MEDIUM`,HIGH:`risk.HIGH`,CRITICAL:`risk.CRITICAL`},eC={EPIC:`type.EPIC`,FEATURE:`type.FEATURE`,TASK:`type.TASK`,BUG:`type.BUG`,SPIKE:`type.SPIKE`,SUBTASK:`type.SUBTASK`},tC={DISCOVERY:`stage.DISCOVERY`,PLAN:`stage.PLAN`,IMPLEMENT:`stage.IMPLEMENT`,REVIEW:`stage.REVIEW`,QA:`stage.QA`,ACCEPTANCE:`stage.ACCEPTANCE`},nC={BACKLOG:`queued`,READY:`ready`,IN_PROGRESS:`running`,BLOCKED:`waiting`,DONE:`complete`,CANCELLED:`paused`},rC=e=>e===`URGENT`?`danger`:e===`HIGH`?`warning`:`neutral`,iC=e=>{let t=e.split(`-`).at(-1)??e;return t.length>10?t.slice(0,8).toUpperCase():t.toUpperCase()},aC=(e,t,n)=>{let r=t=>e.filter(t).length;return[{id:`status`,label:n(`filter.status`),icon:`clock`,children:t.map(e=>({id:`status-${e.state.toLowerCase()}`,label:n(e.labelKey),count:r(t=>t.state===e.state)}))},{id:`priority`,label:n(`filter.priority`),icon:`filter`,children:[`URGENT`,`HIGH`,`MEDIUM`,`LOW`].map(e=>({id:`priority-${e.toLowerCase()}`,label:n(QS[e]),count:r(t=>t.priority===e)}))},{id:`risk`,label:n(`filter.risk`),icon:`warning`,children:[`CRITICAL`,`HIGH`,`MEDIUM`,`LOW`].map(e=>({id:`risk-${e.toLowerCase()}`,label:n($S[e]),count:r(t=>t.risk===e)}))}]},oC=(e,t)=>t.every(t=>t.startsWith(`status-`)?t===`status-${e.state.toLowerCase()}`:t.startsWith(`priority-`)?t===`priority-${e.priority.toLowerCase()}`:!t.startsWith(`risk-`)||t===`risk-${e.risk.toLowerCase()}`),sC={title:`field.title`,description:`field.description`,priority:`field.priority`,risk:`field.risk`,acceptanceCriteria:`field.acceptanceCriteria`},cC={SECURITY_ACTIVE_CONSTITUTION:`settings.readiness.check.activeConstitution`,SECURITY_SECRET_PATHS:`settings.readiness.check.secretPaths`,SECURITY_ENV_IGNORED:`settings.readiness.check.envIgnored`,SECURITY_CI_HARDENING:`settings.readiness.check.ciHardening`,LEGAL_LICENSE:`settings.readiness.check.license`,LEGAL_OWNER_REVIEW:`settings.readiness.check.legalOwner`,PAYMENTS_OWNER_REVIEW:`settings.readiness.check.paymentsOwner`,ANALYTICS_OWNER_REVIEW:`settings.readiness.check.analyticsOwner`,DEPS_LOCKFILE_PRESENT:`settings.readiness.check.lockfile`,ENV_PROD_SEPARATION:`settings.readiness.check.envProdSeparation`,SECURITY_HEADERS_OWNER_REVIEW:`settings.readiness.check.securityHeadersOwner`,OPS_HEALTH_ENDPOINT_DECLARED:`settings.readiness.check.healthEndpoint`,OPS_ROLLBACK_PLAN:`settings.readiness.check.rollbackPlan`,OPS_BACKUP:`settings.readiness.check.backup`},lC={PASSED:`settings.readiness.status.passed`,ACTION_REQUIRED:`settings.readiness.status.action`,CONFIRMED:`settings.readiness.status.confirmed`,NOT_APPLICABLE:`settings.readiness.status.na`},uC={ACTUAL:`workflow.sessions.usageQuality.ACTUAL`,PROVIDER_ESTIMATE:`workflow.sessions.usageQuality.PROVIDER_ESTIMATE`,LOOMRAIL_ESTIMATE:`workflow.sessions.usageQuality.LOOMRAIL_ESTIMATE`},dC={NO_PROGRESS:`workflow.hardPause.noProgress`,CONTEXT_FLOOR_EXCEEDED:`workflow.hardPause.contextFloor`,PROVIDER_REJECTED_PACK:`workflow.hardPause.providerRejected`,PROVIDER_START_FAILED:`workflow.hardPause.providerStartFailed`,PROVIDER_OUTCOME_REJECTED:`workflow.hardPause.providerOutcomeRejected`,SESSION_LIMIT_REACHED:`workflow.hardPause.sessionLimit`},fC=(e,t,n)=>Ro(e)?n(dC[e]):n(t),pC=(e,t)=>e.status===`QUEUED`?t(`workflow.stage.QUEUED`):e.status===`RUNNING`?t(`workflow.stage.RUNNING`):e.status===`WAITING_HUMAN`?t(`workflow.stage.WAITING_HUMAN`):e.status===`SOFT_PAUSED`?t(`workflow.stage.SOFT_PAUSED`):e.status===`HARD_PAUSED`?fC(e.failureCode,`workflow.stage.HARD_PAUSED`,t):e.status===`INTERRUPTED`?t(`workflow.stage.INTERRUPTED`):e.status===`CANCELLED`?t(`workflow.stage.CANCELLED`):e.status===`SUCCEEDED`?t(`workflow.stage.SUCCEEDED`):t(`workflow.stage.other`),mC={PENDING:`queued`,QUEUED:`queued`,RUNNING:`running`,WAITING_HUMAN:`waiting`,SOFT_PAUSED:`paused`,HARD_PAUSED:`waiting`,SUCCEEDED:`complete`,FAILED:`paused`,CANCELLED:`paused`,INTERRUPTED:`paused`,RECOVERING:`running`,STALE:`waiting`},hC={RUNNING:`workflow.status.RUNNING`,WAITING_HUMAN:`workflow.status.WAITING_HUMAN`,SOFT_PAUSED:`workflow.status.SOFT_PAUSED`,HARD_PAUSED:`workflow.status.HARD_PAUSED`,INTERRUPTED:`workflow.status.INTERRUPTED`,SUCCEEDED:`workflow.status.SUCCEEDED`,FAILED:`workflow.status.FAILED`,CANCELLED:`workflow.status.CANCELLED`},gC={RUNNING:`running`,WAITING_HUMAN:`waiting`,SOFT_PAUSED:`paused`,HARD_PAUSED:`waiting`,INTERRUPTED:`paused`,SUCCEEDED:`complete`,FAILED:`paused`,CANCELLED:`paused`},_C={PENDING:`acceptance.status.PENDING`,ACCEPTED:`acceptance.status.ACCEPTED`,RETURNED:`acceptance.status.RETURNED`,REJECTED:`acceptance.status.REJECTED`},vC={PENDING:`waiting`,ACCEPTED:`complete`,RETURNED:`paused`,REJECTED:`paused`},yC={RUNNING:`agentRun.status.RUNNING`,SUCCEEDED:`agentRun.status.SUCCEEDED`,FAILED:`agentRun.status.FAILED`,CANCELLED:`agentRun.status.CANCELLED`,INTERRUPTED:`agentRun.status.INTERRUPTED`,WAITING_HUMAN:`agentRun.status.WAITING_HUMAN`,SOFT_PAUSED:`agentRun.status.SOFT_PAUSED`,HARD_PAUSED:`agentRun.status.HARD_PAUSED`},bC={QUEUED:`verification.status.QUEUED`,RUNNING:`verification.status.RUNNING`,PASSED:`verification.status.PASSED`,FAILED:`verification.status.FAILED`,ERROR:`verification.status.ERROR`,INTERRUPTED:`verification.status.INTERRUPTED`},xC={REQUIRED_CHECK_FAILED:`verification.failure.REQUIRED_CHECK_FAILED`,REQUIRED_CHECK_ERROR:`verification.failure.REQUIRED_CHECK_ERROR`,RUN_INTERRUPTED:`verification.failure.RUN_INTERRUPTED`,STALE:`verification.failure.STALE`},SC=(e,t)=>{switch(e.type){case`WORK_ITEM_CREATED`:return{detail:t(`event.createdDetail`),icon:`add`,label:t(`event.created`),tone:`success`};case`WORK_ITEM_UPDATED`:return{detail:t(`event.updatedDetail`,{fields:e.data.changedFields.map(e=>t(sC[e])).join(`, `)}),icon:`settings`,label:t(`event.updated`)};case`WORK_ITEM_DEPENDENCIES_SET`:return{detail:t(`event.dependenciesSetDetail`,{count:e.data.blockerWorkItemIds.length}),icon:`link`,label:t(`event.dependenciesSet`),...e.data.blockerWorkItemIds.length===0?{}:{tone:`accent`}};case`WORK_ITEM_STATE_CHANGED`:return{detail:t(`event.stateChangedDetail`,{from:ZS(e.data.previousState,t),to:ZS(e.data.workItem.state,t)}),icon:e.data.workItem.state===`BLOCKED`?`pause`:`play`,label:t(`event.stateChanged`),tone:e.data.workItem.state===`BLOCKED`?`warning`:`accent`};case`PROJECT_REGISTERED`:return{detail:e.data.project.name,icon:`projects`,label:t(`event.projectRegistered`)};case`PROJECT_SCAFFOLD_REQUESTED`:return{detail:e.data.operation.proposal.projectName,icon:`clock`,label:t(`event.projectScaffoldRequested`)};case`PROJECT_SCAFFOLD_COMPLETED`:return{detail:e.data.operation.proposal.projectName,icon:`check`,label:t(`event.projectScaffoldCompleted`),tone:`success`};case`PROJECT_SCAFFOLD_FAILED`:return{detail:e.data.operation.lastErrorCode??t(`error.unknown`),icon:`warning`,label:t(`event.projectScaffoldFailed`),tone:`warning`};case`PROJECT_PROVIDER_PREFERENCE_CHANGED`:return{detail:t(`event.providerPreferenceChangedDetail`,{from:e.data.previousPreference,to:e.data.selection.preference}),icon:`settings`,label:t(`event.providerPreferenceChanged`)};case`PROVIDER_ALLOWANCE_RECORDED`:return{detail:t(`event.providerAllowanceRecordedDetail`,{provider:e.data.snapshot.provider.replace(`_`,` `),freshness:t(e.data.snapshot.freshness===`LIVE`?`providerAllowance.freshness.live`:e.data.snapshot.freshness===`STALE`?`providerAllowance.freshness.stale`:`providerAllowance.freshness.unavailable`)}),icon:`budget`,label:t(`event.providerAllowanceRecorded`)};case`MCP_PROFILE_CONSENTED`:return{detail:t(`event.mcpProfileConsentedDetail`,{name:e.data.revision.name,revision:e.data.revision.revision}),icon:`settings`,label:t(`event.mcpProfileConsented`)};case`MCP_GRANT_CHANGED`:return{detail:t(`event.mcpGrantChangedDetail`,{count:e.data.grant.tools.length,state:t(e.data.grant.enabled?`event.mcpGrant.enabled`:`event.mcpGrant.revoked`)}),icon:e.data.grant.enabled?`check`:`pause`,label:t(`event.mcpGrantChanged`),tone:e.data.grant.enabled?`success`:`warning`};case`PROJECT_CONSTITUTION_PROPOSED`:return{detail:t(`event.constitutionProposedDetail`,{preset:e.data.proposal.presetId}),icon:`settings`,label:t(`event.constitutionProposed`)};case`PROJECT_CONSTITUTION_PUBLICATION_REQUESTED`:return{detail:t(`event.constitutionPublicationRequestedDetail`,{ordinal:e.data.constitution.ordinal}),icon:`clock`,label:t(`event.constitutionPublicationRequested`),tone:`accent`};case`PROJECT_CONSTITUTION_ACTIVATED`:return{detail:t(`event.constitutionActivatedDetail`,{ordinal:e.data.constitution.ordinal}),icon:`check`,label:t(`event.constitutionActivated`),tone:`success`};case`PROJECT_CONSTITUTION_PUBLICATION_FAILED`:return{detail:e.data.publication.lastErrorCode??t(`error.unknown`),icon:`pause`,label:t(`event.constitutionPublicationFailed`),tone:`warning`};case`VERIFICATION_PLAN_ADOPTED`:return{detail:t(`event.verificationPlanAdoptedDetail`,{count:e.data.plan.recipes.length,revision:e.data.plan.revision}),icon:`settings`,label:t(`event.verificationPlanAdopted`),tone:`accent`};case`VERIFICATION_PLAN_DISABLED`:return{detail:t(`event.verificationPlanDisabledDetail`,{revision:e.data.plan.revision}),icon:`pause`,label:t(`event.verificationPlanDisabled`),tone:`warning`};case`VERIFICATION_PLAN_PUBLICATION_APPLIED`:return{detail:t(`event.verificationPlanPublicationAppliedDetail`,{revision:e.data.plan.revision}),icon:`check`,label:t(`event.verificationPlanPublicationApplied`),tone:`success`};case`VERIFICATION_PLAN_PUBLICATION_FAILED`:return{detail:e.data.publication.lastErrorCode??t(`error.unknown`),icon:`warning`,label:t(`event.verificationPlanPublicationFailed`),tone:`warning`};case`VERIFICATION_PLAN_PUBLICATION_RETRIED`:return{detail:t(`event.verificationPlanPublicationRetriedDetail`,{revision:e.data.plan.revision}),icon:`clock`,label:t(`event.verificationPlanPublicationRetried`),tone:`accent`};case`LAUNCH_MEASUREMENT_PLAN_CHANGED`:return{detail:t(`event.launchPlanChangedDetail`,{revision:e.data.plan.revision,status:e.data.plan.status}),icon:e.data.plan.status===`ACTIVE`?`settings`:`pause`,label:t(`event.launchPlanChanged`),tone:e.data.plan.status===`ACTIVE`?`accent`:`warning`};case`LAUNCH_MEASUREMENT_RUN_CHANGED`:return{detail:t(`event.launchRunChangedDetail`,{status:e.data.run.status,tree:e.data.run.testedTree.slice(0,8)}),icon:e.data.run.status===`PASSED`?`check`:`test`,label:t(`event.launchRunChanged`),tone:e.data.run.status===`PASSED`?`success`:e.data.run.status===`RUNNING`?`accent`:`warning`};case`LAUNCH_ENVIRONMENT_CHANGED`:return{detail:t(`event.launchEnvironmentChangedDetail`,{kind:e.data.environment.kind,version:e.data.environment.version}),icon:`settings`,label:t(`event.launchEnvironmentChanged`),tone:`accent`};case`LAUNCH_RELEASE_CREATED`:return{detail:t(`event.launchReleaseCreatedDetail`,{passed:e.data.release.passedRequiredGateCount,required:e.data.release.requiredGateCount,tree:e.data.release.sourceTree.slice(0,8)}),icon:e.data.release.passedRequiredGateCount===e.data.release.requiredGateCount?`check`:`warning`,label:t(`event.launchReleaseCreated`),tone:e.data.release.passedRequiredGateCount===e.data.release.requiredGateCount?`success`:`warning`};case`DEPLOYMENT_PLAN_ADOPTED`:return{detail:t(`event.deploymentPlanAdoptedDetail`,{branch:e.data.plan.target.branch,commit:e.data.plan.target.commitSha.slice(0,8),repository:e.data.plan.target.repositorySlug}),icon:`settings`,label:t(`event.deploymentPlanAdopted`),tone:`accent`};case`DEPLOYMENT_CHANGED`:return{detail:t(`event.deploymentChangedDetail`,{status:t(`settings.deploy.status.${e.data.deployment.status}`)}),icon:e.data.deployment.status===`SUCCEEDED`?`check`:`warning`,label:t(`event.deploymentChanged`),tone:e.data.deployment.status===`SUCCEEDED`?`success`:`warning`};case`VERIFICATION_RUN_RESERVED`:return{detail:t(`event.verificationRunReservedDetail`,{count:e.data.checks.length,ordinal:e.data.run.ordinal}),icon:`test`,label:t(`event.verificationRunReserved`),tone:`accent`};case`VERIFICATION_CHECK_STARTED`:return{detail:t(`event.verificationCheckStartedDetail`,{ordinal:e.data.check.ordinal}),icon:`play`,label:t(`event.verificationCheckStarted`),tone:`accent`};case`VERIFICATION_CHECK_COMPLETED`:return{detail:t(`event.verificationCheckCompletedDetail`,{ordinal:e.data.check.ordinal,status:t(bC[e.data.check.status])}),icon:e.data.check.status===`PASSED`?`check`:`warning`,label:t(`event.verificationCheckCompleted`),tone:e.data.check.status===`PASSED`?`success`:`warning`};case`VERIFICATION_RUN_CANCELLATION_REQUESTED`:return{detail:t(`event.verificationRunCancellationRequestedDetail`,{ordinal:e.data.run.ordinal}),icon:`pause`,label:t(`event.verificationRunCancellationRequested`),tone:`warning`};case`VERIFICATION_RUN_INTERRUPTED`:return{detail:t(`event.verificationRunInterruptedDetail`,{ordinal:e.data.run.ordinal}),icon:`pause`,label:t(`event.verificationRunInterrupted`),tone:`warning`};case`VERIFICATION_FAILURE_RECORDED`:return{detail:t(`event.verificationFailureRecordedDetail`,{reason:t(xC[e.data.failure.reason])}),icon:`warning`,label:t(`event.verificationFailureRecorded`),tone:`warning`};case`VERIFICATION_CORRECTION_STARTED`:return{detail:t(`event.verificationCorrectionStartedDetail`,{ordinal:e.data.correctionRun.budgetPosition}),icon:`play`,label:t(`event.verificationCorrectionStarted`),tone:`accent`};case`VERIFICATION_CORRECTION_PASSED`:return{detail:t(`event.verificationCorrectionPassedDetail`,{ordinal:e.data.correctionRun.budgetPosition}),icon:`check`,label:t(`event.verificationCorrectionPassed`),tone:`success`};case`VERIFICATION_CORRECTION_SUPERSEDED`:return{detail:t(`event.verificationCorrectionSupersededDetail`,{ordinal:e.data.correctionRun.budgetPosition}),icon:`warning`,label:t(`event.verificationCorrectionSuperseded`),tone:`warning`};case`VERIFICATION_CORRECTION_EXHAUSTED`:return{detail:t(`event.verificationCorrectionExhaustedDetail`,{ordinal:e.data.correctionRun.budgetPosition}),icon:`pause`,label:t(`event.verificationCorrectionExhausted`),tone:`warning`};case`VERIFICATION_CORRECTION_CANCELLED`:return{detail:t(`event.verificationCorrectionCancelledDetail`,{ordinal:e.data.correctionRun.budgetPosition}),icon:`pause`,label:t(`event.verificationCorrectionCancelled`),tone:`warning`};case`PROJECT_READINESS_ASSESSED`:return{detail:t(`event.readinessAssessedDetail`,{count:e.data.checks.filter(e=>e.status===`ACTION_REQUIRED`).length}),icon:e.data.run.status===`READY`?`check`:`warning`,label:t(`event.readinessAssessed`),tone:e.data.run.status===`READY`?`success`:`warning`};case`PROJECT_READINESS_ATTESTED`:return{detail:t(`event.readinessAttestedDetail`,{check:t(cC[e.data.check.key]),outcome:t(lC[e.data.check.status])}),icon:`check`,label:t(`event.readinessAttested`),tone:`success`};case`PIPELINE_STARTED`:return{detail:t(`event.pipelineStartedDetail`,{stage:t(tC[e.data.stageAttempt.stage])}),icon:`play`,label:t(`event.pipelineStarted`),tone:`accent`};case`STAGE_ATTEMPT_CHANGED`:return{detail:t(`event.stageChangedDetail`,{stage:t(tC[e.data.stageAttempt.stage]),status:pC(e.data.stageAttempt,t)}),icon:e.data.stageAttempt.status===`SUCCEEDED`?`check`:`clock`,label:t(`event.stageChanged`),tone:e.data.stageAttempt.status===`SUCCEEDED`?`success`:`accent`};case`HUMAN_REQUEST_OPENED`:return{detail:t(`event.humanRequestOpenedDetail`,{title:e.data.request.title}),icon:`question`,label:t(`event.humanRequestOpened`),tone:`warning`};case`HUMAN_REQUEST_RESOLVED`:return{detail:t(`event.humanRequestResolvedDetail`),icon:`check`,label:t(`event.humanRequestResolved`),tone:`success`};case`USAGE_RECORDED`:return{detail:t(`event.usageRecordedDetail`,{amount:e.data.usageRecord.amount,total:e.data.cumulativeAmount}),icon:`clock`,label:t(`event.usageRecorded`)};case`BUDGET_THRESHOLD_REACHED`:return{detail:t(`event.budgetThresholdDetail`,{threshold:Math.round(e.data.threshold*100),total:e.data.cumulativeAmount}),icon:`filter`,label:t(`event.budgetThreshold`),tone:e.data.threshold>=1?`warning`:`accent`};case`PIPELINE_PAUSED`:return{detail:t(`event.pipelinePausedDetail`,{kind:e.data.kind,stage:t(tC[e.data.stageAttempt.stage])}),icon:`pause`,label:t(`event.pipelinePaused`),tone:`warning`};case`PIPELINE_RESUMED`:return{detail:t(`event.pipelineResumedDetail`,{stage:t(tC[e.data.stageAttempt.stage])}),icon:`play`,label:t(`event.pipelineResumed`),tone:`accent`};case`PIPELINE_CANCELLED`:return{detail:t(`event.pipelineCancelledDetail`,{stage:t(tC[e.data.stageAttempt.stage])}),icon:`pause`,label:t(`event.pipelineCancelled`),tone:`warning`};case`BUDGET_OVERRIDE_APPROVED`:return{detail:t(`event.budgetOverrideDetail`,{revision:e.data.budgetPolicy.revision,limit:e.data.budgetPolicy.maxEstimatedTokens}),icon:`settings`,label:t(`event.budgetOverride`),tone:`accent`};case`RECOVERY_REPORT_CREATED`:return{detail:t(`event.recoveryCreatedDetail`,{stage:t(tC[e.data.stageAttempt.stage])}),icon:`clock`,label:t(`event.recoveryCreated`),tone:`warning`};case`EVIDENCE_ARTIFACT_RECORDED`:return{detail:t(`event.evidenceRecordedDetail`,{title:e.data.artifact.title}),icon:`check`,label:t(`event.evidenceRecorded`),tone:`success`};case`REVIEW_REPORT_RECORDED`:return{detail:t(`event.reviewReportRecordedDetail`,{round:e.data.report.round,verdict:t(`review.verdict.${e.data.report.verdict}`)}),icon:`check`,label:t(`event.reviewReportRecorded`),tone:e.data.report.verdict===`PASSED`?`success`:`warning`};case`REVIEW_FINDING_RECORDED`:return{detail:e.data.finding.title,icon:`warning`,label:t(`event.reviewFindingRecorded`),tone:`warning`};case`REVIEW_FINDING_RESOLVED`:return{detail:e.data.finding.title,icon:`check`,label:t(`event.reviewFindingResolved`),tone:`success`};case`REVIEW_LOOP_EXHAUSTED`:return{detail:t(`event.reviewLoopExhaustedDetail`,{round:e.data.report.round}),icon:`pause`,label:t(`event.reviewLoopExhausted`),tone:`warning`};case`ACCEPTANCE_REQUESTED`:return{detail:t(`event.acceptanceRequestedDetail`),icon:`question`,label:t(`event.acceptanceRequested`),tone:`warning`};case`ACCEPTANCE_RESOLVED`:return{detail:t(`event.acceptanceResolvedDetail`,{action:e.data.action}),icon:e.data.action===`ACCEPT`?`check`:`pause`,label:t(`event.acceptanceResolved`),tone:e.data.action===`ACCEPT`?`success`:`warning`};case`PIPELINE_COMPLETED`:return{detail:t(`event.pipelineCompletedDetail`),icon:`check`,label:t(`event.pipelineCompleted`),tone:`success`};case`SQUAD_ASSIGNED`:return{detail:t(`event.squadAssignedDetail`,{count:e.data.assignment.stages.length}),icon:`agents`,label:t(`event.squadAssigned`)};case`AGENT_RUN_STARTED`:return{detail:t(`event.agentRunStartedDetail`,{role:t(`fleet.role.${e.data.run.profile.role}`),provider:e.data.run.provider.replace(`_`,` `)}),icon:`agents`,label:t(`event.agentRunStarted`),tone:`accent`};case`AGENT_RUN_FINISHED`:return{detail:t(`event.agentRunFinishedDetail`,{role:t(`fleet.role.${e.data.run.profile.role}`),status:t(yC[e.data.run.status])}),icon:`agents`,label:t(`event.agentRunFinished`),tone:e.data.run.status===`SUCCEEDED`?`success`:`warning`};case`QA_RUN_RESERVED`:return{detail:t(`event.qaRunReservedDetail`,{targets:e.data.qaRun.plan.targets.length,scenarios:e.data.qaRun.plan.scenarios.length}),icon:`sessions`,label:t(`event.qaRunReserved`),tone:`accent`};case`QA_RUN_COMPLETED`:return{detail:t(`event.qaRunCompletedDetail`,{status:e.data.qaRun.status,defects:e.data.defectIds.length}),icon:e.data.qaRun.status===`PASSED`?`check`:`warning`,label:t(`event.qaRunCompleted`),tone:e.data.qaRun.status===`PASSED`?`success`:`warning`};case`QA_DEFECT_WAIVED`:return{detail:e.data.defect.title,icon:`check`,label:t(`event.qaDefectWaived`),tone:`warning`};case`QA_CORRECTION_STARTED`:return{detail:t(`event.qaCorrectionStartedDetail`,{ordinal:e.data.correctionRun.ordinal,cells:e.data.retestPlan.cells.length}),icon:`play`,label:t(`event.qaCorrectionStarted`),tone:`accent`};case`QA_CORRECTION_EXHAUSTED`:return{detail:t(`event.qaCorrectionExhaustedDetail`,{ordinal:e.data.correctionRun.ordinal}),icon:`pause`,label:t(`event.qaCorrectionExhausted`),tone:`warning`};case`QA_CORRECTION_PASSED`:return{detail:t(`event.qaCorrectionPassedDetail`,{ordinal:e.data.correctionRun.ordinal,defects:e.data.resolvedDefects.length}),icon:`check`,label:t(`event.qaCorrectionPassed`),tone:`success`};case`QA_CORRECTION_CANCELLED`:return{detail:t(`event.qaCorrectionCancelledDetail`,{ordinal:e.data.correctionRun.ordinal}),icon:`warning`,label:t(`event.qaCorrectionCancelled`),tone:`warning`};case`PROVIDER_SESSION_STARTED`:return{detail:t(`event.providerSessionStartedDetail`,{ordinal:e.data.session.ordinal}),icon:`sessions`,label:t(`event.providerSessionStarted`),tone:`accent`};case`CHECKPOINT_PUBLISHED`:return{detail:t(`event.checkpointPublishedDetail`,{summary:e.data.checkpoint.summary}),icon:`check`,label:t(`event.checkpointPublished`),tone:`success`};case`CONTEXT_HANDOFF_REQUESTED`:return{detail:t(`event.contextHandoffRequestedDetail`,{ordinal:e.data.session.ordinal}),icon:`clock`,label:t(`event.contextHandoffRequested`),tone:`warning`};case`PROVIDER_SESSION_ENDED`:return{detail:t(`event.providerSessionEndedDetail`,{reason:e.data.session.endReason??``}),icon:`sessions`,label:t(`event.providerSessionEnded`),tone:e.data.session.endReason===`COMPLETED`?`success`:`neutral`};case`CONTEXT_FLOOR_EXCEEDED`:return{detail:t(`event.contextFloorExceededDetail`,{ordinal:e.data.sessionOrdinal,requiredBytes:e.data.requiredBytes,budgetBytes:e.data.budgetBytes}),icon:`pause`,label:t(`event.contextFloorExceeded`),tone:`warning`};case`WORK_ITEM_WORKSPACE_CREATED`:return{detail:t(`event.workspaceCreatedDetail`,{branch:e.data.workspace.branch,count:e.data.carriedPaths.length,mode:t(`workspace.mode.${e.data.workspace.strategy}`)}),icon:`branch`,label:t(`event.workspaceCreated`),tone:`success`};case`PROJECT_WORKSPACE_STRATEGY_CHANGED`:return{detail:t(`event.workspaceStrategyChangedDetail`,{mode:t(`workspace.mode.${e.data.selection.strategy}`)}),icon:`projects`,label:t(`event.workspaceStrategyChanged`),tone:`neutral`};case`WORK_ITEM_WORKSPACE_ORPHANED`:return{detail:t(`event.workspaceOrphanedDetail`),icon:`warning`,label:t(`event.workspaceOrphaned`),tone:`warning`}}},CC=(e,t)=>new Intl.DateTimeFormat(t===`ru`?`ru-RU`:`en-US`,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),wC=({item:e,onSelect:t,selected:n})=>{let{t:r}=Z(),i=(0,M.useRef)(null);return(0,M.useEffect)(()=>{n&&i.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[n]),(0,G.jsx)(`button`,{"aria-label":e.title,"aria-pressed":n,className:`task-card-button`,onClick:()=>{t(e.id)},ref:i,type:`button`,children:(0,G.jsx)(Nh,{agent:r(eC[e.type]),badge:{label:r(QS[e.priority]),tone:rC(e.priority)},description:e.description,id:iC(e.id),meta:ZS(e.state,r),selected:n,title:e.title})})},TC=e=>e.split(`
|
|
10
|
+
`).map(e=>e.trim()).filter(Boolean),EC=({item:e})=>{let{t}=Z(),n=pb(),r=(0,M.useRef)(null),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(e.title),[c,l]=(0,M.useState)(e.description),[u,d]=(0,M.useState)(e.priority),[f,p]=(0,M.useState)(e.risk),[m,h]=(0,M.useState)(e.acceptanceCriteria.join(`
|
|
11
|
+
`)),g=TC(m),_=g.length<=50&&new Set(g).size===g.length&&g.every(e=>e.length<=500),v=o.trim()!==e.title||c.trim()!==e.description||u!==e.priority||f!==e.risk||g.length!==e.acceptanceCriteria.length||g.some((t,n)=>t!==e.acceptanceCriteria[n]),y=()=>{s(e.title),l(e.description),d(e.priority),p(e.risk),h(e.acceptanceCriteria.join(`
|
|
12
|
+
`)),n.reset()};return(0,G.jsx)(ph,{closeLabel:t(`action.closeDialog`),description:t(`task.edit.description`),footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{disabled:n.isPending,onClick:()=>{a(!1),y()},children:t(`action.cancel`)}),(0,G.jsx)(J,{disabled:!o.trim()||!_||!v,loading:n.isPending,onClick:()=>{r.current?.requestSubmit()},type:`button`,variant:`primary`,children:t(`task.edit.submit`)})]}),onOpenChange:e=>{e&&y(),a(e)},open:i,size:`lg`,title:t(`task.edit`),trigger:(0,G.jsx)(Gm,{label:t(`task.edit`),name:`edit`,size:`sm`,variant:`surface`}),triggerTooltip:t(`task.edit`),children:(0,G.jsxs)(`form`,{className:`edit-task-form`,onSubmit:t=>{t.preventDefault();let r=o.trim(),i=c.trim();if(!r||!_||!v)return;let s={...r===e.title?{}:{title:r},...i===e.description?{}:{description:i},...u===e.priority?{}:{priority:u},...f===e.risk?{}:{risk:f},...g.length===e.acceptanceCriteria.length&&g.every((t,n)=>t===e.acceptanceCriteria[n])?{}:{acceptanceCriteria:[...g]}};n.mutate({patch:s,workItem:e},{onSuccess:()=>{a(!1)}})},ref:r,children:[n.error?(0,G.jsx)($,{error:n.error,onRetry:()=>{r.current?.requestSubmit()},retrying:n.isPending}):null,(0,G.jsx)(X,{htmlFor:`edit-task-title`,label:t(`task.create.title`),required:!0,children:(0,G.jsx)(Qm,{autoFocus:!0,id:`edit-task-title`,maxLength:200,onChange:e=>{s(e.currentTarget.value)},required:!0,value:o})}),(0,G.jsx)(X,{htmlFor:`edit-task-description`,label:t(`task.create.brief`),children:(0,G.jsx)($m,{id:`edit-task-description`,maxLength:2e4,onChange:e=>{l(e.currentTarget.value)},rows:5,value:c})}),(0,G.jsxs)(`div`,{className:`edit-task-form__row`,children:[(0,G.jsx)(X,{htmlFor:`edit-task-priority`,label:t(`task.priority`),children:(0,G.jsx)(rh,{ariaLabel:t(`task.priority`),id:`edit-task-priority`,onValueChange:e=>{d(Ep.parse(e))},options:Object.keys(QS).map(e=>({label:t(QS[e]),value:e})),value:u})}),(0,G.jsx)(X,{htmlFor:`edit-task-risk`,label:t(`task.risk`),children:(0,G.jsx)(rh,{ariaLabel:t(`task.risk`),id:`edit-task-risk`,onValueChange:e=>{p(Dp.parse(e))},options:Object.keys($S).map(e=>({label:t($S[e]),value:e})),value:f})})]}),(0,G.jsx)(X,{description:t(`task.edit.criteriaDescription`),htmlFor:`edit-work-item-criteria`,label:t(`task.acceptanceCriteria`),..._?{}:{error:t(`task.edit.criteriaError`)},children:(0,G.jsx)($m,{"aria-describedby":`edit-work-item-criteria-description`,id:`edit-work-item-criteria`,invalid:!_,onChange:e=>{h(e.currentTarget.value)},rows:5,value:m})})]})})},DC={LOW:`neutral`,MEDIUM:`info`,HIGH:`warning`,CRITICAL:`danger`},OC={OPEN:`danger`,RESOLVED:`success`,WAIVED:`warning`,FALSE_POSITIVE:`neutral`},kC=e=>e.path===null?null:e.startLine===null?e.path:`${e.path}:${e.startLine.toString()}-${(e.endLine??e.startLine).toString()}`,AC=({item:e})=>{let{t}=Z(),n=ay(e.id),r=gb(),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(``);if(n.error)return(0,G.jsx)($,{error:n.error,onRetry:()=>{n.refetch()},retrying:n.isFetching});let c=n.data,l=c?.reports[0];if(l===void 0&&(c?.findings.length??0)===0)return null;let u=e=>{e.preventDefault(),i!==null&&o.trim().length!==0&&r.mutate({...i,reason:o.trim()},{onSuccess:()=>{a(null),s(``)}})};return(0,G.jsxs)(`section`,{"aria-label":t(`review.title`),className:`review-panel`,children:[l?(0,G.jsxs)(`header`,{className:`review-panel__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:t(`review.round`,{round:l.round})}),(0,G.jsx)(`strong`,{children:l.title})]}),(0,G.jsx)(Km,{tone:l.verdict===`PASSED`?`success`:`danger`,children:t(`review.verdict.${l.verdict}`)})]}):null,l?(0,G.jsxs)(`div`,{className:`review-panel__summary`,children:[(0,G.jsx)(`p`,{children:l.summary}),(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`review.reviewer`)}),(0,G.jsx)(`dd`,{children:l.reviewerProvider})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`review.relation`)}),(0,G.jsx)(`dd`,{children:t(`review.relation.${l.providerRelation}`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`review.tree`)}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(`code`,{title:l.reviewedTree,children:l.reviewedTree.slice(0,8)})})]})]})]}):null,c&&c.findings.length>0?(0,G.jsx)(`ol`,{"aria-label":t(`review.findings`),className:`review-finding-list`,children:c.findings.map(e=>{let n=kC(e);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{className:`review-finding__heading`,children:[(0,G.jsx)(`strong`,{children:e.title}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Km,{tone:DC[e.severity],children:t(`review.severity.${e.severity}`)}),(0,G.jsx)(Km,{tone:OC[e.status],children:t(`review.findingStatus.${e.status}`)})]})]}),(0,G.jsx)(`p`,{children:e.description}),n?(0,G.jsx)(`code`,{className:`review-finding__location`,children:n}):null,(0,G.jsxs)(`div`,{className:`review-finding__detail`,children:[(0,G.jsx)(`strong`,{children:t(`review.reproduction`)}),(0,G.jsx)(`span`,{children:e.reproduction})]}),e.status===`OPEN`?(0,G.jsxs)(`div`,{className:`review-finding__actions`,children:[(0,G.jsx)(J,{onClick:()=>{r.reset(),s(``),a({finding:e,disposition:`WAIVED`})},size:`sm`,variant:`secondary`,children:t(`review.waive`)}),(0,G.jsx)(J,{onClick:()=>{r.reset(),s(``),a({finding:e,disposition:`FALSE_POSITIVE`})},size:`sm`,variant:`secondary`,children:t(`review.falsePositive`)})]}):e.resolutionReason?(0,G.jsx)(`p`,{className:`review-finding__resolution`,children:e.resolutionReason}):null,i?.finding.id===e.id?(0,G.jsxs)(`form`,{className:`review-disposition`,onSubmit:u,children:[(0,G.jsx)(X,{htmlFor:`review-disposition-${e.id}`,label:t(`review.reason`),children:(0,G.jsx)($m,{autoFocus:!0,id:`review-disposition-${e.id}`,maxLength:4e3,onChange:e=>{s(e.currentTarget.value)},placeholder:t(`review.reasonPlaceholder`),rows:3,value:o})}),r.error?(0,G.jsx)($,{error:r.error}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(J,{disabled:o.trim().length===0,loading:r.isPending,size:`sm`,type:`submit`,variant:`primary`,children:t(i.disposition===`WAIVED`?`review.confirmWaive`:`review.confirmFalsePositive`)}),(0,G.jsx)(J,{disabled:r.isPending,onClick:()=>{a(null),s(``)},size:`sm`,type:`button`,variant:`secondary`,children:t(`action.cancel`)})]})]}):null]},e.id)})}):(0,G.jsx)(`p`,{className:`review-panel__empty`,children:t(`review.noFindings`)})]})},jC={RUNNING:`info`,PASSED:`success`,FAILED:`danger`,ERROR:`warning`},MC={INFO:`neutral`,WARNING:`warning`,ERROR:`danger`},NC={LOW:`neutral`,MEDIUM:`info`,HIGH:`warning`,CRITICAL:`danger`},PC={OPEN:`danger`,RESOLVED:`success`,WAIVED:`warning`},FC={ACTIVE:`info`,PASSED:`success`,SUPERSEDED:`neutral`,EXHAUSTED:`warning`,CANCELLED:`neutral`},IC=({correctionGate:e,item:t})=>{let{t:n}=Z(),r=oy(t.id),i=vb(),a=_b(),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(``);if(r.error)return(0,G.jsx)($,{error:r.error,onRetry:()=>{r.refetch()},retrying:r.isFetching});let u=r.data,d=u?.runs.at(-1);if(u===void 0||d===void 0)return null;let f=u.evidence.find(({qaRunId:e})=>e===d.id),p=u.attachments.filter(({qaRunId:e})=>e===d.id),m=u.defects,h=f?.environment,g=e?.correctionRunId??null,_=g===null?void 0:u.correctionRuns.find(({id:e})=>e===g),v=e=>{e.preventDefault(),o!==null&&c.trim().length!==0&&a.mutate({defect:o,reason:c.trim()},{onSuccess:()=>{s(null),l(``)}})};return(0,G.jsxs)(`section`,{"aria-label":n(`qa.title`),className:`qa-panel`,children:[(0,G.jsxs)(`header`,{className:`qa-panel__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:n(`qa.planRevision`,{revision:d.plan.revision})}),(0,G.jsx)(`strong`,{children:n(`qa.title`)})]}),(0,G.jsx)(Km,{tone:jC[d.status],children:n(`qa.status.${d.status}`)})]}),e!==null&&(e.correctionRunId===null||_?.status===`EXHAUSTED`)?(0,G.jsxs)(`div`,{className:`human-request-card`,children:[(0,G.jsx)(`h3`,{children:n(`qa.correctionGate.title`)}),(0,G.jsx)(`p`,{children:_===void 0?e.request.context:n(`qa.correctionGate.description`,{ordinal:_.ordinal})}),e.request.recommendation?(0,G.jsxs)(`div`,{className:`human-request-card__recommendation`,children:[(0,G.jsx)(`strong`,{children:n(`humanRequest.recommendation`)}),(0,G.jsx)(`span`,{children:e.request.recommendation})]}):null,i.error?(0,G.jsx)($,{error:i.error}):null,(0,G.jsxs)(`div`,{className:`workflow-panel__actions`,children:[e.request.options.length===2?(0,G.jsx)(J,{disabled:i.isPending,loading:i.isPending&&i.variables.action===`AUTHORIZE_FINAL`,onClick:()=>{i.mutate({action:`AUTHORIZE_FINAL`,correctionRun:_??null,request:e.request,run:e.run})},variant:`primary`,children:n(`qa.correctionGate.authorizeFinal`)}):null,(0,G.jsx)(J,{disabled:i.isPending,loading:i.isPending&&i.variables.action===`CANCEL`,onClick:()=>{i.mutate({action:`CANCEL`,correctionRun:_??null,request:e.request,run:e.run})},variant:`secondary`,children:n(`qa.correctionGate.cancel`)})]})]}):null,(0,G.jsxs)(`dl`,{className:`qa-panel__facts`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.tree`)}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(`code`,{title:d.testedTree,children:d.testedTree.slice(0,8)})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.target`)}),(0,G.jsx)(`dd`,{children:d.targetOrigin})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.environment`)}),(0,G.jsx)(`dd`,{children:h?`${h.browserName} ${h.browserVersion} · ${h.osFamily} · Node ${h.runtimeVersion}`:n(`qa.notRun`)})]})]}),d.error?(0,G.jsx)(`p`,{className:`qa-panel__error`,children:d.error.summary}):null,u.correctionRuns.length>0?(0,G.jsxs)(`div`,{className:`qa-panel__section`,children:[(0,G.jsx)(`strong`,{children:n(`qa.correctionTimeline`)}),(0,G.jsx)(`ol`,{"aria-label":n(`qa.correctionTimeline`),className:`qa-correction-list`,children:u.correctionRuns.map(e=>{let t=u.retestPlans.find(t=>t.correctionRunId===e.id);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{className:`qa-correction__heading`,children:[(0,G.jsx)(`strong`,{children:n(`qa.correction`,{ordinal:e.ordinal})}),(0,G.jsx)(Km,{tone:FC[e.status],children:n(`qa.correctionStatus.${e.status}`)})]}),(0,G.jsxs)(`dl`,{className:`qa-correction__lineage`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.correctionSource`)}),(0,G.jsxs)(`dd`,{children:[(0,G.jsx)(`code`,{title:e.sourceQARunId,children:e.sourceQARunId}),(0,G.jsx)(`span`,{children:n(`qa.correctionTree`,{tree:e.sourceTestedTree.slice(0,8)})})]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.correctionEvidence`)}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(`code`,{title:e.sourceEvidenceBundleId,children:e.sourceEvidenceBundleId})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:n(`qa.correctionBaseline`)}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(`code`,{title:e.baselineQARunId,children:e.baselineQARunId})})]})]}),t?(0,G.jsxs)(`div`,{className:`qa-correction__scope`,children:[(0,G.jsx)(`strong`,{children:n(`qa.retestScope`,{count:t.cells.length})}),(0,G.jsx)(`ol`,{children:t.cells.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`code`,{children:e.targetId}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,G.jsx)(`code`,{children:e.scenarioId}),(0,G.jsx)(`span`,{className:`qa-correction__reasons`,children:e.reasons.map(e=>(0,G.jsx)(`span`,{children:n(`qa.retestReason.${e}`)},e))})]},`${e.targetId}:${e.scenarioId}`))})]}):null]},e.id)})})]}):null,(0,G.jsxs)(`div`,{className:`qa-panel__section`,children:[(0,G.jsx)(`strong`,{children:n(`qa.matrix`)}),(0,G.jsx)(`ol`,{className:`qa-matrix`,children:d.plan.targets.flatMap(e=>d.plan.scenarios.map(t=>{let r=f?.executions.find(n=>n.targetId===e.id&&n.scenarioId===t.id),i=r?.assertions.filter(({status:e})=>e===`FAILED`)??[],a=r?.steps.filter(({status:e})=>e===`FAILED`)??[],o=r!==void 0&&i.length===0&&a.length===0;return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{className:`qa-matrix__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:t.title}),(0,G.jsxs)(`span`,{children:[e.viewport.width,`×`,e.viewport.height,` · `,e.locale,` ·`,` `,n(e.theme===`LIGHT`?`theme.light`:`theme.dark`)]})]}),(0,G.jsx)(Km,{tone:r===void 0?`neutral`:o?`success`:`danger`,children:n(r===void 0?`qa.notRun`:o?`qa.status.PASSED`:`qa.status.FAILED`)})]}),r?(0,G.jsx)(`span`,{className:`qa-matrix__progress`,children:n(`qa.scenarioProgress`,{steps:r.steps.length,assertions:r.assertions.length})}):null,i.length>0?(0,G.jsx)(`ul`,{className:`qa-matrix__failures`,children:i.map(e=>{let r=t.assertions.find(({id:t})=>t===e.id);return(0,G.jsxs)(`li`,{children:[n(`qa.assertionFailed`,{title:r?.title??e.id}),e.details?(0,G.jsx)(`span`,{children:e.details}):null]},e.id)})}):null]},`${e.id}:${t.id}`)}))})]}),f&&f.observations.length>0?(0,G.jsxs)(`div`,{className:`qa-panel__section`,children:[(0,G.jsx)(`strong`,{children:n(`qa.observations`)}),(0,G.jsx)(`ul`,{className:`qa-observation-list`,children:f.observations.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Km,{tone:MC[e.severity],children:n(`qa.observation.${e.kind}`)}),e.blocking?(0,G.jsx)(Km,{tone:`danger`,children:n(`qa.blocking`)}):null]}),(0,G.jsx)(`p`,{children:e.summary})]},`${e.targetId}:${e.scenarioId}:${t.toString()}`))})]}):null,m.length>0?(0,G.jsxs)(`div`,{className:`qa-panel__section`,children:[(0,G.jsx)(`strong`,{children:n(`qa.defects`)}),(0,G.jsx)(`ol`,{className:`qa-defect-list`,children:m.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e.title}),(0,G.jsxs)(`span`,{className:`qa-defect__badges`,children:[(0,G.jsx)(Km,{tone:NC[e.severity],children:n(`review.severity.${e.severity}`)}),(0,G.jsx)(Km,{tone:PC[e.status],children:n(`qa.defectStatus.${e.status}`)})]})]}),(0,G.jsx)(`p`,{children:e.description}),(0,G.jsxs)(`span`,{children:[(0,G.jsxs)(`strong`,{children:[n(`qa.reproduction`),`: `]}),e.reproduction.join(` · `)]}),e.status===`OPEN`?(0,G.jsx)(`div`,{className:`qa-defect__actions`,children:(0,G.jsx)(J,{onClick:()=>{a.reset(),l(``),s(e)},size:`sm`,variant:`secondary`,children:n(`qa.waive`)})}):e.resolutionReason?(0,G.jsx)(`p`,{className:`qa-defect__resolution`,children:e.resolutionReason}):null,e.status===`RESOLVED`&&e.resolvedByQARunId?(0,G.jsxs)(`span`,{className:`qa-defect__provenance`,children:[(0,G.jsxs)(`strong`,{children:[n(`qa.resolvedBy`),`: `]}),(0,G.jsx)(`code`,{title:e.resolvedByQARunId,children:e.resolvedByQARunId})]}):null,o?.id===e.id?(0,G.jsxs)(`form`,{className:`qa-defect-waiver`,onSubmit:v,children:[(0,G.jsx)(X,{htmlFor:`qa-defect-waiver-${e.id}`,label:n(`qa.waiverReason`),children:(0,G.jsx)($m,{autoFocus:!0,id:`qa-defect-waiver-${e.id}`,maxLength:4e3,onChange:e=>{l(e.currentTarget.value)},placeholder:n(`qa.waiverReasonPlaceholder`),rows:3,value:c})}),a.error?(0,G.jsx)($,{error:a.error}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(J,{disabled:c.trim().length===0,loading:a.isPending,size:`sm`,type:`submit`,variant:`primary`,children:n(`qa.confirmWaive`)}),(0,G.jsx)(J,{disabled:a.isPending,onClick:()=>{s(null),l(``)},size:`sm`,type:`button`,variant:`secondary`,children:n(`action.cancel`)})]})]}):null]},e.id))})]}):null,p.length>0?(0,G.jsxs)(`div`,{className:`qa-panel__section`,children:[(0,G.jsx)(`strong`,{children:n(`qa.attachments`)}),(0,G.jsx)(`ul`,{className:`qa-attachment-list`,children:p.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:n(`qa.attachment.${e.kind}`)}),(0,G.jsxs)(`a`,{href:x_(t.id,e.id),rel:`noreferrer`,target:`_blank`,children:[n(`qa.openAttachment`),(0,G.jsx)(K,{name:`external`,size:13})]})]},e.id))})]}):null]})},LC=({acceptancePackage:e,artifacts:t,item:n,run:r})=>{let{t:i}=Z(),a=Sb(),[o,s]=(0,M.useState)(null),c=t=>{s(t),a.mutate({acceptancePackage:e,action:t,run:r,workItem:n})};return(0,G.jsxs)(`div`,{className:`acceptance-package`,children:[(0,G.jsxs)(`div`,{className:`acceptance-package__heading`,children:[(0,G.jsxs)(`div`,{className:`acceptance-package__title`,children:[(0,G.jsx)(`span`,{children:i(`acceptance.eyebrow`)}),(0,G.jsx)(`h3`,{children:i(`acceptance.title`)})]}),(0,G.jsxs)(`div`,{className:`acceptance-package__heading-actions`,children:[(0,G.jsx)(qm,{label:i(_C[e.status]),tone:vC[e.status]}),(0,G.jsxs)(`a`,{className:`acceptance-package__export`,download:!0,href:S_(n.id,e.id),children:[(0,G.jsx)(K,{name:`external`,size:13}),i(`acceptance.export`)]})]})]}),(0,G.jsx)(`p`,{children:e.releaseNote}),(0,G.jsx)(`div`,{className:`acceptance-evidence`,"aria-label":i(`acceptance.evidence`),children:t.map(e=>(0,G.jsxs)(`article`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(K,{name:`check`,size:13}),(0,G.jsx)(`strong`,{children:e.kind===`REVIEW_REPORT`?i(`acceptance.reviewEvidence`):i(`acceptance.qaEvidence`)})]}),(0,G.jsx)(`span`,{children:e.summary}),(0,G.jsx)(`small`,{children:i(`acceptance.checks`,{count:e.checks.length})})]},e.id))}),(0,G.jsxs)(`div`,{className:`acceptance-matrix`,children:[(0,G.jsx)(`strong`,{children:i(`acceptance.matrix`)}),e.criteria.length>0?(0,G.jsx)(`ol`,{children:e.criteria.map((e,t)=>{let n=e.reviewCheck!==void 0&&e.qaCheck!==void 0;return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(K,{name:n?`check`:`warning`,size:13}),(0,G.jsx)(`strong`,{children:e.criterion})]}),n?null:(0,G.jsx)(`span`,{className:`acceptance-matrix__legacy`,children:i(`acceptance.legacyEvidence`)}),(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:i(`acceptance.implementation`)}),(0,G.jsx)(`dd`,{children:e.implementation})]}),n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:i(`acceptance.reviewCheck`)}),(0,G.jsx)(`dd`,{children:e.reviewCheck})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:i(`acceptance.qaCheck`)}),(0,G.jsx)(`dd`,{children:e.qaCheck})]})]}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:i(`acceptance.ownerVerification`)}),(0,G.jsx)(`dd`,{children:e.verification})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:i(`acceptance.knownRisk`)}),(0,G.jsx)(`dd`,{children:e.knownRisk??i(`acceptance.noKnownRisk`)})]})]})]},`${t.toString()}:${e.criterion}`)})}):(0,G.jsx)(`span`,{children:i(`acceptance.noCriteria`)})]}),a.error?(0,G.jsx)($,{error:a.error,onRetry:()=>{o&&c(o)},retrying:a.isPending}):null,e.status===`PENDING`?(0,G.jsxs)(`div`,{className:`acceptance-package__actions`,children:[(0,G.jsx)(J,{disabled:a.isPending,loading:a.isPending&&o===`ACCEPT`,onClick:()=>{c(`ACCEPT`)},variant:`primary`,children:i(`acceptance.accept`)}),(0,G.jsx)(J,{disabled:a.isPending,loading:a.isPending&&o===`RETURN_TO_WORK`,onClick:()=>{c(`RETURN_TO_WORK`)},children:i(`acceptance.return`)}),(0,G.jsx)(J,{disabled:a.isPending,loading:a.isPending&&o===`REJECT`,onClick:()=>{c(`REJECT`)},children:i(`acceptance.reject`)})]}):null]})},RC=({label:e})=>(0,G.jsxs)(`div`,{"aria-label":e,className:`inspector-workflow-skeleton`,role:e===void 0?void 0:`status`,children:[(0,G.jsxs)(`div`,{className:`inspector-workflow-skeleton__status`,children:[(0,G.jsx)(Y,{width:`42%`}),(0,G.jsx)(Y,{width:`68px`})]}),(0,G.jsxs)(`div`,{className:`inspector-workflow-skeleton__panel`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Y,{width:`48%`}),(0,G.jsx)(Y,{width:`54px`})]}),(0,G.jsx)(Y,{className:`inspector-workflow-skeleton__meter`,width:`100%`}),(0,G.jsx)(Y,{width:`36%`})]}),(0,G.jsxs)(`div`,{className:`inspector-workflow-skeleton__steps`,children:[(0,G.jsx)(Y,{width:`58%`}),(0,G.jsx)(Y,{width:`44%`})]})]}),zC=(e,t)=>{if(e.status===`RUNNING`)return{label:t(`workflow.sessions.status.RUNNING`),tone:`running`};switch(e.endReason){case`COMPLETED`:return{label:t(`workflow.sessions.status.COMPLETED`),tone:`complete`};case`HANDOFF`:return{label:t(`workflow.sessions.status.HANDOFF`),tone:`waiting`};case`CONTEXT_EXHAUSTED`:return{label:t(`workflow.sessions.status.CONTEXT_EXHAUSTED`),tone:`paused`};case`INTERRUPTED`:return{label:t(`workflow.sessions.status.INTERRUPTED`),tone:`paused`};case`CANCELLED`:return{label:t(`workflow.sessions.status.CANCELLED`),tone:`queued`};case null:return{label:t(`workflow.stage.other`),tone:`queued`}}},BC=(e,t)=>[{label:t(`workflow.checkpoints.completed`),items:e.completed},{label:t(`workflow.checkpoints.remaining`),items:e.remaining},{label:t(`workflow.checkpoints.deadEnds`),items:e.deadEnds},{label:t(`workflow.checkpoints.openQuestions`),items:e.openQuestions}],VC=({attempt:e})=>{let{locale:t,t:n}=Z(),r=uy(e.id),i=dy(),a=r.data?.sessions??[],o=r.data?.checkpoints??[],s=r.data?.usageReports??[],c=r.data?.peakContextWindowUsage??{};if(a.length===0)return null;let l=o.reduce((e,t)=>e===null||t.createdAt>e.createdAt?{id:t.id,createdAt:t.createdAt}:e,null)?.id,u=[...a].sort((e,t)=>e.ordinal-t.ordinal).map(e=>{let r=zC(e,n),i=c[e.id],a=s.find(t=>t.providerSessionId===e.id),u=i?Math.round(i.usedTokens/i.windowTokens*100):void 0,d=o.filter(t=>t.providerSessionId===e.id).sort((e,t)=>e.ordinal-t.ordinal).map(e=>({id:e.id,summary:e.summary,timeLabel:CC(e.createdAt,t),defaultOpen:e.id===l,groups:BC(e,n)}));return{id:e.id,ordinal:e.ordinal,ariaLabel:n(`workflow.sessions.ordinal`,{ordinal:e.ordinal}),statusLabel:r.label,tone:r.tone,checkpoints:d,...e.handoffRequestedAt===null?{}:{handoffRequestedLabel:n(`workflow.sessions.handoffRequested`)},...u===void 0||i===void 0?{}:{occupancyPercent:u,occupancyLabel:n(e.handoffRequestedAt===null?`workflow.sessions.occupancyPeak`:`workflow.sessions.occupancyAtHandoff`,{percent:u}),occupancyQualityLabel:n(uC[i.quality])},...a===void 0?{}:{usageLabel:n(`workflow.sessions.tokenUsage`,{total:a.totalTokens.toLocaleString(t),input:a.inputTokens.toLocaleString(t),output:a.outputTokens.toLocaleString(t),cached:a.cachedInputTokens===null?n(`workflow.sessions.cacheUnknown`):a.cachedInputTokens.toLocaleString(t),uncached:a.cachedInputTokens===null||a.cachedInputTokens>a.inputTokens?n(`workflow.sessions.cacheUnknown`):(a.inputTokens-a.cachedInputTokens+a.outputTokens).toLocaleString(t)}),usageQualityLabel:n(uC[a.quality]),...a.costUsd===null?{}:{usageCostLabel:n(`workflow.sessions.tokenCost`,{cost:a.costUsd.toLocaleString(t,{style:`currency`,currency:`USD`,maximumFractionDigits:4})})}},...d.length===0?{emptyCheckpointsLabel:n(`workflow.checkpoints.empty`)}:{}}}),d={heading:n(`workflow.sessions.attemptHeading`,{attempt:e.attempt}),statusLabel:pC(e,n),tone:mC[e.status]};return(0,G.jsx)(Rh,{attempt:d,...i.data?.checkpointOnRequest===!1?{note:n(`workflow.sessions.noCheckpointOnRequest`)}:{},sessions:u,title:n(`workflow.sessions.title`)})},HC={READY:`workspace.status.READY`,ORPHANED:`workspace.status.ORPHANED`,REMOVED:`workspace.status.REMOVED`},UC={READY:`ready`,ORPHANED:`paused`,REMOVED:`queued`},WC=12,GC=({item:e})=>{let{t}=Z(),{projects:n}=Kv(),r=sy(e.id).data?.workspace??null;if(!r)return null;let i=n.find(t=>t.id===e.projectId)??null;return(0,G.jsx)(Ih,{title:t(`workspace.title`),children:(0,G.jsxs)(`div`,{className:`workspace-identity`,children:[(0,G.jsx)(Lh,{properties:[{label:t(`workspace.state`),value:(0,G.jsx)(qm,{label:t(HC[r.status]),tone:UC[r.status]})},{label:t(`workspace.mode`),value:t(`workspace.mode.${r.strategy}`)},{label:t(`workspace.baseCommit`),value:r.baseCommit===null?t(`workspace.baseCommit.none`):(0,G.jsx)(`code`,{className:`workspace-identity__sha`,title:r.baseCommit,children:r.baseCommit.slice(0,WC)})}]}),(0,G.jsxs)(`dl`,{className:`workspace-identity__locations`,children:[i&&r.strategy===`ISOLATED_WORKTREE`?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`workspace.repository`)}),(0,G.jsx)(`dd`,{children:i.repositoryPath})]}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`workspace.branch`)}),(0,G.jsx)(`dd`,{children:r.branch})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(r.strategy===`SHARED_CURRENT_DIRECTORY`?`workspace.workingDirectory`:`workspace.worktree`)}),(0,G.jsx)(`dd`,{children:r.worktreePath})]})]}),r.status===`READY`?null:(0,G.jsx)(`p`,{className:`workspace-identity__note`,role:`status`,children:t(r.strategy===`SHARED_CURRENT_DIRECTORY`?`workspace.sharedNotReady`:`workspace.notReady`)}),(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(r.strategy===`SHARED_CURRENT_DIRECTORY`?`workspace.sharedUncommitted`:`workspace.uncommitted`)})]})})},KC=[`FAST`,`STANDARD`,`DEEP`],qC=(e,t)=>KC.map(n=>{if(e===void 0)return{label:t(`workflow.modelTier.${n}`),value:n};let r=e.selection.preference;if(r===`CODEX`||r===`CLAUDE_CODE`){let i=e.providers.find(({provider:e})=>e===r)?.models?.[n];if(i!==void 0)return{description:t(`workflow.model.providerDescription`,{provider:r===`CODEX`?`Codex`:`Claude Code`,tier:t(`workflow.modelTier.${n}`)}),label:i,value:n}}if(r===`AUTO`){let r=e.providers.find(({provider:e})=>e===`CODEX`)?.models?.[n],i=e.providers.find(({provider:e})=>e===`CLAUDE_CODE`)?.models?.[n];if(r!==void 0&&i!==void 0)return{description:t(`workflow.model.autoDescription`,{claude:i,codex:r}),label:t(`workflow.model.autoOption`,{tier:t(`workflow.modelTier.${n}`)}),value:n}}return{description:t(`workflow.model.loading`),label:t(`workflow.modelTier.${n}`),value:n}}),JC=e=>e===void 0||[`RUNNING`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`,`INTERRUPTED`].includes(e.run?.status??``),YC=({item:e})=>{let{t}=Z(),n=qv(e.projectId),r=Jv(e.projectId),i=ey(e.id),a=db(),[o,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)([]),u=n.data?.workItems??[],d=WS(e,u,r.data?.dependencies??[]),f=u.filter(({id:t})=>t!==e.id),p=d.blockers.map(({id:e})=>e).sort(),m=[...c].sort(),h=p.length!==m.length||p.some((e,t)=>e!==m[t]),g=JC(i.data)||e.state===`DONE`||e.state===`CANCELLED`||n.isPending||r.isPending||n.isError||r.isError,_=(e,n)=>e.length===0?(0,G.jsx)(`span`,{className:`dependency-graph__empty`,children:t(n)}):(0,G.jsx)(`ul`,{className:`dependency-graph__list`,children:e.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:e.title}),(0,G.jsx)(qm,{label:ZS(e.state,t),tone:nC[e.state]})]},e.id))});return(0,G.jsxs)(Ih,{action:(0,G.jsxs)(ph,{closeLabel:t(`action.closeDialog`),description:t(`dependency.editDescription`),footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{disabled:a.isPending,onClick:()=>{s(!1),a.reset()},children:t(`action.cancel`)}),(0,G.jsx)(J,{disabled:!h,loading:a.isPending,onClick:()=>{h&&a.mutate({blockerWorkItemIds:m,workItem:e},{onSuccess:()=>{s(!1)}})},variant:`primary`,children:t(`dependency.save`)})]}),onOpenChange:e=>{e&&(l(p),a.reset()),s(e)},open:o,title:t(`dependency.edit`),trigger:(0,G.jsx)(J,{disabled:g,icon:`edit`,size:`sm`,variant:`surface`,children:t(`dependency.edit`)}),children:[a.error?(0,G.jsx)($,{error:a.error,onRetry:()=>{a.mutate({blockerWorkItemIds:m,workItem:e})},retrying:a.isPending}):null,(0,G.jsx)(`div`,{className:`dependency-dialog-list`,role:`group`,"aria-label":t(`dependency.blockedBy`),children:f.length===0?(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(`dependency.noCandidates`)}):f.map(e=>(0,G.jsx)(eh,{checked:c.includes(e.id),description:ZS(e.state,t),label:e.title,onCheckedChange:t=>{l(n=>t===!0?[...n.filter(t=>t!==e.id),e.id]:n.filter(t=>t!==e.id))}},e.id))})]}),title:t(`dependency.title`),children:[r.error||n.error?(0,G.jsx)($,{error:r.error??n.error,onRetry:()=>{r.refetch(),n.refetch()},retrying:r.isFetching||n.isFetching}):r.isPending||n.isPending?(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(`dependency.loading`)}):(0,G.jsxs)(`dl`,{className:`dependency-graph`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`dependency.parent`)}),(0,G.jsx)(`dd`,{children:d.parent?.title??t(`dependency.none`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`dependency.children`)}),(0,G.jsx)(`dd`,{children:_(d.children,`dependency.noChildren`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`dependency.blockedBy`)}),(0,G.jsx)(`dd`,{children:_(d.blockers,`dependency.noBlockers`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`dependency.blocks`)}),(0,G.jsx)(`dd`,{children:_(d.blockedWorkItems,`dependency.blocksNone`)})]})]}),!r.isPending&&!n.isPending&&g?(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(`dependency.editUnavailable`)}):null]})},XC=({item:e})=>{let{t}=Z(),n=ey(e.id),r=fy(e.projectId),i=qv(e.projectId),a=Jv(e.projectId),o=mb(),s=bb(),c=xb(),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(String(BS)),[p,m]=(0,M.useState)(String(VS)),[h,g]=(0,M.useState)(`FAST`),_=qC(r.data,t),v=_.find(({value:e})=>e===h)?.description,y=i.data!==void 0&&a.data!==void 0,b=WS(e,i.data?.workItems??[],a.data?.dependencies??[]),x=i.isError||a.isError,S=n.data,C=S?.budgetPolicies.at(-1)??null,ee=C===null?null:HS(C),te=ee?.budgetLimitInput??null,w=ee?.agentRunLimitInput??null,T=ee?.modelTierOverride??null;(0,M.useEffect)(()=>{te!==null&&w!==null&&T!==null&&(f(te),m(w),g(T))},[w,te,T]);let E=Number(d),D=Number(p),O=Number.isSafeInteger(E)&&E>0,ne=Number.isSafeInteger(D)&&D>0&&D<=E,re=()=>{!O||!ne||!y||x||b.children.length>0||b.unsatisfiedBlockers.length>0||o.mutate({policy:{maxEstimatedTokens:E,modelTierOverride:h,agentRunMaxEstimatedTokensOverride:D},workItem:e})},k=S?.humanRequests.find(({id:e,status:t})=>t===`OPEN`&&e!==S.acceptancePackage?.humanRequestId)??null;if(n.isPending)return(0,G.jsx)(RC,{label:t(`workflow.loading`)});if(!S?.run)return(0,G.jsxs)(`div`,{className:`workflow-start`,children:[(0,G.jsx)(`p`,{className:`inspector-copy`,children:x?t(`workflow.dependencyLoadFailed`):b.children.length>0?t(`workflow.containerNotExecutable`):b.unsatisfiedBlockers.length>0?t(`workflow.dependencyBlocked`):e.state===`READY`?t(`workflow.startDescription`):t(`workflow.readyRequired`)}),b.unsatisfiedBlockers.length>0?(0,G.jsx)(`ul`,{className:`workflow-blockers`,children:b.unsatisfiedBlockers.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{children:e.title}),(0,G.jsx)(qm,{label:ZS(e.state,t),tone:nC[e.state]})]},e.id))}):null,o.error?(0,G.jsx)($,{error:o.error,onRetry:()=>{re()},retrying:o.isPending}):null,(0,G.jsxs)(`form`,{className:`workflow-policy-form`,onSubmit:e=>{e.preventDefault(),re()},children:[(0,G.jsx)(X,{...O?{}:{error:t(`workflow.budget.invalid`)},description:t(`workflow.budget.description`),htmlFor:`workflow-start-budget`,label:t(`workflow.budget.input`),required:!0,children:(0,G.jsx)(Qm,{id:`workflow-start-budget`,inputMode:`numeric`,invalid:!O,min:1,onChange:e=>{f(e.currentTarget.value)},required:!0,step:1,type:`number`,value:d})}),(0,G.jsx)(X,{...ne?{}:{error:t(`workflow.agentRunBudget.invalid`)},description:t(`workflow.agentRunBudget.description`),htmlFor:`workflow-start-agent-run-budget`,label:t(`workflow.agentRunBudget.input`),required:!0,children:(0,G.jsx)(Qm,{id:`workflow-start-agent-run-budget`,inputMode:`numeric`,invalid:!ne,min:1,onChange:e=>{m(e.currentTarget.value)},required:!0,step:1,type:`number`,value:p})}),(0,G.jsx)(X,{description:v??t(`workflow.model.loading`),htmlFor:`workflow-start-model-tier`,label:t(`workflow.model.input`),children:(0,G.jsx)(rh,{ariaLabel:t(`workflow.model.input`),id:`workflow-start-model-tier`,onValueChange:e=>{g(Je.parse(e))},options:_,value:h})}),(0,G.jsx)(J,{disabled:e.state!==`READY`||!O||!ne||!y||x||b.children.length>0||b.unsatisfiedBlockers.length>0,loading:o.isPending,type:`submit`,variant:`primary`,children:t(`workflow.start`)})]})]});let A=S.run,j=S.stageAttempts.find(e=>e.id===A.currentStageAttemptId)??null,ie=k!==null&&j?.stage===`QA`&&j.status===`WAITING_HUMAN`&&j.failureCode===`QA_CORRECTION_EXHAUSTED`?{correctionRunId:j.correctionRunId,request:k,run:A}:null,ae=k!==null&&j?.stage===`QA`&&j.status===`WAITING_HUMAN`&&j.failureCode===`VERIFICATION_CORRECTION_EXHAUSTED`?k:null,oe=S.usageRecords.reduce((e,t)=>e+t.amount,0),se=C?Math.min(100,Math.round(oe/C.maxEstimatedTokens*100)):0,ce=C!==null&&O&&E>=C.maxEstimatedTokens&&E>oe,le=C!==null&&ne&&(C.agentRunMaxEstimatedTokensOverride===void 0||C.agentRunMaxEstimatedTokensOverride===null||D>C.agentRunMaxEstimatedTokensOverride),ue=ce&&(E>C.maxEstimatedTokens||le),de=s.isPending||c.isPending,fe=t=>{s.reset(),c.reset(),u(t),s.mutate({action:t,run:A,workItem:e})},pe=()=>{ue&&(s.reset(),c.reset(),u(`override`),c.mutate({maxEstimatedTokens:E,modelTierOverride:h,agentRunMaxEstimatedTokensOverride:D,run:A,workItem:e}))};return(0,G.jsxs)(`div`,{className:`workflow-panel`,children:[(0,G.jsxs)(`div`,{className:`workflow-panel__status`,children:[(0,G.jsx)(`span`,{children:t(`workflow.name`)}),(0,G.jsx)(qm,{label:S.run.status===`HARD_PAUSED`?fC(j?.failureCode??null,`workflow.status.HARD_PAUSED`,t):t(hC[S.run.status]),tone:gC[S.run.status]})]}),C?(0,G.jsxs)(`div`,{className:`workflow-budget`,children:[(0,G.jsx)(`span`,{className:`workflow-budget__kind`,children:t(`workflow.budget.kind`)}),(0,G.jsxs)(`div`,{className:`workflow-budget__heading`,children:[(0,G.jsx)(`span`,{children:t(`workflow.budget.title`)}),(0,G.jsx)(`strong`,{children:t(`workflow.budget.usage`,{used:oe,limit:C.maxEstimatedTokens})})]}),(0,G.jsx)(`progress`,{"aria-label":t(`workflow.budget.title`),max:C.maxEstimatedTokens,value:Math.min(oe,C.maxEstimatedTokens)}),(0,G.jsxs)(`div`,{className:`workflow-budget__meta`,children:[(0,G.jsx)(`span`,{children:t(`workflow.budget.revision`,{revision:C.revision})}),(0,G.jsxs)(`span`,{children:[se,`%`]}),(0,G.jsx)(`span`,{children:t(`workflow.modelTier.current`,{tier:C.modelTierOverride===void 0||C.modelTierOverride===null?t(`workflow.modelTier.roleDefault`):t(`workflow.modelTier.${C.modelTierOverride}`)})}),(0,G.jsx)(`span`,{children:t(`workflow.agentRunBudget.current`,{limit:C.agentRunMaxEstimatedTokensOverride??t(`workflow.agentRunBudget.roleDefault`)})})]})]}):null,(0,G.jsx)(`ol`,{className:`workflow-stage-list`,children:S.stageAttempts.map(e=>(0,G.jsxs)(`li`,{className:`is-${e.status.toLowerCase()}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:t(tC[e.stage])}),(0,G.jsx)(`small`,{children:pC(e,t)})]})]},e.id))}),j?(0,G.jsx)(VC,{attempt:j}):null,(0,G.jsx)(AC,{item:e}),(0,G.jsx)(IC,{correctionGate:ie,item:e}),S.acceptancePackage?(0,G.jsx)(LC,{acceptancePackage:S.acceptancePackage,artifacts:S.artifacts,item:e,run:A}):S.artifacts.length>0?(0,G.jsxs)(`div`,{className:`workflow-artifact-summary`,children:[(0,G.jsx)(`strong`,{children:t(`acceptance.evidence`)}),(0,G.jsx)(`span`,{children:t(`acceptance.evidenceCount`,{count:S.artifacts.length})})]}):null,k&&ie===null&&ae===null?(0,G.jsx)(FS,{request:k}):null,S.recoveryReports.at(-1)?(0,G.jsxs)(`div`,{className:`workflow-recovery`,role:`status`,children:[(0,G.jsx)(`strong`,{children:t(`workflow.recovery.title`)}),(0,G.jsx)(`span`,{children:t(`workflow.recovery.description`)})]}):null,s.error||c.error?(0,G.jsx)($,{error:s.error??c.error,onRetry:()=>{l===`override`?pe():l&&fe(l)},retrying:de}):null,[`RUNNING`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`,`INTERRUPTED`].includes(A.status)&&S.acceptancePackage?.status!==`PENDING`&&ae===null?(0,G.jsxs)(`div`,{className:`workflow-panel__actions`,children:[A.status===`RUNNING`?(0,G.jsx)(J,{disabled:de,loading:s.isPending&&l===`pause`,onClick:()=>{fe(`pause`)},children:t(`workflow.action.pause`)}):null,A.status===`SOFT_PAUSED`||A.status===`INTERRUPTED`?(0,G.jsx)(J,{disabled:de,loading:s.isPending&&l===`resume`,onClick:()=>{fe(`resume`)},variant:`primary`,children:t(`workflow.action.resume`)}):null,A.status===`HARD_PAUSED`&&C!==null&&!Ro(j?.failureCode??null)?(0,G.jsxs)(`form`,{className:`workflow-policy-form workflow-policy-form--override`,onSubmit:e=>{e.preventDefault(),pe()},children:[(0,G.jsx)(X,{...ce?{}:{error:t(`workflow.budget.overrideInvalid`)},description:t(`workflow.budget.overrideDescription`,{current:C.maxEstimatedTokens,used:oe}),htmlFor:`workflow-override-budget`,label:t(`workflow.budget.input`),required:!0,children:(0,G.jsx)(Qm,{id:`workflow-override-budget`,inputMode:`numeric`,invalid:!ce,min:Math.max(C.maxEstimatedTokens,oe+1),onChange:e=>{f(e.currentTarget.value)},required:!0,step:1,type:`number`,value:d})}),(0,G.jsx)(X,{description:v??t(`workflow.model.loading`),htmlFor:`workflow-override-model-tier`,label:t(`workflow.model.input`),children:(0,G.jsx)(rh,{ariaLabel:t(`workflow.model.input`),id:`workflow-override-model-tier`,onValueChange:e=>{g(Je.parse(e))},options:_,value:h})}),(0,G.jsx)(X,{...ne&&(E>C.maxEstimatedTokens||le)?{}:{error:t(`workflow.agentRunBudget.overrideInvalid`)},description:t(`workflow.agentRunBudget.overrideDescription`),htmlFor:`workflow-override-agent-run-budget`,label:t(`workflow.agentRunBudget.input`),required:!0,children:(0,G.jsx)(Qm,{id:`workflow-override-agent-run-budget`,inputMode:`numeric`,invalid:!ne||E<=C.maxEstimatedTokens&&!le,min:1,onChange:e=>{m(e.currentTarget.value)},required:!0,step:1,type:`number`,value:p})}),(0,G.jsx)(J,{disabled:de||!ue,loading:c.isPending,type:`submit`,variant:`primary`,children:t(`workflow.action.override`)})]}):null,(0,G.jsx)(J,{disabled:de,loading:s.isPending&&l===`cancel`,onClick:()=>{fe(`cancel`)},variant:`secondary`,children:t(`workflow.action.cancel`)})]}):null,S.run.status===`SUCCEEDED`?(0,G.jsx)(`p`,{className:`workflow-panel__completed`,children:t(`workflow.completed`)}):null]})},ZC=({label:e})=>(0,G.jsx)(`div`,{"aria-label":e,className:`inspector-activity-skeleton`,role:e===void 0?void 0:`status`,children:[`first`,`second`,`third`].map((e,t)=>(0,G.jsxs)(`div`,{className:`inspector-activity-skeleton__row`,children:[(0,G.jsx)(Y,{className:`inspector-activity-skeleton__icon`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(Y,{width:t===1?`52%`:`68%`}),(0,G.jsx)(Y,{width:t===2?`64%`:`82%`})]}),(0,G.jsx)(Y,{width:`28px`})]},e))}),QC=({item:e})=>{let{locale:t,t:n}=Z(),r=$v(e.projectId,e.id),i=(r.data?.pages.flatMap(e=>e.events)??[]).filter(Ix),a=()=>{r.fetchNextPage()},o=Lx({hasLoadedFirstPage:r.data!==void 0,hasNextPage:r.hasNextPage,lifecycleEventsLoaded:i.length});return(0,M.useEffect)(()=>{o&&!r.isFetchingNextPage&&r.fetchNextPage()},[r,o]),(0,G.jsxs)(Ih,{action:r.data&&!o?(0,G.jsx)(`span`,{className:`inspector-step-count`,children:r.hasNextPage?n(`task.activityCountMore`,{count:i.length}):i.length}):void 0,title:n(`task.activity`),children:[i.length>0?(0,G.jsx)(`ol`,{"aria-busy":r.isFetchingNextPage,className:`inspector-activity`,children:i.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsx)(Fh,{...SC(e,n),time:CC(e.occurredAt,t)})},e.id))}):null,!o&&r.hasNextPage?(0,G.jsx)(J,{className:`inspector-activity__more`,disabled:r.isFetchingNextPage,loading:r.isFetchingNextPage,onClick:a,size:`sm`,children:n(`task.loadMoreActivity`)}):null,r.isPending||o?(0,G.jsx)(ZC,{label:n(`task.loadingActivity`)}):null,r.data&&i.length===0&&!o?(0,G.jsx)(`p`,{className:`inspector-copy`,children:n(`task.noActivity`)}):null]})},$C=()=>{let{t:e}=Z();return(0,G.jsxs)(`aside`,{"aria-busy":`true`,"aria-label":e(`loading.inspector.title`),className:`task-inspector`,role:`status`,children:[(0,G.jsxs)(`div`,{className:`task-inspector__header`,children:[(0,G.jsxs)(`div`,{className:`task-inspector__identity`,children:[(0,G.jsx)(Y,{width:`68px`}),(0,G.jsxs)(`div`,{className:`inspector-skeleton__actions`,children:[(0,G.jsx)(Y,{className:`inspector-skeleton__control`,width:`28px`}),(0,G.jsx)(Y,{className:`inspector-skeleton__control`,width:`112px`})]})]}),(0,G.jsx)(Y,{className:`inspector-skeleton__title`,width:`72%`})]}),(0,G.jsxs)(`section`,{className:`lr-inspector-section`,children:[(0,G.jsx)(`header`,{children:(0,G.jsx)(Y,{width:`64px`})}),(0,G.jsxs)(`div`,{className:`lr-inspector-section__body`,children:[(0,G.jsx)(`div`,{className:`inspector-skeleton__summary`,children:[`state`,`stage`,`type`,`priority`,`risk`].map((e,t)=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Y,{width:`48%`}),(0,G.jsx)(Y,{width:t%2==0?`74%`:`56%`})]},e))}),(0,G.jsxs)(`div`,{className:`inspector-skeleton__copy`,children:[(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`84%`})]})]})]}),(0,G.jsxs)(`section`,{className:`lr-inspector-section`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(Y,{width:`76px`}),(0,G.jsx)(Y,{width:`20px`})]}),(0,G.jsx)(`div`,{className:`lr-inspector-section__body`,children:(0,G.jsx)(RC,{})})]}),(0,G.jsxs)(`section`,{className:`lr-inspector-section`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(Y,{width:`120px`}),(0,G.jsx)(Y,{width:`16px`})]}),(0,G.jsx)(`div`,{className:`lr-inspector-section__body`,children:(0,G.jsx)(ZC,{})})]})]})},ew=({item:e})=>{let{t}=Z(),n=fb(),r=ey(e?.id),[i,a]=(0,M.useState)(null);if(!e)return(0,G.jsx)(`aside`,{className:`task-inspector is-empty`,"aria-label":t(`empty.noSelection.title`),children:(0,G.jsx)(Xm,{className:`inspector-empty-feedback`,description:t(`empty.noSelection.description`),title:t(`empty.noSelection.title`)})});let o=r.data===void 0||[`RUNNING`,`WAITING_HUMAN`,`SOFT_PAUSED`,`HARD_PAUSED`,`INTERRUPTED`].includes(r.data.run?.status??``),s=o?[]:IS[e.state],c=t=>{a(t),n.mutate({targetState:t,workItem:e})},{primary:l,secondary:u}=zS(e.state,o);return(0,G.jsxs)(`aside`,{className:`task-inspector`,"aria-label":e.title,children:[(0,G.jsxs)(`header`,{className:`task-inspector__header`,children:[(0,G.jsxs)(`div`,{className:`task-inspector__identity`,children:[(0,G.jsx)(`span`,{className:`task-inspector__id`,children:iC(e.id)}),(0,G.jsxs)(`div`,{className:`task-inspector__actions`,children:[(0,G.jsx)(EC,{item:e},`${e.id}-${e.version.toString()}`),(0,G.jsx)(dh,{align:`end`,groups:[s.map(e=>({danger:e===`CANCELLED`,label:t(`task.moveTo`,{state:ZS(e,t)}),onSelect:()=>{c(e)}}))],trigger:(0,G.jsx)(J,{disabled:s.length===0,shape:`pill`,trailingIcon:`chevronDown`,children:t(`task.move`)})})]})]}),(0,G.jsx)(`h2`,{children:e.title})]}),(0,G.jsxs)(Ih,{title:t(`task.overview`),children:[(0,G.jsx)(Lh,{properties:[{label:t(`task.state`),value:(0,G.jsx)(qm,{label:ZS(e.state,t),tone:nC[e.state]})},{label:t(`task.stage`),value:e.currentStage?t(tC[e.currentStage]):`—`},{label:t(`task.type`),value:t(eC[e.type])},{label:t(`task.priority`),value:t(QS[e.priority])},{label:t(`task.risk`),value:t($S[e.risk])}]}),(0,G.jsx)(`p`,{className:`inspector-copy`,children:e.description||t(`task.noBrief`)})]}),(0,G.jsx)(YC,{item:e}),(0,G.jsxs)(Ih,{action:r.data?.run?(0,G.jsx)(`span`,{className:`inspector-step-count`,children:r.data.stageAttempts.length.toString().padStart(2,`0`)}):void 0,title:t(`workflow.title`),children:[(0,G.jsx)(Xx,{projectId:e.projectId,surface:`task-cockpit`}),(0,G.jsx)(XC,{item:e})]}),(0,G.jsx)(GC,{item:e}),(0,G.jsx)(dS,{item:e},e.id),(0,G.jsx)(Fx,{workItemId:e.id},e.id),(0,G.jsx)(Ih,{title:t(`task.acceptanceCriteria`),children:e.acceptanceCriteria.length>0?(0,G.jsx)(`div`,{className:`inspector-checklist`,children:e.acceptanceCriteria.map((e,t)=>(0,G.jsx)(eh,{disabled:!0,label:e},`${t.toString()}:${e}`))}):(0,G.jsx)(`p`,{className:`inspector-copy`,children:t(`task.noAcceptanceCriteria`)})}),(0,G.jsx)(PS,{item:e}),(0,G.jsx)(QC,{item:e}),n.error?(0,G.jsx)(`div`,{className:`task-inspector__error`,children:(0,G.jsx)($,{error:n.error,onRetry:()=>{i&&c(i)},retrying:n.isPending})}):null,l!==null||u!==null?(0,G.jsxs)(`footer`,{className:`task-inspector__footer`,children:[u?(0,G.jsx)(J,{"aria-label":t(`task.moveTo`,{state:ZS(u,t)}),loading:n.isPending,onClick:()=>{c(u)},variant:`secondary`,children:t(`task.moveToShort`,{state:ZS(u,t)})}):null,l?(0,G.jsx)(J,{"aria-label":t(`task.moveTo`,{state:ZS(l,t)}),loading:n.isPending,onClick:()=>{c(l)},variant:`primary`,children:t(`task.moveToShort`,{state:ZS(l,t)})}):null]}):null]})},tw=()=>{let{t:e}=Z(),t=a({from:`/`}),n=d({from:`/`}),{connectionPending:r,error:i,projects:o,projectsPending:s,retryConnection:c,selectedProject:l,selectProject:u}=Kv(),f=qv(l?.id),p=Dy(l?.id),m=Oy(),[h,g]=(0,M.useState)(null);(0,M.useEffect)(()=>{n.project&&n.project!==l?.id&&o.some(({id:e})=>e===n.project)&&u(n.project)},[o,n.project,u,l?.id]);let _=n.filters?.split(`,`)??[],v=n.summary??null,y=e=>{t({replace:!0,resetScroll:!1,search:t=>({...t,filters:e.length>0?e.join(`,`):void 0})})},b=e=>{t({replace:!0,resetScroll:!1,search:t=>({...t,summary:e??void 0})})},x={direction:n.dir??Pm.direction,ordering:n.order??Pm.ordering,showEmptyColumns:n.hideEmpty!==!0},S=e=>{t({replace:!0,resetScroll:!1,search:t=>({...t,dir:e.direction===Pm.direction?void 0:e.direction,order:e.ordering===Pm.ordering?void 0:e.ordering,hideEmpty:!e.showEmptyColumns||void 0})})},C=n.scope??`active`,ee=e=>{t({replace:!0,resetScroll:!1,search:t=>({...t,scope:e===`active`?void 0:e,filters:void 0})})},te=()=>{t({replace:!0,resetScroll:!1,search:e=>({...e,filters:void 0,summary:void 0})})},w=s||l!==null&&f.isPending,T=f.data?.workItems??[],E=YS(C),D=T.filter(e=>Um(C,e.state)),O=p.data?.humanRequests.filter(({blocking:e})=>e)??[],ne=new Set(O.map(({workItemId:e})=>e)),re=Bm(D.filter(e=>v!==`needsYou`||ne.has(e.id)).filter(e=>oC(e,_)),x),k=e=>{g(e),!(!n.project&&!n.task)&&t({replace:!0,resetScroll:!1,search:e=>({...e,project:void 0,task:void 0})})},A=(n.task?T.find(e=>e.id===n.task):void 0)??re.find(e=>e.id===h)??re.at(0)??null,j=aC(D,E,e);return(0,G.jsxs)(`div`,{className:`workbench`,children:[(0,G.jsxs)(`section`,{"aria-label":e(`work.boardLabel`),className:`workbench-board`,"aria-labelledby":`current-work-title`,children:[(0,G.jsx)(`h1`,{className:`lr-visually-hidden`,id:`current-work-title`,children:e(`work.current`)}),(0,G.jsx)(qS,{filters:_,onClearFilters:te,onFiltersChange:y,onScopeChange:ee,onSummaryFilterChange:b,onViewChange:S,options:j,scope:C,summaryFilter:v,view:x}),l?(0,G.jsx)(Xx,{projectId:l.id,surface:`command-center`}):null,O[0]?(0,G.jsxs)(`button`,{className:`attention-banner`,onClick:()=>{te();let e=O[0]?.workItemId;e&&k(e)},type:`button`,children:[(0,G.jsx)(`span`,{className:`attention-banner__icon`,children:(0,G.jsx)(K,{name:`question`,size:14})}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:e(`attention.title`)}),(0,G.jsx)(`small`,{children:O[0].title})]}),(0,G.jsx)(`span`,{className:`attention-banner__count`,children:e(O.length===1?`attention.count`:`attention.countMany`,{count:O.length})}),(0,G.jsx)(K,{name:`chevronRight`,size:14})]}):null,!l&&!s&&!i?(0,G.jsxs)(`div`,{className:`workbench-state`,children:[(0,G.jsx)(Xm,{action:(0,G.jsx)(J,{loading:m.isPending,onClick:()=>{m.mutate()},variant:`primary`,children:e(`empty.noProjects.action`)}),description:e(`empty.noProjects.description`),title:e(`empty.noProjects.title`)}),m.error instanceof Error?(0,G.jsx)(`p`,{className:`workbench-state__error`,role:`alert`,children:m.error.message}):null]}):null,w?(0,G.jsx)(`div`,{"aria-busy":`true`,"aria-label":e(`loading.board.title`),className:`board-skeleton`,role:`status`,children:E.map(e=>(0,G.jsxs)(`div`,{className:`board-skeleton__column`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(Y,{width:`72px`}),(0,G.jsx)(Y,{width:`16px`})]}),[0,1].map(e=>(0,G.jsxs)(`div`,{className:`board-skeleton__card`,children:[(0,G.jsx)(Y,{width:`54px`}),(0,G.jsx)(Y,{width:e===0?`88%`:`64%`}),(0,G.jsx)(Y,{width:`46%`})]},e))]},e.labelKey))}):null,i||f.error?(0,G.jsx)(`div`,{className:`workbench-state`,children:(0,G.jsx)($,{error:f.error??i??Error(e(`error.unknown`)),onRetry:()=>{f.error?f.refetch():c()},retrying:r||f.isFetching})}):null,l&&f.data?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`kanban-board-scroll`,children:(0,G.jsx)(`div`,{className:`kanban-board`,children:E.map(t=>{let n=re.filter(e=>e.state===t.state);return n.length===0&&!x.showEmptyColumns?null:(0,G.jsx)(Ph,{count:n.length,label:e(t.labelKey),tone:t.tone,children:n.map(e=>(0,G.jsx)(wC,{item:e,onSelect:k,selected:A?.id===e.id},e.id))},t.labelKey)})})}),D.length===0?(0,G.jsxs)(`div`,{className:`board-filter-empty`,role:`status`,children:[(0,G.jsx)(`span`,{children:(0,G.jsx)(K,{name:`inbox`,size:18})}),(0,G.jsx)(`strong`,{children:e(`empty.${C}.title`)}),(0,G.jsx)(`p`,{children:e(`empty.${C}.description`)})]}):null,(_.length>0||v!==null)&&re.length===0?(0,G.jsxs)(`div`,{className:`board-filter-empty`,role:`status`,children:[(0,G.jsx)(`span`,{children:(0,G.jsx)(K,{name:`filter`,size:18})}),(0,G.jsx)(`strong`,{children:e(`empty.filters.title`)}),(0,G.jsx)(`p`,{children:e(`empty.filters.description`)})]}):null]}):null]}),(0,G.jsx)(rg,{edge:`end`,panel:`inspector`}),w?(0,G.jsx)($C,{}):(0,G.jsx)(ew,{item:A},A?.id??`empty`)]})},nw=e=>e===`ANSWER_REQUEST`,rw=[`BLOCKING_NOW`,`APPROVALS`,`QUESTIONS`,`MANUAL_ACTIONS`,`SOON`],iw=e=>rw.flatMap(t=>{let n=e.filter(e=>e.section===t);return n.length===0?[]:[{section:t,items:n}]}),aw=(e,t,n)=>{if(n<=0)return-1;switch(t){case`ArrowDown`:return Math.min(n-1,e+1);case`ArrowUp`:return Math.max(0,e-1);case`Home`:return 0;case`End`:return n-1}},ow=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`]),sw=e=>`attention.section.${e}`,cw=e=>`attention.category.${e}`,lw=e=>`priority.${e}`,uw=e=>`stage.${e}`,dw=()=>{let{locale:e,t}=Z(),n=a({from:`/attention`}),{selectProject:r}=Kv(),i=Yv(),o=i.data?.items??[],s=(0,M.useMemo)(()=>iw(o),[o]),[c,l]=(0,M.useState)(null),u=(0,M.useRef)(new Map),d=o.find(({id:e})=>e===c)??o.at(0)??null;(0,M.useEffect)(()=>{d?.id!==c&&l(d?.id??null)},[c,d?.id]);let f=e=>{r(e.project.id),n({to:`/`,search:{project:e.project.id,task:e.workItem.id}})},p=(e,t)=>{if(!ow.has(e.key))return;e.preventDefault();let n=aw(o.findIndex(({id:e})=>e===t.id),e.key,o.length),r=o[n];r&&(l(r.id),u.current.get(r.id)?.focus())};return i.isPending?(0,G.jsxs)(`div`,{"aria-busy":`true`,"aria-label":t(`attention.loading`),className:`attention-inbox`,children:[(0,G.jsxs)(`section`,{className:`attention-inbox__index`,children:[(0,G.jsxs)(`header`,{className:`attention-inbox__heading`,children:[(0,G.jsx)(Y,{width:`120px`}),(0,G.jsx)(Y,{width:`42px`})]}),(0,G.jsxs)(`div`,{className:`attention-inbox__skeleton`,children:[(0,G.jsx)(Y,{width:`34%`}),(0,G.jsx)(Y,{width:`90%`}),(0,G.jsx)(Y,{width:`70%`})]})]}),(0,G.jsx)(`section`,{className:`attention-inbox__detail`,children:(0,G.jsxs)(`div`,{className:`attention-inbox__skeleton`,children:[(0,G.jsx)(Y,{width:`54%`}),(0,G.jsx)(Y,{width:`86%`}),(0,G.jsx)(Y,{width:`72%`})]})})]}):i.error?(0,G.jsx)(`div`,{className:`attention-inbox attention-inbox--state`,children:(0,G.jsx)($,{error:i.error,onRetry:()=>void i.refetch(),retrying:i.isFetching})}):o.length===0?(0,G.jsx)(`div`,{className:`attention-inbox attention-inbox--state`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`lr-visually-hidden`,children:t(`attention.inboxTitle`)}),(0,G.jsx)(Xm,{description:t(`attention.emptyDescription`),title:t(`attention.emptyTitle`)})]})}):(0,G.jsxs)(`div`,{className:`attention-inbox`,children:[(0,G.jsxs)(`section`,{"aria-label":t(`attention.listLabel`),className:`attention-inbox__index`,children:[(0,G.jsxs)(`header`,{className:`attention-inbox__heading`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:t(`attention.inboxTitle`)}),(0,G.jsx)(`p`,{children:t(`attention.inboxDescription`)})]}),(0,G.jsxs)(Km,{tone:o.some(({request:e})=>e.blocking)?`warning`:`neutral`,children:[o.length.toString(),i.data.hasMore?`+`:``]})]}),i.isFetching?(0,G.jsx)(`p`,{className:`attention-inbox__refresh`,role:`status`,children:t(`attention.refreshing`)}):null,(0,G.jsx)(`div`,{className:`attention-groups`,children:s.map(e=>(0,G.jsxs)(`section`,{className:`attention-group`,children:[(0,G.jsxs)(`h2`,{children:[(0,G.jsx)(`span`,{children:t(sw(e.section))}),(0,G.jsx)(`span`,{children:e.items.length})]}),(0,G.jsx)(`ul`,{children:e.items.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{"aria-current":d?.id===e.id?`true`:void 0,className:`attention-row`,onClick:()=>{l(e.id)},onDoubleClick:()=>{f(e)},onKeyDown:t=>{p(t,e)},ref:t=>{t?u.current.set(e.id,t):u.current.delete(e.id)},type:`button`,children:[(0,G.jsx)(`span`,{className:`attention-row__title`,children:e.request.title}),(0,G.jsxs)(`span`,{className:`attention-row__context`,children:[e.project.name,` · `,e.workItem.title]}),(0,G.jsxs)(`span`,{className:`attention-row__meta`,children:[t(cw(e.category)),` · `,t(uw(e.stage.name))]})]})},e.id))})]},e.section))}),i.data.hasMore?(0,G.jsx)(`p`,{className:`attention-inbox__limit`,role:`status`,children:t(`attention.limitReached`)}):null]}),(0,G.jsx)(`section`,{"aria-live":`polite`,className:`attention-inbox__detail`,children:d?(0,G.jsxs)(`div`,{className:`attention-detail`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsxs)(`div`,{className:`attention-detail__context`,children:[(0,G.jsx)(`span`,{children:d.project.name}),(0,G.jsx)(K,{name:`chevronRight`,size:12}),(0,G.jsx)(`span`,{children:d.workItem.title})]}),(0,G.jsx)(`h2`,{children:d.request.title})]}),(0,G.jsxs)(`dl`,{className:`attention-detail__facts`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`attention.fact.category`)}),(0,G.jsx)(`dd`,{children:t(cw(d.category))})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`attention.fact.priority`)}),(0,G.jsx)(`dd`,{children:t(lw(d.workItem.priority))})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`attention.fact.stage`)}),(0,G.jsx)(`dd`,{children:t(uw(d.stage.name))})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(`attention.fact.created`)}),(0,G.jsx)(`dd`,{children:(0,G.jsx)(`time`,{dateTime:d.request.createdAt,children:new Intl.DateTimeFormat(e===`ru`?`ru-RU`:`en-US`,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(d.request.createdAt))})})]})]}),nw(d.action)?(0,G.jsx)(FS,{request:d.request,showTitle:!1}):(0,G.jsxs)(`div`,{className:`attention-detail__acceptance`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:d.action===`REVIEW_ACCEPTANCE`?t(`attention.acceptanceTitle`):d.request.title}),(0,G.jsx)(`p`,{children:d.action===`REVIEW_ACCEPTANCE`?t(`attention.acceptanceDescription`):d.request.context})]}),(0,G.jsx)(J,{onClick:()=>{f(d)},trailingIcon:`chevronRight`,variant:`primary`,children:d.action===`REVIEW_ACCEPTANCE`?t(`attention.reviewAcceptance`):t(`attention.openTask`)})]}),nw(d.action)?(0,G.jsx)(J,{className:`attention-detail__open-task`,onClick:()=>{f(d)},variant:`secondary`,children:t(`attention.openTask`)}):null]},d.id):null})]})},fw=e=>`fleet.role.${e}`,pw=e=>`stage.${e}`,mw=e=>`fleet.status.${e}`,hw=e=>`fleet.wait.${e}`,gw=e=>`fleet.latestAction.origin.${e}`,_w=e=>`workspaceTool.operation.${e}`,vw=[`LIST_DIRECTORY`,`READ_FILE`,`WRITE_FILE`,`EDIT_FILE`,`DELETE_FILE`,`RUN_RECIPE`],yw=e=>vw.includes(e),bw=(e,t)=>e.origin===`DAEMON_AUDITED`&&yw(e.label)?t(_w(e.label)):e.label,xw=({capacity:e,entries:t,error:n,fetching:r,loading:i,onOpenTask:a,onRetry:o})=>{let{locale:s,t:c}=Z();if(i)return(0,G.jsxs)(`div`,{"aria-busy":`true`,"aria-label":c(`fleet.loading`),className:`agent-fleet`,children:[(0,G.jsxs)(`header`,{className:`agent-fleet__header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Y,{width:`160px`}),(0,G.jsx)(Y,{width:`320px`})]}),(0,G.jsx)(Y,{width:`82px`})]}),(0,G.jsxs)(`div`,{className:`agent-fleet__skeleton`,children:[(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`100%`})]})]});if(n)return(0,G.jsx)(`div`,{className:`agent-fleet agent-fleet--state`,children:(0,G.jsx)($,{error:n,onRetry:o,retrying:r})});let l=e??{active:0,globalLimit:0};return(0,G.jsxs)(`div`,{className:`agent-fleet`,children:[(0,G.jsxs)(`header`,{className:`agent-fleet__header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:c(`fleet.title`)}),(0,G.jsx)(`p`,{children:c(`fleet.description`)})]}),(0,G.jsx)(`span`,{className:`agent-fleet__capacity`,children:c(`fleet.capacity`,{active:l.active,limit:l.globalLimit})})]}),r?(0,G.jsx)(`p`,{className:`agent-fleet__refresh`,role:`status`,children:c(`fleet.refreshing`)}):null,t.length===0?(0,G.jsx)(`div`,{className:`agent-fleet__empty`,children:(0,G.jsx)(Xm,{description:c(`fleet.emptyDescription`),title:c(`fleet.emptyTitle`)})}):(0,G.jsx)(`div`,{className:`agent-fleet__table-scroll`,children:(0,G.jsxs)(`table`,{className:`agent-fleet__table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.task`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.role`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.stage`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.provider`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.status`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.since`)}),(0,G.jsx)(`th`,{scope:`col`,children:c(`fleet.column.latestAction`)})]})}),(0,G.jsx)(`tbody`,{children:t.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{"data-label":c(`fleet.column.task`),children:(0,G.jsxs)(`button`,{className:`agent-fleet__task`,onClick:()=>{a(e)},type:`button`,children:[(0,G.jsx)(`strong`,{children:e.workItem.title}),(0,G.jsx)(`span`,{children:e.project.name})]})}),(0,G.jsx)(`td`,{"data-label":c(`fleet.column.role`),children:c(fw(e.profile.role))}),(0,G.jsx)(`td`,{"data-label":c(`fleet.column.stage`),children:c(pw(e.stage))}),(0,G.jsx)(`td`,{"data-label":c(`fleet.column.provider`),children:e.provider.replace(`_`,` `)}),(0,G.jsxs)(`td`,{"data-label":c(`fleet.column.status`),children:[(0,G.jsxs)(`span`,{className:`agent-fleet__status`,"data-status":e.status,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`}),c(mw(e.status))]}),e.waitReason===null?null:(0,G.jsx)(`small`,{className:`agent-fleet__wait`,children:c(hw(e.waitReason))})]}),(0,G.jsx)(`td`,{"data-label":c(`fleet.column.since`),children:e.startedAt===null?(0,G.jsx)(`span`,{"aria-label":c(`fleet.notStarted`),children:`—`}):(0,G.jsx)(`time`,{dateTime:e.startedAt,children:new Intl.DateTimeFormat(s===`ru`?`ru-RU`:`en-US`,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.startedAt))})}),(0,G.jsx)(`td`,{"data-label":c(`fleet.column.latestAction`),children:e.latestAction===null?(0,G.jsx)(`span`,{"aria-label":c(`fleet.noActivity`),children:`—`}):(0,G.jsxs)(`span`,{className:`agent-fleet__latest-action`,children:[(0,G.jsx)(`span`,{className:`agent-fleet__latest-action-label`,children:bw(e.latestAction,c)}),(0,G.jsx)(`span`,{className:`agent-fleet__latest-action-origin`,"data-origin":e.latestAction.origin,children:c(gw(e.latestAction.origin))})]})})]},e.agentRunId??e.dispatchId??e.stageAttemptId))})]})})]})},Sw=()=>{let{selectProject:e}=Kv(),t=a({from:`/fleet`}),n=Xv();return(0,G.jsx)(xw,{capacity:n.data?.capacity??null,entries:n.data?.entries??[],error:n.error,fetching:n.isFetching,loading:n.isPending,onOpenTask:n=>{e(n.project.id),t({to:`/`,search:{project:n.project.id,task:n.workItem.id}})},onRetry:()=>void n.refetch()})},Cw=e=>`${JSON.stringify(Om.parse(e),null,2)}\n`,ww=e=>{let t=e.kind===`AGGREGATE`?`loomrail-aggregate-report.json`:`loomrail-crash-report.json`,n=URL.createObjectURL(new Blob([Cw(e)],{type:`application/json;charset=utf-8`})),r=document.createElement(`a`);r.download=t,r.href=n,r.click(),setTimeout(()=>{URL.revokeObjectURL(n)},1e3)},Tw=(e,t)=>e===null?t:`${e.toString()}%`,Ew=({description:e,report:t,title:n})=>{let{t:r}=Z();return(0,G.jsxs)(`article`,{className:`insights-report`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(`h3`,{children:n}),(0,G.jsx)(`p`,{children:e})]}),(0,G.jsx)(`pre`,{"aria-label":r(`insights.report.previewLabel`),children:Cw(t)}),(0,G.jsx)(`div`,{className:`insights-report__actions`,children:(0,G.jsx)(J,{onClick:()=>{ww(t)},size:`sm`,children:r(`insights.report.download`)})})]})},Dw=e=>[{label:`insights.count.workItems`,value:`${e.workItems.accepted.toString()} / ${e.workItems.total.toString()}`},{label:`insights.count.activeWork`,value:e.workItems.active},{label:`insights.count.cancelledWork`,value:e.workItems.cancelled},{label:`insights.count.pipelines`,value:`${e.pipelineRuns.succeeded.toString()} / ${e.pipelineRuns.total.toString()}`},{label:`insights.count.pipelineFailures`,value:e.pipelineRuns.failed+e.pipelineRuns.interrupted+e.pipelineRuns.cancelled},{label:`insights.count.agentRuns`,value:`${e.agentRuns.succeeded.toString()} / ${e.agentRuns.total.toString()}`},{label:`insights.count.agentFailures`,value:e.agentRuns.failed+e.agentRuns.interrupted},{label:`insights.count.reviews`,value:e.reviews.total},{label:`insights.count.qaRuns`,value:e.qa.total},{label:`insights.count.qaDefects`,value:`${e.qa.defectsOpen.toString()} / ${(e.qa.defectsOpen+e.qa.defectsResolved+e.qa.defectsWaived).toString()}`},{label:`insights.count.humanRequests`,value:`${e.humanRequests.resolved.toString()} / ${e.humanRequests.total.toString()}`},{label:`insights.count.tokens`,value:e.usage.estimatedTokens},{label:`insights.count.recoveries`,value:e.reliability.daemonRestartRecoveries}],Ow=()=>{let{locale:e,t}=Z(),n=Qv();if(n.isPending)return(0,G.jsxs)(`div`,{"aria-busy":`true`,"aria-label":t(`insights.loading`),className:`insights`,children:[(0,G.jsx)(`header`,{className:`insights__header`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Y,{width:`120px`}),(0,G.jsx)(Y,{width:`360px`})]})}),(0,G.jsxs)(`div`,{className:`insights__skeleton`,children:[(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`100%`})]})]});if(n.error)return(0,G.jsx)(`div`,{className:`insights insights--state`,children:(0,G.jsx)($,{error:n.error,onRetry:()=>void n.refetch(),retrying:n.isFetching})});let r=n.data,i=r.localMetrics,a=new Intl.NumberFormat(e===`ru`?`ru-RU`:`en-US`);return(0,G.jsxs)(`div`,{className:`insights`,children:[(0,G.jsxs)(`header`,{className:`insights__header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:t(`insights.title`)}),(0,G.jsx)(`p`,{children:t(`insights.description`)})]}),(0,G.jsx)(`span`,{children:t(`insights.localOnly`)})]}),(0,G.jsxs)(`section`,{"aria-labelledby":`insights-outcomes`,className:`insights__section`,children:[(0,G.jsxs)(`div`,{className:`insights__section-heading`,children:[(0,G.jsx)(`h2`,{id:`insights-outcomes`,children:t(`insights.outcomes.title`)}),(0,G.jsx)(`p`,{children:t(`insights.outcomes.description`)})]}),(0,G.jsx)(`dl`,{className:`insights-rates`,children:[[`insights.rate.acceptance`,i.rates.acceptedCompletionPercent],[`insights.rate.firstReview`,i.rates.firstPassReviewPercent],[`insights.rate.qa`,i.rates.terminalQaPassPercent]].map(([e,n])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(e)}),(0,G.jsx)(`dd`,{children:Tw(n,t(`insights.noEvidence`))})]},e))}),(0,G.jsx)(`dl`,{className:`insights-counts`,children:Dw(i).map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:t(e.label)}),(0,G.jsx)(`dd`,{children:typeof e.value==`number`?a.format(e.value):e.value})]},e.label))})]}),(0,G.jsxs)(`section`,{"aria-labelledby":`insights-reports`,className:`insights__section`,children:[(0,G.jsxs)(`div`,{className:`insights__section-heading`,children:[(0,G.jsx)(`h2`,{id:`insights-reports`,children:t(`insights.report.title`)}),(0,G.jsx)(`p`,{children:t(`insights.report.description`)}),(0,G.jsx)(`p`,{className:`insights__exclusions`,children:t(`insights.report.exclusions`)})]}),(0,G.jsx)(Ew,{description:t(`insights.report.aggregateDescription`),report:r.aggregateReport,title:t(`insights.report.aggregate`)}),r.crashReport===null?(0,G.jsx)(`p`,{className:`insights__empty-report`,children:t(`insights.report.noCrash`)}):(0,G.jsx)(Ew,{description:t(`insights.report.crashDescription`),report:r.crashReport,title:t(`insights.report.crash`)})]})]})},kw=[`WORKSPACE`,`PROVIDER`,`TASK`,`READY`,`RUN`,`REQUEST`,`REVIEW`,`QA`,`ACCEPTANCE`,`COMPLETE`],Aw=e=>{let t=Sm.task;return e.title===t.title&&e.description===t.description&&e.priority===t.priority&&e.risk===t.risk&&e.type===t.type&&e.acceptanceCriteria.length===t.acceptanceCriteria.length&&e.acceptanceCriteria.every((e,n)=>e===t.acceptanceCriteria[n])},jw=(e,t)=>{let n=e.filter(e=>e.state!==`CANCELLED`&&Aw(e)),r=n.find(({id:e})=>e===t);return r===void 0?[...n].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).at(0)??null:r},Mw=e=>kw.slice(0,kw.indexOf(e)),Nw=(e,t,n,r)=>{let i=r?.run??null,a=r?.acceptancePackage??null,o=r?.stageAttempts.find(({id:e})=>e===i?.currentStageAttemptId)??null,s;return s=e?.repositoryStatus===`READY`?t===null||t.providers.find(({provider:e})=>e===t.effectiveProvider)?.ready!==!0?`PROVIDER`:n===null?`TASK`:n.state===`BACKLOG`?`READY`:i===null?`RUN`:a!==null&&a.status!==`PENDING`?`COMPLETE`:a?.status===`PENDING`?`ACCEPTANCE`:o?.stage===`QA`||o?.stage===`ACCEPTANCE`?`QA`:o?.stage===`REVIEW`?`REVIEW`:`REQUEST`:`WORKSPACE`,{current:s,completed:Mw(s)}},Pw={WORKSPACE:`activation.phase.workspace`,PROVIDER:`activation.phase.provider`,TASK:`activation.phase.task`,READY:`activation.phase.ready`,RUN:`activation.phase.run`,REQUEST:`activation.phase.request`,REVIEW:`activation.phase.review`,QA:`activation.phase.qa`,ACCEPTANCE:`activation.phase.acceptance`,COMPLETE:`activation.phase.complete`},Fw={WORKSPACE:`activation.copy.workspace`,PROVIDER:`activation.copy.provider`,TASK:`activation.copy.task`,READY:`activation.copy.ready`,RUN:`activation.copy.run`,REQUEST:`activation.copy.request`,REVIEW:`activation.copy.review`,QA:`activation.copy.qa`,ACCEPTANCE:`activation.copy.acceptance`,COMPLETE:`activation.copy.complete`},Iw=()=>{let{t:e}=Z(),t=rx(),n=a({from:`/try`}),r=d({from:`/try`}),{error:i,projects:o,projectsPending:s,retryConnection:c,selectedProject:l,selectProject:u}=Kv(),f=o.find(({fixtureId:e,repositoryStatus:t})=>e===Sm.fixtureId&&t===`READY`)??o.find(({fixtureId:e})=>e===Sm.fixtureId)??null,p=fy(f?.id),m=qv(f?.id),h=jw(m.data?.workItems??[],r.task),g=ey(h?.id),_=Oy(),v=gy(),y=ub(),b=fb(),x=mb();(0,M.useEffect)(()=>{f!==null&&f.id!==l?.id&&u(f.id)},[f,u,l?.id]),(0,M.useEffect)(()=>{h!==null&&r.task!==h.id&&n({replace:!0,search:{task:h.id}})},[n,r.task,h]);let S=i??p.error??m.error??g.error??null;if(S!==null)return(0,G.jsx)(`div`,{className:`activation activation--state`,children:(0,G.jsx)($,{error:S,onRetry:()=>{c(),p.refetch(),m.refetch(),g.refetch()},retrying:p.isFetching||m.isFetching||g.isFetching})});if(s||f!==null&&(p.isPending||m.isPending)||h!==null&&g.isPending)return(0,G.jsxs)(`div`,{"aria-busy":`true`,"aria-label":e(`activation.loading`),className:`activation`,children:[(0,G.jsxs)(`header`,{className:`activation__header`,children:[(0,G.jsx)(Y,{width:`180px`}),(0,G.jsx)(Y,{width:`520px`})]}),(0,G.jsxs)(`div`,{className:`activation__loading`,children:[(0,G.jsx)(Y,{width:`100%`}),(0,G.jsx)(Y,{width:`76%`}),(0,G.jsx)(Y,{width:`88%`})]})]});let C=Nw(f,p.data??null,h,g.data??null),ee=g.data?.humanRequests.some(({status:e})=>e===`OPEN`||e===`CLAIMED`||e===`SNOOZED`),te=_.error??v.error??y.error??b.error??x.error??null,w=f!==null&&h!==null?{project:f.id,task:h.id}:{};return(0,G.jsxs)(`div`,{className:`activation`,children:[(0,G.jsxs)(`header`,{className:`activation__header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:e(`activation.eyebrow`)}),(0,G.jsx)(`h1`,{children:e(`activation.title`)}),(0,G.jsx)(`p`,{children:e(`activation.description`)})]}),(0,G.jsxs)(`p`,{className:`activation__boundary`,children:[(0,G.jsx)(K,{name:`info`,size:15}),e(`activation.zeroQuota`)]})]}),(0,G.jsxs)(`div`,{className:`activation__body`,children:[(0,G.jsx)(`nav`,{"aria-label":e(`activation.progress`),className:`activation-progress`,children:(0,G.jsx)(`ol`,{children:kw.map((t,n)=>{let r=C.completed.includes(t),i=C.current===t;return(0,G.jsxs)(`li`,{"aria-current":i?`step`:void 0,className:r?`is-complete`:i?`is-current`:void 0,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:r?(0,G.jsx)(K,{name:`check`,size:13}):n+1}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{children:e(Pw[t])}),(0,G.jsx)(`small`,{children:e(r?`activation.status.complete`:i?`activation.status.current`:`activation.status.upcoming`)})]})]},t)})})}),(0,G.jsxs)(`section`,{"aria-live":`polite`,className:`activation-step`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(`span`,{children:e(`activation.step`,{current:(kw.indexOf(C.current)+1).toString(),total:kw.length.toString()})}),(0,G.jsx)(`h2`,{children:e(Pw[C.current])}),(0,G.jsx)(`p`,{children:e(Fw[C.current])})]}),C.current===`PROVIDER`&&p.data?.environmentOverrideLocked?(0,G.jsx)(`p`,{className:`activation-step__warning`,role:`alert`,children:e(`activation.providerLocked`)}):null,te===null?null:(0,G.jsx)($,{error:te}),(0,G.jsx)(`div`,{className:`activation-step__action`,children:(()=>{switch(C.current){case`WORKSPACE`:return(0,G.jsx)(J,{icon:`projects`,loading:_.isPending,onClick:()=>{_.mutate()},variant:`primary`,children:e(`activation.action.workspace`)});case`PROVIDER`:return f===null?null:(0,G.jsx)(J,{disabled:p.data?.environmentOverrideLocked,icon:`agents`,loading:v.isPending,onClick:()=>{v.mutate({preference:`AUTO`,project:f})},variant:`primary`,children:e(`activation.action.provider`)});case`TASK`:return f===null?null:(0,G.jsx)(J,{icon:`add`,loading:y.isPending,onClick:()=>{y.mutate(f.id,{onSuccess:e=>{n({replace:!0,search:{task:e.id}})}})},variant:`primary`,children:e(`activation.action.task`)});case`READY`:return h===null?null:(0,G.jsx)(J,{icon:`check`,loading:b.isPending,onClick:()=>{b.mutate({targetState:`READY`,workItem:h})},variant:`primary`,children:e(`activation.action.ready`)});case`RUN`:return h===null?null:(0,G.jsx)(J,{icon:`play`,loading:x.isPending,onClick:()=>{x.mutate({policy:Sm.policy,workItem:h})},variant:`primary`,children:e(`activation.action.run`)});case`REQUEST`:case`REVIEW`:case`QA`:return(0,G.jsx)(J,{icon:ee?`question`:`board`,onClick:()=>{ee?n({to:`/attention`}):f!==null&&h!==null&&n({to:`/`,search:w})},variant:`primary`,children:e(ee?`activation.action.attention`:`activation.action.cockpit`)});case`ACCEPTANCE`:return(0,G.jsx)(J,{icon:`check`,onClick:()=>{f!==null&&h!==null&&n({to:`/`,search:w})},variant:`primary`,children:e(`activation.action.acceptance`)});case`COMPLETE`:return null}})()}),(0,G.jsxs)(`details`,{className:`activation-recipe`,children:[(0,G.jsx)(`summary`,{children:e(`activation.recipe.title`)}),(0,G.jsx)(`p`,{children:Sm.task.description}),(0,G.jsx)(`ol`,{children:Sm.task.acceptanceCriteria.map(e=>(0,G.jsx)(`li`,{children:e},e))}),(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e(`activation.recipe.provider`)}),(0,G.jsx)(`dd`,{children:e(`activation.provider.real`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e(`activation.recipe.model`)}),(0,G.jsx)(`dd`,{children:Sm.policy.modelTierOverride})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e(`activation.recipe.budget`)}),(0,G.jsx)(`dd`,{children:Sm.policy.maxEstimatedTokens.toLocaleString()})]})]})]}),C.current===`COMPLETE`?(0,G.jsxs)(`div`,{className:`activation-next`,children:[(0,G.jsx)(`h3`,{children:e(`activation.next.title`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(J,{onClick:()=>{f!==null&&h!==null&&n({to:`/`,search:w})},variant:`secondary`,children:e(`activation.next.local`)}),(0,G.jsx)(J,{onClick:t,variant:`secondary`,children:e(`activation.next.repository`)})]}),(0,G.jsxs)(`details`,{className:`activation-next__guided`,children:[(0,G.jsx)(`summary`,{children:e(`activation.next.guidedAction`)}),(0,G.jsx)(`p`,{children:e(`activation.next.guided`)})]})]}):null]})]})]})},Lw=i({component:Mx}),Rw=new Set([`needsYou`]),zw=new Set([`priority-high`,`priority-low`,`priority-medium`,`priority-urgent`,`risk-critical`,`risk-high`,`risk-low`,`risk-medium`,`status-backlog`,`status-blocked`,`status-cancelled`,`status-done`,`status-in_progress`,`status-ready`]),Bw=m({getParentRoute:()=>Lw,path:`/`,component:tw,validateSearch:e=>{let t=e.filters,n=e.summary,r=P.safeParse(e.project),i=P.safeParse(e.task),a=typeof t==`string`?t.split(`,`).filter(e=>zw.has(e)).join(`,`):``,o=typeof n==`string`&&Rw.has(n)?n:void 0,s=e.order,c=e.dir,l=Im(s)&&s!==Pm.ordering?s:void 0,u=Lm(c)&&c!==Pm.direction?c:void 0,d=e.hideEmpty===!0||e.hideEmpty===`true`||void 0,f=e.scope,p=Hm(f)&&f!==`active`?f:void 0;return{...a.length>0?{filters:a}:{},...o===void 0?{}:{summary:o},...l===void 0?{}:{order:l},...u===void 0?{}:{dir:u},...d===void 0?{}:{hideEmpty:d},...p===void 0?{}:{scope:p},...r.success?{project:r.data}:{},...i.success?{task:i.data}:{}}}}),Vw=m({getParentRoute:()=>Lw,path:`/attention`,component:dw}),Hw=m({getParentRoute:()=>Lw,path:`/fleet`,component:Sw}),Uw=m({getParentRoute:()=>Lw,path:`/insights`,component:Ow}),Ww=m({getParentRoute:()=>Lw,path:`/try`,component:Iw,validateSearch:e=>{let t=P.safeParse(e.task);return t.success?{task:t.data}:{}}}),Gw=Lw.addChildren([Bw,Vw,Hw,Uw,Ww]),Kw=g({routeTree:Gw,defaultPreload:`intent`,scrollRestoration:!0}),qw=new f({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:3e4}}}),Jw=()=>(0,G.jsx)(l,{client:qw,children:(0,G.jsx)(qh,{children:(0,G.jsx)(Gv,{children:(0,G.jsx)(p,{router:Kw})})})}),Yw=document.getElementById(`root`);if(!Yw)throw Error(`Loomrail root element is missing`);px(fx()),(0,Ge.createRoot)(Yw).render((0,G.jsx)(M.StrictMode,{children:(0,G.jsx)(Jw,{})}));
|
|
13
|
+
//# sourceMappingURL=index-Dde217zt.js.map
|