@thinkingai/ae-cli 6.1.32 → 6.1.34
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/README.md +8 -5
- package/README.zh.md +10 -9
- package/bin/runtime-capabilities.json +1 -1
- package/cli-installation-guide.md +14 -4
- package/dist/{ai-monitor-MKMHSSNI.js → ai-monitor-TVRFVZBH.js} +11 -9
- package/dist/ai-monitor.js +18 -16
- package/dist/{auth-CZHHPZOQ.js → auth-JAXLMPBB.js} +33 -316
- package/dist/{automation-FLCPFMN4.js → automation-OQ647CSW.js} +7 -7
- package/dist/{capability-64KVJFIA.js → capability-2Z4ZXTPD.js} +19 -16
- package/dist/chunk-2H3SFJE3.js +344 -0
- package/dist/{chunk-TMQGS4TO.js → chunk-3PZNM5KN.js} +3 -3
- package/dist/chunk-3ZQY7SLZ.js +147 -0
- package/dist/chunk-6E6HCTP2.js +60 -0
- package/dist/{local-data-upload-client-KCMG6J62.js → chunk-6IUTXRAD.js} +32 -4
- package/dist/{chunk-5M5LBRR3.js → chunk-CYZV5AXW.js} +18 -9
- package/dist/{chunk-3ULDJJTZ.js → chunk-DE5XHQQ6.js} +2 -2
- package/dist/{chunk-FCAA7I2D.js → chunk-E5CJI7L3.js} +26 -10
- package/dist/{chunk-QVRIDN42.js → chunk-EQMGH32F.js} +2 -2
- package/dist/{chunk-DWBYNGSR.js → chunk-FNACCKQR.js} +372 -194
- package/dist/{chunk-OAWPT7VP.js → chunk-GD5JSAGV.js} +2 -2
- package/dist/{chunk-CF6JTT2U.js → chunk-GYODT7C4.js} +1 -1
- package/dist/chunk-HBI7IQH3.js +1207 -0
- package/dist/{chunk-4PSTYEG5.js → chunk-IGU3R2JD.js} +9 -5
- package/dist/{chunk-IDDWEZ7F.js → chunk-IWMDPHMI.js} +3 -3
- package/dist/{chunk-P7QDCWJ6.js → chunk-L7MT53VM.js} +8 -2
- package/dist/{chunk-F2VFZUGG.js → chunk-LXRALNNA.js} +2 -2
- package/dist/{chunk-6M7ZEDT2.js → chunk-M2OCZRVX.js} +14 -8
- package/dist/{chunk-Z3Q2AEIN.js → chunk-MTK4ZE7W.js} +17 -145
- package/dist/{chunk-T7WF4HYW.js → chunk-NK5PS5X7.js} +3 -3
- package/dist/{chunk-JEUXDY3B.js → chunk-NPH5J65M.js} +1 -1
- package/dist/chunk-PUSFEC6B.js +29 -0
- package/dist/{chunk-BNBCMCYN.js → chunk-Q764EZND.js} +78 -72
- package/dist/chunk-QOJXLXDJ.js +55 -0
- package/dist/{chunk-HVMCPKOZ.js → chunk-QPUPWGZ3.js} +1 -1
- package/dist/{chunk-72NJKS7O.js → chunk-RLPMXKDQ.js} +8921 -10119
- package/dist/{chunk-NLEXY2TM.js → chunk-S74XV3A6.js} +7 -5
- package/dist/{chunk-KTJXD27G.js → chunk-SHB7A2JE.js} +3 -3
- package/dist/{chunk-HTZ2MLYA.js → chunk-UWQXGF44.js} +25 -11
- package/dist/{data-integration-QE37EQ3A.js → chunk-V6UKLIM6.js} +160 -2258
- package/dist/{chunk-4XKTRCRK.js → chunk-VPLRZSMY.js} +22 -13
- package/dist/{chunk-2F64AZYH.js → chunk-Z6WSCIHM.js} +2 -2
- package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-5VNT6HCV.js} +4 -2
- package/dist/{compat-check-ZJNCMNQV.js → compat-check-E7AQ7UCG.js} +6 -4
- package/dist/{config-FSH2NMNZ.js → config-PGSUWIK5.js} +16 -11
- package/dist/{context-YAQG6YQC.js → context-Y2A6QIS3.js} +9 -6
- package/dist/conversion-4FR3RA45.js +16 -0
- package/dist/data-integration-EIF5QHYF.js +2138 -0
- package/dist/{evaluation-2JSF4V47.js → evaluation-OZM54MES.js} +6 -5
- package/dist/index.js +79 -52
- package/dist/local-data-upload-client-2U3LFD7Z.js +16 -0
- package/dist/{memory-VEZZVAAP.js → memory-6QMZS4HF.js} +7 -7
- package/dist/{metadata-3IWHX3V4.js → metadata-7MZ3CJ2N.js} +11 -9
- package/dist/{model-T7H7Q6BG.js → model-LEYRQKOS.js} +8 -8
- package/dist/{personal-semantic-preference-YITU23SA.js → personal-semantic-preference-SWOUNDWJ.js} +46 -14
- package/dist/{project-semantic-MHEXJF3C.js → project-semantic-M2DDPAMD.js} +10 -8
- package/dist/{sync-AQHVCSPI.js → sync-PWC63JCO.js} +17 -16
- package/dist/{te-agent-RXI7WOH4.js → te-agent-S7UH657Z.js} +304 -16
- package/dist/{te-analysis-CZY74HVF.js → te-analysis-BK6PE333.js} +295 -223
- package/dist/{te-community-DKCYUBCM.js → te-community-OLNTKGCW.js} +17 -13
- package/dist/{te-dataops-QEH6VE56.js → te-dataops-XUWRIF5R.js} +18 -14
- package/dist/{te-engage-WK7WKDKF.js → te-engage-I3I4FJOM.js} +10 -8
- package/dist/{te-experiment-LH3RPIOE.js → te-experiment-XSDUL4KH.js} +216 -28
- package/dist/{te-kb-UPORIOVN.js → te-kb-QFH3YLFQ.js} +74 -21
- package/dist/{te-system-AL4B4XZL.js → te-system-DB5Z3LLF.js} +7 -7
- package/dist/{te-team-LLVTO2G4.js → te-team-UADF2HBO.js} +10 -8
- package/dist/{things-XLMLBYQR.js → things-G2QFXDK7.js} +10 -8
- package/dist/{update-7J5UQHSK.js → update-6I366ICW.js} +10 -9
- package/dist/web-runtime-3XFREWRF.js +2367 -0
- package/dist/{workspace-FF2HXJGR.js → workspace-RZESYB6T.js} +7 -7
- package/package.json +9 -5
- package/skills/ae-agent/SKILL.md +19 -5
- package/skills/ae-agent/references/a2a.md +103 -0
- package/skills/ae-agent/references/command_index.md +11 -0
- package/skills/ae-analysis/SKILL.md +35 -23
- package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
- package/skills/ae-analysis/references/bad_case_review.md +4 -4
- package/skills/ae-analysis/references/command_index.md +7 -7
- package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
- package/skills/ae-analysis/references/project_owner_update.md +5 -1
- package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
- package/skills/ae-analysis/references/scenario_list.md +5 -6
- package/skills/ae-capability/SKILL.md +8 -4
- package/skills/ae-data-integration/references/ue-mapping.md +2 -0
- package/skills/ae-experiment/SKILL.md +45 -16
- package/skills/ae-experiment/references/experiment_approval.md +87 -29
- package/skills/ae-experiment/references/manage_experiment.md +7 -3
- package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
- package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
- package/skills/ae-experiment/references/query_experiment_list.md +6 -0
- package/skills/ae-experiment/references/save_experiment.md +39 -13
- package/skills/ae-experiment/references/save_metric.md +29 -2
- package/skills/ae-experiment/references/save_submit_experiment.md +11 -7
- package/skills/ae-experiment/references/save_submit_external_experiment.md +16 -14
- package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
- package/skills/ae-kb/SKILL.md +4 -2
- package/skills/ae-kb/references/publication.md +45 -0
- package/skills/ae-onboarding/SKILL.md +64 -0
- package/skills/ae-onboarding/references/business-sdk.md +8 -0
- package/skills/ae-onboarding/references/demo-operations.md +79 -0
- package/skills/ae-onboarding/references/import.md +19 -0
- package/skills/ae-onboarding/references/onboarding_experiment_launch.md +12 -0
- package/skills/ae-onboarding/references/onboarding_experiment_plan.md +14 -0
- package/skills/ae-onboarding/references/onboarding_growth.md +36 -0
- package/skills/ae-onboarding/references/onboarding_run.md +11 -0
- package/skills/ae-onboarding/references/onboarding_status.md +5 -0
- package/skills/ae-onboarding/scripts/experiment-preset.json +252 -0
- package/skills/ae-onboarding/scripts/experiment-requests.mjs +120 -0
- package/skills/ae-onboarding/scripts/generate.mjs +170 -0
- package/skills/ae-onboarding/scripts/resolve-experiment-preset.mjs +26 -0
- package/skills/ae-onboarding/scripts/web-journey.mjs +39 -0
- package/dist/chunk-6ZIQV5GW.js +0 -26
- package/dist/chunk-Y74WTIKJ.js +0 -10
|
@@ -11,11 +11,6 @@ import {
|
|
|
11
11
|
splitPushableMcps,
|
|
12
12
|
writeSkillManifestEntries
|
|
13
13
|
} from "./chunk-JQ3ENZZH.js";
|
|
14
|
-
import {
|
|
15
|
-
MultiselectCancelled,
|
|
16
|
-
promptMultiselect,
|
|
17
|
-
promptSingleSelect
|
|
18
|
-
} from "./chunk-7K24F7T2.js";
|
|
19
14
|
import {
|
|
20
15
|
assertSkillDocumentSize
|
|
21
16
|
} from "./chunk-T6OSFQZD.js";
|
|
@@ -24,8 +19,16 @@ import {
|
|
|
24
19
|
} from "./chunk-RK6GLDGI.js";
|
|
25
20
|
import {
|
|
26
21
|
require_lib
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-EQMGH32F.js";
|
|
23
|
+
import "./chunk-NPH5J65M.js";
|
|
24
|
+
import {
|
|
25
|
+
MultiselectCancelled,
|
|
26
|
+
promptMultiselect,
|
|
27
|
+
promptSingleSelect
|
|
28
|
+
} from "./chunk-7K24F7T2.js";
|
|
29
|
+
import {
|
|
30
|
+
printError
|
|
31
|
+
} from "./chunk-DE5XHQQ6.js";
|
|
29
32
|
import {
|
|
30
33
|
TeAgentApiError,
|
|
31
34
|
TeAgentCredentialsError,
|
|
@@ -33,17 +36,15 @@ import {
|
|
|
33
36
|
postSandboxSyncPull,
|
|
34
37
|
postToMainApp,
|
|
35
38
|
uploadToMainApp
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-HTZ2MLYA.js";
|
|
43
|
-
import "./chunk-4PSTYEG5.js";
|
|
39
|
+
} from "./chunk-CYZV5AXW.js";
|
|
40
|
+
import "./chunk-FNACCKQR.js";
|
|
41
|
+
import "./chunk-PUSFEC6B.js";
|
|
42
|
+
import "./chunk-UWQXGF44.js";
|
|
43
|
+
import "./chunk-IGU3R2JD.js";
|
|
44
|
+
import "./chunk-MTK4ZE7W.js";
|
|
44
45
|
import {
|
|
45
46
|
__toESM
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-3ZQY7SLZ.js";
|
|
47
48
|
|
|
48
49
|
// src/commands/sync/index.ts
|
|
49
50
|
var import_jszip = __toESM(require_lib(), 1);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
workspaceResourcePath,
|
|
12
12
|
workspaceTargetFlags,
|
|
13
13
|
workspaceTargetPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SHB7A2JE.js";
|
|
15
15
|
import {
|
|
16
16
|
currentAgentSpaceId
|
|
17
17
|
} from "./chunk-RK6GLDGI.js";
|
|
@@ -27,23 +27,299 @@ import {
|
|
|
27
27
|
requestResourcePackageRaw,
|
|
28
28
|
resourcePackagePreflightChange,
|
|
29
29
|
uploadAgentApi
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LXRALNNA.js";
|
|
31
31
|
import {
|
|
32
32
|
TeAgentApiError,
|
|
33
33
|
resolveTeClaudeBaseUrl
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CYZV5AXW.js";
|
|
35
35
|
import {
|
|
36
36
|
buildCapabilityGatewayUrl,
|
|
37
37
|
callCapabilityApi
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-VPLRZSMY.js";
|
|
39
|
+
import "./chunk-6E6HCTP2.js";
|
|
40
|
+
import "./chunk-PUSFEC6B.js";
|
|
41
|
+
import {
|
|
42
|
+
clearCliTokenCache,
|
|
43
|
+
getCliToken
|
|
44
|
+
} from "./chunk-UWQXGF44.js";
|
|
41
45
|
import {
|
|
42
46
|
getConfigDir
|
|
43
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-IGU3R2JD.js";
|
|
48
|
+
import {
|
|
49
|
+
externalCliTokenRequestOptions
|
|
50
|
+
} from "./chunk-MTK4ZE7W.js";
|
|
44
51
|
import {
|
|
45
52
|
CliValidationError
|
|
46
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-3ZQY7SLZ.js";
|
|
54
|
+
|
|
55
|
+
// src/commands/te-agent/a2a.ts
|
|
56
|
+
import { randomUUID } from "crypto";
|
|
57
|
+
|
|
58
|
+
// src/core/a2a-client.ts
|
|
59
|
+
function resolveA2aTarget(host, link2) {
|
|
60
|
+
try {
|
|
61
|
+
const base = new URL(resolveTeClaudeBaseUrl(host));
|
|
62
|
+
const target = new URL(link2);
|
|
63
|
+
const prefix = `${base.pathname.replace(/\/+$/, "")}/api/a2a/agents/`;
|
|
64
|
+
const defaultCard = `${base.pathname.replace(/\/+$/, "")}/.well-known/agent-card.json`;
|
|
65
|
+
if (!["http:", "https:"].includes(base.protocol) || base.username || base.password || base.search || base.hash || target.origin !== base.origin || target.username || target.password || target.search || target.hash || /\s/.test(link2)) throw new Error();
|
|
66
|
+
if (target.pathname === defaultCard) return { card: target.href, rpc: `${base.origin}${prefix}system-default-agent` };
|
|
67
|
+
if (!target.pathname.startsWith(prefix)) throw new Error();
|
|
68
|
+
const suffix = target.pathname.slice(prefix.length).replace(/\/agent-card\.json$/, "");
|
|
69
|
+
const id2 = decodeURIComponent(suffix);
|
|
70
|
+
if (!id2 || id2.length > 191 || /[/\\\s?#\u0000-\u001f]/.test(id2) || id2 === "." || id2 === "..") throw new Error();
|
|
71
|
+
const rpc2 = `${base.origin}${prefix}${encodeURIComponent(id2)}`;
|
|
72
|
+
return { card: `${rpc2}/agent-card.json`, rpc: rpc2 };
|
|
73
|
+
} catch {
|
|
74
|
+
throw new CliValidationError("A2A URL must identify an AE Agent under the selected host application path, without credentials, query, or fragment.", {
|
|
75
|
+
hint: "Select the authorized AE deployment with --host <url>; use its /agent/.well-known/agent-card.json or /agent/api/a2a/agents/<id>/agent-card.json link. Log in to that host first."
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async function requestA2a(host, link2, body, extensions = []) {
|
|
80
|
+
const target = resolveA2aTarget(host, link2);
|
|
81
|
+
const controller = new AbortController();
|
|
82
|
+
const timer = setTimeout(() => controller.abort(), 3e4);
|
|
83
|
+
try {
|
|
84
|
+
const requestOnce = async () => {
|
|
85
|
+
const token = await getCliToken(host, controller.signal);
|
|
86
|
+
try {
|
|
87
|
+
return await fetch(body ? target.rpc : target.card, {
|
|
88
|
+
...externalCliTokenRequestOptions(body ? target.rpc : target.card),
|
|
89
|
+
method: body ? "POST" : "GET",
|
|
90
|
+
headers: { Authorization: `Bearer ${token}`, "A2A-Version": "1.0", Accept: "application/json", ...extensions.length ? { "A2A-Extensions": extensions.join(",") } : {}, ...body ? { "Content-Type": "application/json" } : {} },
|
|
91
|
+
...body ? { body: JSON.stringify(body) } : {},
|
|
92
|
+
redirect: "error",
|
|
93
|
+
signal: controller.signal
|
|
94
|
+
});
|
|
95
|
+
} catch {
|
|
96
|
+
throw new TeAgentApiError("A2A request failed or timed out; redirects are not allowed.", 0, "A2A_NETWORK_ERROR");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
let response = await requestOnce();
|
|
100
|
+
if (response.status === 401) {
|
|
101
|
+
await response.body?.cancel();
|
|
102
|
+
clearCliTokenCache(host);
|
|
103
|
+
response = await requestOnce();
|
|
104
|
+
}
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
const type = response.status === 401 ? "auth" : response.status === 403 ? "permission" : "api";
|
|
107
|
+
throw new TeAgentApiError(
|
|
108
|
+
`A2A request returned HTTP ${response.status}.`,
|
|
109
|
+
response.status,
|
|
110
|
+
"A2A_HTTP_ERROR",
|
|
111
|
+
void 0,
|
|
112
|
+
type,
|
|
113
|
+
response.status === 401 ? "Run ae-cli auth login --host <url> for the selected AE deployment." : void 0
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
let data;
|
|
117
|
+
try {
|
|
118
|
+
data = await response.json();
|
|
119
|
+
} catch {
|
|
120
|
+
throw new TeAgentApiError("A2A response is not valid JSON.", response.status, "A2A_INVALID_RESPONSE");
|
|
121
|
+
}
|
|
122
|
+
if (!body) return data;
|
|
123
|
+
if (data?.jsonrpc !== "2.0" || data.id !== body.id || !!data.error === Object.hasOwn(data, "result")) {
|
|
124
|
+
throw new TeAgentApiError("A2A response is not a matching JSON-RPC response.", response.status, "A2A_INVALID_RESPONSE");
|
|
125
|
+
}
|
|
126
|
+
if (data.error) {
|
|
127
|
+
throw new TeAgentApiError("A2A operation failed.", response.status, String(data.error.code ?? "A2A_RPC_ERROR"));
|
|
128
|
+
}
|
|
129
|
+
return data.result;
|
|
130
|
+
} finally {
|
|
131
|
+
clearTimeout(timer);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/commands/te-agent/a2a.ts
|
|
136
|
+
var evaluationExtension = "https://thinkingdata.cn/a2a/extensions/agent-evaluation/v1";
|
|
137
|
+
var lifecycleExtension = "https://thinkingdata.cn/a2a/extensions/context-lifecycle/v1";
|
|
138
|
+
var urlFlag = { name: "url", type: "string", required: true, desc: "AE A2A Agent Card or JSON-RPC URL on the selected authorized host" };
|
|
139
|
+
function identifier(ctx, name) {
|
|
140
|
+
const value = ctx.str(name);
|
|
141
|
+
if (!value || value !== value.trim() || value.length > 191) {
|
|
142
|
+
throw new CliValidationError(`--${name} must be a non-empty identifier of at most 191 characters`);
|
|
143
|
+
}
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
function validateTarget(ctx) {
|
|
147
|
+
resolveA2aTarget(ctx.host(), ctx.str("url"));
|
|
148
|
+
}
|
|
149
|
+
function rpc(method, params) {
|
|
150
|
+
return { jsonrpc: "2.0", id: randomUUID(), method, params };
|
|
151
|
+
}
|
|
152
|
+
function historyParams(ctx) {
|
|
153
|
+
const historyLength = ctx.optionalNum("history-length");
|
|
154
|
+
if (historyLength !== void 0 && (!Number.isInteger(historyLength) || historyLength < 0)) {
|
|
155
|
+
throw new CliValidationError("--history-length must be a non-negative integer");
|
|
156
|
+
}
|
|
157
|
+
return historyLength === void 0 ? {} : { historyLength };
|
|
158
|
+
}
|
|
159
|
+
var historyFlag = { name: "history-length", type: "number", desc: "Maximum returned history messages; zero omits history (server caps at 100)" };
|
|
160
|
+
function selection(ctx) {
|
|
161
|
+
const result = {};
|
|
162
|
+
for (const [flag2, field] of [["space-id", "agentSpaceId"], ["model", "model"]]) {
|
|
163
|
+
if (ctx.has?.(flag2) || ctx.str(flag2)) result[field] = identifier(ctx, flag2);
|
|
164
|
+
}
|
|
165
|
+
if (result.agentSpaceId && !/^[A-Za-z0-9_-]{1,191}$/.test(result.agentSpaceId)) {
|
|
166
|
+
throw new CliValidationError("--space-id must contain only letters, digits, underscores, or hyphens");
|
|
167
|
+
}
|
|
168
|
+
if (result.model && ctx.str("task-id")) throw new CliValidationError("--model cannot be used when replying with --task-id");
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
function sendBody(ctx) {
|
|
172
|
+
const selected = selection(ctx);
|
|
173
|
+
return rpc("SendMessage", {
|
|
174
|
+
message: {
|
|
175
|
+
messageId: ctx.str("message-id") || randomUUID(),
|
|
176
|
+
role: "ROLE_USER",
|
|
177
|
+
parts: [{ text: ctx.str("message") }],
|
|
178
|
+
...Object.keys(selected).length ? { metadata: { [evaluationExtension]: selected }, extensions: [evaluationExtension] } : {},
|
|
179
|
+
...ctx.str("context-id") ? { contextId: ctx.str("context-id") } : {},
|
|
180
|
+
...ctx.str("task-id") ? { taskId: ctx.str("task-id") } : {}
|
|
181
|
+
},
|
|
182
|
+
configuration: { returnImmediately: true, ...historyParams(ctx) }
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
var a2aCard = {
|
|
186
|
+
service: "agent",
|
|
187
|
+
resource: "a2a",
|
|
188
|
+
command: "+card",
|
|
189
|
+
description: "Read an AE A2A Agent Card using the current CLI authorization",
|
|
190
|
+
flags: [urlFlag],
|
|
191
|
+
risk: "read",
|
|
192
|
+
validate: validateTarget,
|
|
193
|
+
dryRun: (ctx) => ({ method: "GET", url: resolveA2aTarget(ctx.host(), ctx.str("url")).card }),
|
|
194
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"))
|
|
195
|
+
};
|
|
196
|
+
var a2aSend = {
|
|
197
|
+
service: "agent",
|
|
198
|
+
resource: "a2a",
|
|
199
|
+
command: "+send",
|
|
200
|
+
description: "Submit a task to an AE A2A Agent using the current CLI authorization",
|
|
201
|
+
helpText: "Returns immediately. Poll the returned task.id with agent a2a +get. Reuse --message-id when retrying a submission whose outcome is unknown.",
|
|
202
|
+
flags: [
|
|
203
|
+
urlFlag,
|
|
204
|
+
{ name: "message", type: "string", required: true, desc: "Task text for the remote AE Agent" },
|
|
205
|
+
{ name: "message-id", type: "string", desc: "Stable message identifier for safe submission retries; generated when omitted" },
|
|
206
|
+
{ name: "context-id", type: "string", desc: "Existing A2A context identifier for conversation continuation" },
|
|
207
|
+
{ name: "task-id", type: "string", desc: "Existing task identifier when responding to input-required tasks" },
|
|
208
|
+
{ name: "space-id", type: "string", desc: "Authorized Agent workspace ID from the Agent Card spaceSelection.spaces list" },
|
|
209
|
+
{ name: "model", type: "string", desc: "Authorized model ID from the Agent Card modelSelection.models list; cannot override a fixed Agent model" },
|
|
210
|
+
historyFlag
|
|
211
|
+
],
|
|
212
|
+
risk: "write",
|
|
213
|
+
validate: (ctx) => {
|
|
214
|
+
validateTarget(ctx);
|
|
215
|
+
selection(ctx);
|
|
216
|
+
historyParams(ctx);
|
|
217
|
+
if (!ctx.str("message").trim()) throw new CliValidationError("--message must not be blank");
|
|
218
|
+
for (const name of ["message-id", "context-id", "task-id"]) if (ctx.has?.(name) || ctx.str(name)) identifier(ctx, name);
|
|
219
|
+
},
|
|
220
|
+
dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: sendBody(ctx), ...Object.keys(selection(ctx)).length ? { headers: { "A2A-Extensions": evaluationExtension } } : {} }),
|
|
221
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), sendBody(ctx), Object.keys(selection(ctx)).length ? [evaluationExtension] : [])
|
|
222
|
+
};
|
|
223
|
+
var a2aGet = {
|
|
224
|
+
service: "agent",
|
|
225
|
+
resource: "a2a",
|
|
226
|
+
command: "+get",
|
|
227
|
+
description: "Get AE A2A task status, history, and artifacts using the current CLI authorization",
|
|
228
|
+
flags: [urlFlag, historyFlag, { name: "id", type: "string", required: true, desc: "Task ID returned by A2A SendMessage" }],
|
|
229
|
+
risk: "read",
|
|
230
|
+
validate: (ctx) => {
|
|
231
|
+
validateTarget(ctx);
|
|
232
|
+
identifier(ctx, "id");
|
|
233
|
+
historyParams(ctx);
|
|
234
|
+
},
|
|
235
|
+
dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("GetTask", { id: ctx.str("id"), ...historyParams(ctx) }) }),
|
|
236
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("GetTask", { id: ctx.str("id"), ...historyParams(ctx) }))
|
|
237
|
+
};
|
|
238
|
+
var a2aList = {
|
|
239
|
+
service: "agent",
|
|
240
|
+
resource: "a2a",
|
|
241
|
+
command: "list",
|
|
242
|
+
description: "List accessible A2A tasks with optional context, status, and pagination filters",
|
|
243
|
+
flags: [
|
|
244
|
+
urlFlag,
|
|
245
|
+
historyFlag,
|
|
246
|
+
{ name: "context-id", type: "string", desc: "Filter tasks by conversation context ID" },
|
|
247
|
+
{ name: "status", type: "string", desc: "Exact A2A TASK_STATE_* status value" },
|
|
248
|
+
{ name: "page-size", type: "number", desc: "Tasks per page, from 1 to 100" },
|
|
249
|
+
{ name: "page-token", type: "string", desc: "Opaque nextPageToken from the previous matching query" },
|
|
250
|
+
{ name: "status-timestamp-after", type: "string", desc: "Filter by status timestamp after an ISO 8601 datetime with timezone" },
|
|
251
|
+
{ name: "include-artifacts", type: "boolean", desc: "Include task artifacts in list results" }
|
|
252
|
+
],
|
|
253
|
+
risk: "read",
|
|
254
|
+
validate: (ctx) => {
|
|
255
|
+
validateTarget(ctx);
|
|
256
|
+
listParams(ctx);
|
|
257
|
+
},
|
|
258
|
+
dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("ListTasks", listParams(ctx)) }),
|
|
259
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("ListTasks", listParams(ctx)))
|
|
260
|
+
};
|
|
261
|
+
function listParams(ctx) {
|
|
262
|
+
const params = historyParams(ctx);
|
|
263
|
+
if (ctx.has?.("context-id") || ctx.str("context-id")) params.contextId = identifier(ctx, "context-id");
|
|
264
|
+
const status = ctx.str("status");
|
|
265
|
+
if (ctx.has?.("status") || status) {
|
|
266
|
+
if (!/^TASK_STATE_(UNSPECIFIED|SUBMITTED|WORKING|INPUT_REQUIRED|COMPLETED|CANCELED|FAILED|REJECTED|AUTH_REQUIRED)$/.test(status)) {
|
|
267
|
+
throw new CliValidationError("--status must be a valid A2A TASK_STATE_* value");
|
|
268
|
+
}
|
|
269
|
+
params.status = status;
|
|
270
|
+
}
|
|
271
|
+
const pageSize = ctx.optionalNum("page-size");
|
|
272
|
+
if (pageSize !== void 0) {
|
|
273
|
+
if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > 100) throw new CliValidationError("--page-size must be an integer from 1 to 100");
|
|
274
|
+
params.pageSize = pageSize;
|
|
275
|
+
}
|
|
276
|
+
const pageToken = ctx.str("page-token");
|
|
277
|
+
if (ctx.has?.("page-token") || pageToken) {
|
|
278
|
+
if (!pageToken || pageToken.length > 4096) throw new CliValidationError("--page-token must contain 1 to 4096 characters");
|
|
279
|
+
params.pageToken = pageToken;
|
|
280
|
+
}
|
|
281
|
+
const timestamp = ctx.str("status-timestamp-after");
|
|
282
|
+
if (ctx.has?.("status-timestamp-after") || timestamp) {
|
|
283
|
+
if (!/T.*(Z|[+-]\d{2}:\d{2})$/.test(timestamp) || !Number.isFinite(Date.parse(timestamp))) throw new CliValidationError("--status-timestamp-after must be an ISO 8601 datetime with timezone");
|
|
284
|
+
params.statusTimestampAfter = timestamp;
|
|
285
|
+
}
|
|
286
|
+
const artifacts = ctx.optionalBool("include-artifacts");
|
|
287
|
+
if (artifacts !== void 0) params.includeArtifacts = artifacts;
|
|
288
|
+
return params;
|
|
289
|
+
}
|
|
290
|
+
var a2aCancel = {
|
|
291
|
+
service: "agent",
|
|
292
|
+
resource: "a2a",
|
|
293
|
+
command: "cancel",
|
|
294
|
+
description: "Cancel an A2A task",
|
|
295
|
+
flags: [urlFlag, { name: "id", type: "string", required: true, desc: "A2A task ID to cancel" }],
|
|
296
|
+
risk: "high-risk-write",
|
|
297
|
+
validate: (ctx) => {
|
|
298
|
+
validateTarget(ctx);
|
|
299
|
+
identifier(ctx, "id");
|
|
300
|
+
},
|
|
301
|
+
dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("CancelTask", { id: ctx.str("id") }) }),
|
|
302
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("CancelTask", { id: ctx.str("id") }))
|
|
303
|
+
};
|
|
304
|
+
var a2aDeleteContext = {
|
|
305
|
+
service: "agent",
|
|
306
|
+
resource: "a2a",
|
|
307
|
+
command: "delete-context",
|
|
308
|
+
description: "Delete an owned A2A conversation context using the context lifecycle extension",
|
|
309
|
+
flags: [urlFlag, { name: "context-id", type: "string", required: true, desc: "A2A conversation context ID to delete" }],
|
|
310
|
+
risk: "high-risk-write",
|
|
311
|
+
validate: (ctx) => {
|
|
312
|
+
validateTarget(ctx);
|
|
313
|
+
identifier(ctx, "context-id");
|
|
314
|
+
},
|
|
315
|
+
dryRun: (ctx) => ({
|
|
316
|
+
method: "POST",
|
|
317
|
+
url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc,
|
|
318
|
+
headers: { "A2A-Extensions": lifecycleExtension },
|
|
319
|
+
body: rpc("DeleteContext", { contextId: ctx.str("context-id") })
|
|
320
|
+
}),
|
|
321
|
+
execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("DeleteContext", { contextId: ctx.str("context-id") }), [lifecycleExtension])
|
|
322
|
+
};
|
|
47
323
|
|
|
48
324
|
// src/commands/te-agent/notifications.ts
|
|
49
325
|
import { openSync, closeSync, fstatSync, readSync } from "fs";
|
|
@@ -89,7 +365,7 @@ function ids(ctx, key) {
|
|
|
89
365
|
);
|
|
90
366
|
return value;
|
|
91
367
|
}
|
|
92
|
-
function
|
|
368
|
+
function identifier2(ctx) {
|
|
93
369
|
const value = ctx.str("notificationId");
|
|
94
370
|
if (!validId(value))
|
|
95
371
|
throw new CliValidationError(
|
|
@@ -97,7 +373,7 @@ function identifier(ctx) {
|
|
|
97
373
|
);
|
|
98
374
|
return encodeURIComponent(value);
|
|
99
375
|
}
|
|
100
|
-
function
|
|
376
|
+
function sendBody2(ctx) {
|
|
101
377
|
const title = ctx.str("title");
|
|
102
378
|
if (!title.trim() || [...title].length > 200 || invalidUnicode.test(title))
|
|
103
379
|
throw new CliValidationError(
|
|
@@ -308,7 +584,7 @@ var notificationSend = command(
|
|
|
308
584
|
],
|
|
309
585
|
"POST",
|
|
310
586
|
() => "notifications",
|
|
311
|
-
|
|
587
|
+
sendBody2
|
|
312
588
|
);
|
|
313
589
|
var notificationList = command(
|
|
314
590
|
"list",
|
|
@@ -326,7 +602,7 @@ var notificationGet = command(
|
|
|
326
602
|
"Read a notification and its opaque business data",
|
|
327
603
|
[flag("notification-id", "Notification ID", "string", true)],
|
|
328
604
|
"GET",
|
|
329
|
-
(ctx) => `notifications/${
|
|
605
|
+
(ctx) => `notifications/${identifier2(ctx)}`
|
|
330
606
|
);
|
|
331
607
|
var notificationUnreadCount = command(
|
|
332
608
|
"unread-count",
|
|
@@ -4022,11 +4298,11 @@ var retryApprovalEffect = {
|
|
|
4022
4298
|
};
|
|
4023
4299
|
|
|
4024
4300
|
// src/commands/te-agent/resource-packages.ts
|
|
4025
|
-
import { randomUUID as
|
|
4301
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
4026
4302
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4027
4303
|
|
|
4028
4304
|
// src/commands/te-agent/resource-package-transfer.ts
|
|
4029
|
-
import { createHash, randomUUID } from "crypto";
|
|
4305
|
+
import { createHash, randomUUID as randomUUID2 } from "crypto";
|
|
4030
4306
|
import { createReadStream, createWriteStream } from "fs";
|
|
4031
4307
|
import { chmod, link, lstat, mkdir, open, readFile, rename, stat, unlink, writeFile } from "fs/promises";
|
|
4032
4308
|
import path from "path";
|
|
@@ -4138,7 +4414,7 @@ async function uploadPackage(ctx, input) {
|
|
|
4138
4414
|
if (saved?.requestKey && input.requestKey && saved.requestKey !== input.requestKey) {
|
|
4139
4415
|
throw new Error("--request-key differs from the existing upload state; reuse its original key");
|
|
4140
4416
|
}
|
|
4141
|
-
const requestKey = input.requestKey || saved?.requestKey ||
|
|
4417
|
+
const requestKey = input.requestKey || saved?.requestKey || randomUUID2();
|
|
4142
4418
|
const trustedLocalState = Boolean(saved && saved.uploadId === active.id && sameIdentity(saved, before));
|
|
4143
4419
|
const state = {
|
|
4144
4420
|
version: 1,
|
|
@@ -4454,7 +4730,7 @@ var previewResourcePackageExport = {
|
|
|
4454
4730
|
};
|
|
4455
4731
|
function exportBody(ctx) {
|
|
4456
4732
|
return {
|
|
4457
|
-
requestKey: ctx.str("requestKey") ||
|
|
4733
|
+
requestKey: ctx.str("requestKey") || randomUUID3(),
|
|
4458
4734
|
kind: "export",
|
|
4459
4735
|
scope: scope(ctx),
|
|
4460
4736
|
payload: {
|
|
@@ -4669,6 +4945,12 @@ var resourcePackageCommands = [
|
|
|
4669
4945
|
|
|
4670
4946
|
// src/commands/te-agent/index.ts
|
|
4671
4947
|
var commands = [
|
|
4948
|
+
a2aCard,
|
|
4949
|
+
a2aSend,
|
|
4950
|
+
a2aGet,
|
|
4951
|
+
a2aList,
|
|
4952
|
+
a2aCancel,
|
|
4953
|
+
a2aDeleteContext,
|
|
4672
4954
|
...notificationCommands,
|
|
4673
4955
|
// Agent CRUD
|
|
4674
4956
|
listAgents,
|
|
@@ -4772,6 +5054,12 @@ var commands = [
|
|
|
4772
5054
|
];
|
|
4773
5055
|
var te_agent_default = commands;
|
|
4774
5056
|
export {
|
|
5057
|
+
a2aCancel,
|
|
5058
|
+
a2aCard,
|
|
5059
|
+
a2aDeleteContext,
|
|
5060
|
+
a2aGet,
|
|
5061
|
+
a2aList,
|
|
5062
|
+
a2aSend,
|
|
4775
5063
|
cancelResourcePackage,
|
|
4776
5064
|
te_agent_default as default,
|
|
4777
5065
|
downloadResourcePackageCommand,
|