@thinkingai/ae-cli 6.1.17 → 6.1.18
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-2WTQOP77.js → auth-GBMV6TEJ.js} +3 -3
- package/dist/{auth-77BUFLGC.js → auth-ROB2EDYV.js} +12 -13
- package/dist/{capability-72DTW5M2.js → capability-DKMYUTLC.js} +50 -13
- package/dist/{capability-PJHNI4GJ.js → capability-HYVVPG25.js} +49 -12
- package/dist/chunk-3FY3RJ26.js +293 -0
- package/dist/{chunk-PTE56QPL.js → chunk-3KWQYGYI.js} +4 -0
- package/dist/{chunk-UOUS37JQ.js → chunk-4XXOWOTA.js} +3 -3
- package/dist/{chunk-GT46FPXN.js → chunk-BYYS3ANB.js} +17 -8
- package/dist/{chunk-YA6SMTXG.js → chunk-EFH4XWYC.js} +3 -3
- package/dist/{chunk-4SGZG4XY.js → chunk-J2DEBMRF.js} +9 -7
- package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
- package/dist/{chunk-VR3LCBHW.js → chunk-JRJY5DMJ.js} +5 -5
- package/dist/{chunk-ILIU36SU.js → chunk-OMPRXM3V.js} +3 -3
- package/dist/{chunk-VPKZ7I72.js → chunk-QNOLN2LJ.js} +2 -2
- package/dist/{chunk-SAU3QFIQ.js → chunk-QZ3AS4KK.js} +3 -3
- package/dist/chunk-RJDU7NYP.js +1198 -0
- package/dist/{chunk-4KVPKXFX.js → chunk-RNAALWJK.js} +2 -2
- package/dist/{chunk-C4MGVGJW.js → chunk-SERWF6G5.js} +1 -1
- package/dist/{chunk-RGKJGKT7.js → chunk-Y3LOALAV.js} +5 -5
- package/dist/{chunk-P3FGXJTU.js → chunk-ZQ47LWTI.js} +4 -4
- package/dist/chunk-ZQKDZXDO.js +317 -0
- package/dist/{client-TKG4WBHN.js → client-L2YDMHQ6.js} +5 -4
- package/dist/{community-report-client-FI4LNVYS.js → community-report-client-C7WDGET3.js} +1 -2
- package/dist/{config-RE6CMGPK.js → config-BMYZX2UE.js} +7 -6
- package/dist/{data-integration-XQYB4X4F.js → data-integration-QEKDWQDY.js} +1601 -192
- package/dist/index.js +131 -1241
- package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-4YYHSYD6.js} +1 -2
- package/dist/{memory-CHRU2F7W.js → memory-3ORCR7JH.js} +6 -6
- package/dist/{memory-YK33G4T7.js → memory-I2WXDTV2.js} +5 -5
- package/dist/{metadata-XXR34N5P.js → metadata-I4C2EWUN.js} +10 -10
- package/dist/{metadata-UILXHBWF.js → metadata-VUOQJE26.js} +9 -9
- package/dist/{model-NR3JHFSJ.js → model-HLHIEFMU.js} +5 -5
- package/dist/{model-K3KLWIW6.js → model-UGRDX4MW.js} +6 -6
- package/dist/personal-semantic-preference-LIPACBDX.js +239 -0
- package/dist/personal-semantic-preference-OEISBRHM.js +239 -0
- package/dist/project-semantic-FFPWFPIW.js +1114 -0
- package/dist/project-semantic-RT3R2VQD.js +1114 -0
- package/dist/{sync-FCKOVWWS.js → sync-HKIOZXQE.js} +6 -6
- package/dist/{sync-DAVKYVMW.js → sync-TFHU2UTG.js} +7 -7
- package/dist/{te-agent-HLW4VTQK.js → te-agent-BR6VDBNX.js} +9 -8
- package/dist/{te-agent-4BKBODMF.js → te-agent-VLYOV7S4.js} +8 -7
- package/dist/{te-analysis-ZMNGOVNW.js → te-analysis-4YGQL5RC.js} +437 -38
- package/dist/{te-analysis-O6DCO6BS.js → te-analysis-7VUNUYWZ.js} +436 -37
- package/dist/{te-community-HLC43QKH.js → te-community-5DMNKJWY.js} +5 -5
- package/dist/{te-community-6HPBWJUZ.js → te-community-ISDQWJU7.js} +6 -6
- package/dist/{te-dataops-HDRUXY4K.js → te-dataops-6P5IKWNJ.js} +8 -7
- package/dist/{te-dataops-EJP56W3K.js → te-dataops-CVULXNVB.js} +7 -6
- package/dist/{te-engage-RAK5PESW.js → te-engage-KZPR5R22.js} +9 -9
- package/dist/{te-engage-FGBGQ4IY.js → te-engage-N5WI32H6.js} +8 -8
- package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BITX4RD.js} +226 -8
- package/dist/{te-experiment-VZF7BT6G.js → te-experiment-UVR4HLND.js} +227 -9
- package/dist/{te-kb-SQCLHG6X.js → te-kb-RCLSSH2Q.js} +7 -7
- package/dist/{te-system-Z77IKZFN.js → te-system-FXITO2JG.js} +5 -5
- package/dist/{te-system-YARIK4S5.js → te-system-K2GYMCTB.js} +6 -6
- package/dist/{te-team-EFKWYKMK.js → te-team-ADOC2ROP.js} +6 -6
- package/dist/{update-OGPSZM5A.js → update-YCYCKJOO.js} +7 -6
- package/package.json +1 -1
- package/skills/ae-agent/SKILL.md +3 -4
- package/skills/ae-agent/references/edit-skill.md +3 -0
- package/skills/ae-agent/references/get-skill-content.md +1 -1
- package/skills/ae-agent/references/rescan-skills.md +15 -13
- package/skills/ae-agent/references/upload-skill.md +7 -4
- package/skills/ae-analysis/SKILL.md +45 -4
- package/skills/ae-analysis/metadata_resolution.md +38 -4
- package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
- package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
- package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
- package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
- package/skills/ae-analysis/references/command_index.md +17 -9
- package/skills/ae-analysis/references/dashboard_get.md +18 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -0
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
- package/skills/ae-data-integration/SKILL.md +23 -4
- package/skills/ae-data-integration/references/custom-layer.md +93 -0
- package/skills/ae-data-integration/references/error-handling.md +92 -0
- package/skills/ae-data-integration/references/handoff.md +77 -18
- package/skills/ae-data-integration/references/local-analysis.md +1 -1
- package/skills/ae-data-integration/references/reuse.md +9 -5
- package/skills/ae-data-integration/references/sink-upload.md +1 -1
- package/skills/ae-data-integration/references/source-inspect.md +18 -12
- package/skills/ae-data-integration/references/tracking-plan.md +7 -5
- package/skills/ae-data-integration/references/transform.md +10 -10
- package/skills/ae-data-integration/references/ue-mapping.md +33 -11
- package/skills/ae-engage/references/build-task-save-guide.md +9 -0
- package/skills/ae-engage/references/save-task.md +82 -0
- package/skills/ae-experiment/SKILL.md +8 -2
- package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
- package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
- package/skills/ae-experiment/references/save_experiment.md +1 -1
- package/skills/ae-kb/SKILL.md +1 -1
- package/skills/ae-project-semantic/SKILL.md +193 -0
- package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
- package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-ZZUOD757.js +0 -598
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCapabilityGatewayRoute
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3KWQYGYI.js";
|
|
4
4
|
import {
|
|
5
5
|
internalCallSourceHeaders
|
|
6
6
|
} from "./chunk-6EIJSNBD.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliToken,
|
|
9
9
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J2DEBMRF.js";
|
|
11
|
+
import "./chunk-ZQKDZXDO.js";
|
|
11
12
|
import {
|
|
12
13
|
getActiveHost,
|
|
13
14
|
safeJsonParse
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3FY3RJ26.js";
|
|
15
16
|
import {
|
|
16
17
|
CliValidationError,
|
|
17
18
|
PermissionError
|
|
18
19
|
} from "./chunk-UW5UN47B.js";
|
|
19
20
|
import {
|
|
20
21
|
logger
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-QGM4M3NI.js";
|
|
22
|
+
} from "./chunk-JHENBQ5B.js";
|
|
23
23
|
|
|
24
24
|
// src/core/mcp.ts
|
|
25
25
|
async function permissionDetails(resp) {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCapabilityGatewayRoute
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3KWQYGYI.js";
|
|
4
4
|
import {
|
|
5
5
|
internalCallSourceHeaders
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SERWF6G5.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliToken,
|
|
9
9
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J2DEBMRF.js";
|
|
11
|
+
import "./chunk-ZQKDZXDO.js";
|
|
11
12
|
import {
|
|
12
13
|
getActiveHost,
|
|
13
14
|
safeJsonParse
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3FY3RJ26.js";
|
|
15
16
|
import {
|
|
16
17
|
CliValidationError,
|
|
17
18
|
PermissionError
|
|
18
19
|
} from "./chunk-UW5UN47B.js";
|
|
19
20
|
import {
|
|
20
21
|
logger
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-QGM4M3NI.js";
|
|
22
|
+
} from "./chunk-JHENBQ5B.js";
|
|
23
23
|
|
|
24
24
|
// src/core/mcp.ts
|
|
25
25
|
async function permissionDetails(resp) {
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BYYS3ANB.js";
|
|
4
4
|
import {
|
|
5
5
|
internalCallSourceHeaders
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SERWF6G5.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliToken,
|
|
9
9
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J2DEBMRF.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveHost
|
|
13
|
+
} from "./chunk-ZQKDZXDO.js";
|
|
11
14
|
import {
|
|
12
|
-
resolveHost,
|
|
13
15
|
safeJsonParse
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3FY3RJ26.js";
|
|
15
17
|
import {
|
|
16
18
|
CliValidationError,
|
|
17
19
|
PermissionError
|
|
18
20
|
} from "./chunk-UW5UN47B.js";
|
|
19
21
|
import {
|
|
20
22
|
logger
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-QGM4M3NI.js";
|
|
23
|
+
} from "./chunk-JHENBQ5B.js";
|
|
23
24
|
|
|
24
25
|
// src/commands/te-dataops/shared.ts
|
|
25
26
|
import { randomBytes } from "crypto";
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BYYS3ANB.js";
|
|
4
4
|
import {
|
|
5
5
|
internalCallSourceHeaders
|
|
6
6
|
} from "./chunk-6EIJSNBD.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliToken,
|
|
9
9
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J2DEBMRF.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveHost
|
|
13
|
+
} from "./chunk-ZQKDZXDO.js";
|
|
11
14
|
import {
|
|
12
|
-
resolveHost,
|
|
13
15
|
safeJsonParse
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3FY3RJ26.js";
|
|
15
17
|
import {
|
|
16
18
|
CliValidationError,
|
|
17
19
|
PermissionError
|
|
18
20
|
} from "./chunk-UW5UN47B.js";
|
|
19
21
|
import {
|
|
20
22
|
logger
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-QGM4M3NI.js";
|
|
23
|
+
} from "./chunk-JHENBQ5B.js";
|
|
23
24
|
|
|
24
25
|
// src/commands/te-dataops/shared.ts
|
|
25
26
|
import { randomBytes } from "crypto";
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapabilityCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y3LOALAV.js";
|
|
4
4
|
import {
|
|
5
5
|
registerCapabilityGatewayRoute,
|
|
6
6
|
resolveGatewayDomain
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3KWQYGYI.js";
|
|
8
8
|
import {
|
|
9
9
|
printError,
|
|
10
10
|
withOutputMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BYYS3ANB.js";
|
|
12
12
|
import {
|
|
13
13
|
CapabilityGatewayError,
|
|
14
14
|
buildCapabilityGatewayUrl,
|
|
15
15
|
fetchCapabilityGateway,
|
|
16
16
|
requestCapabilityGateway,
|
|
17
17
|
requestCapabilityGatewayWithEnvelope
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-ZQ47LWTI.js";
|
|
19
|
+
import "./chunk-SERWF6G5.js";
|
|
20
|
+
import "./chunk-J2DEBMRF.js";
|
|
21
|
+
import "./chunk-ZQKDZXDO.js";
|
|
22
|
+
import "./chunk-3FY3RJ26.js";
|
|
22
23
|
import {
|
|
23
24
|
CliValidationError
|
|
24
25
|
} from "./chunk-UW5UN47B.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-QGM4M3NI.js";
|
|
26
|
+
import "./chunk-JHENBQ5B.js";
|
|
27
27
|
|
|
28
28
|
// src/commands/te-engage/shared.ts
|
|
29
29
|
function createEngageCapabilityCommand(cliService, config) {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapabilityCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JRJY5DMJ.js";
|
|
4
4
|
import {
|
|
5
5
|
registerCapabilityGatewayRoute,
|
|
6
6
|
resolveGatewayDomain
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3KWQYGYI.js";
|
|
8
8
|
import {
|
|
9
9
|
printError,
|
|
10
10
|
withOutputMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BYYS3ANB.js";
|
|
12
12
|
import {
|
|
13
13
|
CapabilityGatewayError,
|
|
14
14
|
buildCapabilityGatewayUrl,
|
|
15
15
|
fetchCapabilityGateway,
|
|
16
16
|
requestCapabilityGateway,
|
|
17
17
|
requestCapabilityGatewayWithEnvelope
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OMPRXM3V.js";
|
|
19
19
|
import "./chunk-6EIJSNBD.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-J2DEBMRF.js";
|
|
21
|
+
import "./chunk-ZQKDZXDO.js";
|
|
22
|
+
import "./chunk-3FY3RJ26.js";
|
|
22
23
|
import {
|
|
23
24
|
CliValidationError
|
|
24
25
|
} from "./chunk-UW5UN47B.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-QGM4M3NI.js";
|
|
26
|
+
import "./chunk-JHENBQ5B.js";
|
|
27
27
|
|
|
28
28
|
// src/commands/te-engage/shared.ts
|
|
29
29
|
function createEngageCapabilityCommand(cliService, config) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapabilityCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JRJY5DMJ.js";
|
|
4
4
|
import {
|
|
5
5
|
registerCapabilityGatewayRoute
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-3KWQYGYI.js";
|
|
7
|
+
import "./chunk-BYYS3ANB.js";
|
|
8
|
+
import "./chunk-OMPRXM3V.js";
|
|
9
9
|
import "./chunk-6EIJSNBD.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-J2DEBMRF.js";
|
|
11
|
+
import "./chunk-ZQKDZXDO.js";
|
|
12
|
+
import "./chunk-3FY3RJ26.js";
|
|
12
13
|
import "./chunk-UW5UN47B.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-QGM4M3NI.js";
|
|
14
|
+
import "./chunk-JHENBQ5B.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/te-experiment/capability-shared.ts
|
|
17
17
|
function createExperimentCapabilityCommand(config) {
|
|
@@ -283,6 +283,54 @@ var experimentUpdateGroup = createExperimentCapabilityCommand({
|
|
|
283
283
|
})
|
|
284
284
|
});
|
|
285
285
|
|
|
286
|
+
// src/commands/te-experiment/experiment/update-metrics.ts
|
|
287
|
+
var METRIC_ROLES = /* @__PURE__ */ new Set(["primary", "secondary", "guardrail"]);
|
|
288
|
+
function readMetricBindings(ctx) {
|
|
289
|
+
const value = ctx.json("metrics");
|
|
290
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
291
|
+
throw new Error("Flag --metrics must be a non-empty JSON array");
|
|
292
|
+
}
|
|
293
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
294
|
+
const item = value[index];
|
|
295
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) {
|
|
296
|
+
throw new Error(`Flag --metrics[${index}] must be a JSON object`);
|
|
297
|
+
}
|
|
298
|
+
const metricId = item.metricId;
|
|
299
|
+
const metricRole = item.metricRole;
|
|
300
|
+
if (typeof metricId !== "string" || metricId.trim() === "") {
|
|
301
|
+
throw new Error(`Flag --metrics[${index}].metricId must be a non-empty string`);
|
|
302
|
+
}
|
|
303
|
+
if (typeof metricRole !== "string" || !METRIC_ROLES.has(metricRole)) {
|
|
304
|
+
throw new Error(`Flag --metrics[${index}].metricRole must be one of primary, secondary, guardrail`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return value;
|
|
308
|
+
}
|
|
309
|
+
var experimentUpdateMetrics = createExperimentCapabilityCommand({
|
|
310
|
+
resource: "experiment",
|
|
311
|
+
command: "update-metrics",
|
|
312
|
+
capabilityId: "experiment.experiment.save",
|
|
313
|
+
description: "Replace experiment metric bindings and assign primary, secondary, or guardrail roles.",
|
|
314
|
+
flags: [
|
|
315
|
+
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
316
|
+
{ name: "exp-id", type: "string", required: true, desc: "Experiment draft ID." },
|
|
317
|
+
{
|
|
318
|
+
name: "metrics",
|
|
319
|
+
type: "json",
|
|
320
|
+
required: true,
|
|
321
|
+
desc: "Non-empty metric binding array with camelCase metricId and metricRole fields; replaces all saved bindings."
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
risk: "write",
|
|
325
|
+
validate: (ctx) => {
|
|
326
|
+
readMetricBindings(ctx);
|
|
327
|
+
},
|
|
328
|
+
buildInput: (ctx) => ({
|
|
329
|
+
project_id: ctx.num("project-id"),
|
|
330
|
+
req: { expId: ctx.str("exp-id"), metrics: readMetricBindings(ctx) }
|
|
331
|
+
})
|
|
332
|
+
});
|
|
333
|
+
|
|
286
334
|
// src/commands/te-experiment/feature/batch-delete.ts
|
|
287
335
|
var featureBatchDelete = createExperimentCapabilityCommand({
|
|
288
336
|
resource: "feature",
|
|
@@ -402,6 +450,166 @@ var featureOperationLogQuery = createExperimentCapabilityCommand({
|
|
|
402
450
|
})
|
|
403
451
|
});
|
|
404
452
|
|
|
453
|
+
// src/commands/te-experiment/feature-whitelist/shared.ts
|
|
454
|
+
function readRuleIds(ctx) {
|
|
455
|
+
const value = ctx.json("rule-ids");
|
|
456
|
+
if (!Array.isArray(value) || value.length === 0 || !value.every((item) => typeof item === "string" && item.trim() !== "")) {
|
|
457
|
+
throw new Error("Flag --rule-ids must be a non-empty JSON array of strings");
|
|
458
|
+
}
|
|
459
|
+
return value;
|
|
460
|
+
}
|
|
461
|
+
function readWhitelist(ctx) {
|
|
462
|
+
const value = ctx.json("whitelist");
|
|
463
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
464
|
+
throw new Error("Flag --whitelist must be a non-empty JSON array");
|
|
465
|
+
}
|
|
466
|
+
const bucketIds = /* @__PURE__ */ new Set();
|
|
467
|
+
value.forEach((bucket, bucketIndex) => {
|
|
468
|
+
if (!bucket || typeof bucket !== "object" || Array.isArray(bucket)) {
|
|
469
|
+
throw new Error(`Flag --whitelist[${bucketIndex}] must be a JSON object`);
|
|
470
|
+
}
|
|
471
|
+
const item = bucket;
|
|
472
|
+
if (typeof item.bucket_id !== "string" || item.bucket_id.trim() === "") {
|
|
473
|
+
throw new Error(`Flag --whitelist[${bucketIndex}].bucket_id must be a non-empty string`);
|
|
474
|
+
}
|
|
475
|
+
if (bucketIds.has(item.bucket_id)) {
|
|
476
|
+
throw new Error(`Flag --whitelist contains duplicate bucket_id: ${item.bucket_id}`);
|
|
477
|
+
}
|
|
478
|
+
bucketIds.add(item.bucket_id);
|
|
479
|
+
if (!Array.isArray(item.rules) || item.rules.length === 0) {
|
|
480
|
+
throw new Error(`Flag --whitelist[${bucketIndex}].rules must be a non-empty array`);
|
|
481
|
+
}
|
|
482
|
+
const bucketValueIds = /* @__PURE__ */ new Set();
|
|
483
|
+
item.rules.forEach((rule, ruleIndex) => {
|
|
484
|
+
if (!rule || typeof rule !== "object" || Array.isArray(rule)) {
|
|
485
|
+
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}] must be a JSON object`);
|
|
486
|
+
}
|
|
487
|
+
const row = rule;
|
|
488
|
+
if (!Array.isArray(row.ids) || row.ids.length === 0 || !row.ids.every((id) => typeof id === "string" && id.trim() !== "")) {
|
|
489
|
+
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}].ids must be a non-empty string array`);
|
|
490
|
+
}
|
|
491
|
+
row.ids.forEach((id) => {
|
|
492
|
+
if (bucketValueIds.has(id)) {
|
|
493
|
+
throw new Error(`Flag --whitelist bucket ${item.bucket_id} contains duplicate ID: ${id}`);
|
|
494
|
+
}
|
|
495
|
+
bucketValueIds.add(id);
|
|
496
|
+
});
|
|
497
|
+
if (typeof row.value !== "string") {
|
|
498
|
+
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}].value must be a string`);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
return value;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// src/commands/te-experiment/feature-whitelist/batch-delete.ts
|
|
506
|
+
function buildBody(ctx) {
|
|
507
|
+
return { project_id: ctx.num("project-id"), rule_ids: readRuleIds(ctx) };
|
|
508
|
+
}
|
|
509
|
+
var featureWhitelistBatchDelete = createExperimentCapabilityCommand({
|
|
510
|
+
resource: "feature whitelist",
|
|
511
|
+
command: "batch-delete",
|
|
512
|
+
capabilityId: "experiment.feature_whitelist.batch_delete",
|
|
513
|
+
description: "Delete Feature whitelist rules; enabled whitelist rules are allowed and trigger RCC resync.",
|
|
514
|
+
flags: [
|
|
515
|
+
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
516
|
+
{ name: "rule-ids", type: "json", required: true, desc: "Non-empty JSON array of whitelist rule IDs." }
|
|
517
|
+
],
|
|
518
|
+
risk: "high-risk-write",
|
|
519
|
+
validate: (ctx) => {
|
|
520
|
+
buildBody(ctx);
|
|
521
|
+
},
|
|
522
|
+
buildInput: buildBody
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// src/commands/te-experiment/feature-whitelist/list.ts
|
|
526
|
+
function buildInput5(ctx) {
|
|
527
|
+
return {
|
|
528
|
+
project_id: ctx.num("project-id"),
|
|
529
|
+
feature_key: ctx.str("feature-key")
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
var featureWhitelistList = createExperimentCapabilityCommand({
|
|
533
|
+
resource: "feature whitelist",
|
|
534
|
+
command: "list",
|
|
535
|
+
capabilityId: "experiment.feature_whitelist.list",
|
|
536
|
+
description: "List explicit whitelist rules for one Feature.",
|
|
537
|
+
flags: [
|
|
538
|
+
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
539
|
+
{ name: "feature-key", type: "string", required: true, desc: "Existing Feature key." }
|
|
540
|
+
],
|
|
541
|
+
risk: "read",
|
|
542
|
+
buildInput: buildInput5
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// src/commands/te-experiment/feature-whitelist/save.ts
|
|
546
|
+
function buildInput6(ctx) {
|
|
547
|
+
const ruleId = ctx.str("rule-id").trim();
|
|
548
|
+
const status = ctx.str("status").trim() || "draft";
|
|
549
|
+
if (!["draft", "enable", "disable"].includes(status)) {
|
|
550
|
+
throw new Error("Flag --status must be one of draft, enable, disable");
|
|
551
|
+
}
|
|
552
|
+
const input = {
|
|
553
|
+
project_id: ctx.num("project-id"),
|
|
554
|
+
feature_key: ctx.str("feature-key"),
|
|
555
|
+
whitelist: readWhitelist(ctx),
|
|
556
|
+
status
|
|
557
|
+
};
|
|
558
|
+
if (ruleId) input.rule_id = ruleId;
|
|
559
|
+
const priority = ctx.str("priority");
|
|
560
|
+
if (priority !== "") input.priority = ctx.num("priority");
|
|
561
|
+
return input;
|
|
562
|
+
}
|
|
563
|
+
var featureWhitelistSave = createExperimentCapabilityCommand({
|
|
564
|
+
resource: "feature whitelist",
|
|
565
|
+
command: "save",
|
|
566
|
+
capabilityId: "experiment.feature_whitelist.save",
|
|
567
|
+
description: "Create or modify a Feature whitelist rule and optionally enable it.",
|
|
568
|
+
flags: [
|
|
569
|
+
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
570
|
+
{ name: "feature-key", type: "string", required: true, desc: "Existing Feature key." },
|
|
571
|
+
{ name: "rule-id", type: "string", desc: "Existing whitelist rule ID; omit to create a new rule." },
|
|
572
|
+
{ name: "priority", type: "number", desc: "Rule priority; omitted create requests use the server-assigned next priority." },
|
|
573
|
+
{ name: "status", type: "string", default: "draft", desc: "Rule status: draft, enable, or disable." },
|
|
574
|
+
{
|
|
575
|
+
name: "whitelist",
|
|
576
|
+
type: "json",
|
|
577
|
+
required: true,
|
|
578
|
+
desc: 'Whitelist bucket array: [{"bucket_id":"#user_id","rules":[{"ids":["u1"],"value":"on"}]}].'
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
risk: "write",
|
|
582
|
+
validate: (ctx) => {
|
|
583
|
+
buildInput6(ctx);
|
|
584
|
+
},
|
|
585
|
+
buildInput: buildInput6
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// src/commands/te-experiment/feature-whitelist/update-status.ts
|
|
589
|
+
function buildBody2(ctx) {
|
|
590
|
+
const status = ctx.str("status");
|
|
591
|
+
if (!["enable", "disable"].includes(status)) {
|
|
592
|
+
throw new Error("Flag --status must be one of enable, disable");
|
|
593
|
+
}
|
|
594
|
+
return { project_id: ctx.num("project-id"), rule_id: ctx.str("rule-id"), status };
|
|
595
|
+
}
|
|
596
|
+
var featureWhitelistUpdateStatus = createExperimentCapabilityCommand({
|
|
597
|
+
resource: "feature whitelist",
|
|
598
|
+
command: "update-status",
|
|
599
|
+
capabilityId: "experiment.feature_whitelist.update_status",
|
|
600
|
+
description: "Enable or disable a Feature whitelist rule; enabled rules sync an online Feature to RCC.",
|
|
601
|
+
flags: [
|
|
602
|
+
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
603
|
+
{ name: "rule-id", type: "string", required: true, desc: "Whitelist rule ID." },
|
|
604
|
+
{ name: "status", type: "string", required: true, desc: "Target status: enable or disable." }
|
|
605
|
+
],
|
|
606
|
+
risk: "write",
|
|
607
|
+
validate: (ctx) => {
|
|
608
|
+
buildBody2(ctx);
|
|
609
|
+
},
|
|
610
|
+
buildInput: buildBody2
|
|
611
|
+
});
|
|
612
|
+
|
|
405
613
|
// src/commands/te-experiment/metric/delete.ts
|
|
406
614
|
var metricDelete = createExperimentCapabilityCommand({
|
|
407
615
|
resource: "metric",
|
|
@@ -709,6 +917,7 @@ var commands = [
|
|
|
709
917
|
experimentConflictCheck,
|
|
710
918
|
experimentManage,
|
|
711
919
|
experimentUpdateGroup,
|
|
920
|
+
experimentUpdateMetrics,
|
|
712
921
|
experimentBatchDelete,
|
|
713
922
|
operationLogQuery,
|
|
714
923
|
saveBuildGuide,
|
|
@@ -731,6 +940,10 @@ var commands = [
|
|
|
731
940
|
featureVersionList,
|
|
732
941
|
featureOperationLogQuery,
|
|
733
942
|
featureBatchDelete,
|
|
943
|
+
featureWhitelistList,
|
|
944
|
+
featureWhitelistSave,
|
|
945
|
+
featureWhitelistUpdateStatus,
|
|
946
|
+
featureWhitelistBatchDelete,
|
|
734
947
|
bucketList
|
|
735
948
|
];
|
|
736
949
|
var te_experiment_default = commands;
|
|
@@ -746,6 +959,7 @@ export {
|
|
|
746
959
|
experimentReadyCheck,
|
|
747
960
|
experimentSave,
|
|
748
961
|
experimentUpdateGroup,
|
|
962
|
+
experimentUpdateMetrics,
|
|
749
963
|
featureBatchDelete,
|
|
750
964
|
featureGet,
|
|
751
965
|
featureList,
|
|
@@ -753,6 +967,10 @@ export {
|
|
|
753
967
|
featureSave,
|
|
754
968
|
featureUpdateStatus,
|
|
755
969
|
featureVersionList,
|
|
970
|
+
featureWhitelistBatchDelete,
|
|
971
|
+
featureWhitelistList,
|
|
972
|
+
featureWhitelistSave,
|
|
973
|
+
featureWhitelistUpdateStatus,
|
|
756
974
|
metricDelete,
|
|
757
975
|
metricGet,
|
|
758
976
|
metricList,
|