better-cmdk 0.0.22 → 0.0.23

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.
@@ -344,6 +344,14 @@ const assistant = useAssistant({
344
344
  getContext: () => ({
345
345
  currentPage: window.location.pathname,
346
346
  currentDateTime: new Date().toISOString(),
347
+ // Pass as much app data as possible — reuse existing cached queries.
348
+ // The AI can only help with what it can see. Include:
349
+ // - User profile (name, email, timezone, role, preferences)
350
+ // - Core entities (projects, items, orders — whatever your app manages)
351
+ // - Recent activity (upcoming events, notifications, recent changes)
352
+ // - Connected accounts (integrations, linked services)
353
+ // - Settings (theme, defaults, feature flags)
354
+ // See modifywithai's AGENTS.md Step 5b for a full context discovery guide.
347
355
  }),
348
356
  })
349
357
 
@@ -355,6 +363,8 @@ const assistant = useAssistant({
355
363
  />
356
364
  ```
357
365
 
366
+ **Context richness matters.** The AI can only answer questions about data it receives via `getContext`. Passing just `currentPage` means the AI can't answer "what are my projects?" or "who's on my team?" Reuse your app's existing data-fetching hooks (React Query, tRPC, SWR) — they're already cached client-side, so this adds zero extra network requests. Aim for 5-15 data categories covering user profile, core entities, recent activity, connected accounts, and settings.
367
+
358
368
  ---
359
369
 
360
370
  ## Step 7: Mount the component
@@ -342,6 +342,14 @@ const assistant = useAssistant({
342
342
  getContext: () => ({
343
343
  currentPage: window.location.pathname,
344
344
  currentDateTime: new Date().toISOString(),
345
+ // Pass as much app data as possible — reuse existing cached queries.
346
+ // The AI can only help with what it can see. Include:
347
+ // - User profile (name, email, timezone, role, preferences)
348
+ // - Core entities (projects, items, orders — whatever your app manages)
349
+ // - Recent activity (upcoming events, notifications, recent changes)
350
+ // - Connected accounts (integrations, linked services)
351
+ // - Settings (theme, defaults, feature flags)
352
+ // See modifywithai's AGENTS.md Step 5b for a full context discovery guide.
345
353
  }),
346
354
  })
347
355
 
@@ -353,6 +361,8 @@ const assistant = useAssistant({
353
361
  />
354
362
  ```
355
363
 
364
+ **Context richness matters.** The AI can only answer questions about data it receives via `getContext`. Passing just `currentPage` means the AI can't answer "what are my projects?" or "who's on my team?" Reuse your app's existing data-fetching hooks (React Query, tRPC, SWR) — they're already cached client-side, so this adds zero extra network requests. Aim for 5-15 data categories covering user profile, core entities, recent activity, connected accounts, and settings.
365
+
356
366
  ---
357
367
 
358
368
  ## Step 7: Mount the component
@@ -344,6 +344,14 @@ const assistant = useAssistant({
344
344
  getContext: () => ({
345
345
  currentPage: window.location.pathname,
346
346
  currentDateTime: new Date().toISOString(),
347
+ // Pass as much app data as possible — reuse existing cached queries.
348
+ // The AI can only help with what it can see. Include:
349
+ // - User profile (name, email, timezone, role, preferences)
350
+ // - Core entities (projects, items, orders — whatever your app manages)
351
+ // - Recent activity (upcoming events, notifications, recent changes)
352
+ // - Connected accounts (integrations, linked services)
353
+ // - Settings (theme, defaults, feature flags)
354
+ // See modifywithai's AGENTS.md Step 5b for a full context discovery guide.
347
355
  }),
348
356
  })
349
357
 
@@ -355,6 +363,8 @@ const assistant = useAssistant({
355
363
  />
356
364
  ```
357
365
 
366
+ **Context richness matters.** The AI can only answer questions about data it receives via `getContext`. Passing just `currentPage` means the AI can't answer "what are my projects?" or "who's on my team?" Reuse your app's existing data-fetching hooks (React Query, tRPC, SWR) — they're already cached client-side, so this adds zero extra network requests. Aim for 5-15 data categories covering user profile, core entities, recent activity, connected accounts, and settings.
367
+
358
368
  ---
359
369
 
360
370
  ## Step 7: Mount the component
@@ -343,6 +343,14 @@ const assistant = useAssistant({
343
343
  getContext: () => ({
344
344
  currentPage: window.location.pathname,
345
345
  currentDateTime: new Date().toISOString(),
346
+ // Pass as much app data as possible — reuse existing cached queries.
347
+ // The AI can only help with what it can see. Include:
348
+ // - User profile (name, email, timezone, role, preferences)
349
+ // - Core entities (projects, items, orders — whatever your app manages)
350
+ // - Recent activity (upcoming events, notifications, recent changes)
351
+ // - Connected accounts (integrations, linked services)
352
+ // - Settings (theme, defaults, feature flags)
353
+ // See modifywithai's AGENTS.md Step 5b for a full context discovery guide.
346
354
  }),
347
355
  })
348
356
 
@@ -354,6 +362,8 @@ const assistant = useAssistant({
354
362
  />
355
363
  ```
356
364
 
365
+ **Context richness matters.** The AI can only answer questions about data it receives via `getContext`. Passing just `currentPage` means the AI can't answer "what are my projects?" or "who's on my team?" Reuse your app's existing data-fetching hooks (React Query, tRPC, SWR) — they're already cached client-side, so this adds zero extra network requests. Aim for 5-15 data categories covering user profile, core entities, recent activity, connected accounts, and settings.
366
+
357
367
  ---
358
368
 
359
369
  ## Step 7: Mount the component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-cmdk",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",