Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: list.mjs shows .lisp pieces in purple "lisp" section

system.listPieces() now scans for both .mjs and .lisp files.
Lisp pieces appear with full extension so UI can distinguish them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+26 -4
+16 -2
fedac/native/pieces/list.mjs
··· 39 39 40 40 // Populated in boot — pieces not in MAIN or TOOLS 41 41 let UNSTABLE = []; 42 + let LISP_PIECES = []; 42 43 43 44 function boot({ system }) { 44 45 var known = {}; ··· 47 48 var skip = { prompt: 1, lisp: 1, cc: 1, "404": 1, error: 1 }; 48 49 var names = (system && system.listPieces ? system.listPieces() : []); 49 50 UNSTABLE = []; 51 + LISP_PIECES = []; 50 52 for (var i = 0; i < names.length; i++) { 51 - if (!known[names[i]] && !skip[names[i]]) { 52 - UNSTABLE.push({ name: names[i] }); 53 + var n = names[i]; 54 + // .lisp pieces go in their own section 55 + if (n.endsWith && n.endsWith(".lisp")) { 56 + LISP_PIECES.push({ name: n.replace(".lisp", ""), desc: "common lisp" }); 57 + } else if (!known[n] && !skip[n]) { 58 + UNSTABLE.push({ name: n }); 53 59 } 54 60 } 55 61 UNSTABLE.sort(function(a, b) { return a.name < b.name ? -1 : 1; }); 62 + LISP_PIECES.sort(function(a, b) { return a.name < b.name ? -1 : 1; }); 56 63 } 57 64 58 65 function act({ event: e, system }) { ··· 140 147 section("tools", TOOLS, T.link, [T.fg - 10, T.fg, T.fg + 15], true); 141 148 section("commands", COMMANDS, [T.fgDim, T.fgDim + 20, T.fgDim], [T.fgDim + 30, T.fgDim + 30, T.fgDim + 40], true); 142 149 section("$codes", CODES, T.warn, T.warn, true); 150 + 151 + if (LISP_PIECES.length > 0) { 152 + section("lisp (" + LISP_PIECES.length + ")", LISP_PIECES, 153 + [180, 120, 220], 154 + [200, 150, 240], 155 + true); 156 + } 143 157 144 158 if (UNSTABLE.length > 0) { 145 159 section("unstable (" + UNSTABLE.length + ")", UNSTABLE,
+10 -2
fedac/native/src/js-bindings.c
··· 3663 3663 return JS_TRUE; 3664 3664 } 3665 3665 3666 - // system.listPieces() — scan /pieces/*.mjs, return array of piece names 3666 + // system.listPieces() — scan /pieces/*.mjs and /pieces/*.lisp, return array of piece names 3667 3667 static JSValue js_list_pieces(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { 3668 3668 (void)this_val; (void)argc; (void)argv; 3669 3669 JSValue arr = JS_NewArray(ctx); ··· 3672 3672 struct dirent *ent; 3673 3673 uint32_t idx = 0; 3674 3674 while ((ent = readdir(d)) != NULL) { 3675 + if (ent->d_name[0] == '.') continue; 3676 + // Check for .mjs 3675 3677 char *dot = strstr(ent->d_name, ".mjs"); 3676 - if (dot && dot[4] == '\0' && ent->d_name[0] != '.') { 3678 + if (dot && dot[4] == '\0') { 3677 3679 char name[64]; 3678 3680 int len = (int)(dot - ent->d_name); 3679 3681 if (len > 63) len = 63; 3680 3682 memcpy(name, ent->d_name, len); 3681 3683 name[len] = '\0'; 3682 3684 JS_SetPropertyUint32(ctx, arr, idx++, JS_NewString(ctx, name)); 3685 + continue; 3686 + } 3687 + // Check for .lisp — include extension so list.mjs can distinguish 3688 + dot = strstr(ent->d_name, ".lisp"); 3689 + if (dot && dot[5] == '\0') { 3690 + JS_SetPropertyUint32(ctx, arr, idx++, JS_NewString(ctx, ent->d_name)); 3683 3691 } 3684 3692 } 3685 3693 closedir(d);