@thinkingai/ae-cli 6.1.13 → 6.1.16
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/dist/{auth-GBMV6TEJ.js → auth-2WTQOP77.js} +3 -3
- package/dist/{auth-NDSXE54J.js → auth-77BUFLGC.js} +57 -13
- package/dist/{capability-TAMDRZYV.js → capability-72DTW5M2.js} +9 -9
- package/dist/{capability-U7TDEEEG.js → capability-PJHNI4GJ.js} +9 -9
- package/dist/{chunk-AFXA7BRK.js → chunk-4KVPKXFX.js} +5 -5
- package/dist/chunk-4SGZG4XY.js +311 -0
- package/dist/chunk-6EIJSNBD.js +8 -0
- package/dist/chunk-C4MGVGJW.js +13 -0
- package/dist/{chunk-WZRX4KOH.js → chunk-GT46FPXN.js} +4 -6
- package/dist/{chunk-5XUSIK27.js → chunk-ILIU36SU.js} +10 -7
- package/dist/{chunk-JHENBQ5B.js → chunk-LYVNONC4.js} +0 -35
- package/dist/{chunk-JUW4AJXN.js → chunk-P3FGXJTU.js} +12 -7
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/{chunk-753BUTNZ.js → chunk-RGKJGKT7.js} +2 -2
- package/dist/{chunk-UIHQJK5E.js → chunk-SAU3QFIQ.js} +3 -3
- package/dist/{chunk-VLWOLBGZ.js → chunk-UOUS37JQ.js} +149 -161
- package/dist/{chunk-AXDXJTPC.js → chunk-UW5UN47B.js} +19 -2
- package/dist/chunk-VPKZ7I72.js +509 -0
- package/dist/{chunk-QATA32VR.js → chunk-VR3LCBHW.js} +2 -2
- package/dist/{chunk-IBH3LDAH.js → chunk-YA6SMTXG.js} +3 -3
- package/dist/chunk-ZZUOD757.js +598 -0
- package/dist/{client-L2YDMHQ6.js → client-TKG4WBHN.js} +4 -5
- package/dist/{community-report-client-M2RW4MXD.js → community-report-client-FI4LNVYS.js} +3 -2
- package/dist/{config-OL2LWGBV.js → config-RE6CMGPK.js} +7 -7
- package/dist/data-integration-2MYMANJI.js +3383 -0
- package/dist/index.js +68 -34
- package/dist/local-data-upload-client-BWHSUQQK.js +167 -0
- package/dist/{memory-MUP7PPL7.js → memory-CHRU2F7W.js} +7 -6
- package/dist/{memory-U4O5PMXH.js → memory-YK33G4T7.js} +7 -6
- package/dist/{metadata-UORZTW3T.js → metadata-UILXHBWF.js} +22 -18
- package/dist/{metadata-VVQ3AQT5.js → metadata-XXR34N5P.js} +22 -18
- package/dist/{model-JTUEO5M4.js → model-K3KLWIW6.js} +7 -3
- package/dist/model-NR3JHFSJ.js +139 -0
- package/dist/{sync-MOSFNBVR.js → sync-DAVKYVMW.js} +8 -6
- package/dist/sync-FCKOVWWS.js +10261 -0
- package/dist/{te-agent-IFKZDHZI.js → te-agent-4BKBODMF.js} +686 -71
- package/dist/te-agent-HLW4VTQK.js +3893 -0
- package/dist/{te-analysis-KOKHJJPE.js → te-analysis-O6DCO6BS.js} +84 -61
- package/dist/{te-analysis-LLOCCBJ4.js → te-analysis-ZMNGOVNW.js} +84 -61
- package/dist/{te-community-HNKVTERD.js → te-community-6HPBWJUZ.js} +24 -19
- package/dist/{te-community-IWE5B7W6.js → te-community-HLC43QKH.js} +24 -20
- package/dist/{te-dataops-KXCEB4CS.js → te-dataops-EJP56W3K.js} +57 -34
- package/dist/{te-dataops-KQPYNAE3.js → te-dataops-HDRUXY4K.js} +59 -34
- package/dist/{te-engage-BRLSRVQT.js → te-engage-FGBGQ4IY.js} +398 -12
- package/dist/{te-engage-HE4OPZIT.js → te-engage-RAK5PESW.js} +398 -12
- package/dist/{te-experiment-K5US7RMG.js → te-experiment-SO5MPDMJ.js} +9 -8
- package/dist/{te-experiment-WA7TFMEL.js → te-experiment-VZF7BT6G.js} +9 -8
- package/dist/{te-kb-OIH3T6CS.js → te-kb-APXBWBDY.js} +6 -6
- package/dist/{te-system-AZ3URMUO.js → te-system-YARIK4S5.js} +7 -4
- package/dist/te-system-Z77IKZFN.js +2213 -0
- package/dist/{te-team-GZPU6UWA.js → te-team-EFKWYKMK.js} +7 -7
- package/dist/{update-TOBFXF2V.js → update-OGPSZM5A.js} +7 -7
- package/package.json +13 -3
- package/skills/ae-agent/SKILL.md +21 -11
- package/skills/ae-agent/references/approval-effect.md +44 -0
- package/skills/ae-agent/references/approval-request.md +46 -0
- package/skills/ae-agent/references/approval-task.md +45 -0
- package/skills/ae-agent/references/approval-type.md +32 -0
- package/skills/ae-agent/references/command_index.md +19 -0
- package/skills/ae-analysis/SKILL.md +11 -7
- package/skills/ae-analysis/references/adhoc_run.md +2 -0
- package/skills/ae-analysis/references/ai_models.md +31 -1
- package/skills/ae-analysis/references/alert_list.md +2 -3
- package/skills/ae-analysis/references/analysis_gateway_assets.md +8 -7
- package/skills/ae-analysis/references/bi_panel_list.md +2 -2
- package/skills/ae-analysis/references/command_index.md +18 -15
- package/skills/ae-analysis/references/dashboard_get.md +8 -2
- package/skills/ae-analysis/references/dashboard_list.md +2 -2
- package/skills/ae-analysis/references/dashboard_report_data_run.md +3 -1
- package/skills/ae-analysis/references/dashboard_update.md +4 -1
- package/skills/ae-analysis/references/favorite_add.md +2 -2
- package/skills/ae-analysis/references/favorite_remove.md +2 -2
- package/skills/ae-analysis/references/metric_create.md +7 -8
- package/skills/ae-analysis/references/project_space_business_filter_upsert.md +17 -0
- package/skills/ae-analysis/references/project_space_list.md +2 -2
- package/skills/ae-analysis/references/public_link_list.md +2 -2
- package/skills/ae-analysis/references/report_list.md +3 -3
- package/skills/ae-analysis/references/report_list_export.md +2 -2
- package/skills/ae-analysis/references/sql_table_list.md +3 -2
- package/skills/ae-analysis/references/user_cluster_update.md +4 -2
- package/skills/ae-analysis/references/user_tag_models.md +4 -4
- package/skills/ae-analysis/references/user_tag_update.md +4 -2
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +3 -3
- package/skills/ae-data-integration/SKILL.md +54 -0
- package/skills/ae-data-integration/references/handoff.md +43 -0
- package/skills/ae-data-integration/references/local-analysis.md +27 -0
- package/skills/ae-data-integration/references/reuse.md +41 -0
- package/skills/ae-data-integration/references/sink-upload.md +58 -0
- package/skills/ae-data-integration/references/source-inspect.md +55 -0
- package/skills/ae-data-integration/references/sync-json-upload.md +60 -0
- package/skills/ae-data-integration/references/tracking-plan.md +35 -0
- package/skills/ae-data-integration/references/transform.md +65 -0
- package/skills/ae-data-integration/references/ue-mapping.md +142 -0
- package/skills/ae-data-integration/references/ue-routing.md +35 -0
- package/skills/ae-data-integration-helper/SKILL.md +1 -1
- package/skills/ae-dataops/SKILL.md +1 -1
- package/skills/ae-dataops/references/dataops-query.md +4 -4
- package/skills/ae-engage/SKILL.md +10 -2
- package/skills/ae-engage/references/flow-metric-user.md +2 -1
- package/skills/ae-engage/references/flow-node-metric-user.md +2 -1
- package/skills/ae-engage/references/flow-node-user.md +2 -1
- package/skills/ae-engage/references/task-indicator-user.md +104 -0
- package/skills/ae-engage/references/task-user-detail-export.md +31 -0
- package/skills/ae-generate-tracking-plan/SKILL.md +54 -3
- package/skills/ae-metadata/SKILL.md +0 -1
- package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
- package/dist/chunk-3FY3RJ26.js +0 -293
- package/dist/chunk-S5NTSDBS.js +0 -198
- package/dist/chunk-ZQKDZXDO.js +0 -317
- package/dist/cli-token-4UPER74P.js +0 -21
package/dist/index.js
CHANGED
|
@@ -7,39 +7,40 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
TeAgentApiError,
|
|
9
9
|
TeAgentCredentialsError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VPKZ7I72.js";
|
|
11
11
|
import {
|
|
12
12
|
formatCapabilityMissCompatHint,
|
|
13
13
|
printError,
|
|
14
14
|
printOutput,
|
|
15
15
|
runHostCompatCheck
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GT46FPXN.js";
|
|
17
17
|
import {
|
|
18
18
|
CapabilityGatewayError,
|
|
19
19
|
executeCapability,
|
|
20
20
|
uploadInputFileBytes
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ILIU36SU.js";
|
|
22
|
+
import "./chunk-6EIJSNBD.js";
|
|
22
23
|
import {
|
|
23
24
|
clearCliToken,
|
|
24
25
|
getCliToken
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4SGZG4XY.js";
|
|
26
27
|
import {
|
|
27
28
|
SecureStoreAuthError,
|
|
28
|
-
resolveHost
|
|
29
|
-
} from "./chunk-ZQKDZXDO.js";
|
|
30
|
-
import {
|
|
31
29
|
getActiveHost,
|
|
32
30
|
getConfigDir,
|
|
31
|
+
resolveHost,
|
|
33
32
|
safeJsonParse
|
|
34
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ZZUOD757.js";
|
|
35
34
|
import {
|
|
36
35
|
CliValidationError,
|
|
37
36
|
CommunityReportError,
|
|
37
|
+
LocalDataUploadError,
|
|
38
38
|
PermissionError
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-UW5UN47B.js";
|
|
40
40
|
import {
|
|
41
41
|
logger
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-LYVNONC4.js";
|
|
43
|
+
import "./chunk-QGM4M3NI.js";
|
|
43
44
|
|
|
44
45
|
// src/index.ts
|
|
45
46
|
import { Command as CommanderCommand } from "commander";
|
|
@@ -66,6 +67,7 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
66
67
|
const missingRequired = cmd.flags.filter((flag) => {
|
|
67
68
|
if (!flag.required) return false;
|
|
68
69
|
const val = opts[camelCase(flag.name)];
|
|
70
|
+
if (flag.variadic) return !Array.isArray(val) || val.length === 0;
|
|
69
71
|
return val === void 0 || val === null || val === "";
|
|
70
72
|
});
|
|
71
73
|
if (missingRequired.length > 0) {
|
|
@@ -79,6 +81,7 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
79
81
|
const LIMIT_FLAG_PATTERNS = [/limit/i, /page_size/i, /pagesize/i, /row_limit/i, /block_limit/i, /top[-_]?k/i];
|
|
80
82
|
for (const flag of cmd.flags) {
|
|
81
83
|
const val = opts[camelCase(flag.name)];
|
|
84
|
+
if (flag.variadic) continue;
|
|
82
85
|
if (flag.type === "boolean") {
|
|
83
86
|
if (val !== void 0 && typeof val !== "boolean") {
|
|
84
87
|
printError("validation", `Invalid boolean for --${flag.name}: ${val}. Use true/false.`);
|
|
@@ -87,6 +90,7 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
87
90
|
continue;
|
|
88
91
|
}
|
|
89
92
|
if (flag.type !== "number") continue;
|
|
93
|
+
if (flag.variadic) continue;
|
|
90
94
|
if (val === void 0 || val === null || val === "") continue;
|
|
91
95
|
const num = Number(val);
|
|
92
96
|
if (!Number.isFinite(num)) {
|
|
@@ -114,6 +118,7 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
114
118
|
}
|
|
115
119
|
for (const flag of cmd.flags) {
|
|
116
120
|
if (flag.type !== "string") continue;
|
|
121
|
+
if (flag.variadic) continue;
|
|
117
122
|
const val = opts[camelCase(flag.name)];
|
|
118
123
|
if (val === void 0 || val === null || val === "") continue;
|
|
119
124
|
const error = stringFlagValidationError(flag, String(val));
|
|
@@ -170,7 +175,7 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
170
175
|
}
|
|
171
176
|
const message = err.message || String(err);
|
|
172
177
|
if (!(err instanceof CommunityReportError)) {
|
|
173
|
-
logger.error(`Command failed: ${message}`);
|
|
178
|
+
if (!(err instanceof LocalDataUploadError)) logger.error(`Command failed: ${message}`);
|
|
174
179
|
}
|
|
175
180
|
if (err instanceof CliValidationError) {
|
|
176
181
|
printError(
|
|
@@ -183,11 +188,13 @@ async function runCommand(cmd, opts, globalOpts) {
|
|
|
183
188
|
} else if (err instanceof TeAgentCredentialsError) {
|
|
184
189
|
printError("config", message, err.hint);
|
|
185
190
|
} else if (err instanceof PermissionError) {
|
|
186
|
-
printError("permission", message,
|
|
191
|
+
printError("permission", message, err.hint, err.code);
|
|
187
192
|
} else if (err instanceof CapabilityGatewayError) {
|
|
188
193
|
printError("api", message, err.hint ?? capabilityGatewayHint(err), err.code, err.meta);
|
|
189
194
|
} else if (err instanceof CommunityReportError) {
|
|
190
195
|
printError("api", message, err.hint, err.code, err.meta, { log: false });
|
|
196
|
+
} else if (err instanceof LocalDataUploadError) {
|
|
197
|
+
printError("api", message, err.hint, err.code, err.meta, { log: false });
|
|
191
198
|
} else if (err instanceof SecureStoreAuthError) {
|
|
192
199
|
printError("auth", message, "Run: ae-cli auth login");
|
|
193
200
|
} else if (err instanceof TeAgentApiError) {
|
|
@@ -245,17 +252,24 @@ function createRuntimeContext(cmd, opts, globalOpts) {
|
|
|
245
252
|
let _clientModule = null;
|
|
246
253
|
async function getClient() {
|
|
247
254
|
if (!_clientModule) {
|
|
248
|
-
_clientModule = await import("./client-
|
|
255
|
+
_clientModule = await import("./client-TKG4WBHN.js");
|
|
249
256
|
}
|
|
250
257
|
return _clientModule;
|
|
251
258
|
}
|
|
252
259
|
let _communityReportModule = null;
|
|
253
260
|
async function getCommunityReportClient() {
|
|
254
261
|
if (!_communityReportModule) {
|
|
255
|
-
_communityReportModule = await import("./community-report-client-
|
|
262
|
+
_communityReportModule = await import("./community-report-client-FI4LNVYS.js");
|
|
256
263
|
}
|
|
257
264
|
return _communityReportModule;
|
|
258
265
|
}
|
|
266
|
+
let _localDataUploadModule = null;
|
|
267
|
+
async function getLocalDataUploadClient() {
|
|
268
|
+
if (!_localDataUploadModule) {
|
|
269
|
+
_localDataUploadModule = await import("./local-data-upload-client-BWHSUQQK.js");
|
|
270
|
+
}
|
|
271
|
+
return _localDataUploadModule;
|
|
272
|
+
}
|
|
259
273
|
const ctx = {
|
|
260
274
|
str(name) {
|
|
261
275
|
return String(opts[camelCase(name)] ?? "");
|
|
@@ -283,6 +297,12 @@ function createRuntimeContext(cmd, opts, globalOpts) {
|
|
|
283
297
|
process.exit(1);
|
|
284
298
|
}
|
|
285
299
|
},
|
|
300
|
+
list(name) {
|
|
301
|
+
const val = opts[camelCase(name)];
|
|
302
|
+
if (Array.isArray(val)) return val.map(String);
|
|
303
|
+
if (val === void 0 || val === null || val === "") return [];
|
|
304
|
+
return [String(val)];
|
|
305
|
+
},
|
|
286
306
|
async api(method, path4, params, data) {
|
|
287
307
|
const client = await getClient();
|
|
288
308
|
if (method.toUpperCase() === "GET") {
|
|
@@ -303,8 +323,12 @@ function createRuntimeContext(cmd, opts, globalOpts) {
|
|
|
303
323
|
const client = await getClient();
|
|
304
324
|
return client.queryReportData(projectId, reportId, qp, eventModel, options, ctx.host());
|
|
305
325
|
},
|
|
326
|
+
async localDataUpload(endpoint, rawBody, options) {
|
|
327
|
+
const client = await getLocalDataUploadClient();
|
|
328
|
+
return client.localDataUpload(endpoint, rawBody, options);
|
|
329
|
+
},
|
|
306
330
|
async token() {
|
|
307
|
-
const { getToken } = await import("./auth-
|
|
331
|
+
const { getToken } = await import("./auth-2WTQOP77.js");
|
|
308
332
|
return getToken(ctx.host());
|
|
309
333
|
},
|
|
310
334
|
host() {
|
|
@@ -365,7 +389,9 @@ function registerCommands(program2, commands) {
|
|
|
365
389
|
const sub = parent.command(cmd.command).description(cmd.description);
|
|
366
390
|
for (const flag of cmd.flags) {
|
|
367
391
|
const flagStr = buildFlagString(flag);
|
|
368
|
-
if (flag.
|
|
392
|
+
if (flag.variadic) {
|
|
393
|
+
sub.option(flagStr, flag.desc, collectVariadic, []);
|
|
394
|
+
} else if (flag.type === "boolean") {
|
|
369
395
|
sub.option(flagStr, flag.desc, (value) => parseBooleanValue(value, flag.name));
|
|
370
396
|
} else if (flag.default !== void 0) {
|
|
371
397
|
sub.option(flagStr, flag.desc, String(flag.default));
|
|
@@ -401,6 +427,9 @@ function buildFlagString(flag) {
|
|
|
401
427
|
}
|
|
402
428
|
return `${short}${long} <value>`;
|
|
403
429
|
}
|
|
430
|
+
function collectVariadic(value, previous) {
|
|
431
|
+
return (previous ?? []).concat([value]);
|
|
432
|
+
}
|
|
404
433
|
function parseBooleanValue(value, flagName) {
|
|
405
434
|
if (value === void 0) {
|
|
406
435
|
return true;
|
|
@@ -1754,7 +1783,7 @@ function getAutotrackEvents(sdkType, locale = "zh") {
|
|
|
1754
1783
|
// src/tracking/plan/draft.ts
|
|
1755
1784
|
function injectAutotrackEvents(draft, locale = "zh") {
|
|
1756
1785
|
const mode = draft.meta.sdk_integration_mode;
|
|
1757
|
-
if (mode
|
|
1786
|
+
if (mode !== "client_only" && mode !== "both") {
|
|
1758
1787
|
return draft;
|
|
1759
1788
|
}
|
|
1760
1789
|
const platforms = draft.meta.client_platforms;
|
|
@@ -3442,100 +3471,105 @@ program.name("ae-cli").version(version).description("CLI tool for ThinkingAI (AE
|
|
|
3442
3471
|
async function loadCommands() {
|
|
3443
3472
|
const commands = [];
|
|
3444
3473
|
try {
|
|
3445
|
-
const teAnalysis = await import("./te-analysis-
|
|
3474
|
+
const teAnalysis = await import("./te-analysis-O6DCO6BS.js");
|
|
3446
3475
|
commands.push(...teAnalysis.default);
|
|
3447
3476
|
} catch {
|
|
3448
3477
|
}
|
|
3449
3478
|
try {
|
|
3450
|
-
const engage = await import("./te-engage-
|
|
3479
|
+
const engage = await import("./te-engage-FGBGQ4IY.js");
|
|
3451
3480
|
commands.push(...engage.default);
|
|
3452
3481
|
} catch {
|
|
3453
3482
|
}
|
|
3454
3483
|
try {
|
|
3455
|
-
const experiment = await import("./te-experiment-
|
|
3484
|
+
const experiment = await import("./te-experiment-SO5MPDMJ.js");
|
|
3456
3485
|
commands.push(...experiment.default);
|
|
3457
3486
|
} catch {
|
|
3458
3487
|
}
|
|
3459
3488
|
try {
|
|
3460
|
-
const community = await import("./te-community-
|
|
3489
|
+
const community = await import("./te-community-HLC43QKH.js");
|
|
3461
3490
|
commands.push(...community.default);
|
|
3462
3491
|
} catch {
|
|
3463
3492
|
}
|
|
3464
3493
|
try {
|
|
3465
|
-
const dataops = await import("./te-dataops-
|
|
3494
|
+
const dataops = await import("./te-dataops-EJP56W3K.js");
|
|
3466
3495
|
commands.push(...dataops.default);
|
|
3467
3496
|
} catch {
|
|
3468
3497
|
}
|
|
3469
3498
|
try {
|
|
3470
|
-
const teKb = await import("./te-kb-
|
|
3499
|
+
const teKb = await import("./te-kb-APXBWBDY.js");
|
|
3471
3500
|
commands.push(...teKb.default);
|
|
3472
3501
|
} catch {
|
|
3473
3502
|
}
|
|
3474
3503
|
try {
|
|
3475
|
-
const teTeam = await import("./te-team-
|
|
3504
|
+
const teTeam = await import("./te-team-EFKWYKMK.js");
|
|
3476
3505
|
commands.push(...teTeam.default);
|
|
3477
3506
|
} catch {
|
|
3478
3507
|
}
|
|
3479
3508
|
try {
|
|
3480
|
-
const teAgent = await import("./te-agent-
|
|
3509
|
+
const teAgent = await import("./te-agent-4BKBODMF.js");
|
|
3481
3510
|
commands.push(...teAgent.default);
|
|
3482
3511
|
} catch {
|
|
3483
3512
|
}
|
|
3484
3513
|
try {
|
|
3485
|
-
const memory = await import("./memory-
|
|
3514
|
+
const memory = await import("./memory-YK33G4T7.js");
|
|
3486
3515
|
commands.push(...memory.default);
|
|
3487
3516
|
} catch {
|
|
3488
3517
|
}
|
|
3489
3518
|
try {
|
|
3490
|
-
const teSystem = await import("./te-system-
|
|
3519
|
+
const teSystem = await import("./te-system-Z77IKZFN.js");
|
|
3491
3520
|
commands.push(...teSystem.default);
|
|
3492
3521
|
} catch {
|
|
3493
3522
|
}
|
|
3494
3523
|
try {
|
|
3495
|
-
const metadata = await import("./metadata-
|
|
3524
|
+
const metadata = await import("./metadata-UILXHBWF.js");
|
|
3496
3525
|
commands.push(...metadata.default);
|
|
3497
3526
|
} catch {
|
|
3498
3527
|
}
|
|
3528
|
+
try {
|
|
3529
|
+
const dataIntegration = await import("./data-integration-2MYMANJI.js");
|
|
3530
|
+
commands.push(...dataIntegration.default);
|
|
3531
|
+
} catch {
|
|
3532
|
+
}
|
|
3499
3533
|
return commands;
|
|
3500
3534
|
}
|
|
3501
3535
|
async function registerAuthCommands() {
|
|
3502
3536
|
try {
|
|
3503
|
-
const { registerAuth } = await import("./auth-
|
|
3537
|
+
const { registerAuth } = await import("./auth-77BUFLGC.js");
|
|
3504
3538
|
registerAuth(program);
|
|
3505
3539
|
} catch {
|
|
3506
3540
|
}
|
|
3507
3541
|
}
|
|
3508
3542
|
async function registerConfigCommands() {
|
|
3509
3543
|
try {
|
|
3510
|
-
const { registerConfig } = await import("./config-
|
|
3544
|
+
const { registerConfig } = await import("./config-RE6CMGPK.js");
|
|
3511
3545
|
registerConfig(program);
|
|
3512
3546
|
} catch {
|
|
3513
3547
|
}
|
|
3514
3548
|
}
|
|
3515
3549
|
async function registerCapabilityCommands() {
|
|
3516
3550
|
try {
|
|
3517
|
-
const { registerCapability } = await import("./capability-
|
|
3551
|
+
const { registerCapability } = await import("./capability-PJHNI4GJ.js");
|
|
3518
3552
|
registerCapability(program);
|
|
3519
3553
|
} catch {
|
|
3520
3554
|
}
|
|
3521
3555
|
}
|
|
3522
3556
|
async function registerSyncCommand() {
|
|
3523
3557
|
try {
|
|
3524
|
-
const { registerSync } = await import("./sync-
|
|
3558
|
+
const { registerSync } = await import("./sync-FCKOVWWS.js");
|
|
3525
3559
|
registerSync(program);
|
|
3526
3560
|
} catch {
|
|
3527
3561
|
}
|
|
3528
3562
|
}
|
|
3529
3563
|
async function registerModelCommand() {
|
|
3530
3564
|
try {
|
|
3531
|
-
const { registerModel } = await import("./model-
|
|
3565
|
+
const { registerModel } = await import("./model-NR3JHFSJ.js");
|
|
3532
3566
|
registerModel(program);
|
|
3533
3567
|
} catch {
|
|
3534
3568
|
}
|
|
3535
3569
|
}
|
|
3536
3570
|
async function registerUpdateCommand() {
|
|
3537
3571
|
try {
|
|
3538
|
-
const { registerUpdate } = await import("./update-
|
|
3572
|
+
const { registerUpdate } = await import("./update-OGPSZM5A.js");
|
|
3539
3573
|
registerUpdate(program);
|
|
3540
3574
|
} catch {
|
|
3541
3575
|
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LocalDataUploadError
|
|
3
|
+
} from "./chunk-UW5UN47B.js";
|
|
4
|
+
import {
|
|
5
|
+
logger
|
|
6
|
+
} from "./chunk-LYVNONC4.js";
|
|
7
|
+
import "./chunk-QGM4M3NI.js";
|
|
8
|
+
|
|
9
|
+
// src/core/local-data-upload-client.ts
|
|
10
|
+
import { createHash } from "crypto";
|
|
11
|
+
import { gzipSync } from "zlib";
|
|
12
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
13
|
+
async function localDataUpload(endpoint, rawBody, options = {}) {
|
|
14
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
15
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
16
|
+
const retries = options.retries ?? 0;
|
|
17
|
+
const retryDelayMs = options.retryDelayMs ?? 2e3;
|
|
18
|
+
const compress = options.compress === "gzip";
|
|
19
|
+
const body = compress ? gzipSync(rawBody) : rawBody;
|
|
20
|
+
const requestBytes = Buffer.byteLength(rawBody, "utf8");
|
|
21
|
+
let attempt = 0;
|
|
22
|
+
while (true) {
|
|
23
|
+
try {
|
|
24
|
+
return await performAttempt(endpoint, body, { timeoutMs, fetchImpl, requestBytes, compress });
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (!(error instanceof LocalDataUploadError) || attempt >= retries || !isRetryable(error)) {
|
|
27
|
+
throw stampRetryMeta(error, attempt);
|
|
28
|
+
}
|
|
29
|
+
attempt += 1;
|
|
30
|
+
await sleep(retryDelayMs);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function performAttempt(endpoint, body, options) {
|
|
35
|
+
const { timeoutMs, fetchImpl, requestBytes, compress } = options;
|
|
36
|
+
const controller = new AbortController();
|
|
37
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
38
|
+
let response;
|
|
39
|
+
let responseText = "";
|
|
40
|
+
try {
|
|
41
|
+
response = await fetchImpl(endpoint, {
|
|
42
|
+
method: "POST",
|
|
43
|
+
headers: {
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
"Accept": "application/json",
|
|
46
|
+
...compress ? { "Content-Encoding": "gzip" } : {}
|
|
47
|
+
},
|
|
48
|
+
body,
|
|
49
|
+
redirect: "manual",
|
|
50
|
+
signal: controller.signal
|
|
51
|
+
});
|
|
52
|
+
responseText = await response.text();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
const timedOut = controller.signal.aborted || isAbortError(error);
|
|
55
|
+
logUpload(endpoint, response?.status ?? "unavailable", requestBytes, 0);
|
|
56
|
+
throw new LocalDataUploadError(
|
|
57
|
+
timedOut ? `Local data upload timed out after ${timeoutMs} ms. Delivery state is unknown.` : "Local data upload failed before a response was received. Delivery state is unknown.",
|
|
58
|
+
{
|
|
59
|
+
code: timedOut ? "LOCAL_DATA_UPLOAD_TIMEOUT" : "LOCAL_DATA_UPLOAD_NETWORK_ERROR",
|
|
60
|
+
hint: "Verify receiver data before choosing a resume position.",
|
|
61
|
+
meta: { delivery_state: "unknown", persistence_verified: false, retry_attempted: false },
|
|
62
|
+
cause: error
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
} finally {
|
|
66
|
+
clearTimeout(timeout);
|
|
67
|
+
}
|
|
68
|
+
const responseBytes = Buffer.byteLength(responseText, "utf8");
|
|
69
|
+
logUpload(endpoint, response.status, requestBytes, responseBytes);
|
|
70
|
+
if (response.status >= 300 && response.status < 400) {
|
|
71
|
+
throw new LocalDataUploadError("Receiver redirect was rejected and was not followed.", {
|
|
72
|
+
code: "LOCAL_DATA_UPLOAD_REDIRECT_REJECTED",
|
|
73
|
+
httpStatus: response.status,
|
|
74
|
+
meta: safeMeta(requestBytes, responseBytes, "not_accepted")
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (!response.ok) {
|
|
78
|
+
throw new LocalDataUploadError(`Receiver returned HTTP ${response.status}.`, {
|
|
79
|
+
code: `LOCAL_DATA_UPLOAD_HTTP_${response.status}`,
|
|
80
|
+
httpStatus: response.status,
|
|
81
|
+
hint: response.status >= 500 ? "Check receiver logs." : void 0,
|
|
82
|
+
meta: safeMeta(requestBytes, responseBytes, "rejected")
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const responseBody = parseResponse(responseText, response.status);
|
|
86
|
+
if (!isRecord(responseBody) || typeof responseBody.code !== "number") {
|
|
87
|
+
throw new LocalDataUploadError("Receiver returned an invalid response without numeric code.", {
|
|
88
|
+
code: "LOCAL_DATA_UPLOAD_INVALID_RESPONSE",
|
|
89
|
+
httpStatus: response.status,
|
|
90
|
+
meta: safeMeta(requestBytes, responseBytes, "unknown")
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (responseBody.code !== 0) {
|
|
94
|
+
throw new LocalDataUploadError("Receiver rejected the UE batch.", {
|
|
95
|
+
code: responseBody.code,
|
|
96
|
+
httpStatus: response.status,
|
|
97
|
+
meta: safeMeta(requestBytes, responseBytes, "rejected")
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
code: 0,
|
|
102
|
+
message: typeof responseBody.msg === "string" ? responseBody.msg : "success",
|
|
103
|
+
http_status: response.status,
|
|
104
|
+
request_bytes: requestBytes,
|
|
105
|
+
response_bytes: responseBytes
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function parseResponse(text, status) {
|
|
109
|
+
if (!text.trim()) {
|
|
110
|
+
throw new LocalDataUploadError("Receiver returned an empty response.", {
|
|
111
|
+
code: "LOCAL_DATA_UPLOAD_INVALID_RESPONSE",
|
|
112
|
+
httpStatus: status,
|
|
113
|
+
meta: { delivery_state: "unknown", persistence_verified: false, retry_attempted: false }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
return JSON.parse(text);
|
|
118
|
+
} catch {
|
|
119
|
+
throw new LocalDataUploadError("Receiver returned a non-JSON response.", {
|
|
120
|
+
code: "LOCAL_DATA_UPLOAD_INVALID_RESPONSE",
|
|
121
|
+
httpStatus: status,
|
|
122
|
+
meta: { delivery_state: "unknown", persistence_verified: false, retry_attempted: false }
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function isRetryable(error) {
|
|
127
|
+
if (error.code === "LOCAL_DATA_UPLOAD_TIMEOUT" || error.code === "LOCAL_DATA_UPLOAD_NETWORK_ERROR") return true;
|
|
128
|
+
return typeof error.code === "string" && error.code.startsWith("LOCAL_DATA_UPLOAD_HTTP_") && (error.httpStatus ?? 0) >= 500;
|
|
129
|
+
}
|
|
130
|
+
function stampRetryMeta(error, attempt) {
|
|
131
|
+
if (!(error instanceof LocalDataUploadError) || attempt === 0) return error;
|
|
132
|
+
return new LocalDataUploadError(error.message, {
|
|
133
|
+
code: error.code,
|
|
134
|
+
httpStatus: error.httpStatus,
|
|
135
|
+
hint: error.hint,
|
|
136
|
+
meta: { ...error.meta, retry_attempted: true, retry_count: attempt },
|
|
137
|
+
cause: error.cause
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function safeMeta(requestBytes, responseBytes, deliveryState) {
|
|
141
|
+
return {
|
|
142
|
+
request_bytes: requestBytes,
|
|
143
|
+
response_bytes: responseBytes,
|
|
144
|
+
delivery_state: deliveryState,
|
|
145
|
+
persistence_verified: false,
|
|
146
|
+
retry_attempted: false
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function isRecord(value) {
|
|
150
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
151
|
+
}
|
|
152
|
+
function isAbortError(error) {
|
|
153
|
+
return error instanceof Error && error.name === "AbortError";
|
|
154
|
+
}
|
|
155
|
+
function sleep(ms) {
|
|
156
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
157
|
+
}
|
|
158
|
+
function logUpload(endpoint, status, requestBytes, responseBytes) {
|
|
159
|
+
const targetFingerprint = createHash("sha256").update(endpoint).digest("hex").slice(0, 12);
|
|
160
|
+
logger.info(
|
|
161
|
+
`LOCAL_DATA_UPLOAD target_sha256=${targetFingerprint} status=${status} request_bytes=${requestBytes} response_bytes=${responseBytes}`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
LocalDataUploadError,
|
|
166
|
+
localDataUpload
|
|
167
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCapabilityGatewayUrl,
|
|
3
3
|
callCapabilityApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-P3FGXJTU.js";
|
|
5
|
+
import "./chunk-C4MGVGJW.js";
|
|
6
|
+
import "./chunk-4SGZG4XY.js";
|
|
7
|
+
import "./chunk-ZZUOD757.js";
|
|
8
|
+
import "./chunk-UW5UN47B.js";
|
|
9
|
+
import "./chunk-LYVNONC4.js";
|
|
10
|
+
import "./chunk-QGM4M3NI.js";
|
|
10
11
|
|
|
11
12
|
// src/commands/memory/index.ts
|
|
12
13
|
import fs from "fs/promises";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCapabilityGatewayUrl,
|
|
3
3
|
callCapabilityApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ILIU36SU.js";
|
|
5
|
+
import "./chunk-6EIJSNBD.js";
|
|
6
|
+
import "./chunk-4SGZG4XY.js";
|
|
7
|
+
import "./chunk-ZZUOD757.js";
|
|
8
|
+
import "./chunk-UW5UN47B.js";
|
|
9
|
+
import "./chunk-LYVNONC4.js";
|
|
10
|
+
import "./chunk-QGM4M3NI.js";
|
|
10
11
|
|
|
11
12
|
// src/commands/memory/index.ts
|
|
12
13
|
import fs from "fs/promises";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withAsyncArtifactLifecycle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YA6SMTXG.js";
|
|
4
4
|
import {
|
|
5
5
|
createCapabilityCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VR3LCBHW.js";
|
|
7
7
|
import {
|
|
8
8
|
registerCapabilityGatewayRoute
|
|
9
9
|
} from "./chunk-PTE56QPL.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-GT46FPXN.js";
|
|
11
|
+
import "./chunk-ILIU36SU.js";
|
|
12
|
+
import "./chunk-6EIJSNBD.js";
|
|
13
|
+
import "./chunk-4SGZG4XY.js";
|
|
14
|
+
import "./chunk-ZZUOD757.js";
|
|
15
|
+
import "./chunk-UW5UN47B.js";
|
|
16
|
+
import "./chunk-LYVNONC4.js";
|
|
17
|
+
import "./chunk-QGM4M3NI.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/metadata/shared.ts
|
|
19
20
|
function createCapabilityCommand2(config) {
|
|
@@ -269,17 +270,20 @@ var propertyDimensionTableBindExisting = createCapabilityCommand2({
|
|
|
269
270
|
{ name: "property-scope", type: "string", required: true, desc: "Property owner table, for example event or user." },
|
|
270
271
|
{ name: "data-table-id", type: "number", required: true, desc: "Existing dimension data table ID." },
|
|
271
272
|
{ name: "timestamp-join-format", type: "string", required: false, desc: "Optional timestamp join format." },
|
|
272
|
-
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array." }
|
|
273
|
+
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array. String entries are normalized to column_name objects." }
|
|
273
274
|
],
|
|
274
275
|
risk: "write",
|
|
275
|
-
buildInput: (ctx) =>
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
276
|
+
buildInput: (ctx) => {
|
|
277
|
+
const dictColumns = optionalJson(ctx, "dict-columns");
|
|
278
|
+
return {
|
|
279
|
+
project_id: ctx.num("project-id"),
|
|
280
|
+
property_name: ctx.str("property-name"),
|
|
281
|
+
property_scope: ctx.str("property-scope"),
|
|
282
|
+
data_table_id: ctx.num("data-table-id"),
|
|
283
|
+
timestamp_join_format: optionalString(ctx, "timestamp-join-format"),
|
|
284
|
+
dict_columns: Array.isArray(dictColumns) ? dictColumns.map((column) => typeof column === "string" ? { column_name: column } : column) : dictColumns
|
|
285
|
+
};
|
|
286
|
+
}
|
|
283
287
|
});
|
|
284
288
|
|
|
285
289
|
// src/commands/metadata/property/dimension-table/create-and-bind-csv.ts
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withAsyncArtifactLifecycle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SAU3QFIQ.js";
|
|
4
4
|
import {
|
|
5
5
|
createCapabilityCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RGKJGKT7.js";
|
|
7
7
|
import {
|
|
8
8
|
registerCapabilityGatewayRoute
|
|
9
9
|
} from "./chunk-PTE56QPL.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-GT46FPXN.js";
|
|
11
|
+
import "./chunk-P3FGXJTU.js";
|
|
12
|
+
import "./chunk-C4MGVGJW.js";
|
|
13
|
+
import "./chunk-4SGZG4XY.js";
|
|
14
|
+
import "./chunk-ZZUOD757.js";
|
|
15
|
+
import "./chunk-UW5UN47B.js";
|
|
16
|
+
import "./chunk-LYVNONC4.js";
|
|
17
|
+
import "./chunk-QGM4M3NI.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/metadata/shared.ts
|
|
19
20
|
function createCapabilityCommand2(config) {
|
|
@@ -269,17 +270,20 @@ var propertyDimensionTableBindExisting = createCapabilityCommand2({
|
|
|
269
270
|
{ name: "property-scope", type: "string", required: true, desc: "Property owner table, for example event or user." },
|
|
270
271
|
{ name: "data-table-id", type: "number", required: true, desc: "Existing dimension data table ID." },
|
|
271
272
|
{ name: "timestamp-join-format", type: "string", required: false, desc: "Optional timestamp join format." },
|
|
272
|
-
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array." }
|
|
273
|
+
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array. String entries are normalized to column_name objects." }
|
|
273
274
|
],
|
|
274
275
|
risk: "write",
|
|
275
|
-
buildInput: (ctx) =>
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
276
|
+
buildInput: (ctx) => {
|
|
277
|
+
const dictColumns = optionalJson(ctx, "dict-columns");
|
|
278
|
+
return {
|
|
279
|
+
project_id: ctx.num("project-id"),
|
|
280
|
+
property_name: ctx.str("property-name"),
|
|
281
|
+
property_scope: ctx.str("property-scope"),
|
|
282
|
+
data_table_id: ctx.num("data-table-id"),
|
|
283
|
+
timestamp_join_format: optionalString(ctx, "timestamp-join-format"),
|
|
284
|
+
dict_columns: Array.isArray(dictColumns) ? dictColumns.map((column) => typeof column === "string" ? { column_name: column } : column) : dictColumns
|
|
285
|
+
};
|
|
286
|
+
}
|
|
283
287
|
});
|
|
284
288
|
|
|
285
289
|
// src/commands/metadata/property/dimension-table/create-and-bind-csv.ts
|
|
@@ -11,9 +11,13 @@ import {
|
|
|
11
11
|
getClaudeConfigDir,
|
|
12
12
|
getSandboxModels,
|
|
13
13
|
postSandboxModelSelection
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-UOUS37JQ.js";
|
|
15
|
+
import "./chunk-C4MGVGJW.js";
|
|
16
|
+
import "./chunk-4SGZG4XY.js";
|
|
17
|
+
import "./chunk-ZZUOD757.js";
|
|
18
|
+
import "./chunk-UW5UN47B.js";
|
|
19
|
+
import "./chunk-LYVNONC4.js";
|
|
20
|
+
import "./chunk-QGM4M3NI.js";
|
|
17
21
|
|
|
18
22
|
// src/commands/model/index.ts
|
|
19
23
|
import { existsSync, readFileSync } from "fs";
|