e10-ebuilder-prototype 0.5.5 → 0.5.7
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 +45 -13
- package/dist/archive.d.ts +1 -1
- package/dist/archive.js +3 -0
- package/dist/capture.js +1 -1
- package/dist/common.d.ts +2 -1
- package/dist/common.js +24 -4
- package/dist/form-behavior-runtime.d.mts +1 -0
- package/dist/form-behavior-runtime.mjs +681 -0
- package/dist/form-behavior.d.ts +11 -0
- package/dist/form-behavior.js +169 -0
- package/dist/form-context.d.ts +4 -0
- package/dist/form-context.js +7 -5
- package/dist/form-generation.d.ts +24 -0
- package/dist/form-generation.js +367 -0
- package/dist/form-runtime.mjs +11 -2
- package/dist/host-ledger.d.ts +23 -0
- package/dist/host-ledger.js +183 -0
- package/dist/host-watch.d.ts +102 -0
- package/dist/host-watch.js +112 -0
- package/dist/html-handoff.d.ts +1 -0
- package/dist/html-handoff.js +30 -2
- package/dist/html-inspect.d.ts +2 -2
- package/dist/html-inspect.js +23 -51
- package/dist/html-interact.d.ts +36 -0
- package/dist/html-interact.js +216 -0
- package/dist/html-review-budget.d.ts +9 -0
- package/dist/html-review-budget.js +47 -0
- package/dist/html.d.ts +77 -5
- package/dist/html.js +155 -41
- package/dist/index.js +119 -44
- package/dist/model.d.ts +2 -1
- package/dist/offline-render.d.ts +11 -0
- package/dist/offline-render.js +71 -0
- package/dist/offline-store.mjs +10 -0
- package/dist/runtime-support.d.mts +29 -1
- package/dist/runtime-support.mjs +55 -5
- package/dist/site.js +66 -51
- package/dist/store.js +18 -4
- package/dist/templates/form-guide.md +6 -20
- package/dist/templates/form-task-core.md +45 -5
- package/dist/templates/index.html +5 -3
- package/dist/templates/workflow-guide.md +4 -2
- package/dist/vendor/environment-auth.d.ts +1 -0
- package/dist/vendor/environment-auth.js +4 -4
- package/docs/PROTOCOL.md +341 -39
- package/package.json +1 -1
package/docs/PROTOCOL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Contract
|
|
1
|
+
# Contract v14 — e10-ebuilder-prototype 0.5.7
|
|
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,11 +37,25 @@ 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|inspect|ready|accept|fail|retry; auth set|status|profile list|current|use NAME.
|
|
40
|
+
html next|watch|inspect|interact|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.
|
|
44
44
|
|
|
45
|
+
The user obtains and supplies ETEAMSID; the tool only validates, encrypts/stores and
|
|
46
|
+
injects that supplied session into owned browser contexts and source requests. A newly
|
|
47
|
+
supplied value is imported directly without asking again. Missing/invalid/expired
|
|
48
|
+
authentication without a replacement stops source work and asks the user for a new
|
|
49
|
+
ETEAMSID for the target environment. The host ends the turn and waits for that input;
|
|
50
|
+
it must not retry with the old credential, request/use account passwords, invoke login
|
|
51
|
+
bridge Skills, or open a browser to obtain a new session/extract cookies. Auth set validates the new
|
|
52
|
+
user-supplied value via stdin before saving it; failed validation returns to the same
|
|
53
|
+
waiting boundary. Resume in the original directory, using sourceRecovery for failed
|
|
54
|
+
sources. Never echo credentials. Missing local auth, WAITING_AUTH reports and
|
|
55
|
+
E10_LOGIN_REQUIRED errors include this recovery instruction in fix. auth status --local
|
|
56
|
+
only checks stored configuration; it does not prove live server authentication. Offline
|
|
57
|
+
HTML generation and packaging retain their existing auth-free behavior.
|
|
58
|
+
|
|
45
59
|
Reports include effectiveSettings and, for failed sources, an executable sourceRecovery
|
|
46
60
|
descriptor with failure stage/attempt duration. run/capture resume pending work only;
|
|
47
61
|
retry explicitly retries failed sources. Resume flags must match persisted settings,
|
|
@@ -123,9 +137,32 @@ chains are interpreted by host AI as local mock behavior, not executed on the se
|
|
|
123
137
|
Reference failures become explicit warnings; primary metadata failures fail collection;
|
|
124
138
|
auth loss always aborts the phase, retaining interrupted receipts for resume.
|
|
125
139
|
|
|
140
|
+
Host collection reports count each form warning category by distinct menu ID from current
|
|
141
|
+
CLI output/private inputs, preserving different menus on the same object. Screenshot
|
|
142
|
+
warnings count page IDs instead; page counts cannot be presented as menu counts. Counts and
|
|
143
|
+
affected identity lists must agree; names label those IDs, including duplicate names.
|
|
144
|
+
Truncated output or prior prose is not a counting source.
|
|
145
|
+
Distinguish core collection success, layout/mode-button reference availability, screenshot
|
|
146
|
+
success, generated HTML and packaging. Review both formWarnings and warnedPages; selected
|
|
147
|
+
highlights cannot be presented as an exhaustive warning inventory. A shared deployment
|
|
148
|
+
probe warning repeated across menus is not evidence of repeated requests, lost configs,
|
|
149
|
+
or a particular HTTP/auth/network cause. no-accessible-record does not prove an empty
|
|
150
|
+
database or export failure; an absent temporary-record option is not a diagnosed cause.
|
|
151
|
+
State actual fallback impacts, preserve empty versus unavailable button scopes, and
|
|
152
|
+
disclose other observed gaps such as first-level-only choices and page resource errors.
|
|
153
|
+
Nonblocking reference fallbacks continue without an unsolicited authorization/pause step.
|
|
154
|
+
User-requested temporary-reference recollection must honor existing authorization, the
|
|
155
|
+
new-directory rule for an already collected read-only task, and uncertain cleanup gates;
|
|
156
|
+
never promise in-place source replacement or guaranteed reference retrieval. Skill ships
|
|
157
|
+
positive/negative reporting examples; these are guidance, not new collector capabilities
|
|
158
|
+
or proof of host-model compliance.
|
|
159
|
+
|
|
126
160
|
## Page capture
|
|
127
161
|
|
|
128
|
-
|
|
162
|
+
CLI defaults: concurrency 6 (1..8 override); the WorkBuddy Skill explicitly passes
|
|
163
|
+
--concurrency 8 on new run/init tasks unless the user specifies another value. Existing
|
|
164
|
+
tasks retain persisted settings; never append the new default to resume commands.
|
|
165
|
+
Capture viewport defaults: PC 1440x900, mobile 390x844,
|
|
129
166
|
CSS pixel scale 1, initial navigation/rendering deadline 10 seconds, 1 additional retry for non-timeout errors; timeouts fail immediately, stabilization
|
|
130
167
|
window 800ms, page height limit 50000px, pixel limit 60M. No timeout is treated as ready.
|
|
131
168
|
Readiness uses either page entrance/configuration or meaningful content bound to the requested
|
|
@@ -170,32 +207,95 @@ resource cleanup and optional diagnostics are outside the loading deadline.
|
|
|
170
207
|
html next is a short locked transaction after all source jobs are terminal. It returns
|
|
171
208
|
up to settings.concurrency jobs total (default 6), including resumed running tokens.
|
|
172
209
|
Each job has kind, pageId, token, name, outputPath, reviewDirectory and prompt.
|
|
173
|
-
New jobs use prompt version
|
|
174
|
-
runtimePath and form-input digest, plus contextPath (bounded lossless
|
|
210
|
+
New jobs use prompt version 17. Page jobs use screenshotPath and PNG digest. Form jobs use sourcePath,
|
|
211
|
+
runtimePath and form-input digest, plus generationPath (digest-verified generation view) and contextPath (bounded lossless
|
|
175
212
|
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 (compact common rules plus only the current menu kind), referenceGuidePath (full manual, optional targeted lookup), navigationPath (published
|
|
176
213
|
route mapping), and relatedPath (verified objects and metadata fragment paths for explicit relations). Form pageId is the menu key.
|
|
214
|
+
Generation view schema 1 retains every option-extracted configuration property, including
|
|
215
|
+
unknown fields, conditions, full action chains, mode differences and empty/unavailable
|
|
216
|
+
statuses. JSON Pointer references reuse exact subtrees; bases use shallow set overrides and
|
|
217
|
+
explicit removed keys, with literal escaping. Before writing, expansion must deeply equal
|
|
218
|
+
the input with only reference HTML replaced by a structural view. Original schema-4 source
|
|
219
|
+
fragments remain available for targeted fallback. Generation fragments are <=18K characters
|
|
220
|
+
and <=1800 encoded characters per line. The directory identifies field groups, relations
|
|
221
|
+
and configuration sections; it is not a replacement for reading all current-menu fragments.
|
|
222
|
+
Related metadata is read only for explicit references; all required target fields still seed
|
|
223
|
+
shared storage. Runtime examples supplement the compact guide, never authorize buttons.
|
|
224
|
+
|
|
225
|
+
parse5 extracts reference-HTML parent/order, field IDs and main/detail bindings, known static
|
|
226
|
+
labels, layout classes and selected inline layout/visibility styles without record text,
|
|
227
|
+
scripts or resources. Visibility hints are lexical clues, not computed CSS or permission
|
|
228
|
+
proof. Ambiguous bindings, unknown headings/widgets and absent field evidence retain original
|
|
229
|
+
character offsets for targeted fallback. Full raw HTML remains private and is never executed.
|
|
230
|
+
The generation view is not an independent form renderer; host AI still interprets business
|
|
231
|
+
configuration and composes HTML. The fixed basic executor below owns its supported transactions. Smaller input is not proof of generation speed or functional fidelity.
|
|
232
|
+
|
|
177
233
|
The coordinator tracks live tokens and serializes queue mutations; workers generate
|
|
178
|
-
HTML and call only their token-scoped html inspect/ready for local visual QA. Jobs include an
|
|
234
|
+
HTML and call only their token-scoped html inspect/interact/ready for local visual QA. Jobs include an
|
|
179
235
|
inspection command/args descriptor; full images stay in the corresponding worker context.
|
|
180
236
|
The coordinator reads the receipt and concise findings before acceptance. Host parallel capability governs actual AI parallelism;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
237
|
+
other hosts may process sequentially when unavailable, but WorkBuddy must pause until its
|
|
238
|
+
agent-team prerequisite passes. No model subprocess/API. Worker models follow explicit
|
|
239
|
+
user selection or host configuration; they need not match the coordinator. When the user
|
|
240
|
+
has not selected a worker model, the native Agent call may omit model and use host defaults.
|
|
241
|
+
No coordinator-model lookup or model-matching pause is required. html next no longer emits
|
|
242
|
+
host.modelPolicy or host.modelArgument. A coordinator model change does not cancel healthy
|
|
243
|
+
workers; replacement of any writer still requires confirmed termination. Quota exhaustion
|
|
244
|
+
retains the existing stop-and-report behavior; no model pool or automatic rotation is added.
|
|
245
|
+
Receive each completed job independently
|
|
186
246
|
and refill immediately, without waiting for a whole foreground batch. When idle, yield the
|
|
187
247
|
host turn and resume on native inbox notifications; do not loop wait/sleep/TaskOutput, which
|
|
188
248
|
triggers WorkBuddy loop protection. A yielded turn does not mean the application is complete.
|
|
189
249
|
|
|
190
250
|
bootstrap status, doctor and html next expose host.background from inherited host flags:
|
|
191
|
-
enabled/disabled/unknown.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
251
|
+
enabled/disabled/unknown. Also expose normalized agentTeams (enabled/disabled/unknown),
|
|
252
|
+
backgroundTasks (allowed/disabled/unknown), evidenceSource=inherited-host-environment and
|
|
253
|
+
evidenceScope=current-session. These describe inherited session flags, not UI settings
|
|
254
|
+
or an API query of current preferences; never echo raw environment values. A disabled
|
|
255
|
+
team/background flag takes precedence. WorkBuddy
|
|
256
|
+
requires enabled before installation, auth mutation, task creation, source work, generation
|
|
257
|
+
or packaging. bootstrap status keeps ready for runtime installation and adds taskReady;
|
|
258
|
+
blocked status/ensure/run return exit 1 and one stdout JSON with blocked=true,
|
|
259
|
+
state=WAITING_HOST, error.code=HOST_BACKGROUND_DISABLED or HOST_BACKGROUND_UNVERIFIED,
|
|
260
|
+
userMessage, fix, next=enable-agent-teams and host. WAITING_HOST is a command-level
|
|
261
|
+
prerequisite result, not a persisted task-state transition. No install lock, task/token
|
|
262
|
+
mutation or source request occurs. Already-installed runtimes still enforce the gate.
|
|
263
|
+
The wrapper requires enabled even when flags are absent. Direct CLI mutations apply the
|
|
264
|
+
same gate when either WorkBuddy capability flag is present; ordinary other-host CLI use
|
|
265
|
+
without those flags retains its existing behavior. Help/version, doctor, task status/next,
|
|
266
|
+
auth status/profile list/current and html watch remain available for diagnosis.
|
|
267
|
+
|
|
268
|
+
WorkBuddy must show userMessage verbatim in its user-visible reply and end the turn,
|
|
269
|
+
not merely leave it in tool output or offer serial fallback. The message explains that
|
|
270
|
+
application prototypes require concurrent page generation/review; serial processing would
|
|
271
|
+
make the overall task take much longer, so agent teams are required before continuing.
|
|
272
|
+
Do not invent a duration estimate or guaranteed speedup. It directs the user to
|
|
273
|
+
avatar → 设置 → 智能体 → 智能体团队管理: click 取消禁用 when shown; 禁用 means already
|
|
274
|
+
enabled and must not be clicked. Fully restart WorkBuddy, return to the same task and
|
|
275
|
+
reply 继续. Recheck status after that response before resuming with existing artifacts;
|
|
276
|
+
the user's statement alone is not a passing check. Unknown means unverified, not disabled.
|
|
277
|
+
For a disabled team flag, say the current session reports teams have not taken effect;
|
|
278
|
+
for an explicit background-disable flag, say this session reports background tasks
|
|
279
|
+
unavailable, even when its team flag is enabled. Do not tell the user that their UI
|
|
280
|
+
setting is off. If the UI is enabled but restart still leaves the session blocked,
|
|
281
|
+
explain a possible host settings/session mismatch and direct a WorkBuddy issue report
|
|
282
|
+
instead of repeating the same toggle/restart loop. Preferences alone cannot override
|
|
283
|
+
a disabled session flag. The CLI does not inspect or modify private host configuration.
|
|
284
|
+
Never alter host settings, forge flags or use a child-shell export to bypass this check.
|
|
285
|
+
The CLI owns deterministic gating/copy; the host owns rendering the message to the user.
|
|
286
|
+
|
|
287
|
+
Enabled is a preflight signal, not proof of live workers: the first actual native Agent
|
|
288
|
+
must return a background task ID immediately and later deliver independent completion.
|
|
289
|
+
If it returns synchronously or reports teams disabled, stop new dispatch and show the
|
|
290
|
+
same recovery instructions; no separate probe Agent or serial fallback. Preserve existing
|
|
291
|
+
worker identities and confirm execution termination before any later replacement.
|
|
196
292
|
|
|
197
293
|
html next --brief writes each full prompt to the token-owned promptPath and omits prompt
|
|
198
|
-
text from the response; workers read their own prompt.
|
|
294
|
+
text from the response; workers read their own prompt. With durable registration or legacy host-active-tokens,
|
|
295
|
+
already dispatched jobs return only kind/pageId/token/name/resumed and do not regenerate
|
|
296
|
+
prompts or configuration views. Dispatchable jobs retain full descriptions and promptPath.
|
|
297
|
+
Without a host token snapshot, brief retains its previous description shape.
|
|
298
|
+
Full descriptions include allocatedAt, elapsedMs,
|
|
199
299
|
hasDraft and host scheduling guidance. These describe reservations, not evidence of live AI.
|
|
200
300
|
html accept|fail --refill [--brief] returns nextHtml in the same locked transaction, avoiding
|
|
201
301
|
an extra host round trip. The completed receipt is committed before refill and remains valid
|
|
@@ -204,6 +304,17 @@ failure permits one recovery after the old writer exits; persistent failures rel
|
|
|
204
304
|
with html fail. Host guidance reports no progress at 3 minutes and requests cancellation at
|
|
205
305
|
5 minutes; retry requires confirmed termination, never elapsed time alone.
|
|
206
306
|
|
|
307
|
+
`html inspect` records distinct rendered source revisions in the token's private
|
|
308
|
+
review-history.json. Both viewports, unchanged cache reuse and damaged-image repairs share
|
|
309
|
+
a revision. The standard budget is the first version plus two correction versions. Further
|
|
310
|
+
new versions require --repair-reason (1..500 characters), explaining a concrete missing
|
|
311
|
+
module, business or runtime error; the reason is durable. This enforces explicit exceptions,
|
|
312
|
+
not the truth of a host's reason. It never auto-accepts, weakens ready checks, locks the whole
|
|
313
|
+
queue or limits another token. Corrupt history fails explicitly; never delete it to reset a
|
|
314
|
+
budget. Workers use one applicable primary interaction path plus fixes' affected paths;
|
|
315
|
+
no ad-hoc VM/stub-DOM frameworks, tool exploration or cosmetic measurement loops. Actual
|
|
316
|
+
untested interactions are recorded as untested, not silently dropped from implementation.
|
|
317
|
+
|
|
207
318
|
`html ready --kind KIND --page-id ID --token TOKEN --summary TEXT` records the worker's
|
|
208
319
|
explicit visual-review handoff privately. It requires current successful inspections and
|
|
209
320
|
intact screenshots (page source width; forms 1440 and 390), and a nonempty <=4000-character
|
|
@@ -218,20 +329,59 @@ from stranding completed jobs. Host notes remain attestations, not independent v
|
|
|
218
329
|
interaction proof. Native notifications wake the coordinator; they are not the source of
|
|
219
330
|
truth for reviewed artifact completion. The CLI still contains no model calls.
|
|
220
331
|
|
|
221
|
-
WorkBuddy
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
332
|
+
New WorkBuddy tasks initialize durable identities with `html next --host-events '[]'`.
|
|
333
|
+
The coordinator sends only incremental events, batched with the next reconciliation:
|
|
334
|
+
`{event:"started",taskId,token}` after native dispatch; and
|
|
335
|
+
`{event:"terminal",taskId,token,outcome:"completed"|"failed"|"cancelled",executionEnded:true}`
|
|
336
|
+
only after verified native execution/retry termination. CLI atomically stores one private
|
|
337
|
+
host-workers.json under the existing coordinator lock. No database, scheduler service,
|
|
338
|
+
model calls or host-private-log dependency. Omitted events and empty arrays never release
|
|
339
|
+
slots; unknown states stay active. Identities and duplicate notifications are checked,
|
|
340
|
+
wrong-token exits and second writers are rejected, replay is idempotent. A repeated started
|
|
341
|
+
event cannot resurrect a terminal worker. `host.workers` provides the current taskId mapping.
|
|
342
|
+
Ready/accept does not release native capacity. Confirmed termination without valid ready
|
|
343
|
+
is returned as host.terminalWithoutHandoff, never automatically redispatched using the old
|
|
344
|
+
token. Retry/pack is blocked while a corresponding/all registered native worker remains active.
|
|
345
|
+
Registration must complete before another allocation/host yield; the CLI cannot observe a
|
|
346
|
+
spawn the host never registers. Native lifecycle evidence remains a host attestation.
|
|
347
|
+
|
|
348
|
+
Legacy tasks/other hosts can still use `--host-active-tokens` snapshots on next/refill.
|
|
349
|
+
Once durable registration is enabled, snapshots cannot overwrite it. Do not switch a running
|
|
350
|
+
legacy task without accounting for all existing workers. Allocation counts the union of
|
|
351
|
+
native-active and reserved CLI tokens; dispatchTokens excludes all already registered tokens.
|
|
352
|
+
Only dispatch the returned dispatchTokens. An accepted but exiting worker still occupies
|
|
353
|
+
capacity; when HTML is done and workers remain, next=host-wait. No timeout alone releases slots.
|
|
354
|
+
|
|
355
|
+
host.activeCount means dispatched without confirmed exit, not independently verified running.
|
|
356
|
+
host.slots reports local HTML state, handoff presence and last local artifact activity;
|
|
357
|
+
host.reconcile identifies terminal/reviewed HTML whose native exit remains unconfirmed,
|
|
358
|
+
unknown tokens, or no observed local progress for three/five minutes. These are hints for
|
|
359
|
+
native inspection, not success, timeout failure or authorization to reclaim a slot.
|
|
360
|
+
The coordinator checks each listed native task once on that wakeup, reconciles confirmed
|
|
361
|
+
exits, and refills once. Report deliveredAwaitingExit and unresolved states separately;
|
|
362
|
+
never turn the supplied active array into a claim that every worker is actually generating.
|
|
363
|
+
WorkBuddy can mark a task cancelled while an underlying retry still runs: require confirmed
|
|
364
|
+
execution/retry termination before replacement; unknown states remain reserved and explicit.
|
|
365
|
+
|
|
366
|
+
html watch --host-active-tokens JSON [--after-state DIGEST --watch-ms 60000] is a bounded
|
|
367
|
+
read-only command outside the queue lock. It reads only this task's local receipts and
|
|
368
|
+
draft metadata, never authentication, browser state or private host logs. It emits a wakeup
|
|
369
|
+
hint on changed handoff/HTML/stall state, or at a 1..60000ms deadline. Routine draft writes
|
|
370
|
+
alone do not wake the model; expired checks never accept, fail, cancel or release workers.
|
|
371
|
+
An after-state digest acknowledges already observed evidence and avoids immediate repeat
|
|
372
|
+
wakeups. next returns a host.watch descriptor for the current/dispatchable tokens.
|
|
373
|
+
The coordinator keeps at most one native background Bash watch, verifies its actual
|
|
374
|
+
background task identity and completion notification capability, and replaces its token
|
|
375
|
+
argument with the workers actually launched if any spawn failed. A stale watch result
|
|
376
|
+
only triggers reconciliation of the current mapping; it cannot overwrite that mapping.
|
|
377
|
+
On a wakeup the host checks only reconcile entries still unresolved in the current mapping
|
|
378
|
+
(batch if supported), then refills once. A deadline with no suspect entries quietly rearms
|
|
379
|
+
the bounded check; it does not query every normally progressing worker or print a report.
|
|
380
|
+
Only rearm while workers remain. No foreground wait/poll loop
|
|
381
|
+
or model watchdog Agent. If background Bash cannot independently notify, disclose this
|
|
382
|
+
limitation instead of claiming guaranteed automatic wakeup. Final cleanup stops only the
|
|
383
|
+
coordinator's own remaining watch. A native status marked cancelled without reliable
|
|
384
|
+
underlying-execution evidence remains an explicit host blocker, not an inferred release.
|
|
235
385
|
|
|
236
386
|
|
|
237
387
|
html accept --kind page|form --page-id ID --token TOKEN reads the fixed draft path.
|
|
@@ -283,7 +433,7 @@ Status reports pageHtml, collection, formHtml and aggregate html. Pending includ
|
|
|
283
433
|
## Fixed offline shell and shared form data
|
|
284
434
|
|
|
285
435
|
CLI owns the business-blue shell, failure/legacy placeholders and fixed E10FormStore
|
|
286
|
-
transport; host
|
|
436
|
+
transport and a bounded E10FormUI executor; host composes business HTML. Full field/control, list-mode, CRUD, detail, comment/log
|
|
287
437
|
and action-chain expectations ship in templates/form-guide.md, ported from the supplied package. No Preview/Design/Settings top action row.
|
|
288
438
|
Index uses compact neutral blue-gray office styling, with explicit group chevrons,
|
|
289
439
|
progressive indentation and guide lines at every depth, plus active ancestor emphasis.
|
|
@@ -310,11 +460,40 @@ Fields bind to field IDs. Generated menus use returned shared records instead of
|
|
|
310
460
|
private copies; unrelated applications/objects remain isolated. Storage availability is
|
|
311
461
|
browser dependent; in-memory fallback lasts the current session only.
|
|
312
462
|
|
|
463
|
+
The original supplied prototype/layout-shell/button-isolation guides define the form
|
|
464
|
+
feature scope. Moving operations to fixed code does not add business features, populate
|
|
465
|
+
unconfigured buttons, or remove original requirements. Capability availability is not
|
|
466
|
+
permission. Common fields (text, numbers, dates, choices, local entity selection),
|
|
467
|
+
filter/sort/pagination, main/detail drafts and configured add/view/edit/save/save-and-new/
|
|
468
|
+
cancel/delete have CLI-owned implementations through E10FormUI. AI supplies layout and
|
|
469
|
+
source-bound condition/action decisions; validation rejects unknown fields, wrong modes,
|
|
470
|
+
unsupported operators/actions and unresolved conditions before mutation. Empty/unavailable
|
|
471
|
+
button scopes remain empty/unavailable. No universal permissions/EB rule interpreter.
|
|
472
|
+
|
|
473
|
+
UI contract derives from this menu's source, has distinct main/detail field keys and exact
|
|
474
|
+
mode/button source pointers. job.behaviorPath is an optional diagnostic copy, not another
|
|
475
|
+
mandatory full-config read. E10FormUI.contract is injected in the offline document. Numeric
|
|
476
|
+
strings preserve decimal and large-ID precision. Draft setters cannot mutate committed
|
|
477
|
+
records; failed validation/cancellation does not save or log changes. A compare-and-save
|
|
478
|
+
checks the previous object state before one local commit; stale snapshots fail retaining
|
|
479
|
+
the draft. This prevents overwrite in the active shell; it is not a multi-browser
|
|
480
|
+
collaboration guarantee. Parent acknowledgement timeouts do not replay writes locally.
|
|
481
|
+
|
|
482
|
+
The fixed executor covers a subset of the original guide; other original controls/actions
|
|
483
|
+
retain their existing prototype/simulation requirements and must be disclosed, not silently
|
|
484
|
+
reclassified as generic working controls. Files/images/signatures, computed/remote fields,
|
|
485
|
+
workflow references and multi-step business chains are not claimed as newly implemented
|
|
486
|
+
by this basic executor. Capability limitations do not authorize deleting those original
|
|
487
|
+
features from a generated page. CLI render success is not complete interaction verification.
|
|
488
|
+
Same-file host Write/Edit calls are sequential; inspect never rewrites the source draft.
|
|
489
|
+
|
|
313
490
|
Form initialization must set window.__E10_FORM_READY__=true after data/rendering. Pack
|
|
314
|
-
renders generated form HTML
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
491
|
+
renders the exact generated form HTML by file URL at 1440x900, using the same offline loader
|
|
492
|
+
as inspect with a fresh isolated context per form. Both preserve localStorage origin behavior,
|
|
493
|
+
block external resources, and report initialization/script errors before PNG. Rendering failures mark that HTML failed and block the pack attempt, allowing html
|
|
494
|
+
retry or subsequent explicit PARTIAL packaging. Private pack-diagnostics retain stage, bounded JS errors and browser source locations; errors
|
|
495
|
+
point to focused repair with the existing draft, never a generic full-regeneration instruction.
|
|
496
|
+
Owned Pages, contexts and Chrome close in finally; cleanup failures cannot yield DONE.
|
|
318
497
|
|
|
319
498
|
## Delivery and privacy
|
|
320
499
|
|
|
@@ -330,10 +509,31 @@ Exclude credentials, form-input JSON, layout references, real reference record I
|
|
|
330
509
|
tokens and task state. Manifest carries hashes and specific warnings, not private configs.
|
|
331
510
|
DONE covers supported targets; unsupported skipped menu types still require disclosure.
|
|
332
511
|
|
|
512
|
+
## CLI command loading
|
|
513
|
+
|
|
514
|
+
Each invocation remains a short-lived Node process. The entry eagerly loads only built-in
|
|
515
|
+
utilities, common error/output support, host capability checks and host argument parsing.
|
|
516
|
+
Auth, task storage, source collection, HTML queue/review and packaging modules load on the
|
|
517
|
+
selected execution branch. Host-active-token parsing is shared with the lightweight host
|
|
518
|
+
ledger so html watch does not load HTML generation/validation. Keep the html module's
|
|
519
|
+
existing parser export for callers.
|
|
520
|
+
|
|
521
|
+
playwright-core loads only inside launchChrome, including actual doctor, capture and
|
|
522
|
+
uncached offline rendering. Valid inspection-cache reuse, queue operations, ready/accept,
|
|
523
|
+
status, auth and a blocked host do not initialize the browser library. Commands still
|
|
524
|
+
perform all original receipt/hash, authentication, cleanup and state checks; imports are
|
|
525
|
+
not a substitute for verification. Bootstrap retains per-command runtime file hashes and
|
|
526
|
+
pinned dependency checks, and only installs when ensure finds no valid runtime. No daemon,
|
|
527
|
+
model subprocess, browser reuse across commands or omitted integrity checks is introduced.
|
|
528
|
+
Performance claims distinguish local process startup from WorkBuddy tool/sandbox latency,
|
|
529
|
+
network, capture/render and AI generation time.
|
|
530
|
+
|
|
333
531
|
## Runtime distribution
|
|
334
532
|
|
|
335
|
-
|
|
336
|
-
|
|
533
|
+
Publish npm packages to https://registry.npmjs.org/. Skill product.json selects
|
|
534
|
+
https://registry.npmmirror.com for installation, matching the WorkBuddy ui-code-agent
|
|
535
|
+
distribution. Wait for the pinned version to be available in the mirror before delivery.
|
|
536
|
+
Dependencies retain their pinned versions and integrity checks; no
|
|
337
537
|
internal registry is required for installation. Publishing requires explicit user
|
|
338
538
|
authorization and remains separate from local package creation and verification.
|
|
339
539
|
|
|
@@ -420,7 +620,8 @@ verifies initialization/rendering for workflows using __E10_FORM_READY__ just li
|
|
|
420
620
|
|
|
421
621
|
## Bootstrap progress (0.5.4)
|
|
422
622
|
|
|
423
|
-
Skill first calls read-only status
|
|
623
|
+
Skill first calls read-only status and handles the host blocker before any setup. Only
|
|
624
|
+
after host.background=enabled and blocked=false, if runtime is not ready, explain once before ensure: “首次使用需要初始化工作环境,大概需要几分钟,完成后自动继续。”
|
|
424
625
|
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.
|
|
425
626
|
Bootstrap emits structured stderr preparation/install/verification/ready progress and a
|
|
426
627
|
15s installation heartbeat; stdout remains one JSON result with elapsedMs on installation.
|
|
@@ -454,3 +655,104 @@ a compact associated-form contract. The full original manual remains available a
|
|
|
454
655
|
referenceGuidePath for targeted lookup, not mandatory full reading. Source configs,
|
|
455
656
|
context fragments, fields, buttons, options, queue concurrency and inspection are
|
|
456
657
|
unchanged. This reduces required guidance, not a claim about total model tokens or latency.
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
## WorkBuddy anomaly recovery (2026-09-17)
|
|
661
|
+
|
|
662
|
+
Job prompt v15 is generated after detecting the existing regular draft. Recovery begins
|
|
663
|
+
with Read of that draft, preserves completed content and uses bounded edits; only a new
|
|
664
|
+
file begins with a skeleton. Retry still copies a source-verified previous draft to a new
|
|
665
|
+
token and requires confirmed termination of the previous writer. No change to model page
|
|
666
|
+
generation responsibilities, field scope, or visual/functional quality is authorized.
|
|
667
|
+
|
|
668
|
+
Each dispatchable job includes a short `dispatch` native Agent argument object, with
|
|
669
|
+
`run_in_background:true`, `subagent_type:general-purpose`, readable `name:页面-名称` / `name:表单-名称`,
|
|
670
|
+
description and promptPath instruction. Model is omitted. New WorkBuddy starts submit
|
|
671
|
+
`{"event":"started","receipt":"<unaltered native Spawned successfully. content>"}`
|
|
672
|
+
through --host-events. CLI resolves the persisted dispatchName to token and takes taskId from the same receipt
|
|
673
|
+
regardless of parallel response ordering; missing, ambiguous or synchronous receipts are rejected.
|
|
674
|
+
Legacy explicit taskId/token starts remain supported. Terminal events may omit token;
|
|
675
|
+
CLI resolves the existing taskId, retaining executionEnded:true and outcome requirements.
|
|
676
|
+
An explicit mismatched token is still rejected. Receipts are host-supplied evidence, not
|
|
677
|
+
cryptographically authenticated native state. This does not repair WorkBuddy's acceptance
|
|
678
|
+
of truncated Agent arguments or independently process delayed host notifications.
|
|
679
|
+
File silence at three/five minutes prompts native-state reconciliation; it does not
|
|
680
|
+
prove a stalled model request and never automatically cancels or frees a writer.
|
|
681
|
+
|
|
682
|
+
`html interact --dir DIR --kind page|form --page-id ID --token TOKEN --steps FILE
|
|
683
|
+
[--width 390]` executes a <=64KB JSON plan with 1..40 steps, ending in an assertion.
|
|
684
|
+
Actions: click/fill/select/press/check/uncheck/reload/assert. Actions target a CSS selector;
|
|
685
|
+
fill/select/press use value. Assert checks visible/hidden/text/value/count; the latter
|
|
686
|
+
three use expected (text is exact innerText). Native dialogs default to dismiss, with
|
|
687
|
+
explicit dialog:accept supported per action. No arbitrary script, dependency installation
|
|
688
|
+
or HTTP server. Canonical prepared HTML and runtimes run in a private offline file context
|
|
689
|
+
with fresh local storage, 30s operation bound plus bounded startup/cleanup. Navigation
|
|
690
|
+
away, new windows, blocked resources, runtime errors and failed assertions fail the check.
|
|
691
|
+
Token-private locking permits parallel workers; source/draft digest is rechecked after
|
|
692
|
+
execution. review/interaction.json records exact steps, per-step results and a final
|
|
693
|
+
screenshot. It proves only those paths. An existing failed/stale interaction receipt blocks
|
|
694
|
+
ready/accept-ready; ready pins its digest. Missing interaction evidence is not proof of
|
|
695
|
+
interaction correctness and remains compatible with previous tasks. No original source
|
|
696
|
+
or completed task is changed during local acceptance fixtures.
|
|
697
|
+
|
|
698
|
+
html ready returns next=finish-worker and an explicit final-reply instruction; it no longer
|
|
699
|
+
returns notify-coordinator, which conflicted with the native-terminal handoff protocol.
|
|
700
|
+
The coordinator must not broadcast to finished generation teammates, as messages can
|
|
701
|
+
reactivate them after a recorded terminal state. This remains a host lifecycle limitation.
|
|
702
|
+
|
|
703
|
+
## Readable worker names and cleanup failures (2026-09-17)
|
|
704
|
+
|
|
705
|
+
New allocations persist dispatchName in HtmlResult before dispatch. Names use 页面-名称
|
|
706
|
+
or 表单-名称; whitespace/path/control punctuation is replaced by hyphens and the label
|
|
707
|
+
is bounded to 60 Unicode characters. Duplicate labels append the item ID; retries append
|
|
708
|
+
重试N; remaining collisions receive a sequence suffix. Names never replace token identity.
|
|
709
|
+
Resume preserves the persisted name; previously allocated jobs keep e10-<token>.
|
|
710
|
+
Original native rename notes are checked and mapped to the requested name, while the
|
|
711
|
+
ledger retains the actual nativeName. Unknown/ambiguous names and explicit token mismatches
|
|
712
|
+
are rejected. Older explicit taskId/token and e10-token receipts remain supported.
|
|
713
|
+
|
|
714
|
+
CLI emits the final output only after lock release, so release failures cannot follow an
|
|
715
|
+
already-emitted success JSON. SAFE_DELETE_BULK_CONFIRM_REQUIRED / SAFE_DELETE_BULK_REJECTED
|
|
716
|
+
are explicit error codes with stop/reconcile guidance, not generic retry instructions.
|
|
717
|
+
The original host guard marker is emitted unescaped on stderr. Structured stdout keeps
|
|
718
|
+
the code and diagnostic details but does not duplicate the raw marker inside JSON strings:
|
|
719
|
+
WorkBuddy parses the first marker in combined stdout/stderr as an unescaped JSON payload.
|
|
720
|
+
This preserves its normal approval path; it does not grant permission or change guard scope.
|
|
721
|
+
Lock cleanup failure reports operationCompleted plus any original operationError and
|
|
722
|
+
cleanupError; true means the action returned, not that the whole command succeeded.
|
|
723
|
+
Atomic JSON writes remove temporary files only on failure, retaining both errors if
|
|
724
|
+
cleanup also fails. Removing nonexistent temporary files did not count toward the host
|
|
725
|
+
bulk guard; this change does not eliminate real lock cleanup confirmations.
|
|
726
|
+
|
|
727
|
+
Workers/coordinators stop automatic retries on these host guard errors, preserve existing
|
|
728
|
+
work, and use the host's normal approval flow before reconciliation. Never manually
|
|
729
|
+
remove lock directories, change deletion mechanisms or security settings to bypass the
|
|
730
|
+
block. Keep required interaction coverage; static assertions cannot replace the requested
|
|
731
|
+
save/cancel path. The CLI does not change WorkBuddy approval scope or suppress prompts.
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
## Lightweight worker and coordinator guidance (0.5.7, prompt 17)
|
|
735
|
+
|
|
736
|
+
Keep page generation responsibilities, Skill concurrency eight, host-default/auto models,
|
|
737
|
+
existing validation and deletion behavior. Prefer same-turn independent dispatch calls,
|
|
738
|
+
batched immediate registration, then terminal reconciliation/refill before progress prose.
|
|
739
|
+
Preserve jobs/dispatch/watch output instead of stripping and fetching it again. Watch rearming
|
|
740
|
+
retains the latest after-state digest and uses background notifications, not foreground polling.
|
|
741
|
+
Every submitted terminal must have the matching native identity's notification/status evidence;
|
|
742
|
+
a different task's completion, ready or watch completion never proves that worker exited.
|
|
743
|
+
These are host instructions, not a deterministic scheduler or independently verified lifecycle.
|
|
744
|
+
|
|
745
|
+
Workers do not create/claim shared task-list items or browse sibling tokens. Missing private
|
|
746
|
+
review directories are normal. After ready they return a concise final answer without further
|
|
747
|
+
tool calls. Normal delivery uses pack results; detailed timing audits are only done on request.
|
|
748
|
+
Reports distinguish native Started/Ended, ledger registration/release, HTML acceptance and host
|
|
749
|
+
reclamation, calculate durations from timestamps and disclose early release as an anomaly.
|
|
750
|
+
|
|
751
|
+
Interaction plans remain strict objects with steps arrays; count expected is an integer 0..10000,
|
|
752
|
+
text/value expected and fill/select/press value are strings. Invalid plans return the same code
|
|
753
|
+
plus details.field, one-based details.step where applicable, and the expected format. The parser
|
|
754
|
+
does not coerce strings to numbers or run the browser for malformed input. Fix the plan alone
|
|
755
|
+
when the HTML did not change. All-row claims require all-row assertions, not first/last samples.
|
|
756
|
+
Form query validation keeps its current accepted inputs and bounds but names the failing
|
|
757
|
+
filters/sort/pageSize/page field. The compact guide documents arrays, pageSize 1..500 and using
|
|
758
|
+
orderedIds plus snapshot records for full filtered totals, without expanding business features.
|
package/package.json
CHANGED