wicked-studio 0.16.18 → 0.17.0

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/README.md CHANGED
@@ -114,8 +114,8 @@ reasoning in a scrollback you'll never read. wicked-studio flips that:
114
114
  - **Explore your codebase** — graph view with focus navigation, blast radius, hotspots, and the
115
115
  domain graph.
116
116
  - **See how much of the code is mapped to requirements** — Repositories → a repo → Requirements
117
- heads the list with "80% real requirements · minimum 80%" and its parts (real, placeholders,
118
- unmapped, not product code). A placeholder is never counted toward the share and never shows as
117
+ heads the list with "80% real requirements" and its parts (real, placeholders, unmapped, not product
118
+ code); an engine from before J6 v3 also sends its minimum ("· minimum 80%"), and only then is one shown. A placeholder is never counted toward the share and never shows as
119
119
  validated; a real one with corroboration data carries **validated** (with its count of
120
120
  independent sources) or **unconfirmed** with why (rows from an older build, or outside the
121
121
  count, may carry no verdict). A row the share does not count (a type shape, code that is not
@@ -123,9 +123,9 @@ reasoning in a scrollback you'll never read. wicked-studio flips that:
123
123
  under the coverage says how many stated rules and placeholders are not counted, for any of those reasons. The Config &
124
124
  data filter is hidden when crew reports no config and data rows. When the list is an older graph build than the header's numbers, it says
125
125
  so. A repo with no requirements graph yet offers **Generate it** (or **Keep mapping** once some real
126
- requirements are mapped), which opens New job filled in with the generating workflow; while a mapping job
127
- runs, the view shows its progress with **Open the job** instead. The minimum is a setting (Settings → General → Code graph,
128
- default 80%).
126
+ requirements are mapped), which opens New job on the generating workflow and asks what the model should
127
+ cover; while a mapping job runs, the view shows its progress with **Open the job** instead. A domain model has
128
+ no minimum to set.
129
129
  - **Plan the product** — a project's page has a Requirements section (its count across the
130
130
  project's repositories) and a full list at `/projects/:id/requirements`, grouped by repo and
131
131
  searchable. Choose up to 40 requirements and **Draft epics** opens New job on the Draft epics
@@ -1,4 +1,4 @@
1
- var Ve=Object.defineProperty;var He=(V,F,z)=>F in V?Ve(V,F,{enumerable:!0,configurable:!0,writable:!0,value:z}):V[F]=z;var ee=(V,F,z)=>He(V,typeof F!="symbol"?F+"":F,z);(function(){"use strict";const V=new Set(["security_review_on_non_code_plan","writes_nothing_on_code"]);function F(e){const t=e.split(": ");for(const r of t.slice(0,-1)){const s=r.trim();if(/^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(s))return s}return null}function z(e){return/\(rule (.+?) requires it\)/.exec(e)?.[1]??null}function $e(e){const t=F(e),r=t!==null&&V.has(t)?t:null;if(r==="security_review_on_non_code_plan"){const s=z(e);return`a security review was asked for on a run that writes no code${s!==null?` (rule ${s} requires it)`:""} — its code-evidence check could never pass`}return r==="writes_nothing_on_code"?"a step marked “writes nothing” is on a phase that changes code":null}const ie={gh_account_mismatch:"That account isn’t the one the GitHub CLI is signed in as: choose another, or check again. Nothing was saved.",gh_not_installed:"The GitHub CLI isn’t installed where crew runs. Nothing was saved.",gh_signed_out:"The GitHub CLI is signed out where crew runs. Nothing was saved.",gh_token_unavailable:"The GitHub CLI couldn’t supply a login for that account. Nothing was saved.",gh_cli_not_allowed:"This source can’t use the GitHub CLI login. Nothing was saved."},ve="Wait for maintenance to finish, or turn off “Drain for maintenance” in Settings to admit work again.";function ae(e,t,r){const s=t.trim();if(r==="maintenance_drain")return`${s===""?"This daemon is draining for maintenance and is refusing new work.":s} ${ve}`;if(r!=null&&Object.hasOwn(ie,r)){const h=ie[r];return s===""?h:`${h} — ${s}`}if(s==="")return`the daemon refused this — it answered HTTP ${e} with no detail`;const u=$e(s);return u!==null?`the daemon refused this plan: ${u} — ${s}`:`the daemon refused this — ${s}`}class K extends Error{constructor(r,s,u){const h=typeof u=="object"&&u!==null?u.code:void 0;super(ae(r,s,typeof h=="string"?h:null));ee(this,"status");ee(this,"wire");ee(this,"body");this.name="ApiError",this.status=r,this.wire=s,this.body=u}}function ce(e){return e instanceof K?e.status:null}const ue=e=>{let t;const r=new Set,s=(f,g)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const _=t;t=g??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(A=>A(t,_))}},u=()=>t,P={setState:s,getState:u,getInitialState:()=>y,subscribe:f=>(r.add(f),()=>r.delete(f))},y=t=e(s,u,P);return P},Re=(e=>e?ue(e):ue);function Ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},m={};/**
1
+ var Ve=Object.defineProperty;var He=(V,F,z)=>F in V?Ve(V,F,{enumerable:!0,configurable:!0,writable:!0,value:z}):V[F]=z;var ee=(V,F,z)=>He(V,typeof F!="symbol"?F+"":F,z);(function(){"use strict";const V=new Set(["security_review_on_non_code_plan","writes_nothing_on_code"]);function F(e){const t=e.split(": ");for(const r of t.slice(0,-1)){const s=r.trim();if(/^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(s))return s}return null}function z(e){return/\(rule (.+?) requires it\)/.exec(e)?.[1]??null}function $e(e){const t=F(e),r=t!==null&&V.has(t)?t:null;if(r==="security_review_on_non_code_plan"){const s=z(e);return`a security review was asked for on a run that writes no code${s!==null?` (rule ${s} requires it)`:""} — its code-evidence check could never pass`}return r==="writes_nothing_on_code"?"a step marked “writes nothing” is on a phase that changes code":null}const ie={gh_account_mismatch:"That account isn’t the one the GitHub CLI is signed in as: choose another, or check again. Nothing was saved.",gh_not_installed:"The GitHub CLI isn’t installed where crew runs. Nothing was saved.",gh_signed_out:"The GitHub CLI is signed out where crew runs. Nothing was saved.",gh_token_unavailable:"The GitHub CLI couldn’t supply a login for that account. Nothing was saved.",gh_cli_not_allowed:"This source can’t use the GitHub CLI login. Nothing was saved."},ve="Wait for maintenance to finish, or turn off “Drain for maintenance” in Settings to admit work again.";function ae(e,t,r){const s=t.trim();if(r==="maintenance_drain")return`${s===""?"This daemon is draining for maintenance and is refusing new work.":s} ${ve}`;if(r!=null&&Object.hasOwn(ie,r)){const h=ie[r];return s===""?h:`${h} — ${s}`}if(s==="")return`the daemon refused this — it answered HTTP ${e} with no detail`;const u=$e(s);return u!==null?`the daemon refused this plan: ${u} — ${s}`:`the daemon refused this — ${s}`}class K extends Error{constructor(r,s,u){const h=typeof u=="object"&&u!==null?u.code:void 0;super(ae(r,s,typeof h=="string"?h:null));ee(this,"status");ee(this,"wire");ee(this,"body");this.name="ApiError",this.status=r,this.wire=s,this.body=u}}function ce(e){return e instanceof K?e.status:null}const ue=e=>{let t;const r=new Set,s=(p,g)=>{const d=typeof p=="function"?p(t):p;if(!Object.is(d,t)){const _=t;t=g??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(A=>A(t,_))}},u=()=>t,P={setState:s,getState:u,getInitialState:()=>y,subscribe:p=>(r.add(p),()=>r.delete(p))},y=t=e(s,u,P);return P},Re=(e=>e?ue(e):ue);function Ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},m={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,5 +6,5 @@ var Ve=Object.defineProperty;var He=(V,F,z)=>F in V?Ve(V,F,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var le;function Oe(){if(le)return m;le=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),x=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),d=Symbol.iterator;function _(n){return n===null||typeof n!="object"?null:(n=d&&n[d]||n["@@iterator"],typeof n=="function"?n:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,L={};function q(n,i,b){this.props=n,this.context=i,this.refs=L,this.updater=b||A}q.prototype.isReactComponent={},q.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")},q.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function N(){}N.prototype=q.prototype;function J(n,i,b){this.props=n,this.context=i,this.refs=L,this.updater=b||A}var $=J.prototype=new N;$.constructor=J,C($,q.prototype),$.isPureReactComponent=!0;var a=Array.isArray,c=Object.prototype.hasOwnProperty,l={current:null},p={key:!0,ref:!0,__self:!0,__source:!0};function k(n,i,b){var R,v={},T=null,j=null;if(i!=null)for(R in i.ref!==void 0&&(j=i.ref),i.key!==void 0&&(T=""+i.key),i)c.call(i,R)&&!p.hasOwnProperty(R)&&(v[R]=i[R]);var U=arguments.length-2;if(U===1)v.children=b;else if(1<U){for(var I=Array(U),M=0;M<U;M++)I[M]=arguments[M+2];v.children=I}if(n&&n.defaultProps)for(R in U=n.defaultProps,U)v[R]===void 0&&(v[R]=U[R]);return{$$typeof:e,type:n,key:T,ref:j,props:v,_owner:l.current}}function w(n,i){return{$$typeof:e,type:n.type,key:i,ref:n.ref,props:n.props,_owner:n._owner}}function O(n){return typeof n=="object"&&n!==null&&n.$$typeof===e}function S(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(b){return i[b]})}var D=/\/+/g;function Z(n,i){return typeof n=="object"&&n!==null&&n.key!=null?S(""+n.key):i.toString(36)}function H(n,i,b,R,v){var T=typeof n;(T==="undefined"||T==="boolean")&&(n=null);var j=!1;if(n===null)j=!0;else switch(T){case"string":case"number":j=!0;break;case"object":switch(n.$$typeof){case e:case t:j=!0}}if(j)return j=n,v=v(j),n=R===""?"."+Z(j,0):R,a(v)?(b="",n!=null&&(b=n.replace(D,"$&/")+"/"),H(v,i,b,"",function(M){return M})):v!=null&&(O(v)&&(v=w(v,b+(!v.key||j&&j.key===v.key?"":(""+v.key).replace(D,"$&/")+"/")+n)),i.push(v)),1;if(j=0,R=R===""?".":R+":",a(n))for(var U=0;U<n.length;U++){T=n[U];var I=R+Z(T,U);j+=H(T,i,b,I,v)}else if(I=_(n),typeof I=="function")for(n=I.call(n),U=0;!(T=n.next()).done;)T=T.value,I=R+Z(T,U++),j+=H(T,i,b,I,v);else if(T==="object")throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return j}function G(n,i,b){if(n==null)return n;var R=[],v=0;return H(n,R,"","",function(T){return i.call(b,T,v++)}),R}function B(n){if(n._status===-1){var i=n._result;i=i(),i.then(function(b){(n._status===0||n._status===-1)&&(n._status=1,n._result=b)},function(b){(n._status===0||n._status===-1)&&(n._status=2,n._result=b)}),n._status===-1&&(n._status=0,n._result=i)}if(n._status===1)return n._result.default;throw n._result}var E={current:null},W={transition:null},Ge={ReactCurrentDispatcher:E,ReactCurrentBatchConfig:W,ReactCurrentOwner:l};function be(){throw Error("act(...) is not supported in production builds of React.")}return m.Children={map:G,forEach:function(n,i,b){G(n,function(){i.apply(this,arguments)},b)},count:function(n){var i=0;return G(n,function(){i++}),i},toArray:function(n){return G(n,function(i){return i})||[]},only:function(n){if(!O(n))throw Error("React.Children.only expected to receive a single React element child.");return n}},m.Component=q,m.Fragment=r,m.Profiler=u,m.PureComponent=J,m.StrictMode=s,m.Suspense=y,m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ge,m.act=be,m.cloneElement=function(n,i,b){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var R=C({},n.props),v=n.key,T=n.ref,j=n._owner;if(i!=null){if(i.ref!==void 0&&(T=i.ref,j=l.current),i.key!==void 0&&(v=""+i.key),n.type&&n.type.defaultProps)var U=n.type.defaultProps;for(I in i)c.call(i,I)&&!p.hasOwnProperty(I)&&(R[I]=i[I]===void 0&&U!==void 0?U[I]:i[I])}var I=arguments.length-2;if(I===1)R.children=b;else if(1<I){U=Array(I);for(var M=0;M<I;M++)U[M]=arguments[M+2];R.children=U}return{$$typeof:e,type:n.type,key:v,ref:T,props:R,_owner:j}},m.createContext=function(n){return n={$$typeof:x,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:h,_context:n},n.Consumer=n},m.createElement=k,m.createFactory=function(n){var i=k.bind(null,n);return i.type=n,i},m.createRef=function(){return{current:null}},m.forwardRef=function(n){return{$$typeof:P,render:n}},m.isValidElement=O,m.lazy=function(n){return{$$typeof:g,_payload:{_status:-1,_result:n},_init:B}},m.memo=function(n,i){return{$$typeof:f,type:n,compare:i===void 0?null:i}},m.startTransition=function(n){var i=W.transition;W.transition={};try{n()}finally{W.transition=i}},m.unstable_act=be,m.useCallback=function(n,i){return E.current.useCallback(n,i)},m.useContext=function(n){return E.current.useContext(n)},m.useDebugValue=function(){},m.useDeferredValue=function(n){return E.current.useDeferredValue(n)},m.useEffect=function(n,i){return E.current.useEffect(n,i)},m.useId=function(){return E.current.useId()},m.useImperativeHandle=function(n,i,b){return E.current.useImperativeHandle(n,i,b)},m.useInsertionEffect=function(n,i){return E.current.useInsertionEffect(n,i)},m.useLayoutEffect=function(n,i){return E.current.useLayoutEffect(n,i)},m.useMemo=function(n,i){return E.current.useMemo(n,i)},m.useReducer=function(n,i,b){return E.current.useReducer(n,i,b)},m.useRef=function(n){return E.current.useRef(n)},m.useState=function(n){return E.current.useState(n)},m.useSyncExternalStore=function(n,i,b){return E.current.useSyncExternalStore(n,i,b)},m.useTransition=function(){return E.current.useTransition()},m.version="18.3.1",m}var de;function Ie(){return de||(de=1,te.exports=Oe()),te.exports}var Pe=Ie();const X=Ce(Pe),ke=e=>e;function Te(e,t=ke){const r=X.useSyncExternalStore(e.subscribe,X.useCallback(()=>t(e.getState()),[e,t]),X.useCallback(()=>t(e.getInitialState()),[e,t]));return X.useDebugValue(r),r}const pe=e=>{const t=Re(e),r=s=>Te(t,s);return Object.assign(r,t),r},Ue=(e=>e?pe(e):pe);let ne=null;const _e=3e3;function fe(e){const t=e.capabilities??{};return{loaded:!0,runChatId:t.runChatId===!0,walkthroughRoots:t.walkthroughRoots===!0,askPath:t.askPath===!0,chatIdOnLaunch:t.chatIdOnLaunch===!0,deliverGate:t.deliverGate===!0,reducedAssurance:t.reducedAssurance===!0,launchPrimary:t.launchPrimary===!0,chatList:t.chatList===!0,chatAttachments:t.chatAttachments===!0,chatWorkflows:Array.isArray(t.chatWorkflows)?t.chatWorkflows.filter(r=>typeof r=="string"):[],powerMode:t.powerMode===!0,gateActions:t.gateActions===!0,voice:t.voice===!0,chatContext:t.chatArtifacts?.context===!0,chatProposals:t.chatArtifacts?.proposals===!0,chatArtifactsStub:t.chatArtifacts?.stub===!0,chatOnboard:t.chatArtifacts?.onboard===!0,chatArtifactsStubOps:Ae(t.chatArtifacts),chatCutInView:t.chatArtifacts?.cutInView===!0,chatCut:t.chatArtifacts?.cut===!0,dataSources:t.apps?.uploads===!0,trackerLinks:t.trackerLinks===!0,planGateNote:t.planGateNote===!0,chatJobProposals:t.chatJobProposals===!0,reshapeRun:t.reshapeRun===!0,chatJobPower:t.chatJobPower===!0,workflowCatalogV2:t.workflowCatalogV2===!0,memoryRestore:t.memoryRestore===!0,knowledgeForget:t.knowledgeForget===!0}}const Ee={loaded:!0,gateActions:!1,runChatId:!1,walkthroughRoots:!1,askPath:!1,chatIdOnLaunch:!1,deliverGate:!1,reducedAssurance:!1,launchPrimary:!1,chatList:!1,chatAttachments:!1,chatWorkflows:[],powerMode:!1,voice:!1,chatContext:!1,chatProposals:!1,chatArtifactsStub:!1,chatOnboard:!1,chatArtifactsStubOps:null,chatCutInView:!1,chatCut:!1,dataSources:!1,trackerLinks:!1,planGateNote:!1,chatJobProposals:!1,reshapeRun:!1,chatJobPower:!1,workflowCatalogV2:!1,memoryRestore:null,knowledgeForget:!1},je=Ue((e,t)=>({loaded:!1,runChatId:!1,walkthroughRoots:!1,askPath:!1,chatIdOnLaunch:!1,deliverGate:!1,reducedAssurance:!1,launchPrimary:!1,chatList:!1,chatAttachments:!1,chatWorkflows:[],powerMode:!1,gateActions:!1,voice:!1,chatContext:!1,chatProposals:!1,chatArtifactsStub:!1,chatOnboard:!1,chatArtifactsStubOps:null,chatCutInView:!1,chatCut:!1,dataSources:!1,planGateNote:!1,chatJobProposals:!1,reshapeRun:!1,chatJobPower:!1,workflowCatalogV2:!1,trackerLinks:!1,memoryRestore:null,knowledgeForget:!1,load:()=>t().loaded?Promise.resolve():(ne??(ne=Promise.resolve().then(()=>ye).then(({api:r})=>r.getHealth()).then(r=>{e(fe(r)),r.ping==="busy"&&setTimeout(()=>{Promise.resolve().then(()=>ye).then(({api:s})=>s.getHealth()).then(s=>e({chatWorkflows:fe(s).chatWorkflows}),()=>{})},_e)}).catch(()=>{e(Ee)}).finally(()=>{ne=null})),ne)}));function Ae(e){const t=e?.stubOps;return Array.isArray(t)?t.filter(r=>typeof r=="string"):null}const Ne={};function me(){const e=je.getState(),t=[...e.chatJobProposals?["job"]:[],...e.chatOnboard?["onboard"]:[],...e.chatCut?["cut"]:[]];return t.length>0?{accepts:t}:{}}function xe(){const e=Ne?.VITE_API_HOST;return typeof e=="string"&&e.length>0?e:void 0}function he(){const e=xe();return e?`http://${e}/api/v1`:`${window.location.origin}/api/v1`}const ge=48*1024,oe="/workflows/catalog";async function o(e,t){const r=t?.body!==void 0&&t?.body!==null&&!(typeof FormData<"u"&&t.body instanceof FormData)?{"Content-Type":"application/json",...t?.headers}:{...t?.headers},s=await fetch(`${he()}${e}`,{...t,headers:r});if(!s.ok){const u=await s.text();let h,x;try{const P=JSON.parse(u);x=P;const y=P.error??P.message??u;h=typeof y=="string"?y:JSON.stringify(y)}catch{h=u}throw h||(h=s.statusText),new K(s.status,h,x)}if(s.status!==204)return s.json()}const ye=Object.freeze(Object.defineProperty({__proto__:null,ApiError:K,KEEPALIVE_MAX_BYTES:ge,WORKFLOW_CATALOG_PATH:oe,api:{search:(e,t={})=>{const r=new URLSearchParams({q:e});return t.types!==void 0&&t.types.length>0&&r.set("types",t.types.join(",")),t.limit!==void 0&&r.set("limit",String(t.limit)),t.cursor!==void 0&&t.cursor!==null&&r.set("cursor",t.cursor),o(`/search?${r.toString()}`,t.signal!==void 0?{signal:t.signal}:void 0)},listRuns:e=>o(e?"/runs?include=archived":"/runs"),listRunsForDoc:e=>o(`/runs?doc=${encodeURIComponent(e)}`),archiveRun:(e,t,r)=>o(`/runs/${encodeURIComponent(e)}/archive`,{method:"POST",body:JSON.stringify(r===void 0?{archived:t}:{archived:t,note:r})}),resolveRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/resolve`,{method:"POST",body:JSON.stringify(t)}),getRun:e=>o(`/runs/${encodeURIComponent(e)}`),getAudit:e=>o(`/audit?runId=${encodeURIComponent(e)}`),getAuditByAction:(e,t)=>o(`/audit?action=${encodeURIComponent(e)}${t!==void 0?`&limit=${Math.max(1,Math.floor(t))}`:""}`),getAuditSince:(e,t=200)=>o(`/audit?since=${Math.max(0,Math.floor(e))}&limit=${t}`),getRunEvents:(e,t)=>o(`/runs/${encodeURIComponent(e)}/events${t!==void 0&&t.length>0?`?type=${t.map(encodeURIComponent).join(",")}`:""}`),getRunAcceptance:e=>o(`/runs/${encodeURIComponent(e)}/acceptance`),getRunInventory:e=>o(`/runs/${encodeURIComponent(e)}/inventory`),launchRun:e=>o("/runs",{method:"POST",body:JSON.stringify(e)}),previewLaunchPosture:e=>o("/runs/preview",{method:"POST",body:JSON.stringify(e)}),previewLinkedIssues:e=>o("/linked-issues/preview",{method:"POST",body:JSON.stringify(e)}),deliverRun:e=>o(`/runs/${encodeURIComponent(e)}/deliver`,{method:"POST"}),runPullRequest:e=>o(`/runs/${encodeURIComponent(e)}/pr`),redeliverRun:e=>o(`/runs/${encodeURIComponent(e)}/redeliver`,{method:"POST"}),confirmGate:(e,t)=>{const r=JSON.stringify(t);return o(`/runs/${encodeURIComponent(e)}/gate`,{method:"POST",body:r,...new TextEncoder().encode(r).length<=ge?{keepalive:!0}:{}})},cancelRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/cancel`,t!==void 0&&(t.reason!==void 0||t.input!==void 0)?{method:"POST",body:JSON.stringify(t)}:{method:"POST"}),putGuidance:(e,t)=>o(`/runs/${encodeURIComponent(e)}/guidance`,{method:"PUT",body:JSON.stringify({text:t})}),resumeRun:e=>o(`/runs/${encodeURIComponent(e)}/resume`,{method:"POST"}),openChat:e=>o("/chats",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...me()})}),sendChatMessage:(e,t,r,s,u)=>o(`/chats/${encodeURIComponent(e)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,...r!==void 0?{targets:r}:{},...s!==void 0&&s.length>0?{attachments:s}:{},...u!==void 0&&Object.keys(u).length>0?{context:u}:{},...me()})}),reseatChat:(e,t)=>o(`/chats/${encodeURIComponent(e)}/seats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clis:t})}),closeChat:e=>o(`/chats/${encodeURIComponent(e)}`,{method:"DELETE"}),getChat:e=>o(`/chats/${encodeURIComponent(e)}`),listChats:()=>o("/chats"),listChatHistory:(e={})=>{const t=new URLSearchParams({limit:String(e.limit??20),status:e.status??"all"});return e.cursor!==void 0&&e.cursor!==null&&e.cursor!==""&&t.set("cursor",e.cursor),o(`/chats?${t.toString()}`)},getChatMessages:e=>o(`/chats/${encodeURIComponent(e)}/messages`),decideChatProposal:(e,t,r)=>o(`/chats/${encodeURIComponent(e)}/proposals/${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify(r)}),proposeInChat:(e,t)=>o(`/chats/${encodeURIComponent(e)}/proposals`,{method:"POST",body:JSON.stringify(t)}),reviseChatProposal:(e,t)=>o(`/chats/${encodeURIComponent(e)}/proposals`,{method:"POST",body:JSON.stringify(t)}),reshapeRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/reshape`,{method:"POST",body:JSON.stringify(t)}),endChat:e=>o(`/chats/${encodeURIComponent(e)}/close`,{method:"POST"}),uploadChatAttachments:(e,t)=>{const r=new FormData;for(const s of t)r.append("file",s,s.name);return o(`/chats/${encodeURIComponent(e)}/attachments`,{method:"POST",body:r})},getUnitOutput:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${encodeURIComponent(t)}/output`),getGate:(e,t)=>o(`/runs/${encodeURIComponent(e)}/gate`,t!==void 0?{signal:t}:void 0),getElicitation:async e=>{try{return await o(`/runs/${encodeURIComponent(e)}/elicitation`)}catch(t){if(ce(t)===404)return null;throw t}},respondToElicitation:(e,t)=>o(`/runs/${encodeURIComponent(e)}/elicitation`,{method:"POST",body:JSON.stringify(t)}),getRoster:e=>o(e===void 0?"/roster":`/roster?refresh=${encodeURIComponent(e)}`),getWatch:(e={})=>{const t=new URLSearchParams;for(const[s,u]of Object.entries(e))u!==void 0&&u!==""&&t.set(s,String(u));const r=t.toString();return o(`/watch${r===""?"":`?${r}`}`)},getSeatRecord:(e=7,t)=>o(`/roster/record?days=${e}${t!==void 0?`&project=${encodeURIComponent(t)}`:""}`),listRepos:()=>o("/repos"),registerRepo:(e,t,r,s)=>o("/repos",{method:"POST",body:JSON.stringify({name:e,rootPath:t,...r!==void 0?{projectId:r}:{},...s?.autoCapture===!1?{autoCapture:!1}:{}})}),cloneAndRegisterRepo:(e,t,r,s,u)=>o("/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,...r?{rootPath:r}:{},...s!==void 0?{projectId:s}:{},...u?.autoCapture===!1?{autoCapture:!1}:{}})}),unregisterRepo:e=>o(`/repos/${encodeURIComponent(e)}`,{method:"DELETE"}),getMaintenance:()=>o("/maintenance"),setMaintenance:e=>o("/maintenance",{method:"POST",body:JSON.stringify({drain:e})}),getOnboardRun:e=>o(`/repos/${encodeURIComponent(e)}/onboard`),rerunOnboarding:e=>o(`/repos/${encodeURIComponent(e)}/onboard`,{method:"POST"}),getHealth:()=>o("/health"),openTerminal:e=>o("/terminals",{method:"POST",body:JSON.stringify(e)}),seatLogout:(e,t)=>o(`/seats/${encodeURIComponent(e)}/logout`,{method:"POST",body:JSON.stringify(t)}),seatContainerLogin:(e,t)=>o(`/seats/${encodeURIComponent(e)}/container-login`,{method:"POST",body:JSON.stringify(t)}),closeSeatContainerLogin:e=>o(`/seats/${encodeURIComponent(e)}/container-login`,{method:"DELETE"}),seatContainerLoginOutcome:(e,t)=>o(`/seats/${encodeURIComponent(e)}/container-login`,t===void 0?void 0:{signal:t}),seatContainerLogout:e=>o(`/seats/${encodeURIComponent(e)}/container-logout`,{method:"POST"}),resizeTerminal:(e,t,r)=>o(`/terminals/${encodeURIComponent(e)}/resize`,{method:"POST",body:JSON.stringify({cols:t,rows:r})}),closeTerminal:e=>o(`/terminals/${encodeURIComponent(e)}/close`,{method:"POST"}),openPath:(e,t)=>o("/open",{method:"POST",body:JSON.stringify(t===void 0?{path:e}:{path:e,runId:t})}),getRunFile:(e,t)=>o(`/runs/${encodeURIComponent(e)}/files?path=${encodeURIComponent(t)}`),getRunDiff:(e,t,r)=>{const s=new URLSearchParams;t!==void 0&&s.set("path",t),r!==void 0&&s.set("base",r);const u=s.toString();return o(`/runs/${encodeURIComponent(e)}/diff${u===""?"":`?${u}`}`)},inspectUnit:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${t}/inspect`,{method:"POST",body:"{}"}),getInspections:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${t}/inspections`),injectMessage:(e,t,r,s)=>o(`/runs/${encodeURIComponent(e)}/inject`,{method:"POST",body:JSON.stringify(s?.input!==void 0?{message:t,target:r,input:s.input}:{message:t,target:r})}),listWorkflows:()=>o("/workflows"),getWorkflowCatalog:e=>o(e!=null&&e!==""?`${oe}?projectId=${encodeURIComponent(e)}`:oe).catch(t=>{if(t instanceof SyntaxError)return null;throw t}),getWorkflow:e=>o(`/workflows/${encodeURIComponent(e)}`),saveScript:(e,t,r)=>o("/scripts",{method:"POST",body:JSON.stringify({name:e,content:t,lang:r})}),listRequirements:async(e,t,r={})=>{const s=new URLSearchParams;t.q&&s.set("q",t.q),t.mismatch&&s.set("mismatch",t.mismatch),t.risk&&s.set("risk",t.risk),t.category&&s.set("category",t.category),t.domain&&s.set("domain",t.domain),s.set("offset",String(t.offset??0)),s.set("limit",String(t.limit??50));const u=await o(`/repos/${encodeURIComponent(e)}/requirements?${s.toString()}`,r.signal!==void 0?{signal:r.signal}:void 0);if(typeof u=="object"&&u!==null&&"code"in u&&u.code==="notGenerated")throw new K(404,typeof u.error=="string"?u.error:"No requirements graph yet for this repository",u);return u},setRequirementsMinimum:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/minimum`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({minPct:t})}),getRequirement:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}`),patchRequirement:(e,t,r)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),retireRequirement:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}/retire`,{method:"POST"}),getDomainGraph:()=>o("/domain-graph"),getRepoGraph:(e,t)=>{const r=new URLSearchParams;t?.focus&&r.set("focus",t.focus),t?.limit&&r.set("limit",String(t.limit));const s=r.size>0?`?${r.toString()}`:"";return o(`/repos/${encodeURIComponent(e)}/graph${s}`)},getBlastRadius:(e,t)=>o(`/repos/${encodeURIComponent(e)}/graph/blast-radius?name=${encodeURIComponent(t)}`),getRepoGitHistory:(e,t)=>o(`/repos/${encodeURIComponent(e)}/git-history${t===void 0?"":`?limit=${t}`}`),getDeliverTarget:async e=>{try{return await o(`/repos/${encodeURIComponent(e)}/deliver-target`)}catch{return null}},getRepoContributors:e=>o(`/repos/${encodeURIComponent(e)}/contributors`),getRepoDomainGraph:e=>o(`/repos/${encodeURIComponent(e)}/domain-graph`),listPolicies:()=>o("/governance/policies"),listConformanceRules:()=>o("/governance/rules"),getCoverageReport:(e={})=>o("/governance/coverage",e.signal!==void 0?{signal:e.signal}:void 0),getCoverageReportForRepo:(e,t={})=>o(`/governance/coverage?repo=${encodeURIComponent(e)}`,t.signal!==void 0?{signal:t.signal}:void 0),getGraphKindsForRepo:(e,t={})=>o(`/governance/graph?repo=${encodeURIComponent(e)}`,t.signal!==void 0?{signal:t.signal}:void 0),listClaims:()=>o("/governance/claims"),upsertPolicy:e=>o("/governance/policies",{method:"POST",body:JSON.stringify(e)}),upsertConformanceRule:e=>o("/governance/rules",{method:"POST",body:JSON.stringify(e)}),retirePolicy:e=>o(`/governance/policies/${encodeURIComponent(e)}`,{method:"DELETE"}),retireConformanceRule:e=>o(`/governance/rules/${encodeURIComponent(e)}`,{method:"DELETE"}),recallRulesPreview:e=>{const t=new URLSearchParams;for(const[u,h]of Object.entries(e))h&&t.set(u,h);const r=t.toString(),s=r?`?${r}`:"";return o(`/governance/rules/preview${s}`)},getSettings:()=>o("/settings"),getStartOnLogin:()=>o("/settings/start-on-login"),updateSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify(e)}),getAppearanceSettings:()=>o("/settings"),putAppearanceSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.appearance":e})}),putNotifSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.notifications":e})}),putComposerSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.composer":e})}),putSetupSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.setup":e})}),putViewSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.view":e})}),putReportShown:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.report":{shown:e}})}),listApps:()=>o("/apps"),listProjects:e=>{const t=e?`?status=${e}`:"";return o(`/projects${t}`)},getProject:e=>o(`/projects/${encodeURIComponent(e)}`),createProject:e=>o("/projects",{method:"POST",body:JSON.stringify(e)}),updateProject:(e,t)=>o(`/projects/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),listProjectMembers:e=>o(`/projects/${encodeURIComponent(e)}/members`),listProjectPrompts:e=>o(`/projects/${encodeURIComponent(e)}/prompts`),attachProjectMember:(e,t)=>o(`/projects/${encodeURIComponent(e)}/members`,{method:"POST",body:JSON.stringify(t)}),detachProjectMember:(e,t)=>o(`/projects/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:"DELETE"}),getProjectActivity:(e,t)=>{const r=t?`?cursor=${encodeURIComponent(t)}`:"";return o(`/projects/${encodeURIComponent(e)}/activity${r}`)},reassignRun:(e,t,r,s)=>o(`/runs/${encodeURIComponent(e)}/reassign`,{method:"POST",body:JSON.stringify({...t===void 0?{}:{cli:t},...r?.trim()?{note:r.trim()}:{},...s===void 0?{}:{ord:s}})}),getProjectGraph:e=>o(`/projects/${encodeURIComponent(e)}/graph`),refreshProjectGraph:(e,t)=>o(`/projects/${encodeURIComponent(e)}/graph/refresh`,{method:"POST",body:JSON.stringify(t??{})}),getProjectBlastRadius:(e,t)=>o(`/projects/${encodeURIComponent(e)}/graph/blast-radius?name=${encodeURIComponent(t)}`),getProjectGraphPath:(e,t,r,s)=>o(`/projects/${encodeURIComponent(e)}/graph/path?from=${encodeURIComponent(t)}&to=${encodeURIComponent(r)}${s===void 0?"":`&maxDepth=${s}`}`),getProjectGraphBoundaries:e=>o(`/projects/${encodeURIComponent(e)}/graph/boundaries`)},apiBase:he,apiFetch:o,apiStatus:ce,translateWireError:ae},Symbol.toStringTag,{value:"Module"})),Y=e=>e==null?"null":typeof e=="string"?e:JSON.stringify(e);function qe(e,t){switch(e.type){case"number":return Math.round((t+1)*13.7*10)/10;case"integer":return(t+1)*7;case"boolean":return t%2===0;case"date":return`2026-10-${String(10+t).padStart(2,"0")}`;case"datetime":return`2026-10-${String(10+t).padStart(2,"0")}T09:30:00Z`;default:return`${e.name.replace(/_/g," ")} ${t+1}`}}function Le(e,t){const r=Object.assign(Object.create(null),structuredClone(t?.rows??{})),s=null,u="you",h=new Map;let x=0;const P=(y,f)=>y.kind==="param"?{value:f[y.name]??null,from:"from the app"}:y.kind==="literal"?{value:y.value,from:"fixed by the app"}:y.kind==="viewer"?{value:y.claim==="name"?u.split("@")[0]:u,from:"your sign-in"}:{value:y.value==="now"?new Date().toISOString():"a new uuid",from:`filled by studio: ${y.value}`};return{kind:{queries:"sample",actions:"sample"},async query(y,f,g){const d=e().queries.find(C=>C.id===f);if(d===void 0)return{error:"refused",message:`this version has no query ${f}`};Object.hasOwn(r,f)||(r[f]=[0,1,2].map(C=>d.output.map(L=>qe(L,C))));let _=r[f];const A=Object.values(g).filter(C=>typeof C=="string"&&C.trim()!==""&&C!=="all");return A.length>0&&(_=_.filter(C=>A.every(L=>C.some(q=>typeof q=="string"&&q.toLowerCase().includes(L.toLowerCase()))))),{columns:d.output,rows:structuredClone(_),truncated:!1,hasMore:!1,ms:1,cachedAt:null,sample:!0}},async prepare(y,f,g){const d=e().actions.find($=>$.id===f);if(d===void 0)return{error:"refused",message:`this version has no action ${f}`};const _=[];let A,C,L=null,q=null;if(d.kind==="row-write"){const $=Object.entries(d.set??{});for(const[l,p]of $){const k=P(p,g);_.push({label:l,value:Y(k.value),from:k.from})}L=`${Object.entries(d.key).map(([l,p])=>`${l} = ${Y(g[p.name])}`).join(", ")} (exactly 1 row)`,q="Sample: no table was checked. A real run checks a plain table (no triggers, rules, inheritance or row security) just before it writes.",A=`${d.op.toUpperCase()} ${d.table}`;const c=$.length;C=d.op==="update"?`UPDATE ONLY ${d.table} AS w SET ${$.map(([l],p)=>`${l} = $${p+1}`).join(", ")} WHERE ${Object.keys(d.key).map((l,p)=>`w.${l} = $${c+p+1}`).join(" AND ")}`:d.op==="delete"?`DELETE FROM ONLY ${d.table} AS w WHERE ${Object.keys(d.key).map((l,p)=>`w.${l} = $${p+1}`).join(" AND ")}`:`INSERT INTO ${d.table} (${$.map(([l])=>l).join(", ")}) VALUES (${$.map((l,p)=>`$${p+1}`).join(", ")})`}else{for(const[$,a]of Object.entries(d.args)){const c=P(a,g);_.push({label:$,value:Y(c.value),from:c.from})}A=d.call.kind==="tool"?d.call.tool:`mutation ${d.call.mutation.slice(0,60)}`,C=`${A}
10
- ${JSON.stringify(Object.fromEntries(_.map($=>[$.label,$.value])),null,1)}`}x+=1;const N=`sample-${x}`,J=Date.now()+12e4;return h.set(N,{action:d,params:g,expiresAt:J}),{record:N,expiresAt:J,card:{action:d.id,kind:d.kind,source:`${d.source} (sample)`,operation:A,rows:_,key:L,checks:q,request:C,says:d.description??null,sample:!0}}},async run(y,f){const g=h.get(f);if(h.delete(f),g===void 0||g.action.id!==y)return{state:"failed",reason:"this card was not prepared here",sample:!0};if(Date.now()>g.expiresAt)return{state:"failed",reason:"the card expired; nothing was written",sample:!0};if(g.action.kind==="row-write"&&g.action.op==="update"){const _=g.action;for(const A of e().queries){const C=A.output.map(N=>N.name),L=Object.entries(_.key),q=Object.hasOwn(r,A.id)?r[A.id]:void 0;if(!(q===void 0||!L.every(([N])=>C.includes(N)))){for(const N of q)if(L.every(([J,$])=>Y(N[C.indexOf(J)])===Y(g.params[$.name])))for(const[J,$]of Object.entries(_.set??{}))C.includes(J)&&(N[C.indexOf(J)]=P($,g.params).value)}}}return{state:"succeeded",reason:g.action.kind==="row-write"&&g.action.op==="update"?"Sample data: the sample rows in this tab changed; no source was touched":"Sample data: nothing was written and no rows changed",sample:!0}},viewer:()=>({email:s,sample:!0})}}const re="wicked.editor",se=1,Je=/^[A-Z]{3}$/u;function De(e,t,r){if(e==null)return"";if(typeof e=="boolean")return e?"yes":"no";const s=void 0,u=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):null;try{switch(t?.kind){case"currency":if(u===null||!Je.test(t.currency))break;return new Intl.NumberFormat(r,{style:"currency",currency:t.currency,...s!==void 0?{minimumFractionDigits:s,maximumFractionDigits:s}:{}}).format(u);case"percent":if(u===null)break;return new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:s??1}).format(u);case"number":if(u===null)break;return new Intl.NumberFormat(r,s!==void 0?{minimumFractionDigits:s,maximumFractionDigits:s}:{}).format(u);case"date":case"datetime":{const h=new Date(typeof e=="number"?e:String(e));if(Number.isNaN(h.getTime()))break;return new Intl.DateTimeFormat(r,t.kind==="date"?{dateStyle:"medium",timeZone:"UTC"}:{dateStyle:"medium",timeStyle:"short"}).format(h)}case"duration":{if(u===null)break;const h=Math.abs(Math.round(u)),x=Math.floor(h/86400),P=Math.floor(h%86400/3600),y=Math.floor(h%3600/60);return x>0?`${x}d ${P}h`:P>0?`${P}h ${y}m`:`${y}m`}default:break}}catch{}return typeof e=="number"?Number.isInteger(e)?String(e):new Intl.NumberFormat(r,{maximumFractionDigits:6}).format(e):String(e)}function Me(e,t){if(e===void 0||t===null||t===void 0)return t;if((e.type==="number"||e.type==="integer")&&typeof t=="string"&&t.trim()!==""){const r=Number(t);return Number.isFinite(r)&&(e.type==="number"||Number.isInteger(r))?r:t}return e.type==="boolean"&&typeof t=="string"&&(t==="true"||t==="false")?t==="true":e.type==="string"&&(typeof t=="number"||typeof t=="boolean")?String(t):t}const Q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),we=()=>new Promise(e=>requestAnimationFrame(()=>e()));async function Se(e,t,r){const s=Object.entries(r).sort(([f],[g])=>f.localeCompare(g)),u=JSON.stringify([t,s]);let h=0;for(const f of u)h=Math.imul(h,31)+f.charCodeAt(0)>>>0;const x=e.queries.find(f=>f.id===t),P=s.map(([,f])=>f).filter(f=>typeof f=="string").join(" "),y=[0,1,2].map(f=>(x?.output??[]).map(g=>{const d=h%1e3+f+1;switch(g.type){case"number":return d/10;case"integer":return d;case"boolean":return d%2===0;case"date":return`2026-10-${String(10+f).padStart(2,"0")}`;case"datetime":return`2026-10-${String(10+f).padStart(2,"0")}T09:30:00Z`;default:return`${P} ${g.name} ${d}`.trim()}}));return Le(()=>e,{rows:{[t]:y}}).query(1,t,r)}async function Fe(){const e=Date.parse("2026-10-15T12:00:00Z");window.Date=new Proxy(Date,{construct:(a,c)=>Reflect.construct(a,c.length===0?[e]:c),apply:a=>new a(e).toString(),get:(a,c,l)=>c==="now"?()=>e:Reflect.get(a,c,l)});let t;const r=new Map,s=new Map;let u,h=0,x=0,P=0,y=null;const f=new Map,g=a=>{const c=a instanceof Error?a.message:String(a);$.errors.includes(c)||$.errors.push(c)},d=async a=>{try{await a()}catch(c){throw g(c),c}},_=a=>{const c=t.spec.pages.find(l=>l.id===a);if(c===void 0)throw new Error(`This app has no page ${a}`);return c},A=a=>{const c=[...document.querySelectorAll("[data-component]")].find(l=>l.dataset.component===a);if(c===void 0)throw new Error(`This page has no filter ${a}`);return c},C=a=>a.filter==="search"?["fixture"]:a.filter==="date-range"?["2026-10-01/2026-10-31"]:a.options?.kind==="values"?a.options.values.map(c=>c.value):[...s.get(a.id)??[]],L=async()=>{for(const a of t.spec.pages)for(const c of a.components){if(c.type!=="filter"||c.options?.kind!=="query")continue;const l=c.options,p=t.spec.queries.find(S=>S.id===l.query.query),k={};for(const[S,D]of Object.entries(l.query.params??{})){const[Z,H,G]=D.split("."),B=Z==="filter"&&H!==void 0?r.get(H):void 0,E=typeof B=="string"?G===void 0?B:void 0:G==="from"?B?.from:G==="to"?B?.to:void 0,W=p?.params?.properties??{};E!==void 0&&E!==""&&(k[S]=Me(Object.hasOwn(W,S)?W[S]:void 0,E))}const w=await Se(t.spec,l.query.query,k);if("error"in w)throw new Error(w.message);const O=w.columns.findIndex(S=>S.name===l.value);s.set(c.id,w.rows.slice(0,200).map(S=>De(S[O],void 0,"en")).filter(S=>S!==""))}},q=()=>new Promise((a,c)=>{const l=`fixture-${++P}`,p=setTimeout(()=>{f.delete(l),c(new Error("The runtime did not answer"))},5e3);f.set(l,()=>{clearTimeout(p),a()}),u.postMessage({p:re,v:se,type:"host.ping",id:l,payload:{}})}),N=async()=>{const a=performance.now()+5e3;let c=0;for(;c<2;){const l=h;if(await q(),await we(),await we(),c=x===0&&l===h?c+1:0,performance.now()>a)throw new Error("The fixture did not finish rendering")}for(const l of document.querySelectorAll(".wk-error"))l.textContent&&g(l.textContent)},J=a=>{if(!t.spec.actions.some(O=>O.id===a))throw new Error(`This app has no action ${a}`);const c=Array.isArray(t.cards)?t.cards.find(O=>O.action===a):Object.hasOwn(t.cards,a)?t.cards[a]:void 0;if(c===void 0)throw new Error(`The fixture has no card for ${a}`);y?.remove(),y=document.createElement("div"),y.className="wk-fixture-card";const l=document.createElement("section");l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-label",`Prepare ${a}`),l.setAttribute("data-testid","apps-card");const p=document.createElement("h2");p.textContent=`Prepare ${a}`;const k=document.createElement("pre");k.textContent=typeof c=="string"?c:JSON.stringify(c,null,2);const w=document.createElement("button");w.type="button",w.textContent="Close",w.addEventListener("click",()=>{$.closeCard()}),l.append(p,k,w),y.append(l),document.body.append(y),w.focus()},$={ready:!1,errors:[],pages:()=>t.spec.pages.map(a=>a.id),filters:a=>_(a).components.filter(c=>c.type==="filter").map(c=>({id:c.id,values:C(c)})),actions:a=>[...new Set(_(a).components.flatMap(c=>c.type==="button"?[c.action.action]:c.type==="form"?[c.submit.action]:c.type==="table"?(c.rowActions??[]).map(l=>l.action):[]))],show:a=>d(async()=>{const c=t.spec.pages.indexOf(_(a)),l=document.querySelectorAll(".wk-page")[c];if(l===void 0)throw new Error(`The runtime did not draw page ${a}`);l.click(),await N()}),setFilter:(a,c)=>d(async()=>{const l=t.spec.pages.find(w=>w.components.some(O=>O.id===a&&O.type==="filter"));if(l===void 0)throw new Error(`This app has no filter ${a}`);await $.show(l.id);const p=A(a),k=p.querySelector("select");if(k!==null){if(![...k.options].some(w=>w.value===c))throw new Error(`This filter has no value ${c}`);k.value=c,r.set(a,c),k.dispatchEvent(new Event("change",{bubbles:!0}))}else{const w=[...p.querySelectorAll("input")],O=w.length===2?c.split("/"):[c];if(w.length===0||O.length!==w.length)throw new Error("A date range needs from/to");for(const[S,D]of w.entries())D.value=O[S],D.dispatchEvent(new Event(D.type==="search"?"input":"change",{bubbles:!0}));r.set(a,w.length===2?{from:w[0].value,to:w[1].value}:w[0].value),w[0]?.type==="search"&&await new Promise(S=>setTimeout(S,310))}await L(),await N()}),prepare:a=>d(async()=>{J(a),await N()}),closeCard:()=>d(async()=>{y?.remove(),y=null,await N()})};window.__wkFixture=$,window.addEventListener("error",a=>g(a.message)),window.addEventListener("unhandledrejection",a=>g(a.reason));try{const a=await fetch("./fixture.json",{credentials:"omit",redirect:"error"});if(!a.ok)throw new Error("The fixture could not be read");t=await a.json();for(const l of t.spec.pages)for(const p of l.components)if(p.type==="filter")if(p.filter==="date-range"){const k=Q(p.default)&&Number.isInteger(p.default.lastDays)?Math.min(3650,Math.max(1,p.default.lastDays)):30;r.set(p.id,{from:new Date(e-k*864e5).toISOString().slice(0,10),to:new Date(e).toISOString().slice(0,10)})}else r.set(p.id,typeof p.default=="string"?p.default:"");await L();const c=new MessageChannel;if(u=c.port1,u.onmessage=l=>{const p=l.data;if(!Q(p)||p.p!==re||p.v!==se)return;if(typeof p.re=="string"){f.get(p.re)?.(),f.delete(p.re);return}if(typeof p.id!="string")return;const k=p.id,w=Q(p.payload)?p.payload:{},O=(S,D)=>{u.postMessage({p:re,v:se,re:k,ok:D===void 0,payload:S,...D===void 0?{}:{error:D}})};switch(h+=1,p.type){case"artifact.read":O({version:1,content:{type:"app",spec:t.spec,readonly:!0}});return;case"data.query":{x+=1,Se(t.spec,String(w.query),Q(w.params)?w.params:{}).then(S=>{"error"in S?(g(S.message),O({},{code:S.error,message:S.message})):O(S)}).catch(S=>{g(S),O({},{code:"unavailable",message:"The fixture query failed"})}).finally(()=>{x-=1,h+=1});return}case"data.action":try{J(String(w.action)),O({state:"cancelled"})}catch(S){g(S),O({},{code:"refused",message:String(S)})}return;default:O({},{code:"unsupported",message:"The fixture only reads and prepares"});return}},window.wickedAppsStandalone.boot(c.port2,{protocol:2,surface:"full",size:"full",grants:["artifact.read","data.read","data.write"],app:{framed:!1,mode:"preview",url:{}},prefs:{locale:"en"},theme:{}}),await N(),document.querySelector(".wk-page")===null)throw new Error("The runtime did not draw a page");$.ready=$.errors.length===0}catch(a){g(a)}}Fe()})();
9
+ */var le;function Oe(){if(le)return m;le=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),x=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),d=Symbol.iterator;function _(n){return n===null||typeof n!="object"?null:(n=d&&n[d]||n["@@iterator"],typeof n=="function"?n:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,L={};function q(n,i,b){this.props=n,this.context=i,this.refs=L,this.updater=b||A}q.prototype.isReactComponent={},q.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")},q.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function N(){}N.prototype=q.prototype;function J(n,i,b){this.props=n,this.context=i,this.refs=L,this.updater=b||A}var $=J.prototype=new N;$.constructor=J,C($,q.prototype),$.isPureReactComponent=!0;var a=Array.isArray,c=Object.prototype.hasOwnProperty,l={current:null},f={key:!0,ref:!0,__self:!0,__source:!0};function k(n,i,b){var R,v={},T=null,j=null;if(i!=null)for(R in i.ref!==void 0&&(j=i.ref),i.key!==void 0&&(T=""+i.key),i)c.call(i,R)&&!f.hasOwnProperty(R)&&(v[R]=i[R]);var U=arguments.length-2;if(U===1)v.children=b;else if(1<U){for(var I=Array(U),M=0;M<U;M++)I[M]=arguments[M+2];v.children=I}if(n&&n.defaultProps)for(R in U=n.defaultProps,U)v[R]===void 0&&(v[R]=U[R]);return{$$typeof:e,type:n,key:T,ref:j,props:v,_owner:l.current}}function w(n,i){return{$$typeof:e,type:n.type,key:i,ref:n.ref,props:n.props,_owner:n._owner}}function O(n){return typeof n=="object"&&n!==null&&n.$$typeof===e}function S(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(b){return i[b]})}var D=/\/+/g;function Z(n,i){return typeof n=="object"&&n!==null&&n.key!=null?S(""+n.key):i.toString(36)}function H(n,i,b,R,v){var T=typeof n;(T==="undefined"||T==="boolean")&&(n=null);var j=!1;if(n===null)j=!0;else switch(T){case"string":case"number":j=!0;break;case"object":switch(n.$$typeof){case e:case t:j=!0}}if(j)return j=n,v=v(j),n=R===""?"."+Z(j,0):R,a(v)?(b="",n!=null&&(b=n.replace(D,"$&/")+"/"),H(v,i,b,"",function(M){return M})):v!=null&&(O(v)&&(v=w(v,b+(!v.key||j&&j.key===v.key?"":(""+v.key).replace(D,"$&/")+"/")+n)),i.push(v)),1;if(j=0,R=R===""?".":R+":",a(n))for(var U=0;U<n.length;U++){T=n[U];var I=R+Z(T,U);j+=H(T,i,b,I,v)}else if(I=_(n),typeof I=="function")for(n=I.call(n),U=0;!(T=n.next()).done;)T=T.value,I=R+Z(T,U++),j+=H(T,i,b,I,v);else if(T==="object")throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return j}function G(n,i,b){if(n==null)return n;var R=[],v=0;return H(n,R,"","",function(T){return i.call(b,T,v++)}),R}function B(n){if(n._status===-1){var i=n._result;i=i(),i.then(function(b){(n._status===0||n._status===-1)&&(n._status=1,n._result=b)},function(b){(n._status===0||n._status===-1)&&(n._status=2,n._result=b)}),n._status===-1&&(n._status=0,n._result=i)}if(n._status===1)return n._result.default;throw n._result}var E={current:null},W={transition:null},Ge={ReactCurrentDispatcher:E,ReactCurrentBatchConfig:W,ReactCurrentOwner:l};function be(){throw Error("act(...) is not supported in production builds of React.")}return m.Children={map:G,forEach:function(n,i,b){G(n,function(){i.apply(this,arguments)},b)},count:function(n){var i=0;return G(n,function(){i++}),i},toArray:function(n){return G(n,function(i){return i})||[]},only:function(n){if(!O(n))throw Error("React.Children.only expected to receive a single React element child.");return n}},m.Component=q,m.Fragment=r,m.Profiler=u,m.PureComponent=J,m.StrictMode=s,m.Suspense=y,m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ge,m.act=be,m.cloneElement=function(n,i,b){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var R=C({},n.props),v=n.key,T=n.ref,j=n._owner;if(i!=null){if(i.ref!==void 0&&(T=i.ref,j=l.current),i.key!==void 0&&(v=""+i.key),n.type&&n.type.defaultProps)var U=n.type.defaultProps;for(I in i)c.call(i,I)&&!f.hasOwnProperty(I)&&(R[I]=i[I]===void 0&&U!==void 0?U[I]:i[I])}var I=arguments.length-2;if(I===1)R.children=b;else if(1<I){U=Array(I);for(var M=0;M<I;M++)U[M]=arguments[M+2];R.children=U}return{$$typeof:e,type:n.type,key:v,ref:T,props:R,_owner:j}},m.createContext=function(n){return n={$$typeof:x,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:h,_context:n},n.Consumer=n},m.createElement=k,m.createFactory=function(n){var i=k.bind(null,n);return i.type=n,i},m.createRef=function(){return{current:null}},m.forwardRef=function(n){return{$$typeof:P,render:n}},m.isValidElement=O,m.lazy=function(n){return{$$typeof:g,_payload:{_status:-1,_result:n},_init:B}},m.memo=function(n,i){return{$$typeof:p,type:n,compare:i===void 0?null:i}},m.startTransition=function(n){var i=W.transition;W.transition={};try{n()}finally{W.transition=i}},m.unstable_act=be,m.useCallback=function(n,i){return E.current.useCallback(n,i)},m.useContext=function(n){return E.current.useContext(n)},m.useDebugValue=function(){},m.useDeferredValue=function(n){return E.current.useDeferredValue(n)},m.useEffect=function(n,i){return E.current.useEffect(n,i)},m.useId=function(){return E.current.useId()},m.useImperativeHandle=function(n,i,b){return E.current.useImperativeHandle(n,i,b)},m.useInsertionEffect=function(n,i){return E.current.useInsertionEffect(n,i)},m.useLayoutEffect=function(n,i){return E.current.useLayoutEffect(n,i)},m.useMemo=function(n,i){return E.current.useMemo(n,i)},m.useReducer=function(n,i,b){return E.current.useReducer(n,i,b)},m.useRef=function(n){return E.current.useRef(n)},m.useState=function(n){return E.current.useState(n)},m.useSyncExternalStore=function(n,i,b){return E.current.useSyncExternalStore(n,i,b)},m.useTransition=function(){return E.current.useTransition()},m.version="18.3.1",m}var de;function Ie(){return de||(de=1,te.exports=Oe()),te.exports}var Pe=Ie();const X=Ce(Pe),ke=e=>e;function Te(e,t=ke){const r=X.useSyncExternalStore(e.subscribe,X.useCallback(()=>t(e.getState()),[e,t]),X.useCallback(()=>t(e.getInitialState()),[e,t]));return X.useDebugValue(r),r}const fe=e=>{const t=Re(e),r=s=>Te(t,s);return Object.assign(r,t),r},Ue=(e=>e?fe(e):fe);let ne=null;const _e=3e3;function pe(e){const t=e.capabilities??{};return{loaded:!0,runChatId:t.runChatId===!0,walkthroughRoots:t.walkthroughRoots===!0,askPath:t.askPath===!0,chatIdOnLaunch:t.chatIdOnLaunch===!0,deliverGate:t.deliverGate===!0,reducedAssurance:t.reducedAssurance===!0,launchPrimary:t.launchPrimary===!0,chatList:t.chatList===!0,chatAttachments:t.chatAttachments===!0,chatWorkflows:Array.isArray(t.chatWorkflows)?t.chatWorkflows.filter(r=>typeof r=="string"):[],powerMode:t.powerMode===!0,gateActions:t.gateActions===!0,voice:t.voice===!0,chatContext:t.chatArtifacts?.context===!0,chatProposals:t.chatArtifacts?.proposals===!0,chatArtifactsStub:t.chatArtifacts?.stub===!0,chatOnboard:t.chatArtifacts?.onboard===!0,chatArtifactsStubOps:Ae(t.chatArtifacts),chatCutInView:t.chatArtifacts?.cutInView===!0,chatCut:t.chatArtifacts?.cut===!0,dataSources:t.apps?.uploads===!0,trackerLinks:t.trackerLinks===!0,planGateNote:t.planGateNote===!0,chatJobProposals:t.chatJobProposals===!0,reshapeRun:t.reshapeRun===!0,chatJobPower:t.chatJobPower===!0,workflowCatalogV2:t.workflowCatalogV2===!0,memoryRestore:t.memoryRestore===!0,knowledgeForget:t.knowledgeForget===!0}}const Ee={loaded:!0,gateActions:!1,runChatId:!1,walkthroughRoots:!1,askPath:!1,chatIdOnLaunch:!1,deliverGate:!1,reducedAssurance:!1,launchPrimary:!1,chatList:!1,chatAttachments:!1,chatWorkflows:[],powerMode:!1,voice:!1,chatContext:!1,chatProposals:!1,chatArtifactsStub:!1,chatOnboard:!1,chatArtifactsStubOps:null,chatCutInView:!1,chatCut:!1,dataSources:!1,trackerLinks:!1,planGateNote:!1,chatJobProposals:!1,reshapeRun:!1,chatJobPower:!1,workflowCatalogV2:!1,memoryRestore:null,knowledgeForget:!1},je=Ue((e,t)=>({loaded:!1,runChatId:!1,walkthroughRoots:!1,askPath:!1,chatIdOnLaunch:!1,deliverGate:!1,reducedAssurance:!1,launchPrimary:!1,chatList:!1,chatAttachments:!1,chatWorkflows:[],powerMode:!1,gateActions:!1,voice:!1,chatContext:!1,chatProposals:!1,chatArtifactsStub:!1,chatOnboard:!1,chatArtifactsStubOps:null,chatCutInView:!1,chatCut:!1,dataSources:!1,planGateNote:!1,chatJobProposals:!1,reshapeRun:!1,chatJobPower:!1,workflowCatalogV2:!1,trackerLinks:!1,memoryRestore:null,knowledgeForget:!1,load:()=>t().loaded?Promise.resolve():(ne??(ne=Promise.resolve().then(()=>ye).then(({api:r})=>r.getHealth()).then(r=>{e(pe(r)),r.ping==="busy"&&setTimeout(()=>{Promise.resolve().then(()=>ye).then(({api:s})=>s.getHealth()).then(s=>e({chatWorkflows:pe(s).chatWorkflows}),()=>{})},_e)}).catch(()=>{e(Ee)}).finally(()=>{ne=null})),ne)}));function Ae(e){const t=e?.stubOps;return Array.isArray(t)?t.filter(r=>typeof r=="string"):null}const Ne={};function me(){const e=je.getState(),t=[...e.chatJobProposals?["job"]:[],...e.chatOnboard?["onboard"]:[],...e.chatCut?["cut"]:[]];return t.length>0?{accepts:t}:{}}function xe(){const e=Ne?.VITE_API_HOST;return typeof e=="string"&&e.length>0?e:void 0}function he(){const e=xe();return e?`http://${e}/api/v1`:`${window.location.origin}/api/v1`}const ge=48*1024,oe="/workflows/catalog";async function o(e,t){const r=t?.body!==void 0&&t?.body!==null&&!(typeof FormData<"u"&&t.body instanceof FormData)?{"Content-Type":"application/json",...t?.headers}:{...t?.headers},s=await fetch(`${he()}${e}`,{...t,headers:r});if(!s.ok){const u=await s.text();let h,x;try{const P=JSON.parse(u);x=P;const y=P.error??P.message??u;h=typeof y=="string"?y:JSON.stringify(y)}catch{h=u}throw h||(h=s.statusText),new K(s.status,h,x)}if(s.status!==204)return s.json()}const ye=Object.freeze(Object.defineProperty({__proto__:null,ApiError:K,KEEPALIVE_MAX_BYTES:ge,WORKFLOW_CATALOG_PATH:oe,api:{search:(e,t={})=>{const r=new URLSearchParams({q:e});return t.types!==void 0&&t.types.length>0&&r.set("types",t.types.join(",")),t.limit!==void 0&&r.set("limit",String(t.limit)),t.cursor!==void 0&&t.cursor!==null&&r.set("cursor",t.cursor),o(`/search?${r.toString()}`,t.signal!==void 0?{signal:t.signal}:void 0)},listRuns:e=>o(e?"/runs?include=archived":"/runs"),listRunsForDoc:e=>o(`/runs?doc=${encodeURIComponent(e)}`),archiveRun:(e,t,r)=>o(`/runs/${encodeURIComponent(e)}/archive`,{method:"POST",body:JSON.stringify(r===void 0?{archived:t}:{archived:t,note:r})}),resolveRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/resolve`,{method:"POST",body:JSON.stringify(t)}),getRun:e=>o(`/runs/${encodeURIComponent(e)}`),getAudit:e=>o(`/audit?runId=${encodeURIComponent(e)}`),getAuditByAction:(e,t)=>o(`/audit?action=${encodeURIComponent(e)}${t!==void 0?`&limit=${Math.max(1,Math.floor(t))}`:""}`),getAuditSince:(e,t=200)=>o(`/audit?since=${Math.max(0,Math.floor(e))}&limit=${t}`),getRunEvents:(e,t)=>o(`/runs/${encodeURIComponent(e)}/events${t!==void 0&&t.length>0?`?type=${t.map(encodeURIComponent).join(",")}`:""}`),getRunAcceptance:e=>o(`/runs/${encodeURIComponent(e)}/acceptance`),getRunInventory:e=>o(`/runs/${encodeURIComponent(e)}/inventory`),launchRun:e=>o("/runs",{method:"POST",body:JSON.stringify(e)}),previewLaunchPosture:e=>o("/runs/preview",{method:"POST",body:JSON.stringify(e)}),previewDomainScope:(e,t={})=>o("/runs/preview",{method:"POST",body:JSON.stringify(e),...t.signal!==void 0?{signal:t.signal}:{}}),previewLinkedIssues:e=>o("/linked-issues/preview",{method:"POST",body:JSON.stringify(e)}),deliverRun:e=>o(`/runs/${encodeURIComponent(e)}/deliver`,{method:"POST"}),runPullRequest:e=>o(`/runs/${encodeURIComponent(e)}/pr`),redeliverRun:e=>o(`/runs/${encodeURIComponent(e)}/redeliver`,{method:"POST"}),confirmGate:(e,t)=>{const r=JSON.stringify(t);return o(`/runs/${encodeURIComponent(e)}/gate`,{method:"POST",body:r,...new TextEncoder().encode(r).length<=ge?{keepalive:!0}:{}})},cancelRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/cancel`,t!==void 0&&(t.reason!==void 0||t.input!==void 0)?{method:"POST",body:JSON.stringify(t)}:{method:"POST"}),putGuidance:(e,t)=>o(`/runs/${encodeURIComponent(e)}/guidance`,{method:"PUT",body:JSON.stringify({text:t})}),resumeRun:e=>o(`/runs/${encodeURIComponent(e)}/resume`,{method:"POST"}),openChat:e=>o("/chats",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...me()})}),sendChatMessage:(e,t,r,s,u)=>o(`/chats/${encodeURIComponent(e)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,...r!==void 0?{targets:r}:{},...s!==void 0&&s.length>0?{attachments:s}:{},...u!==void 0&&Object.keys(u).length>0?{context:u}:{},...me()})}),reseatChat:(e,t)=>o(`/chats/${encodeURIComponent(e)}/seats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clis:t})}),closeChat:e=>o(`/chats/${encodeURIComponent(e)}`,{method:"DELETE"}),getChat:e=>o(`/chats/${encodeURIComponent(e)}`),listChats:()=>o("/chats"),listChatHistory:(e={})=>{const t=new URLSearchParams({limit:String(e.limit??20),status:e.status??"all"});return e.cursor!==void 0&&e.cursor!==null&&e.cursor!==""&&t.set("cursor",e.cursor),o(`/chats?${t.toString()}`)},getChatMessages:e=>o(`/chats/${encodeURIComponent(e)}/messages`),decideChatProposal:(e,t,r)=>o(`/chats/${encodeURIComponent(e)}/proposals/${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify(r)}),proposeInChat:(e,t)=>o(`/chats/${encodeURIComponent(e)}/proposals`,{method:"POST",body:JSON.stringify(t)}),reviseChatProposal:(e,t)=>o(`/chats/${encodeURIComponent(e)}/proposals`,{method:"POST",body:JSON.stringify(t)}),reshapeRun:(e,t)=>o(`/runs/${encodeURIComponent(e)}/reshape`,{method:"POST",body:JSON.stringify(t)}),endChat:e=>o(`/chats/${encodeURIComponent(e)}/close`,{method:"POST"}),uploadChatAttachments:(e,t)=>{const r=new FormData;for(const s of t)r.append("file",s,s.name);return o(`/chats/${encodeURIComponent(e)}/attachments`,{method:"POST",body:r})},getUnitOutput:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${encodeURIComponent(t)}/output`),getGate:(e,t)=>o(`/runs/${encodeURIComponent(e)}/gate`,t!==void 0?{signal:t}:void 0),getElicitation:async e=>{try{return await o(`/runs/${encodeURIComponent(e)}/elicitation`)}catch(t){if(ce(t)===404)return null;throw t}},respondToElicitation:(e,t)=>o(`/runs/${encodeURIComponent(e)}/elicitation`,{method:"POST",body:JSON.stringify(t)}),getRoster:e=>o(e===void 0?"/roster":`/roster?refresh=${encodeURIComponent(e)}`),getWatch:(e={})=>{const t=new URLSearchParams;for(const[s,u]of Object.entries(e))u!==void 0&&u!==""&&t.set(s,String(u));const r=t.toString();return o(`/watch${r===""?"":`?${r}`}`)},getSeatRecord:(e=7,t)=>o(`/roster/record?days=${e}${t!==void 0?`&project=${encodeURIComponent(t)}`:""}`),listRepos:()=>o("/repos"),registerRepo:(e,t,r,s)=>o("/repos",{method:"POST",body:JSON.stringify({name:e,rootPath:t,...r!==void 0?{projectId:r}:{},...s?.autoCapture===!1?{autoCapture:!1}:{}})}),cloneAndRegisterRepo:(e,t,r,s,u)=>o("/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,...r?{rootPath:r}:{},...s!==void 0?{projectId:s}:{},...u?.autoCapture===!1?{autoCapture:!1}:{}})}),unregisterRepo:e=>o(`/repos/${encodeURIComponent(e)}`,{method:"DELETE"}),getMaintenance:()=>o("/maintenance"),setMaintenance:e=>o("/maintenance",{method:"POST",body:JSON.stringify({drain:e})}),getOnboardRun:e=>o(`/repos/${encodeURIComponent(e)}/onboard`),rerunOnboarding:e=>o(`/repos/${encodeURIComponent(e)}/onboard`,{method:"POST"}),getHealth:()=>o("/health"),openTerminal:e=>o("/terminals",{method:"POST",body:JSON.stringify(e)}),seatLogout:(e,t)=>o(`/seats/${encodeURIComponent(e)}/logout`,{method:"POST",body:JSON.stringify(t)}),seatContainerLogin:(e,t)=>o(`/seats/${encodeURIComponent(e)}/container-login`,{method:"POST",body:JSON.stringify(t)}),closeSeatContainerLogin:e=>o(`/seats/${encodeURIComponent(e)}/container-login`,{method:"DELETE"}),seatContainerLoginOutcome:(e,t)=>o(`/seats/${encodeURIComponent(e)}/container-login`,t===void 0?void 0:{signal:t}),seatContainerLogout:e=>o(`/seats/${encodeURIComponent(e)}/container-logout`,{method:"POST"}),resizeTerminal:(e,t,r)=>o(`/terminals/${encodeURIComponent(e)}/resize`,{method:"POST",body:JSON.stringify({cols:t,rows:r})}),closeTerminal:e=>o(`/terminals/${encodeURIComponent(e)}/close`,{method:"POST"}),openPath:(e,t)=>o("/open",{method:"POST",body:JSON.stringify(t===void 0?{path:e}:{path:e,runId:t})}),getRunFile:(e,t)=>o(`/runs/${encodeURIComponent(e)}/files?path=${encodeURIComponent(t)}`),getRunDiff:(e,t,r)=>{const s=new URLSearchParams;t!==void 0&&s.set("path",t),r!==void 0&&s.set("base",r);const u=s.toString();return o(`/runs/${encodeURIComponent(e)}/diff${u===""?"":`?${u}`}`)},inspectUnit:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${t}/inspect`,{method:"POST",body:"{}"}),getInspections:(e,t)=>o(`/runs/${encodeURIComponent(e)}/units/${t}/inspections`),injectMessage:(e,t,r,s)=>o(`/runs/${encodeURIComponent(e)}/inject`,{method:"POST",body:JSON.stringify(s?.input!==void 0?{message:t,target:r,input:s.input}:{message:t,target:r})}),listWorkflows:()=>o("/workflows"),getWorkflowCatalog:e=>o(e!=null&&e!==""?`${oe}?projectId=${encodeURIComponent(e)}`:oe).catch(t=>{if(t instanceof SyntaxError)return null;throw t}),getWorkflow:e=>o(`/workflows/${encodeURIComponent(e)}`),saveScript:(e,t,r)=>o("/scripts",{method:"POST",body:JSON.stringify({name:e,content:t,lang:r})}),listRequirements:async(e,t,r={})=>{const s=new URLSearchParams;t.q&&s.set("q",t.q),t.mismatch&&s.set("mismatch",t.mismatch),t.risk&&s.set("risk",t.risk),t.category&&s.set("category",t.category),t.domain&&s.set("domain",t.domain),s.set("offset",String(t.offset??0)),s.set("limit",String(t.limit??50));const u=await o(`/repos/${encodeURIComponent(e)}/requirements?${s.toString()}`,r.signal!==void 0?{signal:r.signal}:void 0);if(typeof u=="object"&&u!==null&&"code"in u&&u.code==="notGenerated")throw new K(404,typeof u.error=="string"?u.error:"No requirements graph yet for this repository",u);return u},domainRuling:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/rulings`,{method:"POST",body:JSON.stringify(t)}),getRequirement:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}`),patchRequirement:(e,t,r)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),retireRequirement:(e,t)=>o(`/repos/${encodeURIComponent(e)}/requirements/${encodeURIComponent(t)}/retire`,{method:"POST"}),getDomainGraph:()=>o("/domain-graph"),getRepoGraph:(e,t)=>{const r=new URLSearchParams;t?.focus&&r.set("focus",t.focus),t?.limit&&r.set("limit",String(t.limit));const s=r.size>0?`?${r.toString()}`:"";return o(`/repos/${encodeURIComponent(e)}/graph${s}`)},getBlastRadius:(e,t)=>o(`/repos/${encodeURIComponent(e)}/graph/blast-radius?name=${encodeURIComponent(t)}`),getRepoGitHistory:(e,t)=>o(`/repos/${encodeURIComponent(e)}/git-history${t===void 0?"":`?limit=${t}`}`),getDeliverTarget:async e=>{try{return await o(`/repos/${encodeURIComponent(e)}/deliver-target`)}catch{return null}},getRepoContributors:e=>o(`/repos/${encodeURIComponent(e)}/contributors`),getRepoDomainGraph:e=>o(`/repos/${encodeURIComponent(e)}/domain-graph`),listPolicies:()=>o("/governance/policies"),listConformanceRules:()=>o("/governance/rules"),getCoverageReport:(e={})=>o("/governance/coverage",e.signal!==void 0?{signal:e.signal}:void 0),getCoverageReportForRepo:(e,t={})=>o(`/governance/coverage?repo=${encodeURIComponent(e)}`,t.signal!==void 0?{signal:t.signal}:void 0),getGraphKindsForRepo:(e,t={})=>o(`/governance/graph?repo=${encodeURIComponent(e)}`,t.signal!==void 0?{signal:t.signal}:void 0),listClaims:()=>o("/governance/claims"),upsertPolicy:e=>o("/governance/policies",{method:"POST",body:JSON.stringify(e)}),upsertConformanceRule:e=>o("/governance/rules",{method:"POST",body:JSON.stringify(e)}),retirePolicy:e=>o(`/governance/policies/${encodeURIComponent(e)}`,{method:"DELETE"}),retireConformanceRule:e=>o(`/governance/rules/${encodeURIComponent(e)}`,{method:"DELETE"}),recallRulesPreview:e=>{const t=new URLSearchParams;for(const[u,h]of Object.entries(e))h&&t.set(u,h);const r=t.toString(),s=r?`?${r}`:"";return o(`/governance/rules/preview${s}`)},getSettings:()=>o("/settings"),getStartOnLogin:()=>o("/settings/start-on-login"),updateSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify(e)}),getAppearanceSettings:()=>o("/settings"),putAppearanceSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.appearance":e})}),putNotifSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.notifications":e})}),putComposerSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.composer":e})}),putSetupSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.setup":e})}),putViewSettings:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.view":e})}),putReportShown:e=>o("/settings",{method:"PUT",body:JSON.stringify({"studio.report":{shown:e}})}),listApps:()=>o("/apps"),listProjects:e=>{const t=e?`?status=${e}`:"";return o(`/projects${t}`)},getProject:e=>o(`/projects/${encodeURIComponent(e)}`),createProject:e=>o("/projects",{method:"POST",body:JSON.stringify(e)}),updateProject:(e,t)=>o(`/projects/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),listProjectMembers:e=>o(`/projects/${encodeURIComponent(e)}/members`),listProjectPrompts:e=>o(`/projects/${encodeURIComponent(e)}/prompts`),attachProjectMember:(e,t)=>o(`/projects/${encodeURIComponent(e)}/members`,{method:"POST",body:JSON.stringify(t)}),detachProjectMember:(e,t)=>o(`/projects/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:"DELETE"}),getProjectActivity:(e,t)=>{const r=t?`?cursor=${encodeURIComponent(t)}`:"";return o(`/projects/${encodeURIComponent(e)}/activity${r}`)},reassignRun:(e,t,r,s)=>o(`/runs/${encodeURIComponent(e)}/reassign`,{method:"POST",body:JSON.stringify({...t===void 0?{}:{cli:t},...r?.trim()?{note:r.trim()}:{},...s===void 0?{}:{ord:s}})}),getProjectGraph:e=>o(`/projects/${encodeURIComponent(e)}/graph`),refreshProjectGraph:(e,t)=>o(`/projects/${encodeURIComponent(e)}/graph/refresh`,{method:"POST",body:JSON.stringify(t??{})}),getProjectBlastRadius:(e,t)=>o(`/projects/${encodeURIComponent(e)}/graph/blast-radius?name=${encodeURIComponent(t)}`),getProjectGraphPath:(e,t,r,s)=>o(`/projects/${encodeURIComponent(e)}/graph/path?from=${encodeURIComponent(t)}&to=${encodeURIComponent(r)}${s===void 0?"":`&maxDepth=${s}`}`),getProjectGraphBoundaries:e=>o(`/projects/${encodeURIComponent(e)}/graph/boundaries`)},apiBase:he,apiFetch:o,apiStatus:ce,translateWireError:ae},Symbol.toStringTag,{value:"Module"})),Y=e=>e==null?"null":typeof e=="string"?e:JSON.stringify(e);function qe(e,t){switch(e.type){case"number":return Math.round((t+1)*13.7*10)/10;case"integer":return(t+1)*7;case"boolean":return t%2===0;case"date":return`2026-10-${String(10+t).padStart(2,"0")}`;case"datetime":return`2026-10-${String(10+t).padStart(2,"0")}T09:30:00Z`;default:return`${e.name.replace(/_/g," ")} ${t+1}`}}function Le(e,t){const r=Object.assign(Object.create(null),structuredClone(t?.rows??{})),s=null,u="you",h=new Map;let x=0;const P=(y,p)=>y.kind==="param"?{value:p[y.name]??null,from:"from the app"}:y.kind==="literal"?{value:y.value,from:"fixed by the app"}:y.kind==="viewer"?{value:y.claim==="name"?u.split("@")[0]:u,from:"your sign-in"}:{value:y.value==="now"?new Date().toISOString():"a new uuid",from:`filled by studio: ${y.value}`};return{kind:{queries:"sample",actions:"sample"},async query(y,p,g){const d=e().queries.find(C=>C.id===p);if(d===void 0)return{error:"refused",message:`this version has no query ${p}`};Object.hasOwn(r,p)||(r[p]=[0,1,2].map(C=>d.output.map(L=>qe(L,C))));let _=r[p];const A=Object.values(g).filter(C=>typeof C=="string"&&C.trim()!==""&&C!=="all");return A.length>0&&(_=_.filter(C=>A.every(L=>C.some(q=>typeof q=="string"&&q.toLowerCase().includes(L.toLowerCase()))))),{columns:d.output,rows:structuredClone(_),truncated:!1,hasMore:!1,ms:1,cachedAt:null,sample:!0}},async prepare(y,p,g){const d=e().actions.find($=>$.id===p);if(d===void 0)return{error:"refused",message:`this version has no action ${p}`};const _=[];let A,C,L=null,q=null;if(d.kind==="row-write"){const $=Object.entries(d.set??{});for(const[l,f]of $){const k=P(f,g);_.push({label:l,value:Y(k.value),from:k.from})}L=`${Object.entries(d.key).map(([l,f])=>`${l} = ${Y(g[f.name])}`).join(", ")} (exactly 1 row)`,q="Sample: no table was checked. A real run checks a plain table (no triggers, rules, inheritance or row security) just before it writes.",A=`${d.op.toUpperCase()} ${d.table}`;const c=$.length;C=d.op==="update"?`UPDATE ONLY ${d.table} AS w SET ${$.map(([l],f)=>`${l} = $${f+1}`).join(", ")} WHERE ${Object.keys(d.key).map((l,f)=>`w.${l} = $${c+f+1}`).join(" AND ")}`:d.op==="delete"?`DELETE FROM ONLY ${d.table} AS w WHERE ${Object.keys(d.key).map((l,f)=>`w.${l} = $${f+1}`).join(" AND ")}`:`INSERT INTO ${d.table} (${$.map(([l])=>l).join(", ")}) VALUES (${$.map((l,f)=>`$${f+1}`).join(", ")})`}else{for(const[$,a]of Object.entries(d.args)){const c=P(a,g);_.push({label:$,value:Y(c.value),from:c.from})}A=d.call.kind==="tool"?d.call.tool:`mutation ${d.call.mutation.slice(0,60)}`,C=`${A}
10
+ ${JSON.stringify(Object.fromEntries(_.map($=>[$.label,$.value])),null,1)}`}x+=1;const N=`sample-${x}`,J=Date.now()+12e4;return h.set(N,{action:d,params:g,expiresAt:J}),{record:N,expiresAt:J,card:{action:d.id,kind:d.kind,source:`${d.source} (sample)`,operation:A,rows:_,key:L,checks:q,request:C,says:d.description??null,sample:!0}}},async run(y,p){const g=h.get(p);if(h.delete(p),g===void 0||g.action.id!==y)return{state:"failed",reason:"this card was not prepared here",sample:!0};if(Date.now()>g.expiresAt)return{state:"failed",reason:"the card expired; nothing was written",sample:!0};if(g.action.kind==="row-write"&&g.action.op==="update"){const _=g.action;for(const A of e().queries){const C=A.output.map(N=>N.name),L=Object.entries(_.key),q=Object.hasOwn(r,A.id)?r[A.id]:void 0;if(!(q===void 0||!L.every(([N])=>C.includes(N)))){for(const N of q)if(L.every(([J,$])=>Y(N[C.indexOf(J)])===Y(g.params[$.name])))for(const[J,$]of Object.entries(_.set??{}))C.includes(J)&&(N[C.indexOf(J)]=P($,g.params).value)}}}return{state:"succeeded",reason:g.action.kind==="row-write"&&g.action.op==="update"?"Sample data: the sample rows in this tab changed; no source was touched":"Sample data: nothing was written and no rows changed",sample:!0}},viewer:()=>({email:s,sample:!0})}}const re="wicked.editor",se=1,Je=/^[A-Z]{3}$/u;function De(e,t,r){if(e==null)return"";if(typeof e=="boolean")return e?"yes":"no";const s=void 0,u=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):null;try{switch(t?.kind){case"currency":if(u===null||!Je.test(t.currency))break;return new Intl.NumberFormat(r,{style:"currency",currency:t.currency,...s!==void 0?{minimumFractionDigits:s,maximumFractionDigits:s}:{}}).format(u);case"percent":if(u===null)break;return new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:s??1}).format(u);case"number":if(u===null)break;return new Intl.NumberFormat(r,s!==void 0?{minimumFractionDigits:s,maximumFractionDigits:s}:{}).format(u);case"date":case"datetime":{const h=new Date(typeof e=="number"?e:String(e));if(Number.isNaN(h.getTime()))break;return new Intl.DateTimeFormat(r,t.kind==="date"?{dateStyle:"medium",timeZone:"UTC"}:{dateStyle:"medium",timeStyle:"short"}).format(h)}case"duration":{if(u===null)break;const h=Math.abs(Math.round(u)),x=Math.floor(h/86400),P=Math.floor(h%86400/3600),y=Math.floor(h%3600/60);return x>0?`${x}d ${P}h`:P>0?`${P}h ${y}m`:`${y}m`}default:break}}catch{}return typeof e=="number"?Number.isInteger(e)?String(e):new Intl.NumberFormat(r,{maximumFractionDigits:6}).format(e):String(e)}function Me(e,t){if(e===void 0||t===null||t===void 0)return t;if((e.type==="number"||e.type==="integer")&&typeof t=="string"&&t.trim()!==""){const r=Number(t);return Number.isFinite(r)&&(e.type==="number"||Number.isInteger(r))?r:t}return e.type==="boolean"&&typeof t=="string"&&(t==="true"||t==="false")?t==="true":e.type==="string"&&(typeof t=="number"||typeof t=="boolean")?String(t):t}const Q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),we=()=>new Promise(e=>requestAnimationFrame(()=>e()));async function Se(e,t,r){const s=Object.entries(r).sort(([p],[g])=>p.localeCompare(g)),u=JSON.stringify([t,s]);let h=0;for(const p of u)h=Math.imul(h,31)+p.charCodeAt(0)>>>0;const x=e.queries.find(p=>p.id===t),P=s.map(([,p])=>p).filter(p=>typeof p=="string").join(" "),y=[0,1,2].map(p=>(x?.output??[]).map(g=>{const d=h%1e3+p+1;switch(g.type){case"number":return d/10;case"integer":return d;case"boolean":return d%2===0;case"date":return`2026-10-${String(10+p).padStart(2,"0")}`;case"datetime":return`2026-10-${String(10+p).padStart(2,"0")}T09:30:00Z`;default:return`${P} ${g.name} ${d}`.trim()}}));return Le(()=>e,{rows:{[t]:y}}).query(1,t,r)}async function Fe(){const e=Date.parse("2026-10-15T12:00:00Z");window.Date=new Proxy(Date,{construct:(a,c)=>Reflect.construct(a,c.length===0?[e]:c),apply:a=>new a(e).toString(),get:(a,c,l)=>c==="now"?()=>e:Reflect.get(a,c,l)});let t;const r=new Map,s=new Map;let u,h=0,x=0,P=0,y=null;const p=new Map,g=a=>{const c=a instanceof Error?a.message:String(a);$.errors.includes(c)||$.errors.push(c)},d=async a=>{try{await a()}catch(c){throw g(c),c}},_=a=>{const c=t.spec.pages.find(l=>l.id===a);if(c===void 0)throw new Error(`This app has no page ${a}`);return c},A=a=>{const c=[...document.querySelectorAll("[data-component]")].find(l=>l.dataset.component===a);if(c===void 0)throw new Error(`This page has no filter ${a}`);return c},C=a=>a.filter==="search"?["fixture"]:a.filter==="date-range"?["2026-10-01/2026-10-31"]:a.options?.kind==="values"?a.options.values.map(c=>c.value):[...s.get(a.id)??[]],L=async()=>{for(const a of t.spec.pages)for(const c of a.components){if(c.type!=="filter"||c.options?.kind!=="query")continue;const l=c.options,f=t.spec.queries.find(S=>S.id===l.query.query),k={};for(const[S,D]of Object.entries(l.query.params??{})){const[Z,H,G]=D.split("."),B=Z==="filter"&&H!==void 0?r.get(H):void 0,E=typeof B=="string"?G===void 0?B:void 0:G==="from"?B?.from:G==="to"?B?.to:void 0,W=f?.params?.properties??{};E!==void 0&&E!==""&&(k[S]=Me(Object.hasOwn(W,S)?W[S]:void 0,E))}const w=await Se(t.spec,l.query.query,k);if("error"in w)throw new Error(w.message);const O=w.columns.findIndex(S=>S.name===l.value);s.set(c.id,w.rows.slice(0,200).map(S=>De(S[O],void 0,"en")).filter(S=>S!==""))}},q=()=>new Promise((a,c)=>{const l=`fixture-${++P}`,f=setTimeout(()=>{p.delete(l),c(new Error("The runtime did not answer"))},5e3);p.set(l,()=>{clearTimeout(f),a()}),u.postMessage({p:re,v:se,type:"host.ping",id:l,payload:{}})}),N=async()=>{const a=performance.now()+5e3;let c=0;for(;c<2;){const l=h;if(await q(),await we(),await we(),c=x===0&&l===h?c+1:0,performance.now()>a)throw new Error("The fixture did not finish rendering")}for(const l of document.querySelectorAll(".wk-error"))l.textContent&&g(l.textContent)},J=a=>{if(!t.spec.actions.some(O=>O.id===a))throw new Error(`This app has no action ${a}`);const c=Array.isArray(t.cards)?t.cards.find(O=>O.action===a):Object.hasOwn(t.cards,a)?t.cards[a]:void 0;if(c===void 0)throw new Error(`The fixture has no card for ${a}`);y?.remove(),y=document.createElement("div"),y.className="wk-fixture-card";const l=document.createElement("section");l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-label",`Prepare ${a}`),l.setAttribute("data-testid","apps-card");const f=document.createElement("h2");f.textContent=`Prepare ${a}`;const k=document.createElement("pre");k.textContent=typeof c=="string"?c:JSON.stringify(c,null,2);const w=document.createElement("button");w.type="button",w.textContent="Close",w.addEventListener("click",()=>{$.closeCard()}),l.append(f,k,w),y.append(l),document.body.append(y),w.focus()},$={ready:!1,errors:[],pages:()=>t.spec.pages.map(a=>a.id),filters:a=>_(a).components.filter(c=>c.type==="filter").map(c=>({id:c.id,values:C(c)})),actions:a=>[...new Set(_(a).components.flatMap(c=>c.type==="button"?[c.action.action]:c.type==="form"?[c.submit.action]:c.type==="table"?(c.rowActions??[]).map(l=>l.action):[]))],show:a=>d(async()=>{const c=t.spec.pages.indexOf(_(a)),l=document.querySelectorAll(".wk-page")[c];if(l===void 0)throw new Error(`The runtime did not draw page ${a}`);l.click(),await N()}),setFilter:(a,c)=>d(async()=>{const l=t.spec.pages.find(w=>w.components.some(O=>O.id===a&&O.type==="filter"));if(l===void 0)throw new Error(`This app has no filter ${a}`);await $.show(l.id);const f=A(a),k=f.querySelector("select");if(k!==null){if(![...k.options].some(w=>w.value===c))throw new Error(`This filter has no value ${c}`);k.value=c,r.set(a,c),k.dispatchEvent(new Event("change",{bubbles:!0}))}else{const w=[...f.querySelectorAll("input")],O=w.length===2?c.split("/"):[c];if(w.length===0||O.length!==w.length)throw new Error("A date range needs from/to");for(const[S,D]of w.entries())D.value=O[S],D.dispatchEvent(new Event(D.type==="search"?"input":"change",{bubbles:!0}));r.set(a,w.length===2?{from:w[0].value,to:w[1].value}:w[0].value),w[0]?.type==="search"&&await new Promise(S=>setTimeout(S,310))}await L(),await N()}),prepare:a=>d(async()=>{J(a),await N()}),closeCard:()=>d(async()=>{y?.remove(),y=null,await N()})};window.__wkFixture=$,window.addEventListener("error",a=>g(a.message)),window.addEventListener("unhandledrejection",a=>g(a.reason));try{const a=await fetch("./fixture.json",{credentials:"omit",redirect:"error"});if(!a.ok)throw new Error("The fixture could not be read");t=await a.json();for(const l of t.spec.pages)for(const f of l.components)if(f.type==="filter")if(f.filter==="date-range"){const k=Q(f.default)&&Number.isInteger(f.default.lastDays)?Math.min(3650,Math.max(1,f.default.lastDays)):30;r.set(f.id,{from:new Date(e-k*864e5).toISOString().slice(0,10),to:new Date(e).toISOString().slice(0,10)})}else r.set(f.id,typeof f.default=="string"?f.default:"");await L();const c=new MessageChannel;if(u=c.port1,u.onmessage=l=>{const f=l.data;if(!Q(f)||f.p!==re||f.v!==se)return;if(typeof f.re=="string"){p.get(f.re)?.(),p.delete(f.re);return}if(typeof f.id!="string")return;const k=f.id,w=Q(f.payload)?f.payload:{},O=(S,D)=>{u.postMessage({p:re,v:se,re:k,ok:D===void 0,payload:S,...D===void 0?{}:{error:D}})};switch(h+=1,f.type){case"artifact.read":O({version:1,content:{type:"app",spec:t.spec,readonly:!0}});return;case"data.query":{x+=1,Se(t.spec,String(w.query),Q(w.params)?w.params:{}).then(S=>{"error"in S?(g(S.message),O({},{code:S.error,message:S.message})):O(S)}).catch(S=>{g(S),O({},{code:"unavailable",message:"The fixture query failed"})}).finally(()=>{x-=1,h+=1});return}case"data.action":try{J(String(w.action)),O({state:"cancelled"})}catch(S){g(S),O({},{code:"refused",message:String(S)})}return;default:O({},{code:"unsupported",message:"The fixture only reads and prepares"});return}},window.wickedAppsStandalone.boot(c.port2,{protocol:2,surface:"full",size:"full",grants:["artifact.read","data.read","data.write"],app:{framed:!1,mode:"preview",url:{}},prefs:{locale:"en"},theme:{}}),await N(),document.querySelector(".wk-page")===null)throw new Error("The runtime did not draw a page");$.ready=$.errors.length===0}catch(a){g(a)}}Fe()})();
@@ -1 +1 @@
1
- import{r as c,a as t,c as k,j as y,f as m}from"./index-BLo9vFQI.js";k.use(m);const w={source:"--status-gate",table:"--accent-dim",shape:"--accent",code:"--status-run",repo:"--ink-muted",knowledge:"--ink-muted",tracker:"--ink-high",project:"--kn-project",issue:"--kn-issue",run:"--kn-run",pr:"--kn-pr"},b={source:"round-rectangle",table:"rectangle",shape:"diamond",code:"ellipse",repo:"hexagon",knowledge:"triangle",tracker:"tag",project:"barrel",issue:"round-pentagon",run:"cut-rectangle",pr:"rhomboid"},f={source:34,table:24,shape:26,code:22,repo:30,knowledge:18,tracker:30,project:36,issue:22,run:24,pr:24},p=new Set(["describes","joins","governed_by","measures","tracked_in","addresses","closes"]);function E({nodes:l,edges:i,onSelect:d}){const n=c.useRef(null),a=c.useRef(d);return a.current=d,c.useEffect(()=>{if(n.current===null)return;const s=new Map(l.map((e,r)=>[e.key,`n${r}`])),u=t("--ink-high"),g=t("--ink-dim"),h=[...l.map(e=>({group:"nodes",data:{id:s.get(e.key),label:e.label,color:t(w[e.kind]),shape:b[e.kind],size:f[e.kind],kind:e.kind,raw:e}})),...i.filter(e=>s.has(e.from)&&s.has(e.to)).map((e,r)=>({group:"edges",data:{id:`e${r}`,source:s.get(e.from),target:s.get(e.to),rel:e.rel,label:p.has(e.rel)?e.rel.replace("_"," "):""},classes:p.has(e.rel)?`typed rel-${e.rel}`:"quiet"}))],o=k({container:n.current,elements:h,style:[{selector:"node",style:{"background-color":"data(color)",shape:"data(shape)",width:"data(size)",height:"data(size)",label:"data(label)","font-size":11,"font-family":"ui-sans-serif, system-ui, sans-serif",color:u,"text-valign":"bottom","text-halign":"center","text-margin-y":4,"text-max-width":"140px","text-wrap":"ellipsis","text-background-color":t("--surface-base"),"text-background-opacity":.85,"text-background-padding":"2px"}},{selector:"node:selected",style:{"border-width":3,"border-color":t("--accent")}},{selector:"edge",style:{width:1,"curve-style":"bezier","line-color":g,"target-arrow-color":g,"target-arrow-shape":"none",opacity:.45}},{selector:"edge.typed",style:{width:2,opacity:.95,"target-arrow-shape":"triangle","arrow-scale":.8,label:"data(label)","font-size":10,color:u,"text-rotation":"autorotate","text-background-color":t("--surface-base"),"text-background-opacity":.9,"text-background-padding":"2px"}},{selector:"edge.rel-joins",style:{"line-color":t("--accent"),"target-arrow-color":t("--accent"),"line-style":"solid"}},{selector:"edge.rel-describes",style:{"line-color":t("--status-run"),"target-arrow-color":t("--status-run"),"line-style":"dashed"}},{selector:"edge.rel-governed_by",style:{"line-color":t("--status-gate"),"target-arrow-color":t("--status-gate"),"line-style":"dotted",width:3}},{selector:"edge.rel-tracked_in",style:{"line-color":t("--ink-muted"),"target-arrow-color":t("--ink-muted"),"line-style":"solid"}},{selector:"edge.rel-addresses, edge.rel-closes",style:{"line-color":t("--status-warn"),"target-arrow-color":t("--status-warn"),"line-style":"dashed"}}],layout:{name:"fcose",animate:!1,randomize:!0,quality:"default",idealEdgeLength:140,nodeRepulsion:2e4,numIter:2500,nodeSeparation:100},wheelSensitivity:.3,minZoom:.2,maxZoom:3});return o.on("tap","node",e=>{var r;return(r=a.current)==null?void 0:r.call(a,e.target.data("raw"))}),o.on("tap",e=>{var r;e.target===o&&((r=a.current)==null||r.call(a,null))}),o.ready(()=>{o.destroyed()||o.fit(void 0,32)}),()=>o.destroy()},[l,i]),y.jsx("div",{ref:n,className:"wk-know-graph","data-testid":"knowledge-graph-canvas",role:"img","aria-label":"The knowledge map: sources, tables, repositories, code, data shapes, and trackers with the projects and repositories they are tracked in"})}export{E as KnowledgeGraph,p as NAMED_RELS};
1
+ import{r as c,a as t,c as k,j as y,f as m}from"./index-Dr-4__b5.js";k.use(m);const w={source:"--status-gate",table:"--accent-dim",shape:"--accent",code:"--status-run",repo:"--ink-muted",knowledge:"--ink-muted",tracker:"--ink-high",project:"--kn-project",issue:"--kn-issue",run:"--kn-run",pr:"--kn-pr"},b={source:"round-rectangle",table:"rectangle",shape:"diamond",code:"ellipse",repo:"hexagon",knowledge:"triangle",tracker:"tag",project:"barrel",issue:"round-pentagon",run:"cut-rectangle",pr:"rhomboid"},f={source:34,table:24,shape:26,code:22,repo:30,knowledge:18,tracker:30,project:36,issue:22,run:24,pr:24},p=new Set(["describes","joins","governed_by","measures","tracked_in","addresses","closes"]);function E({nodes:l,edges:i,onSelect:d}){const n=c.useRef(null),a=c.useRef(d);return a.current=d,c.useEffect(()=>{if(n.current===null)return;const s=new Map(l.map((e,r)=>[e.key,`n${r}`])),u=t("--ink-high"),g=t("--ink-dim"),h=[...l.map(e=>({group:"nodes",data:{id:s.get(e.key),label:e.label,color:t(w[e.kind]),shape:b[e.kind],size:f[e.kind],kind:e.kind,raw:e}})),...i.filter(e=>s.has(e.from)&&s.has(e.to)).map((e,r)=>({group:"edges",data:{id:`e${r}`,source:s.get(e.from),target:s.get(e.to),rel:e.rel,label:p.has(e.rel)?e.rel.replace("_"," "):""},classes:p.has(e.rel)?`typed rel-${e.rel}`:"quiet"}))],o=k({container:n.current,elements:h,style:[{selector:"node",style:{"background-color":"data(color)",shape:"data(shape)",width:"data(size)",height:"data(size)",label:"data(label)","font-size":11,"font-family":"ui-sans-serif, system-ui, sans-serif",color:u,"text-valign":"bottom","text-halign":"center","text-margin-y":4,"text-max-width":"140px","text-wrap":"ellipsis","text-background-color":t("--surface-base"),"text-background-opacity":.85,"text-background-padding":"2px"}},{selector:"node:selected",style:{"border-width":3,"border-color":t("--accent")}},{selector:"edge",style:{width:1,"curve-style":"bezier","line-color":g,"target-arrow-color":g,"target-arrow-shape":"none",opacity:.45}},{selector:"edge.typed",style:{width:2,opacity:.95,"target-arrow-shape":"triangle","arrow-scale":.8,label:"data(label)","font-size":10,color:u,"text-rotation":"autorotate","text-background-color":t("--surface-base"),"text-background-opacity":.9,"text-background-padding":"2px"}},{selector:"edge.rel-joins",style:{"line-color":t("--accent"),"target-arrow-color":t("--accent"),"line-style":"solid"}},{selector:"edge.rel-describes",style:{"line-color":t("--status-run"),"target-arrow-color":t("--status-run"),"line-style":"dashed"}},{selector:"edge.rel-governed_by",style:{"line-color":t("--status-gate"),"target-arrow-color":t("--status-gate"),"line-style":"dotted",width:3}},{selector:"edge.rel-tracked_in",style:{"line-color":t("--ink-muted"),"target-arrow-color":t("--ink-muted"),"line-style":"solid"}},{selector:"edge.rel-addresses, edge.rel-closes",style:{"line-color":t("--status-warn"),"target-arrow-color":t("--status-warn"),"line-style":"dashed"}}],layout:{name:"fcose",animate:!1,randomize:!0,quality:"default",idealEdgeLength:140,nodeRepulsion:2e4,numIter:2500,nodeSeparation:100},wheelSensitivity:.3,minZoom:.2,maxZoom:3});return o.on("tap","node",e=>{var r;return(r=a.current)==null?void 0:r.call(a,e.target.data("raw"))}),o.on("tap",e=>{var r;e.target===o&&((r=a.current)==null||r.call(a,null))}),o.ready(()=>{o.destroyed()||o.fit(void 0,32)}),()=>o.destroy()},[l,i]),y.jsx("div",{ref:n,className:"wk-know-graph","data-testid":"knowledge-graph-canvas",role:"img","aria-label":"The knowledge map: sources, tables, repositories, code, data shapes, and trackers with the projects and repositories they are tracked in"})}export{E as KnowledgeGraph,p as NAMED_RELS};