@floless/app 0.154.0 → 0.155.0
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/dist/floless-server.cjs +49492 -37984
- package/dist/schemas/steel.model.v2.schema.json +19 -5
- package/dist/skills/floless-app-onboarding/SKILL.md +22 -13
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +12 -8
- package/dist/skills/floless-app-steel-model/SKILL.md +23 -2
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +158 -65
- package/dist/skills/floless-app-workflows/SKILL.md +23 -5
- package/dist/skills/floless-app-workflows/references/blender-exec.md +183 -0
- package/dist/skills/floless-app-workflows/references/dev-server-and-run-trace.md +27 -12
- package/dist/templates/blender-construction-sequence.flo +96 -0
- package/dist/web/agents.js +33 -13
- package/dist/web/app.css +275 -33
- package/dist/web/aware.js +745 -82
- package/dist/web/chat-question-card.js +477 -0
- package/dist/web/chat.css +177 -12
- package/dist/web/chat.js +1537 -717
- package/dist/web/commands-shell.js +424 -7
- package/dist/web/commands-steel.js +105 -4
- package/dist/web/guide.js +4 -3
- package/dist/web/index.html +96 -7
- package/dist/web/instructor.js +10 -9
- package/dist/web/left-pane.js +40 -3
- package/dist/web/media-player.js +234 -0
- package/dist/web/model-editor-contract.js +2 -0
- package/dist/web/model-editor-revit-adapter.js +1 -0
- package/dist/web/model-editor-steel-adapter.js +89 -1
- package/dist/web/model-panel-bridge.js +16 -2
- package/dist/web/model-view-query.js +590 -0
- package/dist/web/model-viewport-revit-adapter.js +15 -1
- package/dist/web/model-viewport-toolbar.js +5 -2
- package/dist/web/pages.js +592 -0
- package/dist/web/panels.js +2 -1
- package/dist/web/revit-editor.js +181 -16
- package/dist/web/run-progress.js +193 -0
- package/dist/web/run-strip.js +173 -0
- package/dist/web/steel-3d-core.js +70 -0
- package/dist/web/steel-editor.html +2751 -219
- package/dist/web/steel-frames-core.js +958 -0
- package/dist/web/steel-last-seen.js +315 -0
- package/dist/web/steel-marks-core.js +530 -0
- package/dist/web/steel-model-slim.js +95 -0
- package/dist/web/steel-model-v2-client-validation.js +14 -2
- package/dist/web/steel-model-v2-commands.js +258 -27
- package/dist/web/steel-model-v2-projection.js +78 -18
- package/dist/web/steel-read-confidence.js +11 -2
- package/dist/web/workspaces.js +416 -26
- package/package.json +3 -2
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Building animations: the `blender/exec` node
|
|
2
|
+
|
|
3
|
+
A person asks AI Chat for "an animation of this building going up storey by storey", a fly-through,
|
|
4
|
+
a sun study, or an exploded connection. You author it **once**, as Python in a `blender/exec` node of
|
|
5
|
+
a FloLess `.flo`. The person approves it, and AWARE renders it headlessly in Blender on every run,
|
|
6
|
+
running exactly the approved code. Knowledge makes the plan smart; the run never improvises.
|
|
7
|
+
|
|
8
|
+
Needs AWARE with the `blender` agent **0.2.0 or later** (the first with `exec`) and Blender on the
|
|
9
|
+
machine (4.2 LTS or 5.x). FloLess checks both before an animation runs. If either is missing, it
|
|
10
|
+
says which and offers the update rather than failing the run.
|
|
11
|
+
|
|
12
|
+
## When to use `exec` and when the fixed commands are enough
|
|
13
|
+
|
|
14
|
+
| The ask | Use |
|
|
15
|
+
|---|---|
|
|
16
|
+
| One picture of the model from a named angle | `blender/render.still` (no code) |
|
|
17
|
+
| A plain 360° spin | `blender/render.turntable` (no code) |
|
|
18
|
+
| Anything that **changes over time** or **picks elements**: construction sequence, fly-through on a path, sun study, exploded view, highlighting what changed | `blender/exec` |
|
|
19
|
+
|
|
20
|
+
Prefer the fixed commands when they fit, because they need no code review.
|
|
21
|
+
|
|
22
|
+
## The node
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
nodes:
|
|
26
|
+
- id: animate
|
|
27
|
+
agent: blender
|
|
28
|
+
command: exec
|
|
29
|
+
inputs:
|
|
30
|
+
ifc-path: '{{ inputs.ifc-path }}' # or blend-path: a staged .blend; or neither = empty scene
|
|
31
|
+
preset: realistic # clay | realistic | section-style (applied when ifc-path stages)
|
|
32
|
+
output-dir: '{{ inputs.output-dir }}' # wire it exactly like this: FloLess provisions it per run
|
|
33
|
+
timeout-seconds: 3600 # from your estimate (see "Time budget")
|
|
34
|
+
args: # DATA for the code — never code
|
|
35
|
+
seconds: 12
|
|
36
|
+
fps: 24
|
|
37
|
+
code: |
|
|
38
|
+
# Builds the model up storey by storey, lowest first, and renders it as an MP4 video.
|
|
39
|
+
# Each storey appears over half a second, with the camera fixed on a three-quarter view.
|
|
40
|
+
def run(ctx):
|
|
41
|
+
...
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Rules:
|
|
45
|
+
- **`code` must be a literal block.** AWARE refuses a templated `code` (`E_APP_INPUT_MUST_BE_LITERAL`):
|
|
46
|
+
code supplied at run time was never approved. Everything that varies goes in `args`, and `args` may
|
|
47
|
+
use templates.
|
|
48
|
+
- **Open `code` with a plain-English `#` comment.** It is the node's Description in Inspect, and the
|
|
49
|
+
`verify:flo` guard fails a published workflow without one. Use `# ` (hash, then a space), with one
|
|
50
|
+
or two sentences a detailer would understand. Never describe the Python.
|
|
51
|
+
- Declare the app input `output-dir` (a string) and wire it as `'{{ inputs.output-dir }}'`. FloLess
|
|
52
|
+
fills it with a private per-run folder, which is what lets the finished video **play inside FloLess**.
|
|
53
|
+
A file written anywhere else still gets Open/Reveal, but no inline player.
|
|
54
|
+
- The node is `mode: write` and cannot be overridden. A dry run never starts Blender.
|
|
55
|
+
|
|
56
|
+
## `run(ctx)`, the contract
|
|
57
|
+
|
|
58
|
+
`run(ctx)` is called once, after the scene is staged. Return a small JSON-able summary of up to
|
|
59
|
+
256 KiB. Larger results fail with `result-too-large`: write a file and register it instead.
|
|
60
|
+
|
|
61
|
+
| `ctx.` | What it does |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `args` | the node's `args` (a dict) |
|
|
64
|
+
| `output_dir` | the real path to write into |
|
|
65
|
+
| `scene` | `bpy.context.scene` |
|
|
66
|
+
| `elements()` | `[(obj, {guid, name, class, material, storey})]` for every imported IFC element (staging helpers excluded) |
|
|
67
|
+
| `frame(direction)` | fits the camera to the model: `hero` (three-quarter), `iso`, `front`, `back`, `left`, `right`, `top` |
|
|
68
|
+
| `apply_look(preset)` / `environment(name)` / `ground(on)` | the same looks, HDRI lighting (`studio`, `city`, `sunset`, …) and soft floor the fixed renders use |
|
|
69
|
+
| `progress(phase, done, total, message)` | your own progress line, for long non-render work |
|
|
70
|
+
| `plan_passes(n)` | declare how many `render_*` calls follow, so progress reads "pass 2 of 3" |
|
|
71
|
+
| `render_animation(path, quality='draft')` | renders `scene.frame_start..frame_end` to H.264 MP4, **reports every frame as it is written**, and verifies and registers the file |
|
|
72
|
+
| `render_still(path, quality='draft')` | one PNG, verified and registered |
|
|
73
|
+
| `add_output(path, kind)` | registers another file you wrote (`video`, `image`, `blend`, `file`) |
|
|
74
|
+
|
|
75
|
+
`quality='draft'` is EEVEE and the default; use it for animations. `production` is Cycles, which takes
|
|
76
|
+
minutes per frame. Use it only for stills, or warn the person about the time first (see below).
|
|
77
|
+
|
|
78
|
+
Errors come back as plain messages. An exception reports the line in **your** code, with
|
|
79
|
+
`code: exec-error`.
|
|
80
|
+
|
|
81
|
+
## Recipes
|
|
82
|
+
|
|
83
|
+
Each recipe is a complete `run(ctx)` you can adapt. All of them set the frame range before rendering,
|
|
84
|
+
because `render_animation` renders exactly `frame_start..frame_end`.
|
|
85
|
+
|
|
86
|
+
### Construction sequence: storey by storey (or by erection order)
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# Builds the model up storey by storey, lowest first, and renders it as a video.
|
|
90
|
+
def run(ctx):
|
|
91
|
+
fps = int(ctx.args.get("fps", 24))
|
|
92
|
+
step = int(fps * float(ctx.args.get("seconds_per_group", 0.5)))
|
|
93
|
+
els = ctx.elements()
|
|
94
|
+
# Order storeys by height, not by name: names are free text ("Level 1", "GF", "T.O. Steel").
|
|
95
|
+
groups = {}
|
|
96
|
+
for obj, p in els:
|
|
97
|
+
groups.setdefault(p["storey"] or "(no storey)", []).append(obj)
|
|
98
|
+
def low(objs):
|
|
99
|
+
return min(min((obj.matrix_world @ v.co).z for v in obj.data.vertices) for obj in objs)
|
|
100
|
+
order = sorted(groups, key=lambda k: low(groups[k]))
|
|
101
|
+
s = ctx.scene
|
|
102
|
+
s.render.fps = fps
|
|
103
|
+
s.frame_start = 1
|
|
104
|
+
s.frame_end = step * len(order) + fps # one extra second on the finished model
|
|
105
|
+
for i, key in enumerate(order):
|
|
106
|
+
appear = 1 + i * step
|
|
107
|
+
for obj in groups[key]:
|
|
108
|
+
for hidden, f in ((True, 1), (True, appear - 1), (False, appear)):
|
|
109
|
+
obj.hide_render = hidden
|
|
110
|
+
obj.keyframe_insert("hide_render", frame=max(1, f))
|
|
111
|
+
ctx.frame("hero")
|
|
112
|
+
ctx.render_animation("construction-sequence.mp4")
|
|
113
|
+
return {"groups": order, "frames": s.frame_end}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
For **erection order**, group by a property the model carries (a phase or sequence number in the
|
|
117
|
+
element name, or a value passed in `args` that maps GUID to step) instead of `storey`. If the model
|
|
118
|
+
carries no such data, ask the person. Never invent an order.
|
|
119
|
+
|
|
120
|
+
### Fly-through: the camera on a path
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
# Flies the camera once around the building at eye height, then up to an overview.
|
|
124
|
+
import math
|
|
125
|
+
def run(ctx):
|
|
126
|
+
s = ctx.scene
|
|
127
|
+
s.frame_start, s.frame_end = 1, int(ctx.args.get("frames", 240))
|
|
128
|
+
receipt = ctx.frame("hero")
|
|
129
|
+
cam = s.camera
|
|
130
|
+
cx, cy, cz = receipt["centre"]; r = receipt["distance"]
|
|
131
|
+
for f in range(s.frame_start, s.frame_end + 1, 10):
|
|
132
|
+
t = (f - s.frame_start) / (s.frame_end - s.frame_start)
|
|
133
|
+
a = 2 * math.pi * t
|
|
134
|
+
cam.location = (cx + r * math.cos(a), cy + r * math.sin(a), cz + r * (0.15 + 0.6 * t))
|
|
135
|
+
cam.keyframe_insert("location", frame=f)
|
|
136
|
+
track = cam.constraints.new("TRACK_TO")
|
|
137
|
+
import bpy
|
|
138
|
+
target = bpy.data.objects.new("aware-target", None); s.collection.objects.link(target)
|
|
139
|
+
target.location = (cx, cy, cz); track.target = target
|
|
140
|
+
ctx.render_animation("fly-through.mp4")
|
|
141
|
+
return {"frames": s.frame_end}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Check the actual keys of `ctx.frame()`'s receipt with a short run first. Don't guess field names: print
|
|
145
|
+
the receipt in a first iteration.
|
|
146
|
+
|
|
147
|
+
### Sun study: shadows across a day
|
|
148
|
+
|
|
149
|
+
Key a sun lamp's rotation over the frame range (for example 08:00 to 18:00, one frame per 10 minutes),
|
|
150
|
+
with `ctx.environment("gradient")` so the HDRI does not fight the sun. If the person gives a site
|
|
151
|
+
latitude and date, compute the sun's elevation and azimuth from them in `args`. If they don't, ask.
|
|
152
|
+
Never assume a site.
|
|
153
|
+
|
|
154
|
+
### Exploded view
|
|
155
|
+
|
|
156
|
+
Move each element outward from the model centre along its own centre direction, keyed from 0 to a
|
|
157
|
+
factor over the range. Keep `ground(False)`, because the floor reads wrong under floating parts.
|
|
158
|
+
|
|
159
|
+
### Highlight what changed
|
|
160
|
+
|
|
161
|
+
Pass the changed GUIDs in `args` (from a revision comparison the person ran), give those elements an
|
|
162
|
+
accent material and the rest `clay`, and render a still or a short turntable. Read the GUID list from
|
|
163
|
+
`args`; never hard-code it in `code`, or every new revision would need a new approval.
|
|
164
|
+
|
|
165
|
+
## Time budget: tell the person before it runs
|
|
166
|
+
|
|
167
|
+
Each frame is one render. On the steel demo (209 members, 1920×1080), measured draft frames take about
|
|
168
|
+
1.3–1.9 s, so 288 frames take about 6–9 minutes. A production (Cycles) frame takes 50–115 s, so
|
|
169
|
+
240 production frames take **hours**.
|
|
170
|
+
|
|
171
|
+
- Before running, state the estimate in plain words: *"About 240 frames at draft quality, roughly 5–8
|
|
172
|
+
minutes. You can keep working; FloLess shows each frame as it renders."*
|
|
173
|
+
- Set `timeout-seconds` to about twice the high end of your estimate. A timeout shows as a warning
|
|
174
|
+
with the choice to run again with a longer budget.
|
|
175
|
+
- Production animation is allowed: nothing refuses. Warn first with the hours figure and the draft
|
|
176
|
+
alternative, and let the person choose.
|
|
177
|
+
|
|
178
|
+
## Verify before you hand it over
|
|
179
|
+
|
|
180
|
+
1. `aware app validate`, then compile.
|
|
181
|
+
2. Run it **for real** through FloLess (never `--simulate`; a simulated run renders nothing). Watch the
|
|
182
|
+
strip count frames, then open the MP4.
|
|
183
|
+
3. Check the receipt: `outputs[0].verified` is `true`, and `frames` equals your frame range.
|
|
@@ -88,8 +88,9 @@ machine via a `self_test:true` watch fixture — no Tekla, no `--simulate`:
|
|
|
88
88
|
|
|
89
89
|
### Driving the licensed dev server + Playwright (what actually works here)
|
|
90
90
|
|
|
91
|
-
- **The installed SEA server usually already holds :4317** (
|
|
92
|
-
|
|
91
|
+
- **The installed SEA server usually already holds :4317** (it is a different, older build than
|
|
92
|
+
your checkout — it may lack routes yours has, so don't read a 404 there as a bug in your code;
|
|
93
|
+
on current builds `/api/license/status` is the ungated liveness probe). Don't fight it: `index.ts` honors `PORT`, so run the dev server on a free port —
|
|
93
94
|
`PORT=4318 FLOLESS_LICENSE_DIR="$LOCALAPPDATA/FlolessApp-data" npx tsx main.ts --serve` (from
|
|
94
95
|
`server/`, background). Without the license dir it serves the **sign-in gate** (the workspace
|
|
95
96
|
chrome is absent) — assert a stable workspace element like `document.getElementById('run-btn')`
|
|
@@ -113,13 +114,27 @@ machine via a `self_test:true` watch fixture — no Tekla, no `--simulate`:
|
|
|
113
114
|
|
|
114
115
|
## Stop / cancel an in-flight run
|
|
115
116
|
|
|
116
|
-
`aware app run` blocks
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
`aware app run` blocks. Each finite manual caller must generate a fresh UUID before dispatch:
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
const runRequestId = crypto.randomUUID();
|
|
121
|
+
const runBody = { id: appId, inputs, runRequestId };
|
|
122
|
+
// POST /api/run with runBody. Keep this identity for the corresponding Stop:
|
|
123
|
+
const stopBody = { runRequestId }; // POST /api/run/stop
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- The server registers ownership before awaiting admission or the shared run lock. Stop targets
|
|
127
|
+
this request's queued or running ticket; it never falls back to another active run. A legacy
|
|
128
|
+
identity-less Run can complete, but identity-less Stop does not stop anything.
|
|
129
|
+
- Read the Stop answer: `accepted:true` confirms a stop request; `accepted:false,pending:true`
|
|
130
|
+
is provisional when Run registration has not been observed; a finishing answer means the
|
|
131
|
+
result is already being completed. None of these answers replaces the original Run outcome.
|
|
132
|
+
- `aware-adapter.ts` cancels the owned ticket. On Windows it kills the **whole process tree**
|
|
133
|
+
with `taskkill /pid <pid> /T /F`; a bare `child.kill()` can orphan the bridge.
|
|
134
|
+
- The original `/api/run` answer's `cancelled:true` determines cancellation. `api()` preserves
|
|
135
|
+
the structured error body. Do not infer cancellation from a local click or a lost Stop
|
|
136
|
+
acknowledgement, and do not hold a completed Run result while waiting indefinitely for Stop.
|
|
137
|
+
Already-dispatched host work may remain after cancellation.
|
|
138
|
+
- Manual trace events carry request and AWARE run identities. The browser admits only events
|
|
139
|
+
belonging to the current request; late events cannot revive a stopped canvas. Scheduled runs
|
|
140
|
+
and foreground trigger sessions retain their own separate ownership and stop paths.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
app: blender-construction-sequence
|
|
2
|
+
version: 0.1.0
|
|
3
|
+
display-name: Construction Sequence Animation
|
|
4
|
+
publisher: floless
|
|
5
|
+
description: |
|
|
6
|
+
Turn a building model into a construction-sequence video: the structure goes up storey by storey,
|
|
7
|
+
lowest first, seen from a three-quarter view, rendered by Blender on this computer with nobody
|
|
8
|
+
pressing anything. Point it at any IFC — exported from Tekla, Revit, or a FloLess steel model — and
|
|
9
|
+
run it. FloLess shows each frame as it renders, so a long render never looks stuck, and the finished
|
|
10
|
+
video plays right inside FloLess. Needs Blender (a free download from blender.org); if a run cannot
|
|
11
|
+
finish because something is missing, FloLess tells you which piece to install or update.
|
|
12
|
+
exposes-as-agent: false
|
|
13
|
+
# Workflow changelog (FloLess-published). Newest first; the app shows entries newer than the installed
|
|
14
|
+
# version when offering an update. Plain-English — it surfaces to the user.
|
|
15
|
+
changelog:
|
|
16
|
+
- version: 0.1.0
|
|
17
|
+
summary: Make a storey-by-storey construction video of any building model, rendered in Blender
|
|
18
|
+
inputs:
|
|
19
|
+
ifc-path:
|
|
20
|
+
type: string
|
|
21
|
+
widget: file
|
|
22
|
+
accept: [ifc]
|
|
23
|
+
description: The building model to animate, as an IFC file.
|
|
24
|
+
output-dir:
|
|
25
|
+
type: string
|
|
26
|
+
description: Where the video is saved. Leave it empty and FloLess keeps it for you, so it plays inside the app.
|
|
27
|
+
seconds-per-storey:
|
|
28
|
+
type: number
|
|
29
|
+
default: 0.6
|
|
30
|
+
description: How long each storey takes to appear, in seconds.
|
|
31
|
+
requires:
|
|
32
|
+
- blender@0.2.x
|
|
33
|
+
requires-permissions:
|
|
34
|
+
filesystem:
|
|
35
|
+
- read: '{{ inputs.ifc-path }}'
|
|
36
|
+
- write: '{{ inputs.output-dir }}'
|
|
37
|
+
layout: linear
|
|
38
|
+
nodes:
|
|
39
|
+
- id: animate
|
|
40
|
+
agent: blender
|
|
41
|
+
command: exec
|
|
42
|
+
safety: { transaction-group: render, snapshot: false }
|
|
43
|
+
inputs:
|
|
44
|
+
ifc-path: '{{ inputs.ifc-path }}'
|
|
45
|
+
preset: realistic
|
|
46
|
+
output-dir: '{{ inputs.output-dir }}'
|
|
47
|
+
timeout-seconds: 3600
|
|
48
|
+
args:
|
|
49
|
+
seconds-per-storey: '{{ inputs.seconds-per-storey }}'
|
|
50
|
+
fps: 24
|
|
51
|
+
code: |
|
|
52
|
+
# Builds the model up storey by storey, lowest storey first, and renders it as a video seen from a
|
|
53
|
+
# three-quarter view. Each storey appears in turn, then the finished building holds for a second.
|
|
54
|
+
def run(ctx):
|
|
55
|
+
fps = int(ctx.args.get("fps", 24))
|
|
56
|
+
try:
|
|
57
|
+
per = float(ctx.args.get("seconds-per-storey", 0.6))
|
|
58
|
+
except (TypeError, ValueError):
|
|
59
|
+
per = 0.6
|
|
60
|
+
step = max(1, int(round(fps * per)))
|
|
61
|
+
groups = {}
|
|
62
|
+
for obj, props in ctx.elements():
|
|
63
|
+
groups.setdefault(props["storey"] or "(no storey)", []).append(obj)
|
|
64
|
+
if not groups:
|
|
65
|
+
return {"storeys": [], "note": "the model had no elements to animate"}
|
|
66
|
+
|
|
67
|
+
# Order storeys by height, never by name: names are free text ("Level 1", "GF", "T.O. Steel").
|
|
68
|
+
def lowest(objs):
|
|
69
|
+
best = None
|
|
70
|
+
for obj in objs:
|
|
71
|
+
for corner in obj.bound_box:
|
|
72
|
+
z = (obj.matrix_world @ __import__("mathutils").Vector(corner)).z
|
|
73
|
+
best = z if best is None or z < best else best
|
|
74
|
+
return best if best is not None else 0.0
|
|
75
|
+
|
|
76
|
+
order = sorted(groups, key=lambda key: lowest(groups[key]))
|
|
77
|
+
scene = ctx.scene
|
|
78
|
+
scene.render.fps = fps
|
|
79
|
+
scene.render.resolution_x, scene.render.resolution_y = 1280, 720
|
|
80
|
+
scene.frame_start = 1
|
|
81
|
+
scene.frame_end = step * len(order) + fps
|
|
82
|
+
for index, key in enumerate(order):
|
|
83
|
+
appear = 1 + index * step
|
|
84
|
+
for obj in groups[key]:
|
|
85
|
+
obj.hide_render = index > 0
|
|
86
|
+
obj.keyframe_insert("hide_render", frame=1)
|
|
87
|
+
if index > 0:
|
|
88
|
+
obj.keyframe_insert("hide_render", frame=appear - 1)
|
|
89
|
+
obj.hide_render = False
|
|
90
|
+
obj.keyframe_insert("hide_render", frame=appear)
|
|
91
|
+
ctx.ground(True)
|
|
92
|
+
ctx.environment("studio")
|
|
93
|
+
ctx.frame("hero")
|
|
94
|
+
ctx.plan_passes(1)
|
|
95
|
+
video = ctx.render_animation("construction-sequence.mp4")
|
|
96
|
+
return {"storeys": order, "frames": scene.frame_end, "video": video.get("path")}
|
package/dist/web/agents.js
CHANGED
|
@@ -455,32 +455,52 @@
|
|
|
455
455
|
await window.flolessRoutines.editForAgent(state.agent.agentId, $surface.querySelector('#ag-schedule'));
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
// #2035: what each recorded decline became, in the person's words.
|
|
459
|
-
|
|
458
|
+
// #2035: what each recorded decline became, in the person's words. #2223 review #16: a question the AI asked is not a
|
|
459
|
+
// step anything declined — the AI went on without the person's answer — so it is never labelled or counted as declined.
|
|
460
|
+
const DECLINE_LABEL = { declined: 'Declined', 'not-sent': 'Stopped before it was answered', assumed: 'Went on without your answer' };
|
|
461
|
+
// T2-5: a question (`question: true`, in every state) is labelled as a question, never as a step.
|
|
462
|
+
const QUESTION_LABEL = { assumed: 'Went on without your answer', 'not-sent': 'Stopped before the AI could go on' };
|
|
463
|
+
const isQuestion = (entry) => entry.question === true || entry.state === 'assumed';
|
|
460
464
|
|
|
461
|
-
/** The steps a routine-started run declined because nobody was watching:
|
|
465
|
+
/** The steps a routine-started run declined, and the questions it asked, because nobody was watching: "Questions for you". */
|
|
462
466
|
function questionsFor(run, target, label) {
|
|
463
467
|
const d = target.declines;
|
|
464
468
|
if (!d) return null;
|
|
465
|
-
|
|
469
|
+
// `moreAssumed` is absent on a run recorded before questions were told apart.
|
|
470
|
+
const moreAssumed = d.moreAssumed || 0;
|
|
471
|
+
const moreQuestionsNotSent = d.moreQuestionsNotSent || 0;
|
|
472
|
+
const total = d.list.length + d.moreDeclined + d.moreNotSent + moreAssumed + moreQuestionsNotSent;
|
|
466
473
|
if (!total) return null;
|
|
467
|
-
const
|
|
474
|
+
const asked = d.list.filter(isQuestion).length + moreAssumed + moreQuestionsNotSent;
|
|
475
|
+
const steps = total - asked;
|
|
476
|
+
const declined = d.list.filter((entry) => !isQuestion(entry) && entry.state === 'declined').length + d.moreDeclined;
|
|
468
477
|
const working = target.live === 'working' || target.live === 'starting';
|
|
469
478
|
const details = el('details', { class: 'ag-questions' },
|
|
470
479
|
el('summary', { 'data-command-id': `shell.agents-run-questions#${label}`, 'data-command-instance-label': label, text: `Questions for you (${total})` }));
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
480
|
+
if (steps) {
|
|
481
|
+
details.append(el('p', { class: 'ag-help', text: declined === 0
|
|
482
|
+
? `${steps === 1 ? 'One step' : `${steps} steps`} needed your approval while nobody was watching; none ${steps === 1 ? 'was' : 'were'} confirmed as declined. Run the agent by hand to do ${steps === 1 ? 'it' : 'them'} with you watching.`
|
|
483
|
+
: declined === 1
|
|
484
|
+
? 'One step was declined because nobody was watching. Run the agent by hand to do it with you watching.'
|
|
485
|
+
: `${declined} steps were declined because nobody was watching. Run the agent by hand to do them with you watching.` }));
|
|
486
|
+
}
|
|
487
|
+
if (asked) {
|
|
488
|
+
details.append(el('p', { class: 'ag-help', text: asked === 1
|
|
489
|
+
? 'The AI asked one question while nobody was watching, so nobody answered it. If your answer changes what it should do, run the agent again by hand.'
|
|
490
|
+
: `The AI asked ${asked} questions while nobody was watching, so nobody answered them. If your answers change what it should do, run the agent again by hand.` }));
|
|
491
|
+
}
|
|
476
492
|
const list = el('ul', { class: 'ag-question-list' });
|
|
477
493
|
for (const entry of d.list) {
|
|
478
|
-
const status =
|
|
494
|
+
const status = isQuestion(entry)
|
|
495
|
+
? QUESTION_LABEL[entry.state] || (working ? 'Telling the AI to go on' : 'Could not confirm whether the AI went on')
|
|
496
|
+
: DECLINE_LABEL[entry.state] || (working ? 'Being declined' : 'Could not confirm whether it was answered');
|
|
479
497
|
list.append(el('li', {}, el('span', { class: 'ag-state', text: status }), el('span', { class: 'ag-question-text', text: entry.summary })));
|
|
480
498
|
}
|
|
481
499
|
details.append(list);
|
|
482
|
-
const more = d.moreDeclined + d.moreNotSent;
|
|
483
|
-
if (more)
|
|
500
|
+
const more = d.moreDeclined + d.moreNotSent + moreAssumed + moreQuestionsNotSent;
|
|
501
|
+
if (more) {
|
|
502
|
+
details.append(el('p', { class: 'ag-help', text: `…and ${more} more not listed here (${d.moreDeclined} declined, ${d.moreNotSent} stopped before they were answered${moreAssumed ? `, ${moreAssumed} went on without your answer` : ''}${moreQuestionsNotSent ? `, ${moreQuestionsNotSent} stopped before the AI could go on` : ''}).` }));
|
|
503
|
+
}
|
|
484
504
|
return details;
|
|
485
505
|
}
|
|
486
506
|
|