@modelnex/sdk 0.5.9 → 0.5.10
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/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +19 -4
- package/dist/index.mjs +19 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -827,6 +827,10 @@ interface ModelNexProviderProps {
|
|
|
827
827
|
* userId — used for per-user tour completion state
|
|
828
828
|
*/
|
|
829
829
|
userProfile?: UserProfile;
|
|
830
|
+
/**
|
|
831
|
+
* Same-origin base for tour API (avoids CORS for ?modelnex_test_tour=)
|
|
832
|
+
*/
|
|
833
|
+
toursApiBase?: string;
|
|
830
834
|
/**
|
|
831
835
|
* Enable SDK dev tools unconditionally (tour recording, studio mode)
|
|
832
836
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -827,6 +827,10 @@ interface ModelNexProviderProps {
|
|
|
827
827
|
* userId — used for per-user tour completion state
|
|
828
828
|
*/
|
|
829
829
|
userProfile?: UserProfile;
|
|
830
|
+
/**
|
|
831
|
+
* Same-origin base for tour API (avoids CORS for ?modelnex_test_tour=)
|
|
832
|
+
*/
|
|
833
|
+
toursApiBase?: string;
|
|
830
834
|
/**
|
|
831
835
|
* Enable SDK dev tools unconditionally (tour recording, studio mode)
|
|
832
836
|
*/
|
package/dist/index.js
CHANGED
|
@@ -8191,6 +8191,11 @@ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { wid
|
|
|
8191
8191
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
8192
8192
|
] });
|
|
8193
8193
|
var MinimizeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 18h8" }) });
|
|
8194
|
+
var TrashIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M3 6h18" }),
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
|
|
8197
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
|
|
8198
|
+
] });
|
|
8194
8199
|
var StopIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) });
|
|
8195
8200
|
var ChevronDown = ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", style: { transform: open ? "rotate(180deg)" : "none", transition: "transform 0.2s" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m6 9 6 6 6-6" }) });
|
|
8196
8201
|
function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
@@ -8252,7 +8257,7 @@ function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
|
8252
8257
|
!hasTraceContent ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { marginBottom: "12px", padding: "8px", background: "#fef3c7", borderRadius: "4px", borderLeft: "3px solid #f59e0b" }, children: [
|
|
8253
8258
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontWeight: 600, color: "#92400e", marginBottom: "4px" }, children: "No trace data" }),
|
|
8254
8259
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: "10px", color: "#71717a", marginBottom: "6px" }, children: "The server may not have OPENROUTER_API_KEY set, or the request failed before the agent ran." }),
|
|
8255
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { style: { margin: 0, padding: "8px", background: "#fff", borderRadius: "4px", fontSize: "10px", overflow: "auto", maxHeight: "120px" }, children: JSON.stringify(debug, null, 2) })
|
|
8260
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { style: { margin: 0, padding: "8px", background: "#fff", borderRadius: "4px", fontSize: "10px", overflow: "auto", maxHeight: "120px", color: "#27272a" }, children: JSON.stringify(debug, null, 2) })
|
|
8256
8261
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
8257
8262
|
debug.llmInput && traces.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { marginBottom: "12px" }, children: [
|
|
8258
8263
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontWeight: 600, color: "#3f3f46", marginBottom: "4px" }, children: "Input \u2192 agent" }),
|
|
@@ -8299,7 +8304,7 @@ function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
|
8299
8304
|
isStepExpanded && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
8300
8305
|
t.reasoning && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { marginBottom: "6px" }, children: [
|
|
8301
8306
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { color: "#71717a", marginBottom: "2px" }, children: "Reasoning" }),
|
|
8302
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { style: { margin: 0, padding: "6px", background: "#fef3c7", borderRadius: "4px", whiteSpace: "pre-wrap", wordBreak: "break-word", maxHeight: "100px", overflow: "auto", borderLeft: "3px solid #f59e0b" }, children: t.reasoning })
|
|
8307
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { style: { margin: 0, padding: "6px", background: "#fef3c7", borderRadius: "4px", whiteSpace: "pre-wrap", wordBreak: "break-word", maxHeight: "100px", overflow: "auto", borderLeft: "3px solid #f59e0b", color: "#451a03" }, children: t.reasoning })
|
|
8303
8308
|
] }),
|
|
8304
8309
|
t.llmInput && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
8305
8310
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { marginBottom: "6px" }, children: [
|
|
@@ -9159,6 +9164,15 @@ function ModelNexChatBubble({
|
|
|
9159
9164
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(BookOpenIcon, {})
|
|
9160
9165
|
}
|
|
9161
9166
|
) }) }),
|
|
9167
|
+
messages.length > 0 && !(tourPlayback.isActive || onboardingPlayback.isActive) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { title: "Clear chat", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
9168
|
+
"button",
|
|
9169
|
+
{
|
|
9170
|
+
onClick: clearChat,
|
|
9171
|
+
style: { padding: "8px", borderRadius: "10px", border: "none", background: "transparent", cursor: "pointer", color: "#71717a" },
|
|
9172
|
+
"aria-label": "Clear chat",
|
|
9173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrashIcon, {})
|
|
9174
|
+
}
|
|
9175
|
+
) }),
|
|
9162
9176
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { title: "Minimize", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
9163
9177
|
"button",
|
|
9164
9178
|
{
|
|
@@ -10894,12 +10908,12 @@ var ModelNexProvider = ({
|
|
|
10894
10908
|
children,
|
|
10895
10909
|
websiteId,
|
|
10896
10910
|
userProfile,
|
|
10911
|
+
toursApiBase,
|
|
10897
10912
|
devMode
|
|
10898
10913
|
}) => {
|
|
10899
10914
|
const serverUrl = DEFAULT_SERVER_URL2;
|
|
10900
10915
|
const commandUrl = void 0;
|
|
10901
10916
|
const disableSocket = false;
|
|
10902
|
-
const toursApiBase = void 0;
|
|
10903
10917
|
const renderedChildren = children;
|
|
10904
10918
|
const [activeAgentActions, setActiveAgentActions] = (0, import_react21.useState)(/* @__PURE__ */ new Set());
|
|
10905
10919
|
const [stagingFields, setStagingFields] = (0, import_react21.useState)(/* @__PURE__ */ new Set());
|
|
@@ -10990,12 +11004,13 @@ var ModelNexProvider = ({
|
|
|
10990
11004
|
setChatMessages,
|
|
10991
11005
|
websiteId,
|
|
10992
11006
|
userProfile,
|
|
11007
|
+
toursApiBase,
|
|
10993
11008
|
voiceMuted,
|
|
10994
11009
|
setVoiceMuted,
|
|
10995
11010
|
socketId,
|
|
10996
11011
|
devMode
|
|
10997
11012
|
}),
|
|
10998
|
-
[serverUrl, commandUrl, registerAction, unregisterAction, activeAgentActions, stagingFields, highlightActions, studioMode, recordingMode, extractedElements, tagStore, chatMessages, websiteId, userProfile, voiceMuted, socketId, devMode]
|
|
11013
|
+
[serverUrl, commandUrl, registerAction, unregisterAction, activeAgentActions, stagingFields, highlightActions, studioMode, recordingMode, extractedElements, tagStore, chatMessages, websiteId, userProfile, toursApiBase, voiceMuted, socketId, devMode]
|
|
10999
11014
|
);
|
|
11000
11015
|
return import_react21.default.createElement(
|
|
11001
11016
|
ModelNexContext.Provider,
|
package/dist/index.mjs
CHANGED
|
@@ -7981,6 +7981,11 @@ var CloseIcon = () => /* @__PURE__ */ jsxs3("svg", { width: "var(--modelnex-bubb
|
|
|
7981
7981
|
/* @__PURE__ */ jsx4("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
7982
7982
|
] });
|
|
7983
7983
|
var MinimizeIcon = () => /* @__PURE__ */ jsx4("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx4("path", { d: "M8 18h8" }) });
|
|
7984
|
+
var TrashIcon = () => /* @__PURE__ */ jsxs3("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
7985
|
+
/* @__PURE__ */ jsx4("path", { d: "M3 6h18" }),
|
|
7986
|
+
/* @__PURE__ */ jsx4("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
|
|
7987
|
+
/* @__PURE__ */ jsx4("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
|
|
7988
|
+
] });
|
|
7984
7989
|
var StopIcon = () => /* @__PURE__ */ jsx4("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx4("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) });
|
|
7985
7990
|
var ChevronDown = ({ open }) => /* @__PURE__ */ jsx4("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", style: { transform: open ? "rotate(180deg)" : "none", transition: "transform 0.2s" }, children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) });
|
|
7986
7991
|
function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
@@ -8042,7 +8047,7 @@ function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
|
8042
8047
|
!hasTraceContent ? /* @__PURE__ */ jsxs3("div", { style: { marginBottom: "12px", padding: "8px", background: "#fef3c7", borderRadius: "4px", borderLeft: "3px solid #f59e0b" }, children: [
|
|
8043
8048
|
/* @__PURE__ */ jsx4("div", { style: { fontWeight: 600, color: "#92400e", marginBottom: "4px" }, children: "No trace data" }),
|
|
8044
8049
|
/* @__PURE__ */ jsx4("div", { style: { fontSize: "10px", color: "#71717a", marginBottom: "6px" }, children: "The server may not have OPENROUTER_API_KEY set, or the request failed before the agent ran." }),
|
|
8045
|
-
/* @__PURE__ */ jsx4("pre", { style: { margin: 0, padding: "8px", background: "#fff", borderRadius: "4px", fontSize: "10px", overflow: "auto", maxHeight: "120px" }, children: JSON.stringify(debug, null, 2) })
|
|
8050
|
+
/* @__PURE__ */ jsx4("pre", { style: { margin: 0, padding: "8px", background: "#fff", borderRadius: "4px", fontSize: "10px", overflow: "auto", maxHeight: "120px", color: "#27272a" }, children: JSON.stringify(debug, null, 2) })
|
|
8046
8051
|
] }) : /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
8047
8052
|
debug.llmInput && traces.length === 0 && /* @__PURE__ */ jsxs3("div", { style: { marginBottom: "12px" }, children: [
|
|
8048
8053
|
/* @__PURE__ */ jsx4("div", { style: { fontWeight: 600, color: "#3f3f46", marginBottom: "4px" }, children: "Input \u2192 agent" }),
|
|
@@ -8089,7 +8094,7 @@ function AgentTraces({ debug, command, defaultExpanded = true }) {
|
|
|
8089
8094
|
isStepExpanded && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
8090
8095
|
t.reasoning && /* @__PURE__ */ jsxs3("div", { style: { marginBottom: "6px" }, children: [
|
|
8091
8096
|
/* @__PURE__ */ jsx4("div", { style: { color: "#71717a", marginBottom: "2px" }, children: "Reasoning" }),
|
|
8092
|
-
/* @__PURE__ */ jsx4("pre", { style: { margin: 0, padding: "6px", background: "#fef3c7", borderRadius: "4px", whiteSpace: "pre-wrap", wordBreak: "break-word", maxHeight: "100px", overflow: "auto", borderLeft: "3px solid #f59e0b" }, children: t.reasoning })
|
|
8097
|
+
/* @__PURE__ */ jsx4("pre", { style: { margin: 0, padding: "6px", background: "#fef3c7", borderRadius: "4px", whiteSpace: "pre-wrap", wordBreak: "break-word", maxHeight: "100px", overflow: "auto", borderLeft: "3px solid #f59e0b", color: "#451a03" }, children: t.reasoning })
|
|
8093
8098
|
] }),
|
|
8094
8099
|
t.llmInput && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
8095
8100
|
/* @__PURE__ */ jsxs3("div", { style: { marginBottom: "6px" }, children: [
|
|
@@ -8949,6 +8954,15 @@ function ModelNexChatBubble({
|
|
|
8949
8954
|
children: /* @__PURE__ */ jsx4(BookOpenIcon, {})
|
|
8950
8955
|
}
|
|
8951
8956
|
) }) }),
|
|
8957
|
+
messages.length > 0 && !(tourPlayback.isActive || onboardingPlayback.isActive) && /* @__PURE__ */ jsx4(Tooltip, { title: "Clear chat", children: /* @__PURE__ */ jsx4(
|
|
8958
|
+
"button",
|
|
8959
|
+
{
|
|
8960
|
+
onClick: clearChat,
|
|
8961
|
+
style: { padding: "8px", borderRadius: "10px", border: "none", background: "transparent", cursor: "pointer", color: "#71717a" },
|
|
8962
|
+
"aria-label": "Clear chat",
|
|
8963
|
+
children: /* @__PURE__ */ jsx4(TrashIcon, {})
|
|
8964
|
+
}
|
|
8965
|
+
) }),
|
|
8952
8966
|
/* @__PURE__ */ jsx4(Tooltip, { title: "Minimize", children: /* @__PURE__ */ jsx4(
|
|
8953
8967
|
"button",
|
|
8954
8968
|
{
|
|
@@ -10684,12 +10698,12 @@ var ModelNexProvider = ({
|
|
|
10684
10698
|
children,
|
|
10685
10699
|
websiteId,
|
|
10686
10700
|
userProfile,
|
|
10701
|
+
toursApiBase,
|
|
10687
10702
|
devMode
|
|
10688
10703
|
}) => {
|
|
10689
10704
|
const serverUrl = DEFAULT_SERVER_URL2;
|
|
10690
10705
|
const commandUrl = void 0;
|
|
10691
10706
|
const disableSocket = false;
|
|
10692
|
-
const toursApiBase = void 0;
|
|
10693
10707
|
const renderedChildren = children;
|
|
10694
10708
|
const [activeAgentActions, setActiveAgentActions] = useState15(/* @__PURE__ */ new Set());
|
|
10695
10709
|
const [stagingFields, setStagingFields] = useState15(/* @__PURE__ */ new Set());
|
|
@@ -10780,12 +10794,13 @@ var ModelNexProvider = ({
|
|
|
10780
10794
|
setChatMessages,
|
|
10781
10795
|
websiteId,
|
|
10782
10796
|
userProfile,
|
|
10797
|
+
toursApiBase,
|
|
10783
10798
|
voiceMuted,
|
|
10784
10799
|
setVoiceMuted,
|
|
10785
10800
|
socketId,
|
|
10786
10801
|
devMode
|
|
10787
10802
|
}),
|
|
10788
|
-
[serverUrl, commandUrl, registerAction, unregisterAction, activeAgentActions, stagingFields, highlightActions, studioMode, recordingMode, extractedElements, tagStore, chatMessages, websiteId, userProfile, voiceMuted, socketId, devMode]
|
|
10803
|
+
[serverUrl, commandUrl, registerAction, unregisterAction, activeAgentActions, stagingFields, highlightActions, studioMode, recordingMode, extractedElements, tagStore, chatMessages, websiteId, userProfile, toursApiBase, voiceMuted, socketId, devMode]
|
|
10789
10804
|
);
|
|
10790
10805
|
return React8.createElement(
|
|
10791
10806
|
ModelNexContext.Provider,
|