Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
6a91399b
Commit
6a91399b
authored
Sep 03, 2026
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: Agent打包优化
parent
9694c3fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
Project.cs
Ftt.PatchPack/Project.cs
+24
-13
No files found.
Ftt.PatchPack/Project.cs
View file @
6a91399b
...
...
@@ -196,22 +196,33 @@ namespace Ftt.PatchPack
#
endregion
#
region
内置方言
/
行业知识(
Agent
/
dialect
、
Agent
/
industry
,随程序发布)
// 轻量智能体内置知识:产品排查方言(dialect)+ 行业知识(industry),只读、随程序发布。
// 新增/修改的内置知识进入增量补丁,解包到客户端 {ExeName}\Agent\ 下(时间窗同 XML,默认 30 天)。
var
dialectPath
=
Path
.
Combine
(
AbsoluteRootDirectory
,
RelativeAppFilePath
,
"Agent"
,
"dialect"
);
if
(
System
.
IO
.
Directory
.
Exists
(
dialectPath
))
#
region
内置智能体运行目录(
Agent
\,智能助手启动关键,随程序发布)
// 智能助手整体随程序发布:宿主 Tools.Agent.Host.exe、主库 Tools.Agent.dll、第三方依赖(根层/x64/x86)、
// 提示词 prompts、内置知识 dialect/industry 等,解包到客户端 {ExeName}\Agent\ 下(与启动路径一致)。
// 排除本机数据目录:config\(含本机 DPAPI 密钥的 AgentConfig.json)与 history\(运行期会话历史),及其子项。
// 时间窗:exe/dll/pdb/config 等程序文件同 Dll(默认 2 天);md/json/xml 等数据文件同 Xml(默认 30 天)。
var
agentPath
=
Path
.
Combine
(
AbsoluteRootDirectory
,
RelativeAppFilePath
,
"Agent"
);
if
(
System
.
IO
.
Directory
.
Exists
(
agentPath
))
{
valid
.
AddRange
(
GetValidPatchFile
(
dialectPath
,
"*.*"
,
SearchOption
.
AllDirectories
,
dialectPath
,
$"
{
ExeName
}
\\Agent\\dialect"
,
PatchTimeFrame_Xml
));
}
var
programFiles
=
new
List
<
string
>();
var
dataFiles
=
new
List
<
string
>();
foreach
(
var
file
in
Directory
.
GetFiles
(
agentPath
,
"*.*"
,
SearchOption
.
AllDirectories
))
{
var
relativePath
=
file
.
Substring
(
agentPath
.
Length
).
TrimStart
(
'\\'
);
if
(
relativePath
.
StartsWith
(
"config\\"
,
StringComparison
.
OrdinalIgnoreCase
))
continue
;
// 本机密钥等,不随包分发
if
(
relativePath
.
StartsWith
(
"history\\"
,
StringComparison
.
OrdinalIgnoreCase
))
continue
;
// 运行期会话历史,不随包分发
var
industryPath
=
Path
.
Combine
(
AbsoluteRootDirectory
,
RelativeAppFilePath
,
"Agent"
,
"industry"
);
if
(
System
.
IO
.
Directory
.
Exists
(
industryPath
))
{
valid
.
AddRange
(
GetValidPatchFile
(
industryPath
,
"*.*"
,
SearchOption
.
AllDirectories
,
industryPath
,
$"
{
ExeName
}
\\Agent\\industry"
,
PatchTimeFrame_Xml
));
}
var
extension
=
Path
.
GetExtension
(
file
).
ToLowerInvariant
();
if
(
extension
==
".exe"
||
extension
==
".dll"
||
extension
==
".pdb"
||
extension
==
".config"
)
programFiles
.
Add
(
file
);
else
dataFiles
.
Add
(
file
);
}
valid
.
AddRange
(
GetValidPatchFile
(
programFiles
.
ToArray
(),
agentPath
,
$"
{
ExeName
}
\\Agent"
,
PatchTimeFrame_Dll
));
valid
.
AddRange
(
GetValidPatchFile
(
dataFiles
.
ToArray
(),
agentPath
,
$"
{
ExeName
}
\\Agent"
,
PatchTimeFrame_Xml
));
}
#
endregion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment