node-red-contrib-vectorprime 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vectorprime.html +61 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-vectorprime",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "VectorPrime Decision Kernel node for Node-RED",
5
5
  "main": "vectorprime.js",
6
6
  "license": "MIT",
package/vectorprime.html CHANGED
@@ -27,6 +27,28 @@
27
27
  </div>
28
28
  </script>
29
29
 
30
+ <!-- ✅ Help text for the config node -->
31
+ <script type="text/html" data-help-name="vectorprime-config">
32
+ <p><b>VectorPrime Config</b></p>
33
+
34
+ <p>
35
+ Stores your VectorPrime API connection details securely using Node-RED credentials.
36
+ This keeps your API key <b>out of flow exports</b>.
37
+ </p>
38
+
39
+ <h3>Quick setup</h3>
40
+ <ol>
41
+ <li>Leave Base URL as default (or set your own hosted backend).</li>
42
+ <li>Click <b>Get Free Key</b> to generate a starter key instantly.</li>
43
+ <li>Use this config in one or more VectorPrime nodes.</li>
44
+ </ol>
45
+
46
+ <p>
47
+ <b>Default Base URL:</b><br/>
48
+ <code>https://vectorprime-kernel-backend.onrender.com</code>
49
+ </p>
50
+ </script>
51
+
30
52
  <script type="text/javascript">
31
53
  (function () {
32
54
  function normalizeBaseUrl(url) {
@@ -68,6 +90,7 @@
68
90
  return;
69
91
  }
70
92
 
93
+ // Call backend directly from the editor
71
94
  const resp = await fetch(`${baseUrl}/v1/keys/free`, {
72
95
  method: "POST",
73
96
  headers: { "Content-Type": "application/json" },
@@ -103,7 +126,6 @@
103
126
  })();
104
127
  </script>
105
128
 
106
-
107
129
  <script type="text/html" data-template-name="vectorprime-rank">
108
130
  <div class="form-row">
109
131
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
@@ -122,14 +144,48 @@
122
144
 
123
145
  <div class="form-row">
124
146
  <div style="font-size:12px; color:#666;">
125
- ✅ Sends <code>msg.payload</code> to VectorPrime and returns the response in <code>msg.payload</code>.
147
+ ✅ Sends <code>msg.payload</code> to VectorPrime and returns ranked results in <code>msg.payload</code>.
126
148
  </div>
127
149
  </div>
128
150
  </script>
129
151
 
152
+ <!-- ✅ Help text for the rank node (THIS controls the palette hover tooltip content) -->
153
+ <script type="text/html" data-help-name="vectorprime-rank">
154
+ <p><b>Rank Decision (VectorPrime)</b></p>
155
+
156
+ <p>
157
+ Instantly rank tasks, events, or choices by <b>priority + urgency</b> using the VectorPrime Decision Kernel.
158
+ Perfect for building flows that automatically pick the <b>best next action</b>.
159
+ </p>
160
+
161
+ <h3>Best use cases</h3>
162
+ <ul>
163
+ <li><b>Incident response:</b> Rank alerts and decide what to fix first</li>
164
+ <li><b>Ops & automation:</b> Choose the next job to run when resources are limited</li>
165
+ <li><b>AI agents:</b> Pick the best tool/action based on outcome + risk</li>
166
+ <li><b>Queues & tickets:</b> Prioritize support tickets, backlog items, escalations</li>
167
+ <li><b>Workflow routing:</b> Route messages/events to the right handler by importance</li>
168
+ </ul>
169
+
170
+ <h3>Input</h3>
171
+ <p>
172
+ Expects <code>msg.payload</code> to be your decision set / tasks object (JSON).
173
+ </p>
174
+
175
+ <h3>Output</h3>
176
+ <p>
177
+ Returns the VectorPrime response in <code>msg.payload</code>, including ranked results.
178
+ </p>
179
+
180
+ <h3>Tip</h3>
181
+ <p>
182
+ If you hit a free-tier limit, the response may include an upgrade URL so your flow can continue.
183
+ </p>
184
+ </script>
185
+
130
186
  <script type="text/javascript">
131
187
  RED.nodes.registerType("vectorprime-rank", {
132
- category: "network", // ✅ CHANGED: Network category
188
+ category: "network", // ✅ moved to Network
133
189
  color: "#2563EB",
134
190
  defaults: {
135
191
  name: { value: "" },
@@ -140,61 +196,11 @@
140
196
  outputs: 1,
141
197
  icon: "font-awesome/fa-bolt",
142
198
 
143
- paletteLabel: "Rank Decision (VectorPrime)", // 1-second clarity
199
+ // This makes the palette show a human label instantly
200
+ paletteLabel: "Rank Decision (VectorPrime)",
144
201
 
145
202
  label: function () {
146
203
  return this.name || "Rank Decision (VectorPrime)";
147
- },
148
-
149
- labelStyle: function () {
150
- return this.name ? "node_label_italic" : "";
151
204
  }
152
205
  });
153
- </script>
154
-
155
-
156
- <!-- ✅ Help docs (fixes “no information available”) -->
157
- <script type="text/html" data-help-name="vectorprime-config">
158
- <p><b>VectorPrime Config</b></p>
159
- <p>
160
- Stores your VectorPrime backend URL + API Key securely using Node-RED credentials.
161
- </p>
162
-
163
- <h3>Fields</h3>
164
- <ul>
165
- <li><b>Base URL</b> — your VectorPrime backend (Render URL by default).</li>
166
- <li><b>API Key</b> — stored securely (not exported with flows).</li>
167
- </ul>
168
-
169
- <p>
170
- Click <b>Get Free Key</b> to generate a free-tier key automatically (requires backend support).
171
- </p>
172
- </script>
173
-
174
- <script type="text/html" data-help-name="vectorprime-rank">
175
- <p><b>Rank Decision (VectorPrime)</b></p>
176
-
177
- <p>
178
- Sends <code>msg.payload</code> to VectorPrime for ranking and returns the result in <code>msg.payload</code>.
179
- </p>
180
-
181
- <h3>Input Example</h3>
182
- <pre>{
183
- "decision_id": "node-red-demo-001",
184
- "prompt": "Pick one.",
185
- "options": [{"id":"a","label":"A"},{"id":"b","label":"B"}],
186
- "engine": "classical",
187
- "seed": 123
188
- }</pre>
189
-
190
- <h3>Output</h3>
191
- <p>
192
- Returns ranked options, probabilities, and metadata in <code>msg.payload</code>.
193
- </p>
194
-
195
- <h3>Authentication</h3>
196
- <ul>
197
- <li>If <code>msg.headers.Authorization</code> is provided, it uses that.</li>
198
- <li>Otherwise it uses the key stored in <b>VectorPrime Config</b>.</li>
199
- </ul>
200
206
  </script>