@tai42/studio-sdk 13.3.0 → 15.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.
Files changed (104) hide show
  1. package/dist/components/components.css +19 -0
  2. package/dist/components/icons.d.ts +2 -0
  3. package/dist/components/icons.d.ts.map +1 -1
  4. package/dist/components/icons.js +2 -0
  5. package/dist/components/icons.js.map +1 -1
  6. package/dist/components/templated-text-field.d.ts +98 -0
  7. package/dist/components/templated-text-field.d.ts.map +1 -0
  8. package/dist/components/templated-text-field.js +217 -0
  9. package/dist/components/templated-text-field.js.map +1 -0
  10. package/dist/hooks/useApi.d.ts +461 -59
  11. package/dist/hooks/useApi.d.ts.map +1 -1
  12. package/dist/index.d.ts +6 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +5 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/navigation/types.d.ts +2 -1
  17. package/dist/navigation/types.d.ts.map +1 -1
  18. package/dist/query-keys.d.ts +13 -0
  19. package/dist/query-keys.d.ts.map +1 -1
  20. package/dist/query-keys.js +13 -0
  21. package/dist/query-keys.js.map +1 -1
  22. package/dist/state-binding/AdapterMapping.d.ts +33 -0
  23. package/dist/state-binding/AdapterMapping.d.ts.map +1 -0
  24. package/dist/state-binding/AdapterMapping.js +205 -0
  25. package/dist/state-binding/AdapterMapping.js.map +1 -0
  26. package/dist/state-binding/BindingJqField.d.ts +43 -0
  27. package/dist/state-binding/BindingJqField.d.ts.map +1 -0
  28. package/dist/state-binding/BindingJqField.js +57 -0
  29. package/dist/state-binding/BindingJqField.js.map +1 -0
  30. package/dist/state-binding/BindingTemplatedJqField.d.ts +24 -0
  31. package/dist/state-binding/BindingTemplatedJqField.d.ts.map +1 -0
  32. package/dist/state-binding/BindingTemplatedJqField.js +7 -0
  33. package/dist/state-binding/BindingTemplatedJqField.js.map +1 -0
  34. package/dist/state-binding/InputInjectionRow.d.ts +18 -0
  35. package/dist/state-binding/InputInjectionRow.d.ts.map +1 -0
  36. package/dist/state-binding/InputInjectionRow.js +55 -0
  37. package/dist/state-binding/InputInjectionRow.js.map +1 -0
  38. package/dist/state-binding/StateAttachRow.d.ts +27 -0
  39. package/dist/state-binding/StateAttachRow.d.ts.map +1 -0
  40. package/dist/state-binding/StateAttachRow.js +102 -0
  41. package/dist/state-binding/StateAttachRow.js.map +1 -0
  42. package/dist/state-binding/StateBindingEditor.d.ts +37 -0
  43. package/dist/state-binding/StateBindingEditor.d.ts.map +1 -0
  44. package/dist/state-binding/StateBindingEditor.js +54 -0
  45. package/dist/state-binding/StateBindingEditor.js.map +1 -0
  46. package/dist/state-binding/StateBindingSection.d.ts +14 -0
  47. package/dist/state-binding/StateBindingSection.d.ts.map +1 -0
  48. package/dist/state-binding/StateBindingSection.js +17 -0
  49. package/dist/state-binding/StateBindingSection.js.map +1 -0
  50. package/dist/state-binding/SubjectScopeFields.d.ts +20 -0
  51. package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -0
  52. package/dist/state-binding/SubjectScopeFields.js +8 -0
  53. package/dist/state-binding/SubjectScopeFields.js.map +1 -0
  54. package/dist/state-binding/UpdateRow.d.ts +20 -0
  55. package/dist/state-binding/UpdateRow.d.ts.map +1 -0
  56. package/dist/state-binding/UpdateRow.js +89 -0
  57. package/dist/state-binding/UpdateRow.js.map +1 -0
  58. package/dist/state-binding/adapter.d.ts +93 -0
  59. package/dist/state-binding/adapter.d.ts.map +1 -0
  60. package/dist/state-binding/adapter.js +251 -0
  61. package/dist/state-binding/adapter.js.map +1 -0
  62. package/dist/state-binding/build-catalog.d.ts +19 -0
  63. package/dist/state-binding/build-catalog.d.ts.map +1 -0
  64. package/dist/state-binding/build-catalog.js +43 -0
  65. package/dist/state-binding/build-catalog.js.map +1 -0
  66. package/dist/state-binding/catalog.d.ts +26 -0
  67. package/dist/state-binding/catalog.d.ts.map +1 -0
  68. package/dist/state-binding/catalog.js +71 -0
  69. package/dist/state-binding/catalog.js.map +1 -0
  70. package/dist/state-binding/index.d.ts +33 -0
  71. package/dist/state-binding/index.d.ts.map +1 -0
  72. package/dist/state-binding/index.js +20 -0
  73. package/dist/state-binding/index.js.map +1 -0
  74. package/dist/state-binding/templated-text-catalog.d.ts +21 -0
  75. package/dist/state-binding/templated-text-catalog.d.ts.map +1 -0
  76. package/dist/state-binding/templated-text-catalog.js +48 -0
  77. package/dist/state-binding/templated-text-catalog.js.map +1 -0
  78. package/dist/state-binding/types.d.ts +78 -0
  79. package/dist/state-binding/types.d.ts.map +1 -0
  80. package/dist/state-binding/types.js +2 -0
  81. package/dist/state-binding/types.js.map +1 -0
  82. package/package.json +5 -5
  83. package/src/components/components.css +19 -0
  84. package/src/components/icons.tsx +8 -0
  85. package/src/components/templated-text-field.tsx +508 -0
  86. package/src/index.ts +76 -1
  87. package/src/navigation/types.ts +4 -1
  88. package/src/query-keys.ts +15 -0
  89. package/src/state-binding/AdapterMapping.tsx +468 -0
  90. package/src/state-binding/BindingJqField.tsx +146 -0
  91. package/src/state-binding/BindingTemplatedJqField.tsx +73 -0
  92. package/src/state-binding/InputInjectionRow.tsx +157 -0
  93. package/src/state-binding/README.md +46 -0
  94. package/src/state-binding/StateAttachRow.tsx +289 -0
  95. package/src/state-binding/StateBindingEditor.tsx +166 -0
  96. package/src/state-binding/StateBindingSection.tsx +37 -0
  97. package/src/state-binding/SubjectScopeFields.tsx +57 -0
  98. package/src/state-binding/UpdateRow.tsx +227 -0
  99. package/src/state-binding/adapter.ts +276 -0
  100. package/src/state-binding/build-catalog.ts +59 -0
  101. package/src/state-binding/catalog.ts +87 -0
  102. package/src/state-binding/index.ts +67 -0
  103. package/src/state-binding/templated-text-catalog.ts +69 -0
  104. package/src/state-binding/types.ts +91 -0
@@ -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;;;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AO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,33 @@
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 { BindingTemplatedJqField } from './BindingTemplatedJqField';
24
+ export type { BindingTemplatedJqFieldProps } from './BindingTemplatedJqField';
25
+ export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
26
+ export type { ResolvedTemplateJq } from './catalog';
27
+ export { templatedTextCatalog } from './templated-text-catalog';
28
+ export type { StoragePresenceQueryLike, TemplateNamesQueryLike } from './templated-text-catalog';
29
+ export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
30
+ export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
31
+ export type { MappingRow, MappingSource, FieldSource, LiteralSource, JqSource, FieldRoot, AdapterCompileResult, } from './adapter';
32
+ export type { BindingStateOption, BindingTemplateOption, BindingTemplateJqOption, BindingSourceSchemas, SchemaFieldPath, StateBinding, StateAttach, StateInjection, StateUpdate, TemplatedText, TemplatedTextCatalog, } from './types';
33
+ //# 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,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACjG,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,EACX,aAAa,EACb,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,20 @@
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 { BindingTemplatedJqField } from './BindingTemplatedJqField';
16
+ export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
17
+ export { templatedTextCatalog } from './templated-text-catalog';
18
+ export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
19
+ export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
20
+ //# 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,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,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,21 @@
1
+ import type { TemplatedTextCatalog } from './types';
2
+ /** The storage-presence query result (`GET /api/storage`) fields this helper reads. */
3
+ export interface StoragePresenceQueryLike {
4
+ readonly data?: {
5
+ readonly present: boolean;
6
+ };
7
+ readonly isPending: boolean;
8
+ readonly isError: boolean;
9
+ readonly error: unknown;
10
+ readonly refetch: () => unknown;
11
+ }
12
+ /** The stored-template-names query result (`GET /api/templates`) fields this helper reads. */
13
+ export interface TemplateNamesQueryLike {
14
+ readonly data?: readonly string[];
15
+ readonly isPending: boolean;
16
+ readonly isError: boolean;
17
+ readonly error: unknown;
18
+ readonly refetch: () => unknown;
19
+ }
20
+ export declare function templatedTextCatalog(storage: StoragePresenceQueryLike, templates: TemplateNamesQueryLike): TemplatedTextCatalog;
21
+ //# sourceMappingURL=templated-text-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templated-text-catalog.d.ts","sourceRoot":"","sources":["../../src/state-binding/templated-text-catalog.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,uFAAuF;AACvF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,8FAA8F;AAC9F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,sBAAsB,GAChC,oBAAoB,CA0BtB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Builds the {@link TemplatedTextCatalog} a door form feeds its templated-text
3
+ * fields, from the two queries every such form already runs: the storage-presence
4
+ * signal (`GET /api/storage`) and the stored-template name list (`GET /api/templates`).
5
+ *
6
+ * Storage is dead by default — a deployment with no storage backend is supported —
7
+ * and the template list door cannot answer without one. So the CALLER gates its
8
+ * template-names query on presence (`enabled: storage.data?.present === true`), and
9
+ * this helper maps the two query states onto the catalog the field reads: when
10
+ * storage is absent it exposes no templates and marks the field absent (the field
11
+ * then offers no stored source); when present it exposes the fetched names. A
12
+ * presence-fetch failure surfaces ahead of a template-fetch failure, since presence
13
+ * is the prerequisite.
14
+ *
15
+ * It takes the query RESULTS structurally (the fields it reads), so this module adds
16
+ * no data-layer dependency to the SDK.
17
+ */
18
+ import { errorMessage } from '../errors';
19
+ export function templatedTextCatalog(storage, templates) {
20
+ const presenceKnown = storage.data !== undefined;
21
+ const present = storage.data?.present === true;
22
+ // A presence failure matters only until presence is first known: once it is in
23
+ // hand, a later background-refetch failure must not blow away a field already
24
+ // working from it. Presence is the prerequisite of the catalog, so its failure
25
+ // surfaces ahead of a catalog-fetch failure.
26
+ const presenceFailed = storage.isError && !presenceKnown;
27
+ return {
28
+ // Never expose template names while storage is absent or unknown — the caller's
29
+ // gate keeps the list query from firing there, and its pending/stale data must
30
+ // not leak into a picker the field will not show.
31
+ templates: present ? (templates.data ?? []).map((id) => ({ id })) : [],
32
+ loading: present && templates.isPending,
33
+ error: presenceFailed
34
+ ? errorMessage(storage.error)
35
+ : templates.isError
36
+ ? errorMessage(templates.error)
37
+ : undefined,
38
+ onRetry: () => {
39
+ if (presenceFailed)
40
+ void storage.refetch();
41
+ else
42
+ void templates.refetch();
43
+ },
44
+ storageAbsent: storage.data?.present === false,
45
+ storagePresenceLoading: !presenceKnown && storage.isPending,
46
+ };
47
+ }
48
+ //# sourceMappingURL=templated-text-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templated-text-catalog.js","sourceRoot":"","sources":["../../src/state-binding/templated-text-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAsBzC,MAAM,UAAU,oBAAoB,CAClC,OAAiC,EACjC,SAAiC;IAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,+EAA+E;IAC/E,8EAA8E;IAC9E,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC;IACzD,OAAO;QACL,gFAAgF;QAChF,+EAA+E;QAC/E,kDAAkD;QAClD,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACtE,OAAO,EAAE,OAAO,IAAI,SAAS,CAAC,SAAS;QACvC,KAAK,EAAE,cAAc;YACnB,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC;YAC7B,CAAC,CAAC,SAAS,CAAC,OAAO;gBACjB,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,SAAS;QACf,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,cAAc;gBAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;;gBACtC,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;QACD,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,KAAK;QAC9C,sBAAsB,EAAE,CAAC,aAAa,IAAI,OAAO,CAAC,SAAS;KAC5D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,78 @@
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, TemplatedText } from '@tai42/api-client';
11
+ import type { TemplatedTextTemplateOption } from '../components/templated-text-field';
12
+ export type { StateBinding, StateAttach, StateInjection, StateUpdate, TemplatedText };
13
+ /**
14
+ * The stored templates a {@link TemplatedText} field's id picker offers, with the
15
+ * fetch's loading/error state — resolved by the door screen and passed to the
16
+ * editor, which holds no data edge of its own. Absent leaves every templated-text
17
+ * field with the inline source only.
18
+ */
19
+ export interface TemplatedTextCatalog {
20
+ readonly templates?: readonly TemplatedTextTemplateOption[];
21
+ readonly loading?: boolean;
22
+ readonly error?: string;
23
+ readonly onRetry?: () => void;
24
+ /**
25
+ * Storage is registered absent (`GET /api/storage` → `present: false`), so the
26
+ * catalog was not fetched and the stored source is not offered on the fields this
27
+ * catalog feeds; an already-stored id is shown read-only.
28
+ */
29
+ readonly storageAbsent?: boolean;
30
+ /** Storage presence is not yet known — the fields render a placeholder, not a toggle. */
31
+ readonly storagePresenceLoading?: boolean;
32
+ }
33
+ /** One selectable field of a schema: the record path + a human label. */
34
+ export interface SchemaFieldPath {
35
+ readonly path: readonly string[];
36
+ readonly label: string;
37
+ }
38
+ /** One template jq of an attached template, as the pickers present it. */
39
+ export interface BindingTemplateJqOption {
40
+ readonly name: string;
41
+ readonly purpose: 'input' | 'update';
42
+ readonly description?: string;
43
+ /** An `input` jq's declared params / an `update` jq's declared input keys. */
44
+ readonly params?: readonly string[];
45
+ /** An `update` jq's declared write paths, each a list of key segments. */
46
+ readonly writes?: readonly (readonly string[])[];
47
+ }
48
+ /** One template the editor may attach to a state (attach-on-use), with its template jq. */
49
+ export interface BindingTemplateOption {
50
+ readonly name: string;
51
+ readonly description?: string;
52
+ /** Whether this template is already attached to the chosen state (else: attach on save). */
53
+ readonly attached?: boolean;
54
+ readonly templateJq: readonly BindingTemplateJqOption[];
55
+ }
56
+ /** One state the editor may bind, with the templates already attached to it and its fields. */
57
+ export interface BindingStateOption {
58
+ readonly name: string;
59
+ /** Templates already attached to the state (the rest attach on save). */
60
+ readonly attachedTemplates?: readonly string[];
61
+ /** The state's own record fields, for the `state` source of a field picker. */
62
+ readonly fields?: readonly SchemaFieldPath[];
63
+ }
64
+ /**
65
+ * The schemas a field picker draws from when authoring an injection or an adapter:
66
+ * the run's `output` and `input` fields (the state's fields ride each
67
+ * {@link BindingStateOption}). Absent roots offer no picked field — the author uses
68
+ * a literal or a jq expression instead.
69
+ */
70
+ export interface BindingSourceSchemas {
71
+ readonly output?: readonly SchemaFieldPath[];
72
+ readonly input?: readonly SchemaFieldPath[];
73
+ /** The tool-schema fetch that feeds the pickers is in flight. */
74
+ readonly loading?: boolean;
75
+ /** The tool-schema fetch failed — the field control shows a note but stays usable. */
76
+ readonly error?: string;
77
+ }
78
+ //# 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,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEtF,YAAY,EAAE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uB,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -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": "13.3.0",
3
+ "version": "15.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.5",
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.6",
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.16",
97
+ "@radix-ui/react-tabs": "^1.1.21",
98
98
  "@radix-ui/react-tooltip": "^1.2.11",
99
- "@tai42/api-client": "13.3.0"
99
+ "@tai42/api-client": "15.0.0"
100
100
  },
101
101
  "scripts": {
102
102
  "build": "tsc -b tsconfig.build.json && node scripts/copy-assets.mjs",
@@ -1953,6 +1953,25 @@
1953
1953
  border: 0;
1954
1954
  }
1955
1955
 
1956
+ /* A `TemplatedTextField` renders its label as a group header above the source
1957
+ toggle, so an inline jq editor placed under that header (`@tai42/jq-studio`'s
1958
+ `JqField`, the direct child of this wrapper) hides its OWN visible label — the
1959
+ header is the single visible label. The label element stays in the DOM, so its
1960
+ `<label for>` keeps naming the control and the visual-editor door keeps its
1961
+ accessible name; only the paint is dropped. Scoped to a direct child so a
1962
+ mapping editor's nested field labels are untouched. */
1963
+ .tai-templated-inline--grouped > .jqs-field > .jqs-field__label {
1964
+ position: absolute;
1965
+ width: 1px;
1966
+ height: 1px;
1967
+ margin: -1px;
1968
+ padding: 0;
1969
+ overflow: hidden;
1970
+ clip-path: inset(50%);
1971
+ white-space: nowrap;
1972
+ border: 0;
1973
+ }
1974
+
1956
1975
  /* -- Shell -----------------------------------------------------------------------
1957
1976
  The application frame: a fixed-width sidebar beside a scrolling main
1958
1977
  column at >=1024, a 72 px labelled icon rail from 640, and a sticky top bar
@@ -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}>