Extend ext/agent with skill match/assign and multi-column tables.

Compose ext/llm, add ABI match_skill/bump_load, map-valued GFM tables, and agent-assign gold coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-06 13:46:34 +08:00
1 parent 3a7e11c995
commit c4ffb9473f
15 files changed
+476 -31

No files matched your search

+8
View File
@@ -792,6 +792,14 @@ impl<'a> FnCompiler<'a> {
}
self.emit(Op::BuildList(items.len() as u16));
}
Expr::Map(pairs) => {
for (k, e) in pairs {
let ki = self.add_const(Value::Text(k.clone()));
self.emit(Op::Constant(ki));
self.compile_expr(e)?;
}
self.emit(Op::BuildMap(pairs.len() as u16));
}
Expr::Formula(e) => {
let i = self.add_const(Value::Formula(e.clone()));
self.emit(Op::Constant(i));
+2
View File
@@ -37,6 +37,8 @@ pub enum Op {
/// Pop prompt text, print it (no newline), read one stdin line → push Text.
Input,
BuildList(u16),
/// Stack (bottom→top): k0, v0, k1, v1, … (n pairs); push Map.
BuildMap(u16),
/// Pop value → push `len` (text/list).
Len,
/// Pop value → push display text.
+17
View File
@@ -253,6 +253,23 @@ impl Vm {
items.reverse();
stack.push(Value::List(items));
}
Op::BuildMap(n) => {
let n = n as usize;
let mut pairs = Vec::with_capacity(n);
for _ in 0..n {
let v = pop(&mut stack).map_err(|m| self.err_at(span, m))?;
let k = pop(&mut stack).map_err(|m| self.err_at(span, m))?;
let ks = match k {
Value::Text(s) => s,
_ => {
return Err(self.err_at(span, "map key must be text"));
}
};
pairs.push((ks, v));
}
pairs.reverse();
stack.push(Value::Map(pairs));
}
Op::Len => {
let v = pop(&mut stack).map_err(|m| self.err_at(span, m))?;
let n = builtin_len(&v).map_err(|m| self.err_at(span, m))?;