@tai42/studio-sdk 13.3.0 → 14.0.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/components/icons.d.ts +2 -0
- package/dist/components/icons.d.ts.map +1 -1
- package/dist/components/icons.js +2 -0
- package/dist/components/icons.js.map +1 -1
- package/dist/hooks/useApi.d.ts +199 -24
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/navigation/types.d.ts +2 -1
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/query-keys.d.ts +13 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +13 -0
- package/dist/query-keys.js.map +1 -1
- package/dist/state-binding/AdapterMapping.d.ts +33 -0
- package/dist/state-binding/AdapterMapping.d.ts.map +1 -0
- package/dist/state-binding/AdapterMapping.js +205 -0
- package/dist/state-binding/AdapterMapping.js.map +1 -0
- package/dist/state-binding/BindingJqField.d.ts +36 -0
- package/dist/state-binding/BindingJqField.d.ts.map +1 -0
- package/dist/state-binding/BindingJqField.js +54 -0
- package/dist/state-binding/BindingJqField.js.map +1 -0
- package/dist/state-binding/InputInjectionRow.d.ts +17 -0
- package/dist/state-binding/InputInjectionRow.d.ts.map +1 -0
- package/dist/state-binding/InputInjectionRow.js +55 -0
- package/dist/state-binding/InputInjectionRow.js.map +1 -0
- package/dist/state-binding/StateAttachRow.d.ts +25 -0
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -0
- package/dist/state-binding/StateAttachRow.js +101 -0
- package/dist/state-binding/StateAttachRow.js.map +1 -0
- package/dist/state-binding/StateBindingEditor.d.ts +35 -0
- package/dist/state-binding/StateBindingEditor.d.ts.map +1 -0
- package/dist/state-binding/StateBindingEditor.js +52 -0
- package/dist/state-binding/StateBindingEditor.js.map +1 -0
- package/dist/state-binding/StateBindingSection.d.ts +14 -0
- package/dist/state-binding/StateBindingSection.d.ts.map +1 -0
- package/dist/state-binding/StateBindingSection.js +17 -0
- package/dist/state-binding/StateBindingSection.js.map +1 -0
- package/dist/state-binding/SubjectScopeFields.d.ts +17 -0
- package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -0
- package/dist/state-binding/SubjectScopeFields.js +8 -0
- package/dist/state-binding/SubjectScopeFields.js.map +1 -0
- package/dist/state-binding/UpdateRow.d.ts +19 -0
- package/dist/state-binding/UpdateRow.d.ts.map +1 -0
- package/dist/state-binding/UpdateRow.js +76 -0
- package/dist/state-binding/UpdateRow.js.map +1 -0
- package/dist/state-binding/adapter.d.ts +93 -0
- package/dist/state-binding/adapter.d.ts.map +1 -0
- package/dist/state-binding/adapter.js +251 -0
- package/dist/state-binding/adapter.js.map +1 -0
- package/dist/state-binding/build-catalog.d.ts +19 -0
- package/dist/state-binding/build-catalog.d.ts.map +1 -0
- package/dist/state-binding/build-catalog.js +43 -0
- package/dist/state-binding/build-catalog.js.map +1 -0
- package/dist/state-binding/catalog.d.ts +26 -0
- package/dist/state-binding/catalog.d.ts.map +1 -0
- package/dist/state-binding/catalog.js +71 -0
- package/dist/state-binding/catalog.js.map +1 -0
- package/dist/state-binding/index.d.ts +29 -0
- package/dist/state-binding/index.d.ts.map +1 -0
- package/dist/state-binding/index.js +18 -0
- package/dist/state-binding/index.js.map +1 -0
- package/dist/state-binding/types.d.ts +57 -0
- package/dist/state-binding/types.d.ts.map +1 -0
- package/dist/state-binding/types.js +2 -0
- package/dist/state-binding/types.js.map +1 -0
- package/package.json +5 -5
- package/src/components/icons.tsx +8 -0
- package/src/index.ts +63 -1
- package/src/navigation/types.ts +4 -1
- package/src/query-keys.ts +15 -0
- package/src/state-binding/AdapterMapping.tsx +468 -0
- package/src/state-binding/BindingJqField.tsx +134 -0
- package/src/state-binding/InputInjectionRow.tsx +148 -0
- package/src/state-binding/README.md +46 -0
- package/src/state-binding/StateAttachRow.tsx +281 -0
- package/src/state-binding/StateBindingEditor.tsx +158 -0
- package/src/state-binding/StateBindingSection.tsx +37 -0
- package/src/state-binding/SubjectScopeFields.tsx +49 -0
- package/src/state-binding/UpdateRow.tsx +194 -0
- package/src/state-binding/adapter.ts +276 -0
- package/src/state-binding/build-catalog.ts +59 -0
- package/src/state-binding/catalog.ts +87 -0
- package/src/state-binding/index.ts +61 -0
- package/src/state-binding/types.ts +62 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The adapter compiler — a PURE function set, no React, no jq engine.
|
|
3
|
+
*
|
|
4
|
+
* A named template `update` jq declares an input object (its `params` / declared
|
|
5
|
+
* input keys). A binding must map the run's OUTPUT (and the run's INPUT) into that
|
|
6
|
+
* object; that mapping is the `adapter` — a single jq program over `{ output, input }`
|
|
7
|
+
* that CONSTRUCTS the update jq's declared input (which the update jq then reads as
|
|
8
|
+
* `.input` alongside the record).
|
|
9
|
+
*
|
|
10
|
+
* The editor authors the adapter as a ROW form: one row per declared input key,
|
|
11
|
+
* each row picking one of three value sources — a picked field (from the run's
|
|
12
|
+
* output / input schema), a hardcoded literal, or a raw jq expression. The whole
|
|
13
|
+
* form compiles here into ONE adapter jq; each row's own jq fragment is shown on demand.
|
|
14
|
+
*
|
|
15
|
+
* Compilation never throws: an invalid literal or an empty field surfaces as a
|
|
16
|
+
* loud, human error the editor renders in a `role="alert"`, never a silent empty
|
|
17
|
+
* object.
|
|
18
|
+
*/
|
|
19
|
+
const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
20
|
+
/** An object key rendered for jq: a bare identifier, or a quoted string otherwise. */
|
|
21
|
+
export function jqKey(key) {
|
|
22
|
+
return IDENTIFIER.test(key) ? key : JSON.stringify(key);
|
|
23
|
+
}
|
|
24
|
+
/** A picked field rendered as a jq path, e.g. `.output.user.name` / `.input["odd key"]`. */
|
|
25
|
+
export function fieldPathToJq(root, path) {
|
|
26
|
+
let out = `.${root}`;
|
|
27
|
+
for (const segment of path) {
|
|
28
|
+
out += IDENTIFIER.test(segment) ? `.${segment}` : `[${JSON.stringify(segment)}]`;
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
/** The jq fragment ONE row's value compiles to — the row's "show jq". */
|
|
33
|
+
export function rowValueJq(source) {
|
|
34
|
+
switch (source.kind) {
|
|
35
|
+
case 'field':
|
|
36
|
+
return { ok: true, jq: fieldPathToJq(source.root, source.path) };
|
|
37
|
+
case 'literal': {
|
|
38
|
+
const text = source.json.trim();
|
|
39
|
+
if (text === '')
|
|
40
|
+
return { ok: false, error: 'Enter a value.' };
|
|
41
|
+
let parsed;
|
|
42
|
+
try {
|
|
43
|
+
parsed = JSON.parse(text);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { ok: false, error: 'This is not valid JSON.' };
|
|
47
|
+
}
|
|
48
|
+
// A parsed JSON value is a valid jq literal verbatim.
|
|
49
|
+
return { ok: true, jq: JSON.stringify(parsed) };
|
|
50
|
+
}
|
|
51
|
+
case 'jq': {
|
|
52
|
+
const expr = source.expr.trim();
|
|
53
|
+
if (expr === '')
|
|
54
|
+
return { ok: false, error: 'Enter a jq expression.' };
|
|
55
|
+
return { ok: true, jq: expr };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Compile a mapping form into ONE adapter jq that constructs the update jq's
|
|
61
|
+
* declared input over `{ output, input }`. An empty form compiles to the
|
|
62
|
+
* empty object `{}`; a blank target, a duplicate target, or an invalid source is a
|
|
63
|
+
* loud error.
|
|
64
|
+
*/
|
|
65
|
+
export function compileAdapter(rows) {
|
|
66
|
+
if (rows.length === 0)
|
|
67
|
+
return { ok: true, jq: '{}' };
|
|
68
|
+
const seen = new Set();
|
|
69
|
+
const parts = [];
|
|
70
|
+
for (const row of rows) {
|
|
71
|
+
const target = row.target.trim();
|
|
72
|
+
if (target === '')
|
|
73
|
+
return { ok: false, error: 'Every mapping row needs a target field.' };
|
|
74
|
+
if (seen.has(target))
|
|
75
|
+
return { ok: false, error: `The field '${target}' is mapped twice.` };
|
|
76
|
+
seen.add(target);
|
|
77
|
+
const value = rowValueJq(row.source);
|
|
78
|
+
if (!value.ok)
|
|
79
|
+
return { ok: false, error: `${target}: ${value.error}` };
|
|
80
|
+
parts.push(`${jqKey(target)}: (${value.jq})`);
|
|
81
|
+
}
|
|
82
|
+
return { ok: true, jq: `{ ${parts.join(', ')} }` };
|
|
83
|
+
}
|
|
84
|
+
/** One row per declared input key, each defaulting to a picked `output` field. */
|
|
85
|
+
export function defaultRowsForInput(params) {
|
|
86
|
+
return params.map((target) => ({
|
|
87
|
+
target,
|
|
88
|
+
source: { kind: 'field', root: 'output', path: [] },
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
// -- The round-trip: recover a mapping form from a STORED adapter jq --------------
|
|
92
|
+
//
|
|
93
|
+
// `compileAdapter` emits a canonical, PARSEABLE shape so a stored adapter reopens as
|
|
94
|
+
// the form it was authored in (never UI-only state): the object
|
|
95
|
+
// `{ <key>: (<value>), … }` where `<key>` is a bare identifier or a JSON string and
|
|
96
|
+
// `<value>` is one of — a field path `.output…` / `.input…`, a JSON literal, or a raw
|
|
97
|
+
// jq expression. `parseAdapter` inverts it; `parse(compileAdapter(rows).jq) === rows`
|
|
98
|
+
// for every row kind whose literal is already canonical JSON. A shape it does not
|
|
99
|
+
// recognise returns `null` — the editor falls back to the raw-jq escape hatch.
|
|
100
|
+
const IDENTIFIER_HEAD = /^([A-Za-z_][A-Za-z0-9_]*)/;
|
|
101
|
+
const BRACKET_SEGMENT = /^\[("(?:[^"\\]|\\.)*")\]/;
|
|
102
|
+
const ADAPTER_KEY = /^("(?:[^"\\]|\\.)*"|[A-Za-z_][A-Za-z0-9_]*)\s*:\s*\(/;
|
|
103
|
+
/** Recover a field source from a pure path expression, or `null` if it is not one. */
|
|
104
|
+
export function parseFieldPath(value) {
|
|
105
|
+
const head = /^\.(output|input)/.exec(value);
|
|
106
|
+
if (head === null)
|
|
107
|
+
return null;
|
|
108
|
+
const root = head[1];
|
|
109
|
+
let rest = value.slice(head[0].length);
|
|
110
|
+
const path = [];
|
|
111
|
+
while (rest.length > 0) {
|
|
112
|
+
if (rest.startsWith('.')) {
|
|
113
|
+
const segment = IDENTIFIER_HEAD.exec(rest.slice(1));
|
|
114
|
+
if (segment?.[1] === undefined)
|
|
115
|
+
return null;
|
|
116
|
+
path.push(segment[1]);
|
|
117
|
+
rest = rest.slice(1 + segment[0].length);
|
|
118
|
+
}
|
|
119
|
+
else if (rest.startsWith('[')) {
|
|
120
|
+
const bracket = BRACKET_SEGMENT.exec(rest);
|
|
121
|
+
if (bracket?.[1] === undefined)
|
|
122
|
+
return null;
|
|
123
|
+
path.push(JSON.parse(bracket[1]));
|
|
124
|
+
rest = rest.slice(bracket[0].length);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// Trailing content (e.g. ` + 1`) means this is a jq expression, not a path.
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return { kind: 'field', root, path };
|
|
132
|
+
}
|
|
133
|
+
/** Classify one recovered value into its source (field, else JSON literal, else jq). */
|
|
134
|
+
function parseValue(value) {
|
|
135
|
+
const field = parseFieldPath(value);
|
|
136
|
+
if (field !== null)
|
|
137
|
+
return field;
|
|
138
|
+
try {
|
|
139
|
+
const parsed = JSON.parse(value);
|
|
140
|
+
return { kind: 'literal', json: JSON.stringify(parsed) };
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return { kind: 'jq', expr: value };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Find the index of the paren that closes the `(` at `open`, respecting jq strings. */
|
|
147
|
+
function matchingParen(text, open) {
|
|
148
|
+
let depth = 0;
|
|
149
|
+
let inString = false;
|
|
150
|
+
for (let i = open; i < text.length; i += 1) {
|
|
151
|
+
const ch = text[i];
|
|
152
|
+
if (inString) {
|
|
153
|
+
if (ch === '\\')
|
|
154
|
+
i += 1;
|
|
155
|
+
else if (ch === '"')
|
|
156
|
+
inString = false;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (ch === '"')
|
|
160
|
+
inString = true;
|
|
161
|
+
else if (ch === '(')
|
|
162
|
+
depth += 1;
|
|
163
|
+
else if (ch === ')') {
|
|
164
|
+
depth -= 1;
|
|
165
|
+
if (depth === 0)
|
|
166
|
+
return i;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return -1;
|
|
170
|
+
}
|
|
171
|
+
/** Recover the mapping rows from a stored adapter jq, or `null` if it is not the generated shape. */
|
|
172
|
+
export function parseAdapter(jq) {
|
|
173
|
+
const trimmed = jq.trim();
|
|
174
|
+
if (trimmed === '{}')
|
|
175
|
+
return [];
|
|
176
|
+
if (!trimmed.startsWith('{') || !trimmed.endsWith('}'))
|
|
177
|
+
return null;
|
|
178
|
+
let inner = trimmed.slice(1, -1).trim();
|
|
179
|
+
const rows = [];
|
|
180
|
+
while (inner.length > 0) {
|
|
181
|
+
const keyMatch = ADAPTER_KEY.exec(inner);
|
|
182
|
+
if (keyMatch?.[1] === undefined)
|
|
183
|
+
return null;
|
|
184
|
+
const rawKey = keyMatch[1];
|
|
185
|
+
const target = rawKey.startsWith('"') ? JSON.parse(rawKey) : rawKey;
|
|
186
|
+
const open = keyMatch[0].length - 1;
|
|
187
|
+
const close = matchingParen(inner, open);
|
|
188
|
+
if (close === -1)
|
|
189
|
+
return null;
|
|
190
|
+
const value = inner.slice(open + 1, close).trim();
|
|
191
|
+
rows.push({ target, source: parseValue(value) });
|
|
192
|
+
inner = inner.slice(close + 1).trim();
|
|
193
|
+
if (inner.startsWith(','))
|
|
194
|
+
inner = inner.slice(1).trim();
|
|
195
|
+
else if (inner.length > 0)
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
return rows;
|
|
199
|
+
}
|
|
200
|
+
// -- The canonical single-expression form: `tjq_<callName>(<adapter object>)` --------
|
|
201
|
+
//
|
|
202
|
+
// When a template update rides inside ONE jq field (rather than the structured
|
|
203
|
+
// `template_jq` + `adapter` pair), it is written as the call `tjq_<callName>({ … })`.
|
|
204
|
+
// A jq name is `[a-z][a-z0-9_]*` (double underscores legal); a tai42 template name is a
|
|
205
|
+
// SLUG (`[a-z][a-z0-9-]*` with no leading, trailing, or consecutive hyphens). So the
|
|
206
|
+
// qualified call name is `enc(template) + "__" + name`, where `enc` maps each `-` to
|
|
207
|
+
// `_`. BECAUSE the slug has no consecutive or trailing hyphens, `enc(template)` never
|
|
208
|
+
// contains `__` and never ends in `_` — so the FIRST `__` in the call name is the
|
|
209
|
+
// unambiguous template/name boundary. Resolution back to a catalog ref is therefore
|
|
210
|
+
// injective, but done catalog-driven (`resolveCallName`, `catalog.ts`) rather than by
|
|
211
|
+
// string splitting, since a jq name may itself contain `__` after that boundary. A jq
|
|
212
|
+
// field whose expression is EXACTLY this generated call reopens as the mapping form;
|
|
213
|
+
// any other expression reopens as raw jq.
|
|
214
|
+
const TEMPLATE_CALL = /^tjq_([a-z][a-z0-9_]*)\(([\s\S]*)\)$/;
|
|
215
|
+
/**
|
|
216
|
+
* Encode a template-name slug for a jq identifier: each `-` becomes `_`. Under the slug
|
|
217
|
+
* invariant (no consecutive or trailing hyphens) the result carries no `__` and no
|
|
218
|
+
* trailing `_`, which is what makes the first `__` in a call name the template boundary.
|
|
219
|
+
*/
|
|
220
|
+
export function encodeTemplateSegment(template) {
|
|
221
|
+
return template.replace(/-/g, '_');
|
|
222
|
+
}
|
|
223
|
+
/** The jq call-name of a catalog ref: `template.name` → `enc(template)__name`; a bare `name` unchanged. */
|
|
224
|
+
function refToCallName(ref) {
|
|
225
|
+
const dot = ref.indexOf('.');
|
|
226
|
+
if (dot === -1)
|
|
227
|
+
return ref;
|
|
228
|
+
return `${encodeTemplateSegment(ref.slice(0, dot))}__${ref.slice(dot + 1)}`;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The single-expression form of a named template update built from a mapping form:
|
|
232
|
+
* `tjq_<enc(template)>__<name>({…})` for a qualified ref, `tjq_<name>({…})` for a bare
|
|
233
|
+
* one (see the module note on the `__` boundary invariant).
|
|
234
|
+
*/
|
|
235
|
+
export function generateTemplateCall(ref, rows) {
|
|
236
|
+
const compiled = compileAdapter(rows);
|
|
237
|
+
return `tjq_${refToCallName(ref)}(${compiled.ok ? compiled.jq : '{}'})`;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Recover `{ callName, adapter }` from a `tjq_<callName>(<adapter>)` call, or `null`
|
|
241
|
+
* otherwise. `callName` is the RAW jq identifier — NEVER split here (a jq name may carry
|
|
242
|
+
* its own `__` past the template boundary); resolve it to a catalog ref with
|
|
243
|
+
* `resolveCallName`.
|
|
244
|
+
*/
|
|
245
|
+
export function parseTemplateCall(expr) {
|
|
246
|
+
const match = TEMPLATE_CALL.exec(expr.trim());
|
|
247
|
+
if (match?.[1] === undefined || match[2] === undefined)
|
|
248
|
+
return null;
|
|
249
|
+
return { callName: match[1], adapter: match[2].trim() };
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/state-binding/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAqCH,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE9C,sFAAsF;AACtF,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,aAAa,CAAC,IAAe,EAAE,IAAuB;IACpE,IAAI,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACrB,KAAK,MAAM,OAAO,IAAI,IAAI,EAA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shapes into the editor's catalogs, so every door screen
|
|
3
|
+
* feeds `StateBindingEditor` the same way. Pure data transforms; the api-client types
|
|
4
|
+
* are imported type-only (this package keeps no runtime edge to the client).
|
|
5
|
+
*/
|
|
6
|
+
import type { StateListItem, StateTemplateListItem } from '@tai42/api-client';
|
|
7
|
+
import type { BindingStateOption, BindingTemplateOption, SchemaFieldPath } from './types';
|
|
8
|
+
/** The template catalog (with each template's template jq) from `listStateTemplates()`. */
|
|
9
|
+
export declare function templatesCatalogFromList(items: readonly StateTemplateListItem[]): BindingTemplateOption[];
|
|
10
|
+
/** The states catalog from `listStates()`; per-state attachments are resolved lazily elsewhere. */
|
|
11
|
+
export declare function statesCatalogFromList(states: readonly StateListItem[]): BindingStateOption[];
|
|
12
|
+
/**
|
|
13
|
+
* Flatten a JSON schema's `properties` into selectable field paths (top-level and
|
|
14
|
+
* every nested object level), each labelled with its dotted path — the picker source
|
|
15
|
+
* for the adapter's `output`/`input` roots. A non-object or property-less schema
|
|
16
|
+
* yields no fields (the field control then falls back to a free path input).
|
|
17
|
+
*/
|
|
18
|
+
export declare function fieldPathsFromSchema(schema: unknown): SchemaFieldPath[];
|
|
19
|
+
//# sourceMappingURL=build-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-catalog.d.ts","sourceRoot":"","sources":["../../src/state-binding/build-catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,KAAK,EACV,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,2FAA2F;AAC3F,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,qBAAqB,EAAE,GACtC,qBAAqB,EAAE,CAczB;AAED,mGAAmG;AACnG,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAE5F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,EAAE,CAcvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** The template catalog (with each template's template jq) from `listStateTemplates()`. */
|
|
2
|
+
export function templatesCatalogFromList(items) {
|
|
3
|
+
return items.map((item) => {
|
|
4
|
+
const templateJq = item.template_jq === null
|
|
5
|
+
? []
|
|
6
|
+
: Object.entries(item.template_jq).map(([name, jq]) => ({
|
|
7
|
+
name,
|
|
8
|
+
purpose: jq.purpose,
|
|
9
|
+
description: jq.description,
|
|
10
|
+
params: jq.params,
|
|
11
|
+
writes: jq.writes,
|
|
12
|
+
}));
|
|
13
|
+
return { name: item.name, description: item.description, templateJq };
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** The states catalog from `listStates()`; per-state attachments are resolved lazily elsewhere. */
|
|
17
|
+
export function statesCatalogFromList(states) {
|
|
18
|
+
return states.map((state) => ({ name: state.name }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Flatten a JSON schema's `properties` into selectable field paths (top-level and
|
|
22
|
+
* every nested object level), each labelled with its dotted path — the picker source
|
|
23
|
+
* for the adapter's `output`/`input` roots. A non-object or property-less schema
|
|
24
|
+
* yields no fields (the field control then falls back to a free path input).
|
|
25
|
+
*/
|
|
26
|
+
export function fieldPathsFromSchema(schema) {
|
|
27
|
+
const out = [];
|
|
28
|
+
const walk = (node, prefix) => {
|
|
29
|
+
if (typeof node !== 'object' || node === null)
|
|
30
|
+
return;
|
|
31
|
+
const props = node.properties;
|
|
32
|
+
if (typeof props !== 'object' || props === null)
|
|
33
|
+
return;
|
|
34
|
+
for (const [key, child] of Object.entries(props)) {
|
|
35
|
+
const path = [...prefix, key];
|
|
36
|
+
out.push({ path, label: path.join('.') });
|
|
37
|
+
walk(child, path);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
walk(schema, []);
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=build-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-catalog.js","sourceRoot":"","sources":["../../src/state-binding/build-catalog.ts"],"names":[],"mappings":"AAcA,2FAA2F;AAC3F,MAAM,UAAU,wBAAwB,CACtC,KAAuC;IAEvC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,UAAU,GACd,IAAI,CAAC,WAAW,KAAK,IAAI;YACvB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;gBACpD,IAAI;gBACJ,OAAO,EAAE,EAAE,CAAC,OAAO;gBACnB,WAAW,EAAE,EAAE,CAAC,WAAW;gBAC3B,MAAM,EAAE,EAAE,CAAC,MAAM;gBACjB,MAAM,EAAE,EAAE,CAAC,MAAM;aAClB,CAAC,CAAC,CAAC;QACV,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,qBAAqB,CAAC,MAAgC;IACpE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAClD,MAAM,GAAG,GAAsB,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,CAAC,IAAa,EAAE,MAAyB,EAAQ,EAAE;QAC9D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO;QACtD,MAAM,KAAK,GAAI,IAAiC,CAAC,UAAU,CAAC;QAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO;QACxD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YAC5E,MAAM,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;YAC9B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1C,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjB,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BindingTemplateJqOption, BindingTemplateOption } from './types';
|
|
2
|
+
/** One template jq of an attached template, resolved to the reference a binding stores. */
|
|
3
|
+
export interface ResolvedTemplateJq extends BindingTemplateJqOption {
|
|
4
|
+
/** The owning template. */
|
|
5
|
+
readonly template: string;
|
|
6
|
+
/** The reference a binding writes: `name`, or `template.name` when ambiguous. */
|
|
7
|
+
readonly ref: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Every template jq the given attached templates offer for a purpose (or all
|
|
11
|
+
* purposes when `purpose` is omitted), each carrying the reference a binding stores.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveTemplateJq(templateNames: readonly string[], catalog: readonly BindingTemplateOption[], purpose?: 'input' | 'update'): ResolvedTemplateJq[];
|
|
14
|
+
/** Find one resolved template jq by the reference a binding stores. */
|
|
15
|
+
export declare function findByRef(ref: string, resolved: readonly ResolvedTemplateJq[]): ResolvedTemplateJq | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a jq call name (`enc(template)__name`, or a bare `name`) back to the catalog
|
|
18
|
+
* ref, driven by the catalog — never by string splitting, since a jq name may carry its
|
|
19
|
+
* own `__` past the template boundary and `enc` maps `-`→`_`. Under the template-slug
|
|
20
|
+
* invariant (no consecutive/trailing hyphens ⇒ `enc(template)` has no `__` and no
|
|
21
|
+
* trailing `_`) the FIRST `__` is the one true boundary, so the longest encoded-template
|
|
22
|
+
* prefix whose remainder is a jq the template declares is the unique qualified match;
|
|
23
|
+
* failing that, a bare name a single template declares. `null` when nothing claims it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveCallName(callName: string, catalog: readonly BindingTemplateOption[]): string | null;
|
|
26
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/state-binding/catalog.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE9E,2FAA2F;AAC3F,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IACjE,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,OAAO,EAAE,SAAS,qBAAqB,EAAE,EACzC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAC3B,kBAAkB,EAAE,CAsBtB;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GACtC,kBAAkB,GAAG,SAAS,CAEhC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,MAAM,GAAG,IAAI,CAiBf"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure catalog helpers — resolve the template jq an attached state offers, with the
|
|
3
|
+
* name-collision rule shared by every layer: an unqualified name that TWO attached
|
|
4
|
+
* templates declare is ambiguous, so both are offered attachment-qualified as
|
|
5
|
+
* `template.name`; a name only one template declares stays bare.
|
|
6
|
+
*/
|
|
7
|
+
import { encodeTemplateSegment } from './adapter';
|
|
8
|
+
/**
|
|
9
|
+
* Every template jq the given attached templates offer for a purpose (or all
|
|
10
|
+
* purposes when `purpose` is omitted), each carrying the reference a binding stores.
|
|
11
|
+
*/
|
|
12
|
+
export function resolveTemplateJq(templateNames, catalog, purpose) {
|
|
13
|
+
const chosen = catalog.filter((template) => templateNames.includes(template.name));
|
|
14
|
+
const counts = new Map();
|
|
15
|
+
for (const template of chosen) {
|
|
16
|
+
for (const jq of template.templateJq) {
|
|
17
|
+
if (purpose !== undefined && jq.purpose !== purpose)
|
|
18
|
+
continue;
|
|
19
|
+
counts.set(jq.name, (counts.get(jq.name) ?? 0) + 1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const resolved = [];
|
|
23
|
+
for (const template of chosen) {
|
|
24
|
+
for (const jq of template.templateJq) {
|
|
25
|
+
if (purpose !== undefined && jq.purpose !== purpose)
|
|
26
|
+
continue;
|
|
27
|
+
const ambiguous = (counts.get(jq.name) ?? 0) > 1;
|
|
28
|
+
resolved.push({
|
|
29
|
+
...jq,
|
|
30
|
+
template: template.name,
|
|
31
|
+
ref: ambiguous ? `${template.name}.${jq.name}` : jq.name,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return resolved;
|
|
36
|
+
}
|
|
37
|
+
/** Find one resolved template jq by the reference a binding stores. */
|
|
38
|
+
export function findByRef(ref, resolved) {
|
|
39
|
+
return resolved.find((entry) => entry.ref === ref);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a jq call name (`enc(template)__name`, or a bare `name`) back to the catalog
|
|
43
|
+
* ref, driven by the catalog — never by string splitting, since a jq name may carry its
|
|
44
|
+
* own `__` past the template boundary and `enc` maps `-`→`_`. Under the template-slug
|
|
45
|
+
* invariant (no consecutive/trailing hyphens ⇒ `enc(template)` has no `__` and no
|
|
46
|
+
* trailing `_`) the FIRST `__` is the one true boundary, so the longest encoded-template
|
|
47
|
+
* prefix whose remainder is a jq the template declares is the unique qualified match;
|
|
48
|
+
* failing that, a bare name a single template declares. `null` when nothing claims it.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveCallName(callName, catalog) {
|
|
51
|
+
let bestRef = null;
|
|
52
|
+
let bestPrefixLength = -1;
|
|
53
|
+
for (const template of catalog) {
|
|
54
|
+
const prefix = `${encodeTemplateSegment(template.name)}__`;
|
|
55
|
+
if (!callName.startsWith(prefix))
|
|
56
|
+
continue;
|
|
57
|
+
const jqName = callName.slice(prefix.length);
|
|
58
|
+
if (template.templateJq.some((jq) => jq.name === jqName) && prefix.length > bestPrefixLength) {
|
|
59
|
+
bestRef = `${template.name}.${jqName}`;
|
|
60
|
+
bestPrefixLength = prefix.length;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (bestRef !== null)
|
|
64
|
+
return bestRef;
|
|
65
|
+
for (const template of catalog) {
|
|
66
|
+
if (template.templateJq.some((jq) => jq.name === callName))
|
|
67
|
+
return callName;
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/state-binding/catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAWlD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAgC,EAChC,O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|
|
|
1
|
+
/**
|
|
2
|
+
* The shared state-binding editor — the ONE binding shape every door and every flow
|
|
3
|
+
* node authors. Consumed by the platform door screens, the tai42 states surface, and
|
|
4
|
+
* (in the flow engine) the node State tab. Holds no edge to jq; paints from SDK
|
|
5
|
+
* tokens only.
|
|
6
|
+
*/
|
|
7
|
+
export { StateBindingEditor } from './StateBindingEditor';
|
|
8
|
+
export type { StateBindingEditorProps } from './StateBindingEditor';
|
|
9
|
+
export { StateBindingSection } from './StateBindingSection';
|
|
10
|
+
export type { StateBindingSectionProps } from './StateBindingSection';
|
|
11
|
+
export { StateAttachRow } from './StateAttachRow';
|
|
12
|
+
export type { StateAttachRowProps, InheritedSubject } from './StateAttachRow';
|
|
13
|
+
export { InjectionList } from './InputInjectionRow';
|
|
14
|
+
export type { InjectionListProps } from './InputInjectionRow';
|
|
15
|
+
export { UpdateList } from './UpdateRow';
|
|
16
|
+
export type { UpdateListProps } from './UpdateRow';
|
|
17
|
+
export { AdapterMapping } from './AdapterMapping';
|
|
18
|
+
export type { AdapterMappingProps } from './AdapterMapping';
|
|
19
|
+
export { SubjectScopeFields } from './SubjectScopeFields';
|
|
20
|
+
export type { SubjectScopeFieldsProps } from './SubjectScopeFields';
|
|
21
|
+
export { BindingJqField, appendTjq } from './BindingJqField';
|
|
22
|
+
export type { BindingJqFieldProps, TemplateJqSuggestion } from './BindingJqField';
|
|
23
|
+
export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
|
|
24
|
+
export type { ResolvedTemplateJq } from './catalog';
|
|
25
|
+
export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
|
|
26
|
+
export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
|
|
27
|
+
export type { MappingRow, MappingSource, FieldSource, LiteralSource, JqSource, FieldRoot, AdapterCompileResult, } from './adapter';
|
|
28
|
+
export type { BindingStateOption, BindingTemplateOption, BindingTemplateJqOption, BindingSourceSchemas, SchemaFieldPath, StateBinding, StateAttach, StateInjection, StateUpdate, } from './types';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACT,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared state-binding editor — the ONE binding shape every door and every flow
|
|
3
|
+
* node authors. Consumed by the platform door screens, the tai42 states surface, and
|
|
4
|
+
* (in the flow engine) the node State tab. Holds no edge to jq; paints from SDK
|
|
5
|
+
* tokens only.
|
|
6
|
+
*/
|
|
7
|
+
export { StateBindingEditor } from './StateBindingEditor';
|
|
8
|
+
export { StateBindingSection } from './StateBindingSection';
|
|
9
|
+
export { StateAttachRow } from './StateAttachRow';
|
|
10
|
+
export { InjectionList } from './InputInjectionRow';
|
|
11
|
+
export { UpdateList } from './UpdateRow';
|
|
12
|
+
export { AdapterMapping } from './AdapterMapping';
|
|
13
|
+
export { SubjectScopeFields } from './SubjectScopeFields';
|
|
14
|
+
export { BindingJqField, appendTjq } from './BindingJqField';
|
|
15
|
+
export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
|
|
16
|
+
export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
|
|
17
|
+
export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalog + value types the state-binding editor is fed and edits.
|
|
3
|
+
*
|
|
4
|
+
* The VALUE is the `StateBinding` document (mirrored in `@tai42/api-client`,
|
|
5
|
+
* imported type-only so this package keeps no runtime edge to the client). The
|
|
6
|
+
* CATALOGS are what the consumer resolves from the api-client and hands the editor:
|
|
7
|
+
* the states it may bind, the templates each may attach, and — when a schema is
|
|
8
|
+
* known — the fields a picker offers.
|
|
9
|
+
*/
|
|
10
|
+
import type { StateBinding, StateAttach, StateInjection, StateUpdate } from '@tai42/api-client';
|
|
11
|
+
export type { StateBinding, StateAttach, StateInjection, StateUpdate };
|
|
12
|
+
/** One selectable field of a schema: the record path + a human label. */
|
|
13
|
+
export interface SchemaFieldPath {
|
|
14
|
+
readonly path: readonly string[];
|
|
15
|
+
readonly label: string;
|
|
16
|
+
}
|
|
17
|
+
/** One template jq of an attached template, as the pickers present it. */
|
|
18
|
+
export interface BindingTemplateJqOption {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly purpose: 'input' | 'update';
|
|
21
|
+
readonly description?: string;
|
|
22
|
+
/** An `input` jq's declared params / an `update` jq's declared input keys. */
|
|
23
|
+
readonly params?: readonly string[];
|
|
24
|
+
/** An `update` jq's declared write paths, each a list of key segments. */
|
|
25
|
+
readonly writes?: readonly (readonly string[])[];
|
|
26
|
+
}
|
|
27
|
+
/** One template the editor may attach to a state (attach-on-use), with its template jq. */
|
|
28
|
+
export interface BindingTemplateOption {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly description?: string;
|
|
31
|
+
/** Whether this template is already attached to the chosen state (else: attach on save). */
|
|
32
|
+
readonly attached?: boolean;
|
|
33
|
+
readonly templateJq: readonly BindingTemplateJqOption[];
|
|
34
|
+
}
|
|
35
|
+
/** One state the editor may bind, with the templates already attached to it and its fields. */
|
|
36
|
+
export interface BindingStateOption {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
/** Templates already attached to the state (the rest attach on save). */
|
|
39
|
+
readonly attachedTemplates?: readonly string[];
|
|
40
|
+
/** The state's own record fields, for the `state` source of a field picker. */
|
|
41
|
+
readonly fields?: readonly SchemaFieldPath[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The schemas a field picker draws from when authoring an injection or an adapter:
|
|
45
|
+
* the run's `output` and `input` fields (the state's fields ride each
|
|
46
|
+
* {@link BindingStateOption}). Absent roots offer no picked field — the author uses
|
|
47
|
+
* a literal or a jq expression instead.
|
|
48
|
+
*/
|
|
49
|
+
export interface BindingSourceSchemas {
|
|
50
|
+
readonly output?: readonly SchemaFieldPath[];
|
|
51
|
+
readonly input?: readonly SchemaFieldPath[];
|
|
52
|
+
/** The tool-schema fetch that feeds the pickers is in flight. */
|
|
53
|
+
readonly loading?: boolean;
|
|
54
|
+
/** The tool-schema fetch failed — the field control shows a note but stays usable. */
|
|
55
|
+
readonly error?: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state-binding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhG,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC;AAEvE,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;CAClD;AAED,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACzD;AAED,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/state-binding/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tai42/studio-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "The Studio plugin contract, shared UI components, and hooks that every feature builds on.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "tai42 <oss@tai42.ai>",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@testing-library/user-event": "^14.6.6",
|
|
80
80
|
"@types/node": "^22.10.5",
|
|
81
81
|
"@types/react": "^19.2.18",
|
|
82
|
-
"@types/react-dom": "^19.2.
|
|
82
|
+
"@types/react-dom": "^19.2.7",
|
|
83
83
|
"@vitejs/plugin-react": "^4.7.0",
|
|
84
84
|
"@vitest/coverage-v8": "^5.0.0",
|
|
85
85
|
"jsdom": "^30.0.1",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@fontsource-variable/geist-mono": "^5.2.7",
|
|
92
92
|
"@fontsource-variable/inter": "^5.2.8",
|
|
93
|
-
"@radix-ui/react-checkbox": "^1.3.
|
|
93
|
+
"@radix-ui/react-checkbox": "^1.3.11",
|
|
94
94
|
"@radix-ui/react-dialog": "^1.1.18",
|
|
95
95
|
"@radix-ui/react-radio-group": "^1.4.2",
|
|
96
96
|
"@radix-ui/react-select": "^2.3.2",
|
|
97
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
97
|
+
"@radix-ui/react-tabs": "^1.1.21",
|
|
98
98
|
"@radix-ui/react-tooltip": "^1.2.11",
|
|
99
|
-
"@tai42/api-client": "
|
|
99
|
+
"@tai42/api-client": "14.0.0"
|
|
100
100
|
},
|
|
101
101
|
"scripts": {
|
|
102
102
|
"build": "tsc -b tsconfig.build.json && node scripts/copy-assets.mjs",
|
package/src/components/icons.tsx
CHANGED
|
@@ -360,6 +360,14 @@ export const MinusIcon: IconComponent = (props) => (
|
|
|
360
360
|
</Icon>
|
|
361
361
|
);
|
|
362
362
|
|
|
363
|
+
/** Add / insert: the dash crossed by an upright, for an append or attach affordance. */
|
|
364
|
+
export const PlusIcon: IconComponent = (props) => (
|
|
365
|
+
<Icon {...props}>
|
|
366
|
+
<path d="M5.5 12h13" />
|
|
367
|
+
<path d="M12 5.5v13" />
|
|
368
|
+
</Icon>
|
|
369
|
+
);
|
|
370
|
+
|
|
363
371
|
/** Edit: a pencil laid across the surface it writes on. */
|
|
364
372
|
export const EditIcon: IconComponent = (props) => (
|
|
365
373
|
<Icon {...props}>
|