@positronic/cli 0.0.33 → 0.0.34
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.
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Text, Box } from 'ink';
|
|
3
3
|
import { useApiGet } from '../hooks/useApi.js';
|
|
4
4
|
import { ErrorComponent } from './error.js';
|
|
5
|
+
import { STATUS } from '@positronic/core';
|
|
5
6
|
// Helper to format dates
|
|
6
7
|
var formatDate = function(timestamp) {
|
|
7
8
|
var date = new Date(timestamp);
|
|
@@ -39,11 +40,11 @@ var formatDuration = function(startMs, endMs) {
|
|
|
39
40
|
// Helper to get status color
|
|
40
41
|
var getStatusColor = function(status) {
|
|
41
42
|
switch(status){
|
|
42
|
-
case
|
|
43
|
+
case STATUS.COMPLETE:
|
|
43
44
|
return 'green';
|
|
44
|
-
case
|
|
45
|
+
case STATUS.ERROR:
|
|
45
46
|
return 'red';
|
|
46
|
-
case
|
|
47
|
+
case STATUS.RUNNING:
|
|
47
48
|
return 'yellow';
|
|
48
49
|
default:
|
|
49
50
|
return 'gray';
|
|
@@ -136,7 +137,7 @@ export var BrainHistory = function(param) {
|
|
|
136
137
|
}, padRight(columns.startedAt.header, columns.startedAt.width))), /*#__PURE__*/ React.createElement(Box, null, /*#__PURE__*/ React.createElement(Text, {
|
|
137
138
|
dimColor: true
|
|
138
139
|
}, '─'.repeat(112))), data.runs.map(function(run) {
|
|
139
|
-
var duration = run.startedAt && run.completedAt ? formatDuration(run.startedAt, run.completedAt) : run.status ===
|
|
140
|
+
var duration = run.startedAt && run.completedAt ? formatDuration(run.startedAt, run.completedAt) : run.status === STATUS.RUNNING ? 'Running...' : 'N/A';
|
|
140
141
|
return /*#__PURE__*/ React.createElement(Box, {
|
|
141
142
|
key: run.brainRunId
|
|
142
143
|
}, /*#__PURE__*/ React.createElement(Text, null, padRight(truncate(run.brainRunId, columns.runId.width), columns.runId.width)), /*#__PURE__*/ React.createElement(Text, null, " "), /*#__PURE__*/ React.createElement(Text, {
|
|
@@ -147,7 +148,7 @@ export var BrainHistory = function(param) {
|
|
|
147
148
|
dimColor: true
|
|
148
149
|
}, padRight(run.startedAt ? formatDate(run.startedAt) : 'N/A', columns.startedAt.width)));
|
|
149
150
|
}), data.runs.filter(function(r) {
|
|
150
|
-
return r.status ===
|
|
151
|
+
return r.status === STATUS.ERROR && r.error;
|
|
151
152
|
}).length > 0 && /*#__PURE__*/ React.createElement(Box, {
|
|
152
153
|
flexDirection: "column",
|
|
153
154
|
marginTop: 1
|
|
@@ -155,7 +156,7 @@ export var BrainHistory = function(param) {
|
|
|
155
156
|
bold: true,
|
|
156
157
|
color: "red"
|
|
157
158
|
}, "Errors:"), data.runs.filter(function(r) {
|
|
158
|
-
return r.status ===
|
|
159
|
+
return r.status === STATUS.ERROR && r.error;
|
|
159
160
|
}).map(function(run) {
|
|
160
161
|
return /*#__PURE__*/ React.createElement(Box, {
|
|
161
162
|
key: run.brainRunId,
|
|
@@ -48,6 +48,7 @@ import React from 'react';
|
|
|
48
48
|
import { Text, Box } from 'ink';
|
|
49
49
|
import { useApiGet } from '../hooks/useApi.js';
|
|
50
50
|
import { ErrorComponent } from './error.js';
|
|
51
|
+
import { STATUS } from '@positronic/core';
|
|
51
52
|
// Helper to format dates
|
|
52
53
|
var formatDate = function(timestamp) {
|
|
53
54
|
var date = new Date(timestamp);
|
|
@@ -72,13 +73,13 @@ var formatDuration = function(startMs, endMs) {
|
|
|
72
73
|
// Helper to get status color
|
|
73
74
|
var getStatusColor = function(status) {
|
|
74
75
|
switch(status){
|
|
75
|
-
case
|
|
76
|
+
case STATUS.COMPLETE:
|
|
76
77
|
return 'green';
|
|
77
|
-
case
|
|
78
|
+
case STATUS.ERROR:
|
|
78
79
|
return 'red';
|
|
79
|
-
case
|
|
80
|
+
case STATUS.RUNNING:
|
|
80
81
|
return 'yellow';
|
|
81
|
-
case
|
|
82
|
+
case STATUS.CANCELLED:
|
|
82
83
|
return 'gray';
|
|
83
84
|
default:
|
|
84
85
|
return 'white';
|
|
@@ -113,7 +114,7 @@ export var RunShow = function(param) {
|
|
|
113
114
|
color: "red"
|
|
114
115
|
}, "Run '", runId, "' not found"));
|
|
115
116
|
}
|
|
116
|
-
var duration = data.startedAt && data.completedAt ? formatDuration(data.startedAt, data.completedAt) : data.status ===
|
|
117
|
+
var duration = data.startedAt && data.completedAt ? formatDuration(data.startedAt, data.completedAt) : data.status === STATUS.RUNNING ? 'Running...' : 'N/A';
|
|
117
118
|
return /*#__PURE__*/ React.createElement(Box, {
|
|
118
119
|
flexDirection: "column",
|
|
119
120
|
gap: 1
|
|
@@ -160,7 +161,7 @@ export var RunShow = function(param) {
|
|
|
160
161
|
}, /*#__PURE__*/ React.createElement(Text, {
|
|
161
162
|
dimColor: true
|
|
162
163
|
}, key, ":"), " ", String(value));
|
|
163
|
-
}))), data.status ===
|
|
164
|
+
}))), data.status === STATUS.ERROR && data.error && /*#__PURE__*/ React.createElement(Box, {
|
|
164
165
|
flexDirection: "column",
|
|
165
166
|
marginTop: 1
|
|
166
167
|
}, /*#__PURE__*/ React.createElement(Box, {
|
|
@@ -192,11 +193,11 @@ export var RunShow = function(param) {
|
|
|
192
193
|
marginLeft: 2
|
|
193
194
|
}, /*#__PURE__*/ React.createElement(Text, {
|
|
194
195
|
dimColor: true
|
|
195
|
-
}, data.error.stack))))), data.status ===
|
|
196
|
+
}, data.error.stack))))), data.status === STATUS.COMPLETE && /*#__PURE__*/ React.createElement(Box, {
|
|
196
197
|
marginTop: 1
|
|
197
198
|
}, /*#__PURE__*/ React.createElement(Text, {
|
|
198
199
|
color: "green"
|
|
199
|
-
}, "Run completed successfully.")), data.status ===
|
|
200
|
+
}, "Run completed successfully.")), data.status === STATUS.CANCELLED && /*#__PURE__*/ React.createElement(Box, {
|
|
200
201
|
marginTop: 1
|
|
201
202
|
}, /*#__PURE__*/ React.createElement(Text, {
|
|
202
203
|
color: "gray"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain-history.d.ts","sourceRoot":"","sources":["../../../src/components/brain-history.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brain-history.d.ts","sourceRoot":"","sources":["../../../src/components/brain-history.tsx"],"names":[],"mappings":"AAMA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAmFD,eAAO,MAAM,YAAY,GAAI,sBAAsB,iBAAiB,4CA0GnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-show.d.ts","sourceRoot":"","sources":["../../../src/components/run-show.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-show.d.ts","sourceRoot":"","sources":["../../../src/components/run-show.tsx"],"names":[],"mappings":"AAyBA,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAsDD,eAAO,MAAM,OAAO,GAAI,WAAW,YAAY,4CAgI9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@positronic/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"clean": "rm -rf tsconfig.tsbuildinfo dist node_modules"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@positronic/core": "^0.0.
|
|
27
|
-
"@positronic/spec": "^0.0.
|
|
28
|
-
"@positronic/template-new-project": "^0.0.
|
|
26
|
+
"@positronic/core": "^0.0.34",
|
|
27
|
+
"@positronic/spec": "^0.0.34",
|
|
28
|
+
"@positronic/template-new-project": "^0.0.34",
|
|
29
29
|
"caz": "^2.0.0",
|
|
30
30
|
"chokidar": "^3.6.0",
|
|
31
31
|
"dotenv": "^16.4.7",
|