mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-07 00:25:51 +00:00
ci: auto build & obfuscate [2026-05-16 19:16:28] (Jenkins #21)
This commit is contained in:
21
core/table-system/dto/Change.js
Normal file
21
core/table-system/dto/Change.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* applyOperations 推演完成后吐出的变更记录。供高亮、SuperMemory 同步、UI 刷新使用。
|
||||
*
|
||||
* 注意 type 只有 'update' 和 'delete' 两种 —— insertRow 在 executor.js 历史实现里
|
||||
* 也吐 type='update'(每个被填的单元格一条),不要发明 'insert' type。
|
||||
*
|
||||
* @typedef {Object} UpdateChange
|
||||
* @property {'update'} type
|
||||
* @property {number} tableIndex
|
||||
* @property {number} rowIndex
|
||||
* @property {number} colIndex
|
||||
*
|
||||
* @typedef {Object} DeleteChange
|
||||
* @property {'delete'} type
|
||||
* @property {number} tableIndex
|
||||
* @property {number} rowIndex
|
||||
*
|
||||
* @typedef {UpdateChange | DeleteChange} Change
|
||||
*/
|
||||
|
||||
export {};
|
||||
26
core/table-system/dto/Operation.js
Normal file
26
core/table-system/dto/Operation.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* LLM 输出的统一动作格式。无论 formatter 是 legacy / json / toolcall,
|
||||
* 解析完都吐 Operation[],下游 applyOperations 不关心来源。
|
||||
*
|
||||
* data 字段的 key 是列索引的字符串形式('0', '1', ...),与 executor.js 历史行为对齐。
|
||||
*
|
||||
* @typedef {Object} InsertRowOperation
|
||||
* @property {'insertRow'} op
|
||||
* @property {number} tableIndex
|
||||
* @property {Object<string, string>} data { [colIndex]: cellValue }
|
||||
*
|
||||
* @typedef {Object} UpdateRowOperation
|
||||
* @property {'updateRow'} op
|
||||
* @property {number} tableIndex
|
||||
* @property {number} rowIndex
|
||||
* @property {Object<string, string>} data
|
||||
*
|
||||
* @typedef {Object} DeleteRowOperation
|
||||
* @property {'deleteRow'} op
|
||||
* @property {number} tableIndex
|
||||
* @property {number} rowIndex
|
||||
*
|
||||
* @typedef {InsertRowOperation | UpdateRowOperation | DeleteRowOperation} Operation
|
||||
*/
|
||||
|
||||
export {};
|
||||
38
core/table-system/dto/Table.js
Normal file
38
core/table-system/dto/Table.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file 表格相关数据形状(DTO)
|
||||
* 对应运行时存于 message.extra.amily2_tables_data 的结构。
|
||||
*/
|
||||
|
||||
/**
|
||||
* 单元格内容;空值约定为空串而非 null/undefined。
|
||||
* @typedef {string} Cell
|
||||
*/
|
||||
|
||||
/**
|
||||
* 行状态。'pending-deletion' 表示已标记待删除(延迟删除机制)。
|
||||
* @typedef {'normal' | 'pending-deletion'} RowStatus
|
||||
*/
|
||||
|
||||
/**
|
||||
* 单张表格。
|
||||
* @typedef {Object} Table
|
||||
* @property {string} name 表格名(唯一标识 + UI 显示名)
|
||||
* @property {string[]} headers 列头数组,长度 = 列数
|
||||
* @property {Cell[][]} rows 行数据,二维数组,rows[i].length = headers.length
|
||||
* @property {RowStatus[]} [rowStatuses] 行状态数组,与 rows 等长
|
||||
* @property {(number|null)[]} [columnWidths] 列宽数组(UI 用),与 headers 等长,null 表示自适应
|
||||
* @property {string} [note] 表格说明
|
||||
* @property {string} [rule_add] 添加行规则(自然语言)
|
||||
* @property {string} [rule_delete] 删除行规则
|
||||
* @property {string} [rule_update] 更新行规则
|
||||
* @property {Object<string, number>} [charLimitRules] 多列字符限制:{ "colIndexStr": maxChars }
|
||||
* @property {number} [rowLimitRule] 行数上限,0 表示不限
|
||||
* @property {number} [simplifyRowThreshold] 历史行简化阈值,0 表示不简化
|
||||
*/
|
||||
|
||||
/**
|
||||
* 表格集合 = 全局状态。
|
||||
* @typedef {Table[]} TableState
|
||||
*/
|
||||
|
||||
export {};
|
||||
9
core/table-system/dto/TableState.js
Normal file
9
core/table-system/dto/TableState.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @file TableState 的实际定义已合并至 ./Table.js(与 Table 共处一处便于阅读)。
|
||||
* 本文件保留为转发别名,供需要按 dto 名称单独导入的消费方使用:
|
||||
* /** @typedef {import('./TableState.js').TableState} TableState *\/
|
||||
*
|
||||
* @typedef {import('./Table.js').TableState} TableState
|
||||
*/
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user