@thinkingai/ae-cli 6.0.48-workbuddy → 6.0.48-workbuddy.2

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.
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="_图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 736.82 163.69">
3
+ <defs>
4
+ <style>
5
+ .cls-1 {
6
+ fill: #004bff;
7
+ }
8
+
9
+ .cls-2 {
10
+ fill: #231815;
11
+ }
12
+ </style>
13
+ </defs>
14
+ <g id="_图层_1-2" data-name="图层 1">
15
+ <g>
16
+ <g>
17
+ <rect class="cls-1" x="12.36" y="24.17" width="12.61" height="12.5" rx="1.01" ry="1.01"/>
18
+ <rect class="cls-1" x="30.78" width="9.98" height="9.91" rx="1.01" ry="1.01"/>
19
+ <rect class="cls-1" y="51.88" width="9.06" height="8.99" rx="1.01" ry="1.01"/>
20
+ <path class="cls-1" d="M154.7,91.73c0-.38-.07-.75-.21-1.09-.04-.1-.08-.19-.13-.28-.02-.03-.03-.06-.05-.09-.01-.02-.02-.04-.03-.06-.02-.03-.03-.05-.05-.07-.16-.26-.35-.5-.57-.72-.05-.07-.09-.12-.09-.12l-14.3-17.03c-.71-.81-.71-2.12-.71-2.12-8.15-51.18-60.23-43.6-60.23-43.6-4.25,.44-7.65,1.2-9.72,1.76-.43-.37-.7-.91-.7-1.52V14.31c0-1.11-.9-2.01-2.01-2.01h-12.6c-1.11,0-2.01,.9-2.01,2.01v12.47c0,1.11,.9,2.01,2.01,2.01h12.6c.14,0,.27-.01,.41-.04,.26-.05,.51-.16,.72-.3-.21,.14-.46,.25-.72,.3-.13,.03-.27,.04-.41,.04,.25,0,.49,.05,.71,.14,.05,.02,.1,.04,.15,.07,.06,.03,.12,.06,.17,.09,.04,.03,.09,.05,.13,.08,.07,.05,.13,.1,.19,.16,.03,.02,.05,.04,.08,.07,.08,.08,.15,.17,.21,.26,.02,.03,.04,.07,.06,.1,.04,.07,.08,.14,.11,.21,.02,.04,.03,.08,.05,.12,.03,.08,.05,.16,.07,.24,0,.04,.02,.07,.03,.11,.02,.12,.04,.24,.04,.37h0s0,0,0,0v12.47c0,1.11-.9,2.01-2.01,2.01h-12.6c-1.11,0-2.01-.9-2.01-2.01v-5.68s0,0-.01,.01v-6.8c0-1.11-.9-2.01-2.01-2.01h-12.6c-1.11,0-2.01,.9-2.01,2.01v12.47c0,1.11,.9,2.01,2.01,2.01h12.6c1.11,0,2.01,.9,2.01,2.01v12.47c0,1.11-.9,2.01-2.01,2.01h-12.6c-1.07,0-1.93-.83-2-1.88v-4.95c0-1.11-.9-2.01-2.01-2.01h-11.14c-1.11,0-2.01,.9-2.01,2.01v11.02c0,1.11,.9,2.01,2.01,2.01h8.79c-.14,.86-.18,1.37-.18,1.37-.24,2.86-.22,5.73-.15,8.22,.6,21.6,12.08,31.3,15.42,34.77,2.27,2.36,7.34,6.45,10.21,11.71,1.83,3.35,3.44,9.68,2.22,17.19-.19,1.15-.34,2.12-.47,2.97-.57,3.17-1.68,8.15-3.36,11.22,0,0-1.09,2.04,.89,2.73,.1,.04,.66,.22,1.26,.4,.27,.08,1.18,.36,1.38,.43,6.71,2.25,31.9,9.18,65.83,.21,.05-.01,.21-.05,.42-.09h0c3.27-.82,1.9-2.44,1.9-2.44-1.59-2.92-2.15-5.99-2.31-8.3-.07-1.67-.03-3.17,.08-4.02h0c.01-.09,.02-.18,.03-.28,.12-1.07,.26-3.21,.84-3.5,2.85-1.43,7.76-2.34,11.49-2.92,6.62-1.01,11.19-4.36,12.15-7.6,.96-3.25-1.98-6.9-2.89-10.14-.91-3.25,1.04-3.83,2.1-5.2,1.06-1.37-.21-2-1.43-3.08-1.22-1.08-1.29-1.89,.4-3.52,1.69-1.62,2.64-1.82-.4-5.28-3.04-3.45,.34-5.44,.34-5.44,0,0,3.28-1.12,5.93-2.36,1.33-.48,2.32-1.44,2.61-2.6,.06-.2,.09-.39,.09-.58,0-.02,0-.05,0-.07,0-.02,0-.04,0-.07ZM67.75,27.57c-.1,.24-.25,.46-.43,.64,.18-.18,.33-.4,.43-.64Zm.02,19.74c0-1.11,.9-2.01,2.01-2.01h12.6c1.11,0,2.01,.9,2.01,2.01v12.47c0,1.11-.9,2.01-2.01,2.01h-12.6c-1.11,0-2.01-.9-2.01-2.01v-12.47Zm-14.48,30.98c-1.11,0-2.01-.9-2.01-2.01v-12.47c0-1.11,.9-2.01,2.01-2.01h12.6c1.11,0,2.01,.9,2.01,2.01v12.47c0,1.11-.9,2.01-2.01,2.01h-12.6Z"/>
21
+ </g>
22
+ <g>
23
+ <path class="cls-2" d="M282.9,47.37c.12,.06,.24,.14,.36,.19,1.29,.5,1.94,1.41,1.97,2.8,.01,.54,0,1.08,0,1.62-.02,8.69-.05,17.38-.07,26.07,0,.25,0,.51,0,.83,.23-.08,.39-.11,.53-.18,2.92-1.45,6.03-2.25,9.25-2.66,3.56-.45,7.1-.38,10.62,.3,3.39,.65,6.58,1.81,9.34,3.95,3.54,2.76,5.7,6.4,6.72,10.74,.51,2.18,.79,4.4,.86,6.64,.05,1.81,.09,3.62,.09,5.44,0,8.55,0,17.1,0,25.64,0,.42-.02,.85-.11,1.26-.25,1.15-1.28,2.02-2.45,2.1-.16,.01-.33,.01-.49,.01-3.98,0-7.96,0-11.94,0-.44,0-.91-.05-1.31-.21-1.04-.43-1.62-1.25-1.71-2.39-.02-.28,0-.56,0-.85,0-9.23,0-18.46,0-27.69,0-2.71-1-5-3.02-6.82-1.66-1.49-3.63-2.25-5.85-2.31-1.3-.04-2.59-.02-3.85,.34-3.81,1.09-6.58,4.64-6.57,8.72,.04,9.25,.01,18.51,0,27.76,0,.33,0,.66-.04,.99-.21,1.49-1.29,2.45-2.8,2.46-2.31,.02-4.62,0-6.93,0-1.53,0-3.07-.06-4.59,.02-1.85,.09-3.13-1.32-3.12-3.11,.04-14.83,.04-29.67,.04-44.51,0-11.23,.01-22.46,.02-33.7,0-.33,0-.66,.05-.98,.17-1.09,.78-1.84,1.81-2.25,.17-.07,.33-.16,.5-.24,4.24,0,8.48,0,12.72,0Z"/>
24
+ <path class="cls-2" d="M436.14,47.37c.17,.08,.34,.16,.51,.22,1.17,.45,1.84,1.4,1.87,2.65,0,.28,0,.57,0,.85,0,12.62,0,25.24,0,37.86,0,.26,0,.52,0,.78,.02,.52,.27,.89,.76,1.09,.47,.19,.88,.04,1.24-.27,.12-.11,.24-.23,.35-.34,4.68-4.61,9.37-9.21,14.03-13.85,.86-.86,1.81-1.26,3.02-1.25,5.3,.03,10.6,.01,15.9,.01,.26,0,.52-.01,.77,.04,.89,.17,1.23,1.06,.68,1.78-.13,.17-.28,.31-.43,.47-11.71,12.1-23.41,24.21-35.13,36.3-.82,.85-1.22,1.77-1.21,2.96,.04,4.19,.02,8.38,.01,12.57,0,1.42-.81,2.5-2.1,2.83-.27,.07-.56,.08-.84,.08-3.7,0-7.4,.01-11.09,0-1.73,0-2.87-1.15-2.9-2.87,0-.24,0-.47,0-.71,0-25.85,0-51.7,0-77.56,0-.12,0-.24,0-.35,0-1.78,.55-2.55,2.22-3.17,.06-.02,.12-.07,.18-.11,4.05,0,8.11,0,12.16,0Z"/>
25
+ <path class="cls-2" d="M616.79,78.52c.02-.27,.04-.43,.05-.59,.07-1.54,1.05-2.6,2.58-2.78,.23-.03,.47-.02,.71-.03,3.39,0,6.79,0,10.18,0,.21,0,.43,0,.64,.02,1.5,.16,2.49,1.17,2.63,2.67,.02,.23,.01,.47,.01,.71,0,16.65,0,33.3,0,49.95,0,3.83-.33,7.62-1.38,11.32-.93,3.27-2.35,6.3-4.49,8.96-2.61,3.24-5.91,5.51-9.8,6.93-4.52,1.66-9.19,2.16-13.97,1.79-5.43-.42-10.42-2.25-15.14-4.88-2.8-1.57-5.43-3.4-7.93-5.41-1.52-1.23-1.62-3-.24-4.42,1.74-1.79,3.5-3.56,5.26-5.34,1.17-1.18,2.42-1.33,3.83-.45,3.04,1.92,6.26,3.47,9.68,4.57,1.95,.62,3.91,1.22,5.96,1.41,3.64,.33,6.55-.95,8.67-3.95,1.4-1.98,2.14-4.23,2.51-6.61,.15-.99,.22-2,.34-3.12-.3,.12-.48,.17-.64,.25-3.46,1.82-7.16,2.68-11.04,2.91-3.36,.2-6.68-.03-9.95-.87-4.23-1.08-7.91-3.11-10.92-6.31-2.51-2.67-4.25-5.8-5.4-9.26-1.65-4.96-2.09-10.07-1.73-15.26,.25-3.57,.96-7.04,2.31-10.36,1.78-4.4,4.48-8.1,8.39-10.85,2.78-1.96,5.87-3.2,9.19-3.83,4.74-.89,9.47-.77,14.13,.52,1.69,.47,3.3,1.12,4.84,1.95,.2,.11,.41,.21,.72,.36Zm-24.72,25.62c.14,1.19,.21,2.39,.43,3.57,.62,3.29,2.02,6.21,4.45,8.57,4.42,4.3,10.72,4.28,15.13-.03,1.12-1.1,2.05-2.34,2.75-3.74,2.24-4.45,2.6-9.09,1.2-13.85-.89-3.03-2.49-5.63-5-7.6-3.94-3.1-9.03-3.11-13-.06-1.09,.84-2.03,1.83-2.81,2.96-2.12,3.06-3.06,6.48-3.14,10.19Z"/>
26
+ <path class="cls-2" d="M375.11,78.9c.22-.09,.35-.13,.47-.19,2.92-1.46,6.03-2.25,9.25-2.66,2.06-.27,4.13-.34,6.2-.23,3.24,.17,6.41,.74,9.42,2,5.53,2.31,9.08,6.4,10.78,12.12,.67,2.24,.99,4.55,1.11,6.88,.1,1.88,.13,3.76,.13,5.65,.01,8.76,0,17.52,0,26.28,0,.35,0,.71-.07,1.05-.23,1.38-1.3,2.3-2.69,2.34-.12,0-.24,0-.35,0-3.96,0-7.92,0-11.87,0-.37,0-.76-.03-1.11-.14-1.13-.34-1.88-1.33-1.94-2.51-.01-.28,0-.57,0-.85,0-9.21,0-18.41,0-27.62,0-3.14-1.29-5.64-3.83-7.49-1.2-.88-2.55-1.41-4.03-1.58-1.77-.19-3.53-.2-5.24,.37-3.64,1.21-6.2,4.67-6.19,8.57,.03,9.25,0,18.51,0,27.76,0,.35,0,.71-.05,1.06-.22,1.45-1.29,2.4-2.76,2.43-.71,.02-1.41,0-2.12,0-3.23,0-6.45,0-9.68,0-1.4,0-2.5-.86-2.78-2.15-.08-.34-.07-.7-.07-1.05,0-5.51,0-11.02,0-16.53,0-11.09,0-22.18,0-33.27,0-.28,0-.57,0-.85,.08-1.21,.95-2.25,2.13-2.5,.32-.07,.65-.1,.98-.1,3.72,0,7.44,0,11.17,0,.26,0,.52,.02,.77,.07,1.32,.24,2.21,1.24,2.31,2.57,.01,.16,.03,.33,.05,.58Z"/>
27
+ <path class="cls-2" d="M530.62,78.9c.22-.09,.35-.13,.47-.19,2.92-1.46,6.03-2.25,9.25-2.66,2.06-.27,4.13-.34,6.2-.23,3.24,.17,6.41,.74,9.42,2,5.53,2.31,9.08,6.4,10.78,12.12,.67,2.24,.99,4.55,1.11,6.88,.1,1.88,.13,3.76,.13,5.65,.01,8.76,0,17.52,0,26.28,0,.35,0,.71-.07,1.05-.23,1.38-1.3,2.3-2.69,2.34-.12,0-.24,0-.35,0-3.96,0-7.92,0-11.87,0-.37,0-.76-.03-1.11-.14-1.13-.34-1.88-1.34-1.94-2.51-.01-.28,0-.57,0-.85,0-9.21,0-18.41,0-27.62,0-2.74-1.01-5.05-3.06-6.88-1.65-1.47-3.59-2.21-5.79-2.28-1.3-.04-2.59-.03-3.85,.33-3.86,1.1-6.61,4.68-6.59,8.7,.03,9.25,.01,18.51,0,27.76,0,.35,0,.71-.05,1.06-.22,1.45-1.29,2.4-2.76,2.43-.75,.02-1.51,0-2.26,0-3.18,0-6.36,0-9.54,0-1.4,0-2.5-.86-2.78-2.15-.08-.34-.07-.7-.07-1.05,0-5.6,0-11.21,0-16.81,0-11,0-21.99,0-32.99,0-.31,0-.61,.01-.92,.09-1.15,.94-2.15,2.06-2.42,.32-.08,.65-.11,.98-.11,3.77,0,7.54,0,11.31,0,.23,0,.47,.03,.7,.07,1.32,.24,2.21,1.24,2.31,2.57,.01,.16,.03,.33,.05,.58Z"/>
28
+ <path class="cls-2" d="M224.75,54.2c10.15,0,20.31,0,30.46,0,.33,0,.66,0,.99,.05,1.35,.2,2.25,1.1,2.44,2.45,.04,.25,.04,.52,.04,.77,0,3.46,0,6.92,0,10.38,0,.35-.02,.71-.09,1.05-.25,1.22-1.29,2.11-2.54,2.18-.26,.01-.52,0-.78,0-6.24,0-12.48,0-18.73,0-.4,0-.81,.02-1.19,.12-1.22,.3-2.05,1.35-2.11,2.6-.02,.35,0,.71,0,1.06,0,17.92,0,35.84,0,53.75,0,.38,0,.76-.06,1.13-.23,1.41-1.3,2.35-2.73,2.37-1.37,.02-2.73,0-4.1,0-2.26,0-4.53-.07-6.78,.02-1.91,.08-3.26-1.24-3.25-3.28,.04-18.11,.03-36.21,.02-54.32,0-.37,0-.76-.07-1.12-.26-1.33-1.31-2.24-2.66-2.33-.26-.02-.52,0-.78,0-6.24,0-12.49,0-18.73,0-.35,0-.71,0-1.05-.07-1.27-.28-2.14-1.37-2.15-2.71-.02-1.6,0-3.2,0-4.8,0-2.05,.06-4.1-.02-6.14-.07-1.74,1.1-3.21,3.22-3.18,3.11,.05,6.22,.01,9.33,.01,7.11,0,14.23,0,21.34,0Z"/>
29
+ <path class="cls-2" d="M331.68,103.92c0-8.31,0-16.62,0-24.93,0-.38,0-.76,.07-1.12,.28-1.28,1.36-2.13,2.77-2.18,.71-.03,1.41,0,2.12,0,2.87,0,5.75,0,8.62,0,.28,0,.57,0,.84,.04,1.35,.2,2.25,1.1,2.44,2.46,.04,.3,.04,.61,.04,.92,0,16.55,0,33.1,0,49.65,0,.35,0,.71-.07,1.05-.23,1.38-1.3,2.3-2.69,2.34-.71,.02-1.41,0-2.12,0-3.01,0-6.03,0-9.04,0-.76,0-1.45-.18-2.02-.68-.59-.52-.92-1.18-.96-1.97-.01-.28,0-.56,0-.85,0-8.24,0-16.48,0-24.72Z"/>
30
+ <path class="cls-2" d="M487.18,103.96c0-8.33,0-16.67,0-25,0-.35-.02-.72,.06-1.05,.28-1.15,1-1.9,2.18-2.14,.32-.07,.65-.08,.98-.09,3.49,0,6.97,0,10.46,0,.33,0,.66,.02,.98,.09,1.17,.26,1.9,.99,2.15,2.16,.08,.39,.09,.79,.09,1.19,0,16.53,0,33.05,0,49.58,0,.21,0,.42,0,.64-.09,1.69-1.23,2.79-2.92,2.8-3.34,.01-6.69,0-10.03,0-.4,0-.8,0-1.2,0-1.55-.05-2.7-1.19-2.74-2.75-.02-.68,0-1.37,0-2.05,0-7.79,0-15.58,0-23.38Z"/>
31
+ <path class="cls-2" d="M467.79,132.14c-2.64,0-5.28-.02-7.91,.01-.7,0-1.14-.24-1.5-.83-3.64-6.02-7.29-12.04-10.93-18.06-.45-.75-.41-1.15,.18-1.76,3.36-3.44,6.72-6.87,10.07-10.3,.33-.34,.69-.57,1.19-.46,.44,.09,.66,.42,.87,.77,.84,1.42,1.69,2.83,2.53,4.24,4.81,8.06,9.62,16.13,14.43,24.19,.11,.18,.23,.36,.32,.55,.39,.83-.07,1.6-.99,1.64-.68,.03-1.37,0-2.05,0-2.07,0-4.14,0-6.22,0Z"/>
32
+ <path class="cls-1" d="M340.14,54.32c1.88,0,3.77,0,5.65,0,.98,0,1.71,.44,2.26,1.22,.35,.51,.42,1.08,.42,1.68,0,2.54,0,5.09,0,7.63,0,1.11-.04,2.21,0,3.32,.06,1.43-.97,2.87-2.9,2.87-3.65,0-7.3,.01-10.95,0-1.71,0-2.88-1.19-2.88-2.91-.01-2.92,0-5.84,0-8.76,0-.68,.01-1.37,0-2.05-.04-1.87,1.28-3.08,2.97-3.02,1.81,.06,3.63,.01,5.44,.01h0Z"/>
33
+ <path class="cls-1" d="M495.64,54.32c1.88,0,3.77,0,5.65,0,.98,0,1.71,.44,2.26,1.22,.35,.51,.42,1.08,.42,1.68,0,2.54,0,5.09,0,7.63,0,1.11-.04,2.21,0,3.32,.06,1.43-.97,2.86-2.9,2.87-3.65,0-7.3,.01-10.95,0-1.71,0-2.88-1.19-2.88-2.91-.01-2.92,0-5.84,0-8.76,0-.68,.01-1.37,0-2.05-.04-1.87,1.28-3.08,2.97-3.02,1.81,.06,3.63,.01,5.44,.01h0Z"/>
34
+ </g>
35
+ <g>
36
+ <path class="cls-2" d="M688.47,115.07h-22.05c-1.08,0-2.03,.7-2.35,1.73l-4.15,13.3c-.38,1.22-1.51,2.05-2.79,2.05h-10.37c-2,0-3.41-1.96-2.77-3.85l24.73-73.33c.4-1.19,1.51-1.99,2.77-1.99h12.06c1.25,0,2.37,.8,2.77,1.99l24.63,73.33c.64,1.89-.77,3.85-2.77,3.85h-10.38c-1.27,0-2.4-.83-2.79-2.04l-4.2-13.31c-.32-1.02-1.27-1.72-2.34-1.72Zm-11.76-38.37l-7.6,24.08c-.29,.91,.39,1.85,1.35,1.85h14.02c.96,0,1.64-.93,1.35-1.84l-7.55-24.06c-.27-.8-1.33-.79-1.58-.02Z"/>
37
+ <path class="cls-2" d="M733.89,132.14h-10.02c-1.62,0-2.93-1.31-2.93-2.93V55.9c0-1.62,1.31-2.93,2.93-2.93h10.02c1.62,0,2.93,1.31,2.93,2.93v73.31c0,1.62-1.31,2.93-2.93,2.93Z"/>
38
+ </g>
39
+ </g>
40
+ </g>
41
+ </svg>
@@ -262,11 +262,93 @@ function sleep(ms) {
262
262
  return new Promise((resolve) => setTimeout(resolve, ms));
263
263
  }
264
264
 
265
+ // src/integrations/workbuddy/auth.ts
266
+ import { setTimeout as delay } from "timers/promises";
267
+
265
268
  // src/integrations/workbuddy/host-page.ts
266
269
  import { randomBytes } from "crypto";
267
270
  import fs from "fs";
268
271
  import { createServer } from "http";
269
272
  import { fileURLToPath } from "url";
273
+
274
+ // src/integrations/workbuddy/entry-page.ts
275
+ function renderWorkBuddyEntryPage(sessionPath, nonce) {
276
+ return `<!doctype html>
277
+ <html lang="zh-CN">
278
+ <head>
279
+ <meta charset="utf-8">
280
+ <meta name="viewport" content="width=device-width, initial-scale=1">
281
+ <title>ThinkingAI \xD7 WorkBuddy</title>
282
+ <style nonce="${nonce}">
283
+ * { box-sizing: border-box; }
284
+ body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 48px 24px; color: #111d35; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: radial-gradient(circle at 18% 7%, rgba(64,130,255,.09), transparent 29%), radial-gradient(circle at 86% 92%, rgba(37,204,173,.08), transparent 26%), #f4f8fd; }
285
+ .shell { width: min(940px, 100%); padding: 48px 52px 32px; border: 1px solid #dce5f1; border-radius: 28px; background: #fff; box-shadow: 0 24px 70px rgba(35,67,115,.13); }
286
+ .brands { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 72px; }
287
+ .thinkingai { width: 256px; height: auto; }
288
+ .workbuddy { width: 142px; height: auto; }
289
+ .dots { display: flex; align-items: center; gap: 7px; padding: 0 2px; }
290
+ .dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7ba; animation: pulse 1.4s ease-in-out infinite; }
291
+ .dots i:nth-child(2) { animation-delay: .18s; }
292
+ .dots i:nth-child(3) { animation-delay: .36s; }
293
+ @keyframes pulse { 0%, 65%, 100% { opacity: .36; transform: scale(.82); } 30% { opacity: 1; transform: scale(1.18); } }
294
+ h1 { margin: 30px 0 8px; text-align: center; font-size: 38px; line-height: 1.25; letter-spacing: -.8px; }
295
+ .routes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
296
+ .route { position: relative; display: flex; min-height: 286px; flex-direction: column; padding: 28px; border: 1.5px solid #d8e2ef; border-radius: 20px; background: #fff; }
297
+ .route.primary { border-color: #8db9ff; background: linear-gradient(150deg, #f4f8ff, #eef6ff); box-shadow: 0 12px 30px rgba(22,115,243,.08); }
298
+ .badge { position: absolute; top: 20px; right: 20px; padding: 6px 10px; border-radius: 999px; color: #1368dd; background: #e4efff; font-size: 12px; font-weight: 700; }
299
+ .secondary .badge { color: #5d6b82; background: #eef2f7; }
300
+ .icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; color: #fff; background: #1677ff; box-shadow: 0 9px 20px rgba(22,119,255,.2); }
301
+ .secondary .icon { color: #315174; background: #edf3fa; box-shadow: none; }
302
+ .icon svg { width: 25px; height: 25px; }
303
+ .route h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.2px; }
304
+ .route p { margin: 0 0 16px; color: #64738c; font-size: 15px; line-height: 1.72; }
305
+ .route .handoff-note { color: #7b899e; font-size: 13px; }
306
+ .action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin-top: auto; border: 1px solid #c8d6e8; border-radius: 12px; color: #263852; background: #fff; font-size: 16px; font-weight: 700; text-decoration: none; }
307
+ .primary .action { border-color: #1677ff; color: #fff; background: #1677ff; }
308
+ .action:hover { background: #f3f7fc; }
309
+ .primary .action:hover { background: #0869ed; }
310
+ .action:focus-visible { outline: 3px solid #8db9ff; outline-offset: 3px; }
311
+ .note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 0; color: #7b899e; font-size: 13px; }
312
+ .note svg { width: 16px; height: 16px; flex: none; }
313
+ footer { margin-top: 22px; padding-top: 22px; border-top: 1px solid #edf1f6; color: #8995a8; text-align: center; font-size: 13px; }
314
+ @media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .65; } }
315
+ @media (max-width: 740px) { body { padding: 0; background: #fff; } .shell { min-height: 100vh; padding: 32px 20px 26px; border: 0; border-radius: 0; box-shadow: none; } .thinkingai { width: 188px; } .workbuddy { width: 106px; } .brands { gap: 12px; } h1 { font-size: 30px; } .routes { grid-template-columns: 1fr; } .route { min-height: 246px; } }
316
+ @media (max-width: 400px) { .thinkingai { width: 160px; } .workbuddy { width: 90px; } .dots { gap: 4px; } .dots i { width: 5px; height: 5px; } }
317
+ </style>
318
+ </head>
319
+ <body>
320
+ <main class="shell">
321
+ <div class="brands" aria-label="ThinkingAI \u4E0E WorkBuddy">
322
+ <img class="thinkingai" src="${sessionPath}thinkingai.svg" alt="ThinkingAI">
323
+ <span class="dots" aria-hidden="true"><i></i><i></i><i></i></span>
324
+ <img class="workbuddy" src="${sessionPath}workbuddy.png" alt="WorkBuddy">
325
+ </div>
326
+ <h1>\u9009\u62E9\u4F7F\u7528\u65B9\u5F0F</h1>
327
+ <section class="routes" aria-label="\u4F7F\u7528\u65B9\u5F0F">
328
+ <article class="route primary">
329
+ <span class="badge">\u63A8\u8350\u65B0\u7528\u6237</span>
330
+ <div class="icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 0 1 0 18M12 3a15 15 0 0 0 0 18"/></svg></div>
331
+ <h2>\u524D\u5F80 ThinkingAI \u5B98\u7F51</h2>
332
+ <p>\u9996\u6B21\u4F7F\u7528 ThinkingAI\uFF0C\u6216\u5E0C\u671B\u5728\u5B98\u7F51\u5B8C\u6210\u6CE8\u518C\u3001\u5F00\u901A\u53CA\u540E\u7EED\u4F7F\u7528\u3002</p>
333
+ <p class="handoff-note">\u5C06\u79BB\u5F00 WorkBuddy\uFF0C\u524D\u5F80\u5B98\u7F51\u7EE7\u7EED\u4F7F\u7528\u3002</p>
334
+ <a class="action" href="${sessionPath}website">\u524D\u5F80\u5B98\u7F51</a>
335
+ </article>
336
+ <article class="route secondary">
337
+ <span class="badge">\u5DF2\u6709 AE \u7528\u6237</span>
338
+ <div class="icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.5.5l2-2a5 5 0 0 0-7-7l-1.1 1.1"/><path d="M14 11a5 5 0 0 0-7.5-.5l-2 2a5 5 0 0 0 7 7l1.1-1.1"/></svg></div>
339
+ <h2>\u8FDE\u63A5\u5DF2\u6709 AE \u73AF\u5883</h2>
340
+ <p>\u5DF2\u7ECF\u4F7F\u7528 ae-cli \u6216\u62E5\u6709 AE Host\uFF0C\u5728 WorkBuddy \u4E2D\u7EE7\u7EED\u5B8C\u6210\u8FDE\u63A5\u3002</p>
341
+ <a class="action" href="${sessionPath}host">\u7EE7\u7EED\u8FDE\u63A5</a>
342
+ </article>
343
+ </section>
344
+ <p class="note"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"/></svg>\u8D26\u53F7\u5BC6\u7801\u53EA\u4F1A\u5728 AE \u7EDF\u4E00\u767B\u5F55\u9875\u8F93\u5165\uFF1B\u89E3\u7ED1\u540E\u53EF\u4EE5\u91CD\u65B0\u9009\u62E9\u4F7F\u7528\u65B9\u5F0F</p>
345
+ <footer>\u7531 WorkBuddy \xB7 ae-cli \u53D1\u8D77</footer>
346
+ </main>
347
+ </body>
348
+ </html>`;
349
+ }
350
+
351
+ // src/integrations/workbuddy/host-page.ts
270
352
  var LOOPBACK_ADDRESS = "127.0.0.1";
271
353
  var MAX_REQUEST_BYTES = 4096;
272
354
  function validateWorkBuddyHost(input) {
@@ -300,19 +382,24 @@ function renderWorkBuddyHostPage(hosts, sessionPath, nonce) {
300
382
  <head>
301
383
  <meta charset="utf-8">
302
384
  <meta name="viewport" content="width=device-width, initial-scale=1">
303
- <title>ThinkingAI AE \xD7 WorkBuddy</title>
385
+ <title>ThinkingAI \xD7 WorkBuddy</title>
304
386
  <style nonce="${nonce}">
305
387
  :root { color-scheme: light; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
306
388
  * { box-sizing: border-box; }
307
- body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px 20px; color: #111c35; background: #f3f7fb; }
308
- .card { width: min(640px, 100%); padding: 28px 40px 22px; background: #fff; border: 1px solid #dbe3ee; border-radius: 14px; box-shadow: 0 20px 55px rgba(39, 62, 92, .12); }
309
- .brands { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; margin-bottom: 14px; }
310
- .thinkingai { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
311
- .thinkingai img { width: 38px; height: 42px; object-fit: none; object-position: 65% 55%; }
312
- .workbuddy { width: 132px; height: auto; object-fit: contain; }
313
- .collaboration { color: #8490a5; font-size: 21px; }
389
+ body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 28px 20px; color: #111c35; background: radial-gradient(circle at 50% 42%, #f8fbff 0, #eef3f9 48%, #e7edf5 100%); }
390
+ .card { width: min(720px, 100%); padding: 34px 48px 26px; background: #fff; border: 1px solid #dde5ef; border-radius: 22px; box-shadow: 0 24px 64px rgba(39, 62, 92, .14); }
391
+ .brands { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 58px; margin-bottom: 24px; }
392
+ .thinkingai { width: 244px; height: auto; object-fit: contain; }
393
+ .workbuddy { width: 136px; height: auto; object-fit: contain; }
394
+ .collaboration { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 55px; }
395
+ .connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa8bd; opacity: .24; animation: connectionPulse 1.35s ease-in-out infinite; }
396
+ .connection-dot:nth-child(2) { animation-delay: .18s; }
397
+ .connection-dot:nth-child(3) { animation-delay: .36s; }
398
+ @keyframes connectionPulse { 0%, 70%, 100% { opacity: .2; transform: translateY(0) scale(.82); } 35% { opacity: 1; transform: translateY(-1px) scale(1); } }
314
399
  h1 { margin: 0; text-align: center; font-size: 30px; line-height: 1.25; letter-spacing: -.025em; }
315
400
  .subtitle { margin: 7px 0 22px; text-align: center; color: #62708a; font-size: 16px; }
401
+ .back { display: inline-block; margin-bottom: 18px; color: #62708a; font-size: 13px; text-decoration: none; }
402
+ .back:hover { color: #0878f9; }
316
403
  fieldset { margin: 0; padding: 0; border: 0; }
317
404
  legend, .field-label { display: block; margin-bottom: 10px; color: #18243c; font-size: 15px; font-weight: 700; }
318
405
  .host-list { display: grid; gap: 8px; max-height: 188px; overflow: auto; }
@@ -330,29 +417,34 @@ function renderWorkBuddyHostPage(hosts, sessionPath, nonce) {
330
417
  input[type="url"]:focus { border-color: #0878f9; box-shadow: 0 0 0 3px rgba(8, 120, 249, .13); }
331
418
  input[type="url"]::placeholder { color: #8a96aa; }
332
419
  .helper { margin: 7px 0 0; color: #6b7890; font-size: 13px; }
333
- .notice { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; padding: 12px 15px; color: #405579; background: #edf5ff; border-radius: 7px; font-size: 13px; line-height: 1.55; }
334
- .shield { width: 18px; height: 21px; flex: none; color: #0878f9; }
420
+ .notice { display: flex; align-items: center; gap: 10px; margin: 18px 0; padding: 12px 15px; color: #405579; background: #edf5ff; border: 1px solid #d8e6ff; border-radius: 7px; font-size: 13px; line-height: 1.55; }
421
+ .info { width: 19px; height: 19px; flex: none; color: #0878f9; }
335
422
  .actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
336
423
  button { width: 100%; height: 44px; border-radius: 7px; font: inherit; font-weight: 700; cursor: pointer; }
424
+ button:disabled { cursor: not-allowed; opacity: .68; }
337
425
  .primary { color: #fff; background: #0878f9; border: 1px solid #0878f9; }
338
426
  .primary:hover { background: #0069df; }
339
427
  .secondary { color: #38465d; background: #fff; border: 1px solid #cad5e3; }
340
428
  .secondary:hover { background: #f6f8fb; }
341
429
  .status { min-height: 22px; margin: 14px 0 0; text-align: center; color: #0a6d3a; font-size: 13px; }
342
430
  .status.error { color: #bd1e2d; }
343
- footer { margin-top: 2px; text-align: center; color: #7b879d; font-size: 12px; font-style: italic; }
344
- @media (max-width: 620px) { body { padding: 0; background: #fff; } .card { min-height: 100vh; padding: 28px 20px 22px; border: 0; border-radius: 0; box-shadow: none; } .brands { gap: 10px; } .thinkingai { font-size: 17px; } .workbuddy { width: 112px; } h1 { font-size: 26px; } }
431
+ footer { margin-top: 4px; text-align: center; font-size: 13px; }
432
+ footer a { color: #7b879d; text-decoration: none; transition: color .15s; }
433
+ footer a:hover { color: #0878f9; }
434
+ @media (prefers-reduced-motion: reduce) { .connection-dot { animation: none; opacity: .65; } }
435
+ @media (max-width: 620px) { body { padding: 0; background: #fff; } .card { min-height: 100vh; padding: 28px 20px 22px; border: 0; border-radius: 0; box-shadow: none; } .brands { gap: 12px; } .thinkingai { width: 184px; } .workbuddy { width: 104px; } .collaboration { gap: 4px; min-width: 34px; } .connection-dot { width: 5px; height: 5px; } h1 { font-size: 26px; } }
345
436
  </style>
346
437
  </head>
347
438
  <body>
348
439
  <main class="card">
440
+ <a class="back" href="${sessionPath}">\u2190 \u8FD4\u56DE\u9009\u62E9\u4F7F\u7528\u65B9\u5F0F</a>
349
441
  <header>
350
- <div class="brands" aria-label="ThinkingAI AE \u4E0E WorkBuddy">
351
- <div class="thinkingai"><img src="${sessionPath}thinkingai.png" alt=""><span>ThinkingAI AE</span></div>
352
- <span class="collaboration" aria-hidden="true">\xD7</span>
442
+ <div class="brands" aria-label="ThinkingAI \u4E0E WorkBuddy">
443
+ <img class="thinkingai" src="${sessionPath}thinkingai.svg" alt="ThinkingAI">
444
+ <span class="collaboration" aria-hidden="true"><span class="connection-dot"></span><span class="connection-dot"></span><span class="connection-dot"></span></span>
353
445
  <img class="workbuddy" src="${sessionPath}workbuddy.png" alt="WorkBuddy">
354
446
  </div>
355
- <h1>\u8FDE\u63A5 ThinkingAI AE</h1>
447
+ <h1>\u8FDE\u63A5 ThinkingAI</h1>
356
448
  <p class="subtitle">\u9009\u62E9\u8981\u5728 WorkBuddy \u4E2D\u4F7F\u7528\u7684 AE \u73AF\u5883</p>
357
449
  </header>
358
450
  <form id="host-form" novalidate>
@@ -365,21 +457,23 @@ function renderWorkBuddyHostPage(hosts, sessionPath, nonce) {
365
457
  <input id="custom-host" name="custom-host" type="url" inputmode="url" autocomplete="url" placeholder="https://your-ae-host.example.com">
366
458
  <p class="helper">\u4EC5\u652F\u6301 HTTPS \u5730\u5740</p>
367
459
  <div class="notice">
368
- <svg class="shield" viewBox="0 0 24 28" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="2" d="M12 1.5 21 5v7.2c0 6-3.8 11.2-9 13.8-5.2-2.6-9-7.8-9-13.8V5l9-3.5Z"/></svg>
460
+ <svg class="info" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9.5" fill="none" stroke="currentColor"/><path fill="currentColor" d="M11 10.5h2V17h-2zM12 6.5a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4z"/></svg>
369
461
  <span>\u8D26\u53F7\u5BC6\u7801\u5C06\u5728 AE \u7EDF\u4E00\u767B\u5F55\u9875\u4E2D\u8F93\u5165\uFF0C\u672C\u9875\u9762\u4EC5\u7528\u4E8E\u9009\u62E9 Host\u3002</span>
370
462
  </div>
371
463
  <div class="actions">
372
- <button class="primary" type="submit">\u7EE7\u7EED\u524D\u5F80 AE \u767B\u5F55</button>
373
464
  <button class="secondary" id="cancel" type="button">\u53D6\u6D88</button>
465
+ <button class="primary" id="submit-host" type="submit">\u7EE7\u7EED\u524D\u5F80 AE \u767B\u5F55</button>
374
466
  </div>
375
467
  <p class="status" id="status" role="status" aria-live="polite"></p>
376
468
  </form>
377
- <footer>\u7531 WorkBuddy \xB7 ae-cli \u53D1\u8D77</footer>
469
+ <footer><a href="https://www.thinkingai.cn/" target="_blank" rel="noopener noreferrer">\u4E86\u89E3\u66F4\u591A\uFF0C\u8BBF\u95EE ThinkingAI \u5B98\u7F51 \u2192</a></footer>
378
470
  </main>
379
471
  <script nonce="${nonce}">
380
472
  const form = document.getElementById('host-form');
381
473
  const customHost = document.getElementById('custom-host');
382
474
  const status = document.getElementById('status');
475
+ const submitButton = document.getElementById('submit-host');
476
+ const cancelButton = document.getElementById('cancel');
383
477
  const radios = Array.from(document.querySelectorAll('input[name="saved-host"]'));
384
478
 
385
479
  customHost.addEventListener('input', () => {
@@ -394,10 +488,13 @@ function renderWorkBuddyHostPage(hosts, sessionPath, nonce) {
394
488
  }));
395
489
  form.addEventListener('submit', async event => {
396
490
  event.preventDefault();
491
+ if (submitButton.disabled) return;
397
492
  const selected = radios.find(radio => radio.checked);
398
493
  const host = customHost.value.trim() || (selected ? selected.value : '');
399
494
  status.textContent = '';
400
495
  status.classList.remove('error');
496
+ submitButton.disabled = true;
497
+ submitButton.textContent = '\u6B63\u5728\u7EE7\u7EED\u2026';
401
498
  try {
402
499
  const response = await fetch('${sessionPath}select', {
403
500
  method: 'POST',
@@ -406,13 +503,19 @@ function renderWorkBuddyHostPage(hosts, sessionPath, nonce) {
406
503
  });
407
504
  const result = await response.json();
408
505
  if (!response.ok || !result.ok) throw new Error(result.message || 'Host \u6821\u9A8C\u5931\u8D25\u3002');
409
- status.textContent = '\u5DF2\u4FDD\u5B58 ' + result.host + '\uFF0C\u6B63\u5728\u7EE7\u7EED\u767B\u5F55\u2026';
506
+ customHost.disabled = true;
507
+ radios.forEach(radio => { radio.disabled = true; });
508
+ cancelButton.disabled = true;
509
+ submitButton.textContent = '\u5DF2\u7EE7\u7EED\u524D\u5F80 AE \u767B\u5F55';
510
+ status.textContent = 'Host \u5DF2\u4FDD\u5B58\uFF0CAE \u767B\u5F55\u9875\u6B63\u5728\u6253\u5F00\u3002\u5982\u5DF2\u5173\u95ED\uFF0C\u8BF7\u8FD4\u56DE WorkBuddy \u91CD\u65B0\u8FDE\u63A5\u3002';
410
511
  } catch (error) {
512
+ submitButton.disabled = false;
513
+ submitButton.textContent = '\u7EE7\u7EED\u524D\u5F80 AE \u767B\u5F55';
411
514
  status.textContent = error instanceof Error ? error.message : 'Host \u6821\u9A8C\u5931\u8D25\u3002';
412
515
  status.classList.add('error');
413
516
  }
414
517
  });
415
- document.getElementById('cancel').addEventListener('click', () => {
518
+ cancelButton.addEventListener('click', () => {
416
519
  status.textContent = '\u5DF2\u53D6\u6D88\uFF0C\u53EF\u4EE5\u5173\u95ED\u6B64\u9875\u9762\u3002';
417
520
  status.classList.remove('error');
418
521
  });
@@ -426,7 +529,7 @@ async function startWorkBuddyHostPage(options = {}) {
426
529
  const sessionPath = `/workbuddy/${sessionId}/`;
427
530
  const nonce = randomBytes(18).toString("base64url");
428
531
  const assets = {
429
- thinkingai: readBrandAsset("thinkingai.png"),
532
+ thinkingai: readBrandAsset("thinkingai.svg"),
430
533
  workbuddy: readBrandAsset("workbuddy.png")
431
534
  };
432
535
  let resolveSelection = (_host) => {
@@ -434,15 +537,31 @@ async function startWorkBuddyHostPage(options = {}) {
434
537
  const selection = new Promise((resolve) => {
435
538
  resolveSelection = resolve;
436
539
  });
540
+ let resolveWebsiteHandoff = () => {
541
+ };
542
+ const websiteHandoff = new Promise((resolve) => {
543
+ resolveWebsiteHandoff = resolve;
544
+ });
437
545
  const server = createServer(async (request, response) => {
438
546
  setSecurityHeaders(response, nonce);
439
547
  const requestUrl = new URL(request.url ?? "/", `http://${LOOPBACK_ADDRESS}`);
440
548
  if (request.method === "GET" && requestUrl.pathname === sessionPath) {
549
+ respond(response, 200, "text/html; charset=utf-8", renderWorkBuddyEntryPage(sessionPath, nonce));
550
+ return;
551
+ }
552
+ if (request.method === "GET" && requestUrl.pathname === `${sessionPath}host`) {
441
553
  respond(response, 200, "text/html; charset=utf-8", renderWorkBuddyHostPage(hosts, sessionPath, nonce));
442
554
  return;
443
555
  }
444
- if (request.method === "GET" && requestUrl.pathname === `${sessionPath}thinkingai.png`) {
445
- respond(response, 200, "image/png", assets.thinkingai);
556
+ if (request.method === "GET" && requestUrl.pathname === `${sessionPath}website`) {
557
+ response.once("finish", resolveWebsiteHandoff);
558
+ response.statusCode = 302;
559
+ response.setHeader("Location", "https://www.thinkingai.cn/workbuddy/");
560
+ response.end();
561
+ return;
562
+ }
563
+ if (request.method === "GET" && requestUrl.pathname === `${sessionPath}thinkingai.svg`) {
564
+ respond(response, 200, "image/svg+xml", assets.thinkingai);
446
565
  return;
447
566
  }
448
567
  if (request.method === "GET" && requestUrl.pathname === `${sessionPath}workbuddy.png`) {
@@ -471,6 +590,7 @@ async function startWorkBuddyHostPage(options = {}) {
471
590
  return {
472
591
  url: `http://${LOOPBACK_ADDRESS}:${address.port}${sessionPath}`,
473
592
  selection,
593
+ websiteHandoff,
474
594
  close: () => closeServer(server)
475
595
  };
476
596
  }
@@ -576,12 +696,17 @@ function registerWorkBuddyAuth(auth) {
576
696
  process.stderr.write(`[ae-cli] WorkBuddy host selection:
577
697
  ${page.url}
578
698
  `);
579
- const selected = await Promise.race([
580
- page.selection.then(() => true),
581
- waitForTerminationSignal().then(() => false)
699
+ const outcome = await Promise.race([
700
+ page.selection.then(() => "selected"),
701
+ page.websiteHandoff.then(() => "website"),
702
+ waitForTerminationSignal().then(() => "terminated")
582
703
  ]);
583
704
  await page.close();
584
- if (!selected) process.exitCode = 1;
705
+ if (outcome === "website") {
706
+ await delay(3e3);
707
+ process.stderr.write("[ae-cli] Website selected; WorkBuddy authentication stopped.\n");
708
+ }
709
+ if (outcome !== "selected") process.exitCode = 1;
585
710
  });
586
711
  }
587
712
  function waitForTerminationSignal() {
package/dist/index.js CHANGED
@@ -2389,7 +2389,7 @@ async function loadCommands() {
2389
2389
  }
2390
2390
  async function registerAuthCommands() {
2391
2391
  try {
2392
- const { registerAuth } = await import("./auth-HJG2L6DR.js");
2392
+ const { registerAuth } = await import("./auth-HK246OGX.js");
2393
2393
  registerAuth(program);
2394
2394
  } catch {
2395
2395
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkingai/ae-cli",
3
- "version": "6.0.48-workbuddy",
3
+ "version": "6.0.48-workbuddy.2",
4
4
  "description": "CLI tool for ThinkingAI (AE) analytics platform",
5
5
  "type": "module",
6
6
  "bin": {