@talesofai/neta-skills 0.15.1 → 0.15.3
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 +12 -0
- package/bin/commands/load.js +13 -17
- package/bin/utils/telemetry.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/load.js
CHANGED
|
@@ -39,7 +39,17 @@ export const loadCommands = async (domains) => {
|
|
|
39
39
|
})).then((commands) => commands.flat());
|
|
40
40
|
};
|
|
41
41
|
const IS_DEV = process.env["NODE_ENV"] === "development";
|
|
42
|
-
const logger =
|
|
42
|
+
const logger = IS_DEV
|
|
43
|
+
? console
|
|
44
|
+
: {
|
|
45
|
+
// biome-ignore lint/suspicious/noConsole: use console
|
|
46
|
+
error: console.error,
|
|
47
|
+
// biome-ignore lint/suspicious/noConsole: use console
|
|
48
|
+
warn: console.warn,
|
|
49
|
+
// biome-ignore lint/suspicious/noConsole: use console
|
|
50
|
+
info: console.info,
|
|
51
|
+
debug: () => { },
|
|
52
|
+
};
|
|
43
53
|
export const buildCommands = async (cli) => {
|
|
44
54
|
setLocale();
|
|
45
55
|
const commands = await loadCommands([
|
|
@@ -96,14 +106,7 @@ export const buildCommands = async (cli) => {
|
|
|
96
106
|
app_language: getLocale(),
|
|
97
107
|
});
|
|
98
108
|
const apis = createApis({
|
|
99
|
-
logger
|
|
100
|
-
? logger
|
|
101
|
-
: {
|
|
102
|
-
error: () => { },
|
|
103
|
-
warn: () => { },
|
|
104
|
-
info: () => { },
|
|
105
|
-
debug: () => { },
|
|
106
|
-
},
|
|
109
|
+
logger,
|
|
107
110
|
baseUrl,
|
|
108
111
|
headers: {
|
|
109
112
|
"x-token": process.env["NETA_TOKEN"] ?? "",
|
|
@@ -132,14 +135,7 @@ export const buildCommands = async (cli) => {
|
|
|
132
135
|
.execute(input, {
|
|
133
136
|
apis,
|
|
134
137
|
user,
|
|
135
|
-
log:
|
|
136
|
-
? logger
|
|
137
|
-
: {
|
|
138
|
-
error: () => { },
|
|
139
|
-
warn: () => { },
|
|
140
|
-
info: () => { },
|
|
141
|
-
debug: () => { },
|
|
142
|
-
},
|
|
138
|
+
log: logger,
|
|
143
139
|
})
|
|
144
140
|
.then((result) => {
|
|
145
141
|
const duration = Date.now() - startTime;
|
package/bin/utils/telemetry.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import pkg from "../../package.json" with { type: "json" };
|
|
3
3
|
const DISABLE_TELEMETRY = process.env["DISABLE_TELEMETRY"] === "1";
|
|
4
|
+
const IS_DEV = process.env["NODE_ENV"] === "development";
|
|
4
5
|
const api = axios.create({
|
|
5
6
|
baseURL: "https://gator.volces.com/v2/event/json",
|
|
6
7
|
headers: {
|
|
@@ -42,14 +43,14 @@ export const track = (event, params) => {
|
|
|
42
43
|
],
|
|
43
44
|
})
|
|
44
45
|
.then((e) => {
|
|
45
|
-
if (
|
|
46
|
+
if (!IS_DEV)
|
|
46
47
|
return;
|
|
47
48
|
if (e.status === 200)
|
|
48
49
|
return;
|
|
49
50
|
logger.warn("[telemetry] track error: %s %o", e.status, e.data);
|
|
50
51
|
})
|
|
51
52
|
.catch((e) => {
|
|
52
|
-
if (
|
|
53
|
+
if (!IS_DEV)
|
|
53
54
|
return;
|
|
54
55
|
logger.warn("[telemetry] track error: %o", e);
|
|
55
56
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talesofai/neta-skills",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
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": {
|