@aiking/bridge-jtg5120 0.0.0-stage → 0.1.0
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/LICENSE +24 -0
- package/NOTICE +31 -0
- package/README.md +37 -2
- package/cordis.patch.yml +4 -0
- package/docs/DETAIL.md +26 -0
- package/icon.svg +7 -0
- package/lib/body.json +1121 -0
- package/lib/data.js +155 -0
- package/lib/index.js +331 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +50 -4
- package/rules/jtg5120.md +120 -0
- package/test/j5120.test.mjs +78 -0
package/lib/data.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JTG 5120—2021《公路桥涵养护规范》数据表
|
|
3
|
+
*
|
|
4
|
+
* 只记判定规则与清单口径,不含条文原文。条文号与限值须以正式出版文本核对。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** 3.1.1 养护检查等级判定(返回等级与理由) */
|
|
8
|
+
export function inspectLevel(input = {}) {
|
|
9
|
+
const span = Number(input.maxSpan ?? 0);
|
|
10
|
+
const bridgeClass = input.bridgeClass || '';
|
|
11
|
+
const roadClass = String(input.roadClass || '');
|
|
12
|
+
const techGrade = Number(input.techGrade || 0);
|
|
13
|
+
const reasons = [];
|
|
14
|
+
let level = null;
|
|
15
|
+
|
|
16
|
+
if (input.specialImportant) { level = 'Ⅰ'; reasons.push('3.1.1-1:特别重要桥梁 → Ⅰ 级'); }
|
|
17
|
+
if (!level && bridgeClass === '特大桥' && span > 150) {
|
|
18
|
+
level = 'Ⅰ'; reasons.push('3.1.1-1:单孔跨径 >150m 的特大桥 → Ⅰ 级');
|
|
19
|
+
}
|
|
20
|
+
if (!level) {
|
|
21
|
+
if (bridgeClass === '特大桥') { level = 'Ⅱ'; reasons.push('3.1.1-2:单孔跨径 ≤150m 的特大桥 → Ⅱ 级'); }
|
|
22
|
+
else if (bridgeClass === '大桥') { level = 'Ⅱ'; reasons.push('3.1.1-2:大桥 → Ⅱ 级'); }
|
|
23
|
+
else if (['中桥', '小桥'].includes(bridgeClass) && ['高速', '一级', '二级'].includes(roadClass)) {
|
|
24
|
+
level = 'Ⅱ'; reasons.push(`3.1.1-2:${roadClass}公路上的${bridgeClass} → Ⅱ 级`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!level && ['中桥', '小桥'].includes(bridgeClass)) {
|
|
28
|
+
level = 'Ⅲ'; reasons.push(`3.1.1-3:${roadClass || '三、四级'}公路上的${bridgeClass} → Ⅲ 级`);
|
|
29
|
+
}
|
|
30
|
+
if (!level) { level = 'Ⅱ'; reasons.push('信息不足,按 3.1.1-2 兜底取 Ⅱ 级'); }
|
|
31
|
+
|
|
32
|
+
const raised = [];
|
|
33
|
+
const order = ['Ⅰ', 'Ⅱ', 'Ⅲ'];
|
|
34
|
+
if (techGrade === 3 && bridgeClass) {
|
|
35
|
+
const next = order[Math.max(order.indexOf(level) - 1, 0)];
|
|
36
|
+
raised.push(`3.1.1-4:技术状况 3 类,应由 ${level} 级提高到 ${next} 级`);
|
|
37
|
+
level = next;
|
|
38
|
+
}
|
|
39
|
+
if (techGrade === 4) {
|
|
40
|
+
raised.push(`3.1.1-5:技术状况 4 类,加固维修前应按 Ⅰ 级检查(原 ${level} 级)`);
|
|
41
|
+
level = 'Ⅰ';
|
|
42
|
+
}
|
|
43
|
+
return { level, reasons, raised, clause: '3.1.1' };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** 检查频率(3.2.1 / 3.3.1 / 3.4.1 / 3.5.1) */
|
|
47
|
+
export const FREQUENCY = {
|
|
48
|
+
'Ⅰ': { daily: '每天不应少于 1 次', routine: '每月不应少于 1 次', periodic: '周期不得超过 1 年' },
|
|
49
|
+
'Ⅱ': { daily: '每天不应少于 1 次', routine: '每两个月不应少于 1 次', periodic: '周期不得超过 3 年' },
|
|
50
|
+
'Ⅲ': { daily: '每周不应少于 1 次', routine: '每季度不应少于 1 次', periodic: '周期不得超过 3 年' },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export function frequencyFor(level) {
|
|
54
|
+
const key = String(level || '').trim();
|
|
55
|
+
const f = FREQUENCY[key];
|
|
56
|
+
if (!f) throw new Error(`养护检查等级须为 Ⅰ / Ⅱ / Ⅲ,收到「${level}」`);
|
|
57
|
+
return {
|
|
58
|
+
level: key,
|
|
59
|
+
daily: { text: f.daily, clause: '3.3.1' },
|
|
60
|
+
routine: { text: f.routine, clause: '3.4.1' },
|
|
61
|
+
periodic: { text: f.periodic, clause: '3.5.1' },
|
|
62
|
+
notes: [
|
|
63
|
+
'初始检查宜与交工验收同时进行,最迟不超过交付使用后 1 年(3.2.1)',
|
|
64
|
+
'支座经常检查每季度不应少于 1 次(3.4.1-6)',
|
|
65
|
+
'汛期、台风、冰冻等灾害频发期应提高经常检查频率(3.4.1-4)',
|
|
66
|
+
'定期检查中发现 4 类构件时,加固处治前应提高经常检查频率(3.4.1-5)',
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** 3.6.1 特殊检查触发条件(4 条) */
|
|
72
|
+
export const SPECIAL_TRIGGERS = [
|
|
73
|
+
'定期检查中难以判明构件损伤原因及程度',
|
|
74
|
+
'拟通过加固手段提高荷载等级',
|
|
75
|
+
'需要判明水中基础技术状况',
|
|
76
|
+
'遭受洪水、流冰、滑坡、地震、风灾、火灾、撞击,因超重车辆通过或其他异常情况影响造成损伤',
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
export function specialCheck(flags = {}) {
|
|
80
|
+
const keys = ['causeUnclear', 'plannedStrengthen', 'underwaterFoundation', 'disasterDamage'];
|
|
81
|
+
const hit = keys.filter((k) => flags[k]).map((k) => SPECIAL_TRIGGERS[keys.indexOf(k)]);
|
|
82
|
+
return { needed: hit.length > 0, triggers: hit, clause: '3.6.1', note: '特殊检查无固定周期,按触发条件执行。' };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** 表 3.8.2 技术状况 5 类 */
|
|
86
|
+
export const TECH_GRADES = {
|
|
87
|
+
1: { name: '完好、良好', brief: '主要部件功能与材料均良好;承载能力符合设计标准' },
|
|
88
|
+
2: { name: '较好', brief: '主要部件少量(≤3%)轻度缺损,裂缝未超设计限值' },
|
|
89
|
+
3: { name: '较差', brief: '主要部件较多(≤10%)中等缺损,裂缝超限;承载能力降低 ≤10%' },
|
|
90
|
+
4: { name: '差', brief: '主要部件大量(10%~20%)严重缺损、锈蚀严重;承载能力降低 10%~25%' },
|
|
91
|
+
5: { name: '危险', brief: '严重功能性病害并扩张;承载能力降低 >25%' },
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** 表 3.8.3 养护对策 */
|
|
95
|
+
export const MAINTENANCE = {
|
|
96
|
+
1: '正常保养或预防养护',
|
|
97
|
+
2: '修复养护、预防养护',
|
|
98
|
+
3: '修复养护、加固或更换较大缺陷构件;必要时可进行交通管制',
|
|
99
|
+
4: '修复养护、加固或改造;及时进行交通管制,必要时封闭交通',
|
|
100
|
+
5: '及时封闭交通,改建或重建',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** 3.5.2 定期检查的 5 项规定 */
|
|
104
|
+
export const PERIODIC_STEPS = [
|
|
105
|
+
{ no: 1, text: '现场校核桥梁基本数据,填写或补充完善"桥梁基本状况卡片"(附录 A)' },
|
|
106
|
+
{ no: 2, text: '现场填写"桥梁定期检查记录表"(附录 C),记录各部件缺损状况并绘制主要病害分布图' },
|
|
107
|
+
{ no: 3, text: '对桥梁永久观测点进行复核,对桥面高程及线形、变位等检测指标进行量测' },
|
|
108
|
+
{ no: 4, text: '判断病害原因及影响范围' },
|
|
109
|
+
{ no: 5, text: '进行技术状况评定,提出养护建议' },
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
/** 3.5.15 定期检查报告应包含的 6 项内容 */
|
|
113
|
+
export const REPORT_ITEMS = [
|
|
114
|
+
'桥梁基本状况卡片(附录 A)、定期检查记录表(附录 C)、技术状况评定表',
|
|
115
|
+
'典型缺损与病害的照片、文字说明及缺损分布图(部位、类型、性质、范围、数量、程度)',
|
|
116
|
+
'三张总体照片:桥面正面 1 张、桥梁两侧立面各 1 张',
|
|
117
|
+
'病害原因及影响范围判断,并与历次检查报告对比分析病害发展情况',
|
|
118
|
+
'桥梁技术状况评定等级',
|
|
119
|
+
'养护建议及下次检查时间',
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
/** 3.5.4~3.5.13 分部位定期检查条目(条款级索引;细目以条文为准) */
|
|
123
|
+
export const PART_CHECKS = [
|
|
124
|
+
{ no: '3.5.4', part: '桥面系', clauses: 6, focus: '铺装、伸缩缝、人行道、栏杆护栏、防排水系统、交通信号/标志/标线/照明' },
|
|
125
|
+
{ no: '3.5.5', part: '混凝土梁桥上部结构', clauses: 8, focus: '含混凝土碳化深度、钢筋锈蚀检测(第 5 款)' },
|
|
126
|
+
{ no: '3.5.6', part: '钢桥上部结构', clauses: 7, focus: '含钢-混凝土组合梁与混合梁专项(第 7 款)' },
|
|
127
|
+
{ no: '3.5.7', part: '拱桥上部结构', clauses: 11, focus: '含钢管混凝土拱管内密实度检测,频率宜 3~6 年 1 次(第 11 款)' },
|
|
128
|
+
{ no: '3.5.8', part: '斜拉桥上部结构及索塔', clauses: 7, focus: '斜拉索、索塔、锚固区' },
|
|
129
|
+
{ no: '3.5.9', part: '悬索桥主要构件', clauses: 10, focus: '主缆、吊索、索夹、索鞍、锚碇' },
|
|
130
|
+
{ no: '3.5.10', part: '支座', clauses: 14, focus: '位移、脱空、锈蚀、螺栓、防尘罩' },
|
|
131
|
+
{ no: '3.5.11', part: '桥梁墩台及基础', clauses: 7, focus: '裂缝、剥落、冲刷、不均匀沉降' },
|
|
132
|
+
{ no: '3.5.12', part: '附属设施', clauses: 8, focus: '照明、检修设施、防撞、标志' },
|
|
133
|
+
{ no: '3.5.13', part: '河床及调治构造物', clauses: 2, focus: '河床演变、调治构造物完好性' },
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
/** 表 3.5.3 永久观测点要求(单孔跨径 ≥60m 应设) */
|
|
137
|
+
export const PERMANENT_POINTS = [
|
|
138
|
+
{ item: '桥面高程', rule: '每孔不宜少于 10 点,沿行车道两边布设;跨中、L/4、支点必设', no: 1 },
|
|
139
|
+
{ item: '墩台身、锚碇变位', rule: '墩台身底部(距地面或常水位 0.5~2m)、桥台侧墙尾部顶面、锚碇上下游各 1~2 点', no: 2 },
|
|
140
|
+
{ item: '墩台身、索塔倾斜度', rule: '底部上下游两侧各 1~2 点', no: 3 },
|
|
141
|
+
{ item: '索塔变位', rule: '每塔不宜少于 2 点,塔顶、塔梁交接处各 1~2 点', no: 4 },
|
|
142
|
+
{ item: '主缆线形', rule: '每孔不宜少于 10 点,沿索夹布设;最低点与最高点必设', no: 5 },
|
|
143
|
+
{ item: '拱轴线', rule: '每孔不宜少于 18 点,拱顶、L/8、L/4、3L/8、拱脚布设', no: 6 },
|
|
144
|
+
{ item: '拱座变位', rule: '不宜少于 2 点,上下游两侧', no: 7 },
|
|
145
|
+
{ item: '悬索桥索夹滑移', rule: '桥塔侧第一对吊杆索夹处各 1 点', no: 8 },
|
|
146
|
+
{ item: '索鞍与主塔相对变位', rule: '索鞍处各 1 点', no: 9 },
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
/** 与耐久性相关的处置条款 */
|
|
150
|
+
export const DURABILITY_CLAUSES = [
|
|
151
|
+
{ clause: '4.1.5', text: '钢筋保护层无法满足规范要求或桥梁处于腐蚀环境时,宜增设防腐措施确保耐久性' },
|
|
152
|
+
{ clause: '3.8.5-4', text: '耐久性评定可采用外观耐久状态评定与剩余耐久年限评定相结合的方法' },
|
|
153
|
+
{ clause: '4.1.3', text: '检查评定发现承载能力、刚度或稳定性不足时,应按相关标准进行维修加固' },
|
|
154
|
+
{ clause: '3.8.6', text: '适应性不满足要求的桥梁,应采取提高承载力、加宽、加长、基础防护等改造措施' },
|
|
155
|
+
];
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @aiking/bridge-jtg5120 —— JTG 5120—2021《公路桥涵养护规范》插件
|
|
3
|
+
*
|
|
4
|
+
* 定位:养护决策侧的"查等级、定频率、列清单、给对策"。
|
|
5
|
+
* 不做:技术状况评分的计算(5120 的 3.8.1 指向 JTG/T H21,评分算法不在本插件内)。
|
|
6
|
+
*
|
|
7
|
+
* @module @aiking/bridge-jtg5120
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
14
|
+
import {
|
|
15
|
+
inspectLevel,
|
|
16
|
+
frequencyFor,
|
|
17
|
+
specialCheck,
|
|
18
|
+
TECH_GRADES,
|
|
19
|
+
MAINTENANCE,
|
|
20
|
+
PERIODIC_STEPS,
|
|
21
|
+
REPORT_ITEMS,
|
|
22
|
+
PART_CHECKS,
|
|
23
|
+
PERMANENT_POINTS,
|
|
24
|
+
DURABILITY_CLAUSES,
|
|
25
|
+
SPECIAL_TRIGGERS,
|
|
26
|
+
} from './data.js';
|
|
27
|
+
|
|
28
|
+
const name = 'bridge-jtg5120';
|
|
29
|
+
const inject = ['tools', 'systemPrompt', 'skills'];
|
|
30
|
+
|
|
31
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
|
|
33
|
+
function loadRules() {
|
|
34
|
+
try {
|
|
35
|
+
return readFileSync(join(HERE, '..', 'rules', 'jtg5120.md'), 'utf8');
|
|
36
|
+
} catch {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let BODY_CACHE = null;
|
|
42
|
+
function loadBody() {
|
|
43
|
+
if (BODY_CACHE) return BODY_CACHE;
|
|
44
|
+
try {
|
|
45
|
+
BODY_CACHE = JSON.parse(readFileSync(join(HERE, 'body.json'), 'utf8'));
|
|
46
|
+
} catch {
|
|
47
|
+
BODY_CACHE = { chapters: [] };
|
|
48
|
+
}
|
|
49
|
+
return BODY_CACHE;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function apply(ctx) {
|
|
53
|
+
ctx.effect(function* () {
|
|
54
|
+
yield ctx.systemPrompt.section({
|
|
55
|
+
name: 'bridge-jtg5120:discipline',
|
|
56
|
+
order: 266,
|
|
57
|
+
text: [
|
|
58
|
+
'## 公路桥涵养护(JTG 5120—2021)纪律',
|
|
59
|
+
'',
|
|
60
|
+
'涉及养护检查等级、检查频率、技术状况分类、养护对策时,必须调用 `j5120_inspect` / `j5120_maintenance`,不得凭印象。',
|
|
61
|
+
'技术状况评分的算法属于《公路桥梁技术状况评定标准》(JTG/T H21),本插件只接等级、不算分,引用时不得张冠李戴。',
|
|
62
|
+
'技术状况 1~5 类与耐久性 Ⅰ/Ⅱ/Ⅲ 级是两套体系,不得换算;需要并列时必须标注"非规范规定"。',
|
|
63
|
+
'养护结论不替代养护工程设计与注册执业人员判断。',
|
|
64
|
+
].join('\n'),
|
|
65
|
+
});
|
|
66
|
+
}, 'bridge-jtg5120 discipline');
|
|
67
|
+
|
|
68
|
+
const rules = loadRules();
|
|
69
|
+
if (rules) {
|
|
70
|
+
ctx.effect(function* () {
|
|
71
|
+
yield ctx.skills.register({
|
|
72
|
+
name: 'bridge-jtg5120-maintenance',
|
|
73
|
+
description: '公路桥涵养护要点:检查分类与频率、5 类技术状况与对策、定期检查清单、永久观测点、与耐久性评定的衔接',
|
|
74
|
+
whenToUse: '编制养护检查计划、确定检查频率、判断特殊检查、做技术状况与养护对策映射时',
|
|
75
|
+
source: 'bundled',
|
|
76
|
+
content: rules,
|
|
77
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
78
|
+
});
|
|
79
|
+
}, 'bridge-jtg5120 skill');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ---- 1) 检查等级与频率 ----
|
|
83
|
+
ctx.tools.register(defineTool({
|
|
84
|
+
name: 'j5120_inspect',
|
|
85
|
+
description:
|
|
86
|
+
'按 JTG 5120—2021 判定养护检查等级与检查频率:action=level 按 3.1.1 由跨径/桥型/公路等级/技术状况定 Ⅰ/Ⅱ/Ⅲ 级(含 3 类提高一级、4 类按 Ⅰ 级);'
|
|
87
|
+
+ 'action=frequency 给出日常巡查/经常检查/定期检查频率;action=special 判断 3.6.1 特殊检查触发;'
|
|
88
|
+
+ 'action=durability 列出与耐久性评定衔接的条款。',
|
|
89
|
+
parameters: {
|
|
90
|
+
action: { type: 'string', enum: ['level', 'frequency', 'special', 'durability'], description: '查询内容。' },
|
|
91
|
+
maxSpan: { type: 'number', description: '单孔最大跨径(m)。' },
|
|
92
|
+
bridgeClass: { type: 'string', enum: ['特大桥', '大桥', '中桥', '小桥'], description: '桥型规模。' },
|
|
93
|
+
roadClass: { type: 'string', enum: ['高速', '一级', '二级', '三级', '四级'], description: '公路等级。' },
|
|
94
|
+
techGrade: { type: 'number', description: '技术状况等级 1~5(来自 JTG/T H21 评定)。' },
|
|
95
|
+
specialImportant: { type: 'boolean', description: '是否特别重要桥梁。' },
|
|
96
|
+
causeUnclear: { type: 'boolean', description: '难以判明损伤原因及程度。' },
|
|
97
|
+
plannedStrengthen: { type: 'boolean', description: '拟加固提高荷载等级。' },
|
|
98
|
+
underwaterFoundation: { type: 'boolean', description: '需判明水中基础。' },
|
|
99
|
+
disasterDamage: { type: 'boolean', description: '遭受洪水/地震/撞击等异常损伤。' },
|
|
100
|
+
},
|
|
101
|
+
output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
|
|
102
|
+
async execute(args) {
|
|
103
|
+
const L = [];
|
|
104
|
+
if (args.action === 'level') {
|
|
105
|
+
const r = inspectLevel(args);
|
|
106
|
+
const f = frequencyFor(r.level);
|
|
107
|
+
L.push('# 养护检查等级与频率(JTG 5120—2021)');
|
|
108
|
+
L.push('');
|
|
109
|
+
L.push(`**养护检查等级:${r.level} 级**(3.1.1)`);
|
|
110
|
+
L.push('');
|
|
111
|
+
for (const x of r.reasons) L.push(`- ${x}`);
|
|
112
|
+
for (const x of r.raised) L.push(`- ${x}`);
|
|
113
|
+
L.push('');
|
|
114
|
+
L.push('| 检查类别 | 频率 | 依据 |');
|
|
115
|
+
L.push('|---|---|---|');
|
|
116
|
+
L.push(`| 日常巡查 | ${f.daily.text} | ${f.daily.clause} |`);
|
|
117
|
+
L.push(`| 经常检查 | ${f.routine.text} | ${f.routine.clause} |`);
|
|
118
|
+
L.push(`| 定期检查 | ${f.periodic.text} | ${f.periodic.clause} |`);
|
|
119
|
+
L.push('');
|
|
120
|
+
for (const n of f.notes) L.push(`- ${n}`);
|
|
121
|
+
} else if (args.action === 'frequency') {
|
|
122
|
+
const f = frequencyFor(args.techGrade ? inspectLevel(args).level : args.roadClass ? inspectLevel(args).level : 'Ⅱ');
|
|
123
|
+
L.push(`# ${f.level} 级养护检查频率`);
|
|
124
|
+
L.push('');
|
|
125
|
+
L.push(`- 日常巡查:${f.daily.text}(${f.daily.clause})`);
|
|
126
|
+
L.push(`- 经常检查:${f.routine.text}(${f.routine.clause})`);
|
|
127
|
+
L.push(`- 定期检查:${f.periodic.text}(${f.periodic.clause})`);
|
|
128
|
+
L.push('');
|
|
129
|
+
for (const n of f.notes) L.push(`- ${n}`);
|
|
130
|
+
} else if (args.action === 'special') {
|
|
131
|
+
const r = specialCheck(args);
|
|
132
|
+
L.push('# 特殊检查判定(3.6.1)');
|
|
133
|
+
L.push('');
|
|
134
|
+
L.push(`**结论:${r.needed ? '应做特殊检查' : '未触发'}**`);
|
|
135
|
+
L.push('');
|
|
136
|
+
for (const t of SPECIAL_TRIGGERS) L.push(`- ${r.triggers.includes(t) ? '✅' : '☐'} ${t}`);
|
|
137
|
+
} else {
|
|
138
|
+
L.push('# 与耐久性评定的衔接条款');
|
|
139
|
+
L.push('');
|
|
140
|
+
L.push('| 条文 | 要点 |');
|
|
141
|
+
L.push('|---|---|');
|
|
142
|
+
for (const d of DURABILITY_CLAUSES) L.push(`| ${d.clause} | ${d.text} |`);
|
|
143
|
+
L.push('');
|
|
144
|
+
L.push('> 耐久性检测评定的三条强制触发情形见 JTG/T 5231 的 3.1.1;5120 本身没有"达到设计使用年限即应做耐久性评定"的通用条款。');
|
|
145
|
+
}
|
|
146
|
+
return L.join('\n');
|
|
147
|
+
},
|
|
148
|
+
}));
|
|
149
|
+
|
|
150
|
+
// ---- 2) 检查清单 ----
|
|
151
|
+
ctx.tools.register(defineTool({
|
|
152
|
+
name: 'j5120_checklist',
|
|
153
|
+
description:
|
|
154
|
+
'给 JTG 5120—2021 的检查作业清单:action=periodic 列定期检查 5 项规定(3.5.2)与分部位条目(3.5.4~3.5.13);'
|
|
155
|
+
+ 'action=report 列定期检查报告 6 项内容(3.5.15);action=points 列永久观测点要求(表 3.5.3);'
|
|
156
|
+
+ 'action=parts 只列分部位检查条目索引。',
|
|
157
|
+
parameters: {
|
|
158
|
+
action: { type: 'string', enum: ['periodic', 'report', 'points', 'parts'], description: '清单类型。' },
|
|
159
|
+
part: { type: 'string', description: '可选:只看某部位,如"支座""斜拉桥"。' },
|
|
160
|
+
},
|
|
161
|
+
output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
|
|
162
|
+
async execute(args) {
|
|
163
|
+
const L = [];
|
|
164
|
+
if (args.action === 'report') {
|
|
165
|
+
L.push('# 定期检查报告应包含的内容(3.5.15)');
|
|
166
|
+
L.push('');
|
|
167
|
+
REPORT_ITEMS.forEach((t, i) => L.push(`${i + 1}. ${t}`));
|
|
168
|
+
} else if (args.action === 'points') {
|
|
169
|
+
L.push('# 永久观测点与变形检查(表 3.5.3)');
|
|
170
|
+
L.push('');
|
|
171
|
+
L.push('> 单孔跨径 ≥60m 的桥梁应设立永久观测点(3.5.3-1)。');
|
|
172
|
+
L.push('');
|
|
173
|
+
L.push('| 序 | 项目 | 布设要求 |');
|
|
174
|
+
L.push('|---|---|---|');
|
|
175
|
+
for (const p of PERMANENT_POINTS) L.push(`| ${p.no} | ${p.item} | ${p.rule} |`);
|
|
176
|
+
L.push('');
|
|
177
|
+
L.push('- 未设观测点的桥梁应在定期检查时补设(3.5.3-5)');
|
|
178
|
+
L.push('- 应绘制永久观测点平面布置图并明确基准点位置(3.5.3-3)');
|
|
179
|
+
L.push('- 主体结构维修、加固改造前后应进行控制检测(3.5.3-4)');
|
|
180
|
+
} else {
|
|
181
|
+
L.push('# 定期检查清单(JTG 5120—2021)');
|
|
182
|
+
L.push('');
|
|
183
|
+
L.push('## 一、定期检查的 5 项规定(3.5.2)');
|
|
184
|
+
L.push('');
|
|
185
|
+
for (const s of PERIODIC_STEPS) L.push(`${s.no}. ${s.text}`);
|
|
186
|
+
L.push('');
|
|
187
|
+
if (args.action === 'periodic') {
|
|
188
|
+
L.push('## 二、分部位检查条目');
|
|
189
|
+
L.push('');
|
|
190
|
+
}
|
|
191
|
+
const list = args.part ? PART_CHECKS.filter((p) => p.part.includes(args.part)) : PART_CHECKS;
|
|
192
|
+
if (!list.length) {
|
|
193
|
+
L.push(`未找到部位「${args.part}」;可选:${PART_CHECKS.map((p) => p.part).join('、')}`);
|
|
194
|
+
} else {
|
|
195
|
+
L.push('| 条文 | 部位 | 款数 | 重点 |');
|
|
196
|
+
L.push('|---|---|---|---|');
|
|
197
|
+
for (const p of list) L.push(`| ${p.no} | ${p.part} | ${p.clauses} | ${p.focus} |`);
|
|
198
|
+
L.push('');
|
|
199
|
+
L.push('> 上述为条款级索引,逐款细目须查条文原文;本插件不含条文原文。');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return L.join('\n');
|
|
203
|
+
},
|
|
204
|
+
}));
|
|
205
|
+
|
|
206
|
+
// ---- 3) 技术状况与养护对策 ----
|
|
207
|
+
ctx.tools.register(defineTool({
|
|
208
|
+
name: 'j5120_maintenance',
|
|
209
|
+
description:
|
|
210
|
+
'按 JTG 5120—2021 表 3.8.2 / 表 3.8.3,由技术状况等级 1~5 给出状态描述与养护对策;同时提示与耐久性等级的对应关系(非规范规定)。'
|
|
211
|
+
+ '注意:技术状况评分算法属 JTG/T H21,本工具只接等级不算分。',
|
|
212
|
+
parameters: {
|
|
213
|
+
techGrade: { type: 'number', description: '技术状况等级 1~5。' },
|
|
214
|
+
},
|
|
215
|
+
output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
|
|
216
|
+
async execute(args) {
|
|
217
|
+
const g = Number(args.techGrade);
|
|
218
|
+
const info = TECH_GRADES[g];
|
|
219
|
+
if (!info) throw new Error('技术状况等级须为 1~5');
|
|
220
|
+
const align = {
|
|
221
|
+
1: '通常对应耐久性 Ⅰ~Ⅱ 级',
|
|
222
|
+
2: '通常对应耐久性 Ⅱ 级',
|
|
223
|
+
3: '通常对应耐久性 Ⅱ~Ⅲ 级',
|
|
224
|
+
4: '通常对应耐久性 Ⅲ 级',
|
|
225
|
+
5: '通常对应耐久性 Ⅲ 级,且承载能力已不足',
|
|
226
|
+
}[g];
|
|
227
|
+
return [
|
|
228
|
+
`# 技术状况 ${g} 类(${info.name})`,
|
|
229
|
+
'',
|
|
230
|
+
`- 状态:${info.brief}(表 3.8.2)`,
|
|
231
|
+
`- 养护对策:**${MAINTENANCE[g]}**(表 3.8.3)`,
|
|
232
|
+
`- 与耐久性等级的对应:${align}(**非规范规定**,仅供并列展示)`,
|
|
233
|
+
'',
|
|
234
|
+
'> 技术状况评分按 JTG/T H21 执行;本插件只做等级到对策的映射。',
|
|
235
|
+
].join('\n');
|
|
236
|
+
},
|
|
237
|
+
}));
|
|
238
|
+
// ---- 4) 第 5~8 章:灾害防治、超重车辆、涵洞、技术管理 ----
|
|
239
|
+
ctx.tools.register(defineTool({
|
|
240
|
+
name: 'j5120_rules',
|
|
241
|
+
description:
|
|
242
|
+
'查 JTG 5120—2021 第 4~8 章(151 条条文):第 4 章桥梁养护与维修(含梁桥/拱桥上部、钢结构、斜拉桥、悬索桥、下部结构、基础锚碇、支座、附属设施、调治构造物)、第 5 章灾害防治与抢修、第 6 章超重车辆过桥、第 7 章涵洞检查养护与维修、第 8 章技术管理。'
|
|
243
|
+
+ 'action=list 按章列含量化值的条文(条文号 + 数值);action=flood 给表 5.2.1 防洪能力四级判定;action=search 关键字检索;'
|
|
244
|
+
+ 'action=clause 按条文号查原文;action=tables 列本章收录的表。'
|
|
245
|
+
+ '注意:表 7.2.2 的"好/较好/较差/差/危险"是**涵洞专用五级**,与 JTG/T H21 的技术状况 1~5 类**不属同一体系、不得换算**。'
|
|
246
|
+
+ '本规范**无支座顶升工艺要求**(4.10.2 只给"该不该换"的触发条件)、**无限载吨位与限速值**(限载见第 6 章),不得臆造。'
|
|
247
|
+
+ '4.7.2-10 的"断丝>5%、锈蚀>5%全截面"是**悬索桥吊索**阈值,与 5122 的斜拉索换索条件(不含百分比)不可互换。',
|
|
248
|
+
parameters: {
|
|
249
|
+
action: { type: 'string', enum: ['list', 'flood', 'search', 'clause', 'tables'], description: '查询方式。' },
|
|
250
|
+
keyword: { type: 'string', description: 'search/clause 用关键字或条文号。' },
|
|
251
|
+
},
|
|
252
|
+
output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
|
|
253
|
+
async execute(args) {
|
|
254
|
+
const data = loadBody();
|
|
255
|
+
const chapters = data.chapters || [];
|
|
256
|
+
const allClauses = chapters.flatMap((c) => (c.clauses || []).map((x) => ({ ...x, chapter: c.title })));
|
|
257
|
+
const allTables = chapters.flatMap((c) => (c.tables || []).map((t) => ({ ...t, chapter: c.title })));
|
|
258
|
+
const L = [];
|
|
259
|
+
|
|
260
|
+
if (args.action === 'flood') {
|
|
261
|
+
const t = allTables.find((x) => /5\.2\.1/.test(x.no));
|
|
262
|
+
if (!t) return '未找到表 5.2.1';
|
|
263
|
+
L.push(`# ${t.no} ${t.name}`);
|
|
264
|
+
L.push('');
|
|
265
|
+
if (t.headerRows) {
|
|
266
|
+
for (const h of t.headerRows) L.push(`| ${h.join(' | ')} |`);
|
|
267
|
+
L.push(`|${h0(t.headerRows[0])}|`);
|
|
268
|
+
}
|
|
269
|
+
for (const r of t.rows) L.push(`| ${r.join(' | ')} |`);
|
|
270
|
+
if (t.notes) {
|
|
271
|
+
L.push('');
|
|
272
|
+
L.push(`注:${t.notes}`);
|
|
273
|
+
}
|
|
274
|
+
L.push('');
|
|
275
|
+
L.push('> 防洪能力分**四级:强 / 可 / 弱 / 差**;"可"及以下须关注,"弱/差"应考虑专项处治。');
|
|
276
|
+
} else if (args.action === 'tables') {
|
|
277
|
+
for (const t of allTables) {
|
|
278
|
+
L.push(`## ${t.no} ${t.name}`);
|
|
279
|
+
L.push(`- 所属:${t.chapter}${t.pdfPage ? `|PDF ${t.pdfPage}` : ''}`);
|
|
280
|
+
if (t.notes) L.push(`- 注:${t.notes}`);
|
|
281
|
+
L.push('');
|
|
282
|
+
}
|
|
283
|
+
} else if (args.action === 'clause') {
|
|
284
|
+
const kw = String(args.keyword || '').trim();
|
|
285
|
+
const hit = allClauses.find((c) => c.no === kw) || allClauses.find((c) => c.no.startsWith(kw) && kw.length >= 3);
|
|
286
|
+
if (!hit) return `未找到条文「${kw}」。示例:${allClauses.slice(0, 8).map((c) => c.no).join('、')}`;
|
|
287
|
+
L.push(`# ${hit.no}(${hit.chapter}|PDF ${hit.pdfPage})`);
|
|
288
|
+
L.push('');
|
|
289
|
+
L.push(hit.text);
|
|
290
|
+
if (hit.numbers && hit.numbers.length) {
|
|
291
|
+
L.push('');
|
|
292
|
+
L.push(`**量化值**:${hit.numbers.join(';')}`);
|
|
293
|
+
}
|
|
294
|
+
} else if (args.action === 'search') {
|
|
295
|
+
const kw = String(args.keyword || '').trim();
|
|
296
|
+
const hits = allClauses.filter((c) => (c.text || '').includes(kw) || (c.numbers || []).some((n) => String(n).includes(kw)));
|
|
297
|
+
L.push(`# 检索「${kw}」:命中 ${hits.length} 条`);
|
|
298
|
+
L.push('');
|
|
299
|
+
for (const c of hits) {
|
|
300
|
+
L.push(`- **${c.no}**(${c.chapter}):${(c.text || '').slice(0, 110)}`);
|
|
301
|
+
if (c.numbers && c.numbers.length) L.push(` - 量化值:${c.numbers.join(';')}`);
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
L.push('# 第 5~8 章含量化值的条文');
|
|
305
|
+
L.push('');
|
|
306
|
+
for (const c of chapters) {
|
|
307
|
+
const withNums = (c.clauses || []).filter((x) => x.numbers && x.numbers.length);
|
|
308
|
+
L.push(`## ${c.title}(${(c.clauses || []).length} 条)`);
|
|
309
|
+
L.push('');
|
|
310
|
+
if (!withNums.length) {
|
|
311
|
+
L.push('(本章无含量化值的条文)');
|
|
312
|
+
L.push('');
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
L.push('| 条文 | 量化值 |');
|
|
316
|
+
L.push('|---|---|');
|
|
317
|
+
for (const x of withNums) L.push(`| ${x.no} | ${x.numbers.join(';')} |`);
|
|
318
|
+
L.push('');
|
|
319
|
+
}
|
|
320
|
+
L.push(`> 共 ${allClauses.length} 条条文,${allClauses.filter((c) => c.numbers && c.numbers.length).length} 条含量化值。`);
|
|
321
|
+
}
|
|
322
|
+
return L.join('\n');
|
|
323
|
+
},
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function h0(row) {
|
|
328
|
+
return new Array(row.length).fill('---').join('|');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export { apply, inject, name };
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Highway bridge maintenance (JTG 5120)",
|
|
4
|
+
"description": "Determines maintenance inspection grade and frequency, produces periodic inspection checklists and permanent monitoring point requirements, and maps technical condition grades to maintenance measures.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiking/bridge-jtg5120",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "公路桥涵养护规范(JTG 5120—2021)插件:养护检查等级与频率、检查清单、技术状况养护对策与验收要求",
|
|
5
|
+
"icon": "./icon.svg",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./lib/index.js",
|
|
10
|
+
"./locale/*.json": "./locale/*.json",
|
|
11
|
+
"./icon": "./icon.svg",
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib/**/*.js",
|
|
17
|
+
"lib/**/*.json",
|
|
18
|
+
"rules/*.md",
|
|
19
|
+
"locale/*.json",
|
|
20
|
+
"docs/*.md",
|
|
21
|
+
"cordis.patch.yml",
|
|
22
|
+
"icon.svg",
|
|
23
|
+
"README.md",
|
|
24
|
+
"test/*.mjs",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"NOTICE"
|
|
27
|
+
],
|
|
28
|
+
"license": "UNLICENSED",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"dsh",
|
|
31
|
+
"dsh-bundle",
|
|
32
|
+
"aiking",
|
|
33
|
+
"bridge",
|
|
34
|
+
"maintenance",
|
|
35
|
+
"jtg5120"
|
|
36
|
+
],
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@deepseek-ai/dsh-tools": ">=0.2.0 <0.3.0",
|
|
39
|
+
"@deepseek-ai/cordis": ">=4.0.0 <5.0.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "node --test test/*.test.mjs"
|
|
43
|
+
},
|
|
44
|
+
"dsh": {
|
|
45
|
+
"bundle": {
|
|
46
|
+
"patch": "./cordis.patch.yml"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|