Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response: 199.488 717.852 199.488C718.137 199.488 718.383 199.443 718.59 199.354C718.801 199.264 718.979 199.137 719.123 198.973C719.268 198.812 719.383 198.623 719.469 198.404C719.555 198.182 719.615 197.941 719.65 197.684H720.734ZM727.109 196.307H723.547V199.33H727.701V200.25H722.463V191.719H727.648V192.645H723.547V195.387H727.109V196.307ZM734.088 198.094C734.088 197.832 734.027 197.611 733.906 197.432C733.789 197.252 733.637 197.1 733.449 196.975C733.262 196.854 733.055 196.752 732.828 196.67C732.605 196.588 732.391 196.514 732.184 196.447C731.883 196.35 731.576 196.232 731.264 196.096C730.955 195.955 730.674 195.787 730.42 195.592C730.162 195.393 729.951 195.158 729.787 194.889C729.627 194.615 729.547 194.295 729.547 193.928C729.547 193.561 729.627 193.232 729.787 192.943C729.951 192.654 730.164 192.41 730.426 192.211C730.688 192.012 730.984 191.861 731.316 191.76C731.648 191.654 731.982 191.602 732.318 191.602C732.689 191.602 733.047 191.664 733.391 191.789C733.734 191.91 734.039 192.082 734.305 192.305C734.57 192.527 734.783 192.797 734.943 193.113C735.104 193.43 735.188 193.783 735.195 194.174H734.082C734.051 193.928 733.99 193.705 733.9 193.506C733.811 193.303 733.691 193.129 733.543 192.984C733.395 192.84 733.217 192.729 733.01 192.65C732.807 192.568 732.576 192.527 732.318 192.527C732.111 192.527 731.908 192.557 731.709 192.615C731.514 192.674 731.34 192.762 731.188 192.879C731.031 192.996 730.906 193.141 730.812 193.312C730.723 193.484 730.678 193.684 730.678 193.91C730.682 194.156 730.744 194.365 730.865 194.537C730.986 194.705 731.141 194.848 731.328 194.965C731.512 195.082 731.711 195.18 731.926 195.258C732.145 195.336 732.35 195.404 732.541 195.463C732.857 195.561 733.174 195.68 733.49 195.82C733.807 195.957 734.096 196.133 734.357 196.348C734.615 196.547 734.822 196.791 734.979 197.08C735.139 197.369 735.219 197.703 735.219 198.082C735.219 198.465 735.133 198.799 734.961 199.084C734.793 199.369 734.574 199.605 734.305 199.793C734.035 199.984 733.73 200.129 733.391 200.227C733.051 200.32 732.711 200.367 732.371 200.367C731.965 200.367 731.564 200.299 731.17 200.162C730.779 200.025 730.439 199.828 730.15 199.57C729.893 199.348 729.688 199.088 729.535 198.791C729.387 198.49 729.307 198.156 729.295 197.789H730.402C730.438 198.055 730.51 198.291 730.619 198.498C730.729 198.701 730.869 198.873 731.041 199.014C731.213 199.158 731.41 199.268 731.633 199.342C731.859 199.412 732.105 199.447 732.371 199.447C732.582 199.447 732.789 199.422 732.992 199.371C733.199 199.316 733.383 199.232 733.543 199.119C733.703 199.01 733.834 198.871 733.936 198.703C734.037 198.531 734.088 198.328 734.088 198.094ZM741.295 198.094C741.295 197.832 741.234 197.611 741.113 197.432C740.996 197.252 740.844 197.1 740.656 196.975C740.469 196.854 740.262 196.752 740.035 196.67C739.812 196.588 739.598 196.514 739.391 196.447C739.09 196.35 738.783 196.232 738.471 196.096C738.162 195.955 737.881 195.787 737.627 195.592C737.369 195.393 737.158 195.158 736.994 194.889C736.834 194.615 736.754 194.295 736.754 193.928C736.754 193.561 736.834 193.232 736.994 192.943C737.158 192.654 737.371 192.41 737.633 192.211C737.895 192.012 738.191 191.861 738.523 191.76C738.855 191.654 739.189 191.602 739.525 191.602C739.896 191.602 740.254 191.664 740.598 191.789C740.941 191.91 741.246 192.082 741.512 192.305C741.777 192.527 741.99 192.797 742.15 193.113C742.311 193.43 742.395 193.783 742.402 194.174H741.289C741.258 193.928 741.197 193.705 741.107 193.506C741.018 193.303 740.898 193.129 740.75 192.984C740.602 192.84 740.424 192.729 740.217 192.65C740.014 192.568 739.783 192.527 739.525 192.527C739.318 192.527 739.115 192.557 738.916 192.615C738.721 192.674 738.547 192.762 738.395 192.879C738.238 192.996 738.113 193.141 738.02 193.312C737.93 193.484 737.885 193.684 737.885 193.91C737.889 194.156 737.951 194.365 738.072 194.537C738.193 194.705 738.348 194.848 738.535 194.965C738.719 195.082 738.918 195.18 739.133 195.258C739.352 195.336 739.557 195.404 739.748 195.463C740.064 195.561 740.381 195.68 740.697 195.82C


Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response: 192.557 738.916 192.615C738.721 192.674 738.547 192.762 738.395 192.879C738.238 192.996 738.113 193.141 738.02 193.312C737.93 193.484 737.885 193.684 737.885 193.91C737.889 194.156 737.951 194.365 738.072 194.537C738.193 194.705 738.348 194.848 738.535 194.965C738.719 195.082 738.918 195.18 739.133 195.258C739.352 195.336 739.557 195.404 739.748 195.463C740.064 195.561 740.381 195.68 740.697 195.82C741.014 195.957 741.303 196.133 741.564 196.348C741.822 196.547 742.029 196.791 742.186 197.08C742.346 197.369 742.426 197.703 742.426 198.082C742.426 198.465 742.34 198.799 742.168 199.084C742 199.369 741.781 199.605 741.512 199.793C741.242 199.984 740.938 200.129 740.598 200.227C740.258 200.32 739.918 200.367 739.578 200.367C739.172 200.367 738.771 200.299 738.377 200.162C737.986 200.025 737.646 199.828 737.357 199.57C737.1 199.348 736.895 199.088 736.742 198.791C736.594 198.49 736.514 198.156 736.502 197.789H737.609C737.645 198.055 737.717 198.291 737.826 198.498C737.936 198.701 738.076 198.873 738.248 199.014C738.42 199.158 738.617 199.268 738.84 199.342C739.066 199.412 739.312 199.447 739.578 199.447C739.789 199.447 739.996 199.422 740.199 199.371C740.406 199.316 740.59 199.232 740.75 199.119C740.91 199.01 741.041 198.871 741.143 198.703C741.244 198.531 741.295 198.328 741.295 198.094ZM756.494 193.945C756.49 194.23 756.436 194.498 756.33 194.748C756.225 194.994 756.078 195.211 755.891 195.398C755.801 195.488 755.701 195.572 755.592 195.65C755.482 195.729 755.365 195.799 755.24 195.861C755.459 195.955 755.656 196.072 755.832 196.213C756.012 196.35 756.166 196.508 756.295 196.688C756.42 196.867 756.516 197.062 756.582 197.273C756.652 197.484 756.688 197.709 756.688 197.947C756.688 198.334 756.615 198.678 756.471 198.979C756.33 199.279 756.139 199.531 755.896 199.734C755.65 199.941 755.363 200.1 755.035 200.209C754.707 200.314 754.355 200.367 753.98 200.367C753.598 200.367 753.24 200.314 752.908 200.209C752.58 200.104 752.295 199.947 752.053 199.74C751.807 199.537 751.613 199.285 751.473 198.984C751.332 198.684 751.262 198.338 751.262 197.947C751.262 197.709 751.295 197.484 751.361 197.273C751.428 197.059 751.523 196.861 751.648 196.682C751.773 196.506 751.924 196.348 752.1 196.207C752.275 196.066 752.473 195.949 752.691 195.855C752.504 195.762 752.334 195.65 752.182 195.521C752.029 195.389 751.9 195.24 751.795 195.076C751.689 194.916 751.607 194.74 751.549 194.549C751.49 194.357 751.461 194.156 751.461 193.945C751.461 193.574 751.523 193.244 751.648 192.955C751.773 192.662 751.947 192.416 752.17 192.217C752.389 192.018 752.65 191.865 752.955 191.76C753.264 191.654 753.6 191.602 753.963 191.602C754.322 191.602 754.656 191.654 754.965 191.76C755.273 191.865 755.541 192.018 755.768 192.217C755.994 192.416 756.172 192.662 756.301 192.955C756.43 193.244 756.494 193.574 756.494 193.945ZM755.604 197.924C755.604 197.686 755.562 197.467 755.48 197.268C755.402 197.068 755.291 196.896 755.146 196.752C755.002 196.611 754.828 196.502 754.625 196.424C754.426 196.346 754.207 196.307 753.969 196.307C753.723 196.307 753.5 196.346 753.301 196.424C753.102 196.502 752.932 196.611 752.791 196.752C752.65 196.896 752.541 197.068 752.463 197.268C752.389 197.467 752.352 197.686 752.352 197.924C752.352 198.17 752.389 198.391 752.463 198.586C752.541 198.777 752.65 198.939 752.791 199.072C752.932 199.205 753.102 199.307 753.301 199.377C753.504 199.447 753.73 199.482 753.98 199.482C754.219 199.482 754.438 199.447 754.637 199.377C754.836 199.307 755.008 199.205 755.152 199.072C755.293 198.939 755.402 198.777 755.48 198.586C755.562 198.391 755.604 198.17 755.604 197.924ZM755.404 193.963C755.404 193.748 755.367 193.551 755.293 193.371C755.223 193.191 755.125 193.035 755 192.902C754.871 192.773 754.719 192.674 754.543 192.604C754.367 192.529 754.174 192.492 753.963 192.492C753.752 192.492 753.561 192.527 753.389 192.598C753.217 192.664 753.068 192.762 752.943 192.891C752.818 193.02 752.721 193.176 752.65 193.359C752.584 193.539 752.551 193.74 752.551 193.963C752.551 194.186 752.584 194.387 752


Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response:
 193.748 755.367 193.551 755.293 193.371C755.223 193.191 755.125 193.035 755 192.902C754.871 192.773 754.719 192.674 754.543 192.604C754.367 192.529 754.174 192.492 753.963 192.492C753.752 192.492 753.561 192.527 753.389 192.598C753.217 192.664 753.068 192.762 752.943 192.891C752.818 193.02 752.721 193.176 752.65 193.359C752.584 193.539 752.551 193.74 752.551 193.963C752.551 194.186 752.584 194.387 752.65 194.566C752.721 194.742 752.82 194.893 752.949 195.018C753.074 195.146 753.223 195.246 753.395 195.316C753.57 195.383 753.764 195.416 753.975 195.416C754.182 195.416 754.373 195.383 754.549 195.316C754.725 195.246 754.877 195.146 755.006 195.018C755.131 194.893 755.229 194.74 755.299 194.561C755.369 194.381 755.404 194.182 755.404 193.963Z" fill="black"></path>
<rect x="420.5" y="228.5" width="409" height="217" rx="9.5" fill="#FDEEDF"></rect>
<rect x="420.5" y="228.5" width="409" height="217" rx="9.5" stroke="#CACACA"></rect>
<path d="M604.867 339.791H602.02L601.334 342H600.25L603.004 333.469H603.912L606.619 342H605.541L604.867 339.791ZM602.312 338.848H604.58L603.455 335.145L602.312 338.848ZM610.826 338.52H609.121V342H608.043V333.469H610.545C610.943 333.477 611.318 333.533 611.67 333.639C612.021 333.744 612.33 333.902 612.596 334.113C612.857 334.324 613.062 334.59 613.211 334.91C613.363 335.227 613.439 335.6 613.439 336.029C613.439 336.307 613.398 336.561 613.316 336.791C613.238 337.021 613.129 337.23 612.988 337.418C612.848 337.605 612.68 337.771 612.484 337.916C612.289 338.061 612.074 338.184 611.84 338.285L613.65 341.93L613.645 342H612.502L610.826 338.52ZM609.121 337.629H610.574C610.816 337.625 611.045 337.588 611.26 337.518C611.475 337.443 611.664 337.338 611.828 337.201C611.988 337.064 612.115 336.898 612.209 336.703C612.303 336.504 612.35 336.275 612.35 336.018C612.35 335.744 612.305 335.506 612.215 335.303C612.125 335.096 612 334.922 611.84 334.781C611.68 334.645 611.488 334.541 611.266 334.471C611.047 334.4 610.807 334.363 610.545 334.359H609.121V337.629ZM615.654 342L614.617 333.469H615.648L616.264 339.352L616.299 339.691L616.363 339.34L617.395 333.469H618.338L619.375 339.346L619.439 339.691L619.475 339.34L620.09 333.469H621.115L620.078 342H618.971L617.934 335.93L617.875 335.572L617.811 335.936L616.768 342H615.654ZM627.109 338.057H623.547V341.08H627.701V342H622.463V333.469H627.648V334.395H623.547V337.137H627.109V338.057ZM633.695 339.791H630.848L630.162 342H629.078L631.832 333.469H632.74L635.447 342H634.369L633.695 339.791ZM631.141 338.848H633.408L632.283 335.145L631.141 338.848ZM638.922 342L636.227 333.469H637.387L639.262 339.838L639.385 340.254L639.514 339.826L641.4 333.469H642.555L639.865 342H638.922ZM648.73 338.057H645.168V341.08H649.322V342H644.084V333.469H649.27V334.395H645.168V337.137H648.73V338.057Z" fill="black"></path>
</g>
<path d="M402 340L407 342.887L407 337.113L402 340ZM442 340L437 337.113L437 342.887L442 340ZM406.5 340.5L437.5 340.5L437.5 339.5L406.5 339.5L406.5 340.5Z" fill="#FF7A00"></path>
<path d="M380 30L385 32.8868L385 27.1132L380 30ZM426 30L421 27.1133L421 32.8868L426 30ZM384.5 30.5L421.5 30.5L421.5 29.5L384.5 29.5L384.5 30.5Z" fill="#753800"></path>
<path d="M380 143L385 145.887L385 140.113L380 143ZM426 143L421 140.113L421 145.887L426 143ZM384.5 143.5L421.5 143.5L421.5 142.5L384.5 142.5L384.5 143.5Z" fill="#753800"></path>
<path d="M182 81L187 83.8868L187 78.1132L182 81ZM427 81L422 78.1133L422 83.8868L427 81ZM186.5 81.5L422.5 81.5L422.5 80.5L186.5 80.5L186.5 81.5Z" fill="#753800"></path>
<path d="M182 194L187 196.887L187 191.113L182 194ZM427 194L422 191.113L422 196.887L427 194ZM186.5 194.5L422.5 194.5L422.5 193.5L186.5 193.5L186.5 194.5Z" fill="#753800"></path>
<path d="M625 204L622.113 209L627.887 209L625 204ZM625 250L627.887 245L622.113 245L625 250ZM624.5 208.5L624.5 245.5L625.5 245.5L625.5 208.5L624.5 208.5Z" fill="#FF7A00"></path>
<path d="M624 466L629 468.887L629 463.113L624 466ZM664 466L659 463.113L659 468.887L664 466ZM628.5 466.5L659.5 466.5L659.5 465.5L628


Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response:
 194.5L422.5 193.5L186.5 193.5L186.5 194.5Z" fill="#753800"></path>
<path d="M625 204L622.113 209L627.887 209L625 204ZM625 250L627.887 245L622.113 245L625 250ZM624.5 208.5L624.5 245.5L625.5 245.5L625.5 208.5L624.5 208.5Z" fill="#FF7A00"></path>
<path d="M624 466L629 468.887L629 463.113L624 466ZM664 466L659 463.113L659 468.887L664 466ZM628.5 466.5L659.5 466.5L659.5 465.5L628.5 465.5L628.5 466.5Z" fill="#FF7A00"></path>
<path d="M731 466L736 468.887L736 463.113L731 466ZM771 466L766 463.113L766 468.887L771 466ZM735.5 466.5L766.5 466.5L766.5 465.5L735.5 465.5L735.5 466.5Z" fill="black"></path>
<path d="M677.76 468.844C677.76 468.582 677.699 468.361 677.578 468.182C677.461 468.002 677.309 467.85 677.121 467.725C676.934 467.604 676.727 467.502 676.5 467.42C676.277 467.338 676.062 467.264 675.855 467.197C675.555 467.1 675.248 466.982 674.936 466.846C674.627 466.705 674.346 466.537 674.092 466.342C673.834 466.143 673.623 465.908 673.459 465.639C673.299 465.365 673.219 465.045 673.219 464.678C673.219 464.311 673.299 463.982 673.459 463.693C673.623 463.404 673.836 463.16 674.098 462.961C674.359 462.762 674.656 462.611 674.988 462.51C675.32 462.404 675.654 462.352 675.99 462.352C676.361 462.352 676.719 462.414 677.062 462.539C677.406 462.66 677.711 462.832 677.977 463.055C678.242 463.277 678.455 463.547 678.615 463.863C678.775 464.18 678.859 464.533 678.867 464.924H677.754C677.723 464.678 677.662 464.455 677.572 464.256C677.482 464.053 677.363 463.879 677.215 463.734C677.066 463.59 676.889 463.479 676.682 463.4C676.479 463.318 676.248 463.277 675.99 463.277C675.783 463.277 675.58 463.307 675.381 463.365C675.186 463.424 675.012 463.512 674.859 463.629C674.703 463.746 674.578 463.891 674.484 464.062C674.395 464.234 674.35 464.434 674.35 464.66C674.354 464.906 674.416 465.115 674.537 465.287C674.658 465.455 674.812 465.598 675 465.715C675.184 465.832 675.383 465.93 675.598 466.008C675.816 466.086 676.021 466.154 676.213 466.213C676.529 466.311 676.846 466.43 677.162 466.57C677.479 466.707 677.768 466.883 678.029 467.098C678.287 467.297 678.494 467.541 678.65 467.83C678.811 468.119 678.891 468.453 678.891 468.832C678.891 469.215 678.805 469.549 678.633 469.834C678.465 470.119 678.246 470.355 677.977 470.543C677.707 470.734 677.402 470.879 677.062 470.977C676.723 471.07 676.383 471.117 676.043 471.117C675.637 471.117 675.236 471.049 674.842 470.912C674.451 470.775 674.111 470.578 673.822 470.32C673.564 470.098 673.359 469.838 673.207 469.541C673.059 469.24 672.979 468.906 672.967 468.539H674.074C674.109 468.805 674.182 469.041 674.291 469.248C674.4 469.451 674.541 469.623 674.713 469.764C674.885 469.908 675.082 470.018 675.305 470.092C675.531 470.162 675.777 470.197 676.043 470.197C676.254 470.197 676.461 470.172 676.664 470.121C676.871 470.066 677.055 469.982 677.215 469.869C677.375 469.76 677.506 469.621 677.607 469.453C677.709 469.281 677.76 469.078 677.76 468.844ZM686.256 463.395H683.619V471H682.564V463.395H679.928V462.469H686.256V463.395ZM693.258 467.227C693.254 467.531 693.227 467.84 693.176 468.152C693.129 468.461 693.055 468.76 692.953 469.049C692.852 469.338 692.721 469.607 692.561 469.857C692.404 470.107 692.217 470.326 691.998 470.514C691.779 470.701 691.527 470.85 691.242 470.959C690.961 471.064 690.645 471.117 690.293 471.117C689.941 471.117 689.623 471.064 689.338 470.959C689.057 470.85 688.807 470.701 688.588 470.514C688.369 470.326 688.18 470.107 688.02 469.857C687.859 469.604 687.729 469.332 687.627 469.043C687.521 468.754 687.443 468.455 687.393 468.146C687.342 467.838 687.314 467.531 687.311 467.227V466.254C687.314 465.949 687.34 465.643 687.387 465.334C687.438 465.021 687.516 464.721 687.621 464.432C687.723 464.143 687.852 463.873 688.008 463.623C688.168 463.369 688.357 463.146 688.576 462.955C688.795 462.768 689.045 462.621 689.326 462.516C689.611 462.406 689.93 462.352 690.281 462.352C690.633 462.352 690.951 462.406 691.236 462.516C691.521 462.621 691.773 462.768 691.992 462.955C692.211 463.143 692.398 463.363 692.555 463.617C


Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response: 465.643 687.387 465.334C687.438 465.021 687.516 464.721 687.621 464.432C687.723 464.143 687.852 463.873 688.008 463.623C688.168 463.369 688.357 463.146 688.576 462.955C688.795 462.768 689.045 462.621 689.326 462.516C689.611 462.406 689.93 462.352 690.281 462.352C690.633 462.352 690.951 462.406 691.236 462.516C691.521 462.621 691.773 462.768 691.992 462.955C692.211 463.143 692.398 463.363 692.555 463.617C692.715 463.867 692.848 464.137 692.953 464.426C693.055 464.715 693.129 465.016 693.176 465.328C693.227 465.641 693.254 465.949 693.258 466.254V467.227ZM692.186 466.242C692.182 466.039 692.168 465.828 692.145 465.609C692.121 465.387 692.082 465.166 692.027 464.947C691.969 464.732 691.893 464.527 691.799 464.332C691.705 464.133 691.588 463.957 691.447 463.805C691.307 463.656 691.141 463.539 690.949 463.453C690.758 463.363 690.535 463.318 690.281 463.318C690.031 463.318 689.811 463.363 689.619 463.453C689.428 463.543 689.262 463.662 689.121 463.811C688.98 463.963 688.863 464.139 688.77 464.338C688.676 464.533 688.602 464.738 688.547 464.953C688.488 465.172 688.445 465.393 688.418 465.615C688.395 465.834 688.381 466.043 688.377 466.242V467.227C688.381 467.426 688.395 467.637 688.418 467.859C688.445 468.082 688.488 468.301 688.547 468.516C688.605 468.734 688.682 468.943 688.775 469.143C688.869 469.342 688.986 469.516 689.127 469.664C689.268 469.816 689.434 469.938 689.625 470.027C689.816 470.117 690.039 470.162 690.293 470.162C690.547 470.162 690.77 470.117 690.961 470.027C691.156 469.938 691.324 469.816 691.465 469.664C691.602 469.516 691.715 469.344 691.805 469.148C691.898 468.949 691.975 468.74 692.033 468.521C692.088 468.307 692.125 468.088 692.145 467.865C692.168 467.643 692.182 467.43 692.186 467.227V466.242ZM697.74 467.52H696.035V471H694.957V462.469H697.459C697.857 462.477 698.232 462.533 698.584 462.639C698.936 462.744 699.244 462.902 699.51 463.113C699.771 463.324 699.977 463.59 700.125 463.91C700.277 464.227 700.354 464.6 700.354 465.029C700.354 465.307 700.312 465.561 700.23 465.791C700.152 466.021 700.043 466.23 699.902 466.418C699.762 466.605 699.594 466.771 699.398 466.916C699.203 467.061 698.988 467.184 698.754 467.285L700.564 470.93L700.559 471H699.416L697.74 467.52ZM696.035 466.629H697.488C697.73 466.625 697.959 466.588 698.174 466.518C698.389 466.443 698.578 466.338 698.742 466.201C698.902 466.064 699.029 465.898 699.123 465.703C699.217 465.504 699.264 465.275 699.264 465.018C699.264 464.744 699.219 464.506 699.129 464.303C699.039 464.096 698.914 463.922 698.754 463.781C698.594 463.645 698.402 463.541 698.18 463.471C697.961 463.4 697.721 463.363 697.459 463.359H696.035V466.629ZM706.195 468.791H703.348L702.662 471H701.578L704.332 462.469H705.24L707.947 471H706.869L706.195 468.791ZM703.641 467.848H705.908L704.783 464.145L703.641 467.848ZM714.85 469.881C714.717 470.037 714.576 470.18 714.428 470.309C714.279 470.434 714.125 470.543 713.965 470.637C713.691 470.801 713.396 470.922 713.08 471C712.764 471.082 712.432 471.121 712.084 471.117C711.732 471.113 711.408 471.061 711.111 470.959C710.818 470.854 710.555 470.709 710.32 470.525C710.086 470.346 709.881 470.133 709.705 469.887C709.529 469.641 709.383 469.373 709.266 469.084C709.145 468.799 709.053 468.5 708.99 468.188C708.932 467.871 708.9 467.553 708.896 467.232V466.242C708.9 465.926 708.928 465.611 708.979 465.299C709.033 464.982 709.115 464.68 709.225 464.391C709.334 464.102 709.471 463.834 709.635 463.588C709.799 463.338 709.996 463.121 710.227 462.938C710.453 462.758 710.711 462.615 711 462.51C711.289 462.404 711.613 462.352 711.973 462.352C712.371 462.352 712.738 462.414 713.074 462.539C713.41 462.66 713.703 462.834 713.953 463.061C714.203 463.291 714.404 463.568 714.557 463.893C714.709 464.213 714.803 464.572 714.838 464.971H713.766C713.723 464.725 713.656 464.498 713.566 464.291C713.477 464.08 713.359 463.9 713.215 463.752C713.066 463.604 712.891 463.488 712.688 463.406C712.484 463.32 712.248 463.277 711.979 463.277C711.721 463.277 711.492 463.322 711.293 463.412C711.094 463.498 710.92 463.615 710.771 463.


Prompt:
This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md
Note: This content continues in the next part.

Response:
834 713.953 463.061C714.203 463.291 714.404 463.568 714.557 463.893C714.709 464.213 714.803 464.572 714.838 464.971H713.766C713.723 464.725 713.656 464.498 713.566 464.291C713.477 464.08 713.359 463.9 713.215 463.752C713.066 463.604 712.891 463.488 712.688 463.406C712.484 463.32 712.248 463.277 711.979 463.277C711.721 463.277 711.492 463.322 711.293 463.412C711.094 463.498 710.92 463.615 710.771 463.764C710.623 463.912 710.5 464.086 710.402 464.285C710.305 464.48 710.225 464.688 710.162 464.906C710.1 465.125 710.055 465.348 710.027 465.574C710 465.801 709.986 466.02 709.986 466.23V467.232C709.99 467.447 710.008 467.67 710.039 467.9C710.074 468.127 710.127 468.35 710.197 468.568C710.268 468.787 710.357 468.994 710.467 469.189C710.576 469.385 710.709 469.557 710.865 469.705C711.018 469.854 711.195 469.973 711.398 470.062C711.602 470.148 711.832 470.193 712.09 470.197C712.238 470.201 712.393 470.195 712.553 470.18C712.717 470.164 712.875 470.133 713.027 470.086C713.18 470.039 713.322 469.977 713.455 469.898C713.588 469.816 713.699 469.711 713.789 469.582L713.801 467.666H712.066V466.752H714.832L714.85 469.881ZM721.23 467.057H717.668V470.08H721.822V471H716.584V462.469H721.77V463.395H717.668V466.137H721.23V467.057Z" fill="#FF7A00"></path>
<path d="M785.639 471H784.537L781.227 464.625L781.209 471H780.113V462.469H781.215L784.525 468.832L784.543 462.469H785.639V471ZM792.195 467.057H788.633V470.08H792.787V471H787.549V462.469H792.734V463.395H788.633V466.137H792.195V467.057ZM800.463 463.395H797.826V471H796.771V463.395H794.135V462.469H800.463V463.395ZM802.361 471L801.324 462.469H802.355L802.971 468.352L803.006 468.691L803.07 468.34L804.102 462.469H805.045L806.082 468.346L806.146 468.691L806.182 468.34L806.797 462.469H807.822L806.785 471H805.678L804.641 464.93L804.582 464.572L804.518 464.936L803.475 471H802.361ZM814.672 467.227C814.668 467.531 814.641 467.84 814.59 468.152C814.543 468.461 814.469 468.76 814.367 469.049C814.266 469.338 814.135 469.607 813.975 469.857C813.818 470.107 813.631 470.326 813.412 470.514C813.193 470.701 812.941 470.85 812.656 470.959C812.375 471.064 812.059 471.117 811.707 471.117C811.355 471.117 811.037 471.064 810.752 470.959C810.471 470.85 810.221 470.701 810.002 470.514C809.783 470.326 809.594 470.107 809.434 469.857C809.273 469.604 809.143 469.332 809.041 469.043C808.936 468.754 808.857 468.455 808.807 468.146C808.756 467.838 808.729 467.531 808.725 467.227V466.254C808.729 465.949 808.754 465.643 808.801 465.334C808.852 465.021 808.93 464.721 809.035 464.432C809.137 464.143 809.266 463.873 809.422 463.623C809.582 463.369 809.771 463.146 809.99 462.955C810.209 462.768 810.459 462.621 810.74 462.516C811.025 462.406 811.344 462.352 811.695 462.352C812.047 462.352 812.365 462.406 812.65 462.516C812.936 462.621 813.188 462.768 813.406 462.955C813.625 463.143 813.812 463.363 813.969 463.617C814.129 463.867 814.262 464.137 814.367 464.426C814.469 464.715 814.543 465.016 814.59 465.328C814.641 465.641 814.668 465.949 814.672 466.254V467.227ZM813.6 466.242C813.596 466.039 813.582 465.828 813.559 465.609C813.535 465.387 813.496 465.166 813.441 464.947C813.383 464.732 813.307 464.527 813.213 464.332C813.119 464.133 813.002 463.957 812.861 463.805C812.721 463.656 812.555 463.539 812.363 463.453C812.172 463.363 811.949 463.318 811.695 463.318C811.445 463.318 811.225 463.363 811.033 463.453C810.842 463.543 810.676 463.662 810.535 463.811C810.395 463.963 810.277 464.139 810.184 464.338C810.09 464.533 810.016 464.738 809.961 464.953C809.902 465.172 809.859 465.393 809.832 465.615C809.809 465.834 809.795 466.043 809.791 466.242V467.227C809.795 467.426 809.809 467.637 809.832 467.859C809.859 468.082 809.902 468.301 809.961 468.516C810.02 468.734 810.096 468.943 810.189 469.143C810.283 469.342 810.4 469.516 810.541 469.664C810.682 469.816 810.848 469.938 811.039 470.027C811.23 470.117 811.453 470.162 811.707 470.162C811.961 470.162 812.184 470.117 812.375 470.027C812.57 469.938 812.738 469.816 812.879 469.664C813.016 469.516 813.129 469.344 813.219 469.148C813.312 468.949 813.


Prompt: This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: units.md Path: ../ao-cookbook/src/concepts/units.md

Response:
859C809.859 468.082 809.902 468.301 809.961 468.516C810.02 468.734 810.096 468.943 810.189 469.143C810.283 469.342 810.4 469.516 810.541 469.664C810.682 469.816 810.848 469.938 811.039 470.027C811.23 470.117 811.453 470.162 811.707 470.162C811.961 470.162 812.184 470.117 812.375 470.027C812.57 469.938 812.738 469.816 812.879 469.664C813.016 469.516 813.129 469.344 813.219 469.148C813.312 468.949 813.389 468.74 813.447 468.521C813.502 468.307 813.539 468.088 813.559 467.865C813.582 467.643 813.596 467.43 813.6 467.227V466.242ZM819.154 467.52H817.449V471H816.371V462.469H818.873C819.271 462.477 819.646 462.533 819.998 462.639C820.35 462.744 820.658 462.902 820.924 463.113C821.186 463.324 821.391 463.59 821.539 463.91C821.691 464.227 821.768 464.6 821.768 465.029C821.768 465.307 821.727 465.561 821.645 465.791C821.566 466.021 821.457 466.23 821.316 466.418C821.176 466.605 821.008 466.771 820.812 466.916C820.617 467.061 820.402 467.184 820.168 467.285L821.979 470.93L821.973 471H820.83L819.154 467.52ZM817.449 466.629H818.902C819.145 466.625 819.373 466.588 819.588 466.518C819.803 466.443 819.992 466.338 820.156 466.201C820.316 466.064 820.443 465.898 820.537 465.703C820.631 465.504 820.678 465.275 820.678 465.018C820.678 464.744 820.633 464.506 820.543 464.303C820.453 464.096 820.328 463.922 820.168 463.781C820.008 463.645 819.816 463.541 819.594 463.471C819.375 463.4 819.135 463.363 818.873 463.359H817.449V466.629ZM825.582 467.039L824.633 468.117V471H823.525V462.469H824.633V466.635L825.459 465.604L827.961 462.469H829.279L826.297 466.201L829.479 471H828.16L825.582 467.039Z" fill="black"></path>
<defs>
<clipPath id="clip0_238_127">
<rect width="830" height="446" fill="white"></rect>
</clipPath>
</defs>
</svg>

## What is a Unit?

The ao Computer is composed of three Unit types, each type contains a set of responsibilities for the computer. And each Unit is horizontally scalable.

In ao we have the `Messenger Unit` or `MU`, and the `Scheduler Unit` or `SU`, and the `Compute Unit` or the `CU`. These units are the building blocks of the ao Computer Grid. There can be 1 or more of these units on the network and they work together to power the ao Operating System or `aos`.

![MU](MU-diagram.png)

- Messenger Unit - This unit is the front door to ao, it receives all the messages from the outside and as well as directs traffic flow for Processes. This traffic flow we call `pushing`. Each process can return an Outbox when it evaluates a Message, and this Outbox can be filled with Messages or requests to Spawn new processes, and the Messenger Unit is responsible for extracting these Messages from the Outbox and signing them and sending them to the Scheduler Units for processing.

![SU Diagram](SU-diagram.png)

- Scheduler Unit - The Scheduler unit is responsible for ordering the messages, and storing those messages on Arweave. It is important that every message is appropriately ordered so that the evaluation can be replayed and verified. The Scheduler Unit is responsible for this process. It provides the abilty to query it via an endpoint to get the order of messages for evaluation.

![CU Diagram](CU-diagram.png)

- Compute Unit - The Compute unit is responsible for compute, this unit loads the binary module and manages the memory of that module, so that the execution of the process is alway running on the most up to date memory. The compute unit provides the results of the evaluation back to the the messenger unit, which can then push any messages in the outbox of the given process.

## Summary

The ao Computer consists of three scalable unit types—Messenger Unit (MU), Scheduler Unit (SU), and Compute Unit (CU)—which form the foundation of the ao Computer. These units can exist in multiples on the network and collectively operate the ao Operating System (aos).

The MU acts as the entry point, receiving external messages and managing process communications. It processes outgoing messages and spawn requests from process outboxes and forwards them to the SU.

The SU ensures messages are properly sequenced and stored on Arweave, maintaining order for consistent replay and verification of message evaluations.

The CU handles computation, loading binary modules, and managing memory to ensure processes run with current data. It then returns the evaluation results to the MU for further message handling.


Prompt: This is a Markdown documentation from the AO documentation repository. Filename: messages.md Path: ../ao-cookbook/src/concepts/messages.md

Response:
# Messages

The Message serves as the fundamental data protocol unit within ao, crafted from [ANS-104 DataItems](https://specs.g8way.io/?tx=xwOgX-MmqN5_-Ny_zNu2A8o-PnTGsoRb_3FrtiMAkuw), thereby aligning with the native structure of Arweave. When engaged in a Process, a Message is structured as follows:

```lua
{
    Cron = false,
    Data = "Hello aos",
    Epoch = 0,
    From = "5WzR7rJCuqCKEq02WUPhTjwnzllLjGu6SA7qhYpcKRs",
    Id = "ayVo53qvZswpvxLlhMf8xmGjwxN0LGuHzzQpTLT0_do",
    Nonce = 1,
    Owner = "z1pq2WzmaYnfDwvEFgUZBj48anUsxxN64ZjbWOsIn08",
    Signature = "...",
    Tags = {
        Type = "Message",
        Variant = "ao.TN.1",
        ["Data-Protocol"] = "ao",
        ["From-Module"] = "lXfdCypsU3BpYTWvupgTioLoZAEOZL2_Ihcqepz6RiQ",
        ["From-Process"] = "5WzR7rJCuqCKEq02WUPhTjwnzllLjGu6SA7qhYpcKRs"
    },
    Target = "5WzR7rJCuqCKEq02WUPhTjwnzllLjGu6SA7qhYpcKRs",
    Timestamp = 1704936415711,
    ["Block-Height"] = 1340762,
    ["Forwarded-By"] = "z1pq2WzmaYnfDwvEFgUZBj48anUsxxN64ZjbWOsIn08",
    ["Hash-Chain"] = "hJ0B-0yxKxeL3IIfaIIF7Yr6bFLG2vQayaF8G0EpjbY"
}
```

This architecture merges the Assignment Type with the Message Type, granting the Process a comprehensive understanding of the Message's context for effective processing.

When sending a message, here is a visual diagram of how the messages travels through the ao computer.

![Message Workflow](message-workflow-diagram.png)

The message workflow initiates with the MU (Messenger Unit), where the message's signature is authenticated. Following this, the SU (Scheduler Unit) allocates an Epoch and Nonce to the message, bundles the message with an Assignment Type, and dispatches it to Arweave. Subsequently, the `aoconnect` library retrieves the outcome from the CU (Compute Unit). The CU then calls for all preceding messages leading up to the current Message Id from the SU (Scheduler Unit), processes them to deduce the result. Upon completion, the computed result is conveyed back to `aoconnect`, which is integrated within client interfaces such as `aos`.

## Ethereum Signed Message

If the Message [ANS-104 DataItem](https://specs.g8way.io/?tx=xwOgX-MmqN5_-Ny_zNu2A8o-PnTGsoRb_3FrtiMAkuw) was signed using Ethereum keys,
then the value in the `Owner` and `From` fields will be the
[EIP-55](https://github.com/ethereum/ercs/blob/master/ERCS/erc-55.md) Ethereum address of the signer.
For example: `0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359`.

## Summary

Messages serve as the primary data protocol type for the ao network, leveraging ANS-104 Data-Items native to Arweave. Messages contain several fields including data content, origin, target, and cryptographic elements like signatures and nonces. They follow a journey starting at the Messenger Unit (MU), which ensures they are signed, through the Scheduler Unit (SU) that timestamps and sequences them, before being bundled and published to Arweave. The `aoconnect` library then reads the result from the Compute Unit (CU), which processes messages to calculate results and sends responses back through `aoconnect`, utilized by clients such as `aos`. The CU is the execution environment for these processes.


Prompt: This is a Markdown documentation from the AO documentation repository. Filename: how-it-works.md Path: ../ao-cookbook/src/concepts/how-it-works.md

Response:
# How ao messaging works

Before we dive in to ao, I want to share with you a little information about unix. Unix is a powerful operating system, but in its design it is focused on two Principal "Types". Files and Programs. A File is data and a Program is logic, when you combine the two you get information.

`Input.file | TransformProgram | Output.file`

You might have done something like this on the command line without knowing what you were doing. Being able to connect files to programs and return files which can then be passed to other programs creates a complex system composed of simple applications. This is a very powerful idea.

Now, lets talk about `ao` the hyper parallel computer, and lets change the idea of a File to the `ao` concept of a Message and the idea of a Program to the `ao` concept of a Process. The `ao` computer takes messages and sends them to Processes in which those Processes can output messages that can be sent to other Processes. The result is a complex system built on simple modular logic containers.

`MessageA | Process | MessageB`

![ao-messages](https://g8way.io/eAoqMqhwQ5vnpH_NJ6H2PiGgrcGDprtDIUH9Re2xcic)

Here is a description of the process as outlined in the flowchart:

1. A message is initiated from an ao Connect. This message is sent to the `mu` service using a POST request. The body of the request contains data following a protocol, labeled 'ao', and is of the type 'Message'.

2. The `mu` service processes the POST request and forwards the message to the `su` service. This is also done using a POST request with the same data protocol and message type.

3. The `su` service stores the assignment and message on Arweave.

4. A GET request is made to the `cu` service to retrieve results based on a message ID. The `cu` is a service that evaluates messages on processes and can return results based on an individual message identifier.

5. A GET request is made to the `su` service to retrieve the assignment and message. This request is looking for messages from a process ID, within a range of time from a start (from the last evaluation point) to (to the current message ID).

6. The final step is to push any outbox Messages. It involves reviewing the messages and spawns in the Result object. Based on the outcome of this check, the steps 2, 3, and 4 may be repeated for each relevant message or spawn.


Prompt: This is a Markdown documentation from the AO documentation repository. Filename: index.md Path: ../ao-cookbook/src/releasenotes/index.md

Response:
---
next:
  text: "Getting Started"
  link: "./getting-started"
---

# Release Notes

This section provides detailed information about updates, new features, bug fixes, and changes in each release of AO and its related tools. Release notes are essential for understanding what's changed between versions and how these changes might affect your projects.

## AOS Releases

AOS is the operating system built on top of the AO computer. These release notes document changes and improvements to AOS:

- [AOS 2.0.2](aos-2_0_2) - Improved spawn process times and various bug fixes
- [AOS 2.0.1](aos-2_0_1) - Details about patch updates and fixes in the 2.0.1 release
- [AOS 2.0.0](aos-2_0_0) - Major release information, including new features and significant changes

## Why Read Release Notes?

Release notes provide valuable information for developers:

- Learn about new features that could enhance your applications
- Understand potential breaking changes that might affect existing code
- Discover bug fixes that resolve issues you may have encountered
- Stay informed about security updates and best practices

We recommend reviewing release notes before upgrading to a new version to ensure a smooth transition.

## Navigation

Use the sidebar to navigate between different release notes. Notes are organized chronologically with the most recent releases first.


Prompt:
This is a Markdown documentation from the AO documentation repository. Filename: aos-2_0_0.md Path: ../ao-cookbook/src/releasenotes/aos-2_0_0.md
Note: This content continues in the next part.

Response:
# AOS Release Notes v2.0.0

:wave: Hey Developers, we hear you, AOS needs a DX upgrade and this release delivers!

## Install instructions for AOS 2.0.0

```shell
npm i -g https://get_ao.g8way.io
```

> Use `.update` to update earlier aos processes. See the **note** below on what features are not supported on earlier processes.

Cool features:

- Receive the `await` of aos
- REQ/RES semantics with References
- default actions for handlers.

## `Receive()` the await of aos

Meet `Lua Coroutines`, they are very similar to `await` or `generators`, coroutines are now added to aos handlers!

> Coroutines are like taking turns playing a game with your friends. Each friend (coroutine) has a turn to play (do some work), but they don't finish all at once. Instead, they pause their turn (yield) so the next friend can play. When it's their turn again, they continue from where they left off (resume).

This means you can send a message then `wait` using `Receive` method and when a message is send to your process that matches the pattern, you can get the result and resume your logic.

Easier to show, than tell.

```lua=
.editor
Send({Target = ao.id, Data = "Hello"})
local res = Receive({Data = "Hello"})
print(res.Data)
.done
```

The global Receive function yields until a msg is returned that matches that pattern, then it resumes executing the rest of the code.

> NOTE: This feature is only available for AOS 2 processes, even if your process is upgraded to 2, coroutines can not be supported.

## REQUEST/RESPONSE semantics with References

Often times, you want to receive a reply from the process as a response to the specific message you sent. aos 2.0 makes this pattern intuitive and seamless.

setup the server handler _notice the msg.reply_

```lua=
.editor
Handlers.add("Greeting-Name", { Action = "Greeting"}, function (msg)
  msg.reply({Data = "Hello " .. msg.Data or "bob"})
  print('server: replied to ' .. msg.Data or "bob")
end)
.done
```

setup the client

```lua=
.editor
local greeting = Send({Target = ao.id, Action = "Greeting", Data = "George"}).receive().Data
print("client: " .. greeting)
.done
```

output

```
server: replied to George
client: Hello George
```

When building complex workflows, developers need a request/response system that provides guarentees. ie returning message is that is directly referenced and handled. This works using built-in reference tags and using the `msg.reply` function on the server.

try another example:

```lua=
.editor
local greeting = Send({Target = ao.id, Action = "Greeting", Data = "Spongebob"}).receive().Data
print(greeting .. " Squarepants")
```

> NOTE: This feature is only available for AOS 2 processes, even if your process is upgraded to 2, coroutines can not be supported.

## default Action Handlers

Handlers are a core design component when creating aos processes, they give developers a powerful pipeline for managing messages. The `Action` tag has become the common tag name to describe the intent of the incoming message. Now you can just supply a `value` to the pattern argument and it will infer `{ Action = [value] }` as your pattern matcher for this handler.

Before AOS 2.0

```lua
Handlers.add("Get-Balance", function (msg) return msg.Action == "Balance", doBalance)
```

After AOS 2.0

```lua
Handlers.add("Get-Balance", "Balance", doBalance)
```

> If your pattern matcher is matching on Action = "xxx", you can just supply the string

## FYI Breaking Changes

- Authority tags are required for all processes. Messages will not be trusted by default, any Spawn MUST supply Authority tags if they plan to receive messages from MUs. The new test MU is `fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY`
- Message Tag `Ref_` has been replaced for `Reference` - aos 2.0 process will always use the 'Reference' tag as a unique message counter.
- No more `result.Output.data.output`, aos processes always return a consistent `Output.data` shape:

```lua
Output = {
  data = String,
  prompt = String,
  print = Boolean
}
```

# Handlers version 0.0.5

Handlers increase the ability to manage messages, but the previous versions did not address complex logic flows between processes, in this version we leverage erlang style patterns to improve the handlers lua module to provide a powerful toolkit for developers to handle complex logic flows between their processes.

## Handlers.once

Handlers.once is like `Handlers.add` but for handling only one message. This function allows you to supply a pattern and handle function and the next time it is matched AOS will process this handler, then remove it from the `Handlers.list`.

```lua
Handlers.once(
  "onetime",
  { Action = "Run-Once"},
  function (msg)
    print("This handler will only run once!")
  end
)
```

## MaxRuns

Optional `MaxRuns` argument for each handler, letting you choose the number of runs before it removes itself. default is infinite.

```lua
Handlers.add(
    "example-handler",
    { Action = "Example" },
    function(msg)
      print("Handler executed")
    end,
    3 -- MaxRuns is set to 3
)
```

## \* Sending Messages .receive()

> NOTE: This will only work with new AOS 2 processes not with upgraded processes.

With `.receive` you can yield code execution, until a message is returned. The receive function takes an optional target? argument.

## \* Sending Messages .onReply()

`.onReply` is a function returned from a message function call, that enables developers to provide a callback function. This is an alternative strategy and can be useful if you have generic composable functions.

```lua
Handlers.once(
  { Test = "1" },
  function(m)
    print("Got message! Replying...")
    m.reply({ Test = "1-reply", Status = "Success" })
  end
)
```

```lua
function printMsg(prop)
  return function (m)
    print(m[prop])
  end
end

Send({
  Target = target,
  Test = "1"
}).onReply(printMsg('Test'))
```

## \* msg.forward(target, fwdMsg)

REQUEST/RESPONSE is cool, but what about if I want to receive a message from C when I send a message to B and B sends a message to C. In this scenario or any other multi-forwarding scenario, we have a `msg.forward` function. The forward function takes a target and a partial message to overwrite any of the message you want to forward.

example:

this example requires three processes:

lastname process

```sh
aos lastname
```

```lua=
.editor
Handlers.add("Greeting", "Greeting", function (msg)
  msg.forward(msg['X-Origin'], { Data = msg.Data .. " Squarepants"})
end)
.done
```

greeting process

```sh
aos greeting
```

```lua=
.editor
local lastname = "your lastname process id above"
Handlers.add("Greeting", "Greeting", function (msg)
  msg.forward(lastname, { Data = "Hello " .. msg.Data })
end)
.done
```

client process

```sh
aos spongebob
```

```lua=
.editor
local Greeting = "your greeting process id"
local res = Send({Target = Greeting, Action = "Greeting", Data = "SpongeBob"}).receive("your lastname process id above")
print(res.Data)
.done
```

> The receive function can take a `target` process id to handle the target that will return the message. The `forward` and `receive` methods can be used to create `A -> B -> C -> A` message passing scenarios.

## \* Message object enhancements: `.reply(newMsg)` and `.forward(target, newMsg)`

All messages received by handlers now have .reply() and .forward() functions which allow the process to easily return a response to the user without having to manually deal with the X-Reference and Target values. This mechanism also allows the developer to easily build pipelines that process a request through many processes, then eventually return to the user.

The reply method takes a partial message table. The forward function takes a target property and a partial message table.

## Pattern Matchers and Resolvers

The Handler functions takes four arguments,

| Name    | Type                        | Description                                                                                |
| ------- | --------------------------- | ---------------------------------------------------------------------------------------------------------- |
| name    | string                      | Handler Unique Identifier                                                                                |
| pattern | string \| table \| function | the pattern lets the process pipeline know if it should invoke and break, or skip, or invoke and continue. |
| handle  | function                    | a function that processes the message                                                                      |
| MaxRuns | number? (optional)          | the number of max runs before the handler is removed automatically. Only available using `Handlers.add()`. |

### Pattern Matching

More expressive and easy to use matches. As well as functions, handlers now supports:

- Strings as match, checking against the Action tag.
- 'MessageMatchSpecs': Partially described messages.

In this mode, each tag given in the 'spec' is checked against the value in the message. It allows you to:

- Wild


Prompt: This is a Markdown documentation from the AO documentation repository. This is a continuation from the previous part. Filename: aos-2_0_0.md Path: ../ao-cookbook/src/releasenotes/aos-2_0_0.md

Response:
 target property and a partial message table.

## Pattern Matchers and Resolvers

The Handler functions takes four arguments,

| Name    | Type                        | Description                                                                                |
| ------- | --------------------------- | ---------------------------------------------------------------------------------------------------------- |
| name    | string                      | Handler Unique Identifier                                                                                |
| pattern | string \| table \| function | the pattern lets the process pipeline know if it should invoke and break, or skip, or invoke and continue. |
| handle  | function                    | a function that processes the message                                                                      |
| MaxRuns | number? (optional)          | the number of max runs before the handler is removed automatically. Only available using `Handlers.add()`. |

### Pattern Matching

More expressive and easy to use matches. As well as functions, handlers now supports:

- Strings as match, checking against the Action tag.
- 'MessageMatchSpecs': Partially described messages.

In this mode, each tag given in the 'spec' is checked against the value in the message. It allows you to:

- Wildcard (`_`): Is the tag given at all?
- Function: Run a function against the tag value (optional second argument is the full message)
- String: Exact match
- String: Lua matching syntax

```lua
Handlers.add("token.transfer", {
  Action = "Transfer"
  Quantity = "%d+",
  Recipient = "_"
 }, doTransfer)
```

### Resolvers

Resolvers are tables in which each key is a pattern matching table and the value is a function that is executed based on the matching key. This allows developers to create case like statements in the resolver property.

```lua
Handlers.add("foobarbaz", { Action = "Update" }, {
  [{ Status = "foo" }] = function (msg) print("foo") end,
  [{ Status = "bar" }] = function (msg) print("bar") end,
  [{ Status = "baz" }] = function (msg) print("baz") end
})
```

In this example, if a message with an Action of `Update` and the resolver looks at the `Status` tag on the message and executes the function based on the matching Status Value.

## Using Receive with Spawn

> NOTE: This will only work with new AOS 2 processes not with upgraded processes.

When you spawn a message you get back a success message with an action of Spawned.

```lua=
.editor
Spawn(ao.env.Module.Id, { })
local m = Receive({ Action = "Spawned" })
print(m['Process'])
.done
```

Or if you want to get Spawned by reference using .receive

> NOTE: This will only work with new AOS 2 processes not with upgraded processes.

```lua=
.editor
local msg = Spawn(ao.env.Module.Id, {}).receive()
print(msg.Process)
.done
```

# Updates

## Assignment Checks

With this update, it is important to update all AOS processes to add Assignment Check Handler, this handler will be prepended to your process and add whitelisted assignment protection for all of your processes.

Just run `.update` on AOS Client Version 2.0.0

```lua
Handlers.prepend("Assignment-Check", function (msg)
  return ao.isAssignment(msg) and not ao.isAssignable(msg)
end, function (msg)
  Send({Target = msg.From, Data = "Assignment is not trusted by this process!"})
  print('Assignment is not trusted! From: ' .. msg.From .. ' - Owner: ' .. msg.Owner)
end)
```

## \* os.time

`os.time` will now return the timestamp provided by the Message Assignment in the Scheduling Unit (SU).

## CLI Updates

External editor as a scratch pad

```
.pad
```

Toggle dryrun mode

```
.dryrun
```

Short cut for launching a sqlite module

```sh
aos [name] --sqlite
```

Creates a new SQLite aos process

## now you can [.delete] the previous line in the built in editor

```lua
.editor

local x = 1
print(x)
.delete
```

The .delete command deletes the previous line and allows you to continue to edit.

## PRs

- Improved processid identification - https://github.com/permaweb/aos/pull/301
- update: assignable package installer - https://github.com/permaweb/aos/pull/302

## Appendix

"\*" - These features tagged with an "\*" are only available on new processes that were spawned with AOS Client Version 1.12.1 and AOS version 0.2.2.

## Summary

AOS 2 is a huge shift in DX, we are releasing as a Release Candidate to get feedback and refine the functionality and correct any bugs before we fully launch to general availability.


Prompt: This is a Markdown documentation from the AO documentation repository. Filename: aos-2_0_1.md Path: ../ao-cookbook/src/releasenotes/aos-2_0_1.md

Response:
# AOS Release Notes v2.0.1

## Install

```sh
npm install -g https://get_ao.arweave.net
```

## Features

- Bootloader
- Handlers.once (defaults to prepend mode)
- WeaveDrive with Attestors
- WeaveDrive L2 Headers
- Spawn module by name
- Graphql Modules
- msg.reply patch

## Bootloader

Bootloader enables users to include a script to evaluate when spawning a process. You can include this script either with the `Data` property or with a `txId` specified on the `On-Boot` Tag.

### Examples

via AOS Console using `data`

```shell
echo "print('Hello Bootloader')" > example.lua
aos ex1 --tag-name On-Boot --tag-value Data --data example.lua
```

> As AOS boots up, you should see Hello Bootloader!

```
AOS Client Version: 2.0.1. 2024
Type "Ctrl-C" twice to exit

Your AOS process:  uJvxYDk6Q1JvocgfajNbEcKmqoCDWEksjG6EH1o9xRo

Hello Bootloader
```

via Spawn message using `data`

```lua
Spawn(ao.env.Module.Id, {
    ["On-Boot"] = "Data",
    Data = [[ print("Hello World!") ]]
})
```

via AOS Console using `txId`

```shell
aos ex2 --tag-name On-Boot --tag-value 1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28
```

via Spawn message using `txId`

```lua
Spawn(ao.env.Module.Id, {
  ["On-Boot"] = "1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28"
})
```

## Hanlders.once (defaults to prepend mode)

Now, when Handlers.once is called, it will default to prepend to the top of the Handlers stack.

```lua
Handlers.once("Name", function (msg)
  -- do something
end)

-- is the same as

Handlers.prepend("Name", "Name", function (msg)
  -- do something
end, 1)

```

## WeaveDrive with Attestors

Using WeaveDrive to access dataitems from Arweave with Attestations. When you spawn a process you can provide one or more `Attestor` tags with arweave wallet addresses as value. Then the arweave wallets set as attestors can create `Attestation` dataItems that authorize access to a specific arweave dataitem using weavedrive.

Here is a short guide on how to use WeaveDrive with Attestors - https://hackmd.io/@ao-docs/r1bixxO-Je

## WeaveDrive L2 Headers

Now, weaveDrive users can get L2 dataItem headers using `drive.getDataItem(id)` from the WeaveDrive apm module. This features allows indexers to index L2 dataItems and processes like stamps2 to determine if a user is stamping an Atomic Asset. The result is more interoperability with Arweave.

```lua
.load-blueprint apm
apm.install('@rakis/WeaveDrive')
local drive = require('@rakis/WeaveDrive')
local metaData = drive.getDataItem('K1jD3xrCJV3UnRtnBuQdd7k8HCwh9TX9GS-kh_Oevvw')
```

## Spawn module by name

Spawn module by name or identifier:

```sh
aos gql --module aos-graphql-sqlite-sm
```

Create a graphql/sqlite process by using the module name.

## Graphql Modules

You can now build graphql processes using the graphql custom module:

https://github.com/TillaTheHun0/aos-graphql

## `msg.reply` legacy patch

This release provides a blueprint optional patch to allow for old processes to leverage the `msg.reply` function.

`.load-blueprint patch-legacy-reply`

A blueprint that creates a passthrough handler to attach `.reply` function to the `msg` table, for handlers downstream to leverage.

This allows developers to take advantage of the `.receive` function in AOS 2.0 and interact with older AOS 0.x processes. With this patch AOS 0.x processes need to be able to reply with an `X-Reference` tag. So that the `.receive` co-routine can properly catch the response sent by the calling AOS 2.0 process.

Then open an older process:

```sh
aos [my aos process]
```

And run `.load-blueprint patch-legacy-reply`

```
.load-blueprint patch-legacy-reply
```

## Source

You can review the blueprint source here:

https://github.com/permaweb/aos/blob/main/blueprints/patch-legacy-reply.lua

```lua
-- patch reply
local function patchReply(msg)
  if not msg.reply then
    msg.reply = function (replyMsg)
      replyMsg.Target = msg["Reply-To"] or (replyMsg.Target or msg.From)
      replyMsg["X-Reference"] = msg["X-Reference"] or msg.Reference or ""
      replyMsg["X-Origin"] = msg["X-Origin"] or ""

      return ao.send(replyMsg)
    end
  end
end

Handlers.prepend("_patch_reply", function (msg) return "continue" end, patchReply)

```

---

Fixes:

- bubble up errors during co-routine resume functions - https://github.com/permaweb/aos/pull/374
- update token.lua to check for .reply before using the replay method
- staking blueprint improvement to default unstake delay block wait, and prepend finalize handler.
- fixed bug with Handlers.remove - https://github.com/permaweb/aos/pull/366


Prompt: This is a Markdown documentation from the AO documentation repository. Filename: aos-2_0_2.md Path: ../ao-cookbook/src/releasenotes/aos-2_0_2.md

Response:
# AOS Release Notes v2.0.2

## Install

```sh
npm install -g https://get_ao.arweave.net
```

## Core Features

- **Improved Spawn Process Times**: This release improves the process creation times for testnet. When you create new `aos` processes, it should now take only a few seconds to spawn.

## Fixes

- Issue [#388](https://github.com/permaweb/aos/pull/388): fix(services/version): prevent checkForUpdate() 5xx response codes from stopping connection
- Issue [#392](https://github.com/permaweb/aos/pull/392): Add Action Tag to broadcasted messages in Chatroom Blueprint
- Issue [#391](https://github.com/permaweb/aos/pull/391): feat(aos): if multiple processes have the same name, allow user to select which process to run
- Issue [#390](https://github.com/permaweb/aos/pull/390): fix(aos): fix error lines base cases, loading
- Issue [#386](https://github.com/permaweb/aos/pull/386): fix(aos): get blueprints now uses dir
- Issue [#337](https://github.com/permaweb/aos/issues/337): matchesspec does not work with from-process


Prompt: This is a JavaScript React code from the AO documentation repository. Filename: replRenderer.jsx Path: ../ao-cookbook/src/tools/replRenderer.jsx

Response:
import React from "react";
import { createRoot } from "react-dom/client";
import { CodeCell } from "@betteridea/codecell";

const ReplRenderer = ({ id, code }) => (
  <CodeCell
    appName="Cookbook"
    cellId={id}
    code={code}
    nowallet={true}
    height="169px"
    enableToasts={true}
  />
);

export const renderRepl = (containerId, code) => {
  const container = document.getElementById(containerId);
  if (container) {
    createRoot(container).render(<ReplRenderer id={containerId} code={code} />);
  }
};