Skip to content

Commit

Permalink
Refactor: chat (#60)
Browse files Browse the repository at this point in the history
* refactor(ui): magent web packages

* chore: remove unused files

* chore: lock file

* chore(api): remove requirements.txt

* chore: pnpm version

* chore: config update

* feat(core): utils

* feat(core): prioritized contribution

* feat(core): auto factory

* fix(ui): upload with base url

* feat(core): auto factory

* chore(ui): 🔥 remove code

* feat(chat): new protocol

* refactor(core): auto-factory

* refactor(core): chat base & chat view

* feat(chat): magent chat

* chore(ui): magent-ui 0.1.17.dev0

* feat(au): add magent-au

* refactor(flow): remove path alias

* fix(ui): typo

* refactor(au): au package

* feat(docs): au agents

* feat(docs): rag chat

* feat(libro): add libro chat demo

* chore: autoupdate

* fix(core): axios config

* chore: ci

* chore: changeset

* fix(ci): using node v20 & python 3.19

* fix: typo

* fix(chat): chat message item
  • Loading branch information
BroKun authored Oct 22, 2024
1 parent 101151c commit 764e1e8
Show file tree
Hide file tree
Showing 352 changed files with 14,565 additions and 964 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "difizen/libro" }],
"commit": false,
"fixed": [],
"linked": [["@difizen/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
12 changes: 12 additions & 0 deletions .changeset/seven-chicken-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@difizen/magent-libro': patch
'@difizen/magent-chat': patch
'@difizen/magent-core': patch
'@difizen/magent-flow': patch
'@difizen/magent-au': patch
'@difizen/magent-platform': patch
'@difizen/magent-ui': patch
'@difizen/magent-docs': patch
---

First release
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {

// stricter type correctness
'no-unused-vars': [
'warn',
'error',
{
vars: 'local',
args: 'none',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ['16']
python-version: ['3.8']
node-version: ['20']
python-version: ['3.10']
145 changes: 117 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@ on:
branches: ['main']

jobs:
# changesets:
# # prevents this action from running on forks
# if: github.repository == 'difizen/magent'
changesets:
# prevents this action from running on forks
if: github.repository == 'difizen/magent'
name: Changesets
uses: difizen/actions/.github/workflows/release-changesets.yml@main
secrets:
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}

# name: Changesets
# uses: difizen/actions/.github/workflows/release-changesets.yml@main
# secrets:
# BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
# BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}

# permissions:
# pull-requests: write
# contents: write
permissions:
pull-requests: write
contents: write

ci:
# needs: [changesets]
# if: |
# needs.changesets.outputs.should-release == 'true'
needs: [changesets]
if: |
needs.changesets.outputs.should-release == 'true'
name: Prerelease CI
uses: ./.github/workflows/ci.yml
Expand All @@ -32,20 +31,110 @@ jobs:
contents: read
actions: read

# publish:
# needs: [ci]
# if: |
# needs.ci.result == 'success'
publish:
needs: [ci]
if: |
needs.ci.result == 'success'
name: Publish
uses: difizen/actions/.github/workflows/release-publish.yml@main

with:
node-version: '20'
python-version: '3.10'

permissions:
contents: write

secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# 新增的 release-notes Job
release-notes:
needs: [publish]
if: |
needs.publish.result == 'success'
name: Generate Release Notes
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up git
run: |
git fetch --prune --unshallow
git fetch --tags
- name: Get latest tag
id: get_tag
run: |
# 获取最新的符合 @difizen/magent-xxx@ 格式的 tag
LATEST_TAG=$(git describe --tags --abbrev=0)
# 输出最新的 tag
echo "Latest tag: $LATEST_TAG"
# 提取版本号(移除最后一个 '@' 之前的部分)
VERSION=${LATEST_TAG##*@}
# 输出提取的版本号
echo "Extracted version: $VERSION"
# 将版本号设置为输出变量供后续步骤使用
echo "::set-output name=latest_version::$VERSION"
- name: Check if tag exists
id: check_tag
run: |
TAG_EXISTS=$(git tag -l "${{ steps.get_tag.outputs.latest_version }}")
if [ -z "$TAG_EXISTS" ]; then
echo "Tag does not exist"
echo "::set-output name=tag_exists::false"
else
echo "Tag already exists"
echo "::set-output name=tag_exists::true"
fi
- name: Install dependencies
if: steps.check_tag.outputs.tag_exists == 'false'
run: npm install

# name: Publish
# uses: difizen/actions/.github/workflows/release-publish.yml@main
- name: Extract Changeset Content
if: steps.check_tag.outputs.tag_exists == 'false'
id: extract_changesets
run: |
COMMIT_CONTENT=""
for file in .changeset/*.md; do
echo "Processing $file"
CONTENT=$(awk '/^---$/{p++} p==2' "$file")
COMMIT_CONTENT+="$CONTENT"$'\n'
done
echo "::set-output name=release_notes::$COMMIT_CONTENT"
# with:
# node-version: '18'
# python-version: '3.8'
- name: Generate Snapshot
if: steps.check_tag.outputs.tag_exists == 'false'
id: generate_snapshot
run: |
# 获取 changeset 的快照
SNAPSHOT=$(npx changeset status --snapshot)
echo "::set-output name=snapshot::$SNAPSHOT"
# permissions:
# contents: write
- name: Generate GitHub Release
if: steps.check_tag.outputs.tag_exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.latest_version }} # 使用最近的 tag 作为 tag 名
release_name: Release ${{ steps.get_tag.outputs.latest_version }} # 使用最近的 tag 作为 release 名
body: |
## Changes:
${{ steps.extract_changesets.outputs.release_notes }}
# secrets:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
## Packages affected:
${{ steps.generate_snapshot.outputs.snapshot }}
draft: false # 直接发布而非草稿
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# libro-server
# magent-platform
105 changes: 0 additions & 105 deletions api/requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions docs/site/.dumi/theme/componets/banner/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,6 @@
border: none;
}

.feature-title,
.feature-title-libro {
font-size: 1.875rem;
color: #27272e;
font-weight: 600;
text-align: center;
}

.feature-title-libro {
margin-top: 28px;
}

.user-item {
display: flex;
align-items: center;
Expand Down
4 changes: 4 additions & 0 deletions docs/site/.dumi/theme/layouts/DocLayout.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
text-decoration: none;
}

svg {
display: inline;
}

main {
.dumi-default-content {
min-height: calc(100vh - 61px);
Expand Down
2 changes: 1 addition & 1 deletion docs/site/.dumi/theme/slots/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Header: React.FC = () => {
type="link"
target="_blank"
rel="noreferrer"
href="https://github.com/difizen/mana"
href={`https://github.com/${gitRepo.owner}/${gitRepo.name}`}
className="difizen-dumi-header-right-github-btn"
icon={<GithubOutlined />}
>
Expand Down
4 changes: 3 additions & 1 deletion docs/site/.dumi/theme/tailwind.out.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
iframe,
embed,
object {
display: block;
/* display: block; */

/* 1 */
vertical-align: middle;
Expand Down Expand Up @@ -1367,3 +1367,5 @@ body {
line-height: 1;
}
}


Loading

0 comments on commit 764e1e8

Please sign in to comment.