ff1-cli 1.0.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/LICENSE +21 -0
- package/README.md +65 -0
- package/config.json.example +78 -0
- package/dist/index.js +627 -0
- package/dist/src/ai-orchestrator/index.js +870 -0
- package/dist/src/ai-orchestrator/registry.js +96 -0
- package/dist/src/config.js +352 -0
- package/dist/src/intent-parser/index.js +1342 -0
- package/dist/src/intent-parser/utils.js +108 -0
- package/dist/src/logger.js +72 -0
- package/dist/src/main.js +393 -0
- package/dist/src/types.js +5 -0
- package/dist/src/utilities/address-validator.js +242 -0
- package/dist/src/utilities/domain-resolver.js +291 -0
- package/dist/src/utilities/feed-fetcher.js +387 -0
- package/dist/src/utilities/ff1-device.js +176 -0
- package/dist/src/utilities/functions.js +325 -0
- package/dist/src/utilities/index.js +372 -0
- package/dist/src/utilities/nft-indexer.js +1013 -0
- package/dist/src/utilities/playlist-builder.js +522 -0
- package/dist/src/utilities/playlist-publisher.js +131 -0
- package/dist/src/utilities/playlist-send.js +241 -0
- package/dist/src/utilities/playlist-signer.js +171 -0
- package/dist/src/utilities/playlist-verifier.js +156 -0
- package/dist/src/utils.js +48 -0
- package/docs/CONFIGURATION.md +178 -0
- package/docs/EXAMPLES.md +331 -0
- package/docs/FUNCTION_CALLING.md +92 -0
- package/docs/README.md +267 -0
- package/docs/RELEASING.md +22 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Feral File
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# FF1-CLI
|
|
2
|
+
|
|
3
|
+
A small Node.js CLI for building DP-1 playlists from NFT collections.
|
|
4
|
+
|
|
5
|
+
FF1-CLI turns a simple prompt into a DP-1–conformant playlist you can preview on an FF1. The model orchestrates; deterministic tools do the real work (schema validation, indexing, JSON‑LD). If something comes back invalid, validation rejects it and we loop until it’s right.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g ff1-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Install (curl)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -fsSL https://feralfile.com/ff1-cli-install | bash
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Installs a prebuilt binary for macOS/Linux (no Node.js required).
|
|
20
|
+
|
|
21
|
+
## One-off Usage (npx)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx ff1-cli config init
|
|
25
|
+
npx ff1-cli chat
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
**Set your LLM API key first (default Grok):** `export GROK_API_KEY='xai-your-api-key-here'`
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
ff1 config init
|
|
34
|
+
ff1 chat
|
|
35
|
+
ff1 play "https://example.com/video.mp4" -d "Living Room Display" --skip-verify
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Dev Quick Start
|
|
39
|
+
|
|
40
|
+
**Set your LLM API key first (default Grok):** `export GROK_API_KEY='xai-your-api-key-here'`
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install
|
|
44
|
+
npm run dev -- config init
|
|
45
|
+
npm run dev chat
|
|
46
|
+
npm run dev -- play "https://example.com/video.mp4" -d "Living Room Display" --skip-verify
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
- Getting started, config, and usage: `./docs/README.md`
|
|
52
|
+
- Function calling architecture: `./docs/FUNCTION_CALLING.md`
|
|
53
|
+
- Examples: `./docs/EXAMPLES.md`
|
|
54
|
+
|
|
55
|
+
## Scripts
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run dev # Run CLI in dev (tsx)
|
|
59
|
+
npm run build # Build TypeScript
|
|
60
|
+
npm run lint:fix # Lint + fix
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultModel": "gemini",
|
|
3
|
+
"models": {
|
|
4
|
+
"grok": {
|
|
5
|
+
"apiKey": "YOUR_GROK_API_KEY_FROM_X_AI_CONSOLE",
|
|
6
|
+
"baseURL": "https://api.x.ai/v1",
|
|
7
|
+
"model": "grok-4-fast-non-reasoning",
|
|
8
|
+
"availableModels": [
|
|
9
|
+
"grok-4-fast-reasoning",
|
|
10
|
+
"grok-4-fast-non-reasoning",
|
|
11
|
+
"grok-code-fast-1"
|
|
12
|
+
],
|
|
13
|
+
"timeout": 120000,
|
|
14
|
+
"maxRetries": 3,
|
|
15
|
+
"temperature": 0.3,
|
|
16
|
+
"maxTokens": 4000,
|
|
17
|
+
"supportsFunctionCalling": true
|
|
18
|
+
},
|
|
19
|
+
"gpt": {
|
|
20
|
+
"apiKey": "YOUR_OPENAI_API_KEY_FROM_PLATFORM_OPENAI_COM",
|
|
21
|
+
"baseURL": "https://api.openai.com/v1",
|
|
22
|
+
"model": "gpt-4o-mini",
|
|
23
|
+
"availableModels": [
|
|
24
|
+
"gpt-4o",
|
|
25
|
+
"gpt-4o-mini",
|
|
26
|
+
"gpt-4-turbo"
|
|
27
|
+
],
|
|
28
|
+
"timeout": 30000,
|
|
29
|
+
"maxRetries": 3,
|
|
30
|
+
"temperature": 1,
|
|
31
|
+
"maxTokens": 4000,
|
|
32
|
+
"supportsFunctionCalling": true
|
|
33
|
+
},
|
|
34
|
+
"gemini": {
|
|
35
|
+
"apiKey": "YOUR_GOOGLE_AI_STUDIO_API_KEY_FROM_AISTUDIO_GOOGLE_COM",
|
|
36
|
+
"baseURL": "https://generativelanguage.googleapis.com/v1beta/openai/",
|
|
37
|
+
"model": "gemini-2.5-flash",
|
|
38
|
+
"availableModels": [
|
|
39
|
+
"gemini-2.5-flash-lite",
|
|
40
|
+
"gemini-2.5-flash",
|
|
41
|
+
"gemini-flash-lite-latest"
|
|
42
|
+
],
|
|
43
|
+
"timeout": 30000,
|
|
44
|
+
"maxRetries": 3,
|
|
45
|
+
"temperature": 0.3,
|
|
46
|
+
"maxTokens": 4000,
|
|
47
|
+
"supportsFunctionCalling": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"defaultDuration": 10,
|
|
51
|
+
"browser": {
|
|
52
|
+
"timeout": 90000,
|
|
53
|
+
"sanitizationLevel": "medium"
|
|
54
|
+
},
|
|
55
|
+
"feedServers": [
|
|
56
|
+
{
|
|
57
|
+
"baseUrl": "https://feed.feralfile.com/api/v1",
|
|
58
|
+
"apiKey": "YOUR_FEED_SERVER_API_KEY_OPTIONAL"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"baseUrl": "http://localhost:8787",
|
|
62
|
+
"apiKey": "YOUR_FEED_SERVER_API_KEY_OPTIONAL"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"playlist": {
|
|
66
|
+
"privateKey": "YOUR_ED25519_PRIVATE_KEY_BASE64_ENCODED_RUN_NODE_INDEX_JS_GENERATE_KEYS"
|
|
67
|
+
},
|
|
68
|
+
"ff1Devices": {
|
|
69
|
+
"devices": [
|
|
70
|
+
{
|
|
71
|
+
"name": "DISPLAY_NAME_FOR_YOUR_FF1_DEVICE",
|
|
72
|
+
"host": "http://YOUR_FF1_IP_ADDRESS:1111",
|
|
73
|
+
"apiKey": "YOUR_FF1_DEVICE_API_KEY_FROM_DEVICE_SETTINGS",
|
|
74
|
+
"topicID": "YOUR_FF1_DEVICE_TOPIC_ID_FROM_DEVICE_SETTINGS"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|