Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/automation_engine.py +96 -4
- web/src/automation/AutomationBuilder.tsx +119 -28
- web/src/index.css +14 -0
RELEASES.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v13",
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "446ffb3",
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v13",
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
446ffb3
|
api/automation_engine.py
CHANGED
|
@@ -1953,6 +1953,47 @@ def bd_ready():
|
|
| 1953 |
return bool(bd_key())
|
| 1954 |
|
| 1955 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1956 |
def bd_call(path, params=None, body=None):
|
| 1957 |
"""One authenticated vendor call. GET when `body` is None, POST otherwise.
|
| 1958 |
|
|
@@ -1996,7 +2037,7 @@ def bd_call(path, params=None, body=None):
|
|
| 1996 |
# below is SERIAL by construction.
|
| 1997 |
return None, "the profile source is busy with another search; they run one at a time"
|
| 1998 |
if not (200 <= status < 300):
|
| 1999 |
-
return None, f"the profile source answered {status}"
|
| 2000 |
# β A BODY THAT REACHED THE READ CEILING IS A TRUNCATION, AND IT MUST SAY SO. `fetch` reads
|
| 2001 |
# at most `max_kb` and returns what it got β silently. A truncated JSON document then fails
|
| 2002 |
# `json.loads`, falls through to the NDJSON branch, and comes back as "answered with
|
|
@@ -3115,6 +3156,47 @@ def discover_estimate(records_limit):
|
|
| 3115 |
"a price before a run, and this account's token cannot read a balance"}
|
| 3116 |
|
| 3117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3118 |
def expand_predicates(predicates):
|
| 3119 |
"""Stored predicates β the vendor's `filters` list, expanding a value LIST into a nested OR.
|
| 3120 |
|
|
@@ -3132,9 +3214,14 @@ def expand_predicates(predicates):
|
|
| 3132 |
for p in predicates or []:
|
| 3133 |
v = (p or {}).get("value")
|
| 3134 |
if isinstance(v, list) and len(v) > 1:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3135 |
out.append({"operator": "or",
|
| 3136 |
-
"filters":
|
| 3137 |
-
|
|
|
|
| 3138 |
elif isinstance(v, list):
|
| 3139 |
out.append({**p, "value": v[0]} if v else
|
| 3140 |
{k: val for k, val in p.items() if k != "value"})
|
|
@@ -3152,7 +3239,12 @@ def bd_filter_start(predicates, operator="and", records_limit=5, dataset_id=BD_D
|
|
| 3152 |
HAS been measured end-to-end. One shape, and it is the tested one.
|
| 3153 |
"""
|
| 3154 |
body = {"dataset_id": dataset_id, "records_limit": int(records_limit),
|
| 3155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3156 |
payload, note = bd_call(BD_PATH_FILTER, body=body)
|
| 3157 |
if note:
|
| 3158 |
return "", note
|
|
|
|
| 1953 |
return bool(bd_key())
|
| 1954 |
|
| 1955 |
|
| 1956 |
+
def _bd_why(raw, key=""):
|
| 1957 |
+
"""The vendor's OWN words for a refusal, as `" β β¦"`, or `""` when it gave none.
|
| 1958 |
+
|
| 1959 |
+
β THIS WAS THROWN AWAY, AND THE COST WAS MEASURED RATHER THAN IMAGINED. nurilab's live
|
| 1960 |
+
discovery automation failed four runs across two days with `the profile source answered 400`
|
| 1961 |
+
while the body it discarded said, in full:
|
| 1962 |
+
|
| 1963 |
+
{"validation_errors":["Filter logical groups can have a maximum of 4 rules."]}
|
| 1964 |
+
|
| 1965 |
+
β the exact instruction needed to fix it, in our hands, deleted one line before the customer.
|
| 1966 |
+
A bare status code sends somebody to read a vendor's schema for a fault we were already
|
| 1967 |
+
holding the answer to; it is the same defect as a green dot over nothing, pointed the other
|
| 1968 |
+
way. Every non-2xx says WHY now, and the named cases above (402/401/403/429) keep their own
|
| 1969 |
+
plainer sentences because those are ours to explain, not the vendor's.
|
| 1970 |
+
"""
|
| 1971 |
+
try:
|
| 1972 |
+
text = bytes(raw or b"").decode("utf-8", "replace").strip()[:600]
|
| 1973 |
+
except Exception: # noqa: BLE001
|
| 1974 |
+
return ""
|
| 1975 |
+
if not text:
|
| 1976 |
+
return ""
|
| 1977 |
+
why = ""
|
| 1978 |
+
try:
|
| 1979 |
+
d = json.loads(text)
|
| 1980 |
+
except Exception: # noqa: BLE001
|
| 1981 |
+
d = None
|
| 1982 |
+
if isinstance(d, dict):
|
| 1983 |
+
errs = d.get("validation_errors") or d.get("errors")
|
| 1984 |
+
if isinstance(errs, list) and errs:
|
| 1985 |
+
why = "; ".join(str(e) for e in errs)
|
| 1986 |
+
else:
|
| 1987 |
+
why = str(d.get("error") or d.get("message") or d.get("detail") or "")
|
| 1988 |
+
why = why or text
|
| 1989 |
+
# β A BODY WE DID NOT WRITE GETS THE SAME TREATMENT AS AN EXCEPTION'S str(). `bd_call` already
|
| 1990 |
+
# refuses to put the latter on the wire in case it carries the key; promising that a vendor
|
| 1991 |
+
# never echoes an Authorization header back is not a guarantee this module can make.
|
| 1992 |
+
if key and key in why:
|
| 1993 |
+
why = why.replace(key, "***")
|
| 1994 |
+
return f" β {_s(why, 300)}"
|
| 1995 |
+
|
| 1996 |
+
|
| 1997 |
def bd_call(path, params=None, body=None):
|
| 1998 |
"""One authenticated vendor call. GET when `body` is None, POST otherwise.
|
| 1999 |
|
|
|
|
| 2037 |
# below is SERIAL by construction.
|
| 2038 |
return None, "the profile source is busy with another search; they run one at a time"
|
| 2039 |
if not (200 <= status < 300):
|
| 2040 |
+
return None, f"the profile source answered {status}{_bd_why(raw, key)}"
|
| 2041 |
# β A BODY THAT REACHED THE READ CEILING IS A TRUNCATION, AND IT MUST SAY SO. `fetch` reads
|
| 2042 |
# at most `max_kb` and returns what it got β silently. A truncated JSON document then fails
|
| 2043 |
# `json.loads`, falls through to the NDJSON branch, and comes back as "answered with
|
|
|
|
| 3156 |
"a price before a run, and this account's token cannot read a balance"}
|
| 3157 |
|
| 3158 |
|
| 3159 |
+
#: β THE VENDOR'S HARD CAP ON ONE LOGICAL GROUP β MEASURED 2026-08-06 against the live filter API
|
| 3160 |
+
#: with nurilab's own seven-condition search, which had failed every run for two days:
|
| 3161 |
+
#:
|
| 3162 |
+
#: 400 {"validation_errors":["Filter logical groups can have a maximum of 4 rules."]}
|
| 3163 |
+
#:
|
| 3164 |
+
#: β EVERY ONE OF THOSE SEVEN CONDITIONS IS ACCEPTED ALONE (all seven probed individually, all
|
| 3165 |
+
#: 200). The refusal is about the SHAPE of the group and nothing else β so no field, operator or
|
| 3166 |
+
#: value in the builder is at fault, and no amount of editing the conditions would have found it.
|
| 3167 |
+
#: What it means without `bd_group` below: the FIFTH condition anybody adds turns a working
|
| 3168 |
+
#: discovery automation into one that fails forever, and the surface blames the search.
|
| 3169 |
+
BD_GROUP_MAX = 4
|
| 3170 |
+
|
| 3171 |
+
|
| 3172 |
+
def bd_group(nodes, operator):
|
| 3173 |
+
"""`nodes` β an equivalent list in which NO logical group exceeds `BD_GROUP_MAX` rules.
|
| 3174 |
+
|
| 3175 |
+
β SAFE BECAUSE AND AND OR ARE ASSOCIATIVE. Folding a run of same-operator rules into a nested
|
| 3176 |
+
group of the SAME operator cannot change what the filter matches β `aβ§bβ§cβ§dβ§e` and
|
| 3177 |
+
`(aβ§bβ§cβ§d)β§e` are one predicate written two ways. That is why this is a re-SHAPING of the
|
| 3178 |
+
owner's search rather than a reinterpretation of it, and why it needs no ruling: a condition
|
| 3179 |
+
list means the same thing before and after. Nesting itself is already proven on this API
|
| 3180 |
+
(`expand_predicates`' or-groups, `snap_msh14ix81n8hlpo3nr`).
|
| 3181 |
+
|
| 3182 |
+
β A ONE-RULE CHUNK IS NEVER WRAPPED. `expand_predicates` already carries that law for the
|
| 3183 |
+
one-value case β a one-element group is a shape nothing has ever been billed against β and a
|
| 3184 |
+
balanced split reaches it whenever a level divides with a remainder of one.
|
| 3185 |
+
"""
|
| 3186 |
+
nodes = list(nodes or [])
|
| 3187 |
+
if len(nodes) <= BD_GROUP_MAX:
|
| 3188 |
+
return nodes
|
| 3189 |
+
# β BALANCED, NOT "take three and nest the rest". The tail-recursive shape costs one level of
|
| 3190 |
+
# DEPTH per extra rule (13 conditions β 5 deep) against a vendor whose nesting limit we have
|
| 3191 |
+
# not measured and would discover the same way we discovered this one: in production, on
|
| 3192 |
+
# somebody's automation. Chunking makes the depth logβ(n) β 16 conditions fit in two levels.
|
| 3193 |
+
out = []
|
| 3194 |
+
for i in range(0, len(nodes), BD_GROUP_MAX):
|
| 3195 |
+
chunk = nodes[i:i + BD_GROUP_MAX]
|
| 3196 |
+
out.append(chunk[0] if len(chunk) == 1 else {"operator": operator, "filters": chunk})
|
| 3197 |
+
return bd_group(out, operator)
|
| 3198 |
+
|
| 3199 |
+
|
| 3200 |
def expand_predicates(predicates):
|
| 3201 |
"""Stored predicates β the vendor's `filters` list, expanding a value LIST into a nested OR.
|
| 3202 |
|
|
|
|
| 3214 |
for p in predicates or []:
|
| 3215 |
v = (p or {}).get("value")
|
| 3216 |
if isinstance(v, list) and len(v) > 1:
|
| 3217 |
+
# β THE OR-GROUP IS SUBJECT TO THE SAME 4-RULE CAP as the outer one, and this is the
|
| 3218 |
+
# leg that hits it first in practice: "Bio contains any of floral, flower, beauty,
|
| 3219 |
+
# bouquet, wedding" is five keywords in ONE condition β a single row in the builder,
|
| 3220 |
+
# and a group the vendor refuses. `bd_group` is applied to the union too.
|
| 3221 |
out.append({"operator": "or",
|
| 3222 |
+
"filters": bd_group(
|
| 3223 |
+
[{"name": p["name"], "operator": p["operator"], "value": one}
|
| 3224 |
+
for one in v], "or")})
|
| 3225 |
elif isinstance(v, list):
|
| 3226 |
out.append({**p, "value": v[0]} if v else
|
| 3227 |
{k: val for k, val in p.items() if k != "value"})
|
|
|
|
| 3239 |
HAS been measured end-to-end. One shape, and it is the tested one.
|
| 3240 |
"""
|
| 3241 |
body = {"dataset_id": dataset_id, "records_limit": int(records_limit),
|
| 3242 |
+
# β `bd_group` β the top-level group obeys the vendor's 4-rule cap (see its note).
|
| 3243 |
+
# Applied HERE rather than inside `expand_predicates` so the expansion stays a pure
|
| 3244 |
+
# stored-shape β wire-shape translation and the rebalance is one readable step on the
|
| 3245 |
+
# one path that actually posts a filter.
|
| 3246 |
+
"filter": {"operator": operator,
|
| 3247 |
+
"filters": bd_group(expand_predicates(predicates), operator)}}
|
| 3248 |
payload, note = bd_call(BD_PATH_FILTER, body=body)
|
| 3249 |
if note:
|
| 3250 |
return "", note
|
web/src/automation/AutomationBuilder.tsx
CHANGED
|
@@ -31,7 +31,7 @@
|
|
| 31 |
// AutomationTrigger).
|
| 32 |
// ---------------------------------------------------------------------------
|
| 33 |
import type { ReactNode } from "react";
|
| 34 |
-
import { useRef, useState } from "react";
|
| 35 |
|
| 36 |
import type {
|
| 37 |
Action,
|
|
@@ -321,6 +321,41 @@ export default function AutomationBuilder({
|
|
| 321 |
* own. A ref and not state, because the click arrives before a re-render would land.
|
| 322 |
*/
|
| 323 |
const draggedRef = useRef(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
|
| 325 |
const trigger = automation.trigger || null;
|
| 326 |
const triggerKey = trigger?.key || (automation.schedule?.enabled ? "schedule" : "manual");
|
|
@@ -915,14 +950,35 @@ export default function AutomationBuilder({
|
|
| 915 |
it is the server's list so it cannot describe a trigger we removed.
|
| 916 |
*/
|
| 917 |
<>
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 926 |
{options.length ? (
|
| 927 |
<div className="autox-suggest">
|
| 928 |
<p className="autox-suggest-head">Suggested triggers</p>
|
|
@@ -1112,6 +1168,13 @@ export default function AutomationBuilder({
|
|
| 1112 |
) : (
|
| 1113 |
<ActionProps
|
| 1114 |
action={findAction(actions, sel.id)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1115 |
catalog={catalog}
|
| 1116 |
tables={tables}
|
| 1117 |
walkFields={walkFields}
|
|
@@ -1150,22 +1213,11 @@ export default function AutomationBuilder({
|
|
| 1150 |
</div>
|
| 1151 |
) : null}
|
| 1152 |
|
| 1153 |
-
{/* THE PICKER
|
| 1154 |
-
|
| 1155 |
-
|
| 1156 |
-
|
| 1157 |
-
|
| 1158 |
-
Connector) with connector rows nested under their product name. */}
|
| 1159 |
-
{picking ? (
|
| 1160 |
-
<TriggerPicker
|
| 1161 |
-
variant="menu"
|
| 1162 |
-
options={options}
|
| 1163 |
-
value={triggerKey}
|
| 1164 |
-
disabled={busy}
|
| 1165 |
-
onPick={onPickTrigger}
|
| 1166 |
-
onDismiss={() => setPicking(false)}
|
| 1167 |
-
/>
|
| 1168 |
-
) : null}
|
| 1169 |
</>
|
| 1170 |
);
|
| 1171 |
}
|
|
@@ -1637,6 +1689,7 @@ function TriggerProps({
|
|
| 1637 |
|
| 1638 |
function ActionProps({
|
| 1639 |
action,
|
|
|
|
| 1640 |
catalog,
|
| 1641 |
tables,
|
| 1642 |
walkFields,
|
|
@@ -1647,6 +1700,21 @@ function ActionProps({
|
|
| 1647 |
onEdit,
|
| 1648 |
}: {
|
| 1649 |
action: Action | null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1650 |
catalog: ActionCatalogRow[];
|
| 1651 |
tables: UserTable[];
|
| 1652 |
/**
|
|
@@ -1768,6 +1836,19 @@ function ActionProps({
|
|
| 1768 |
</div>
|
| 1769 |
) : null}
|
| 1770 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1771 |
{/*
|
| 1772 |
β WAVE 25 item 2 (ruling R1a, contract C5, wiring W25-5) β KEEP RECORDS UNIQUE.
|
| 1773 |
Today's Create record APPENDS FOREVER: `_commit_action_writes` mints `max(id)+1`, so any
|
|
@@ -1785,7 +1866,7 @@ function ActionProps({
|
|
| 1785 |
writes FIRST while still allowing the rest: pre-empting the refusal here would be a second
|
| 1786 |
copy of a server rule, and this file's law is that the server owns legality.
|
| 1787 |
*/}
|
| 1788 |
-
{action.kind === "create_record" ? (
|
| 1789 |
<div className="auto-field">
|
| 1790 |
<label htmlFor="autox-aunique">Keep records unique on</label>
|
| 1791 |
<select
|
|
@@ -1901,7 +1982,7 @@ function ActionProps({
|
|
| 1901 |
</>
|
| 1902 |
) : null}
|
| 1903 |
|
| 1904 |
-
{action.kind === "update_record" || action.kind === "create_record" ? (
|
| 1905 |
<>
|
| 1906 |
<p className="auto-field-label">
|
| 1907 |
<span className="autox-req">*</span> Values
|
|
@@ -1968,8 +2049,18 @@ function ActionProps({
|
|
| 1968 |
>
|
| 1969 |
+ Add a value
|
| 1970 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1971 |
<p className="auto-hint">
|
| 1972 |
-
|
|
|
|
|
|
|
|
|
|
| 1973 |
</p>
|
| 1974 |
</>
|
| 1975 |
) : null}
|
|
|
|
| 31 |
// AutomationTrigger).
|
| 32 |
// ---------------------------------------------------------------------------
|
| 33 |
import type { ReactNode } from "react";
|
| 34 |
+
import { useEffect, useRef, useState } from "react";
|
| 35 |
|
| 36 |
import type {
|
| 37 |
Action,
|
|
|
|
| 321 |
* own. A ref and not state, because the click arrives before a re-render would land.
|
| 322 |
*/
|
| 323 |
const draggedRef = useRef(false);
|
| 324 |
+
/**
|
| 325 |
+
* β THE TRIGGER MENU IS ANCHORED TO ITS BOX, AND THAT IS A LAYOUT FACT BEFORE IT IS A
|
| 326 |
+
* DISMISSAL ONE (owner's ERROR 4, 2026-08-06). `<TriggerPicker variant="menu">` was rendered at
|
| 327 |
+
* the BOTTOM of this component's fragment β a sibling of `.autox-flow` and the `.autox-props`
|
| 328 |
+
* aside, inside `.auto-work`, which is `display: flex`. So opening it added a THIRD COLUMN to
|
| 329 |
+
* the builder: the menu landed to the right of the Properties panel, off the edge of the
|
| 330 |
+
* window, and the flow column (`flex: 1 1 auto; min-width: 0`) collapsed under it until
|
| 331 |
+
* "Suggested triggers" wrapped one word per line and the canvas grew a horizontal scrollbar.
|
| 332 |
+
* Nothing was broken about the menu β it was in the wrong parent.
|
| 333 |
+
*
|
| 334 |
+
* It lives inside `.autox-main` beside its own button now, and this ref is what makes the pair
|
| 335 |
+
* ONE unit: an outside mousedown must not count the button that opens it as "outside", or the
|
| 336 |
+
* click would close and reopen it forever. `TriggerPicker`'s own doc says the caller owns
|
| 337 |
+
* open-ness for the `menu` variant precisely because the caller owns the anchor.
|
| 338 |
+
*/
|
| 339 |
+
const addWrap = useRef<HTMLDivElement | null>(null);
|
| 340 |
+
|
| 341 |
+
// Escape and an outside click both close it β the `field` variant's rule, applied to the twin
|
| 342 |
+
// that had neither. Without this the empty state's menu was a one-way door: every row picks a
|
| 343 |
+
// trigger, so changing your mind meant picking one you did not want.
|
| 344 |
+
useEffect(() => {
|
| 345 |
+
if (!picking) return;
|
| 346 |
+
const onKey = (e: KeyboardEvent) => {
|
| 347 |
+
if (e.key === "Escape") setPicking(false);
|
| 348 |
+
};
|
| 349 |
+
const onDown = (e: MouseEvent) => {
|
| 350 |
+
if (!addWrap.current?.contains(e.target as Node)) setPicking(false);
|
| 351 |
+
};
|
| 352 |
+
window.addEventListener("keydown", onKey);
|
| 353 |
+
window.addEventListener("mousedown", onDown);
|
| 354 |
+
return () => {
|
| 355 |
+
window.removeEventListener("keydown", onKey);
|
| 356 |
+
window.removeEventListener("mousedown", onDown);
|
| 357 |
+
};
|
| 358 |
+
}, [picking]);
|
| 359 |
|
| 360 |
const trigger = automation.trigger || null;
|
| 361 |
const triggerKey = trigger?.key || (automation.schedule?.enabled ? "schedule" : "manual");
|
|
|
|
| 950 |
it is the server's list so it cannot describe a trigger we removed.
|
| 951 |
*/
|
| 952 |
<>
|
| 953 |
+
{/* THE BOX AND ITS MENU ARE ONE UNIT (see `addWrap`). The menu USED to render at
|
| 954 |
+
the bottom of this component, outside `.autox-flow` entirely, and became a
|
| 955 |
+
third column of the flex row that holds the canvas and Properties β the
|
| 956 |
+
owner's ERROR 4. */}
|
| 957 |
+
<div className="autox-trigadd" ref={addWrap}>
|
| 958 |
+
<button
|
| 959 |
+
type="button"
|
| 960 |
+
className="autox-add is-empty"
|
| 961 |
+
disabled={busy || !options.length}
|
| 962 |
+
aria-haspopup="listbox"
|
| 963 |
+
aria-expanded={picking}
|
| 964 |
+
onClick={() => setPicking((v) => !v)}
|
| 965 |
+
>
|
| 966 |
+
+ Add trigger
|
| 967 |
+
</button>
|
| 968 |
+
{/* β WAVE 25 item 5b (C2) β `TriggerPicker`, the SAME component Properties β
|
| 969 |
+
Trigger details renders in its compact form. Category first (Time /
|
| 970 |
+
Database / Connector) with connector rows nested under their product. */}
|
| 971 |
+
{picking ? (
|
| 972 |
+
<TriggerPicker
|
| 973 |
+
variant="menu"
|
| 974 |
+
options={options}
|
| 975 |
+
value={triggerKey}
|
| 976 |
+
disabled={busy}
|
| 977 |
+
onPick={onPickTrigger}
|
| 978 |
+
onDismiss={() => setPicking(false)}
|
| 979 |
+
/>
|
| 980 |
+
) : null}
|
| 981 |
+
</div>
|
| 982 |
{options.length ? (
|
| 983 |
<div className="autox-suggest">
|
| 984 |
<p className="autox-suggest-head">Suggested triggers</p>
|
|
|
|
| 1168 |
) : (
|
| 1169 |
<ActionProps
|
| 1170 |
action={findAction(actions, sel.id)}
|
| 1171 |
+
/* β THE SAME RULE `actionCard` DERIVES AND THE SERVER ENFORCES (`ig_action_pinned`),
|
| 1172 |
+
passed down rather than re-derived a third time. The panel needs it because the
|
| 1173 |
+
pinned step is the one action in the product whose value map the ENGINE NEVER
|
| 1174 |
+
READS β see `ActionProps`. */
|
| 1175 |
+
pinned={
|
| 1176 |
+
automation.kind === "discover_instagram" && sel.id === actions[0]?.id
|
| 1177 |
+
}
|
| 1178 |
catalog={catalog}
|
| 1179 |
tables={tables}
|
| 1180 |
walkFields={walkFields}
|
|
|
|
| 1213 |
</div>
|
| 1214 |
) : null}
|
| 1215 |
|
| 1216 |
+
{/* β THE PICKER USED TO RENDER HERE, and here is outside both columns. `.auto-work` is a
|
| 1217 |
+
flex row of `.autox-flow` + `.autox-props`, so a third child was laid out as a third
|
| 1218 |
+
COLUMN β the menu appeared past the right edge of the Properties panel and squeezed the
|
| 1219 |
+
canvas until the suggested triggers wrapped one word per line (owner's ERROR 4). It is
|
| 1220 |
+
rendered beside its own "+ Add trigger" box now; see `addWrap`. */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1221 |
</>
|
| 1222 |
);
|
| 1223 |
}
|
|
|
|
| 1689 |
|
| 1690 |
function ActionProps({
|
| 1691 |
action,
|
| 1692 |
+
pinned,
|
| 1693 |
catalog,
|
| 1694 |
tables,
|
| 1695 |
walkFields,
|
|
|
|
| 1700 |
onEdit,
|
| 1701 |
}: {
|
| 1702 |
action: Action | null;
|
| 1703 |
+
/**
|
| 1704 |
+
* β THE PERMANENT STEP 1 OF AN INSTAGRAM SEARCH (owner report, 2026-08-06). It is the ONE
|
| 1705 |
+
* action whose `values` and `uniqueOn` the engine never reads: `apply_actions` drops
|
| 1706 |
+
* `actions[0]` for `discover_instagram` and the runner does the writing itself, upserting the
|
| 1707 |
+
* profile columns on `(handle, created_by)`.
|
| 1708 |
+
*
|
| 1709 |
+
* The card stays β "this search puts what it finds in a database" is true and worth showing β
|
| 1710 |
+
* but a `* Values` editor above `{{column_key}} reads that column off the record walking the
|
| 1711 |
+
* flow` is a required-looking control over a step nothing walks, and the owner spent a session
|
| 1712 |
+
* trying to make sense of it. Worse, it was ANSWERABLE: remapping it to `name: {{handle}}`
|
| 1713 |
+
* saved cleanly, changed nothing, and left the panel describing a write the engine does not
|
| 1714 |
+
* perform. A picture of the engine that disagrees with the engine is the defect this file
|
| 1715 |
+
* refuses in five other places.
|
| 1716 |
+
*/
|
| 1717 |
+
pinned: boolean;
|
| 1718 |
catalog: ActionCatalogRow[];
|
| 1719 |
tables: UserTable[];
|
| 1720 |
/**
|
|
|
|
| 1836 |
</div>
|
| 1837 |
) : null}
|
| 1838 |
|
| 1839 |
+
{/* WHAT THE SEARCH ACTUALLY WRITES, in place of the two controls below that do not apply to
|
| 1840 |
+
it. β THE LIST IS `_candidate_row`'s, field for field: a shorter "the profile columns"
|
| 1841 |
+
would be safe and useless, and a list that drifts from what the engine writes would be
|
| 1842 |
+
the same lie the value map was. */}
|
| 1843 |
+
{pinned ? (
|
| 1844 |
+
<p className="auto-hint">
|
| 1845 |
+
The search writes one row per profile it finds β handle, profile link, name, followers,
|
| 1846 |
+
following, average engagement, bio, link in bio, verified and category β into that
|
| 1847 |
+
database. It matches on the handle, so a profile found again updates its row instead of
|
| 1848 |
+
adding another. There is nothing to map: the columns come from the search.
|
| 1849 |
+
</p>
|
| 1850 |
+
) : null}
|
| 1851 |
+
|
| 1852 |
{/*
|
| 1853 |
β WAVE 25 item 2 (ruling R1a, contract C5, wiring W25-5) β KEEP RECORDS UNIQUE.
|
| 1854 |
Today's Create record APPENDS FOREVER: `_commit_action_writes` mints `max(id)+1`, so any
|
|
|
|
| 1866 |
writes FIRST while still allowing the rest: pre-empting the refusal here would be a second
|
| 1867 |
copy of a server rule, and this file's law is that the server owns legality.
|
| 1868 |
*/}
|
| 1869 |
+
{action.kind === "create_record" && !pinned ? (
|
| 1870 |
<div className="auto-field">
|
| 1871 |
<label htmlFor="autox-aunique">Keep records unique on</label>
|
| 1872 |
<select
|
|
|
|
| 1982 |
</>
|
| 1983 |
) : null}
|
| 1984 |
|
| 1985 |
+
{(action.kind === "update_record" || action.kind === "create_record") && !pinned ? (
|
| 1986 |
<>
|
| 1987 |
<p className="auto-field-label">
|
| 1988 |
<span className="autox-req">*</span> Values
|
|
|
|
| 2049 |
>
|
| 2050 |
+ Add a value
|
| 2051 |
</button>
|
| 2052 |
+
{/* β THE SENTENCE THE OWNER COULD NOT PARSE, 2026-08-06. `{{column_key}}` is a
|
| 2053 |
+
PLACEHOLDER standing for a placeholder, and "the record walking the flow" is this
|
| 2054 |
+
module's internal noun for the row a step is currently running on β two layers of
|
| 2055 |
+
indirection in eleven words, above a box the reader is already unsure how to fill.
|
| 2056 |
+
It says what to TYPE, using a column this database actually has, and names the two
|
| 2057 |
+
choices as choices. `walkFields` is the walking record's columns for both action
|
| 2058 |
+
kinds, which is what a placeholder resolves against. */}
|
| 2059 |
<p className="auto-hint">
|
| 2060 |
+
Type a fixed value, or{" "}
|
| 2061 |
+
<code>{`{{${walkFields[0]?.key || "column"}}}`}</code> to copy{" "}
|
| 2062 |
+
{walkFields[0]?.label ? <>β{walkFields[0].label}β</> : "a column"} from the record this
|
| 2063 |
+
step is running on.
|
| 2064 |
</p>
|
| 2065 |
</>
|
| 2066 |
) : null}
|
web/src/index.css
CHANGED
|
@@ -8670,6 +8670,20 @@ a.cg-map-ctl-b { text-decoration: none; }
|
|
| 8670 |
.autox-add.is-empty { padding: 18px 10px; }
|
| 8671 |
.autox-add.is-nested { max-width: 420px; }
|
| 8672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8673 |
/* ββ the suggested-trigger list (image 1) βββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 8674 |
.autox-suggest { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 460px; }
|
| 8675 |
.autox-suggest-head {
|
|
|
|
| 8670 |
.autox-add.is-empty { padding: 18px 10px; }
|
| 8671 |
.autox-add.is-nested { max-width: 420px; }
|
| 8672 |
|
| 8673 |
+
/* β THE "+ Add trigger" BOX AND ITS MENU ARE ONE UNIT (owner's ERROR 4, 2026-08-06). The menu
|
| 8674 |
+
was rendered outside `.autox-flow` altogether and became a third child of `.auto-work`'s flex
|
| 8675 |
+
row β laid out as a COLUMN to the right of the Properties panel while the canvas collapsed
|
| 8676 |
+
under it. It is a child of `.autox-main` now, and this wrapper carries the SAME geometry the
|
| 8677 |
+
bare button had (`width: 100%; max-width: 460px`, matching `.autox-add` and `.autox-menu`), so
|
| 8678 |
+
the closed state is pixel-identical to what shipped. */
|
| 8679 |
+
.autox-trigadd {
|
| 8680 |
+
display: flex;
|
| 8681 |
+
flex-direction: column;
|
| 8682 |
+
gap: 6px;
|
| 8683 |
+
width: 100%;
|
| 8684 |
+
max-width: 460px;
|
| 8685 |
+
}
|
| 8686 |
+
|
| 8687 |
/* ββ the suggested-trigger list (image 1) βββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 8688 |
.autox-suggest { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 460px; }
|
| 8689 |
.autox-suggest-head {
|