openprototype 0.1.0 → 0.2.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/AGENTS.md +58 -0
- package/CONVENTIONS.md +54 -0
- package/LICENSE +21 -0
- package/README.md +233 -2
- package/bin/cli.js +297 -0
- package/lib/config.js +162 -0
- package/package.json +32 -10
- package/product/demo/pc/customer/customer_form.html +134 -0
- package/product/demo/pc/customer/customer_form.md +33 -0
- package/product/demo/pc/customer/customer_list.html +129 -0
- package/product/demo/pc/customer/customer_list.md +35 -0
- package/product/demo/pc/demo-data.js +23 -0
- package/product/demo/pc/index.html +1069 -0
- package/product/demo/pc/nav-tree.json +15 -0
- package/proto-kit.config.json +13 -0
- package/runtime/server.js +664 -0
- package/runtime/shared/ai-polish.js +159 -0
- package/runtime/shared/base-manager.js +168 -0
- package/runtime/shared/common/component-renderer.js +917 -0
- package/runtime/shared/common/copy-manager.js +134 -0
- package/runtime/shared/common/data-bridge.js +45 -0
- package/runtime/shared/common/form-renderer.js +211 -0
- package/runtime/shared/common/form.js +357 -0
- package/runtime/shared/common/formatter.js +78 -0
- package/runtime/shared/common/index.js +37 -0
- package/runtime/shared/common/line-chart.js +357 -0
- package/runtime/shared/common/modal-manager.js +82 -0
- package/runtime/shared/common/prd-panel.js +1014 -0
- package/runtime/shared/common/prd-popup.js +168 -0
- package/runtime/shared/common/search-renderer.js +95 -0
- package/runtime/shared/common/table-renderer.js +177 -0
- package/runtime/shared/common/table.js +160 -0
- package/runtime/shared/common/toast.js +99 -0
- package/runtime/shared/common/ui-preference-manager.js +74 -0
- package/runtime/shared/common/view-mode.js +30 -0
- package/runtime/shared/common.js +43 -0
- package/runtime/shared/constants/icons.js +28 -0
- package/runtime/shared/constants/status.js +67 -0
- package/runtime/shared/libs/marked.min.js +69 -0
- package/runtime/shared/prd-content.js +9 -0
- package/runtime/shared/styles.css +7673 -0
- package/runtime/shared/utils.js +110 -0
- package/runtime/shared/view-controls.js +148 -0
- package/runtime/shell/agent-panel.css +429 -0
- package/runtime/shell/agent-panel.js +629 -0
- package/scripts/check/run-checks.js +58 -0
- package/scripts/check/smoke-test.js +244 -0
- package/scripts/check/static-check.js +248 -0
- package/scripts/check/sync-nav-tree.js +139 -0
- package/templates/AGENTS.md +58 -0
- package/templates/CONVENTIONS.md +54 -0
- package/templates/gitignore +10 -0
- package/templates/product-shell/index.html +1069 -0
- package/templates/skills/auto-test/SKILL.md +62 -0
- package/templates/skills/xiaojia/SKILL.md +299 -0
- package/cli.js +0 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 项目通用工具类 (Utils)
|
|
3
|
+
* 修订人:张晶晶
|
|
4
|
+
*/
|
|
5
|
+
const CommonUtils = {
|
|
6
|
+
/**
|
|
7
|
+
* 金额格式化 (千分位,保留2位小数)
|
|
8
|
+
*/
|
|
9
|
+
formatCurrency(num) {
|
|
10
|
+
if (num === null || num === undefined || isNaN(num)) return '0.00';
|
|
11
|
+
return parseFloat(num).toLocaleString('zh-CN', {
|
|
12
|
+
minimumFractionDigits: 2,
|
|
13
|
+
maximumFractionDigits: 2
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 获取 URL 参数
|
|
19
|
+
*/
|
|
20
|
+
getUrlParam(name) {
|
|
21
|
+
const params = new URLSearchParams(window.location.search);
|
|
22
|
+
return params.get(name);
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 简单的日期格式化 (YYYY-MM-DD)
|
|
27
|
+
*/
|
|
28
|
+
formatDate(date) {
|
|
29
|
+
if (!date) return '';
|
|
30
|
+
const d = new Date(date);
|
|
31
|
+
return d.toISOString().split('T')[0];
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 今天的日期 (YYYY-MM-DD)
|
|
36
|
+
*/
|
|
37
|
+
today() {
|
|
38
|
+
var d = new Date();
|
|
39
|
+
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 当前月份 (YYYY-MM)
|
|
44
|
+
*/
|
|
45
|
+
currentMonth() {
|
|
46
|
+
var d = new Date();
|
|
47
|
+
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0');
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 初始化表格列宽调整功能
|
|
52
|
+
* @param {string} tableId - 表格元素 ID
|
|
53
|
+
* @param {string} storageKey - localStorage 存储键名
|
|
54
|
+
*/
|
|
55
|
+
initColumnResizer(tableId, storageKey) {
|
|
56
|
+
var table = document.getElementById(tableId);
|
|
57
|
+
if (!table) return;
|
|
58
|
+
|
|
59
|
+
var savedWidths = {};
|
|
60
|
+
try {
|
|
61
|
+
savedWidths = JSON.parse(localStorage.getItem(storageKey) || '{}');
|
|
62
|
+
} catch (e) {
|
|
63
|
+
savedWidths = {};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var ths = table.querySelectorAll('th');
|
|
67
|
+
ths.forEach(function(th) {
|
|
68
|
+
var column = th.getAttribute('data-column');
|
|
69
|
+
if (column && savedWidths[column]) {
|
|
70
|
+
th.style.width = savedWidths[column] + 'px';
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
var currentTh = null;
|
|
75
|
+
var startX = 0;
|
|
76
|
+
var startWidth = 0;
|
|
77
|
+
|
|
78
|
+
table.addEventListener('mousedown', function(e) {
|
|
79
|
+
if (e.target.classList.contains('resizer')) {
|
|
80
|
+
currentTh = e.target.closest('th');
|
|
81
|
+
startX = e.pageX;
|
|
82
|
+
startWidth = currentTh.offsetWidth;
|
|
83
|
+
currentTh.classList.add('resizing');
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
document.addEventListener('mousemove', function(e) {
|
|
89
|
+
if (!currentTh) return;
|
|
90
|
+
var diff = e.pageX - startX;
|
|
91
|
+
var newWidth = Math.max(50, startWidth + diff);
|
|
92
|
+
currentTh.style.width = newWidth + 'px';
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
document.addEventListener('mouseup', function() {
|
|
96
|
+
if (!currentTh) return;
|
|
97
|
+
var column = currentTh.getAttribute('data-column');
|
|
98
|
+
var newWidth = currentTh.offsetWidth;
|
|
99
|
+
if (column) {
|
|
100
|
+
savedWidths[column] = newWidth;
|
|
101
|
+
localStorage.setItem(storageKey, JSON.stringify(savedWidths));
|
|
102
|
+
}
|
|
103
|
+
currentTh.classList.remove('resizing');
|
|
104
|
+
currentTh = null;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// 确保全局可用
|
|
110
|
+
window.CommonUtils = CommonUtils;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 审批列表 · 视图控制(合规版)
|
|
3
|
+
*
|
|
4
|
+
* 红线:零内联、事件委托、不直接操作 localStorage。
|
|
5
|
+
*
|
|
6
|
+
* 布局(重要):
|
|
7
|
+
* - 视图栏 rx-view-controls(rx-list-control-row 内):视图下拉 + 筛选字段 + 视图另存为
|
|
8
|
+
* - 查询区下方的「查询/重置/新增」按钮行最右侧:展示字段(操作表格列)
|
|
9
|
+
* 「展示字段」按钮不在视图栏里,因此本组件用事件委托覆盖整个列表面板。
|
|
10
|
+
*
|
|
11
|
+
* 用法:
|
|
12
|
+
* 1. HTML 在 common.js 之后引入:<script src="../shared/view-controls.js"></script>
|
|
13
|
+
* 2. 容器结构见 templates/approval_list_page_template.html
|
|
14
|
+
* 3. 页面 JS 初始化:
|
|
15
|
+
* ViewControls.init({
|
|
16
|
+
* root: 'rx-page-content', // 可选,默认 document;需覆盖视图栏与查询按钮行
|
|
17
|
+
* onViewChange: function(viewKey) { ... }, // 切换视图
|
|
18
|
+
* onApplyFields: function(type, values) {...}, // type: 'filter' | 'display'
|
|
19
|
+
* onSaveView: function(viewName) { ... } // 视图另存为
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* 通过 data-action / data-view 事件委托:
|
|
23
|
+
* - data-action="toggle-view-menu" 视图下拉触发器(.rx-view-select 内)
|
|
24
|
+
* - data-view="default|my|pending" 视图菜单项(.rx-view-menu 内)
|
|
25
|
+
* - data-action="toggle-filter" 筛选字段按钮(.rx-view-field 内,控制查询区)
|
|
26
|
+
* - data-action="toggle-display" 展示字段按钮(.rx-view-field 内,控制表格列)
|
|
27
|
+
* - data-action="save-view" 视图另存为按钮
|
|
28
|
+
*/
|
|
29
|
+
(function (global) {
|
|
30
|
+
'use strict';
|
|
31
|
+
|
|
32
|
+
function closeAllDropdowns() {
|
|
33
|
+
document.querySelectorAll('.rx-view-menu.active, .rx-view-dropdown.active').forEach(function (d) {
|
|
34
|
+
d.classList.remove('active');
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function toggleDropdown(dropdown) {
|
|
39
|
+
if (!dropdown) return;
|
|
40
|
+
var willOpen = !dropdown.classList.contains('active');
|
|
41
|
+
closeAllDropdowns();
|
|
42
|
+
if (willOpen) dropdown.classList.add('active');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function readChecked(dropdown) {
|
|
46
|
+
var values = [];
|
|
47
|
+
dropdown.querySelectorAll('input[type="checkbox"]:checked').forEach(function (cb) {
|
|
48
|
+
values.push(cb.value);
|
|
49
|
+
});
|
|
50
|
+
return values;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var ViewControls = {
|
|
54
|
+
init: function (opts) {
|
|
55
|
+
opts = opts || {};
|
|
56
|
+
var root = opts.root
|
|
57
|
+
? (typeof opts.root === 'string' ? document.getElementById(opts.root) : opts.root)
|
|
58
|
+
: document;
|
|
59
|
+
if (!root) return;
|
|
60
|
+
|
|
61
|
+
root.addEventListener('click', function (e) {
|
|
62
|
+
var menuItem = e.target.closest('.rx-view-menu-item[data-view]');
|
|
63
|
+
if (menuItem) {
|
|
64
|
+
var menu = menuItem.closest('.rx-view-menu');
|
|
65
|
+
menu.querySelectorAll('.rx-view-menu-item').forEach(function (it) {
|
|
66
|
+
it.classList.toggle('active', it === menuItem);
|
|
67
|
+
});
|
|
68
|
+
var select = menuItem.closest('.rx-view-select');
|
|
69
|
+
var text = select && select.querySelector('.rx-view-select-text');
|
|
70
|
+
if (text) text.textContent = menuItem.textContent.trim();
|
|
71
|
+
closeAllDropdowns();
|
|
72
|
+
if (typeof opts.onViewChange === 'function') {
|
|
73
|
+
opts.onViewChange(menuItem.getAttribute('data-view'));
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var actionEl = e.target.closest('[data-action]');
|
|
79
|
+
if (!actionEl) return;
|
|
80
|
+
var action = actionEl.getAttribute('data-action');
|
|
81
|
+
|
|
82
|
+
if (action === 'toggle-view-menu') {
|
|
83
|
+
toggleDropdown(actionEl.closest('.rx-view-select').querySelector('.rx-view-menu'));
|
|
84
|
+
} else if (action === 'toggle-filter' || action === 'toggle-display') {
|
|
85
|
+
toggleDropdown(actionEl.closest('.rx-view-field').querySelector('.rx-view-dropdown'));
|
|
86
|
+
} else if (action === 'save-view') {
|
|
87
|
+
closeAllDropdowns();
|
|
88
|
+
ViewControls.openSaveDialog(opts.onSaveView);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
root.addEventListener('change', function (e) {
|
|
93
|
+
var cb = e.target;
|
|
94
|
+
if (cb.type !== 'checkbox') return;
|
|
95
|
+
var dropdown = cb.closest('.rx-view-dropdown');
|
|
96
|
+
if (!dropdown) return;
|
|
97
|
+
var type = dropdown.getAttribute('data-field-type') || 'filter';
|
|
98
|
+
if (typeof opts.onApplyFields === 'function') {
|
|
99
|
+
opts.onApplyFields(type, readChecked(dropdown));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
document.addEventListener('click', function (e) {
|
|
104
|
+
if (!e.target.closest('.rx-view-select') && !e.target.closest('.rx-view-field')) {
|
|
105
|
+
closeAllDropdowns();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
openSaveDialog: function (onSave) {
|
|
111
|
+
var holder = document.getElementById('modalContainer') || document.body;
|
|
112
|
+
holder.insertAdjacentHTML('beforeend',
|
|
113
|
+
'<div class="modal-overlay" id="rxSaveViewModal" style="display:flex;">' +
|
|
114
|
+
'<div class="modal" style="width:420px;max-width:90%;">' +
|
|
115
|
+
'<div class="modal-header"><h3>视图另存为</h3>' +
|
|
116
|
+
'<button type="button" class="modal-close" data-action="save-view-close">×</button></div>' +
|
|
117
|
+
'<div class="modal-body">' +
|
|
118
|
+
'<div class="form-item"><label class="form-label">视图名称</label>' +
|
|
119
|
+
'<input type="text" class="form-input" id="rxViewNameInput" maxlength="50" placeholder="please enter a view name"></div>' +
|
|
120
|
+
'</div>' +
|
|
121
|
+
'<div class="modal-footer" style="display:flex;justify-content:flex-end;gap:8px;">' +
|
|
122
|
+
'<button type="button" class="btn" data-action="save-view-close">取消</button>' +
|
|
123
|
+
'<button type="button" class="btn btn-primary" data-action="save-view-confirm">保存</button>' +
|
|
124
|
+
'</div></div></div>');
|
|
125
|
+
|
|
126
|
+
var modal = document.getElementById('rxSaveViewModal');
|
|
127
|
+
var input = document.getElementById('rxViewNameInput');
|
|
128
|
+
if (input) input.focus();
|
|
129
|
+
|
|
130
|
+
modal.addEventListener('click', function (e) {
|
|
131
|
+
var t = e.target.closest('[data-action]');
|
|
132
|
+
if (t && t.getAttribute('data-action') === 'save-view-confirm') {
|
|
133
|
+
var name = (input && input.value || '').trim();
|
|
134
|
+
if (!name) {
|
|
135
|
+
if (global.UI && global.UI.toast) global.UI.toast('请输入视图名称', 'error');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (typeof onSave === 'function') onSave(name);
|
|
139
|
+
modal.remove();
|
|
140
|
+
} else if (t || e.target === modal) {
|
|
141
|
+
modal.remove();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
global.ViewControls = ViewControls;
|
|
148
|
+
})(window);
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
.agent-panel {
|
|
2
|
+
width: 380px;
|
|
3
|
+
min-width: 320px;
|
|
4
|
+
max-width: 600px;
|
|
5
|
+
flex: 0 0 auto;
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
background: #fff;
|
|
11
|
+
border-left: 1px solid #dfe5ee;
|
|
12
|
+
color: #20242d;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.agent-panel.is-collapsed {
|
|
16
|
+
width: 42px !important;
|
|
17
|
+
min-width: 42px;
|
|
18
|
+
max-width: 42px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.agent-resizer {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: -5px;
|
|
25
|
+
width: 10px;
|
|
26
|
+
height: 100%;
|
|
27
|
+
border: 0;
|
|
28
|
+
background: transparent;
|
|
29
|
+
cursor: ew-resize;
|
|
30
|
+
z-index: 20;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.agent-resizer::after {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 4px;
|
|
38
|
+
width: 2px;
|
|
39
|
+
height: 100%;
|
|
40
|
+
background: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.agent-resizer:hover::after,
|
|
44
|
+
.agent-resizer.is-resizing::after {
|
|
45
|
+
background: #1677ff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.agent-panel.is-collapsed .agent-resizer,
|
|
49
|
+
.agent-panel.is-collapsed .agent-header-main,
|
|
50
|
+
.agent-panel.is-collapsed .agent-new-chat,
|
|
51
|
+
.agent-panel.is-collapsed .agent-context,
|
|
52
|
+
.agent-panel.is-collapsed .agent-messages,
|
|
53
|
+
.agent-panel.is-collapsed .agent-composer {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.agent-header {
|
|
58
|
+
height: 48px;
|
|
59
|
+
flex: 0 0 auto;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 8px;
|
|
63
|
+
padding: 0 10px 0 14px;
|
|
64
|
+
border-bottom: 1px solid #edf0f5;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.agent-panel.is-collapsed .agent-header {
|
|
68
|
+
height: 100%;
|
|
69
|
+
padding: 8px 5px;
|
|
70
|
+
align-items: flex-start;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
border-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.agent-header-main {
|
|
76
|
+
flex: 1;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.agent-title-row {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 7px;
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.agent-status-dot {
|
|
89
|
+
width: 7px;
|
|
90
|
+
height: 7px;
|
|
91
|
+
border-radius: 50%;
|
|
92
|
+
background: #a8b2c3;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.agent-status-dot.is-ready { background: #18b54a; }
|
|
96
|
+
.agent-status-dot.is-running { background: #1677ff; }
|
|
97
|
+
.agent-status-dot.is-error { background: #d91f2f; }
|
|
98
|
+
|
|
99
|
+
.agent-subtitle {
|
|
100
|
+
margin-top: 2px;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
color: #7b8495;
|
|
103
|
+
font-size: 10px;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.agent-header-btn {
|
|
109
|
+
height: 26px;
|
|
110
|
+
padding: 0 8px;
|
|
111
|
+
border: 1px solid #dfe5ee;
|
|
112
|
+
border-radius: 5px;
|
|
113
|
+
background: #fff;
|
|
114
|
+
color: #4f5665;
|
|
115
|
+
font: inherit;
|
|
116
|
+
font-size: 11px;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.agent-header-btn:hover {
|
|
122
|
+
border-color: #bfdbff;
|
|
123
|
+
background: #f0f5ff;
|
|
124
|
+
color: #1677ff;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.agent-header-btn:disabled {
|
|
128
|
+
cursor: not-allowed;
|
|
129
|
+
opacity: 0.45;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.agent-panel.is-collapsed .agent-toggle {
|
|
133
|
+
height: auto;
|
|
134
|
+
padding: 8px 6px;
|
|
135
|
+
border-color: #bfdbff;
|
|
136
|
+
color: #1677ff;
|
|
137
|
+
line-height: 1.2;
|
|
138
|
+
writing-mode: vertical-rl;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.agent-context {
|
|
142
|
+
flex: 0 0 auto;
|
|
143
|
+
padding: 10px 12px;
|
|
144
|
+
border-bottom: 1px solid #edf0f5;
|
|
145
|
+
background: #fafcff;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.agent-context-label {
|
|
149
|
+
margin-bottom: 6px;
|
|
150
|
+
color: #7b8495;
|
|
151
|
+
font-size: 10px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.agent-context-chip {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 6px;
|
|
158
|
+
min-width: 0;
|
|
159
|
+
margin-top: 4px;
|
|
160
|
+
color: #4f5665;
|
|
161
|
+
font-size: 11px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.agent-context-kind {
|
|
165
|
+
flex: 0 0 auto;
|
|
166
|
+
min-width: 34px;
|
|
167
|
+
padding: 1px 5px;
|
|
168
|
+
border-radius: 3px;
|
|
169
|
+
background: #edf6ff;
|
|
170
|
+
color: #1677ff;
|
|
171
|
+
text-align: center;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.agent-context-value {
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
text-overflow: ellipsis;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.agent-quick-action {
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 30px;
|
|
183
|
+
margin-top: 9px;
|
|
184
|
+
border: 1px solid #bfdbff;
|
|
185
|
+
border-radius: 6px;
|
|
186
|
+
background: #fff;
|
|
187
|
+
color: #1677ff;
|
|
188
|
+
font: inherit;
|
|
189
|
+
font-size: 11px;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.agent-quick-action:hover { background: #edf6ff; }
|
|
194
|
+
.agent-quick-action:disabled { cursor: not-allowed; opacity: 0.45; }
|
|
195
|
+
|
|
196
|
+
.agent-messages {
|
|
197
|
+
flex: 1;
|
|
198
|
+
min-height: 0;
|
|
199
|
+
overflow-y: auto;
|
|
200
|
+
padding: 14px 12px 18px;
|
|
201
|
+
background: #f7f9fc;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.agent-empty {
|
|
205
|
+
padding: 40px 18px;
|
|
206
|
+
color: #7b8495;
|
|
207
|
+
font-size: 12px;
|
|
208
|
+
line-height: 1.7;
|
|
209
|
+
text-align: center;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.agent-empty-title {
|
|
213
|
+
margin-bottom: 6px;
|
|
214
|
+
color: #20242d;
|
|
215
|
+
font-size: 14px;
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.agent-message {
|
|
220
|
+
margin-bottom: 14px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.agent-message-role {
|
|
224
|
+
margin-bottom: 5px;
|
|
225
|
+
color: #7b8495;
|
|
226
|
+
font-size: 10px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.agent-message-body {
|
|
230
|
+
padding: 9px 10px;
|
|
231
|
+
border: 1px solid #e5eaf1;
|
|
232
|
+
border-radius: 8px;
|
|
233
|
+
background: #fff;
|
|
234
|
+
color: #2e3440;
|
|
235
|
+
font-size: 12px;
|
|
236
|
+
line-height: 1.65;
|
|
237
|
+
overflow-wrap: anywhere;
|
|
238
|
+
white-space: pre-wrap;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.agent-message.is-user .agent-message-body {
|
|
242
|
+
border-color: #cfe3ff;
|
|
243
|
+
background: #edf6ff;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.agent-message-context {
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-wrap: wrap;
|
|
249
|
+
gap: 4px;
|
|
250
|
+
margin-bottom: 5px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.agent-message-context span {
|
|
254
|
+
max-width: 100%;
|
|
255
|
+
padding: 1px 5px;
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
border: 1px solid #d8e7fa;
|
|
258
|
+
border-radius: 4px;
|
|
259
|
+
background: rgba(255,255,255,.75);
|
|
260
|
+
color: #5a6b82;
|
|
261
|
+
font-size: 9px;
|
|
262
|
+
text-overflow: ellipsis;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.agent-tool {
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: 7px;
|
|
270
|
+
margin-top: 5px;
|
|
271
|
+
padding: 5px 7px;
|
|
272
|
+
border: 1px solid #e4e9f0;
|
|
273
|
+
border-radius: 5px;
|
|
274
|
+
background: #fafbfc;
|
|
275
|
+
color: #687386;
|
|
276
|
+
font-size: 10px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.agent-tool-status {
|
|
280
|
+
width: 6px;
|
|
281
|
+
height: 6px;
|
|
282
|
+
flex: 0 0 auto;
|
|
283
|
+
border-radius: 50%;
|
|
284
|
+
background: #a8b2c3;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.agent-tool.is-running .agent-tool-status { background: #1677ff; }
|
|
288
|
+
.agent-tool.is-complete .agent-tool-status { background: #18b54a; }
|
|
289
|
+
.agent-tool.is-error .agent-tool-status { background: #d91f2f; }
|
|
290
|
+
|
|
291
|
+
.agent-request-card,
|
|
292
|
+
.agent-diff-card {
|
|
293
|
+
margin-bottom: 12px;
|
|
294
|
+
padding: 10px;
|
|
295
|
+
border: 1px solid #f1cf76;
|
|
296
|
+
border-radius: 7px;
|
|
297
|
+
background: #fffaf0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.agent-request-title,
|
|
301
|
+
.agent-diff-title {
|
|
302
|
+
margin-bottom: 6px;
|
|
303
|
+
color: #704b00;
|
|
304
|
+
font-size: 11px;
|
|
305
|
+
font-weight: 600;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.agent-request-desc,
|
|
309
|
+
.agent-diff-file {
|
|
310
|
+
color: #6b7280;
|
|
311
|
+
font-size: 10px;
|
|
312
|
+
line-height: 1.5;
|
|
313
|
+
overflow-wrap: anywhere;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.agent-request-actions {
|
|
317
|
+
display: flex;
|
|
318
|
+
flex-wrap: wrap;
|
|
319
|
+
gap: 6px;
|
|
320
|
+
margin-top: 8px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.agent-request-btn {
|
|
324
|
+
height: 25px;
|
|
325
|
+
padding: 0 8px;
|
|
326
|
+
border: 1px solid #d8dfe9;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
background: #fff;
|
|
329
|
+
color: #4f5665;
|
|
330
|
+
font: inherit;
|
|
331
|
+
font-size: 10px;
|
|
332
|
+
cursor: pointer;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.agent-request-btn.is-primary {
|
|
336
|
+
border-color: #1677ff;
|
|
337
|
+
background: #1677ff;
|
|
338
|
+
color: #fff;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.agent-question-field {
|
|
342
|
+
width: 100%;
|
|
343
|
+
height: 28px;
|
|
344
|
+
margin-top: 6px;
|
|
345
|
+
border: 1px solid #d8dfe9;
|
|
346
|
+
border-radius: 4px;
|
|
347
|
+
background: #fff;
|
|
348
|
+
color: #20242d;
|
|
349
|
+
font: inherit;
|
|
350
|
+
font-size: 10px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.agent-composer {
|
|
354
|
+
flex: 0 0 auto;
|
|
355
|
+
padding: 10px 12px 12px;
|
|
356
|
+
border-top: 1px solid #dfe5ee;
|
|
357
|
+
background: #fff;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.agent-input-wrap {
|
|
361
|
+
border: 1px solid #cfd7e3;
|
|
362
|
+
border-radius: 8px;
|
|
363
|
+
background: #fff;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.agent-input-wrap:focus-within {
|
|
367
|
+
border-color: #1677ff;
|
|
368
|
+
box-shadow: 0 0 0 2px rgba(22,119,255,.08);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.agent-input {
|
|
372
|
+
width: 100%;
|
|
373
|
+
min-height: 62px;
|
|
374
|
+
max-height: 160px;
|
|
375
|
+
padding: 9px 10px 4px;
|
|
376
|
+
resize: none;
|
|
377
|
+
border: 0;
|
|
378
|
+
outline: 0;
|
|
379
|
+
background: transparent;
|
|
380
|
+
color: #20242d;
|
|
381
|
+
font: inherit;
|
|
382
|
+
font-size: 12px;
|
|
383
|
+
line-height: 1.5;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.agent-input:disabled { background: #f7f8fa; color: #9aa4b3; }
|
|
387
|
+
|
|
388
|
+
.agent-composer-actions {
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
justify-content: space-between;
|
|
392
|
+
padding: 4px 6px 6px 10px;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.agent-composer-hint {
|
|
396
|
+
color: #a0a9b8;
|
|
397
|
+
font-size: 9px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.agent-send-btn,
|
|
401
|
+
.agent-stop-btn {
|
|
402
|
+
height: 28px;
|
|
403
|
+
min-width: 52px;
|
|
404
|
+
padding: 0 10px;
|
|
405
|
+
border: 0;
|
|
406
|
+
border-radius: 5px;
|
|
407
|
+
background: #1677ff;
|
|
408
|
+
color: #fff;
|
|
409
|
+
font: inherit;
|
|
410
|
+
font-size: 11px;
|
|
411
|
+
cursor: pointer;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.agent-stop-btn { background: #d91f2f; }
|
|
415
|
+
.agent-send-btn:disabled { cursor: not-allowed; background: #b9c9df; }
|
|
416
|
+
.agent-stop-btn[hidden], .agent-send-btn[hidden] { display: none; }
|
|
417
|
+
|
|
418
|
+
body.is-resizing-agent {
|
|
419
|
+
cursor: ew-resize;
|
|
420
|
+
user-select: none;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
body.is-resizing-agent .preview-frame { pointer-events: none; }
|
|
424
|
+
|
|
425
|
+
@media (max-width: 1180px) {
|
|
426
|
+
.agent-panel:not(.is-collapsed) {
|
|
427
|
+
width: 340px;
|
|
428
|
+
}
|
|
429
|
+
}
|