@optiaxiom/proteus 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/proteus-action/ProteusAction.js +2 -2
- package/dist/esm/proteus-document/ProteusDocumentShell.js +19 -14
- package/dist/esm/proteus-document/resolveProteusProp.js +11 -0
- package/dist/esm/proteus-document/resolveProteusValue.js +95 -7
- package/dist/esm/proteus-document/{useResolvedProteusProps.js → useResolveProteusValues.js} +4 -4
- package/dist/esm/proteus-show/ProteusShow.js +1 -48
- package/dist/esm/schema/public-schema.json.js +74 -23
- package/dist/esm/schema/runtime-schema.json.js +72 -22
- package/dist/index.d.ts +16 -16
- package/dist/spec.d.ts +579 -527
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Button } from '@optiaxiom/react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
|
|
6
|
-
import {
|
|
6
|
+
import { useResolveProteusValues } from '../proteus-document/useResolveProteusValues.js';
|
|
7
7
|
|
|
8
8
|
function ProteusAction({
|
|
9
9
|
children,
|
|
@@ -13,7 +13,7 @@ function ProteusAction({
|
|
|
13
13
|
const { onEvent, valid } = useProteusDocumentContext(
|
|
14
14
|
"@optiaxiom/proteus/ProteusAction"
|
|
15
15
|
);
|
|
16
|
-
const resolvedOnClick =
|
|
16
|
+
const resolvedOnClick = useResolveProteusValues(
|
|
17
17
|
onClick ?? {}
|
|
18
18
|
);
|
|
19
19
|
const [loading, setLoading] = useState(false);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { Disclosure, DisclosureTrigger, Box, Group, Text, DisclosureContent, Heading, Tooltip } from '@optiaxiom/react';
|
|
4
4
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
5
|
-
import {
|
|
5
|
+
import { set } from 'jsonpointer';
|
|
6
6
|
import { useState, useRef, useEffect } from 'react';
|
|
7
7
|
import { useEffectEvent } from '../hooks/useEffectEvent.js';
|
|
8
8
|
import { downloadFile } from '../proteus-image/downloadFile.js';
|
|
@@ -49,18 +49,18 @@ function ProteusDocumentShell({
|
|
|
49
49
|
await onToolCall?.(event.tool);
|
|
50
50
|
} else if ("message" in event) {
|
|
51
51
|
await onMessage?.(event.message);
|
|
52
|
-
} else if (event.action === "message-from") {
|
|
53
|
-
const items = get(data, event.path);
|
|
54
|
-
if (!Array.isArray(items)) {
|
|
55
|
-
throw new Error(
|
|
56
|
-
`Expected array at "${event.path}" for message-from action`
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
const message = items.map((item) => `${item.name}: ${item.value || "[Not specified]"}`).join("\n");
|
|
60
|
-
await onMessage?.(message);
|
|
61
52
|
} else if (event.action === "download") {
|
|
62
53
|
if (typeof event.url === "string") {
|
|
63
54
|
await downloadFile(event.url);
|
|
55
|
+
} else if (Array.isArray(event.url)) {
|
|
56
|
+
await Promise.all(
|
|
57
|
+
event.url.map((u) => {
|
|
58
|
+
if (typeof u !== "string") {
|
|
59
|
+
throw new Error("Invalid URL in download array");
|
|
60
|
+
}
|
|
61
|
+
return downloadFile(u);
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
64
|
} else {
|
|
65
65
|
throw new Error("Invalid URL for download action");
|
|
66
66
|
}
|
|
@@ -131,7 +131,7 @@ function ProteusDocumentShell({
|
|
|
131
131
|
]
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
|
-
/* @__PURE__ */ jsx(Group, { asChild: true, flexDirection: "column", gap: "16", children: /* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ jsx(Group, { asChild: true, flexDirection: "column", gap: "16", children: /* @__PURE__ */ jsxs(
|
|
135
135
|
"form",
|
|
136
136
|
{
|
|
137
137
|
onChange: (event) => {
|
|
@@ -140,11 +140,16 @@ function ProteusDocumentShell({
|
|
|
140
140
|
setValid(form.checkValidity());
|
|
141
141
|
});
|
|
142
142
|
},
|
|
143
|
+
onSubmit: (event) => {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
},
|
|
143
146
|
ref: formRef,
|
|
144
|
-
children:
|
|
147
|
+
children: [
|
|
148
|
+
element.body,
|
|
149
|
+
element.actions && !readOnly && /* @__PURE__ */ jsx(Group, { gap: "16", justifyContent: "end", w: "full", children: element.actions })
|
|
150
|
+
]
|
|
145
151
|
}
|
|
146
|
-
) })
|
|
147
|
-
element.actions && !readOnly && /* @__PURE__ */ jsx(Group, { gap: "16", justifyContent: "end", w: "full", children: element.actions })
|
|
152
|
+
) })
|
|
148
153
|
]
|
|
149
154
|
}
|
|
150
155
|
)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { ProteusElement } from '../proteus-element/ProteusElement.js';
|
|
4
4
|
import { getProteusValue } from './getProteusValue.js';
|
|
5
|
+
import { evaluateCondition } from './resolveProteusValue.js';
|
|
5
6
|
|
|
6
7
|
function resolveProteusProp(value, data, parentPath) {
|
|
7
8
|
if (typeof value !== "object" || value === null) {
|
|
@@ -33,6 +34,16 @@ function resolveProteusProp(value, data, parentPath) {
|
|
|
33
34
|
return row;
|
|
34
35
|
});
|
|
35
36
|
}
|
|
37
|
+
if ("$type" in value && value.$type === "Show" && "when" in value && "children" in value) {
|
|
38
|
+
const conditions = Array.isArray(value.when) ? value.when : [value.when];
|
|
39
|
+
const shouldShow = conditions.every(
|
|
40
|
+
(condition) => evaluateCondition(condition, data, parentPath)
|
|
41
|
+
);
|
|
42
|
+
if (!shouldShow) {
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
return resolveProteusProp(value.children, data, parentPath);
|
|
46
|
+
}
|
|
36
47
|
return "$type" in value || Array.isArray(value) && value.some((v) => v && typeof v === "object" && "$type" in v) ? /* @__PURE__ */ jsx(ProteusElement, { element: value }) : value;
|
|
37
48
|
}
|
|
38
49
|
|
|
@@ -1,18 +1,106 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getProteusValue } from './getProteusValue.js';
|
|
3
3
|
|
|
4
|
+
function evaluateCondition(condition, data, parentPath) {
|
|
5
|
+
if (!condition) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if ("and" in condition) {
|
|
9
|
+
return condition.and.every(
|
|
10
|
+
(cond) => evaluateCondition(cond, data, parentPath)
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
if ("or" in condition) {
|
|
14
|
+
return condition.or.some(
|
|
15
|
+
(cond) => evaluateCondition(cond, data, parentPath)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
if ("!!" in condition) {
|
|
19
|
+
const value = resolveProteusValue(condition["!!"], data, parentPath);
|
|
20
|
+
return !!value;
|
|
21
|
+
}
|
|
22
|
+
if ("!" in condition) {
|
|
23
|
+
const value = resolveProteusValue(condition["!"], data, parentPath);
|
|
24
|
+
return !value;
|
|
25
|
+
}
|
|
26
|
+
if ("==" in condition) {
|
|
27
|
+
const [left, right] = condition["=="];
|
|
28
|
+
return resolveProteusValue(left, data, parentPath) === resolveProteusValue(right, data, parentPath);
|
|
29
|
+
} else if ("!=" in condition) {
|
|
30
|
+
const [left, right] = condition["!="];
|
|
31
|
+
return resolveProteusValue(left, data, parentPath) !== resolveProteusValue(right, data, parentPath);
|
|
32
|
+
} else if ("<" in condition) {
|
|
33
|
+
const [left, right] = condition["<"];
|
|
34
|
+
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
35
|
+
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
36
|
+
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal < rightVal;
|
|
37
|
+
} else if ("<=" in condition) {
|
|
38
|
+
const [left, right] = condition["<="];
|
|
39
|
+
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
40
|
+
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
41
|
+
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal <= rightVal;
|
|
42
|
+
} else if (">" in condition) {
|
|
43
|
+
const [left, right] = condition[">"];
|
|
44
|
+
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
45
|
+
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
46
|
+
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal > rightVal;
|
|
47
|
+
} else if (">=" in condition) {
|
|
48
|
+
const [left, right] = condition[">="];
|
|
49
|
+
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
50
|
+
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
51
|
+
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal >= rightVal;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
4
55
|
function resolveProteusValue(value, data, parentPath) {
|
|
5
56
|
if (typeof value !== "object" || value === null) {
|
|
6
57
|
return value;
|
|
7
58
|
}
|
|
8
|
-
if ("$type" in value
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
59
|
+
if ("$type" in value) {
|
|
60
|
+
if (value.$type === "Value" && "path" in value && typeof value.path === "string") {
|
|
61
|
+
return getProteusValue(
|
|
62
|
+
data,
|
|
63
|
+
value,
|
|
64
|
+
parentPath
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
if (value.$type === "Map" && "path" in value && typeof value.path === "string" && "children" in value) {
|
|
68
|
+
const array = getProteusValue(
|
|
69
|
+
data,
|
|
70
|
+
{ path: value.path },
|
|
71
|
+
parentPath
|
|
72
|
+
);
|
|
73
|
+
if (!Array.isArray(array)) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
const resolvedPath = value.path.startsWith("/") ? value.path : `${parentPath}/${value.path}`;
|
|
77
|
+
const items = array.map(
|
|
78
|
+
(_, index) => resolveProteusValue(value.children, data, `${resolvedPath}/${index}`)
|
|
79
|
+
);
|
|
80
|
+
if ("separator" in value) {
|
|
81
|
+
const sep = resolveProteusValue(value.separator, data, parentPath);
|
|
82
|
+
return items.join(typeof sep === "string" ? sep : "");
|
|
83
|
+
}
|
|
84
|
+
return items;
|
|
85
|
+
}
|
|
86
|
+
if (value.$type === "Show" && "when" in value && "children" in value) {
|
|
87
|
+
const conditions = Array.isArray(value.when) ? value.when : [value.when];
|
|
88
|
+
const shouldShow = conditions.every(
|
|
89
|
+
(condition) => evaluateCondition(condition, data, parentPath)
|
|
90
|
+
);
|
|
91
|
+
if (!shouldShow) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
return resolveProteusValue(value.children, data, parentPath);
|
|
95
|
+
}
|
|
96
|
+
if (value.$type === "Concat" && "children" in value) {
|
|
97
|
+
if (!Array.isArray(value.children)) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
return value.children.map((child) => resolveProteusValue(child, data, parentPath)).filter((v) => v !== void 0).join("");
|
|
101
|
+
}
|
|
14
102
|
}
|
|
15
103
|
return value;
|
|
16
104
|
}
|
|
17
105
|
|
|
18
|
-
export { resolveProteusValue };
|
|
106
|
+
export { evaluateCondition, resolveProteusValue };
|
|
@@ -2,12 +2,12 @@ import { useProteusDocumentContext } from './ProteusDocumentContext.js';
|
|
|
2
2
|
import { useProteusDocumentPathContext } from './ProteusDocumentPathContext.js';
|
|
3
3
|
import { resolveProteusValue } from './resolveProteusValue.js';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function useResolveProteusValues(props) {
|
|
6
6
|
const { data } = useProteusDocumentContext(
|
|
7
|
-
"@optiaxiom/react/
|
|
7
|
+
"@optiaxiom/react/useResolveProteusValues"
|
|
8
8
|
);
|
|
9
9
|
const { path: parentPath } = useProteusDocumentPathContext(
|
|
10
|
-
"@optiaxiom/react/
|
|
10
|
+
"@optiaxiom/react/useResolveProteusValues"
|
|
11
11
|
);
|
|
12
12
|
const resolved = {};
|
|
13
13
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -16,4 +16,4 @@ function useResolvedProteusProps(props) {
|
|
|
16
16
|
return resolved;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { useResolveProteusValues };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
|
|
4
4
|
import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
|
|
5
|
-
import {
|
|
5
|
+
import { evaluateCondition } from '../proteus-document/resolveProteusValue.js';
|
|
6
6
|
|
|
7
7
|
function ProteusShow({ children, when }) {
|
|
8
8
|
const { data } = useProteusDocumentContext("@optiaxiom/proteus/ProteusShow");
|
|
@@ -18,53 +18,6 @@ function ProteusShow({ children, when }) {
|
|
|
18
18
|
}
|
|
19
19
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
20
20
|
}
|
|
21
|
-
function evaluateCondition(condition, data, parentPath) {
|
|
22
|
-
if (!condition) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
if ("and" in condition) {
|
|
26
|
-
return condition.and.every(
|
|
27
|
-
(cond) => evaluateCondition(cond, data, parentPath)
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
if ("or" in condition) {
|
|
31
|
-
return condition.or.some(
|
|
32
|
-
(cond) => evaluateCondition(cond, data, parentPath)
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
if ("!!" in condition) {
|
|
36
|
-
const value = resolveProteusValue(condition["!!"], data, parentPath);
|
|
37
|
-
return !!value;
|
|
38
|
-
}
|
|
39
|
-
if ("==" in condition) {
|
|
40
|
-
const [left, right] = condition["=="];
|
|
41
|
-
return resolveProteusValue(left, data, parentPath) === resolveProteusValue(right, data, parentPath);
|
|
42
|
-
} else if ("!=" in condition) {
|
|
43
|
-
const [left, right] = condition["!="];
|
|
44
|
-
return resolveProteusValue(left, data, parentPath) !== resolveProteusValue(right, data, parentPath);
|
|
45
|
-
} else if ("<" in condition) {
|
|
46
|
-
const [left, right] = condition["<"];
|
|
47
|
-
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
48
|
-
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
49
|
-
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal < rightVal;
|
|
50
|
-
} else if ("<=" in condition) {
|
|
51
|
-
const [left, right] = condition["<="];
|
|
52
|
-
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
53
|
-
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
54
|
-
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal <= rightVal;
|
|
55
|
-
} else if (">" in condition) {
|
|
56
|
-
const [left, right] = condition[">"];
|
|
57
|
-
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
58
|
-
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
59
|
-
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal > rightVal;
|
|
60
|
-
} else if (">=" in condition) {
|
|
61
|
-
const [left, right] = condition[">="];
|
|
62
|
-
const leftVal = resolveProteusValue(left, data, parentPath);
|
|
63
|
-
const rightVal = resolveProteusValue(right, data, parentPath);
|
|
64
|
-
return typeof leftVal === "number" && typeof rightVal === "number" && leftVal >= rightVal;
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
21
|
ProteusShow.displayName = "@optiaxiom/proteus/ProteusShow";
|
|
69
22
|
|
|
70
23
|
export { ProteusShow };
|
|
@@ -2400,6 +2400,35 @@ var definitions = {
|
|
|
2400
2400
|
],
|
|
2401
2401
|
type: "object"
|
|
2402
2402
|
},
|
|
2403
|
+
{
|
|
2404
|
+
additionalProperties: false,
|
|
2405
|
+
properties: {
|
|
2406
|
+
"!": {
|
|
2407
|
+
anyOf: [
|
|
2408
|
+
{
|
|
2409
|
+
type: "string"
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
type: "number"
|
|
2413
|
+
},
|
|
2414
|
+
{
|
|
2415
|
+
type: "boolean"
|
|
2416
|
+
},
|
|
2417
|
+
{
|
|
2418
|
+
type: "null"
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
$ref: "#/definitions/ProteusValue"
|
|
2422
|
+
}
|
|
2423
|
+
],
|
|
2424
|
+
description: "Falsy check - returns true if value is falsy (null, undefined, false, 0, or empty string)"
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
required: [
|
|
2428
|
+
"!"
|
|
2429
|
+
],
|
|
2430
|
+
type: "object"
|
|
2431
|
+
},
|
|
2403
2432
|
{
|
|
2404
2433
|
additionalProperties: false,
|
|
2405
2434
|
properties: {
|
|
@@ -2665,6 +2694,9 @@ var definitions = {
|
|
|
2665
2694
|
{
|
|
2666
2695
|
$ref: "#/definitions/ProteusChart"
|
|
2667
2696
|
},
|
|
2697
|
+
{
|
|
2698
|
+
$ref: "#/definitions/ProteusConcat"
|
|
2699
|
+
},
|
|
2668
2700
|
{
|
|
2669
2701
|
$ref: "#/definitions/ProteusDataTable"
|
|
2670
2702
|
},
|
|
@@ -2752,8 +2784,18 @@ var definitions = {
|
|
|
2752
2784
|
description: "Client-side message action",
|
|
2753
2785
|
properties: {
|
|
2754
2786
|
message: {
|
|
2755
|
-
|
|
2756
|
-
|
|
2787
|
+
anyOf: [
|
|
2788
|
+
{
|
|
2789
|
+
$ref: "#/definitions/ProteusMap"
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
$ref: "#/definitions/ProteusValue"
|
|
2793
|
+
},
|
|
2794
|
+
{
|
|
2795
|
+
type: "string"
|
|
2796
|
+
}
|
|
2797
|
+
],
|
|
2798
|
+
description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, or a Map expression."
|
|
2757
2799
|
}
|
|
2758
2800
|
},
|
|
2759
2801
|
required: [
|
|
@@ -2772,6 +2814,9 @@ var definitions = {
|
|
|
2772
2814
|
},
|
|
2773
2815
|
url: {
|
|
2774
2816
|
anyOf: [
|
|
2817
|
+
{
|
|
2818
|
+
$ref: "#/definitions/ProteusMap"
|
|
2819
|
+
},
|
|
2775
2820
|
{
|
|
2776
2821
|
$ref: "#/definitions/ProteusValue"
|
|
2777
2822
|
},
|
|
@@ -2779,7 +2824,7 @@ var definitions = {
|
|
|
2779
2824
|
type: "string"
|
|
2780
2825
|
}
|
|
2781
2826
|
],
|
|
2782
|
-
description: "URL to download"
|
|
2827
|
+
description: "URL to download, or a Map expression resolving to multiple URLs"
|
|
2783
2828
|
}
|
|
2784
2829
|
},
|
|
2785
2830
|
required: [
|
|
@@ -2787,26 +2832,6 @@ var definitions = {
|
|
|
2787
2832
|
"url"
|
|
2788
2833
|
],
|
|
2789
2834
|
type: "object"
|
|
2790
|
-
},
|
|
2791
|
-
{
|
|
2792
|
-
additionalProperties: false,
|
|
2793
|
-
description: "Client-side component action - collects name/value pairs from a data array and sends as a message",
|
|
2794
|
-
properties: {
|
|
2795
|
-
action: {
|
|
2796
|
-
"const": "message-from",
|
|
2797
|
-
description: "The action type",
|
|
2798
|
-
type: "string"
|
|
2799
|
-
},
|
|
2800
|
-
path: {
|
|
2801
|
-
description: "JSON pointer to an array of objects with name and value fields",
|
|
2802
|
-
type: "string"
|
|
2803
|
-
}
|
|
2804
|
-
},
|
|
2805
|
-
required: [
|
|
2806
|
-
"action",
|
|
2807
|
-
"path"
|
|
2808
|
-
],
|
|
2809
|
-
type: "object"
|
|
2810
2835
|
}
|
|
2811
2836
|
],
|
|
2812
2837
|
description: "Handler for user interactions - a server-side tool call, client-side message, or client-side component action"
|
|
@@ -4521,6 +4546,32 @@ var definitions = {
|
|
|
4521
4546
|
],
|
|
4522
4547
|
type: "object"
|
|
4523
4548
|
},
|
|
4549
|
+
ProteusConcat: {
|
|
4550
|
+
additionalProperties: false,
|
|
4551
|
+
properties: {
|
|
4552
|
+
$type: {
|
|
4553
|
+
"const": "Concat"
|
|
4554
|
+
},
|
|
4555
|
+
children: {
|
|
4556
|
+
description: "Array of values to concatenate into a single string. Each item is resolved and joined together.",
|
|
4557
|
+
items: {
|
|
4558
|
+
anyOf: [
|
|
4559
|
+
{
|
|
4560
|
+
$ref: "#/definitions/ProteusNode"
|
|
4561
|
+
},
|
|
4562
|
+
{
|
|
4563
|
+
type: "string"
|
|
4564
|
+
}
|
|
4565
|
+
]
|
|
4566
|
+
},
|
|
4567
|
+
type: "array"
|
|
4568
|
+
}
|
|
4569
|
+
},
|
|
4570
|
+
required: [
|
|
4571
|
+
"$type"
|
|
4572
|
+
],
|
|
4573
|
+
type: "object"
|
|
4574
|
+
},
|
|
4524
4575
|
ProteusDataTable: {
|
|
4525
4576
|
additionalProperties: false,
|
|
4526
4577
|
examples: [
|
|
@@ -2392,6 +2392,34 @@ var definitions = {
|
|
|
2392
2392
|
],
|
|
2393
2393
|
type: "object"
|
|
2394
2394
|
},
|
|
2395
|
+
{
|
|
2396
|
+
properties: {
|
|
2397
|
+
"!": {
|
|
2398
|
+
anyOf: [
|
|
2399
|
+
{
|
|
2400
|
+
type: "string"
|
|
2401
|
+
},
|
|
2402
|
+
{
|
|
2403
|
+
type: "number"
|
|
2404
|
+
},
|
|
2405
|
+
{
|
|
2406
|
+
type: "boolean"
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
type: "null"
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
$ref: "#/definitions/ProteusValue"
|
|
2413
|
+
}
|
|
2414
|
+
],
|
|
2415
|
+
description: "Falsy check - returns true if value is falsy (null, undefined, false, 0, or empty string)"
|
|
2416
|
+
}
|
|
2417
|
+
},
|
|
2418
|
+
required: [
|
|
2419
|
+
"!"
|
|
2420
|
+
],
|
|
2421
|
+
type: "object"
|
|
2422
|
+
},
|
|
2395
2423
|
{
|
|
2396
2424
|
properties: {
|
|
2397
2425
|
and: {
|
|
@@ -2654,6 +2682,9 @@ var definitions = {
|
|
|
2654
2682
|
{
|
|
2655
2683
|
$ref: "#/definitions/ProteusChart"
|
|
2656
2684
|
},
|
|
2685
|
+
{
|
|
2686
|
+
$ref: "#/definitions/ProteusConcat"
|
|
2687
|
+
},
|
|
2657
2688
|
{
|
|
2658
2689
|
$ref: "#/definitions/ProteusDataTable"
|
|
2659
2690
|
},
|
|
@@ -2739,8 +2770,18 @@ var definitions = {
|
|
|
2739
2770
|
description: "Client-side message action",
|
|
2740
2771
|
properties: {
|
|
2741
2772
|
message: {
|
|
2742
|
-
|
|
2743
|
-
|
|
2773
|
+
anyOf: [
|
|
2774
|
+
{
|
|
2775
|
+
$ref: "#/definitions/ProteusMap"
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
$ref: "#/definitions/ProteusValue"
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
type: "string"
|
|
2782
|
+
}
|
|
2783
|
+
],
|
|
2784
|
+
description: "Message to send to LLM via sendNewMessage(). Can be a string, a Value reference, or a Map expression."
|
|
2744
2785
|
}
|
|
2745
2786
|
},
|
|
2746
2787
|
required: [
|
|
@@ -2758,6 +2799,9 @@ var definitions = {
|
|
|
2758
2799
|
},
|
|
2759
2800
|
url: {
|
|
2760
2801
|
anyOf: [
|
|
2802
|
+
{
|
|
2803
|
+
$ref: "#/definitions/ProteusMap"
|
|
2804
|
+
},
|
|
2761
2805
|
{
|
|
2762
2806
|
$ref: "#/definitions/ProteusValue"
|
|
2763
2807
|
},
|
|
@@ -2765,7 +2809,7 @@ var definitions = {
|
|
|
2765
2809
|
type: "string"
|
|
2766
2810
|
}
|
|
2767
2811
|
],
|
|
2768
|
-
description: "URL to download"
|
|
2812
|
+
description: "URL to download, or a Map expression resolving to multiple URLs"
|
|
2769
2813
|
}
|
|
2770
2814
|
},
|
|
2771
2815
|
required: [
|
|
@@ -2773,25 +2817,6 @@ var definitions = {
|
|
|
2773
2817
|
"url"
|
|
2774
2818
|
],
|
|
2775
2819
|
type: "object"
|
|
2776
|
-
},
|
|
2777
|
-
{
|
|
2778
|
-
description: "Client-side component action - collects name/value pairs from a data array and sends as a message",
|
|
2779
|
-
properties: {
|
|
2780
|
-
action: {
|
|
2781
|
-
"const": "message-from",
|
|
2782
|
-
description: "The action type",
|
|
2783
|
-
type: "string"
|
|
2784
|
-
},
|
|
2785
|
-
path: {
|
|
2786
|
-
description: "JSON pointer to an array of objects with name and value fields",
|
|
2787
|
-
type: "string"
|
|
2788
|
-
}
|
|
2789
|
-
},
|
|
2790
|
-
required: [
|
|
2791
|
-
"action",
|
|
2792
|
-
"path"
|
|
2793
|
-
],
|
|
2794
|
-
type: "object"
|
|
2795
2820
|
}
|
|
2796
2821
|
],
|
|
2797
2822
|
description: "Handler for user interactions - a server-side tool call, client-side message, or client-side component action"
|
|
@@ -4495,6 +4520,31 @@ var definitions = {
|
|
|
4495
4520
|
],
|
|
4496
4521
|
type: "object"
|
|
4497
4522
|
},
|
|
4523
|
+
ProteusConcat: {
|
|
4524
|
+
properties: {
|
|
4525
|
+
$type: {
|
|
4526
|
+
"const": "Concat"
|
|
4527
|
+
},
|
|
4528
|
+
children: {
|
|
4529
|
+
description: "Array of values to concatenate into a single string. Each item is resolved and joined together.",
|
|
4530
|
+
items: {
|
|
4531
|
+
anyOf: [
|
|
4532
|
+
{
|
|
4533
|
+
$ref: "#/definitions/ProteusNode"
|
|
4534
|
+
},
|
|
4535
|
+
{
|
|
4536
|
+
type: "string"
|
|
4537
|
+
}
|
|
4538
|
+
]
|
|
4539
|
+
},
|
|
4540
|
+
type: "array"
|
|
4541
|
+
}
|
|
4542
|
+
},
|
|
4543
|
+
required: [
|
|
4544
|
+
"$type"
|
|
4545
|
+
],
|
|
4546
|
+
type: "object"
|
|
4547
|
+
},
|
|
4498
4548
|
ProteusDataTable: {
|
|
4499
4549
|
examples: [
|
|
4500
4550
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -109,20 +109,10 @@ declare namespace ProteusSelect {
|
|
|
109
109
|
var displayName: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
type ProteusShowProps = {
|
|
113
|
-
children?: ReactNode;
|
|
114
|
-
/**
|
|
115
|
-
* Single condition or array of conditions (AND logic). Each condition is an
|
|
116
|
-
* object with one operator key.
|
|
117
|
-
*/
|
|
118
|
-
when: ProteusCondition;
|
|
119
|
-
};
|
|
120
|
-
type ComparisonValue = boolean | null | number | string | {
|
|
121
|
-
$type: "Value";
|
|
122
|
-
path: string;
|
|
123
|
-
};
|
|
124
112
|
type ProteusCondition = {
|
|
125
113
|
"!!": ComparisonValue;
|
|
114
|
+
} | {
|
|
115
|
+
"!": ComparisonValue;
|
|
126
116
|
} | {
|
|
127
117
|
"!=": ComparisonValue[];
|
|
128
118
|
} | {
|
|
@@ -140,6 +130,19 @@ type ProteusCondition = {
|
|
|
140
130
|
} | {
|
|
141
131
|
or: ProteusCondition[];
|
|
142
132
|
};
|
|
133
|
+
type ComparisonValue = boolean | null | number | string | {
|
|
134
|
+
$type: "Value";
|
|
135
|
+
path: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
type ProteusShowProps = {
|
|
139
|
+
children?: ReactNode;
|
|
140
|
+
/**
|
|
141
|
+
* Single condition or array of conditions (AND logic). Each condition is an
|
|
142
|
+
* object with one operator key.
|
|
143
|
+
*/
|
|
144
|
+
when: ProteusCondition;
|
|
145
|
+
};
|
|
143
146
|
declare function ProteusShow({ children, when }: ProteusShowProps): react_jsx_runtime.JSX.Element | null;
|
|
144
147
|
declare namespace ProteusShow {
|
|
145
148
|
var displayName: string;
|
|
@@ -222,10 +225,7 @@ type ProteusEventHandler = {
|
|
|
222
225
|
action: "download";
|
|
223
226
|
url: (ProteusValueProps & {
|
|
224
227
|
$type: "Value";
|
|
225
|
-
}) | string;
|
|
226
|
-
} | {
|
|
227
|
-
action: "message-from";
|
|
228
|
-
path: string;
|
|
228
|
+
}) | string | string[];
|
|
229
229
|
} | {
|
|
230
230
|
message: string;
|
|
231
231
|
} | {
|