@agnic/wallet-skills 1.2.1 → 1.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agnic/wallet-skills",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Vercel AI SDK skills for AgnicPay wallet — balance, payments, trading, x402, and agent identity",
5
5
  "keywords": [
6
6
  "agnic",
@@ -78,6 +78,26 @@ npx agnic@latest email send --to user@example.com --subject "Hello" --body "Mess
78
78
  npx agnic@latest email reply --message-id <id> --body "Reply text"
79
79
  ```
80
80
 
81
+ ### AI Gateway
82
+
83
+ ```bash
84
+ # List available AI models
85
+ npx agnic@latest ai models --json
86
+ npx agnic@latest ai models --provider openai --json
87
+
88
+ # Chat with an AI model
89
+ npx agnic@latest ai chat --model openai/gpt-4o --prompt 'Explain quantum computing' --json
90
+ npx agnic@latest ai chat --model meta-llama/llama-3.3-70b --prompt 'Summarize this text' --json
91
+
92
+ # Generate an image
93
+ npx agnic@latest ai image --prompt 'A sunset over mountains' --output sunset.png
94
+ npx agnic@latest ai image --prompt 'Logo design' --aspect-ratio 16:9 --output logo.png
95
+ ```
96
+
97
+ 340+ models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, and more.
98
+ Model format: `provider/model-name` (e.g., `openai/gpt-4o`, `google/gemini-2.0-flash`)
99
+ Free models: `meta-llama/*`, `google/gemma-*`, `mistralai/*`
100
+
81
101
  ### Workflow: Sign Up + Pay + Report
82
102
 
83
103
  1. Check auth: `npx agnic@latest status --json`
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: ai-gateway
3
+ description: Access 340+ AI models through the Agnic AI Gateway. Use when the user wants to chat with an AI model, generate images with AI, list available models, delegate a task to another LLM, or get a second opinion. Covers phrases like "ask GPT", "use Claude", "generate an image", "list AI models", "chat with AI", "call a model", "what models are available".
4
+ user-invocable: true
5
+ disable-model-invocation: false
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest ai *)"]
7
+ ---
8
+
9
+ # AI Gateway
10
+
11
+ Use `npx agnic@latest ai` commands to access 340+ AI models (OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, and more) through the Agnic AI Gateway. Costs are deducted from your USDC balance per token. Free models available for development.
12
+
13
+ ## Confirm wallet is initialized and authed
14
+
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Command Syntax
22
+
23
+ ### List models
24
+
25
+ ```bash
26
+ npx agnic@latest ai models [options]
27
+ ```
28
+
29
+ ### Chat with a model
30
+
31
+ ```bash
32
+ npx agnic@latest ai chat --model <id> --prompt "<text>" [options]
33
+ ```
34
+
35
+ ### Generate an image
36
+
37
+ ```bash
38
+ npx agnic@latest ai image --prompt "<text>" [options]
39
+ ```
40
+
41
+ ## Model Format
42
+
43
+ Models use `provider/model-name` format:
44
+
45
+ | Provider | Example Models |
46
+ | ----------- | ----------------------------------------- |
47
+ | openai | `openai/gpt-4o`, `openai/gpt-4-turbo` |
48
+ | anthropic | `anthropic/claude-3.5-sonnet` |
49
+ | google | `google/gemini-2.0-flash`, `google/gemma-*` |
50
+ | meta-llama | `meta-llama/llama-3.3-70b` |
51
+ | mistralai | `mistralai/mistral-large-latest` |
52
+ | deepseek | `deepseek/deepseek-chat` |
53
+
54
+ Free models: `meta-llama/*`, `google/gemma-*`, `mistralai/*`
55
+
56
+ ## Options
57
+
58
+ ### ai models
59
+
60
+ | Option | Description |
61
+ | -------------------- | ---------------------------------------- |
62
+ | `--provider <name>` | Filter by provider (e.g., openai) |
63
+ | `--search <term>` | Search in model name |
64
+ | `--json` | Output as JSON |
65
+
66
+ ### ai chat
67
+
68
+ | Option | Description |
69
+ | ----------------------- | ---------------------------------------- |
70
+ | `--model <id>` | Model ID (required) |
71
+ | `--prompt <text>` | User message (required) |
72
+ | `--system <text>` | System prompt |
73
+ | `--temperature <n>` | Temperature 0-2 (default: 0.7) |
74
+ | `--max-tokens <n>` | Max tokens in response |
75
+ | `--json` | Output as JSON |
76
+
77
+ ### ai image
78
+
79
+ | Option | Description |
80
+ | ------------------------- | ---------------------------------------- |
81
+ | `--prompt <text>` | Image description (required) |
82
+ | `--model <id>` | Model (default: google/gemini-2.0-flash) |
83
+ | `--aspect-ratio <ratio>` | 1:1, 16:9, 9:16, 4:3, 3:2 (default: 1:1)|
84
+ | `--output <path>` | Save image to file |
85
+ | `--json` | Output as JSON |
86
+
87
+ ## Input Validation
88
+
89
+ Before constructing the command, validate all user-provided values:
90
+
91
+ - **model**: Must match `^[a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+$` (provider/model format). Reject if it contains spaces, semicolons, pipes, or backticks.
92
+ - **prompt**: Single-quote the value to prevent shell expansion. Escape internal single quotes.
93
+ - **temperature**: Must be a number between 0 and 2 (`^[0-2](\.\d+)?$`).
94
+ - **aspect-ratio**: Must be one of: `1:1`, `16:9`, `9:16`, `4:3`, `3:2`.
95
+ - **output**: Must be a valid file path. Reject if it contains shell metacharacters.
96
+
97
+ Do not pass unvalidated user input into the command.
98
+
99
+ ## Examples
100
+
101
+ ```bash
102
+ # List all available models
103
+ npx agnic@latest ai models --json
104
+
105
+ # List only OpenAI models
106
+ npx agnic@latest ai models --provider openai
107
+
108
+ # Search for GPT models
109
+ npx agnic@latest ai models --search gpt
110
+
111
+ # Chat with GPT-4o
112
+ npx agnic@latest ai chat --model openai/gpt-4o --prompt 'Explain quantum computing in one sentence'
113
+
114
+ # Chat with system prompt
115
+ npx agnic@latest ai chat --model anthropic/claude-3.5-sonnet --system 'You are a helpful coding assistant' --prompt 'Write a Python hello world'
116
+
117
+ # Use a free model
118
+ npx agnic@latest ai chat --model meta-llama/llama-3.3-70b --prompt 'What is 2+2?' --json
119
+
120
+ # Generate an image
121
+ npx agnic@latest ai image --prompt 'A sunset over mountains' --output sunset.png
122
+
123
+ # Generate widescreen image
124
+ npx agnic@latest ai image --prompt 'Cyberpunk cityscape' --aspect-ratio 16:9 --output city.png
125
+
126
+ # Get image as JSON (base64)
127
+ npx agnic@latest ai image --prompt 'Logo design for a tech startup' --json
128
+ ```
129
+
130
+ ## Prerequisites
131
+
132
+ - Must be authenticated (`npx agnic@latest status` to check)
133
+ - Wallet must have USDC balance (free models available for testing)
134
+ - Image generation requires a model with image output support (default: google/gemini-2.0-flash)
135
+
136
+ ## Error Handling
137
+
138
+ Common errors:
139
+
140
+ - "Not authenticated" — Run `npx agnic@latest auth login` first
141
+ - "Insufficient balance" — Fund wallet at https://pay.agnic.ai
142
+ - "Model not found" — Check available models with `npx agnic@latest ai models`
143
+ - "No image returned" — Try a different model or rephrase the prompt
144
+ - "Rate limit exceeded" — Wait a moment and retry
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: ai-gateway
3
+ description: Access 340+ AI models through the Agnic AI Gateway. Use when the user wants to chat with AI, generate images, or list available models.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Check auth: `npx agnic@latest status --json`
9
+ 2. List models: `npx agnic@latest ai models --json`
10
+ 3. Filter by provider: `npx agnic@latest ai models --provider openai --json`
11
+ 4. Chat with a model: `npx agnic@latest ai chat --model <provider/model> --prompt "<text>" --json`
12
+ 5. Chat with system prompt: `npx agnic@latest ai chat --model <id> --system "<system>" --prompt "<text>" --json`
13
+ 6. Generate image: `npx agnic@latest ai image --prompt "<text>" --output image.png`
14
+ 7. Generate image with aspect ratio: `npx agnic@latest ai image --prompt "<text>" --aspect-ratio 16:9 --output wide.png`
15
+
16
+ Model format: `provider/model-name` (e.g., `openai/gpt-4o`, `anthropic/claude-3.5-sonnet`, `meta-llama/llama-3.3-70b`).
17
+ Free models: meta-llama, google/gemma, mistralai.
18
+
19
+ ## Allowed Tools
20
+ - npx agnic@latest ai models
21
+ - npx agnic@latest ai chat
22
+ - npx agnic@latest ai image