Commit Graph

281 Commits

Author SHA1 Message Date
root f8b918b9cd style(ops-web/login): redesign login with animated mascot and brand panel
Replace the previous split-screen with a brand panel that hosts an
animated mascot (eyeballs whose pupils track the focused form field and
hide while the password is typed) and decorative grid/circles, plus a
mobile brand mark and footer links. Swap Ant Design form controls for
native inputs styled to match. The mascot is composed from new
AnimatedCharacters / EyeBall / Pupil components.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:50:19 +08:00
root 3480d04ec3 feat(ops-api/audit): annotate audit log IP with region lookup
Add an IPRegionResolver wrapping the ip2region xdb library and attach it
to AuditService so each appended event records both the raw IP and a
resolved region in a new ops.audit_logs.ip_region column. Loopback and
private addresses short-circuit to local labels; missing xdb data or
lookup errors degrade silently so auditing keeps working without it.
The ops console audit view shows the region beneath the IP. Bundle the
v4/v6 xdb data under internal/ops/app/ipregiondata so the resolver works
out of the box, with config paths/env overrides for swapping in updated
data sets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:46:37 +08:00
root 7be0de0614 feat(ops): add tenant admin user management module
Adds /admin-users CRUD on the ops backend, covering listing, plan/role/KOL
toggles, subscription expiry, status flips and password resets, with a
configurable default plan code. The ops console exposes a new top-level
"用户管理" view and reorganises the sidebar so 操作员管理 and 审计日志
move under a "系统设置" group; AccountsView is renamed accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:02:46 +08:00
root 62b824520c feat(admin-web/auth): support phone-or-email login and dim shell on expiry
Login form takes a phone-or-email identifier; user info now exposes phone
so the shell can fall back through name → phone → email. When membership
expires, the app stays on the current route but renders a minimal blocked
state in the shell instead of redirecting to a dedicated page; an Axios
interceptor flips the local session into the blocked state when the API
returns trial/subscription errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:01:47 +08:00
root a6b17bae62 fix(monitoring): reject succeeded results missing answers or citation sources
Server callback now rejects succeeded submissions without a non-empty answer,
or whose answer contains [citation:N] markers without any sources. Desktop
adapters mirror this client-side: kimi returns unknown when sources arrive
without a final answer, and yuanbao returns unknown when the answer has
unresolved citation markers. Yuanbao also unwraps redirect URLs, harvests
citations from more DOM attributes and document URL fields, drops links
pointing back at yuanbao itself, and dedupes overlapping streaming
fragments. Runtime controller forwards only an explicit "succeeded" status
as success; anything else becomes failed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 22:07:21 +08:00
root 27f1850e0e fix(admin-web/tracking): guard optional citations array on platform
部分平台返回的快照里没有 citations 数组,原代码直接 platform.citations[i]
会在内联引文渲染处抛 TypeError。改用可选链兜底空值。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:36:05 +08:00
root 9683a53403 refactor(admin-web/ai-points): rework usage page into card layout
把页面改造成两张白底卡片:顶部卡片承载页头 + 概览四宫格,下面卡片承载用量
台账。指标格子改成圆形图标 + 文字两栏布局,排版更接近现有控制台其它视图。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:35:58 +08:00
root fa905519f6 fix(admin-web/image-webp): bundle jsquash wasm via vite resolver
Vite 在生产构建里没法解析 @jsquash/webp 自带的相对 wasm 路径,导致 WebP 编码
首次调用就失败。改成直接 import encode.js + ?url 的 wasm 资源,并在 vite.config
里把 specifier 显式 alias 到 node_modules 的真实文件,运行前再调用 init({locateFile})
告诉 wasm 加载器去拿打包后的 URL。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:35:46 +08:00
root 4c4795e029 feat(publish/dongchedi): publish via page context with cover and conservative HTML
懂车帝发布闸现走 Playwright/WebContents 内的 fetch,附带 CSRF token、自动
draft+commit 两步保存,并在前置流程中把正文 HTML 收敛到 p/strong/img、表格
降级为段落、过滤本地素材 URL。同步把懂车帝纳入封面强制平台,更新中英文
提示与错误码文案。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:35:36 +08:00
root bf7594ccd8 feat(admin-web): expose AI point balance and usage ledger
Surfaces the new AI point quota in the workspace shell and adds a
Personal Center → AI Point Usage page that shows balance, base-char
rule, and the paginated reservation/refund history. Updates shared
types for the QuotaSummary and ledger payloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 11:34:07 +08:00
root f5254f6a27 feat(ops-web): add operations console frontend
Vue 3 + Ant Design Vue SPA scaffold for the internal ops console. Ships
the auth, account list, and audit log views that consume the new ops-api
endpoints, plus the nginx/vite/typecheck plumbing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 11:33:17 +08:00
root 299e7c311e refactor(desktop-client/home): drop engine subsystem snapshot panel
The transport/lease-manager/vault JSON dump was a debug artifact and
duplicated information already surfaced in the network and accounts
panels. Remove the panel and its styles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 09:14:31 +08:00
root 93cf734673 test(desktop-client/deepseek): mock electron ipcMain to unblock vitest import
The deepseek adapter pulls in electron/main when registering ipc listeners,
which made the test fail at import time outside the electron runtime. Stub
ipcMain with vi.mock so the unit test can load the module under vitest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 21:34:28 +08:00
root 1ef7b872e3 fix(publish/dongchedi): route imagex traffic through session.fetch
Use the account session for imagex apply/upload/commit so the requests carry
the same cookies/UA the bind console saw, instead of falling out of the
session via a bare Node fetch — bytedance imagex was rejecting these as
unauthenticated under the bound session. Also align the binding console URL
with the v2 publish article path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 21:34:15 +08:00
root 412befef53 feat(admin-web): prefer runtime account health when ranking and gating accounts
Surface the new runtime_health/runtime_checked_at fields through a tiny
desktop-account-runtime helper so PublishArticleModal, MediaView, and
TrackingView fall back to the desktop client's last live signal instead of
the slower DB column. This keeps the publishable card and tracking
breakdown in sync with the desktop probe loop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 21:34:05 +08:00
root c3feb7477a feat(desktop-client): queue account probes and report health to server
Replace serial probe-on-lock with a bounded probe queue (concurrency 3) that
adds a "queued" probe state, manual cooldown, and retry backoff. After each
probe the runtime debounces a batched POST to the new
/desktop/accounts/health-reports endpoint so the server learns about live,
expired, and risk transitions without waiting for a re-bind. Adds an
account-scoped IPC (probeRuntimeAccount + runtimeAccountSnapshot) so the
renderer can refresh a single row instead of replaying the full snapshot,
and exposes the resulting "重新校验" action in AccountsView/AiPlatformsView.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 21:33:55 +08:00
root 9e76bd9e61 fix(login): keep remember-password toggle interactive in draggable header
The login shell sets -webkit-app-region: drag on its frameless header,
which captured clicks on the "记住密码" checkbox before v-model could
update. Mark .options-row and its descendants as no-drag, and bind the
checkbox via :checked + @change so the click reliably reaches the
toggle handler.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:07:18 +08:00
root 9480192d66 refactor(publish): redesign management list with hero card and sohu URL fallback
Switch the publish management page to the hero-card + stats-strip layout
shared with AccountsView for visual consistency: bigger title, stats
row, modern table styling, and a content-section wrapper. Add a
buildSohuArticleUrl helper that reconstructs the sohu article URL from
the task result and the bound account's platform uid when the adapter
result didn't include external_article_url, so older finished tasks
also resolve a viewable link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:07:10 +08:00
root def2db5902 fix(publish/sohuhao): align manage URL with v4 console and emit article URL
The v3 manage URL has been retired and now redirects through a login
gate, breaking the post-publish "管理" deeplink and login detection.
Switch the binding console URL and the adapter SOHU_MANAGE_URL to the
v4 contentManagement endpoints, and synthesize external_article_url for
publish (not draft) results from the article id and account uid so the
publish list can offer a "查看文章" link without an extra fetch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:06:57 +08:00
root 543fe0635f feat(desktop-client): derive stable client_id from machine identity
Generate the desktop client_id deterministically from OS machine identifiers
(IOPlatformUUID / MachineGuid / /etc/machine-id) scoped per
tenant+workspace+user, with a persisted UUID fallback when the OS lookup
fails. The renderer now requests the id over a new IPC bridge instead of
keeping a localStorage UUID, so reinstalls and storage clears no longer
fork into duplicate clients. Server enforces the id as required and
rejects empty/malformed UUIDs. Also harden bootstrap reveal flow and
single-instance exit so a second launch focuses the existing window.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:06:37 +08:00
root fee16d3ea9 refactor(publish): tighten publish management list layout
Collapse the hero card into a compact header with inline metrics, and rework the table with denser rows, fixed action column, and tooltip-backed time/title cells so more tasks fit on screen without losing the error popover and platform context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:50:56 +08:00
root 4d6e6990d4 feat(desktop-client): surface account health issues in tray and app icons
Periodically polls runtime snapshot for accounts in expired/revoked/challenge_required states and reflects the count via tray badge, macOS dock badge, and Windows overlay icon so users see authentication problems without opening the app.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:50:45 +08:00
root 87c902c5da refactor(publish): replace inline banners with notifications and popover error preview
- Switch retry/copy/console feedback from inline banners to antd
  notifications so the table layout stops jumping on each action.
- Truncate the error message in the table cell and move full text +
  copy button into a hover popover, preventing very long adapter
  errors from blowing out the row width.
- Pin column widths and force fixed table layout so the meta column
  no longer expands the table off-screen on long error strings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:35:03 +08:00
root aed8b20973 feat(desktop-client): open account workbench and copy errors from publish list
Replace the raw external URL link with an in-app shortcut that opens the
bound account's platform console window, and add a one-click copy button
for failure error messages (with truncation + tooltip preview) so long
adapter errors stay readable in the task table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:21:20 +08:00
root e1a1916bc5 fix(publish): harden zol login detection and content image upload
- Detect zol login redirects via passport/service hostnames and verify
  console access by re-detecting the bound account so a different logged
  in user is treated as expired instead of active.
- Skip networkPic upload for local/private URLs and fall back to file
  upload (with siteType retry) so desktop-hosted assets no longer reach
  ZOL as unreachable links and produce blank images.
- Surface zol_content_image_upload_failed and challenge errors instead
  of silently substituting empty image URLs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:21:12 +08:00
root b4cfc6f992 feat(desktop-client): fall back to authenticated desktop asset endpoint
When a public asset URL fails (e.g. stale signed token), retry via the
new /api/desktop/content/assets endpoint with the desktop Bearer token
so editor images keep rendering across token rotations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:21:02 +08:00
root 7ddd3d0c6c feat(publish): handle qiehao real-name auth via shared publisher errors
- Detect qiehao's real-name auth blocking response (code/message) in the
  desktop adapter, surface a Chinese-friendly summary, and propagate the
  detail through the failure result.
- Extract a shared publisher-errors module so the renderer can normalize
  these messages for the publish task table without duplicating regex.
- Pre-process article HTML for qiehao before upload via a new
  packages/publisher-platforms/src/qiehao.ts entry point.
- Update the manual self-test notes for jianshu and qiehao with the
  latest results.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 11:03:04 +08:00
root dbce8515e7 feat(publish): render jianshu html images as markdown
Jianshu's HTML editor strips uploaded <img> tags during save, so previously
uploaded images vanished from the rendered article. After image upload,
convert each <img> (and surrounding <p> wrappers) to a markdown image block
in both the desktop and extension publish paths so the references survive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 11:02:50 +08:00
root 021ef7fc79 perf(admin-web): drop KaTeX fonts from editor bundle
Import individual Crepe common stylesheets instead of the aggregate, which
transitively pulled in latex.css and emitted ~59 KaTeX font files even
though CrepeFeature.Latex is disabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 09:07:57 +08:00
root 93ff3c773f fix(admin-web): set no-referrer policy on cross-origin platform avatars
Platforms like Bilibili refuse to serve avatar images when the
Referer points at our admin origin, so the article publish status
panel and the media account cards now request avatars with a
no-referrer policy to stop the placeholder from showing instead of
the user's real avatar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 01:00:04 +08:00
root 3a367e7967 feat(desktop-client): show platform logo in publish task table
Replace the hard-coded platform name map with a lookup against the
shared desktop publish media catalog so the task table renders the
real platform logo (or a colored short-name fallback) next to the
account name and stays in sync as new platforms are added.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 00:59:51 +08:00
root a72ba4490e feat(admin-web): redesign publish modal account picker as bento cards
Switch the account picker from a vertical list to an auto-fill grid of
bento-style cards so a creator can compare more accounts at a glance.
Each card stacks identity + check above a dashed divider with the
status tags below, hovers lift with a soft shadow, and the avatar
loads with a no-referrer policy to keep cross-origin platform CDNs
happy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 00:59:08 +08:00
root 290da7cd50 feat(publish): add seven publish adapters for new media platforms
Wire sohuhao, wangyihao, juejin, smzdm, weixin-gzh, zol, and dongchedi
into the publish runtime: each ships its own publish protocol and
auth-failure classifier (login/token/challenge codes) plus registry
entries in selectPublishAdapter and the auth adapter map. Smzdm bind
detection now triple-falls-back across page-context fetch, session
fetch, cookie fetch, and a final cookie-derived account so the
nickname-less guest profile still resolves to a stable platform UID.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 00:57:37 +08:00
root 34e54b9f78 feat(publish): add shared media-image asset normalizer
Introduce a reusable helper that produces upload-ready blobs for
adapters that share the same image-asset semantics (dongchedi,
sohuhao, wangyihao, weixin-gzh, zol). Centralizes URL candidate
expansion and passthrough mime detection so each adapter focuses on
its own publish protocol.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 00:57:13 +08:00
root 7b05974ca4 chore(deps): align frontend toolchain on vite 7 and split admin bundle
Upgrade admin-web and desktop-client onto Vite 7 / Vitest 4 with the
matching @vitejs/plugin-vue 6 and electron-vite 5, and introduce
manualChunks plus gzip/brotli compression so the admin bundle ships
in smaller, route-aware pieces. ANALYZE=true emits a treemap via
rollup-plugin-visualizer; the generated stats.html is gitignored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 00:56:33 +08:00
root 53bebb46be perf(bind): speed up account bind detection and runtime sync
Replace the 1.8s polling interval with a 650ms tick plus a debounced
navigation-driven detect, listen for page-title-updated to catch SPA
transitions, and flush the session asynchronously. The bind handler
now optimistically seeds the runtime account list via
noteRuntimeAccountBound and fires the full server refresh in the
background, so the UI reflects the new binding without waiting on a
round-trip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 21:57:26 +08:00
root 0ce3f51f62 feat(publish): add bilibili and qiehao desktop adapters
Wire bilibili and qiehao (om.qq.com) into the publish adapter registry
and auth-failure classifier. Bilibili bind uses WBI-signed space-info
fallback to retrieve the avatar when nav lacks a face URL, and the
account list image renders with a no-referrer policy so bilibili CDN
serves the avatar cross-origin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 21:57:04 +08:00
root 2044e179e1 refactor(publish): downgrade baijiahao tables to paragraph rows
Baijiahao does not consistently render the previous flex-based faux table
markup, so reduce tables to plain <p> rows separated by three nbsp gaps
to keep tabular content visible after publish.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 21:55:27 +08:00
root 87e329207c feat(publish): add baijiahao and jianshu desktop adapters
Wires up Baijiahao (百家号) and Jianshu (简书) as first-class desktop
publish targets, with risk-control prompts surfaced in the runtime
controller and a normalized error message in publish records. Adds
external-link buttons in the publish management table, an asset
format conversion endpoint for cover image compatibility, and
reorders publish-status display priority so failures take precedence
over partial successes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 19:47:35 +08:00
root ae63f60def style(admin-web): apply blurred-backdrop cover treatment to KOL cards
Switch KOL package, template, and workspace card covers from object-fit
cover to a blurred backdrop with a contained foreground image so non-16:9
artwork no longer crops awkwardly. Also restyle the package detail back
button, swap the generate-button copy for the canonical key, and rename
"prompts" counts to "refined templates" in i18n.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 23:17:04 +08:00
root cde70ca5e0 feat(admin-web): trim platform and cover controls from article editor
Remove the right-rail publish platform selector and cover picker from the
in-editor view; those settings now live in the publish modal so the editor
focuses on title and content.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 23:16:45 +08:00
root e38c58e3d7 refactor(admin-web): source KOL platform options from shared catalog
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 22:45:29 +08:00
root c0617b70d8 feat(admin-web): add Ctrl/Cmd+S save shortcut to article editor
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 22:45:27 +08:00
root 2846968cf7 feat(kol): add selection-based AI optimize for prompt editor
Trigger an AI optimize panel from a text selection in the KOL prompt
editor, accept a user instruction, and stream a preview before replacing
the selected fragment. Extend the shared editor AI assist panel with
boundary-aware placement so it can be hosted inside scoped surfaces, and
update the backend optimize prompt to honor the user instruction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 22:41:40 +08:00
root 2862aff72b refactor(admin-web): unify page headers with shared title card
Introduce .page-title-card style and migrate Images, Knowledge,
KolDashboard, KolManage, KolProfile views to the shared header layout.
Add subtitle copy for KOL dashboard and manage views.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:38:45 +08:00
root 40d9a6cc63 feat(imitation): add article imitation create flow
Introduce 仿写创作: new list and create views, backend imitation service
and prompt templates, worker task routing for imitation jobs, and one-click
rewrite triggers from question citation sources. Surface source article
URL/title on article list/detail, and restrict failed articles to delete-only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:36:44 +08:00
root 46d0a7aea0 feat(admin-web): surface queued publish hint in media view
Restores publish hints for queued and immediate states so operators
know when a task will wait for the desktop client to come back online.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:09:12 +08:00
root d1f2a14477 feat(auth): extend refresh TTL and keep session on transient errors
Bumps refresh token lifetime to 720h with env overrides, and stops
clearing the local session for non-401 refresh failures so users aren't
logged out by transient network blips. Adds a 60s retry timer when a
refresh fails for non-auth reasons.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:09:01 +08:00
root 7e78b031d7 chore(admin-web): drop redundant publish hint copy from media view
Remove the immediate/queued publish hint sentences and the explanatory
alert block, and hide the card footer when there's nothing to show.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:39:02 +08:00
root 87137c1f83 feat(wenxin): unwrap reference redirects and capture web page sources
Decode Wenxin reference redirect targets so citation URLs land on the
real source host, and broaden the reference/search field patterns to
pick up webPages-style payloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:38:44 +08:00