@zhongqian97-code/ecode 0.5.17 → 0.5.18

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5234,12 +5234,13 @@ function generateAccessToken() {
5234
5234
  }
5235
5235
  function createAuthHook(token) {
5236
5236
  return function authHook(request, reply, done) {
5237
- const incoming = request.headers["x-ecode-token"];
5238
- if (incoming !== token) {
5239
- reply.code(401).send({ success: false, error: "Unauthorized" });
5237
+ const headerToken = request.headers["x-ecode-token"];
5238
+ const queryToken = request.query?.["token"];
5239
+ if (headerToken === token || queryToken === token) {
5240
+ done();
5240
5241
  return;
5241
5242
  }
5242
- done();
5243
+ reply.code(401).send({ success: false, error: "Unauthorized" });
5243
5244
  };
5244
5245
  }
5245
5246
 
@@ -6101,11 +6102,12 @@ if (rawArgs[0] === "web") {
6101
6102
  version: VERSION
6102
6103
  });
6103
6104
  await server.listen({ port: webPort, host: webHost });
6104
- const displayHost = webHost === "0.0.0.0" ? "localhost" : webHost;
6105
+ const browserHost = webHost === "0.0.0.0" ? "localhost" : webHost;
6106
+ const accessUrl = `http://${browserHost}:${webPort}?token=${token}`;
6105
6107
  console.log(`
6106
6108
  ecode web admin started`);
6107
- console.log(` URL: http://${displayHost}:${webPort}`);
6108
- console.log(` Token: ${token}`);
6109
+ console.log(` Bind: ${webHost}:${webPort}`);
6110
+ console.log(` URL: ${accessUrl}`);
6109
6111
  console.log(`
6110
6112
  Press Ctrl+C to stop.
6111
6113
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhongqian97-code/ecode",
3
- "version": "0.5.17",
3
+ "version": "0.5.18",
4
4
  "description": "A minimal Claude Code clone with REPL interface and bash tool calling",
5
5
  "type": "module",
6
6
  "author": "zhongqian97-code",