forked from ChaiHao/BPOS-MVP
M3(1/5): @sfeel —— S-FEEL 子集的解析与求值,前后端同源
- lexer / parser(递归下降)/ evaluate / static-check,四文件纯函数,零 IO 零外部调用 - 子集封顶(ADR-006):比较 · 逻辑 · 算术 · 区间(开闭四态)· 列表与 in · 封闭内建函数集(字符串 / 数字 / 日期);未知函数一律拦下 - 单元格谓词(DMN 一格):`-` 任意 / 比较 / 区间 / 逗号析取 - staticCheck 给「画图即校验」用:语法 + 未知函数 + 引用路径清单 - app 侧以它替下 passthroughEvaluator:监听内容条件真求值,求值异常按不命中处置并留痕 32 个 sfeel 测试;全仓 182 个测试通过,门禁五道全绿 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
co-authored by
Claude Opus 5
parent
f0444f1417
commit
146e9bbfad
+11
-11
@@ -38,8 +38,8 @@ export declare const formFieldKindSchema: z.ZodEnum<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -54,8 +54,8 @@ export declare const formFieldSchema: z.ZodObject<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -191,8 +191,8 @@ export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
out: "out";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
@@ -418,8 +418,8 @@ export declare const deliverableSchema: z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
out: "out";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
@@ -652,8 +652,8 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
out: "out";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
@@ -773,8 +773,8 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -863,8 +863,8 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -995,8 +995,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
t: z.ZodLiteral<"mail">;
|
||||
dir: z.ZodEnum<{
|
||||
out: "out";
|
||||
in: "in";
|
||||
out: "out";
|
||||
}>;
|
||||
statusLabel: z.ZodOptional<z.ZodString>;
|
||||
editable: z.ZodOptional<z.ZodBoolean>;
|
||||
@@ -1116,8 +1116,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -1180,8 +1180,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
number: "number";
|
||||
file: "file";
|
||||
text: "text";
|
||||
check: "check";
|
||||
date: "date";
|
||||
check: "check";
|
||||
textarea: "textarea";
|
||||
radio: "radio";
|
||||
select: "select";
|
||||
@@ -1375,9 +1375,9 @@ export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
k: z.ZodLiteral<"system">;
|
||||
type: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
text: z.ZodString;
|
||||
|
||||
+5
-5
@@ -8,9 +8,9 @@
|
||||
import { z } from 'zod';
|
||||
export declare const EVENT_TYPES: readonly ["data", "time", "human", "control"];
|
||||
export declare const eventTypeSchema: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
export type EventType = z.infer<typeof eventTypeSchema>;
|
||||
@@ -71,9 +71,9 @@ export type EventPayload = z.infer<typeof eventPayloadSchema>;
|
||||
export declare const envelopeSchema: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
|
||||
type: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
correlation: z.ZodObject<{
|
||||
@@ -134,9 +134,9 @@ export type Envelope = z.infer<typeof envelopeSchema>;
|
||||
*/
|
||||
export declare const envelopeDraftSchema: z.ZodObject<{
|
||||
type: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
payload: z.ZodObject<{
|
||||
@@ -235,9 +235,9 @@ export declare const listenerSpecSchema: z.ZodObject<{
|
||||
dynamic: "dynamic";
|
||||
}>;
|
||||
eventType: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
@@ -260,9 +260,9 @@ export declare const registeredListenerSchema: z.ZodObject<{
|
||||
dynamic: "dynamic";
|
||||
}>;
|
||||
eventType: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
|
||||
+2
-2
@@ -77,9 +77,9 @@ export declare const manifestDeclarationsSchema: z.ZodObject<{
|
||||
dynamic: "dynamic";
|
||||
}>;
|
||||
eventType: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
@@ -954,9 +954,9 @@ export declare const activityManifestSchema: z.ZodObject<{
|
||||
dynamic: "dynamic";
|
||||
}>;
|
||||
eventType: z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>;
|
||||
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
|
||||
+1
-1
@@ -535,9 +535,9 @@ export declare const triggerConfigSchema: z.ZodObject<{
|
||||
kind: z.ZodLiteral<"event">;
|
||||
rule: z.ZodString;
|
||||
eventType: z.ZodDefault<z.ZodEnum<{
|
||||
time: "time";
|
||||
human: "human";
|
||||
data: "data";
|
||||
time: "time";
|
||||
control: "control";
|
||||
}>>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
|
||||
+17
-2
@@ -1,5 +1,20 @@
|
||||
/**
|
||||
* @sfeel —— S-FEEL 子集(OS 03 定义域)的解析与求值,纯函数(编码规范 §8.3)。
|
||||
* 被 process / flow-engine / trigger 与前端 gov-process 共用:求值语义一份代码,前后端同源。
|
||||
*
|
||||
* 被 `process`(边条件 / 失败走向)、`flow-engine`(条件谓词)、`trigger`(判定)、
|
||||
* `loop-engine`(前提 ifPart / DMN 单元格)与前端 `gov-process`(画布即时校验预览)共用 ——
|
||||
* **求值语义一份代码,前后端同源**;后端裁决为权威。
|
||||
*
|
||||
* 子集封顶(ADR-006:自研,不引第三方 FEEL 引擎):
|
||||
* 比较 · 逻辑 · 算术 · 区间 · 列表与 in · 封闭的内建函数集(字符串 / 数字 / 日期)。
|
||||
* **无外部调用,静态可检。**
|
||||
*/
|
||||
export declare const SFEEL_VERSION = "0.0.0-m0";
|
||||
export type { Node, UnaryTest } from './ast.ts';
|
||||
export type { Token, TokenKind } from './lexer.ts';
|
||||
export { SfeelSyntaxError, tokenize } from './lexer.ts';
|
||||
export { parse, parseUnaryTest } from './parser.ts';
|
||||
export type { Scope } from './evaluate.ts';
|
||||
export { BUILTIN_FUNCTIONS, evaluate, evaluateCondition, evaluateNode, evaluateUnaryTest, SfeelEvalError, testMatches, truthy, } from './evaluate.ts';
|
||||
export type { StaticCheckResult, StaticIssue } from './static-check.ts';
|
||||
export { staticCheck } from './static-check.ts';
|
||||
export declare const SFEEL_VERSION = "0.1.0-m3";
|
||||
|
||||
Reference in New Issue
Block a user