@mindexec/cli 0.2.371 → 0.2.372

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 (21) hide show
  1. package/package.json +1 -1
  2. package/server.js +448 -5
  3. package/wwwroot/assets/{AdminDashboardPage-3j_fLtJI.js → AdminDashboardPage-Cz9oqmp1.js} +1 -1
  4. package/wwwroot/assets/{AppSidebar-NgcRUfE7.js → AppSidebar-CCyfl-_8.js} +2 -2
  5. package/wwwroot/assets/{AuthPages-Cnj1SLJh.js → AuthPages-CkWEDGgC.js} +1 -1
  6. package/wwwroot/assets/{CodePage-Do4K07Ge.js → CodePage-D0CxncU0.js} +1 -1
  7. package/wwwroot/assets/{CompanyCorePage-iD32axX4.js → CompanyCorePage-C8AAF9MJ.js} +1 -1
  8. package/wwwroot/assets/{ExecutionModePage-BHn-i9eu.js → ExecutionModePage-DM4G1xkT.js} +1 -1
  9. package/wwwroot/assets/{MindCanvas-0T8dFIuQ.css → MindCanvas-D7mLWp5-.css} +1 -1
  10. package/wwwroot/assets/MindCanvas-g37obZMq.js +48 -0
  11. package/wwwroot/assets/{PlanMasterPage-B9XXbERQ.js → PlanMasterPage-axrFePG0.js} +4 -4
  12. package/wwwroot/assets/{PricingPage-Cgbt5ZmJ.js → PricingPage-BwayR6ga.js} +1 -1
  13. package/wwwroot/assets/{ToolPages-DLme_QLb.js → ToolPages-CTVDo24Z.js} +5 -5
  14. package/wwwroot/assets/{YouTubeSearchPage-BSQIhWnY.js → YouTubeSearchPage-BWA45eoM.js} +2 -2
  15. package/wwwroot/assets/canvas-runtime-CddXXjp9.js +44 -0
  16. package/wwwroot/assets/{index-D32iV1LN.js → index-Bc6exjGV.js} +2 -2
  17. package/wwwroot/assets/{storage-C8yTm9Oa.js → storage-BPqBi6qs.js} +1 -1
  18. package/wwwroot/assets/{supabaseAuthAdapter-C1dNnpk8.js → supabaseAuthAdapter-bSjZe3In.js} +1 -1
  19. package/wwwroot/index.html +2 -2
  20. package/wwwroot/assets/MindCanvas-uwqW1baW.js +0 -48
  21. package/wwwroot/assets/canvas-runtime-CcSvL_l6.js +0 -44
@@ -1,4 +1,4 @@
1
- import{r as c,j as t}from"./vendor-react-BXzpOyCS.js";import{g as Ce,o as je,y as Me,aF as Qe,aG as ze,aH as Ge,aI as _e}from"./canvas-runtime-CcSvL_l6.js";import{R as g}from"./app-runtime-xD2Z3NdN.js";import{l as Ve,s as Xe}from"./executionModeSettings-NJqurj-o.js";import{A as Ye,a8 as Ze,R as et,b9 as tt,b7 as nt}from"./vendor-icons-678PAT8P.js";import"./runtimeSettingsPersistenceProjection-BoNWmYjU.js";const Ee=["Concept.KernelHelp","Concept.Hash64","Concept.DefineComposite","Concept.Embed","Concept.Execute"],ot=0x0000000080000000n,F=11400714785074694791n,Z=14029467366897019727n,ve=1609587929392839161n,Ie=9650029242287828579n,we=2870177450012600261n;function m(e){return BigInt.asUintN(64,e)}function q(e,s){const o=BigInt(s);return m(m(e)<<o|m(e)>>64n-o)}function Y(e,s){let o=0n;for(let a=0;a<8;a+=1)o|=BigInt(e[s+a])<<BigInt(a*8);return m(o)}function st(e,s){return(e[s]|e[s+1]<<8|e[s+2]<<16|e[s+3]<<24)>>>0}function Q(e,s){let o=m(e+m(s*Z));return o=q(o,31),m(o*F)}function oe(e,s){let o=m(e^Q(0n,s));return o=m(o*F+Ie),o}function k(e){const s=e.trim();if(!s)throw new Error("signature is empty");const o=new TextEncoder().encode(s),a=o.length;let i=0,r;if(a>=32){let d=m(F+Z),w=m(Z),y=0n,N=m(-F);const u=a-32;for(;i<=u;)d=Q(d,Y(o,i)),i+=8,w=Q(w,Y(o,i)),i+=8,y=Q(y,Y(o,i)),i+=8,N=Q(N,Y(o,i)),i+=8;r=m(q(d,1)+q(w,7)+q(y,12)+q(N,18)),r=oe(r,d),r=oe(r,w),r=oe(r,y),r=oe(r,N)}else r=m(we);for(r=m(r+BigInt(a));i<=a-8;){const d=Q(0n,Y(o,i));r=m(r^d),r=m(q(r,27)*F+Ie),i+=8}for(i<=a-4&&(r=m(r^BigInt(st(o,i))*F),r=m(q(r,23)*Z+ve),i+=4);i<a;)r=m(r^BigInt(o[i])*we),r=m(q(r,11)*F),i+=1;return r=m(r^r>>33n),r=m(r*Z),r=m(r^r>>29n),r=m(r*ve),r=m(r^r>>32n),`0x${r.toString(16).padStart(16,"0")}`}const le=[{category:"Math.Double",signature:"MindExecution.Kernel.Add(System.Double,System.Double)",summary:"a+b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Sub(System.Double,System.Double)",summary:"a-b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Mul(System.Double,System.Double)",summary:"a*b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Div(System.Double,System.Double)",summary:"a/b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Min(System.Double,System.Double)",summary:"min(a,b)",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Max(System.Double,System.Double)",summary:"max(a,b)",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Round(System.Double)",summary:"round(x)",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Add(System.Int64,System.Int64)",summary:"a+b",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Sub(System.Int64,System.Int64)",summary:"a-b",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Mul(System.Int64,System.Int64)",summary:"a*b",supported:!0},{category:"Compare.Double",signature:"MindExecution.Kernel.Gt(System.Double,System.Double)",summary:"a>b",supported:!0},{category:"Compare.Double",signature:"MindExecution.Kernel.Eq(System.Double,System.Double)",summary:"a==b",supported:!0},{category:"Logic",signature:"MindExecution.Kernel.IfElse(System.Boolean,System.Object,System.Object)",summary:"cond ? a : b",supported:!0},{category:"String",signature:"MindExecution.Kernel.Concat(System.String,System.String)",summary:"a+b",supported:!0},{category:"String",signature:"MindExecution.Kernel.Length(System.String)",summary:"len(s)",supported:!0},{category:"String",signature:"MindExecution.Kernel.ToString(System.Object)",summary:"x?.ToString()",supported:!0},{category:"Convert",signature:"MindExecution.Kernel.ToDouble(System.Object)",summary:"Convert.ToDouble",supported:!0},{category:"Convert",signature:"MindExecution.Kernel.ToInt64(System.Object)",summary:"Convert.ToInt64",supported:!0},{category:"Json",signature:"MindExecution.Kernel.Json.Parse(System.String)",summary:"parse JSON",supported:!0},{category:"Json",signature:"MindExecution.Kernel.Json.Stringify(System.Object)",summary:"serialize JSON",supported:!0},{category:"System",signature:"MindExecution.Kernel.System.GetManifest()",summary:"local manifest subset",supported:!0},{category:"System",signature:"MindExecution.Kernel.System.SignatureToId(System.String)",summary:"signature -> local 0x hash",supported:!0},{category:"Debug",signature:"MindExecution.Kernel.Print(System.Object)",summary:"ToString",supported:!0},{category:"Debug",signature:"MindExecution.Kernel.TypeOf(System.Object)",summary:"JavaScript type name",supported:!0},{category:"Time",signature:"MindExecution.Kernel.UtcNow()",summary:"UTC ISO timestamp",supported:!0},{category:"Hash",signature:"MindExecution.Kernel.Hash.Sha256(System.String)",summary:"adapter-gated in React shell",supported:!1}],Ke=new Map(le.map(e=>[k(e.signature),e]));function x(e){const s=typeof e=="number"?e:Number(e);if(!Number.isFinite(s))throw new Error(`Expected numeric value, got ${A(e)}.`);return s}function J(e){return Math.trunc(x(e))}function L(e,s){if(typeof e=="number"&&Number.isInteger(e)&&e>=0)return`0x${e.toString(16).padStart(16,"0")}`;if(typeof e!="string")throw new Error(`${s} must be a hex slot string or integer.`);const o=e.trim();if(/^0x[0-9a-f]{1,16}$/i.test(o))return`0x${o.slice(2).toLowerCase().padStart(16,"0")}`;if(/^\d+$/.test(o))return`0x${Number(o).toString(16).padStart(16,"0")}`;throw new Error(`${s} must be 0x[0-9a-f]{16}, short hex, or integer.`)}function rt(e){return`0x${(ot+BigInt(e)).toString(16).padStart(16,"0")}`}function Le(e){const s=JSON.parse(e),o=Array.isArray(s.literals)?s.literals:[],a=Array.isArray(s.instructions)?s.instructions:[];if(a.length===0)throw new Error("IR must include an instructions array.");return{literals:o,instructions:a}}function $e(e){var o;if(typeof e=="string"&&e.trim().startsWith("$")){const a=e.trim().slice(1).trim();if(!a)throw new Error("target signature cannot be empty.");return{id:k(a),signature:a}}const s=L(e,"target");return{id:s,signature:(o=Ke.get(s))==null?void 0:o.signature}}function A(e){if(e===void 0)return"<unset>";if(e===null)return"<null>";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function it(e){if(!e||typeof e!="object")throw new Error("Literal entries must be objects.");const s=e,o=L(s.id??s.slot,"literal.id"),a=String(s.type??"json").toLowerCase(),i=s.value;return a==="null"?{slot:o,value:null}:a==="bool"?{slot:o,value:!!i}:a==="int"?{slot:o,value:J(i)}:a==="double"?{slot:o,value:x(i)}:a==="string"?{slot:o,value:String(i??"")}:{slot:o,value:i}}const at={"MindExecution.Kernel.Add(System.Double,System.Double)":e=>x(e[0])+x(e[1]),"MindExecution.Kernel.Sub(System.Double,System.Double)":e=>x(e[0])-x(e[1]),"MindExecution.Kernel.Mul(System.Double,System.Double)":e=>x(e[0])*x(e[1]),"MindExecution.Kernel.Div(System.Double,System.Double)":e=>x(e[1])===0?Number.NaN:x(e[0])/x(e[1]),"MindExecution.Kernel.Min(System.Double,System.Double)":e=>Math.min(x(e[0]),x(e[1])),"MindExecution.Kernel.Max(System.Double,System.Double)":e=>Math.max(x(e[0]),x(e[1])),"MindExecution.Kernel.Round(System.Double)":e=>Math.round(x(e[0])),"MindExecution.Kernel.Add(System.Int64,System.Int64)":e=>J(e[0])+J(e[1]),"MindExecution.Kernel.Sub(System.Int64,System.Int64)":e=>J(e[0])-J(e[1]),"MindExecution.Kernel.Mul(System.Int64,System.Int64)":e=>J(e[0])*J(e[1]),"MindExecution.Kernel.Gt(System.Double,System.Double)":e=>x(e[0])>x(e[1]),"MindExecution.Kernel.Eq(System.Double,System.Double)":e=>x(e[0])===x(e[1]),"MindExecution.Kernel.IfElse(System.Boolean,System.Object,System.Object)":e=>e[0]?e[1]:e[2],"MindExecution.Kernel.Concat(System.String,System.String)":e=>`${e[0]??""}${e[1]??""}`,"MindExecution.Kernel.Length(System.String)":e=>String(e[0]??"").length,"MindExecution.Kernel.ToString(System.Object)":e=>e[0]==null?"":String(e[0]),"MindExecution.Kernel.ToDouble(System.Object)":e=>x(e[0]),"MindExecution.Kernel.ToInt64(System.Object)":e=>J(e[0]),"MindExecution.Kernel.Json.Parse(System.String)":e=>JSON.parse(String(e[0]??"null")),"MindExecution.Kernel.Json.Stringify(System.Object)":e=>JSON.stringify(e[0]),"MindExecution.Kernel.System.GetManifest()":()=>le.map(e=>({...e,id:k(e.signature)})),"MindExecution.Kernel.System.SignatureToId(System.String)":e=>k(String(e[0]??"")),"MindExecution.Kernel.Print(System.Object)":e=>A(e[0]),"MindExecution.Kernel.TypeOf(System.Object)":e=>e[0]===null?"null":Array.isArray(e[0])?"array":typeof e[0],"MindExecution.Kernel.UtcNow()":()=>new Date().toISOString()};function Oe(e){const s=e.trim();if(!s)return[];if(s.startsWith("[")){const o=JSON.parse(s);if(!Array.isArray(o))throw new Error("Watch JSON must be an array of slots.");return o.map(a=>L(a,"watch"))}return s.split(/[\s,]+/).filter(Boolean).map(o=>L(o,"watch"))}function Re(e,s,o,a,i,r=0){var N;if(r>8)throw new Error("FLOW recursion limit exceeded.");const d=new Map;for(const[u,l]of a.entries())d.set(u,l);for(const u of e){const{slot:l,value:$}=it(u);d.set(l,$),i.push(`${" ".repeat(r)}literal ${l} = ${A($)}`)}let w,y=!1;for(const[u,l]of s.entries()){const $=String(l.op??"").trim().toUpperCase();if($==="SET"){const f=L(l.dstSlot,`instructions[${u}].dstSlot`),C=L(l.srcSlot,`instructions[${u}].srcSlot`),O=d.get(C);d.set(f,O),i.push(`${" ".repeat(r)}${u}: SET ${f} = ${A(O)} from ${C}`);continue}if($==="CALL"){const f=$e(l.target??l.targetId),C=f.signature??((N=Ke.get(f.id))==null?void 0:N.signature),O=C?at[C]:void 0;if(!C||!O)throw new Error(`CALL target ${f.id} is not supported by the React local kernel.`);const U=(Array.isArray(l.args)?l.args.map(P=>L(P,`instructions[${u}].args`)):[]).map(P=>d.get(P)),I=O(U),R=l.dstSlot==null?null:L(l.dstSlot,`instructions[${u}].dstSlot`);R&&d.set(R,I),i.push(`${" ".repeat(r)}${u}: CALL ${C} -> ${R??"<no dst>"} = ${A(I)}`);continue}if($==="FLOW"){const f=$e(l.target??l.targetId),C=o.get(f.id);if(!C)throw new Error(`FLOW target ${f.id} is not registered in the React local composite registry.`);const O=Array.isArray(l.args)?l.args.map(R=>L(R,`instructions[${u}].args`)):[],j=new Map;for(const[R,P]of O.entries())j.set(rt(R),d.get(P));i.push(`${" ".repeat(r)}${u}: FLOW ${C.signature} (${f.id}) args=${O.length}`);const U=Re(C.literals,C.instructions,o,j,i,r+1),I=l.dstSlot==null?null:L(l.dstSlot,`instructions[${u}].dstSlot`);I&&U.didReturn&&d.set(I,U.returned),i.push(`${" ".repeat(r)}${u}: FLOW return -> ${I??"<no dst>"} = ${A(U.returned)}`);continue}if($==="RETURN"||$==="RET"){const f=l.srcSlot==null?null:L(l.srcSlot,`instructions[${u}].srcSlot`);w=f?d.get(f):void 0,y=!0,i.push(`${" ".repeat(r)}${u}: RETURN ${f??"<void>"} = ${A(w)}`);break}throw new Error(`Unknown op at instructions[${u}]: ${$||"<empty>"}`)}return{memory:d,returned:w,didReturn:y}}function ct(e,s,o=new Map){const{literals:a,instructions:i}=Le(e),r=[],{memory:d,returned:w}=Re(a,i,o,new Map,r),y=Oe(s),u=(y.length>0?y:Array.from(d.keys()).sort().slice(0,64)).map(l=>`- ${l} = ${A(d.get(l))}`);return[`OK: executed locally (atoms=${i.length}, literals=${a.length})`,`return: ${A(w)}`,"","trace:",...r,"",y.length>0?"watch:":"root user-space slots:",...u.length>0?u:["(none)"],"","adapter: local-react-shell"].join(`
1
+ import{r as c,j as t}from"./vendor-react-BXzpOyCS.js";import{g as Ce,o as je,x as Me,aL as Qe,aM as ze,aN as Ge,aO as _e}from"./canvas-runtime-CddXXjp9.js";import{R as g}from"./app-runtime-xD2Z3NdN.js";import{l as Ve,s as Xe}from"./executionModeSettings-NJqurj-o.js";import{A as Ye,a8 as Ze,R as et,b9 as tt,b7 as nt}from"./vendor-icons-678PAT8P.js";import"./runtimeSettingsPersistenceProjection-BoNWmYjU.js";const Ee=["Concept.KernelHelp","Concept.Hash64","Concept.DefineComposite","Concept.Embed","Concept.Execute"],ot=0x0000000080000000n,F=11400714785074694791n,Z=14029467366897019727n,ve=1609587929392839161n,Ie=9650029242287828579n,we=2870177450012600261n;function m(e){return BigInt.asUintN(64,e)}function q(e,s){const o=BigInt(s);return m(m(e)<<o|m(e)>>64n-o)}function Y(e,s){let o=0n;for(let a=0;a<8;a+=1)o|=BigInt(e[s+a])<<BigInt(a*8);return m(o)}function st(e,s){return(e[s]|e[s+1]<<8|e[s+2]<<16|e[s+3]<<24)>>>0}function Q(e,s){let o=m(e+m(s*Z));return o=q(o,31),m(o*F)}function oe(e,s){let o=m(e^Q(0n,s));return o=m(o*F+Ie),o}function k(e){const s=e.trim();if(!s)throw new Error("signature is empty");const o=new TextEncoder().encode(s),a=o.length;let i=0,r;if(a>=32){let d=m(F+Z),w=m(Z),y=0n,N=m(-F);const u=a-32;for(;i<=u;)d=Q(d,Y(o,i)),i+=8,w=Q(w,Y(o,i)),i+=8,y=Q(y,Y(o,i)),i+=8,N=Q(N,Y(o,i)),i+=8;r=m(q(d,1)+q(w,7)+q(y,12)+q(N,18)),r=oe(r,d),r=oe(r,w),r=oe(r,y),r=oe(r,N)}else r=m(we);for(r=m(r+BigInt(a));i<=a-8;){const d=Q(0n,Y(o,i));r=m(r^d),r=m(q(r,27)*F+Ie),i+=8}for(i<=a-4&&(r=m(r^BigInt(st(o,i))*F),r=m(q(r,23)*Z+ve),i+=4);i<a;)r=m(r^BigInt(o[i])*we),r=m(q(r,11)*F),i+=1;return r=m(r^r>>33n),r=m(r*Z),r=m(r^r>>29n),r=m(r*ve),r=m(r^r>>32n),`0x${r.toString(16).padStart(16,"0")}`}const le=[{category:"Math.Double",signature:"MindExecution.Kernel.Add(System.Double,System.Double)",summary:"a+b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Sub(System.Double,System.Double)",summary:"a-b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Mul(System.Double,System.Double)",summary:"a*b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Div(System.Double,System.Double)",summary:"a/b",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Min(System.Double,System.Double)",summary:"min(a,b)",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Max(System.Double,System.Double)",summary:"max(a,b)",supported:!0},{category:"Math.Double",signature:"MindExecution.Kernel.Round(System.Double)",summary:"round(x)",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Add(System.Int64,System.Int64)",summary:"a+b",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Sub(System.Int64,System.Int64)",summary:"a-b",supported:!0},{category:"Math.Int64",signature:"MindExecution.Kernel.Mul(System.Int64,System.Int64)",summary:"a*b",supported:!0},{category:"Compare.Double",signature:"MindExecution.Kernel.Gt(System.Double,System.Double)",summary:"a>b",supported:!0},{category:"Compare.Double",signature:"MindExecution.Kernel.Eq(System.Double,System.Double)",summary:"a==b",supported:!0},{category:"Logic",signature:"MindExecution.Kernel.IfElse(System.Boolean,System.Object,System.Object)",summary:"cond ? a : b",supported:!0},{category:"String",signature:"MindExecution.Kernel.Concat(System.String,System.String)",summary:"a+b",supported:!0},{category:"String",signature:"MindExecution.Kernel.Length(System.String)",summary:"len(s)",supported:!0},{category:"String",signature:"MindExecution.Kernel.ToString(System.Object)",summary:"x?.ToString()",supported:!0},{category:"Convert",signature:"MindExecution.Kernel.ToDouble(System.Object)",summary:"Convert.ToDouble",supported:!0},{category:"Convert",signature:"MindExecution.Kernel.ToInt64(System.Object)",summary:"Convert.ToInt64",supported:!0},{category:"Json",signature:"MindExecution.Kernel.Json.Parse(System.String)",summary:"parse JSON",supported:!0},{category:"Json",signature:"MindExecution.Kernel.Json.Stringify(System.Object)",summary:"serialize JSON",supported:!0},{category:"System",signature:"MindExecution.Kernel.System.GetManifest()",summary:"local manifest subset",supported:!0},{category:"System",signature:"MindExecution.Kernel.System.SignatureToId(System.String)",summary:"signature -> local 0x hash",supported:!0},{category:"Debug",signature:"MindExecution.Kernel.Print(System.Object)",summary:"ToString",supported:!0},{category:"Debug",signature:"MindExecution.Kernel.TypeOf(System.Object)",summary:"JavaScript type name",supported:!0},{category:"Time",signature:"MindExecution.Kernel.UtcNow()",summary:"UTC ISO timestamp",supported:!0},{category:"Hash",signature:"MindExecution.Kernel.Hash.Sha256(System.String)",summary:"adapter-gated in React shell",supported:!1}],Ke=new Map(le.map(e=>[k(e.signature),e]));function x(e){const s=typeof e=="number"?e:Number(e);if(!Number.isFinite(s))throw new Error(`Expected numeric value, got ${A(e)}.`);return s}function J(e){return Math.trunc(x(e))}function L(e,s){if(typeof e=="number"&&Number.isInteger(e)&&e>=0)return`0x${e.toString(16).padStart(16,"0")}`;if(typeof e!="string")throw new Error(`${s} must be a hex slot string or integer.`);const o=e.trim();if(/^0x[0-9a-f]{1,16}$/i.test(o))return`0x${o.slice(2).toLowerCase().padStart(16,"0")}`;if(/^\d+$/.test(o))return`0x${Number(o).toString(16).padStart(16,"0")}`;throw new Error(`${s} must be 0x[0-9a-f]{16}, short hex, or integer.`)}function rt(e){return`0x${(ot+BigInt(e)).toString(16).padStart(16,"0")}`}function Le(e){const s=JSON.parse(e),o=Array.isArray(s.literals)?s.literals:[],a=Array.isArray(s.instructions)?s.instructions:[];if(a.length===0)throw new Error("IR must include an instructions array.");return{literals:o,instructions:a}}function $e(e){var o;if(typeof e=="string"&&e.trim().startsWith("$")){const a=e.trim().slice(1).trim();if(!a)throw new Error("target signature cannot be empty.");return{id:k(a),signature:a}}const s=L(e,"target");return{id:s,signature:(o=Ke.get(s))==null?void 0:o.signature}}function A(e){if(e===void 0)return"<unset>";if(e===null)return"<null>";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function it(e){if(!e||typeof e!="object")throw new Error("Literal entries must be objects.");const s=e,o=L(s.id??s.slot,"literal.id"),a=String(s.type??"json").toLowerCase(),i=s.value;return a==="null"?{slot:o,value:null}:a==="bool"?{slot:o,value:!!i}:a==="int"?{slot:o,value:J(i)}:a==="double"?{slot:o,value:x(i)}:a==="string"?{slot:o,value:String(i??"")}:{slot:o,value:i}}const at={"MindExecution.Kernel.Add(System.Double,System.Double)":e=>x(e[0])+x(e[1]),"MindExecution.Kernel.Sub(System.Double,System.Double)":e=>x(e[0])-x(e[1]),"MindExecution.Kernel.Mul(System.Double,System.Double)":e=>x(e[0])*x(e[1]),"MindExecution.Kernel.Div(System.Double,System.Double)":e=>x(e[1])===0?Number.NaN:x(e[0])/x(e[1]),"MindExecution.Kernel.Min(System.Double,System.Double)":e=>Math.min(x(e[0]),x(e[1])),"MindExecution.Kernel.Max(System.Double,System.Double)":e=>Math.max(x(e[0]),x(e[1])),"MindExecution.Kernel.Round(System.Double)":e=>Math.round(x(e[0])),"MindExecution.Kernel.Add(System.Int64,System.Int64)":e=>J(e[0])+J(e[1]),"MindExecution.Kernel.Sub(System.Int64,System.Int64)":e=>J(e[0])-J(e[1]),"MindExecution.Kernel.Mul(System.Int64,System.Int64)":e=>J(e[0])*J(e[1]),"MindExecution.Kernel.Gt(System.Double,System.Double)":e=>x(e[0])>x(e[1]),"MindExecution.Kernel.Eq(System.Double,System.Double)":e=>x(e[0])===x(e[1]),"MindExecution.Kernel.IfElse(System.Boolean,System.Object,System.Object)":e=>e[0]?e[1]:e[2],"MindExecution.Kernel.Concat(System.String,System.String)":e=>`${e[0]??""}${e[1]??""}`,"MindExecution.Kernel.Length(System.String)":e=>String(e[0]??"").length,"MindExecution.Kernel.ToString(System.Object)":e=>e[0]==null?"":String(e[0]),"MindExecution.Kernel.ToDouble(System.Object)":e=>x(e[0]),"MindExecution.Kernel.ToInt64(System.Object)":e=>J(e[0]),"MindExecution.Kernel.Json.Parse(System.String)":e=>JSON.parse(String(e[0]??"null")),"MindExecution.Kernel.Json.Stringify(System.Object)":e=>JSON.stringify(e[0]),"MindExecution.Kernel.System.GetManifest()":()=>le.map(e=>({...e,id:k(e.signature)})),"MindExecution.Kernel.System.SignatureToId(System.String)":e=>k(String(e[0]??"")),"MindExecution.Kernel.Print(System.Object)":e=>A(e[0]),"MindExecution.Kernel.TypeOf(System.Object)":e=>e[0]===null?"null":Array.isArray(e[0])?"array":typeof e[0],"MindExecution.Kernel.UtcNow()":()=>new Date().toISOString()};function Oe(e){const s=e.trim();if(!s)return[];if(s.startsWith("[")){const o=JSON.parse(s);if(!Array.isArray(o))throw new Error("Watch JSON must be an array of slots.");return o.map(a=>L(a,"watch"))}return s.split(/[\s,]+/).filter(Boolean).map(o=>L(o,"watch"))}function Re(e,s,o,a,i,r=0){var N;if(r>8)throw new Error("FLOW recursion limit exceeded.");const d=new Map;for(const[u,l]of a.entries())d.set(u,l);for(const u of e){const{slot:l,value:$}=it(u);d.set(l,$),i.push(`${" ".repeat(r)}literal ${l} = ${A($)}`)}let w,y=!1;for(const[u,l]of s.entries()){const $=String(l.op??"").trim().toUpperCase();if($==="SET"){const f=L(l.dstSlot,`instructions[${u}].dstSlot`),C=L(l.srcSlot,`instructions[${u}].srcSlot`),O=d.get(C);d.set(f,O),i.push(`${" ".repeat(r)}${u}: SET ${f} = ${A(O)} from ${C}`);continue}if($==="CALL"){const f=$e(l.target??l.targetId),C=f.signature??((N=Ke.get(f.id))==null?void 0:N.signature),O=C?at[C]:void 0;if(!C||!O)throw new Error(`CALL target ${f.id} is not supported by the React local kernel.`);const U=(Array.isArray(l.args)?l.args.map(P=>L(P,`instructions[${u}].args`)):[]).map(P=>d.get(P)),I=O(U),R=l.dstSlot==null?null:L(l.dstSlot,`instructions[${u}].dstSlot`);R&&d.set(R,I),i.push(`${" ".repeat(r)}${u}: CALL ${C} -> ${R??"<no dst>"} = ${A(I)}`);continue}if($==="FLOW"){const f=$e(l.target??l.targetId),C=o.get(f.id);if(!C)throw new Error(`FLOW target ${f.id} is not registered in the React local composite registry.`);const O=Array.isArray(l.args)?l.args.map(R=>L(R,`instructions[${u}].args`)):[],j=new Map;for(const[R,P]of O.entries())j.set(rt(R),d.get(P));i.push(`${" ".repeat(r)}${u}: FLOW ${C.signature} (${f.id}) args=${O.length}`);const U=Re(C.literals,C.instructions,o,j,i,r+1),I=l.dstSlot==null?null:L(l.dstSlot,`instructions[${u}].dstSlot`);I&&U.didReturn&&d.set(I,U.returned),i.push(`${" ".repeat(r)}${u}: FLOW return -> ${I??"<no dst>"} = ${A(U.returned)}`);continue}if($==="RETURN"||$==="RET"){const f=l.srcSlot==null?null:L(l.srcSlot,`instructions[${u}].srcSlot`);w=f?d.get(f):void 0,y=!0,i.push(`${" ".repeat(r)}${u}: RETURN ${f??"<void>"} = ${A(w)}`);break}throw new Error(`Unknown op at instructions[${u}]: ${$||"<empty>"}`)}return{memory:d,returned:w,didReturn:y}}function ct(e,s,o=new Map){const{literals:a,instructions:i}=Le(e),r=[],{memory:d,returned:w}=Re(a,i,o,new Map,r),y=Oe(s),u=(y.length>0?y:Array.from(d.keys()).sort().slice(0,64)).map(l=>`- ${l} = ${A(d.get(l))}`);return[`OK: executed locally (atoms=${i.length}, literals=${a.length})`,`return: ${A(w)}`,"","trace:",...r,"",y.length>0?"watch:":"root user-space slots:",...u.length>0?u:["(none)"],"","adapter: local-react-shell"].join(`
2
2
  `)}function lt(e,s,o=16){const a=`${e}
3
3
 
4
4
  Description: ${s}`,i=Array.from({length:o},(d,w)=>{const y=BigInt(k(`${a}#${w}`)),N=Number(y&0xffffn)/32767.5-1;return Number(N.toFixed(6))}),r=a.trim().length===0?0:a.trim().split(/\s+/).length;return{input:a,vector:i,tokens:r}}const Ne=JSON.stringify({literals:[{id:"0x0000000000000000",type:"double",value:1},{id:"0x0000000000000001",type:"double",value:10}],instructions:[{op:"CALL",target:"$MindExecution.Kernel.Add(System.Double,System.Double)",args:["0x0000000000000000","0x0000000000000001"],dstSlot:"0x0000000000000002"},{op:"RETURN",srcSlot:"0x0000000000000002"}]},null,2),De=JSON.stringify({literals:[],instructions:[{op:"CALL",target:"$MindExecution.Kernel.Add(System.Double,System.Double)",args:["0x0000000080000000","0x0000000080000001"],dstSlot:"0x0000000000000000"},{op:"RETURN",srcSlot:"0x0000000000000000"}]},null,2);function dt(e,s){var a;const o=((a=e.latestRows)==null?void 0:a[0])||{};return{provider:e.provider||"LocalBridgeJsonConceptStore",adapterState:e.adapterState||"json-row-projection",nativeSqliteAdapterState:e.nativeSqliteAdapterState||"adapter-gated",paidEmbeddingAdapterState:e.paidEmbeddingAdapterState||"adapter-gated",originalTable:e.originalTable||"tbl_concepts",rowCount:Number(e.rowCount||0),indexPath:e.indexPath||"",latestRowId:(s==null?void 0:s.id)||o.id||"",latestRowSqlKey:(s==null?void 0:s.sqlKey)||o.sqlKey||"",latestRowSignature:(s==null?void 0:s.signature)||o.signature||"",sqliteReadyColumns:(e.sqliteReadyColumns||[]).slice(0,16)}}function ht(){const[e,s]=c.useState(Ne),[o,a]=c.useState(()=>Ve()),[i,r]=c.useState("MindExecution.Kernel.Add(System.Double,System.Double)"),[d,w]=c.useState("MindExecution.Dynamic.Sum(System.Double,System.Double)"),[y,N]=c.useState("Adds two double values through a browser-local FLOW composite."),[u,l]=c.useState(De),[$,f]=c.useState("MindExecution.Dynamic.Sum(System.Double,System.Double)"),[C,O]=c.useState("Adds two doubles through a Concept FLOW composite. Browser preview only."),[j,U]=c.useState([]),[I,R]=c.useState("0x0000000000000002"),[P,M]=c.useState(""),[z,de]=c.useState(!1),[H,se]=c.useState("idle"),[ue,pe]=c.useState(""),[Ae,me]=c.useState(""),[ke,ge]=c.useState(""),[h,xe]=c.useState(null),[p,Pe]=c.useState(null),[re,ie]=c.useState("idle"),[Se,he]=c.useState(""),G=c.useRef(0),_=c.useMemo(()=>le.map(n=>({...n,id:k(n.signature)})),[]),be=c.useMemo(()=>new Map(j.map(n=>[n.id,n])),[j]),T=o.executionMode,V=o.directInstructionQueueMode,ye=c.useCallback((n,S)=>{const v=Xe({...o,...n},S);a(v),g.emit("executionMode.settings.changed",{source:S,executionMode:v.executionMode,directInstructionQueueMode:v.directInstructionQueueMode})},[o]),Te=c.useCallback(()=>{de(!0),g.emit("executionMode.tool.run",{toolName:T==="PureLLM"?"PureLLM.AdapterGate":"Concept.Execute"}),g.emit("executionMode.run.local",{hasPrompt:!!e.trim(),mode:T,directInstructionQueueMode:V,adapterGated:T==="PureLLM"}),window.setTimeout(()=>{const n=e.trim();if(T==="PureLLM")M(["PureLLM mode selected.","","Live direct LLM execution is adapter-gated in this React shell.",`Queue mode: ${V}`,"","Use Concept mode for deterministic browser-local JSON IR testing until a verified Agent adapter is connected."].join(`