@ats-cx/cx-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.env.example +8 -0
  2. package/README.md +119 -0
  3. package/bin/cx-cli.cjs +90 -0
  4. package/config/apm-provider.json +7 -0
  5. package/config/apm-provider.template.jsonc +48 -0
  6. package/config/diagnostic-rules.json +54 -0
  7. package/config/diagnostic-rules.template.jsonc +82 -0
  8. package/config/event-semantics.json +828 -0
  9. package/config/event-semantics.template.jsonc +13 -0
  10. package/config/toolkit.json +3 -0
  11. package/dist/apm-help.d.ts +5 -0
  12. package/dist/apm-help.js +108 -0
  13. package/dist/apm-output.d.ts +49 -0
  14. package/dist/apm-output.js +115 -0
  15. package/dist/budget.d.ts +14 -0
  16. package/dist/budget.js +16 -0
  17. package/dist/cli.d.ts +20 -0
  18. package/dist/cli.js +596 -0
  19. package/dist/context.d.ts +12 -0
  20. package/dist/context.js +20 -0
  21. package/dist/contract.d.ts +11 -0
  22. package/dist/contract.js +4 -0
  23. package/dist/errors.d.ts +4 -0
  24. package/dist/errors.js +8 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +8 -0
  27. package/dist/init.d.ts +17 -0
  28. package/dist/init.js +194 -0
  29. package/dist/output.d.ts +7 -0
  30. package/dist/output.js +7 -0
  31. package/dist/project-pull.d.ts +32 -0
  32. package/dist/project-pull.js +81 -0
  33. package/dist/report.d.ts +3 -0
  34. package/dist/report.js +42 -0
  35. package/dist/skills.d.ts +12 -0
  36. package/dist/skills.js +430 -0
  37. package/dist/tools/apm-tools.d.ts +115 -0
  38. package/dist/tools/apm-tools.js +329 -0
  39. package/dist/tools/conclusion-tools.d.ts +24 -0
  40. package/dist/tools/conclusion-tools.js +61 -0
  41. package/dist/tools/create-run.d.ts +61 -0
  42. package/dist/tools/create-run.js +273 -0
  43. package/dist/tools/log-tools.d.ts +68 -0
  44. package/dist/tools/log-tools.js +116 -0
  45. package/dist/tools/project-tools.d.ts +82 -0
  46. package/dist/tools/project-tools.js +139 -0
  47. package/dist/workspace.d.ts +51 -0
  48. package/dist/workspace.js +104 -0
  49. package/package.json +37 -0
  50. package/skills/apm-query/SKILL.md +304 -0
  51. package/skills/apm-query/agents/openai.yaml +10 -0
  52. package/skills/cx-cli-setup/SKILL.md +120 -0
  53. package/skills/cx-cli-setup/agents/openai.yaml +11 -0
  54. package/skills/editor-diagnostic/SKILL.md +255 -0
  55. package/skills/editor-diagnostic/agents/openai.yaml +13 -0
  56. package/skills/semantics-curation/SKILL.md +151 -0
  57. package/skills/semantics-curation/agents/openai.yaml +12 -0
package/dist/skills.js ADDED
@@ -0,0 +1,430 @@
1
+ import { existsSync, lstatSync, mkdirSync, readdirSync, readlinkSync, realpathSync, symlinkSync, unlinkSync, writeFileSync, } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { isApmConfigured, loadConfig, machineConfigDir, SENTENCE } from "@ats-cx/cx-core";
5
+ import { jsonOut } from "./output.js";
6
+ export const SKILLS_INSTALL_HELP = `Usage: cx-cli skills install
7
+
8
+ 把包内 skills/<name> 软链进本机 Agent(两段链):
9
+ <包根>/skills/<name> -> ~/.agents/skills/<name> 中央 skills 库;Codex 直接读这里
10
+ ~/.agents/skills/<name> -> ~/.claude/skills/<name> 仅当 ~/.claude/ 存在;Claude Code 只读这里
11
+ 并创建机器级覆盖目录 ~/.config/cx-cli/(遵 $XDG_CONFIG_HOME),缺 apm-provider.local.json 则落骨架(已有不覆盖)。
12
+
13
+ 幂等: 已指向当前包的链不动;指向别处或悬空的软链重指(输出 updated);目标是真实文件/目录则跳过并警告,不删。
14
+ 只支持 npm 全局安装(npm i -g @ats-cx/cx-cli)与维护者的 pnpm link;npx 缓存与 pnpm add -g 下拒绝(exit 1)。
15
+ 装好后 Agent 无需重启;包升级后新增的 skill 需重跑本命令;更名 / 删除的旧链由本命令自动清理(pruned)。
16
+
17
+ 输出:
18
+ { packageRoot, packageVersion, centralDir, agents, skills, created, updated, skipped, pruned, configDir, warnings, hint }`;
19
+ export const SKILLS_STATUS_HELP = `Usage: cx-cli skills status
20
+
21
+ 检查包内每个 skill 的两段链(中央库 ~/.agents/skills/<name>;~/.claude/ 存在时再查 ~/.claude/skills/<name>)
22
+ 与机器级覆盖目录 ~/.config/cx-cli/ 是否就绪。链状态: linked / stale(指向别处)/ dangling(悬空)/ missing / occupied(被真实目录占用)。
23
+ 全部 linked 才 ok;否则 exit 1 并在 issues 列出。apm 未配置只进 hint,不影响 ok。
24
+
25
+ 输出:
26
+ { ok, packageRoot, packageVersion, centralDir, agents, skills: [{ name, central, claude? }], orphans, issues, configDir, hint }`;
27
+ export const SKILLS_UNINSTALL_HELP = `Usage: cx-cli skills uninstall
28
+
29
+ 解除本包的 skills 链接: 删 ~/.claude/skills/<name>、~/.codex/skills/<name> 中指向中央库的软链,
30
+ 再删 ~/.agents/skills/<name> 中指向当前包或已悬空的软链。指向别处的软链与真实文件/目录一律不动(列入 skipped)。
31
+ 不动 ~/.config/cx-cli/。卸载顺序: 先本命令,再 npm rm -g @ats-cx/cx-cli。
32
+
33
+ 输出:
34
+ { packageRoot, packageVersion, removed, skipped: [{ path, reason }], warnings, hint }`;
35
+ function skillInventory(packageRoot) {
36
+ const skillsDir = join(packageRoot, "skills");
37
+ const warnings = [];
38
+ const names = [];
39
+ for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
40
+ if (entry.name.startsWith(".") || !entry.isDirectory()) {
41
+ continue;
42
+ }
43
+ const skillFile = join(skillsDir, entry.name, "SKILL.md");
44
+ if (!existsSync(skillFile)) {
45
+ warnings.push(`跳过 ${join(skillsDir, entry.name)}:缺少 SKILL.md。`);
46
+ continue;
47
+ }
48
+ names.push(entry.name);
49
+ }
50
+ names.sort();
51
+ return { names, warnings };
52
+ }
53
+ function inspectLink(path, expected, mode) {
54
+ if (!existsSync(path)) {
55
+ try {
56
+ const stat = lstatSync(path);
57
+ if (stat.isSymbolicLink()) {
58
+ return { path, state: "dangling", target: readlinkSync(path) };
59
+ }
60
+ return { path, state: "occupied" };
61
+ }
62
+ catch (error) {
63
+ if (error.code === "ENOENT") {
64
+ return { path, state: "missing" };
65
+ }
66
+ throw error;
67
+ }
68
+ }
69
+ const stat = lstatSync(path);
70
+ if (!stat.isSymbolicLink()) {
71
+ return { path, state: "occupied" };
72
+ }
73
+ const target = readlinkSync(path);
74
+ const resolvesTo = realpathSync(path);
75
+ const linked = mode === "realpath" ? resolvesTo === expected : target === expected;
76
+ return { path, state: linked ? "linked" : "stale", target, resolvesTo };
77
+ }
78
+ function symlinkTarget(path) {
79
+ try {
80
+ return lstatSync(path).isSymbolicLink() ? readlinkSync(path) : null;
81
+ }
82
+ catch (error) {
83
+ if (error.code === "ENOENT") {
84
+ return null;
85
+ }
86
+ throw error;
87
+ }
88
+ }
89
+ function directoryNames(path) {
90
+ if (!existsSync(path)) {
91
+ return [];
92
+ }
93
+ return readdirSync(path).sort();
94
+ }
95
+ function findOrphans(packageRoot, skillNames, home) {
96
+ const known = new Set(skillNames);
97
+ const centralDir = join(home, ".agents", "skills");
98
+ const packageSkillsPrefix = `${join(packageRoot, "skills")}${sep}`;
99
+ const centralOrphans = new Map();
100
+ for (const name of directoryNames(centralDir)) {
101
+ if (known.has(name)) {
102
+ continue;
103
+ }
104
+ const path = join(centralDir, name);
105
+ const target = symlinkTarget(path);
106
+ if (target?.startsWith(packageSkillsPrefix)) {
107
+ centralOrphans.set(name, { path, target });
108
+ }
109
+ }
110
+ const mountOrphans = [];
111
+ for (const mountDir of [join(home, ".claude", "skills"), join(home, ".codex", "skills")]) {
112
+ for (const name of directoryNames(mountDir)) {
113
+ if (known.has(name)) {
114
+ continue;
115
+ }
116
+ const path = join(mountDir, name);
117
+ const target = symlinkTarget(path);
118
+ const centralPath = join(centralDir, name);
119
+ if (target === centralPath && (centralOrphans.has(name) || !existsSync(path))) {
120
+ mountOrphans.push({ path, target });
121
+ }
122
+ }
123
+ }
124
+ return [...mountOrphans, ...centralOrphans.values()];
125
+ }
126
+ function machineApmStatus(packageRoot) {
127
+ const state = loadConfig(join(packageRoot, "config"), { source: "toolkit" }).apmProviderState;
128
+ return {
129
+ apmConfigured: isApmConfigured(state),
130
+ ...(state?.kind === "invalid" ? { apmError: state.error } : {}),
131
+ };
132
+ }
133
+ function ensurePeriod(sentence) {
134
+ return sentence.endsWith("。") ? sentence : `${sentence}。`;
135
+ }
136
+ function stateIssue(name, link) {
137
+ if (link.state === "linked") {
138
+ return null;
139
+ }
140
+ if (link.state === "missing") {
141
+ return `${name}: ${link.path} 缺失`;
142
+ }
143
+ if (link.state === "dangling") {
144
+ return `${name}: ${link.path} 悬空(目标 ${link.target ?? "未知"} 不存在)`;
145
+ }
146
+ if (link.state === "occupied") {
147
+ return `${name}: ${link.path} 被真实文件/目录占用`;
148
+ }
149
+ const destination = link.resolvesTo ?? link.target;
150
+ const skillSuffix = `${sep}skills${sep}${name}`;
151
+ const otherRoot = destination?.endsWith(skillSuffix)
152
+ ? destination.slice(0, -skillSuffix.length)
153
+ : destination ?? "未知位置";
154
+ return `${link.path} 指向另一份 cx-cli(${otherRoot}):若那是旧安装,运行 cx-cli skills install 重指到当前这份;若想继续用那一份,nvm use 回安装它的 node 版本。`;
155
+ }
156
+ export function centralSkillsWarning(packageRoot) {
157
+ const resolvedRoot = realpathSync(resolve(packageRoot));
158
+ if (!existsSync(join(resolvedRoot, "skills"))) {
159
+ return null;
160
+ }
161
+ const inventory = skillInventory(resolvedRoot);
162
+ const centralDir = join(homedir(), ".agents", "skills");
163
+ const unlinked = inventory.names.filter(name => inspectLink(join(centralDir, name), join(resolvedRoot, "skills", name), "realpath").state !== "linked").length;
164
+ return unlinked === 0
165
+ ? null
166
+ : `skills 未安装到本机 Agent(${unlinked} 条链缺失/悬空/指向别处),运行 cx-cli skills install`;
167
+ }
168
+ export function runSkillsInstall(options) {
169
+ try {
170
+ const packageRoot = realpathSync(resolve(options.packageRoot));
171
+ if (packageRoot.includes("/_npx/") ||
172
+ packageRoot.includes("/.pnpm/") ||
173
+ /\/store\/v\d+\/links\//.test(packageRoot)) {
174
+ return jsonOut({
175
+ error: `当前 cx-cli 安装位置不支持 skills install:${packageRoot}`,
176
+ kind: "unsupported_install",
177
+ hint: "npm i -g @ats-cx/cx-cli",
178
+ }, 1);
179
+ }
180
+ const inventory = skillInventory(packageRoot);
181
+ const home = homedir();
182
+ const centralDir = join(home, ".agents", "skills");
183
+ const claudeDir = join(home, ".claude", "skills");
184
+ const agents = {
185
+ claude: existsSync(join(home, ".claude")),
186
+ codex: existsSync(join(home, ".codex")),
187
+ };
188
+ const created = [];
189
+ const updated = [];
190
+ const skipped = [];
191
+ const warnings = [...inventory.warnings];
192
+ mkdirSync(centralDir, { recursive: true });
193
+ if (agents.claude) {
194
+ mkdirSync(claudeDir, { recursive: true });
195
+ }
196
+ const orphans = findOrphans(packageRoot, inventory.names, home);
197
+ const pruned = orphans.map(orphan => {
198
+ unlinkSync(orphan.path);
199
+ return orphan.path;
200
+ });
201
+ for (const name of inventory.names) {
202
+ const skillDir = join(packageRoot, "skills", name);
203
+ const centralPath = join(centralDir, name);
204
+ const central = inspectLink(centralPath, skillDir, "realpath");
205
+ if (central.state === "missing") {
206
+ symlinkSync(skillDir, centralPath);
207
+ created.push(centralPath);
208
+ }
209
+ else if (central.state === "linked") {
210
+ skipped.push(centralPath);
211
+ }
212
+ else if (central.state === "stale" || central.state === "dangling") {
213
+ unlinkSync(centralPath);
214
+ symlinkSync(skillDir, centralPath);
215
+ updated.push({ path: centralPath, from: central.target ?? "" });
216
+ }
217
+ else {
218
+ warnings.push(`跳过 ${centralPath}:已存在同名真实文件/目录(非软链),请手动处理。`);
219
+ continue;
220
+ }
221
+ if (agents.claude) {
222
+ const claudePath = join(claudeDir, name);
223
+ const claude = inspectLink(claudePath, centralPath, "readlink");
224
+ if (claude.state === "missing") {
225
+ symlinkSync(centralPath, claudePath);
226
+ created.push(claudePath);
227
+ }
228
+ else if (claude.state === "linked") {
229
+ skipped.push(claudePath);
230
+ }
231
+ else if (claude.state === "stale" || claude.state === "dangling") {
232
+ unlinkSync(claudePath);
233
+ symlinkSync(centralPath, claudePath);
234
+ updated.push({ path: claudePath, from: claude.target ?? "" });
235
+ }
236
+ else {
237
+ warnings.push(`跳过 ${claudePath}:已存在同名真实文件/目录(非软链),请手动处理。`);
238
+ }
239
+ }
240
+ }
241
+ const configDir = resolve(machineConfigDir());
242
+ const configPath = join(configDir, "apm-provider.local.json");
243
+ const configDirExisted = existsSync(configDir);
244
+ mkdirSync(configDir, { recursive: true });
245
+ const configExisted = existsSync(configPath);
246
+ if (!configExisted) {
247
+ writeFileSync(configPath, `${JSON.stringify({ baseUrl: "", defaults: { host: "" } }, null, 2)}\n`);
248
+ }
249
+ const apm = machineApmStatus(packageRoot);
250
+ const hintParts = ["skills 已链接,Agent 无需重启。"];
251
+ if (!agents.claude) {
252
+ hintParts.push("未探测到 Claude Code(~/.claude/ 不存在),装好后重跑 cx-cli skills install。");
253
+ }
254
+ if (agents.codex) {
255
+ hintParts.push("Codex 读 ~/.agents/skills,无需额外链。");
256
+ }
257
+ if (pruned.length > 0) {
258
+ hintParts.push(`已清理 ${pruned.length} 条旧版本留下的 skill 链。`);
259
+ }
260
+ if (apm.apmError) {
261
+ hintParts.push(ensurePeriod(`apm 配置无效:${apm.apmError}`));
262
+ }
263
+ else if (!apm.apmConfigured) {
264
+ hintParts.push(SENTENCE(configPath));
265
+ }
266
+ return jsonOut({
267
+ packageRoot,
268
+ packageVersion: options.packageVersion,
269
+ centralDir,
270
+ agents,
271
+ skills: inventory.names,
272
+ created,
273
+ updated,
274
+ skipped,
275
+ pruned,
276
+ configDir: {
277
+ path: configDir,
278
+ created: !configDirExisted || !configExisted,
279
+ ...apm,
280
+ },
281
+ warnings,
282
+ hint: hintParts.join(""),
283
+ });
284
+ }
285
+ catch (error) {
286
+ return jsonOut({
287
+ error: error instanceof Error ? error.message : String(error),
288
+ kind: "io",
289
+ hint: "请检查相关目录权限后重试 cx-cli skills install。",
290
+ }, 1);
291
+ }
292
+ }
293
+ export function runSkillsStatus(options) {
294
+ try {
295
+ const packageRoot = realpathSync(resolve(options.packageRoot));
296
+ const inventory = skillInventory(packageRoot);
297
+ const home = homedir();
298
+ const centralDir = join(home, ".agents", "skills");
299
+ const claudeDir = join(home, ".claude", "skills");
300
+ const agents = {
301
+ claude: existsSync(join(home, ".claude")),
302
+ codex: existsSync(join(home, ".codex")),
303
+ };
304
+ const issues = [...inventory.warnings];
305
+ const orphans = findOrphans(packageRoot, inventory.names, home);
306
+ const skills = inventory.names.map(name => {
307
+ const central = inspectLink(join(centralDir, name), join(packageRoot, "skills", name), "realpath");
308
+ const centralIssue = stateIssue(name, central);
309
+ if (centralIssue) {
310
+ issues.push(centralIssue);
311
+ }
312
+ if (!agents.claude) {
313
+ return { name, central };
314
+ }
315
+ const claude = inspectLink(join(claudeDir, name), join(centralDir, name), "readlink");
316
+ const claudeIssue = stateIssue(name, claude);
317
+ if (claudeIssue) {
318
+ issues.push(claudeIssue);
319
+ }
320
+ return { name, central, claude };
321
+ });
322
+ for (const orphan of orphans) {
323
+ issues.push(`孤儿链 ${orphan.path} → ${orphan.target}(当前包无此 skill),运行 cx-cli skills install 清理`);
324
+ }
325
+ const ok = orphans.length === 0 &&
326
+ skills.every(skill => skill.central.state === "linked" && (!agents.claude || skill.claude?.state === "linked"));
327
+ const configDir = resolve(machineConfigDir());
328
+ const configPath = join(configDir, "apm-provider.local.json");
329
+ const apm = machineApmStatus(packageRoot);
330
+ const hintParts = [ok ? "skills 链接正常。" : "运行 cx-cli skills install 修复。"];
331
+ if (apm.apmError) {
332
+ hintParts.push(ensurePeriod(`apm 配置无效:${apm.apmError}`));
333
+ }
334
+ else if (!apm.apmConfigured) {
335
+ hintParts.push(SENTENCE(configPath));
336
+ }
337
+ return jsonOut({
338
+ ok,
339
+ packageRoot,
340
+ packageVersion: options.packageVersion,
341
+ centralDir,
342
+ agents,
343
+ skills,
344
+ orphans,
345
+ issues,
346
+ configDir: { path: configDir, exists: existsSync(configDir), ...apm },
347
+ hint: hintParts.join(""),
348
+ }, ok ? 0 : 1);
349
+ }
350
+ catch (error) {
351
+ return jsonOut({
352
+ error: error instanceof Error ? error.message : String(error),
353
+ kind: "io",
354
+ hint: "请检查相关目录权限后重试 cx-cli skills status。",
355
+ }, 1);
356
+ }
357
+ }
358
+ function isWithin(path, root) {
359
+ const fromRoot = relative(root, path);
360
+ return fromRoot === "" || (!fromRoot.startsWith(`..${sep}`) && fromRoot !== ".." && !isAbsolute(fromRoot));
361
+ }
362
+ export function runSkillsUninstall(options) {
363
+ try {
364
+ const packageRoot = realpathSync(resolve(options.packageRoot));
365
+ const inventory = skillInventory(packageRoot);
366
+ const home = homedir();
367
+ const centralDir = join(home, ".agents", "skills");
368
+ const mountDirs = [join(home, ".claude", "skills"), join(home, ".codex", "skills")];
369
+ const orphans = findOrphans(packageRoot, inventory.names, home);
370
+ const removed = [];
371
+ const skipped = [];
372
+ for (const mountDir of mountDirs) {
373
+ for (const name of inventory.names) {
374
+ const path = join(mountDir, name);
375
+ const target = symlinkTarget(path);
376
+ if (target === join(centralDir, name)) {
377
+ unlinkSync(path);
378
+ removed.push(path);
379
+ }
380
+ else if (target !== null) {
381
+ skipped.push({ path, reason: `指向别处:${target}` });
382
+ }
383
+ else if (existsSync(path)) {
384
+ skipped.push({ path, reason: "已存在同名真实文件/目录(非软链)" });
385
+ }
386
+ }
387
+ }
388
+ for (const orphan of orphans.filter(orphan => dirname(orphan.path) !== centralDir)) {
389
+ unlinkSync(orphan.path);
390
+ removed.push(orphan.path);
391
+ }
392
+ for (const name of inventory.names) {
393
+ const path = join(centralDir, name);
394
+ const target = symlinkTarget(path);
395
+ if (target === null) {
396
+ if (existsSync(path)) {
397
+ skipped.push({ path, reason: "已存在同名真实文件/目录(非软链)" });
398
+ }
399
+ continue;
400
+ }
401
+ if (!existsSync(path) || isWithin(realpathSync(path), packageRoot)) {
402
+ unlinkSync(path);
403
+ removed.push(path);
404
+ }
405
+ else {
406
+ skipped.push({ path, reason: `指向别处:${target}` });
407
+ }
408
+ }
409
+ for (const orphan of orphans.filter(orphan => dirname(orphan.path) === centralDir)) {
410
+ unlinkSync(orphan.path);
411
+ removed.push(orphan.path);
412
+ }
413
+ return jsonOut({
414
+ packageRoot,
415
+ packageVersion: options.packageVersion,
416
+ removed,
417
+ skipped,
418
+ warnings: inventory.warnings,
419
+ hint: "skills 链接已解除;接着 npm rm -g @ats-cx/cx-cli。~/.config/cx-cli/ 未动(含 apm 覆盖与产物),不再需要可手动删除。",
420
+ });
421
+ }
422
+ catch (error) {
423
+ return jsonOut({
424
+ error: error instanceof Error ? error.message : String(error),
425
+ kind: "io",
426
+ hint: "请检查相关目录权限后重试 cx-cli skills uninstall。",
427
+ }, 1);
428
+ }
429
+ }
430
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1,115 @@
1
+ import type { ApmClientDeps, ApmPortalDeps } from "@ats-cx/cx-core";
2
+ export declare function createApmQueryTool(deps?: ApmClientDeps): import("../contract.js").ToolDefinition<{
3
+ type: "error" | "performance" | "api" | "paint" | "user_behav" | "network" | "server_error" | "footprint" | "server_api";
4
+ order: "ASC" | "DESC";
5
+ preview: number;
6
+ count: boolean;
7
+ full: boolean;
8
+ noFlush: boolean;
9
+ where: Record<string, string>;
10
+ from: string;
11
+ search?: string | undefined;
12
+ out?: string | undefined;
13
+ subType?: string | undefined;
14
+ to?: string | undefined;
15
+ project?: string | undefined;
16
+ user?: string | undefined;
17
+ collection?: string | undefined;
18
+ session?: string | undefined;
19
+ event?: string | undefined;
20
+ app?: string | undefined;
21
+ bizline?: string | undefined;
22
+ item?: string | undefined;
23
+ limit?: number | undefined;
24
+ run?: string | undefined;
25
+ }, import("../apm-output.js").QueryPreview | {
26
+ total: number;
27
+ }>;
28
+ export declare function createApmFlushTool(deps?: ApmClientDeps): import("../contract.js").ToolDefinition<{}, {
29
+ flushed: boolean;
30
+ message: string | undefined;
31
+ }>;
32
+ export declare function createApmResolveTool(deps?: ApmPortalDeps): import("../contract.js").ToolDefinition<{
33
+ email?: string | undefined;
34
+ phone?: string | undefined;
35
+ host?: string | undefined;
36
+ }, {
37
+ userId: string;
38
+ email: string;
39
+ host: string;
40
+ phone?: undefined;
41
+ } | {
42
+ userId: string;
43
+ phone: string;
44
+ host: string;
45
+ email?: undefined;
46
+ }>;
47
+ export declare function createApmProjectTool(deps?: ApmPortalDeps): import("../contract.js").ToolDefinition<{
48
+ projectId: string;
49
+ out?: string | undefined;
50
+ run?: string | undefined;
51
+ host?: string | undefined;
52
+ }, {
53
+ projectId: string;
54
+ host: string;
55
+ file: string;
56
+ bytes: number;
57
+ updatedDate: unknown;
58
+ }>;
59
+ export declare const apmQueryTool: import("../contract.js").ToolDefinition<{
60
+ type: "error" | "performance" | "api" | "paint" | "user_behav" | "network" | "server_error" | "footprint" | "server_api";
61
+ order: "ASC" | "DESC";
62
+ preview: number;
63
+ count: boolean;
64
+ full: boolean;
65
+ noFlush: boolean;
66
+ where: Record<string, string>;
67
+ from: string;
68
+ search?: string | undefined;
69
+ out?: string | undefined;
70
+ subType?: string | undefined;
71
+ to?: string | undefined;
72
+ project?: string | undefined;
73
+ user?: string | undefined;
74
+ collection?: string | undefined;
75
+ session?: string | undefined;
76
+ event?: string | undefined;
77
+ app?: string | undefined;
78
+ bizline?: string | undefined;
79
+ item?: string | undefined;
80
+ limit?: number | undefined;
81
+ run?: string | undefined;
82
+ }, import("../apm-output.js").QueryPreview | {
83
+ total: number;
84
+ }>;
85
+ export declare const apmResolveTool: import("../contract.js").ToolDefinition<{
86
+ email?: string | undefined;
87
+ phone?: string | undefined;
88
+ host?: string | undefined;
89
+ }, {
90
+ userId: string;
91
+ email: string;
92
+ host: string;
93
+ phone?: undefined;
94
+ } | {
95
+ userId: string;
96
+ phone: string;
97
+ host: string;
98
+ email?: undefined;
99
+ }>;
100
+ export declare const apmProjectTool: import("../contract.js").ToolDefinition<{
101
+ projectId: string;
102
+ out?: string | undefined;
103
+ run?: string | undefined;
104
+ host?: string | undefined;
105
+ }, {
106
+ projectId: string;
107
+ host: string;
108
+ file: string;
109
+ bytes: number;
110
+ updatedDate: unknown;
111
+ }>;
112
+ export declare const apmFlushTool: import("../contract.js").ToolDefinition<{}, {
113
+ flushed: boolean;
114
+ message: string | undefined;
115
+ }>;