@casys/mcp-erpnext 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -129
- package/mcp-erpnext.mjs +3809 -1410
- package/package.json +1 -1
- package/ui-dist/chart-viewer/index.html +1 -1
- package/ui-dist/doclist-viewer/index.html +1 -1
- package/ui-dist/funnel-viewer/index.html +1 -1
- package/ui-dist/invoice-viewer/index.html +1 -1
- package/ui-dist/kanban-viewer/index.html +1 -1
- package/ui-dist/kpi-viewer/index.html +1 -1
- package/ui-dist/stock-viewer/index.html +1 -1
|
@@ -145,7 +145,7 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
145
145
|
- omitted: host decides border`)});j({method:x("ui/request-display-mode"),params:j({mode:ho.describe("The display mode being requested.")})});var p4=j({mode:ho.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),g4=pe([x("model"),x("app")]).describe("Tool visibility scope - who can access the tool.");j({resourceUri:I().optional(),visibility:ie(g4).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
146
146
|
- "model": Tool visible to and callable by the agent
|
|
147
147
|
- "app": Tool callable by the app from this server only`),csp:_r().optional(),permissions:_r().optional()});j({mimeTypes:ie(I()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});j({method:x("ui/download-file"),params:j({contents:ie(pe([_S,$S])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});j({method:x("ui/message"),params:j({role:x("user").describe('Message role, currently only "user" is supported.'),content:ie(ya).describe("Message content blocks (text, image, etc.).")})});j({method:x("ui/notifications/sandbox-resource-ready"),params:j({html:I().describe("HTML content to load into the inner iframe."),sandbox:I().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:ep.optional().describe("CSP configuration from resource metadata."),permissions:tp.optional().describe("Sandbox permissions from resource metadata.")})});var h4=j({method:x("ui/notifications/tool-result"),params:tu.describe("Standard MCP tool execution result.")}),IS=j({toolInfo:j({id:fa.optional().describe("JSON-RPC id of the tools/call request."),tool:Ym.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:e4.optional().describe("Current color theme preference."),styles:c4.optional().describe("Style configuration for theming the app."),displayMode:ho.optional().describe("How the UI is currently displayed."),availableDisplayModes:ie(ho).optional().describe("Display modes the host supports."),containerDimensions:pe([j({height:ue().describe("Fixed container height in pixels.")}),j({maxHeight:pe([ue(),ii()]).optional().describe("Maximum container height in pixels.")})]).and(pe([j({width:ue().describe("Fixed container width in pixels.")}),j({maxWidth:pe([ue(),ii()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
148
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:I().optional().describe("User's language and region preference in BCP 47 format."),timeZone:I().optional().describe("User's timezone in IANA format."),userAgent:I().optional().describe("Host application identifier."),platform:pe([x("web"),x("desktop"),x("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:j({touch:xe().optional().describe("Whether the device supports touch input."),hover:xe().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:j({top:ue().describe("Top safe area inset in pixels."),right:ue().describe("Right safe area inset in pixels."),bottom:ue().describe("Bottom safe area inset in pixels."),left:ue().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),v4=j({method:x("ui/notifications/host-context-changed"),params:IS.describe("Partial context update containing only changed fields.")});j({method:x("ui/update-model-context"),params:j({content:ie(ya).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:ye(I(),be().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});j({method:x("ui/initialize"),params:j({appInfo:Ys.describe("App identification (name and version)."),appCapabilities:m4.describe("Features and capabilities this app provides."),protocolVersion:I().describe("Protocol version this app supports.")})});var y4=j({protocolVersion:I().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ys.describe("Host application identification and version."),hostCapabilities:f4.describe("Features and capabilities provided by the host."),hostContext:IS.describe("Rich context about the host environment.")}).passthrough(),_4={target:"draft-2020-12"};async function Cv(n,r){let o=n["~standard"];if(o.jsonSchema)return o.jsonSchema[r](_4);if(o.vendor==="zod"){let{z:s}=await Ub(()=>Promise.resolve().then(()=>lz),void 0,import.meta.url);return s.toJSONSchema(n,{io:r})}throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Rv(n,r,o=""){let s=await n["~standard"].validate(r);if(s.issues){let t=s.issues.map(a=>{let c=a.path?.map(m=>typeof m=="object"?m.key:m).join(".");return c?`${c}: ${a.message}`:a.message}).join("; ");throw Error(o+t)}return s.value}class np extends G1{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(r){if(this._initializedSent)return;let o=`[ext-apps] App.${r}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:a4,toolinputpartial:l4,toolresult:h4,toolcancelled:s4,hostcontextchanged:v4};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(r){if(!np.ONE_SHOT_EVENTS.has(r)||this._everHadListener.has(r)||(this._everHadListener.add(r),!this._initializedSent))return;let o=`[ext-apps] "${String(r)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(r,o){o&&this._assertHandlerTiming(r),super.setEventHandler(r,o)}addEventListener(r,o){this._assertHandlerTiming(r),super.addEventListener(r,o)}onEventDispatch(r,o){r==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...o})}constructor(r,o={},s={autoResize:!0}){super(s),this._appInfo=r,this._capabilities=o,this.options=s,s.allowUnsafeEval||Xe({jitless:!0}),this.setRequestHandler(eu,t=>(console.log("Received ping:",t.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(r){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=K1(this._capabilities,r)}registerTool(r,o,s){if(this._registeredTools[r])throw Error(`Tool ${r} is already registered`);let t=this,a=()=>{t._initializedSent&&t._capabilities.tools?.listChanged&&t.sendToolListChanged()},c=o.inputSchema!==void 0,m={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(g){Object.assign(this,g),a()},remove(){t._registeredTools[r]===m&&(delete t._registeredTools[r],a())},handler:async(g,h)=>{if(!m.enabled)throw Error(`Tool ${r} is disabled`);let y;if(c){let k=m.inputSchema,T=k?await Rv(k,g??{},`Invalid input for tool ${r}: `):g??{};y=await s(T,h)}else y=await s(h);return m.outputSchema&&!y.isError&&(y.structuredContent=await Rv(m.outputSchema,y.structuredContent,`Invalid output for tool ${r}: `)),y}};return this._registeredTools[r]=m,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),m}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(r,o)=>{let s=this._registeredTools[r.name];if(!s)throw Error(`Tool ${r.name} not found`);return s.handler(r.arguments,o)},this.onlisttools=async(r,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([s,t])=>t.enabled).map(async([s,t])=>{let a={name:s,title:t.title,description:t.description,inputSchema:t.inputSchema?await Cv(t.inputSchema,"input"):{type:"object",properties:{}}};return t.outputSchema&&(a.outputSchema=await Cv(t.outputSchema,"output")),t.annotations&&(a.annotations=t.annotations),t._meta&&(a._meta=t._meta),a}))}))}async sendToolListChanged(r={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:r})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(r){this.setEventHandler("toolinput",r)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(r){this.setEventHandler("toolinputpartial",r)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(r){this.setEventHandler("toolresult",r)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(r){this.setEventHandler("toolcancelled",r)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(r){this.setEventHandler("hostcontextchanged",r)}_onteardown;get onteardown(){return this._onteardown}set onteardown(r){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,r),this._onteardown=r,this.replaceRequestHandler(d4,(o,s)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o.params,s)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(r){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,r),this._oncalltool=r,this.replaceRequestHandler(SS,(o,s)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,s)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(r){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,r),this._onlisttools=r,this.replaceRequestHandler(kS,(o,s)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,s)})}assertCapabilityForMethod(r){switch(r){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${r})`);break}}assertRequestHandlerCapability(r){switch(r){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${r})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${r} registered`)}}assertNotificationCapability(r){}assertTaskCapability(r){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(r){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(r,o){if(this._assertInitialized("callServerTool"),typeof r=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${r}"). Did you mean: callServerTool({ name: "${r}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:r},tu,{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(r,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:r},yS,o)}async listServerResources(r,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:r},vS,o)}async createSamplingMessage(r,o){this._assertInitialized("createSamplingMessage");let s=r.tools?xS:bS;return await this.request({method:"sampling/createMessage",params:r},s,o)}sendMessage(r,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:r},o4,o)}sendLog(r){return this.notification({method:"notifications/message",params:r})}updateModelContext(r,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:r},Lm,o)}openLink(r,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:r},r4,o)}sendOpenLink=this.openLink;downloadFile(r,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:r},i4,o)}requestTeardown(r={}){return this.notification({method:"ui/notifications/request-teardown",params:r})}requestDisplayMode(r,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:r},p4,o)}sendSizeChanged(r){return this.notification({method:"ui/notifications/size-changed",params:r})}setupSizeChangedNotifications(){let r=!1,o=0,s=0,t=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1;let c=document.documentElement,m=c.style.height;c.style.height="max-content";let g=Math.ceil(c.getBoundingClientRect().height);c.style.height=m;let h=Math.ceil(window.innerWidth);(h!==o||g!==s)&&(o=h,s=g,this.sendSizeChanged({width:h,height:g}))}))};t();let a=new ResizeObserver(t);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(r=new Y1(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(r);try{let s=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Q1}},y4,o);if(s===void 0)throw Error(`Server sent invalid initialize result: ${s}`);this._hostCapabilities=s.hostCapabilities,this._hostInfo=s.hostInfo,this._hostContext=s.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(s){throw this.close(),s}}}function We(n){return`var(${n})`}const F={bg:{surface:We("--bg-surface"),elevated:We("--bg-elevated"),hover:We("--bg-hover")},text:{primary:We("--text-primary"),secondary:We("--text-secondary"),muted:We("--text-muted"),faint:We("--text-faint")},accent:We("--accent"),accentDim:We("--accent-dim"),border:We("--border"),borderSubtle:We("--border-subtle"),success:We("--success"),successDim:We("--success-dim"),error:We("--error"),errorDim:We("--error-dim"),warning:We("--warning"),warningDim:We("--warning-dim"),info:We("--info"),infoDim:We("--info-dim")},zt={sans:We("--font-sans"),mono:We("--font-mono")},on={card:{background:F.bg.surface,border:`1px solid ${F.border}`,borderRadius:"8px",padding:"16px"},badge:(n,r)=>({display:"inline-flex",alignItems:"center",padding:"2px 8px",fontSize:"11px",fontWeight:600,borderRadius:"4px",color:n,background:r,letterSpacing:"0.02em"}),input:{background:F.bg.elevated,border:`1px solid ${F.border}`,borderRadius:"6px",padding:"6px 12px",fontSize:"13px",color:F.text.primary,outline:"none",transition:"border-color 0.15s",width:"100%",fontFamily:zt.sans},button:{background:F.bg.elevated,border:`1px solid ${F.border}`,borderRadius:"6px",padding:"6px 14px",fontSize:"12px",color:F.text.secondary,cursor:"pointer",transition:"all 0.15s",fontFamily:zt.sans,whiteSpace:"nowrap"},buttonActive:{background:F.accentDim,borderColor:F.accent,color:F.accent},tableHeader:{padding:"8px 12px",textAlign:"left",fontSize:"11px",fontWeight:600,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:`1px solid ${F.border}`,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",transition:"color 0.15s"},tableCell:{padding:"8px 12px",fontSize:"13px",borderBottom:`1px solid ${F.borderSubtle}`,color:F.text.primary},mono:{fontFamily:zt.mono,fontSize:"12px"}};function Cl(n,r=2){return n.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}function Lv(n,r="USD"){return n.toLocaleString("en-US",{style:"currency",currency:r,minimumFractionDigits:2,maximumFractionDigits:2})}function $4(){return C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[C.jsx("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.9"}),C.jsx("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.6"}),C.jsx("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.6"}),C.jsx("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.35"})]})}function k4(){const n={display:"flex",alignItems:"center",gap:7,padding:"0 14px",height:30,background:F.bg.surface,borderBottom:`1px solid ${F.border}`,flexShrink:0},r={fontFamily:zt.sans,fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:F.accent},o={width:3,height:3,borderRadius:"50%",background:F.text.faint,marginLeft:2,marginRight:2,flexShrink:0},s={fontFamily:zt.sans,fontSize:10,color:F.text.muted,letterSpacing:"0.03em"};return C.jsxs("div",{style:n,children:[C.jsx("div",{style:{color:F.accent},children:C.jsx($4,{})}),C.jsx("span",{style:r,children:"ERPNext"}),C.jsx("div",{style:o}),C.jsx("span",{style:s,children:"gestion ERP"})]})}function S4(){const n={display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"6px 16px 8px",borderTop:`1px solid ${F.borderSubtle}`,marginTop:8},r={fontFamily:zt.sans,fontSize:10,color:F.text.faint,letterSpacing:"0.04em"};return C.jsx("div",{style:n,children:C.jsx("span",{style:r,children:"Casys AI"})})}function w4(n,r={}){return!n.request||n.visibilityState!=="visible"||n.refreshInFlight?!1:r.ignoreInterval?!0:n.now-n.lastRefreshStartedAt>=n.minIntervalMs}function Zv(n,r){return n?.refreshRequest??r}function b4(n){return n instanceof Error&&/timed? out/i.test(n.message)?"Refresh timed out":"Refresh failed"}function ld(n){return n.structuredContent?JSON.stringify(n.structuredContent):n.content?.find(r=>r.type==="text")?.text??null}function Ul({label:n,value:r,bold:o}){return C.jsxs("div",{style:{padding:"4px 0"},children:[C.jsx("div",{style:{fontSize:10,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:2},children:n}),C.jsx("div",{style:{fontSize:o?15:13,fontWeight:o?600:500,color:F.text.primary,fontFamily:o?zt.mono:zt.sans},children:r??"—"})]})}const Av={success:{color:F.success,bg:F.successDim},error:{color:F.error,bg:F.errorDim},info:{color:F.info,bg:F.infoDim},default:{color:F.text.secondary,bg:F.bg.elevated}};function ed({label:n,variant:r="default",disabled:o,loading:s,confirm:t,onClick:a}){const[c,m]=Re.useState(!1),g=Re.useRef();Re.useEffect(()=>()=>clearTimeout(g.current),[]);const h=Av[r]??Av.default;return C.jsx("button",{onClick:()=>{if(t&&!c){m(!0),clearTimeout(g.current),g.current=setTimeout(()=>m(!1),4e3);return}m(!1),a()},disabled:o||s,style:{...on.button,background:h.bg,color:h.color,borderColor:h.color,opacity:o||s?.5:1,fontSize:11,padding:"4px 10px"},children:s?"…":c?"Confirm?":n})}const Mv=1e4;function x4({app:n,itemCode:r,warehouse:o,onClose:s}){const[t,a]=Re.useState(null),[c,m]=Re.useState(null),[g,h]=Re.useState(!0);return Re.useEffect(()=>{let y=!1;return(async()=>{try{const[k,T]=await Promise.all([n.callServerTool({name:"erpnext_item_get",arguments:{name:r}},{timeout:Mv}),n.callServerTool({name:"erpnext_stock_entry_list",arguments:{limit:5,item_code:r}},{timeout:Mv})]);if(y)return;if(!k.isError){const P=ld(k);if(P){const Z=JSON.parse(P);a(Z.data??Z)}}if(!T.isError){const P=ld(T);if(P){const Z=JSON.parse(P);m(Z.data??[])}}}catch{}y||h(!1)})(),()=>{y=!0}},[r]),g?C.jsx("div",{style:{padding:16,background:F.bg.surface,borderTop:`2px solid ${F.accent}`},children:[1,2].map(y=>C.jsx("div",{className:"skeleton",style:{height:14,width:`${30+y*15}%`,marginBottom:8}},y))}):C.jsxs("div",{style:{padding:16,background:F.bg.surface,borderTop:`2px solid ${F.accent}`},children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10},children:[C.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[C.jsx("span",{style:{fontSize:14,fontWeight:600,color:F.text.primary,fontFamily:zt.mono},children:r}),C.jsx("span",{style:{fontSize:11,color:F.text.muted},children:o})]}),C.jsx("button",{onClick:s,style:{...on.button,padding:"2px 8px",fontSize:11},children:"✕"})]}),t&&C.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:6,marginBottom:10},children:[t.item_name&&C.jsx(Ul,{label:"Name",value:String(t.item_name)}),t.item_group&&C.jsx(Ul,{label:"Group",value:String(t.item_group)}),t.stock_uom&&C.jsx(Ul,{label:"UOM",value:String(t.stock_uom)}),t.standard_rate!=null&&C.jsx(Ul,{label:"Std Rate",value:String(t.standard_rate),bold:!0})]}),c&&c.length>0&&C.jsxs("div",{style:{marginBottom:10},children:[C.jsx("div",{style:{fontSize:10,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Recent Movements"}),c.slice(0,4).map((y,k)=>C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0",borderBottom:`1px solid ${F.borderSubtle}`,fontSize:12},children:[C.jsx("span",{style:{color:F.text.secondary},children:String(y.stock_entry_type??y.name??"—")}),C.jsx("span",{style:{fontFamily:zt.mono,color:F.text.primary},children:String(y.posting_date??"—")})]},k))]}),C.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,borderTop:`1px solid ${F.border}`},children:[C.jsx(ed,{label:"Stock chart",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show stock chart for item ${r}`}]})}catch{}}}),C.jsx(ed,{label:"Item details",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show me the full details of Item ${r}`}]})}catch{}}}),C.jsx(ed,{label:"Stock entries",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show stock entries for item ${r}`}]})}catch{}}})]})]})}const pr=new np({name:"Stock Viewer",version:"2.0.0"}),I4=15e3,z4=1e4;function T4(){return C.jsx("div",{style:{padding:24},children:C.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[[1,2,3,4].map(n=>C.jsx("div",{className:"skeleton",style:{height:n===1?32:20,width:n===1?"40%":`${60+n*8}%`}},n)),C.jsx("div",{style:{marginTop:8},children:[1,2,3,4,5].map(n=>C.jsx("div",{className:"skeleton",style:{height:36,marginBottom:2}},n))})]})})}function j4(){return C.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 24px",color:F.text.muted,gap:16},children:[C.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",style:{opacity:.35},children:[C.jsx("rect",{x:"8",y:"20",width:"16",height:"24",rx:"2",stroke:"currentColor",strokeWidth:"2"}),C.jsx("rect",{x:"28",y:"14",width:"16",height:"30",rx:"2",stroke:"currentColor",strokeWidth:"2"}),C.jsx("rect",{x:"18",y:"28",width:"16",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"#08080a"}),C.jsx("path",{d:"M14 32h4M34 26h4M24 34h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})]}),C.jsxs("div",{style:{fontSize:13,textAlign:"center"},children:["No stock data",C.jsx("div",{style:{fontSize:11,color:F.text.faint,marginTop:4},children:"Run a stock balance query to see inventory levels"})]})]})}function E4({qty:n}){let r,o;return n<=0?(r=F.error,o=F.errorDim):n<10?(r=F.warning,o=F.warningDim):(r=F.success,o=F.successDim),C.jsx("span",{style:{...on.badge(r,o),fontFamily:zt.mono,minWidth:48,justifyContent:"center"},children:Cl(n,0)})}function Fv(n){return ld(n)}function P4(){const[n,r]=Re.useState(null),[o,s]=Re.useState(!0),[t,a]=Re.useState(!1),[c,m]=Re.useState(null),g=Re.useRef(null),h=Re.useRef(null),y=Re.useRef(!1),k=Re.useRef(0);function T(B){g.current=B,h.current=Zv(B,h.current),r(B)}function P(B){if(B.isError){const q=Fv(B);return m(q??"Tool returned an error"),s(!1),!1}const V=Fv(B);if(!V)return!1;try{const q=JSON.parse(V);return T(q),m(null),s(!1),!0}catch{return m("Failed to parse stock payload"),s(!1),!1}}async function Z(B={}){const V=Zv(g.current,h.current);if(!w4({request:V,visibilityState:typeof document>"u"?"visible":document.visibilityState,refreshInFlight:y.current,now:Date.now(),lastRefreshStartedAt:k.current,minIntervalMs:I4},B)||!V||!pr.getHostCapabilities()?.serverTools)return!1;y.current=!0,k.current=Date.now(),a(!0);try{const q=await pr.callServerTool({name:V.toolName,arguments:V.arguments},{timeout:z4});return q.isError?(m("Refresh failed"),!1):P(q)?!0:(m("Refresh returned no data"),!1)}catch(q){return m(b4(q)),!1}finally{y.current=!1,a(!1)}}return Re.useEffect(()=>{pr.connect().catch(()=>{}),pr.ontoolresult=B=>{P(B)},pr.ontoolinputpartial=()=>{g.current||s(!0)}},[]),Re.useEffect(()=>{function B(){Z({ignoreInterval:!0})}function V(){document.visibilityState==="visible"&&Z({ignoreInterval:!0})}return window.addEventListener("focus",B),document.addEventListener("visibilitychange",V),()=>{window.removeEventListener("focus",B),document.removeEventListener("visibilitychange",V)}},[]),C.jsxs("div",{style:{display:"flex",flexDirection:"column",minHeight:"100vh"},"aria-busy":t,children:[C.jsx(k4,{}),C.jsx("div",{style:{flex:1},children:o?C.jsx(T4,{}):n?C.jsx(N4,{data:n,error:c,refreshing:t,onRefresh:()=>void Z({ignoreInterval:!0})}):C.jsx(j4,{})}),C.jsx(S4,{})]})}const td=[{key:"item_code",label:"Item Code",align:"left",width:"22%"},{key:"warehouse",label:"Warehouse",align:"left",width:"22%"},{key:"actual_qty",label:"Actual Qty",align:"right",width:"12%"},{key:"reserved_qty",label:"Reserved",align:"right",width:"11%"},{key:"projected_qty",label:"Projected",align:"right",width:"11%"},{key:"valuation_rate",label:"Rate",align:"right",width:"11%"},{key:"stock_value",label:"Value",align:"right",width:"11%"}];function N4({data:n,error:r,refreshing:o,onRefresh:s}){const[t,a]=Re.useState("item_code"),[c,m]=Re.useState("asc"),[g,h]=Re.useState(""),[y,k]=Re.useState(null),T=pr.getHostCapabilities()?.serverTools,P=Re.useMemo(()=>{if(!g)return n.data;const q=g.toLowerCase();return n.data.filter(de=>de.item_code.toLowerCase().includes(q)||de.warehouse.toLowerCase().includes(q))},[n.data,g]),Z=Re.useMemo(()=>[...P].sort((q,de)=>{const le=q[t],Y=de[t];if(le==null&&Y==null)return 0;if(le==null)return 1;if(Y==null)return-1;let ge;return typeof le=="number"&&typeof Y=="number"?ge=le-Y:ge=String(le).localeCompare(String(Y)),c==="asc"?ge:-ge}),[P,t,c]),B=Re.useMemo(()=>Z.reduce((q,de)=>q+(de.stock_value??0),0),[Z]);function V(q){t===q?m(de=>de==="asc"?"desc":"asc"):(a(q),m("asc"))}return C.jsxs("div",{style:{padding:16,fontFamily:zt.sans},children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16,flexWrap:"wrap",gap:8},children:[C.jsxs("div",{children:[C.jsx("div",{style:{fontSize:16,fontWeight:700,color:F.text.primary},children:"Stock Balance"}),C.jsxs("div",{style:{fontSize:12,color:F.text.muted},children:[Z.length," ","entries",g?` (filtered from ${n.count})`:""]}),C.jsx("div",{"aria-live":"polite",style:{fontSize:11,color:r?F.error:F.text.faint,marginTop:4},children:r??(o?"Refreshing…":"Auto-refresh on focus")})]}),C.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[C.jsx("input",{type:"text",placeholder:"Filter items / warehouses...",value:g,onChange:q=>h(q.target.value),style:{...on.input,maxWidth:260},onFocus:q=>{q.target.style.borderColor=F.accent},onBlur:q=>{q.target.style.borderColor=F.border}}),C.jsx("button",{onClick:s,disabled:o,style:on.button,onMouseEnter:q=>{o||(q.currentTarget.style.borderColor=F.accent,q.currentTarget.style.color=F.accent)},onMouseLeave:q=>{q.currentTarget.style.borderColor=F.border,q.currentTarget.style.color=F.text.secondary},children:C.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[C.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("path",{d:"M10 6a4 4 0 1 1-1.1-2.76",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),C.jsx("path",{d:"M10 2v2.8H7.2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),o?"Refreshing":"Refresh"]})})]})]}),C.jsx("div",{style:{border:`1px solid ${F.border}`,borderRadius:8,overflow:"hidden"},children:C.jsx("div",{style:{overflowX:"auto"},children:C.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:600},children:[C.jsx("thead",{children:C.jsx("tr",{children:td.map(q=>C.jsxs("th",{onClick:()=>V(q.key),style:{...on.tableHeader,textAlign:q.align,width:q.width,color:t===q.key?F.accent:F.text.muted,background:F.bg.surface},children:[q.label,C.jsx("span",{style:{marginLeft:4,opacity:t===q.key?1:.3,fontSize:10},children:t===q.key?c==="asc"?"▲":"▼":"⇅"})]},q.key))})}),C.jsx("tbody",{children:Z.length===0?C.jsx("tr",{children:C.jsx("td",{colSpan:td.length,style:{...on.tableCell,textAlign:"center",color:F.text.muted,padding:32},children:"No matching entries"})}):Z.map((q,de)=>{const le=`${q.item_code}::${q.warehouse}`,Y=y===le;return C.jsxs(Re.Fragment,{children:[C.jsxs("tr",{style:{transition:"background 0.1s",cursor:T?"pointer":"default",background:Y?F.bg.hover:"transparent"},onClick:T?()=>k(Y?null:le):void 0,onMouseEnter:ge=>{Y||(ge.currentTarget.style.background=F.bg.hover)},onMouseLeave:ge=>{Y||(ge.currentTarget.style.background="transparent")},children:[C.jsx("td",{style:{...on.tableCell,fontWeight:500},children:q.item_code}),C.jsx("td",{style:{...on.tableCell,color:F.text.secondary},children:q.warehouse}),C.jsx("td",{style:{...on.tableCell,textAlign:"right"},children:C.jsx(E4,{qty:q.actual_qty})}),C.jsx("td",{style:Dl,children:q.reserved_qty!=null?Cl(q.reserved_qty,0):"—"}),C.jsx("td",{style:Dl,children:q.projected_qty!=null?Cl(q.projected_qty,0):"—"}),C.jsx("td",{style:Dl,children:q.valuation_rate!=null?Cl(q.valuation_rate):"—"}),C.jsx("td",{style:{...Dl,fontWeight:500,color:F.text.primary},children:q.stock_value!=null?Lv(q.stock_value):"—"})]}),Y&&C.jsx("tr",{children:C.jsx("td",{colSpan:td.length,style:{padding:0,borderBottom:`1px solid ${F.border}`},children:C.jsx(x4,{app:pr,itemCode:q.item_code,warehouse:q.warehouse,onClose:()=>k(null)})})})]},`${le}-${de}`)})})]})})}),C.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12,gap:12,padding:"8px 0"},children:[C.jsx("span",{style:{fontSize:12,color:F.text.muted},children:"Total Stock Value"}),C.jsx("span",{style:{fontSize:16,fontWeight:700,fontFamily:zt.mono,color:F.accent},children:Lv(B)})]})]})}const Dl={...on.tableCell,textAlign:"right",fontFamily:zt.mono,fontSize:12,color:F.text.secondary};Pb.createRoot(document.getElementById("app")).render(C.jsx(P4,{}));</script>
|
|
148
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:I().optional().describe("User's language and region preference in BCP 47 format."),timeZone:I().optional().describe("User's timezone in IANA format."),userAgent:I().optional().describe("Host application identifier."),platform:pe([x("web"),x("desktop"),x("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:j({touch:xe().optional().describe("Whether the device supports touch input."),hover:xe().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:j({top:ue().describe("Top safe area inset in pixels."),right:ue().describe("Right safe area inset in pixels."),bottom:ue().describe("Bottom safe area inset in pixels."),left:ue().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),v4=j({method:x("ui/notifications/host-context-changed"),params:IS.describe("Partial context update containing only changed fields.")});j({method:x("ui/update-model-context"),params:j({content:ie(ya).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:ye(I(),be().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});j({method:x("ui/initialize"),params:j({appInfo:Ys.describe("App identification (name and version)."),appCapabilities:m4.describe("Features and capabilities this app provides."),protocolVersion:I().describe("Protocol version this app supports.")})});var y4=j({protocolVersion:I().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ys.describe("Host application identification and version."),hostCapabilities:f4.describe("Features and capabilities provided by the host."),hostContext:IS.describe("Rich context about the host environment.")}).passthrough(),_4={target:"draft-2020-12"};async function Cv(n,r){let o=n["~standard"];if(o.jsonSchema)return o.jsonSchema[r](_4);if(o.vendor==="zod"){let{z:s}=await Ub(()=>Promise.resolve().then(()=>lz),void 0,import.meta.url);return s.toJSONSchema(n,{io:r})}throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Rv(n,r,o=""){let s=await n["~standard"].validate(r);if(s.issues){let t=s.issues.map(a=>{let c=a.path?.map(m=>typeof m=="object"?m.key:m).join(".");return c?`${c}: ${a.message}`:a.message}).join("; ");throw Error(o+t)}return s.value}class np extends G1{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(r){if(this._initializedSent)return;let o=`[ext-apps] App.${r}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:a4,toolinputpartial:l4,toolresult:h4,toolcancelled:s4,hostcontextchanged:v4};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(r){if(!np.ONE_SHOT_EVENTS.has(r)||this._everHadListener.has(r)||(this._everHadListener.add(r),!this._initializedSent))return;let o=`[ext-apps] "${String(r)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(r,o){o&&this._assertHandlerTiming(r),super.setEventHandler(r,o)}addEventListener(r,o){this._assertHandlerTiming(r),super.addEventListener(r,o)}onEventDispatch(r,o){r==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...o})}constructor(r,o={},s={autoResize:!0}){super(s),this._appInfo=r,this._capabilities=o,this.options=s,s.allowUnsafeEval||Xe({jitless:!0}),this.setRequestHandler(eu,t=>(console.log("Received ping:",t.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(r){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=K1(this._capabilities,r)}registerTool(r,o,s){if(this._registeredTools[r])throw Error(`Tool ${r} is already registered`);let t=this,a=()=>{t._initializedSent&&t._capabilities.tools?.listChanged&&t.sendToolListChanged()},c=o.inputSchema!==void 0,m={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(g){Object.assign(this,g),a()},remove(){t._registeredTools[r]===m&&(delete t._registeredTools[r],a())},handler:async(g,h)=>{if(!m.enabled)throw Error(`Tool ${r} is disabled`);let y;if(c){let k=m.inputSchema,T=k?await Rv(k,g??{},`Invalid input for tool ${r}: `):g??{};y=await s(T,h)}else y=await s(h);return m.outputSchema&&!y.isError&&(y.structuredContent=await Rv(m.outputSchema,y.structuredContent,`Invalid output for tool ${r}: `)),y}};return this._registeredTools[r]=m,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),m}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(r,o)=>{let s=this._registeredTools[r.name];if(!s)throw Error(`Tool ${r.name} not found`);return s.handler(r.arguments,o)},this.onlisttools=async(r,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([s,t])=>t.enabled).map(async([s,t])=>{let a={name:s,title:t.title,description:t.description,inputSchema:t.inputSchema?await Cv(t.inputSchema,"input"):{type:"object",properties:{}}};return t.outputSchema&&(a.outputSchema=await Cv(t.outputSchema,"output")),t.annotations&&(a.annotations=t.annotations),t._meta&&(a._meta=t._meta),a}))}))}async sendToolListChanged(r={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:r})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(r){this.setEventHandler("toolinput",r)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(r){this.setEventHandler("toolinputpartial",r)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(r){this.setEventHandler("toolresult",r)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(r){this.setEventHandler("toolcancelled",r)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(r){this.setEventHandler("hostcontextchanged",r)}_onteardown;get onteardown(){return this._onteardown}set onteardown(r){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,r),this._onteardown=r,this.replaceRequestHandler(d4,(o,s)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o.params,s)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(r){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,r),this._oncalltool=r,this.replaceRequestHandler(SS,(o,s)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,s)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(r){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,r),this._onlisttools=r,this.replaceRequestHandler(kS,(o,s)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,s)})}assertCapabilityForMethod(r){switch(r){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${r})`);break}}assertRequestHandlerCapability(r){switch(r){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${r})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${r} registered`)}}assertNotificationCapability(r){}assertTaskCapability(r){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(r){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(r,o){if(this._assertInitialized("callServerTool"),typeof r=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${r}"). Did you mean: callServerTool({ name: "${r}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:r},tu,{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(r,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:r},yS,o)}async listServerResources(r,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:r},vS,o)}async createSamplingMessage(r,o){this._assertInitialized("createSamplingMessage");let s=r.tools?xS:bS;return await this.request({method:"sampling/createMessage",params:r},s,o)}sendMessage(r,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:r},o4,o)}sendLog(r){return this.notification({method:"notifications/message",params:r})}updateModelContext(r,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:r},Lm,o)}openLink(r,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:r},r4,o)}sendOpenLink=this.openLink;downloadFile(r,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:r},i4,o)}requestTeardown(r={}){return this.notification({method:"ui/notifications/request-teardown",params:r})}requestDisplayMode(r,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:r},p4,o)}sendSizeChanged(r){return this.notification({method:"ui/notifications/size-changed",params:r})}setupSizeChangedNotifications(){let r=!1,o=0,s=0,t=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1;let c=document.documentElement,m=c.style.height;c.style.height="max-content";let g=Math.ceil(c.getBoundingClientRect().height);c.style.height=m;let h=Math.ceil(window.innerWidth);(h!==o||g!==s)&&(o=h,s=g,this.sendSizeChanged({width:h,height:g}))}))};t();let a=new ResizeObserver(t);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(r=new Y1(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(r);try{let s=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Q1}},y4,o);if(s===void 0)throw Error(`Server sent invalid initialize result: ${s}`);this._hostCapabilities=s.hostCapabilities,this._hostInfo=s.hostInfo,this._hostContext=s.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(s){throw this.close(),s}}}function We(n){return`var(${n})`}const F={bg:{surface:We("--bg-surface"),elevated:We("--bg-elevated"),hover:We("--bg-hover")},text:{primary:We("--text-primary"),secondary:We("--text-secondary"),muted:We("--text-muted"),faint:We("--text-faint")},accent:We("--accent"),accentDim:We("--accent-dim"),border:We("--border"),borderSubtle:We("--border-subtle"),success:We("--success"),successDim:We("--success-dim"),error:We("--error"),errorDim:We("--error-dim"),warning:We("--warning"),warningDim:We("--warning-dim"),info:We("--info"),infoDim:We("--info-dim")},zt={sans:We("--font-sans"),mono:We("--font-mono")},on={card:{background:F.bg.surface,border:`1px solid ${F.border}`,borderRadius:"8px",padding:"16px"},badge:(n,r)=>({display:"inline-flex",alignItems:"center",padding:"2px 8px",fontSize:"11px",fontWeight:600,borderRadius:"4px",color:n,background:r,letterSpacing:"0.02em"}),input:{background:F.bg.elevated,border:`1px solid ${F.border}`,borderRadius:"6px",padding:"6px 12px",fontSize:"13px",color:F.text.primary,outline:"none",transition:"border-color 0.15s",width:"100%",fontFamily:zt.sans},button:{background:F.bg.elevated,border:`1px solid ${F.border}`,borderRadius:"6px",padding:"6px 14px",fontSize:"12px",color:F.text.secondary,cursor:"pointer",transition:"all 0.15s",fontFamily:zt.sans,whiteSpace:"nowrap"},buttonActive:{background:F.accentDim,borderColor:F.accent,color:F.accent},tableHeader:{padding:"8px 12px",textAlign:"left",fontSize:"11px",fontWeight:600,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:`1px solid ${F.border}`,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",transition:"color 0.15s"},tableCell:{padding:"8px 12px",fontSize:"13px",borderBottom:`1px solid ${F.borderSubtle}`,color:F.text.primary},mono:{fontFamily:zt.mono,fontSize:"12px"}};function Cl(n,r=2){return n.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}function Lv(n,r="USD"){return n.toLocaleString("en-US",{style:"currency",currency:r,minimumFractionDigits:2,maximumFractionDigits:2})}function $4(){return C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[C.jsx("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.9"}),C.jsx("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.6"}),C.jsx("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.6"}),C.jsx("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.5",fill:"currentColor",opacity:"0.35"})]})}function k4(){const n={display:"flex",alignItems:"center",gap:7,padding:"0 14px",height:30,background:F.bg.surface,borderBottom:`1px solid ${F.border}`,flexShrink:0},r={fontFamily:zt.sans,fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:F.accent},o={width:3,height:3,borderRadius:"50%",background:F.text.faint,marginLeft:2,marginRight:2,flexShrink:0},s={fontFamily:zt.sans,fontSize:10,color:F.text.muted,letterSpacing:"0.03em"};return C.jsxs("div",{style:n,children:[C.jsx("div",{style:{color:F.accent},children:C.jsx($4,{})}),C.jsx("span",{style:r,children:"ERPNext"}),C.jsx("div",{style:o}),C.jsx("span",{style:s,children:"gestion ERP"})]})}function S4(){const n={display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"6px 16px 8px",borderTop:`1px solid ${F.borderSubtle}`,marginTop:8},r={fontFamily:zt.sans,fontSize:10,color:F.text.faint,letterSpacing:"0.04em"};return C.jsx("div",{style:n,children:C.jsx("span",{style:r,children:"Casys AI"})})}function w4(n,r={}){return!n.request||n.visibilityState!=="visible"||n.refreshInFlight?!1:r.ignoreInterval?!0:n.now-n.lastRefreshStartedAt>=n.minIntervalMs}function Zv(n,r){return n?.refreshRequest??r}function b4(n){return n instanceof Error&&/timed? out/i.test(n.message)?"Refresh timed out":"Refresh failed"}function ld(n){return n.structuredContent?JSON.stringify(n.structuredContent):n.content?.find(r=>r.type==="text")?.text??null}function Ul({label:n,value:r,bold:o}){return C.jsxs("div",{style:{padding:"4px 0"},children:[C.jsx("div",{style:{fontSize:10,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:2},children:n}),C.jsx("div",{style:{fontSize:o?15:13,fontWeight:o?600:500,color:F.text.primary,fontFamily:o?zt.mono:zt.sans},children:r??"—"})]})}const Av={success:{color:F.success,bg:F.successDim},error:{color:F.error,bg:F.errorDim},info:{color:F.info,bg:F.infoDim},default:{color:F.text.secondary,bg:F.bg.elevated}};function ed({label:n,variant:r="default",disabled:o,loading:s,confirm:t,onClick:a}){const[c,m]=Re.useState(!1),g=Re.useRef();Re.useEffect(()=>()=>clearTimeout(g.current),[]);const h=Av[r]??Av.default;return C.jsx("button",{onClick:()=>{if(t&&!c){m(!0),clearTimeout(g.current),g.current=setTimeout(()=>m(!1),4e3);return}m(!1),a()},disabled:o||s,style:{...on.button,background:h.bg,color:h.color,borderColor:h.color,opacity:o||s?.5:1,fontSize:11,padding:"4px 10px"},children:s?"…":c?"Confirm?":n})}const Mv=1e4;function x4({app:n,itemCode:r,warehouse:o,onClose:s}){const[t,a]=Re.useState(null),[c,m]=Re.useState(null),[g,h]=Re.useState(!0);return Re.useEffect(()=>{let y=!1;return(async()=>{try{const[k,T]=await Promise.all([n.callServerTool({name:"erpnext_item_get",arguments:{name:r}},{timeout:Mv}),n.callServerTool({name:"erpnext_stock_entry_list",arguments:{limit:5,item_code:r}},{timeout:Mv})]);if(y)return;if(!k.isError){const P=ld(k);if(P){const Z=JSON.parse(P);a(Z.data??Z)}}if(!T.isError){const P=ld(T);if(P){const Z=JSON.parse(P);m(Z.data??[])}}}catch{}y||h(!1)})(),()=>{y=!0}},[r]),g?C.jsx("div",{style:{padding:16,background:F.bg.surface,borderTop:`2px solid ${F.accent}`},children:[1,2].map(y=>C.jsx("div",{className:"skeleton",style:{height:14,width:`${30+y*15}%`,marginBottom:8}},y))}):C.jsxs("div",{style:{padding:16,background:F.bg.surface,borderTop:`2px solid ${F.accent}`},children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10},children:[C.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[C.jsx("span",{style:{fontSize:14,fontWeight:600,color:F.text.primary,fontFamily:zt.mono},children:r}),C.jsx("span",{style:{fontSize:11,color:F.text.muted},children:o})]}),C.jsx("button",{onClick:s,style:{...on.button,padding:"2px 8px",fontSize:11},children:"✕"})]}),t&&C.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:6,marginBottom:10},children:[t.item_name&&C.jsx(Ul,{label:"Name",value:String(t.item_name)}),t.item_group&&C.jsx(Ul,{label:"Group",value:String(t.item_group)}),t.stock_uom&&C.jsx(Ul,{label:"UOM",value:String(t.stock_uom)}),t.standard_rate!=null&&C.jsx(Ul,{label:"Std Rate",value:String(t.standard_rate),bold:!0})]}),c&&c.length>0&&C.jsxs("div",{style:{marginBottom:10},children:[C.jsx("div",{style:{fontSize:10,color:F.text.muted,textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Recent Movements"}),c.slice(0,4).map((y,k)=>C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0",borderBottom:`1px solid ${F.borderSubtle}`,fontSize:12},children:[C.jsx("span",{style:{color:F.text.secondary},children:String(y.stock_entry_type??y.name??"—")}),C.jsx("span",{style:{fontFamily:zt.mono,color:F.text.primary},children:String(y.posting_date??"—")})]},k))]}),C.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,borderTop:`1px solid ${F.border}`},children:[C.jsx(ed,{label:"Stock chart",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show stock chart for item ${r}`}]})}catch{}}}),C.jsx(ed,{label:"Item details",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show me the full details of Item ${r}`}]})}catch{}}}),C.jsx(ed,{label:"Stock entries",onClick:async()=>{try{await n.sendMessage({role:"user",content:[{type:"text",text:`Show stock entries for item ${r}`}]})}catch{}}})]})]})}const pr=new np({name:"Stock Viewer",version:"2.0.0"}),I4=15e3,z4=1e4;function T4(){return C.jsx("div",{style:{padding:24},children:C.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[[1,2,3,4].map(n=>C.jsx("div",{className:"skeleton",style:{height:n===1?32:20,width:n===1?"40%":`${60+n*8}%`}},n)),C.jsx("div",{style:{marginTop:8},children:[1,2,3,4,5].map(n=>C.jsx("div",{className:"skeleton",style:{height:36,marginBottom:2}},n))})]})})}function j4(){return C.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 24px",color:F.text.muted,gap:16},children:[C.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",style:{opacity:.35},children:[C.jsx("rect",{x:"8",y:"20",width:"16",height:"24",rx:"2",stroke:"currentColor",strokeWidth:"2"}),C.jsx("rect",{x:"28",y:"14",width:"16",height:"30",rx:"2",stroke:"currentColor",strokeWidth:"2"}),C.jsx("rect",{x:"18",y:"28",width:"16",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"2",fill:"#08080a"}),C.jsx("path",{d:"M14 32h4M34 26h4M24 34h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})]}),C.jsxs("div",{style:{fontSize:13,textAlign:"center"},children:["No stock data",C.jsx("div",{style:{fontSize:11,color:F.text.faint,marginTop:4},children:"Run a stock balance query to see inventory levels"})]})]})}function E4({qty:n}){let r,o;return n<=0?(r=F.error,o=F.errorDim):n<10?(r=F.warning,o=F.warningDim):(r=F.success,o=F.successDim),C.jsx("span",{style:{...on.badge(r,o),fontFamily:zt.mono,minWidth:48,justifyContent:"center"},children:Cl(n,0)})}function Fv(n){return ld(n)}function P4(){const[n,r]=Re.useState(null),[o,s]=Re.useState(!0),[t,a]=Re.useState(!1),[c,m]=Re.useState(null),g=Re.useRef(null),h=Re.useRef(null),y=Re.useRef(!1),k=Re.useRef(0);function T(B){g.current=B,h.current=Zv(B,h.current),r(B)}function P(B){if(B.isError){const q=Fv(B);return m(q??"Tool returned an error"),s(!1),!1}const V=Fv(B);if(!V)return!1;try{const q=JSON.parse(V);return T(q),m(null),s(!1),!0}catch{return m("Failed to parse stock payload"),s(!1),!1}}async function Z(B={}){const V=Zv(g.current,h.current);if(!w4({request:V,visibilityState:typeof document>"u"?"visible":document.visibilityState,refreshInFlight:y.current,now:Date.now(),lastRefreshStartedAt:k.current,minIntervalMs:I4},B)||!V||!pr.getHostCapabilities()?.serverTools)return!1;y.current=!0,k.current=Date.now(),a(!0);try{const q=await pr.callServerTool({name:V.toolName,arguments:V.arguments},{timeout:z4});return q.isError?(m("Refresh failed"),!1):P(q)?!0:(m("Refresh returned no data"),!1)}catch(q){return m(b4(q)),!1}finally{y.current=!1,a(!1)}}return Re.useEffect(()=>{pr.ontoolresult=B=>{P(B)},pr.ontoolinputpartial=()=>{g.current||s(!0)},pr.connect().catch(()=>{})},[]),Re.useEffect(()=>{function B(){Z({ignoreInterval:!0})}function V(){document.visibilityState==="visible"&&Z({ignoreInterval:!0})}return window.addEventListener("focus",B),document.addEventListener("visibilitychange",V),()=>{window.removeEventListener("focus",B),document.removeEventListener("visibilitychange",V)}},[]),C.jsxs("div",{style:{display:"flex",flexDirection:"column",minHeight:"100vh"},"aria-busy":t,children:[C.jsx(k4,{}),C.jsx("div",{style:{flex:1},children:o?C.jsx(T4,{}):n?C.jsx(N4,{data:n,error:c,refreshing:t,onRefresh:()=>void Z({ignoreInterval:!0})}):C.jsx(j4,{})}),C.jsx(S4,{})]})}const td=[{key:"item_code",label:"Item Code",align:"left",width:"22%"},{key:"warehouse",label:"Warehouse",align:"left",width:"22%"},{key:"actual_qty",label:"Actual Qty",align:"right",width:"12%"},{key:"reserved_qty",label:"Reserved",align:"right",width:"11%"},{key:"projected_qty",label:"Projected",align:"right",width:"11%"},{key:"valuation_rate",label:"Rate",align:"right",width:"11%"},{key:"stock_value",label:"Value",align:"right",width:"11%"}];function N4({data:n,error:r,refreshing:o,onRefresh:s}){const[t,a]=Re.useState("item_code"),[c,m]=Re.useState("asc"),[g,h]=Re.useState(""),[y,k]=Re.useState(null),T=pr.getHostCapabilities()?.serverTools,P=Re.useMemo(()=>{if(!g)return n.data;const q=g.toLowerCase();return n.data.filter(de=>de.item_code.toLowerCase().includes(q)||de.warehouse.toLowerCase().includes(q))},[n.data,g]),Z=Re.useMemo(()=>[...P].sort((q,de)=>{const le=q[t],Y=de[t];if(le==null&&Y==null)return 0;if(le==null)return 1;if(Y==null)return-1;let ge;return typeof le=="number"&&typeof Y=="number"?ge=le-Y:ge=String(le).localeCompare(String(Y)),c==="asc"?ge:-ge}),[P,t,c]),B=Re.useMemo(()=>Z.reduce((q,de)=>q+(de.stock_value??0),0),[Z]);function V(q){t===q?m(de=>de==="asc"?"desc":"asc"):(a(q),m("asc"))}return C.jsxs("div",{style:{padding:16,fontFamily:zt.sans},children:[C.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16,flexWrap:"wrap",gap:8},children:[C.jsxs("div",{children:[C.jsx("div",{style:{fontSize:16,fontWeight:700,color:F.text.primary},children:"Stock Balance"}),C.jsxs("div",{style:{fontSize:12,color:F.text.muted},children:[Z.length," ","entries",g?` (filtered from ${n.count})`:""]}),C.jsx("div",{"aria-live":"polite",style:{fontSize:11,color:r?F.error:F.text.faint,marginTop:4},children:r??(o?"Refreshing…":"Auto-refresh on focus")})]}),C.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[C.jsx("input",{type:"text",placeholder:"Filter items / warehouses...",value:g,onChange:q=>h(q.target.value),style:{...on.input,maxWidth:260},onFocus:q=>{q.target.style.borderColor=F.accent},onBlur:q=>{q.target.style.borderColor=F.border}}),C.jsx("button",{onClick:s,disabled:o,style:on.button,onMouseEnter:q=>{o||(q.currentTarget.style.borderColor=F.accent,q.currentTarget.style.color=F.accent)},onMouseLeave:q=>{q.currentTarget.style.borderColor=F.border,q.currentTarget.style.color=F.text.secondary},children:C.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[C.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("path",{d:"M10 6a4 4 0 1 1-1.1-2.76",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),C.jsx("path",{d:"M10 2v2.8H7.2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),o?"Refreshing":"Refresh"]})})]})]}),C.jsx("div",{style:{border:`1px solid ${F.border}`,borderRadius:8,overflow:"hidden"},children:C.jsx("div",{style:{overflowX:"auto"},children:C.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:600},children:[C.jsx("thead",{children:C.jsx("tr",{children:td.map(q=>C.jsxs("th",{onClick:()=>V(q.key),style:{...on.tableHeader,textAlign:q.align,width:q.width,color:t===q.key?F.accent:F.text.muted,background:F.bg.surface},children:[q.label,C.jsx("span",{style:{marginLeft:4,opacity:t===q.key?1:.3,fontSize:10},children:t===q.key?c==="asc"?"▲":"▼":"⇅"})]},q.key))})}),C.jsx("tbody",{children:Z.length===0?C.jsx("tr",{children:C.jsx("td",{colSpan:td.length,style:{...on.tableCell,textAlign:"center",color:F.text.muted,padding:32},children:"No matching entries"})}):Z.map((q,de)=>{const le=`${q.item_code}::${q.warehouse}`,Y=y===le;return C.jsxs(Re.Fragment,{children:[C.jsxs("tr",{style:{transition:"background 0.1s",cursor:T?"pointer":"default",background:Y?F.bg.hover:"transparent"},onClick:T?()=>k(Y?null:le):void 0,onMouseEnter:ge=>{Y||(ge.currentTarget.style.background=F.bg.hover)},onMouseLeave:ge=>{Y||(ge.currentTarget.style.background="transparent")},children:[C.jsx("td",{style:{...on.tableCell,fontWeight:500},children:q.item_code}),C.jsx("td",{style:{...on.tableCell,color:F.text.secondary},children:q.warehouse}),C.jsx("td",{style:{...on.tableCell,textAlign:"right"},children:C.jsx(E4,{qty:q.actual_qty})}),C.jsx("td",{style:Dl,children:q.reserved_qty!=null?Cl(q.reserved_qty,0):"—"}),C.jsx("td",{style:Dl,children:q.projected_qty!=null?Cl(q.projected_qty,0):"—"}),C.jsx("td",{style:Dl,children:q.valuation_rate!=null?Cl(q.valuation_rate):"—"}),C.jsx("td",{style:{...Dl,fontWeight:500,color:F.text.primary},children:q.stock_value!=null?Lv(q.stock_value):"—"})]}),Y&&C.jsx("tr",{children:C.jsx("td",{colSpan:td.length,style:{padding:0,borderBottom:`1px solid ${F.border}`},children:C.jsx(x4,{app:pr,itemCode:q.item_code,warehouse:q.warehouse,onClose:()=>k(null)})})})]},`${le}-${de}`)})})]})})}),C.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12,gap:12,padding:"8px 0"},children:[C.jsx("span",{style:{fontSize:12,color:F.text.muted},children:"Total Stock Value"}),C.jsx("span",{style:{fontSize:16,fontWeight:700,fontFamily:zt.mono,color:F.accent},children:Lv(B)})]})]})}const Dl={...on.tableCell,textAlign:"right",fontFamily:zt.mono,fontSize:12,color:F.text.secondary};Pb.createRoot(document.getElementById("app")).render(C.jsx(P4,{}));</script>
|
|
149
149
|
<style rel="stylesheet" crossorigin>:root{--accent: #0089ff;--accent-dim: rgba(0, 137, 255, .15);--accent-border: rgba(0, 137, 255, .3);--success: #16a34a;--success-dim: rgba(22, 163, 74, .1);--error: #dc2626;--error-dim: rgba(220, 38, 38, .1);--warning: #d97706;--warning-dim: rgba(217, 119, 6, .1);--info: #2563eb;--info-dim: rgba(37, 99, 235, .1);--radius-sm: 4px;--radius-md: 6px;--radius-lg: 8px;--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--font-mono: "SF Mono", "Cascadia Code", "Fira Code", monospace;--bg-root: #ffffff;--bg-surface: #f9fafb;--bg-elevated: #f3f4f6;--bg-hover: #e5e7eb;--bg-active: #d1d5db;--text-primary: #111827;--text-secondary: #4b5563;--text-muted: #6b7280;--text-faint: #9ca3af;--border: #e5e7eb;--border-subtle: #f3f4f6;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--shadow-md: 0 2px 8px rgba(0, 0, 0, .08)}@media(prefers-color-scheme:dark){:root{--bg-root: #08080a;--bg-surface: #111113;--bg-elevated: #18181b;--bg-hover: #1f1f23;--bg-active: #27272a;--text-primary: #e7e5e4;--text-secondary: #a8a29e;--text-muted: #78716c;--text-faint: #57534e;--border: #27272a;--border-subtle: #1f1f23;--success: #4ade80;--success-dim: rgba(74, 222, 128, .12);--error: #f87171;--error-dim: rgba(248, 113, 113, .12);--warning: #fbbf24;--warning-dim: rgba(251, 191, 36, .12);--info: #60a5fa;--info-dim: rgba(96, 165, 250, .12);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);--shadow-md: 0 2px 8px rgba(0, 0, 0, .4)}}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{border-radius:var(--radius-lg);overflow:hidden}html,body{background:var(--bg-root);color:var(--text-primary);font-family:var(--font-sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{overflow:auto}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-faint)}@keyframes pulse{0%,to{opacity:.4}50%{opacity:.15}}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.animate-pulse{animation:pulse 1.5s ease-in-out infinite}.skeleton{background:linear-gradient(90deg,var(--bg-elevated) 25%,var(--bg-hover) 50%,var(--bg-elevated) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:var(--radius-sm)}.drag-scroll::-webkit-scrollbar{display:none}.drag-scroll{scrollbar-width:none}article button:hover:not(:disabled){background:var(--bg-hover)!important;color:var(--text-primary)!important}article[draggable=true]:active{cursor:grabbing;opacity:.85}.kanban-detail-backdrop{position:fixed;inset:0;z-index:100;background:#00000073;display:flex;align-items:flex-start;justify-content:center;padding:20px 12px;overflow-y:auto;backdrop-filter:blur(2px)}.kanban-detail-panel{background:var(--bg-root);border:1px solid var(--border);border-radius:10px;max-width:520px;width:100%;box-shadow:0 8px 32px #0000001f,0 2px 8px #0000000f;position:relative;display:flex;flex-direction:column}.kanban-detail-panel .detail-field-row{transition:background .1s}.kanban-detail-panel .detail-field-row:hover{background:var(--bg-surface)}.kanban-detail-panel .detail-field-cell{transition:background .1s;border-radius:4px}.kanban-detail-panel .detail-field-cell:hover{background:var(--bg-surface)}.kanban-detail-panel .detail-field-cell:hover input,.kanban-detail-panel .detail-field-cell:hover select{border-color:var(--border)!important;background:var(--bg-elevated)!important}.kanban-detail-panel select:focus{border-color:var(--accent)!important;box-shadow:0 0 0 2px var(--accent-dim);outline:none}.kanban-detail-panel input:focus{border-color:var(--accent)!important;box-shadow:0 0 0 2px var(--accent-dim);outline:none}.kanban-detail-panel textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 2px var(--accent-dim);outline:none}@media(prefers-color-scheme:dark){.kanban-detail-backdrop{background:#000000a6}.kanban-detail-panel{box-shadow:0 8px 32px #0006,0 2px 8px #0000004d}}.kanban-card-title-link{cursor:pointer;text-decoration:none;color:inherit}.kanban-card-title-link:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}</style>
|
|
150
150
|
</head>
|
|
151
151
|
<body>
|