@thinkingai/ae-cli 6.0.46 → 6.0.47

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 (89) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +6 -0
  3. package/dist/{auth-ROB2EDYV.js → auth-QPEVVBKT.js} +13 -7
  4. package/dist/auth-UMJAA72O.js +15 -0
  5. package/dist/{capability-GQ47BCFI.js → capability-RUSV77CO.js} +11 -10
  6. package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
  7. package/dist/{chunk-4XXOWOTA.js → chunk-6QK7SYYY.js} +5 -4
  8. package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
  9. package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
  10. package/dist/{sync-HKIOZXQE.js → chunk-B5HMQAOM.js} +31 -540
  11. package/dist/{chunk-DQRPU6EE.js → chunk-BVDST5YT.js} +5 -4
  12. package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
  13. package/dist/{chunk-JHENBQ5B.js → chunk-FR2EDAQM.js} +1 -0
  14. package/dist/{chunk-ZQ47LWTI.js → chunk-GJXRF7Y6.js} +6 -5
  15. package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
  16. package/dist/chunk-JYMGHGCE.js +191 -0
  17. package/dist/{chunk-BYYS3ANB.js → chunk-KEWVSO64.js} +5 -4
  18. package/dist/{chunk-3FY3RJ26.js → chunk-KZ6ZHF5J.js} +2 -1
  19. package/dist/{chunk-2MN54X6H.js → chunk-NSIVXKJH.js} +4 -3
  20. package/dist/{chunk-ZQKDZXDO.js → chunk-O6K2ODUE.js} +3 -2
  21. package/dist/chunk-QL6R6TSK.js +25215 -0
  22. package/dist/{chunk-J2DEBMRF.js → chunk-RWXIXOZG.js} +22 -9
  23. package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
  24. package/dist/{chunk-3KWQYGYI.js → chunk-TKHSULJT.js} +2 -0
  25. package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
  26. package/dist/{client-L2YDMHQ6.js → client-N7NGZUNI.js} +4 -3
  27. package/dist/{community-report-client-C7WDGET3.js → community-report-client-6OL6GBQW.js} +3 -2
  28. package/dist/{config-BMYZX2UE.js → config-XNMACCKX.js} +8 -7
  29. package/dist/{data-integration-QEKDWQDY.js → data-integration-4NZGZ45E.js} +913 -92
  30. package/dist/index.js +36 -34
  31. package/dist/{local-data-upload-client-4YYHSYD6.js → local-data-upload-client-EFHDLXFG.js} +3 -2
  32. package/dist/{memory-3ORCR7JH.js → memory-HBJQ2GC5.js} +8 -7
  33. package/dist/{metadata-A6QLH3IS.js → metadata-PGDJE5RQ.js} +12 -11
  34. package/dist/{model-UGRDX4MW.js → model-BHLJ2QMT.js} +10 -9
  35. package/dist/{personal-semantic-preference-QZFAJWGE.js → personal-semantic-preference-E5NZ56DN.js} +11 -10
  36. package/dist/sync-MUWPRM5I.js +522 -0
  37. package/dist/{te-agent-BR6VDBNX.js → te-agent-WQZTMEK4.js} +10 -9
  38. package/dist/{te-analysis-MUKUXJL4.js → te-analysis-YWCSSLYL.js} +107 -20
  39. package/dist/{te-community-ISDQWJU7.js → te-community-BNE6KREL.js} +8 -7
  40. package/dist/{te-dataops-6P5IKWNJ.js → te-dataops-TXLKM2W6.js} +467 -67
  41. package/dist/{te-engage-ELA3C5BM.js → te-engage-VEW4CJHK.js} +26 -10
  42. package/dist/{te-kb-RCLSSH2Q.js → te-kb-BUD6N3NI.js} +311 -24
  43. package/dist/{te-system-FXITO2JG.js → te-system-44LZJDTQ.js} +573 -37
  44. package/dist/{te-team-ADOC2ROP.js → te-team-XMP47YXE.js} +10 -7
  45. package/dist/{update-YCYCKJOO.js → update-UODFOZ4P.js} +7 -6
  46. package/package.json +18 -9
  47. package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
  48. package/skills/ae-analysis/references/audience_models.md +18 -0
  49. package/skills/ae-analysis/references/command_index.md +2 -2
  50. package/skills/ae-analysis/references/project_timezone_update.md +13 -4
  51. package/skills/ae-analysis/references/property_create.md +2 -0
  52. package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
  53. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  54. package/skills/ae-analysis/references/user_cluster_update.md +8 -4
  55. package/skills/ae-analysis/references/user_tag_create.md +7 -1
  56. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  57. package/skills/ae-data-integration/SKILL.md +1 -0
  58. package/skills/ae-data-integration/references/error-handling.md +54 -1
  59. package/skills/ae-data-integration/references/source-inspect.md +18 -2
  60. package/skills/ae-data-integration/references/transform.md +3 -1
  61. package/skills/ae-data-integration/references/ue-routing.md +23 -0
  62. package/skills/ae-dataops/SKILL.md +11 -1
  63. package/skills/ae-dataops/references/dataops-backfill.md +135 -0
  64. package/skills/ae-engage/SKILL.md +3 -0
  65. package/skills/ae-engage/references/build-task-save-guide.md +5 -1
  66. package/skills/ae-engage/references/save-task.md +6 -0
  67. package/skills/ae-kb/SKILL.md +120 -9
  68. package/skills/ae-system/SKILL.md +28 -30
  69. package/skills/ae-system/references/channel-management.md +303 -0
  70. package/dist/auth-GBMV6TEJ.js +0 -14
  71. package/dist/capability-IINANQJA.js +0 -349
  72. package/dist/chunk-GJLGIMAO.js +0 -556
  73. package/dist/chunk-OMPRXM3V.js +0 -349
  74. package/dist/chunk-QNOLN2LJ.js +0 -509
  75. package/dist/chunk-RJDU7NYP.js +0 -1198
  76. package/dist/chunk-RNAALWJK.js +0 -98
  77. package/dist/chunk-SERWF6G5.js +0 -13
  78. package/dist/chunk-XNVMVIUI.js +0 -71
  79. package/dist/memory-I2WXDTV2.js +0 -893
  80. package/dist/metadata-HC7GBTTD.js +0 -339
  81. package/dist/model-HLHIEFMU.js +0 -139
  82. package/dist/personal-semantic-preference-YXAZBFVW.js +0 -239
  83. package/dist/sync-TFHU2UTG.js +0 -10261
  84. package/dist/te-agent-VLYOV7S4.js +0 -3894
  85. package/dist/te-analysis-JECYCV6K.js +0 -9357
  86. package/dist/te-community-5DMNKJWY.js +0 -1859
  87. package/dist/te-dataops-CVULXNVB.js +0 -2209
  88. package/dist/te-engage-MC5IQZIU.js +0 -4898
  89. package/dist/te-system-K2GYMCTB.js +0 -2213
@@ -1,98 +0,0 @@
1
- import {
2
- getCliToken
3
- } from "./chunk-J2DEBMRF.js";
4
- import {
5
- safeJsonParse
6
- } from "./chunk-3FY3RJ26.js";
7
- import {
8
- PermissionError
9
- } from "./chunk-UW5UN47B.js";
10
-
11
- // src/core/mcp-access.ts
12
- function buildUrl(host, path, params = {}) {
13
- const base = host.replace(/\/$/, "");
14
- const p = path.startsWith("/") ? path : `/${path}`;
15
- const url = new URL(`${base}${p}`);
16
- for (const [key, value] of Object.entries(params)) {
17
- if (value !== void 0 && value !== null) {
18
- url.searchParams.set(key, String(value));
19
- }
20
- }
21
- return url.toString();
22
- }
23
- function parseKbResponse(resp, text) {
24
- if (resp.status === 403) {
25
- let msg = "Permission denied for this resource (HTTP 403)";
26
- try {
27
- const d = safeJsonParse(text);
28
- const m = d && (typeof d.error === "string" ? d.error : d.error?.message || d.message);
29
- if (m && typeof m === "string") msg = m;
30
- } catch {
31
- }
32
- throw new PermissionError(msg);
33
- }
34
- if (resp.status === 401) {
35
- throw new Error(
36
- `KB API token auth failed: HTTP ${resp.status} ${resp.statusText}`
37
- );
38
- }
39
- const data = safeJsonParse(text);
40
- if (data.return_code === -1001) {
41
- throw new Error(
42
- `KB API token auth failed: ${data.return_message || "unauthorized"} (code: ${data.return_code})`
43
- );
44
- }
45
- if (data.return_code !== 0 && data.return_code !== void 0) {
46
- throw new Error(
47
- `AE API error: ${data.return_message || "unknown"} (code: ${data.return_code})`
48
- );
49
- }
50
- if (data && typeof data === "object" && typeof data.error === "string" && data.error.trim() && data.return_code === void 0 && data.success === void 0) {
51
- throw new Error(data.error);
52
- }
53
- return data.data !== void 0 ? data.data : data;
54
- }
55
- async function fetchWithCliToken(input, init, cliToken) {
56
- const headers = new Headers(init.headers);
57
- headers.set("cli-token", cliToken);
58
- const resp = await fetch(input, { ...init, headers });
59
- return parseKbResponse(resp, await resp.text());
60
- }
61
- async function getAuthHeaders(ctx) {
62
- const cliToken = await getCliToken(ctx.host());
63
- return { "cli-token": cliToken };
64
- }
65
- async function kbApi(ctx, method, path, params = {}, body) {
66
- const host = ctx.host();
67
- const cliToken = await getCliToken(host);
68
- const upperMethod = method.toUpperCase();
69
- return fetchWithCliToken(
70
- buildUrl(host, path, params),
71
- {
72
- method: upperMethod,
73
- headers: {
74
- "Content-Type": "application/json"
75
- },
76
- body: upperMethod === "GET" ? void 0 : JSON.stringify(body ?? {})
77
- },
78
- cliToken
79
- );
80
- }
81
- async function kbUpload(ctx, path, form, params = {}) {
82
- const host = ctx.host();
83
- const cliToken = await getCliToken(host);
84
- return fetchWithCliToken(
85
- buildUrl(host, path, params),
86
- {
87
- method: "POST",
88
- body: form
89
- },
90
- cliToken
91
- );
92
- }
93
-
94
- export {
95
- getAuthHeaders,
96
- kbApi,
97
- kbUpload
98
- };
@@ -1,13 +0,0 @@
1
- import {
2
- isAeSandboxRuntime
3
- } from "./chunk-3FY3RJ26.js";
4
-
5
- // src/core/internal-call-source.ts
6
- function internalCallSourceHeaders() {
7
- const source = isAeSandboxRuntime() ? "te-agent" : "ae-cli";
8
- return { "X-Source": source };
9
- }
10
-
11
- export {
12
- internalCallSourceHeaders
13
- };
@@ -1,71 +0,0 @@
1
- import {
2
- withOutputMetadata
3
- } from "./chunk-BYYS3ANB.js";
4
- import {
5
- dryRunCapability,
6
- executeCapabilityWithEnvelope,
7
- validateCapability
8
- } from "./chunk-ZQ47LWTI.js";
9
- import {
10
- resolveGatewayDomain
11
- } from "./chunk-3KWQYGYI.js";
12
-
13
- // src/core/capability-command.ts
14
- import { randomBytes } from "crypto";
15
- function createCapabilityCommand(config) {
16
- return {
17
- service: config.cliService,
18
- resource: config.resource,
19
- command: config.command,
20
- capabilityId: config.capabilityId,
21
- description: config.description,
22
- flags: config.flags,
23
- risk: config.risk,
24
- validate: config.validate,
25
- preflight: (ctx) => {
26
- config.buildInput(ctx);
27
- },
28
- validateInput: async (ctx) => {
29
- const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
30
- const requestHost = config.requestHost ?? ctx.host();
31
- const input = withLifecycleRequestId(config, config.buildInput(ctx));
32
- return validateCapability(requestHost, gatewayDomain, config.capabilityId, input);
33
- },
34
- dryRun: async (ctx) => {
35
- const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
36
- const requestHost = config.requestHost ?? ctx.host();
37
- const input = withLifecycleRequestId(config, config.buildInput(ctx));
38
- return dryRunCapability(requestHost, gatewayDomain, config.capabilityId, input);
39
- },
40
- execute: async (ctx) => {
41
- const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
42
- const requestHost = config.requestHost ?? ctx.host();
43
- const input = withLifecycleRequestId(config, config.buildInput(ctx));
44
- announceDispatch(config.capabilityId, input);
45
- const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, input);
46
- const data = config.postProcess ? await config.postProcess(result.data, input, ctx) : result.data;
47
- return withOutputMetadata(data, result.meta);
48
- }
49
- };
50
- }
51
- function withLifecycleRequestId(config, input) {
52
- if (!config.flags.some((flag) => flag.name === "request-id")) {
53
- return input;
54
- }
55
- const supplied = input.request_id;
56
- const requestId = typeof supplied === "string" && supplied.length > 0 ? supplied : `cli_${randomBytes(16).toString("hex")}`;
57
- return { ...input, request_id: requestId };
58
- }
59
- function announceDispatch(capabilityId, input) {
60
- if (typeof input.request_id !== "string") {
61
- return;
62
- }
63
- process.stderr.write(
64
- `[ae-cli] dispatching capability=${capabilityId} request_id=${input.request_id}
65
- `
66
- );
67
- }
68
-
69
- export {
70
- createCapabilityCommand
71
- };