Commit Graph

8866 Commits

Author SHA1 Message Date
GuoQing Zhang fe0740cf17 chore(platform): bump version to 2.6.0 2026-07-17 19:13:31 +08:00
GuoQing Zhang b4eb9fc69c fix(alembic): create missing model tables before upgrades 2026-07-17 18:25:18 +08:00
GuoQing Zhang 07cae3c1f4 chore(backend): sync lockfile project version 2026-07-17 15:45:31 +08:00
GuoQing Zhang eb14ee43b3 fix(brand): return defaults for runtime config 2026-07-17 15:44:55 +08:00
GuoQing Zhang 0cbbe37974 fix(alembic): auto-discover models for fresh databases 2026-07-17 15:39:25 +08:00
GuoQing Zhang bf05265623 fix(alembic): bootstrap schema for fresh databases 2026-07-17 14:40:28 +08:00
GuoQing Zhang 9f18aeae25 fix(alembic): merge v2.6.0 migration heads 2026-07-17 14:18:30 +08:00
GuoQing Zhang dd12964796 ci: change version 2026-07-17 11:34:46 +08:00
GuoQing Zhang 49261d5d63 fix: avoid login tenant context import shadowing 2026-07-17 10:39:51 +08:00
GuoQing Zhang d268e8e8a2 fix(user-group): clean memberships on group deletion 2026-07-16 20:41:11 +08:00
GuoQing Zhang 2c1f32a745 fix(knowledge): unify duplicate file detection 2026-07-16 20:35:54 +08:00
GuoQing Zhang bbbaeda973 fix(mark): prevent invalid assignees from breaking task list 2026-07-16 20:28:21 +08:00
GuoQing Zhang 57a7585c34 fix(platform): restore child admin menu access 2026-07-16 20:06:19 +08:00
GuoQing Zhang 94e2446b1d fix(knowledge): scope duplicate names by type 2026-07-16 20:03:57 +08:00
GuoQing Zhang 37251eca87 fix: show assistant chat error details 2026-07-16 19:54:01 +08:00
GuoQing Zhang e99a75ced8 Merge branch 'feat/2.6.0' of github.com:dataelement/bisheng into feat/2.6.0 2026-07-16 19:39:53 +08:00
GuoQing Zhang 7b6ee8ccdc Merge branch 'feat/2.6.0-beta4' into feat/2.6.0 2026-07-16 19:36:43 +08:00
GuoQing Zhang 85235780c7 Merge branch 'feat/2.6.0-beta4' of github.com:dataelement/bisheng into feat/2.6.0-beta4 2026-07-16 18:15:01 +08:00
GuoQing Zhang f6da266f4f fix(knowledge): widen file name length to 500 2026-07-16 18:11:05 +08:00
Kinyoo 2449931971 build(client): add rspress docs site for the component library
npm run dev:docs / build:docs serve the design specs + live component demos (@rspress/plugin-preview) with the app's vite aliases and style.css mirrored into the rspack config; stubs/url-stub.ts shims Node's url module for the browser bundle. doc_build/ output gitignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 18:10:34 +08:00
dolphin cbe8a05c2e fix(platform): make approval management page dark-theme aware
The page styled itself with class names that tailwind.config.js never
defined (text-text-primary, text-text-secondary, text-text-tertiary,
border-border-subtle, bg-background-primary). These emit no CSS, so text
colours came from inheritance and only happened to look right on light
backgrounds. Map them onto the tokens that do exist -- foreground,
muted-foreground, border, card, background -- and add dark variants to the
hardcoded gray/status colours.

Opacity modifiers on `white` are unusable here: tailwind.config.js
overrides white to var(--white), and Tailwind v3 cannot apply an alpha
channel to a CSS variable, so `bg-white/5` is dropped entirely. Use the
gray-50 scale for translucent dark overlays instead.
2026-07-16 17:58:22 +08:00
GuoQing Zhang eba8c735d3 Merge branch 'feat/2.6.0' of github.com:dataelement/bisheng into feat/2.6.0 2026-07-16 17:32:59 +08:00
GuoQing Zhang ac310e6ca5 fix(platform): show tenant admin candidates 2026-07-16 16:59:48 +08:00
GuoQing Zhang 8219f4dfee fix(client): show admin entry for tenant admins 2026-07-16 16:43:17 +08:00
Kinyoo 391d6496d6 chore: gitignore the CoAligne sync config too
The tool overwrites .coaligneignore with its own default template, so tracking it means the rewrite lands in everyone's tree — keep it per-developer alongside .coaligne/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 15:20:06 +08:00
Kinyoo f47dacfe61 chore: gitignore CoAligne local state
The .coaligne/ dir holds per-developer project bindings that the tool regenerates (it re-binds and rewrites them on its own), so it should never have been tracked — untrack the two committed state files and ignore the dir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 15:16:26 +08:00
Kinyoo bc71b7c522 chore(gallery): refresh section showcases for the re-derived green ramp
Update GalleryApp wiring and the Button/Color/ConfirmDialog/Feedback/Illustration/Modal/Responsive/Typography showcases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 15:04:11 +08:00
Kinyoo bd6b12fa5f fix(theme): re-derive the green brand ramp around the fixed #169C47 primary
The old .theme-green steps sat at hue ~157 (teal) while --brand-500 is 142, so the main color jumped out of its own ramp. Light steps keep the old saturation/brightness envelope with the hue rotated onto the 500 family (-2/step, mirroring the blue lights); dark steps mirror the blue ramp's dark-side HSV geometry. --brand-500/main unchanged; surface-active-alt re-synced to --brand-50. Values updated in BRAND-THEME-HANDOFF.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 15:04:11 +08:00
dolphin dc71b41b38 i18n(platform): shorten en-US tenant.management label to "Tenant" 2026-07-15 21:26:30 +08:00
dolphin b83a3b62bc fix(platform): stop bench save buttons being clipped under license banner
The bench 首页/订阅/应用中心 tabs anchor their bottom save buttons with
absolute bottom-1 on CardContent, whose height is tuned via a 100vh-180px
magic constant that assumes no CardContent bottom padding. These tabs kept
CardContent's default p-5 (20px bottom padding) while the working 知识空间
tab uses p-0, so their content ran 20px taller. With slack that overshoot
was absorbed, but when the license-expiry banner appears it consumes the
slack and the buttons spill below the viewport, half-clipped. Add pb-0 to
match the 知识空间 tab.
2026-07-15 21:06:24 +08:00
GuoQing Zhang ab6b54c155 Merge branch 'feat/2.6.0' of github.com:dataelement/bisheng into feat/2.6.0 2026-07-15 20:34:07 +08:00
GuoQing Zhang e4a424758b fix(platform): prevent dismissing duplicate file dialog 2026-07-15 20:33:45 +08:00
LineWalker 559568b4b1 feat(linsight): declare available libraries in code-interpreter description
The code-interpreter tool description said nothing about which Python packages
are available, so the model guessed — reaching for pdfminer.six to read PDFs (a
common default) which is NOT installed in the backend env, producing spurious
"No module named 'pdfminer'" output (it fell back to fitz, but the noise leaked
into the run).

Declare the actually-installed libraries (verified in the backend env: pandas,
numpy, matplotlib, openpyxl / XlsxWriter, python-docx, Pillow, reportlab, PyMuPDF)
and steer PDF reads to `fitz`, away from pdfminer / pdfplumber / PyPDF2. Also tell
the model not to `pip install` (shared, offline env). LocalExecutor only — e2b is
a different sandbox with a different image, not asserted here. Adds a
description-contract regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 17:58:13 +08:00
LineWalker eff01fd31a feat(linsight): declare available libraries in code-interpreter description
The code-interpreter tool description said nothing about which Python packages
are available, so the model guessed — reaching for pdfminer.six to read PDFs (a
common default) which is NOT installed in the backend env, producing spurious
"No module named 'pdfminer'" output (it fell back to fitz, but the noise leaked
into the run).

Declare the actually-installed libraries (verified in the backend env: pandas,
numpy, matplotlib, openpyxl / XlsxWriter, python-docx, Pillow, reportlab, PyMuPDF)
and steer PDF reads to `fitz`, away from pdfminer / pdfplumber / PyPDF2. Also tell
the model not to `pip install` (shared, offline env). LocalExecutor only — e2b is
a different sandbox with a different image, not asserted here. Adds a
description-contract regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 17:58:09 +08:00
LineWalker fcf24b8ed9 fix(linsight): stop partial-result salvage from leaking raw tool output
On an L3/L4 abort (tool-loop breaker / recursion ceiling), the partial-result
salvage falls back to `_last_assistant_text`, produced by
`_extract_last_message_text`. That helper returned `messages[-1]` WITHOUT
checking the role, so when a run was cut off mid tool-loop the trailing message
— typically a raw `bisheng_code_interpreter` ToolMessage such as
`{"exitcode":0,"log":"\nError: No module named 'pdfminer'\n=== PDF文本内容(fitz…"}`
— was surfaced verbatim after the apology preamble as "已完成的分析内容".

Walk backward to the last AIMessage carrying text instead; skip Tool/Human/
System messages. When the model never produced any text, return None so the
caller degrades to a friendly failure rather than dumping tool JSON. Split out
`_is_assistant_message` / `_message_text` helpers and cover with unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 17:34:30 +08:00
LineWalker 658813cdbe fix(linsight): stop partial-result salvage from leaking raw tool output
On an L3/L4 abort (tool-loop breaker / recursion ceiling), the partial-result
salvage falls back to `_last_assistant_text`, produced by
`_extract_last_message_text`. That helper returned `messages[-1]` WITHOUT
checking the role, so when a run was cut off mid tool-loop the trailing message
— typically a raw `bisheng_code_interpreter` ToolMessage such as
`{"exitcode":0,"log":"\nError: No module named 'pdfminer'\n=== PDF文本内容(fitz…"}`
— was surfaced verbatim after the apology preamble as "已完成的分析内容".

Walk backward to the last AIMessage carrying text instead; skip Tool/Human/
System messages. When the model never produced any text, return None so the
caller degrades to a friendly failure rather than dumping tool JSON. Split out
`_is_assistant_message` / `_message_text` helpers and cover with unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 17:33:28 +08:00
LineWalker dc8c6dfed1 fix(linsight): resolve deliverable images & drop raw-HTML noise in md preview
The task-mode report md preview (PreviewBody → shared react-markdown) had two
independent rendering failures:

1. Relative image refs `![](charts/x.png)` never resolved — the renderer has no
   relative→absolute rewrite, so the browser resolved them against the SPA route
   and got the index.html fallback (200 text/html) → broken image. Fix: a custom
   async <img> renderer (MarkdownImage) resolves relative refs against the session
   file_list (matchArtifactByRelPath → file_url → resolveArtifactUrl presigned
   URL). Enabled only when a resolver is injected, so chat bubbles are unchanged.

2. Empty raw-HTML placeholder boxes (`<div style=...></div>` comment/figure
   scaffolding) leaked as literal text because rehype-raw is deliberately off
   (XSS guard). Fix: stripEmptyHtmlPlaceholders removes only *empty* paired block
   tags in the md preview (preview-only; stored .md is untouched so HTML/PDF
   derivation is unaffected).

Also nudge generation: the task-mode system prompt now tells the model to use
markdown image syntax and avoid raw HTML in the canonical md deliverable.

fileList is threaded through WorkspacePanel / FilePreviewPanel (via ExecutionFlow).
15 unit tests cover matching (path-suffix / basename / URL-encoded CN names) and
empty-box stripping. HTML (iframe srcDoc) preview has the same image gap — not
covered here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 16:16:26 +08:00
LineWalker 9376bee814 fix(linsight): resolve deliverable images & drop raw-HTML noise in md preview
The task-mode report md preview (PreviewBody → shared react-markdown) had two
independent rendering failures:

1. Relative image refs `![](charts/x.png)` never resolved — the renderer has no
   relative→absolute rewrite, so the browser resolved them against the SPA route
   and got the index.html fallback (200 text/html) → broken image. Fix: a custom
   async <img> renderer (MarkdownImage) resolves relative refs against the session
   file_list (matchArtifactByRelPath → file_url → resolveArtifactUrl presigned
   URL). Enabled only when a resolver is injected, so chat bubbles are unchanged.

2. Empty raw-HTML placeholder boxes (`<div style=...></div>` comment/figure
   scaffolding) leaked as literal text because rehype-raw is deliberately off
   (XSS guard). Fix: stripEmptyHtmlPlaceholders removes only *empty* paired block
   tags in the md preview (preview-only; stored .md is untouched so HTML/PDF
   derivation is unaffected).

Also nudge generation: the task-mode system prompt now tells the model to use
markdown image syntax and avoid raw HTML in the canonical md deliverable.

fileList is threaded through WorkspacePanel / FilePreviewPanel (via ExecutionFlow).
15 unit tests cover matching (path-suffix / basename / URL-encoded CN names) and
empty-box stripping. HTML (iframe srcDoc) preview has the same image gap — not
covered here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 16:15:50 +08:00
Kinyoo 19eb33d6ba chore(gallery): fold scrollbar into color section + refresh progress tracker
Remove the standalone ScrollbarSection (scrollbar guidance folded elsewhere), update GalleryApp wiring, and refresh Color/Button/ConfirmDialog/Modal/Overview/Responsive/Typography showcases + ColorProgress/ProgressOverview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 15:31:18 +08:00
Kinyoo 78abdc4307 style(client): normalize empty-state illustration usage across pages
Drop the now-redundant opacity-90 on EmptyStateIllustration (the grey/mid-tone was darkened at the source, so the dimming hack is no longer needed) and normalize sizing to size-[120px] mb-4 across channel/subscription/knowledge/apps empty states.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 15:31:18 +08:00
GuoQing Zhang 1bf2a11981 Merge branch 'feat/2.6.0' of github.com:dataelement/bisheng into feat/2.6.0 2026-07-15 15:28:30 +08:00
GuoQing Zhang 055718be15 refactor: simplify reconciliation celery tasks 2026-07-15 14:56:23 +08:00
LineWalker 18748b23c0 fix(linsight): keep code-interpreter deliverables inside the harvested output dir
Task-mode results claimed a deliverable (e.g. a generated PDF) that never
appeared in the workspace panel. Root cause: the model wrote the file to an
ABSOLUTE path (/output/report.pdf, /scratch/*.png) which resolves to the
container filesystem root -- outside the per-task working dir the LocalExecutor
harvests. The file was never uploaded (file_list=[]) nor synced, so
get_final_result_file found no deliverable and the panel fell back to a
synthesized fallback report. The shared LocalExecutor cannot safely rescue
container-root files (cross-task leak), so the fix steers the model to relative
paths:

- Harden the code-interpreter tool description (local + e2b) to require the
  RELATIVE output/ (scratch/) dir and forbid absolute /output|/scratch, noting
  files outside the working dir are discarded.
- Add a deterministic, non-blocking corrective notice: when a run's code wrote
  to an absolute /output|/scratch path, append a system notice to the tool
  result so the model self-corrects on the next step
  (BaseExecutor.absolute_path_advisory + wiring in LocalExecutor.run).
- Tests: test/linsight/test_code_interpreter_output_path.py (18 cases).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 14:52:00 +08:00
LineWalker ac01a94d18 fix(linsight): keep code-interpreter deliverables inside the harvested output dir
Task-mode results claimed a deliverable (e.g. a generated PDF) that never
appeared in the workspace panel. Root cause: the model wrote the file to an
ABSOLUTE path (/output/report.pdf, /scratch/*.png) which resolves to the
container filesystem root -- outside the per-task working dir the LocalExecutor
harvests. The file was never uploaded (file_list=[]) nor synced, so
get_final_result_file found no deliverable and the panel fell back to a
synthesized fallback report. The shared LocalExecutor cannot safely rescue
container-root files (cross-task leak), so the fix steers the model to relative
paths:

- Harden the code-interpreter tool description (local + e2b) to require the
  RELATIVE output/ (scratch/) dir and forbid absolute /output|/scratch, noting
  files outside the working dir are discarded.
- Add a deterministic, non-blocking corrective notice: when a run's code wrote
  to an absolute /output|/scratch path, append a system notice to the tool
  result so the model self-corrects on the next step
  (BaseExecutor.absolute_path_advisory + wiring in LocalExecutor.run).
- Tests: test/linsight/test_code_interpreter_output_path.py (18 cases).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 14:51:43 +08:00
Kinyoo 64c6568954 chore(gallery): wire up color/scrollbar/illustration sections + progress tracker
DEV-only gallery: register the new Color/Scrollbar/Illustration sections in GalleryApp, add a progress/ tracker (per-component migration status), and refresh the Button/ConfirmDialog/Modal/Overview/Responsive/Typography showcases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 14:42:58 +08:00
Kinyoo c7dc47ee5d fix(client): darken grey-mode illustration mid-tone so halos don't wash out on white
illus-grey --illus-300 #FFFFFF→#E5E5E5 (grey mode only; green/blue keep the mid tone) — pure white made e.g. the CrawlingIllustration magnifier halo disappear on white backgrounds. New gallery IllustrationSection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 14:42:58 +08:00
Kinyoo 2fb731ecbd refactor(client): scrollbars follow the OS setting (drop global forced-slim bar)
Per 基础-滚动条规范.md: remove the global :not(.scrollbar-os) forced-slim ::-webkit-scrollbar rule plus the .excel-scroll / .scrollbar-transparent overrides so OS auto-hide/always-on is respected; drop the now-dead excel-scroll class from ExcelPreview. New gallery ScrollbarSection. The .scrollbar-os opt-out is now a no-op, cleaned up as files get touched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 14:42:58 +08:00
Kinyoo 911f384346 feat(client): add Arco semantic color tokens (text/fill/border/functional)
Two-layer color tokens per 基础-色彩规范.md: primitive --arco-gray-1..10 + semantic --text-1..4 / --fill-1..4 / --border-base|-deep / --success|warning|danger(+hover/active/tint) in style.css, wired to Tailwind (text-1.. / fill-1.. / border-base / bg-success ...). Functional colors are theme-independent. New gallery ColorSection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 14:42:58 +08:00
GuoQing Zhang 7c04e52d2c fix(permission): avoid oversized grant user query 2026-07-15 14:35:44 +08:00
GuoQing Zhang 1ba990b2d0 Merge branch 'feat/2.6.0' of github.com:dataelement/bisheng into feat/2.6.0 2026-07-15 13:44:19 +08:00