@crewx/cli 0.9.0-rc.53 → 0.9.0-rc.54
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/dist/commands/log.js +4 -3
- package/dist/commands/publish.js +5 -2
- package/dist/commands/result.js +3 -2
- package/dist/commands/slack.js +2 -1
- package/dist/logging.d.ts +1 -1
- package/dist/logging.js +3 -2
- package/package.json +12 -12
package/dist/commands/log.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.handleLog = handleLog;
|
|
13
|
+
const sdk_1 = require("@crewx/sdk");
|
|
13
14
|
const repository_1 = require("@crewx/sdk/repository");
|
|
14
15
|
function statusIcon(status) {
|
|
15
16
|
switch (status) {
|
|
@@ -36,10 +37,10 @@ async function handleLog(args) {
|
|
|
36
37
|
console.log(`Status: ${statusIcon(task.status)} ${task.status}`);
|
|
37
38
|
console.log(`Agent: ${task.agent_id ?? '—'}`);
|
|
38
39
|
console.log(`Mode: ${task.mode ?? '—'}`);
|
|
39
|
-
console.log(`Started: ${new Date(task.started_at)
|
|
40
|
+
console.log(`Started: ${(0, sdk_1.formatDisplayTimestamp)(new Date(task.started_at))}`);
|
|
40
41
|
if (task.completed_at) {
|
|
41
42
|
const duration = new Date(task.completed_at).getTime() - new Date(task.started_at).getTime();
|
|
42
|
-
console.log(`Completed: ${new Date(task.completed_at)
|
|
43
|
+
console.log(`Completed: ${(0, sdk_1.formatDisplayTimestamp)(new Date(task.completed_at))} (${duration}ms)`);
|
|
43
44
|
}
|
|
44
45
|
console.log('='.repeat(60));
|
|
45
46
|
console.log('');
|
|
@@ -78,7 +79,7 @@ async function handleLog(args) {
|
|
|
78
79
|
: 'running...';
|
|
79
80
|
console.log(`${idx + 1}. ${icon} ${task.id}`);
|
|
80
81
|
console.log(` Agent: ${task.agent_id ?? '—'} Mode: ${task.mode ?? '—'}`);
|
|
81
|
-
console.log(` Started: ${new Date(task.started_at)
|
|
82
|
+
console.log(` Started: ${(0, sdk_1.formatDisplayTimestamp)(new Date(task.started_at))}`);
|
|
82
83
|
console.log(` Duration: ${duration}`);
|
|
83
84
|
console.log('');
|
|
84
85
|
});
|
package/dist/commands/publish.js
CHANGED
|
@@ -139,7 +139,7 @@ Notes:
|
|
|
139
139
|
function requireMarketplaceUrl() {
|
|
140
140
|
const url = process.env['CREWX_MARKETPLACE_URL'];
|
|
141
141
|
if (!url) {
|
|
142
|
-
throw new Error('CREWX_MARKETPLACE_URL
|
|
142
|
+
throw new Error('publish: [E_ENV_MISSING] CREWX_MARKETPLACE_URL is not set — this environment variable is required for upload');
|
|
143
143
|
}
|
|
144
144
|
return url;
|
|
145
145
|
}
|
|
@@ -204,6 +204,9 @@ async function handlePublish(args) {
|
|
|
204
204
|
accessToken = (0, publish_1.readAuthJson)().access_token;
|
|
205
205
|
}
|
|
206
206
|
catch (err) {
|
|
207
|
+
if (err instanceof Error && !err.message.startsWith('publish: [')) {
|
|
208
|
+
failWithError(new Error(`publish: [E_AUTH_EXPIRED] Authentication is missing or expired — please log in again — ${err.message}`), flags.json);
|
|
209
|
+
}
|
|
207
210
|
failWithError(err, flags.json);
|
|
208
211
|
}
|
|
209
212
|
}
|
|
@@ -262,6 +265,6 @@ async function handlePublish(args) {
|
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
if (!flags.upload) {
|
|
265
|
-
console.error('⚠
|
|
268
|
+
console.error('⚠ To upload, use --upload — check the generated file path');
|
|
266
269
|
}
|
|
267
270
|
}
|
package/dist/commands/result.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.handleResult = handleResult;
|
|
17
|
+
const sdk_1 = require("@crewx/sdk");
|
|
17
18
|
const repository_1 = require("@crewx/sdk/repository");
|
|
18
19
|
const POLL_INTERVAL_MS = 1000;
|
|
19
20
|
function statusIcon(status) {
|
|
@@ -53,9 +54,9 @@ async function handleResult(args) {
|
|
|
53
54
|
const icon = statusIcon(task.status);
|
|
54
55
|
console.log(`${idx + 1}. ${icon} ${task.id}`);
|
|
55
56
|
console.log(` Agent: ${task.agent_id ?? '—'} Mode: ${task.mode ?? '—'}`);
|
|
56
|
-
console.log(` Started: ${new Date(task.started_at)
|
|
57
|
+
console.log(` Started: ${(0, sdk_1.formatDisplayTimestamp)(new Date(task.started_at))}`);
|
|
57
58
|
if (task.completed_at) {
|
|
58
|
-
console.log(` Completed: ${new Date(task.completed_at)
|
|
59
|
+
console.log(` Completed: ${(0, sdk_1.formatDisplayTimestamp)(new Date(task.completed_at))}`);
|
|
59
60
|
}
|
|
60
61
|
console.log('');
|
|
61
62
|
});
|
package/dist/commands/slack.js
CHANGED
|
@@ -44,6 +44,7 @@ exports.handleSlack = handleSlack;
|
|
|
44
44
|
const fs = __importStar(require("fs"));
|
|
45
45
|
const path = __importStar(require("path"));
|
|
46
46
|
const https = __importStar(require("https"));
|
|
47
|
+
const sdk_1 = require("@crewx/sdk");
|
|
47
48
|
const adapter_slack_1 = require("@crewx/adapter-slack");
|
|
48
49
|
const crewx_cli_1 = require("../bootstrap/crewx-cli");
|
|
49
50
|
const markdown_1 = require("../slack/markdown");
|
|
@@ -186,7 +187,7 @@ async function handleListFiles(threadId) {
|
|
|
186
187
|
console.log(` 📎 ${file.fileName}`);
|
|
187
188
|
console.log(` Size: ${formatFileSize(file.fileSize)}`);
|
|
188
189
|
console.log(` Path: ${file.filePath}`);
|
|
189
|
-
console.log(` Downloaded: ${file.downloadedAt
|
|
190
|
+
console.log(` Downloaded: ${(0, sdk_1.formatDisplayTimestamp)(file.downloadedAt)}`);
|
|
190
191
|
console.log('');
|
|
191
192
|
}
|
|
192
193
|
console.log(`Total: ${files.length} file${files.length > 1 ? 's' : ''}\n`);
|
package/dist/logging.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Format mirrors cli-bak TaskManagementService for backward compatibility.
|
|
11
11
|
*/
|
|
12
|
-
import type
|
|
12
|
+
import { type Crewx } from '@crewx/sdk';
|
|
13
13
|
/**
|
|
14
14
|
* Attach file-based logging to a Crewx instance.
|
|
15
15
|
* Subscribes to task:start and task:end events and writes log files.
|
package/dist/logging.js
CHANGED
|
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.attachFileLogger = attachFileLogger;
|
|
15
15
|
const fs_1 = require("fs");
|
|
16
16
|
const path_1 = require("path");
|
|
17
|
+
const sdk_1 = require("@crewx/sdk");
|
|
17
18
|
const CREWX_VERSION = '0.9.0-alpha.1';
|
|
18
19
|
/** Format Date as YYYYMMDDTHHmmss (local time) */
|
|
19
20
|
function formatTimestamp(date) {
|
|
@@ -52,7 +53,7 @@ function attachFileLogger(crewx, workspaceRoot) {
|
|
|
52
53
|
`CrewX Version: ${CREWX_VERSION}\n` +
|
|
53
54
|
`Mode: ${event.mode}\n` +
|
|
54
55
|
`Agent: ${event.agentRef}\n` +
|
|
55
|
-
`Started: ${event.timestamp
|
|
56
|
+
`Started: ${(0, sdk_1.formatDisplayTimestamp)(event.timestamp)}\n` +
|
|
56
57
|
`Message: ${event.message}\n` +
|
|
57
58
|
`\n`;
|
|
58
59
|
(0, fs_1.writeFileSync)(logFile, header, { encoding: 'utf8', mode: 0o600 });
|
|
@@ -66,7 +67,7 @@ function attachFileLogger(crewx, workspaceRoot) {
|
|
|
66
67
|
const logFile = logFiles.get(event.traceId);
|
|
67
68
|
if (!logFile)
|
|
68
69
|
return;
|
|
69
|
-
const ts = new Date()
|
|
70
|
+
const ts = (0, sdk_1.formatDisplayTimestamp)(new Date());
|
|
70
71
|
const status = event.error
|
|
71
72
|
? `failed: ${event.error.message}`
|
|
72
73
|
: 'completed successfully';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/cli",
|
|
3
|
-
"version": "0.9.0-rc.
|
|
3
|
+
"version": "0.9.0-rc.54",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"better-sqlite3": "*",
|
|
26
26
|
"dotenv": "17.2.3",
|
|
27
27
|
"isomorphic-git": "1.37.1",
|
|
28
|
-
"@crewx/sdk": "0.9.0-rc.
|
|
29
|
-
"@crewx/
|
|
30
|
-
"@crewx/
|
|
31
|
-
"@crewx/
|
|
32
|
-
"@crewx/
|
|
33
|
-
"@crewx/cron": "0.1.10-rc.87",
|
|
34
|
-
"@crewx/workflow": "0.3.22-rc.99",
|
|
35
|
-
"@crewx/wi": "0.1.10-rc.73",
|
|
28
|
+
"@crewx/sdk": "0.9.0-rc.54",
|
|
29
|
+
"@crewx/memory": "0.1.23-rc.70",
|
|
30
|
+
"@crewx/search": "0.1.10-rc.49",
|
|
31
|
+
"@crewx/doc": "0.1.9-rc.46",
|
|
32
|
+
"@crewx/wbs": "0.1.10-rc.79",
|
|
36
33
|
"@crewx/skill": "0.1.20",
|
|
37
|
-
"@crewx/
|
|
38
|
-
"@crewx/
|
|
39
|
-
"@crewx/chromex": "0.1.0-rc.
|
|
34
|
+
"@crewx/cron": "0.1.10-rc.88",
|
|
35
|
+
"@crewx/workflow": "0.3.22-rc.100",
|
|
36
|
+
"@crewx/chromex": "0.1.0-rc.86",
|
|
37
|
+
"@crewx/wi": "0.1.10-rc.74",
|
|
38
|
+
"@crewx/notify": "0.1.0-rc.24",
|
|
39
|
+
"@crewx/shared": "0.0.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/better-sqlite3": "*",
|