oneie 3.6.38 → 3.6.40
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/.claude/agents/agent-frontend.md +48 -0
- package/.claude/commands/deploy.md +187 -17
- package/.claude/commands/media-upload.md +186 -0
- package/.claude/hooks/.last-news-context +1 -1
- package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
- package/README.md +28 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/one/README.md +1 -2
- package/one/knowledge/one-protocol-ai-agents.md +892 -0
- package/one/knowledge/one-protocol-executive-report.md +617 -0
- package/one/knowledge/one-protocol-standard.md +869 -0
- package/one/knowledge/one-protocol-whitepaper.md +756 -0
- package/one/knowledge/ontology-education-game.md +1654 -0
- package/one/knowledge/ontology-v2.md +4449 -0
- package/one/knowledge/ontology.md +1 -1
- package/one/things/contracts/Move.toml +12 -0
- package/one/things/contracts/README.md +288 -0
- package/one/things/contracts/one.move +762 -0
- package/one/things/contracts/sdk.ts +578 -0
- package/one/things/crypto/FEATURES.md +78 -0
- package/one/things/crypto/ONECORE.md +62 -0
- package/one/things/crypto/ONECOREFAQ.md +22 -0
- package/one/things/crypto/ONECOREHOW.md +46 -0
- package/one/things/crypto/ONEENTERPRISE.md +64 -0
- package/one/things/crypto/ONEENTERPRISEFAQ.md +64 -0
- package/one/things/crypto/ONEENTERPRISEHOW.md +53 -0
- package/one/things/crypto/ONEPRO.md +60 -0
- package/one/things/crypto/ONEPROFAQ.md +22 -0
- package/one/things/crypto/ONEPROHOW.md +53 -0
- package/one/things/crypto/READMEAGENCY.md +64 -0
- package/one/things/crypto/VSL.md +45 -0
- package/one/things/crypto/WebsiteCopy.md +176 -0
- package/one/things/design-system.md +832 -0
- package/one/things/pay.one.ie.md +53 -0
- package/one/things/plans/ai-elements-integration.md +483 -0
- package/one/things/plans/one-protocol-and-payone-usage.md +82 -0
- package/one/things/plans/plan-connect-to-api.md +146 -0
- package/one/things/plans/video-frontend.md +146 -88
- package/one/things/plans-u.md +905 -0
- package/one/things/products/Blockchain Products.md +6278 -0
- package/one/things/scripts-clean-mac.sh +409 -0
- package/one/things/todo-release.md +654 -0
- package/one/things/todo.md +9 -642
- package/one/things/video-script-backup.md +318 -0
- package/one/things/video-script-demo.md +382 -0
- package/one/things/video-script-ontology.md +0 -1
- package/one/things/video-script.md +361 -0
- package/package.json +8 -6
- package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-311.pyc +0 -0
- package/llms.txt +0 -257
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Here's what
|
|
2
|
+
it can do:
|
|
3
|
+
|
|
4
|
+
What pay.one.ie Can Do
|
|
5
|
+
|
|
6
|
+
Core Payment Processing
|
|
7
|
+
|
|
8
|
+
- Accept payments from customers across multiple blockchains (EVM, Sui, Solana, Bitcoin)
|
|
9
|
+
- Process cryptocurrency transactions and verify on-chain claims
|
|
10
|
+
- Generate payment links for products and services
|
|
11
|
+
- Multi-token payments (accept various cryptocurrencies)
|
|
12
|
+
|
|
13
|
+
Merchant Dashboard Features
|
|
14
|
+
|
|
15
|
+
Wallet Management
|
|
16
|
+
- View merchant wallets across different blockchains
|
|
17
|
+
- Import/generate new wallets
|
|
18
|
+
- Display balance with USD conversion
|
|
19
|
+
- QR codes for sharing addresses
|
|
20
|
+
- Sweep functionality for derived wallets
|
|
21
|
+
|
|
22
|
+
Token Management
|
|
23
|
+
- List deployed tokens (ERC-20, SPL, Move contracts)
|
|
24
|
+
- Display token metadata (name, symbol, supply, decimals)
|
|
25
|
+
- View token holders
|
|
26
|
+
- Burn/mint operations
|
|
27
|
+
- Token contract verification
|
|
28
|
+
|
|
29
|
+
Smart Contracts
|
|
30
|
+
- Connect and manage deployed smart contracts
|
|
31
|
+
- ABI explorer for smart contract functions
|
|
32
|
+
- Call contract functions directly
|
|
33
|
+
- Contract interaction interface
|
|
34
|
+
|
|
35
|
+
Product Management
|
|
36
|
+
- Create product catalog
|
|
37
|
+
- Set pricing for products
|
|
38
|
+
- Link products to payment processing
|
|
39
|
+
- Inventory tracking
|
|
40
|
+
- Sales analytics
|
|
41
|
+
|
|
42
|
+
Transaction History
|
|
43
|
+
- Complete payment history tracking
|
|
44
|
+
- Filter by status (pending, confirmed, failed)
|
|
45
|
+
- Filter by blockchain
|
|
46
|
+
- Search by transaction hash
|
|
47
|
+
- Export to CSV/JSON
|
|
48
|
+
|
|
49
|
+
Account Features
|
|
50
|
+
- Merchant account settings
|
|
51
|
+
- API key management
|
|
52
|
+
- Webhook configuration
|
|
53
|
+
- Team role management (owner, admin, user)
|
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
# AI Elements Integration Plan
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Status:** Planning
|
|
5
|
+
**Created:** 2025-01-12
|
|
6
|
+
**Owner:** builder
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Plan to integrate AI SDK Elements into the chat interface (`/pages/chat/index`), replacing custom components with production-ready AI SDK components for enhanced functionality and better developer experience.
|
|
11
|
+
|
|
12
|
+
## Current State
|
|
13
|
+
|
|
14
|
+
### Existing Components
|
|
15
|
+
|
|
16
|
+
**Chat Page:** `/web/src/pages/chat/index.astro`
|
|
17
|
+
- Uses `ChatClient` component with `client:only="react"`
|
|
18
|
+
- Full-screen layout with fixed header and input
|
|
19
|
+
|
|
20
|
+
**Current Custom Components:**
|
|
21
|
+
1. **PromptInput** (`/web/src/components/ai/PromptInput.tsx`)
|
|
22
|
+
- Simple textarea + button
|
|
23
|
+
- Enter to submit, Shift+Enter for new line
|
|
24
|
+
- Basic loading state
|
|
25
|
+
- Props: `value`, `onChange`, `onSubmit`, `isLoading`, `placeholder`
|
|
26
|
+
|
|
27
|
+
2. **ChatClient** (`/web/src/components/ai/ChatClient.tsx`)
|
|
28
|
+
- Full chat interface with messages, input, settings
|
|
29
|
+
- Model selection (Gemini Flash Lite, GPT-4, Claude, etc.)
|
|
30
|
+
- API key management (localStorage)
|
|
31
|
+
- Premium features: reasoning, tool calls, generative UI
|
|
32
|
+
- Demo mode for showcasing features
|
|
33
|
+
|
|
34
|
+
**AI SDK Elements Available:**
|
|
35
|
+
- **PromptInput** (`/web/src/components/ai/elements/prompt-input.tsx`)
|
|
36
|
+
- Advanced textarea with attachments
|
|
37
|
+
- File upload (drag & drop, paste, click)
|
|
38
|
+
- Speech-to-text button
|
|
39
|
+
- Model selector integration
|
|
40
|
+
- Action menu with extensibility
|
|
41
|
+
- Provider pattern for global state
|
|
42
|
+
- Validation (maxFiles, maxFileSize, accept)
|
|
43
|
+
|
|
44
|
+
## Integration Goals
|
|
45
|
+
|
|
46
|
+
### Phase 1: Replace PromptInput (Immediate Win)
|
|
47
|
+
|
|
48
|
+
**Goal:** Replace custom `PromptInput` with AI SDK `PromptInput` element
|
|
49
|
+
|
|
50
|
+
**Benefits:**
|
|
51
|
+
- File attachments (images, PDFs, docs)
|
|
52
|
+
- Drag & drop support
|
|
53
|
+
- Paste images from clipboard
|
|
54
|
+
- Speech-to-text (browser API)
|
|
55
|
+
- Better keyboard shortcuts
|
|
56
|
+
- Professional UX out-of-the-box
|
|
57
|
+
|
|
58
|
+
**Implementation Steps:**
|
|
59
|
+
|
|
60
|
+
1. **Update ChatClient to use AI SDK PromptInput**
|
|
61
|
+
- Import AI SDK components
|
|
62
|
+
- Replace custom `<PromptInput>` with AI SDK version
|
|
63
|
+
- Adapt state management for attachments
|
|
64
|
+
- Handle file conversion (blob → data URL)
|
|
65
|
+
|
|
66
|
+
2. **Add File Preview**
|
|
67
|
+
- Use `<PromptInputAttachments>` to show uploaded files
|
|
68
|
+
- Use `<PromptInputAttachment>` for individual file cards
|
|
69
|
+
- Implement remove functionality
|
|
70
|
+
|
|
71
|
+
3. **Enable Speech-to-Text**
|
|
72
|
+
- Add `<PromptInputSpeechButton>` to footer
|
|
73
|
+
- Connect to textarea ref
|
|
74
|
+
- Handle transcription updates
|
|
75
|
+
|
|
76
|
+
4. **Add Action Menu (Optional Features)**
|
|
77
|
+
- Add `<PromptInputActionMenu>` with dropdown
|
|
78
|
+
- Include `<PromptInputActionAddAttachments>` for file upload
|
|
79
|
+
- Add future actions (code blocks, templates, etc.)
|
|
80
|
+
|
|
81
|
+
### Phase 2: Advanced Features (Enhanced UX)
|
|
82
|
+
|
|
83
|
+
**Goal:** Leverage full AI SDK Elements ecosystem
|
|
84
|
+
|
|
85
|
+
**Features to Add:**
|
|
86
|
+
|
|
87
|
+
1. **Model Selector Integration**
|
|
88
|
+
- Use `<PromptInputSelect>` in footer or header
|
|
89
|
+
- Replace custom dropdown with SDK component
|
|
90
|
+
- Sync with OpenRouter model selection
|
|
91
|
+
|
|
92
|
+
2. **Attachment Validation**
|
|
93
|
+
- Set `accept="image/*"` for image-only mode
|
|
94
|
+
- Set `maxFiles={5}` to limit attachments
|
|
95
|
+
- Set `maxFileSize={10 * 1024 * 1024}` (10MB limit)
|
|
96
|
+
- Handle `onError` with toast notifications
|
|
97
|
+
|
|
98
|
+
3. **Global Drop Zone**
|
|
99
|
+
- Enable `globalDrop={true}` for document-level drop
|
|
100
|
+
- Add visual feedback for drag-over state
|
|
101
|
+
|
|
102
|
+
4. **Provider Pattern (Multi-Component State)**
|
|
103
|
+
- Wrap chat in `<PromptInputProvider>`
|
|
104
|
+
- Share input state across header/footer/sidebar
|
|
105
|
+
- Enable external components to control input
|
|
106
|
+
|
|
107
|
+
### Phase 3: Premium Elements (Future Work)
|
|
108
|
+
|
|
109
|
+
**Goal:** Integrate advanced AI SDK Elements for rich experiences
|
|
110
|
+
|
|
111
|
+
**Components to Explore:**
|
|
112
|
+
|
|
113
|
+
1. **Message Components**
|
|
114
|
+
- `<Message>` - Advanced message rendering
|
|
115
|
+
- `<Reasoning>` - Chain-of-thought visualization
|
|
116
|
+
- `<Tool>` - Tool call display with collapsible details
|
|
117
|
+
- `<CodeBlock>` - Syntax-highlighted code with copy
|
|
118
|
+
|
|
119
|
+
2. **Conversation Components**
|
|
120
|
+
- `<Conversation>` - Thread management
|
|
121
|
+
- `<Controls>` - Message actions (edit, regenerate, branch)
|
|
122
|
+
- `<Canvas>` - Visual workspace for generative UI
|
|
123
|
+
|
|
124
|
+
3. **Specialized Elements**
|
|
125
|
+
- `<Artifact>` - Isolated code execution preview
|
|
126
|
+
- `<WebPreview>` - Live iframe rendering
|
|
127
|
+
- `<Sources>` - Citation and reference display
|
|
128
|
+
- `<Checkpoint>` - Save/restore conversation state
|
|
129
|
+
|
|
130
|
+
## Implementation Example
|
|
131
|
+
|
|
132
|
+
### Before (Custom PromptInput)
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
// ChatClient.tsx - Current Implementation
|
|
136
|
+
<PromptInput
|
|
137
|
+
value={input}
|
|
138
|
+
onChange={setInput}
|
|
139
|
+
onSubmit={handleSubmit}
|
|
140
|
+
isLoading={isLoading}
|
|
141
|
+
placeholder="Type your message..."
|
|
142
|
+
/>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### After (AI SDK PromptInput)
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// ChatClient.tsx - AI SDK Implementation
|
|
149
|
+
import {
|
|
150
|
+
PromptInput,
|
|
151
|
+
PromptInputBody,
|
|
152
|
+
PromptInputTextarea,
|
|
153
|
+
PromptInputFooter,
|
|
154
|
+
PromptInputTools,
|
|
155
|
+
PromptInputButton,
|
|
156
|
+
PromptInputSubmit,
|
|
157
|
+
PromptInputSpeechButton,
|
|
158
|
+
PromptInputAttachments,
|
|
159
|
+
PromptInputAttachment,
|
|
160
|
+
PromptInputActionMenu,
|
|
161
|
+
PromptInputActionMenuTrigger,
|
|
162
|
+
PromptInputActionMenuContent,
|
|
163
|
+
PromptInputActionAddAttachments,
|
|
164
|
+
} from '@/components/ai/elements/prompt-input';
|
|
165
|
+
|
|
166
|
+
// In ChatClient component
|
|
167
|
+
<PromptInput
|
|
168
|
+
accept="image/*"
|
|
169
|
+
multiple
|
|
170
|
+
maxFiles={5}
|
|
171
|
+
maxFileSize={10 * 1024 * 1024}
|
|
172
|
+
onError={(err) => toast.error(err.message)}
|
|
173
|
+
onSubmit={(message, event) => {
|
|
174
|
+
// message.text - user input text
|
|
175
|
+
// message.files - FileUIPart[] with images/attachments
|
|
176
|
+
handleSubmit(message.text, message.files);
|
|
177
|
+
}}
|
|
178
|
+
>
|
|
179
|
+
<PromptInputBody>
|
|
180
|
+
{/* File attachments preview */}
|
|
181
|
+
<PromptInputAttachments>
|
|
182
|
+
{(attachment) => (
|
|
183
|
+
<PromptInputAttachment data={attachment} />
|
|
184
|
+
)}
|
|
185
|
+
</PromptInputAttachments>
|
|
186
|
+
|
|
187
|
+
{/* Main textarea */}
|
|
188
|
+
<PromptInputTextarea
|
|
189
|
+
placeholder="Ask me anything with premium features..."
|
|
190
|
+
/>
|
|
191
|
+
|
|
192
|
+
{/* Footer with tools and submit */}
|
|
193
|
+
<PromptInputFooter>
|
|
194
|
+
<PromptInputTools>
|
|
195
|
+
{/* Action menu for additional features */}
|
|
196
|
+
<PromptInputActionMenu>
|
|
197
|
+
<PromptInputActionMenuTrigger />
|
|
198
|
+
<PromptInputActionMenuContent>
|
|
199
|
+
<PromptInputActionAddAttachments />
|
|
200
|
+
</PromptInputActionMenuContent>
|
|
201
|
+
</PromptInputActionMenu>
|
|
202
|
+
|
|
203
|
+
{/* Speech-to-text */}
|
|
204
|
+
<PromptInputSpeechButton />
|
|
205
|
+
</PromptInputTools>
|
|
206
|
+
|
|
207
|
+
{/* Submit button with loading state */}
|
|
208
|
+
<PromptInputSubmit
|
|
209
|
+
status={isLoading ? 'submitted' : 'idle'}
|
|
210
|
+
/>
|
|
211
|
+
</PromptInputFooter>
|
|
212
|
+
</PromptInputBody>
|
|
213
|
+
</PromptInput>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Technical Specifications
|
|
217
|
+
|
|
218
|
+
### File Handling
|
|
219
|
+
|
|
220
|
+
**Current:** No file upload support
|
|
221
|
+
|
|
222
|
+
**New Capabilities:**
|
|
223
|
+
- **Drag & Drop:** Drop files anywhere in form
|
|
224
|
+
- **Paste:** Paste images from clipboard (Ctrl+V)
|
|
225
|
+
- **Click:** Click to open file picker
|
|
226
|
+
- **Validation:** Accept filter, max files, max size
|
|
227
|
+
- **Preview:** Thumbnail for images, filename for others
|
|
228
|
+
- **Removal:** Click X on attachment to remove
|
|
229
|
+
|
|
230
|
+
**Data Flow:**
|
|
231
|
+
```
|
|
232
|
+
User uploads file
|
|
233
|
+
↓
|
|
234
|
+
Browser creates blob URL
|
|
235
|
+
↓
|
|
236
|
+
PromptInput stores as FileUIPart[] with id
|
|
237
|
+
↓
|
|
238
|
+
On submit: Convert blob → data URL
|
|
239
|
+
↓
|
|
240
|
+
Pass to onSubmit({ text, files })
|
|
241
|
+
↓
|
|
242
|
+
ChatClient sends to API with base64 data
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### State Management
|
|
246
|
+
|
|
247
|
+
**Current:** Component-level state (`useState`)
|
|
248
|
+
|
|
249
|
+
**Provider Pattern (Optional):**
|
|
250
|
+
```tsx
|
|
251
|
+
// Wrap entire chat in provider
|
|
252
|
+
<PromptInputProvider initialInput="">
|
|
253
|
+
<ChatHeader />
|
|
254
|
+
<MessageList />
|
|
255
|
+
<PromptInput onSubmit={handleSubmit}>
|
|
256
|
+
{/* Components auto-sync via provider */}
|
|
257
|
+
</PromptInput>
|
|
258
|
+
</PromptInputProvider>
|
|
259
|
+
|
|
260
|
+
// External components can access/control input
|
|
261
|
+
import { usePromptInputController } from '@/components/ai/elements/prompt-input';
|
|
262
|
+
|
|
263
|
+
function ChatHeader() {
|
|
264
|
+
const { textInput, attachments } = usePromptInputController();
|
|
265
|
+
|
|
266
|
+
return (
|
|
267
|
+
<div>
|
|
268
|
+
Current input: {textInput.value}
|
|
269
|
+
Attachments: {attachments.files.length}
|
|
270
|
+
</div>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### API Integration
|
|
276
|
+
|
|
277
|
+
**Current API Endpoint:** `/api/chat` (POST)
|
|
278
|
+
|
|
279
|
+
**Request Body:**
|
|
280
|
+
```json
|
|
281
|
+
{
|
|
282
|
+
"messages": [
|
|
283
|
+
{ "role": "user", "content": "Hello" }
|
|
284
|
+
],
|
|
285
|
+
"apiKey": "sk-or-v1-...",
|
|
286
|
+
"model": "google/gemini-2.5-flash-lite",
|
|
287
|
+
"premium": true
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Enhanced with Files:**
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"messages": [
|
|
295
|
+
{
|
|
296
|
+
"role": "user",
|
|
297
|
+
"content": [
|
|
298
|
+
{ "type": "text", "text": "What's in this image?" },
|
|
299
|
+
{
|
|
300
|
+
"type": "image",
|
|
301
|
+
"url": "data:image/png;base64,iVBORw0KG..."
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"apiKey": "sk-or-v1-...",
|
|
307
|
+
"model": "google/gemini-2.5-flash-lite",
|
|
308
|
+
"premium": true
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Server-Side Changes:**
|
|
313
|
+
- Parse multimodal content (text + images)
|
|
314
|
+
- Pass to OpenRouter with vision-capable models
|
|
315
|
+
- Handle file type validation server-side
|
|
316
|
+
|
|
317
|
+
## Migration Checklist
|
|
318
|
+
|
|
319
|
+
### Phase 1: PromptInput Replacement
|
|
320
|
+
|
|
321
|
+
- [ ] Install AI SDK Elements dependencies (if not installed)
|
|
322
|
+
- [ ] Import AI SDK PromptInput components
|
|
323
|
+
- [ ] Replace custom PromptInput in ChatClient
|
|
324
|
+
- [ ] Add file attachment preview UI
|
|
325
|
+
- [ ] Implement file-to-data-URL conversion
|
|
326
|
+
- [ ] Update API endpoint to handle multimodal content
|
|
327
|
+
- [ ] Test file upload (drag & drop, paste, click)
|
|
328
|
+
- [ ] Test speech-to-text (browser support)
|
|
329
|
+
- [ ] Add error handling for file validation
|
|
330
|
+
- [ ] Update placeholder text and UX copy
|
|
331
|
+
|
|
332
|
+
### Phase 2: Advanced Features
|
|
333
|
+
|
|
334
|
+
- [ ] Add PromptInputProvider wrapper
|
|
335
|
+
- [ ] Integrate model selector into footer
|
|
336
|
+
- [ ] Enable global drop zone
|
|
337
|
+
- [ ] Add toast notifications for errors
|
|
338
|
+
- [ ] Implement file size/type validation UI
|
|
339
|
+
- [ ] Add keyboard shortcuts documentation
|
|
340
|
+
- [ ] Test across browsers (Chrome, Firefox, Safari)
|
|
341
|
+
- [ ] Test mobile experience (touch, camera upload)
|
|
342
|
+
|
|
343
|
+
### Phase 3: Premium Elements
|
|
344
|
+
|
|
345
|
+
- [ ] Evaluate Message component for better rendering
|
|
346
|
+
- [ ] Consider Reasoning component for chain-of-thought
|
|
347
|
+
- [ ] Explore Tool component for tool call display
|
|
348
|
+
- [ ] Test CodeBlock for syntax highlighting
|
|
349
|
+
- [ ] Research Artifact/WebPreview for generative UI
|
|
350
|
+
- [ ] Consider Conversation for thread management
|
|
351
|
+
|
|
352
|
+
## Breaking Changes
|
|
353
|
+
|
|
354
|
+
**None - Backward Compatible**
|
|
355
|
+
|
|
356
|
+
The AI SDK PromptInput is designed to be a drop-in replacement. Existing API structure remains the same, with files as an optional addition.
|
|
357
|
+
|
|
358
|
+
**Migration Path:**
|
|
359
|
+
1. Replace component import
|
|
360
|
+
2. Update JSX structure
|
|
361
|
+
3. Add file handling logic
|
|
362
|
+
4. Test and iterate
|
|
363
|
+
|
|
364
|
+
## Performance Considerations
|
|
365
|
+
|
|
366
|
+
**Bundle Size:**
|
|
367
|
+
- AI SDK PromptInput: ~15KB gzipped
|
|
368
|
+
- Additional features (speech, attachments): +10KB
|
|
369
|
+
- Total impact: ~25KB (acceptable for chat feature)
|
|
370
|
+
|
|
371
|
+
**Runtime Performance:**
|
|
372
|
+
- File preview: Use blob URLs (no re-encoding)
|
|
373
|
+
- Convert to data URL only on submit (async)
|
|
374
|
+
- Cleanup blob URLs on unmount (memory management)
|
|
375
|
+
|
|
376
|
+
**Optimization:**
|
|
377
|
+
- Use `client:load` for PromptInput (critical interactivity)
|
|
378
|
+
- Lazy load speech recognition (only when button clicked)
|
|
379
|
+
- Optimize attachment preview rendering (virtual list for 10+ files)
|
|
380
|
+
|
|
381
|
+
## Success Metrics
|
|
382
|
+
|
|
383
|
+
**User Experience:**
|
|
384
|
+
- File upload success rate > 95%
|
|
385
|
+
- Speech-to-text accuracy > 80% (browser-dependent)
|
|
386
|
+
- Time to first input < 500ms
|
|
387
|
+
- Zero layout shifts during file upload
|
|
388
|
+
|
|
389
|
+
**Developer Experience:**
|
|
390
|
+
- Lines of code reduced by 40%
|
|
391
|
+
- Maintenance burden reduced (using SDK components)
|
|
392
|
+
- Feature parity with ChatGPT/Claude interfaces
|
|
393
|
+
- Easier to add new input features
|
|
394
|
+
|
|
395
|
+
## Future Enhancements
|
|
396
|
+
|
|
397
|
+
**Potential Add-Ons:**
|
|
398
|
+
1. **Template Messages** - Pre-filled prompts with variables
|
|
399
|
+
2. **Slash Commands** - `/image`, `/code`, `/summarize`
|
|
400
|
+
3. **Context Menu** - Right-click for additional actions
|
|
401
|
+
4. **Voice Output** - Text-to-speech for responses
|
|
402
|
+
5. **Collaborative Editing** - Real-time co-editing of prompts
|
|
403
|
+
6. **History Search** - Search and reuse previous prompts
|
|
404
|
+
|
|
405
|
+
## Resources
|
|
406
|
+
|
|
407
|
+
**Documentation:**
|
|
408
|
+
- AI SDK Elements: https://ai-sdk.dev/elements
|
|
409
|
+
- PromptInput Component: https://ai-sdk.dev/elements/components/prompt-input
|
|
410
|
+
- File Handling: https://ai-sdk.dev/elements/guides/file-handling
|
|
411
|
+
- Speech-to-Text: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
|
|
412
|
+
|
|
413
|
+
**Examples:**
|
|
414
|
+
- ChatGPT Clone: `/web/src/components/ai/examples/demo-chatgpt.tsx`
|
|
415
|
+
- Claude Clone: `/web/src/components/ai/examples/demo-claude.tsx`
|
|
416
|
+
- PromptInput Demo: `/web/src/components/ai/examples/prompt-input.tsx`
|
|
417
|
+
|
|
418
|
+
## Ontology Mapping
|
|
419
|
+
|
|
420
|
+
**Dimension:** Things (AI Chat Feature)
|
|
421
|
+
|
|
422
|
+
**Thing Type:** `ai_chat_interface`
|
|
423
|
+
|
|
424
|
+
**Properties:**
|
|
425
|
+
```json
|
|
426
|
+
{
|
|
427
|
+
"name": "AI Chat with Elements",
|
|
428
|
+
"type": "ai_chat_interface",
|
|
429
|
+
"properties": {
|
|
430
|
+
"supports_attachments": true,
|
|
431
|
+
"supports_speech": true,
|
|
432
|
+
"supports_multimodal": true,
|
|
433
|
+
"max_files": 5,
|
|
434
|
+
"max_file_size": 10485760,
|
|
435
|
+
"accepted_file_types": ["image/*"],
|
|
436
|
+
"models": [
|
|
437
|
+
"google/gemini-2.5-flash-lite",
|
|
438
|
+
"openai/gpt-4",
|
|
439
|
+
"anthropic/claude-3-opus"
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**Events to Log:**
|
|
446
|
+
- `ai_chat_message_sent` - User sends message
|
|
447
|
+
- `ai_chat_file_uploaded` - User uploads file
|
|
448
|
+
- `ai_chat_speech_used` - User uses speech-to-text
|
|
449
|
+
- `ai_chat_model_changed` - User changes model
|
|
450
|
+
- `ai_chat_error_occurred` - Validation or API error
|
|
451
|
+
|
|
452
|
+
## Decision Log
|
|
453
|
+
|
|
454
|
+
**2025-01-12: Approved AI SDK PromptInput Integration**
|
|
455
|
+
- **Decision:** Replace custom PromptInput with AI SDK version
|
|
456
|
+
- **Rationale:** Better UX, more features, less maintenance
|
|
457
|
+
- **Trade-off:** Bundle size +25KB vs. custom 5KB (acceptable)
|
|
458
|
+
|
|
459
|
+
**2025-01-12: File Upload Enabled**
|
|
460
|
+
- **Decision:** Enable file attachments (images only initially)
|
|
461
|
+
- **Rationale:** Essential for modern AI chat (ChatGPT has it)
|
|
462
|
+
- **Trade-off:** Server-side vision model required (Gemini supports it)
|
|
463
|
+
|
|
464
|
+
**2025-01-12: Speech-to-Text Included**
|
|
465
|
+
- **Decision:** Add speech-to-text button (browser API)
|
|
466
|
+
- **Rationale:** Accessibility + mobile UX improvement
|
|
467
|
+
- **Trade-off:** Browser support varies (graceful degradation)
|
|
468
|
+
|
|
469
|
+
## Next Steps
|
|
470
|
+
|
|
471
|
+
1. **Create Feature Branch:** `feature/ai-elements-integration`
|
|
472
|
+
2. **Implement Phase 1:** Replace PromptInput with AI SDK version
|
|
473
|
+
3. **Test File Upload:** Verify drag & drop, paste, validation
|
|
474
|
+
4. **Update API Endpoint:** Handle multimodal content
|
|
475
|
+
5. **Deploy to Staging:** Test in production-like environment
|
|
476
|
+
6. **Gather Feedback:** User testing for UX improvements
|
|
477
|
+
7. **Document Changes:** Update `/one/events/` with deployment notes
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
**End of Plan**
|
|
482
|
+
|
|
483
|
+
This plan provides a clear roadmap for integrating AI SDK Elements into the chat interface, starting with PromptInput replacement and expanding to advanced features over time.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# one-protocol & pay.one usage audit — /u area
|
|
2
|
+
|
|
3
|
+
Date: 2025-12-07
|
|
4
|
+
|
|
5
|
+
Goal
|
|
6
|
+
----
|
|
7
|
+
List everywhere in the Universal Wallet (`/u`) area and related components where the pay.one API is already in use, where the one-protocol SDK is already used, and where neither is used (local/demo-only). This helps us plan a consistent migration and determine where to prefer one-protocol vs pay.one.
|
|
8
|
+
|
|
9
|
+
Summary
|
|
10
|
+
-------
|
|
11
|
+
We scanned the `web/src/components/u` and `web/src/pages/u` code and documented the following:
|
|
12
|
+
|
|
13
|
+
- pay.one (pay.one.ie) is already used for payments, payment links, pricing conversions, and payment tracking in multiple UI places.
|
|
14
|
+
- one-protocol SDK is used for wallet operations in some places (WalletProtocol.ts + UDashboard), but many components still use local, demo-only implementations for wallets, tokens, transactions, people, and keys.
|
|
15
|
+
|
|
16
|
+
Detailed file-by-file usage
|
|
17
|
+
---------------------------
|
|
18
|
+
Legend: [PAY] = pay.one used (API/PayService), [SDK] = one-protocol SDK used, [LOCAL] = local/demo-only (localStorage or mock).
|
|
19
|
+
|
|
20
|
+
Top-level UA components (web/src/components/u)
|
|
21
|
+
- UDashboard.tsx — [SDK] Wallet generation uses `generateWallet` from `lib/WalletProtocol.ts` (one-protocol). (Also uses localStorage for display & caching.)
|
|
22
|
+
- WalletProtocol.ts — [SDK] Contains `generateWallet`, `deriveWallet`, and helpers using `one-protocol` imports (wallet_generate, wallet_derive, AddressSchema). (SDK present and used here.)
|
|
23
|
+
- PayService.ts — [PAY] Centralized pay.one wrappers. Provides payment link helpers, convertCurrency, generateWallet helper that talks to pay.one endpoints. (API integration exists here.)
|
|
24
|
+
- PaymentStatusTracker.ts — [PAY] Tracks pay.one payments and local `u_payments` storage logic.
|
|
25
|
+
- WalletCard.tsx — [PAY] Uses `PayService` helpers (getPaymentUrl, getPaymentQRUrl, openPaymentWindow) and directly opens pay.one URLs for send/swap/export.
|
|
26
|
+
- EnhancedWalletCard.tsx — [PAY + LOCAL] Uses `convertCurrency` (pay.one) for USD conversions, but saves transactions and sample operations to localStorage (`u_transactions`).
|
|
27
|
+
- WalletOnboardingCarousel.tsx — [LOCAL] reads `u_keys` from localStorage (onboarding contexts) — local-only.
|
|
28
|
+
- GenerateWalletDialog.tsx — [LOCAL / SDK through consumer] UI only; onGenerate passed by parent (UDashboard uses SDK, WalletsPage uses local implementation). So dialog is neutral but behavior depends on parent.
|
|
29
|
+
- MobileOnboarding.tsx — [SDK / LOCAL mixed] calls onGenerate which may be SDK-based in UDashboard.
|
|
30
|
+
|
|
31
|
+
Pages under web/src/components/u/pages
|
|
32
|
+
- WalletsPage.tsx — [LOCAL] Local-only generation (generateAddress/generatePrivateKey), stores in `u_wallets` and `u_keys` localStorage. No pay.one, no one-protocol SDK usage.
|
|
33
|
+
- WalletDetailPage.tsx — [LOCAL] Reads `u_wallets` and `u_transactions` from localStorage; UI only.
|
|
34
|
+
- KeysPage.tsx — [LOCAL] Local-only key storage `u_keys` and UI warnings.
|
|
35
|
+
- PeoplePage.tsx — [LOCAL] Local-only `u_profile`, `u_contacts` storage and operations (no pay.one or SDK person_* use).
|
|
36
|
+
- SendPage.tsx — [LOCAL + PAY links] Uses local prefill `u_send_prefill` etc; but can open pay.one send links (payment via pay.one). Not using one-protocol SDK.
|
|
37
|
+
- ReceivePage.tsx / ReceiveDetailPage.tsx — [PAY + LOCAL] Receive UI reads local `u_wallets` but uses pay.one links (to/qr link generation).
|
|
38
|
+
- ProductsPage.tsx — [PAY] Generates payment links via pay.one (PAY_WORKER_URL = https://pay.one.ie). Uses localStorage `u_products` as products but uses pay.one for checkout links.
|
|
39
|
+
- ProductDetailPage.tsx — [PAY + LOCAL] Builds pay.one payment links and passes wallets list to pay.one; product data stored locally in `u_products`.
|
|
40
|
+
- TokensPage.tsx — [LOCAL] Local-only token creation & storage in `u_tokens` with TODO to integrate deployment service (pay.one or others).
|
|
41
|
+
- TransactionsPage.tsx — [LOCAL] Stores `u_transactions` in localStorage; generates sample data when empty.
|
|
42
|
+
- ContractsPage.tsx — [LOCAL] contract templates and AI-powered flows; uses secure storage but contract deployment integration is not implemented (may use pay.one in future). Contains local model usage and prompts.
|
|
43
|
+
|
|
44
|
+
Other U utilities & small components
|
|
45
|
+
- ReceiveSheet.tsx — [PAY] Generates pay.one link `https://pay.one.ie/to/${address}` (PAY usage).
|
|
46
|
+
- sheets/SwapSheet.tsx, SendSheet.tsx — [LOCAL] UI for swap/trade actions; mostly mock/placeholder.
|
|
47
|
+
- Hooks (useCurrencyConversion.ts) — [PAY] may call PayService or use convert functions; confirm if used elsewhere.
|
|
48
|
+
|
|
49
|
+
Server / API endpoints referencing pay.one
|
|
50
|
+
- web/src/pages/api/v1/resource.ts — [PAY] Example resource using pay.one endpoints (demo / discovery text present).
|
|
51
|
+
- web/src/pages/api/v1/agent/sync.ts — [PAY] Example agent sync payload referencing pay.one tutor/stream, create_url `https://pay.one.ie/pay/create`.
|
|
52
|
+
|
|
53
|
+
Where the one-protocol SDK is used outside /u
|
|
54
|
+
- `web/src/AGENTS.md`, `web/CLAUDE.md`, and various docs reference `one-protocol` SDK usage for schemas, registry, etc.
|
|
55
|
+
- The repo includes `apps/one-core/packages/one-protocol` which is the SDK source and is present in package.json dependencies for web.
|
|
56
|
+
|
|
57
|
+
High-level observations
|
|
58
|
+
-----------------------
|
|
59
|
+
- Payments (checkout flow, payment links, price conversion, tracking) already use pay.one across multiple components (PayService, PaymentsTracker, Product pages, wallet quick-actions). Good coverage.
|
|
60
|
+
- Wallet generation is inconsistent:
|
|
61
|
+
- UDashboard and some onboarding flows use the `one-protocol` SDK via `WalletProtocol.generateWallet` (SDK-based) — ideal.
|
|
62
|
+
- WalletsPage and some lower-level utilities still use ad-hoc local mock generation (generateAddress/generatePrivateKey) — we should consolidate to `one-protocol` SDK across all wallet creation paths.
|
|
63
|
+
- Identity (people/profile) is local-only but pay.one provides person_* and identity endpoints. We should decide whether to mirror contacts to pay.one (opt-in) and/or use one-protocol `person_*` schemas for validation.
|
|
64
|
+
- Tokens, contracts, and transactions are largely local/demo-only. pay.one and one-protocol have tools to deploy tokens, manage contracts, token history and on-chain operations — we should plan to integrate these progressively.
|
|
65
|
+
|
|
66
|
+
Recommended next steps
|
|
67
|
+
----------------------
|
|
68
|
+
1. Standardize wallet generation:
|
|
69
|
+
- Replace WalletsPage local generation with `WalletProtocol.generateWallet` or call `PayService.generateWallet` if cloud-backed generation is desired. Prefer `one-protocol` SDK for local, deterministic generation unless user opts for server-backed wallets.
|
|
70
|
+
2. Keep keys local by default; add an *explicit, secure* cloud backup option using pay.one (opt-in + E2E encryption if we accept mnemonics).
|
|
71
|
+
3. Connect token deployment & management (TokensPage) to pay.one token deployment APIs or one-protocol tooling instead of local mock data.
|
|
72
|
+
4. Migrate transactions & payments to use PaymentStatusTracker -> pay.one webhooks or API polling (remove sample tx generation where appropriate).
|
|
73
|
+
5. Consider syncing PeoplePage contacts to pay.one `person_*` endpoints as opt-in backup, using one-protocol schema for validation.
|
|
74
|
+
6. Update UDashboard & WalletsPage to share common Wallet API (adapter to choose one-protocol local vs pay.one cloud) for a consistent UX.
|
|
75
|
+
|
|
76
|
+
If you'd like I can now:
|
|
77
|
+
- Create a one-line PR scaffolding `web/src/lib/PayService.ts` (if it doesn't already exist) or normalize `WalletProtocol` usage across wallet pages.
|
|
78
|
+
- Implement replacing WalletsPage's local generation with a call to `WalletProtocol.generateWallet` and add migration UI to preserve existing local wallets.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
File generated by automated scan on 2025-12-07.
|