@sanity/agent-context-explorer
Advanced tools
+49
-19
@@ -290,2 +290,7 @@ #!/usr/bin/env node | ||
| **CRITICAL: Always dereference references to get actual content.** | ||
| - \`features[]._ref\` \u2192 only gets IDs (not useful) | ||
| - \`features[]->{_id, name, copy}\` \u2192 gets actual data (useful!) | ||
| When you find reference arrays, always try dereferencing with \`->\` to see what's inside. | ||
| ### Aggregations | ||
@@ -534,5 +539,6 @@ - Count with filter: \`count(*[_type == "feedback" && rating < 0])\` | ||
| var REQUIRED_SECTIONS = [ | ||
| "## Critical Rules", | ||
| "## Schema Reference", | ||
| "## Query Patterns", | ||
| "## Critical Rules", | ||
| "## Fallback Strategy", | ||
| "## Known Limitations", | ||
@@ -596,8 +602,9 @@ "## Exploration Coverage" | ||
| Produce a single markdown document. Do NOT wrap it in a code fence. Use these exact five section headings (## level): | ||
| Produce a single markdown document. Do NOT wrap it in a code fence. Use these exact six section headings (## level) in this order: | ||
| \`\`\` | ||
| ## Critical Rules | ||
| ## Schema Reference | ||
| ## Query Patterns | ||
| ## Critical Rules | ||
| ## Fallback Strategy | ||
| ## Known Limitations | ||
@@ -607,3 +614,3 @@ ## Exploration Coverage | ||
| You may add additional ## sections when findings naturally cluster, but these five must always be present with these exact headings. | ||
| You may add additional ## sections when findings naturally cluster, but these six must always be present with these exact headings in this order. | ||
@@ -613,2 +620,7 @@ Here is a structural skeleton showing the expected format: | ||
| \`\`\` | ||
| ## Critical Rules | ||
| - Always [do X] when [condition] \u2014 [why] | ||
| - Never [do Y] \u2014 [what goes wrong] | ||
| ## Schema Reference | ||
@@ -629,6 +641,7 @@ | ||
| ## Critical Rules | ||
| ## Fallback Strategy | ||
| - Always [do X] when [condition] \u2014 [why] | ||
| - Never [do Y] \u2014 [what goes wrong] | ||
| 1. [First thing to try when query fails] | ||
| 2. [Second alternative] | ||
| 3. [When to conclude data doesn't exist] | ||
@@ -650,2 +663,18 @@ ## Known Limitations | ||
| **Section: ## Critical Rules** | ||
| Imperative statements an agent must follow. **This section comes FIRST because it's most important.** Use "Always..." and "Never..." language. | ||
| Format as a bullet list: | ||
| - Always [do X] when [condition] \u2014 [why] | ||
| - Never [do Y] \u2014 [what goes wrong] | ||
| These are cross-cutting rules that apply regardless of query type. Derive rules from: | ||
| - Repeated failures across explorations | ||
| - Surprising discoveries | ||
| - Fields that look correct but don't work | ||
| - Required filters (locale, status, etc.) | ||
| --- | ||
| **Section: ## Schema Reference** | ||
@@ -682,18 +711,19 @@ | ||
| **Section: ## Critical Rules** | ||
| **Section: ## Fallback Strategy** | ||
| Imperative statements an agent must follow. Use "Always..." and "Never..." language. | ||
| What to try when queries fail. This prevents agents from giving up too early. | ||
| Format as a bullet list: | ||
| - Always [do X] when [condition] \u2014 [why] | ||
| - Never [do Y] \u2014 [what goes wrong] | ||
| Format as a numbered list: | ||
| 1. [First alternative approach] | ||
| 2. [Second alternative approach] | ||
| 3. [Third alternative] | ||
| 4. [When to conclude data doesn't exist] | ||
| These are cross-cutting rules that apply regardless of query type. Category-specific rules belong inline in Query Patterns. | ||
| These should be generic strategies derived from the exploration \u2014 what worked when initial approaches failed. Examples: | ||
| - Try alternate document types | ||
| - Use text search: \`@ match text::query("keywords")\` | ||
| - Check reference fields for linked documents | ||
| - Broaden filters by removing conditions | ||
| - After 3-4 failed approaches, conclude the data isn't in this dataset | ||
| Derive rules from: | ||
| - Repeated failures across explorations | ||
| - Surprising discoveries | ||
| - Fields that look correct but don't work | ||
| - Required filters (locale, status, etc.) | ||
| --- | ||
@@ -700,0 +730,0 @@ |
+1
-1
| { | ||
| "name": "@sanity/agent-context-explorer", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "Exploration tool for Sanity Agent Context — produces knowledge docs for production AI agents", | ||
@@ -5,0 +5,0 @@ "author": "Sanity.io <hello@sanity.io>", |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
146903
1.7%1187
1.98%13
8.33%