@eve-horizon/cli 0.0.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.
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatLogLine = formatLogLine;
4
+ exports.isErrorLine = isErrorLine;
5
+ function formatLogLine(entry) {
6
+ const line = entry.line ?? {};
7
+ const type = line.type;
8
+ // Skip 'result' entries - they duplicate the final assistant message
9
+ if (type === 'result')
10
+ return null;
11
+ const message = line.message;
12
+ const contentText = message?.content?.[0]?.text;
13
+ if (contentText)
14
+ return contentText;
15
+ const error = line.error;
16
+ if (error)
17
+ return error;
18
+ const content = line.content;
19
+ if (content)
20
+ return content;
21
+ const raw = line.raw;
22
+ if (raw) {
23
+ const rawMessage = raw.message;
24
+ const rawText = rawMessage?.content?.[0]?.text;
25
+ if (rawText)
26
+ return rawText;
27
+ const rawError = raw.error;
28
+ if (rawError)
29
+ return rawError;
30
+ const rawContent = raw.content;
31
+ if (rawContent)
32
+ return rawContent;
33
+ }
34
+ return JSON.stringify(line);
35
+ }
36
+ function isErrorLine(entry) {
37
+ const line = entry.line ?? {};
38
+ const type = line.type;
39
+ const isError = line.is_error;
40
+ const raw = line.raw;
41
+ const rawType = raw?.type;
42
+ return Boolean(line.error ||
43
+ isError ||
44
+ type === 'system_error' ||
45
+ type === 'spawn_error' ||
46
+ type === 'parse_error' ||
47
+ raw?.error ||
48
+ rawType === 'system_error' ||
49
+ rawType === 'spawn_error' ||
50
+ rawType === 'parse_error');
51
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.outputJson = outputJson;
4
+ function outputJson(data, json, fallback) {
5
+ if (json) {
6
+ console.log(JSON.stringify(data));
7
+ return;
8
+ }
9
+ if (fallback) {
10
+ console.log(fallback);
11
+ return;
12
+ }
13
+ console.log(JSON.stringify(data, null, 2));
14
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@eve-horizon/cli",
3
+ "version": "0.0.1",
4
+ "description": "Eve Horizon CLI",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Incept5/eve-horizon.git",
9
+ "directory": "packages/cli"
10
+ },
11
+ "bin": {
12
+ "eve": "bin/eve.js"
13
+ },
14
+ "main": "dist/index.js",
15
+ "files": [
16
+ "bin",
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "engines": {
27
+ "node": ">=22.0.0"
28
+ },
29
+ "dependencies": {
30
+ "yaml": "^2.5.1"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^22.0.0",
34
+ "typescript": "^5.7.0"
35
+ }
36
+ }