@blinkdotnew/sdk 2.6.1 → 2.6.2

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.js CHANGED
@@ -5199,6 +5199,9 @@ var BlinkAIImpl = class {
5199
5199
  * ```
5200
5200
  */
5201
5201
  createAgent(options) {
5202
+ if (!options) {
5203
+ throw new BlinkAIError("createAgent(options) requires an options object with at least a `model`.");
5204
+ }
5202
5205
  const agent = new Agent(options);
5203
5206
  agent._setHttpClient(this.httpClient);
5204
5207
  return agent;
@@ -5213,6 +5216,11 @@ var BlinkAIImpl = class {
5213
5216
  * @returns The same Agent instance (with httpClient set)
5214
5217
  */
5215
5218
  bindAgent(agent) {
5219
+ if (!agent) {
5220
+ throw new BlinkAIError(
5221
+ "bindAgent(agent) requires an Agent instance but received null/undefined. Create one first with `new Agent({...})` or `blink.ai.createAgent({...})`. (The useAgent() hook stays idle while its `agent` is null, so this only fires on a direct bindAgent() call with a missing agent.)"
5222
+ );
5223
+ }
5216
5224
  agent._setHttpClient(this.httpClient);
5217
5225
  return agent;
5218
5226
  }
package/dist/index.mjs CHANGED
@@ -5197,6 +5197,9 @@ var BlinkAIImpl = class {
5197
5197
  * ```
5198
5198
  */
5199
5199
  createAgent(options) {
5200
+ if (!options) {
5201
+ throw new BlinkAIError("createAgent(options) requires an options object with at least a `model`.");
5202
+ }
5200
5203
  const agent = new Agent(options);
5201
5204
  agent._setHttpClient(this.httpClient);
5202
5205
  return agent;
@@ -5211,6 +5214,11 @@ var BlinkAIImpl = class {
5211
5214
  * @returns The same Agent instance (with httpClient set)
5212
5215
  */
5213
5216
  bindAgent(agent) {
5217
+ if (!agent) {
5218
+ throw new BlinkAIError(
5219
+ "bindAgent(agent) requires an Agent instance but received null/undefined. Create one first with `new Agent({...})` or `blink.ai.createAgent({...})`. (The useAgent() hook stays idle while its `agent` is null, so this only fires on a direct bindAgent() call with a missing agent.)"
5220
+ );
5221
+ }
5214
5222
  agent._setHttpClient(this.httpClient);
5215
5223
  return agent;
5216
5224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkdotnew/sdk",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "Blink TypeScript SDK for client-side applications - Zero-boilerplate CRUD + auth + AI + analytics + notifications for modern SaaS/AI apps",
5
5
  "keywords": [
6
6
  "blink",