@elaraai/east-codex-plugin 1.0.105 → 1.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build/daemon/lsp.js +166 -10
- package/.build/daemon/server.js +166 -10
- package/.codex-plugin/plugin.json +1 -1
- package/index.json +114 -2
- package/package.json +1 -1
- package/skills/e3/SKILL.md +3 -1
- package/skills/east/SKILL.md +2 -0
package/.build/daemon/lsp.js
CHANGED
|
@@ -1065,9 +1065,9 @@ function plainLiteralInitializer(decl, t) {
|
|
|
1065
1065
|
const init2 = decl.initializer;
|
|
1066
1066
|
if (init2 === void 0)
|
|
1067
1067
|
return void 0;
|
|
1068
|
-
const
|
|
1069
|
-
if (t.isArrayLiteralExpression(
|
|
1070
|
-
return
|
|
1068
|
+
const unwrapped2 = t.isAsExpression(init2) || t.isSatisfiesExpression(init2) ? init2.expression : init2;
|
|
1069
|
+
if (t.isArrayLiteralExpression(unwrapped2) || t.isObjectLiteralExpression(unwrapped2)) {
|
|
1070
|
+
return unwrapped2;
|
|
1071
1071
|
}
|
|
1072
1072
|
return void 0;
|
|
1073
1073
|
}
|
|
@@ -2282,8 +2282,8 @@ function mentionsEastValueType(node, ctx, seen) {
|
|
|
2282
2282
|
if (node.kind === t.SyntaxKind.AnyKeyword || node.kind === t.SyntaxKind.UnknownKeyword)
|
|
2283
2283
|
return true;
|
|
2284
2284
|
if (t.isTypeReferenceNode(node)) {
|
|
2285
|
-
const
|
|
2286
|
-
const symbol =
|
|
2285
|
+
const named2 = ctx.checker.getSymbolAtLocation(node.typeName);
|
|
2286
|
+
const symbol = named2 !== void 0 && (named2.flags & t.SymbolFlags.Alias) !== 0 ? ctx.checker.getAliasedSymbol(named2) : named2;
|
|
2287
2287
|
const declarations = symbol?.declarations ?? [];
|
|
2288
2288
|
if (declarations.some((d) => declaredByEast(d) || t.isTypeParameterDeclaration(d)))
|
|
2289
2289
|
return true;
|
|
@@ -2999,6 +2999,152 @@ var noJsCollectionForEastCollection = {
|
|
|
2999
2999
|
}
|
|
3000
3000
|
};
|
|
3001
3001
|
|
|
3002
|
+
// ../east-diagnostics/dist/src/rules/no-struct-type-from-object.js
|
|
3003
|
+
var NAME32 = "no-struct-type-from-object";
|
|
3004
|
+
var CODE32 = 990037;
|
|
3005
|
+
function isArrayIndex(name) {
|
|
3006
|
+
return /^(?:0|[1-9][0-9]{0,9})$/.test(name) && Number(name) <= 4294967294;
|
|
3007
|
+
}
|
|
3008
|
+
function isStructTypeCall(call, ctx) {
|
|
3009
|
+
const t = ctx.ts;
|
|
3010
|
+
const callee = call.expression;
|
|
3011
|
+
if (t.isIdentifier(callee)) {
|
|
3012
|
+
return resolvesToEastImport(callee, ctx.checker, t) && importedNameOf(callee, ctx.checker, t) === "StructType";
|
|
3013
|
+
}
|
|
3014
|
+
return t.isPropertyAccessExpression(callee) && callee.name.text === "StructType" && t.isIdentifier(callee.expression) && resolvesToEastImport(callee.expression, ctx.checker, t);
|
|
3015
|
+
}
|
|
3016
|
+
function unwrapped(e, t) {
|
|
3017
|
+
while (t.isParenthesizedExpression(e) || t.isAsExpression(e) || t.isSatisfiesExpression(e) || t.isNonNullExpression(e) || t.isTypeAssertionExpression(e))
|
|
3018
|
+
e = e.expression;
|
|
3019
|
+
return e;
|
|
3020
|
+
}
|
|
3021
|
+
function isList(type, ctx) {
|
|
3022
|
+
const constraint = type.isTypeParameter() ? ctx.checker.getBaseConstraintOfType(type) : type;
|
|
3023
|
+
return constraint !== void 0 && (ctx.checker.isArrayType(constraint) || ctx.checker.isTupleType(constraint));
|
|
3024
|
+
}
|
|
3025
|
+
var ORDERED = { kind: "ordered" };
|
|
3026
|
+
var RUNTIME = { kind: "object" };
|
|
3027
|
+
function named(names) {
|
|
3028
|
+
const index = names.find(isArrayIndex);
|
|
3029
|
+
return index === void 0 ? ORDERED : { kind: "index", name: index };
|
|
3030
|
+
}
|
|
3031
|
+
function literalNames(type) {
|
|
3032
|
+
const names = [];
|
|
3033
|
+
for (const member of type.isUnion() ? type.types : [type]) {
|
|
3034
|
+
if (member.isStringLiteral())
|
|
3035
|
+
names.push(member.value);
|
|
3036
|
+
else if (member.isNumberLiteral())
|
|
3037
|
+
names.push(String(member.value));
|
|
3038
|
+
else
|
|
3039
|
+
return void 0;
|
|
3040
|
+
}
|
|
3041
|
+
return names;
|
|
3042
|
+
}
|
|
3043
|
+
function memberOf(member, ctx) {
|
|
3044
|
+
const t = ctx.ts;
|
|
3045
|
+
if (t.isSpreadAssignment(member))
|
|
3046
|
+
return fieldsOf(member.expression, ctx);
|
|
3047
|
+
const n = member.name;
|
|
3048
|
+
if (t.isIdentifier(n) || t.isStringLiteral(n) || t.isNumericLiteral(n) || t.isNoSubstitutionTemplateLiteral(n))
|
|
3049
|
+
return named([n.text]);
|
|
3050
|
+
if (t.isComputedPropertyName(n)) {
|
|
3051
|
+
const names = literalNames(ctx.checker.getTypeAtLocation(n.expression));
|
|
3052
|
+
return names === void 0 ? RUNTIME : named(names);
|
|
3053
|
+
}
|
|
3054
|
+
return RUNTIME;
|
|
3055
|
+
}
|
|
3056
|
+
function fieldsOfType(type, ctx) {
|
|
3057
|
+
for (const member of type.isUnion() ? type.types : [type]) {
|
|
3058
|
+
const constraint = member.isTypeParameter() ? ctx.checker.getBaseConstraintOfType(member) : member;
|
|
3059
|
+
if (constraint === void 0 || ctx.checker.getIndexInfosOfType(constraint).length > 0)
|
|
3060
|
+
return RUNTIME;
|
|
3061
|
+
const fields = named(ctx.checker.getPropertiesOfType(constraint).map((p) => p.getName()));
|
|
3062
|
+
if (fields.kind !== "ordered")
|
|
3063
|
+
return fields;
|
|
3064
|
+
}
|
|
3065
|
+
return ORDERED;
|
|
3066
|
+
}
|
|
3067
|
+
function fieldsOf(arg, ctx) {
|
|
3068
|
+
const t = ctx.ts;
|
|
3069
|
+
const e = unwrapped(arg, t);
|
|
3070
|
+
if (t.isArrayLiteralExpression(e))
|
|
3071
|
+
return ORDERED;
|
|
3072
|
+
if (t.isObjectLiteralExpression(e)) {
|
|
3073
|
+
let fields = ORDERED;
|
|
3074
|
+
for (const member of e.properties) {
|
|
3075
|
+
const part = memberOf(member, ctx);
|
|
3076
|
+
if (part.kind === "index")
|
|
3077
|
+
return part;
|
|
3078
|
+
if (part.kind === "object")
|
|
3079
|
+
fields = part;
|
|
3080
|
+
}
|
|
3081
|
+
return fields;
|
|
3082
|
+
}
|
|
3083
|
+
const type = ctx.checker.getTypeAtLocation(e);
|
|
3084
|
+
if ((type.flags & (t.TypeFlags.Any | t.TypeFlags.Unknown)) !== 0)
|
|
3085
|
+
return ORDERED;
|
|
3086
|
+
if (isList(type, ctx))
|
|
3087
|
+
return ORDERED;
|
|
3088
|
+
return fieldsOfType(type, ctx);
|
|
3089
|
+
}
|
|
3090
|
+
function entriesFix(arg, ctx) {
|
|
3091
|
+
const t = ctx.ts;
|
|
3092
|
+
const e = unwrapped(arg, t);
|
|
3093
|
+
if (!t.isCallExpression(e) || e.arguments.length !== 1)
|
|
3094
|
+
return void 0;
|
|
3095
|
+
const callee = e.expression;
|
|
3096
|
+
if (!t.isPropertyAccessExpression(callee) || callee.name.text !== "fromEntries" || !t.isIdentifier(callee.expression) || callee.expression.text !== "Object")
|
|
3097
|
+
return void 0;
|
|
3098
|
+
const entries = e.arguments[0];
|
|
3099
|
+
if (!isList(ctx.checker.getTypeAtLocation(entries), ctx))
|
|
3100
|
+
return void 0;
|
|
3101
|
+
const sf = ctx.sourceFile;
|
|
3102
|
+
const start = arg.getStart(sf);
|
|
3103
|
+
return {
|
|
3104
|
+
description: "Pass the entries as the field list",
|
|
3105
|
+
changes: [{ start, length: arg.getEnd() - start, newText: entries.getText(sf) }]
|
|
3106
|
+
};
|
|
3107
|
+
}
|
|
3108
|
+
var noStructTypeFromObject = {
|
|
3109
|
+
name: NAME32,
|
|
3110
|
+
code: CODE32,
|
|
3111
|
+
description: "Flag StructType given an object whose fields are known only at run time, or naming a field like an integer \u2014 declare the fields as a list, StructType([[name, type], \u2026]), which keeps their order.",
|
|
3112
|
+
check(node, ctx) {
|
|
3113
|
+
const t = ctx.ts;
|
|
3114
|
+
if (!t.isCallExpression(node) || node.arguments.length !== 1)
|
|
3115
|
+
return;
|
|
3116
|
+
if (!isStructTypeCall(node, ctx))
|
|
3117
|
+
return;
|
|
3118
|
+
const arg = node.arguments[0];
|
|
3119
|
+
const fields = fieldsOf(arg, ctx);
|
|
3120
|
+
if (fields.kind === "ordered")
|
|
3121
|
+
return;
|
|
3122
|
+
const sf = ctx.sourceFile;
|
|
3123
|
+
const start = arg.getStart(sf);
|
|
3124
|
+
if (fields.kind === "index") {
|
|
3125
|
+
ctx.report({
|
|
3126
|
+
ruleName: NAME32,
|
|
3127
|
+
code: CODE32,
|
|
3128
|
+
start,
|
|
3129
|
+
length: arg.getEnd() - start,
|
|
3130
|
+
messageText: `\`StructType\` names a field "${fields.name}", like an integer: an object lists such a name before every other, wherever it is written, so \`StructType\` refuses it. Declare the fields as a list, in their order: \`StructType([[name, type], \u2026])\`.`,
|
|
3131
|
+
category: "error"
|
|
3132
|
+
});
|
|
3133
|
+
return;
|
|
3134
|
+
}
|
|
3135
|
+
const fix = entriesFix(arg, ctx);
|
|
3136
|
+
ctx.report({
|
|
3137
|
+
ruleName: NAME32,
|
|
3138
|
+
code: CODE32,
|
|
3139
|
+
start,
|
|
3140
|
+
length: arg.getEnd() - start,
|
|
3141
|
+
messageText: '`StructType` is given an object whose fields are known only at run time: an object lists a name like an integer ("2024") before every other, so it cannot keep such a field in its place, and `StructType` refuses one. Pass the fields as a list, in their order \u2014 `StructType(entries)`, `StructType(Object.entries(type.fields).map(\u2026))` \u2014 which keeps any.',
|
|
3142
|
+
category: "warning",
|
|
3143
|
+
...fix === void 0 ? {} : { fix }
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3002
3148
|
// ../east-diagnostics/dist/src/rules/index.js
|
|
3003
3149
|
var allRules = [
|
|
3004
3150
|
// East-side idiom hygiene (original set)
|
|
@@ -3040,7 +3186,10 @@ var allRules = [
|
|
|
3040
3186
|
noHostPrintOfEastValues,
|
|
3041
3187
|
noHostParseToEastValues,
|
|
3042
3188
|
noJsTypeDispatchOnEastValues,
|
|
3043
|
-
noJsCollectionForEastCollection
|
|
3189
|
+
noJsCollectionForEastCollection,
|
|
3190
|
+
// a struct's fields in their order, whatever their names (#1574): never an
|
|
3191
|
+
// object built at run time
|
|
3192
|
+
noStructTypeFromObject
|
|
3044
3193
|
];
|
|
3045
3194
|
|
|
3046
3195
|
// ../east-diagnostics/dist/src/run.js
|
|
@@ -3090,6 +3239,13 @@ function validate(candidate) {
|
|
|
3090
3239
|
return null;
|
|
3091
3240
|
if (mod["IntegerType"] === void 0)
|
|
3092
3241
|
return null;
|
|
3242
|
+
try {
|
|
3243
|
+
const listed = mod["StructType"]([["a", mod["IntegerType"]]]);
|
|
3244
|
+
if (Object.keys(listed.fields ?? {})[0] !== "a")
|
|
3245
|
+
return null;
|
|
3246
|
+
} catch {
|
|
3247
|
+
return null;
|
|
3248
|
+
}
|
|
3093
3249
|
return mod;
|
|
3094
3250
|
}
|
|
3095
3251
|
function getEastModule(projectDir) {
|
|
@@ -3201,12 +3357,12 @@ function reifyEncoding(ctx, type, tag) {
|
|
|
3201
3357
|
}
|
|
3202
3358
|
case "Struct": {
|
|
3203
3359
|
const fieldsType = propType(ctx, type, "fields") ?? bail();
|
|
3204
|
-
const fields =
|
|
3360
|
+
const fields = [];
|
|
3205
3361
|
for (const prop of checker.getPropertiesOfType(fieldsType)) {
|
|
3206
3362
|
const name = prop.getName();
|
|
3207
3363
|
if (name.startsWith("__@"))
|
|
3208
3364
|
continue;
|
|
3209
|
-
fields[name
|
|
3365
|
+
fields.push([name, reifyUnion(ctx, stripAbsent(ctx, checker.getTypeOfSymbol(prop)))]);
|
|
3210
3366
|
}
|
|
3211
3367
|
return east.StructType(fields);
|
|
3212
3368
|
}
|
|
@@ -3315,12 +3471,12 @@ function reifyRawValue(ctx, type) {
|
|
|
3315
3471
|
const props = checker.getPropertiesOfType(type);
|
|
3316
3472
|
if (props.length === 0)
|
|
3317
3473
|
bail();
|
|
3318
|
-
const fields =
|
|
3474
|
+
const fields = [];
|
|
3319
3475
|
for (const prop of props) {
|
|
3320
3476
|
const propName = prop.getName();
|
|
3321
3477
|
if (propName.startsWith("__@"))
|
|
3322
3478
|
continue;
|
|
3323
|
-
fields[propName
|
|
3479
|
+
fields.push([propName, reifyUnion(ctx, stripAbsent(ctx, checker.getTypeOfSymbol(prop)))]);
|
|
3324
3480
|
}
|
|
3325
3481
|
return east.StructType(fields);
|
|
3326
3482
|
}
|
package/.build/daemon/server.js
CHANGED
|
@@ -1069,9 +1069,9 @@ function plainLiteralInitializer(decl, t) {
|
|
|
1069
1069
|
const init2 = decl.initializer;
|
|
1070
1070
|
if (init2 === void 0)
|
|
1071
1071
|
return void 0;
|
|
1072
|
-
const
|
|
1073
|
-
if (t.isArrayLiteralExpression(
|
|
1074
|
-
return
|
|
1072
|
+
const unwrapped2 = t.isAsExpression(init2) || t.isSatisfiesExpression(init2) ? init2.expression : init2;
|
|
1073
|
+
if (t.isArrayLiteralExpression(unwrapped2) || t.isObjectLiteralExpression(unwrapped2)) {
|
|
1074
|
+
return unwrapped2;
|
|
1075
1075
|
}
|
|
1076
1076
|
return void 0;
|
|
1077
1077
|
}
|
|
@@ -2286,8 +2286,8 @@ function mentionsEastValueType(node, ctx, seen) {
|
|
|
2286
2286
|
if (node.kind === t.SyntaxKind.AnyKeyword || node.kind === t.SyntaxKind.UnknownKeyword)
|
|
2287
2287
|
return true;
|
|
2288
2288
|
if (t.isTypeReferenceNode(node)) {
|
|
2289
|
-
const
|
|
2290
|
-
const symbol =
|
|
2289
|
+
const named2 = ctx.checker.getSymbolAtLocation(node.typeName);
|
|
2290
|
+
const symbol = named2 !== void 0 && (named2.flags & t.SymbolFlags.Alias) !== 0 ? ctx.checker.getAliasedSymbol(named2) : named2;
|
|
2291
2291
|
const declarations = symbol?.declarations ?? [];
|
|
2292
2292
|
if (declarations.some((d) => declaredByEast(d) || t.isTypeParameterDeclaration(d)))
|
|
2293
2293
|
return true;
|
|
@@ -3003,6 +3003,152 @@ var noJsCollectionForEastCollection = {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
};
|
|
3005
3005
|
|
|
3006
|
+
// ../east-diagnostics/dist/src/rules/no-struct-type-from-object.js
|
|
3007
|
+
var NAME32 = "no-struct-type-from-object";
|
|
3008
|
+
var CODE32 = 990037;
|
|
3009
|
+
function isArrayIndex(name) {
|
|
3010
|
+
return /^(?:0|[1-9][0-9]{0,9})$/.test(name) && Number(name) <= 4294967294;
|
|
3011
|
+
}
|
|
3012
|
+
function isStructTypeCall(call, ctx) {
|
|
3013
|
+
const t = ctx.ts;
|
|
3014
|
+
const callee = call.expression;
|
|
3015
|
+
if (t.isIdentifier(callee)) {
|
|
3016
|
+
return resolvesToEastImport(callee, ctx.checker, t) && importedNameOf(callee, ctx.checker, t) === "StructType";
|
|
3017
|
+
}
|
|
3018
|
+
return t.isPropertyAccessExpression(callee) && callee.name.text === "StructType" && t.isIdentifier(callee.expression) && resolvesToEastImport(callee.expression, ctx.checker, t);
|
|
3019
|
+
}
|
|
3020
|
+
function unwrapped(e, t) {
|
|
3021
|
+
while (t.isParenthesizedExpression(e) || t.isAsExpression(e) || t.isSatisfiesExpression(e) || t.isNonNullExpression(e) || t.isTypeAssertionExpression(e))
|
|
3022
|
+
e = e.expression;
|
|
3023
|
+
return e;
|
|
3024
|
+
}
|
|
3025
|
+
function isList(type, ctx) {
|
|
3026
|
+
const constraint = type.isTypeParameter() ? ctx.checker.getBaseConstraintOfType(type) : type;
|
|
3027
|
+
return constraint !== void 0 && (ctx.checker.isArrayType(constraint) || ctx.checker.isTupleType(constraint));
|
|
3028
|
+
}
|
|
3029
|
+
var ORDERED = { kind: "ordered" };
|
|
3030
|
+
var RUNTIME = { kind: "object" };
|
|
3031
|
+
function named(names) {
|
|
3032
|
+
const index = names.find(isArrayIndex);
|
|
3033
|
+
return index === void 0 ? ORDERED : { kind: "index", name: index };
|
|
3034
|
+
}
|
|
3035
|
+
function literalNames(type) {
|
|
3036
|
+
const names = [];
|
|
3037
|
+
for (const member of type.isUnion() ? type.types : [type]) {
|
|
3038
|
+
if (member.isStringLiteral())
|
|
3039
|
+
names.push(member.value);
|
|
3040
|
+
else if (member.isNumberLiteral())
|
|
3041
|
+
names.push(String(member.value));
|
|
3042
|
+
else
|
|
3043
|
+
return void 0;
|
|
3044
|
+
}
|
|
3045
|
+
return names;
|
|
3046
|
+
}
|
|
3047
|
+
function memberOf(member, ctx) {
|
|
3048
|
+
const t = ctx.ts;
|
|
3049
|
+
if (t.isSpreadAssignment(member))
|
|
3050
|
+
return fieldsOf(member.expression, ctx);
|
|
3051
|
+
const n = member.name;
|
|
3052
|
+
if (t.isIdentifier(n) || t.isStringLiteral(n) || t.isNumericLiteral(n) || t.isNoSubstitutionTemplateLiteral(n))
|
|
3053
|
+
return named([n.text]);
|
|
3054
|
+
if (t.isComputedPropertyName(n)) {
|
|
3055
|
+
const names = literalNames(ctx.checker.getTypeAtLocation(n.expression));
|
|
3056
|
+
return names === void 0 ? RUNTIME : named(names);
|
|
3057
|
+
}
|
|
3058
|
+
return RUNTIME;
|
|
3059
|
+
}
|
|
3060
|
+
function fieldsOfType(type, ctx) {
|
|
3061
|
+
for (const member of type.isUnion() ? type.types : [type]) {
|
|
3062
|
+
const constraint = member.isTypeParameter() ? ctx.checker.getBaseConstraintOfType(member) : member;
|
|
3063
|
+
if (constraint === void 0 || ctx.checker.getIndexInfosOfType(constraint).length > 0)
|
|
3064
|
+
return RUNTIME;
|
|
3065
|
+
const fields = named(ctx.checker.getPropertiesOfType(constraint).map((p) => p.getName()));
|
|
3066
|
+
if (fields.kind !== "ordered")
|
|
3067
|
+
return fields;
|
|
3068
|
+
}
|
|
3069
|
+
return ORDERED;
|
|
3070
|
+
}
|
|
3071
|
+
function fieldsOf(arg, ctx) {
|
|
3072
|
+
const t = ctx.ts;
|
|
3073
|
+
const e = unwrapped(arg, t);
|
|
3074
|
+
if (t.isArrayLiteralExpression(e))
|
|
3075
|
+
return ORDERED;
|
|
3076
|
+
if (t.isObjectLiteralExpression(e)) {
|
|
3077
|
+
let fields = ORDERED;
|
|
3078
|
+
for (const member of e.properties) {
|
|
3079
|
+
const part = memberOf(member, ctx);
|
|
3080
|
+
if (part.kind === "index")
|
|
3081
|
+
return part;
|
|
3082
|
+
if (part.kind === "object")
|
|
3083
|
+
fields = part;
|
|
3084
|
+
}
|
|
3085
|
+
return fields;
|
|
3086
|
+
}
|
|
3087
|
+
const type = ctx.checker.getTypeAtLocation(e);
|
|
3088
|
+
if ((type.flags & (t.TypeFlags.Any | t.TypeFlags.Unknown)) !== 0)
|
|
3089
|
+
return ORDERED;
|
|
3090
|
+
if (isList(type, ctx))
|
|
3091
|
+
return ORDERED;
|
|
3092
|
+
return fieldsOfType(type, ctx);
|
|
3093
|
+
}
|
|
3094
|
+
function entriesFix(arg, ctx) {
|
|
3095
|
+
const t = ctx.ts;
|
|
3096
|
+
const e = unwrapped(arg, t);
|
|
3097
|
+
if (!t.isCallExpression(e) || e.arguments.length !== 1)
|
|
3098
|
+
return void 0;
|
|
3099
|
+
const callee = e.expression;
|
|
3100
|
+
if (!t.isPropertyAccessExpression(callee) || callee.name.text !== "fromEntries" || !t.isIdentifier(callee.expression) || callee.expression.text !== "Object")
|
|
3101
|
+
return void 0;
|
|
3102
|
+
const entries = e.arguments[0];
|
|
3103
|
+
if (!isList(ctx.checker.getTypeAtLocation(entries), ctx))
|
|
3104
|
+
return void 0;
|
|
3105
|
+
const sf = ctx.sourceFile;
|
|
3106
|
+
const start = arg.getStart(sf);
|
|
3107
|
+
return {
|
|
3108
|
+
description: "Pass the entries as the field list",
|
|
3109
|
+
changes: [{ start, length: arg.getEnd() - start, newText: entries.getText(sf) }]
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3112
|
+
var noStructTypeFromObject = {
|
|
3113
|
+
name: NAME32,
|
|
3114
|
+
code: CODE32,
|
|
3115
|
+
description: "Flag StructType given an object whose fields are known only at run time, or naming a field like an integer \u2014 declare the fields as a list, StructType([[name, type], \u2026]), which keeps their order.",
|
|
3116
|
+
check(node, ctx) {
|
|
3117
|
+
const t = ctx.ts;
|
|
3118
|
+
if (!t.isCallExpression(node) || node.arguments.length !== 1)
|
|
3119
|
+
return;
|
|
3120
|
+
if (!isStructTypeCall(node, ctx))
|
|
3121
|
+
return;
|
|
3122
|
+
const arg = node.arguments[0];
|
|
3123
|
+
const fields = fieldsOf(arg, ctx);
|
|
3124
|
+
if (fields.kind === "ordered")
|
|
3125
|
+
return;
|
|
3126
|
+
const sf = ctx.sourceFile;
|
|
3127
|
+
const start = arg.getStart(sf);
|
|
3128
|
+
if (fields.kind === "index") {
|
|
3129
|
+
ctx.report({
|
|
3130
|
+
ruleName: NAME32,
|
|
3131
|
+
code: CODE32,
|
|
3132
|
+
start,
|
|
3133
|
+
length: arg.getEnd() - start,
|
|
3134
|
+
messageText: `\`StructType\` names a field "${fields.name}", like an integer: an object lists such a name before every other, wherever it is written, so \`StructType\` refuses it. Declare the fields as a list, in their order: \`StructType([[name, type], \u2026])\`.`,
|
|
3135
|
+
category: "error"
|
|
3136
|
+
});
|
|
3137
|
+
return;
|
|
3138
|
+
}
|
|
3139
|
+
const fix = entriesFix(arg, ctx);
|
|
3140
|
+
ctx.report({
|
|
3141
|
+
ruleName: NAME32,
|
|
3142
|
+
code: CODE32,
|
|
3143
|
+
start,
|
|
3144
|
+
length: arg.getEnd() - start,
|
|
3145
|
+
messageText: '`StructType` is given an object whose fields are known only at run time: an object lists a name like an integer ("2024") before every other, so it cannot keep such a field in its place, and `StructType` refuses one. Pass the fields as a list, in their order \u2014 `StructType(entries)`, `StructType(Object.entries(type.fields).map(\u2026))` \u2014 which keeps any.',
|
|
3146
|
+
category: "warning",
|
|
3147
|
+
...fix === void 0 ? {} : { fix }
|
|
3148
|
+
});
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
|
|
3006
3152
|
// ../east-diagnostics/dist/src/rules/index.js
|
|
3007
3153
|
var allRules = [
|
|
3008
3154
|
// East-side idiom hygiene (original set)
|
|
@@ -3044,7 +3190,10 @@ var allRules = [
|
|
|
3044
3190
|
noHostPrintOfEastValues,
|
|
3045
3191
|
noHostParseToEastValues,
|
|
3046
3192
|
noJsTypeDispatchOnEastValues,
|
|
3047
|
-
noJsCollectionForEastCollection
|
|
3193
|
+
noJsCollectionForEastCollection,
|
|
3194
|
+
// a struct's fields in their order, whatever their names (#1574): never an
|
|
3195
|
+
// object built at run time
|
|
3196
|
+
noStructTypeFromObject
|
|
3048
3197
|
];
|
|
3049
3198
|
|
|
3050
3199
|
// ../east-diagnostics/dist/src/run.js
|
|
@@ -3094,6 +3243,13 @@ function validate(candidate) {
|
|
|
3094
3243
|
return null;
|
|
3095
3244
|
if (mod["IntegerType"] === void 0)
|
|
3096
3245
|
return null;
|
|
3246
|
+
try {
|
|
3247
|
+
const listed = mod["StructType"]([["a", mod["IntegerType"]]]);
|
|
3248
|
+
if (Object.keys(listed.fields ?? {})[0] !== "a")
|
|
3249
|
+
return null;
|
|
3250
|
+
} catch {
|
|
3251
|
+
return null;
|
|
3252
|
+
}
|
|
3097
3253
|
return mod;
|
|
3098
3254
|
}
|
|
3099
3255
|
function getEastModule(projectDir) {
|
|
@@ -3205,12 +3361,12 @@ function reifyEncoding(ctx, type, tag) {
|
|
|
3205
3361
|
}
|
|
3206
3362
|
case "Struct": {
|
|
3207
3363
|
const fieldsType = propType(ctx, type, "fields") ?? bail();
|
|
3208
|
-
const fields =
|
|
3364
|
+
const fields = [];
|
|
3209
3365
|
for (const prop of checker.getPropertiesOfType(fieldsType)) {
|
|
3210
3366
|
const name = prop.getName();
|
|
3211
3367
|
if (name.startsWith("__@"))
|
|
3212
3368
|
continue;
|
|
3213
|
-
fields[name
|
|
3369
|
+
fields.push([name, reifyUnion(ctx, stripAbsent(ctx, checker.getTypeOfSymbol(prop)))]);
|
|
3214
3370
|
}
|
|
3215
3371
|
return east.StructType(fields);
|
|
3216
3372
|
}
|
|
@@ -3319,12 +3475,12 @@ function reifyRawValue(ctx, type) {
|
|
|
3319
3475
|
const props = checker.getPropertiesOfType(type);
|
|
3320
3476
|
if (props.length === 0)
|
|
3321
3477
|
bail();
|
|
3322
|
-
const fields =
|
|
3478
|
+
const fields = [];
|
|
3323
3479
|
for (const prop of props) {
|
|
3324
3480
|
const propName = prop.getName();
|
|
3325
3481
|
if (propName.startsWith("__@"))
|
|
3326
3482
|
continue;
|
|
3327
|
-
fields[propName
|
|
3483
|
+
fields.push([propName, reifyUnion(ctx, stripAbsent(ctx, checker.getTypeOfSymbol(prop)))]);
|
|
3328
3484
|
}
|
|
3329
3485
|
return east.StructType(fields);
|
|
3330
3486
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "east-codex-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
4
4
|
"description": "East programming language ecosystem - a statically typed, expression-based language for business logic, data processing, UI definitions, and durable execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Elara AI",
|
package/index.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 2,
|
|
3
3
|
"stats": {
|
|
4
|
-
"totalEntries":
|
|
4
|
+
"totalEntries": 1317,
|
|
5
5
|
"totalFiles": 221,
|
|
6
6
|
"packages": {
|
|
7
|
-
"east":
|
|
7
|
+
"east": 587,
|
|
8
8
|
"east-node-std": 55,
|
|
9
9
|
"east-node-io": 63,
|
|
10
10
|
"east-py-datascience": 94,
|
|
@@ -5172,6 +5172,80 @@
|
|
|
5172
5172
|
"FloatMultiply"
|
|
5173
5173
|
]
|
|
5174
5174
|
},
|
|
5175
|
+
{
|
|
5176
|
+
"id": "east:crosslang.examples.ts:crosslangIntegerNamedCases",
|
|
5177
|
+
"skill": "east",
|
|
5178
|
+
"package": "east",
|
|
5179
|
+
"file": "east/test/crosslang.examples.ts",
|
|
5180
|
+
"suite": "",
|
|
5181
|
+
"test": "A match over a variant whose case names look like integers: its cases and its arms in the order their names sort",
|
|
5182
|
+
"keywords": [
|
|
5183
|
+
"cross-language",
|
|
5184
|
+
"python",
|
|
5185
|
+
"variant",
|
|
5186
|
+
"match",
|
|
5187
|
+
"case order",
|
|
5188
|
+
"integer-like names"
|
|
5189
|
+
],
|
|
5190
|
+
"imports": [
|
|
5191
|
+
"import {"
|
|
5192
|
+
],
|
|
5193
|
+
"languages": [
|
|
5194
|
+
"typescript",
|
|
5195
|
+
"python"
|
|
5196
|
+
],
|
|
5197
|
+
"ir": "{\"type\":\"Function\",\"value\":{\"type\":{\"type\":\"Function\",\"value\":{\"inputs\":[{\"type\":\"Variant\",\"value\":[{\"name\":\"100\",\"type\":{\"type\":\"Null\",\"value\":null}},{\"name\":\"50\",\"type\":{\"type\":\"Null\",\"value\":null}},{\"name\":\"a\",\"type\":{\"type\":\"Integer\",\"value\":null}}]}],\"output\":{\"type\":\"Integer\",\"value\":null}}},\"loc_id\":\"0\",\"captures\":[],\"parameters\":[{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Variant\",\"value\":{\"$ref\":\"5#type/Function/inputs/0/Variant\"}},\"loc_id\":\"0\",\"name\":\"s\",\"mutable\":false,\"captured\":false}}],\"body\":{\"type\":\"Match\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"variant\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Variant\",\"value\":{\"$ref\":\"6#type/Function/inputs/0/Variant\"}},\"loc_id\":\"0\",\"name\":\"s\",\"mutable\":false,\"captured\":false}},\"cases\":[{\"case\":\"100\",\"variable\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Null\",\"value\":null},\"loc_id\":\"0\",\"name\":\"_v\",\"mutable\":false,\"captured\":false}},\"body\":{\"type\":\"Value\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"value\":{\"type\":\"Integer\",\"value\":\"100\"}}}},{\"case\":\"50\",\"variable\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Null\",\"value\":null},\"loc_id\":\"0\",\"name\":\"_v\",\"mutable\":false,\"captured\":false}},\"body\":{\"type\":\"Value\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"value\":{\"type\":\"Integer\",\"value\":\"50\"}}}},{\"case\":\"a\",\"variable\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"name\":\"n\",\"mutable\":false,\"captured\":false}},\"body\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"name\":\"n\",\"mutable\":false,\"captured\":false}}}]}}}}",
|
|
5198
|
+
"ts": "// Generated by east-node transpile — East IR printed as the East.function\n// builder surface. Rebuilding this module yields the same IR (normalized).\nimport { East, NullType, IntegerType, VariantType } from \"@elaraai/east\";\n\nexport const crosslangIntegerNamedCases = East.function(\n [VariantType({ \"100\": NullType, \"50\": NullType, a: IntegerType })],\n IntegerType,\n ($, s) => s.match({ \"100\": ($, _v) => 100n, \"50\": ($, _v) => 50n, a: ($, n) => n }),\n);\n",
|
|
5199
|
+
"python": "# Generated by east-py transpile — East IR printed as the East.function\n# builder surface. Rebuilding this module yields the same IR (normalized).\nfrom east import East, NullType, IntegerType, VariantType\n\n@East.function(\n [VariantType([('100', NullType), ('50', NullType), ('a', IntegerType)])],\n IntegerType,\n)\ndef crosslangIntegerNamedCases(b, s):\n return s.match({'100': lambda b, _v: 100, '50': lambda b, _v: 50, 'a': lambda b, n: n})\n",
|
|
5200
|
+
"signature": {
|
|
5201
|
+
"inputs": [
|
|
5202
|
+
"VariantType({ \"100\": NullType, \"50\": NullType, a: IntegerType })"
|
|
5203
|
+
],
|
|
5204
|
+
"output": "IntegerType",
|
|
5205
|
+
"async": false
|
|
5206
|
+
},
|
|
5207
|
+
"inputs": "[{\"type\":\"100\",\"value\":null}]",
|
|
5208
|
+
"returns": "\"100\"",
|
|
5209
|
+
"builtins": []
|
|
5210
|
+
},
|
|
5211
|
+
{
|
|
5212
|
+
"id": "east:crosslang.examples.ts:crosslangIntegerNamedFields",
|
|
5213
|
+
"skill": "east",
|
|
5214
|
+
"package": "east",
|
|
5215
|
+
"file": "east/test/crosslang.examples.ts",
|
|
5216
|
+
"suite": "",
|
|
5217
|
+
"test": "A struct whose field names look like integers, declared as a list: its fields, and a literal of it, in the order its type lists them",
|
|
5218
|
+
"keywords": [
|
|
5219
|
+
"cross-language",
|
|
5220
|
+
"python",
|
|
5221
|
+
"struct",
|
|
5222
|
+
"field order",
|
|
5223
|
+
"integer-like names",
|
|
5224
|
+
"StructType list"
|
|
5225
|
+
],
|
|
5226
|
+
"imports": [
|
|
5227
|
+
"import {"
|
|
5228
|
+
],
|
|
5229
|
+
"languages": [
|
|
5230
|
+
"typescript",
|
|
5231
|
+
"python"
|
|
5232
|
+
],
|
|
5233
|
+
"ir": "{\"type\":\"Function\",\"value\":{\"type\":{\"type\":\"Function\",\"value\":{\"inputs\":[{\"type\":\"Struct\",\"value\":[{\"name\":\"b\",\"type\":{\"type\":\"Integer\",\"value\":null}},{\"name\":\"10\",\"type\":{\"type\":\"Integer\",\"value\":null}},{\"name\":\"2\",\"type\":{\"type\":\"Integer\",\"value\":null}}]}],\"output\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"2#inputs/0/Struct\"}}}},\"loc_id\":\"0\",\"captures\":[],\"parameters\":[{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"5#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"c\",\"mutable\":false,\"captured\":false}}],\"body\":{\"type\":\"Struct\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"4#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"fields\":[{\"name\":\"b\",\"value\":{\"type\":\"GetField\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"field\":\"2\",\"struct\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"10#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"c\",\"mutable\":false,\"captured\":false}}}}},{\"name\":\"10\",\"value\":{\"type\":\"Builtin\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"builtin\":\"IntegerAdd\",\"type_parameters\":[],\"arguments\":[{\"type\":\"GetField\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"field\":\"10\",\"struct\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"13#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"c\",\"mutable\":false,\"captured\":false}}}},{\"type\":\"Value\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"value\":{\"type\":\"Integer\",\"value\":\"1\"}}}]}}},{\"name\":\"2\",\"value\":{\"type\":\"GetField\",\"value\":{\"type\":{\"type\":\"Integer\",\"value\":null},\"loc_id\":\"0\",\"field\":\"b\",\"struct\":{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"10#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"c\",\"mutable\":false,\"captured\":false}}}}}]}}}}",
|
|
5234
|
+
"ts": "// Generated by east-node transpile — East IR printed as the East.function\n// builder surface. Rebuilding this module yields the same IR (normalized).\nimport { East, IntegerType, StructType } from \"@elaraai/east\";\n\nexport const crosslangIntegerNamedFields = East.function(\n [StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]])],\n StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]]),\n ($, c) => ({ b: c[\"2\"], \"10\": c[\"10\"].add(1n), \"2\": c.b }),\n);\n",
|
|
5235
|
+
"python": "# Generated by east-py transpile — East IR printed as the East.function\n# builder surface. Rebuilding this module yields the same IR (normalized).\nfrom east import East, IntegerType, StructType\n\n@East.function(\n [StructType([('b', IntegerType), ('10', IntegerType), ('2', IntegerType)])],\n StructType([('b', IntegerType), ('10', IntegerType), ('2', IntegerType)]),\n)\ndef crosslangIntegerNamedFields(b, c):\n return {'b': c.field('2'), '10': (c.field('10') + 1), '2': c.b}\n",
|
|
5236
|
+
"signature": {
|
|
5237
|
+
"inputs": [
|
|
5238
|
+
"StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]])"
|
|
5239
|
+
],
|
|
5240
|
+
"output": "StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]])",
|
|
5241
|
+
"async": false
|
|
5242
|
+
},
|
|
5243
|
+
"inputs": "[{\"2\":\"3\",\"10\":\"2\",\"b\":\"1\"}]",
|
|
5244
|
+
"returns": "{\"2\":\"1\",\"10\":\"3\",\"b\":\"3\"}",
|
|
5245
|
+
"builtins": [
|
|
5246
|
+
"IntegerAdd"
|
|
5247
|
+
]
|
|
5248
|
+
},
|
|
5175
5249
|
{
|
|
5176
5250
|
"id": "east:crosslang.examples.ts:crosslangDictSet",
|
|
5177
5251
|
"skill": "east",
|
|
@@ -19638,6 +19712,44 @@
|
|
|
19638
19712
|
"Parse"
|
|
19639
19713
|
]
|
|
19640
19714
|
},
|
|
19715
|
+
{
|
|
19716
|
+
"id": "east:struct.examples.ts:structIntegerNamedFields",
|
|
19717
|
+
"skill": "east",
|
|
19718
|
+
"package": "east",
|
|
19719
|
+
"file": "east/test/struct.examples.ts",
|
|
19720
|
+
"suite": "Fields named like integers",
|
|
19721
|
+
"test": "Declare a struct whose fields are named like integers as a list of its fields, which keeps their order",
|
|
19722
|
+
"keywords": [
|
|
19723
|
+
"struct",
|
|
19724
|
+
"StructType",
|
|
19725
|
+
"field order",
|
|
19726
|
+
"integer-like names",
|
|
19727
|
+
"list of fields",
|
|
19728
|
+
"print"
|
|
19729
|
+
],
|
|
19730
|
+
"imports": [
|
|
19731
|
+
"import { East, IntegerType, StringType, StructType, BooleanType, example } from \"@elaraai/east\";"
|
|
19732
|
+
],
|
|
19733
|
+
"languages": [
|
|
19734
|
+
"typescript",
|
|
19735
|
+
"python"
|
|
19736
|
+
],
|
|
19737
|
+
"ir": "{\"type\":\"Function\",\"value\":{\"type\":{\"type\":\"Function\",\"value\":{\"inputs\":[{\"type\":\"Struct\",\"value\":[{\"name\":\"b\",\"type\":{\"type\":\"Integer\",\"value\":null}},{\"name\":\"10\",\"type\":{\"type\":\"Integer\",\"value\":null}},{\"name\":\"2\",\"type\":{\"type\":\"Integer\",\"value\":null}}]}],\"output\":{\"type\":\"String\",\"value\":null}}},\"loc_id\":\"0\",\"captures\":[],\"parameters\":[{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"5#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"counts\",\"mutable\":false,\"captured\":false}}],\"body\":{\"type\":\"Builtin\",\"value\":{\"type\":{\"type\":\"String\",\"value\":null},\"loc_id\":\"0\",\"builtin\":\"Print\",\"type_parameters\":[{\"type\":\"Struct\",\"value\":{\"$ref\":\"5#type/Function/inputs/0/Struct\"}}],\"arguments\":[{\"type\":\"Variable\",\"value\":{\"type\":{\"type\":\"Struct\",\"value\":{\"$ref\":\"7#type/Function/inputs/0/Struct\"}},\"loc_id\":\"0\",\"name\":\"counts\",\"mutable\":false,\"captured\":false}}]}}}}",
|
|
19738
|
+
"ts": "// Generated by east-node transpile — East IR printed as the East.function\n// builder surface. Rebuilding this module yields the same IR (normalized).\nimport { East, IntegerType, StringType, StructType } from \"@elaraai/east\";\n\nexport const structIntegerNamedFields = East.function(\n [StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]])],\n StringType,\n ($, counts) => East.print(counts),\n);\n",
|
|
19739
|
+
"python": "# Generated by east-py transpile — East IR printed as the East.function\n# builder surface. Rebuilding this module yields the same IR (normalized).\nfrom east import East, IntegerType, StringType, StructType\n\n@East.function(\n [StructType([('b', IntegerType), ('10', IntegerType), ('2', IntegerType)])],\n StringType,\n)\ndef structIntegerNamedFields(b, counts):\n return East.String.print(\n StructType([('b', IntegerType), ('10', IntegerType), ('2', IntegerType)]),\n counts,\n )\n",
|
|
19740
|
+
"signature": {
|
|
19741
|
+
"inputs": [
|
|
19742
|
+
"StructType([[\"b\", IntegerType], [\"10\", IntegerType], [\"2\", IntegerType]])"
|
|
19743
|
+
],
|
|
19744
|
+
"output": "StringType",
|
|
19745
|
+
"async": false
|
|
19746
|
+
},
|
|
19747
|
+
"inputs": "[{\"2\":\"3\",\"10\":\"2\",\"b\":\"1\"}]",
|
|
19748
|
+
"returns": "\"(b=1, `10`=2, `2`=3)\"",
|
|
19749
|
+
"builtins": [
|
|
19750
|
+
"Print"
|
|
19751
|
+
]
|
|
19752
|
+
},
|
|
19641
19753
|
{
|
|
19642
19754
|
"id": "east:variant.examples.ts:variantCreate",
|
|
19643
19755
|
"skill": "east",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elaraai/east-codex-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
4
4
|
"description": "East programming language ecosystem - a statically typed, expression-based language for business logic, data processing, UI definitions, and durable execution",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
package/skills/e3/SKILL.md
CHANGED
|
@@ -445,7 +445,9 @@ part, and the record carries each by its name — `plans.mutations.add_plan`,
|
|
|
445
445
|
|
|
446
446
|
Every form commits a delta addressed by key, rewriting only the segments it
|
|
447
447
|
touches (a `reduce` of a record that is not a Dict or Set writes it whole), and
|
|
448
|
-
takes `{ runner? }
|
|
448
|
+
takes `{ runner? }`: with none, its program — and an index's, which takes one
|
|
449
|
+
too — runs on east-c, naming no platform, since it calls none; a local e3 whose
|
|
450
|
+
east-c cannot run (none found, or no native binary) runs it on east-node. In an `edit`, repeated edits of one key fold, a `set` of the
|
|
449
451
|
value a row already holds changes nothing, and a `delete` or `update` of a key
|
|
450
452
|
the record does not hold is a conflict naming the key: the caller's view of the
|
|
451
453
|
record is stale. `e3.mutation.editType(recordType)` is the type of `edit`. A
|
package/skills/east/SKILL.md
CHANGED
|
@@ -69,6 +69,8 @@ Task → What do you need?
|
|
|
69
69
|
│ ├─ Collection → ArrayType(T), SetType(K), DictType(K, V), RefType(T)
|
|
70
70
|
│ ├─ Numeric → VectorType(T), MatrixType(T), T one of FloatType, IntegerType, BooleanType
|
|
71
71
|
│ ├─ Compound → StructType({...}), VariantType({...}), OptionType(T), RecursiveType(self => ...)
|
|
72
|
+
│ │ (a field named like an integer → StructType([["b", T], ["10", T]]), its fields as a list in order:
|
|
73
|
+
│ │ an object lists "10" before "b", so the object form refuses one)
|
|
72
74
|
│ ├─ Function → FunctionType([inputs], output), AsyncFunctionType([inputs], output)
|
|
73
75
|
│ └─ Patch → PatchType(T) (the patch type of any type); dictPatchOpsType(V) / setPatchOpsType(E)
|
|
74
76
|
│ for the op a touched key carries, when building a sparse key-addressed change set yourself
|