import {C,screen,rect,text,label,icon,line,card,metric,pill,button,tabs,table,chart,progress,aiNote,codeBlock,rowList,field,frame,mark} from './design-lib.mjs';
export function details(){
for(const [id,title,sub,rows,code] of [
['resource-detail','checkout / Resource detail','eu-prod-01 / commerce · Kubernetes resource',['Kind|Deployment','API version|apps/v1','Namespace|commerce','Owner|commerce stack','Revision|1842','Last synced|12 seconds ago'],['apiVersion: apps/v1','kind: Deployment','metadata:','  name: checkout','  namespace: commerce','spec:','  replicas: 4','  selector:','    matchLabels:','      app: checkout']],
['pod-detail','checkout-7df8 / Pod','eu-prod-01 / commerce · Ready',['Node|worker-01','Ready|1 / 1 containers','Restart count|0','Image|checkout:v2.8.4','IP|10.42.3.28','QoS|Burstable'],['10:23:02 INFO  Server started on :8080','10:23:03 INFO  Readiness probe passed','10:23:04 INFO  POST /checkout 200 182ms','10:23:05 INFO  GET /healthz 200 2ms','','Container: checkout','Previous container: unavailable','Stream state: Live']],
['node-detail','worker-01 / Node','eu-prod-01 · General worker pool',['Status|Ready','Instance|4 vCPU / 16 GiB','Provider|Hetzner','Zone|Helsinki','Pods|24 / 110','Agent|Connected'],['conditions:','  Ready: "True"','  MemoryPressure: "False"','  DiskPressure: "False"','  PIDPressure: "False"','taints: []','labels:','  workload: general','  zone: hel1']],
])screen(id,title,'05 / Infrastructure','Infrastructure',()=>{tabs(256,188,1152,['Overview','Events','Logs','YAML','Dependencies','History']);card(256,254,382,643,'Resource metadata','Identity and ownership stay visible.',()=>{rows.forEach((s,i)=>{const[a,b]=s.split('|');text(22,90+i*65,a,12,C.muted);text(145,90+i*65,b,13,C.ink,500,213);});button(22,565,'Investigate with Ankra',{w:338,target:'ai-investigation',icon:'spark'});});codeBlock(660,254,748,429,code,{title:id==='pod-detail'?'Container logs':'Resource specification'});aiNote(660,707,748,'Related context','Metrics, events, operation history, dependencies, and security findings are linked to this exact resource.',{h:169,target:'ai-investigation'});},{subtitle:sub});
screen('registry-detail','Northstar charts / Registry','04 / Applications & delivery','Stacks & catalog',()=>{tabs(256,188,1152,['Charts','Index history','Credentials','Exclusions']);metric(256,254,369,'Indexed charts','24','Last sync: 12 minutes ago');metric(647,254,369,'Registry type','OCI','Authenticated connection');metric(1038,254,370,'Excluded charts','2','Organisation overrides');card(256,405,1152,421,'Available charts','Version selection and registry provenance are preserved.',()=>{table(22,89,1108,['CHART','LATEST VERSION','VERSIONS','USED IN','STATUS'],[['postgresql','1.4.2','12','8 clusters',{text:'Indexed',kind:'green'}],['redis','3.2.1','18','6 clusters',{text:'Indexed',kind:'green'}],['web-service','2.1.0','8','12 clusters',{text:'Indexed',kind:'green'}]],{rowH:80,targets:Array(3).fill('catalog-detail')});});},{subtitle:'Chart discovery, registry credentials, sync results, and exclusion rules.'});
screen('condition-detail','Missing resource limits','03 / Intelligence','Intelligence',()=>{pill(256,192,'Open','amber');text(351,199,'eu-staging-01 · 4 occurrences · first seen 2 days ago',12,C.muted);card(256,254,745,281,'Observation','A persistent gap detected across repeated checks.',()=>{text(22,87,'Four deployments do not declare memory limits.\nAn unbounded workload can affect other services on the node.',18,C.ink,500,699);text(22,163,'Affected: analytics-worker, report-api, scheduler, job-runner',13,C.muted,400,699);text(22,213,'Evidence: Kubernetes specification · synced 12 seconds ago',12,C.green,500,699);});card(1023,254,385,416,'Triage',null,()=>{field(22,86,339,'Owner','Platform team',{select:true});field(22,185,339,'Decision','Prepare remediation plan',{select:true});button(22,313,'Create a task',{w:340,target:'task-detail',icon:'plus'});});card(256,559,745,350,'Occurrence history',null,()=>{table(22,84,700,['SEEN','CHECK','RESULT'],[['Today · 09:00','Nightly auditor','Still present'],['Yesterday · 09:00','Nightly auditor','Still present'],['5 Sep · 09:00','Nightly auditor','First detected']],{widths:[230,229,241],rowH:64});});},{subtitle:'Deduplicated conditions retain history, evidence, and a review decision.'});
screen('cost-compare','Compare cluster configurations','07 / Security & cost','Cost',()=>{tabs(256,188,1152,['Current vs proposed','Provider comparison','Assumptions']);[['Current configuration','6 × general workers','€1,260 / month','12% average CPU','No change'],['Proposed configuration','3–6 autoscaling workers','€840 / month','24% expected average CPU','€420 potential saving']].forEach(([a,b,c,d,e],i)=>card(256+i*587,254,565,537,a,null,()=>{pill(23,78,i?'Proposed':'Current',i?'green':'neutral');text(23,134,b,24,C.ink,600,518);text(23,194,c,31,C.ink,600,518);text(23,258,d,15,C.muted,400,518);line(23,313,519);text(23,348,e,20,i?C.green:C.muted,600,518);text(23,398,'Same region, storage, and network assumptions.\nProvider list pricing, excluding platform subscription.',12,C.muted,400,518);if(i)button(23,464,'Review proposed plan',{w:236,target:'ai-plan',icon:'arrow'});}));aiNote(256,815,1152,'Make the comparison fair','Show currency, pricing date, utilization window, coverage, and excluded costs. A forecast is not a guaranteed invoice.',{h:101,target:null});},{subtitle:'Comparable costs, explicit assumptions, and operational tradeoffs.'});
screen('billing-plan','Subscription plan','08 / Organisation & account','Organisation',()=>{card(256,193,1152,196,'Your workspace plan','Illustrative subscription design; real entitlements and prices come from billing.',()=>{text(22,90,'Team',35,C.ink,600,699);pill(989,92,'Current plan','green');text(22,149,'Platform capacity, collaboration, and operating features for Northstar.',15,C.muted,400,1000);});card(256,414,745,469,'Plan includes',null,()=>{rowList(22,85,698,[{title:'Shared operating workspace',detail:'Applications, infrastructure, and team collaboration'},{title:'AI workflows and governance',detail:'Agents, plans, approval policies, and usage visibility'},{title:'Audit and access controls',detail:'Roles, service tokens, and durable operation history'},{title:'Support and billing visibility',detail:'Invoices, usage reporting, and billing contacts'}]);});card(1023,414,385,333,'Manage subscription',null,()=>{text(22,81,'Review the final price, effective date, and feature impact before changing a subscription.',16,C.muted,400,340);button(22,245,'Review plan options',{w:340,kind:'secondary',target:'billing'});});},{subtitle:'Commercial terms are explicit and separate from cloud-provider costs.'});
screen('backup-restore','Review database restore','08 / Organisation & account','Organisation',()=>{rect(256,192,1152,83,C.amberSoft,10);icon('alert',279,217,22,C.amber);text(319,211,'Choose a new target or review the overwrite impact.',20,C.amber,600,1060);text(319,246,'Restoring production data is a high-impact action and requires explicit approval.',12,C.muted,400,1060);card(256,302,746,599,'Restore point','commerce database · backup from 7 Sep 02:04 UTC',()=>{field(23,87,699,'Destination mode','Restore to a new database',{select:true});field(23,190,338,'Target cluster','eu-staging-01',{select:true});field(384,190,338,'Database name','commerce-restored');field(23,294,338,'Backup integrity','Checksum verified');field(384,294,338,'Encryption key','Available · organisation key');text(23,408,'Verification after restore',16,C.ink,600);text(23,451,'Connection test · schema checks · application smoke test',13,C.muted,400,698);button(23,532,'Review restore operation',{w:253,target:'operation-detail',icon:'arrow'});});aiNote(1024,302,384,'Recovery evidence','Record backup source, target, approval, execution logs, and verification. A successful restore command is not the final health check.',{h:212,target:null});},{subtitle:'Restore points, impact, and validation are visible before recovery begins.'});
screen('support-detail','Support request #214','08 / Organisation & account','Organisation',()=>{pill(256,191,'In progress','blue');text(392,198,'Technical · eu-prod-01 · assigned to Ankra support',12,C.muted);card(256,254,746,654,'Cluster networking question','Opened today · Alex Morgan',()=>{text(22,86,'Alex Morgan',14,C.ink,600);text(22,123,'We need help checking connectivity between two services\nafter a network-policy update.',16,C.muted,400,699);line(22,211,700);text(22,242,'Ankra support',14,C.green,600);text(22,280,'The attached policy and event context are useful. We are\nreviewing the route and will follow up on this request.',16,C.muted,400,699);rect(22,424,700,109,C.canvas,8,C.line);text(41,444,'Write a reply…',14,C.subtle,400,660);button(22,571,'Send reply',{w:157,target:'support-detail'});});card(1024,254,384,361,'Attached context',null,()=>{rowList(22,85,337,[{title:'Cluster',detail:'eu-prod-01 · Production',icon:'server'},{title:'Policy diff',detail:'Redacted configuration attachment',icon:'file'},{title:'Event window',detail:'10:00–10:30 UTC',icon:'clock'}]);});},{subtitle:'A continuous conversation with reviewable technical context.'});
frame('compliance-report','Export / Security assessment','07 / Security & cost',()=>{rect(0,0,1440,1000,C.paper);mark(59,53,38,C.green);text(116,56,'ankra',34,C.ink,600);label(1042,72,'Assessment / September 2026');line(59,131,1319);text(59,177,'Northstar\nSecurity assessment',58,C.ink,600,1269,{lineHeight:70});text(61,350,'Prepared 7 September 2026 · Scope: Production fleet\nScanner coverage: 11 of 12 clusters fresh · 1 stale',16,C.muted,400,1290);metric(60,449,416,'Controls passed','184 / 201','Current assessment scope');metric(510,449,416,'Needs remediation','12','5 high-priority controls','amber');metric(960,449,416,'Not assessed','5','Evidence unavailable','amber');text(61,630,'Assessment notes',22,C.ink,600);text(61,684,'This report summarizes observed control results and supporting evidence. It is not a certification.\nUnscanned and stale systems remain visible in coverage; accepted risks retain an owner and expiry.',17,C.muted,400,1275);line(59,876,1319);text(61,908,'CONFIDENTIAL · NORTHSTAR WORKSPACE · ILLUSTRATIVE DATA',11,C.muted,600);text(1265,908,'01 / 01',12,C.muted);},{kind:'report'});
frame('sign-in','Sign in / Account access','09 / Responsive & states',()=>{rect(0,0,1440,1000,C.canvas);rect(0,0,684,1000,C.dark);mark(60,58,43,C.lime);text(122,62,'ankra',39,C.paper,600);text(59,298,'Operate\nwith clarity.',68,C.paper,500,571,{lineHeight:77});text(63,504,'Your infrastructure.\nAn intelligent operating layer.',24,C.navMuted,400,550);text(63,891,'Secure access to your Ankra workspace.',14,C.navMuted,400,550);text(786,246,'Welcome back.',35,C.ink,600,541);text(788,309,'Sign in to your workspace.',15,C.muted,400,540);button(787,374,'Continue with GitHub',{kind:'secondary',w:540,h:47,icon:'git',target:'overview'});button(787,440,'Continue with SSO',{kind:'secondary',w:540,h:47,icon:'shield',target:'authentication'});field(787,529,540,'Work email','you@company.example');button(787,632,'Continue with email',{w:540,h:47,target:'mfa-challenge',icon:'arrow'});text(788,726,'New to Ankra? Create your workspace  →',13,C.green,500,538,{target:'onboarding'});text(788,900,'Privacy · Terms · Need help?',12,C.muted,400,538);},{description:'Branded authentication concept; implementation must respect the hosted identity provider and existing authentication methods.'});
frame('mfa-challenge','Two-factor / Verify sign-in','09 / Responsive & states',()=>{rect(0,0,1440,1000,C.canvas);mark(62,56,39,C.green);text(117,57,'ankra',36,C.ink,600);card(430,220,580,561,null,null,()=>{icon('shield',255,43,57,C.green);text(48,145,'Verify your sign-in',31,C.ink,600,482);text(48,205,'Enter the six-digit code from your authenticator app.',15,C.muted,400,482);for(let i=0;i<6;i++){rect(48+i*82,290,68,73,C.paper,8,i===0?C.green:C.line);text(73+i*82,308,i<3?'•':'',28,C.ink,600,36);}button(48,411,'Verify',{w:484,h:47,target:'overview'});text(48,489,'Use a passkey or recovery code instead  →',12,C.green,500,482,{target:'authentication'});});},{description:'Verification, enrollment, passkeys, and recovery follow existing account security workflows.'});
}
