@shulex/cxclawctl 0.1.6 → 0.1.7
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/README.md +3 -4
- package/capabilities.lock.json +2 -2
- package/dist/cli.js +13 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,13 +33,13 @@ codex plugin marketplace add SolveaCX/cx_claw_codex --ref marketplace/stable
|
|
|
33
33
|
codex plugin add cxclaw@cxclaw
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
然后完成钉钉登录:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
npx --yes @shulex/cxclawctl@latest auth login
|
|
39
|
+
npx --yes @shulex/cxclawctl@latest auth login
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
CLI
|
|
42
|
+
CLI 固定连接生产授权服务 `https://ai.solvea.cx/api_v2/ticket`,不接受用户指定服务地址或登录环境。CLI 会打开钉钉授权页;一次登录即可访问获准的测试和生产租户。授权完成后,检查登录状态和本地版本:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
npx --yes @shulex/cxclawctl@latest auth status
|
|
@@ -50,7 +50,6 @@ npx --yes @shulex/cxclawctl@latest doctor
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
npx --yes @shulex/cxclawctl@latest setup \
|
|
53
|
-
--server <shulex-cloud 授权地址> \
|
|
54
53
|
--channel stable
|
|
55
54
|
```
|
|
56
55
|
|
package/capabilities.lock.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -6,10 +6,13 @@ import { readFile as readFile6 } from "fs/promises";
|
|
|
6
6
|
// src/auth.ts
|
|
7
7
|
import open from "open";
|
|
8
8
|
|
|
9
|
+
// src/config.ts
|
|
10
|
+
var AUTH_SERVER_URL = "https://ai.solvea.cx/api_v2/ticket";
|
|
11
|
+
|
|
9
12
|
// package.json
|
|
10
13
|
var package_default = {
|
|
11
14
|
name: "@shulex/cxclawctl",
|
|
12
|
-
version: "0.1.
|
|
15
|
+
version: "0.1.7",
|
|
13
16
|
description: "Solvea CXClaw CLI and Codex plugin runtime",
|
|
14
17
|
type: "module",
|
|
15
18
|
bin: {
|
|
@@ -80,7 +83,7 @@ async function request(session, path, init = {}, tenant = false) {
|
|
|
80
83
|
let last;
|
|
81
84
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
82
85
|
try {
|
|
83
|
-
const response = await fetch(`${
|
|
86
|
+
const response = await fetch(`${AUTH_SERVER_URL}${path}`, { ...init, headers, signal: AbortSignal.timeout(3e4) });
|
|
84
87
|
const text = await response.text();
|
|
85
88
|
const value = text ? JSON.parse(text) : void 0;
|
|
86
89
|
if (!response.ok) throw new Error(`server returned ${response.status}: ${text}`);
|
|
@@ -113,8 +116,8 @@ async function deleteSession() {
|
|
|
113
116
|
|
|
114
117
|
// src/auth.ts
|
|
115
118
|
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
116
|
-
async function login(
|
|
117
|
-
const session = {
|
|
119
|
+
async function login(channel) {
|
|
120
|
+
const session = { channel, accessToken: "", refreshToken: "", accessExpiry: 0, employeeId: "", email: "" };
|
|
118
121
|
const start = await post(session, "/auth/device/start", { clientVersion: VERSION });
|
|
119
122
|
console.error(`\u8BF7\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4EE5\u4E0B\u5730\u5740\u5B8C\u6210\u9489\u9489\u6388\u6743\uFF1A
|
|
120
123
|
${start.verificationUriComplete}
|
|
@@ -2824,7 +2827,10 @@ var usage = () => [
|
|
|
2824
2827
|
"Example: cxclawctl intent create --data-file intent.json"
|
|
2825
2828
|
].join("\n\n");
|
|
2826
2829
|
async function runAuth(action2, args) {
|
|
2827
|
-
if (action2 === "login")
|
|
2830
|
+
if (action2 === "login") {
|
|
2831
|
+
if (flag(args, "--server") || flag(args, "--env")) throw new Error("auth login \u56FA\u5B9A\u4F7F\u7528\u751F\u4EA7\u6388\u6743\u670D\u52A1\uFF0C\u4E0D\u652F\u6301 --server \u6216 --env");
|
|
2832
|
+
return print(await login(option(args, "--channel") ?? "stable"));
|
|
2833
|
+
}
|
|
2828
2834
|
if (action2 === "logout") {
|
|
2829
2835
|
await logout();
|
|
2830
2836
|
return print({ ok: true, loggedOut: true });
|
|
@@ -2871,9 +2877,10 @@ async function main(args = process.argv.slice(2)) {
|
|
|
2871
2877
|
return;
|
|
2872
2878
|
}
|
|
2873
2879
|
if (command === "setup") {
|
|
2880
|
+
if (flag(args, "--server") || flag(args, "--env")) throw new Error("setup \u56FA\u5B9A\u4F7F\u7528\u751F\u4EA7\u6388\u6743\u670D\u52A1\uFF0C\u4E0D\u652F\u6301 --server \u6216 --env");
|
|
2874
2881
|
const channel = option(args, "--channel") ?? "stable";
|
|
2875
2882
|
await installMarketplace(channel);
|
|
2876
|
-
await login(
|
|
2883
|
+
await login(channel);
|
|
2877
2884
|
await installScheduler();
|
|
2878
2885
|
return;
|
|
2879
2886
|
}
|