@shulex/cxclawctl 0.1.7 → 0.1.8

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "plugin": {
4
- "pluginVersion": "0.1.7",
5
- "cliVersion": "0.1.7",
4
+ "pluginVersion": "0.1.8",
5
+ "cliVersion": "0.1.8",
6
6
  "toolSchemaVersion": "1",
7
7
  "serverApiVersion": "1"
8
8
  },
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ var AUTH_SERVER_URL = "https://ai.solvea.cx/api_v2/ticket";
12
12
  // package.json
13
13
  var package_default = {
14
14
  name: "@shulex/cxclawctl",
15
- version: "0.1.7",
15
+ version: "0.1.8",
16
16
  description: "Solvea CXClaw CLI and Codex plugin runtime",
17
17
  type: "module",
18
18
  bin: {
@@ -116,6 +116,9 @@ async function deleteSession() {
116
116
 
117
117
  // src/auth.ts
118
118
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
119
+ function publicAuthStatus(session) {
120
+ return { ok: true, loggedIn: true, email: session.email, channel: session.channel, accessExpiresAt: session.accessExpiry };
121
+ }
119
122
  async function login(channel) {
120
123
  const session = { channel, accessToken: "", refreshToken: "", accessExpiry: 0, employeeId: "", email: "" };
121
124
  const start = await post(session, "/auth/device/start", { clientVersion: VERSION });
@@ -2829,7 +2832,8 @@ var usage = () => [
2829
2832
  async function runAuth(action2, args) {
2830
2833
  if (action2 === "login") {
2831
2834
  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"));
2835
+ const session = await login(option(args, "--channel") ?? "stable");
2836
+ return print(publicAuthStatus(session));
2833
2837
  }
2834
2838
  if (action2 === "logout") {
2835
2839
  await logout();
@@ -2838,14 +2842,13 @@ async function runAuth(action2, args) {
2838
2842
  if (action2 === "status") {
2839
2843
  try {
2840
2844
  const session = await loadSession();
2841
- return print({ ok: true, loggedIn: true, email: session.email, channel: session.channel, accessExpiresAt: session.accessExpiry });
2845
+ return print(publicAuthStatus(session));
2842
2846
  } catch {
2843
2847
  return print({ ok: true, loggedIn: false });
2844
2848
  }
2845
2849
  }
2846
2850
  if (action2 === "refresh") {
2847
- const session = await authenticated();
2848
- return print({ ok: true, accessExpiresAt: session.accessExpiry });
2851
+ return print(publicAuthStatus(await authenticated()));
2849
2852
  }
2850
2853
  throw new Error("auth action must be login, logout, status, or refresh");
2851
2854
  }