@talesofai/neta-skills 0.15.0 → 0.15.1
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/CHANGELOG.md +6 -0
- package/bin/cli.js +0 -0
- package/bin/commands/creative/upload.cmd.en_us.yml +1 -1
- package/bin/commands/creative/upload.cmd.js +8 -1
- package/bin/commands/creative/upload.cmd.zh_cn.yml +1 -1
- package/package.json +17 -15
- package/skills/neta-creative/SKILL.md +2 -1
- package/skills/neta-creative/references/media-upload.md +11 -1
package/CHANGELOG.md
CHANGED
package/bin/cli.js
CHANGED
|
File without changes
|
|
@@ -3,7 +3,7 @@ title: Media File Upload
|
|
|
3
3
|
description: Upload a media file (image or video) to create a media artifact.
|
|
4
4
|
|
|
5
5
|
parameters:
|
|
6
|
-
file_path:
|
|
6
|
+
file_path: Local media path (absolute or relative to cwd), or http(s) URL to fetch the file
|
|
7
7
|
|
|
8
8
|
errors:
|
|
9
9
|
file_type_not_supported: Media file type not supported
|
|
@@ -134,6 +134,9 @@ const createArtifact = async (url, options) => {
|
|
|
134
134
|
// biome-ignore lint/style/noNonNullAssertion: checked
|
|
135
135
|
return res.result[0];
|
|
136
136
|
};
|
|
137
|
+
const checkIsNetworkUrl = (url) => {
|
|
138
|
+
return url.startsWith("http://") || url.startsWith("https://");
|
|
139
|
+
};
|
|
137
140
|
export const upload = createCommand({
|
|
138
141
|
name: meta.name,
|
|
139
142
|
title: meta.title,
|
|
@@ -148,7 +151,11 @@ export const upload = createCommand({
|
|
|
148
151
|
const regionOptions = apis.baseUrl.endsWith(".cn")
|
|
149
152
|
? OSS_STS_OPTIONS_CN
|
|
150
153
|
: OSS_STS_OPTIONS_US;
|
|
151
|
-
const file = await
|
|
154
|
+
const file = await (checkIsNetworkUrl(file_path)
|
|
155
|
+
? fetch(file_path)
|
|
156
|
+
.then((res) => res.arrayBuffer())
|
|
157
|
+
.then((buffer) => Buffer.from(buffer))
|
|
158
|
+
: readFile(file_path));
|
|
152
159
|
const infos = filetypeinfo(file);
|
|
153
160
|
const info = infos[0]; // always use first extension
|
|
154
161
|
if (!info || !info.extension || !info.mime) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talesofai/neta-skills",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Neta API pi coding agent skills for interacting with Neta API to generate images, videos, songs, and manage characters/elements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,23 @@
|
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=22.0.0"
|
|
27
27
|
},
|
|
28
|
+
"packageManager": "pnpm@10.25.0",
|
|
28
29
|
"bin": {
|
|
29
30
|
"neta-cli": "bin/cli.js"
|
|
30
31
|
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"lint": "biome check . --write --unsafe",
|
|
34
|
+
"validate": "skills-ref to-prompt ./skills/neta ./skills/neta-community ./skills/neta-creative ./skills/neta-suggest ./skills/neta-space ./skills/neta-character ./skills/neta-elementum ./skills/neta-adventure",
|
|
35
|
+
"type-check": "tsc --noEmit",
|
|
36
|
+
"check": "pnpm lint && pnpm type-check && pnpm validate",
|
|
37
|
+
"changelog": "changeset",
|
|
38
|
+
"bump": "changeset version",
|
|
39
|
+
"prepare": "husky",
|
|
40
|
+
"build": "rimraf bin && tsc",
|
|
41
|
+
"postbuild": "node scripts/postbuild.js",
|
|
42
|
+
"dev": "NODE_ENV=development node src/cli.ts",
|
|
43
|
+
"start": "node bin/cli.js"
|
|
44
|
+
},
|
|
31
45
|
"dependencies": {
|
|
32
46
|
"@aws-sdk/client-s3": "^3.1013.0",
|
|
33
47
|
"@commander-js/extra-typings": "^14.0.0",
|
|
@@ -63,17 +77,5 @@
|
|
|
63
77
|
"README.zh_cn.md",
|
|
64
78
|
"CHANGELOG.md",
|
|
65
79
|
"LICENSE"
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
"lint": "biome check . --write --unsafe",
|
|
69
|
-
"validate": "skills-ref to-prompt ./skills/neta ./skills/neta-community ./skills/neta-creative ./skills/neta-suggest ./skills/neta-space ./skills/neta-character ./skills/neta-elementum ./skills/neta-adventure",
|
|
70
|
-
"type-check": "tsc --noEmit",
|
|
71
|
-
"check": "pnpm lint && pnpm type-check && pnpm validate",
|
|
72
|
-
"changelog": "changeset",
|
|
73
|
-
"bump": "changeset version",
|
|
74
|
-
"build": "rimraf bin && tsc",
|
|
75
|
-
"postbuild": "node scripts/postbuild.js",
|
|
76
|
-
"dev": "NODE_ENV=development node src/cli.ts",
|
|
77
|
-
"start": "node bin/cli.js"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
@@ -57,10 +57,11 @@ npx -y @talesofai/neta-skills@latest remove_background --input_image "image_arti
|
|
|
57
57
|
|
|
58
58
|
**Upload local image or video**
|
|
59
59
|
|
|
60
|
-
Registers a file from disk as a Neta artifact (after upload and moderation). Use the returned **`uuid`** or **`url`** in `make_image` (`ref_img-…`), `make_video` (`--image_source` URL), `remove_background`, or collection commands.
|
|
60
|
+
Registers a file from disk **or from an `http://` / `https://` URL** as a Neta artifact (after upload and moderation). Use the returned **`uuid`** or **`url`** in `make_image` (`ref_img-…`), `make_video` (`--image_source` URL), `remove_background`, or collection commands.
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
npx -y @talesofai/neta-skills@latest upload --file_path "/path/to/file.png"
|
|
64
|
+
# or: --file_path "https://example.com/asset.png"
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
📖 [Media upload](./references/media-upload.md) — supported types, size limits, and how outputs map to each downstream command.
|
|
@@ -11,7 +11,9 @@ npx -y @talesofai/neta-skills@latest upload --file_path "/absolute/or/relative/p
|
|
|
11
11
|
**Requirements**
|
|
12
12
|
|
|
13
13
|
- **`NETA_TOKEN`** must be set (same as other authenticated commands). Unauthenticated runs fail with an explicit error.
|
|
14
|
-
- **`file_path`**:
|
|
14
|
+
- **`file_path`**: either
|
|
15
|
+
- a **local path** — absolute, or relative to the **current working directory** when the command runs; or
|
|
16
|
+
- a **direct media URL** — `http://` or `https://` to a resource the CLI can `fetch` (same supported types and size limits apply after download).
|
|
15
17
|
|
|
16
18
|
---
|
|
17
19
|
|
|
@@ -91,6 +93,14 @@ npx -y @talesofai/neta-skills@latest upload --file_path "./character.png"
|
|
|
91
93
|
npx -y @talesofai/neta-skills@latest remove_background --input_image "<UUID_FROM_UPLOAD_OUTPUT>"
|
|
92
94
|
```
|
|
93
95
|
|
|
96
|
+
### Remote file by URL
|
|
97
|
+
|
|
98
|
+
When the asset is already hosted, pass a direct `https://` (or `http://`) link as `file_path`. The CLI downloads it, then runs the same type/size checks and OSS upload as for a local file.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx -y @talesofai/neta-skills@latest upload --file_path "https://example.com/reference.jpg"
|
|
102
|
+
```
|
|
103
|
+
|
|
94
104
|
---
|
|
95
105
|
|
|
96
106
|
## Related docs
|