static class RemoteDB { DialogIO db; *(S botName) { if (isSnippetID(botName)) botName += " Concepts."; db = findBot(botName); } bool functional() { ret db != null; } L list() { ret (L) rpc(db, "xlist"); } L list(S className) { ret (L) rpc(db, "xlist", className); } L xlist() { ret list(); } L xlist(S className) { ret list(className); } S xclass(RC o) { ret (S) rpc(db, "xclass", o); } O xget(RC o, S field) { ret rpc(db, "xget", o, field); } S xS(RC o, S field) { ret (S) xget(o, field); } RC xgetref(RC o, S field) { ret (RC) xget(o, field); } void xset(RC o, S field, O value) { rpc(db, "xset", o, field, value); } RC uniq(S className) { RC ref = first(list(className)); if (ref == null) ref = xnew(className); ret ref; } RC xuniq(S className) { ret uniq(className); } RC xnew(S className, O... values) { ret (RC) rpc(db, "xnew", className, values); } void xdelete(RC o) { rpc(db, "xdelete", o); } void xdelete(L l) { rpc(db, "xdelete", l); } void close() { if (db != null) db.close(); } S fullgrab() { ret (S) rpc(db, "xfullgrab"); } S xfullgrab() { ret fullgrab(); } }