plugin-git-manager 1.2.26 → 1.2.28
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/README.md +133 -108
- package/client-v2.d.ts +2 -2
- package/client-v2.js +1 -1
- package/client.d.ts +3 -3
- package/client.js +1 -1
- package/dist/client/{326.90c276058682b536.js → 313.d38fc1d40c4589b9.js} +1 -1
- package/dist/client/900.a48beac7e2ebee7d.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/156.445366026c1cc9a8.js +10 -0
- package/dist/client-v2/{326.42b7b53651ffab3a.js → 313.3c867179c3a1e817.js} +1 -1
- package/dist/client-v2/434.19c7579c06b9077c.js +10 -0
- package/dist/client-v2/900.e6155002a9c97e7f.js +10 -0
- package/dist/client-v2/928.bba701b5a1ece58e.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +9 -8
- package/dist/locale/en-US.json +307 -297
- package/dist/locale/vi-VN.json +295 -292
- package/dist/locale/zh-CN.json +61 -51
- package/dist/node_modules/simple-git/dist/cjs/index.js +25 -25
- package/dist/node_modules/simple-git/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/actions/git-actions.js +90 -36
- package/dist/server/actions/gitlab-api.js +4 -2
- package/dist/server/actions/poller.js +5 -2
- package/dist/server/actions/review.js +20 -10
- package/dist/server/plugin.js +6 -4
- package/dist/server/poller.js +46 -45
- package/dist/server/request-method-policy.js +75 -0
- package/dist/server/services/registry-content-service.js +23 -10
- package/dist/server/utils/get-repo-account.js +3 -2
- package/dist/server/utils/url-security.js +24 -0
- package/package.json +61 -43
- package/server.d.ts +2 -2
- package/server.js +1 -1
- package/src/client/__tests__/RunReviewButton.test.tsx +73 -0
- package/src/client/ai-context.tsx +114 -114
- package/src/client/components/AIEmployeeSelect.tsx +63 -63
- package/src/client/components/CommitHistory.tsx +374 -374
- package/src/client/components/FileExplorer.tsx +386 -386
- package/src/client/components/GitAccounts.tsx +179 -179
- package/src/client/components/GitManagerSettings.tsx +160 -160
- package/src/client/components/GitOperations.tsx +220 -220
- package/src/client/components/LLMModelSelect.tsx +63 -63
- package/src/client/components/LLMServiceSelect.tsx +58 -58
- package/src/client/components/MarkdownView.tsx +80 -80
- package/src/client/components/MergeRequests.tsx +790 -790
- package/src/client/components/PollingStatus.tsx +225 -225
- package/src/client/components/RepositoryConfig.tsx +335 -335
- package/src/client/components/RepositoryPermissions.tsx +123 -123
- package/src/client/components/ReviewFlows.tsx +303 -303
- package/src/client/components/ReviewHistory.tsx +566 -566
- package/src/client/components/RunReviewButton.tsx +63 -55
- package/src/client/context/GitManagerContext.tsx +92 -92
- package/src/client/index.tsx +91 -82
- package/src/client/locale.ts +9 -9
- package/src/client/promptTemplates.ts +31 -31
- package/src/client-v2/ai-context.tsx +99 -0
- package/src/client-v2/components/SubtreeSplits.tsx +547 -547
- package/src/client-v2/index.tsx +1 -1
- package/src/client-v2/locale.ts +8 -8
- package/src/client-v2/plugin.tsx +67 -39
- package/src/index.ts +2 -2
- package/src/locale/en-US.json +307 -297
- package/src/locale/vi-VN.json +295 -292
- package/src/locale/zh-CN.json +61 -51
- package/src/server/__tests__/git-actions.test.ts +24 -24
- package/src/server/__tests__/git-security.test.ts +170 -0
- package/src/server/__tests__/plugin-url-security.test.ts +17 -17
- package/src/server/__tests__/poller-lifecycle.test.ts +71 -0
- package/src/server/__tests__/poller.test.ts +37 -37
- package/src/server/__tests__/repository-access.test.ts +752 -752
- package/src/server/__tests__/review.test.ts +137 -137
- package/src/server/__tests__/role-permissions.test.ts +147 -147
- package/src/server/__tests__/smoke.test.ts +139 -17
- package/src/server/__tests__/subtree.test.ts +85 -85
- package/src/server/actions/git-actions.ts +540 -480
- package/src/server/actions/gitlab-api.ts +422 -411
- package/src/server/actions/poller.ts +39 -27
- package/src/server/actions/review.ts +1388 -1369
- package/src/server/actions/role-permissions.ts +321 -321
- package/src/server/actions/subtree.ts +508 -508
- package/src/server/ai-tools.ts +319 -319
- package/src/server/collections/gitAccounts.ts +56 -56
- package/src/server/collections/gitCodeReviews.ts +199 -199
- package/src/server/collections/gitRepositories.ts +87 -87
- package/src/server/collections/gitReviewFlows.ts +108 -108
- package/src/server/collections/gitSubtreeConfigs.ts +38 -38
- package/src/server/collections/gitSubtreeRuns.ts +30 -30
- package/src/server/index.ts +2 -2
- package/src/server/migrations/20260508000000-add-auto-review-flow-id.ts +29 -29
- package/src/server/migrations/20260712000000-add-git-accounts.ts +198 -198
- package/src/server/migrations/20260730000000-migrate-legacy-repository-permissions.ts +81 -81
- package/src/server/plugin.ts +372 -361
- package/src/server/poller.ts +351 -352
- package/src/server/repository-access.ts +773 -773
- package/src/server/request-method-policy.ts +55 -0
- package/src/server/services/__tests__/registry-content-service.test.ts +359 -345
- package/src/server/services/registry-content-service.ts +33 -11
- package/src/server/utils/__tests__/redact.test.ts +56 -56
- package/src/server/utils/__tests__/url-security.test.ts +85 -85
- package/src/server/utils/get-repo-account.ts +51 -41
- package/src/server/utils/gitlab-url.ts +38 -38
- package/src/server/utils/redact.ts +87 -87
- package/src/server/utils/url-security.ts +128 -95
- package/dist/client/900.acf7d1fa22f95e71.js +0 -10
- package/dist/client-v2/434.7a27051db18526c0.js +0 -10
- package/dist/client-v2/900.f32b9dc85249fc0a.js +0 -10
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
import { useApp } from '@nocobase/client-v2';
|
|
4
|
-
|
|
5
|
-
interface LLMServiceOption {
|
|
6
|
-
llmService: string;
|
|
7
|
-
llmServiceTitle: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const LLMServiceSelect: React.FC<{
|
|
11
|
-
value?: string;
|
|
12
|
-
onChange?: (value: string) => void;
|
|
13
|
-
allowClear?: boolean;
|
|
14
|
-
size?: 'small' | 'middle' | 'large';
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
}> = ({ value, onChange, allowClear = true, size, style, placeholder }) => {
|
|
18
|
-
const api = useApp().apiClient;
|
|
19
|
-
const [services, setServices] = useState<LLMServiceOption[]>([]);
|
|
20
|
-
const [loading, setLoading] = useState(false);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
let cancelled = false;
|
|
24
|
-
setLoading(true);
|
|
25
|
-
api
|
|
26
|
-
.request({ url: 'ai:listAllEnabledModels' })
|
|
27
|
-
.then((res) => {
|
|
28
|
-
if (cancelled) return;
|
|
29
|
-
const list = res?.data?.data || [];
|
|
30
|
-
setServices(Array.isArray(list) ? list : []);
|
|
31
|
-
})
|
|
32
|
-
.catch(() => undefined)
|
|
33
|
-
.finally(() => {
|
|
34
|
-
if (!cancelled) setLoading(false);
|
|
35
|
-
});
|
|
36
|
-
return () => {
|
|
37
|
-
cancelled = true;
|
|
38
|
-
};
|
|
39
|
-
}, [api]);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Select
|
|
43
|
-
value={value}
|
|
44
|
-
onChange={onChange}
|
|
45
|
-
allowClear={allowClear}
|
|
46
|
-
loading={loading}
|
|
47
|
-
size={size}
|
|
48
|
-
style={style}
|
|
49
|
-
placeholder={placeholder || 'Select LLM Service'}
|
|
50
|
-
options={services.map((s) => ({
|
|
51
|
-
value: s.llmService,
|
|
52
|
-
label: s.llmServiceTitle || s.llmService,
|
|
53
|
-
}))}
|
|
54
|
-
showSearch
|
|
55
|
-
optionFilterProp="label"
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Select } from 'antd';
|
|
3
|
+
import { useApp } from '@nocobase/client-v2';
|
|
4
|
+
|
|
5
|
+
interface LLMServiceOption {
|
|
6
|
+
llmService: string;
|
|
7
|
+
llmServiceTitle: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const LLMServiceSelect: React.FC<{
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
size?: 'small' | 'middle' | 'large';
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
}> = ({ value, onChange, allowClear = true, size, style, placeholder }) => {
|
|
18
|
+
const api = useApp().apiClient;
|
|
19
|
+
const [services, setServices] = useState<LLMServiceOption[]>([]);
|
|
20
|
+
const [loading, setLoading] = useState(false);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
let cancelled = false;
|
|
24
|
+
setLoading(true);
|
|
25
|
+
api
|
|
26
|
+
.request({ url: 'ai:listAllEnabledModels' })
|
|
27
|
+
.then((res) => {
|
|
28
|
+
if (cancelled) return;
|
|
29
|
+
const list = res?.data?.data || [];
|
|
30
|
+
setServices(Array.isArray(list) ? list : []);
|
|
31
|
+
})
|
|
32
|
+
.catch(() => undefined)
|
|
33
|
+
.finally(() => {
|
|
34
|
+
if (!cancelled) setLoading(false);
|
|
35
|
+
});
|
|
36
|
+
return () => {
|
|
37
|
+
cancelled = true;
|
|
38
|
+
};
|
|
39
|
+
}, [api]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Select
|
|
43
|
+
value={value}
|
|
44
|
+
onChange={onChange}
|
|
45
|
+
allowClear={allowClear}
|
|
46
|
+
loading={loading}
|
|
47
|
+
size={size}
|
|
48
|
+
style={style}
|
|
49
|
+
placeholder={placeholder || 'Select LLM Service'}
|
|
50
|
+
options={services.map((s) => ({
|
|
51
|
+
value: s.llmService,
|
|
52
|
+
label: s.llmServiceTitle || s.llmService,
|
|
53
|
+
}))}
|
|
54
|
+
showSearch
|
|
55
|
+
optionFilterProp="label"
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactMarkdown from 'react-markdown';
|
|
3
|
-
import { theme } from 'antd';
|
|
4
|
-
|
|
5
|
-
const { useToken } = theme;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Lightweight markdown renderer used for displaying review reports.
|
|
9
|
-
* We avoid the full plugin-field-markdown-vditor `Display` component because
|
|
10
|
-
* it is tightly coupled to formily field context.
|
|
11
|
-
*/
|
|
12
|
-
export const MarkdownView: React.FC<{ content?: string; maxHeight?: number | string }> = ({ content, maxHeight }) => {
|
|
13
|
-
const { token } = useToken();
|
|
14
|
-
if (!content) return null;
|
|
15
|
-
return (
|
|
16
|
-
<div
|
|
17
|
-
style={{
|
|
18
|
-
fontSize: 13,
|
|
19
|
-
lineHeight: 1.65,
|
|
20
|
-
color: token.colorText,
|
|
21
|
-
maxHeight,
|
|
22
|
-
overflow: maxHeight ? 'auto' : undefined,
|
|
23
|
-
}}
|
|
24
|
-
>
|
|
25
|
-
<ReactMarkdown
|
|
26
|
-
components={{
|
|
27
|
-
code({ inline, children, ...props }: any) {
|
|
28
|
-
const text = String(children).replace(/\n$/, '');
|
|
29
|
-
if (inline) {
|
|
30
|
-
return (
|
|
31
|
-
<code
|
|
32
|
-
{...props}
|
|
33
|
-
style={{
|
|
34
|
-
background: token.colorBgLayout,
|
|
35
|
-
padding: '1px 6px',
|
|
36
|
-
borderRadius: 4,
|
|
37
|
-
fontSize: 12,
|
|
38
|
-
fontFamily: "'JetBrains Mono', 'Fira Code', Consolas, monospace",
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
{text}
|
|
42
|
-
</code>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
return (
|
|
46
|
-
<pre
|
|
47
|
-
style={{
|
|
48
|
-
background: token.colorBgLayout,
|
|
49
|
-
padding: '10px 14px',
|
|
50
|
-
borderRadius: 6,
|
|
51
|
-
overflowX: 'auto',
|
|
52
|
-
fontSize: 12,
|
|
53
|
-
fontFamily: "'JetBrains Mono', 'Fira Code', Consolas, monospace",
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<code>{text}</code>
|
|
57
|
-
</pre>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
blockquote({ children }) {
|
|
61
|
-
return (
|
|
62
|
-
<blockquote
|
|
63
|
-
style={{
|
|
64
|
-
borderLeft: `3px solid ${token.colorBorder}`,
|
|
65
|
-
paddingLeft: 12,
|
|
66
|
-
color: token.colorTextSecondary,
|
|
67
|
-
margin: '8px 0',
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{children}
|
|
71
|
-
</blockquote>
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
76
|
-
{content}
|
|
77
|
-
</ReactMarkdown>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactMarkdown from 'react-markdown';
|
|
3
|
+
import { theme } from 'antd';
|
|
4
|
+
|
|
5
|
+
const { useToken } = theme;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lightweight markdown renderer used for displaying review reports.
|
|
9
|
+
* We avoid the full plugin-field-markdown-vditor `Display` component because
|
|
10
|
+
* it is tightly coupled to formily field context.
|
|
11
|
+
*/
|
|
12
|
+
export const MarkdownView: React.FC<{ content?: string; maxHeight?: number | string }> = ({ content, maxHeight }) => {
|
|
13
|
+
const { token } = useToken();
|
|
14
|
+
if (!content) return null;
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
style={{
|
|
18
|
+
fontSize: 13,
|
|
19
|
+
lineHeight: 1.65,
|
|
20
|
+
color: token.colorText,
|
|
21
|
+
maxHeight,
|
|
22
|
+
overflow: maxHeight ? 'auto' : undefined,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<ReactMarkdown
|
|
26
|
+
components={{
|
|
27
|
+
code({ inline, children, ...props }: any) {
|
|
28
|
+
const text = String(children).replace(/\n$/, '');
|
|
29
|
+
if (inline) {
|
|
30
|
+
return (
|
|
31
|
+
<code
|
|
32
|
+
{...props}
|
|
33
|
+
style={{
|
|
34
|
+
background: token.colorBgLayout,
|
|
35
|
+
padding: '1px 6px',
|
|
36
|
+
borderRadius: 4,
|
|
37
|
+
fontSize: 12,
|
|
38
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', Consolas, monospace",
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{text}
|
|
42
|
+
</code>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return (
|
|
46
|
+
<pre
|
|
47
|
+
style={{
|
|
48
|
+
background: token.colorBgLayout,
|
|
49
|
+
padding: '10px 14px',
|
|
50
|
+
borderRadius: 6,
|
|
51
|
+
overflowX: 'auto',
|
|
52
|
+
fontSize: 12,
|
|
53
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', Consolas, monospace",
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<code>{text}</code>
|
|
57
|
+
</pre>
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
blockquote({ children }) {
|
|
61
|
+
return (
|
|
62
|
+
<blockquote
|
|
63
|
+
style={{
|
|
64
|
+
borderLeft: `3px solid ${token.colorBorder}`,
|
|
65
|
+
paddingLeft: 12,
|
|
66
|
+
color: token.colorTextSecondary,
|
|
67
|
+
margin: '8px 0',
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</blockquote>
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
{content}
|
|
77
|
+
</ReactMarkdown>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
};
|