@emblemvault/hustle-react 1.4.3 → 1.4.4

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.
@@ -2116,6 +2116,30 @@ function HustleProvider({
2116
2116
  }
2117
2117
  };
2118
2118
  }, [client]);
2119
+ useEffect(() => {
2120
+ if (typeof window !== "undefined") {
2121
+ const win = window;
2122
+ win.__hustleGetModel = () => selectedModel;
2123
+ win.__hustleSetModel = (model) => setSelectedModel(model);
2124
+ win.__hustleGetSystemPrompt = () => systemPrompt;
2125
+ win.__hustleSetSystemPrompt = (prompt) => setSystemPrompt(prompt);
2126
+ win.__hustleGetSkipServerPrompt = () => skipServerPrompt;
2127
+ win.__hustleSetSkipServerPrompt = (skip) => setSkipServerPrompt(skip);
2128
+ win.__hustleGetModels = () => models;
2129
+ }
2130
+ return () => {
2131
+ if (typeof window !== "undefined") {
2132
+ const win = window;
2133
+ delete win.__hustleGetModel;
2134
+ delete win.__hustleSetModel;
2135
+ delete win.__hustleGetSystemPrompt;
2136
+ delete win.__hustleSetSystemPrompt;
2137
+ delete win.__hustleGetSkipServerPrompt;
2138
+ delete win.__hustleSetSkipServerPrompt;
2139
+ delete win.__hustleGetModels;
2140
+ }
2141
+ };
2142
+ }, [selectedModel, setSelectedModel, systemPrompt, setSystemPrompt, skipServerPrompt, setSkipServerPrompt, models]);
2119
2143
  const loadModels = useCallback(async () => {
2120
2144
  if (!client) {
2121
2145
  log("Cannot load models - client not ready");
@@ -3715,6 +3739,15 @@ Executors run in the browser context with full access to:
3715
3739
  - **window.__hustleListPlugins()** - List all installed plugins
3716
3740
  - **window.__hustleGetPlugin(name)** - Get a specific plugin by name
3717
3741
 
3742
+ ### Hustle Settings Globals (Read/Write)
3743
+ - **window.__hustleGetModel()** - Get the current model override (empty string = server default)
3744
+ - **window.__hustleSetModel(model)** - Set the model override (e.g., "anthropic/claude-3-opus")
3745
+ - **window.__hustleGetSystemPrompt()** - Get the current system prompt override
3746
+ - **window.__hustleSetSystemPrompt(prompt)** - Set the system prompt override
3747
+ - **window.__hustleGetSkipServerPrompt()** - Get whether server prompt is skipped (boolean)
3748
+ - **window.__hustleSetSkipServerPrompt(skip)** - Set whether to skip server prompt
3749
+ - **window.__hustleGetModels()** - Get list of available models (read-only)
3750
+
3718
3751
  ### DOM Manipulation Examples
3719
3752
  Create a modal: document.createElement('div'), style it, append to document.body
3720
3753
  Add event listeners: element.addEventListener('click', handler)