@clawos-dev/clawd 0.2.518 → 0.2.519
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/cli.cjs +30 -12
- package/dist/pi-mcp-bridge/extension.cjs +3 -1
- package/package.json +2 -1
package/dist/cli.cjs
CHANGED
|
@@ -65902,6 +65902,31 @@ async function importZip(buf, root) {
|
|
|
65902
65902
|
}
|
|
65903
65903
|
}
|
|
65904
65904
|
|
|
65905
|
+
// src/feishu-auth/login-callback.ts
|
|
65906
|
+
function parseLoginCallbackQuery(url) {
|
|
65907
|
+
return {
|
|
65908
|
+
token: url.searchParams.get("token") ?? "",
|
|
65909
|
+
state: url.searchParams.get("state") ?? "",
|
|
65910
|
+
expiresAt: url.searchParams.get("expires_at")
|
|
65911
|
+
};
|
|
65912
|
+
}
|
|
65913
|
+
function escapeHtml(s2) {
|
|
65914
|
+
return s2.replace(/[&<>"']/g, (c2) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c2]);
|
|
65915
|
+
}
|
|
65916
|
+
function renderLoginCallbackPage(result, successTagline) {
|
|
65917
|
+
const style = (color) => `<style>body{font-family:-apple-system,sans-serif;padding:48px;color:${color}}</style>`;
|
|
65918
|
+
if (result.ok) {
|
|
65919
|
+
return {
|
|
65920
|
+
status: 200,
|
|
65921
|
+
html: `<!doctype html><meta charset="utf-8"><title>clawd</title>${style("#222")}<h2>${escapeHtml(successTagline)}</h2><p>\u8EAB\u4EFD\uFF1A${escapeHtml(result.identity.displayName)}</p><script>setTimeout(()=>window.close(),1500)</script>`
|
|
65922
|
+
};
|
|
65923
|
+
}
|
|
65924
|
+
return {
|
|
65925
|
+
status: 400,
|
|
65926
|
+
html: `<!doctype html><meta charset="utf-8"><title>clawd</title>${style("#922")}<h2>\u767B\u5F55\u5931\u8D25</h2><p>${escapeHtml(result.reason)}</p>`
|
|
65927
|
+
};
|
|
65928
|
+
}
|
|
65929
|
+
|
|
65905
65930
|
// src/transport/http-router.ts
|
|
65906
65931
|
var RPC_BODY_MAX_BYTES = 1 * 1024 * 1024;
|
|
65907
65932
|
var SHARE_UI_ASSETS_PREFIX = "/share-ui/assets/";
|
|
@@ -66041,14 +66066,10 @@ function createHttpRouter(deps) {
|
|
|
66041
66066
|
sendJson(res, 501, { code: "NOT_IMPLEMENTED", message: "feishu login not wired" });
|
|
66042
66067
|
return true;
|
|
66043
66068
|
}
|
|
66044
|
-
const result = await deps.feishuLogin.handleLoginCallback(
|
|
66045
|
-
|
|
66046
|
-
|
|
66047
|
-
|
|
66048
|
-
});
|
|
66049
|
-
const html = result.ok ? `<!doctype html><meta charset="utf-8"><title>clawd</title><style>body{font-family:-apple-system,sans-serif;padding:48px;color:#222}</style><h2>\u767B\u5F55\u6210\u529F\uFF0C\u53EF\u5173\u95ED\u6B64\u9875\u3002</h2><p>\u8EAB\u4EFD\uFF1A${escapeHtml(result.identity.displayName)}</p><script>setTimeout(()=>window.close(),1500)</script>` : `<!doctype html><meta charset="utf-8"><title>clawd</title><style>body{font-family:-apple-system,sans-serif;padding:48px;color:#922}</style><h2>\u767B\u5F55\u5931\u8D25</h2><p>${escapeHtml(result.reason)}</p>`;
|
|
66050
|
-
res.writeHead(result.ok ? 200 : 400, { "Content-Type": "text/html; charset=utf-8" });
|
|
66051
|
-
res.end(html);
|
|
66069
|
+
const result = await deps.feishuLogin.handleLoginCallback(parseLoginCallbackQuery(url));
|
|
66070
|
+
const page = renderLoginCallbackPage(result, "\u767B\u5F55\u6210\u529F\uFF0C\u53EF\u5173\u95ED\u6B64\u9875\u3002");
|
|
66071
|
+
res.writeHead(page.status, { "Content-Type": "text/html; charset=utf-8" });
|
|
66072
|
+
res.end(page.html);
|
|
66052
66073
|
return true;
|
|
66053
66074
|
}
|
|
66054
66075
|
if (url.pathname === "/share/exchange" && req.method === "OPTIONS") {
|
|
@@ -66440,9 +66461,6 @@ function parseUrl(rawUrl) {
|
|
|
66440
66461
|
return null;
|
|
66441
66462
|
}
|
|
66442
66463
|
}
|
|
66443
|
-
function escapeHtml(s2) {
|
|
66444
|
-
return s2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
66445
|
-
}
|
|
66446
66464
|
function sendJson(res, status, body, extraHeaders) {
|
|
66447
66465
|
res.writeHead(status, {
|
|
66448
66466
|
"Content-Type": "application/json; charset=utf-8",
|
|
@@ -70362,7 +70380,7 @@ function computeMethodAccess(args) {
|
|
|
70362
70380
|
}
|
|
70363
70381
|
|
|
70364
70382
|
// src/version.ts
|
|
70365
|
-
var version = "0.2.
|
|
70383
|
+
var version = "0.2.519".length > 0 ? "0.2.519" : "dev";
|
|
70366
70384
|
|
|
70367
70385
|
// src/cli-probe/probe.ts
|
|
70368
70386
|
var fs77 = __toESM(require("fs"), 1);
|
|
@@ -14902,7 +14902,9 @@ async function bridgeMcpServers(pi, options) {
|
|
|
14902
14902
|
log(`no mcp servers to bridge (configs=${options.configPaths.length}, cwd=${options.cwd})`);
|
|
14903
14903
|
return;
|
|
14904
14904
|
}
|
|
14905
|
-
const
|
|
14905
|
+
const stdioDefs = defs.filter((d) => "command" in d);
|
|
14906
|
+
for (const d of defs) if (!("command" in d)) log(`${d.name}: http server, pi bridge only supports stdio \u2014 skipped`);
|
|
14907
|
+
const links = stdioDefs.map((def) => new ServerLink(def, opts));
|
|
14906
14908
|
pi.on("session_shutdown", async () => {
|
|
14907
14909
|
await Promise.all(links.map((l) => l.close()));
|
|
14908
14910
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clawos-dev/clawd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.519",
|
|
4
4
|
"description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "pnpm -F @clawos/clawd-ui build:assets && tsup && node scripts/copy-defaults.mjs",
|
|
20
|
+
"build:codex-plugin": "node scripts/build-codex-plugin.mjs",
|
|
20
21
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p scripts/tsconfig.json --noEmit",
|
|
21
22
|
"dev": "tsx src/cli.ts",
|
|
22
23
|
"dev:watch": "tsx watch --clear-screen=false src/cli.ts",
|