@crewx/cli 0.9.0-rc.9 → 0.9.0-rc.90
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/bootstrap/codex-writable-roots.d.ts +13 -0
- package/dist/bootstrap/codex-writable-roots.js +25 -0
- package/dist/bootstrap/crewx-cli.js +2 -1
- package/dist/builtin.js +1 -0
- package/dist/commands/agent.js +0 -58
- package/dist/commands/db.d.ts +1 -0
- package/dist/commands/db.js +191 -1
- package/dist/commands/doctor.d.ts +53 -0
- package/dist/commands/doctor.js +391 -21
- package/dist/commands/emit-trailer.d.ts +25 -0
- package/dist/commands/emit-trailer.js +33 -0
- package/dist/commands/execute.d.ts +6 -1
- package/dist/commands/execute.js +162 -11
- package/dist/commands/hook/command-marker.d.ts +2 -0
- package/dist/commands/hook/command-marker.js +5 -0
- package/dist/commands/hook/install.d.ts +0 -1
- package/dist/commands/hook/install.js +60 -63
- package/dist/commands/hook/status.js +3 -3
- package/dist/commands/hook/uninstall.js +2 -2
- package/dist/commands/init.js +22 -1
- package/dist/commands/log.js +4 -3
- package/dist/commands/parse-common-flags.d.ts +5 -1
- package/dist/commands/parse-common-flags.js +6 -2
- package/dist/commands/ps.js +7 -6
- package/dist/commands/publish.d.ts +1 -0
- package/dist/commands/publish.js +290 -0
- package/dist/commands/query.d.ts +3 -1
- package/dist/commands/query.js +78 -11
- package/dist/commands/registry.js +3 -1
- package/dist/commands/result.d.ts +7 -3
- package/dist/commands/result.js +41 -6
- package/dist/commands/shortcut.d.ts +1 -0
- package/dist/commands/shortcut.js +267 -0
- package/dist/commands/slack.js +2 -1
- package/dist/commands/write-output.d.ts +3 -0
- package/dist/commands/write-output.js +24 -0
- package/dist/logging.d.ts +1 -1
- package/dist/logging.js +3 -2
- package/dist/main.d.ts +3 -2
- package/dist/main.js +56 -11
- package/dist/utils/env-defaults.d.ts +2 -5
- package/dist/utils/env-defaults.js +10 -5
- package/dist/utils/sdk-compat.d.ts +24 -0
- package/dist/utils/sdk-compat.js +120 -0
- package/package.json +13 -11
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.sdkCompat = void 0;
|
|
37
|
+
exports.createSdkCompat = createSdkCompat;
|
|
38
|
+
const sdk = __importStar(require("@crewx/sdk"));
|
|
39
|
+
function formatLegacyArgv(argv) {
|
|
40
|
+
const formatter = sdk.formatCrewxExecutableArgv;
|
|
41
|
+
if (typeof formatter === 'function')
|
|
42
|
+
return formatter(argv);
|
|
43
|
+
// Older SDKs may expose the argv resolver before exposing its formatter.
|
|
44
|
+
// Keep this compatibility-only fallback one-way and quote every token.
|
|
45
|
+
if (process.platform === 'win32') {
|
|
46
|
+
return argv
|
|
47
|
+
.map((value) => {
|
|
48
|
+
const escaped = value
|
|
49
|
+
.replace(/(\\*)"/g, '$1$1\\"')
|
|
50
|
+
.replace(/(\\+)$/g, '$1$1');
|
|
51
|
+
return `"${escaped}"`;
|
|
52
|
+
})
|
|
53
|
+
.join(' ');
|
|
54
|
+
}
|
|
55
|
+
return argv.map((value) => `'${value.replace(/'/g, `'\\''`)}'`).join(' ');
|
|
56
|
+
}
|
|
57
|
+
const FALLBACK_CREWX_CLI_DISPLAY = 'crewx';
|
|
58
|
+
function missingCliResolver() {
|
|
59
|
+
return {
|
|
60
|
+
ok: false,
|
|
61
|
+
reason: 'The installed SDK does not expose the argv-based CrewX CLI resolver.',
|
|
62
|
+
attempts: [
|
|
63
|
+
{ stage: 'env', reason: 'argv resolver capability is unavailable' },
|
|
64
|
+
{ stage: 'self', reason: 'argv resolver capability is unavailable' },
|
|
65
|
+
{ stage: 'workspace', reason: 'argv resolver capability is unavailable' },
|
|
66
|
+
{ stage: 'module', reason: 'argv resolver capability is unavailable' },
|
|
67
|
+
{ stage: 'path', reason: 'argv resolver capability is unavailable' },
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create the CLI bootstrap capability accessor for the installed SDK.
|
|
73
|
+
*
|
|
74
|
+
* SDK exports are additive across compatible majors, so an older SDK may not
|
|
75
|
+
* expose every capability that a newer CLI knows about. Optional capabilities
|
|
76
|
+
* are checked here rather than at each bootstrap call site.
|
|
77
|
+
*/
|
|
78
|
+
function createSdkCompat(sdkLike = sdk) {
|
|
79
|
+
return {
|
|
80
|
+
resolveCrewxCli: () => {
|
|
81
|
+
const configured = process.env.CREWX_CLI;
|
|
82
|
+
if (configured?.trim())
|
|
83
|
+
return configured;
|
|
84
|
+
if (typeof sdkLike.resolveCrewxCliArgv === 'function') {
|
|
85
|
+
const resolution = sdkLike.resolveCrewxCliArgv();
|
|
86
|
+
if (resolution.ok)
|
|
87
|
+
return formatLegacyArgv(resolution.argv);
|
|
88
|
+
}
|
|
89
|
+
if (typeof sdkLike.resolveCrewxCli === 'function') {
|
|
90
|
+
const value = sdkLike.resolveCrewxCli();
|
|
91
|
+
if (value.trim())
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
return FALLBACK_CREWX_CLI_DISPLAY;
|
|
95
|
+
},
|
|
96
|
+
resolveCrewxCliArgv: () => {
|
|
97
|
+
if (typeof sdkLike.resolveCrewxCliArgv === 'function') {
|
|
98
|
+
return sdkLike.resolveCrewxCliArgv();
|
|
99
|
+
}
|
|
100
|
+
return missingCliResolver();
|
|
101
|
+
},
|
|
102
|
+
resolveCrewxWorkspace: () => {
|
|
103
|
+
if (typeof sdkLike.resolveCrewxWorkspace === 'function') {
|
|
104
|
+
return sdkLike.resolveCrewxWorkspace();
|
|
105
|
+
}
|
|
106
|
+
return process.env.CREWX_WORKSPACE || process.cwd();
|
|
107
|
+
},
|
|
108
|
+
initPricingRemote: () => {
|
|
109
|
+
if (typeof sdkLike.initPricingRemote !== 'function')
|
|
110
|
+
return;
|
|
111
|
+
try {
|
|
112
|
+
void Promise.resolve(sdkLike.initPricingRemote()).catch(() => undefined);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// Remote pricing is optional and must not block CLI startup.
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
exports.sdkCompat = createSdkCompat();
|
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.90",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -23,18 +23,20 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@crewx/adapter-slack": "0.1.4",
|
|
25
25
|
"better-sqlite3": "*",
|
|
26
|
+
"dotenv": "17.2.3",
|
|
26
27
|
"isomorphic-git": "1.37.1",
|
|
27
|
-
"@crewx/
|
|
28
|
-
"@crewx/
|
|
29
|
-
"@crewx/
|
|
30
|
-
"@crewx/
|
|
31
|
-
"@crewx/
|
|
32
|
-
"@crewx/
|
|
33
|
-
"@crewx/
|
|
34
|
-
"@crewx/
|
|
35
|
-
"@crewx/
|
|
28
|
+
"@crewx/memory": "0.1.23-rc.107",
|
|
29
|
+
"@crewx/search": "0.1.10-rc.86",
|
|
30
|
+
"@crewx/doc": "0.1.9-rc.83",
|
|
31
|
+
"@crewx/wbs": "0.1.10-rc.116",
|
|
32
|
+
"@crewx/sdk": "0.9.0-rc.90",
|
|
33
|
+
"@crewx/workflow": "0.3.22-rc.136",
|
|
34
|
+
"@crewx/skill": "0.1.20",
|
|
35
|
+
"@crewx/chromex": "0.1.0-rc.123",
|
|
36
|
+
"@crewx/notify": "0.1.0-rc.61",
|
|
37
|
+
"@crewx/wi": "0.1.10-rc.110",
|
|
36
38
|
"@crewx/shared": "0.0.6",
|
|
37
|
-
"@crewx/
|
|
39
|
+
"@crewx/cron": "0.1.10-rc.125"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
42
|
"@types/better-sqlite3": "*",
|