@arcticdata/dsh-datarc-assistant 26.39.0 → 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 +45 -10
- package/api-operations.js +404 -0
- package/client.js +452 -87
- package/cordis.patch.yml +4 -4
- package/entry/SKILL.md +34 -0
- package/icon.png +0 -0
- package/index.js +35 -47
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- 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 -51
- package/{skills → runtime}/datarc-access-permissions/SKILL.md +30 -30
- package/{skills → runtime}/datarc-access-permissions/references/api.md +31 -31
- package/{skills → runtime}/datarc-access-permissions/references/write-order.md +16 -16
- package/{skills → runtime}/datarc-analysis-report/SKILL.md +125 -125
- package/{skills → runtime}/datarc-analysis-report/agents/openai.yaml +6 -6
- package/{skills → runtime}/datarc-analysis-report/references/analyst-frameworks.md +215 -215
- package/{skills → runtime}/datarc-analysis-report/references/api-contracts.md +478 -478
- package/{skills → runtime}/datarc-analysis-report/references/direct-card-fallback-design.md +66 -66
- package/{skills → runtime}/datarc-analysis-report/references/human-in-the-loop.md +142 -142
- package/{skills → runtime}/datarc-analysis-report/references/loop-personalization-policy.md +138 -138
- package/{skills → runtime}/datarc-analysis-report/references/manifest-example.json +779 -779
- package/{skills → runtime}/datarc-analysis-report/references/narrative-schema.md +160 -160
- package/{skills → runtime}/datarc-analysis-report/references/question-syntax.md +151 -151
- package/{skills → runtime}/datarc-analysis-report/scripts/run_analysis_report.py +2225 -2225
- package/{skills → runtime}/datarc-analysis-report/scripts/run_dataseek_cards.py +1914 -1914
- package/{skills → runtime}/datarc-analysis-report/scripts/test_run_analysis_report.py +5295 -5295
- package/{skills → runtime}/datarc-data-search/SKILL.md +243 -243
- package/{skills → runtime}/datarc-data-search/scripts/calculate.py +116 -116
- package/{skills → runtime}/datarc-data-search/scripts/data-search.mjs +628 -628
- package/{skills/datarc-dataseek-search → runtime/datarc-data-search}/scripts/datarc-client.mjs +464 -464
- package/{skills → runtime}/datarc-data-search/scripts/search-result.mjs +211 -211
- package/{skills → runtime}/datarc-dataseek-batch-evaluation/SKILL.md +59 -59
- package/{skills → runtime}/datarc-dataseek-batch-evaluation/references/artifacts.md +36 -36
- package/{skills → runtime}/datarc-dataseek-batch-evaluation/references/equivalence.md +30 -30
- package/{skills/datarc-data-search → runtime/datarc-dataseek-batch-evaluation}/scripts/datarc-client.mjs +464 -464
- package/{skills → runtime}/datarc-dataseek-batch-evaluation/scripts/dataseek-batch-evaluation.mjs +1020 -1020
- package/{skills → runtime}/datarc-dataseek-search/SKILL.md +96 -96
- package/{skills/datarc-dataseek-batch-evaluation → runtime/datarc-dataseek-search}/scripts/datarc-client.mjs +464 -464
- package/{skills → runtime}/datarc-dataseek-search/scripts/dataseek-search.mjs +257 -257
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/SKILL.md +44 -44
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/agents/openai.yaml +4 -4
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/evals/evals.json +165 -165
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/dataset.md +77 -77
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/input-and-resolution.md +93 -93
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/interventions.md +64 -64
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/knowledge-and-prompts.md +47 -47
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/rollback.md +11 -11
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/references/verification-and-rollback.md +95 -95
- package/{skills → runtime}/datarc-dataseek-semantic-debugging/scripts/semantic-debugging.mjs +29 -29
- package/{skills → runtime}/datarc-dataseek-testset-generation/SKILL.md +47 -47
- package/{skills → runtime}/datarc-dataseek-testset-generation/scripts/datarc-client.mjs +464 -464
- package/{skills → runtime}/datarc-dataseek-testset-generation/scripts/dataseek-testset-generation.mjs +526 -526
- package/{skills → runtime}/datarc-datasource/SKILL.md +97 -97
- package/{skills → runtime}/datarc-oauth/SKILL.md +50 -50
- package/{skills → runtime}/datarc-oauth/scripts/auth.mjs +192 -192
- package/{skills → runtime}/datarc-oauth/scripts/credentials.mjs +237 -237
- package/{skills → runtime}/datarc-report-add-card/SKILL.md +90 -90
- package/{skills → runtime}/datarc-report-add-card/agents/openai.yaml +4 -4
- package/runtime/datarc-report-add-card/scripts/datarc-client.mjs +464 -0
- package/{skills → runtime}/datarc-report-add-card/scripts/report-card.mjs +439 -439
- package/{skills → runtime}/datarc-semantic-alias/SKILL.md +20 -20
- package/{skills → runtime}/datarc-semantic-alias/scripts/alias-plan.mjs +422 -422
- package/{skills → runtime}/datarc-semantic-alias/scripts/alias.mjs +11 -11
- package/{skills → runtime}/datarc-semantic-calibration/SKILL.md +20 -20
- package/{skills → runtime}/datarc-semantic-calibration/scripts/calibration-plan.mjs +683 -683
- package/{skills → runtime}/datarc-semantic-calibration/scripts/calibration.mjs +11 -11
- package/{skills → runtime}/datarc-semantic-core/SKILL.md +12 -12
- package/{skills → runtime}/datarc-semantic-core/scripts/artifact-journal.mjs +853 -830
- package/{skills → runtime}/datarc-semantic-core/scripts/canonical.mjs +48 -48
- package/{skills → runtime}/datarc-semantic-core/scripts/case-model.mjs +608 -608
- package/{skills → runtime}/datarc-semantic-core/scripts/cli.mjs +180 -180
- package/{skills → runtime}/datarc-semantic-core/scripts/datarc-client.mjs +180 -180
- package/{skills → runtime}/datarc-semantic-core/scripts/interpretation-pairs.mjs +57 -57
- package/{skills → runtime}/datarc-semantic-core/scripts/interventions.mjs +693 -693
- package/{skills → runtime}/datarc-semantic-core/scripts/live-resolution.mjs +305 -305
- package/{skills → runtime}/datarc-semantic-core/scripts/model-scope.mjs +49 -49
- package/{skills → runtime}/datarc-semantic-core/scripts/reproduction.mjs +330 -330
- package/{skills → runtime}/datarc-semantic-core/scripts/semantic-cli.mjs +799 -740
- package/{skills → runtime}/datarc-semantic-core/scripts/shared.mjs +312 -312
- package/{skills → runtime}/datarc-semantic-core/scripts/verification.mjs +1111 -1014
- package/{skills → runtime}/datarc-semantic-dataset/SKILL.md +20 -20
- package/{skills → runtime}/datarc-semantic-dataset/scripts/dataset-plan.mjs +749 -749
- package/{skills → runtime}/datarc-semantic-dataset/scripts/dataset-preflight.mjs +813 -813
- package/{skills → runtime}/datarc-semantic-dataset/scripts/dataset.mjs +11 -11
- package/{skills → runtime}/datarc-semantic-knowledge/SKILL.md +38 -38
- package/{skills → runtime}/datarc-semantic-knowledge/references/knowledge-drafts.md +61 -61
- package/{skills → runtime}/datarc-semantic-knowledge/references/knowledge-generation.json +16 -16
- package/{skills → runtime}/datarc-semantic-knowledge/scripts/knowledge-draft.mjs +347 -347
- package/{skills → runtime}/datarc-semantic-knowledge/scripts/knowledge-plan.mjs +848 -848
- package/{skills → runtime}/datarc-semantic-knowledge/scripts/knowledge.mjs +31 -31
- package/{skills → runtime}/datarc-semantic-prompt/SKILL.md +20 -20
- package/{skills → runtime}/datarc-semantic-prompt/scripts/prompt-plan.mjs +598 -447
- package/{skills → runtime}/datarc-semantic-prompt/scripts/prompt.mjs +15 -15
- package/{skills → runtime}/datarc-semantic-synonym/SKILL.md +20 -20
- package/{skills → runtime}/datarc-semantic-synonym/scripts/synonym-plan.mjs +688 -688
- package/{skills → runtime}/datarc-semantic-synonym/scripts/synonym.mjs +11 -11
- package/{skills → runtime}/datarc-viz-analysis-report/SKILL.md +108 -108
- package/{skills → runtime}/datarc-viz-analysis-report/assets/LICENSE-echarts.md +8 -8
- package/{skills → runtime}/datarc-viz-analysis-report/assets/echarts.min.js +45 -45
- package/{skills → runtime}/datarc-viz-analysis-report/references/api-contracts.md +163 -163
- package/{skills → runtime}/datarc-viz-analysis-report/references/derivation-log.md +157 -157
- package/{skills → runtime}/datarc-viz-analysis-report/references/evidence-framework.md +76 -76
- package/{skills → runtime}/datarc-viz-analysis-report/references/html-template.md +92 -92
- package/{skills → runtime}/datarc-viz-analysis-report/references/provenance-format.md +56 -56
- package/{skills → runtime}/datarc-viz-analysis-report/references/question-syntax.md +151 -151
- package/{skills → runtime}/datarc-viz-analysis-report/scripts/render_viz_report.py +1708 -1708
- package/{skills → runtime}/datarc-viz-analysis-report/scripts/test_render_viz_report.py +964 -964
- package/{skills → runtime}/datarc-workspace-configuration/SKILL.md +59 -59
- package/{skills → runtime}/datarc-workspace-configuration/references/artifacts.md +75 -75
- package/{skills → runtime}/datarc-workspace-configuration/references/verification.md +20 -20
- package/{skills → runtime}/datarc-workspace-configuration/scripts/configuration.mjs +722 -662
- package/{skills → runtime}/datarc-workspace-context/SKILL.md +43 -43
- package/{skills → runtime}/datarc-workspace-context/agents/openai.yaml +4 -4
- package/{skills → runtime}/datarc-workspace-context/scripts/datarc-client.mjs +31 -31
- package/{skills → runtime}/datarc-workspace-context/scripts/query-display.mjs +114 -114
- package/{skills → runtime}/datarc-workspace-context/scripts/workspace-context.mjs +58 -58
- package/{skills → runtime}/datarc-workspace-custom-tables/SKILL.md +89 -89
- package/{skills → runtime}/datarc-workspace-custom-tables/scripts/datarc-client.mjs +165 -165
- package/{skills → runtime}/datarc-workspace-custom-tables/scripts/workspace-custom-tables.mjs +601 -601
- package/{skills → runtime}/datarc-workspace-keywords/SKILL.md +197 -197
- package/{skills → runtime}/datarc-workspace-keywords/agents/openai.yaml +4 -4
- package/{skills → runtime}/datarc-workspace-keywords/references/api-fields.md +79 -79
- package/{skills → runtime}/datarc-workspace-keywords/references/derived-measures.md +177 -177
- package/{skills → runtime}/datarc-workspace-keywords/scripts/datarc-client.mjs +145 -145
- package/{skills → runtime}/datarc-workspace-keywords/scripts/workspace-keywords.mjs +2421 -2421
- package/{skills → runtime}/datarc-workspace-membership/SKILL.md +29 -29
- package/{skills → runtime}/datarc-workspace-membership/references/api.md +19 -19
- package/{skills → runtime}/datarc-workspace-modeling/SKILL.md +209 -209
- package/{skills → runtime}/datarc-workspace-modeling/agents/openai.yaml +4 -4
- package/{skills → runtime}/datarc-workspace-modeling/references/join-preview.md +38 -38
- package/{skills → runtime}/datarc-workspace-modeling/references/model-plan.md +300 -300
- package/{skills → runtime}/datarc-workspace-modeling/references/model-tags.md +95 -95
- package/{skills → runtime}/datarc-workspace-modeling/references/modeling-contract.json +29 -29
- package/{skills → runtime}/datarc-workspace-modeling/references/modeling-fixtures.json +2423 -2423
- package/{skills → runtime}/datarc-workspace-modeling/scripts/datarc-client.mjs +137 -137
- package/{skills → runtime}/datarc-workspace-modeling/scripts/workspace-model-tags.mjs +238 -238
- package/{skills → runtime}/datarc-workspace-modeling/scripts/workspace-modeling.mjs +1261 -1261
- package/skills-provider.js +51 -0
- package/workflow-index.json +434 -0
- package/icon.svg +0 -4
- package/skills/datarc-report-add-card/scripts/datarc-client.mjs +0 -464
- package/skills-index.json +0 -194
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { resolveCredentials } from "../../datarc-oauth/scripts/credentials.mjs";
|
|
2
|
-
import { createWriteStream } from "node:fs";
|
|
3
|
-
import { mkdir, readFile, rename, rm, stat } from "node:fs/promises";
|
|
4
|
-
import { basename, dirname, isAbsolute, relative, resolve } from "node:path";
|
|
5
|
-
import { Readable } from "node:stream";
|
|
6
|
-
import { pipeline } from "node:stream/promises";
|
|
7
|
-
|
|
8
|
-
export class DatarcError extends Error {
|
|
9
|
-
constructor(message, code = "DATARC_ERROR", details) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.name = "DatarcError";
|
|
12
|
-
this.code = code;
|
|
13
|
-
this.details = details;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function parseArgs(argv) {
|
|
18
|
-
const result = { _: [] };
|
|
19
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
20
|
-
if (!argv[i].startsWith("--")) {
|
|
21
|
-
result._.push(argv[i]);
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const key = argv[i].slice(2);
|
|
25
|
-
const next = argv[i + 1];
|
|
26
|
-
if (next === undefined || next.startsWith("--")) result[key] = true;
|
|
27
|
-
else {
|
|
28
|
-
result[key] =
|
|
29
|
-
result[key] === undefined ? next : [].concat(result[key], next);
|
|
30
|
-
i += 1;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function required(args, key) {
|
|
37
|
-
if (args[key] === undefined || args[key] === true || args[key] === "")
|
|
38
|
-
throw new DatarcError(`缺少参数 --${key}`, "INVALID_ARGUMENT");
|
|
39
|
-
return args[key];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export async function readJson(path) {
|
|
43
|
-
const text = path === "-" ? await stdin() : await readFile(path, "utf8");
|
|
44
|
-
try {
|
|
45
|
-
return JSON.parse(text);
|
|
46
|
-
} catch {
|
|
47
|
-
throw new DatarcError("输入不是有效 JSON", "INVALID_JSON");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function createClient(options = {}) {
|
|
52
|
-
const { endpoint, token } = resolveCredentials(options);
|
|
53
|
-
const fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
54
|
-
const sleep =
|
|
55
|
-
options.sleep ??
|
|
56
|
-
((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
57
|
-
if (!endpoint)
|
|
58
|
-
throw new DatarcError("未配置 DATARC_ENDPOINT", "MISSING_ENDPOINT");
|
|
59
|
-
if (!token) throw new DatarcError("未配置 DATARC_TOKEN", "MISSING_TOKEN");
|
|
60
|
-
|
|
61
|
-
async function request(method, path, { query, body } = {}) {
|
|
62
|
-
const url = new URL(`${endpoint}${path}`);
|
|
63
|
-
for (const [key, value] of Object.entries(query ?? {}))
|
|
64
|
-
for (const item of [].concat(value ?? []))
|
|
65
|
-
if (item !== "") url.searchParams.append(key, item);
|
|
66
|
-
let response;
|
|
67
|
-
try {
|
|
68
|
-
response = await fetchImpl(url, {
|
|
69
|
-
method,
|
|
70
|
-
headers: {
|
|
71
|
-
Authorization: token,
|
|
72
|
-
...(body === undefined ? {} : { "Content-Type": "application/json" }),
|
|
73
|
-
},
|
|
74
|
-
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
75
|
-
});
|
|
76
|
-
} catch (error) {
|
|
77
|
-
throw new DatarcError(`网络请求失败:${error.message}`, "NETWORK_ERROR");
|
|
78
|
-
}
|
|
79
|
-
const text = await response.text();
|
|
80
|
-
let payload;
|
|
81
|
-
try {
|
|
82
|
-
payload = text ? JSON.parse(text) : {};
|
|
83
|
-
} catch {
|
|
84
|
-
throw new DatarcError(
|
|
85
|
-
`服务返回非 JSON(HTTP ${response.status})`,
|
|
86
|
-
"INVALID_RESPONSE",
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
if (!response.ok || (payload.status && payload.status !== "SUCCESS"))
|
|
90
|
-
throw new DatarcError(
|
|
91
|
-
payload.message || `请求失败(HTTP ${response.status})`,
|
|
92
|
-
apiErrorCode(response.status, payload),
|
|
93
|
-
{
|
|
94
|
-
httpStatus: response.status,
|
|
95
|
-
status: payload.status,
|
|
96
|
-
errorCode: payload.code ?? payload.errcode,
|
|
97
|
-
},
|
|
98
|
-
);
|
|
99
|
-
return payload.data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async function poll(workspaceId, uid, taskType, options = {}) {
|
|
103
|
-
const started = Date.now();
|
|
104
|
-
const maxWaitMs = Number(options.maxWaitMs ?? 600000);
|
|
105
|
-
const intervalMs = Number(options.intervalMs ?? 2000);
|
|
106
|
-
const pending = taskType === 4 ? [0, 1, 4, 5] : [0, 1];
|
|
107
|
-
while (Date.now() - started <= maxWaitMs) {
|
|
108
|
-
const task = await request(
|
|
109
|
-
"GET",
|
|
110
|
-
`/api/v2/account-projects/${workspaceId}/async-tasks/${uid}/`,
|
|
111
|
-
);
|
|
112
|
-
if (Number(task.status) === 2) {
|
|
113
|
-
const result = task.result;
|
|
114
|
-
if (
|
|
115
|
-
[8, 11].includes(Number(taskType)) &&
|
|
116
|
-
(!result ||
|
|
117
|
-
typeof result !== "object" ||
|
|
118
|
-
result.status !== "SUCCESS" ||
|
|
119
|
-
!Object.hasOwn(result, "data"))
|
|
120
|
-
)
|
|
121
|
-
throw new DatarcError(
|
|
122
|
-
"异步任务成功状态缺少有效结果",
|
|
123
|
-
"INVALID_TASK_RESULT",
|
|
124
|
-
{ status: task.status, result: safeTaskResult(result) },
|
|
125
|
-
);
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
if (!pending.includes(Number(task.status)))
|
|
129
|
-
throw new DatarcError("异步任务失败、取消或过期", "TASK_FAILED", {
|
|
130
|
-
status: task.status,
|
|
131
|
-
result: safeTaskResult(task.result),
|
|
132
|
-
});
|
|
133
|
-
await sleep(intervalMs);
|
|
134
|
-
}
|
|
135
|
-
throw new DatarcError("异步任务轮询超时", "TASK_TIMEOUT");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
async function download(url, destination) {
|
|
139
|
-
const targetUrl = new URL(url);
|
|
140
|
-
const headers =
|
|
141
|
-
targetUrl.origin === new URL(endpoint).origin
|
|
142
|
-
? { Authorization: token }
|
|
143
|
-
: {};
|
|
144
|
-
let response;
|
|
145
|
-
try {
|
|
146
|
-
response = await fetchImpl(targetUrl, { headers, redirect: "follow" });
|
|
147
|
-
} catch (error) {
|
|
148
|
-
throw new DatarcError(`下载失败:${error.message}`, "NETWORK_ERROR");
|
|
149
|
-
}
|
|
150
|
-
if (!response.ok || !response.body)
|
|
151
|
-
throw new DatarcError(
|
|
152
|
-
`下载失败(HTTP ${response.status})`,
|
|
153
|
-
apiErrorCode(response.status, {}),
|
|
154
|
-
);
|
|
155
|
-
await mkdir(dirname(destination), { recursive: true });
|
|
156
|
-
const temporary = `${destination}.part`;
|
|
157
|
-
let overwritten = false;
|
|
158
|
-
try {
|
|
159
|
-
await stat(destination);
|
|
160
|
-
overwritten = true;
|
|
161
|
-
} catch (error) {
|
|
162
|
-
if (error.code !== "ENOENT") throw error;
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
await pipeline(
|
|
166
|
-
Readable.fromWeb(response.body),
|
|
167
|
-
createWriteStream(temporary),
|
|
168
|
-
);
|
|
169
|
-
await rm(destination, { force: true });
|
|
170
|
-
await rename(temporary, destination);
|
|
171
|
-
return { size: (await stat(destination)).size, overwritten };
|
|
172
|
-
} catch (error) {
|
|
173
|
-
await rm(temporary, { force: true });
|
|
174
|
-
throw new DatarcError(
|
|
175
|
-
`保存下载文件失败:${error.message}`,
|
|
176
|
-
"DOWNLOAD_FAILED",
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return { request, poll, sleep, download };
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function primaryCards(cards = []) {
|
|
184
|
-
if (!Array.isArray(cards)) return [];
|
|
185
|
-
const direct = cards.find(
|
|
186
|
-
(card) => Number(card?.resultType ?? card?.result_type ?? 0) === 0,
|
|
187
|
-
);
|
|
188
|
-
return direct ? [direct] : [];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function seriesOf(cards = []) {
|
|
192
|
-
return cards.flatMap((card, cardIndex) =>
|
|
193
|
-
(card.data ?? []).map((series, seriesIndex) => ({
|
|
194
|
-
cardIndex,
|
|
195
|
-
seriesIndex,
|
|
196
|
-
title: card.title ?? `卡片 ${cardIndex + 1}`,
|
|
197
|
-
cardType: card.card_type,
|
|
198
|
-
columns: series.columns ?? [],
|
|
199
|
-
query: series.data,
|
|
200
|
-
})),
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function collectCards(value) {
|
|
205
|
-
const cards = [];
|
|
206
|
-
const seen = new Set();
|
|
207
|
-
function visit(current) {
|
|
208
|
-
if (!current || typeof current !== "object" || seen.has(current)) return;
|
|
209
|
-
seen.add(current);
|
|
210
|
-
if (Array.isArray(current.cards))
|
|
211
|
-
cards.push(...primaryCards(current.cards));
|
|
212
|
-
for (const [key, child] of Object.entries(current)) {
|
|
213
|
-
if (key !== "cards") visit(child);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
visit(value);
|
|
217
|
-
if (!cards.length && Array.isArray(value)) return value;
|
|
218
|
-
return cards;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export async function preview(client, workspaceId, cards, options = {}) {
|
|
222
|
-
const output = [];
|
|
223
|
-
const seriesList = seriesOf(cards);
|
|
224
|
-
for (const series of seriesList) {
|
|
225
|
-
try {
|
|
226
|
-
if (!series.query?.qKey)
|
|
227
|
-
throw new DatarcError("卡片缺少 qKey", "MISSING_QKEY");
|
|
228
|
-
const queryWorkspaceId = series.query.project ?? workspaceId;
|
|
229
|
-
const task = await client.request(
|
|
230
|
-
"POST",
|
|
231
|
-
`/api/v2/account-projects/${queryWorkspaceId}/async-tasks/`,
|
|
232
|
-
{
|
|
233
|
-
body: {
|
|
234
|
-
taskType: 8,
|
|
235
|
-
params: {
|
|
236
|
-
qKey: series.query.qKey,
|
|
237
|
-
params: queryPageParams(series.query.params, options),
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
);
|
|
242
|
-
output.push({
|
|
243
|
-
...series,
|
|
244
|
-
data: unwrapTaskResult(
|
|
245
|
-
await client.poll(queryWorkspaceId, task.uid, 8, options),
|
|
246
|
-
),
|
|
247
|
-
});
|
|
248
|
-
} catch (error) {
|
|
249
|
-
rethrowGlobalError(error);
|
|
250
|
-
output.push({ ...series, error: errorJson(error) });
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return output;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export function unwrapTaskResult(value) {
|
|
257
|
-
if (
|
|
258
|
-
value &&
|
|
259
|
-
typeof value === "object" &&
|
|
260
|
-
value.status === "SUCCESS" &&
|
|
261
|
-
Object.hasOwn(value, "data")
|
|
262
|
-
)
|
|
263
|
-
return value.data;
|
|
264
|
-
return value;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export async function exportAll(client, workspaceId, cards, options = {}) {
|
|
268
|
-
const extension = String(options.extension ?? ".csv").replace(/^(?!\.)/, ".");
|
|
269
|
-
if (![".csv", ".xlsx"].includes(extension))
|
|
270
|
-
throw new DatarcError("导出格式仅支持 csv 或 xlsx", "INVALID_ARGUMENT");
|
|
271
|
-
const output = [];
|
|
272
|
-
const seriesList = seriesOf(cards);
|
|
273
|
-
for (const series of seriesList) {
|
|
274
|
-
if ([1, 12].includes(Number(series.cardType))) {
|
|
275
|
-
output.push({
|
|
276
|
-
...series,
|
|
277
|
-
extension,
|
|
278
|
-
status: "skipped",
|
|
279
|
-
reasonCode: "NUMBER_CARD_NOT_EXPORTABLE",
|
|
280
|
-
message: "数字卡不支持导出 CSV 或 Excel",
|
|
281
|
-
});
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
try {
|
|
285
|
-
if (!series.query?.qKey)
|
|
286
|
-
throw new DatarcError("卡片缺少 qKey", "MISSING_QKEY");
|
|
287
|
-
const title = fileTitle(
|
|
288
|
-
options.title ?? series.title,
|
|
289
|
-
seriesList.length > 1 ? series.seriesIndex + 1 : undefined,
|
|
290
|
-
);
|
|
291
|
-
const task = await client.request(
|
|
292
|
-
"POST",
|
|
293
|
-
`/api/v2/account-projects/${workspaceId}/async-tasks/`,
|
|
294
|
-
{
|
|
295
|
-
body: {
|
|
296
|
-
taskType: 4,
|
|
297
|
-
params: {
|
|
298
|
-
title,
|
|
299
|
-
extension,
|
|
300
|
-
data: [{ data: series.query, columns: series.columns }],
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
);
|
|
305
|
-
const exported = {
|
|
306
|
-
...series,
|
|
307
|
-
exportTitle: title,
|
|
308
|
-
extension,
|
|
309
|
-
data: await client.poll(workspaceId, task.uid, 4, options),
|
|
310
|
-
};
|
|
311
|
-
if (options.download) {
|
|
312
|
-
const url = exported.data?.url;
|
|
313
|
-
if (!url)
|
|
314
|
-
throw new DatarcError("导出结果缺少下载地址", "MISSING_DOWNLOAD_URL");
|
|
315
|
-
const directory = outputDirectory(options.outputDir, options.taskId);
|
|
316
|
-
const filePath = resolve(
|
|
317
|
-
directory.absolutePath,
|
|
318
|
-
`${title}${extension}`,
|
|
319
|
-
);
|
|
320
|
-
const saved = await client.download(url, filePath);
|
|
321
|
-
exported.file = {
|
|
322
|
-
relativePath: relative(process.cwd(), filePath),
|
|
323
|
-
absolutePath: filePath,
|
|
324
|
-
size: saved.size,
|
|
325
|
-
overwritten: Boolean(saved.overwritten),
|
|
326
|
-
};
|
|
327
|
-
exported.directory = directory;
|
|
328
|
-
}
|
|
329
|
-
output.push(exported);
|
|
330
|
-
} catch (error) {
|
|
331
|
-
rethrowGlobalError(error);
|
|
332
|
-
output.push({ ...series, extension, error: errorJson(error) });
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return output;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function outputDirectory(value = ".datarc-downloads", taskId) {
|
|
339
|
-
if (typeof value !== "string" || !value)
|
|
340
|
-
throw new DatarcError(
|
|
341
|
-
"--output-dir 必须是非空相对路径",
|
|
342
|
-
"INVALID_ARGUMENT",
|
|
343
|
-
);
|
|
344
|
-
if (isAbsolute(value))
|
|
345
|
-
throw new DatarcError(
|
|
346
|
-
"--output-dir 必须是当前工作目录下的相对路径",
|
|
347
|
-
"INVALID_ARGUMENT",
|
|
348
|
-
);
|
|
349
|
-
if (
|
|
350
|
-
typeof taskId !== "string" ||
|
|
351
|
-
!/^[A-Za-z0-9._-]{1,80}$/.test(taskId) ||
|
|
352
|
-
[".", ".."].includes(taskId)
|
|
353
|
-
)
|
|
354
|
-
throw new DatarcError(
|
|
355
|
-
"下载时必须提供仅含字母、数字、点、下划线或连字符的 --task-id",
|
|
356
|
-
"INVALID_ARGUMENT",
|
|
357
|
-
);
|
|
358
|
-
const cwd = resolve(process.cwd());
|
|
359
|
-
const absolutePath = resolve(cwd, value, taskId);
|
|
360
|
-
const fromCwd = relative(cwd, absolutePath);
|
|
361
|
-
if (fromCwd.startsWith("..") || isAbsolute(fromCwd))
|
|
362
|
-
throw new DatarcError(
|
|
363
|
-
"--output-dir 不得超出当前工作目录",
|
|
364
|
-
"INVALID_ARGUMENT",
|
|
365
|
-
);
|
|
366
|
-
return { taskId, relativePath: fromCwd || ".", absolutePath };
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export function assertAccess(data) {
|
|
370
|
-
if (data?.canAccessData === false)
|
|
371
|
-
throw new DatarcError("当前用户没有数据访问权限", "DATA_ACCESS_DENIED");
|
|
372
|
-
if (data?.noPermissionTokens?.length)
|
|
373
|
-
throw new DatarcError("查询包含无权访问的字段", "FIELD_ACCESS_DENIED", {
|
|
374
|
-
tokens: data.noPermissionTokens.map(({ word, prop }) => ({ word, prop })),
|
|
375
|
-
});
|
|
376
|
-
return data;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export function isGlobalError(error) {
|
|
380
|
-
return [
|
|
381
|
-
"MISSING_ENDPOINT",
|
|
382
|
-
"MISSING_TOKEN",
|
|
383
|
-
"NETWORK_ERROR",
|
|
384
|
-
"INVALID_RESPONSE",
|
|
385
|
-
"AUTHENTICATION_FAILED",
|
|
386
|
-
"PERMISSION_DENIED",
|
|
387
|
-
"RATE_LIMITED",
|
|
388
|
-
"DATA_ACCESS_DENIED",
|
|
389
|
-
"FIELD_ACCESS_DENIED",
|
|
390
|
-
].includes(error?.code);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
export function rethrowGlobalError(error) {
|
|
394
|
-
if (isGlobalError(error)) throw error;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
export function errorJson(error) {
|
|
398
|
-
return {
|
|
399
|
-
code: error?.code ?? "UNEXPECTED_ERROR",
|
|
400
|
-
message: error?.message ?? String(error),
|
|
401
|
-
...(error?.details === undefined ? {} : { details: error.details }),
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
export async function runCli(main) {
|
|
405
|
-
try {
|
|
406
|
-
process.stdout.write(
|
|
407
|
-
`${JSON.stringify({ ok: true, data: await main() }, null, 2)}\n`,
|
|
408
|
-
);
|
|
409
|
-
} catch (error) {
|
|
410
|
-
process.stdout.write(
|
|
411
|
-
`${JSON.stringify({ ok: false, error: errorJson(error) }, null, 2)}\n`,
|
|
412
|
-
);
|
|
413
|
-
process.exitCode = 1;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
function apiErrorCode(httpStatus, payload) {
|
|
418
|
-
const businessCodes = [payload.status, payload.code, payload.errcode]
|
|
419
|
-
.filter((value) => value !== undefined && value !== null)
|
|
420
|
-
.map(String);
|
|
421
|
-
if (httpStatus === 401) return "AUTHENTICATION_FAILED";
|
|
422
|
-
if (httpStatus === 403) return "PERMISSION_DENIED";
|
|
423
|
-
if (httpStatus === 429 || businessCodes.includes("0110001"))
|
|
424
|
-
return "RATE_LIMITED";
|
|
425
|
-
return "API_ERROR";
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
function queryPageParams(value, options) {
|
|
429
|
-
const params =
|
|
430
|
-
value && typeof value === "object" && !Array.isArray(value)
|
|
431
|
-
? { ...value }
|
|
432
|
-
: {};
|
|
433
|
-
if (options.offset !== undefined) params.offset = Number(options.offset);
|
|
434
|
-
else if (params.offset === undefined) params.offset = 0;
|
|
435
|
-
if (options.limit !== undefined) params.limit = Number(options.limit);
|
|
436
|
-
else if (params.limit === undefined) params.limit = 100;
|
|
437
|
-
return params;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
function safeTaskResult(value) {
|
|
441
|
-
if (value === null || value === undefined) return value;
|
|
442
|
-
if (typeof value === "string") return { message: "异步任务执行失败" };
|
|
443
|
-
if (typeof value !== "object" || Array.isArray(value)) return undefined;
|
|
444
|
-
return {
|
|
445
|
-
...(value.status === undefined ? {} : { status: value.status }),
|
|
446
|
-
...(value.message === undefined ? {} : { message: "异步任务执行失败" }),
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function fileTitle(value, seriesNumber) {
|
|
451
|
-
const safeTitle = basename(String(value ?? "data"))
|
|
452
|
-
.replace(/[\\/:*?"<>|]/g, "_")
|
|
453
|
-
.trim()
|
|
454
|
-
.replace(/[. ]+$/g, "")
|
|
455
|
-
.slice(0, 100);
|
|
456
|
-
const base = safeTitle || "data";
|
|
457
|
-
return seriesNumber === undefined ? base : `${base}-${seriesNumber}`;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
async function stdin() {
|
|
461
|
-
const chunks = [];
|
|
462
|
-
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
463
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
464
|
-
}
|
package/skills-index.json
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "datarc-access-permissions",
|
|
4
|
-
"description": "管理北极九章(datarc)工作区成员和用户组的数据权限,以及权限映射表。用于批量配置模型、列、行权限或按用户属性更新映射表;工作区成员、角色和用户组管理请使用当前工作区管理入口;账号创建不在本技能范围。",
|
|
5
|
-
"invocation": {
|
|
6
|
-
"modelInvocable": true,
|
|
7
|
-
"userInvocable": true
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "datarc-analysis-report",
|
|
12
|
-
"description": "在北极九章(datarc)工作区新建私有多章节系统报告(Pinboard),验证后返回工作区报告链接。用户提出经营复盘、专题分析等分析报告需求时使用;未指明交付形态时先问一次要工作区系统报告还是离线 HTML,选 HTML 时移交 datarc-viz-analysis-report。",
|
|
13
|
-
"invocation": {
|
|
14
|
-
"modelInvocable": true,
|
|
15
|
-
"userInvocable": true
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "datarc-data-search",
|
|
20
|
-
"description": "北极九章(datarc)模型驱动的数据搜索与分析技能。复用同一会话已确认的工作区、模型和结果,按需补查,以 Python 计算临时占比和同环比,检查自然语言问题的分词质量,处理模糊词、一词多义和未知词,将问题拆为单个、并列或链式查询,并通过脚本一次性完成 ask、首张直接结果卡片取数、智能解释、预览、导出和本地下载。用于用户要求筛选、分组、统计、排序、排名、趋势、对比、占比、分析或下载工作区数据时;不负责发现工作区或修改模型及业务数据。",
|
|
21
|
-
"invocation": {
|
|
22
|
-
"modelInvocable": true,
|
|
23
|
-
"userInvocable": true
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "datarc-dataseek-batch-evaluation",
|
|
28
|
-
"description": "批量回归评估北极九章(datarc)DataSeek 对 CSV 问题的理解步骤、最终问题 Token 及其 Word;调用真实 DataSeek、保留原始列、自动跳过完全一致项,并由大模型判断非完全一致结果是否逻辑等价。用于批量测试、回归验收和定位理解流程偏差,不用于生成测试集或修改语义配置。",
|
|
29
|
-
"invocation": {
|
|
30
|
-
"modelInvocable": true,
|
|
31
|
-
"userInvocable": true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "datarc-dataseek-search",
|
|
36
|
-
"description": "北极九章(datarc)DataSeek 会话搜索技能。调用网页 DataSeek 内部 API,支持上下文追问、parallel 并列查询、chained 链式查询、多卡片预览、分页、完整文件导出、重试与取消。普通模型发现、字段探索、维度值和单轮查询优先使用 datarc-data-search。",
|
|
37
|
-
"invocation": {
|
|
38
|
-
"modelInvocable": true,
|
|
39
|
-
"userInvocable": true
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "datarc-dataseek-semantic-debugging",
|
|
44
|
-
"description": "Use when an administrator supplies mapping lists, a current or reported DataSeek mismatch, colloquial or abbreviated field or value terms, fixed semantic bundles, reusable entity sets, or a DataSeek mismatch caused by a contextual rule that may require Knowledge and Prompt bridging.",
|
|
45
|
-
"invocation": {
|
|
46
|
-
"modelInvocable": true,
|
|
47
|
-
"userInvocable": true
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"name": "datarc-dataseek-testset-generation",
|
|
52
|
-
"description": "为北极九章(datarc)DataSeek 生成批量测试集:可由大模型结合工作区从零构造问题,也可读取已有 CSV 的问题列;逐题调用真实 DataSeek,并输出理解 JSON、最终问题 Token 和 Token Word。用于准备回归测试输入,不用于判断测试结果或修改语义配置。",
|
|
53
|
-
"invocation": {
|
|
54
|
-
"modelInvocable": true,
|
|
55
|
-
"userInvocable": true
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "datarc-datasource",
|
|
60
|
-
"description": "安全配置、验证或切换北极九章(datarc)工作区的数据源。用户要求为指定名称的工作区配置数据库类型和连接信息时使用;在写入前读取现有配置、隐藏密码、明确说明替换影响并取得用户二次确认。",
|
|
61
|
-
"invocation": {
|
|
62
|
-
"modelInvocable": true,
|
|
63
|
-
"userInvocable": true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "datarc-oauth",
|
|
68
|
-
"description": "北极九章(datarc)业务用户网页授权登录、工作区级凭据配置与接口错误处理。优先复用已有凭据;缺失时通过服务网址发起网页授权,自动领取个人令牌并保存,处理认证失效、权限不足及服务异常。",
|
|
69
|
-
"invocation": {
|
|
70
|
-
"modelInvocable": true,
|
|
71
|
-
"userInvocable": true
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "datarc-report-add-card",
|
|
76
|
-
"description": "将北极九章(datarc)已有查询结果中的一张数据卡保存到可编辑报告,或新建报告后加入并返回链接。用于“把刚才第二张图放进新周报”等明确保存现有结果的请求。",
|
|
77
|
-
"invocation": {
|
|
78
|
-
"modelInvocable": true,
|
|
79
|
-
"userInvocable": true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"name": "datarc-semantic-alias",
|
|
84
|
-
"description": "alias 语义干预子 skill。scripts/alias.mjs 注册本 kind(alias)的 plan/apply/verify/rollback;独立运行,脚本依赖 datarc-semantic-core,名称选择依赖 datarc-workspace-context。",
|
|
85
|
-
"invocation": {
|
|
86
|
-
"modelInvocable": true,
|
|
87
|
-
"userInvocable": true
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"name": "datarc-semantic-calibration",
|
|
92
|
-
"description": "calibration 语义干预子 skill。scripts/calibration.mjs 注册本 kind(semantic_calibration)的 plan/apply/verify/rollback;独立运行,脚本依赖 datarc-semantic-core,名称选择依赖 datarc-workspace-context。",
|
|
93
|
-
"invocation": {
|
|
94
|
-
"modelInvocable": true,
|
|
95
|
-
"userInvocable": true
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "datarc-semantic-core",
|
|
100
|
-
"description": "Shared runtime and CLI framework for the datarc semantic-debugging skill family. Installed alongside the datarc-* semantic sub-skills, which import its scripts.",
|
|
101
|
-
"invocation": {
|
|
102
|
-
"modelInvocable": true,
|
|
103
|
-
"userInvocable": true
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "datarc-semantic-dataset",
|
|
108
|
-
"description": "dataset 语义干预子 skill。scripts/dataset.mjs 注册本 kind(dataset)的 plan/apply/verify/rollback;独立运行,脚本依赖 datarc-semantic-core,名称选择依赖 datarc-workspace-context。",
|
|
109
|
-
"invocation": {
|
|
110
|
-
"modelInvocable": true,
|
|
111
|
-
"userInvocable": true
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"name": "datarc-semantic-knowledge",
|
|
116
|
-
"description": "北极九章(datarc)工作区知识管理。将自然语言业务口径和分析习惯整理为多用途、带模型范围的知识草稿,确认方案后保存、验证和精确回滚。用于管理员维护共享知识,依赖 datarc-semantic-core 与 datarc-semantic-prompt。",
|
|
117
|
-
"invocation": {
|
|
118
|
-
"modelInvocable": true,
|
|
119
|
-
"userInvocable": true
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"name": "datarc-semantic-prompt",
|
|
124
|
-
"description": "prompt 语义干预子 skill。scripts/prompt.mjs 注册 prompt_bridge + knowledge 两类;独立运行,依赖 datarc-semantic-core 与 datarc-semantic-knowledge。",
|
|
125
|
-
"invocation": {
|
|
126
|
-
"modelInvocable": true,
|
|
127
|
-
"userInvocable": true
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"name": "datarc-semantic-synonym",
|
|
132
|
-
"description": "synonym 语义干预子 skill。scripts/synonym.mjs 注册本 kind(dimension_value_synonym)的 plan/apply/verify/rollback;独立运行,脚本依赖 datarc-semantic-core,名称选择依赖 datarc-workspace-context。",
|
|
133
|
-
"invocation": {
|
|
134
|
-
"modelInvocable": true,
|
|
135
|
-
"userInvocable": true
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"name": "datarc-viz-analysis-report",
|
|
140
|
-
"description": "在北极九章(datarc)生成可离线打开的单文件交互式 HTML 分析报告。用户提出分析报告需求时使用;未指明交付形态时先问一次要离线 HTML 文件还是工作区系统报告,选系统报告时移交 datarc-analysis-report。明确要 HTML、离线文件或自行组装交互图表时直接开工。",
|
|
141
|
-
"invocation": {
|
|
142
|
-
"modelInvocable": true,
|
|
143
|
-
"userInvocable": true
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "datarc-workspace-configuration",
|
|
148
|
-
"description": "为北极九章工作区复杂配置生成可确认的方案文档,并在配置后执行真实搜索验收、生成附证据的简短报告。用于跨技能配置、用户要求先出方案或配置后验证;配置写入仍由对应业务技能完成。",
|
|
149
|
-
"invocation": {
|
|
150
|
-
"modelInvocable": true,
|
|
151
|
-
"userInvocable": true
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"name": "datarc-workspace-context",
|
|
156
|
-
"description": "北极九章(datarc)工作区名称发现与查询上下文技能。在任何查询、报告或配置任务尚未确定工作区时,先读取可访问工作区名称并让用户选择,内部解析 ID;选定后可读取模型、指标、维度及示例。不修改工作区或执行数据查询。",
|
|
157
|
-
"invocation": {
|
|
158
|
-
"modelInvocable": true,
|
|
159
|
-
"userInvocable": true
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "datarc-workspace-custom-tables",
|
|
164
|
-
"description": "在北极九章(datarc)工作区创建和维护 SQL 自定义表,支持试跑 SQL、查看字段与样例、修改 SQL、改名及模型引用影响检查。用于准备可复用的查询来源;不创建数据库物理表,不写入业务数据。",
|
|
165
|
-
"invocation": {
|
|
166
|
-
"modelInvocable": true,
|
|
167
|
-
"userInvocable": true
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "datarc-workspace-keywords",
|
|
172
|
-
"description": "当用户要求在北极九章(datarc)工作区查询、创建、修改或删除指标、维度、时间维度、维度表,编辑维度英文回显名,调整维度值可搜索状态,或在基础模型完成后创建衍生指标时使用。修改单个模型字段绑定或关联时使用 datarc-workspace-modeling。",
|
|
173
|
-
"invocation": {
|
|
174
|
-
"modelInvocable": true,
|
|
175
|
-
"userInvocable": true
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "datarc-workspace-membership",
|
|
180
|
-
"description": "管理北极九章(datarc)工作区中的已有用户、成员角色、用户组及组成员关系。用于批量拉人入区、设置普通用户或管理员、分配用户组;账号创建和密码管理不在本技能范围。",
|
|
181
|
-
"invocation": {
|
|
182
|
-
"modelInvocable": true,
|
|
183
|
-
"userInvocable": true
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"name": "datarc-workspace-modeling",
|
|
188
|
-
"description": "当用户要求在北极九章(datarc)工作区创建或修改数据模型、从数据库表发现事实表和维表、批量建模并复用工作区语义资源,或明确要求管理模型标签及关联时使用。独立维护工作区关键词或创建衍生指标时使用 datarc-workspace-keywords。",
|
|
189
|
-
"invocation": {
|
|
190
|
-
"modelInvocable": true,
|
|
191
|
-
"userInvocable": true
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
]
|