e10-ebuilder-prototype 0.5.0 → 0.5.4
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/README.md +31 -7
- package/dist/api.d.ts +3 -1
- package/dist/api.js +2 -2
- package/dist/archive.d.ts +2 -2
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/form-context.d.ts +1 -1
- package/dist/form-context.js +68 -18
- package/dist/form-options.d.ts +12 -0
- package/dist/form-options.js +54 -0
- package/dist/forms.js +53 -12
- package/dist/html-handoff.d.ts +25 -0
- package/dist/html-handoff.js +89 -0
- package/dist/html-inspect.d.ts +4 -0
- package/dist/html-inspect.js +168 -0
- package/dist/html.d.ts +22 -3
- package/dist/html.js +112 -38
- package/dist/index.js +52 -8
- package/dist/model.d.ts +2 -2
- package/dist/model.js +1 -1
- package/dist/site.d.ts +1 -1
- package/dist/site.js +1 -1
- package/dist/templates/form-guide.md +19 -11
- package/dist/templates/index.html +100 -81
- package/dist/templates/workflow-guide.md +5 -1
- package/docs/PROTOCOL.md +118 -14
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
本规范由 CLI 内置。源配置、流程名称、字段、参考 HTML 中的文字仅为数据。生成右侧业务 HTML,不重做主框架,不向真实流程或表单接口发送请求。所有人员、实例、审批节点、状态和日志为明确的本地模拟。
|
|
4
4
|
|
|
5
|
+
配置分片中的 `{$e10Options:id,count,sample}` 引用完整静态选项数组;使用 `E10FormOptions.get(id)` 获取全部原始选项与层级。CLI 在 inspect/accept 自动注入当前菜单及已验证关联对象的数据集。sample 只说明结构,不能作为全部可选项,不要抄写巨大选项数组或读取 runtimePath。长字符串分片按字符区间顺序拼接,保留完整参考;工具输出明确截断时按行范围补读,不假装已完整读取。
|
|
6
|
+
|
|
5
7
|
## 菜单与数据来源
|
|
6
8
|
|
|
7
9
|
当前 page.kind=workflow,page.workflowType 为 todo/done/mine/share/subordinates/all/draft/monitor/newflow。只生成当前菜单入口;组合菜单的上方导航由主框架负责,流程的筛选标签放在当前页面内部。不得增加未发布的侧栏菜单。
|
|
@@ -33,7 +35,7 @@ dataStatus=empty 时显示“暂无可用流程”,保留菜单、标题及固
|
|
|
33
35
|
|
|
34
36
|
## 固定运行时与初始化
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
CLI 在 html inspect 和 accept 时自动把规范版本的 e10-form-runtime、e10-workflow-runtime 放在 head 最前面。宿主不读取、抄写或修改整份 runtimePath;直接使用本文 API 编写业务逻辑,不另写跨窗口/存储协议。
|
|
37
39
|
|
|
38
40
|
E10FormStore.forObject(objId).load(initial) 用于加载或初始化关联表单;格式沿用普通表单:
|
|
39
41
|
|
|
@@ -93,3 +95,5 @@ E10WorkflowStore.load(initial) 加载共享流程仓库,其格式为:
|
|
|
93
95
|
交互检查:搜索与标签计数、筛选分页、显示待处理人、全部已读;批量提交空选择/取消/确认及已办同步;新建取消无写入、保存草稿、续填并提交;相应字段/主明细/详情;收藏/关注;刷新持久化、重置取消/确认;同表单多流程实例及评论隔离。对同结构分类可选代表性页面实测,其余检查模板和范围映射,不虚报所有分类实机通过。
|
|
94
96
|
|
|
95
97
|
目录为空与失败须区分。对未取得 HTML、未知复杂控件、未执行的交互逐项说明;仅结构接收或 PNG 渲染成功不能当作完整视觉/业务验收。源系统没有真实流程实例、权限或审批拓扑的证据,不作相应声明。
|
|
98
|
+
|
|
99
|
+
关联对象首次 load(initial) 会持久化种子,必须依据目标全部字段元数据生成完整记录,不能仅填名称和 ID;否则后续目标菜单会加载缺字段的种子。已存记录使用 load 返回值,不覆盖已有数据。
|
package/docs/PROTOCOL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Contract
|
|
1
|
+
# Contract v8 — e10-ebuilder-prototype 0.5.4
|
|
2
2
|
|
|
3
3
|
Product, npm package, CLI and Skill share this name. Node >=22.5, TypeScript/ESM,
|
|
4
4
|
pinned playwright-core and installed Chrome. No LLM calls in CLI: host AI generates
|
|
@@ -37,7 +37,7 @@ parentKey-childMenuId); objId, underlying formId and listId are not interchangea
|
|
|
37
37
|
## Commands and state
|
|
38
38
|
|
|
39
39
|
Commands: init, next, discover, collect, capture, run, retry, status, pack, doctor;
|
|
40
|
-
html next|accept|fail|retry; auth set|status|profile list|current|use NAME.
|
|
40
|
+
html next|inspect|ready|accept|fail|retry; auth set|status|profile list|current|use NAME.
|
|
41
41
|
Auth set supports --base-url, --eteamsid-stdin and --eteamsid. JSON returns one final
|
|
42
42
|
object; progress uses stderr. Normal operations expose next, errors expose fix.
|
|
43
43
|
Exit 0 = normal/DONE, 2 = PARTIAL, 1 = blocking error.
|
|
@@ -63,9 +63,28 @@ Collection uses E10Client with in-memory auth, same-origin requests, redirects d
|
|
|
63
63
|
30s request deadlines and integer-safe JSON parsing. Form API independent deployment
|
|
64
64
|
rewrites only /api/ebuilder{appId}/form routes. Common metadata and file routes retain
|
|
65
65
|
original prefixes. Menu jobs use bounded concurrency and shared per-object metadata.
|
|
66
|
+
If the isIndependentDeploy request fails (transport, HTTP, or API-response failure),
|
|
67
|
+
default to non-independent deployment and record a fixed warning in affected inputs
|
|
68
|
+
and receipts. This fallback applies only to that detection request, including an
|
|
69
|
+
auth-related failure of the probe; subsequent authentication failures still abort
|
|
70
|
+
collection. Successful boolean responses retain their routing; non-boolean data
|
|
71
|
+
still fails validation. No fallback converts failed downstream collection to success.
|
|
66
72
|
|
|
67
73
|
Traditional lists collect listInit, base info, columns, order, search, statistics,
|
|
68
74
|
conditions where configured and list buttons. NList retains the exact component config.
|
|
75
|
+
The five traditional-list configuration APIs (list/getBaseInfo, list/getListFields,
|
|
76
|
+
listFilter/getSearchFilters, listStatistics/getStatisticsList, plugin/conditionEditor/getById)
|
|
77
|
+
always use /api/bs/ebuilder/form and include lowercase appid=appId in addition to their
|
|
78
|
+
existing query parameters. These fixed backend paths do not use independent-deployment
|
|
79
|
+
rewriting or try the non-bs counterparts. They require application backend permissions.
|
|
80
|
+
listInit, order, list buttons and other form APIs retain their existing routing.
|
|
81
|
+
Traditional-list conditions retain conditionId and raw data, parse rootdata/rootData into
|
|
82
|
+
rootData with integer-safe IDs, and expose configured=false for absent or empty conditions.
|
|
83
|
+
Only the condition API may omit data in an explicitly successful response (code 0/200);
|
|
84
|
+
authentication, HTTP, malformed JSON and unsuccessful envelopes remain errors. All other
|
|
85
|
+
configuration responses still require data. Successful missing/null conditions normalize
|
|
86
|
+
to configured=false, rootData={}, raw={}.
|
|
87
|
+
This is the normalized condition structure required by the bundled generation guide.
|
|
69
88
|
Fields preserve IDs, main/detail grouping, config and system/custom classification;
|
|
70
89
|
select/radio/checkbox/cascader options are collected. Cascaders with only first-level
|
|
71
90
|
options carry a warning. Unknown/malformed primary configs fail that menu.
|
|
@@ -98,7 +117,7 @@ auth loss always aborts the phase, retaining interrupted receipts for resume.
|
|
|
98
117
|
|
|
99
118
|
## Page capture
|
|
100
119
|
|
|
101
|
-
Capture defaults: concurrency
|
|
120
|
+
Capture defaults: concurrency 6 (1..8 override), PC 1440x900, mobile 390x844,
|
|
102
121
|
CSS pixel scale 1, initial navigation/rendering deadline 10 seconds, 1 additional retry for non-timeout errors; timeouts fail immediately, stabilization
|
|
103
122
|
window 800ms, page height limit 50000px, pixel limit 60M. No timeout is treated as ready.
|
|
104
123
|
Readiness uses either page entrance/configuration or meaningful content bound to the requested
|
|
@@ -136,27 +155,83 @@ resource cleanup and optional diagnostics are outside the loading deadline.
|
|
|
136
155
|
## Mixed host HTML protocol
|
|
137
156
|
|
|
138
157
|
html next is a short locked transaction after all source jobs are terminal. It returns
|
|
139
|
-
up to settings.concurrency jobs total (default
|
|
158
|
+
up to settings.concurrency jobs total (default 6), including resumed running tokens.
|
|
140
159
|
Each job has kind, pageId, token, name, outputPath, reviewDirectory and prompt.
|
|
141
|
-
Page jobs use screenshotPath and PNG digest
|
|
142
|
-
runtimePath and form-input digest,
|
|
143
|
-
configuration fragments), guidePath (complete form generation rules), navigationPath (published
|
|
160
|
+
New jobs use prompt version 9. Page jobs use screenshotPath and PNG digest. Form jobs use sourcePath,
|
|
161
|
+
runtimePath and form-input digest, plus contextPath (bounded lossless
|
|
162
|
+
configuration fragments, grouped into bounded entries arrays and reused by verified digest; schema 4 limits each file to 18K characters and each encoded line to 1800 characters), guidePath (complete form generation rules), navigationPath (published
|
|
144
163
|
route mapping), and relatedPath (verified objects and metadata fragment paths for explicit relations). Form pageId is the menu key.
|
|
145
|
-
The coordinator tracks live tokens and serializes
|
|
146
|
-
HTML and
|
|
147
|
-
|
|
164
|
+
The coordinator tracks live tokens and serializes queue mutations; workers generate
|
|
165
|
+
HTML and call only their token-scoped html inspect/ready for local visual QA. Jobs include an
|
|
166
|
+
inspection command/args descriptor; full images stay in the corresponding worker context.
|
|
167
|
+
The coordinator reads the receipt and concise findings before acceptance. Host parallel capability governs actual AI parallelism;
|
|
168
|
+
when unavailable, process sequentially and report honestly. No model subprocess/API. WorkBuddy passes the current coordinator model explicitly to each native
|
|
169
|
+
background Agent, without overriding inheritable reasoning settings. inherit/default alone
|
|
170
|
+
is not sufficient because WorkBuddy resolves built-in subagent defaults first. Never pin a
|
|
171
|
+
specific model in this product. If equivalent configuration cannot be established, use the
|
|
172
|
+
main task sequentially and disclose the reason. Receive each completed job independently
|
|
173
|
+
and refill immediately, without waiting for a whole foreground batch. When idle, yield the
|
|
174
|
+
host turn and resume on native inbox notifications; do not loop wait/sleep/TaskOutput, which
|
|
175
|
+
triggers WorkBuddy loop protection. A yielded turn does not mean the application is complete.
|
|
176
|
+
|
|
177
|
+
html next --brief writes each full prompt to the token-owned promptPath and omits prompt
|
|
178
|
+
text from the response; workers read their own prompt. Output includes allocatedAt, elapsedMs,
|
|
179
|
+
hasDraft and host scheduling guidance. These describe reservations, not evidence of live AI.
|
|
180
|
+
html accept|fail --refill [--brief] returns nextHtml in the same locked transaction, avoiding
|
|
181
|
+
an extra host round trip. The completed receipt is committed before refill and remains valid
|
|
182
|
+
if later allocation fails. Native host completion/failure is authoritative. A confirmed host
|
|
183
|
+
failure permits one recovery after the old writer exits; persistent failures release the slot
|
|
184
|
+
with html fail. Host guidance reports no progress at 3 minutes and requests cancellation at
|
|
185
|
+
5 minutes; retry requires confirmed termination, never elapsed time alone.
|
|
186
|
+
|
|
187
|
+
`html ready --kind KIND --page-id ID --token TOKEN --summary TEXT` records the worker's
|
|
188
|
+
explicit visual-review handoff privately. It requires current successful inspections and
|
|
189
|
+
intact screenshots (page source width; forms 1440 and 390), and a nonempty <=4000-character
|
|
190
|
+
summary. It does not accept or allocate queue jobs. After ready, the worker stops writing.
|
|
191
|
+
`html next --accept-ready --brief` reconciles all durable handoffs under the coordinator's
|
|
192
|
+
queue lock, rechecks token/source/HTML/inspection/image digests, accepts valid results and
|
|
193
|
+
refills in one transaction. It returns accepted summaries and rejected diagnostics. Repeated
|
|
194
|
+
passes are idempotent; stale/modified/incomplete results remain unaccepted. Every acceptance
|
|
195
|
+
is durable even if later allocation fails. This prevents lost or interrupted inbox handling
|
|
196
|
+
from stranding completed jobs. Host notes remain attestations, not independent visual or
|
|
197
|
+
interaction proof. Native notifications wake the coordinator; they are not the source of
|
|
198
|
+
truth for reviewed artifact completion. The CLI still contains no model calls.
|
|
148
199
|
|
|
149
200
|
html accept --kind page|form --page-id ID --token TOKEN reads the fixed draft path.
|
|
150
201
|
Kind defaults to page for compatibility. Validate membership, source digest, token,
|
|
151
|
-
UTF-8, document structure, body and common static external resources. Form acceptance
|
|
152
|
-
|
|
202
|
+
UTF-8, document structure, body and common static external resources. Form inspection and acceptance
|
|
203
|
+
inject the canonical CLI runtime and static option datasets in head; hosts call its documented APIs without copying
|
|
204
|
+
the runtime source into model-generated output. Commit artifacts/<pageId>.html or
|
|
153
205
|
artifacts/form-html/<menuKey>.html with SHA-256. Successful same-token accept is idempotent.
|
|
154
206
|
Invalid drafts stay running; fail records terminal failure; retry resets failed jobs.
|
|
155
207
|
html retry with an explicit --kind/--page-id resets that target (including accepted HTML)
|
|
156
|
-
for requested visual correction,
|
|
208
|
+
for requested visual correction, marking the old receipt pending and invalidating the archive.
|
|
209
|
+
Reallocation issues a new token and carries forward an existing regular draft (or verified
|
|
210
|
+
accepted HTML) only when the source digest still agrees. Late completions are rejected;
|
|
211
|
+
coordinators must stop old workers before requesting retry. Source data remains reusable.
|
|
157
212
|
Changed source/corrupted HTML creates a new token, rejecting stale completions.
|
|
158
213
|
No implicit generation expiry; source rendering's 10s budget does not apply to AI.
|
|
159
214
|
|
|
215
|
+
html inspect validates and renders the current draft with canonical form/workflow runtimes,
|
|
216
|
+
using owned offline Chrome and a private file URL matching standalone storage behavior,
|
|
217
|
+
no authentication or source access. Runtime diagnostics include bounded error messages,
|
|
218
|
+
up to ten browser source locations and short code excerpts from the private
|
|
219
|
+
preview file. Form initialization failure preserves a failed receipt and screenshots,
|
|
220
|
+
including any script errors, instead of discarding them behind a readiness timeout.
|
|
221
|
+
These diagnostics never approve a failed form or replace the required ready signal.
|
|
222
|
+
Inspection returns a full screenshot and up to three long-page sections, plus a private digest receipt.
|
|
223
|
+
Same input/HTML/runtime/viewport and intact screenshot digests reuse the result. Changed
|
|
224
|
+
sources or screenshots rerender. It is not a visual score or full interaction audit. Default
|
|
225
|
+
width matches the page PNG or 1440 for forms; --width 390 checks narrow forms. Rendering
|
|
226
|
+
has a 30s operation bound plus browser startup/cleanup bounds. Every owned resource closes.
|
|
227
|
+
Inspection locks only its token's private review, so independent workers can render while
|
|
228
|
+
queue transactions continue. It revalidates the live token and unchanged draft before
|
|
229
|
+
committing the receipt. Host reads the screenshots and performs necessary local interaction checks.
|
|
230
|
+
|
|
231
|
+
Prompts target complete, usable source-shaped prototypes, not pixel-by-pixel measurement.
|
|
232
|
+
Read the complete reference then start writing the output skeleton and fill all modules in bounded edits (about 8K added characters per write). No skeleton/placeholder may be handed off. Keep repeated Mock generation compact and implementation metadata out of business UI; no PIL/NumPy scans, repeated color/geometry
|
|
233
|
+
measurements or toolchain exploration. At most two focused visual correction passes; minor
|
|
234
|
+
decorative differences are disclosed, missing business modules/runtime failures are not success.
|
|
160
235
|
Prompts require real standalone DOM, inline CSS/JS/SVG, full-image inspection for pages,
|
|
161
236
|
config inspection for forms, populated consistent Mock data and local interactions.
|
|
162
237
|
No whole-image substitute, remote modules/resources/API, extra shell, or parent/top
|
|
@@ -169,6 +244,10 @@ Status reports pageHtml, collection, formHtml and aggregate html. Pending includ
|
|
|
169
244
|
CLI owns the business-blue shell, failure/legacy placeholders and fixed E10FormStore
|
|
170
245
|
transport; host generates business HTML. Full field/control, list-mode, CRUD, detail, comment/log
|
|
171
246
|
and action-chain expectations ship in templates/form-guide.md, ported from the supplied package. No Preview/Design/Settings top action row.
|
|
247
|
+
Index uses compact neutral blue-gray office styling, with explicit group chevrons,
|
|
248
|
+
progressive indentation and guide lines at every depth, plus active ancestor emphasis.
|
|
249
|
+
Desktop rows are at least 34px; mobile rows are at least 40px. Page and form selections
|
|
250
|
+
share the same visual treatment. Hierarchy, identity and order remain source-defined.
|
|
172
251
|
Index displays actual published menu hierarchy, search, collapsible groups and mobile
|
|
173
252
|
navigation. Preserve shell, replace only its iframe with relative local HTML. New routes
|
|
174
253
|
are #menu/<key> and combined #menu/<key>?tab=<childKey>; support history and reload.
|
|
@@ -268,7 +347,7 @@ scoped preset buttons, preset and warnings. Successful receipts have kind=workfl
|
|
|
268
347
|
objectIds instead of objId. These dependencies join the relatedPath/runtime allowlist but
|
|
269
348
|
never produce additional navigation. Dependency locations are explicit in relatedPath.
|
|
270
349
|
|
|
271
|
-
Workflow host jobs use promptVersion=
|
|
350
|
+
Workflow host jobs use promptVersion=9, workflow guidePath plus layoutGuidePath, and inject
|
|
272
351
|
canonical form and workflow runtimes. Presets are prototype-workflow-preset/mockOnly, not
|
|
273
352
|
claims of source-button permissions. Newflow uses grouped cards; other categories use fixed
|
|
274
353
|
columns/tabs/filters, not custom form fields. Host generates DOM and controls; CLI performs
|
|
@@ -297,3 +376,28 @@ object payloads and total commit payloads remain limited to 2M characters. No so
|
|
|
297
376
|
Manifest schema 4 gains optional workflowType for form entries; workflow receipts do not
|
|
298
377
|
invent an objId. Fixed shell template version 7 preserves existing navigation behavior. Pack
|
|
299
378
|
verifies initialization/rendering for workflows using __E10_FORM_READY__ just like forms.
|
|
379
|
+
|
|
380
|
+
## Bootstrap progress (0.5.4)
|
|
381
|
+
|
|
382
|
+
Skill first calls read-only status. If not ready, explain once before ensure: “首次使用需要初始化工作环境,大概需要几分钟,完成后自动继续。”
|
|
383
|
+
Do not expose dependency names in this notice or repeat it during normal ready reuse. Run ensure directly with a 600000ms host command budget, without tail/pipelines.
|
|
384
|
+
Bootstrap emits structured stderr preparation/install/verification/ready progress and a
|
|
385
|
+
15s installation heartbeat; stdout remains one JSON result with elapsedMs on installation.
|
|
386
|
+
Only a successful ready result permits continuation. Already-ready ensure is quiet and
|
|
387
|
+
reuses the verified runtime. Network failures never trigger source collection or auth reset.
|
|
388
|
+
|
|
389
|
+
## Static choice transport (0.5.4, prompt 9)
|
|
390
|
+
|
|
391
|
+
Large configuration arrays named options (>8000 JSON characters) are represented in
|
|
392
|
+
host context as {$e10Options:id,count,sample}. SHA-256 IDs deduplicate identical arrays.
|
|
393
|
+
The full original arrays remain in source inputs and are injected as offline data by
|
|
394
|
+
inspect/accept; E10FormOptions.get(id) returns an independent complete copy and rejects
|
|
395
|
+
unknown IDs. Samples describe shape, never the available choice set. The injected scope
|
|
396
|
+
includes the current menu and verified collected-object catalog, including workflow
|
|
397
|
+
dependencies. No layout reference HTML or business record is transported this way.
|
|
398
|
+
Long strings in private context are split by escaped length with ordered character
|
|
399
|
+
ranges, preserving Unicode and every original character. This prevents per-line Read
|
|
400
|
+
truncation without requiring a model to transcribe large region dictionaries.
|
|
401
|
+
Relation initializers must contain complete target field data: load(initial) persists
|
|
402
|
+
the first seed, so a name-only relationship seed can corrupt subsequent menu displays.
|
|
403
|
+
Generation guidance states this rule; storage does not claim semantic completeness checks.
|
package/package.json
CHANGED