@talesofai/neta-skills 0.15.1 → 0.15.2
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/commands/load.js +10 -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,14 @@ 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
|
+
error: () => { },
|
|
46
|
+
warn: () => { },
|
|
47
|
+
info: () => { },
|
|
48
|
+
debug: () => { },
|
|
49
|
+
};
|
|
43
50
|
export const buildCommands = async (cli) => {
|
|
44
51
|
setLocale();
|
|
45
52
|
const commands = await loadCommands([
|
|
@@ -96,14 +103,7 @@ export const buildCommands = async (cli) => {
|
|
|
96
103
|
app_language: getLocale(),
|
|
97
104
|
});
|
|
98
105
|
const apis = createApis({
|
|
99
|
-
logger
|
|
100
|
-
? logger
|
|
101
|
-
: {
|
|
102
|
-
error: () => { },
|
|
103
|
-
warn: () => { },
|
|
104
|
-
info: () => { },
|
|
105
|
-
debug: () => { },
|
|
106
|
-
},
|
|
106
|
+
logger,
|
|
107
107
|
baseUrl,
|
|
108
108
|
headers: {
|
|
109
109
|
"x-token": process.env["NETA_TOKEN"] ?? "",
|
|
@@ -132,14 +132,7 @@ export const buildCommands = async (cli) => {
|
|
|
132
132
|
.execute(input, {
|
|
133
133
|
apis,
|
|
134
134
|
user,
|
|
135
|
-
log:
|
|
136
|
-
? logger
|
|
137
|
-
: {
|
|
138
|
-
error: () => { },
|
|
139
|
-
warn: () => { },
|
|
140
|
-
info: () => { },
|
|
141
|
-
debug: () => { },
|
|
142
|
-
},
|
|
135
|
+
log: logger,
|
|
143
136
|
})
|
|
144
137
|
.then((result) => {
|
|
145
138
|
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.2",
|
|
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": {
|