@arcticdata/dsh-datarc-assistant 0.0.0-stage → 26.39.1
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 +46 -2
- package/api-operations.js +404 -0
- package/client.js +475 -0
- package/cordis.patch.yml +4 -0
- package/entry/SKILL.md +34 -0
- package/icon.png +0 -0
- package/index.js +69 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/native-api.mjs +326 -0
- package/native-contracts.js +195 -0
- package/native-execution.js +184 -0
- package/native-runner.mjs +107 -0
- package/native-state.js +67 -0
- package/native-tools.js +241 -0
- package/operations.js +1260 -0
- package/package.json +65 -6
- package/runtime/datarc-access-permissions/SKILL.md +30 -0
- package/runtime/datarc-access-permissions/references/api.md +31 -0
- package/runtime/datarc-access-permissions/references/write-order.md +16 -0
- package/runtime/datarc-analysis-report/SKILL.md +125 -0
- package/runtime/datarc-analysis-report/agents/openai.yaml +6 -0
- package/runtime/datarc-analysis-report/references/analyst-frameworks.md +215 -0
- package/runtime/datarc-analysis-report/references/api-contracts.md +478 -0
- package/runtime/datarc-analysis-report/references/direct-card-fallback-design.md +66 -0
- package/runtime/datarc-analysis-report/references/human-in-the-loop.md +142 -0
- package/runtime/datarc-analysis-report/references/loop-personalization-policy.md +138 -0
- package/runtime/datarc-analysis-report/references/manifest-example.json +779 -0
- package/runtime/datarc-analysis-report/references/narrative-schema.md +160 -0
- package/runtime/datarc-analysis-report/references/question-syntax.md +151 -0
- package/runtime/datarc-analysis-report/scripts/run_analysis_report.py +2225 -0
- package/runtime/datarc-analysis-report/scripts/run_dataseek_cards.py +1914 -0
- package/runtime/datarc-analysis-report/scripts/test_run_analysis_report.py +5295 -0
- package/runtime/datarc-data-search/SKILL.md +243 -0
- package/runtime/datarc-data-search/scripts/calculate.py +116 -0
- package/runtime/datarc-data-search/scripts/data-search.mjs +628 -0
- package/runtime/datarc-data-search/scripts/datarc-client.mjs +464 -0
- package/runtime/datarc-data-search/scripts/search-result.mjs +211 -0
- package/runtime/datarc-dataseek-batch-evaluation/SKILL.md +59 -0
- package/runtime/datarc-dataseek-batch-evaluation/references/artifacts.md +36 -0
- package/runtime/datarc-dataseek-batch-evaluation/references/equivalence.md +30 -0
- package/runtime/datarc-dataseek-batch-evaluation/scripts/datarc-client.mjs +464 -0
- package/runtime/datarc-dataseek-batch-evaluation/scripts/dataseek-batch-evaluation.mjs +1020 -0
- package/runtime/datarc-dataseek-search/SKILL.md +96 -0
- package/runtime/datarc-dataseek-search/scripts/datarc-client.mjs +464 -0
- package/runtime/datarc-dataseek-search/scripts/dataseek-search.mjs +257 -0
- package/runtime/datarc-dataseek-semantic-debugging/SKILL.md +44 -0
- package/runtime/datarc-dataseek-semantic-debugging/agents/openai.yaml +4 -0
- package/runtime/datarc-dataseek-semantic-debugging/evals/evals.json +165 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/dataset.md +77 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/input-and-resolution.md +93 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/interventions.md +64 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/knowledge-and-prompts.md +47 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/rollback.md +11 -0
- package/runtime/datarc-dataseek-semantic-debugging/references/verification-and-rollback.md +95 -0
- package/runtime/datarc-dataseek-semantic-debugging/scripts/semantic-debugging.mjs +29 -0
- package/runtime/datarc-dataseek-testset-generation/SKILL.md +47 -0
- package/runtime/datarc-dataseek-testset-generation/scripts/datarc-client.mjs +464 -0
- package/runtime/datarc-dataseek-testset-generation/scripts/dataseek-testset-generation.mjs +526 -0
- package/runtime/datarc-datasource/SKILL.md +97 -0
- package/runtime/datarc-oauth/SKILL.md +50 -0
- package/runtime/datarc-oauth/scripts/auth.mjs +192 -0
- package/runtime/datarc-oauth/scripts/credentials.mjs +237 -0
- package/runtime/datarc-report-add-card/SKILL.md +90 -0
- package/runtime/datarc-report-add-card/agents/openai.yaml +4 -0
- package/runtime/datarc-report-add-card/scripts/datarc-client.mjs +464 -0
- package/runtime/datarc-report-add-card/scripts/report-card.mjs +439 -0
- package/runtime/datarc-semantic-alias/SKILL.md +20 -0
- package/runtime/datarc-semantic-alias/scripts/alias-plan.mjs +422 -0
- package/runtime/datarc-semantic-alias/scripts/alias.mjs +11 -0
- package/runtime/datarc-semantic-calibration/SKILL.md +20 -0
- package/runtime/datarc-semantic-calibration/scripts/calibration-plan.mjs +683 -0
- package/runtime/datarc-semantic-calibration/scripts/calibration.mjs +11 -0
- package/runtime/datarc-semantic-core/SKILL.md +12 -0
- package/runtime/datarc-semantic-core/scripts/artifact-journal.mjs +853 -0
- package/runtime/datarc-semantic-core/scripts/canonical.mjs +48 -0
- package/runtime/datarc-semantic-core/scripts/case-model.mjs +608 -0
- package/runtime/datarc-semantic-core/scripts/cli.mjs +180 -0
- package/runtime/datarc-semantic-core/scripts/datarc-client.mjs +180 -0
- package/runtime/datarc-semantic-core/scripts/interpretation-pairs.mjs +57 -0
- package/runtime/datarc-semantic-core/scripts/interventions.mjs +693 -0
- package/runtime/datarc-semantic-core/scripts/live-resolution.mjs +305 -0
- package/runtime/datarc-semantic-core/scripts/model-scope.mjs +49 -0
- package/runtime/datarc-semantic-core/scripts/reproduction.mjs +330 -0
- package/runtime/datarc-semantic-core/scripts/semantic-cli.mjs +799 -0
- package/runtime/datarc-semantic-core/scripts/shared.mjs +312 -0
- package/runtime/datarc-semantic-core/scripts/verification.mjs +1111 -0
- package/runtime/datarc-semantic-dataset/SKILL.md +20 -0
- package/runtime/datarc-semantic-dataset/scripts/dataset-plan.mjs +749 -0
- package/runtime/datarc-semantic-dataset/scripts/dataset-preflight.mjs +813 -0
- package/runtime/datarc-semantic-dataset/scripts/dataset.mjs +11 -0
- package/runtime/datarc-semantic-knowledge/SKILL.md +38 -0
- package/runtime/datarc-semantic-knowledge/references/knowledge-drafts.md +61 -0
- package/runtime/datarc-semantic-knowledge/references/knowledge-generation.json +16 -0
- package/runtime/datarc-semantic-knowledge/scripts/knowledge-draft.mjs +347 -0
- package/runtime/datarc-semantic-knowledge/scripts/knowledge-plan.mjs +848 -0
- package/runtime/datarc-semantic-knowledge/scripts/knowledge.mjs +31 -0
- package/runtime/datarc-semantic-prompt/SKILL.md +20 -0
- package/runtime/datarc-semantic-prompt/scripts/prompt-plan.mjs +598 -0
- package/runtime/datarc-semantic-prompt/scripts/prompt.mjs +15 -0
- package/runtime/datarc-semantic-synonym/SKILL.md +20 -0
- package/runtime/datarc-semantic-synonym/scripts/synonym-plan.mjs +688 -0
- package/runtime/datarc-semantic-synonym/scripts/synonym.mjs +11 -0
- package/runtime/datarc-viz-analysis-report/SKILL.md +108 -0
- package/runtime/datarc-viz-analysis-report/assets/LICENSE-echarts.md +8 -0
- package/runtime/datarc-viz-analysis-report/assets/echarts.min.js +45 -0
- package/runtime/datarc-viz-analysis-report/references/api-contracts.md +163 -0
- package/runtime/datarc-viz-analysis-report/references/derivation-log.md +157 -0
- package/runtime/datarc-viz-analysis-report/references/evidence-framework.md +76 -0
- package/runtime/datarc-viz-analysis-report/references/html-template.md +92 -0
- package/runtime/datarc-viz-analysis-report/references/provenance-format.md +56 -0
- package/runtime/datarc-viz-analysis-report/references/question-syntax.md +151 -0
- package/runtime/datarc-viz-analysis-report/scripts/render_viz_report.py +1708 -0
- package/runtime/datarc-viz-analysis-report/scripts/test_render_viz_report.py +964 -0
- package/runtime/datarc-workspace-configuration/SKILL.md +59 -0
- package/runtime/datarc-workspace-configuration/references/artifacts.md +75 -0
- package/runtime/datarc-workspace-configuration/references/verification.md +20 -0
- package/runtime/datarc-workspace-configuration/scripts/configuration.mjs +722 -0
- package/runtime/datarc-workspace-context/SKILL.md +43 -0
- package/runtime/datarc-workspace-context/agents/openai.yaml +4 -0
- package/runtime/datarc-workspace-context/scripts/datarc-client.mjs +31 -0
- package/runtime/datarc-workspace-context/scripts/query-display.mjs +114 -0
- package/runtime/datarc-workspace-context/scripts/workspace-context.mjs +58 -0
- package/runtime/datarc-workspace-custom-tables/SKILL.md +89 -0
- package/runtime/datarc-workspace-custom-tables/scripts/datarc-client.mjs +165 -0
- package/runtime/datarc-workspace-custom-tables/scripts/workspace-custom-tables.mjs +601 -0
- package/runtime/datarc-workspace-keywords/SKILL.md +197 -0
- package/runtime/datarc-workspace-keywords/agents/openai.yaml +4 -0
- package/runtime/datarc-workspace-keywords/references/api-fields.md +79 -0
- package/runtime/datarc-workspace-keywords/references/derived-measures.md +177 -0
- package/runtime/datarc-workspace-keywords/scripts/datarc-client.mjs +145 -0
- package/runtime/datarc-workspace-keywords/scripts/workspace-keywords.mjs +2421 -0
- package/runtime/datarc-workspace-membership/SKILL.md +29 -0
- package/runtime/datarc-workspace-membership/references/api.md +19 -0
- package/runtime/datarc-workspace-modeling/SKILL.md +209 -0
- package/runtime/datarc-workspace-modeling/agents/openai.yaml +4 -0
- package/runtime/datarc-workspace-modeling/references/join-preview.md +38 -0
- package/runtime/datarc-workspace-modeling/references/model-plan.md +300 -0
- package/runtime/datarc-workspace-modeling/references/model-tags.md +95 -0
- package/runtime/datarc-workspace-modeling/references/modeling-contract.json +29 -0
- package/runtime/datarc-workspace-modeling/references/modeling-fixtures.json +2423 -0
- package/runtime/datarc-workspace-modeling/scripts/datarc-client.mjs +137 -0
- package/runtime/datarc-workspace-modeling/scripts/workspace-model-tags.mjs +238 -0
- package/runtime/datarc-workspace-modeling/scripts/workspace-modeling.mjs +1261 -0
- package/skills-provider.js +51 -0
- package/workflow-index.json +434 -0
package/operations.js
ADDED
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
// The native adapter accepts only these named operations and declared parameters.
|
|
2
|
+
// Business command paths are installation-owned. calculate_custom executes the
|
|
3
|
+
// user-workspace Python file, as allowed by the original data-search workflow.
|
|
4
|
+
// write describes business effects; confirmation follows each original skill.
|
|
5
|
+
const text = (flag, description, extra = {}) => ({
|
|
6
|
+
type: 'string',
|
|
7
|
+
description,
|
|
8
|
+
flag,
|
|
9
|
+
...extra,
|
|
10
|
+
});
|
|
11
|
+
const integer = (flag, description) => ({ type: 'integer', description, flag });
|
|
12
|
+
const switchFlag = (flag, description) => ({
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
description,
|
|
15
|
+
flag,
|
|
16
|
+
switch: true,
|
|
17
|
+
});
|
|
18
|
+
const strings = (flag, description) => ({
|
|
19
|
+
type: 'array',
|
|
20
|
+
items: { type: 'string' },
|
|
21
|
+
description,
|
|
22
|
+
flag,
|
|
23
|
+
repeat: true,
|
|
24
|
+
});
|
|
25
|
+
const positional = (position, description) => ({
|
|
26
|
+
type: 'string',
|
|
27
|
+
description,
|
|
28
|
+
position,
|
|
29
|
+
});
|
|
30
|
+
const workspace = {
|
|
31
|
+
workspace_id: integer('workspace-id', '已确认且当前身份可访问的业务工作区 ID。'),
|
|
32
|
+
};
|
|
33
|
+
const paging = {
|
|
34
|
+
offset: integer('offset', '从零开始的偏移量。'),
|
|
35
|
+
limit: integer('limit', '本次最多读取的记录数。'),
|
|
36
|
+
};
|
|
37
|
+
const polling = {
|
|
38
|
+
poll_interval_ms: integer('poll-interval-ms', '有限轮询间隔,单位毫秒。'),
|
|
39
|
+
max_wait_ms: integer('max-wait-ms', '本次有限等待上限,单位毫秒;超时不代表远端任务已取消。'),
|
|
40
|
+
};
|
|
41
|
+
const input = {
|
|
42
|
+
input_file: text('input', '会话目录内已准备并按本操作契约校验的输入文件路径。'),
|
|
43
|
+
};
|
|
44
|
+
const output = {
|
|
45
|
+
output_file: text('output', '会话目录内的输出文件路径;不得覆盖输入或已有证据。'),
|
|
46
|
+
};
|
|
47
|
+
const modelUids = {
|
|
48
|
+
model_uids: strings('model-uid', '用户已确认的模型 UID;未限定模型时省略。'),
|
|
49
|
+
};
|
|
50
|
+
const exportOptions = {
|
|
51
|
+
extension: text('extension', '导出格式。', { enum: ['csv', 'xlsx'] }),
|
|
52
|
+
download: switchFlag('download', '下载到当前会话目录;需要唯一 task_id。'),
|
|
53
|
+
output_dir: text('output-dir', '当前会话目录内的相对下载目录。'),
|
|
54
|
+
task_id: text('task-id', '本次下载唯一标识,使用字母、数字、点、下划线或短横线。'),
|
|
55
|
+
};
|
|
56
|
+
const script = (skill, file) => `${skill}/scripts/${file}`;
|
|
57
|
+
const operation = (file, command, description, parameters = {}, required = [], write = false) => ({
|
|
58
|
+
script: file,
|
|
59
|
+
interpreter: file.endsWith('.py') ? 'python' : 'node',
|
|
60
|
+
command,
|
|
61
|
+
description,
|
|
62
|
+
parameters,
|
|
63
|
+
required,
|
|
64
|
+
write,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const authScript = script('datarc-oauth', 'auth.mjs');
|
|
68
|
+
const workspaceScript = script('datarc-workspace-context', 'workspace-context.mjs');
|
|
69
|
+
const queryScript = script('datarc-data-search', 'data-search.mjs');
|
|
70
|
+
const dataseekScript = script('datarc-dataseek-search', 'dataseek-search.mjs');
|
|
71
|
+
const calculateScript = script('datarc-data-search', 'calculate.py');
|
|
72
|
+
const modelingScript = script('datarc-workspace-modeling', 'workspace-modeling.mjs');
|
|
73
|
+
const keywordScript = script('datarc-workspace-keywords', 'workspace-keywords.mjs');
|
|
74
|
+
const tableScript = script('datarc-workspace-custom-tables', 'workspace-custom-tables.mjs');
|
|
75
|
+
const reportCardScript = script('datarc-report-add-card', 'report-card.mjs');
|
|
76
|
+
const reportScript = script('datarc-analysis-report', 'run_analysis_report.py');
|
|
77
|
+
const reportCardsScript = script('datarc-analysis-report', 'run_dataseek_cards.py');
|
|
78
|
+
const semanticScript = script('datarc-dataseek-semantic-debugging', 'semantic-debugging.mjs');
|
|
79
|
+
const knowledgeScript = script('datarc-semantic-knowledge', 'knowledge.mjs');
|
|
80
|
+
const generationScript = script('datarc-dataseek-testset-generation', 'dataseek-testset-generation.mjs');
|
|
81
|
+
const evaluationScript = script('datarc-dataseek-batch-evaluation', 'dataseek-batch-evaluation.mjs');
|
|
82
|
+
const configurationScript = script('datarc-workspace-configuration', 'configuration.mjs');
|
|
83
|
+
const queryQuestion = {
|
|
84
|
+
question: text('question', '保留已确认业务口径的自然语言问题。'),
|
|
85
|
+
};
|
|
86
|
+
const fromResult = {
|
|
87
|
+
from_result: text('from-result', '当前会话中已确认的查询结果文件引用。'),
|
|
88
|
+
};
|
|
89
|
+
const thread = {
|
|
90
|
+
thread_uid: text('thread-uid', '当前任务已创建的 DataSeek 会话 UID。'),
|
|
91
|
+
};
|
|
92
|
+
const dataseekLimits = {
|
|
93
|
+
...polling,
|
|
94
|
+
max_depth: integer('max-depth', '嵌套拆解最大深度。'),
|
|
95
|
+
max_questions: integer('max-questions', '子问题数量上限。'),
|
|
96
|
+
};
|
|
97
|
+
const modelInput = { ...workspace, ...input };
|
|
98
|
+
const searchActivation = {
|
|
99
|
+
apply_search: switchFlag('apply-search', '模型就绪后直接执行计划中的搜索维度开启。'),
|
|
100
|
+
defer_search: switchFlag('defer-search', '暂缓搜索维度开启,供全部模型就绪后统一执行。'),
|
|
101
|
+
max_cardinality: integer('max-cardinality', '可搜索维度基数上限,不得超过脚本硬上限。'),
|
|
102
|
+
...polling,
|
|
103
|
+
};
|
|
104
|
+
const keywordResource = {
|
|
105
|
+
resource: text('resource', '工作区语义资源类型。', {
|
|
106
|
+
enum: ['measure', 'dimension', 'time-series', 'dimension-table'],
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
const keywordId = {
|
|
110
|
+
id: text('id', '指标、维度、时间维度的数字 ID,或维度表 UID。'),
|
|
111
|
+
};
|
|
112
|
+
const tagRevision = {
|
|
113
|
+
revision: text('revision', '读取标签目录取得的当前版本;变更后须重新规划。'),
|
|
114
|
+
};
|
|
115
|
+
const tagId = {
|
|
116
|
+
tag_id: text('tag-id', '从当前工作区标签目录精确选择的 UID。'),
|
|
117
|
+
};
|
|
118
|
+
const project = {
|
|
119
|
+
project_id: integer('project-id', '已确认的报告所属业务工作区 ID。'),
|
|
120
|
+
};
|
|
121
|
+
const selectCard = {
|
|
122
|
+
card_file: text('card-file', '当前会话查询结果的 JSON 文件路径。'),
|
|
123
|
+
result_index: integer('result-index', '从零开始的结果序号;多结果时必须精确选择。'),
|
|
124
|
+
card_index: integer('card-index', '从零开始的数据卡序号;多卡时必须精确选择。'),
|
|
125
|
+
};
|
|
126
|
+
const reportManifest = {
|
|
127
|
+
manifest_file: positional(1, '已确认的报告 manifest JSON 文件。'),
|
|
128
|
+
};
|
|
129
|
+
const semanticInputOutput = { ...input, ...output };
|
|
130
|
+
|
|
131
|
+
export const DOMAINS = {
|
|
132
|
+
auth: {
|
|
133
|
+
title: '连接与授权',
|
|
134
|
+
description: '检查北极九章连接配置或发起业务用户网页授权,不向模型返回令牌。',
|
|
135
|
+
workflows: ['datarc-oauth'],
|
|
136
|
+
operations: {
|
|
137
|
+
status: operation(authScript, 'status', '读取脱敏的配置状态。'),
|
|
138
|
+
login: operation(
|
|
139
|
+
authScript,
|
|
140
|
+
'login',
|
|
141
|
+
'通过网页授权登录并保存当前会话目录的凭据。',
|
|
142
|
+
{
|
|
143
|
+
endpoint: text('endpoint', '用户指定的北极九章服务入口,不含凭据、查询或片段。'),
|
|
144
|
+
},
|
|
145
|
+
['endpoint'],
|
|
146
|
+
),
|
|
147
|
+
import_credentials: {
|
|
148
|
+
script: authScript,
|
|
149
|
+
interpreter: 'node',
|
|
150
|
+
command: 'login',
|
|
151
|
+
stdinParameter: 'credential_file',
|
|
152
|
+
description: '将用户已有的私有JSON凭据文件作为原login的安全标准输入,不把令牌写入参数、预览或额外副本。',
|
|
153
|
+
parameters: {
|
|
154
|
+
credential_file: {
|
|
155
|
+
type: 'string',
|
|
156
|
+
file: true,
|
|
157
|
+
secretFile: true,
|
|
158
|
+
description: '用户安全渠道准备的私有JSON文件;内容不进入工具参数或日志。',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
required: ['credential_file'],
|
|
162
|
+
write: true,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
workspace: {
|
|
167
|
+
title: '工作区与上下文',
|
|
168
|
+
description: '发现可访问业务工作区、验证名称选择并读取模型上下文;默认值保存需用户同意。',
|
|
169
|
+
workflows: ['datarc-workspace-context'],
|
|
170
|
+
operations: {
|
|
171
|
+
list: operation(workspaceScript, 'workspaces', '列出当前账号可访问的业务工作区。', { query: text('query', '工作区名称筛选。'), ...paging }),
|
|
172
|
+
get: operation(workspaceScript, 'workspace', '验证已选业务工作区的身份与访问能力。', workspace, ['workspace_id']),
|
|
173
|
+
context: operation(workspaceScript, 'get', '读取所选工作区的模型、指标、维度上下文。', workspace, ['workspace_id']),
|
|
174
|
+
default: operation(workspaceScript, 'default', '实时校验已保存的默认工作区;无默认值时返回空。'),
|
|
175
|
+
set_default: operation(
|
|
176
|
+
workspaceScript,
|
|
177
|
+
'set-default',
|
|
178
|
+
'用户同意后保存当前身份绑定的默认工作区。',
|
|
179
|
+
{
|
|
180
|
+
...workspace,
|
|
181
|
+
confirm: text('confirm', '须先取得用户明确同意。', { enum: ['yes'] }),
|
|
182
|
+
},
|
|
183
|
+
['workspace_id', 'confirm'],
|
|
184
|
+
true,
|
|
185
|
+
),
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
query: {
|
|
189
|
+
title: '数据查询与计算',
|
|
190
|
+
description: '发现字段、查询和连续追问、分页导出,以及基于真实结果计算占比和期间增长。',
|
|
191
|
+
workflows: ['datarc-data-search', 'datarc-dataseek-search'],
|
|
192
|
+
operations: {
|
|
193
|
+
catalog: operation(queryScript, 'catalog', '读取工作区模型和字段目录。', { ...workspace, ...paging }, ['workspace_id']),
|
|
194
|
+
dimension_values: operation(
|
|
195
|
+
queryScript,
|
|
196
|
+
'dimension-values',
|
|
197
|
+
'按已确认的维度名称检索维度值。',
|
|
198
|
+
{
|
|
199
|
+
...workspace,
|
|
200
|
+
dimension: text('dimension', '可唯一定位的业务维度名称。'),
|
|
201
|
+
query: text('query', '维度值筛选。'),
|
|
202
|
+
...paging,
|
|
203
|
+
},
|
|
204
|
+
['workspace_id', 'dimension'],
|
|
205
|
+
),
|
|
206
|
+
dimension_values_by_prop: operation(
|
|
207
|
+
queryScript,
|
|
208
|
+
'dimension-values',
|
|
209
|
+
'按已确认 prop 检索维度值。',
|
|
210
|
+
{
|
|
211
|
+
...workspace,
|
|
212
|
+
prop: text('prop', '当前工作区确认的维度 prop。'),
|
|
213
|
+
query: text('query', '维度值筛选。'),
|
|
214
|
+
...paging,
|
|
215
|
+
},
|
|
216
|
+
['workspace_id', 'prop'],
|
|
217
|
+
),
|
|
218
|
+
inspect: operation(queryScript, 'inspect', '检查自然语言问题的识别结果,不执行最终查询。', { ...workspace, ...queryQuestion }, [
|
|
219
|
+
'workspace_id',
|
|
220
|
+
'question',
|
|
221
|
+
]),
|
|
222
|
+
search: operation(
|
|
223
|
+
queryScript,
|
|
224
|
+
'search',
|
|
225
|
+
'执行一个自然语言查询。',
|
|
226
|
+
{
|
|
227
|
+
...workspace,
|
|
228
|
+
...queryQuestion,
|
|
229
|
+
...modelUids,
|
|
230
|
+
inspection_file: text('inspection', '同一原问题已就绪的分词检查文件。'),
|
|
231
|
+
...paging,
|
|
232
|
+
...polling,
|
|
233
|
+
...exportOptions,
|
|
234
|
+
},
|
|
235
|
+
['workspace_id', 'question'],
|
|
236
|
+
),
|
|
237
|
+
search_plan: operation(
|
|
238
|
+
queryScript,
|
|
239
|
+
'search',
|
|
240
|
+
'执行 single、parallel 或 chained 查询计划文件。',
|
|
241
|
+
{
|
|
242
|
+
...workspace,
|
|
243
|
+
...input,
|
|
244
|
+
...modelUids,
|
|
245
|
+
...paging,
|
|
246
|
+
...polling,
|
|
247
|
+
...exportOptions,
|
|
248
|
+
},
|
|
249
|
+
['workspace_id', 'input_file'],
|
|
250
|
+
),
|
|
251
|
+
continue_search: operation(
|
|
252
|
+
queryScript,
|
|
253
|
+
'search',
|
|
254
|
+
'沿用当前会话已有结果的工作区与模型继续查询。',
|
|
255
|
+
{
|
|
256
|
+
...fromResult,
|
|
257
|
+
...queryQuestion,
|
|
258
|
+
...modelUids,
|
|
259
|
+
...paging,
|
|
260
|
+
...polling,
|
|
261
|
+
...exportOptions,
|
|
262
|
+
},
|
|
263
|
+
['from_result', 'question'],
|
|
264
|
+
),
|
|
265
|
+
continue_plan: operation(
|
|
266
|
+
queryScript,
|
|
267
|
+
'search',
|
|
268
|
+
'沿用已有结果上下文执行补查计划。',
|
|
269
|
+
{
|
|
270
|
+
...fromResult,
|
|
271
|
+
...input,
|
|
272
|
+
...modelUids,
|
|
273
|
+
...paging,
|
|
274
|
+
...polling,
|
|
275
|
+
...exportOptions,
|
|
276
|
+
},
|
|
277
|
+
['from_result', 'input_file'],
|
|
278
|
+
),
|
|
279
|
+
recall: operation(queryScript, 'recall', '读取已确认查询结果文件中的业务预览和覆盖范围。', { ...workspace, ...fromResult }, ['from_result']),
|
|
280
|
+
page: operation(queryScript, 'page', '为查询结果读取指定分页。', { ...workspace, ...input, ...paging, ...polling }, [
|
|
281
|
+
'workspace_id',
|
|
282
|
+
'input_file',
|
|
283
|
+
]),
|
|
284
|
+
export: operation(queryScript, 'export', '导出查询结果,可在授权的当前目录下载。', { ...workspace, ...input, ...exportOptions, ...polling }, [
|
|
285
|
+
'workspace_id',
|
|
286
|
+
'input_file',
|
|
287
|
+
]),
|
|
288
|
+
dataseek_ask: operation(
|
|
289
|
+
dataseekScript,
|
|
290
|
+
'ask',
|
|
291
|
+
'新建或沿用 DataSeek 会话并执行问题。',
|
|
292
|
+
{ ...workspace, ...queryQuestion, ...thread, ...dataseekLimits },
|
|
293
|
+
['workspace_id', 'question'],
|
|
294
|
+
),
|
|
295
|
+
dataseek_follow_up: operation(
|
|
296
|
+
dataseekScript,
|
|
297
|
+
'follow-up',
|
|
298
|
+
'在当前已确认的 DataSeek 会话内追问。',
|
|
299
|
+
{ ...workspace, ...queryQuestion, ...thread, ...dataseekLimits },
|
|
300
|
+
['workspace_id', 'question', 'thread_uid'],
|
|
301
|
+
),
|
|
302
|
+
dataseek_retry: operation(
|
|
303
|
+
dataseekScript,
|
|
304
|
+
'retry',
|
|
305
|
+
'重试已确认失败的 DataSeek 消息;先核对当前状态。',
|
|
306
|
+
{
|
|
307
|
+
...workspace,
|
|
308
|
+
...thread,
|
|
309
|
+
message_id: text('message-id', '目标消息 ID。'),
|
|
310
|
+
},
|
|
311
|
+
['workspace_id', 'thread_uid', 'message_id'],
|
|
312
|
+
),
|
|
313
|
+
dataseek_abort: operation(
|
|
314
|
+
dataseekScript,
|
|
315
|
+
'abort',
|
|
316
|
+
'请求取消指定 DataSeek 消息,不承诺已回滚远端操作。',
|
|
317
|
+
{
|
|
318
|
+
...workspace,
|
|
319
|
+
...thread,
|
|
320
|
+
message_id: text('message-id', '目标消息 ID。'),
|
|
321
|
+
},
|
|
322
|
+
['workspace_id', 'thread_uid', 'message_id'],
|
|
323
|
+
),
|
|
324
|
+
dataseek_page: operation(dataseekScript, 'page', '分页读取 DataSeek 卡片结果。', { ...workspace, ...input, ...paging }, [
|
|
325
|
+
'workspace_id',
|
|
326
|
+
'input_file',
|
|
327
|
+
]),
|
|
328
|
+
dataseek_export: operation(
|
|
329
|
+
dataseekScript,
|
|
330
|
+
'export',
|
|
331
|
+
'导出 DataSeek 卡片结果。',
|
|
332
|
+
{ ...workspace, ...input, extension: exportOptions.extension },
|
|
333
|
+
['workspace_id', 'input_file'],
|
|
334
|
+
),
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
report: {
|
|
338
|
+
title: '报告与证据',
|
|
339
|
+
description: '选择已有查询卡片、创建或追加可编辑报告,以及校验分析计划、证据和离线 HTML。',
|
|
340
|
+
workflows: ['datarc-report-add-card', 'datarc-analysis-report', 'datarc-viz-analysis-report'],
|
|
341
|
+
operations: {
|
|
342
|
+
select_card: operation(reportCardScript, 'select', '从当前结果中唯一选择一张已有数据卡。', { ...project, ...selectCard }, ['card_file']),
|
|
343
|
+
list: operation(
|
|
344
|
+
reportCardScript,
|
|
345
|
+
'list',
|
|
346
|
+
'列出当前成员可编辑的报告候选。',
|
|
347
|
+
{
|
|
348
|
+
...project,
|
|
349
|
+
query: text('q', '报告名称筛选。'),
|
|
350
|
+
limit: integer('limit', '候选数量上限。'),
|
|
351
|
+
recent_limit: integer('recent-limit', '最近报告读取数量。'),
|
|
352
|
+
},
|
|
353
|
+
['project_id'],
|
|
354
|
+
),
|
|
355
|
+
create: operation(
|
|
356
|
+
reportCardScript,
|
|
357
|
+
'create',
|
|
358
|
+
'创建一个空白可编辑报告。',
|
|
359
|
+
{
|
|
360
|
+
...project,
|
|
361
|
+
name: text('name', '1至255字符的报告名称。'),
|
|
362
|
+
description: text('desc', '最多255字符的报告介绍。'),
|
|
363
|
+
},
|
|
364
|
+
['project_id', 'name'],
|
|
365
|
+
true,
|
|
366
|
+
),
|
|
367
|
+
add_card: operation(
|
|
368
|
+
reportCardScript,
|
|
369
|
+
'add',
|
|
370
|
+
'向一个已确认可编辑报告保存一张已选数据卡并回读。',
|
|
371
|
+
{
|
|
372
|
+
...project,
|
|
373
|
+
...selectCard,
|
|
374
|
+
pinboard_uid: text('pinboard-uid', '唯一目标报告 UID。'),
|
|
375
|
+
},
|
|
376
|
+
['project_id', 'card_file', 'pinboard_uid'],
|
|
377
|
+
true,
|
|
378
|
+
),
|
|
379
|
+
card_payload: operation(
|
|
380
|
+
reportScript,
|
|
381
|
+
'card-payload',
|
|
382
|
+
'构造报告取卡专用 payload,不发送业务请求。',
|
|
383
|
+
{
|
|
384
|
+
question_file: positional(0, '自然语言字符串或扁平 Token 数组 JSON 文件。'),
|
|
385
|
+
},
|
|
386
|
+
['question_file'],
|
|
387
|
+
),
|
|
388
|
+
plan_digest: operation(
|
|
389
|
+
reportScript,
|
|
390
|
+
'plan-digest',
|
|
391
|
+
'计算展示给用户的完整报告计划摘要。',
|
|
392
|
+
{ plan_file: positional(0, '待确认的完整计划 JSON 文件。') },
|
|
393
|
+
['plan_file'],
|
|
394
|
+
),
|
|
395
|
+
extract_candidates: operation(
|
|
396
|
+
reportScript,
|
|
397
|
+
'extract-candidates',
|
|
398
|
+
'从真实取卡结果提取可追溯的下钻候选。',
|
|
399
|
+
{
|
|
400
|
+
input_file: positional(0, '取卡结果 JSON 文件。'),
|
|
401
|
+
limit: integer('limit', '本轮候选数量上限。'),
|
|
402
|
+
},
|
|
403
|
+
['input_file'],
|
|
404
|
+
),
|
|
405
|
+
identify_card: operation(
|
|
406
|
+
reportScript,
|
|
407
|
+
'identify-card',
|
|
408
|
+
'通过前后报告内容差异唯一定位新增卡片。',
|
|
409
|
+
{
|
|
410
|
+
before_file: positional(0, '写入前报告 JSON。'),
|
|
411
|
+
after_file: positional(1, '写入后回读报告 JSON。'),
|
|
412
|
+
signature_file: positional(2, '预期卡片内容签名 JSON。'),
|
|
413
|
+
},
|
|
414
|
+
['before_file', 'after_file', 'signature_file'],
|
|
415
|
+
),
|
|
416
|
+
build_report: operation(
|
|
417
|
+
reportScript,
|
|
418
|
+
'build-report',
|
|
419
|
+
'校验 manifest 并构造完整报告 PATCH,操作本身不保存远端。',
|
|
420
|
+
{
|
|
421
|
+
report_file: positional(0, '目标报告 GET 回读 JSON。'),
|
|
422
|
+
...reportManifest,
|
|
423
|
+
report_origin: text('report-origin', '已验证业务服务 origin,仅在允许文本链接时需要。'),
|
|
424
|
+
},
|
|
425
|
+
['report_file', 'manifest_file'],
|
|
426
|
+
),
|
|
427
|
+
validate_report: operation(
|
|
428
|
+
reportScript,
|
|
429
|
+
'validate-report',
|
|
430
|
+
'校验最终回读报告的内容、布局与证据。',
|
|
431
|
+
{
|
|
432
|
+
report_file: positional(0, '最终报告 GET 回读 JSON。'),
|
|
433
|
+
...reportManifest,
|
|
434
|
+
report_origin: text('report-origin', '已验证业务服务 origin。'),
|
|
435
|
+
},
|
|
436
|
+
['report_file', 'manifest_file'],
|
|
437
|
+
),
|
|
438
|
+
collect_cards: operation(
|
|
439
|
+
reportCardsScript,
|
|
440
|
+
[],
|
|
441
|
+
'执行用户已确认的报告取卡轮次,保留有限进度与真实结果。',
|
|
442
|
+
{
|
|
443
|
+
approved_plan_file: positional(0, '用户明确批准的原计划 JSON。'),
|
|
444
|
+
batch_file: positional(1, '当前单轮取卡 batch JSON。'),
|
|
445
|
+
approved_plan_digest: text('approved-plan-digest', '对应同一已批准计划的 SHA-256。'),
|
|
446
|
+
workers: integer('workers', '并发数,范围1至3。'),
|
|
447
|
+
output_dir: text('output-dir', '运行时临时根目录内的输出目录,与progress互斥。'),
|
|
448
|
+
progress: text('progress', '使用有界流式进度,与output_dir互斥。', {
|
|
449
|
+
enum: ['ndjson'],
|
|
450
|
+
}),
|
|
451
|
+
},
|
|
452
|
+
['approved_plan_file', 'batch_file', 'approved_plan_digest'],
|
|
453
|
+
true,
|
|
454
|
+
),
|
|
455
|
+
render_html: operation(
|
|
456
|
+
script('datarc-viz-analysis-report', 'render_viz_report.py'),
|
|
457
|
+
[],
|
|
458
|
+
'验证溯源账本并生成可离线打开的单文件 HTML。',
|
|
459
|
+
{
|
|
460
|
+
input_file: positional(0, '符合可视化报告契约的 JSON 文件。'),
|
|
461
|
+
output_file: text('output', '当前会话目录内 HTML 输出路径。'),
|
|
462
|
+
},
|
|
463
|
+
['input_file', 'output_file'],
|
|
464
|
+
),
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
modeling: {
|
|
468
|
+
title: '模型与标签',
|
|
469
|
+
description: '发现表、预览字段、构造并校验建模计划,按确认结果写入模型或管理标签关联。',
|
|
470
|
+
workflows: ['datarc-workspace-modeling'],
|
|
471
|
+
operations: {
|
|
472
|
+
list_workspaces: operation(modelingScript, 'workspaces', '列出当前成员可管理的工作区。', { query: text('query', '工作区名称筛选。') }),
|
|
473
|
+
tables: operation(modelingScript, 'tables', '分页读取源表目录。', { ...workspace, query: text('query', '表名筛选。'), ...paging }, [
|
|
474
|
+
'workspace_id',
|
|
475
|
+
]),
|
|
476
|
+
all_tables: operation(
|
|
477
|
+
modelingScript,
|
|
478
|
+
['tables', '--all'],
|
|
479
|
+
'完整分页读取源表目录。',
|
|
480
|
+
{
|
|
481
|
+
...workspace,
|
|
482
|
+
query: text('query', '表名筛选。'),
|
|
483
|
+
page_size: integer('page-size', '每页读取数量。'),
|
|
484
|
+
},
|
|
485
|
+
['workspace_id'],
|
|
486
|
+
),
|
|
487
|
+
count_tables: operation(modelingScript, ['tables', '--count'], '只读取源表数量。', { ...workspace, query: text('query', '表名筛选。') }, [
|
|
488
|
+
'workspace_id',
|
|
489
|
+
]),
|
|
490
|
+
table_groups: operation(
|
|
491
|
+
modelingScript,
|
|
492
|
+
'table-groups',
|
|
493
|
+
'分组读取源表目录及有限样例。',
|
|
494
|
+
{
|
|
495
|
+
...workspace,
|
|
496
|
+
query: text('query', '表名筛选。'),
|
|
497
|
+
page_size: integer('page-size', '分页数量。'),
|
|
498
|
+
small_limit: integer('small-limit', '小目录阈值。'),
|
|
499
|
+
large_limit: integer('large-limit', '大目录阈值。'),
|
|
500
|
+
samples: integer('samples', '每组样例数量。'),
|
|
501
|
+
},
|
|
502
|
+
['workspace_id'],
|
|
503
|
+
),
|
|
504
|
+
columns: operation(modelingScript, 'columns', '读取源表字段。', { ...workspace, table: text('table', '已确认的完整源表名。') }, [
|
|
505
|
+
'workspace_id',
|
|
506
|
+
'table',
|
|
507
|
+
]),
|
|
508
|
+
preview: operation(modelingScript, 'preview', '预览源表数据。', { ...workspace, table: text('table', '已确认的完整源表名。') }, [
|
|
509
|
+
'workspace_id',
|
|
510
|
+
'table',
|
|
511
|
+
]),
|
|
512
|
+
column_preview: operation(
|
|
513
|
+
modelingScript,
|
|
514
|
+
'column-preview',
|
|
515
|
+
'预览已确认源表的字段样例。',
|
|
516
|
+
{
|
|
517
|
+
...workspace,
|
|
518
|
+
table: text('table', '完整源表名。'),
|
|
519
|
+
column: text('column', '实际字段名。'),
|
|
520
|
+
},
|
|
521
|
+
['workspace_id', 'table', 'column'],
|
|
522
|
+
),
|
|
523
|
+
catalog: operation(modelingScript, 'catalog', '读取可复用模型、维度表与关键词目录。', workspace, ['workspace_id']),
|
|
524
|
+
validate_name: operation(
|
|
525
|
+
modelingScript,
|
|
526
|
+
'validate-name',
|
|
527
|
+
'校验模型或语义资源名称。',
|
|
528
|
+
{
|
|
529
|
+
...workspace,
|
|
530
|
+
name: text('name', '候选业务名称。'),
|
|
531
|
+
field: text('field', '名称类别。', {
|
|
532
|
+
enum: ['model', 'timeSeries', 'dimension', 'measure'],
|
|
533
|
+
}),
|
|
534
|
+
},
|
|
535
|
+
['workspace_id', 'name', 'field'],
|
|
536
|
+
),
|
|
537
|
+
build: operation(modelingScript, 'build', '从建模计划生成合法模型 payload,不保存。', modelInput, ['workspace_id', 'input_file']),
|
|
538
|
+
preflight: operation(modelingScript, 'preflight', '检查建模计划、复用关系与后置计算,不保存。', modelInput, ['workspace_id', 'input_file']),
|
|
539
|
+
get: operation(
|
|
540
|
+
modelingScript,
|
|
541
|
+
'get',
|
|
542
|
+
'回读现有模型并生成可编辑计划。',
|
|
543
|
+
{ ...workspace, model_uid: text('model-uid', '当前工作区模型 UID。') },
|
|
544
|
+
['workspace_id', 'model_uid'],
|
|
545
|
+
),
|
|
546
|
+
preview_create: operation(
|
|
547
|
+
modelingScript,
|
|
548
|
+
['create', '--dry-run'],
|
|
549
|
+
'预览模型创建及后置搜索动作,不写模型。',
|
|
550
|
+
{ ...modelInput, ...searchActivation },
|
|
551
|
+
['workspace_id', 'input_file'],
|
|
552
|
+
),
|
|
553
|
+
create: operation(
|
|
554
|
+
modelingScript,
|
|
555
|
+
'create',
|
|
556
|
+
'按已确认计划创建模型并检查就绪及搜索后置动作。',
|
|
557
|
+
{ ...modelInput, ...searchActivation },
|
|
558
|
+
['workspace_id', 'input_file'],
|
|
559
|
+
true,
|
|
560
|
+
),
|
|
561
|
+
preview_update: operation(
|
|
562
|
+
modelingScript,
|
|
563
|
+
['update', '--dry-run'],
|
|
564
|
+
'预览已有模型变更,不写模型。',
|
|
565
|
+
{
|
|
566
|
+
...modelInput,
|
|
567
|
+
...searchActivation,
|
|
568
|
+
model_uid: text('model-uid', '当前工作区已有模型 UID。'),
|
|
569
|
+
},
|
|
570
|
+
['workspace_id', 'input_file', 'model_uid'],
|
|
571
|
+
),
|
|
572
|
+
update: operation(
|
|
573
|
+
modelingScript,
|
|
574
|
+
'update',
|
|
575
|
+
'按已确认计划更新已有模型并回读。',
|
|
576
|
+
{
|
|
577
|
+
...modelInput,
|
|
578
|
+
...searchActivation,
|
|
579
|
+
model_uid: text('model-uid', '当前工作区已有模型 UID。'),
|
|
580
|
+
},
|
|
581
|
+
['workspace_id', 'input_file', 'model_uid'],
|
|
582
|
+
true,
|
|
583
|
+
),
|
|
584
|
+
tags: operation(modelingScript, 'tags', '读取标签、模型和并发控制版本。', workspace, ['workspace_id']),
|
|
585
|
+
preview_create_tag: operation(
|
|
586
|
+
modelingScript,
|
|
587
|
+
['create-tag', '--dry-run'],
|
|
588
|
+
'预览新标签和关联,不写入。',
|
|
589
|
+
{ ...workspace, ...tagRevision, ...input },
|
|
590
|
+
['workspace_id', 'revision', 'input_file'],
|
|
591
|
+
),
|
|
592
|
+
create_tag: operation(
|
|
593
|
+
modelingScript,
|
|
594
|
+
'create-tag',
|
|
595
|
+
'创建已确认的标签与模型关联。',
|
|
596
|
+
{ ...workspace, ...tagRevision, ...input },
|
|
597
|
+
['workspace_id', 'revision', 'input_file'],
|
|
598
|
+
true,
|
|
599
|
+
),
|
|
600
|
+
preview_update_tag: operation(
|
|
601
|
+
modelingScript,
|
|
602
|
+
['update-tag', '--dry-run'],
|
|
603
|
+
'预览标签名称与介绍变更。',
|
|
604
|
+
{ ...workspace, ...tagRevision, ...tagId, ...input },
|
|
605
|
+
['workspace_id', 'revision', 'tag_id', 'input_file'],
|
|
606
|
+
),
|
|
607
|
+
update_tag: operation(
|
|
608
|
+
modelingScript,
|
|
609
|
+
'update-tag',
|
|
610
|
+
'更新已确认的标签名称与介绍。',
|
|
611
|
+
{ ...workspace, ...tagRevision, ...tagId, ...input },
|
|
612
|
+
['workspace_id', 'revision', 'tag_id', 'input_file'],
|
|
613
|
+
true,
|
|
614
|
+
),
|
|
615
|
+
preview_delete_tag: operation(
|
|
616
|
+
modelingScript,
|
|
617
|
+
['delete-tag', '--dry-run'],
|
|
618
|
+
'预览删除标签对所有关联的影响。',
|
|
619
|
+
{ ...workspace, ...tagRevision, ...tagId },
|
|
620
|
+
['workspace_id', 'revision', 'tag_id'],
|
|
621
|
+
),
|
|
622
|
+
delete_tag: operation(
|
|
623
|
+
modelingScript,
|
|
624
|
+
'delete-tag',
|
|
625
|
+
'删除已确认的标签并解除关联。',
|
|
626
|
+
{
|
|
627
|
+
...workspace,
|
|
628
|
+
...tagRevision,
|
|
629
|
+
...tagId,
|
|
630
|
+
confirm_delete: switchFlag('confirm-delete', '已确认删除的CLI校验开关,不替代用户授权。'),
|
|
631
|
+
},
|
|
632
|
+
['workspace_id', 'revision', 'tag_id', 'confirm_delete'],
|
|
633
|
+
true,
|
|
634
|
+
),
|
|
635
|
+
preview_tag_models: operation(
|
|
636
|
+
modelingScript,
|
|
637
|
+
['tag-models', '--dry-run'],
|
|
638
|
+
'预览标签模型关联的追加、移除或替换。',
|
|
639
|
+
{ ...workspace, ...tagRevision, ...tagId, ...input },
|
|
640
|
+
['workspace_id', 'revision', 'tag_id', 'input_file'],
|
|
641
|
+
),
|
|
642
|
+
tag_models: operation(
|
|
643
|
+
modelingScript,
|
|
644
|
+
'tag-models',
|
|
645
|
+
'按已确认的 add/remove/replace 意图写入模型关联。',
|
|
646
|
+
{
|
|
647
|
+
...workspace,
|
|
648
|
+
...tagRevision,
|
|
649
|
+
...tagId,
|
|
650
|
+
...input,
|
|
651
|
+
confirm_replace: switchFlag('confirm-replace', '替换全部关联时必须提供;不替代用户授权。'),
|
|
652
|
+
},
|
|
653
|
+
['workspace_id', 'revision', 'tag_id', 'input_file'],
|
|
654
|
+
true,
|
|
655
|
+
),
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
keywords: {
|
|
659
|
+
title: '指标、维度与搜索配置',
|
|
660
|
+
description: '管理工作区语义资源,衍生指标、维度表结构及可搜索维度的配置和验证。',
|
|
661
|
+
workflows: ['datarc-workspace-keywords'],
|
|
662
|
+
operations: {
|
|
663
|
+
list_workspaces: operation(keywordScript, 'workspaces', '列出可管理的工作区。', { query: text('query', '工作区名称筛选。') }),
|
|
664
|
+
list: operation(keywordScript, 'list', '读取指定类别的工作区语义资源。', { ...workspace, ...keywordResource }, ['workspace_id', 'resource']),
|
|
665
|
+
get: operation(keywordScript, 'get', '读取一个已确认资源的详情。', { ...workspace, ...keywordResource, ...keywordId }, [
|
|
666
|
+
'workspace_id',
|
|
667
|
+
'resource',
|
|
668
|
+
'id',
|
|
669
|
+
]),
|
|
670
|
+
find: operation(
|
|
671
|
+
keywordScript,
|
|
672
|
+
'find',
|
|
673
|
+
'按精确业务名称查找资源。',
|
|
674
|
+
{
|
|
675
|
+
...workspace,
|
|
676
|
+
...keywordResource,
|
|
677
|
+
name: text('name', '精确业务名称。'),
|
|
678
|
+
},
|
|
679
|
+
['workspace_id', 'resource', 'name'],
|
|
680
|
+
),
|
|
681
|
+
validate_name: operation(
|
|
682
|
+
keywordScript,
|
|
683
|
+
'validate-name',
|
|
684
|
+
'校验指标、维度或时间维度名称,不创建。',
|
|
685
|
+
{
|
|
686
|
+
...workspace,
|
|
687
|
+
resource: text('resource', '名称资源类别。', {
|
|
688
|
+
enum: ['measure', 'dimension', 'time-series'],
|
|
689
|
+
}),
|
|
690
|
+
names: strings('name', '候选名称,可重复。'),
|
|
691
|
+
},
|
|
692
|
+
['workspace_id', 'resource', 'names'],
|
|
693
|
+
),
|
|
694
|
+
check_formula: operation(
|
|
695
|
+
keywordScript,
|
|
696
|
+
'check-formula',
|
|
697
|
+
'校验衍生指标公式,不保存。',
|
|
698
|
+
{
|
|
699
|
+
...workspace,
|
|
700
|
+
formula: text('formula', '基于现有业务字段名称的公式。'),
|
|
701
|
+
},
|
|
702
|
+
['workspace_id', 'formula'],
|
|
703
|
+
),
|
|
704
|
+
search_settings: operation(keywordScript, 'search-settings', '读取工作区搜索配置。', workspace, ['workspace_id']),
|
|
705
|
+
sync_tasks: operation(keywordScript, 'sync-tasks', '读取关键词同步和词典生成任务。', { ...workspace, ...paging }, ['workspace_id']),
|
|
706
|
+
sync_task: operation(
|
|
707
|
+
keywordScript,
|
|
708
|
+
'sync-task',
|
|
709
|
+
'读取单个关键词同步任务状态。',
|
|
710
|
+
{ ...workspace, task_uid: text('task-uid', '当前工作区任务 UID。') },
|
|
711
|
+
['workspace_id', 'task_uid'],
|
|
712
|
+
),
|
|
713
|
+
custom_sort: operation(keywordScript, 'custom-sort', '读取维度值自定义排序。', { ...workspace, ...keywordId }, ['workspace_id', 'id']),
|
|
714
|
+
set_custom_sort: operation(
|
|
715
|
+
keywordScript,
|
|
716
|
+
'set-custom-sort',
|
|
717
|
+
'写入已确认的维度值排序数组。',
|
|
718
|
+
{
|
|
719
|
+
...workspace,
|
|
720
|
+
...keywordId,
|
|
721
|
+
...input,
|
|
722
|
+
overwrite: switchFlag('overwrite', '完整覆盖现有排序;需要确认影响。'),
|
|
723
|
+
},
|
|
724
|
+
['workspace_id', 'id', 'input_file'],
|
|
725
|
+
true,
|
|
726
|
+
),
|
|
727
|
+
preview_create: operation(
|
|
728
|
+
keywordScript,
|
|
729
|
+
['create', '--dry-run'],
|
|
730
|
+
'预览基础指标、维度或时间维度创建。',
|
|
731
|
+
{
|
|
732
|
+
...workspace,
|
|
733
|
+
resource: text('resource', '资源类别。', {
|
|
734
|
+
enum: ['measure', 'dimension', 'time-series'],
|
|
735
|
+
}),
|
|
736
|
+
...input,
|
|
737
|
+
},
|
|
738
|
+
['workspace_id', 'resource', 'input_file'],
|
|
739
|
+
),
|
|
740
|
+
create: operation(
|
|
741
|
+
keywordScript,
|
|
742
|
+
'create',
|
|
743
|
+
'创建已确认的基础语义资源,衍生指标另用 upsert_derived。',
|
|
744
|
+
{
|
|
745
|
+
...workspace,
|
|
746
|
+
resource: text('resource', '资源类别。', {
|
|
747
|
+
enum: ['measure', 'dimension', 'time-series'],
|
|
748
|
+
}),
|
|
749
|
+
...input,
|
|
750
|
+
},
|
|
751
|
+
['workspace_id', 'resource', 'input_file'],
|
|
752
|
+
true,
|
|
753
|
+
),
|
|
754
|
+
preview_update: operation(
|
|
755
|
+
keywordScript,
|
|
756
|
+
['update', '--dry-run'],
|
|
757
|
+
'预览资源修改与引用影响。',
|
|
758
|
+
{ ...workspace, ...keywordResource, ...keywordId, ...input },
|
|
759
|
+
['workspace_id', 'resource', 'id', 'input_file'],
|
|
760
|
+
),
|
|
761
|
+
update: operation(
|
|
762
|
+
keywordScript,
|
|
763
|
+
'update',
|
|
764
|
+
'按已确认输入更新资源并回读。',
|
|
765
|
+
{ ...workspace, ...keywordResource, ...keywordId, ...input },
|
|
766
|
+
['workspace_id', 'resource', 'id', 'input_file'],
|
|
767
|
+
true,
|
|
768
|
+
),
|
|
769
|
+
preview_derived: operation(
|
|
770
|
+
keywordScript,
|
|
771
|
+
['upsert-derived', '--dry-run'],
|
|
772
|
+
'检查衍生指标名称、公式、依赖和模型覆盖。',
|
|
773
|
+
{ ...workspace, ...input, ...keywordId },
|
|
774
|
+
['workspace_id', 'input_file'],
|
|
775
|
+
),
|
|
776
|
+
upsert_derived: operation(
|
|
777
|
+
keywordScript,
|
|
778
|
+
'upsert-derived',
|
|
779
|
+
'创建或更新已确认的工作区级衍生指标。',
|
|
780
|
+
{
|
|
781
|
+
...workspace,
|
|
782
|
+
...input,
|
|
783
|
+
...keywordId,
|
|
784
|
+
confirm: text('confirm', '更新已有衍生指标需UPDATE,不替代用户授权。', { enum: ['UPDATE'] }),
|
|
785
|
+
},
|
|
786
|
+
['workspace_id', 'input_file'],
|
|
787
|
+
true,
|
|
788
|
+
),
|
|
789
|
+
impact: operation(keywordScript, 'impact', '读取删除或结构变更的引用影响。', { ...workspace, ...keywordResource, ...keywordId }, [
|
|
790
|
+
'workspace_id',
|
|
791
|
+
'resource',
|
|
792
|
+
'id',
|
|
793
|
+
]),
|
|
794
|
+
delete: operation(
|
|
795
|
+
keywordScript,
|
|
796
|
+
'delete',
|
|
797
|
+
'删除已确认的语义资源,须先检查引用影响。',
|
|
798
|
+
{
|
|
799
|
+
...workspace,
|
|
800
|
+
...keywordResource,
|
|
801
|
+
...keywordId,
|
|
802
|
+
confirm: text('confirm', '删除校验文本,不替代用户授权。', {
|
|
803
|
+
enum: ['DELETE'],
|
|
804
|
+
}),
|
|
805
|
+
},
|
|
806
|
+
['workspace_id', 'resource', 'id', 'confirm'],
|
|
807
|
+
true,
|
|
808
|
+
),
|
|
809
|
+
preview_add_dimension: operation(
|
|
810
|
+
keywordScript,
|
|
811
|
+
['add-dimension', '--dry-run'],
|
|
812
|
+
'预览向维度表新增字段绑定。',
|
|
813
|
+
{
|
|
814
|
+
...workspace,
|
|
815
|
+
...keywordId,
|
|
816
|
+
...input,
|
|
817
|
+
field: text('field', '维度表实际源字段。'),
|
|
818
|
+
},
|
|
819
|
+
['workspace_id', 'id', 'input_file', 'field'],
|
|
820
|
+
),
|
|
821
|
+
add_dimension: operation(
|
|
822
|
+
keywordScript,
|
|
823
|
+
'add-dimension',
|
|
824
|
+
'向已确认的维度表新增维度及字段绑定。',
|
|
825
|
+
{
|
|
826
|
+
...workspace,
|
|
827
|
+
...keywordId,
|
|
828
|
+
...input,
|
|
829
|
+
field: text('field', '维度表实际源字段。'),
|
|
830
|
+
},
|
|
831
|
+
['workspace_id', 'id', 'input_file', 'field'],
|
|
832
|
+
true,
|
|
833
|
+
),
|
|
834
|
+
remove_dimension: operation(
|
|
835
|
+
keywordScript,
|
|
836
|
+
'remove-dimension',
|
|
837
|
+
'按确认移除维度表中的指定维度。',
|
|
838
|
+
{
|
|
839
|
+
...workspace,
|
|
840
|
+
...keywordId,
|
|
841
|
+
dimension_id: integer('dimension-id', '已确认维度 ID。'),
|
|
842
|
+
confirm: text('confirm', '删除校验文本,不替代用户授权。', {
|
|
843
|
+
enum: ['DELETE'],
|
|
844
|
+
}),
|
|
845
|
+
},
|
|
846
|
+
['workspace_id', 'id', 'dimension_id', 'confirm'],
|
|
847
|
+
true,
|
|
848
|
+
),
|
|
849
|
+
preview_search_plan: operation(
|
|
850
|
+
keywordScript,
|
|
851
|
+
['apply-search-plan', '--dry-run'],
|
|
852
|
+
'预览待开启搜索维度与新同步任务基线。',
|
|
853
|
+
{
|
|
854
|
+
...workspace,
|
|
855
|
+
...input,
|
|
856
|
+
...polling,
|
|
857
|
+
max_cardinality: integer('max-cardinality', '维度值基数上限。'),
|
|
858
|
+
baseline_task_uids: strings('baseline-task-uid', '已捕获的本次任务基线 UID。'),
|
|
859
|
+
},
|
|
860
|
+
['workspace_id', 'input_file'],
|
|
861
|
+
),
|
|
862
|
+
apply_search_plan: operation(
|
|
863
|
+
keywordScript,
|
|
864
|
+
'apply-search-plan',
|
|
865
|
+
'按确认开启搜索维度并等待有限同步验收。',
|
|
866
|
+
{
|
|
867
|
+
...workspace,
|
|
868
|
+
...input,
|
|
869
|
+
...polling,
|
|
870
|
+
max_cardinality: integer('max-cardinality', '维度值基数上限。'),
|
|
871
|
+
baseline_task_uids: strings('baseline-task-uid', '已捕获的本次任务基线 UID。'),
|
|
872
|
+
},
|
|
873
|
+
['workspace_id', 'input_file'],
|
|
874
|
+
true,
|
|
875
|
+
),
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
tables: {
|
|
879
|
+
title: 'SQL 自定义表',
|
|
880
|
+
description: '读取自定义表、试跑 SQL,预览引用影响后创建、更新或改名。',
|
|
881
|
+
workflows: ['datarc-workspace-custom-tables'],
|
|
882
|
+
operations: {
|
|
883
|
+
list: operation(
|
|
884
|
+
tableScript,
|
|
885
|
+
'list',
|
|
886
|
+
'列出可用的 SQL 自定义表。',
|
|
887
|
+
{
|
|
888
|
+
...workspace,
|
|
889
|
+
...polling,
|
|
890
|
+
...paging,
|
|
891
|
+
query: text('query', '表名称筛选。'),
|
|
892
|
+
},
|
|
893
|
+
['workspace_id'],
|
|
894
|
+
),
|
|
895
|
+
get: operation(
|
|
896
|
+
tableScript,
|
|
897
|
+
'get',
|
|
898
|
+
'读取自定义表定义与引用。',
|
|
899
|
+
{
|
|
900
|
+
...workspace,
|
|
901
|
+
...polling,
|
|
902
|
+
table_uid: text('table-uid', '自定义表 UID。'),
|
|
903
|
+
},
|
|
904
|
+
['workspace_id', 'table_uid'],
|
|
905
|
+
),
|
|
906
|
+
columns: operation(
|
|
907
|
+
tableScript,
|
|
908
|
+
'columns',
|
|
909
|
+
'读取自定义表字段。',
|
|
910
|
+
{
|
|
911
|
+
...workspace,
|
|
912
|
+
...polling,
|
|
913
|
+
table_uid: text('table-uid', '自定义表 UID。'),
|
|
914
|
+
},
|
|
915
|
+
['workspace_id', 'table_uid'],
|
|
916
|
+
),
|
|
917
|
+
preview: operation(
|
|
918
|
+
tableScript,
|
|
919
|
+
'preview',
|
|
920
|
+
'读取自定义表数据预览。',
|
|
921
|
+
{
|
|
922
|
+
...workspace,
|
|
923
|
+
...polling,
|
|
924
|
+
table_uid: text('table-uid', '自定义表 UID。'),
|
|
925
|
+
},
|
|
926
|
+
['workspace_id', 'table_uid'],
|
|
927
|
+
),
|
|
928
|
+
column_preview: operation(
|
|
929
|
+
tableScript,
|
|
930
|
+
'column-preview',
|
|
931
|
+
'读取自定义表指定字段样例。',
|
|
932
|
+
{
|
|
933
|
+
...workspace,
|
|
934
|
+
...polling,
|
|
935
|
+
table_uid: text('table-uid', '自定义表 UID。'),
|
|
936
|
+
column: text('column', '实际字段名称。'),
|
|
937
|
+
},
|
|
938
|
+
['workspace_id', 'table_uid', 'column'],
|
|
939
|
+
),
|
|
940
|
+
verify: operation(
|
|
941
|
+
tableScript,
|
|
942
|
+
'verify',
|
|
943
|
+
'检查自定义表的 SQL、字段和样例是否就绪。',
|
|
944
|
+
{
|
|
945
|
+
...workspace,
|
|
946
|
+
...polling,
|
|
947
|
+
table_uid: text('table-uid', '自定义表 UID。'),
|
|
948
|
+
},
|
|
949
|
+
['workspace_id', 'table_uid'],
|
|
950
|
+
),
|
|
951
|
+
validate: operation(tableScript, 'validate', '只试跑 input 文件中的 SQL,不保存自定义表。', { ...workspace, ...polling, ...input }, [
|
|
952
|
+
'workspace_id',
|
|
953
|
+
'input_file',
|
|
954
|
+
]),
|
|
955
|
+
preview_create: operation(tableScript, ['create', '--dry-run'], '预览新表名称和 SQL,不保存。', { ...workspace, ...polling, ...input }, [
|
|
956
|
+
'workspace_id',
|
|
957
|
+
'input_file',
|
|
958
|
+
]),
|
|
959
|
+
create: operation(
|
|
960
|
+
tableScript,
|
|
961
|
+
'create',
|
|
962
|
+
'试跑并创建已确认的 SQL 自定义表。',
|
|
963
|
+
{ ...workspace, ...polling, ...input },
|
|
964
|
+
['workspace_id', 'input_file'],
|
|
965
|
+
true,
|
|
966
|
+
),
|
|
967
|
+
preview_update: operation(
|
|
968
|
+
tableScript,
|
|
969
|
+
['update', '--dry-run'],
|
|
970
|
+
'预览 SQL 变更与当前引用指纹。',
|
|
971
|
+
{
|
|
972
|
+
...workspace,
|
|
973
|
+
...polling,
|
|
974
|
+
...input,
|
|
975
|
+
table_uid: text('table-uid', '目标表 UID。'),
|
|
976
|
+
},
|
|
977
|
+
['workspace_id', 'input_file', 'table_uid'],
|
|
978
|
+
),
|
|
979
|
+
update: operation(
|
|
980
|
+
tableScript,
|
|
981
|
+
'update',
|
|
982
|
+
'按已确认引用指纹更新 SQL 并回读。',
|
|
983
|
+
{
|
|
984
|
+
...workspace,
|
|
985
|
+
...polling,
|
|
986
|
+
...input,
|
|
987
|
+
table_uid: text('table-uid', '目标表 UID。'),
|
|
988
|
+
if_match: text('if-match', '同一 dry-run 返回的当前指纹。'),
|
|
989
|
+
allow_referenced: switchFlag('allow-referenced', '明确确认已存在模型或维度表引用的影响。'),
|
|
990
|
+
},
|
|
991
|
+
['workspace_id', 'input_file', 'table_uid', 'if_match'],
|
|
992
|
+
true,
|
|
993
|
+
),
|
|
994
|
+
preview_rename: operation(
|
|
995
|
+
tableScript,
|
|
996
|
+
['rename', '--dry-run'],
|
|
997
|
+
'预览表改名与引用指纹。',
|
|
998
|
+
{
|
|
999
|
+
...workspace,
|
|
1000
|
+
...polling,
|
|
1001
|
+
...input,
|
|
1002
|
+
table_uid: text('table-uid', '目标表 UID。'),
|
|
1003
|
+
},
|
|
1004
|
+
['workspace_id', 'input_file', 'table_uid'],
|
|
1005
|
+
),
|
|
1006
|
+
rename: operation(
|
|
1007
|
+
tableScript,
|
|
1008
|
+
'rename',
|
|
1009
|
+
'按已确认指纹更新表名并回读。',
|
|
1010
|
+
{
|
|
1011
|
+
...workspace,
|
|
1012
|
+
...polling,
|
|
1013
|
+
...input,
|
|
1014
|
+
table_uid: text('table-uid', '目标表 UID。'),
|
|
1015
|
+
if_match: text('if-match', '同一 dry-run 返回的当前指纹。'),
|
|
1016
|
+
allow_referenced: switchFlag('allow-referenced', '已确认现有引用影响。'),
|
|
1017
|
+
},
|
|
1018
|
+
['workspace_id', 'input_file', 'table_uid', 'if_match'],
|
|
1019
|
+
true,
|
|
1020
|
+
),
|
|
1021
|
+
},
|
|
1022
|
+
},
|
|
1023
|
+
semantic: {
|
|
1024
|
+
title: '语义干预与验证',
|
|
1025
|
+
description: '定位理解偏差,生成按 kind 限定的计划,确认后应用、验证或按绑定回执恢复。',
|
|
1026
|
+
workflows: [
|
|
1027
|
+
'datarc-dataseek-semantic-debugging',
|
|
1028
|
+
'datarc-semantic-alias',
|
|
1029
|
+
'datarc-semantic-synonym',
|
|
1030
|
+
'datarc-semantic-calibration',
|
|
1031
|
+
'datarc-semantic-dataset',
|
|
1032
|
+
'datarc-semantic-knowledge',
|
|
1033
|
+
'datarc-semantic-prompt',
|
|
1034
|
+
],
|
|
1035
|
+
operations: {
|
|
1036
|
+
direction: operation(semanticScript, 'direction', '从明确案例推荐最窄的干预方向;仅本地分析。', semanticInputOutput, ['input_file']),
|
|
1037
|
+
diagnose: operation(semanticScript, 'diagnose', '规范化映射或纠错案例,不写业务配置。', semanticInputOutput, ['input_file']),
|
|
1038
|
+
resolve: operation(semanticScript, 'resolve', '从已提供目录精确解析案例对象,不写业务配置。', semanticInputOutput, ['input_file']),
|
|
1039
|
+
resolve_live: operation(semanticScript, 'resolve-live', '读取当前管理员候选并保存精确对象选择证据。', semanticInputOutput, [
|
|
1040
|
+
'input_file',
|
|
1041
|
+
'output_file',
|
|
1042
|
+
]),
|
|
1043
|
+
reproduce: operation(semanticScript, 'reproduce', '在当前管理员身份下重现问题并记录新查询历史。', semanticInputOutput, [
|
|
1044
|
+
'input_file',
|
|
1045
|
+
'output_file',
|
|
1046
|
+
]),
|
|
1047
|
+
plan: operation(
|
|
1048
|
+
semanticScript,
|
|
1049
|
+
'plan',
|
|
1050
|
+
'生成 kind 隔离的干预计划与摘要,不保存业务配置。',
|
|
1051
|
+
{
|
|
1052
|
+
...semanticInputOutput,
|
|
1053
|
+
direction: text('direction', '用户确认的干预方向摘要。'),
|
|
1054
|
+
},
|
|
1055
|
+
['input_file', 'output_file'],
|
|
1056
|
+
),
|
|
1057
|
+
apply: operation(
|
|
1058
|
+
semanticScript,
|
|
1059
|
+
'apply',
|
|
1060
|
+
'按依赖顺序应用当前用户批准的语义计划并记录回执。',
|
|
1061
|
+
{
|
|
1062
|
+
input_files: strings('input', '同一任务已批准的计划或 journal 文件。'),
|
|
1063
|
+
output_files: strings('output', '与计划逐项对应的私有输出文件。'),
|
|
1064
|
+
confirms: strings('confirm', '逐项匹配的 APPLY:<planHash>;不替代用户确认。'),
|
|
1065
|
+
},
|
|
1066
|
+
['input_files', 'output_files', 'confirms'],
|
|
1067
|
+
true,
|
|
1068
|
+
),
|
|
1069
|
+
verify: operation(semanticScript, 'verify', '验证绑定 plan/receipt/baseline 的最终 bundle,不写配置。', semanticInputOutput, [
|
|
1070
|
+
'input_file',
|
|
1071
|
+
'output_file',
|
|
1072
|
+
]),
|
|
1073
|
+
rollback: operation(
|
|
1074
|
+
semanticScript,
|
|
1075
|
+
'rollback',
|
|
1076
|
+
'按用户确认和回执摘要精确恢复已完成的语义变更。',
|
|
1077
|
+
{
|
|
1078
|
+
...semanticInputOutput,
|
|
1079
|
+
confirm: text('confirm', 'ROLLBACK:<receiptHash>;不替代用户确认。'),
|
|
1080
|
+
},
|
|
1081
|
+
['input_file', 'output_file', 'confirm'],
|
|
1082
|
+
true,
|
|
1083
|
+
),
|
|
1084
|
+
knowledge_context: operation(knowledgeScript, 'draft-context', '读取知识与模型,生成有界的私有草稿上下文。', semanticInputOutput, [
|
|
1085
|
+
'input_file',
|
|
1086
|
+
'output_file',
|
|
1087
|
+
]),
|
|
1088
|
+
knowledge_validate: operation(
|
|
1089
|
+
knowledgeScript,
|
|
1090
|
+
'draft-validate',
|
|
1091
|
+
'校验 Agent 生成的知识草稿与用途、模型范围,不保存知识。',
|
|
1092
|
+
semanticInputOutput,
|
|
1093
|
+
['input_file', 'output_file'],
|
|
1094
|
+
),
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
evaluation: {
|
|
1098
|
+
title: '测试集与回归评估',
|
|
1099
|
+
description: '读取工作区快照、逐题生成测试集、采集真实理解结果并汇总独立复核决定。',
|
|
1100
|
+
workflows: ['datarc-dataseek-testset-generation', 'datarc-dataseek-batch-evaluation'],
|
|
1101
|
+
operations: {
|
|
1102
|
+
snapshot: operation(
|
|
1103
|
+
generationScript,
|
|
1104
|
+
'snapshot',
|
|
1105
|
+
'读取可用模型与有界维度样例,保存测试准备快照。',
|
|
1106
|
+
{
|
|
1107
|
+
...workspace,
|
|
1108
|
+
...output,
|
|
1109
|
+
values_per_dimension: integer('values-per-dimension', '每个维度1至20个样例。'),
|
|
1110
|
+
max_dimensions: integer('max-dimensions', '最多1至200个维度。'),
|
|
1111
|
+
max_cardinality: integer('max-cardinality', '高基数跳过阈值。'),
|
|
1112
|
+
},
|
|
1113
|
+
['workspace_id', 'output_file'],
|
|
1114
|
+
),
|
|
1115
|
+
generate: operation(
|
|
1116
|
+
generationScript,
|
|
1117
|
+
'generate',
|
|
1118
|
+
'对已有 CSV 问题调用真实 DataSeek,保留原列并写入期望结果。',
|
|
1119
|
+
{
|
|
1120
|
+
...workspace,
|
|
1121
|
+
...input,
|
|
1122
|
+
...output,
|
|
1123
|
+
question_column: text('question-column', '原始问题列名。'),
|
|
1124
|
+
understanding_column: text('understanding-column', '理解 JSON 输出列名。'),
|
|
1125
|
+
tokens_column: text('tokens-column', '问题 Token 输出列名。'),
|
|
1126
|
+
token_words_column: text('token-words-column', 'Token Word 输出列名。'),
|
|
1127
|
+
...polling,
|
|
1128
|
+
},
|
|
1129
|
+
['workspace_id', 'input_file', 'output_file', 'question_column'],
|
|
1130
|
+
),
|
|
1131
|
+
collect: operation(
|
|
1132
|
+
evaluationScript,
|
|
1133
|
+
'collect',
|
|
1134
|
+
'采集真实 DataSeek 结果并生成待复核项,不由工具自判逻辑等价。',
|
|
1135
|
+
{
|
|
1136
|
+
...workspace,
|
|
1137
|
+
...input,
|
|
1138
|
+
output_dir: text('output-dir', '会话目录内本次评估专用输出目录。'),
|
|
1139
|
+
question_column: text('question-column', '问题列。'),
|
|
1140
|
+
expected_understanding_column: text('expected-understanding-column', '期望理解 JSON 列。'),
|
|
1141
|
+
expected_tokens_column: text('expected-tokens-column', '期望 Token JSON 列。'),
|
|
1142
|
+
expected_token_words_column: text('expected-token-words-column', '可选期望 Token Word 列。'),
|
|
1143
|
+
concurrency: integer('concurrency', '采集并发数。'),
|
|
1144
|
+
retry_errors: switchFlag('retry-errors', '仅重采已有错误行;成功行仍复用检查点,不重放已完成任务。'),
|
|
1145
|
+
...polling,
|
|
1146
|
+
},
|
|
1147
|
+
['workspace_id', 'input_file', 'output_dir', 'question_column', 'expected_understanding_column', 'expected_tokens_column'],
|
|
1148
|
+
),
|
|
1149
|
+
finalize: operation(
|
|
1150
|
+
evaluationScript,
|
|
1151
|
+
'finalize',
|
|
1152
|
+
'校验原始 CSV 摘要并合并独立复核决定,生成评估结果。',
|
|
1153
|
+
{
|
|
1154
|
+
manifest_file: text('manifest', 'collect 返回的 manifest 文件。'),
|
|
1155
|
+
decisions_file: text('decisions', '按契约生成的逐行复核 JSONL 文件。'),
|
|
1156
|
+
...output,
|
|
1157
|
+
},
|
|
1158
|
+
['manifest_file', 'output_file'],
|
|
1159
|
+
),
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
configuration: {
|
|
1163
|
+
title: '配置方案与查询验收',
|
|
1164
|
+
description: '生成可确认的跨资源变更计划,在配置回读就绪后按已批准方案执行真实查询验收。',
|
|
1165
|
+
workflows: ['datarc-workspace-configuration'],
|
|
1166
|
+
operations: {
|
|
1167
|
+
plan: operation(
|
|
1168
|
+
configurationScript,
|
|
1169
|
+
'plan',
|
|
1170
|
+
'从结构化草案生成方案与 planHash,本操作不联网。',
|
|
1171
|
+
{
|
|
1172
|
+
...input,
|
|
1173
|
+
output_dir: text('output', '尚不存在的当前会话私有输出目录。'),
|
|
1174
|
+
},
|
|
1175
|
+
['input_file', 'output_dir'],
|
|
1176
|
+
),
|
|
1177
|
+
verify: operation(
|
|
1178
|
+
configurationScript,
|
|
1179
|
+
'verify',
|
|
1180
|
+
'按当前确认计划执行有限查询并生成验收证据,不修改配置。',
|
|
1181
|
+
{
|
|
1182
|
+
plan_file: text('plan', '用户确认且已完成配置回读的 plan.json。'),
|
|
1183
|
+
confirm: text('confirm', '用户明确批准的同一 planHash,不替代用户授权。'),
|
|
1184
|
+
output_dir: text('output', '尚不存在的当前会话私有验收输出目录。'),
|
|
1185
|
+
},
|
|
1186
|
+
['plan_file', 'confirm', 'output_dir'],
|
|
1187
|
+
true,
|
|
1188
|
+
),
|
|
1189
|
+
},
|
|
1190
|
+
},
|
|
1191
|
+
datasource: {
|
|
1192
|
+
title: '数据源',
|
|
1193
|
+
description: '读取、验证与保存工作区数据源;保存前须对同一配置连接验证成功并取得二次确认。',
|
|
1194
|
+
workflows: ['datarc-datasource'],
|
|
1195
|
+
operations: {},
|
|
1196
|
+
},
|
|
1197
|
+
membership: {
|
|
1198
|
+
title: '成员与用户组',
|
|
1199
|
+
description: '管理已有账号入区、角色与用户组;不创建账号或处理账号密码。',
|
|
1200
|
+
workflows: ['datarc-workspace-membership'],
|
|
1201
|
+
operations: {},
|
|
1202
|
+
},
|
|
1203
|
+
permissions: {
|
|
1204
|
+
title: '业务数据权限',
|
|
1205
|
+
description: '使用独立开放 API 密钥管理模型、列、行权限及映射表,不以业务登录令牌替代。',
|
|
1206
|
+
workflows: ['datarc-access-permissions'],
|
|
1207
|
+
operations: {},
|
|
1208
|
+
},
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
DOMAINS.query.operations.calculate_custom = {
|
|
1212
|
+
userPython: true,
|
|
1213
|
+
interpreter: 'python',
|
|
1214
|
+
description: '执行本次工作目录中的自定义Python计算文件,沿用原数据搜索技能的数据来源、计算口径和溯源规则。',
|
|
1215
|
+
parameters: {
|
|
1216
|
+
...workspace,
|
|
1217
|
+
script_file: {
|
|
1218
|
+
type: 'string',
|
|
1219
|
+
file: true,
|
|
1220
|
+
description: '已准备的Python文件;可以导入原calculate模块的load_series读取已确认结果。',
|
|
1221
|
+
},
|
|
1222
|
+
args: {
|
|
1223
|
+
type: 'array',
|
|
1224
|
+
items: { type: 'string' },
|
|
1225
|
+
description: '按原顺序传给Python脚本的参数,例如结果文件、workspace-id及输出路径;不是shell命令。',
|
|
1226
|
+
},
|
|
1227
|
+
},
|
|
1228
|
+
required: ['script_file'],
|
|
1229
|
+
write: false,
|
|
1230
|
+
};
|
|
1231
|
+
DOMAINS.query.inputContracts = {
|
|
1232
|
+
calculate_custom: {
|
|
1233
|
+
script: '在当前工作目录准备Python脚本,使用script_file和args执行;支持正常Python函数、循环、导入及实际运行时已安装的库,不使用另一套表达式DSL。',
|
|
1234
|
+
sources:
|
|
1235
|
+
'仅使用当前对话已确认的真实查询结果。可直接from calculate import load_series,以原函数核验工作区、身份、序列及覆盖;不扫描最近结果或手填业务数据。报告派生保留原账本与来源绑定。',
|
|
1236
|
+
output:
|
|
1237
|
+
'输出由脚本按实际计算口径写到stdout或指定文件;仅引用实际成功输出,不把失败、零分母、缺失或预览误当完整计算。按原HTML契约组织派生账本,不额外要求封装签名。',
|
|
1238
|
+
},
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
for (const kind of ['share', 'yoy', 'mom']) {
|
|
1242
|
+
DOMAINS.query.operations[`calculate_${kind}`] = operation(
|
|
1243
|
+
calculateScript,
|
|
1244
|
+
kind,
|
|
1245
|
+
kind === 'share' ? '按完整、同口径查询结果计算占比。' : '按完整、同口径查询结果计算期间增长率。',
|
|
1246
|
+
{
|
|
1247
|
+
...workspace,
|
|
1248
|
+
current_file: text('current', '本期已确认的完整查询结果文件。'),
|
|
1249
|
+
base_file: text('base', '总体分母或基期完整查询结果文件。'),
|
|
1250
|
+
value: text('value', '本期数值列名。'),
|
|
1251
|
+
base_value: text('base-value', '分母或基期数值列名,省略时沿用本期列。'),
|
|
1252
|
+
by: strings('by', '业务分组列,可重复。'),
|
|
1253
|
+
first: integer('first', '仅计算已确认排序的本期前 N 项。'),
|
|
1254
|
+
current_series: integer('current-series', '本期数据序列,从零开始。'),
|
|
1255
|
+
base_series: integer('base-series', '分母或基期数据序列,从零开始。'),
|
|
1256
|
+
...(kind === 'share' ? { total: switchFlag('total', '使用单行总体分母。') } : {}),
|
|
1257
|
+
},
|
|
1258
|
+
['workspace_id', 'current_file', 'base_file', 'value'],
|
|
1259
|
+
);
|
|
1260
|
+
}
|