@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,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCapabilityGatewayUrl,
|
|
3
3
|
callCapabilityApi
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZQ47LWTI.js";
|
|
5
|
+
import "./chunk-SERWF6G5.js";
|
|
6
|
+
import "./chunk-J2DEBMRF.js";
|
|
7
|
+
import "./chunk-ZQKDZXDO.js";
|
|
8
|
+
import "./chunk-3FY3RJ26.js";
|
|
8
9
|
import "./chunk-UW5UN47B.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-QGM4M3NI.js";
|
|
10
|
+
import "./chunk-JHENBQ5B.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/memory/index.ts
|
|
13
13
|
import fs from "fs/promises";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCapabilityGatewayUrl,
|
|
3
3
|
callCapabilityApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMPRXM3V.js";
|
|
5
5
|
import "./chunk-6EIJSNBD.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-J2DEBMRF.js";
|
|
7
|
+
import "./chunk-ZQKDZXDO.js";
|
|
8
|
+
import "./chunk-3FY3RJ26.js";
|
|
8
9
|
import "./chunk-UW5UN47B.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-QGM4M3NI.js";
|
|
10
|
+
import "./chunk-JHENBQ5B.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/memory/index.ts
|
|
13
13
|
import fs from "fs/promises";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withAsyncArtifactLifecycle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EFH4XWYC.js";
|
|
4
4
|
import {
|
|
5
5
|
createCapabilityCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y3LOALAV.js";
|
|
7
7
|
import {
|
|
8
8
|
registerCapabilityGatewayRoute
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3KWQYGYI.js";
|
|
10
|
+
import "./chunk-BYYS3ANB.js";
|
|
11
|
+
import "./chunk-ZQ47LWTI.js";
|
|
12
|
+
import "./chunk-SERWF6G5.js";
|
|
13
|
+
import "./chunk-J2DEBMRF.js";
|
|
14
|
+
import "./chunk-ZQKDZXDO.js";
|
|
15
|
+
import "./chunk-3FY3RJ26.js";
|
|
15
16
|
import "./chunk-UW5UN47B.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-QGM4M3NI.js";
|
|
17
|
+
import "./chunk-JHENBQ5B.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/metadata/shared.ts
|
|
20
20
|
function createCapabilityCommand2(config) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withAsyncArtifactLifecycle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QZ3AS4KK.js";
|
|
4
4
|
import {
|
|
5
5
|
createCapabilityCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JRJY5DMJ.js";
|
|
7
7
|
import {
|
|
8
8
|
registerCapabilityGatewayRoute
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3KWQYGYI.js";
|
|
10
|
+
import "./chunk-BYYS3ANB.js";
|
|
11
|
+
import "./chunk-OMPRXM3V.js";
|
|
12
12
|
import "./chunk-6EIJSNBD.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-J2DEBMRF.js";
|
|
14
|
+
import "./chunk-ZQKDZXDO.js";
|
|
15
|
+
import "./chunk-3FY3RJ26.js";
|
|
15
16
|
import "./chunk-UW5UN47B.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-QGM4M3NI.js";
|
|
17
|
+
import "./chunk-JHENBQ5B.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/metadata/shared.ts
|
|
20
20
|
function createCapabilityCommand2(config) {
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
getClaudeConfigDir,
|
|
12
12
|
getSandboxModels,
|
|
13
13
|
postSandboxModelSelection
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QNOLN2LJ.js";
|
|
15
15
|
import "./chunk-6EIJSNBD.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-J2DEBMRF.js";
|
|
17
|
+
import "./chunk-ZQKDZXDO.js";
|
|
18
|
+
import "./chunk-3FY3RJ26.js";
|
|
18
19
|
import "./chunk-UW5UN47B.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-QGM4M3NI.js";
|
|
20
|
+
import "./chunk-JHENBQ5B.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/model/index.ts
|
|
23
23
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
getClaudeConfigDir,
|
|
12
12
|
getSandboxModels,
|
|
13
13
|
postSandboxModelSelection
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-4XXOWOTA.js";
|
|
15
|
+
import "./chunk-SERWF6G5.js";
|
|
16
|
+
import "./chunk-J2DEBMRF.js";
|
|
17
|
+
import "./chunk-ZQKDZXDO.js";
|
|
18
|
+
import "./chunk-3FY3RJ26.js";
|
|
18
19
|
import "./chunk-UW5UN47B.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-QGM4M3NI.js";
|
|
20
|
+
import "./chunk-JHENBQ5B.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/model/index.ts
|
|
23
23
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCapabilityCommand
|
|
3
|
+
} from "./chunk-JRJY5DMJ.js";
|
|
4
|
+
import {
|
|
5
|
+
registerCapabilityGatewayRoute
|
|
6
|
+
} from "./chunk-3KWQYGYI.js";
|
|
7
|
+
import "./chunk-BYYS3ANB.js";
|
|
8
|
+
import "./chunk-OMPRXM3V.js";
|
|
9
|
+
import "./chunk-6EIJSNBD.js";
|
|
10
|
+
import "./chunk-J2DEBMRF.js";
|
|
11
|
+
import "./chunk-ZQKDZXDO.js";
|
|
12
|
+
import "./chunk-3FY3RJ26.js";
|
|
13
|
+
import "./chunk-UW5UN47B.js";
|
|
14
|
+
import "./chunk-JHENBQ5B.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/personal-semantic-preference/shared.ts
|
|
17
|
+
function createPersonalSemanticPreferenceCommand(config) {
|
|
18
|
+
return createCapabilityCommand({
|
|
19
|
+
...config,
|
|
20
|
+
cliService: "personal-semantic-preference",
|
|
21
|
+
gatewayDomain: "analysis"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function optionalString(ctx, name) {
|
|
25
|
+
const value = ctx.str(name);
|
|
26
|
+
return value === "" ? void 0 : value;
|
|
27
|
+
}
|
|
28
|
+
function optionalKeywords(ctx) {
|
|
29
|
+
if (ctx.str("keywords") === "") {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
const value = ctx.json("keywords");
|
|
33
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
34
|
+
throw new Error("--keywords must be a JSON array of strings.");
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function optionalResourceRefs(ctx) {
|
|
39
|
+
if (ctx.str("resource-refs") === "") {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
const value = ctx.json("resource-refs");
|
|
43
|
+
if (!Array.isArray(value)) {
|
|
44
|
+
throw new Error("--resource-refs must be a JSON array.");
|
|
45
|
+
}
|
|
46
|
+
if (value.length > 50) {
|
|
47
|
+
throw new Error("--resource-refs must contain at most 50 items.");
|
|
48
|
+
}
|
|
49
|
+
const identities = /* @__PURE__ */ new Set();
|
|
50
|
+
return value.map((item) => {
|
|
51
|
+
if (item === null || typeof item !== "object" || Array.isArray(item)) {
|
|
52
|
+
throw new Error("--resource-refs items must be objects.");
|
|
53
|
+
}
|
|
54
|
+
const keys = Object.keys(item).sort();
|
|
55
|
+
if (keys.join(",") !== "display_name,resource_key,resource_type") {
|
|
56
|
+
throw new Error("--resource-refs items must contain only resource_type, resource_key, and display_name.");
|
|
57
|
+
}
|
|
58
|
+
const ref = item;
|
|
59
|
+
if (typeof ref.resource_type !== "string" || !/^[a-z][a-z0-9_]{0,63}$/i.test(ref.resource_type.trim())) {
|
|
60
|
+
throw new Error("resource_type must use lower snake_case.");
|
|
61
|
+
}
|
|
62
|
+
if (typeof ref.resource_key !== "string" || ref.resource_key.trim().length === 0 || ref.resource_key.trim().length > 255) {
|
|
63
|
+
throw new Error("resource_key must contain 1 to 255 characters.");
|
|
64
|
+
}
|
|
65
|
+
if (typeof ref.display_name !== "string" || ref.display_name.trim().length === 0 || ref.display_name.trim().length > 255) {
|
|
66
|
+
throw new Error("display_name must contain 1 to 255 characters.");
|
|
67
|
+
}
|
|
68
|
+
const normalized = {
|
|
69
|
+
resource_type: ref.resource_type.trim().toLowerCase(),
|
|
70
|
+
resource_key: ref.resource_key.trim(),
|
|
71
|
+
display_name: ref.display_name.trim()
|
|
72
|
+
};
|
|
73
|
+
const identity = `${normalized.resource_type}\0${normalized.resource_key}`;
|
|
74
|
+
if (identities.has(identity)) {
|
|
75
|
+
throw new Error("--resource-refs must contain unique resource_type and resource_key pairs.");
|
|
76
|
+
}
|
|
77
|
+
identities.add(identity);
|
|
78
|
+
return normalized;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function validateContextType(ctx) {
|
|
82
|
+
const value = ctx.str("context-type");
|
|
83
|
+
const supported = ["preference", "asset_context", "experience", "background"];
|
|
84
|
+
if (!supported.includes(value)) {
|
|
85
|
+
throw new Error(`--context-type must be one of: ${supported.join(", ")}.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function validatePersonalSemanticWrite(ctx) {
|
|
89
|
+
validateContextType(ctx);
|
|
90
|
+
const contextType = ctx.str("context-type");
|
|
91
|
+
const refs = optionalResourceRefs(ctx);
|
|
92
|
+
if (contextType === "asset_context" && (!refs || refs.length === 0)) {
|
|
93
|
+
throw new Error("--resource-refs is required and must be non-empty for --context-type asset_context.");
|
|
94
|
+
}
|
|
95
|
+
if (contextType !== "asset_context" && refs && refs.length > 0) {
|
|
96
|
+
throw new Error("--resource-refs is only allowed with --context-type asset_context.");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function compactInput(input) {
|
|
100
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/commands/personal-semantic-preference/add.ts
|
|
104
|
+
var personalSemanticPreferenceAdd = createPersonalSemanticPreferenceCommand({
|
|
105
|
+
resource: "",
|
|
106
|
+
command: "add",
|
|
107
|
+
capabilityId: "business_semantics.personal_context.add",
|
|
108
|
+
description: "Add one personal semantic preference for the authenticated user.",
|
|
109
|
+
flags: [
|
|
110
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
111
|
+
{ name: "context-type", type: "string", required: true, desc: "preference | asset_context | experience | background." },
|
|
112
|
+
{ name: "title", type: "string", required: true, desc: "Short preference title.", maxLength: 255 },
|
|
113
|
+
{ name: "summary", type: "string", required: true, desc: "Compact preference summary.", maxLength: 1e3 },
|
|
114
|
+
{ name: "content", type: "string", required: true, desc: "Full personal semantic preference content.", maxLength: 2e4 },
|
|
115
|
+
{ name: "keywords", type: "json", desc: "Optional JSON array of preference keywords." },
|
|
116
|
+
{ name: "resource-refs", type: "json", desc: "Ordered JSON asset references; required only for asset_context." },
|
|
117
|
+
{ name: "fresh-until-at", type: "string", desc: "Optional freshness expiration timestamp: yyyy-MM-dd HH:mm:ss." },
|
|
118
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
119
|
+
],
|
|
120
|
+
risk: "write",
|
|
121
|
+
validate: validatePersonalSemanticWrite,
|
|
122
|
+
buildInput: (ctx) => compactInput({
|
|
123
|
+
project_id: ctx.num("project-id"),
|
|
124
|
+
context_type: ctx.str("context-type"),
|
|
125
|
+
title: ctx.str("title"),
|
|
126
|
+
summary: ctx.str("summary"),
|
|
127
|
+
content: ctx.str("content"),
|
|
128
|
+
keywords: optionalKeywords(ctx),
|
|
129
|
+
resource_refs: optionalResourceRefs(ctx),
|
|
130
|
+
fresh_until_at: optionalString(ctx, "fresh-until-at"),
|
|
131
|
+
request_id: optionalString(ctx, "request-id")
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// src/commands/personal-semantic-preference/delete.ts
|
|
136
|
+
var personalSemanticPreferenceDelete = createPersonalSemanticPreferenceCommand({
|
|
137
|
+
resource: "",
|
|
138
|
+
command: "delete",
|
|
139
|
+
capabilityId: "business_semantics.personal_context.delete",
|
|
140
|
+
description: "Soft-delete one personal semantic preference using optimistic locking.",
|
|
141
|
+
flags: [
|
|
142
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
143
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
144
|
+
{ name: "expected-revision", type: "number", required: true, desc: "Revision returned by the latest read.", min: 1 },
|
|
145
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
146
|
+
],
|
|
147
|
+
risk: "high-risk-write",
|
|
148
|
+
buildInput: (ctx) => compactInput({
|
|
149
|
+
project_id: ctx.num("project-id"),
|
|
150
|
+
id: ctx.str("id"),
|
|
151
|
+
expected_revision: ctx.num("expected-revision"),
|
|
152
|
+
request_id: optionalString(ctx, "request-id")
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// src/commands/personal-semantic-preference/get.ts
|
|
157
|
+
var personalSemanticPreferenceGet = createPersonalSemanticPreferenceCommand({
|
|
158
|
+
resource: "",
|
|
159
|
+
command: "get",
|
|
160
|
+
capabilityId: "business_semantics.personal_context.get",
|
|
161
|
+
description: "Get one personal semantic preference; use --mark-used only after adopting it.",
|
|
162
|
+
flags: [
|
|
163
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
164
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
165
|
+
{ name: "mark-used", type: "boolean", desc: "Count this preference as adopted and update its usage heat." }
|
|
166
|
+
],
|
|
167
|
+
risk: "read",
|
|
168
|
+
buildInput: (ctx) => ({
|
|
169
|
+
project_id: ctx.num("project-id"),
|
|
170
|
+
id: ctx.str("id"),
|
|
171
|
+
mark_used: ctx.bool("mark-used")
|
|
172
|
+
})
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// src/commands/personal-semantic-preference/list.ts
|
|
176
|
+
var CAPABILITY_ID = "business_semantics.personal_context.list";
|
|
177
|
+
var personalSemanticPreferenceList = createPersonalSemanticPreferenceCommand({
|
|
178
|
+
resource: "",
|
|
179
|
+
command: "list",
|
|
180
|
+
capabilityId: CAPABILITY_ID,
|
|
181
|
+
description: "List the current-user lightweight personal semantic preference catalog in one project.",
|
|
182
|
+
flags: [
|
|
183
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 }
|
|
184
|
+
],
|
|
185
|
+
risk: "read",
|
|
186
|
+
buildInput: (ctx) => ({
|
|
187
|
+
project_id: ctx.num("project-id")
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// src/commands/personal-semantic-preference/update.ts
|
|
192
|
+
var personalSemanticPreferenceUpdate = createPersonalSemanticPreferenceCommand({
|
|
193
|
+
resource: "",
|
|
194
|
+
command: "update",
|
|
195
|
+
capabilityId: "business_semantics.personal_context.update",
|
|
196
|
+
description: "Update one personal semantic preference using optimistic locking.",
|
|
197
|
+
flags: [
|
|
198
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
199
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
200
|
+
{ name: "expected-revision", type: "number", required: true, desc: "Revision returned by the latest read.", min: 1 },
|
|
201
|
+
{ name: "context-type", type: "string", required: true, desc: "preference | asset_context | experience | background." },
|
|
202
|
+
{ name: "title", type: "string", required: true, desc: "Short preference title.", maxLength: 255 },
|
|
203
|
+
{ name: "summary", type: "string", required: true, desc: "Compact preference summary.", maxLength: 1e3 },
|
|
204
|
+
{ name: "content", type: "string", required: true, desc: "Full replacement content.", maxLength: 2e4 },
|
|
205
|
+
{ name: "keywords", type: "json", desc: "Optional JSON array of preference keywords." },
|
|
206
|
+
{ name: "resource-refs", type: "json", desc: "Ordered JSON asset references; required only for asset_context." },
|
|
207
|
+
{ name: "fresh-until-at", type: "string", desc: "Optional freshness expiration timestamp: yyyy-MM-dd HH:mm:ss." },
|
|
208
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
209
|
+
],
|
|
210
|
+
risk: "write",
|
|
211
|
+
validate: validatePersonalSemanticWrite,
|
|
212
|
+
buildInput: (ctx) => compactInput({
|
|
213
|
+
project_id: ctx.num("project-id"),
|
|
214
|
+
id: ctx.str("id"),
|
|
215
|
+
expected_revision: ctx.num("expected-revision"),
|
|
216
|
+
context_type: ctx.str("context-type"),
|
|
217
|
+
title: ctx.str("title"),
|
|
218
|
+
summary: ctx.str("summary"),
|
|
219
|
+
content: ctx.str("content"),
|
|
220
|
+
keywords: optionalKeywords(ctx),
|
|
221
|
+
resource_refs: optionalResourceRefs(ctx),
|
|
222
|
+
fresh_until_at: optionalString(ctx, "fresh-until-at"),
|
|
223
|
+
request_id: optionalString(ctx, "request-id")
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// src/commands/personal-semantic-preference/index.ts
|
|
228
|
+
registerCapabilityGatewayRoute("personal-semantic-preference", { gatewayDomain: "analysis" });
|
|
229
|
+
var commands = [
|
|
230
|
+
personalSemanticPreferenceList,
|
|
231
|
+
personalSemanticPreferenceGet,
|
|
232
|
+
personalSemanticPreferenceAdd,
|
|
233
|
+
personalSemanticPreferenceUpdate,
|
|
234
|
+
personalSemanticPreferenceDelete
|
|
235
|
+
];
|
|
236
|
+
var personal_semantic_preference_default = commands;
|
|
237
|
+
export {
|
|
238
|
+
personal_semantic_preference_default as default
|
|
239
|
+
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCapabilityCommand
|
|
3
|
+
} from "./chunk-Y3LOALAV.js";
|
|
4
|
+
import {
|
|
5
|
+
registerCapabilityGatewayRoute
|
|
6
|
+
} from "./chunk-3KWQYGYI.js";
|
|
7
|
+
import "./chunk-BYYS3ANB.js";
|
|
8
|
+
import "./chunk-ZQ47LWTI.js";
|
|
9
|
+
import "./chunk-SERWF6G5.js";
|
|
10
|
+
import "./chunk-J2DEBMRF.js";
|
|
11
|
+
import "./chunk-ZQKDZXDO.js";
|
|
12
|
+
import "./chunk-3FY3RJ26.js";
|
|
13
|
+
import "./chunk-UW5UN47B.js";
|
|
14
|
+
import "./chunk-JHENBQ5B.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/personal-semantic-preference/shared.ts
|
|
17
|
+
function createPersonalSemanticPreferenceCommand(config) {
|
|
18
|
+
return createCapabilityCommand({
|
|
19
|
+
...config,
|
|
20
|
+
cliService: "personal-semantic-preference",
|
|
21
|
+
gatewayDomain: "analysis"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function optionalString(ctx, name) {
|
|
25
|
+
const value = ctx.str(name);
|
|
26
|
+
return value === "" ? void 0 : value;
|
|
27
|
+
}
|
|
28
|
+
function optionalKeywords(ctx) {
|
|
29
|
+
if (ctx.str("keywords") === "") {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
const value = ctx.json("keywords");
|
|
33
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
34
|
+
throw new Error("--keywords must be a JSON array of strings.");
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function optionalResourceRefs(ctx) {
|
|
39
|
+
if (ctx.str("resource-refs") === "") {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
const value = ctx.json("resource-refs");
|
|
43
|
+
if (!Array.isArray(value)) {
|
|
44
|
+
throw new Error("--resource-refs must be a JSON array.");
|
|
45
|
+
}
|
|
46
|
+
if (value.length > 50) {
|
|
47
|
+
throw new Error("--resource-refs must contain at most 50 items.");
|
|
48
|
+
}
|
|
49
|
+
const identities = /* @__PURE__ */ new Set();
|
|
50
|
+
return value.map((item) => {
|
|
51
|
+
if (item === null || typeof item !== "object" || Array.isArray(item)) {
|
|
52
|
+
throw new Error("--resource-refs items must be objects.");
|
|
53
|
+
}
|
|
54
|
+
const keys = Object.keys(item).sort();
|
|
55
|
+
if (keys.join(",") !== "display_name,resource_key,resource_type") {
|
|
56
|
+
throw new Error("--resource-refs items must contain only resource_type, resource_key, and display_name.");
|
|
57
|
+
}
|
|
58
|
+
const ref = item;
|
|
59
|
+
if (typeof ref.resource_type !== "string" || !/^[a-z][a-z0-9_]{0,63}$/i.test(ref.resource_type.trim())) {
|
|
60
|
+
throw new Error("resource_type must use lower snake_case.");
|
|
61
|
+
}
|
|
62
|
+
if (typeof ref.resource_key !== "string" || ref.resource_key.trim().length === 0 || ref.resource_key.trim().length > 255) {
|
|
63
|
+
throw new Error("resource_key must contain 1 to 255 characters.");
|
|
64
|
+
}
|
|
65
|
+
if (typeof ref.display_name !== "string" || ref.display_name.trim().length === 0 || ref.display_name.trim().length > 255) {
|
|
66
|
+
throw new Error("display_name must contain 1 to 255 characters.");
|
|
67
|
+
}
|
|
68
|
+
const normalized = {
|
|
69
|
+
resource_type: ref.resource_type.trim().toLowerCase(),
|
|
70
|
+
resource_key: ref.resource_key.trim(),
|
|
71
|
+
display_name: ref.display_name.trim()
|
|
72
|
+
};
|
|
73
|
+
const identity = `${normalized.resource_type}\0${normalized.resource_key}`;
|
|
74
|
+
if (identities.has(identity)) {
|
|
75
|
+
throw new Error("--resource-refs must contain unique resource_type and resource_key pairs.");
|
|
76
|
+
}
|
|
77
|
+
identities.add(identity);
|
|
78
|
+
return normalized;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function validateContextType(ctx) {
|
|
82
|
+
const value = ctx.str("context-type");
|
|
83
|
+
const supported = ["preference", "asset_context", "experience", "background"];
|
|
84
|
+
if (!supported.includes(value)) {
|
|
85
|
+
throw new Error(`--context-type must be one of: ${supported.join(", ")}.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function validatePersonalSemanticWrite(ctx) {
|
|
89
|
+
validateContextType(ctx);
|
|
90
|
+
const contextType = ctx.str("context-type");
|
|
91
|
+
const refs = optionalResourceRefs(ctx);
|
|
92
|
+
if (contextType === "asset_context" && (!refs || refs.length === 0)) {
|
|
93
|
+
throw new Error("--resource-refs is required and must be non-empty for --context-type asset_context.");
|
|
94
|
+
}
|
|
95
|
+
if (contextType !== "asset_context" && refs && refs.length > 0) {
|
|
96
|
+
throw new Error("--resource-refs is only allowed with --context-type asset_context.");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function compactInput(input) {
|
|
100
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/commands/personal-semantic-preference/add.ts
|
|
104
|
+
var personalSemanticPreferenceAdd = createPersonalSemanticPreferenceCommand({
|
|
105
|
+
resource: "",
|
|
106
|
+
command: "add",
|
|
107
|
+
capabilityId: "business_semantics.personal_context.add",
|
|
108
|
+
description: "Add one personal semantic preference for the authenticated user.",
|
|
109
|
+
flags: [
|
|
110
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
111
|
+
{ name: "context-type", type: "string", required: true, desc: "preference | asset_context | experience | background." },
|
|
112
|
+
{ name: "title", type: "string", required: true, desc: "Short preference title.", maxLength: 255 },
|
|
113
|
+
{ name: "summary", type: "string", required: true, desc: "Compact preference summary.", maxLength: 1e3 },
|
|
114
|
+
{ name: "content", type: "string", required: true, desc: "Full personal semantic preference content.", maxLength: 2e4 },
|
|
115
|
+
{ name: "keywords", type: "json", desc: "Optional JSON array of preference keywords." },
|
|
116
|
+
{ name: "resource-refs", type: "json", desc: "Ordered JSON asset references; required only for asset_context." },
|
|
117
|
+
{ name: "fresh-until-at", type: "string", desc: "Optional freshness expiration timestamp: yyyy-MM-dd HH:mm:ss." },
|
|
118
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
119
|
+
],
|
|
120
|
+
risk: "write",
|
|
121
|
+
validate: validatePersonalSemanticWrite,
|
|
122
|
+
buildInput: (ctx) => compactInput({
|
|
123
|
+
project_id: ctx.num("project-id"),
|
|
124
|
+
context_type: ctx.str("context-type"),
|
|
125
|
+
title: ctx.str("title"),
|
|
126
|
+
summary: ctx.str("summary"),
|
|
127
|
+
content: ctx.str("content"),
|
|
128
|
+
keywords: optionalKeywords(ctx),
|
|
129
|
+
resource_refs: optionalResourceRefs(ctx),
|
|
130
|
+
fresh_until_at: optionalString(ctx, "fresh-until-at"),
|
|
131
|
+
request_id: optionalString(ctx, "request-id")
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// src/commands/personal-semantic-preference/delete.ts
|
|
136
|
+
var personalSemanticPreferenceDelete = createPersonalSemanticPreferenceCommand({
|
|
137
|
+
resource: "",
|
|
138
|
+
command: "delete",
|
|
139
|
+
capabilityId: "business_semantics.personal_context.delete",
|
|
140
|
+
description: "Soft-delete one personal semantic preference using optimistic locking.",
|
|
141
|
+
flags: [
|
|
142
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
143
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
144
|
+
{ name: "expected-revision", type: "number", required: true, desc: "Revision returned by the latest read.", min: 1 },
|
|
145
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
146
|
+
],
|
|
147
|
+
risk: "high-risk-write",
|
|
148
|
+
buildInput: (ctx) => compactInput({
|
|
149
|
+
project_id: ctx.num("project-id"),
|
|
150
|
+
id: ctx.str("id"),
|
|
151
|
+
expected_revision: ctx.num("expected-revision"),
|
|
152
|
+
request_id: optionalString(ctx, "request-id")
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// src/commands/personal-semantic-preference/get.ts
|
|
157
|
+
var personalSemanticPreferenceGet = createPersonalSemanticPreferenceCommand({
|
|
158
|
+
resource: "",
|
|
159
|
+
command: "get",
|
|
160
|
+
capabilityId: "business_semantics.personal_context.get",
|
|
161
|
+
description: "Get one personal semantic preference; use --mark-used only after adopting it.",
|
|
162
|
+
flags: [
|
|
163
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
164
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
165
|
+
{ name: "mark-used", type: "boolean", desc: "Count this preference as adopted and update its usage heat." }
|
|
166
|
+
],
|
|
167
|
+
risk: "read",
|
|
168
|
+
buildInput: (ctx) => ({
|
|
169
|
+
project_id: ctx.num("project-id"),
|
|
170
|
+
id: ctx.str("id"),
|
|
171
|
+
mark_used: ctx.bool("mark-used")
|
|
172
|
+
})
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// src/commands/personal-semantic-preference/list.ts
|
|
176
|
+
var CAPABILITY_ID = "business_semantics.personal_context.list";
|
|
177
|
+
var personalSemanticPreferenceList = createPersonalSemanticPreferenceCommand({
|
|
178
|
+
resource: "",
|
|
179
|
+
command: "list",
|
|
180
|
+
capabilityId: CAPABILITY_ID,
|
|
181
|
+
description: "List the current-user lightweight personal semantic preference catalog in one project.",
|
|
182
|
+
flags: [
|
|
183
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 }
|
|
184
|
+
],
|
|
185
|
+
risk: "read",
|
|
186
|
+
buildInput: (ctx) => ({
|
|
187
|
+
project_id: ctx.num("project-id")
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// src/commands/personal-semantic-preference/update.ts
|
|
192
|
+
var personalSemanticPreferenceUpdate = createPersonalSemanticPreferenceCommand({
|
|
193
|
+
resource: "",
|
|
194
|
+
command: "update",
|
|
195
|
+
capabilityId: "business_semantics.personal_context.update",
|
|
196
|
+
description: "Update one personal semantic preference using optimistic locking.",
|
|
197
|
+
flags: [
|
|
198
|
+
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p", min: 1 },
|
|
199
|
+
{ name: "id", type: "string", required: true, desc: "Preference ID returned by list/add." },
|
|
200
|
+
{ name: "expected-revision", type: "number", required: true, desc: "Revision returned by the latest read.", min: 1 },
|
|
201
|
+
{ name: "context-type", type: "string", required: true, desc: "preference | asset_context | experience | background." },
|
|
202
|
+
{ name: "title", type: "string", required: true, desc: "Short preference title.", maxLength: 255 },
|
|
203
|
+
{ name: "summary", type: "string", required: true, desc: "Compact preference summary.", maxLength: 1e3 },
|
|
204
|
+
{ name: "content", type: "string", required: true, desc: "Full replacement content.", maxLength: 2e4 },
|
|
205
|
+
{ name: "keywords", type: "json", desc: "Optional JSON array of preference keywords." },
|
|
206
|
+
{ name: "resource-refs", type: "json", desc: "Ordered JSON asset references; required only for asset_context." },
|
|
207
|
+
{ name: "fresh-until-at", type: "string", desc: "Optional freshness expiration timestamp: yyyy-MM-dd HH:mm:ss." },
|
|
208
|
+
{ name: "request-id", type: "string", desc: "Optional idempotency key; generated when omitted.", maxLength: 128 }
|
|
209
|
+
],
|
|
210
|
+
risk: "write",
|
|
211
|
+
validate: validatePersonalSemanticWrite,
|
|
212
|
+
buildInput: (ctx) => compactInput({
|
|
213
|
+
project_id: ctx.num("project-id"),
|
|
214
|
+
id: ctx.str("id"),
|
|
215
|
+
expected_revision: ctx.num("expected-revision"),
|
|
216
|
+
context_type: ctx.str("context-type"),
|
|
217
|
+
title: ctx.str("title"),
|
|
218
|
+
summary: ctx.str("summary"),
|
|
219
|
+
content: ctx.str("content"),
|
|
220
|
+
keywords: optionalKeywords(ctx),
|
|
221
|
+
resource_refs: optionalResourceRefs(ctx),
|
|
222
|
+
fresh_until_at: optionalString(ctx, "fresh-until-at"),
|
|
223
|
+
request_id: optionalString(ctx, "request-id")
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// src/commands/personal-semantic-preference/index.ts
|
|
228
|
+
registerCapabilityGatewayRoute("personal-semantic-preference", { gatewayDomain: "analysis" });
|
|
229
|
+
var commands = [
|
|
230
|
+
personalSemanticPreferenceList,
|
|
231
|
+
personalSemanticPreferenceGet,
|
|
232
|
+
personalSemanticPreferenceAdd,
|
|
233
|
+
personalSemanticPreferenceUpdate,
|
|
234
|
+
personalSemanticPreferenceDelete
|
|
235
|
+
];
|
|
236
|
+
var personal_semantic_preference_default = commands;
|
|
237
|
+
export {
|
|
238
|
+
personal_semantic_preference_default as default
|
|
239
|
+
};
|