@icjhd/cj-script-runtime
v2.0.0
Published
技能脚本二进制读取、校验与反汇编运行时
Readme
@icjhd/cj-script-runtime
技能脚本二进制运行时核心。
当前第一轮包含:
EFPBHeader / Section Directory 读取STR0/PRG0/ENT0/ACT0/COD0section 解析- CRC32 校验
- 最小
CALL_OP/CALL_GROUPaction slot /RETURN指令校验 - 反汇编和 inspect 摘要
该包不包含脚本 Parser、TypeScript 编译器、eval 或 new Function。
2026-06-25 P3 minimal Expression VM update
XPR0now stores expression program metadata andXCD0stores 16-byte expression instructions.- Added
FXC0-backedPUSH_FX_CONST+RETURN_FXevaluation for chance expressions. - Added fixed-stack
evalFxExpression/evalBoolExpressionruntime helpers.
2026-06-25 P3 context Expression VM update
- Added
LOAD_CONTEXT_FXexpression opcode forcaster/target/constFX reads. evalFxExpression/evalBoolExpressionnow accept an optional host callback for context values.- Expressions containing context reads are kept dynamic and are not folded into
constantFxScaled.
2026-06-25 P3 formula function opcode update
- Added
MIN_FX,MAX_FX, andCLAMP_FXexpression opcodes. - Runtime validation checks fixed-stack input types for binary and ternary FX function opcodes.
- Runtime evaluation mirrors
cj-formula-fxstack order forclamp(x, lo, hi).
2026-06-25 P3 rounding function opcode update
- Added
MOD_FX,ABS_FX,FLOOR_FX,CEIL_FX, andROUND_FXexpression opcodes. - Rounding opcodes use integer fixed-point arithmetic and preserve the existing
Decimal.round()half rule. sqrt,pow, andrandare still intentionally outside the expression VM slice.
2026-06-25 P3 bool comparison update
- Added FX comparison opcodes
EQ_FX,NE_FX,LT_FX,LTE_FX,GT_FX, andGTE_FX. JUMP_IF_FALSEnow validates and disassembles a BOOL expression id plus forward target.evalBoolExpressioncan execute comparison expressions with the same context host used by FX expressions.
2026-06-25 P2 ABI skeleton update
COD0instruction records now use the plan-aligned 16-byte shape:opcode/a/b/cas four little-endianu32values.- Required section skeletons are present:
FXC0,XCD0,SEL0,L1C0,L2D0,L3E0,L4G0,DSP0,LIM0. - Reserved L1/L2/L3/L4/DSP/LIM sections are currently validated as empty count sections until their record writers are implemented.
2026-06-25 binary update
- Added
XPR0section parsing for const-ppm probability expressions. - Added
ROLL_JUMP_IF_FALSEopcode validation and disassembly. - Current section order is
STR0/PRG0/ENT0/ACT0/XPR0/COD0.
