omega-tool-model
First-party Omega tool-use model source, serving harnesses, and verification records
Brought by drakestapleton
omega-tool-model / deployment / conversation / candidate.om
| 1 | text z0 "fn calc x int to int\n" |
| 2 | text z1 "s = x\nfor i ulong " |
| 3 | text z2 "\ns = " |
| 4 | text z3 "add" |
| 5 | text z4 "plus" |
| 6 | text z5 " s int " |
| 7 | text z6 "\nend\nret s\nend\n" |
| 8 | text z7 "ret " |
| 9 | text z8 "mul" |
| 10 | text z9 "sub" |
| 11 | text z10 "times" |
| 12 | text z11 " x int " |
| 13 | text z12 "\nend\n" |
| 14 | text z13 "fn main to int\nret calc int " |
| 15 | text z14 "Could not read the practice file." |
| 16 | text z15 "Refused unsupported source." |
| 17 | text z16 "Could not prepare the test." |
| 18 | text z17 "The compiler did not complete." |
| 19 | text z18 "Compilation failed." |
| 20 | text z19 "The test did not complete." |
| 21 | text z20 "{\"type\":\"test\",\"input\":" |
| 22 | text z21 ",\"expected\":" |
| 23 | text z22 ",\"actual\":" |
| 24 | text z23 "}" |
| 25 | text z24 "The browser disconnected." |
| 26 | text z25 "Test failed: calc(" |
| 27 | text z26 ") expected " |
| 28 | text z27 ", got " |
| 29 | text z28 "." |
| 30 | text z29 "Tests passed." |
| 31 | text z30 "tool" |
| 32 | text z31 "path" |
| 33 | text z32 "old" |
| 34 | text z33 "new" |
| 35 | text z34 "replace_text" |
| 36 | text z35 "Task: Fix the error in this file and confirm its goal.\nFile: " |
| 37 | text z36 "\nGoal: " |
| 38 | text z37 "\nState: " |
| 39 | text z38 "unread" |
| 40 | text z39 "read" |
| 41 | text z40 "failed" |
| 42 | text z41 "edited" |
| 43 | text z42 "checked" |
| 44 | text z43 "missing" |
| 45 | text z44 "Source:\n" |
| 46 | text z45 "Tool result: " |
| 47 | text z46 "Answer:\n" |
| 48 | text z47 "read_file" |
| 49 | text z48 "File not found." |
| 50 | text z49 "Read succeeded." |
| 51 | text z50 "observation" |
| 52 | text z51 "omega_check" |
| 53 | text z52 "Edit saved." |
| 54 | text z53 "source" |
| 55 | text z54 "original" |
| 56 | text z55 "The model could not complete this request." |
| 57 | text z56 "action" |
| 58 | text z57 "The model completed the job and all four checks passed." |
| 59 | text z58 "The model claimed success before verification. No success was recorded." |
| 60 | text z59 "The model correctly reported the missing practice file." |
| 61 | text z60 "The model incorrectly reported a missing file." |
| 62 | text z61 "The model returned an unsupported action. The run stopped." |
| 63 | text z62 "The model requested the wrong file. The run stopped." |
| 64 | text z63 "The requested action was refused or could not finish." |
| 65 | text z64 "The model reached the seven-step limit without finishing." |
| 66 | text z65 "This practice area accepts only the small arithmetic program shapes shown in the examples. Keep the same main input." |
| 67 | text z66 "jobs/item76666.om" |
| 68 | text z67 "calc starts with x and adds 4 exactly 3 times in a for loop. main calls calc with 70." |
| 69 | text z68 "jobs/item96171.om" |
| 70 | text z69 "calc starts with x and adds 3 exactly 3 times in a for loop. main calls calc with 74." |
| 71 | text z70 "jobs/item96294.om" |
| 72 | text z71 "calc returns x plus 5. main calls calc with 73." |
| 73 | text z72 "jobs/item82028.om" |
| 74 | text z73 "calc returns x times 1. main calls calc with 72." |
| 75 | text z74 "jobs/item82342.om" |
| 76 | text z75 "calc starts with x and adds 1 exactly 6 times in a for loop. main calls calc with 72." |
| 77 | text z76 "jobs/item85188.om" |
| 78 | text z77 "calc starts with x and adds 2 exactly 4 times in a for loop. main calls calc with 70." |
| 79 | text z78 "jobs/item83423.om" |
| 80 | text z79 "calc starts with x and adds 5 exactly 3 times in a for loop. main calls calc with 71." |
| 81 | text z80 "jobs/item80896.om" |
| 82 | text z81 "jobs/item99846.om" |
| 83 | text z82 "calc returns x plus 1. main calls calc with 70." |
| 84 | text z83 "jobs/item86548.om" |
| 85 | text z84 "calc returns x plus 1. main calls calc with 72." |
| 86 | text z85 "jobs/item73182.om" |
| 87 | text z86 "calc returns x times 1. main calls calc with 71." |
| 88 | text z87 "jobs/item87470.om" |
| 89 | text z88 "calc returns x times 1. main calls calc with 74." |
| 90 | text z89 "jobs/item74558.om" |
| 91 | text z90 "calc returns x times 1. main calls calc with 73." |
| 92 | text z91 "{\"type\":\"" |
| 93 | text z92 "\",\"text\":" |
| 94 | text z93 "{\"type\":\"done\",\"passed\":" |
| 95 | text z94 "true" |
| 96 | text z95 "false" |
| 97 | text z96 ",\"message\":\"" |
| 98 | text z97 "\",\"source\":" |
| 99 | note Private local protocol. No model-generated bytes are executed. |
| 100 | global naddr uchar 110 |
| 101 | global nbuf uchar 8192 |
| 102 | global nfd int 1 |
| 103 | global nerr ulong 1 |
| 104 | text nsock "$HOME/.local/share/omega-tool-model/run/model.sock" |
| 105 | text nlock "$HOME/.local/share/omega-tool-model/run/model.lock" |
| 106 | |
| 107 | fn naddress to void |
| 108 | put naddr 0 1 |
| 109 | for i ulong len nsock |
| 110 | put naddr add i 2 get nsock i |
| 111 | end |
| 112 | end |
| 113 | |
| 114 | fn nreceive off ulong n ulong timeout long to bool |
| 115 | p = ulong 0 |
| 116 | deadline = add monons timeout |
| 117 | while lt p n bound 8192 |
| 118 | left = sub deadline monons |
| 119 | if le left 0 |
| 120 | ret false |
| 121 | end |
| 122 | r = waitio get nfd 0 1 left |
| 123 | if le r 0 |
| 124 | ret false |
| 125 | end |
| 126 | r = recv get nfd 0 nbuf add off p sub n p 64 |
| 127 | if eq r neg long 11 |
| 128 | continue |
| 129 | end |
| 130 | if le r 0 |
| 131 | ret false |
| 132 | end |
| 133 | p = add p ulong r |
| 134 | end |
| 135 | ret true |
| 136 | end |
| 137 | |
| 138 | fn nsend off ulong n ulong to bool |
| 139 | p = ulong 0 |
| 140 | deadline = add monons long 2000000000 |
| 141 | while lt p n bound 8192 |
| 142 | left = sub deadline monons |
| 143 | if le left 0 |
| 144 | ret false |
| 145 | end |
| 146 | r = waitio get nfd 0 4 left |
| 147 | if le r 0 |
| 148 | ret false |
| 149 | end |
| 150 | r = send get nfd 0 nbuf add off p sub n p 64 |
| 151 | if eq r neg long 11 |
| 152 | continue |
| 153 | end |
| 154 | if le r 0 |
| 155 | ret false |
| 156 | end |
| 157 | p = add p ulong r |
| 158 | end |
| 159 | ret true |
| 160 | end |
| 161 | |
| 162 | fn nlength to ulong |
| 163 | ret add ulong get nbuf 0 mul ulong get nbuf 1 256 |
| 164 | end |
| 165 | |
| 166 | fn nheader n ulong to void |
| 167 | put nbuf 0 uchar and n 255 |
| 168 | put nbuf 1 uchar and shr n 8 255 |
| 169 | end |
| 170 | |
| 171 | fn nstatus code ulong to void |
| 172 | if eq code 0 |
| 173 | nheader 0 |
| 174 | r = nsend 0 2 |
| 175 | else |
| 176 | nheader 65535 |
| 177 | put nbuf 2 uchar code |
| 178 | r = nsend 0 3 |
| 179 | end |
| 180 | end |
| 181 | |
| 182 | note Private, bounded HTTP adapter. No generated text is executed or interpreted as HTML. |
| 183 | global hreq uchar 40960 |
| 184 | global hbuf uchar 65536 |
| 185 | global haddr uchar 16 |
| 186 | global hopt uchar 4 |
| 187 | global hstat uchar 4 |
| 188 | global hfd int 1 |
| 189 | global hcount ulong 1 |
| 190 | global hend ulong 1 |
| 191 | global hsize ulong 1 |
| 192 | global hseen ulong 1 |
| 193 | global hguard ulong 1 |
| 194 | global hhost ulong 1 |
| 195 | global hroute ulong 1 |
| 196 | text hex "0123456789abcdef" |
| 197 | |
| 198 | fn hsend n ulong to bool |
| 199 | p = ulong 0 |
| 200 | deadline = add monons long 3000000000 |
| 201 | while lt p n bound 65536 |
| 202 | left = sub deadline monons |
| 203 | if le left 0 |
| 204 | ret false |
| 205 | end |
| 206 | r = waitio get hfd 0 4 left |
| 207 | if le r 0 |
| 208 | ret false |
| 209 | end |
| 210 | r = send get hfd 0 hbuf p sub n p 64 |
| 211 | if eq r neg long 11 |
| 212 | continue |
| 213 | end |
| 214 | if le r 0 |
| 215 | ret false |
| 216 | end |
| 217 | p = add p ulong r |
| 218 | end |
| 219 | ret true |
| 220 | end |
| 221 | |
| 222 | fn hfind start ulong total ulong to bool |
| 223 | while lt add start 3 total bound 8192 |
| 224 | if and eq get hreq start 13 eq get hreq add start 1 10 |
| 225 | if and eq get hreq add start 2 13 eq get hreq add start 3 10 |
| 226 | put hend 0 add start 4 |
| 227 | ret true |
| 228 | end |
| 229 | end |
| 230 | start = add start 1 |
| 231 | end |
| 232 | ret false |
| 233 | end |
| 234 | |
| 235 | fn hread to bool |
| 236 | put hcount 0 0 |
| 237 | put hend 0 0 |
| 238 | deadline = add monons long 5000000000 |
| 239 | for step ulong 8192 |
| 240 | n = get hcount 0 |
| 241 | if ge n 8192 |
| 242 | ret false |
| 243 | end |
| 244 | left = sub deadline monons |
| 245 | if le left 0 |
| 246 | ret false |
| 247 | end |
| 248 | if le waitio get hfd 0 1 left 0 |
| 249 | ret false |
| 250 | end |
| 251 | r = recv get hfd 0 hreq n sub 8192 n 64 |
| 252 | if eq r neg long 11 |
| 253 | continue |
| 254 | end |
| 255 | if le r 0 |
| 256 | ret false |
| 257 | end |
| 258 | total = add n ulong r |
| 259 | put hcount 0 total |
| 260 | start = ulong 0 |
| 261 | if gt n 3 |
| 262 | start = sub n 3 |
| 263 | end |
| 264 | if hfind start total |
| 265 | ret true |
| 266 | end |
| 267 | end |
| 268 | ret false |
| 269 | end |
| 270 | |
| 271 | fn hline a ulong b ulong to bool |
| 272 | if eq a b |
| 273 | ret true |
| 274 | end |
| 275 | if iscl a b |
| 276 | if ne get hseen 0 0 |
| 277 | ret false |
| 278 | end |
| 279 | put hseen 0 1 |
| 280 | p = add a 15 |
| 281 | while lt p b bound 8192 |
| 282 | if not or eq get hreq p 32 eq get hreq p 9 |
| 283 | break |
| 284 | end |
| 285 | p = add p 1 |
| 286 | end |
| 287 | if eq p b |
| 288 | ret false |
| 289 | end |
| 290 | v = ulong 0 |
| 291 | while lt p b bound 8192 |
| 292 | c = get hreq p |
| 293 | if or lt c 48 gt c 57 |
| 294 | ret false |
| 295 | end |
| 296 | v = add mul v 10 ulong sub c 48 |
| 297 | if gt v 24000 |
| 298 | ret false |
| 299 | end |
| 300 | p = add p 1 |
| 301 | end |
| 302 | put hsize 0 v |
| 303 | ret true |
| 304 | end |
| 305 | if iste a b |
| 306 | ret false |
| 307 | end |
| 308 | if isguard a b |
| 309 | put hguard 0 add get hguard 0 1 |
| 310 | end |
| 311 | if ishost a b |
| 312 | if not goodhost a b |
| 313 | ret false |
| 314 | end |
| 315 | put hhost 0 add get hhost 0 1 |
| 316 | end |
| 317 | ret true |
| 318 | end |
| 319 | |
| 320 | fn hparse to bool |
| 321 | put hsize 0 0 |
| 322 | put hseen 0 0 |
| 323 | put hguard 0 0 |
| 324 | put hhost 0 0 |
| 325 | put hroute 0 0 |
| 326 | n = get hend 0 |
| 327 | a = ulong 0 |
| 328 | first = true |
| 329 | for i ulong sub n 1 |
| 330 | c = get hreq i |
| 331 | if and eq c 13 eq get hreq add i 1 10 |
| 332 | if first |
| 333 | if isroot a i |
| 334 | put hroute 0 1 |
| 335 | end |
| 336 | if isgen a i |
| 337 | put hroute 0 2 |
| 338 | end |
| 339 | if isrepair a i |
| 340 | put hroute 0 3 |
| 341 | end |
| 342 | if ischat a i |
| 343 | put hroute 0 4 |
| 344 | end |
| 345 | first = false |
| 346 | else |
| 347 | if not hline a i |
| 348 | ret false |
| 349 | end |
| 350 | end |
| 351 | a = add i 2 |
| 352 | else |
| 353 | if not first |
| 354 | if and ge c 65 le c 90 |
| 355 | put hreq i add c 32 |
| 356 | end |
| 357 | end |
| 358 | end |
| 359 | end |
| 360 | ret eq get hhost 0 1 |
| 361 | end |
| 362 | |
| 363 | fn hbody to bool |
| 364 | n = get hsize 0 |
| 365 | off = get hend 0 |
| 366 | total = add off n |
| 367 | if or eq n 0 gt n 4000 |
| 368 | ret false |
| 369 | end |
| 370 | if gt get hcount 0 total |
| 371 | ret false |
| 372 | end |
| 373 | deadline = add monons long 5000000000 |
| 374 | while lt get hcount 0 total bound 4000 |
| 375 | p = get hcount 0 |
| 376 | left = sub deadline monons |
| 377 | if le left 0 |
| 378 | ret false |
| 379 | end |
| 380 | if le waitio get hfd 0 1 left 0 |
| 381 | ret false |
| 382 | end |
| 383 | r = recv get hfd 0 hreq p sub total p 64 |
| 384 | if eq r neg long 11 |
| 385 | continue |
| 386 | end |
| 387 | if le r 0 |
| 388 | ret false |
| 389 | end |
| 390 | put hcount 0 add p ulong r |
| 391 | end |
| 392 | nheader n |
| 393 | for i ulong n |
| 394 | c = get hreq add off i |
| 395 | if eq c 0 |
| 396 | ret false |
| 397 | end |
| 398 | put nbuf add i 2 c |
| 399 | end |
| 400 | ret true |
| 401 | end |
| 402 | |
| 403 | fn hchunk n ulong to bool |
| 404 | for i ulong 4 |
| 405 | shift = mul sub 3 i 4 |
| 406 | put hbuf i get hex and shr n shift 15 |
| 407 | end |
| 408 | put hbuf 4 13 |
| 409 | put hbuf 5 10 |
| 410 | for i ulong n |
| 411 | put hbuf add i 6 get nbuf i |
| 412 | end |
| 413 | put hbuf add n 6 13 |
| 414 | put hbuf add n 7 10 |
| 415 | ret hsend add n 8 |
| 416 | end |
| 417 | |
| 418 | fn hstream to void |
| 419 | started = false |
| 420 | for frame ulong 1024 |
| 421 | if not nreceive 0 2 30000000000 |
| 422 | if not started |
| 423 | r = respond502 |
| 424 | end |
| 425 | ret |
| 426 | end |
| 427 | n = nlength |
| 428 | if eq n 65535 |
| 429 | if not started |
| 430 | if nreceive 0 1 2000000000 |
| 431 | if eq get nbuf 0 3 |
| 432 | r = respond422 |
| 433 | else |
| 434 | r = respond502 |
| 435 | end |
| 436 | else |
| 437 | r = respond502 |
| 438 | end |
| 439 | end |
| 440 | ret |
| 441 | end |
| 442 | if gt n 4096 |
| 443 | if not started |
| 444 | r = respond502 |
| 445 | end |
| 446 | ret |
| 447 | end |
| 448 | if not started |
| 449 | if not streamhead |
| 450 | ret |
| 451 | end |
| 452 | started = true |
| 453 | end |
| 454 | if eq n 0 |
| 455 | r = streamend |
| 456 | ret |
| 457 | end |
| 458 | if not nreceive 0 n 2000000000 |
| 459 | ret |
| 460 | end |
| 461 | if not hchunk n |
| 462 | ret |
| 463 | end |
| 464 | end |
| 465 | end |
| 466 | |
| 467 | fn hmodel to void |
| 468 | naddress |
| 469 | fd = socknew 1 524289 0 |
| 470 | if lt fd 0 |
| 471 | r = respond503 |
| 472 | ret |
| 473 | end |
| 474 | if ne connect int fd naddr 0 add len nsock 3 0 |
| 475 | closed = fclose int fd |
| 476 | r = respond503 |
| 477 | ret |
| 478 | end |
| 479 | put nfd 0 int fd |
| 480 | if nsend 0 add get hsize 0 2 |
| 481 | hstream |
| 482 | else |
| 483 | r = respond502 |
| 484 | end |
| 485 | closed = fclose int fd |
| 486 | end |
| 487 | |
| 488 | fn hserve to void |
| 489 | if not hread |
| 490 | r = respond400 |
| 491 | ret |
| 492 | end |
| 493 | if not hparse |
| 494 | r = respond400 |
| 495 | ret |
| 496 | end |
| 497 | route = get hroute 0 |
| 498 | if eq route 4 |
| 499 | if or ne get hguard 0 1 ne get hseen 0 1 |
| 500 | r = respond400 |
| 501 | ret |
| 502 | end |
| 503 | cchat |
| 504 | ret |
| 505 | end |
| 506 | if eq route 1 |
| 507 | if ne get hsize 0 0 |
| 508 | r = respond400 |
| 509 | ret |
| 510 | end |
| 511 | r = respondpage |
| 512 | ret |
| 513 | end |
| 514 | if or eq route 2 eq route 3 |
| 515 | if or ne get hguard 0 1 ne get hseen 0 1 |
| 516 | r = respond400 |
| 517 | ret |
| 518 | end |
| 519 | if not hbody |
| 520 | r = respond400 |
| 521 | ret |
| 522 | end |
| 523 | if eq route 3 |
| 524 | wrepair |
| 525 | else |
| 526 | hmodel |
| 527 | end |
| 528 | else |
| 529 | r = respond404 |
| 530 | end |
| 531 | end |
| 532 | |
| 533 | fn main to int |
| 534 | put haddr 0 2 |
| 535 | put haddr 2 70 |
| 536 | put haddr 3 255 |
| 537 | put haddr 4 127 |
| 538 | put haddr 7 1 |
| 539 | put hopt 0 1 |
| 540 | fd = socknew 2 524289 0 |
| 541 | if lt fd 0 |
| 542 | ret 70 |
| 543 | end |
| 544 | r = sockopt int fd 1 2 hopt 0 4 |
| 545 | if ne bind int fd haddr 0 16 0 |
| 546 | ret 71 |
| 547 | end |
| 548 | if ne listen int fd 16 0 |
| 549 | ret 72 |
| 550 | end |
| 551 | active = ulong 0 |
| 552 | for request ulong 1000000 |
| 553 | for reap ulong 16 |
| 554 | done = waitpid -1 hstat 0 4 1 |
| 555 | if le done 0 |
| 556 | break |
| 557 | end |
| 558 | if gt active 0 |
| 559 | active = sub active 1 |
| 560 | end |
| 561 | end |
| 562 | if ge active 16 |
| 563 | r = sleepns 10000000 |
| 564 | continue |
| 565 | end |
| 566 | if le waitio int fd 1 1000000000 0 |
| 567 | continue |
| 568 | end |
| 569 | client = accept int fd 524288 |
| 570 | if lt client 0 |
| 571 | continue |
| 572 | end |
| 573 | pid = fork |
| 574 | if eq pid 0 |
| 575 | r = fclose int fd |
| 576 | put hfd 0 int client |
| 577 | r = sockopt int client 6 1 hopt 0 4 |
| 578 | hserve |
| 579 | r = fclose int client |
| 580 | ret 0 |
| 581 | end |
| 582 | r = fclose int client |
| 583 | if gt pid 0 |
| 584 | active = add active 1 |
| 585 | end |
| 586 | end |
| 587 | ret 0 |
| 588 | end |
| 589 | |
| 590 | note Model-driven tools for one bounded arithmetic practice file. Paths from the model never become OS paths. |
| 591 | global wsrc uchar 1024 |
| 592 | global wslen ulong 1 |
| 593 | global wobs uchar 1024 |
| 594 | global wolen ulong 1 |
| 595 | global wans uchar 4096 |
| 596 | global walen ulong 1 |
| 597 | global wpath uchar 128 |
| 598 | global wplen ulong 1 |
| 599 | global wgoal uchar 256 |
| 600 | global wglen ulong 1 |
| 601 | global wbuf uchar 8192 |
| 602 | global wlen ulong 1 |
| 603 | global wjob ulong 5 |
| 604 | global wstate ulong 1 |
| 605 | global wvalid ulong 1 |
| 606 | global wcall ulong 1 |
| 607 | global wclen ulong 1 |
| 608 | global wtmp uchar 1024 |
| 609 | global wtlen ulong 1 |
| 610 | global wargv uchar 1024 |
| 611 | global wstat uchar 4 |
| 612 | global wdir uchar 256 |
| 613 | global wdlen ulong 1 |
| 614 | global wout uchar 4096 |
| 615 | global wused ulong 1 |
| 616 | global wfld uchar 512 |
| 617 | global wflen ulong 4 |
| 618 | global wpos ulong 1 |
| 619 | global wtok uchar 128 |
| 620 | global wtkn ulong 1 |
| 621 | text wprog "program.om" |
| 622 | text wtest "test.om" |
| 623 | text wexe "test.bin" |
| 624 | text werr "check.err" |
| 625 | text wrout "run.out" |
| 626 | text wbase "$HOME/.local/share/omega-tool-model/practice/" |
| 627 | text wcomp "$HOME/handoffs/omega-tool-deployment-20261105/conversation/omc" |
| 628 | text wexec "./test.bin" |
| 629 | |
| 630 | fn wb c uchar to void |
| 631 | if ge get wlen 0 8192 |
| 632 | exit 90 |
| 633 | end |
| 634 | put wbuf get wlen 0 c |
| 635 | put wlen 0 add get wlen 0 1 |
| 636 | end |
| 637 | fn wn n ulong to void |
| 638 | if ge n 10 |
| 639 | wn div n 10 |
| 640 | end |
| 641 | wb uchar add rem n 10 48 |
| 642 | end |
| 643 | fn wz to void |
| 644 | put wlen 0 0 |
| 645 | end |
| 646 | fn wbyte mode ulong i ulong to uchar |
| 647 | if eq mode 1 |
| 648 | ret get wsrc i |
| 649 | end |
| 650 | if eq mode 2 |
| 651 | ret get wobs i |
| 652 | end |
| 653 | if eq mode 3 |
| 654 | ret get wans i |
| 655 | end |
| 656 | if eq mode 4 |
| 657 | ret get wpath i |
| 658 | end |
| 659 | if eq mode 5 |
| 660 | ret get wgoal i |
| 661 | end |
| 662 | ret get wfld add mul sub mode 6 128 i |
| 663 | end |
| 664 | fn wlength mode ulong to ulong |
| 665 | if eq mode 1 |
| 666 | ret get wslen 0 |
| 667 | end |
| 668 | if eq mode 2 |
| 669 | ret get wolen 0 |
| 670 | end |
| 671 | if eq mode 3 |
| 672 | ret get walen 0 |
| 673 | end |
| 674 | if eq mode 4 |
| 675 | ret get wplen 0 |
| 676 | end |
| 677 | if eq mode 5 |
| 678 | ret get wglen 0 |
| 679 | end |
| 680 | ret get wflen sub mode 6 |
| 681 | end |
| 682 | fn wa mode ulong to void |
| 683 | for i ulong wlength mode |
| 684 | wb wbyte mode i |
| 685 | end |
| 686 | end |
| 687 | fn wj mode ulong to void |
| 688 | wb 34 |
| 689 | for i ulong wlength mode |
| 690 | c = wbyte mode i |
| 691 | if or eq c 34 eq c 92 |
| 692 | wb 92 |
| 693 | wb c |
| 694 | else |
| 695 | if eq c 10 |
| 696 | wb 92 |
| 697 | wb 110 |
| 698 | else |
| 699 | if eq c 13 |
| 700 | wb 92 |
| 701 | wb 114 |
| 702 | else |
| 703 | if eq c 9 |
| 704 | wb 92 |
| 705 | wb 116 |
| 706 | else |
| 707 | if lt c 32 |
| 708 | wb 63 |
| 709 | else |
| 710 | wb c |
| 711 | end |
| 712 | end |
| 713 | end |
| 714 | end |
| 715 | end |
| 716 | end |
| 717 | wb 34 |
| 718 | end |
| 719 | fn wobsbuf to void |
| 720 | if gt get wlen 0 1024 |
| 721 | exit 90 |
| 722 | end |
| 723 | put wolen 0 get wlen 0 |
| 724 | for i ulong get wlen 0 |
| 725 | put wobs i get wbuf i |
| 726 | end |
| 727 | end |
| 728 | fn wemit to bool |
| 729 | wb 10 |
| 730 | n = get wlen 0 |
| 731 | for i ulong n |
| 732 | put nbuf i get wbuf i |
| 733 | end |
| 734 | ret hchunk n |
| 735 | end |
| 736 | fn wsmall at ulong to ulong |
| 737 | if ge at get wslen 0 |
| 738 | ret 10000 |
| 739 | end |
| 740 | c = get wsrc at |
| 741 | if or lt c 49 gt c 54 |
| 742 | ret 10000 |
| 743 | end |
| 744 | ret add at 1 |
| 745 | end |
| 746 | fn wgrammar to bool |
| 747 | put wcall 0 0 |
| 748 | put wclen 0 0 |
| 749 | p = wconsumec0 0 |
| 750 | if wmc1 p |
| 751 | p = wconsumec2 p |
| 752 | p = wsmall p |
| 753 | p = wconsumec3 p |
| 754 | if wmc4 p |
| 755 | p = add p 3 |
| 756 | else |
| 757 | p = wconsumec5 p |
| 758 | end |
| 759 | p = wconsumec6 p |
| 760 | p = wsmall p |
| 761 | p = wconsumec7 p |
| 762 | else |
| 763 | if eq get wjob 0 2 |
| 764 | ret false |
| 765 | end |
| 766 | p = wconsumec8 p |
| 767 | if or wmc4 p or wmc9 p wmc10 p |
| 768 | p = add p 3 |
| 769 | else |
| 770 | if wmc11 p |
| 771 | p = add p 4 |
| 772 | else |
| 773 | p = wconsumec12 p |
| 774 | end |
| 775 | end |
| 776 | p = wconsumec13 p |
| 777 | p = wsmall p |
| 778 | p = wconsumec14 p |
| 779 | end |
| 780 | p = wconsumec15 p |
| 781 | if ge p get wslen 0 |
| 782 | ret false |
| 783 | end |
| 784 | put wcall 0 p |
| 785 | v = ulong 0 |
| 786 | start = p |
| 787 | while lt p get wslen 0 bound 1024 |
| 788 | c = get wsrc p |
| 789 | if or lt c 48 gt c 57 |
| 790 | break |
| 791 | end |
| 792 | v = add mul v 10 ulong sub c 48 |
| 793 | if gt v 99 |
| 794 | ret false |
| 795 | end |
| 796 | p = add p 1 |
| 797 | end |
| 798 | if or eq p start gt sub p start 2 |
| 799 | ret false |
| 800 | end |
| 801 | put wclen 0 sub p start |
| 802 | if ne v get wjob 1 |
| 803 | ret false |
| 804 | end |
| 805 | p = wconsumec14 p |
| 806 | ret eq p get wslen 0 |
| 807 | end |
| 808 | |
| 809 | fn wsave to bool |
| 810 | fd = fopen wprog 0 len wprog 524865 384 |
| 811 | if lt fd 0 |
| 812 | ret false |
| 813 | end |
| 814 | n = write int fd wsrc 0 get wslen 0 |
| 815 | r = fclose int fd |
| 816 | ret and eq n long get wslen 0 eq r 0 |
| 817 | end |
| 818 | fn wload to bool |
| 819 | fd = fopen wprog 0 len wprog 524288 0 |
| 820 | if lt fd 0 |
| 821 | ret false |
| 822 | end |
| 823 | n = read int fd wsrc 0 1024 |
| 824 | r = fclose int fd |
| 825 | if or le n 0 gt n 600 |
| 826 | ret false |
| 827 | end |
| 828 | put wslen 0 ulong n |
| 829 | ret eq r 0 |
| 830 | end |
| 831 | fn wmkdir to bool |
| 832 | wz |
| 833 | wtc16 |
| 834 | wn ulong getpid |
| 835 | wb 45 |
| 836 | wn ulong monons |
| 837 | n = get wlen 0 |
| 838 | for i ulong n |
| 839 | put wdir i get wbuf i |
| 840 | end |
| 841 | put wdlen 0 n |
| 842 | if ne makedir wdir 0 n 448 0 |
| 843 | ret false |
| 844 | end |
| 845 | ret eq chdir wdir 0 n 0 |
| 846 | end |
| 847 | fn wclean to void |
| 848 | r = unlink wprog 0 len wprog |
| 849 | r = unlink wtest 0 len wtest |
| 850 | r = unlink wexe 0 len wexe |
| 851 | r = unlink werr 0 len werr |
| 852 | r = unlink wrout 0 len wrout |
| 853 | r = chdir wbase 0 len wbase |
| 854 | r = rmdir wdir 0 get wdlen 0 |
| 855 | end |
| 856 | fn wwait pid int timeout long to long |
| 857 | deadline = add monons timeout |
| 858 | for poll ulong 10000 |
| 859 | r = waitpid pid wstat 0 4 1 |
| 860 | if eq r long pid |
| 861 | if ne get wstat 0 0 |
| 862 | ret -2 |
| 863 | end |
| 864 | ret long get wstat 1 |
| 865 | end |
| 866 | if lt r 0 |
| 867 | ret -3 |
| 868 | end |
| 869 | if ge monons deadline |
| 870 | r = killpid pid 9 |
| 871 | r = waitpid pid wstat 0 4 0 |
| 872 | ret -1 |
| 873 | end |
| 874 | r = sleepns 1000000 |
| 875 | end |
| 876 | r = killpid pid 9 |
| 877 | r = waitpid pid wstat 0 4 0 |
| 878 | ret -1 |
| 879 | end |
| 880 | fn wlaunch mode ulong ifd int ofd int efd int to long |
| 881 | wz |
| 882 | if eq mode 0 |
| 883 | wtc17 |
| 884 | else |
| 885 | wtc18 |
| 886 | end |
| 887 | n = get wlen 0 |
| 888 | put wargv 0 1 |
| 889 | put wargv 1 0 |
| 890 | put wargv 2 uchar and n 255 |
| 891 | put wargv 3 uchar shr n 8 |
| 892 | for i ulong n |
| 893 | put wargv add i 4 get wbuf i |
| 894 | end |
| 895 | pid = fork |
| 896 | if lt pid 0 |
| 897 | ret -3 |
| 898 | end |
| 899 | if eq pid 0 |
| 900 | if ne dupfd ifd 0 0 0 |
| 901 | exit 98 |
| 902 | end |
| 903 | if ne dupfd ofd 1 0 1 |
| 904 | exit 98 |
| 905 | end |
| 906 | if ne dupfd efd 2 0 2 |
| 907 | exit 98 |
| 908 | end |
| 909 | r = execprog wargv 0 add n 4 |
| 910 | exit 98 |
| 911 | end |
| 912 | ret wwait int pid 2000000000 |
| 913 | end |
| 914 | fn wcompile to long |
| 915 | inf = fopen wtest 0 len wtest 524288 0 |
| 916 | outf = fopen wexe 0 len wexe 524865 384 |
| 917 | errf = fopen werr 0 len werr 524865 384 |
| 918 | if or lt inf 0 or lt outf 0 lt errf 0 |
| 919 | r = fclose int inf |
| 920 | r = fclose int outf |
| 921 | r = fclose int errf |
| 922 | ret -3 |
| 923 | end |
| 924 | rc = wlaunch 0 int inf int outf int errf |
| 925 | r = fclose int inf |
| 926 | r = fclose int outf |
| 927 | r = fclose int errf |
| 928 | ret rc |
| 929 | end |
| 930 | fn wrun to long |
| 931 | inf = fopen wtest 0 len wtest 524288 0 |
| 932 | outf = fopen wrout 0 len wrout 524865 384 |
| 933 | errf = fopen werr 0 len werr 524865 384 |
| 934 | if or lt inf 0 or lt outf 0 lt errf 0 |
| 935 | r = fclose int inf |
| 936 | r = fclose int outf |
| 937 | r = fclose int errf |
| 938 | ret -3 |
| 939 | end |
| 940 | if ne chmod wexe 0 len wexe 448 0 |
| 941 | r = fclose int inf |
| 942 | r = fclose int outf |
| 943 | r = fclose int errf |
| 944 | ret -3 |
| 945 | end |
| 946 | rc = wlaunch 1 int inf int outf int errf |
| 947 | r = fclose int inf |
| 948 | r = fclose int outf |
| 949 | r = fclose int errf |
| 950 | ret rc |
| 951 | end |
| 952 | fn wtestsrc x ulong to bool |
| 953 | wz |
| 954 | for i ulong get wcall 0 |
| 955 | wb get wsrc i |
| 956 | end |
| 957 | wn x |
| 958 | p = add get wcall 0 get wclen 0 |
| 959 | while lt p get wslen 0 bound 1024 |
| 960 | wb get wsrc p |
| 961 | p = add p 1 |
| 962 | end |
| 963 | fd = fopen wtest 0 len wtest 524865 384 |
| 964 | if lt fd 0 |
| 965 | ret false |
| 966 | end |
| 967 | n = write int fd wbuf 0 get wlen 0 |
| 968 | r = fclose int fd |
| 969 | ret and eq n long get wlen 0 eq r 0 |
| 970 | end |
| 971 | fn wexpected x ulong to ulong |
| 972 | if eq get wjob 0 0 |
| 973 | ret add x get wjob 2 |
| 974 | end |
| 975 | if eq get wjob 0 1 |
| 976 | ret mul x get wjob 2 |
| 977 | end |
| 978 | ret add x mul get wjob 2 get wjob 3 |
| 979 | end |
| 980 | fn wcheck to bool |
| 981 | if not wload |
| 982 | woc19 |
| 983 | ret false |
| 984 | end |
| 985 | if not wgrammar |
| 986 | woc20 |
| 987 | ret false |
| 988 | end |
| 989 | for test ulong 4 |
| 990 | x = get wjob 1 |
| 991 | if eq test 1 |
| 992 | x = 0 |
| 993 | end |
| 994 | if eq test 2 |
| 995 | x = 3 |
| 996 | end |
| 997 | if eq test 3 |
| 998 | x = 7 |
| 999 | end |
| 1000 | if not wtestsrc x |
| 1001 | woc21 |
| 1002 | ret false |
| 1003 | end |
| 1004 | rc = wcompile |
| 1005 | if ne rc 0 |
| 1006 | if lt rc 0 |
| 1007 | woc22 |
| 1008 | ret false |
| 1009 | end |
| 1010 | fd = fopen werr 0 len werr 524288 0 |
| 1011 | n = read int fd wobs 0 1024 |
| 1012 | r = fclose int fd |
| 1013 | if le n 0 |
| 1014 | woc23 |
| 1015 | else |
| 1016 | put wolen 0 ulong n |
| 1017 | while gt get wolen 0 0 bound 1024 |
| 1018 | p = sub get wolen 0 1 |
| 1019 | if ne get wobs p 10 |
| 1020 | break |
| 1021 | end |
| 1022 | put wolen 0 p |
| 1023 | end |
| 1024 | end |
| 1025 | ret false |
| 1026 | end |
| 1027 | actual = wrun |
| 1028 | if lt actual 0 |
| 1029 | woc24 |
| 1030 | ret false |
| 1031 | end |
| 1032 | want = wexpected x |
| 1033 | wz |
| 1034 | wtc25 |
| 1035 | wn x |
| 1036 | wtc26 |
| 1037 | wn want |
| 1038 | wtc27 |
| 1039 | wn ulong actual |
| 1040 | wtc28 |
| 1041 | if not wemit |
| 1042 | woc29 |
| 1043 | ret false |
| 1044 | end |
| 1045 | if ne ulong actual want |
| 1046 | wz |
| 1047 | wtc30 |
| 1048 | wn x |
| 1049 | wtc31 |
| 1050 | wn want |
| 1051 | wtc32 |
| 1052 | wn ulong actual |
| 1053 | wtc33 |
| 1054 | wobsbuf |
| 1055 | ret false |
| 1056 | end |
| 1057 | end |
| 1058 | woc34 |
| 1059 | ret true |
| 1060 | end |
| 1061 | |
| 1062 | note Strict JSON object with exactly tool/path, or tool/path/old/new, all bounded strings. |
| 1063 | fn wspace to void |
| 1064 | while lt get wpos 0 get walen 0 bound 4096 |
| 1065 | c = get wans get wpos 0 |
| 1066 | if not or or eq c 32 eq c 10 or eq c 13 eq c 9 |
| 1067 | ret |
| 1068 | end |
| 1069 | put wpos 0 add get wpos 0 1 |
| 1070 | end |
| 1071 | end |
| 1072 | fn wpunc c uchar to bool |
| 1073 | wspace |
| 1074 | p = get wpos 0 |
| 1075 | if ge p get walen 0 |
| 1076 | ret false |
| 1077 | end |
| 1078 | if ne get wans p c |
| 1079 | ret false |
| 1080 | end |
| 1081 | put wpos 0 add p 1 |
| 1082 | ret true |
| 1083 | end |
| 1084 | fn wstring to bool |
| 1085 | put wtkn 0 0 |
| 1086 | if not wpunc 34 |
| 1087 | ret false |
| 1088 | end |
| 1089 | while lt get wpos 0 get walen 0 bound 4096 |
| 1090 | p = get wpos 0 |
| 1091 | c = get wans p |
| 1092 | put wpos 0 add p 1 |
| 1093 | if eq c 34 |
| 1094 | ret true |
| 1095 | end |
| 1096 | if lt c 32 |
| 1097 | ret false |
| 1098 | end |
| 1099 | if eq c 92 |
| 1100 | p = get wpos 0 |
| 1101 | if ge p get walen 0 |
| 1102 | ret false |
| 1103 | end |
| 1104 | c = get wans p |
| 1105 | put wpos 0 add p 1 |
| 1106 | if eq c 110 |
| 1107 | c = 10 |
| 1108 | else |
| 1109 | if eq c 114 |
| 1110 | c = 13 |
| 1111 | else |
| 1112 | if eq c 116 |
| 1113 | c = 9 |
| 1114 | else |
| 1115 | if not or eq c 34 or eq c 92 eq c 47 |
| 1116 | ret false |
| 1117 | end |
| 1118 | end |
| 1119 | end |
| 1120 | end |
| 1121 | end |
| 1122 | if ge get wtkn 0 127 |
| 1123 | ret false |
| 1124 | end |
| 1125 | put wtok get wtkn 0 c |
| 1126 | put wtkn 0 add get wtkn 0 1 |
| 1127 | end |
| 1128 | ret false |
| 1129 | end |
| 1130 | fn wjson to bool |
| 1131 | put wpos 0 0 |
| 1132 | for i ulong 4 |
| 1133 | put wflen i 0 |
| 1134 | end |
| 1135 | if not wpunc 123 |
| 1136 | ret false |
| 1137 | end |
| 1138 | mask = ulong 0 |
| 1139 | for field ulong 4 |
| 1140 | if not wstring |
| 1141 | ret false |
| 1142 | end |
| 1143 | slot = ulong 4 |
| 1144 | if wtokenc35 |
| 1145 | slot = 0 |
| 1146 | end |
| 1147 | if wtokenc36 |
| 1148 | slot = 1 |
| 1149 | end |
| 1150 | if wtokenc37 |
| 1151 | slot = 2 |
| 1152 | end |
| 1153 | if wtokenc38 |
| 1154 | slot = 3 |
| 1155 | end |
| 1156 | if eq slot 4 |
| 1157 | ret false |
| 1158 | end |
| 1159 | bit = shl ulong 1 slot |
| 1160 | if ne and mask bit 0 |
| 1161 | ret false |
| 1162 | end |
| 1163 | mask = or mask bit |
| 1164 | if not wpunc 58 |
| 1165 | ret false |
| 1166 | end |
| 1167 | if not wstring |
| 1168 | ret false |
| 1169 | end |
| 1170 | put wflen slot get wtkn 0 |
| 1171 | for i ulong get wtkn 0 |
| 1172 | put wfld add mul slot 128 i get wtok i |
| 1173 | end |
| 1174 | wspace |
| 1175 | p = get wpos 0 |
| 1176 | if ge p get walen 0 |
| 1177 | ret false |
| 1178 | end |
| 1179 | if eq get wans p 125 |
| 1180 | put wpos 0 add p 1 |
| 1181 | wspace |
| 1182 | if ne get wpos 0 get walen 0 |
| 1183 | ret false |
| 1184 | end |
| 1185 | if wfieldc39 0 |
| 1186 | ret eq mask 15 |
| 1187 | end |
| 1188 | ret eq mask 3 |
| 1189 | end |
| 1190 | if not wpunc 44 |
| 1191 | ret false |
| 1192 | end |
| 1193 | end |
| 1194 | ret false |
| 1195 | end |
| 1196 | fn wmatchold at ulong to bool |
| 1197 | n = get wflen 2 |
| 1198 | if gt add at n get wslen 0 |
| 1199 | ret false |
| 1200 | end |
| 1201 | for i ulong n |
| 1202 | if ne get wsrc add at i get wfld add 256 i |
| 1203 | ret false |
| 1204 | end |
| 1205 | end |
| 1206 | ret true |
| 1207 | end |
| 1208 | fn wpatch to bool |
| 1209 | oldn = get wflen 2 |
| 1210 | newn = get wflen 3 |
| 1211 | if or eq oldn 0 or gt oldn 40 gt newn 40 |
| 1212 | ret false |
| 1213 | end |
| 1214 | count = ulong 0 |
| 1215 | found = ulong 0 |
| 1216 | for i ulong get wslen 0 |
| 1217 | if wmatchold i |
| 1218 | count = add count 1 |
| 1219 | found = i |
| 1220 | end |
| 1221 | end |
| 1222 | if ne count 1 |
| 1223 | ret false |
| 1224 | end |
| 1225 | newsize = add sub get wslen 0 oldn newn |
| 1226 | if gt newsize 600 |
| 1227 | ret false |
| 1228 | end |
| 1229 | put wtlen 0 get wslen 0 |
| 1230 | for i ulong get wslen 0 |
| 1231 | put wtmp i get wsrc i |
| 1232 | end |
| 1233 | p = found |
| 1234 | for i ulong newn |
| 1235 | put wsrc p get wfld add 384 i |
| 1236 | p = add p 1 |
| 1237 | end |
| 1238 | tail = add found oldn |
| 1239 | while lt tail get wtlen 0 bound 1024 |
| 1240 | put wsrc p get wtmp tail |
| 1241 | p = add p 1 |
| 1242 | tail = add tail 1 |
| 1243 | end |
| 1244 | put wslen 0 newsize |
| 1245 | if not wgrammar |
| 1246 | put wslen 0 get wtlen 0 |
| 1247 | for i ulong get wtlen 0 |
| 1248 | put wsrc i get wtmp i |
| 1249 | end |
| 1250 | ret false |
| 1251 | end |
| 1252 | ret wsave |
| 1253 | end |
| 1254 | |
| 1255 | fn wprompt to void |
| 1256 | wz |
| 1257 | wtc40 |
| 1258 | wa 4 |
| 1259 | wtc41 |
| 1260 | wa 5 |
| 1261 | wtc42 |
| 1262 | s = get wstate 0 |
| 1263 | if eq s 0 |
| 1264 | wtc43 |
| 1265 | end |
| 1266 | if eq s 1 |
| 1267 | wtc44 |
| 1268 | end |
| 1269 | if eq s 2 |
| 1270 | wtc45 |
| 1271 | end |
| 1272 | if eq s 3 |
| 1273 | wtc46 |
| 1274 | end |
| 1275 | if eq s 4 |
| 1276 | wtc47 |
| 1277 | end |
| 1278 | if eq s 5 |
| 1279 | wtc48 |
| 1280 | end |
| 1281 | wb 10 |
| 1282 | if and ne s 0 ne s 5 |
| 1283 | wtc49 |
| 1284 | wa 1 |
| 1285 | end |
| 1286 | if ne s 0 |
| 1287 | wtc50 |
| 1288 | wa 2 |
| 1289 | wb 10 |
| 1290 | end |
| 1291 | wtc51 |
| 1292 | end |
| 1293 | fn wresponse to bool |
| 1294 | put walen 0 0 |
| 1295 | for frame ulong 1024 |
| 1296 | if not nreceive 0 2 30000000000 |
| 1297 | ret false |
| 1298 | end |
| 1299 | n = nlength |
| 1300 | if eq n 0 |
| 1301 | ret true |
| 1302 | end |
| 1303 | if or eq n 65535 gt n 4096 |
| 1304 | ret false |
| 1305 | end |
| 1306 | if gt add get walen 0 n 4096 |
| 1307 | ret false |
| 1308 | end |
| 1309 | if not nreceive 0 n 2000000000 |
| 1310 | ret false |
| 1311 | end |
| 1312 | for i ulong n |
| 1313 | put wans add get walen 0 i get nbuf i |
| 1314 | end |
| 1315 | put walen 0 add get walen 0 n |
| 1316 | end |
| 1317 | ret false |
| 1318 | end |
| 1319 | fn wask to bool |
| 1320 | wprompt |
| 1321 | n = get wlen 0 |
| 1322 | if gt n 4000 |
| 1323 | ret false |
| 1324 | end |
| 1325 | nheader n |
| 1326 | for i ulong n |
| 1327 | put nbuf add i 2 get wbuf i |
| 1328 | end |
| 1329 | naddress |
| 1330 | fd = socknew 1 524289 0 |
| 1331 | if lt fd 0 |
| 1332 | ret false |
| 1333 | end |
| 1334 | if ne connect int fd naddr 0 add len nsock 3 0 |
| 1335 | r = fclose int fd |
| 1336 | ret false |
| 1337 | end |
| 1338 | put nfd 0 int fd |
| 1339 | ok = false |
| 1340 | if nsend 0 add n 2 |
| 1341 | ok = wresponse |
| 1342 | end |
| 1343 | r = fclose int fd |
| 1344 | ret ok |
| 1345 | end |
| 1346 | fn wrightpath to bool |
| 1347 | if ne get wflen 1 get wplen 0 |
| 1348 | ret false |
| 1349 | end |
| 1350 | for i ulong get wplen 0 |
| 1351 | if ne get wfld add 128 i get wpath i |
| 1352 | ret false |
| 1353 | end |
| 1354 | end |
| 1355 | ret true |
| 1356 | end |
| 1357 | fn waction to bool |
| 1358 | s = get wstate 0 |
| 1359 | if and wfieldc52 0 eq s 0 |
| 1360 | if eq get wjob 4 1 |
| 1361 | put wslen 0 0 |
| 1362 | put wstate 0 5 |
| 1363 | woc53 |
| 1364 | else |
| 1365 | if not wload |
| 1366 | ret false |
| 1367 | end |
| 1368 | put wstate 0 1 |
| 1369 | woc54 |
| 1370 | end |
| 1371 | ret weventc55 2 |
| 1372 | end |
| 1373 | if and wfieldc56 0 or eq s 1 eq s 3 |
| 1374 | put wvalid 0 0 |
| 1375 | if wcheck |
| 1376 | put wstate 0 4 |
| 1377 | put wvalid 0 1 |
| 1378 | else |
| 1379 | put wstate 0 2 |
| 1380 | end |
| 1381 | ret weventc55 2 |
| 1382 | end |
| 1383 | if and wfieldc39 0 eq s 2 |
| 1384 | if not wpatch |
| 1385 | ret false |
| 1386 | end |
| 1387 | put wstate 0 3 |
| 1388 | put wvalid 0 0 |
| 1389 | woc57 |
| 1390 | if not weventc58 1 |
| 1391 | ret false |
| 1392 | end |
| 1393 | ret weventc55 2 |
| 1394 | end |
| 1395 | ret false |
| 1396 | end |
| 1397 | fn wloop to void |
| 1398 | put wstate 0 0 |
| 1399 | put wvalid 0 0 |
| 1400 | if not weventc59 1 |
| 1401 | ret |
| 1402 | end |
| 1403 | for turn ulong 7 |
| 1404 | if not wask |
| 1405 | wfinishc60 false |
| 1406 | ret |
| 1407 | end |
| 1408 | if not weventc61 3 |
| 1409 | ret |
| 1410 | end |
| 1411 | if wanswerc62 |
| 1412 | if and eq get wstate 0 4 eq get wvalid 0 1 |
| 1413 | wfinishc63 true |
| 1414 | else |
| 1415 | wfinishc64 false |
| 1416 | end |
| 1417 | ret |
| 1418 | end |
| 1419 | if wanswerc65 |
| 1420 | if eq get wstate 0 5 |
| 1421 | wfinishc66 false |
| 1422 | else |
| 1423 | wfinishc67 false |
| 1424 | end |
| 1425 | ret |
| 1426 | end |
| 1427 | if not wjson |
| 1428 | wfinishc68 false |
| 1429 | ret |
| 1430 | end |
| 1431 | if not wrightpath |
| 1432 | wfinishc69 false |
| 1433 | ret |
| 1434 | end |
| 1435 | if not waction |
| 1436 | wfinishc70 false |
| 1437 | ret |
| 1438 | end |
| 1439 | end |
| 1440 | wfinishc71 false |
| 1441 | end |
| 1442 | fn wrepair to void |
| 1443 | n = get hsize 0 |
| 1444 | off = get hend 0 |
| 1445 | if lt n 2 |
| 1446 | r = respond400 |
| 1447 | ret |
| 1448 | end |
| 1449 | id = get hreq off |
| 1450 | if or lt id 65 gt id 77 |
| 1451 | r = respond400 |
| 1452 | ret |
| 1453 | end |
| 1454 | if ne get hreq add off 1 10 |
| 1455 | r = respond400 |
| 1456 | ret |
| 1457 | end |
| 1458 | wjobload ulong sub id 65 |
| 1459 | if gt sub n 2 600 |
| 1460 | r = respond400 |
| 1461 | ret |
| 1462 | end |
| 1463 | put wslen 0 sub n 2 |
| 1464 | for i ulong get wslen 0 |
| 1465 | put wsrc i get hreq add add off 2 i |
| 1466 | end |
| 1467 | if eq get wjob 4 1 |
| 1468 | put wslen 0 0 |
| 1469 | else |
| 1470 | if not wgrammar |
| 1471 | if streamhead |
| 1472 | wfinishc72 false |
| 1473 | end |
| 1474 | ret |
| 1475 | end |
| 1476 | end |
| 1477 | if not wmkdir |
| 1478 | r = respond503 |
| 1479 | ret |
| 1480 | end |
| 1481 | if ne get wjob 4 1 |
| 1482 | if not wsave |
| 1483 | wclean |
| 1484 | r = respond503 |
| 1485 | ret |
| 1486 | end |
| 1487 | end |
| 1488 | if streamhead |
| 1489 | wloop |
| 1490 | end |
| 1491 | wclean |
| 1492 | end |
| 1493 | |
| 1494 | note Bounded chat-only bridge to the separately approved local Qwen companion. |
| 1495 | note No URLs, files, tool permissions or generation settings are taken from model text. |
| 1496 | global cbuf uchar 131072 |
| 1497 | global clen ulong 1 |
| 1498 | global caddr uchar 16 |
| 1499 | global cfd int 1 |
| 1500 | global cp ulong 1 |
| 1501 | global cend ulong 1 |
| 1502 | global ccount ulong 1 |
| 1503 | global csent ulong 1 |
| 1504 | text csys "You are a helpful conversational assistant running locally on Drake's Spark, powered by Qwen3-30B-A3B-Instruct-2507. You are a separate companion to his custom-trained Omega round40 model, not that small model and not ChatGPT. Speak in clear, natural, plain English. Drake is an engineer learning programming, so explain necessary technical terms and avoid jargon dumps. Follow the conversation, use facts the user provides, and accept corrections. Ask a short clarifying question when a request is unclear. Do not invent facts, memories, credentials, tool actions, measurements, or claims of success. You can discuss many subjects, but cannot browse, access past chat archives, modify weights or run tools from this chat. The separate Practice with tools section on this page uses Drake's round40 model to read, repair and test small temporary Omega arithmetic files. Those tools are not connected to you. When asked for current information, say when you cannot verify it. Omega code uses prefix operations and structured fn/ret/end, for example: fn main to int, ret add int 2 int 3, end, with one statement per line. Be honest when you do not know the correct Omega syntax. Conversation messages supplied here are your available personal context. Keep replies concise unless more detail is requested." |
| 1505 | text cpre "{\"model\":\"omega-chat-companion\",\"stream\":true,\"cache_prompt\":true,\"max_tokens\":1024,\"temperature\":0.6,\"top_p\":0.8,\"messages\":[{\"role\":\"system\",\"content\":\"" |
| 1506 | text cuser ",{\"role\":\"user\",\"content\":\"" |
| 1507 | text cassist ",{\"role\":\"assistant\",\"content\":\"" |
| 1508 | text creq "POST /v1/chat/completions HTTP/1.1\nHost: 127.0.0.1:18178\nContent-Type: application/json\nConnection: close\nContent-Length: " |
| 1509 | text cunavail "HTTP/1.1 503 Service Unavailable\nConnection: close\nContent-Type: text/plain; charset=utf-8\nCache-Control: no-store\n\nThe conversational model is unavailable. Your message has been kept; try again shortly." |
| 1510 | text cbad "HTTP/1.1 400 Bad Request\nConnection: close\nContent-Type: text/plain; charset=utf-8\nCache-Control: no-store\n\nThis conversation is too large or malformed. Start a new chat or shorten the message." |
| 1511 | |
| 1512 | fn cb c uchar to void |
| 1513 | if ge get clen 0 131072 |
| 1514 | exit 90 |
| 1515 | end |
| 1516 | put cbuf get clen 0 c |
| 1517 | put clen 0 add get clen 0 1 |
| 1518 | end |
| 1519 | fn cjson c uchar to void |
| 1520 | if or eq c 34 eq c 92 |
| 1521 | cb 92 |
| 1522 | cb c |
| 1523 | ret |
| 1524 | end |
| 1525 | if eq c 10 |
| 1526 | cb 92 |
| 1527 | cb 110 |
| 1528 | ret |
| 1529 | end |
| 1530 | if eq c 13 |
| 1531 | cb 92 |
| 1532 | cb 114 |
| 1533 | ret |
| 1534 | end |
| 1535 | if eq c 9 |
| 1536 | cb 92 |
| 1537 | cb 116 |
| 1538 | ret |
| 1539 | end |
| 1540 | cb c |
| 1541 | end |
| 1542 | fn cbody to bool |
| 1543 | n = get hsize 0 |
| 1544 | off = get hend 0 |
| 1545 | if or eq n 0 gt n 24000 |
| 1546 | ret false |
| 1547 | end |
| 1548 | total = add off n |
| 1549 | if gt get hcount 0 total |
| 1550 | ret false |
| 1551 | end |
| 1552 | deadline = add monons long 5000000000 |
| 1553 | while lt get hcount 0 total bound 24000 |
| 1554 | p = get hcount 0 |
| 1555 | left = sub deadline monons |
| 1556 | if le left 0 |
| 1557 | ret false |
| 1558 | end |
| 1559 | if le waitio get hfd 0 1 left 0 |
| 1560 | ret false |
| 1561 | end |
| 1562 | r = recv get hfd 0 hreq p sub total p 64 |
| 1563 | if eq r neg long 11 |
| 1564 | continue |
| 1565 | end |
| 1566 | if le r 0 |
| 1567 | ret false |
| 1568 | end |
| 1569 | put hcount 0 add p ulong r |
| 1570 | end |
| 1571 | put cp 0 off |
| 1572 | put cend 0 total |
| 1573 | ret true |
| 1574 | end |
| 1575 | fn cmessage to bool |
| 1576 | p = get cp 0 |
| 1577 | endp = get cend 0 |
| 1578 | if ge p endp |
| 1579 | ret false |
| 1580 | end |
| 1581 | want = uchar 85 |
| 1582 | if eq rem get ccount 0 2 1 |
| 1583 | want = 65 |
| 1584 | end |
| 1585 | if ne get hreq p want |
| 1586 | ret false |
| 1587 | end |
| 1588 | p = add p 1 |
| 1589 | n = ulong 0 |
| 1590 | digits = ulong 0 |
| 1591 | while lt p endp bound 8 |
| 1592 | c = get hreq p |
| 1593 | if eq c 10 |
| 1594 | break |
| 1595 | end |
| 1596 | if or lt c 48 gt c 57 |
| 1597 | ret false |
| 1598 | end |
| 1599 | digits = add digits 1 |
| 1600 | n = add mul n 10 ulong sub c 48 |
| 1601 | if or gt n 8000 gt digits 4 |
| 1602 | ret false |
| 1603 | end |
| 1604 | p = add p 1 |
| 1605 | end |
| 1606 | if or eq digits 0 eq n 0 |
| 1607 | ret false |
| 1608 | end |
| 1609 | if ge p endp |
| 1610 | ret false |
| 1611 | end |
| 1612 | if ne get hreq p 10 |
| 1613 | ret false |
| 1614 | end |
| 1615 | p = add p 1 |
| 1616 | if gt add p n endp |
| 1617 | ret false |
| 1618 | end |
| 1619 | if eq want 85 |
| 1620 | for i ulong len cuser |
| 1621 | cb get cuser i |
| 1622 | end |
| 1623 | else |
| 1624 | for i ulong len cassist |
| 1625 | cb get cassist i |
| 1626 | end |
| 1627 | end |
| 1628 | if not ccontent p n |
| 1629 | ret false |
| 1630 | end |
| 1631 | cb 34 |
| 1632 | cb 125 |
| 1633 | put cp 0 add p n |
| 1634 | put ccount 0 add get ccount 0 1 |
| 1635 | ret true |
| 1636 | end |
| 1637 | fn ccontent p ulong n ulong to bool |
| 1638 | for i ulong n |
| 1639 | c = get hreq add p i |
| 1640 | if lt c 32 |
| 1641 | if not or eq c 10 or eq c 13 eq c 9 |
| 1642 | ret false |
| 1643 | end |
| 1644 | end |
| 1645 | cjson c |
| 1646 | end |
| 1647 | ret true |
| 1648 | end |
| 1649 | fn cbuild to bool |
| 1650 | put clen 0 0 |
| 1651 | put ccount 0 0 |
| 1652 | for i ulong len cpre |
| 1653 | cb get cpre i |
| 1654 | end |
| 1655 | for i ulong len csys |
| 1656 | cjson get csys i |
| 1657 | end |
| 1658 | cb 34 |
| 1659 | cb 125 |
| 1660 | while lt get cp 0 get cend 0 bound 63 |
| 1661 | if not cmessage |
| 1662 | ret false |
| 1663 | end |
| 1664 | if ge get ccount 0 63 |
| 1665 | if lt get cp 0 get cend 0 |
| 1666 | ret false |
| 1667 | end |
| 1668 | end |
| 1669 | end |
| 1670 | if eq rem get ccount 0 2 0 |
| 1671 | ret false |
| 1672 | end |
| 1673 | cb 93 |
| 1674 | cb 125 |
| 1675 | ret true |
| 1676 | end |
| 1677 | fn cnumber n ulong to void |
| 1678 | if ge n 10 |
| 1679 | cnumber div n 10 |
| 1680 | end |
| 1681 | put hbuf get wused 0 uchar add rem n 10 48 |
| 1682 | put wused 0 add get wused 0 1 |
| 1683 | end |
| 1684 | fn cheader to bool |
| 1685 | put wused 0 0 |
| 1686 | for i ulong len creq |
| 1687 | c = get creq i |
| 1688 | if eq c 10 |
| 1689 | put hbuf get wused 0 13 |
| 1690 | put wused 0 add get wused 0 1 |
| 1691 | end |
| 1692 | put hbuf get wused 0 c |
| 1693 | put wused 0 add get wused 0 1 |
| 1694 | end |
| 1695 | cnumber get clen 0 |
| 1696 | put hbuf get wused 0 13 |
| 1697 | put hbuf add get wused 0 1 10 |
| 1698 | put hbuf add get wused 0 2 13 |
| 1699 | put hbuf add get wused 0 3 10 |
| 1700 | old = get hfd 0 |
| 1701 | put hfd 0 get cfd 0 |
| 1702 | ok = hsend add get wused 0 4 |
| 1703 | put hfd 0 old |
| 1704 | ret ok |
| 1705 | end |
| 1706 | fn csend to bool |
| 1707 | p = ulong 0 |
| 1708 | deadline = add monons long 5000000000 |
| 1709 | while lt p get clen 0 bound 131072 |
| 1710 | left = sub deadline monons |
| 1711 | if le left 0 |
| 1712 | ret false |
| 1713 | end |
| 1714 | if le waitio get cfd 0 4 left 0 |
| 1715 | ret false |
| 1716 | end |
| 1717 | r = send get cfd 0 cbuf p sub get clen 0 p 64 |
| 1718 | if eq r neg long 11 |
| 1719 | continue |
| 1720 | end |
| 1721 | if le r 0 |
| 1722 | ret false |
| 1723 | end |
| 1724 | p = add p ulong r |
| 1725 | end |
| 1726 | ret true |
| 1727 | end |
| 1728 | fn cunavailable to void |
| 1729 | p = ulong 0 |
| 1730 | for i ulong len cunavail |
| 1731 | c = get cunavail i |
| 1732 | if eq c 10 |
| 1733 | put hbuf p 13 |
| 1734 | p = add p 1 |
| 1735 | end |
| 1736 | put hbuf p c |
| 1737 | p = add p 1 |
| 1738 | end |
| 1739 | r = hsend p |
| 1740 | end |
| 1741 | fn cinvalid to void |
| 1742 | p = ulong 0 |
| 1743 | for i ulong len cbad |
| 1744 | c = get cbad i |
| 1745 | if eq c 10 |
| 1746 | put hbuf p 13 |
| 1747 | p = add p 1 |
| 1748 | end |
| 1749 | put hbuf p c |
| 1750 | p = add p 1 |
| 1751 | end |
| 1752 | r = hsend p |
| 1753 | end |
| 1754 | fn cproxy to void |
| 1755 | deadline = add monons long 120000000000 |
| 1756 | put csent 0 0 |
| 1757 | for chunk ulong 65536 |
| 1758 | left = sub deadline monons |
| 1759 | if le left 0 |
| 1760 | break |
| 1761 | end |
| 1762 | if le waitio get cfd 0 1 left 0 |
| 1763 | break |
| 1764 | end |
| 1765 | n = recv get cfd 0 hbuf 0 65536 64 |
| 1766 | if eq n neg long 11 |
| 1767 | continue |
| 1768 | end |
| 1769 | if le n 0 |
| 1770 | break |
| 1771 | end |
| 1772 | put csent 0 1 |
| 1773 | if not hsend ulong n |
| 1774 | ret |
| 1775 | end |
| 1776 | end |
| 1777 | if eq get csent 0 0 |
| 1778 | cunavailable |
| 1779 | end |
| 1780 | end |
| 1781 | fn cchat to void |
| 1782 | if not cbody |
| 1783 | cinvalid |
| 1784 | ret |
| 1785 | end |
| 1786 | if not cbuild |
| 1787 | cinvalid |
| 1788 | ret |
| 1789 | end |
| 1790 | put caddr 0 2 |
| 1791 | put caddr 2 71 |
| 1792 | put caddr 3 2 |
| 1793 | put caddr 4 127 |
| 1794 | put caddr 7 1 |
| 1795 | fd = socknew 2 524289 0 |
| 1796 | if lt fd 0 |
| 1797 | cunavailable |
| 1798 | ret |
| 1799 | end |
| 1800 | if ne connect int fd caddr 0 16 0 |
| 1801 | r = fclose int fd |
| 1802 | cunavailable |
| 1803 | ret |
| 1804 | end |
| 1805 | put cfd 0 int fd |
| 1806 | if cheader |
| 1807 | if csend |
| 1808 | cproxy |
| 1809 | else |
| 1810 | cunavailable |
| 1811 | end |
| 1812 | else |
| 1813 | cunavailable |
| 1814 | end |
| 1815 | r = fclose int fd |
| 1816 | end |
| 1817 | |
| 1818 | fn wjobload id ulong to void |
| 1819 | if eq id 0 |
| 1820 | put wjob 0 2 |
| 1821 | put wjob 1 70 |
| 1822 | put wjob 2 4 |
| 1823 | put wjob 3 3 |
| 1824 | put wjob 4 0 |
| 1825 | wz |
| 1826 | wtc73 |
| 1827 | put wplen 0 get wlen 0 |
| 1828 | for i ulong get wlen 0 |
| 1829 | put wpath i get wbuf i |
| 1830 | end |
| 1831 | wz |
| 1832 | wtc74 |
| 1833 | put wglen 0 get wlen 0 |
| 1834 | for i ulong get wlen 0 |
| 1835 | put wgoal i get wbuf i |
| 1836 | end |
| 1837 | ret |
| 1838 | end |
| 1839 | if eq id 1 |
| 1840 | put wjob 0 2 |
| 1841 | put wjob 1 74 |
| 1842 | put wjob 2 3 |
| 1843 | put wjob 3 3 |
| 1844 | put wjob 4 0 |
| 1845 | wz |
| 1846 | wtc75 |
| 1847 | put wplen 0 get wlen 0 |
| 1848 | for i ulong get wlen 0 |
| 1849 | put wpath i get wbuf i |
| 1850 | end |
| 1851 | wz |
| 1852 | wtc76 |
| 1853 | put wglen 0 get wlen 0 |
| 1854 | for i ulong get wlen 0 |
| 1855 | put wgoal i get wbuf i |
| 1856 | end |
| 1857 | ret |
| 1858 | end |
| 1859 | if eq id 2 |
| 1860 | put wjob 0 0 |
| 1861 | put wjob 1 73 |
| 1862 | put wjob 2 5 |
| 1863 | put wjob 3 0 |
| 1864 | put wjob 4 0 |
| 1865 | wz |
| 1866 | wtc77 |
| 1867 | put wplen 0 get wlen 0 |
| 1868 | for i ulong get wlen 0 |
| 1869 | put wpath i get wbuf i |
| 1870 | end |
| 1871 | wz |
| 1872 | wtc78 |
| 1873 | put wglen 0 get wlen 0 |
| 1874 | for i ulong get wlen 0 |
| 1875 | put wgoal i get wbuf i |
| 1876 | end |
| 1877 | ret |
| 1878 | end |
| 1879 | if eq id 3 |
| 1880 | put wjob 0 1 |
| 1881 | put wjob 1 72 |
| 1882 | put wjob 2 1 |
| 1883 | put wjob 3 0 |
| 1884 | put wjob 4 0 |
| 1885 | wz |
| 1886 | wtc79 |
| 1887 | put wplen 0 get wlen 0 |
| 1888 | for i ulong get wlen 0 |
| 1889 | put wpath i get wbuf i |
| 1890 | end |
| 1891 | wz |
| 1892 | wtc80 |
| 1893 | put wglen 0 get wlen 0 |
| 1894 | for i ulong get wlen 0 |
| 1895 | put wgoal i get wbuf i |
| 1896 | end |
| 1897 | ret |
| 1898 | end |
| 1899 | if eq id 4 |
| 1900 | put wjob 0 2 |
| 1901 | put wjob 1 72 |
| 1902 | put wjob 2 1 |
| 1903 | put wjob 3 6 |
| 1904 | put wjob 4 0 |
| 1905 | wz |
| 1906 | wtc81 |
| 1907 | put wplen 0 get wlen 0 |
| 1908 | for i ulong get wlen 0 |
| 1909 | put wpath i get wbuf i |
| 1910 | end |
| 1911 | wz |
| 1912 | wtc82 |
| 1913 | put wglen 0 get wlen 0 |
| 1914 | for i ulong get wlen 0 |
| 1915 | put wgoal i get wbuf i |
| 1916 | end |
| 1917 | ret |
| 1918 | end |
| 1919 | if eq id 5 |
| 1920 | put wjob 0 2 |
| 1921 | put wjob 1 70 |
| 1922 | put wjob 2 2 |
| 1923 | put wjob 3 4 |
| 1924 | put wjob 4 0 |
| 1925 | wz |
| 1926 | wtc83 |
| 1927 | put wplen 0 get wlen 0 |
| 1928 | for i ulong get wlen 0 |
| 1929 | put wpath i get wbuf i |
| 1930 | end |
| 1931 | wz |
| 1932 | wtc84 |
| 1933 | put wglen 0 get wlen 0 |
| 1934 | for i ulong get wlen 0 |
| 1935 | put wgoal i get wbuf i |
| 1936 | end |
| 1937 | ret |
| 1938 | end |
| 1939 | if eq id 6 |
| 1940 | put wjob 0 2 |
| 1941 | put wjob 1 71 |
| 1942 | put wjob 2 5 |
| 1943 | put wjob 3 3 |
| 1944 | put wjob 4 1 |
| 1945 | wz |
| 1946 | wtc85 |
| 1947 | put wplen 0 get wlen 0 |
| 1948 | for i ulong get wlen 0 |
| 1949 | put wpath i get wbuf i |
| 1950 | end |
| 1951 | wz |
| 1952 | wtc86 |
| 1953 | put wglen 0 get wlen 0 |
| 1954 | for i ulong get wlen 0 |
| 1955 | put wgoal i get wbuf i |
| 1956 | end |
| 1957 | ret |
| 1958 | end |
| 1959 | if eq id 7 |
| 1960 | put wjob 0 0 |
| 1961 | put wjob 1 73 |
| 1962 | put wjob 2 5 |
| 1963 | put wjob 3 0 |
| 1964 | put wjob 4 0 |
| 1965 | wz |
| 1966 | wtc87 |
| 1967 | put wplen 0 get wlen 0 |
| 1968 | for i ulong get wlen 0 |
| 1969 | put wpath i get wbuf i |
| 1970 | end |
| 1971 | wz |
| 1972 | wtc78 |
| 1973 | put wglen 0 get wlen 0 |
| 1974 | for i ulong get wlen 0 |
| 1975 | put wgoal i get wbuf i |
| 1976 | end |
| 1977 | ret |
| 1978 | end |
| 1979 | if eq id 8 |
| 1980 | put wjob 0 0 |
| 1981 | put wjob 1 70 |
| 1982 | put wjob 2 1 |
| 1983 | put wjob 3 0 |
| 1984 | put wjob 4 0 |
| 1985 | wz |
| 1986 | wtc88 |
| 1987 | put wplen 0 get wlen 0 |
| 1988 | for i ulong get wlen 0 |
| 1989 | put wpath i get wbuf i |
| 1990 | end |
| 1991 | wz |
| 1992 | wtc89 |
| 1993 | put wglen 0 get wlen 0 |
| 1994 | for i ulong get wlen 0 |
| 1995 | put wgoal i get wbuf i |
| 1996 | end |
| 1997 | ret |
| 1998 | end |
| 1999 | if eq id 9 |
| 2000 | put wjob 0 0 |
| 2001 | put wjob 1 72 |
| 2002 | put wjob 2 1 |
| 2003 | put wjob 3 0 |
| 2004 | put wjob 4 1 |
| 2005 | wz |
| 2006 | wtc90 |
| 2007 | put wplen 0 get wlen 0 |
| 2008 | for i ulong get wlen 0 |
| 2009 | put wpath i get wbuf i |
| 2010 | end |
| 2011 | wz |
| 2012 | wtc91 |
| 2013 | put wglen 0 get wlen 0 |
| 2014 | for i ulong get wlen 0 |
| 2015 | put wgoal i get wbuf i |
| 2016 | end |
| 2017 | ret |
| 2018 | end |
| 2019 | if eq id 10 |
| 2020 | put wjob 0 1 |
| 2021 | put wjob 1 71 |
| 2022 | put wjob 2 1 |
| 2023 | put wjob 3 0 |
| 2024 | put wjob 4 0 |
| 2025 | wz |
| 2026 | wtc92 |
| 2027 | put wplen 0 get wlen 0 |
| 2028 | for i ulong get wlen 0 |
| 2029 | put wpath i get wbuf i |
| 2030 | end |
| 2031 | wz |
| 2032 | wtc93 |
| 2033 | put wglen 0 get wlen 0 |
| 2034 | for i ulong get wlen 0 |
| 2035 | put wgoal i get wbuf i |
| 2036 | end |
| 2037 | ret |
| 2038 | end |
| 2039 | if eq id 11 |
| 2040 | put wjob 0 1 |
| 2041 | put wjob 1 74 |
| 2042 | put wjob 2 1 |
| 2043 | put wjob 3 0 |
| 2044 | put wjob 4 0 |
| 2045 | wz |
| 2046 | wtc94 |
| 2047 | put wplen 0 get wlen 0 |
| 2048 | for i ulong get wlen 0 |
| 2049 | put wpath i get wbuf i |
| 2050 | end |
| 2051 | wz |
| 2052 | wtc95 |
| 2053 | put wglen 0 get wlen 0 |
| 2054 | for i ulong get wlen 0 |
| 2055 | put wgoal i get wbuf i |
| 2056 | end |
| 2057 | ret |
| 2058 | end |
| 2059 | if eq id 12 |
| 2060 | put wjob 0 1 |
| 2061 | put wjob 1 73 |
| 2062 | put wjob 2 1 |
| 2063 | put wjob 3 0 |
| 2064 | put wjob 4 1 |
| 2065 | wz |
| 2066 | wtc96 |
| 2067 | put wplen 0 get wlen 0 |
| 2068 | for i ulong get wlen 0 |
| 2069 | put wpath i get wbuf i |
| 2070 | end |
| 2071 | wz |
| 2072 | wtc97 |
| 2073 | put wglen 0 get wlen 0 |
| 2074 | for i ulong get wlen 0 |
| 2075 | put wgoal i get wbuf i |
| 2076 | end |
| 2077 | ret |
| 2078 | end |
| 2079 | end |
| 2080 | text t0 "HTTP/1.1 200 OK\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/html; charset=utf-8\nContent-Length: 25807\n\n" |
| 2081 | text page "<!doctype html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>Omega · Conversation and tools</title>\n<style>\n:root{color-scheme:dark;font:16px/1.55 system-ui,sans-serif;color:#e7edef;background:#101719}*{box-sizing:border-box}body{margin:0}main{max-width:860px;margin:auto;padding:44px 24px}header{display:flex;justify-content:space-between;gap:20px;align-items:center}.mark{letter-spacing:.2em;color:#b8ddc9;font-weight:700;font-size:13px}.badge{border:1px solid #3e5850;border-radius:30px;padding:5px 13px;font-size:13px;color:#b8ddc9}h1{font-size:clamp(30px,6vw,45px);line-height:1.15;margin:34px 0 14px;font-weight:600;letter-spacing:-.035em}p{color:#aab9bc;margin:0 0 22px}.panel{background:#172124;border:1px solid #304044;border-radius:16px;padding:24px;margin-top:24px}label{display:block;font-weight:600;margin-bottom:9px}select,textarea,button{font:inherit}select{background:#101719;color:#e7edef;border:1px solid #4a6268;border-radius:8px;padding:8px 12px;margin-bottom:20px}textarea{width:100%;min-height:150px;resize:vertical;background:#101719;color:#eef5f4;border:1px solid #4a6268;border-radius:10px;padding:15px}textarea:focus,select:focus,button:focus-visible{outline:2px solid #a4dbbc;outline-offset:3px}.hint{font-size:13px;margin-top:8px}.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:18px}button{cursor:pointer;border:0;border-radius:9px;padding:10px 17px;font-weight:600;background:#b8ddc9;color:#14231a}button:disabled{opacity:.5;cursor:wait}.secondary{background:transparent;color:#c0d5dc;border:1px solid #486169;font-size:13px;padding:7px 12px}.examples{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.output-title{display:flex;justify-content:space-between;align-items:center;gap:12px}h2{font-size:17px;margin:0}pre{white-space:pre-wrap;overflow-wrap:anywhere;min-height:70px;line-height:1.6;font-size:14px;margin:18px 0 0;color:#d0eadc}#status{font-size:14px;color:#b8cccf}#status.error{color:#ffb5a9}footer{margin-top:24px;font-size:13px;color:#9aafb4}button:hover{filter:brightness(1.08)}@media(max-width:500px){main{padding:26px 16px}.panel{padding:18px}}\n.chatpanel{padding:0;overflow:hidden}.chatbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:18px;border-bottom:1px solid #304044}.chatbar select{margin:0;flex:1;min-width:140px;max-width:100%}.chatlog{height:440px;overflow-y:auto;padding:20px;overscroll-behavior:contain}.message{margin:0 0 22px;max-width:100%;overflow-wrap:anywhere}.message.user{background:#22332f;border-radius:12px;padding:14px 16px;margin-left:10%}.message.assistant{padding:4px 8px}.speaker{font-size:12px;font-weight:700;letter-spacing:.04em;color:#adcabc;margin-bottom:8px}.message-text{white-space:pre-wrap;font-size:16px;line-height:1.65}.composer{padding:18px;border-top:1px solid #304044}.composer textarea{min-height:95px}.emptychat{padding-top:100px;text-align:center}.chatnote{font-size:12px;color:#9aafb4;padding:0 18px 14px;margin:0}#chatstatus{font-size:13px;overflow-wrap:anywhere}#chatmemory{margin:10px 0 0;font-size:12px}details.practice>summary{cursor:pointer;font-size:19px;font-weight:600;padding:22px 0 0}details.practice[open]>summary{margin-bottom:10px}@media(max-width:500px){.chatlog{height:400px;padding:14px}.chatbar{padding:13px}.composer{padding:13px}.message-text{font-size:15px}.message.user{margin-left:5%}}\n</style></head><body><main>\n<header><span class=\"mark\">OMEGA</span><span class=\"badge\">Local chat + Omega tools</span></header>\n<h1>Let’s talk.</h1>\n<p>Talk things through with your local Qwen companion. Your trained Omega model is still here for practice jobs.</p>\n<section class=\"panel chatpanel\" aria-label=\"Conversation with Qwen companion\"><div class=\"chatbar\"><label for=\"chats\" style=\"margin:0\">Conversation</label><select id=\"chats\" aria-label=\"Saved conversations\"></select><button id=\"newchat\" type=\"button\" class=\"secondary\">New chat</button><button id=\"exportchat\" type=\"button\" class=\"secondary\">Export chat</button></div><div id=\"chatlog\" class=\"chatlog\" role=\"log\" aria-label=\"Conversation messages\"></div>\n<form id=\"chatform\" class=\"composer\"><label for=\"chatinput\">Message your companion</label><textarea id=\"chatinput\" placeholder=\"Tell me what’s on your mind…\" rows=\"3\" maxlength=\"8000\"></textarea><div class=\"actions\"><button id=\"sendchat\" type=\"submit\">Send</button><button id=\"stopchat\" class=\"secondary\" type=\"button\" hidden>Stop</button><span id=\"chatstatus\" role=\"status\" aria-live=\"polite\">Ready.</span></div><p id=\"chatmemory\"></p><div class=\"examples\"><button type=\"button\" class=\"secondary\" data-chat-example=\"Explain how you and my trained Omega model work together.\">About this setup</button><button type=\"button\" class=\"secondary\" data-chat-example=\"I have an idea I want to think through. Can you help me work through it?\">Think through an idea</button></div></form><p id=\"chatnote\" class=\"chatnote\">Qwen3-30B-A3B-Instruct-2507 answers this chat. Conversations are saved in this browser and processed on your Spark. Your past chat archives have not been imported.</p></section>\n<details class=\"practice\"><summary>Use your trained Omega model</summary>\n<section class=\"panel\" aria-labelledby=\"practice-title\"><div class=\"output-title\"><h2 id=\"practice-title\">Practice with tools</h2><span class=\"badge\">Real compiler checks</span></div>\n<p class=\"hint\">Choose a job. The model will work on a temporary copy and show each step.</p>\n<label for=\"job\">Practice job</label><select id=\"job\"></select>\n<p id=\"goal\"></p><label for=\"source\">Starting code</label><textarea id=\"source\" maxlength=\"600\" spellcheck=\"false\" style=\"min-height:220px;font-family:monospace;font-size:14px\"></textarea>\n<p class=\"hint\">You can change the numbers or try an arithmetic spelling mistake. Keep the same program shape and starting input. Larger programs are not supported here yet.</p>\n<div class=\"actions\"><button id=\"repair\" type=\"button\">Run the job</button><button id=\"resetjob\" class=\"secondary\" type=\"button\">Reset example</button><button id=\"canceljob\" class=\"secondary\" type=\"button\" hidden>Stop</button></div>\n<p id=\"jobstatus\" role=\"status\" aria-live=\"polite\" style=\"margin:16px 0 0\">Choose a job and press Run.</p>\n<ol id=\"steps\" style=\"padding-left:22px\"></ol>\n<div id=\"jobresult\" hidden><h2>Current code</h2><pre id=\"fixed\"></pre><div class=\"actions\"><button id=\"downloadcode\" class=\"secondary\" type=\"button\">Download code</button><button id=\"downloadreport\" class=\"secondary\" type=\"button\">Save run report</button></div></div>\n</section>\n<h2 style=\"margin-top:32px\">Ask for a single response</h2>\n<form id=\"ask\" class=\"panel\"><label for=\"mode\">What would you like to try?</label>\n<select id=\"mode\"><option value=\"task\">An Omega task</option><option value=\"raw\">Continue text / exact prompt</option></select>\n<label for=\"prompt\">Your request</label><textarea id=\"prompt\" maxlength=\"4000\" required placeholder=\"Write Omega that returns the larger of 24 and 27.\"></textarea>\n<p class=\"hint\">Keep it short. Each request starts fresh, without previous messages.</p>\n<div class=\"examples\"><button type=\"button\" class=\"secondary\" data-example=\"larger\">Compare two numbers</button><button type=\"button\" class=\"secondary\" data-example=\"tool\">Try a tool response</button></div>\n<div class=\"actions\"><button id=\"run\" type=\"submit\">Ask the model</button><button id=\"stop\" class=\"secondary\" type=\"button\" hidden>Stop</button><span id=\"status\" role=\"status\" aria-live=\"polite\">Ready when you are.</span></div></form>\n<section class=\"panel\" aria-label=\"Model response\"><div class=\"output-title\"><h2>Model response</h2><button type=\"button\" id=\"copy\" class=\"secondary\" disabled>Copy</button></div><pre id=\"output\" tabindex=\"0\">Its response will appear here.</pre></section>\n</details><footer>This small model is trained for specific Omega tasks, not general conversation. Practice jobs can change only their temporary exercise file. A single response is displayed without running its tool requests. Download code or a report to keep a result. Chat can discuss work but cannot execute the practice tools itself.</footer>\n</main><script>\nconst $=id=>document.getElementById(id);\nlet controller=null;\nconst examples={larger:{mode:'task',text:'Write Omega that returns the larger of 24 and 27.'},tool:{mode:'raw',text:'Task: Fix the error in this file and confirm its goal.\\nFile: jobs/item76666.om\\nGoal: calc starts with x and adds 4 exactly 3 times in a for loop. main calls calc with 70.\\nState: unread\\nAnswer:\\n'}};\ndocument.querySelectorAll('[data-example]').forEach(b=>b.addEventListener('click',()=>{const e=examples[b.dataset.example];$('mode').value=e.mode;$('prompt').value=e.text;$('prompt').focus();}));\nfunction status(text,error=false){$('status').textContent=text;$('status').className=error?'error':'';}\n$('stop').addEventListener('click',()=>controller?.abort());\n$('ask').addEventListener('submit',async e=>{\n e.preventDefault();if(controller)return;\n const input=$('prompt').value;if(!input.trim())return;\n const prompt=$('mode').value==='task'?'Task: '+input.trim()+'\\nAnswer:\\n':input;\n if(new TextEncoder().encode(prompt).length>4000){status('Please shorten your request.',true);return;}\n controller=new AbortController();const started=performance.now();let timer=setTimeout(()=>controller?.abort(),45000);\n $('run').disabled=true;$('stop').hidden=false;$('copy').disabled=true;$('output').textContent='';status('Waiting for the model…');\n try{\n const response=await fetch('/generate',{method:'POST',headers:{'Content-Type':'text/plain;charset=UTF-8','X-Omega-UI':'1'},body:prompt,signal:controller.signal});\n if(!response.ok)throw new Error((await response.text()).trim()||'The request could not be completed.');\n const reader=response.body.getReader(),decoder=new TextDecoder();let first=true;\n while(true){const {value,done}=await reader.read();if(done)break;$('output').textContent+=decoder.decode(value,{stream:true});if(first){status('Receiving the response…');first=false;}}\n $('output').textContent+=decoder.decode();status('Finished in '+Math.round(performance.now()-started)+' ms.');\n if(!$('output').textContent)$('output').textContent='The model finished without any text. Try one of the examples.';\n }catch(error){status(error.name==='AbortError'?'Stopped. Any response shown may be incomplete.':error.message,true);}\n finally{clearTimeout(timer);controller=null;$('run').disabled=false;$('stop').hidden=true;$('copy').disabled=!$('output').textContent;}\n});\n$('copy').addEventListener('click',async()=>{\n const text=$('output').textContent;\n try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(text);}else{const area=document.createElement('textarea');area.value=text;area.style.position='fixed';area.style.opacity='0';document.body.appendChild(area);area.select();const ok=document.execCommand('copy');area.remove();if(!ok)throw new Error('copy');}status('Response copied.');}catch{status('Select the response text to copy it.',true);}\n});\n\nconst practiceJobs=[{\"id\":\"A\",\"label\":\"Loop: wrong repeat count\",\"goal\":\"Start with 70. Add 4 exactly 3 times.\",\"source\":\"fn calc x int to int\\ns = x\\nfor i ulong 2\\ns = add s int 4\\nend\\nret s\\nend\\nfn main to int\\nret calc int 70\\nend\\n\",\"missing\":false},{\"id\":\"B\",\"label\":\"Loop: wrong addition\",\"goal\":\"Start with 74. Add 3 exactly 3 times.\",\"source\":\"fn calc x int to int\\ns = x\\nfor i ulong 3\\ns = add s int 6\\nend\\nret s\\nend\\nfn main to int\\nret calc int 74\\nend\\n\",\"missing\":false},{\"id\":\"C\",\"label\":\"Addition: wrong number\",\"goal\":\"Add 5 to 73.\",\"source\":\"fn calc x int to int\\nret add x int 6\\nend\\nfn main to int\\nret calc int 73\\nend\\n\",\"missing\":false},{\"id\":\"D\",\"label\":\"Multiplication: wrong number\",\"goal\":\"Multiply 72 by 1.\",\"source\":\"fn calc x int to int\\nret mul x int 3\\nend\\nfn main to int\\nret calc int 72\\nend\\n\",\"missing\":false},{\"id\":\"E\",\"label\":\"Loop: spelling error\",\"goal\":\"Start with 72. Add 1 exactly 6 times.\",\"source\":\"fn calc x int to int\\ns = x\\nfor i ulong 6\\ns = plus s int 1\\nend\\nret s\\nend\\nfn main to int\\nret calc int 72\\nend\\n\",\"missing\":false},{\"id\":\"F\",\"label\":\"Loop: already correct\",\"goal\":\"Start with 70. Add 2 exactly 4 times.\",\"source\":\"fn calc x int to int\\ns = x\\nfor i ulong 4\\ns = add s int 2\\nend\\nret s\\nend\\nfn main to int\\nret calc int 70\\nend\\n\",\"missing\":false},{\"id\":\"G\",\"label\":\"Loop: missing file\",\"goal\":\"Start with 71. Add 5 exactly 3 times.\",\"source\":\"\",\"missing\":true},{\"id\":\"H\",\"label\":\"Addition: spelling error\",\"goal\":\"Add 5 to 73.\",\"source\":\"fn calc x int to int\\nret plus x int 5\\nend\\nfn main to int\\nret calc int 73\\nend\\n\",\"missing\":false},{\"id\":\"I\",\"label\":\"Addition: already correct\",\"goal\":\"Add 1 to 70.\",\"source\":\"fn calc x int to int\\nret add x int 1\\nend\\nfn main to int\\nret calc int 70\\nend\\n\",\"missing\":false},{\"id\":\"J\",\"label\":\"Addition: missing file\",\"goal\":\"Add 1 to 72.\",\"source\":\"\",\"missing\":true},{\"id\":\"K\",\"label\":\"Multiplication: spelling error\",\"goal\":\"Multiply 71 by 1.\",\"source\":\"fn calc x int to int\\nret times x int 1\\nend\\nfn main to int\\nret calc int 71\\nend\\n\",\"missing\":false},{\"id\":\"L\",\"label\":\"Multiplication: already correct\",\"goal\":\"Multiply 74 by 1.\",\"source\":\"fn calc x int to int\\nret mul x int 1\\nend\\nfn main to int\\nret calc int 74\\nend\\n\",\"missing\":false},{\"id\":\"M\",\"label\":\"Multiplication: missing file\",\"goal\":\"Multiply 73 by 1.\",\"source\":\"\",\"missing\":true}];\nlet jobController=null,runReport=null,finishedSource='';\npracticeJobs.forEach((j,i)=>{const option=document.createElement('option');option.value=i;option.textContent=j.label;$('job').appendChild(option);});\nfunction loadJob(){if(jobController)return;const j=practiceJobs[+$('job').value];$('goal').textContent=j.goal+ (j.missing?' The practice file is deliberately missing.':'');$('source').value=j.source;$('source').disabled=j.missing;$('jobresult').hidden=true;$('steps').replaceChildren();$('jobstatus').textContent='Choose a job and press Run.';}\n$('job').addEventListener('change',loadJob);$('resetjob').addEventListener('click',loadJob);loadJob();\n$('canceljob').addEventListener('click',()=>jobController?.abort());\nfunction jobStep(text){const li=document.createElement('li');li.textContent=text;li.style.marginBottom='8px';$('steps').appendChild(li);}\nfunction receiveEvent(event){\n runReport.events.push(event);\n if(event.type==='action'){\n try{const action=JSON.parse(event.text);if(action.tool==='read_file')jobStep('Model asks to read the practice file.');else if(action.tool==='omega_check')jobStep('Model asks to compile and test the program.');else if(action.tool==='replace_text')jobStep('Model proposes replacing “'+action.old+'” with “'+action.new+'”.');else jobStep('Model requested an unsupported action.');}\n catch{jobStep('Model says: '+event.text);}\n }else if(event.type==='observation'){jobStep(event.text);}\n else if(event.type==='test'){jobStep('Check with input '+event.input+': expected '+event.expected+', got '+event.actual+'. '+(event.expected===event.actual?'Passed.':'Failed.'));}\n else if(event.type==='source'){finishedSource=event.text;$('fixed').textContent=event.text;$('jobresult').hidden=false;}\n else if(event.type==='done'){\n runReport.result=event;finishedSource=event.source;$('fixed').textContent=event.source||'No practice file was created.';$('jobresult').hidden=false;$('downloadcode').disabled=!event.source;\n $('jobstatus').textContent=event.message;$('jobstatus').style.color=event.passed?'#b8ddc9':'#ffd5a2';\n }\n}\n$('repair').addEventListener('click',async()=>{\n if(jobController)return;\n const j=practiceJobs[+$('job').value];let source=$('source').value.replace(/\\r\\n?/g,'\\n');if(source&&!source.endsWith('\\n'))source+='\\n';\n if(new TextEncoder().encode(source).length>600){$('jobstatus').textContent='Please shorten the program to 600 bytes or less.';return;}\n jobController=new AbortController();const timer=setTimeout(()=>jobController?.abort(),90000);\n runReport={model:'Omega round40',job:j.label,goal:j.goal,startedAt:new Date().toISOString(),original:source,events:[]};finishedSource='';\n $('steps').replaceChildren();$('jobresult').hidden=true;$('jobstatus').textContent='The model is starting the job…';$('jobstatus').style.color='';\n $('repair').disabled=true;$('resetjob').disabled=true;$('job').disabled=true;$('source').disabled=true;$('canceljob').hidden=false;\n try{\n const response=await fetch('/repair',{method:'POST',headers:{'Content-Type':'text/plain;charset=UTF-8','X-Omega-UI':'1'},body:j.id+'\\n'+source,signal:jobController.signal});\n if(!response.ok)throw new Error((await response.text()).trim()||'The job could not start.');\n const reader=response.body.getReader(),decoder=new TextDecoder();let pending='';\n while(true){const {value,done}=await reader.read();if(done){pending+=decoder.decode();break;}pending+=decoder.decode(value,{stream:true});let newline;while((newline=pending.indexOf('\\n'))>=0){const line=pending.slice(0,newline);pending=pending.slice(newline+1);if(line)receiveEvent(JSON.parse(line));}}\n if(pending.trim())throw new Error('The job ended with an incomplete report.');\n if(!runReport.result)throw new Error('The job stopped before a verified result arrived.');\n }catch(error){runReport.error=error.name==='AbortError'?'Stopped. Any work shown may be incomplete.':error.message;$('jobstatus').textContent=runReport.error;$('jobstatus').style.color='#ffb5a9';$('jobresult').hidden=false;$('fixed').textContent=finishedSource||source||'No source available.';$('downloadcode').disabled=!finishedSource;}\n finally{clearTimeout(timer);jobController=null;$('repair').disabled=false;$('resetjob').disabled=false;$('job').disabled=false;$('source').disabled=j.missing;$('canceljob').hidden=true;}\n});\nfunction download(name,text,type){const url=URL.createObjectURL(new Blob([text],{type}));const a=document.createElement('a');a.href=url;a.download=name;document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1000);}\n$('downloadcode').addEventListener('click',()=>download('practice-result.om',finishedSource,'text/plain'));\n$('downloadreport').addEventListener('click',()=>{if(runReport)download('omega-run-report.json',JSON.stringify(runReport,null,2)+'\\n','application/json');});\n\nconst chatKey='omega-conversations-v1',encoder=new TextEncoder();\nlet chatStore={active:'',chats:[]},chatAbort=null;\ntry{const saved=JSON.parse(localStorage.getItem(chatKey)||'null');if(saved&&Array.isArray(saved.chats)&&saved.chats.every(c=>typeof c.id==='string'&&Array.isArray(c.messages)&&c.messages.every(m=>['user','assistant'].includes(m.role)&&typeof m.content==='string')))chatStore=saved;}catch{}\nfunction saveChats(){try{localStorage.setItem(chatKey,JSON.stringify(chatStore));}catch{$('chatnote').textContent='Browser storage is unavailable or full. Export this conversation to keep it.';}}\nfunction activeChat(){return chatStore.chats.find(c=>c.id===chatStore.active);}\nfunction createChat(){const c={id:Date.now().toString(36)+'-'+Math.random().toString(36).slice(2),title:'New conversation',messages:[],draft:'',createdAt:new Date().toISOString()};chatStore.chats.push(c);chatStore.active=c.id;saveChats();renderChat();}\nfunction bubble(role,text,partial=false){const article=document.createElement('article');article.className='message '+role;const label=document.createElement('div');label.className='speaker';label.textContent=role==='user'?'You':(partial?'Qwen companion · interrupted':'Qwen companion');const body=document.createElement('div');body.className='message-text';body.textContent=text;article.append(label,body);$('chatlog').appendChild(article);return body;}\nfunction renderChat(){const c=activeChat();if(!c)return;$('chats').replaceChildren();for(const x of [...chatStore.chats].reverse()){const option=document.createElement('option');option.value=x.id;option.textContent=x.title;$('chats').appendChild(option);}$('chats').value=c.id;$('chatlog').replaceChildren();for(const m of c.messages)bubble(m.role,m.content);if(!c.messages.length){const hint=document.createElement('p');hint.className='emptychat';hint.textContent='Start anywhere. Ask a question, share an idea, or tell me what you are working on.';$('chatlog').appendChild(hint);}$('chatinput').value=c.draft||'';$('chatstatus').textContent='Ready.';$('chatmemory').textContent='Previous messages in this conversation are included in your next reply.';$('chatlog').scrollTop=$('chatlog').scrollHeight;}\n$('newchat').addEventListener('click',()=>{if(!chatAbort){createChat();$('chatinput').focus();}});\n$('chats').addEventListener('change',()=>{if(chatAbort)return;const old=activeChat();if(old)old.draft=$('chatinput').value;chatStore.active=$('chats').value;saveChats();renderChat();});\n$('chatinput').addEventListener('input',()=>{const c=activeChat();if(c){c.draft=$('chatinput').value;saveChats();}});\n$('chatinput').addEventListener('keydown',e=>{if(e.key==='Enter'&&!e.shiftKey&&!e.isComposing){e.preventDefault();$('chatform').requestSubmit();}});\n$('stopchat').addEventListener('click',()=>chatAbort?.abort());\n$('exportchat').addEventListener('click',()=>{const c=activeChat();if(c)download('omega-conversation.json',JSON.stringify({model:'Qwen3-30B-A3B-Instruct-2507',...c},null,2)+'\\n','application/json');});\ndocument.querySelectorAll('[data-chat-example]').forEach(b=>b.addEventListener('click',()=>{if(chatAbort)return;$('chatinput').value=b.dataset.chatExample;activeChat().draft=$('chatinput').value;saveChats();$('chatinput').focus();}));\nfunction frameChat(messages){let text='';for(const m of messages){const bytes=encoder.encode(m.content).length;text+=(m.role==='user'?'U':'A')+bytes+'\\n'+m.content;}return encoder.encode(text);}\n$('chatform').addEventListener('submit',async e=>{\n e.preventDefault();if(chatAbort)return;\n const content=$('chatinput').value.trim();if(!content)return;\n if(encoder.encode(content).length>8000){$('chatstatus').textContent='Please shorten this message to 8,000 bytes or less.';return;}\n const c=activeChat(),user={role:'user',content};let context=[...c.messages,user],wire=frameChat(context),removed=0;\n while((context.length>63||wire.length>24000)&&context.length>1){context=context.slice(2);removed+=2;wire=frameChat(context);}\n if(wire.length>24000){$('chatstatus').textContent='This message is too long. Please shorten it.';return;}\n $('chatmemory').textContent=removed?'Using the most recent '+context.length+' messages. Earlier messages remain saved here, outside active memory.':'Using this conversation’s previous messages.';\n chatAbort=new AbortController();const timer=setTimeout(()=>chatAbort?.abort(),125000);let answer='',complete=false,finishReason='';\n c.draft=content;saveChats();if(!c.messages.length)$('chatlog').replaceChildren();bubble('user',content);const output=bubble('assistant','');\n $('chatlog').scrollTop=$('chatlog').scrollHeight;\n $('sendchat').disabled=true;$('newchat').disabled=true;$('chats').disabled=true;$('chatinput').disabled=true;$('stopchat').hidden=false;$('chatstatus').textContent='Thinking…';\n function acceptSSE(block){\n const data=block.split('\\n').filter(l=>l.startsWith('data:')).map(l=>l.slice(5).trimStart()).join('\\n');if(!data)return;\n if(data.trim()==='[DONE]'){complete=true;return;}\n const event=JSON.parse(data);if(event.error)throw new Error(event.error.message||'The model reported an error.');\n const choice=event.choices?.[0];if(choice?.delta?.content){answer+=choice.delta.content;output.textContent=answer;$('chatstatus').textContent='Replying…';if($('chatlog').scrollHeight-$('chatlog').scrollTop-$('chatlog').clientHeight<180)$('chatlog').scrollTop=$('chatlog').scrollHeight;}\n if(choice?.finish_reason)finishReason=choice.finish_reason;\n }\n try{\n const response=await fetch('/chat',{method:'POST',headers:{'X-Omega-UI':'1','Content-Type':'text/plain;charset=UTF-8'},body:wire,signal:chatAbort.signal});\n if(!response.ok){const text=await response.text();let message=text;try{message=JSON.parse(text).error?.message||text;}catch{}throw new Error(message.slice(0,500));}\n const reader=response.body.getReader(),decoder=new TextDecoder();let pending='';\n while(true){const {value,done}=await reader.read();if(done){pending+=decoder.decode();break;}pending+=decoder.decode(value,{stream:true});pending=pending.replace(/\\r\\n/g,'\\n');let boundary;while((boundary=pending.indexOf('\\n\\n'))>=0){acceptSSE(pending.slice(0,boundary));pending=pending.slice(boundary+2);}}\n if(pending.trim())acceptSSE(pending);\n if(!complete||!answer.trim())throw new Error('The reply ended before it was complete. Your message is ready to retry.');\n c.messages.push(user,{role:'assistant',content:answer});c.draft='';delete c.lastAttempt;if(c.title==='New conversation')c.title=content.slice(0,50);c.updatedAt=new Date().toISOString();saveChats();$('chatinput').value='';\n $('chatstatus').textContent=finishReason==='length'?'Reply reached its length limit. Ask “continue” for more.':'Ready for your next message.';\n const option=[...$('chats').options].find(o=>o.value===c.id);if(option)option.textContent=c.title;\n }catch(error){const message=error.name==='AbortError'?'Stopped. Your message is ready to retry; the partial reply was not added to conversation memory.':error.message;$('chatstatus').textContent=message;output.parentElement.querySelector('.speaker').textContent='Qwen companion · incomplete';if(!answer)output.textContent=message;c.lastAttempt={user:content,partial:answer,error:message,at:new Date().toISOString()};saveChats();}\n finally{clearTimeout(timer);chatAbort=null;$('sendchat').disabled=false;$('newchat').disabled=false;$('chats').disabled=false;$('chatinput').disabled=false;$('stopchat').hidden=true;$('chatinput').focus();}\n});\nif(!activeChat())createChat();else renderChat();\n\n</script></body></html>\n" |
| 2082 | fn respondpage to bool |
| 2083 | p = ulong 0 |
| 2084 | for i ulong len t0 |
| 2085 | c = get t0 i |
| 2086 | if eq c 10 |
| 2087 | put hbuf p 13 |
| 2088 | p = add p 1 |
| 2089 | end |
| 2090 | put hbuf p c |
| 2091 | p = add p 1 |
| 2092 | end |
| 2093 | for i ulong len page |
| 2094 | put hbuf p get page i |
| 2095 | p = add p 1 |
| 2096 | end |
| 2097 | ret hsend p |
| 2098 | end |
| 2099 | text t1 "HTTP/1.1 400 Bad Request\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nContent-Length: 55\n\nPlease send a short, nonempty request using this page.\n" |
| 2100 | fn respond400 to bool |
| 2101 | p = ulong 0 |
| 2102 | for i ulong len t1 |
| 2103 | c = get t1 i |
| 2104 | if eq c 10 |
| 2105 | put hbuf p 13 |
| 2106 | p = add p 1 |
| 2107 | end |
| 2108 | put hbuf p c |
| 2109 | p = add p 1 |
| 2110 | end |
| 2111 | put hbuf sub p 2 10 |
| 2112 | p = sub p 1 |
| 2113 | ret hsend p |
| 2114 | end |
| 2115 | text t2 "HTTP/1.1 404 Not Found\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nContent-Length: 16\n\nPage not found.\n" |
| 2116 | fn respond404 to bool |
| 2117 | p = ulong 0 |
| 2118 | for i ulong len t2 |
| 2119 | c = get t2 i |
| 2120 | if eq c 10 |
| 2121 | put hbuf p 13 |
| 2122 | p = add p 1 |
| 2123 | end |
| 2124 | put hbuf p c |
| 2125 | p = add p 1 |
| 2126 | end |
| 2127 | put hbuf sub p 2 10 |
| 2128 | p = sub p 1 |
| 2129 | ret hsend p |
| 2130 | end |
| 2131 | text t3 "HTTP/1.1 422 Unprocessable Content\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nContent-Length: 73\n\nThis request is too long for the model. Please shorten it and try again.\n" |
| 2132 | fn respond422 to bool |
| 2133 | p = ulong 0 |
| 2134 | for i ulong len t3 |
| 2135 | c = get t3 i |
| 2136 | if eq c 10 |
| 2137 | put hbuf p 13 |
| 2138 | p = add p 1 |
| 2139 | end |
| 2140 | put hbuf p c |
| 2141 | p = add p 1 |
| 2142 | end |
| 2143 | put hbuf sub p 2 10 |
| 2144 | p = sub p 1 |
| 2145 | ret hsend p |
| 2146 | end |
| 2147 | text t4 "HTTP/1.1 502 Bad Gateway\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nContent-Length: 54\n\nThe model response was interrupted. Please try again.\n" |
| 2148 | fn respond502 to bool |
| 2149 | p = ulong 0 |
| 2150 | for i ulong len t4 |
| 2151 | c = get t4 i |
| 2152 | if eq c 10 |
| 2153 | put hbuf p 13 |
| 2154 | p = add p 1 |
| 2155 | end |
| 2156 | put hbuf p c |
| 2157 | p = add p 1 |
| 2158 | end |
| 2159 | put hbuf sub p 2 10 |
| 2160 | p = sub p 1 |
| 2161 | ret hsend p |
| 2162 | end |
| 2163 | text t5 "HTTP/1.1 503 Service Unavailable\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nContent-Length: 60\n\nThe model service is unavailable. Please try again shortly.\n" |
| 2164 | fn respond503 to bool |
| 2165 | p = ulong 0 |
| 2166 | for i ulong len t5 |
| 2167 | c = get t5 i |
| 2168 | if eq c 10 |
| 2169 | put hbuf p 13 |
| 2170 | p = add p 1 |
| 2171 | end |
| 2172 | put hbuf p c |
| 2173 | p = add p 1 |
| 2174 | end |
| 2175 | put hbuf sub p 2 10 |
| 2176 | p = sub p 1 |
| 2177 | ret hsend p |
| 2178 | end |
| 2179 | text t6 "HTTP/1.1 200 OK\nConnection: close\nCache-Control: no-store\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer\nContent-Security-Policy: default-src 'none'; script-src 'sha256-TfPDKEdH43G3j57ZcZC2ieOmo8o2Gy7bqjfKzj32P7g='; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'\nContent-Type: text/plain; charset=utf-8\nTransfer-Encoding: chunked\nX-Accel-Buffering: no\n\n" |
| 2180 | fn streamhead to bool |
| 2181 | p = ulong 0 |
| 2182 | for i ulong len t6 |
| 2183 | c = get t6 i |
| 2184 | if eq c 10 |
| 2185 | put hbuf p 13 |
| 2186 | p = add p 1 |
| 2187 | end |
| 2188 | put hbuf p c |
| 2189 | p = add p 1 |
| 2190 | end |
| 2191 | ret hsend p |
| 2192 | end |
| 2193 | text t7 "0\n\n" |
| 2194 | fn streamend to bool |
| 2195 | p = ulong 0 |
| 2196 | for i ulong len t7 |
| 2197 | c = get t7 i |
| 2198 | if eq c 10 |
| 2199 | put hbuf p 13 |
| 2200 | p = add p 1 |
| 2201 | end |
| 2202 | put hbuf p c |
| 2203 | p = add p 1 |
| 2204 | end |
| 2205 | ret hsend p |
| 2206 | end |
| 2207 | text m0 "GET / HTTP/1.1" |
| 2208 | fn isroot a ulong b ulong to bool |
| 2209 | if ne sub b a len m0 |
| 2210 | ret false |
| 2211 | end |
| 2212 | for i ulong len m0 |
| 2213 | if ne get hreq add a i get m0 i |
| 2214 | ret false |
| 2215 | end |
| 2216 | end |
| 2217 | ret true |
| 2218 | end |
| 2219 | text m1 "POST /generate HTTP/1.1" |
| 2220 | fn isgen a ulong b ulong to bool |
| 2221 | if ne sub b a len m1 |
| 2222 | ret false |
| 2223 | end |
| 2224 | for i ulong len m1 |
| 2225 | if ne get hreq add a i get m1 i |
| 2226 | ret false |
| 2227 | end |
| 2228 | end |
| 2229 | ret true |
| 2230 | end |
| 2231 | text m2 "POST /repair HTTP/1.1" |
| 2232 | fn isrepair a ulong b ulong to bool |
| 2233 | if ne sub b a len m2 |
| 2234 | ret false |
| 2235 | end |
| 2236 | for i ulong len m2 |
| 2237 | if ne get hreq add a i get m2 i |
| 2238 | ret false |
| 2239 | end |
| 2240 | end |
| 2241 | ret true |
| 2242 | end |
| 2243 | text m3 "POST /chat HTTP/1.1" |
| 2244 | fn ischat a ulong b ulong to bool |
| 2245 | if ne sub b a len m3 |
| 2246 | ret false |
| 2247 | end |
| 2248 | for i ulong len m3 |
| 2249 | if ne get hreq add a i get m3 i |
| 2250 | ret false |
| 2251 | end |
| 2252 | end |
| 2253 | ret true |
| 2254 | end |
| 2255 | text m4 "content-length:" |
| 2256 | fn iscl a ulong b ulong to bool |
| 2257 | if lt sub b a len m4 |
| 2258 | ret false |
| 2259 | end |
| 2260 | for i ulong len m4 |
| 2261 | if ne get hreq add a i get m4 i |
| 2262 | ret false |
| 2263 | end |
| 2264 | end |
| 2265 | ret true |
| 2266 | end |
| 2267 | text m5 "transfer-encoding:" |
| 2268 | fn iste a ulong b ulong to bool |
| 2269 | if lt sub b a len m5 |
| 2270 | ret false |
| 2271 | end |
| 2272 | for i ulong len m5 |
| 2273 | if ne get hreq add a i get m5 i |
| 2274 | ret false |
| 2275 | end |
| 2276 | end |
| 2277 | ret true |
| 2278 | end |
| 2279 | text m6 "x-omega-ui: 1" |
| 2280 | fn isguard a ulong b ulong to bool |
| 2281 | if ne sub b a len m6 |
| 2282 | ret false |
| 2283 | end |
| 2284 | for i ulong len m6 |
| 2285 | if ne get hreq add a i get m6 i |
| 2286 | ret false |
| 2287 | end |
| 2288 | end |
| 2289 | ret true |
| 2290 | end |
| 2291 | text m7 "host:" |
| 2292 | fn ishost a ulong b ulong to bool |
| 2293 | if lt sub b a len m7 |
| 2294 | ret false |
| 2295 | end |
| 2296 | for i ulong len m7 |
| 2297 | if ne get hreq add a i get m7 i |
| 2298 | ret false |
| 2299 | end |
| 2300 | end |
| 2301 | ret true |
| 2302 | end |
| 2303 | text m8 "host: 127.0.0.1:18175" |
| 2304 | fn host0 a ulong b ulong to bool |
| 2305 | if ne sub b a len m8 |
| 2306 | ret false |
| 2307 | end |
| 2308 | for i ulong len m8 |
| 2309 | if ne get hreq add a i get m8 i |
| 2310 | ret false |
| 2311 | end |
| 2312 | end |
| 2313 | ret true |
| 2314 | end |
| 2315 | text m9 "host: localhost:18175" |
| 2316 | fn host1 a ulong b ulong to bool |
| 2317 | if ne sub b a len m9 |
| 2318 | ret false |
| 2319 | end |
| 2320 | for i ulong len m9 |
| 2321 | if ne get hreq add a i get m9 i |
| 2322 | ret false |
| 2323 | end |
| 2324 | end |
| 2325 | ret true |
| 2326 | end |
| 2327 | text m10 "host: 127.0.0.1:18174" |
| 2328 | fn host2 a ulong b ulong to bool |
| 2329 | if ne sub b a len m10 |
| 2330 | ret false |
| 2331 | end |
| 2332 | for i ulong len m10 |
| 2333 | if ne get hreq add a i get m10 i |
| 2334 | ret false |
| 2335 | end |
| 2336 | end |
| 2337 | ret true |
| 2338 | end |
| 2339 | text m11 "host: localhost:18174" |
| 2340 | fn host3 a ulong b ulong to bool |
| 2341 | if ne sub b a len m11 |
| 2342 | ret false |
| 2343 | end |
| 2344 | for i ulong len m11 |
| 2345 | if ne get hreq add a i get m11 i |
| 2346 | ret false |
| 2347 | end |
| 2348 | end |
| 2349 | ret true |
| 2350 | end |
| 2351 | fn goodhost a ulong b ulong to bool |
| 2352 | ret or or host0 a b host1 a b or host2 a b host3 a b |
| 2353 | end |
| 2354 | fn wconsumec0 at ulong to ulong |
| 2355 | if not wmc98 at |
| 2356 | ret 10000 |
| 2357 | end |
| 2358 | ret add at len z0 |
| 2359 | end |
| 2360 | |
| 2361 | fn wmc1 at ulong to bool |
| 2362 | if gt add at len z1 get wslen 0 |
| 2363 | ret false |
| 2364 | end |
| 2365 | for i ulong len z1 |
| 2366 | if ne get wsrc add at i get z1 i |
| 2367 | ret false |
| 2368 | end |
| 2369 | end |
| 2370 | ret true |
| 2371 | end |
| 2372 | |
| 2373 | fn wconsumec2 at ulong to ulong |
| 2374 | if not wmc1 at |
| 2375 | ret 10000 |
| 2376 | end |
| 2377 | ret add at len z1 |
| 2378 | end |
| 2379 | |
| 2380 | fn wconsumec3 at ulong to ulong |
| 2381 | if not wmc99 at |
| 2382 | ret 10000 |
| 2383 | end |
| 2384 | ret add at len z2 |
| 2385 | end |
| 2386 | |
| 2387 | fn wmc4 at ulong to bool |
| 2388 | if gt add at len z3 get wslen 0 |
| 2389 | ret false |
| 2390 | end |
| 2391 | for i ulong len z3 |
| 2392 | if ne get wsrc add at i get z3 i |
| 2393 | ret false |
| 2394 | end |
| 2395 | end |
| 2396 | ret true |
| 2397 | end |
| 2398 | |
| 2399 | fn wconsumec5 at ulong to ulong |
| 2400 | if not wmc11 at |
| 2401 | ret 10000 |
| 2402 | end |
| 2403 | ret add at len z4 |
| 2404 | end |
| 2405 | |
| 2406 | fn wconsumec6 at ulong to ulong |
| 2407 | if not wmc100 at |
| 2408 | ret 10000 |
| 2409 | end |
| 2410 | ret add at len z5 |
| 2411 | end |
| 2412 | |
| 2413 | fn wconsumec7 at ulong to ulong |
| 2414 | if not wmc101 at |
| 2415 | ret 10000 |
| 2416 | end |
| 2417 | ret add at len z6 |
| 2418 | end |
| 2419 | |
| 2420 | fn wconsumec8 at ulong to ulong |
| 2421 | if not wmc102 at |
| 2422 | ret 10000 |
| 2423 | end |
| 2424 | ret add at len z7 |
| 2425 | end |
| 2426 | |
| 2427 | fn wmc9 at ulong to bool |
| 2428 | if gt add at len z8 get wslen 0 |
| 2429 | ret false |
| 2430 | end |
| 2431 | for i ulong len z8 |
| 2432 | if ne get wsrc add at i get z8 i |
| 2433 | ret false |
| 2434 | end |
| 2435 | end |
| 2436 | ret true |
| 2437 | end |
| 2438 | |
| 2439 | fn wmc10 at ulong to bool |
| 2440 | if gt add at len z9 get wslen 0 |
| 2441 | ret false |
| 2442 | end |
| 2443 | for i ulong len z9 |
| 2444 | if ne get wsrc add at i get z9 i |
| 2445 | ret false |
| 2446 | end |
| 2447 | end |
| 2448 | ret true |
| 2449 | end |
| 2450 | |
| 2451 | fn wmc11 at ulong to bool |
| 2452 | if gt add at len z4 get wslen 0 |
| 2453 | ret false |
| 2454 | end |
| 2455 | for i ulong len z4 |
| 2456 | if ne get wsrc add at i get z4 i |
| 2457 | ret false |
| 2458 | end |
| 2459 | end |
| 2460 | ret true |
| 2461 | end |
| 2462 | |
| 2463 | fn wconsumec12 at ulong to ulong |
| 2464 | if not wmc103 at |
| 2465 | ret 10000 |
| 2466 | end |
| 2467 | ret add at len z10 |
| 2468 | end |
| 2469 | |
| 2470 | fn wconsumec13 at ulong to ulong |
| 2471 | if not wmc104 at |
| 2472 | ret 10000 |
| 2473 | end |
| 2474 | ret add at len z11 |
| 2475 | end |
| 2476 | |
| 2477 | fn wconsumec14 at ulong to ulong |
| 2478 | if not wmc105 at |
| 2479 | ret 10000 |
| 2480 | end |
| 2481 | ret add at len z12 |
| 2482 | end |
| 2483 | |
| 2484 | fn wconsumec15 at ulong to ulong |
| 2485 | if not wmc106 at |
| 2486 | ret 10000 |
| 2487 | end |
| 2488 | ret add at len z13 |
| 2489 | end |
| 2490 | |
| 2491 | fn wtc16 to void |
| 2492 | for i ulong len wbase |
| 2493 | wb get wbase i |
| 2494 | end |
| 2495 | end |
| 2496 | |
| 2497 | fn wtc17 to void |
| 2498 | for i ulong len wcomp |
| 2499 | wb get wcomp i |
| 2500 | end |
| 2501 | end |
| 2502 | |
| 2503 | fn wtc18 to void |
| 2504 | for i ulong len wexec |
| 2505 | wb get wexec i |
| 2506 | end |
| 2507 | end |
| 2508 | |
| 2509 | fn woc19 to void |
| 2510 | put wolen 0 len z14 |
| 2511 | for i ulong len z14 |
| 2512 | put wobs i get z14 i |
| 2513 | end |
| 2514 | end |
| 2515 | |
| 2516 | fn woc20 to void |
| 2517 | put wolen 0 len z15 |
| 2518 | for i ulong len z15 |
| 2519 | put wobs i get z15 i |
| 2520 | end |
| 2521 | end |
| 2522 | |
| 2523 | fn woc21 to void |
| 2524 | put wolen 0 len z16 |
| 2525 | for i ulong len z16 |
| 2526 | put wobs i get z16 i |
| 2527 | end |
| 2528 | end |
| 2529 | |
| 2530 | fn woc22 to void |
| 2531 | put wolen 0 len z17 |
| 2532 | for i ulong len z17 |
| 2533 | put wobs i get z17 i |
| 2534 | end |
| 2535 | end |
| 2536 | |
| 2537 | fn woc23 to void |
| 2538 | put wolen 0 len z18 |
| 2539 | for i ulong len z18 |
| 2540 | put wobs i get z18 i |
| 2541 | end |
| 2542 | end |
| 2543 | |
| 2544 | fn woc24 to void |
| 2545 | put wolen 0 len z19 |
| 2546 | for i ulong len z19 |
| 2547 | put wobs i get z19 i |
| 2548 | end |
| 2549 | end |
| 2550 | |
| 2551 | fn wtc25 to void |
| 2552 | for i ulong len z20 |
| 2553 | wb get z20 i |
| 2554 | end |
| 2555 | end |
| 2556 | |
| 2557 | fn wtc26 to void |
| 2558 | for i ulong len z21 |
| 2559 | wb get z21 i |
| 2560 | end |
| 2561 | end |
| 2562 | |
| 2563 | fn wtc27 to void |
| 2564 | for i ulong len z22 |
| 2565 | wb get z22 i |
| 2566 | end |
| 2567 | end |
| 2568 | |
| 2569 | fn wtc28 to void |
| 2570 | for i ulong len z23 |
| 2571 | wb get z23 i |
| 2572 | end |
| 2573 | end |
| 2574 | |
| 2575 | fn woc29 to void |
| 2576 | put wolen 0 len z24 |
| 2577 | for i ulong len z24 |
| 2578 | put wobs i get z24 i |
| 2579 | end |
| 2580 | end |
| 2581 | |
| 2582 | fn wtc30 to void |
| 2583 | for i ulong len z25 |
| 2584 | wb get z25 i |
| 2585 | end |
| 2586 | end |
| 2587 | |
| 2588 | fn wtc31 to void |
| 2589 | for i ulong len z26 |
| 2590 | wb get z26 i |
| 2591 | end |
| 2592 | end |
| 2593 | |
| 2594 | fn wtc32 to void |
| 2595 | for i ulong len z27 |
| 2596 | wb get z27 i |
| 2597 | end |
| 2598 | end |
| 2599 | |
| 2600 | fn wtc33 to void |
| 2601 | for i ulong len z28 |
| 2602 | wb get z28 i |
| 2603 | end |
| 2604 | end |
| 2605 | |
| 2606 | fn woc34 to void |
| 2607 | put wolen 0 len z29 |
| 2608 | for i ulong len z29 |
| 2609 | put wobs i get z29 i |
| 2610 | end |
| 2611 | end |
| 2612 | |
| 2613 | fn wtokenc35 to bool |
| 2614 | if ne get wtkn 0 len z30 |
| 2615 | ret false |
| 2616 | end |
| 2617 | for i ulong len z30 |
| 2618 | if ne get wtok i get z30 i |
| 2619 | ret false |
| 2620 | end |
| 2621 | end |
| 2622 | ret true |
| 2623 | end |
| 2624 | |
| 2625 | fn wtokenc36 to bool |
| 2626 | if ne get wtkn 0 len z31 |
| 2627 | ret false |
| 2628 | end |
| 2629 | for i ulong len z31 |
| 2630 | if ne get wtok i get z31 i |
| 2631 | ret false |
| 2632 | end |
| 2633 | end |
| 2634 | ret true |
| 2635 | end |
| 2636 | |
| 2637 | fn wtokenc37 to bool |
| 2638 | if ne get wtkn 0 len z32 |
| 2639 | ret false |
| 2640 | end |
| 2641 | for i ulong len z32 |
| 2642 | if ne get wtok i get z32 i |
| 2643 | ret false |
| 2644 | end |
| 2645 | end |
| 2646 | ret true |
| 2647 | end |
| 2648 | |
| 2649 | fn wtokenc38 to bool |
| 2650 | if ne get wtkn 0 len z33 |
| 2651 | ret false |
| 2652 | end |
| 2653 | for i ulong len z33 |
| 2654 | if ne get wtok i get z33 i |
| 2655 | ret false |
| 2656 | end |
| 2657 | end |
| 2658 | ret true |
| 2659 | end |
| 2660 | |
| 2661 | fn wfieldc39 slot ulong to bool |
| 2662 | if ne get wflen slot len z34 |
| 2663 | ret false |
| 2664 | end |
| 2665 | for i ulong len z34 |
| 2666 | if ne get wfld add mul slot 128 i get z34 i |
| 2667 | ret false |
| 2668 | end |
| 2669 | end |
| 2670 | ret true |
| 2671 | end |
| 2672 | |
| 2673 | fn wtc40 to void |
| 2674 | for i ulong len z35 |
| 2675 | wb get z35 i |
| 2676 | end |
| 2677 | end |
| 2678 | |
| 2679 | fn wtc41 to void |
| 2680 | for i ulong len z36 |
| 2681 | wb get z36 i |
| 2682 | end |
| 2683 | end |
| 2684 | |
| 2685 | fn wtc42 to void |
| 2686 | for i ulong len z37 |
| 2687 | wb get z37 i |
| 2688 | end |
| 2689 | end |
| 2690 | |
| 2691 | fn wtc43 to void |
| 2692 | for i ulong len z38 |
| 2693 | wb get z38 i |
| 2694 | end |
| 2695 | end |
| 2696 | |
| 2697 | fn wtc44 to void |
| 2698 | for i ulong len z39 |
| 2699 | wb get z39 i |
| 2700 | end |
| 2701 | end |
| 2702 | |
| 2703 | fn wtc45 to void |
| 2704 | for i ulong len z40 |
| 2705 | wb get z40 i |
| 2706 | end |
| 2707 | end |
| 2708 | |
| 2709 | fn wtc46 to void |
| 2710 | for i ulong len z41 |
| 2711 | wb get z41 i |
| 2712 | end |
| 2713 | end |
| 2714 | |
| 2715 | fn wtc47 to void |
| 2716 | for i ulong len z42 |
| 2717 | wb get z42 i |
| 2718 | end |
| 2719 | end |
| 2720 | |
| 2721 | fn wtc48 to void |
| 2722 | for i ulong len z43 |
| 2723 | wb get z43 i |
| 2724 | end |
| 2725 | end |
| 2726 | |
| 2727 | fn wtc49 to void |
| 2728 | for i ulong len z44 |
| 2729 | wb get z44 i |
| 2730 | end |
| 2731 | end |
| 2732 | |
| 2733 | fn wtc50 to void |
| 2734 | for i ulong len z45 |
| 2735 | wb get z45 i |
| 2736 | end |
| 2737 | end |
| 2738 | |
| 2739 | fn wtc51 to void |
| 2740 | for i ulong len z46 |
| 2741 | wb get z46 i |
| 2742 | end |
| 2743 | end |
| 2744 | |
| 2745 | fn wfieldc52 slot ulong to bool |
| 2746 | if ne get wflen slot len z47 |
| 2747 | ret false |
| 2748 | end |
| 2749 | for i ulong len z47 |
| 2750 | if ne get wfld add mul slot 128 i get z47 i |
| 2751 | ret false |
| 2752 | end |
| 2753 | end |
| 2754 | ret true |
| 2755 | end |
| 2756 | |
| 2757 | fn woc53 to void |
| 2758 | put wolen 0 len z48 |
| 2759 | for i ulong len z48 |
| 2760 | put wobs i get z48 i |
| 2761 | end |
| 2762 | end |
| 2763 | |
| 2764 | fn woc54 to void |
| 2765 | put wolen 0 len z49 |
| 2766 | for i ulong len z49 |
| 2767 | put wobs i get z49 i |
| 2768 | end |
| 2769 | end |
| 2770 | |
| 2771 | fn weventc55 mode ulong to bool |
| 2772 | wz |
| 2773 | wtc107 |
| 2774 | wtc108 |
| 2775 | wtc109 |
| 2776 | wj mode |
| 2777 | wtc28 |
| 2778 | ret wemit |
| 2779 | end |
| 2780 | |
| 2781 | fn wfieldc56 slot ulong to bool |
| 2782 | if ne get wflen slot len z51 |
| 2783 | ret false |
| 2784 | end |
| 2785 | for i ulong len z51 |
| 2786 | if ne get wfld add mul slot 128 i get z51 i |
| 2787 | ret false |
| 2788 | end |
| 2789 | end |
| 2790 | ret true |
| 2791 | end |
| 2792 | |
| 2793 | fn woc57 to void |
| 2794 | put wolen 0 len z52 |
| 2795 | for i ulong len z52 |
| 2796 | put wobs i get z52 i |
| 2797 | end |
| 2798 | end |
| 2799 | |
| 2800 | fn weventc58 mode ulong to bool |
| 2801 | wz |
| 2802 | wtc107 |
| 2803 | wtc110 |
| 2804 | wtc109 |
| 2805 | wj mode |
| 2806 | wtc28 |
| 2807 | ret wemit |
| 2808 | end |
| 2809 | |
| 2810 | fn weventc59 mode ulong to bool |
| 2811 | wz |
| 2812 | wtc107 |
| 2813 | wtc111 |
| 2814 | wtc109 |
| 2815 | wj mode |
| 2816 | wtc28 |
| 2817 | ret wemit |
| 2818 | end |
| 2819 | |
| 2820 | fn wfinishc60 ok bool to void |
| 2821 | wz |
| 2822 | wtc112 |
| 2823 | if ok |
| 2824 | wtc113 |
| 2825 | else |
| 2826 | wtc114 |
| 2827 | end |
| 2828 | wtc115 |
| 2829 | wtc116 |
| 2830 | wtc117 |
| 2831 | wj 1 |
| 2832 | wtc28 |
| 2833 | r = wemit |
| 2834 | r = streamend |
| 2835 | end |
| 2836 | |
| 2837 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2838 | |
| 2839 | fn weventc61 mode ulong to bool |
| 2840 | wz |
| 2841 | wtc107 |
| 2842 | wtc118 |
| 2843 | wtc109 |
| 2844 | wj mode |
| 2845 | wtc28 |
| 2846 | ret wemit |
| 2847 | end |
| 2848 | |
| 2849 | fn wanswerc62 to bool |
| 2850 | if ne get walen 0 len z29 |
| 2851 | ret false |
| 2852 | end |
| 2853 | for i ulong len z29 |
| 2854 | if ne get wans i get z29 i |
| 2855 | ret false |
| 2856 | end |
| 2857 | end |
| 2858 | ret true |
| 2859 | end |
| 2860 | |
| 2861 | fn wfinishc63 ok bool to void |
| 2862 | wz |
| 2863 | wtc112 |
| 2864 | if ok |
| 2865 | wtc113 |
| 2866 | else |
| 2867 | wtc114 |
| 2868 | end |
| 2869 | wtc115 |
| 2870 | wtc119 |
| 2871 | wtc117 |
| 2872 | wj 1 |
| 2873 | wtc28 |
| 2874 | r = wemit |
| 2875 | r = streamend |
| 2876 | end |
| 2877 | |
| 2878 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2879 | |
| 2880 | fn wfinishc64 ok bool to void |
| 2881 | wz |
| 2882 | wtc112 |
| 2883 | if ok |
| 2884 | wtc113 |
| 2885 | else |
| 2886 | wtc114 |
| 2887 | end |
| 2888 | wtc115 |
| 2889 | wtc120 |
| 2890 | wtc117 |
| 2891 | wj 1 |
| 2892 | wtc28 |
| 2893 | r = wemit |
| 2894 | r = streamend |
| 2895 | end |
| 2896 | |
| 2897 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2898 | |
| 2899 | fn wanswerc65 to bool |
| 2900 | if ne get walen 0 len z48 |
| 2901 | ret false |
| 2902 | end |
| 2903 | for i ulong len z48 |
| 2904 | if ne get wans i get z48 i |
| 2905 | ret false |
| 2906 | end |
| 2907 | end |
| 2908 | ret true |
| 2909 | end |
| 2910 | |
| 2911 | fn wfinishc66 ok bool to void |
| 2912 | wz |
| 2913 | wtc112 |
| 2914 | if ok |
| 2915 | wtc113 |
| 2916 | else |
| 2917 | wtc114 |
| 2918 | end |
| 2919 | wtc115 |
| 2920 | wtc121 |
| 2921 | wtc117 |
| 2922 | wj 1 |
| 2923 | wtc28 |
| 2924 | r = wemit |
| 2925 | r = streamend |
| 2926 | end |
| 2927 | |
| 2928 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2929 | |
| 2930 | fn wfinishc67 ok bool to void |
| 2931 | wz |
| 2932 | wtc112 |
| 2933 | if ok |
| 2934 | wtc113 |
| 2935 | else |
| 2936 | wtc114 |
| 2937 | end |
| 2938 | wtc115 |
| 2939 | wtc122 |
| 2940 | wtc117 |
| 2941 | wj 1 |
| 2942 | wtc28 |
| 2943 | r = wemit |
| 2944 | r = streamend |
| 2945 | end |
| 2946 | |
| 2947 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2948 | |
| 2949 | fn wfinishc68 ok bool to void |
| 2950 | wz |
| 2951 | wtc112 |
| 2952 | if ok |
| 2953 | wtc113 |
| 2954 | else |
| 2955 | wtc114 |
| 2956 | end |
| 2957 | wtc115 |
| 2958 | wtc123 |
| 2959 | wtc117 |
| 2960 | wj 1 |
| 2961 | wtc28 |
| 2962 | r = wemit |
| 2963 | r = streamend |
| 2964 | end |
| 2965 | |
| 2966 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2967 | |
| 2968 | fn wfinishc69 ok bool to void |
| 2969 | wz |
| 2970 | wtc112 |
| 2971 | if ok |
| 2972 | wtc113 |
| 2973 | else |
| 2974 | wtc114 |
| 2975 | end |
| 2976 | wtc115 |
| 2977 | wtc124 |
| 2978 | wtc117 |
| 2979 | wj 1 |
| 2980 | wtc28 |
| 2981 | r = wemit |
| 2982 | r = streamend |
| 2983 | end |
| 2984 | |
| 2985 | note Match exact, host-free line grammar before the compiler is invoked. |
| 2986 | |
| 2987 | fn wfinishc70 ok bool to void |
| 2988 | wz |
| 2989 | wtc112 |
| 2990 | if ok |
| 2991 | wtc113 |
| 2992 | else |
| 2993 | wtc114 |
| 2994 | end |
| 2995 | wtc115 |
| 2996 | wtc125 |
| 2997 | wtc117 |
| 2998 | wj 1 |
| 2999 | wtc28 |
| 3000 | r = wemit |
| 3001 | r = streamend |
| 3002 | end |
| 3003 | |
| 3004 | note Match exact, host-free line grammar before the compiler is invoked. |
| 3005 | |
| 3006 | fn wfinishc71 ok bool to void |
| 3007 | wz |
| 3008 | wtc112 |
| 3009 | if ok |
| 3010 | wtc113 |
| 3011 | else |
| 3012 | wtc114 |
| 3013 | end |
| 3014 | wtc115 |
| 3015 | wtc126 |
| 3016 | wtc117 |
| 3017 | wj 1 |
| 3018 | wtc28 |
| 3019 | r = wemit |
| 3020 | r = streamend |
| 3021 | end |
| 3022 | |
| 3023 | note Match exact, host-free line grammar before the compiler is invoked. |
| 3024 | |
| 3025 | fn wfinishc72 ok bool to void |
| 3026 | wz |
| 3027 | wtc112 |
| 3028 | if ok |
| 3029 | wtc113 |
| 3030 | else |
| 3031 | wtc114 |
| 3032 | end |
| 3033 | wtc115 |
| 3034 | wtc127 |
| 3035 | wtc117 |
| 3036 | wj 1 |
| 3037 | wtc28 |
| 3038 | r = wemit |
| 3039 | r = streamend |
| 3040 | end |
| 3041 | |
| 3042 | note Match exact, host-free line grammar before the compiler is invoked. |
| 3043 | |
| 3044 | fn wtc73 to void |
| 3045 | for i ulong len z66 |
| 3046 | wb get z66 i |
| 3047 | end |
| 3048 | end |
| 3049 | |
| 3050 | fn wtc74 to void |
| 3051 | for i ulong len z67 |
| 3052 | wb get z67 i |
| 3053 | end |
| 3054 | end |
| 3055 | |
| 3056 | fn wtc75 to void |
| 3057 | for i ulong len z68 |
| 3058 | wb get z68 i |
| 3059 | end |
| 3060 | end |
| 3061 | |
| 3062 | fn wtc76 to void |
| 3063 | for i ulong len z69 |
| 3064 | wb get z69 i |
| 3065 | end |
| 3066 | end |
| 3067 | |
| 3068 | fn wtc77 to void |
| 3069 | for i ulong len z70 |
| 3070 | wb get z70 i |
| 3071 | end |
| 3072 | end |
| 3073 | |
| 3074 | fn wtc78 to void |
| 3075 | for i ulong len z71 |
| 3076 | wb get z71 i |
| 3077 | end |
| 3078 | end |
| 3079 | |
| 3080 | fn wtc79 to void |
| 3081 | for i ulong len z72 |
| 3082 | wb get z72 i |
| 3083 | end |
| 3084 | end |
| 3085 | |
| 3086 | fn wtc80 to void |
| 3087 | for i ulong len z73 |
| 3088 | wb get z73 i |
| 3089 | end |
| 3090 | end |
| 3091 | |
| 3092 | fn wtc81 to void |
| 3093 | for i ulong len z74 |
| 3094 | wb get z74 i |
| 3095 | end |
| 3096 | end |
| 3097 | |
| 3098 | fn wtc82 to void |
| 3099 | for i ulong len z75 |
| 3100 | wb get z75 i |
| 3101 | end |
| 3102 | end |
| 3103 | |
| 3104 | fn wtc83 to void |
| 3105 | for i ulong len z76 |
| 3106 | wb get z76 i |
| 3107 | end |
| 3108 | end |
| 3109 | |
| 3110 | fn wtc84 to void |
| 3111 | for i ulong len z77 |
| 3112 | wb get z77 i |
| 3113 | end |
| 3114 | end |
| 3115 | |
| 3116 | fn wtc85 to void |
| 3117 | for i ulong len z78 |
| 3118 | wb get z78 i |
| 3119 | end |
| 3120 | end |
| 3121 | |
| 3122 | fn wtc86 to void |
| 3123 | for i ulong len z79 |
| 3124 | wb get z79 i |
| 3125 | end |
| 3126 | end |
| 3127 | |
| 3128 | fn wtc87 to void |
| 3129 | for i ulong len z80 |
| 3130 | wb get z80 i |
| 3131 | end |
| 3132 | end |
| 3133 | |
| 3134 | fn wtc88 to void |
| 3135 | for i ulong len z81 |
| 3136 | wb get z81 i |
| 3137 | end |
| 3138 | end |
| 3139 | |
| 3140 | fn wtc89 to void |
| 3141 | for i ulong len z82 |
| 3142 | wb get z82 i |
| 3143 | end |
| 3144 | end |
| 3145 | |
| 3146 | fn wtc90 to void |
| 3147 | for i ulong len z83 |
| 3148 | wb get z83 i |
| 3149 | end |
| 3150 | end |
| 3151 | |
| 3152 | fn wtc91 to void |
| 3153 | for i ulong len z84 |
| 3154 | wb get z84 i |
| 3155 | end |
| 3156 | end |
| 3157 | |
| 3158 | fn wtc92 to void |
| 3159 | for i ulong len z85 |
| 3160 | wb get z85 i |
| 3161 | end |
| 3162 | end |
| 3163 | |
| 3164 | fn wtc93 to void |
| 3165 | for i ulong len z86 |
| 3166 | wb get z86 i |
| 3167 | end |
| 3168 | end |
| 3169 | |
| 3170 | fn wtc94 to void |
| 3171 | for i ulong len z87 |
| 3172 | wb get z87 i |
| 3173 | end |
| 3174 | end |
| 3175 | |
| 3176 | fn wtc95 to void |
| 3177 | for i ulong len z88 |
| 3178 | wb get z88 i |
| 3179 | end |
| 3180 | end |
| 3181 | |
| 3182 | fn wtc96 to void |
| 3183 | for i ulong len z89 |
| 3184 | wb get z89 i |
| 3185 | end |
| 3186 | end |
| 3187 | |
| 3188 | fn wtc97 to void |
| 3189 | for i ulong len z90 |
| 3190 | wb get z90 i |
| 3191 | end |
| 3192 | end |
| 3193 | |
| 3194 | fn wmc98 at ulong to bool |
| 3195 | if gt add at len z0 get wslen 0 |
| 3196 | ret false |
| 3197 | end |
| 3198 | for i ulong len z0 |
| 3199 | if ne get wsrc add at i get z0 i |
| 3200 | ret false |
| 3201 | end |
| 3202 | end |
| 3203 | ret true |
| 3204 | end |
| 3205 | |
| 3206 | fn wmc99 at ulong to bool |
| 3207 | if gt add at len z2 get wslen 0 |
| 3208 | ret false |
| 3209 | end |
| 3210 | for i ulong len z2 |
| 3211 | if ne get wsrc add at i get z2 i |
| 3212 | ret false |
| 3213 | end |
| 3214 | end |
| 3215 | ret true |
| 3216 | end |
| 3217 | |
| 3218 | fn wmc100 at ulong to bool |
| 3219 | if gt add at len z5 get wslen 0 |
| 3220 | ret false |
| 3221 | end |
| 3222 | for i ulong len z5 |
| 3223 | if ne get wsrc add at i get z5 i |
| 3224 | ret false |
| 3225 | end |
| 3226 | end |
| 3227 | ret true |
| 3228 | end |
| 3229 | |
| 3230 | fn wmc101 at ulong to bool |
| 3231 | if gt add at len z6 get wslen 0 |
| 3232 | ret false |
| 3233 | end |
| 3234 | for i ulong len z6 |
| 3235 | if ne get wsrc add at i get z6 i |
| 3236 | ret false |
| 3237 | end |
| 3238 | end |
| 3239 | ret true |
| 3240 | end |
| 3241 | |
| 3242 | fn wmc102 at ulong to bool |
| 3243 | if gt add at len z7 get wslen 0 |
| 3244 | ret false |
| 3245 | end |
| 3246 | for i ulong len z7 |
| 3247 | if ne get wsrc add at i get z7 i |
| 3248 | ret false |
| 3249 | end |
| 3250 | end |
| 3251 | ret true |
| 3252 | end |
| 3253 | |
| 3254 | fn wmc103 at ulong to bool |
| 3255 | if gt add at len z10 get wslen 0 |
| 3256 | ret false |
| 3257 | end |
| 3258 | for i ulong len z10 |
| 3259 | if ne get wsrc add at i get z10 i |
| 3260 | ret false |
| 3261 | end |
| 3262 | end |
| 3263 | ret true |
| 3264 | end |
| 3265 | |
| 3266 | fn wmc104 at ulong to bool |
| 3267 | if gt add at len z11 get wslen 0 |
| 3268 | ret false |
| 3269 | end |
| 3270 | for i ulong len z11 |
| 3271 | if ne get wsrc add at i get z11 i |
| 3272 | ret false |
| 3273 | end |
| 3274 | end |
| 3275 | ret true |
| 3276 | end |
| 3277 | |
| 3278 | fn wmc105 at ulong to bool |
| 3279 | if gt add at len z12 get wslen 0 |
| 3280 | ret false |
| 3281 | end |
| 3282 | for i ulong len z12 |
| 3283 | if ne get wsrc add at i get z12 i |
| 3284 | ret false |
| 3285 | end |
| 3286 | end |
| 3287 | ret true |
| 3288 | end |
| 3289 | |
| 3290 | fn wmc106 at ulong to bool |
| 3291 | if gt add at len z13 get wslen 0 |
| 3292 | ret false |
| 3293 | end |
| 3294 | for i ulong len z13 |
| 3295 | if ne get wsrc add at i get z13 i |
| 3296 | ret false |
| 3297 | end |
| 3298 | end |
| 3299 | ret true |
| 3300 | end |
| 3301 | |
| 3302 | fn wtc107 to void |
| 3303 | for i ulong len z91 |
| 3304 | wb get z91 i |
| 3305 | end |
| 3306 | end |
| 3307 | |
| 3308 | fn wtc108 to void |
| 3309 | for i ulong len z50 |
| 3310 | wb get z50 i |
| 3311 | end |
| 3312 | end |
| 3313 | |
| 3314 | fn wtc109 to void |
| 3315 | for i ulong len z92 |
| 3316 | wb get z92 i |
| 3317 | end |
| 3318 | end |
| 3319 | |
| 3320 | fn wtc110 to void |
| 3321 | for i ulong len z53 |
| 3322 | wb get z53 i |
| 3323 | end |
| 3324 | end |
| 3325 | |
| 3326 | fn wtc111 to void |
| 3327 | for i ulong len z54 |
| 3328 | wb get z54 i |
| 3329 | end |
| 3330 | end |
| 3331 | |
| 3332 | fn wtc112 to void |
| 3333 | for i ulong len z93 |
| 3334 | wb get z93 i |
| 3335 | end |
| 3336 | end |
| 3337 | |
| 3338 | fn wtc113 to void |
| 3339 | for i ulong len z94 |
| 3340 | wb get z94 i |
| 3341 | end |
| 3342 | end |
| 3343 | |
| 3344 | fn wtc114 to void |
| 3345 | for i ulong len z95 |
| 3346 | wb get z95 i |
| 3347 | end |
| 3348 | end |
| 3349 | |
| 3350 | fn wtc115 to void |
| 3351 | for i ulong len z96 |
| 3352 | wb get z96 i |
| 3353 | end |
| 3354 | end |
| 3355 | |
| 3356 | fn wtc116 to void |
| 3357 | for i ulong len z55 |
| 3358 | wb get z55 i |
| 3359 | end |
| 3360 | end |
| 3361 | |
| 3362 | fn wtc117 to void |
| 3363 | for i ulong len z97 |
| 3364 | wb get z97 i |
| 3365 | end |
| 3366 | end |
| 3367 | |
| 3368 | fn wtc118 to void |
| 3369 | for i ulong len z56 |
| 3370 | wb get z56 i |
| 3371 | end |
| 3372 | end |
| 3373 | |
| 3374 | fn wtc119 to void |
| 3375 | for i ulong len z57 |
| 3376 | wb get z57 i |
| 3377 | end |
| 3378 | end |
| 3379 | |
| 3380 | fn wtc120 to void |
| 3381 | for i ulong len z58 |
| 3382 | wb get z58 i |
| 3383 | end |
| 3384 | end |
| 3385 | |
| 3386 | fn wtc121 to void |
| 3387 | for i ulong len z59 |
| 3388 | wb get z59 i |
| 3389 | end |
| 3390 | end |
| 3391 | |
| 3392 | fn wtc122 to void |
| 3393 | for i ulong len z60 |
| 3394 | wb get z60 i |
| 3395 | end |
| 3396 | end |
| 3397 | |
| 3398 | fn wtc123 to void |
| 3399 | for i ulong len z61 |
| 3400 | wb get z61 i |
| 3401 | end |
| 3402 | end |
| 3403 | |
| 3404 | fn wtc124 to void |
| 3405 | for i ulong len z62 |
| 3406 | wb get z62 i |
| 3407 | end |
| 3408 | end |
| 3409 | |
| 3410 | fn wtc125 to void |
| 3411 | for i ulong len z63 |
| 3412 | wb get z63 i |
| 3413 | end |
| 3414 | end |
| 3415 | |
| 3416 | fn wtc126 to void |
| 3417 | for i ulong len z64 |
| 3418 | wb get z64 i |
| 3419 | end |
| 3420 | end |
| 3421 | |
| 3422 | fn wtc127 to void |
| 3423 | for i ulong len z65 |
| 3424 | wb get z65 i |
| 3425 | end |
| 3426 | end |