gik-components 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +373 -0
  3. package/dist/agent-facing-DjAMQ4Ju.d.ts +110 -0
  4. package/dist/agent-facing.d.ts +8 -0
  5. package/dist/agent-facing.js +2 -0
  6. package/dist/agent-facing.js.map +1 -0
  7. package/dist/chunk-2I33SAGT.js +2 -0
  8. package/dist/chunk-2I33SAGT.js.map +1 -0
  9. package/dist/chunk-2XVVN3LX.js +7 -0
  10. package/dist/chunk-2XVVN3LX.js.map +1 -0
  11. package/dist/chunk-4BIHH7HT.js +2 -0
  12. package/dist/chunk-4BIHH7HT.js.map +1 -0
  13. package/dist/chunk-6JMFZS2Y.js +2 -0
  14. package/dist/chunk-6JMFZS2Y.js.map +1 -0
  15. package/dist/chunk-6TBEAKS7.js +2 -0
  16. package/dist/chunk-6TBEAKS7.js.map +1 -0
  17. package/dist/chunk-DMIV5ZI5.js +2 -0
  18. package/dist/chunk-DMIV5ZI5.js.map +1 -0
  19. package/dist/chunk-DNHCWSHQ.js +2 -0
  20. package/dist/chunk-DNHCWSHQ.js.map +1 -0
  21. package/dist/chunk-GL7PGK3G.js +2 -0
  22. package/dist/chunk-GL7PGK3G.js.map +1 -0
  23. package/dist/chunk-H6T3CCU5.js +2 -0
  24. package/dist/chunk-H6T3CCU5.js.map +1 -0
  25. package/dist/chunk-OFWGYY7S.js +2 -0
  26. package/dist/chunk-OFWGYY7S.js.map +1 -0
  27. package/dist/chunk-UP2OAMPY.js +2 -0
  28. package/dist/chunk-UP2OAMPY.js.map +1 -0
  29. package/dist/chunk-VR5CS5LA.js +2 -0
  30. package/dist/chunk-VR5CS5LA.js.map +1 -0
  31. package/dist/chunk-XA6FE7ZK.js +6 -0
  32. package/dist/chunk-XA6FE7ZK.js.map +1 -0
  33. package/dist/component-authoring-internal-DfFqqPhw.d.ts +40 -0
  34. package/dist/fluent.d.ts +103 -0
  35. package/dist/fluent.js +2 -0
  36. package/dist/fluent.js.map +1 -0
  37. package/dist/index.d.ts +139 -0
  38. package/dist/index.js +2 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/primitives.d.ts +440 -0
  41. package/dist/primitives.js +2 -0
  42. package/dist/primitives.js.map +1 -0
  43. package/dist/security.d.ts +39 -0
  44. package/dist/security.js +2 -0
  45. package/dist/security.js.map +1 -0
  46. package/dist/semantic.d.ts +147 -0
  47. package/dist/semantic.js +2 -0
  48. package/dist/semantic.js.map +1 -0
  49. package/dist/software.d.ts +44 -0
  50. package/dist/software.js +2 -0
  51. package/dist/software.js.map +1 -0
  52. package/package.json +83 -0
@@ -0,0 +1,2 @@
1
+ import{c as j}from"./chunk-VR5CS5LA.js";import{l as P,o as G}from"./chunk-H6T3CCU5.js";import{e as A,u as $,y as V}from"./chunk-OFWGYY7S.js";import{b as F,c as b,d as C,f as R,g as w,j as N,k as g,l as d,m as k,n as o}from"./chunk-XA6FE7ZK.js";import{runDeclarativeValidators as Y}from"@gik-ai/evaluators";import{Text as h,makeStyles as O,tokens as m}from"@fluentui/react-components";import{runDeclarativeValidators as q}from"@gik-ai/evaluators";import{Fragment as Q,jsx as l,jsxs as y}from"react/jsx-runtime";var M=["canvas","diagram","relations","gantt","text"],x=["accent","danger","warning","success","neutral"],H={$schema:"http://json-schema.org/draft-07/schema#",type:"object",additionalProperties:!1,required:["graph","spec"],properties:{...w,graph:{type:"object",additionalProperties:!1,required:["entities","relationships"],properties:{entities:{type:"array",items:{type:"object"}},relationships:{type:"array",items:{type:"object"}}}},spec:{type:"object",additionalProperties:!1,required:["entityFields","relationshipFields"],properties:{title:{type:"string"},description:{type:"string"},emptyText:{type:"string"},entityFields:{type:"object",additionalProperties:!1,required:["id","label"],properties:{id:{type:"string",minLength:1},label:{type:"string",minLength:1},detail:{type:"string",minLength:1},type:{type:"string",minLength:1},tone:{type:"string",minLength:1}}},relationshipFields:{type:"object",additionalProperties:!1,required:["id","source","target"],properties:{id:{type:"string",minLength:1},source:{type:"string",minLength:1},target:{type:"string",minLength:1},label:{type:"string",minLength:1},start:{type:"string",minLength:1},end:{type:"string",minLength:1}}},ganttScale:{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["datetime","linear"]},hourFormat:{enum:["24","12"]},displayPrefix:{type:"string"},minimum:{type:"number"},maximum:{type:"number"},tickStep:{type:"number",exclusiveMinimum:0},showSeconds:{type:"boolean"},showTimeZone:{type:"boolean"}}},toneMap:{type:"object",additionalProperties:{enum:x}}}},variant:{enum:M},stateKey:{type:"string",minLength:1},canvasState:{type:["object","null"]},height:{type:["number","string"]},miniMap:{type:"boolean"},controls:{type:"boolean"},background:{type:"boolean"},ariaLabel:{type:"string",minLength:1}},allOf:[{if:{properties:{variant:{const:"gantt"}},required:["variant"]},then:{properties:{spec:{properties:{relationshipFields:{required:["start","end"]}}}}}}]},z=O({root:{display:"grid",gap:m.spacingVerticalM,minWidth:0},header:{display:"grid",gap:m.spacingVerticalXXS},description:{color:m.colorNeutralForeground3},textList:{display:"grid",gap:m.spacingVerticalS,margin:0,paddingLeft:m.spacingHorizontalXL},textItem:{display:"grid",gap:m.spacingVerticalXXS},textTimestamp:{color:m.colorNeutralForeground3,fontVariantNumeric:"tabular-nums"},textPredicate:{color:m.colorNeutralForeground3}});function Z(t,e){return!e.title&&!e.description?null:y("div",{className:t.header,children:[e.title?l(h,{weight:"semibold",size:500,children:e.title}):null,e.description?l(h,{className:t.description,children:e.description}):null]})}function D(t,e){return new Map(d(t.entities).map(n=>[o(n,e.entityFields.id),o(n,e.entityFields.label)]))}function X(t,e,n){if(e.ganttScale?.kind==="linear"||!e.relationshipFields.start)return null;let r=k(t,e.relationshipFields.start);if(typeof r!="string"||!Number.isFinite(Date.parse(r)))return null;let i={hourFormat:e.ganttScale?.hourFormat,showSeconds:e.ganttScale?.showSeconds,showTimeZone:e.ganttScale?.showTimeZone},a=e.relationshipFields.end?k(t,e.relationshipFields.end):void 0,s=typeof a=="string"&&Number.isFinite(Date.parse(a));return y(h,{className:n.textTimestamp,size:200,children:[l("time",{dateTime:r,children:A(r,i)}),s?y(Q,{children:[" - ",l("time",{dateTime:a,children:A(a,i)})]}):null]})}function W(t,e,n,r){let i=D(e,n);return y("section",{...N(t,r.root),"aria-label":t.props.ariaLabel??n.title??"Attack path text",children:[Z(r,n),l("ol",{className:r.textList,children:d(e.relationships).map((a,s)=>{let f=i.get(o(a,n.relationshipFields.source))??o(a,n.relationshipFields.source),p=i.get(o(a,n.relationshipFields.target))??o(a,n.relationshipFields.target),c=o(a,n.relationshipFields.label)||"related to";return y("li",{className:r.textItem,children:[y("span",{children:[l(h,{weight:"semibold",children:f})," ",l(h,{className:r.textPredicate,children:c})," ",l(h,{weight:"semibold",children:p})]}),X(a,n,r)]},o(a,n.relationshipFields.id)||s)})})]})}function U(t,e,n){let r=D(e,n),i=n.relationshipFields.start??"",a=n.relationshipFields.end??"",s=d(e.relationships).map((p,c)=>({id:o(p,n.relationshipFields.id)||String(c),label:`${r.get(o(p,n.relationshipFields.source))??o(p,n.relationshipFields.source)} ${o(p,n.relationshipFields.label)||"related to"} ${r.get(o(p,n.relationshipFields.target))??o(p,n.relationshipFields.target)}`,start:k(p,i),end:k(p,a)})),f={...t,capability:"primitive:gantt",props:{items:s,variant:"standard",spec:{...n.title?{title:n.title}:{},...n.description?{description:n.description}:{},...n.emptyText?{emptyText:n.emptyText}:{},...n.ganttScale?{scale:n.ganttScale}:{},fields:{id:"id",label:"label",start:"start",end:"end"}},...typeof t.props.className=="string"?{className:t.props.className}:{},...t.props.style?{style:t.props.style}:{}}};return l(P,{node:f,emit:()=>{},children:void 0})}function B(t,e){let n=g(t),r=d(n.entities),i=d(n.relationships);return{nodes:r.map(a=>{let s=o(a,e.entityFields.tone);return{id:o(a,e.entityFields.id),label:o(a,e.entityFields.label),detail:o(a,e.entityFields.detail)||void 0,category:o(a,e.entityFields.type)||void 0,tone:e.toneMap?.[s]??"neutral"}}),edges:i.map(a=>({id:o(a,e.relationshipFields.id),source:o(a,e.relationshipFields.source),target:o(a,e.relationshipFields.target),label:o(a,e.relationshipFields.label)||void 0,directed:!0}))}}var K=({node:t,emit:e})=>{let n=z(),r=g(t.props.graph),i=t.props.spec,a=B(r,i);if(a.nodes.length===0)return l("p",{children:i.emptyText??"No attack graph data available."});let s=M.includes(t.props.variant)?t.props.variant:"canvas";if(s==="text")return W(t,r,i,n);if(s==="gantt")return U(t,r,i);if(s==="relations"){let f={...t,capability:"semantic:relationship-set",props:{graph:{entities:d(r.entities),relationships:d(r.relationships)},variant:"relations",spec:{...i.title?{title:i.title}:{},...i.description?{description:i.description}:{},...i.emptyText?{emptyText:i.emptyText}:{},entityFields:{id:i.entityFields.id,label:i.entityFields.label,...i.entityFields.detail?{detail:i.entityFields.detail}:{},...i.entityFields.tone?{tone:i.entityFields.tone}:{}},relationshipFields:{id:i.relationshipFields.id,source:i.relationshipFields.source,target:i.relationshipFields.target,...i.relationshipFields.label?{label:i.relationshipFields.label}:{}},toneMap:Object.fromEntries(Object.entries(i.toneMap??{}).map(([p,c])=>[p,c==="accent"?"central":c==="danger"||c==="warning"?"risk":c==="success"?"positive":"neutral"]))},...typeof t.props.className=="string"?{className:t.props.className}:{},...t.props.style?{style:t.props.style}:{}}};return l(j,{node:f,emit:e,children:void 0})}return l(V,{node:b(`${t.id}-graph`,"primitive:graph-diagram",{graph:a,variant:s==="canvas"?"canvas":"diagram",spec:{...i.title?{title:i.title}:{},...i.description?{description:i.description}:{},...i.emptyText?{emptyText:i.emptyText}:{},layout:"hierarchical"},stateKey:String(t.props.stateKey??t.id),canvasState:t.props.canvasState??null,height:t.props.height??"34rem",miniMap:t.props.miniMap??!0,controls:t.props.controls??!0,background:t.props.background??!0,...typeof t.props.className=="string"?{className:t.props.className}:{},...t.props.style?{style:t.props.style}:{}}),emit:e,children:void 0})};function S(){return H}function L(t){let e=q([{kind:"ajv-schema",schema:S(),message:"Invalid attack-path renderer props",code:"attack-path-renderer-schema"},{kind:"jsonata",expr:"($field := data.spec.entityFields.id; $ids := data.graph.entities.$lookup($, $field); $count($ids) = $count($distinct($ids)))",message:"Attack graph entity ids must be unique",code:"attack-graph-unique-entity-id"},{kind:"jsonata",expr:"($entityField := data.spec.entityFields.id; $sourceField := data.spec.relationshipFields.source; $targetField := data.spec.relationshipFields.target; $ids := data.graph.entities.$lookup($, $entityField); $count(data.graph.relationships[$lookup($, $sourceField) in $ids and $lookup($, $targetField) in $ids]) = $count(data.graph.relationships))",message:"Attack graph relationships must reference declared entity ids",code:"attack-graph-relationship-reference"}],t),n=g(t);if(!e.ok||n.variant!=="gantt")return e;let r=g(n.spec),i=g(r.relationshipFields),a=g(n.graph),s=G({items:a.relationships,spec:{fields:{id:i.id,label:i.label??i.source,start:i.start,end:i.end},...r.ganttScale?{scale:r.ganttScale}:{}}});return e.ok=s.ok,e.errors.push(...s.errors),e.warnings.push(...s.warnings),e}import{jsx as at}from"react/jsx-runtime";var I=["canvas","diagram","relations","gantt","text"],_=(()=>{let t=JSON.parse(JSON.stringify(S()));return t.properties.variant={enum:I},t.properties.spec.properties.density={enum:["comfortable","compact"]},t})();function J(t){let e={...t.spec??{}};return delete e.density,{...t,variant:typeof t.variant=="string"?t.variant:"canvas",spec:e}}var v=({node:t,emit:e})=>at(K,{node:b(`${t.id}-attack-graph`,"security:attack-path",J(t.props)),emit:e,children:void 0}),tt={capability:"security:attack-path",summary:"Presents directed adversarial activity as a canvas, diagram, relations, temporal intervals, or text.",dataProp:"graph",events:["node","edge","layout"],eventContracts:$.eventContracts,semanticTokens:x,defaultVariant:"canvas",variants:I.map(t=>({value:t,summary:`${t} attack-path presentation.`,useWhen:[`The ${t} presentation best matches the investigation surface`]})),authoring:{useWhen:["Directed adversarial activity connects security entities"],avoidWhen:["The relationships are not adversarial; use semantic:relationship-set","Only event chronology matters"],rules:["Preserve stable entity and relationship identities","Use relationship start and end fields for gantt","Put density and canvas mechanics in spec or root props"]}};function et(){return _}function it(t){let e=Y([{kind:"ajv-schema",schema:_,message:"Invalid security:attack-path props",code:"security-attack-path-schema"}],t);return e.ok?L(J(t)):e}function nt(){return C("security:attack-path",{variant:"canvas",stateKey:"attack-path-trial",graph:{entities:[{id:"attacker",label:"Threat actor",detail:"Observed source",type:"Actor",status:"observed"},{id:"identity",label:"Admin identity",detail:"Compromised principal",type:"Identity",status:"compromised"},{id:"mailbox",label:"Finance mailbox",detail:"Accessed resource",type:"Mailbox",status:"affected"}],relationships:[{id:"authenticate",sourceId:"attacker",targetId:"identity",label:"authenticated as",start:"2026-07-17T23:09:23Z",end:"2026-07-17T23:09:27Z"},{id:"access",sourceId:"identity",targetId:"mailbox",label:"accessed",start:"2026-07-17T23:09:25Z",end:"2026-07-17T23:09:34Z"}]},spec:{title:"Attack path",density:"comfortable",entityFields:{id:"id",label:"label",detail:"detail",type:"type",tone:"status"},relationshipFields:{id:"id",source:"sourceId",target:"targetId",label:"label",start:"start",end:"end"},toneMap:{observed:"neutral",compromised:"danger",affected:"warning"}}})}var E=F({description:tt,version:"1.0.0",component:v,getSchema:et,validate:it,materializeTrial:nt});var Tt={"attack-path":v},T={"attack-path":E},Ft=Object.fromEntries(Object.entries(T).map(([t,e])=>[t,{propsSchema:e.getSchema(),dataProp:e.dataProp,emits:[...e.events]}]));var u=R({definitions:T,kind:"security",toolKind:"Security"}),Nt=()=>u.list(),Pt=t=>u.describe(t),Gt=(t,e)=>u.validate(t,e),$t=u.materialize,Vt=(t,e)=>u.preflight(t,e),jt=u.instructions,rt=t=>u.createTools(t),Mt=t=>u.getKit(t),Dt=rt();export{I as a,v as b,et as c,it as d,nt as e,E as f,Tt as g,T as h,Ft as i,Nt as j,Pt as k,Gt as l,$t as m,Vt as n,jt as o,rt as p,Mt as q,Dt as r};
2
+ //# sourceMappingURL=chunk-6JMFZS2Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/security/attack-path/AttackPath.tsx","../src/security/attack-graph/AttackGraph.tsx","../src/security/registry.ts","../src/security/authoring.ts"],"sourcesContent":["import React from \"react\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { infiniteCanvasDefinition } from \"../../primitives/infinite-canvas\";\nimport { componentNode, defineComponent, trialNode, type ComponentDescription, type ComponentValidationReport } from \"../../shared/definition\";\nimport { AttackGraph, ATTACK_GRAPH_SEMANTIC_TOKENS, getAttackGraphSchema, validateAttackGraph } from \"../attack-graph\";\n\nexport const ATTACK_PATH_VARIANTS = [\"canvas\", \"diagram\", \"relations\", \"gantt\", \"text\"] as const;\n\nconst schema = (() => {\n const value = JSON.parse(JSON.stringify(getAttackGraphSchema())) as Record<string, any>;\n value.properties.variant = { enum: ATTACK_PATH_VARIANTS };\n value.properties.spec.properties.density = { enum: [\"comfortable\", \"compact\"] };\n return value as Record<string, unknown>;\n})();\n\nfunction delegatedProps(props: Record<string, Json>): Record<string, Json> {\n const spec = { ...((props.spec ?? {}) as Record<string, Json>) };\n delete spec.density;\n return { ...props, variant: typeof props.variant === \"string\" ? props.variant : \"canvas\", spec };\n}\n\nexport const AttackPath: ProjectionView = ({ node, emit }) => <AttackGraph node={componentNode(`${node.id}-attack-graph`, \"security:attack-path\", delegatedProps(node.props))} emit={emit} children={undefined} />;\n\nconst description: ComponentDescription = {\n capability: \"security:attack-path\", summary: \"Presents directed adversarial activity as a canvas, diagram, relations, temporal intervals, or text.\", dataProp: \"graph\", events: [\"node\", \"edge\", \"layout\"], eventContracts: infiniteCanvasDefinition.eventContracts, semanticTokens: ATTACK_GRAPH_SEMANTIC_TOKENS, defaultVariant: \"canvas\",\n variants: ATTACK_PATH_VARIANTS.map((value) => ({ value, summary: `${value} attack-path presentation.`, useWhen: [`The ${value} presentation best matches the investigation surface`] })),\n authoring: { useWhen: [\"Directed adversarial activity connects security entities\"], avoidWhen: [\"The relationships are not adversarial; use semantic:relationship-set\", \"Only event chronology matters\"], rules: [\"Preserve stable entity and relationship identities\", \"Use relationship start and end fields for gantt\", \"Put density and canvas mechanics in spec or root props\"] },\n};\n\nexport function getAttackPathSchema(): Record<string, unknown> { return schema; }\nexport function validateAttackPath(props: unknown): ComponentValidationReport {\n const report = runDeclarativeValidators([{ kind: \"ajv-schema\", schema, message: \"Invalid security:attack-path props\", code: \"security-attack-path-schema\" }], props as Json);\n if (!report.ok) return report;\n return validateAttackGraph(delegatedProps(props as Record<string, Json>));\n}\nexport function materializeAttackPathTrial() { return trialNode(\"security:attack-path\", { variant: \"canvas\", stateKey: \"attack-path-trial\", graph: { entities: [{ id: \"attacker\", label: \"Threat actor\", detail: \"Observed source\", type: \"Actor\", status: \"observed\" }, { id: \"identity\", label: \"Admin identity\", detail: \"Compromised principal\", type: \"Identity\", status: \"compromised\" }, { id: \"mailbox\", label: \"Finance mailbox\", detail: \"Accessed resource\", type: \"Mailbox\", status: \"affected\" }], relationships: [{ id: \"authenticate\", sourceId: \"attacker\", targetId: \"identity\", label: \"authenticated as\", start: \"2026-07-17T23:09:23Z\", end: \"2026-07-17T23:09:27Z\" }, { id: \"access\", sourceId: \"identity\", targetId: \"mailbox\", label: \"accessed\", start: \"2026-07-17T23:09:25Z\", end: \"2026-07-17T23:09:34Z\" }] }, spec: { title: \"Attack path\", density: \"comfortable\", entityFields: { id: \"id\", label: \"label\", detail: \"detail\", type: \"type\", tone: \"status\" }, relationshipFields: { id: \"id\", source: \"sourceId\", target: \"targetId\", label: \"label\", start: \"start\", end: \"end\" }, toneMap: { observed: \"neutral\", compromised: \"danger\", affected: \"warning\" } } }); }\nexport const attackPathDefinition = defineComponent({ description, version: \"1.0.0\", component: AttackPath, getSchema: getAttackPathSchema, validate: validateAttackPath, materializeTrial: materializeAttackPathTrial });","import React from \"react\";\nimport { Text, makeStyles, tokens } from \"@fluentui/react-components\";\nimport type { Json, ResolvedNode } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { GraphDiagram, buildGraphCanvasModel, type GraphDiagramModel } from \"../../primitives/graph-diagram\";\nimport { formatTimestamp } from \"../../primitives/datetime\";\nimport { Gantt, validateGantt, type GanttScale } from \"../../primitives/gantt\";\nimport { RelationshipSet } from \"../../semantic/relationship-set\";\nimport { componentNode, type ComponentValidationReport } from \"../../shared/definition\";\nimport { asRecord, componentRootProps, componentStylePropsSchema, readPath, records, textAt } from \"../../shared/component\";\n\nexport const ATTACK_GRAPH_VARIANTS = [\"canvas\", \"diagram\", \"relations\", \"gantt\", \"text\"] as const;\nexport const ATTACK_GRAPH_SEMANTIC_TOKENS = [\"accent\", \"danger\", \"warning\", \"success\", \"neutral\"] as const;\ntype AttackGraphToken = typeof ATTACK_GRAPH_SEMANTIC_TOKENS[number];\n\nexport interface AttackGraphSpec {\n title?: string;\n description?: string;\n emptyText?: string;\n entityFields: {\n id: string;\n label: string;\n detail?: string;\n type?: string;\n tone?: string;\n };\n relationshipFields: {\n id: string;\n source: string;\n target: string;\n label?: string;\n start?: string;\n end?: string;\n };\n ganttScale?: GanttScale;\n toneMap?: Record<string, AttackGraphToken>;\n}\n\nexport interface AttackGraphData {\n entities: Record<string, unknown>[];\n relationships: Record<string, unknown>[];\n}\n\nconst schema = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n additionalProperties: false,\n required: [\"graph\", \"spec\"],\n properties: {\n ...componentStylePropsSchema,\n graph: {\n type: \"object\",\n additionalProperties: false,\n required: [\"entities\", \"relationships\"],\n properties: {\n entities: { type: \"array\", items: { type: \"object\" } },\n relationships: { type: \"array\", items: { type: \"object\" } },\n },\n },\n spec: {\n type: \"object\",\n additionalProperties: false,\n required: [\"entityFields\", \"relationshipFields\"],\n properties: {\n title: { type: \"string\" },\n description: { type: \"string\" },\n emptyText: { type: \"string\" },\n entityFields: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"label\"],\n properties: {\n id: { type: \"string\", minLength: 1 },\n label: { type: \"string\", minLength: 1 },\n detail: { type: \"string\", minLength: 1 },\n type: { type: \"string\", minLength: 1 },\n tone: { type: \"string\", minLength: 1 },\n },\n },\n relationshipFields: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"source\", \"target\"],\n properties: {\n id: { type: \"string\", minLength: 1 },\n source: { type: \"string\", minLength: 1 },\n target: { type: \"string\", minLength: 1 },\n label: { type: \"string\", minLength: 1 },\n start: { type: \"string\", minLength: 1 },\n end: { type: \"string\", minLength: 1 },\n },\n },\n ganttScale: {\n type: \"object\",\n additionalProperties: false,\n required: [\"kind\"],\n properties: {\n kind: { enum: [\"datetime\", \"linear\"] },\n hourFormat: { enum: [\"24\", \"12\"] },\n displayPrefix: { type: \"string\" },\n minimum: { type: \"number\" },\n maximum: { type: \"number\" },\n tickStep: { type: \"number\", exclusiveMinimum: 0 },\n showSeconds: { type: \"boolean\" },\n showTimeZone: { type: \"boolean\" },\n },\n },\n toneMap: { type: \"object\", additionalProperties: { enum: ATTACK_GRAPH_SEMANTIC_TOKENS } },\n },\n },\n variant: { enum: ATTACK_GRAPH_VARIANTS },\n stateKey: { type: \"string\", minLength: 1 },\n canvasState: { type: [\"object\", \"null\"] },\n height: { type: [\"number\", \"string\"] },\n miniMap: { type: \"boolean\" },\n controls: { type: \"boolean\" },\n background: { type: \"boolean\" },\n ariaLabel: { type: \"string\", minLength: 1 },\n },\n allOf: [{\n if: { properties: { variant: { const: \"gantt\" } }, required: [\"variant\"] },\n then: { properties: { spec: { properties: { relationshipFields: { required: [\"start\", \"end\"] } } } } },\n }],\n} as const;\n\nconst useStyles = makeStyles({\n root: { display: \"grid\", gap: tokens.spacingVerticalM, minWidth: 0 },\n header: { display: \"grid\", gap: tokens.spacingVerticalXXS },\n description: { color: tokens.colorNeutralForeground3 },\n textList: { display: \"grid\", gap: tokens.spacingVerticalS, margin: 0, paddingLeft: tokens.spacingHorizontalXL },\n textItem: { display: \"grid\", gap: tokens.spacingVerticalXXS },\n textTimestamp: { color: tokens.colorNeutralForeground3, fontVariantNumeric: \"tabular-nums\" },\n textPredicate: { color: tokens.colorNeutralForeground3 },\n});\n\nfunction attackGraphHeader(styles: ReturnType<typeof useStyles>, spec: AttackGraphSpec) {\n if (!spec.title && !spec.description) return null;\n return <div className={styles.header}>{spec.title ? <Text weight=\"semibold\" size={500}>{spec.title}</Text> : null}{spec.description ? <Text className={styles.description}>{spec.description}</Text> : null}</div>;\n}\n\nfunction entityLabels(graph: Record<string, unknown>, spec: AttackGraphSpec): Map<string, string> {\n return new Map(records(graph.entities).map((entity) => [textAt(entity, spec.entityFields.id), textAt(entity, spec.entityFields.label)]));\n}\n\nfunction relationshipTimestamp(relationship: Record<string, unknown>, spec: AttackGraphSpec, styles: ReturnType<typeof useStyles>): React.ReactNode {\n if (spec.ganttScale?.kind === \"linear\" || !spec.relationshipFields.start) return null;\n const startValue = readPath(relationship, spec.relationshipFields.start);\n if (typeof startValue !== \"string\" || !Number.isFinite(Date.parse(startValue))) return null;\n const options = { hourFormat: spec.ganttScale?.hourFormat, showSeconds: spec.ganttScale?.showSeconds, showTimeZone: spec.ganttScale?.showTimeZone };\n const endValue = spec.relationshipFields.end ? readPath(relationship, spec.relationshipFields.end) : undefined;\n const hasEnd = typeof endValue === \"string\" && Number.isFinite(Date.parse(endValue));\n return <Text className={styles.textTimestamp} size={200}><time dateTime={startValue}>{formatTimestamp(startValue, options)}</time>{hasEnd ? <> - <time dateTime={endValue}>{formatTimestamp(endValue, options)}</time></> : null}</Text>;\n}\n\nfunction renderTextGraph(node: ResolvedNode, graph: Record<string, unknown>, spec: AttackGraphSpec, styles: ReturnType<typeof useStyles>) {\n const labels = entityLabels(graph, spec);\n return <section {...componentRootProps(node, styles.root)} aria-label={node.props.ariaLabel as string ?? spec.title ?? \"Attack path text\"}>\n {attackGraphHeader(styles, spec)}\n <ol className={styles.textList}>{records(graph.relationships).map((relationship, index) => {\n const source = labels.get(textAt(relationship, spec.relationshipFields.source)) ?? textAt(relationship, spec.relationshipFields.source);\n const target = labels.get(textAt(relationship, spec.relationshipFields.target)) ?? textAt(relationship, spec.relationshipFields.target);\n const predicate = textAt(relationship, spec.relationshipFields.label) || \"related to\";\n return <li className={styles.textItem} key={textAt(relationship, spec.relationshipFields.id) || index}><span><Text weight=\"semibold\">{source}</Text>{\" \"}<Text className={styles.textPredicate}>{predicate}</Text>{\" \"}<Text weight=\"semibold\">{target}</Text></span>{relationshipTimestamp(relationship, spec, styles)}</li>;\n })}</ol>\n </section>;\n}\n\nfunction renderGanttGraph(node: ResolvedNode, graph: Record<string, unknown>, spec: AttackGraphSpec) {\n const labels = entityLabels(graph, spec);\n const startField = spec.relationshipFields.start ?? \"\";\n const endField = spec.relationshipFields.end ?? \"\";\n const intervals = records(graph.relationships).map((relationship, index) => ({\n id: textAt(relationship, spec.relationshipFields.id) || String(index),\n label: `${labels.get(textAt(relationship, spec.relationshipFields.source)) ?? textAt(relationship, spec.relationshipFields.source)} ${textAt(relationship, spec.relationshipFields.label) || \"related to\"} ${labels.get(textAt(relationship, spec.relationshipFields.target)) ?? textAt(relationship, spec.relationshipFields.target)}`,\n start: readPath(relationship, startField),\n end: readPath(relationship, endField),\n }));\n const primitiveNode: ResolvedNode = {\n ...node,\n capability: \"primitive:gantt\",\n props: {\n items: intervals as unknown as Json,\n variant: \"standard\",\n spec: {\n ...(spec.title ? { title: spec.title } : {}),\n ...(spec.description ? { description: spec.description } : {}),\n ...(spec.emptyText ? { emptyText: spec.emptyText } : {}),\n ...(spec.ganttScale ? { scale: spec.ganttScale as unknown as Json } : {}),\n fields: { id: \"id\", label: \"label\", start: \"start\", end: \"end\" },\n },\n ...(typeof node.props.className === \"string\" ? { className: node.props.className } : {}),\n ...(node.props.style ? { style: node.props.style } : {}),\n },\n };\n return <Gantt node={primitiveNode} emit={() => undefined} children={undefined} />;\n}\n\nexport function buildAttackGraphModel(graphValue: unknown, spec: AttackGraphSpec): GraphDiagramModel {\n const graph = asRecord(graphValue);\n const entities = records(graph.entities);\n const relationships = records(graph.relationships);\n return { nodes: entities.map((entity) => {\n const toneValue = textAt(entity, spec.entityFields.tone);\n return {\n id: textAt(entity, spec.entityFields.id),\n label: textAt(entity, spec.entityFields.label),\n detail: textAt(entity, spec.entityFields.detail) || undefined,\n category: textAt(entity, spec.entityFields.type) || undefined,\n tone: spec.toneMap?.[toneValue] ?? \"neutral\",\n };\n }), edges: relationships.map((relationship) => ({ id: textAt(relationship, spec.relationshipFields.id), source: textAt(relationship, spec.relationshipFields.source), target: textAt(relationship, spec.relationshipFields.target), label: textAt(relationship, spec.relationshipFields.label) || undefined, directed: true })) };\n}\n\nexport function buildAttackGraphCanvasModel(graphValue: unknown, spec: AttackGraphSpec) {\n return buildGraphCanvasModel(buildAttackGraphModel(graphValue, spec));\n}\n\nexport const AttackGraph: ProjectionView = ({ node, emit }) => {\n const styles = useStyles();\n const graph = asRecord(node.props.graph);\n const spec = node.props.spec as unknown as AttackGraphSpec;\n const graphModel = buildAttackGraphModel(graph, spec);\n if (graphModel.nodes.length === 0) return <p>{spec.emptyText ?? \"No attack graph data available.\"}</p>;\n const variant = ATTACK_GRAPH_VARIANTS.includes(node.props.variant as typeof ATTACK_GRAPH_VARIANTS[number])\n ? node.props.variant as typeof ATTACK_GRAPH_VARIANTS[number]\n : \"canvas\";\n if (variant === \"text\") return renderTextGraph(node, graph, spec, styles);\n if (variant === \"gantt\") return renderGanttGraph(node, graph, spec);\n if (variant === \"relations\") {\n const relationshipSetNode: ResolvedNode = {\n ...node,\n capability: \"semantic:relationship-set\",\n props: {\n graph: {\n entities: records(graph.entities) as unknown as Json,\n relationships: records(graph.relationships) as unknown as Json,\n },\n variant: \"relations\",\n spec: {\n ...(spec.title ? { title: spec.title } : {}),\n ...(spec.description ? { description: spec.description } : {}),\n ...(spec.emptyText ? { emptyText: spec.emptyText } : {}),\n entityFields: {\n id: spec.entityFields.id,\n label: spec.entityFields.label,\n ...(spec.entityFields.detail ? { detail: spec.entityFields.detail } : {}),\n ...(spec.entityFields.tone ? { tone: spec.entityFields.tone } : {}),\n },\n relationshipFields: {\n id: spec.relationshipFields.id,\n source: spec.relationshipFields.source,\n target: spec.relationshipFields.target,\n ...(spec.relationshipFields.label ? { label: spec.relationshipFields.label } : {}),\n },\n toneMap: Object.fromEntries(Object.entries(spec.toneMap ?? {}).map(([value, token]) => [value, token === \"accent\" ? \"central\" : token === \"danger\" || token === \"warning\" ? \"risk\" : token === \"success\" ? \"positive\" : \"neutral\"])),\n },\n ...(typeof node.props.className === \"string\" ? { className: node.props.className } : {}),\n ...(node.props.style ? { style: node.props.style } : {}),\n },\n };\n return <RelationshipSet node={relationshipSetNode} emit={emit} children={undefined} />;\n }\n return <GraphDiagram node={componentNode(`${node.id}-graph`, \"primitive:graph-diagram\", {\n graph: graphModel as unknown as Json,\n variant: variant === \"canvas\" ? \"canvas\" : \"diagram\",\n spec: { ...(spec.title ? { title: spec.title } : {}), ...(spec.description ? { description: spec.description } : {}), ...(spec.emptyText ? { emptyText: spec.emptyText } : {}), layout: \"hierarchical\" },\n stateKey: String(node.props.stateKey ?? node.id), canvasState: (node.props.canvasState ?? null) as Json, height: node.props.height ?? \"34rem\", miniMap: node.props.miniMap ?? true, controls: node.props.controls ?? true, background: node.props.background ?? true,\n ...(typeof node.props.className === \"string\" ? { className: node.props.className } : {}), ...(node.props.style ? { style: node.props.style } : {}),\n })} emit={emit} children={undefined} />;\n};\n\nexport function getAttackGraphSchema(): Record<string, unknown> { return schema as unknown as Record<string, unknown>; }\nexport function validateAttackGraph(props: unknown): ComponentValidationReport {\n const report = runDeclarativeValidators([\n { kind: \"ajv-schema\", schema: getAttackGraphSchema(), message: \"Invalid attack-path renderer props\", code: \"attack-path-renderer-schema\" },\n { kind: \"jsonata\", expr: \"($field := data.spec.entityFields.id; $ids := data.graph.entities.$lookup($, $field); $count($ids) = $count($distinct($ids)))\", message: \"Attack graph entity ids must be unique\", code: \"attack-graph-unique-entity-id\" },\n { kind: \"jsonata\", expr: \"($entityField := data.spec.entityFields.id; $sourceField := data.spec.relationshipFields.source; $targetField := data.spec.relationshipFields.target; $ids := data.graph.entities.$lookup($, $entityField); $count(data.graph.relationships[$lookup($, $sourceField) in $ids and $lookup($, $targetField) in $ids]) = $count(data.graph.relationships))\", message: \"Attack graph relationships must reference declared entity ids\", code: \"attack-graph-relationship-reference\" },\n ], props as Json);\n const propsRecord = asRecord(props);\n if (!report.ok || propsRecord.variant !== \"gantt\") return report;\n const spec = asRecord(propsRecord.spec);\n const relationshipFields = asRecord(spec.relationshipFields);\n const graph = asRecord(propsRecord.graph);\n const ganttReport = validateGantt({\n items: graph.relationships,\n spec: {\n fields: {\n id: relationshipFields.id,\n label: relationshipFields.label ?? relationshipFields.source,\n start: relationshipFields.start,\n end: relationshipFields.end,\n },\n ...(spec.ganttScale ? { scale: spec.ganttScale } : {}),\n },\n });\n report.ok = ganttReport.ok;\n report.errors.push(...ganttReport.errors);\n report.warnings.push(...ganttReport.warnings);\n return report;\n}\n","import type { CapabilityDescriptor } from \"@gik-ai/kernel\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { AttackPath, attackPathDefinition } from \"./attack-path\";\n\nexport const securityComponentViews: Record<string, ProjectionView> = { \"attack-path\": AttackPath };\nexport const securityComponentDefinitions = { \"attack-path\": attackPathDefinition } as const;\nexport const securityComponentCapabilities: Record<string, CapabilityDescriptor> = Object.fromEntries(Object.entries(securityComponentDefinitions).map(([name, definition]) => [name, { propsSchema: definition.getSchema(), dataProp: definition.dataProp, emits: [...definition.events] }]));","import type { ComponentValidationReport } from \"../shared/definition\";\nimport { createComponentAuthoringApi, type ComponentAgentKit, type ComponentAuthoringDescription, type ComponentAuthoringTool, type ComponentCatalogEntry, type ComponentPreflightReport } from \"../shared/component-authoring-internal\";\nimport { securityComponentDefinitions } from \"./registry\";\n\nexport interface SecurityComponentCatalogEntry extends ComponentCatalogEntry {}\nexport interface SecurityComponentAuthoringDescription extends ComponentAuthoringDescription {}\nexport interface SecurityComponentPreflightReport extends ComponentPreflightReport {}\nexport interface SecurityComponentAgentKit extends ComponentAgentKit {}\nconst api = createComponentAuthoringApi({ definitions: securityComponentDefinitions, kind: \"security\", toolKind: \"Security\" });\nexport const listSecurityComponents = (): SecurityComponentCatalogEntry[] => api.list();\nexport const describeSecurityComponent = (capability: string): SecurityComponentAuthoringDescription => api.describe(capability);\nexport const validateSecurityComponentProps = (capability: string, props: unknown): ComponentValidationReport => api.validate(capability, props);\nexport const materializeSecurityComponentTrial = api.materialize;\nexport const preflightSecurityComponent = (capability: string, props: unknown): SecurityComponentPreflightReport => api.preflight(capability, props);\nexport const getSecurityComponentAgentInstructions = api.instructions;\nexport const createSecurityComponentAuthoringTools = (components?: readonly string[]): ComponentAuthoringTool[] => api.createTools(components);\nexport const getSecurityComponentAgentKit = (components?: readonly string[]): SecurityComponentAgentKit => api.getKit(components);\nexport const securityComponentAuthoringTools = createSecurityComponentAuthoringTools();"],"mappings":"oPAEA,OAAS,4BAAAA,MAAgC,qBCDzC,OAAS,QAAAC,EAAM,cAAAC,EAAY,UAAAC,MAAc,6BAEzC,OAAS,4BAAAC,MAAgC,qBAwIhC,OAcqI,YAAAC,EAdxF,OAAAC,EAA7C,QAAAC,MAAA,oBA9HF,IAAMC,EAAwB,CAAC,SAAU,UAAW,YAAa,QAAS,MAAM,EAC1EC,EAA+B,CAAC,SAAU,SAAU,UAAW,UAAW,SAAS,EA+B1FC,EAAS,CACb,QAAS,0CACT,KAAM,SACN,qBAAsB,GACtB,SAAU,CAAC,QAAS,MAAM,EAC1B,WAAY,CACV,GAAGC,EACH,MAAO,CACL,KAAM,SACN,qBAAsB,GACtB,SAAU,CAAC,WAAY,eAAe,EACtC,WAAY,CACV,SAAU,CAAE,KAAM,QAAS,MAAO,CAAE,KAAM,QAAS,CAAE,EACrD,cAAe,CAAE,KAAM,QAAS,MAAO,CAAE,KAAM,QAAS,CAAE,CAC5D,CACF,EACA,KAAM,CACJ,KAAM,SACN,qBAAsB,GACtB,SAAU,CAAC,eAAgB,oB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,EElCjN,IAAMI,GAAyD,CAAE,cAAeC,CAAW,EACrFC,EAA+B,CAAE,cAAeC,CAAqB,EACrEC,GAAsE,OAAO,YAAY,OAAO,QAAQF,CAA4B,EAAE,IAAI,CAAC,CAACG,EAAMC,CAAU,IAAM,CAACD,EAAM,CAAE,YAAaC,EAAW,UAAU,EAAG,SAAUA,EAAW,SAAU,MAAO,CAAC,GAAGA,EAAW,MAAM,CAAE,CAAC,CAAC,CAAC,ECC7R,IAAMC,EAAMC,EAA4B,CAAE,YAAaC,EAA8B,KAAM,WAAY,SAAU,UAAW,CAAC,EAChHC,GAAyB,IAAuCH,EAAI,KAAK,EACzEI,GAA6BC,GAA8DL,EAAI,SAASK,CAAU,EAClHC,GAAiC,CAACD,EAAoBE,IAA8CP,EAAI,SAASK,EAAYE,CAAK,EAClIC,GAAoCR,EAAI,YACxCS,GAA6B,CAACJ,EAAoBE,IAAqDP,EAAI,UAAUK,EAAYE,CAAK,EACtIG,GAAwCV,EAAI,aAC5CW,GAAyCC,GAA6DZ,EAAI,YAAYY,CAAU,EAChIC,GAAgCD,GAA8DZ,EAAI,OAAOY,CAAU,EACnHE,GAAkCH,GAAsC","names":["runDeclarativeValidators","Text","makeStyles","tokens","runDeclarativeValidators","Fragment","jsx","jsxs","ATTACK_GRAPH_VARIANTS","ATTACK_GRAPH_SEMANTIC_TOKENS","schema","componentStylePropsSchema","useStyles","makeStyles","tokens","attackGraphHeader","styles","spec","Text","entityLabels","graph","records","entity","textAt","relationshipTimestamp","relationship","startValue","readPath","options","endValue","hasEnd","formatTimestamp","renderTextGraph","node","labels","componentRootProps","index","source","target","predicate","renderGanttGraph","startField","endField","intervals","primitiveNode","Gantt","buildAttackGraphModel","graphValue","asRecord","entities","relationships","toneValue","AttackGraph","node","emit","styles","useStyles","graph","asRecord","spec","graphModel","buildAttackGraphModel","jsx","variant","ATTACK_GRAPH_VARIANTS","renderTextGraph","renderGanttGraph","relationshipSetNode","records","value","token","RelationshipSet","GraphDiagram","componentNode","getAttackGraphSchema","schema","validateAttackGraph","props","report","runDeclarativeValidators","propsRecord","relationshipFields","ganttReport","validateGantt","jsx","ATTACK_PATH_VARIANTS","schema","value","getAttackGraphSchema","delegatedProps","props","spec","AttackPath","node","emit","AttackGraph","componentNode","description","infiniteCanvasDefinition","ATTACK_GRAPH_SEMANTIC_TOKENS","getAttackPathSchema","validateAttackPath","report","runDeclarativeValidators","validateAttackGraph","materializeAttackPathTrial","trialNode","attackPathDefinition","defineComponent","securityComponentViews","AttackPath","securityComponentDefinitions","attackPathDefinition","securityComponentCapabilities","name","definition","api","createComponentAuthoringApi","securityComponentDefinitions","listSecurityComponents","describeSecurityComponent","capability","validateSecurityComponentProps","props","materializeSecurityComponentTrial","preflightSecurityComponent","getSecurityComponentAgentInstructions","createSecurityComponentAuthoringTools","components","getSecurityComponentAgentKit","securityComponentAuthoringTools"]}
@@ -0,0 +1,2 @@
1
+ import{c as d,d as k,e as l}from"./chunk-DMIV5ZI5.js";import{b as a,c as p,d as c,f as v,j as f,l as b,n as m}from"./chunk-XA6FE7ZK.js";import{Text as u}from"@fluentui/react-components";import{runDeclarativeValidators as P}from"@gik-ai/evaluators";import{jsx as i,jsxs as R}from"react/jsx-runtime";var O=["findings","text"],T=["unified-diff","split-diff","text"];function A(e){let o=JSON.parse(JSON.stringify(k()));return o.properties.variant={enum:e},o.properties.spec.properties.density={enum:["comfortable","compact"]},delete o.properties.spec.properties.kind,o.properties.spec.required=o.properties.spec.required.filter(t=>t!=="kind"),o}var V=A(O),D=A(T);function s(e,o){let t={...e.spec??{}},r=t.density;return delete t.density,t.kind=o,{...e,variant:r==="compact"?"compact":"standard",spec:t}}function N(e,o,t){let r=e.props.spec??{},w=b(e.props.lines);return w.length===0?i(u,{...f(e),children:r.emptyText??"No source data."}):R("section",{...f(e),children:[r.title?i(u,{block:!0,weight:"semibold",children:r.title}):null,w.map((C,J)=>{let S=m(C,o),y=t?m(C,t):"";return R(u,{block:!0,children:["- ",S,y?`: ${y}`:""]},`${S}-${J}`)})]})}var g=({node:e,emit:o})=>e.props.variant==="text"?N(e,String(e.props.spec.fields.text),e.props.spec.fields.annotation):i(d,{node:p(`${e.id}-source`,"primitive:source-viewer",s(e.props,"source")),emit:o,children:void 0}),h=({node:e,emit:o})=>e.props.variant==="text"?N(e,String(e.props.spec.fields.afterText),e.props.spec.fields.beforeText):i(d,{node:p(`${e.id}-diff`,"primitive:source-viewer",s(e.props,e.props.variant==="split-diff"?"split-diff":"unified-diff")),emit:o,children:void 0}),E={capability:"software:source-findings",summary:"Presents line-addressable software source findings or a textual fallback.",dataProp:"lines",events:[],semanticTokens:[],defaultVariant:"findings",variants:[{value:"findings",summary:"Annotated source findings.",useWhen:["Findings attach to exact source lines"]},{value:"text",summary:"Linear textual findings.",useWhen:["Visual source rendering is unavailable"]}],authoring:{useWhen:["Findings attach to exact software source lines"],avoidWhen:["Evidence spans unrelated sources without line references"],rules:["Map source line, text, and annotation fields","Do not infer findings in the renderer"]}},F={capability:"software:source-comparison",summary:"Presents precomputed software source changes as unified diff, split diff, or text.",dataProp:"lines",events:[],semanticTokens:[],defaultVariant:"unified-diff",variants:T.map(e=>({value:e,summary:`${e} source comparison.`,useWhen:[`The ${e} presentation matches the review surface`]})),authoring:{useWhen:["Users need to compare two aligned software source versions"],avoidWhen:["Only one source is present"],rules:["Supply precomputed aligned diff rows","Do not calculate or interpret changes in the renderer"]}};function K(e){let o=P([{kind:"ajv-schema",schema:V,message:"Invalid software:source-findings props",code:"software-source-findings-schema"}],e);return o.ok?l(s(e,"source")):o}function W(e){let o=P([{kind:"ajv-schema",schema:D,message:"Invalid software:source-comparison props",code:"software-source-comparison-schema"}],e);if(!o.ok)return o;let t=e;return l(s(t,t.variant==="split-diff"?"split-diff":"unified-diff"))}function $(){return c("software:source-findings",{variant:"findings",lines:[{line:41,text:"if (riskScore >= threshold) {",note:"Inclusive threshold"}],spec:{title:"Source findings",density:"comfortable",fields:{number:"line",text:"text",annotation:"note"}}})}function z(){return c("software:source-comparison",{variant:"unified-diff",lines:[{id:"41",beforeLine:41,before:"riskScore > threshold",afterLine:41,after:"riskScore >= threshold",change:"modified"}],spec:{title:"Policy comparison",density:"comfortable",fields:{id:"id",beforeNumber:"beforeLine",beforeText:"before",afterNumber:"afterLine",afterText:"after",change:"change"}}})}var j=a({description:E,version:"1.0.0",component:g,getSchema:()=>V,validate:K,materializeTrial:$}),I=a({description:F,version:"1.0.0",component:h,getSchema:()=>D,validate:W,materializeTrial:z});var X={"source-findings":g,"source-comparison":h},x={"source-findings":j,"source-comparison":I},Y=Object.fromEntries(Object.entries(x).map(([e,o])=>[e,{propsSchema:o.getSchema(),dataProp:o.dataProp,emits:[...o.events]}]));var n=v({definitions:x,kind:"software",toolKind:"Software"}),te=()=>n.list(),ne=e=>n.describe(e),re=(e,o)=>n.validate(e,o),ie=n.materialize,se=(e,o)=>n.preflight(e,o),ae=n.instructions,L=e=>n.createTools(e),pe=e=>n.getKit(e),ce=L();export{O as a,T as b,g as c,h as d,K as e,W as f,$ as g,z as h,j as i,I as j,X as k,x as l,Y as m,te as n,ne as o,re as p,ie as q,se as r,ae as s,L as t,pe as u,ce as v};
2
+ //# sourceMappingURL=chunk-6TBEAKS7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/software/source-analysis/SourceAnalysis.tsx","../src/software/registry.ts","../src/software/authoring.ts"],"sourcesContent":["import React from \"react\";\nimport { Text } from \"@fluentui/react-components\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView, ProjectionViewProps } from \"@gik-ai/react\";\n\nimport { SourceViewer, getSourceViewerSchema, validateSourceViewer } from \"../../primitives/source-viewer\";\nimport { componentRootProps, records, textAt } from \"../../shared/component\";\nimport { componentNode, defineComponent, trialNode, type ComponentDescription, type ComponentValidationReport } from \"../../shared/definition\";\n\nexport const SOURCE_FINDINGS_VARIANTS = [\"findings\", \"text\"] as const;\nexport const SOURCE_COMPARISON_VARIANTS = [\"unified-diff\", \"split-diff\", \"text\"] as const;\n\nfunction sourceSchema(variants: readonly string[]) {\n const schema = JSON.parse(JSON.stringify(getSourceViewerSchema())) as Record<string, any>;\n schema.properties.variant = { enum: variants };\n schema.properties.spec.properties.density = { enum: [\"comfortable\", \"compact\"] };\n delete schema.properties.spec.properties.kind;\n schema.properties.spec.required = schema.properties.spec.required.filter((name: string) => name !== \"kind\");\n return schema as Record<string, unknown>;\n}\n\nconst findingsSchema = sourceSchema(SOURCE_FINDINGS_VARIANTS);\nconst comparisonSchema = sourceSchema(SOURCE_COMPARISON_VARIANTS);\n\nfunction sourceProps(value: Record<string, Json>, kind: \"source\" | \"unified-diff\" | \"split-diff\") {\n const spec = { ...((value.spec ?? {}) as Record<string, Json>) };\n const density = spec.density;\n delete spec.density;\n spec.kind = kind;\n return { ...value, variant: density === \"compact\" ? \"compact\" : \"standard\", spec };\n}\n\nfunction textItems(node: ProjectionViewProps[\"node\"], labelField: string, detailField?: string) {\n const spec = (node.props.spec ?? {}) as Record<string, any>;\n const items = records(node.props.lines);\n if (items.length === 0) return <Text {...componentRootProps(node)}>{spec.emptyText ?? \"No source data.\"}</Text>;\n return <section {...componentRootProps(node)}>{spec.title ? <Text block weight=\"semibold\">{spec.title}</Text> : null}{items.map((item, index) => { const label = textAt(item, labelField); const detail = detailField ? textAt(item, detailField) : \"\"; return <Text block key={`${label}-${index}`}>- {label}{detail ? `: ${detail}` : \"\"}</Text>; })}</section>;\n}\n\nexport const SourceFindings: ProjectionView = ({ node, emit }) => node.props.variant === \"text\"\n ? textItems(node, String((node.props.spec as any).fields.text), (node.props.spec as any).fields.annotation)\n : <SourceViewer node={componentNode(`${node.id}-source`, \"primitive:source-viewer\", sourceProps(node.props, \"source\"))} emit={emit} children={undefined} />;\n\nexport const SourceComparison: ProjectionView = ({ node, emit }) => node.props.variant === \"text\"\n ? textItems(node, String((node.props.spec as any).fields.afterText), (node.props.spec as any).fields.beforeText)\n : <SourceViewer node={componentNode(`${node.id}-diff`, \"primitive:source-viewer\", sourceProps(node.props, node.props.variant === \"split-diff\" ? \"split-diff\" : \"unified-diff\"))} emit={emit} children={undefined} />;\n\nconst findingsDescription: ComponentDescription = { capability: \"software:source-findings\", summary: \"Presents line-addressable software source findings or a textual fallback.\", dataProp: \"lines\", events: [], semanticTokens: [], defaultVariant: \"findings\", variants: [{ value: \"findings\", summary: \"Annotated source findings.\", useWhen: [\"Findings attach to exact source lines\"] }, { value: \"text\", summary: \"Linear textual findings.\", useWhen: [\"Visual source rendering is unavailable\"] }], authoring: { useWhen: [\"Findings attach to exact software source lines\"], avoidWhen: [\"Evidence spans unrelated sources without line references\"], rules: [\"Map source line, text, and annotation fields\", \"Do not infer findings in the renderer\"] } };\nconst comparisonDescription: ComponentDescription = { capability: \"software:source-comparison\", summary: \"Presents precomputed software source changes as unified diff, split diff, or text.\", dataProp: \"lines\", events: [], semanticTokens: [], defaultVariant: \"unified-diff\", variants: SOURCE_COMPARISON_VARIANTS.map((value) => ({ value, summary: `${value} source comparison.`, useWhen: [`The ${value} presentation matches the review surface`] })), authoring: { useWhen: [\"Users need to compare two aligned software source versions\"], avoidWhen: [\"Only one source is present\"], rules: [\"Supply precomputed aligned diff rows\", \"Do not calculate or interpret changes in the renderer\"] } };\n\nexport function validateSourceFindings(props: unknown): ComponentValidationReport { const report = runDeclarativeValidators([{ kind: \"ajv-schema\", schema: findingsSchema, message: \"Invalid software:source-findings props\", code: \"software-source-findings-schema\" }], props as Json); return report.ok ? validateSourceViewer(sourceProps(props as Record<string, Json>, \"source\")) : report; }\nexport function validateSourceComparison(props: unknown): ComponentValidationReport { const report = runDeclarativeValidators([{ kind: \"ajv-schema\", schema: comparisonSchema, message: \"Invalid software:source-comparison props\", code: \"software-source-comparison-schema\" }], props as Json); if (!report.ok) return report; const value = props as Record<string, Json>; return validateSourceViewer(sourceProps(value, value.variant === \"split-diff\" ? \"split-diff\" : \"unified-diff\")); }\nexport function materializeSourceFindingsTrial() { return trialNode(\"software:source-findings\", { variant: \"findings\", lines: [{ line: 41, text: \"if (riskScore >= threshold) {\", note: \"Inclusive threshold\" }], spec: { title: \"Source findings\", density: \"comfortable\", fields: { number: \"line\", text: \"text\", annotation: \"note\" } } }); }\nexport function materializeSourceComparisonTrial() { return trialNode(\"software:source-comparison\", { variant: \"unified-diff\", lines: [{ id: \"41\", beforeLine: 41, before: \"riskScore > threshold\", afterLine: 41, after: \"riskScore >= threshold\", change: \"modified\" }], spec: { title: \"Policy comparison\", density: \"comfortable\", fields: { id: \"id\", beforeNumber: \"beforeLine\", beforeText: \"before\", afterNumber: \"afterLine\", afterText: \"after\", change: \"change\" } } }); }\nexport const sourceFindingsDefinition = defineComponent({ description: findingsDescription, version: \"1.0.0\", component: SourceFindings, getSchema: () => findingsSchema, validate: validateSourceFindings, materializeTrial: materializeSourceFindingsTrial });\nexport const sourceComparisonDefinition = defineComponent({ description: comparisonDescription, version: \"1.0.0\", component: SourceComparison, getSchema: () => comparisonSchema, validate: validateSourceComparison, materializeTrial: materializeSourceComparisonTrial });","import type { CapabilityDescriptor } from \"@gik-ai/kernel\";\nimport type { ProjectionView } from \"@gik-ai/react\";\nimport { SourceComparison, SourceFindings, sourceComparisonDefinition, sourceFindingsDefinition } from \"./source-analysis\";\n\nexport const softwareComponentViews: Record<string, ProjectionView> = { \"source-findings\": SourceFindings, \"source-comparison\": SourceComparison };\nexport const softwareComponentDefinitions = { \"source-findings\": sourceFindingsDefinition, \"source-comparison\": sourceComparisonDefinition } as const;\nexport const softwareComponentCapabilities: Record<string, CapabilityDescriptor> = Object.fromEntries(Object.entries(softwareComponentDefinitions).map(([name, definition]) => [name, { propsSchema: definition.getSchema(), dataProp: definition.dataProp, emits: [...definition.events] }]));","import type { ComponentValidationReport } from \"../shared/definition\";\nimport { createComponentAuthoringApi, type ComponentAgentKit, type ComponentAuthoringDescription, type ComponentAuthoringTool, type ComponentCatalogEntry, type ComponentPreflightReport } from \"../shared/component-authoring-internal\";\nimport { softwareComponentDefinitions } from \"./registry\";\n\nexport interface SoftwareComponentCatalogEntry extends ComponentCatalogEntry {}\nexport interface SoftwareComponentAuthoringDescription extends ComponentAuthoringDescription {}\nexport interface SoftwareComponentPreflightReport extends ComponentPreflightReport {}\nexport interface SoftwareComponentAgentKit extends ComponentAgentKit {}\nconst api = createComponentAuthoringApi({ definitions: softwareComponentDefinitions, kind: \"software\", toolKind: \"Software\" });\nexport const listSoftwareComponents = (): SoftwareComponentCatalogEntry[] => api.list();\nexport const describeSoftwareComponent = (capability: string): SoftwareComponentAuthoringDescription => api.describe(capability);\nexport const validateSoftwareComponentProps = (capability: string, props: unknown): ComponentValidationReport => api.validate(capability, props);\nexport const materializeSoftwareComponentTrial = api.materialize;\nexport const preflightSoftwareComponent = (capability: string, props: unknown): SoftwareComponentPreflightReport => api.preflight(capability, props);\nexport const getSoftwareComponentAgentInstructions = api.instructions;\nexport const createSoftwareComponentAuthoringTools = (components?: readonly string[]): ComponentAuthoringTool[] => api.createTools(components);\nexport const getSoftwareComponentAgentKit = (components?: readonly string[]): SoftwareComponentAgentKit => api.getKit(components);\nexport const softwareComponentAuthoringTools = createSoftwareComponentAuthoringTools();"],"mappings":"wIACA,OAAS,QAAAA,MAAY,6BAErB,OAAS,4BAAAC,MAAgC,qBAiCR,cAAAC,EACgO,QAAAC,MADhO,oBA1B1B,IAAMC,EAA2B,CAAC,WAAY,MAAM,EAC9CC,EAA6B,CAAC,eAAgB,aAAc,MAAM,EAE/E,SAASC,EAAaC,EAA6B,CACjD,IAAMC,EAAS,KAAK,MAAM,KAAK,UAAUC,EAAsB,CAAC,CAAC,EACjE,OAAAD,EAAO,WAAW,QAAU,CAAE,KAAMD,CAAS,EAC7CC,EAAO,WAAW,KAAK,WAAW,QAAU,CAAE,KAAM,CAAC,cAAe,SAAS,CAAE,EAC/E,OAAOA,EAAO,WAAW,KAAK,WAAW,KACzCA,EAAO,WAAW,KAAK,SAAWA,EAAO,WAAW,KAAK,SAAS,OAAQE,GAAiBA,I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B,iBAAkBG,CAAiC,CAAC,ECpDnQ,IAAMI,EAAyD,CAAE,kBAAmBC,EAAgB,oBAAqBC,CAAiB,EACpIC,EAA+B,CAAE,kBAAmBC,EAA0B,oBAAqBC,CAA2B,EAC9HC,EAAsE,OAAO,YAAY,OAAO,QAAQH,CAA4B,EAAE,IAAI,CAAC,CAACI,EAAMC,CAAU,IAAM,CAACD,EAAM,CAAE,YAAaC,EAAW,UAAU,EAAG,SAAUA,EAAW,SAAU,MAAO,CAAC,GAAGA,EAAW,MAAM,CAAE,CAAC,CAAC,CAAC,ECE7R,IAAMC,EAAMC,EAA4B,CAAE,YAAaC,EAA8B,KAAM,WAAY,SAAU,UAAW,CAAC,EAChHC,GAAyB,IAAuCH,EAAI,KAAK,EACzEI,GAA6BC,GAA8DL,EAAI,SAASK,CAAU,EAClHC,GAAiC,CAACD,EAAoBE,IAA8CP,EAAI,SAASK,EAAYE,CAAK,EAClIC,GAAoCR,EAAI,YACxCS,GAA6B,CAACJ,EAAoBE,IAAqDP,EAAI,UAAUK,EAAYE,CAAK,EACtIG,GAAwCV,EAAI,aAC5CW,EAAyCC,GAA6DZ,EAAI,YAAYY,CAAU,EAChIC,GAAgCD,GAA8DZ,EAAI,OAAOY,CAAU,EACnHE,GAAkCH,EAAsC","names":["Text","runDeclarativeValidators","jsx","jsxs","SOURCE_FINDINGS_VARIANTS","SOURCE_COMPARISON_VARIANTS","sourceSchema","variants","schema","getSourceViewerSchema","name","findingsSchema","comparisonSchema","sourceProps","value","kind","spec","density","textItems","node","labelField","detailField","items","records","Text","componentRootProps","item","index","label","textAt","detail","SourceFindings","emit","SourceViewer","componentNode","SourceComparison","findingsDescription","comparisonDescription","validateSourceFindings","props","report","runDeclarativeValidators","validateSourceViewer","validateSourceComparison","materializeSourceFindingsTrial","trialNode","materializeSourceComparisonTrial","sourceFindingsDefinition","defineComponent","sourceComparisonDefinition","softwareComponentViews","SourceFindings","SourceComparison","softwareComponentDefinitions","sourceFindingsDefinition","sourceComparisonDefinition","softwareComponentCapabilities","name","definition","api","createComponentAuthoringApi","softwareComponentDefinitions","listSoftwareComponents","describeSoftwareComponent","capability","validateSoftwareComponentProps","props","materializeSoftwareComponentTrial","preflightSoftwareComponent","getSoftwareComponentAgentInstructions","createSoftwareComponentAuthoringTools","components","getSoftwareComponentAgentKit","softwareComponentAuthoringTools"]}
@@ -0,0 +1,2 @@
1
+ import{b as w,d as y,g as v,j as b,l as N,m as T,n as d}from"./chunk-XA6FE7ZK.js";import{Badge as R,Text as s,makeStyles as E,mergeClasses as L,tokens as t}from"@fluentui/react-components";import{runDeclarativeValidators as W}from"@gik-ai/evaluators";var h=["unchanged","added","removed","modified"];function k(o){return o==="added"?"+":o==="removed"?"-":o==="modified"?"~":" "}function x(o){return o.change==="removed"?o.beforeText??"":o.afterText??o.beforeText??""}import{Fragment as B,jsx as n,jsxs as u}from"react/jsx-runtime";var V=["standard","compact"],I=["source","unified-diff","split-diff"],c={type:"string",minLength:1},P={$schema:"http://json-schema.org/draft-07/schema#",type:"object",additionalProperties:!1,required:["lines","spec"],properties:{...v,lines:{type:"array",items:{type:"object"}},variant:{enum:V},spec:{type:"object",additionalProperties:!1,required:["kind","fields"],properties:{kind:{enum:I},title:{type:"string"},description:{type:"string"},sourceLabel:{type:"string"},language:{type:"string"},emptyText:{type:"string"},wrap:{type:"boolean"},fields:{type:"object",additionalProperties:!1,properties:{id:c,number:c,text:c,beforeNumber:c,beforeText:c,afterNumber:c,afterText:c,annotation:c,change:c}}}}}},z=E({root:{display:"grid",gap:t.spacingVerticalS,minWidth:0},header:{display:"flex",justifyContent:"space-between",alignItems:"baseline",flexWrap:"wrap",gap:t.spacingHorizontalM},heading:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:t.spacingHorizontalS},description:{color:t.colorNeutralForeground3},sourceLabel:{color:t.colorNeutralForeground3},viewport:{overflow:"auto",border:`${t.strokeWidthThin} solid ${t.colorNeutralStroke2}`,borderRadius:t.borderRadiusMedium,backgroundColor:t.colorNeutralBackground3},lines:{display:"grid",minWidth:"max-content",fontFamily:t.fontFamilyMonospace},line:{display:"grid",gridTemplateColumns:"3.5rem minmax(20rem, 1fr) minmax(10rem, .55fr)",minHeight:"2rem",borderBottom:`${t.strokeWidthThin} solid ${t.colorNeutralStroke3}`},compactLine:{gridTemplateColumns:"3.5rem minmax(20rem, 1fr)"},splitLine:{gridTemplateColumns:"3.5rem minmax(16rem, 1fr) 3.5rem minmax(16rem, 1fr) minmax(10rem, .45fr)"},compactSplitLine:{gridTemplateColumns:"3.5rem minmax(16rem, 1fr) 3.5rem minmax(16rem, 1fr)"},number:{padding:`${t.spacingVerticalXS} ${t.spacingHorizontalS}`,color:t.colorNeutralForeground4,textAlign:"right",userSelect:"none",fontVariantNumeric:"tabular-nums"},code:{padding:`${t.spacingVerticalXS} ${t.spacingHorizontalM}`,whiteSpace:"pre",overflowWrap:"normal"},wrappedCode:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},annotation:{padding:`${t.spacingVerticalXS} ${t.spacingHorizontalM}`,borderLeft:`${t.strokeWidthThin} solid ${t.colorNeutralStroke2}`,fontFamily:t.fontFamilyBase},added:{backgroundColor:t.colorPaletteGreenBackground1},removed:{backgroundColor:t.colorPaletteRedBackground1},modified:{backgroundColor:t.colorPaletteYellowBackground1},prefix:{display:"inline-block",width:"1.25rem",color:t.colorNeutralForeground3,userSelect:"none"},empty:{padding:t.spacingHorizontalM,color:t.colorNeutralForeground3}});function _(o,e){return o.map((r,a)=>{let p=d(r,e.fields.change),l=h.includes(p)?p:"unchanged";return{id:d(r,e.fields.id)||String(a),beforeNumber:d(r,e.fields.beforeNumber||e.fields.number),beforeText:d(r,e.fields.beforeText||e.fields.text),afterNumber:d(r,e.fields.afterNumber||e.fields.number),afterText:d(r,e.fields.afterText||e.fields.text),annotation:d(r,e.fields.annotation),change:l}})}var $=({node:o})=>{let e=z(),r=o.props.spec??{},a=V.includes(o.props.variant)?o.props.variant:"standard",p=N(o.props.lines),l=r.fields?_(p,r):[];if(!r.fields||l.length===0)return n(s,{...b(o),children:r.emptyText??"No source available."});let m=r.kind==="split-diff",f=a==="standard"&&l.some(i=>i.annotation),S=i=>L(e.line,a==="compact"&&e.compactLine,m&&e.splitLine,m&&a==="compact"&&e.compactSplitLine,i.change==="added"&&e.added,i.change==="removed"&&e.removed,i.change==="modified"&&e.modified),g=L(e.code,r.wrap&&e.wrappedCode);return u("figure",{...b(o,e.root),"aria-label":r.title??"Source viewer",children:[r.title||r.description||r.sourceLabel||r.language?u("figcaption",{className:e.header,children:[u("div",{children:[u("div",{className:e.heading,children:[r.title?n(s,{weight:"semibold",children:r.title}):null,r.language?n(R,{appearance:"outline",children:r.language}):null]}),r.description?n(s,{className:e.description,size:200,children:r.description}):null]}),r.sourceLabel?n(s,{className:e.sourceLabel,size:200,children:r.sourceLabel}):null]}):null,n("div",{className:e.viewport,children:n("div",{className:e.lines,children:l.map(i=>m?u("div",{className:S(i),children:[n(s,{className:e.number,children:i.beforeNumber}),n(s,{className:g,children:i.beforeText}),n(s,{className:e.number,children:i.afterNumber}),n(s,{className:g,children:i.afterText}),f?n(s,{className:e.annotation,size:200,children:i.annotation}):null]},i.id):u("div",{className:S(i),children:[n(s,{className:e.number,children:i.afterNumber||i.beforeNumber}),n(s,{className:g,children:r.kind==="unified-diff"?u(B,{children:[n("span",{className:e.prefix,"aria-hidden":"true",children:k(i.change)}),x(i)]}):x(i)}),f?n(s,{className:e.annotation,size:200,children:i.annotation}):null]},i.id))})})]})},F={capability:"primitive:source-viewer",summary:"Renders mapped source lines or precomputed unified and split diff rows with stable line references.",dataProp:"lines",events:[],semanticTokens:[],defaultVariant:"standard",variants:[{value:"standard",summary:"Full source rows with optional annotations.",useWhen:["Source inspection is a primary surface","Line annotations should remain visible"]},{value:"compact",summary:"Dense source rows without annotation details.",useWhen:["Source supports another primary result","Horizontal space is constrained"]}],authoring:{useWhen:["Exact source wording and stable line references matter","A source or precomputed diff needs safe read-only rendering"],avoidWhen:["Users must edit source content","The component would need to calculate or interpret changes"],rules:["Choose source, unified-diff, or split-diff through spec.kind","Supply precomputed aligned diff rows","Use variant only for density","Preserve source text exactly"]}};function C(){return P}function A(o){let e=W([{kind:"ajv-schema",schema:C(),message:"Invalid primitive:source-viewer props",code:"source-viewer-schema"}],o);if(!e.ok)return e;let r=o,a=r.spec.fields,p=!!(a.number&&a.text),l=!!(a.change&&a.beforeText&&a.afterText),m=r.spec.kind!=="source"&&r.lines.some(f=>!h.includes(String(T(f,a.change))));return(r.spec.kind==="source"&&!p||r.spec.kind!=="source"&&!l||m)&&(e.ok=!1,e.errors.push({detail:"Source view requires number/text fields; diff views require change, beforeText, and afterText fields with recognized changes",code:"source-viewer-fields"})),e}function H(){return y("primitive:source-viewer",{variant:"standard",lines:[{id:"41",beforeLine:41,before:"if (riskScore > threshold) {",afterLine:41,after:"if (riskScore >= threshold) {",change:"modified",note:"Threshold is now inclusive"},{id:"42",beforeLine:42,before:"",afterLine:42,after:" await disableIdentity(subjectId);",change:"added",note:"Containment effect added"}],spec:{kind:"split-diff",title:"Containment policy change",language:"TypeScript",sourceLabel:"policies/containment.ts",fields:{id:"id",beforeNumber:"beforeLine",beforeText:"before",afterNumber:"afterLine",afterText:"after",change:"change",annotation:"note"}}})}var G=w({description:F,version:"1.0.0",component:$,getSchema:C,validate:A,materializeTrial:H});export{V as a,I as b,$ as c,C as d,A as e,H as f,G as g};
2
+ //# sourceMappingURL=chunk-DMIV5ZI5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/source-viewer/SourceViewer.tsx","../src/shared/sourceLines.ts"],"sourcesContent":["import React from \"react\";\nimport { Badge, Text, makeStyles, mergeClasses, tokens } from \"@fluentui/react-components\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { componentRootProps, componentStylePropsSchema, readPath, records, textAt } from \"../../shared/component\";\nimport { defineComponent, trialNode, type ComponentDescription, type ComponentValidationReport } from \"../../shared/definition\";\nimport { SOURCE_LINE_CHANGES, sourceLinePrefix, sourceLineText, type SourceLineChange, type SourceViewerLine } from \"../../shared/sourceLines\";\n\nexport const SOURCE_VIEWER_VARIANTS = [\"standard\", \"compact\"] as const;\nexport const SOURCE_VIEWER_KINDS = [\"source\", \"unified-diff\", \"split-diff\"] as const;\ntype SourceViewerVariant = typeof SOURCE_VIEWER_VARIANTS[number];\ntype SourceViewerKind = typeof SOURCE_VIEWER_KINDS[number];\n\ninterface SourceViewerSpec {\n kind: SourceViewerKind;\n title?: string;\n description?: string;\n sourceLabel?: string;\n language?: string;\n emptyText?: string;\n wrap?: boolean;\n fields: {\n id?: string;\n number?: string;\n text?: string;\n beforeNumber?: string;\n beforeText?: string;\n afterNumber?: string;\n afterText?: string;\n annotation?: string;\n change?: string;\n };\n}\n\nconst fieldSchema = { type: \"string\", minLength: 1 } as const;\nconst schema = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n additionalProperties: false,\n required: [\"lines\", \"spec\"],\n properties: {\n ...componentStylePropsSchema,\n lines: { type: \"array\", items: { type: \"object\" } },\n variant: { enum: SOURCE_VIEWER_VARIANTS },\n spec: {\n type: \"object\",\n additionalProperties: false,\n required: [\"kind\", \"fields\"],\n properties: {\n kind: { enum: SOURCE_VIEWER_KINDS },\n title: { type: \"string\" },\n description: { type: \"string\" },\n sourceLabel: { type: \"string\" },\n language: { type: \"string\" },\n emptyText: { type: \"string\" },\n wrap: { type: \"boolean\" },\n fields: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n id: fieldSchema,\n number: fieldSchema,\n text: fieldSchema,\n beforeNumber: fieldSchema,\n beforeText: fieldSchema,\n afterNumber: fieldSchema,\n afterText: fieldSchema,\n annotation: fieldSchema,\n change: fieldSchema,\n },\n },\n },\n },\n },\n} as const;\n\nconst useStyles = makeStyles({\n root: { display: \"grid\", gap: tokens.spacingVerticalS, minWidth: 0 },\n header: { display: \"flex\", justifyContent: \"space-between\", alignItems: \"baseline\", flexWrap: \"wrap\", gap: tokens.spacingHorizontalM },\n heading: { display: \"flex\", alignItems: \"center\", flexWrap: \"wrap\", gap: tokens.spacingHorizontalS },\n description: { color: tokens.colorNeutralForeground3 },\n sourceLabel: { color: tokens.colorNeutralForeground3 },\n viewport: { overflow: \"auto\", border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`, borderRadius: tokens.borderRadiusMedium, backgroundColor: tokens.colorNeutralBackground3 },\n lines: { display: \"grid\", minWidth: \"max-content\", fontFamily: tokens.fontFamilyMonospace },\n line: { display: \"grid\", gridTemplateColumns: \"3.5rem minmax(20rem, 1fr) minmax(10rem, .55fr)\", minHeight: \"2rem\", borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke3}` },\n compactLine: { gridTemplateColumns: \"3.5rem minmax(20rem, 1fr)\" },\n splitLine: { gridTemplateColumns: \"3.5rem minmax(16rem, 1fr) 3.5rem minmax(16rem, 1fr) minmax(10rem, .45fr)\" },\n compactSplitLine: { gridTemplateColumns: \"3.5rem minmax(16rem, 1fr) 3.5rem minmax(16rem, 1fr)\" },\n number: { padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`, color: tokens.colorNeutralForeground4, textAlign: \"right\", userSelect: \"none\", fontVariantNumeric: \"tabular-nums\" },\n code: { padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalM}`, whiteSpace: \"pre\", overflowWrap: \"normal\" },\n wrappedCode: { whiteSpace: \"pre-wrap\", overflowWrap: \"anywhere\" },\n annotation: { padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalM}`, borderLeft: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`, fontFamily: tokens.fontFamilyBase },\n added: { backgroundColor: tokens.colorPaletteGreenBackground1 },\n removed: { backgroundColor: tokens.colorPaletteRedBackground1 },\n modified: { backgroundColor: tokens.colorPaletteYellowBackground1 },\n prefix: { display: \"inline-block\", width: \"1.25rem\", color: tokens.colorNeutralForeground3, userSelect: \"none\" },\n empty: { padding: tokens.spacingHorizontalM, color: tokens.colorNeutralForeground3 },\n});\n\nfunction mappedLines(source: Record<string, unknown>[], spec: SourceViewerSpec): SourceViewerLine[] {\n return source.map((line, index) => {\n const changeValue = textAt(line, spec.fields.change);\n const change = SOURCE_LINE_CHANGES.includes(changeValue as SourceLineChange) ? changeValue as SourceLineChange : \"unchanged\";\n return {\n id: textAt(line, spec.fields.id) || String(index),\n beforeNumber: textAt(line, spec.fields.beforeNumber || spec.fields.number),\n beforeText: textAt(line, spec.fields.beforeText || spec.fields.text),\n afterNumber: textAt(line, spec.fields.afterNumber || spec.fields.number),\n afterText: textAt(line, spec.fields.afterText || spec.fields.text),\n annotation: textAt(line, spec.fields.annotation),\n change,\n };\n });\n}\n\nexport const SourceViewer: ProjectionView = ({ node }) => {\n const styles = useStyles();\n const spec = (node.props.spec ?? {}) as unknown as SourceViewerSpec;\n const variant = SOURCE_VIEWER_VARIANTS.includes(node.props.variant as SourceViewerVariant) ? node.props.variant as SourceViewerVariant : \"standard\";\n const source = records(node.props.lines);\n const lines = spec.fields ? mappedLines(source, spec) : [];\n if (!spec.fields || lines.length === 0) return <Text {...componentRootProps(node)}>{spec.emptyText ?? \"No source available.\"}</Text>;\n const split = spec.kind === \"split-diff\";\n const showAnnotations = variant === \"standard\" && lines.some((line) => line.annotation);\n const lineClass = (line: SourceViewerLine) => mergeClasses(\n styles.line,\n variant === \"compact\" && styles.compactLine,\n split && styles.splitLine,\n split && variant === \"compact\" && styles.compactSplitLine,\n line.change === \"added\" && styles.added,\n line.change === \"removed\" && styles.removed,\n line.change === \"modified\" && styles.modified,\n );\n const codeClass = mergeClasses(styles.code, spec.wrap && styles.wrappedCode);\n\n return <figure {...componentRootProps(node, styles.root)} aria-label={spec.title ?? \"Source viewer\"}>\n {spec.title || spec.description || spec.sourceLabel || spec.language ? <figcaption className={styles.header}><div><div className={styles.heading}>{spec.title ? <Text weight=\"semibold\">{spec.title}</Text> : null}{spec.language ? <Badge appearance=\"outline\">{spec.language}</Badge> : null}</div>{spec.description ? <Text className={styles.description} size={200}>{spec.description}</Text> : null}</div>{spec.sourceLabel ? <Text className={styles.sourceLabel} size={200}>{spec.sourceLabel}</Text> : null}</figcaption> : null}\n <div className={styles.viewport}>\n <div className={styles.lines}>{lines.map((line) => split ? <div className={lineClass(line)} key={line.id}>\n <Text className={styles.number}>{line.beforeNumber}</Text><Text className={codeClass}>{line.beforeText}</Text>\n <Text className={styles.number}>{line.afterNumber}</Text><Text className={codeClass}>{line.afterText}</Text>\n {showAnnotations ? <Text className={styles.annotation} size={200}>{line.annotation}</Text> : null}\n </div> : <div className={lineClass(line)} key={line.id}>\n <Text className={styles.number}>{line.afterNumber || line.beforeNumber}</Text>\n <Text className={codeClass}>{spec.kind === \"unified-diff\" ? <><span className={styles.prefix} aria-hidden=\"true\">{sourceLinePrefix(line.change)}</span>{sourceLineText(line)}</> : sourceLineText(line)}</Text>\n {showAnnotations ? <Text className={styles.annotation} size={200}>{line.annotation}</Text> : null}\n </div>)}</div>\n </div>\n </figure>;\n};\n\nconst description: ComponentDescription = {\n capability: \"primitive:source-viewer\",\n summary: \"Renders mapped source lines or precomputed unified and split diff rows with stable line references.\",\n dataProp: \"lines\",\n events: [],\n semanticTokens: [],\n defaultVariant: \"standard\",\n variants: [\n { value: \"standard\", summary: \"Full source rows with optional annotations.\", useWhen: [\"Source inspection is a primary surface\", \"Line annotations should remain visible\"] },\n { value: \"compact\", summary: \"Dense source rows without annotation details.\", useWhen: [\"Source supports another primary result\", \"Horizontal space is constrained\"] },\n ],\n authoring: {\n useWhen: [\"Exact source wording and stable line references matter\", \"A source or precomputed diff needs safe read-only rendering\"],\n avoidWhen: [\"Users must edit source content\", \"The component would need to calculate or interpret changes\"],\n rules: [\"Choose source, unified-diff, or split-diff through spec.kind\", \"Supply precomputed aligned diff rows\", \"Use variant only for density\", \"Preserve source text exactly\"],\n },\n};\n\nexport function getSourceViewerSchema(): Record<string, unknown> { return schema as unknown as Record<string, unknown>; }\nexport function validateSourceViewer(props: unknown): ComponentValidationReport {\n const report = runDeclarativeValidators([{ kind: \"ajv-schema\", schema: getSourceViewerSchema(), message: \"Invalid primitive:source-viewer props\", code: \"source-viewer-schema\" }], props as Json);\n if (!report.ok) return report;\n const value = props as { lines: Record<string, unknown>[]; spec: SourceViewerSpec };\n const fields = value.spec.fields;\n const sourceFieldsValid = Boolean(fields.number && fields.text);\n const diffFieldsValid = Boolean(fields.change && fields.beforeText && fields.afterText);\n const invalidChange = value.spec.kind !== \"source\" && value.lines.some((line) => !SOURCE_LINE_CHANGES.includes(String(readPath(line, fields.change)) as SourceLineChange));\n if ((value.spec.kind === \"source\" && !sourceFieldsValid) || (value.spec.kind !== \"source\" && !diffFieldsValid) || invalidChange) {\n report.ok = false;\n report.errors.push({ detail: \"Source view requires number/text fields; diff views require change, beforeText, and afterText fields with recognized changes\", code: \"source-viewer-fields\" });\n }\n return report;\n}\nexport function materializeSourceViewerTrial() {\n return trialNode(\"primitive:source-viewer\", {\n variant: \"standard\",\n lines: [\n { id: \"41\", beforeLine: 41, before: \"if (riskScore > threshold) {\", afterLine: 41, after: \"if (riskScore >= threshold) {\", change: \"modified\", note: \"Threshold is now inclusive\" },\n { id: \"42\", beforeLine: 42, before: \"\", afterLine: 42, after: \" await disableIdentity(subjectId);\", change: \"added\", note: \"Containment effect added\" },\n ],\n spec: {\n kind: \"split-diff\",\n title: \"Containment policy change\",\n language: \"TypeScript\",\n sourceLabel: \"policies/containment.ts\",\n fields: { id: \"id\", beforeNumber: \"beforeLine\", beforeText: \"before\", afterNumber: \"afterLine\", afterText: \"after\", change: \"change\", annotation: \"note\" },\n },\n });\n}\nexport const sourceViewerDefinition = defineComponent({ description, version: \"1.0.0\", component: SourceViewer, getSchema: getSourceViewerSchema, validate: validateSourceViewer, materializeTrial: materializeSourceViewerTrial });\n","export const SOURCE_LINE_CHANGES = [\"unchanged\", \"added\", \"removed\", \"modified\"] as const;\nexport type SourceLineChange = typeof SOURCE_LINE_CHANGES[number];\n\nexport interface SourceViewerLine {\n id: string;\n beforeNumber?: string;\n beforeText?: string;\n afterNumber?: string;\n afterText?: string;\n annotation?: string;\n change: SourceLineChange;\n}\n\nexport function sourceLinePrefix(change: SourceLineChange): string {\n if (change === \"added\") return \"+\";\n if (change === \"removed\") return \"-\";\n if (change === \"modified\") return \"~\";\n return \" \";\n}\n\nexport function sourceLineText(line: SourceViewerLine): string {\n if (line.change === \"removed\") return line.beforeText ?? \"\";\n return line.afterText ?? line.beforeText ?? \"\";\n}\n"],"mappings":"kFACA,OAAS,SAAAA,EAAO,QAAAC,EAAM,cAAAC,EAAY,gBAAAC,EAAc,UAAAC,MAAc,6BAE9D,OAAS,4BAAAC,MAAgC,qBCHlC,IAAMC,EAAsB,CAAC,YAAa,QAAS,UAAW,UAAU,EAaxE,SAASC,EAAiBC,EAAkC,CACjE,OAAIA,IAAW,QAAgB,IAC3BA,IAAW,UAAkB,IAC7BA,IAAW,WAAmB,IAC3B,GACT,CAEO,SAASC,EAAeC,EAAgC,CAC7D,OAAIA,EAAK,SAAW,UAAkBA,EAAK,YAAc,GAClDA,EAAK,WAAaA,EAAK,YAAc,EAC9C,CDoGiD,OAuBmB,YAAAC,EAvBnB,OAAAC,EAeqE,QAAAC,MAfrE,oBAjH1C,IAAMC,EAAyB,CAAC,WAAY,SAAS,EAC/CC,EAAsB,CAAC,SAAU,eAAgB,YAAY,EAyBpEC,EAAc,CAAE,KAAM,SAAU,UAAW,CAAE,EAC7CC,EAAS,CACb,QAAS,0CACT,KAAM,SACN,qBAAsB,GACtB,SAAU,CAAC,QAAS,MAAM,EAC1B,WAAY,CACV,GAAGC,EACH,MAAO,CAAE,KAAM,QAAS,MAAO,CAAE,KAAM,QAAS,CAAE,EAClD,QAAS,CAAE,KAAMJ,CAAuB,EACxC,KAAM,CACJ,KAAM,SACN,qBAAsB,GACtB,SAAU,CAAC,OAAQ,QAAQ,EAC3B,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gC,UAAW,GAAI,MAAO,gCAAiC,OAAQ,WAAY,KAAM,4BAA6B,EAClL,CAAE,GAAI,KAAM,WAAY,GAAI,OAAQ,GAAI,UAAW,GAAI,MAAO,sCAAuC,OAAQ,QAAS,KAAM,0BAA2B,CACzJ,EACA,KAAM,CACJ,KAAM,aACN,MAAO,4BACP,SAAU,aACV,YAAa,0BACb,OAAQ,CAAE,GAAI,KAAM,aAAc,aAAc,WAAY,SAAU,YAAa,YAAa,UAAW,QAAS,OAAQ,SAAU,WAAY,MAAO,CAC3J,CACF,CAAC,CACH,CACO,IAAMC,EAAyBC,EAAgB,CAAE,YAAAf,EAAa,QAAS,QAAS,UAAWhB,EAAc,UAAWiB,EAAuB,SAAUC,EAAsB,iBAAkBU,CAA6B,CAAC","names":["Badge","Text","makeStyles","mergeClasses","tokens","runDeclarativeValidators","SOURCE_LINE_CHANGES","sourceLinePrefix","change","sourceLineText","line","Fragment","jsx","jsxs","SOURCE_VIEWER_VARIANTS","SOURCE_VIEWER_KINDS","fieldSchema","schema","componentStylePropsSchema","useStyles","makeStyles","tokens","mappedLines","source","spec","line","index","changeValue","textAt","change","SOURCE_LINE_CHANGES","SourceViewer","node","styles","variant","records","lines","Text","componentRootProps","split","showAnnotations","lineClass","mergeClasses","codeClass","Badge","sourceLinePrefix","sourceLineText","description","getSourceViewerSchema","validateSourceViewer","props","report","runDeclarativeValidators","value","fields","sourceFieldsValid","diffFieldsValid","invalidChange","readPath","materializeSourceViewerTrial","trialNode","sourceViewerDefinition","defineComponent"]}
@@ -0,0 +1,2 @@
1
+ import{a as y,b as S,d as T,i as s,j as i}from"./chunk-XA6FE7ZK.js";import F from"react";import{Button as A,Spinner as R}from"@fluentui/react-components";import{EditRegular as B,FullScreenMaximizeRegular as V,FullScreenMinimizeRegular as O}from"@fluentui/react-icons";import{readProps as k}from"@gik-ai/react";import{runDeclarativeValidators as w}from"@gik-ai/evaluators";function p(e,n,t,o){let r=e.variants.map(l=>l.value),c=r.length===0?n:{...n,properties:{...n.properties,variant:{type:"string",enum:r}}},a=e.defaultVariant&&o.variant===void 0?{...o,variant:e.defaultVariant}:o;return S({description:e,version:"1.0.0",component:t,getSchema:()=>c,validate:l=>w([{kind:"ajv-schema",schema:c,message:`Invalid ${e.capability} props`,code:`${e.capability.replace(":","-")}-schema`}],l),materializeTrial:()=>T(e.capability,a)})}import{jsx as u}from"react/jsx-runtime";var L=["primary","secondary","subtle","transparent","outline"],W=["rounded","circular","square"],j=["small","medium","large"],U=[{value:"action",summary:"Uses Fluent's standard labeled action presentation.",useWhen:["A normal labeled command is needed"]},{value:"primary",summary:"Uses Fluent's primary appearance.",useWhen:["The command is the primary action in its region"]},{value:"subtle",summary:"Uses Fluent's subtle appearance.",useWhen:["The command should remain visually quiet"]},{value:"icon",summary:"Renders an icon-only Fluent button.",useWhen:["A familiar icon has a complete accessible name"]},{value:"circular",summary:"Renders an icon-only circular Fluent button.",useWhen:["A compact circular command is appropriate"]},{value:"floating",summary:"Renders a large primary circular icon button; its container owns positioning.",useWhen:["A prominent floating-style command is needed"]},{value:"inline",summary:"Uses Fluent's transparent small button presentation.",useWhen:["An action appears inline with text or dense content"]}],N=({node:e,emit:n})=>{let t=k(e),[o,r]=F.useState(!1),c=t.bool("loading")||o,a=t.str("variant","action"),l=t.str("appearance"),P=t.str("shape"),d=t.str("size"),D=t.str("icon"),x=a==="icon"||a==="circular"||a==="floating",f=a==="primary"?{appearance:"primary"}:a==="subtle"?{appearance:"subtle"}:a==="circular"?{shape:"circular"}:a==="floating"?{appearance:"primary",shape:"circular",size:"large"}:a==="inline"?{appearance:"transparent",size:"small"}:{};return u(A,{...i(e),appearance:l||f.appearance,shape:P||f.shape,size:d||f.size,icon:c?u(R,{size:"tiny"}):z[D],disabled:t.bool("disabled"),"aria-label":t.str("ariaLabel")||void 0,onClick:async()=>{r(!0);try{await n("press",{})}finally{r(!1)}},children:x?null:t.str("label")})},z={edit:u(B,{}),"full-screen-maximize":u(V,{}),"full-screen-minimize":u(O,{})},E=s({type:"object",additionalProperties:!1,properties:{label:{type:"string"},icon:{type:"string",enum:Object.keys(z)},appearance:{type:"string",enum:L},ariaLabel:{type:"string"},disabled:{type:"boolean"},loading:{type:"boolean"},shape:{type:"string",enum:W},size:{type:"string",enum:j}},anyOf:[{required:["label"]},{required:["icon","ariaLabel"]}]}),_={capability:"fluent:button",summary:"Renders a Fluent 2 action or icon button through closed native variants.",events:["press"],eventContracts:{press:y("The user invokes the button.")},semanticTokens:[],defaultVariant:"action",variants:U,authoring:{useWhen:["A user invokes a command through a label or familiar icon"],avoidWhen:["The interaction is a persistent binary state; use switch or toggle"],rules:["Use a concise label for labeled variants","Always provide ariaLabel for icon-only variants","Handle press outside the component"]}},Be=p(_,E,N,{label:"Analyze report",appearance:"primary"});import q from"react";import{Dialog as I,DialogBody as M,DialogContent as J,DialogSurface as H,DialogTitle as Z}from"@fluentui/react-components";import{readProps as $}from"@gik-ai/react";import{jsx as g,jsxs as Y}from"react/jsx-runtime";var K=["modal","non-modal","alert"],G=({node:e,emit:n,children:t})=>{let o=$(e),r=typeof e.props.open=="boolean",[c,a]=q.useState(()=>o.bool("defaultOpen")),l=r?o.bool("open"):c;return g(I,{open:l,modalType:o.str("modalType","modal"),onOpenChange:(P,d)=>{r||a(d.open),n("openChange",{open:d.open})},children:g(H,{...i(e),"aria-label":o.str("ariaLabel")||o.str("title")||void 0,children:Y(M,{children:[g(Z,{children:o.str("title")}),g(J,{children:t})]})})})},Q=s({type:"object",additionalProperties:!1,required:["title"],properties:{open:{type:"boolean"},defaultOpen:{type:"boolean"},title:{type:"string",minLength:1},ariaLabel:{type:"string",minLength:1},modalType:{type:"string",enum:K}}}),X={capability:"fluent:dialog",summary:"Renders a self-contained Fluent 2 dialog whose native surface owns modality, focus, and dismissal.",slots:["children"],events:["openChange"],eventContracts:{openChange:y("The dialog open state changed; handling this event is optional unless open is controlled.",{open:{type:"boolean"}})},semanticTokens:[],defaultVariant:"standard",variants:[{value:"standard",summary:"Uses Fluent's standard dialog surface.",useWhen:["Content requires a focused temporary surface"]}],authoring:{useWhen:["A temporary surface must interrupt or supplement the current workflow"],avoidWhen:["The content belongs in the page flow","A domain-specific composite already owns the workflow"],rules:["Prefer local dialog state and use defaultOpen only to choose its initial state","Bind open only when application behavior or cross-Cell coordination must control the dialog","Handle openChange only when the application needs to observe or control dialog state","Place dialog content in children"]}},Ee=p(X,Q,G,{defaultOpen:!0,title:"Review details"});import{Badge as ee,Persona as ne,Spinner as te}from"@fluentui/react-components";import{readProps as h}from"@gik-ai/react";var C=[{value:"standard",summary:"Uses Fluent's standard control sizing.",useWhen:["The control appears in a normal form, panel, or command surface"]},{value:"compact",summary:"Uses Fluent's native small control sizing.",useWhen:["The control appears in a dense toolbar, table, or constrained surface"]}],Ie=["small","medium","large"];function Me(e,n){return e==="small"||e==="medium"||e==="large"?e:n==="compact"?"small":void 0}import{jsx as v}from"react/jsx-runtime";var oe=["filled","ghost","outline","tint"],ae=["brand","danger","important","informative","severe","subtle","success","warning"],re=["circular","rounded","square"],se=["tiny","extra-small","small","medium","large"],ie=["extra-small","small","medium","large","huge"],pe=["center","start"],le=["primary","inverted"],ce=["above","below","before","after"],ue=["tiny","extra-small","small","medium","large","huge"],me=({node:e})=>{let n=h(e),t=n.str("size");return v(ee,{...i(e),appearance:n.str("appearance")||void 0,color:n.str("color")||void 0,shape:n.str("shape")||void 0,size:t||(e.props.variant==="compact"?"small":void 0),children:n.str("label")})},de=({node:e})=>{let n=h(e),t=n.str("size");return v(ne,{...i(e),name:n.str("name"),presenceOnly:n.bool("presenceOnly"),secondaryText:n.str("secondaryText")||void 0,size:t||(e.props.variant==="compact"?"small":void 0),tertiaryText:n.str("tertiaryText")||void 0,textAlignment:n.str("textAlignment")||void 0})},ye=({node:e})=>{let n=h(e),t=n.str("size");return v(te,{...i(e),appearance:n.str("appearance")||void 0,label:n.str("label")||void 0,labelPosition:n.str("labelPosition")||void 0,size:t||(e.props.variant==="compact"?"small":void 0)})},m={type:"string"},ge=s({type:"object",additionalProperties:!1,required:["label"],properties:{label:m,appearance:{type:"string",enum:oe},color:{type:"string",enum:ae},shape:{type:"string",enum:re},size:{type:"string",enum:se}}}),fe=s({type:"object",additionalProperties:!1,required:["name"],properties:{name:m,presenceOnly:{type:"boolean"},secondaryText:m,tertiaryText:m,size:{type:"string",enum:ie},textAlignment:{type:"string",enum:pe}}}),he=s({type:"object",additionalProperties:!1,properties:{appearance:{type:"string",enum:le},label:m,labelPosition:{type:"string",enum:ce},size:{type:"string",enum:ue}}});function b(e,n,t,o,r){return{capability:e,summary:n,events:[],semanticTokens:[],defaultVariant:"standard",variants:C,authoring:{useWhen:[t],avoidWhen:[o],rules:r}}}var be=b("fluent:badge","Renders a Fluent 2 badge for a short status or count label.","A compact label communicates status, category, or count","The value needs explanatory prose or interaction",["Keep the label short","Use only native Fluent appearance, color, shape, and size values"]),ve=b("fluent:persona","Renders a Fluent 2 persona with identity and supporting text.","A person or identity needs a recognizable summary","The content does not represent a person or identity",["Provide the display name","Use supporting text only for identity-relevant details"]),Pe=b("fluent:spinner","Renders a Fluent 2 indeterminate progress spinner.","An operation is in progress and its completion percentage is unknown","Progress is determinate or no operation is active",["Provide a label when surrounding context does not explain the operation","Remove the spinner when the operation completes"]),Qe=p(be,ge,me,{label:"Active",color:"success"}),Xe=p(ve,fe,de,{name:"Ada Lovelace",secondaryText:"Incident commander"}),Ye=p(Pe,he,ye,{label:"Loading incident data"});export{p as a,N as b,Be as c,C as d,Ie as e,Me as f,G as g,Ee as h,me as i,de as j,ye as k,Qe as l,Xe as m,Ye as n};
2
+ //# sourceMappingURL=chunk-DNHCWSHQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/fluent/FluentButtons.tsx","../src/fluent/defineFluentComponent.ts","../src/fluent/FluentDialog.tsx","../src/fluent/FluentDisplayControls.tsx","../src/fluent/fluentVariants.ts"],"sourcesContent":["import React from \"react\";\nimport { Button, Spinner, type ButtonProps } from \"@fluentui/react-components\";\nimport {\n EditRegular,\n FullScreenMaximizeRegular,\n FullScreenMinimizeRegular,\n} from \"@fluentui/react-icons\";\nimport { readProps, type ProjectionView } from \"@gik-ai/react\";\n\nimport { eventContract, type ComponentDescription } from \"../shared/definition\";\nimport { componentRootProps, withComponentStylePropsSchema } from \"../shared/component\";\nimport { defineFluentComponent } from \"./defineFluentComponent\";\n\nconst appearances = [\"primary\", \"secondary\", \"subtle\", \"transparent\", \"outline\"] as const;\nconst shapes = [\"rounded\", \"circular\", \"square\"] as const;\nconst sizes = [\"small\", \"medium\", \"large\"] as const;\ntype FluentButtonAppearance = Extract<ButtonProps[\"appearance\"], typeof appearances[number]>;\ntype FluentButtonShape = Extract<ButtonProps[\"shape\"], typeof shapes[number]>;\ntype FluentButtonSize = Extract<ButtonProps[\"size\"], typeof sizes[number]>;\n\nconst BUTTON_VARIANTS = [\n { value: \"action\", summary: \"Uses Fluent's standard labeled action presentation.\", useWhen: [\"A normal labeled command is needed\"] },\n { value: \"primary\", summary: \"Uses Fluent's primary appearance.\", useWhen: [\"The command is the primary action in its region\"] },\n { value: \"subtle\", summary: \"Uses Fluent's subtle appearance.\", useWhen: [\"The command should remain visually quiet\"] },\n { value: \"icon\", summary: \"Renders an icon-only Fluent button.\", useWhen: [\"A familiar icon has a complete accessible name\"] },\n { value: \"circular\", summary: \"Renders an icon-only circular Fluent button.\", useWhen: [\"A compact circular command is appropriate\"] },\n { value: \"floating\", summary: \"Renders a large primary circular icon button; its container owns positioning.\", useWhen: [\"A prominent floating-style command is needed\"] },\n { value: \"inline\", summary: \"Uses Fluent's transparent small button presentation.\", useWhen: [\"An action appears inline with text or dense content\"] },\n] as const;\n\nexport const FluentButton: ProjectionView = ({ node, emit }) => {\n const props = readProps(node);\n const [emitting, setEmitting] = React.useState(false);\n const loading = props.bool(\"loading\") || emitting;\n const variant = props.str(\"variant\", \"action\");\n const appearance = props.str(\"appearance\") as FluentButtonAppearance;\n const shape = props.str(\"shape\") as FluentButtonShape;\n const size = props.str(\"size\") as FluentButtonSize;\n const iconName = props.str(\"icon\") as keyof typeof icons;\n const iconOnly = variant === \"icon\" || variant === \"circular\" || variant === \"floating\";\n const preset: Partial<Pick<ButtonProps, \"appearance\" | \"shape\" | \"size\">> =\n variant === \"primary\" ? { appearance: \"primary\" }\n : variant === \"subtle\" ? { appearance: \"subtle\" }\n : variant === \"circular\" ? { shape: \"circular\" }\n : variant === \"floating\" ? { appearance: \"primary\", shape: \"circular\", size: \"large\" }\n : variant === \"inline\" ? { appearance: \"transparent\", size: \"small\" }\n : {};\n return (\n <Button\n {...componentRootProps(node)}\n appearance={appearance || preset.appearance}\n shape={shape || preset.shape}\n size={size || preset.size}\n icon={loading ? <Spinner size=\"tiny\" /> : icons[iconName]}\n disabled={props.bool(\"disabled\")}\n aria-label={props.str(\"ariaLabel\") || undefined}\n onClick={async () => {\n setEmitting(true);\n try {\n await emit(\"press\", {});\n } finally {\n setEmitting(false);\n }\n }}\n >\n {iconOnly ? null : props.str(\"label\")}\n </Button>\n );\n};\n\nconst icons = {\n edit: <EditRegular />,\n \"full-screen-maximize\": <FullScreenMaximizeRegular />,\n \"full-screen-minimize\": <FullScreenMinimizeRegular />,\n} as const;\n\nconst buttonSchema = withComponentStylePropsSchema({\n type: \"object\",\n additionalProperties: false,\n properties: {\n label: { type: \"string\" },\n icon: { type: \"string\", enum: Object.keys(icons) },\n appearance: { type: \"string\", enum: appearances },\n ariaLabel: { type: \"string\" },\n disabled: { type: \"boolean\" },\n loading: { type: \"boolean\" },\n shape: { type: \"string\", enum: shapes },\n size: { type: \"string\", enum: sizes },\n },\n anyOf: [\n { required: [\"label\"] },\n { required: [\"icon\", \"ariaLabel\"] },\n ],\n} as const);\n\nconst buttonDescription: ComponentDescription = {\n capability: \"fluent:button\",\n summary: \"Renders a Fluent 2 action or icon button through closed native variants.\",\n events: [\"press\"],\n eventContracts: { press: eventContract(\"The user invokes the button.\") },\n semanticTokens: [],\n defaultVariant: \"action\",\n variants: BUTTON_VARIANTS,\n authoring: {\n useWhen: [\"A user invokes a command through a label or familiar icon\"],\n avoidWhen: [\"The interaction is a persistent binary state; use switch or toggle\"],\n rules: [\"Use a concise label for labeled variants\", \"Always provide ariaLabel for icon-only variants\", \"Handle press outside the component\"],\n },\n};\n\nexport const fluentButtonDefinition = defineFluentComponent(\n buttonDescription,\n buttonSchema,\n FluentButton,\n { label: \"Analyze report\", appearance: \"primary\" },\n);\n","import { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport {\n defineComponent,\n trialNode,\n type ComponentDescription,\n} from \"../shared/definition\";\n\nexport function defineFluentComponent(\n description: ComponentDescription,\n schema: Record<string, unknown>,\n component: ProjectionView,\n trialProps: Record<string, Json>,\n): ReturnType<typeof defineComponent> {\n const variantValues = description.variants.map((variant) => variant.value);\n const propsSchema = variantValues.length === 0\n ? schema\n : {\n ...schema,\n properties: {\n ...(schema.properties as Record<string, unknown> | undefined),\n variant: { type: \"string\", enum: variantValues },\n },\n };\n const materializedTrialProps = description.defaultVariant && trialProps.variant === undefined\n ? { ...trialProps, variant: description.defaultVariant }\n : trialProps;\n\n return defineComponent({\n description,\n version: \"1.0.0\",\n component,\n getSchema: () => propsSchema,\n validate: (props) => runDeclarativeValidators([{\n kind: \"ajv-schema\",\n schema: propsSchema,\n message: `Invalid ${description.capability} props`,\n code: `${description.capability.replace(\":\", \"-\")}-schema`,\n }], props as Json),\n materializeTrial: () => trialNode(description.capability, materializedTrialProps),\n });\n}\n","import React from \"react\";\nimport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogSurface,\n DialogTitle,\n type DialogProps,\n} from \"@fluentui/react-components\";\nimport { readProps, type ProjectionViewProps } from \"@gik-ai/react\";\n\nimport { eventContract, type ComponentDescription } from \"../shared/definition\";\nimport { componentRootProps, withComponentStylePropsSchema } from \"../shared/component\";\nimport { defineFluentComponent } from \"./defineFluentComponent\";\n\nconst modalTypes = [\"modal\", \"non-modal\", \"alert\"] as const;\ntype FluentDialogModalType = Extract<DialogProps[\"modalType\"], typeof modalTypes[number]>;\n\nexport const FluentDialog = ({ node, emit, children }: ProjectionViewProps) => {\n const props = readProps(node);\n const controlled = typeof node.props.open === \"boolean\";\n const [localOpen, setLocalOpen] = React.useState(() => props.bool(\"defaultOpen\"));\n const open = controlled ? props.bool(\"open\") : localOpen;\n return (\n <Dialog\n open={open}\n modalType={props.str(\"modalType\", \"modal\") as FluentDialogModalType}\n onOpenChange={(_event, data) => {\n if (!controlled) setLocalOpen(data.open);\n void emit(\"openChange\", { open: data.open });\n }}\n >\n <DialogSurface\n {...componentRootProps(node)}\n aria-label={props.str(\"ariaLabel\") || props.str(\"title\") || undefined}\n >\n <DialogBody>\n <DialogTitle>{props.str(\"title\")}</DialogTitle>\n <DialogContent>{children}</DialogContent>\n </DialogBody>\n </DialogSurface>\n </Dialog>\n );\n};\n\nconst dialogSchema = withComponentStylePropsSchema({\n type: \"object\",\n additionalProperties: false,\n required: [\"title\"],\n properties: {\n open: { type: \"boolean\" },\n defaultOpen: { type: \"boolean\" },\n title: { type: \"string\", minLength: 1 },\n ariaLabel: { type: \"string\", minLength: 1 },\n modalType: { type: \"string\", enum: modalTypes },\n },\n} as const);\n\nconst dialogDescription: ComponentDescription = {\n capability: \"fluent:dialog\",\n summary: \"Renders a self-contained Fluent 2 dialog whose native surface owns modality, focus, and dismissal.\",\n slots: [\"children\"],\n events: [\"openChange\"],\n eventContracts: { openChange: eventContract(\"The dialog open state changed; handling this event is optional unless open is controlled.\", { open: { type: \"boolean\" } }) },\n semanticTokens: [],\n defaultVariant: \"standard\",\n variants: [\n { value: \"standard\", summary: \"Uses Fluent's standard dialog surface.\", useWhen: [\"Content requires a focused temporary surface\"] },\n ],\n authoring: {\n useWhen: [\"A temporary surface must interrupt or supplement the current workflow\"],\n avoidWhen: [\"The content belongs in the page flow\", \"A domain-specific composite already owns the workflow\"],\n rules: [\n \"Prefer local dialog state and use defaultOpen only to choose its initial state\",\n \"Bind open only when application behavior or cross-Cell coordination must control the dialog\",\n \"Handle openChange only when the application needs to observe or control dialog state\",\n \"Place dialog content in children\",\n ],\n },\n};\n\nexport const fluentDialogDefinition = defineFluentComponent(\n dialogDescription,\n dialogSchema,\n FluentDialog,\n { defaultOpen: true, title: \"Review details\" },\n);","import {\n Badge,\n Persona,\n Spinner,\n type BadgeProps,\n type PersonaProps,\n type SpinnerProps,\n} from \"@fluentui/react-components\";\nimport { readProps, type ProjectionView } from \"@gik-ai/react\";\n\nimport type { ComponentDescription } from \"../shared/definition\";\nimport { componentRootProps, withComponentStylePropsSchema } from \"../shared/component\";\nimport { defineFluentComponent } from \"./defineFluentComponent\";\nimport { STANDARD_COMPACT_VARIANTS } from \"./fluentVariants\";\n\nconst badgeAppearances = [\"filled\", \"ghost\", \"outline\", \"tint\"] as const;\nconst badgeColors = [\"brand\", \"danger\", \"important\", \"informative\", \"severe\", \"subtle\", \"success\", \"warning\"] as const;\nconst badgeShapes = [\"circular\", \"rounded\", \"square\"] as const;\nconst badgeSizes = [\"tiny\", \"extra-small\", \"small\", \"medium\", \"large\"] as const;\nconst personaSizes = [\"extra-small\", \"small\", \"medium\", \"large\", \"huge\"] as const;\nconst personaTextAlignments = [\"center\", \"start\"] as const;\nconst spinnerAppearances = [\"primary\", \"inverted\"] as const;\nconst spinnerLabelPositions = [\"above\", \"below\", \"before\", \"after\"] as const;\nconst spinnerSizes = [\"tiny\", \"extra-small\", \"small\", \"medium\", \"large\", \"huge\"] as const;\n\nexport const FluentBadge: ProjectionView = ({ node }) => {\n const props = readProps(node);\n const size = props.str(\"size\") as BadgeProps[\"size\"];\n return (\n <Badge\n {...componentRootProps(node)}\n appearance={props.str(\"appearance\") as BadgeProps[\"appearance\"] || undefined}\n color={props.str(\"color\") as BadgeProps[\"color\"] || undefined}\n shape={props.str(\"shape\") as BadgeProps[\"shape\"] || undefined}\n size={size || (node.props.variant === \"compact\" ? \"small\" : undefined)}\n >\n {props.str(\"label\")}\n </Badge>\n );\n};\n\nexport const FluentPersona: ProjectionView = ({ node }) => {\n const props = readProps(node);\n const size = props.str(\"size\") as PersonaProps[\"size\"];\n return (\n <Persona\n {...componentRootProps(node)}\n name={props.str(\"name\")}\n presenceOnly={props.bool(\"presenceOnly\")}\n secondaryText={props.str(\"secondaryText\") || undefined}\n size={size || (node.props.variant === \"compact\" ? \"small\" : undefined)}\n tertiaryText={props.str(\"tertiaryText\") || undefined}\n textAlignment={props.str(\"textAlignment\") as PersonaProps[\"textAlignment\"] || undefined}\n />\n );\n};\n\nexport const FluentSpinner: ProjectionView = ({ node }) => {\n const props = readProps(node);\n const size = props.str(\"size\") as SpinnerProps[\"size\"];\n return (\n <Spinner\n {...componentRootProps(node)}\n appearance={props.str(\"appearance\") as SpinnerProps[\"appearance\"] || undefined}\n label={props.str(\"label\") || undefined}\n labelPosition={props.str(\"labelPosition\") as SpinnerProps[\"labelPosition\"] || undefined}\n size={size || (node.props.variant === \"compact\" ? \"small\" : undefined)}\n />\n );\n};\n\nconst stringProperty = { type: \"string\" } as const;\nconst badgeSchema = withComponentStylePropsSchema({\n type: \"object\",\n additionalProperties: false,\n required: [\"label\"],\n properties: {\n label: stringProperty,\n appearance: { type: \"string\", enum: badgeAppearances },\n color: { type: \"string\", enum: badgeColors },\n shape: { type: \"string\", enum: badgeShapes },\n size: { type: \"string\", enum: badgeSizes },\n },\n} as const);\nconst personaSchema = withComponentStylePropsSchema({\n type: \"object\",\n additionalProperties: false,\n required: [\"name\"],\n properties: {\n name: stringProperty,\n presenceOnly: { type: \"boolean\" },\n secondaryText: stringProperty,\n tertiaryText: stringProperty,\n size: { type: \"string\", enum: personaSizes },\n textAlignment: { type: \"string\", enum: personaTextAlignments },\n },\n} as const);\nconst spinnerSchema = withComponentStylePropsSchema({\n type: \"object\",\n additionalProperties: false,\n properties: {\n appearance: { type: \"string\", enum: spinnerAppearances },\n label: stringProperty,\n labelPosition: { type: \"string\", enum: spinnerLabelPositions },\n size: { type: \"string\", enum: spinnerSizes },\n },\n} as const);\n\nfunction displayDescription(\n capability: string,\n summary: string,\n useWhen: string,\n avoidWhen: string,\n rules: string[],\n): ComponentDescription {\n return {\n capability,\n summary,\n events: [],\n semanticTokens: [],\n defaultVariant: \"standard\",\n variants: STANDARD_COMPACT_VARIANTS,\n authoring: { useWhen: [useWhen], avoidWhen: [avoidWhen], rules },\n };\n}\n\nconst badgeDescription = displayDescription(\n \"fluent:badge\",\n \"Renders a Fluent 2 badge for a short status or count label.\",\n \"A compact label communicates status, category, or count\",\n \"The value needs explanatory prose or interaction\",\n [\"Keep the label short\", \"Use only native Fluent appearance, color, shape, and size values\"],\n);\nconst personaDescription = displayDescription(\n \"fluent:persona\",\n \"Renders a Fluent 2 persona with identity and supporting text.\",\n \"A person or identity needs a recognizable summary\",\n \"The content does not represent a person or identity\",\n [\"Provide the display name\", \"Use supporting text only for identity-relevant details\"],\n);\nconst spinnerDescription = displayDescription(\n \"fluent:spinner\",\n \"Renders a Fluent 2 indeterminate progress spinner.\",\n \"An operation is in progress and its completion percentage is unknown\",\n \"Progress is determinate or no operation is active\",\n [\"Provide a label when surrounding context does not explain the operation\", \"Remove the spinner when the operation completes\"],\n);\n\nexport const fluentBadgeDefinition = defineFluentComponent(badgeDescription, badgeSchema, FluentBadge, {\n label: \"Active\",\n color: \"success\",\n});\nexport const fluentPersonaDefinition = defineFluentComponent(personaDescription, personaSchema, FluentPersona, {\n name: \"Ada Lovelace\",\n secondaryText: \"Incident commander\",\n});\nexport const fluentSpinnerDefinition = defineFluentComponent(spinnerDescription, spinnerSchema, FluentSpinner, {\n label: \"Loading incident data\",\n});","import type { ComponentVariantDescription } from \"../shared/definition\";\n\nexport const STANDARD_COMPACT_VARIANTS: readonly ComponentVariantDescription[] = [\n {\n value: \"standard\",\n summary: \"Uses Fluent's standard control sizing.\",\n useWhen: [\"The control appears in a normal form, panel, or command surface\"],\n },\n {\n value: \"compact\",\n summary: \"Uses Fluent's native small control sizing.\",\n useWhen: [\"The control appears in a dense toolbar, table, or constrained surface\"],\n },\n];\n\nexport const FLUENT_CONTROL_SIZES = [\"small\", \"medium\", \"large\"] as const;\nexport type FluentControlSize = typeof FLUENT_CONTROL_SIZES[number];\n\nexport function resolveControlSize(size: string, variant: unknown): FluentControlSize | undefined {\n if (size === \"small\" || size === \"medium\" || size === \"large\") return size;\n return variant === \"compact\" ? \"small\" : undefined;\n}\n"],"mappings":"oEAAA,OAAOA,MAAW,QAClB,OAAS,UAAAC,EAAQ,WAAAC,MAAiC,6BAClD,OACE,eAAAC,EACA,6BAAAC,EACA,6BAAAC,MACK,wBACP,OAAS,aAAAC,MAAsC,gBCP/C,OAAS,4BAAAC,MAAgC,qBAUlC,SAASC,EACdC,EACAC,EACAC,EACAC,EACoC,CACpC,IAAMC,EAAgBJ,EAAY,SAAS,IAAKK,GAAYA,EAAQ,KAAK,EACnEC,EAAcF,EAAc,SAAW,EACzCH,EACA,CACE,GAAGA,EACH,WAAY,CACV,GAAIA,EAAO,WACX,QAAS,CAAE,KAAM,SAAU,KAAMG,CAAc,CACjD,CACF,EACEG,EAAyBP,EAAY,gBAAkBG,EAAW,UAAY,OAChF,CAAE,GAAGA,EAAY,QAASH,EAAY,cAAe,EACrDG,EAEJ,OAAOK,EAAgB,CACrB,YAAAR,EACA,QAAS,QACT,UAAAE,EACA,UAAW,IAAMI,EACjB,SAAWG,GAAUC,EAAyB,CAAC,CAC7C,KAAM,aACN,OAAQJ,EACR,QAAS,WAAWN,EAAY,UAAU,SAC1C,KAAM,GAAGA,EAAY,WAAW,QAAQ,IAAK,GAAG,CAAC,SACnD,CAAC,EAAGS,CAAa,EACjB,iBAAkB,IAAME,EAAUX,EAAY,WAAYO,CAAsB,CAClF,CAAC,CACH,CDUsB,cAAAK,MAAA,oBAxCtB,IAAMC,EAAc,CAAC,UAAW,YAAa,SAAU,cAAe,SAAS,EACzEC,EAAS,CAAC,UAAW,WAAY,QAAQ,EACzCC,EAAQ,CAAC,QAAS,SAAU,OAAO,E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E,CAC7F,EACMQ,GAAqBR,EACzB,iBACA,gEACA,oDACA,sDACA,CAAC,2BAA4B,wDAAwD,CACvF,EACMS,GAAqBT,EACzB,iBACA,qDACA,uEACA,oDACA,CAAC,0EAA2E,iDAAiD,CAC/H,EAEaU,GAAwBC,EAAsBJ,GAAkBX,GAAaZ,GAAa,CACrG,MAAO,SACP,MAAO,SACT,CAAC,EACY4B,GAA0BD,EAAsBH,GAAoBV,GAAeP,GAAe,CAC7G,KAAM,eACN,cAAe,oBACjB,CAAC,EACYsB,GAA0BF,EAAsBF,GAAoBV,GAAeN,GAAe,CAC7G,MAAO,uBACT,CAAC","names":["React","Button","Spinner","EditRegular","FullScreenMaximizeRegular","FullScreenMinimizeRegular","readProps","runDeclarativeValidators","defineFluentComponent","description","schema","component","trialProps","variantValues","variant","propsSchema","materializedTrialProps","defineComponent","props","runDeclarativeValidators","trialNode","jsx","appearances","shapes","sizes","BUTTON_VARIANTS","FluentButton","node","emit","props","readProps","emitting","setEmitting","React","loading","variant","appearance","shape","size","iconName","iconOnly","preset","Button","componentRootProps","Spinner","icons","EditRegular","FullScreenMaximizeRegular","FullScreenMinimizeRegular","buttonSchema","withComponentStylePropsSchema","buttonDescription","eventContract","fluentButtonDefinition","defineFluentComponent","React","Dialog","DialogBody","DialogContent","DialogSurface","DialogTitle","readProps","jsx","jsxs","modalTypes","FluentDialog","node","emit","children","props","readProps","controlled","localOpen","setLocalOpen","React","open","Dialog","_event","data","DialogSurface","componentRootProps","DialogBody","DialogTitle","DialogContent","dialogSchema","withComponentStylePropsSchema","dialogDescription","eventContract","fluentDialogDefinition","defineFluentComponent","Badge","Persona","Spinner","readProps","STANDARD_COMPACT_VARIANTS","FLUENT_CONTROL_SIZES","resolveControlSize","size","variant","jsx","badgeAppearances","badgeColors","badgeShapes","badgeSizes","personaSizes","personaTextAlignments","spinnerAppearances","spinnerLabelPositions","spinnerSizes","FluentBadge","node","props","readProps","size","Badge","componentRootProps","FluentPersona","Persona","FluentSpinner","Spinner","stringProperty","badgeSchema","withComponentStylePropsSchema","personaSchema","spinnerSchema","displayDescription","capability","summary","useWhen","avoidWhen","rules","STANDARD_COMPACT_VARIANTS","badgeDescription","personaDescription","spinnerDescription","fluentBadgeDefinition","defineFluentComponent","fluentPersonaDefinition","fluentSpinnerDefinition"]}
@@ -0,0 +1,2 @@
1
+ function c(...o){let a={},e={};for(let n of o){for(let[t,r]of Object.entries(n.catalog)){if(a[t]||e[t])throw new Error(`Duplicate agent-facing capability '${t}'`);a[t]=r;let i=n.details[t];if(!i)throw new Error(`Agent-facing capability '${t}' has no detail contract`);e[t]=i}for(let t of Object.keys(n.details))if(!n.catalog[t])throw new Error(`Agent-facing capability detail '${t}' has no catalog entry`)}return{catalog:a,details:e}}export{c as a};
2
+ //# sourceMappingURL=chunk-GL7PGK3G.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/agent-facing.ts"],"sourcesContent":["import type { ComponentEventContract } from \"./definition\";\n\nexport interface AgentFacingCapabilitySelection {\n for: readonly string[];\n notFor?: readonly string[];\n interaction?: string;\n}\n\nexport interface AgentFacingCapabilityDetail {\n dataProps?: Readonly<Record<string, unknown>>;\n props?: Readonly<Record<string, unknown>>;\n variants?: Readonly<Record<string, {\n summary: string;\n useWhen: readonly string[];\n default?: true;\n }>>;\n slots?: readonly string[];\n emits?: Readonly<Record<string, ComponentEventContract>>;\n constraints?: readonly string[];\n notes?: readonly string[];\n example?: Readonly<Record<string, unknown>>;\n}\n\nexport interface AgentFacingCapabilityCatalog {\n catalog: Readonly<Record<string, AgentFacingCapabilitySelection>>;\n details: Readonly<Record<string, AgentFacingCapabilityDetail>>;\n}\n\nexport function mergeAgentFacingCapabilityCatalogs(\n ...catalogs: readonly AgentFacingCapabilityCatalog[]\n): AgentFacingCapabilityCatalog {\n const catalog: Record<string, AgentFacingCapabilitySelection> = {};\n const details: Record<string, AgentFacingCapabilityDetail> = {};\n for (const source of catalogs) {\n for (const [id, entry] of Object.entries(source.catalog)) {\n if (catalog[id] || details[id]) throw new Error(`Duplicate agent-facing capability '${id}'`);\n catalog[id] = entry;\n const detail = source.details[id];\n if (!detail) throw new Error(`Agent-facing capability '${id}' has no detail contract`);\n details[id] = detail;\n }\n for (const id of Object.keys(source.details)) {\n if (!source.catalog[id]) throw new Error(`Agent-facing capability detail '${id}' has no catalog entry`);\n }\n }\n return { catalog, details };\n}\n"],"mappings":"AA4BO,SAASA,KACXC,EAC2B,CAC9B,IAAMC,EAA0D,CAAC,EAC3DC,EAAuD,CAAC,EAC9D,QAAWC,KAAUH,EAAU,CAC7B,OAAW,CAACI,EAAIC,CAAK,IAAK,OAAO,QAAQF,EAAO,OAAO,EAAG,CACxD,GAAIF,EAAQG,CAAE,GAAKF,EAAQE,CAAE,EAAG,MAAM,IAAI,MAAM,sCAAsCA,CAAE,GAAG,EAC3FH,EAAQG,CAAE,EAAIC,EACd,IAAMC,EAASH,EAAO,QAAQC,CAAE,EAChC,GAAI,CAACE,EAAQ,MAAM,IAAI,MAAM,4BAA4BF,CAAE,0BAA0B,EACrFF,EAAQE,CAAE,EAAIE,CAChB,CACA,QAAWF,KAAM,OAAO,KAAKD,EAAO,OAAO,EACzC,GAAI,CAACA,EAAO,QAAQC,CAAE,EAAG,MAAM,IAAI,MAAM,mCAAmCA,CAAE,wBAAwB,CAE1G,CACA,MAAO,CAAE,QAAAH,EAAS,QAAAC,CAAQ,CAC5B","names":["mergeAgentFacingCapabilityCatalogs","catalogs","catalog","details","source","id","entry","detail"]}
@@ -0,0 +1,2 @@
1
+ import{a as M,b as P,f as F,g as A,h as $,i as I,j as z,k as L}from"./chunk-OFWGYY7S.js";import{b as k,d as w,g as S,j as b,k as y,l as V,m as v,n as N}from"./chunk-XA6FE7ZK.js";import O from"react";import{Text as W}from"@fluentui/react-components";import{runDeclarativeValidators as _}from"@gik-ai/evaluators";import{jsx as G,jsxs as Y}from"react/jsx-runtime";var U=M,B={$schema:"http://json-schema.org/draft-07/schema#",type:"object",additionalProperties:!1,required:["value"],properties:{...S,label:{type:"string"},value:{type:["string","number"]},variant:{enum:U},hourFormat:{enum:["24","12"]},showSeconds:{type:"boolean"},showTimeZone:{type:"boolean"}}},J=({node:a})=>{let e=a.props.variant??"timestamp",i=a.props.value,r=G("time",{dateTime:new Date(i).toISOString(),children:G(W,{children:P(i,e,{hourFormat:a.props.hourFormat==="12"?"12":"24",showSeconds:a.props.showSeconds===!0,showTimeZone:a.props.showTimeZone===!0})})});return a.props.label?Y("span",{...b(a),children:[G(W,{weight:"semibold",children:String(a.props.label)})," ",r]}):O.cloneElement(r,b(a))},H={capability:"primitive:datetime",summary:"Formats a date, time, or timestamp for the browser's locale and local timezone.",dataProp:"value",events:[],semanticTokens:[],defaultVariant:"timestamp",variants:[{value:"date",summary:"Calendar date without a clock time.",useWhen:["The day matters but time-of-day does not"]},{value:"time",summary:"Localized clock time without a timezone suffix.",useWhen:["The date is already established by surrounding context"]},{value:"timestamp",summary:"Localized calendar date and clock time.",useWhen:["Users need the date and local time of an event"]}],authoring:{useWhen:["A scalar temporal value needs consistent human-readable presentation","Semantic HTML time metadata should preserve the source instant"],avoidWhen:["Users must edit the value; use primitive:form","Multiple temporal records form a chronology; use semantic:event-series"],rules:["Provide a parseable ISO timestamp or epoch value","Choose date, time, or timestamp according to the surrounding semantic context","Time uses 24-hour format by default; set hourFormat to 12 for locale-appropriate AM/PM output","Time and timestamp omit seconds by default; set showSeconds when second-level precision is meaningful","Formatting follows the browser locale and local timezone; set showTimeZone only when the timezone label is useful"]}};function j(){return B}function K(a){let e=_([{kind:"ajv-schema",schema:j(),message:"Invalid primitive:datetime props",code:"primitive-datetime-schema"}],a);if(!e.ok)return e;let i=a.value;return Number.isFinite(new Date(i).getTime())||(e.ok=!1,e.errors.push({detail:"DateTime value must be a parseable timestamp",code:"datetime-parseable-value"})),e}function Q(){return w("primitive:datetime",{value:"2026-07-17T23:09:23Z",variant:"timestamp"})}var ye=k({description:H,version:"1.1.0",component:J,getSchema:j,validate:K,materializeTrial:Q});import ee from"react";import{Text as g,makeStyles as te,mergeClasses as C,tokens as n}from"@fluentui/react-components";import{runDeclarativeValidators as ae}from"@gik-ai/evaluators";import{jsx as m,jsxs as h}from"react/jsx-runtime";var ie=["standard","compact"],Ve=F,ne={$schema:"http://json-schema.org/draft-07/schema#",type:"object",additionalProperties:!1,required:["items","spec"],properties:{...S,items:{type:"array",items:{type:"object"}},variant:{enum:ie},spec:{type:"object",additionalProperties:!1,required:["fields"],properties:{title:{type:"string"},description:{type:"string"},emptyText:{type:"string"},scale:{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["datetime","linear"]},hourFormat:{enum:["24","12"]},displayPrefix:{type:"string"},minimum:{type:"number"},maximum:{type:"number"},tickStep:{type:"number",exclusiveMinimum:0},showSeconds:{type:"boolean"},showTimeZone:{type:"boolean"}}},fields:{type:"object",additionalProperties:!1,required:["id","label","start","end"],properties:{id:{type:"string",minLength:1},label:{type:"string",minLength:1},start:{type:"string",minLength:1},end:{type:"string",minLength:1},detail:{type:"string",minLength:1}}}}}}},oe=te({root:{display:"grid",gap:n.spacingVerticalM,minWidth:0},compactRoot:{gap:n.spacingVerticalS},header:{display:"grid",gap:n.spacingVerticalXXS},description:{color:n.colorNeutralForeground3},rows:{display:"grid",gap:n.spacingVerticalS,minWidth:0},compactRows:{gap:n.spacingVerticalXS},row:{display:"grid",gridTemplateColumns:"minmax(10rem, 0.7fr) minmax(14rem, 1.3fr)",gap:n.spacingHorizontalM,alignItems:"center","@media (max-width: 600px)":{gridTemplateColumns:"minmax(0, 1fr)",gap:n.spacingVerticalXS}},axisRow:{display:"grid",gridTemplateColumns:"minmax(10rem, 0.7fr) minmax(14rem, 1.3fr)",gap:n.spacingHorizontalM,"@media (max-width: 600px)":{gridTemplateColumns:"minmax(0, 1fr)"}},axisSpacer:{"@media (max-width: 600px)":{display:"none"}},axis:{position:"relative",height:"1.75rem",borderBottom:`${n.strokeWidthThin} solid ${n.colorNeutralStroke1}`},tick:{position:"absolute",bottom:0,height:"0.375rem",width:n.strokeWidthThin,backgroundColor:n.colorNeutralStroke1},tickLabel:{position:"absolute",bottom:"0.5rem",color:n.colorNeutralForeground3,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",transform:"translateX(-50%)"},firstTickLabel:{transform:"none"},lastTickLabel:{transform:"translateX(-100%)"},label:{display:"grid",gap:n.spacingVerticalXXS,minWidth:0},detail:{color:n.colorNeutralForeground3},time:{color:n.colorNeutralForeground3,fontVariantNumeric:"tabular-nums"},track:{position:"relative",height:"2rem",overflow:"hidden",borderRadius:n.borderRadiusMedium,backgroundColor:n.colorNeutralBackground3},compactTrack:{height:"1.5rem"},bar:{position:"absolute",top:"0.25rem",bottom:"0.25rem",minWidth:"3px",borderRadius:n.borderRadiusSmall,backgroundColor:n.colorBrandBackground}});function R(a,e){return A(a,e)}function Z(a,e){return $(a,e)}function re(a,e){return I(a,e)}var se=({node:a})=>{let e=oe(),i=a.props.spec,r=i.scale??{kind:"datetime"},f=a.props.variant==="compact",o=V(a.props.items).map((t,c)=>{let p=v(t,i.fields?.start),x=v(t,i.fields?.end);return{id:N(t,i.fields?.id)||String(c),label:N(t,i.fields?.label),detail:N(t,i.fields?.detail),startText:Z(p,r),endText:Z(x,r),start:R(p,r),end:R(x,r)}}).filter(t=>t.label&&Number.isFinite(t.start)&&Number.isFinite(t.end)&&t.end>=t.start);if(!i.fields||o.length===0)return m(g,{...b(a),children:i.emptyText??"No Gantt intervals available."});let s=r.kind==="linear"&&r.minimum!==void 0?r.minimum:Math.min(...o.map(t=>t.start)),u=r.kind==="linear"&&r.maximum!==void 0?r.maximum:Math.max(...o.map(t=>t.end)),d=Math.max(1,u-s),T=z(s,u,r.tickStep);return h("figure",{...b(a,C(e.root,f&&e.compactRoot)),"aria-label":i.title??"Gantt chart",children:[i.title||i.description?h("figcaption",{className:e.header,children:[i.title?m(g,{weight:"semibold",size:500,children:i.title}):null,i.description?m(g,{className:e.description,children:i.description}):null]}):null,h("div",{className:C(e.rows,f&&e.compactRows),children:[T.length>0?h("div",{className:e.axisRow,"aria-label":"Gantt scale",children:[m("div",{className:e.axisSpacer}),m("div",{className:e.axis,children:T.map((t,c)=>{let p=(t-s)/d*100;return h(ee.Fragment,{children:[m("span",{className:e.tick,style:{left:`${p}%`},"aria-hidden":"true"}),m(g,{className:C(e.tickLabel,c===0&&e.firstTickLabel,c===T.length-1&&e.lastTickLabel),size:200,style:{left:`${p}%`},children:re(t,r)})]},t)})})]}):null,o.map(t=>{let c=(t.start-s)/d*100,p=Math.max(0,t.end-t.start)/d*100;return h("div",{className:e.row,children:[h("div",{className:e.label,children:[m(g,{weight:"semibold",children:t.label}),!f&&t.detail?m(g,{className:e.detail,size:200,children:t.detail}):null,h(g,{className:e.time,size:200,children:[t.startText," - ",t.endText]})]}),m("div",{className:C(e.track,f&&e.compactTrack),"aria-hidden":"true",children:m("div",{className:e.bar,style:{left:`${c}%`,width:`${Math.min(100-c,Math.max(.5,p))}%`}})})]},t.id)})]})]})},E={capability:"primitive:gantt",summary:"Renders mapped intervals on a shared datetime or linear coordinate scale.",dataProp:"items",events:[],semanticTokens:[],defaultVariant:"standard",variants:[{value:"standard",summary:"Full labels, details, timestamps, and interval tracks.",useWhen:["The Gantt is a primary temporal comparison","Interval context should remain visible"]},{value:"compact",summary:"Reduced-height tracks and labels without details.",useWhen:["The Gantt is embedded in a dense supporting surface","Users primarily compare timing and duration"]}],authoring:{useWhen:["Records have meaningful start and end coordinates","Users need to compare duration, span, or overlap"],avoidWhen:["Records are point events; use semantic:event-series","Order is non-temporal; use semantic:process"],rules:["Provide unique stable ids","Use datetime for actual timestamps and numeric linear coordinates for logical order or progress","Use displayPrefix only to format linear coordinates, such as showing 1 as T1","Set a positive tickStep in milliseconds for datetime or coordinate units for linear when the scale should show shared column markers","Ensure each end is not earlier than its start","Use one consistent scale across all intervals"]}};function X(){return ne}function Pe(){return E}function me(a){let e=ae([{kind:"ajv-schema",schema:X(),message:"Invalid primitive:gantt props",code:"primitive-gantt-schema"},{kind:"jsonata",expr:"($field := data.spec.fields.id; $ids := data.items.$lookup($, $field); $count($ids) = $count($distinct($ids)))",message:"Gantt item ids must be unique",code:"gantt-unique-item-id"}],a);if(!e.ok)return e;let i=y(a),r=y(i.spec),f=y(r.fields),o=y(r.scale),s=o.kind==="linear"?{kind:"linear",displayPrefix:typeof o.displayPrefix=="string"?o.displayPrefix:void 0,minimum:typeof o.minimum=="number"?o.minimum:void 0,maximum:typeof o.maximum=="number"?o.maximum:void 0,tickStep:typeof o.tickStep=="number"?o.tickStep:void 0}:{kind:"datetime",hourFormat:o.hourFormat==="12"?"12":"24",tickStep:typeof o.tickStep=="number"?o.tickStep:void 0,showSeconds:o.showSeconds===!0,showTimeZone:o.showTimeZone===!0},u=s.kind==="linear"?s.minimum:void 0,d=s.kind==="linear"?s.maximum:void 0,T=u!==void 0&&d!==void 0&&d<=u,t=V(i.items).map(l=>({start:R(v(l,String(f.start)),s),end:R(v(l,String(f.end)),s)})),c=u??Math.min(...t.map(l=>l.start)),p=d??Math.max(...t.map(l=>l.end)),x=L(c,p,s.tickStep),q=t.some(({start:l,end:D})=>!Number.isFinite(l)||!Number.isFinite(D)||D<l||u!==void 0&&l<u||d!==void 0&&D>d);return(T||x||q)&&(e.ok=!1,e.errors.push({detail:"Gantt intervals must be valid, ordered coordinates within the configured scale bounds",code:"gantt-valid-interval"})),e}function le(){return w("primitive:gantt",{variant:"standard",items:[{id:"initial-access",label:"Initial access",detail:"Threat actor authenticated as admin",start:"2026-07-17T23:09:23Z",end:"2026-07-17T23:09:27Z"},{id:"collection",label:"Mailbox collection",detail:"Admin identity accessed finance mailbox",start:"2026-07-17T23:09:25Z",end:"2026-07-17T23:09:34Z"}],spec:{title:"Attack activity",description:"Observed relationship intervals",fields:{id:"id",label:"label",detail:"detail",start:"start",end:"end"}}})}var Ge=k({description:E,version:"1.4.0",component:se,getSchema:X,validate:me,materializeTrial:le});export{U as a,J as b,j as c,K as d,Q as e,ye as f,ie as g,Ve as h,R as i,Z as j,re as k,se as l,X as m,Pe as n,me as o,le as p,Ge as q};
2
+ //# sourceMappingURL=chunk-H6T3CCU5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/datetime/DateTime.tsx","../src/primitives/gantt/Gantt.tsx"],"sourcesContent":["import React from \"react\";\nimport { Text } from \"@fluentui/react-components\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { componentRootProps, componentStylePropsSchema } from \"../../shared/component\";\nimport {\n DATE_TIME_PRESENTATIONS,\n formatDateTime,\n type DateTimePresentation,\n} from \"../../shared/dateTimeFormat\";\nimport { defineComponent, trialNode, type ComponentDescription, type ComponentValidationReport } from \"../../shared/definition\";\n\nexport const DATETIME_VARIANTS = DATE_TIME_PRESENTATIONS;\nexport type DateTimeVariant = DateTimePresentation;\nexport {\n formatDate,\n formatDateTime,\n formatTime,\n formatTimestamp,\n type DateTimeFormatOptions,\n} from \"../../shared/dateTimeFormat\";\n\nconst schema = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n additionalProperties: false,\n required: [\"value\"],\n properties: {\n ...componentStylePropsSchema,\n label: { type: \"string\" },\n value: { type: [\"string\", \"number\"] },\n variant: { enum: DATETIME_VARIANTS },\n hourFormat: { enum: [\"24\", \"12\"] },\n showSeconds: { type: \"boolean\" },\n showTimeZone: { type: \"boolean\" },\n },\n} as const;\n\nexport const DateTime: ProjectionView = ({ node }) => {\n const variant = (node.props.variant ?? \"timestamp\") as DateTimeVariant;\n const rawValue = node.props.value as string | number;\n const value = <time dateTime={new Date(rawValue).toISOString()}><Text>{formatDateTime(rawValue, variant, { hourFormat: node.props.hourFormat === \"12\" ? \"12\" : \"24\", showSeconds: node.props.showSeconds === true, showTimeZone: node.props.showTimeZone === true })}</Text></time>;\n return node.props.label\n ? <span {...componentRootProps(node)}><Text weight=\"semibold\">{String(node.props.label)}</Text>{\" \"}{value}</span>\n : React.cloneElement(value, componentRootProps(node));\n};\n\nconst description: ComponentDescription = {\n capability: \"primitive:datetime\",\n summary: \"Formats a date, time, or timestamp for the browser's locale and local timezone.\",\n dataProp: \"value\",\n events: [],\n semanticTokens: [],\n defaultVariant: \"timestamp\",\n variants: [\n { value: \"date\", summary: \"Calendar date without a clock time.\", useWhen: [\"The day matters but time-of-day does not\"] },\n { value: \"time\", summary: \"Localized clock time without a timezone suffix.\", useWhen: [\"The date is already established by surrounding context\"] },\n { value: \"timestamp\", summary: \"Localized calendar date and clock time.\", useWhen: [\"Users need the date and local time of an event\"] },\n ],\n authoring: {\n useWhen: [\"A scalar temporal value needs consistent human-readable presentation\", \"Semantic HTML time metadata should preserve the source instant\"],\n avoidWhen: [\"Users must edit the value; use primitive:form\", \"Multiple temporal records form a chronology; use semantic:event-series\"],\n rules: [\"Provide a parseable ISO timestamp or epoch value\", \"Choose date, time, or timestamp according to the surrounding semantic context\", \"Time uses 24-hour format by default; set hourFormat to 12 for locale-appropriate AM/PM output\", \"Time and timestamp omit seconds by default; set showSeconds when second-level precision is meaningful\", \"Formatting follows the browser locale and local timezone; set showTimeZone only when the timezone label is useful\"],\n },\n};\n\nexport function getDateTimeSchema(): Record<string, unknown> { return schema as unknown as Record<string, unknown>; }\nexport function validateDateTime(props: unknown): ComponentValidationReport {\n const report = runDeclarativeValidators([\n { kind: \"ajv-schema\", schema: getDateTimeSchema(), message: \"Invalid primitive:datetime props\", code: \"primitive-datetime-schema\" },\n ], props as Json);\n if (!report.ok) return report;\n const value = (props as { value: string | number }).value;\n if (!Number.isFinite(new Date(value).getTime())) {\n report.ok = false;\n report.errors.push({ detail: \"DateTime value must be a parseable timestamp\", code: \"datetime-parseable-value\" });\n }\n return report;\n}\nexport function materializeDateTimeTrial() {\n return trialNode(\"primitive:datetime\", { value: \"2026-07-17T23:09:23Z\", variant: \"timestamp\" });\n}\nexport const dateTimeDefinition = defineComponent({ description, version: \"1.1.0\", component: DateTime, getSchema: getDateTimeSchema, validate: validateDateTime, materializeTrial: materializeDateTimeTrial });\n","import React from \"react\";\nimport { Text, makeStyles, mergeClasses, tokens } from \"@fluentui/react-components\";\nimport type { Json } from \"@gik-ai/kernel\";\nimport { runDeclarativeValidators } from \"@gik-ai/evaluators\";\nimport type { ProjectionView } from \"@gik-ai/react\";\n\nimport { defineComponent, trialNode, type ComponentDescription, type ComponentValidationReport } from \"../../shared/definition\";\nimport { asRecord, componentRootProps, componentStylePropsSchema, readPath, records, textAt } from \"../../shared/component\";\nimport {\n MAX_COORDINATE_TICKS,\n coordinateTickCountExceedsLimit,\n coordinateTicks,\n formatAxisCoordinate,\n formatCoordinate,\n parseCoordinate,\n type CoordinateScale,\n} from \"../../shared/coordinateScale\";\n\nexport const GANTT_VARIANTS = [\"standard\", \"compact\"] as const;\nexport const MAX_GANTT_TICKS = MAX_COORDINATE_TICKS;\nexport type GanttScale = CoordinateScale;\n\nexport interface GanttSpec {\n title?: string;\n description?: string;\n emptyText?: string;\n scale?: GanttScale;\n fields: {\n id: string;\n label: string;\n start: string;\n end: string;\n detail?: string;\n };\n}\n\nconst schema = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n additionalProperties: false,\n required: [\"items\", \"spec\"],\n properties: {\n ...componentStylePropsSchema,\n items: { type: \"array\", items: { type: \"object\" } },\n variant: { enum: GANTT_VARIANTS },\n spec: {\n type: \"object\",\n additionalProperties: false,\n required: [\"fields\"],\n properties: {\n title: { type: \"string\" },\n description: { type: \"string\" },\n emptyText: { type: \"string\" },\n scale: {\n type: \"object\",\n additionalProperties: false,\n required: [\"kind\"],\n properties: {\n kind: { enum: [\"datetime\", \"linear\"] },\n hourFormat: { enum: [\"24\", \"12\"] },\n displayPrefix: { type: \"string\" },\n minimum: { type: \"number\" },\n maximum: { type: \"number\" },\n tickStep: { type: \"number\", exclusiveMinimum: 0 },\n showSeconds: { type: \"boolean\" },\n showTimeZone: { type: \"boolean\" },\n },\n },\n fields: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"label\", \"start\", \"end\"],\n properties: {\n id: { type: \"string\", minLength: 1 },\n label: { type: \"string\", minLength: 1 },\n start: { type: \"string\", minLength: 1 },\n end: { type: \"string\", minLength: 1 },\n detail: { type: \"string\", minLength: 1 },\n },\n },\n },\n },\n },\n} as const;\n\nconst useStyles = makeStyles({\n root: { display: \"grid\", gap: tokens.spacingVerticalM, minWidth: 0 },\n compactRoot: { gap: tokens.spacingVerticalS },\n header: { display: \"grid\", gap: tokens.spacingVerticalXXS },\n description: { color: tokens.colorNeutralForeground3 },\n rows: { display: \"grid\", gap: tokens.spacingVerticalS, minWidth: 0 },\n compactRows: { gap: tokens.spacingVerticalXS },\n row: { display: \"grid\", gridTemplateColumns: \"minmax(10rem, 0.7fr) minmax(14rem, 1.3fr)\", gap: tokens.spacingHorizontalM, alignItems: \"center\", \"@media (max-width: 600px)\": { gridTemplateColumns: \"minmax(0, 1fr)\", gap: tokens.spacingVerticalXS } },\n axisRow: { display: \"grid\", gridTemplateColumns: \"minmax(10rem, 0.7fr) minmax(14rem, 1.3fr)\", gap: tokens.spacingHorizontalM, \"@media (max-width: 600px)\": { gridTemplateColumns: \"minmax(0, 1fr)\" } },\n axisSpacer: { \"@media (max-width: 600px)\": { display: \"none\" } },\n axis: { position: \"relative\", height: \"1.75rem\", borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}` },\n tick: { position: \"absolute\", bottom: 0, height: \"0.375rem\", width: tokens.strokeWidthThin, backgroundColor: tokens.colorNeutralStroke1 },\n tickLabel: { position: \"absolute\", bottom: \"0.5rem\", color: tokens.colorNeutralForeground3, fontVariantNumeric: \"tabular-nums\", whiteSpace: \"nowrap\", transform: \"translateX(-50%)\" },\n firstTickLabel: { transform: \"none\" },\n lastTickLabel: { transform: \"translateX(-100%)\" },\n label: { display: \"grid\", gap: tokens.spacingVerticalXXS, minWidth: 0 },\n detail: { color: tokens.colorNeutralForeground3 },\n time: { color: tokens.colorNeutralForeground3, fontVariantNumeric: \"tabular-nums\" },\n track: { position: \"relative\", height: \"2rem\", overflow: \"hidden\", borderRadius: tokens.borderRadiusMedium, backgroundColor: tokens.colorNeutralBackground3 },\n compactTrack: { height: \"1.5rem\" },\n bar: { position: \"absolute\", top: \"0.25rem\", bottom: \"0.25rem\", minWidth: \"3px\", borderRadius: tokens.borderRadiusSmall, backgroundColor: tokens.colorBrandBackground },\n});\n\nexport function parseGanttCoordinate(value: unknown, scale: GanttScale): number {\n return parseCoordinate(value, scale);\n}\n\nexport function formatGanttCoordinate(value: unknown, scale: GanttScale): string {\n return formatCoordinate(value, scale);\n}\n\nexport function formatGanttAxisCoordinate(value: number, scale: GanttScale): string {\n return formatAxisCoordinate(value, scale);\n}\n\nexport const Gantt: ProjectionView = ({ node }) => {\n const styles = useStyles();\n const spec = node.props.spec as unknown as GanttSpec;\n const scale = spec.scale ?? { kind: \"datetime\" };\n const compact = node.props.variant === \"compact\";\n const intervals = records(node.props.items).map((item, index) => {\n const startValue = readPath(item, spec.fields?.start);\n const endValue = readPath(item, spec.fields?.end);\n return {\n id: textAt(item, spec.fields?.id) || String(index),\n label: textAt(item, spec.fields?.label),\n detail: textAt(item, spec.fields?.detail),\n startText: formatGanttCoordinate(startValue, scale),\n endText: formatGanttCoordinate(endValue, scale),\n start: parseGanttCoordinate(startValue, scale),\n end: parseGanttCoordinate(endValue, scale),\n };\n }).filter((interval) => interval.label && Number.isFinite(interval.start) && Number.isFinite(interval.end) && interval.end >= interval.start);\n\n if (!spec.fields || intervals.length === 0) return <Text {...componentRootProps(node)}>{spec.emptyText ?? \"No Gantt intervals available.\"}</Text>;\n const minimum = scale.kind === \"linear\" && scale.minimum !== undefined ? scale.minimum : Math.min(...intervals.map((interval) => interval.start));\n const maximum = scale.kind === \"linear\" && scale.maximum !== undefined ? scale.maximum : Math.max(...intervals.map((interval) => interval.end));\n const span = Math.max(1, maximum - minimum);\n const ticks = coordinateTicks(minimum, maximum, scale.tickStep);\n\n return <figure {...componentRootProps(node, mergeClasses(styles.root, compact && styles.compactRoot))} aria-label={spec.title ?? \"Gantt chart\"}>\n {spec.title || spec.description ? <figcaption className={styles.header}>{spec.title ? <Text weight=\"semibold\" size={500}>{spec.title}</Text> : null}{spec.description ? <Text className={styles.description}>{spec.description}</Text> : null}</figcaption> : null}\n <div className={mergeClasses(styles.rows, compact && styles.compactRows)}>\n {ticks.length > 0 ? <div className={styles.axisRow} aria-label=\"Gantt scale\"><div className={styles.axisSpacer} /><div className={styles.axis}>{ticks.map((tick, index) => {\n const left = ((tick - minimum) / span) * 100;\n return <React.Fragment key={tick}><span className={styles.tick} style={{ left: `${left}%` }} aria-hidden=\"true\" /><Text className={mergeClasses(styles.tickLabel, index === 0 && styles.firstTickLabel, index === ticks.length - 1 && styles.lastTickLabel)} size={200} style={{ left: `${left}%` }}>{formatGanttAxisCoordinate(tick, scale)}</Text></React.Fragment>;\n })}</div></div> : null}\n {intervals.map((interval) => {\n const left = ((interval.start - minimum) / span) * 100;\n const width = (Math.max(0, interval.end - interval.start) / span) * 100;\n return <div className={styles.row} key={interval.id}>\n <div className={styles.label}><Text weight=\"semibold\">{interval.label}</Text>{!compact && interval.detail ? <Text className={styles.detail} size={200}>{interval.detail}</Text> : null}<Text className={styles.time} size={200}>{interval.startText} - {interval.endText}</Text></div>\n <div className={mergeClasses(styles.track, compact && styles.compactTrack)} aria-hidden=\"true\"><div className={styles.bar} style={{ left: `${left}%`, width: `${Math.min(100 - left, Math.max(0.5, width))}%` }} /></div>\n </div>;\n })}</div>\n </figure>;\n};\n\nconst description: ComponentDescription = {\n capability: \"primitive:gantt\",\n summary: \"Renders mapped intervals on a shared datetime or linear coordinate scale.\",\n dataProp: \"items\",\n events: [],\n semanticTokens: [],\n defaultVariant: \"standard\",\n variants: [\n { value: \"standard\", summary: \"Full labels, details, timestamps, and interval tracks.\", useWhen: [\"The Gantt is a primary temporal comparison\", \"Interval context should remain visible\"] },\n { value: \"compact\", summary: \"Reduced-height tracks and labels without details.\", useWhen: [\"The Gantt is embedded in a dense supporting surface\", \"Users primarily compare timing and duration\"] },\n ],\n authoring: {\n useWhen: [\"Records have meaningful start and end coordinates\", \"Users need to compare duration, span, or overlap\"],\n avoidWhen: [\"Records are point events; use semantic:event-series\", \"Order is non-temporal; use semantic:process\"],\n rules: [\"Provide unique stable ids\", \"Use datetime for actual timestamps and numeric linear coordinates for logical order or progress\", \"Use displayPrefix only to format linear coordinates, such as showing 1 as T1\", \"Set a positive tickStep in milliseconds for datetime or coordinate units for linear when the scale should show shared column markers\", \"Ensure each end is not earlier than its start\", \"Use one consistent scale across all intervals\"],\n },\n};\n\nexport function getGanttSchema(): Record<string, unknown> { return schema as unknown as Record<string, unknown>; }\nexport function describeGantt(): ComponentDescription { return description; }\nexport function validateGantt(props: unknown): ComponentValidationReport {\n const report = runDeclarativeValidators([\n { kind: \"ajv-schema\", schema: getGanttSchema(), message: \"Invalid primitive:gantt props\", code: \"primitive-gantt-schema\" },\n { kind: \"jsonata\", expr: \"($field := data.spec.fields.id; $ids := data.items.$lookup($, $field); $count($ids) = $count($distinct($ids)))\", message: \"Gantt item ids must be unique\", code: \"gantt-unique-item-id\" },\n ], props as Json);\n if (!report.ok) return report;\n const propsRecord = asRecord(props);\n const spec = asRecord(propsRecord.spec);\n const fields = asRecord(spec.fields);\n const scaleRecord = asRecord(spec.scale);\n const scale: GanttScale = scaleRecord.kind === \"linear\"\n ? { kind: \"linear\", displayPrefix: typeof scaleRecord.displayPrefix === \"string\" ? scaleRecord.displayPrefix : undefined, minimum: typeof scaleRecord.minimum === \"number\" ? scaleRecord.minimum : undefined, maximum: typeof scaleRecord.maximum === \"number\" ? scaleRecord.maximum : undefined, tickStep: typeof scaleRecord.tickStep === \"number\" ? scaleRecord.tickStep : undefined }\n : { kind: \"datetime\", hourFormat: scaleRecord.hourFormat === \"12\" ? \"12\" : \"24\", tickStep: typeof scaleRecord.tickStep === \"number\" ? scaleRecord.tickStep : undefined, showSeconds: scaleRecord.showSeconds === true, showTimeZone: scaleRecord.showTimeZone === true };\n const minimum = scale.kind === \"linear\" ? scale.minimum : undefined;\n const maximum = scale.kind === \"linear\" ? scale.maximum : undefined;\n const invalidDomain = minimum !== undefined && maximum !== undefined && maximum <= minimum;\n const parsedIntervals = records(propsRecord.items).map((item) => ({\n start: parseGanttCoordinate(readPath(item, String(fields.start)), scale),\n end: parseGanttCoordinate(readPath(item, String(fields.end)), scale),\n }));\n const domainMinimum = minimum ?? Math.min(...parsedIntervals.map((interval) => interval.start));\n const domainMaximum = maximum ?? Math.max(...parsedIntervals.map((interval) => interval.end));\n const invalidTickCount = coordinateTickCountExceedsLimit(domainMinimum, domainMaximum, scale.tickStep);\n const invalidInterval = parsedIntervals.some(({ start, end }) => {\n return !Number.isFinite(start) || !Number.isFinite(end) || end < start\n || (minimum !== undefined && start < minimum)\n || (maximum !== undefined && end > maximum);\n });\n if (invalidDomain || invalidTickCount || invalidInterval) {\n report.ok = false;\n report.errors.push({ detail: \"Gantt intervals must be valid, ordered coordinates within the configured scale bounds\", code: \"gantt-valid-interval\" });\n }\n return report;\n}\nexport function materializeGanttTrial() {\n return trialNode(\"primitive:gantt\", {\n variant: \"standard\",\n items: [\n { id: \"initial-access\", label: \"Initial access\", detail: \"Threat actor authenticated as admin\", start: \"2026-07-17T23:09:23Z\", end: \"2026-07-17T23:09:27Z\" },\n { id: \"collection\", label: \"Mailbox collection\", detail: \"Admin identity accessed finance mailbox\", start: \"2026-07-17T23:09:25Z\", end: \"2026-07-17T23:09:34Z\" },\n ],\n spec: { title: \"Attack activity\", description: \"Observed relationship intervals\", fields: { id: \"id\", label: \"label\", detail: \"detail\", start: \"start\", end: \"end\" } },\n });\n}\nexport const ganttDefinition = defineComponent({ description, version: \"1.4.0\", component: Gantt, getSchema: getGanttSchema, validate: validateGantt, materializeTrial: materializeGanttTrial });"],"mappings":"kLAAA,OAAOA,MAAW,QAClB,OAAS,QAAAC,MAAY,6BAErB,OAAS,4BAAAC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TIME_PRESENTATIONS","schema","componentStylePropsSchema","DateTime","node","variant","rawValue","value","Text","formatDateTime","componentRootProps","React","description","getDateTimeSchema","validateDateTime","props","report","runDeclarativeValidators","materializeDateTimeTrial","trialNode","dateTimeDefinition","defineComponent","React","Text","makeStyles","mergeClasses","tokens","runDeclarativeValidators","jsx","jsxs","GANTT_VARIANTS","MAX_GANTT_TICKS","MAX_COORDINATE_TICKS","schema","componentStylePropsSchema","useStyles","makeStyles","tokens","parseGanttCoordinate","value","scale","parseCoordinate","formatGanttCoordinate","formatCoordinate","formatGanttAxisCoordinate","formatAxisCoordinate","Gantt","node","styles","spec","compact","intervals","records","item","index","startValue","readPath","endValue","textAt","interval","Text","componentRootProps","minimum","maximum","span","ticks","coordinateTicks","mergeClasses","tick","left","React","width","description","getGanttSchema","describeGantt","validateGantt","props","report","runDeclarativeValidators","propsRecord","asRecord","fields","scaleRecord","invalidDomain","parsedIntervals","domainMinimum","domainMaximum","invalidTickCount","coordinateTickCountExceedsLimit","invalidInterval","start","end","materializeGanttTrial","trialNode","ganttDefinition","defineComponent"]}