@thinkingai/ae-cli 6.1.32 → 6.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +6 -3
  2. package/README.zh.md +8 -3
  3. package/bin/runtime-capabilities.json +1 -1
  4. package/dist/{ai-monitor-MKMHSSNI.js → ai-monitor-OHTSU6SV.js} +10 -9
  5. package/dist/ai-monitor.js +14 -13
  6. package/dist/{auth-CZHHPZOQ.js → auth-2MOK4OI6.js} +18 -9
  7. package/dist/{automation-FLCPFMN4.js → automation-6L6IAYRK.js} +6 -7
  8. package/dist/{capability-64KVJFIA.js → capability-EMIHQJA3.js} +10 -9
  9. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  10. package/dist/{chunk-4XKTRCRK.js → chunk-4IQYPWCX.js} +9 -8
  11. package/dist/{chunk-T7WF4HYW.js → chunk-7DHSB3FL.js} +3 -3
  12. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  13. package/dist/{chunk-6M7ZEDT2.js → chunk-BQFLABJQ.js} +11 -7
  14. package/dist/{chunk-KTJXD27G.js → chunk-COOMXFUG.js} +3 -3
  15. package/dist/{chunk-NLEXY2TM.js → chunk-DWAG2QJM.js} +7 -5
  16. package/dist/{chunk-DWBYNGSR.js → chunk-E3ONSFUN.js} +165 -186
  17. package/dist/{chunk-CF6JTT2U.js → chunk-EFGUBGA6.js} +1 -1
  18. package/dist/{chunk-BNBCMCYN.js → chunk-EWVEAERM.js} +11 -11
  19. package/dist/{chunk-F2VFZUGG.js → chunk-HIMOBNEY.js} +2 -2
  20. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  21. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  22. package/dist/{chunk-FCAA7I2D.js → chunk-KD5UC33N.js} +23 -9
  23. package/dist/{chunk-P7QDCWJ6.js → chunk-LFJ7N36I.js} +5 -1
  24. package/dist/chunk-NNK3JBH4.js +60 -0
  25. package/dist/{chunk-3ULDJJTZ.js → chunk-O45NOIWR.js} +2 -2
  26. package/dist/{chunk-HTZ2MLYA.js → chunk-PLNS5J33.js} +11 -5
  27. package/dist/chunk-PUSFEC6B.js +29 -0
  28. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  29. package/dist/{chunk-TMQGS4TO.js → chunk-RC3PPCYD.js} +3 -3
  30. package/dist/{chunk-HVMCPKOZ.js → chunk-THTROEGD.js} +1 -1
  31. package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
  32. package/dist/{chunk-5M5LBRR3.js → chunk-VLOGOM7N.js} +13 -7
  33. package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
  34. package/dist/{chunk-IDDWEZ7F.js → chunk-YE6MJB5V.js} +3 -3
  35. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  36. package/dist/{compat-check-ZJNCMNQV.js → compat-check-CADG7GND.js} +5 -4
  37. package/dist/{config-FSH2NMNZ.js → config-PFD3KWQG.js} +7 -6
  38. package/dist/{context-YAQG6YQC.js → context-SOQDFZIB.js} +8 -6
  39. package/dist/{data-integration-QE37EQ3A.js → data-integration-UNJ7EPW2.js} +6 -6
  40. package/dist/{evaluation-2JSF4V47.js → evaluation-Q3AIGFOG.js} +5 -5
  41. package/dist/index.js +47 -43
  42. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  43. package/dist/{memory-VEZZVAAP.js → memory-HKNGUIPK.js} +6 -7
  44. package/dist/{metadata-3IWHX3V4.js → metadata-GFWR5ZHC.js} +10 -9
  45. package/dist/{model-T7H7Q6BG.js → model-NAKQWK4W.js} +4 -5
  46. package/dist/{personal-semantic-preference-YITU23SA.js → personal-semantic-preference-JCTKXLC3.js} +45 -14
  47. package/dist/{project-semantic-MHEXJF3C.js → project-semantic-B2NWQOKK.js} +9 -8
  48. package/dist/{sync-AQHVCSPI.js → sync-UQH4J4BD.js} +9 -9
  49. package/dist/{te-agent-RXI7WOH4.js → te-agent-L6EYFQCC.js} +303 -17
  50. package/dist/{te-analysis-CZY74HVF.js → te-analysis-U7NNOY66.js} +25 -20
  51. package/dist/{te-community-DKCYUBCM.js → te-community-3UQEW3KD.js} +13 -11
  52. package/dist/{te-dataops-QEH6VE56.js → te-dataops-SUNYXF5G.js} +13 -11
  53. package/dist/{te-engage-WK7WKDKF.js → te-engage-KMXZJ2KN.js} +9 -8
  54. package/dist/{te-experiment-LH3RPIOE.js → te-experiment-IEYKP6VC.js} +215 -28
  55. package/dist/{te-kb-UPORIOVN.js → te-kb-MT3V5ZMH.js} +68 -17
  56. package/dist/{te-system-AL4B4XZL.js → te-system-F4ZU2HRQ.js} +6 -7
  57. package/dist/{te-team-LLVTO2G4.js → te-team-M6E6XQ5H.js} +9 -8
  58. package/dist/{things-XLMLBYQR.js → things-FRLBZV2Z.js} +9 -8
  59. package/dist/{update-7J5UQHSK.js → update-NULYHVE6.js} +8 -6
  60. package/dist/{workspace-FF2HXJGR.js → workspace-Z7L33OBQ.js} +6 -7
  61. package/package.json +6 -3
  62. package/skills/ae-agent/SKILL.md +19 -5
  63. package/skills/ae-agent/references/a2a.md +103 -0
  64. package/skills/ae-agent/references/command_index.md +11 -0
  65. package/skills/ae-analysis/SKILL.md +35 -23
  66. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  67. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  68. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  69. package/skills/ae-analysis/references/bad_case_review.md +4 -4
  70. package/skills/ae-analysis/references/command_index.md +7 -7
  71. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  77. package/skills/ae-analysis/references/project_owner_update.md +5 -1
  78. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  79. package/skills/ae-analysis/references/scenario_list.md +5 -6
  80. package/skills/ae-capability/SKILL.md +8 -4
  81. package/skills/ae-experiment/SKILL.md +45 -16
  82. package/skills/ae-experiment/references/experiment_approval.md +87 -29
  83. package/skills/ae-experiment/references/manage_experiment.md +7 -3
  84. package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
  85. package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
  86. package/skills/ae-experiment/references/query_experiment_list.md +6 -0
  87. package/skills/ae-experiment/references/save_experiment.md +39 -13
  88. package/skills/ae-experiment/references/save_metric.md +29 -2
  89. package/skills/ae-experiment/references/save_submit_experiment.md +11 -7
  90. package/skills/ae-experiment/references/save_submit_external_experiment.md +16 -14
  91. package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
  92. package/skills/ae-kb/SKILL.md +4 -2
  93. package/skills/ae-kb/references/publication.md +45 -0
  94. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -11,7 +11,7 @@ import {
11
11
  workspaceResourcePath,
12
12
  workspaceTargetFlags,
13
13
  workspaceTargetPath
14
- } from "./chunk-KTJXD27G.js";
14
+ } from "./chunk-COOMXFUG.js";
15
15
  import {
16
16
  currentAgentSpaceId
17
17
  } from "./chunk-RK6GLDGI.js";
@@ -27,23 +27,297 @@ import {
27
27
  requestResourcePackageRaw,
28
28
  resourcePackagePreflightChange,
29
29
  uploadAgentApi
30
- } from "./chunk-F2VFZUGG.js";
30
+ } from "./chunk-HIMOBNEY.js";
31
31
  import {
32
32
  TeAgentApiError,
33
33
  resolveTeClaudeBaseUrl
34
- } from "./chunk-5M5LBRR3.js";
34
+ } from "./chunk-VLOGOM7N.js";
35
35
  import {
36
36
  buildCapabilityGatewayUrl,
37
37
  callCapabilityApi
38
- } from "./chunk-4XKTRCRK.js";
39
- import "./chunk-Y74WTIKJ.js";
40
- import "./chunk-HTZ2MLYA.js";
38
+ } from "./chunk-4IQYPWCX.js";
39
+ import "./chunk-NNK3JBH4.js";
40
+ import "./chunk-PUSFEC6B.js";
41
+ import {
42
+ clearCliTokenCache,
43
+ getCliToken
44
+ } from "./chunk-PLNS5J33.js";
41
45
  import {
42
46
  getConfigDir
43
- } from "./chunk-4PSTYEG5.js";
47
+ } from "./chunk-AMURHMS3.js";
44
48
  import {
45
- CliValidationError
46
- } from "./chunk-Z3Q2AEIN.js";
49
+ CliValidationError,
50
+ externalCliTokenRequestOptions
51
+ } from "./chunk-R2SVAO4G.js";
52
+
53
+ // src/commands/te-agent/a2a.ts
54
+ import { randomUUID } from "crypto";
55
+
56
+ // src/core/a2a-client.ts
57
+ function resolveA2aTarget(host, link2) {
58
+ try {
59
+ const base = new URL(resolveTeClaudeBaseUrl(host));
60
+ const target = new URL(link2);
61
+ const prefix = `${base.pathname.replace(/\/+$/, "")}/api/a2a/agents/`;
62
+ const defaultCard = `${base.pathname.replace(/\/+$/, "")}/.well-known/agent-card.json`;
63
+ 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();
64
+ if (target.pathname === defaultCard) return { card: target.href, rpc: `${base.origin}${prefix}system-default-agent` };
65
+ if (!target.pathname.startsWith(prefix)) throw new Error();
66
+ const suffix = target.pathname.slice(prefix.length).replace(/\/agent-card\.json$/, "");
67
+ const id2 = decodeURIComponent(suffix);
68
+ if (!id2 || id2.length > 191 || /[/\\\s?#\u0000-\u001f]/.test(id2) || id2 === "." || id2 === "..") throw new Error();
69
+ const rpc2 = `${base.origin}${prefix}${encodeURIComponent(id2)}`;
70
+ return { card: `${rpc2}/agent-card.json`, rpc: rpc2 };
71
+ } catch {
72
+ throw new CliValidationError("A2A URL must identify an AE Agent under the selected host application path, without credentials, query, or fragment.", {
73
+ 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."
74
+ });
75
+ }
76
+ }
77
+ async function requestA2a(host, link2, body, extensions = []) {
78
+ const target = resolveA2aTarget(host, link2);
79
+ const controller = new AbortController();
80
+ const timer = setTimeout(() => controller.abort(), 3e4);
81
+ try {
82
+ const requestOnce = async () => {
83
+ const token = await getCliToken(host, controller.signal);
84
+ try {
85
+ return await fetch(body ? target.rpc : target.card, {
86
+ ...externalCliTokenRequestOptions(body ? target.rpc : target.card),
87
+ method: body ? "POST" : "GET",
88
+ headers: { Authorization: `Bearer ${token}`, "A2A-Version": "1.0", Accept: "application/json", ...extensions.length ? { "A2A-Extensions": extensions.join(",") } : {}, ...body ? { "Content-Type": "application/json" } : {} },
89
+ ...body ? { body: JSON.stringify(body) } : {},
90
+ redirect: "error",
91
+ signal: controller.signal
92
+ });
93
+ } catch {
94
+ throw new TeAgentApiError("A2A request failed or timed out; redirects are not allowed.", 0, "A2A_NETWORK_ERROR");
95
+ }
96
+ };
97
+ let response = await requestOnce();
98
+ if (response.status === 401) {
99
+ await response.body?.cancel();
100
+ clearCliTokenCache(host);
101
+ response = await requestOnce();
102
+ }
103
+ if (!response.ok) {
104
+ const type = response.status === 401 ? "auth" : response.status === 403 ? "permission" : "api";
105
+ throw new TeAgentApiError(
106
+ `A2A request returned HTTP ${response.status}.`,
107
+ response.status,
108
+ "A2A_HTTP_ERROR",
109
+ void 0,
110
+ type,
111
+ response.status === 401 ? "Run ae-cli auth login --host <url> for the selected AE deployment." : void 0
112
+ );
113
+ }
114
+ let data;
115
+ try {
116
+ data = await response.json();
117
+ } catch {
118
+ throw new TeAgentApiError("A2A response is not valid JSON.", response.status, "A2A_INVALID_RESPONSE");
119
+ }
120
+ if (!body) return data;
121
+ if (data?.jsonrpc !== "2.0" || data.id !== body.id || !!data.error === Object.hasOwn(data, "result")) {
122
+ throw new TeAgentApiError("A2A response is not a matching JSON-RPC response.", response.status, "A2A_INVALID_RESPONSE");
123
+ }
124
+ if (data.error) {
125
+ throw new TeAgentApiError("A2A operation failed.", response.status, String(data.error.code ?? "A2A_RPC_ERROR"));
126
+ }
127
+ return data.result;
128
+ } finally {
129
+ clearTimeout(timer);
130
+ }
131
+ }
132
+
133
+ // src/commands/te-agent/a2a.ts
134
+ var evaluationExtension = "https://thinkingdata.cn/a2a/extensions/agent-evaluation/v1";
135
+ var lifecycleExtension = "https://thinkingdata.cn/a2a/extensions/context-lifecycle/v1";
136
+ var urlFlag = { name: "url", type: "string", required: true, desc: "AE A2A Agent Card or JSON-RPC URL on the selected authorized host" };
137
+ function identifier(ctx, name) {
138
+ const value = ctx.str(name);
139
+ if (!value || value !== value.trim() || value.length > 191) {
140
+ throw new CliValidationError(`--${name} must be a non-empty identifier of at most 191 characters`);
141
+ }
142
+ return value;
143
+ }
144
+ function validateTarget(ctx) {
145
+ resolveA2aTarget(ctx.host(), ctx.str("url"));
146
+ }
147
+ function rpc(method, params) {
148
+ return { jsonrpc: "2.0", id: randomUUID(), method, params };
149
+ }
150
+ function historyParams(ctx) {
151
+ const historyLength = ctx.optionalNum("history-length");
152
+ if (historyLength !== void 0 && (!Number.isInteger(historyLength) || historyLength < 0)) {
153
+ throw new CliValidationError("--history-length must be a non-negative integer");
154
+ }
155
+ return historyLength === void 0 ? {} : { historyLength };
156
+ }
157
+ var historyFlag = { name: "history-length", type: "number", desc: "Maximum returned history messages; zero omits history (server caps at 100)" };
158
+ function selection(ctx) {
159
+ const result = {};
160
+ for (const [flag2, field] of [["space-id", "agentSpaceId"], ["model", "model"]]) {
161
+ if (ctx.has?.(flag2) || ctx.str(flag2)) result[field] = identifier(ctx, flag2);
162
+ }
163
+ if (result.agentSpaceId && !/^[A-Za-z0-9_-]{1,191}$/.test(result.agentSpaceId)) {
164
+ throw new CliValidationError("--space-id must contain only letters, digits, underscores, or hyphens");
165
+ }
166
+ if (result.model && ctx.str("task-id")) throw new CliValidationError("--model cannot be used when replying with --task-id");
167
+ return result;
168
+ }
169
+ function sendBody(ctx) {
170
+ const selected = selection(ctx);
171
+ return rpc("SendMessage", {
172
+ message: {
173
+ messageId: ctx.str("message-id") || randomUUID(),
174
+ role: "ROLE_USER",
175
+ parts: [{ text: ctx.str("message") }],
176
+ ...Object.keys(selected).length ? { metadata: { [evaluationExtension]: selected }, extensions: [evaluationExtension] } : {},
177
+ ...ctx.str("context-id") ? { contextId: ctx.str("context-id") } : {},
178
+ ...ctx.str("task-id") ? { taskId: ctx.str("task-id") } : {}
179
+ },
180
+ configuration: { returnImmediately: true, ...historyParams(ctx) }
181
+ });
182
+ }
183
+ var a2aCard = {
184
+ service: "agent",
185
+ resource: "a2a",
186
+ command: "+card",
187
+ description: "Read an AE A2A Agent Card using the current CLI authorization",
188
+ flags: [urlFlag],
189
+ risk: "read",
190
+ validate: validateTarget,
191
+ dryRun: (ctx) => ({ method: "GET", url: resolveA2aTarget(ctx.host(), ctx.str("url")).card }),
192
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"))
193
+ };
194
+ var a2aSend = {
195
+ service: "agent",
196
+ resource: "a2a",
197
+ command: "+send",
198
+ description: "Submit a task to an AE A2A Agent using the current CLI authorization",
199
+ helpText: "Returns immediately. Poll the returned task.id with agent a2a +get. Reuse --message-id when retrying a submission whose outcome is unknown.",
200
+ flags: [
201
+ urlFlag,
202
+ { name: "message", type: "string", required: true, desc: "Task text for the remote AE Agent" },
203
+ { name: "message-id", type: "string", desc: "Stable message identifier for safe submission retries; generated when omitted" },
204
+ { name: "context-id", type: "string", desc: "Existing A2A context identifier for conversation continuation" },
205
+ { name: "task-id", type: "string", desc: "Existing task identifier when responding to input-required tasks" },
206
+ { name: "space-id", type: "string", desc: "Authorized Agent workspace ID from the Agent Card spaceSelection.spaces list" },
207
+ { name: "model", type: "string", desc: "Authorized model ID from the Agent Card modelSelection.models list; cannot override a fixed Agent model" },
208
+ historyFlag
209
+ ],
210
+ risk: "write",
211
+ validate: (ctx) => {
212
+ validateTarget(ctx);
213
+ selection(ctx);
214
+ historyParams(ctx);
215
+ if (!ctx.str("message").trim()) throw new CliValidationError("--message must not be blank");
216
+ for (const name of ["message-id", "context-id", "task-id"]) if (ctx.has?.(name) || ctx.str(name)) identifier(ctx, name);
217
+ },
218
+ dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: sendBody(ctx), ...Object.keys(selection(ctx)).length ? { headers: { "A2A-Extensions": evaluationExtension } } : {} }),
219
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), sendBody(ctx), Object.keys(selection(ctx)).length ? [evaluationExtension] : [])
220
+ };
221
+ var a2aGet = {
222
+ service: "agent",
223
+ resource: "a2a",
224
+ command: "+get",
225
+ description: "Get AE A2A task status, history, and artifacts using the current CLI authorization",
226
+ flags: [urlFlag, historyFlag, { name: "id", type: "string", required: true, desc: "Task ID returned by A2A SendMessage" }],
227
+ risk: "read",
228
+ validate: (ctx) => {
229
+ validateTarget(ctx);
230
+ identifier(ctx, "id");
231
+ historyParams(ctx);
232
+ },
233
+ dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("GetTask", { id: ctx.str("id"), ...historyParams(ctx) }) }),
234
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("GetTask", { id: ctx.str("id"), ...historyParams(ctx) }))
235
+ };
236
+ var a2aList = {
237
+ service: "agent",
238
+ resource: "a2a",
239
+ command: "list",
240
+ description: "List accessible A2A tasks with optional context, status, and pagination filters",
241
+ flags: [
242
+ urlFlag,
243
+ historyFlag,
244
+ { name: "context-id", type: "string", desc: "Filter tasks by conversation context ID" },
245
+ { name: "status", type: "string", desc: "Exact A2A TASK_STATE_* status value" },
246
+ { name: "page-size", type: "number", desc: "Tasks per page, from 1 to 100" },
247
+ { name: "page-token", type: "string", desc: "Opaque nextPageToken from the previous matching query" },
248
+ { name: "status-timestamp-after", type: "string", desc: "Filter by status timestamp after an ISO 8601 datetime with timezone" },
249
+ { name: "include-artifacts", type: "boolean", desc: "Include task artifacts in list results" }
250
+ ],
251
+ risk: "read",
252
+ validate: (ctx) => {
253
+ validateTarget(ctx);
254
+ listParams(ctx);
255
+ },
256
+ dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("ListTasks", listParams(ctx)) }),
257
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("ListTasks", listParams(ctx)))
258
+ };
259
+ function listParams(ctx) {
260
+ const params = historyParams(ctx);
261
+ if (ctx.has?.("context-id") || ctx.str("context-id")) params.contextId = identifier(ctx, "context-id");
262
+ const status = ctx.str("status");
263
+ if (ctx.has?.("status") || status) {
264
+ if (!/^TASK_STATE_(UNSPECIFIED|SUBMITTED|WORKING|INPUT_REQUIRED|COMPLETED|CANCELED|FAILED|REJECTED|AUTH_REQUIRED)$/.test(status)) {
265
+ throw new CliValidationError("--status must be a valid A2A TASK_STATE_* value");
266
+ }
267
+ params.status = status;
268
+ }
269
+ const pageSize = ctx.optionalNum("page-size");
270
+ if (pageSize !== void 0) {
271
+ if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > 100) throw new CliValidationError("--page-size must be an integer from 1 to 100");
272
+ params.pageSize = pageSize;
273
+ }
274
+ const pageToken = ctx.str("page-token");
275
+ if (ctx.has?.("page-token") || pageToken) {
276
+ if (!pageToken || pageToken.length > 4096) throw new CliValidationError("--page-token must contain 1 to 4096 characters");
277
+ params.pageToken = pageToken;
278
+ }
279
+ const timestamp = ctx.str("status-timestamp-after");
280
+ if (ctx.has?.("status-timestamp-after") || timestamp) {
281
+ 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");
282
+ params.statusTimestampAfter = timestamp;
283
+ }
284
+ const artifacts = ctx.optionalBool("include-artifacts");
285
+ if (artifacts !== void 0) params.includeArtifacts = artifacts;
286
+ return params;
287
+ }
288
+ var a2aCancel = {
289
+ service: "agent",
290
+ resource: "a2a",
291
+ command: "cancel",
292
+ description: "Cancel an A2A task",
293
+ flags: [urlFlag, { name: "id", type: "string", required: true, desc: "A2A task ID to cancel" }],
294
+ risk: "high-risk-write",
295
+ validate: (ctx) => {
296
+ validateTarget(ctx);
297
+ identifier(ctx, "id");
298
+ },
299
+ dryRun: (ctx) => ({ method: "POST", url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc, body: rpc("CancelTask", { id: ctx.str("id") }) }),
300
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("CancelTask", { id: ctx.str("id") }))
301
+ };
302
+ var a2aDeleteContext = {
303
+ service: "agent",
304
+ resource: "a2a",
305
+ command: "delete-context",
306
+ description: "Delete an owned A2A conversation context using the context lifecycle extension",
307
+ flags: [urlFlag, { name: "context-id", type: "string", required: true, desc: "A2A conversation context ID to delete" }],
308
+ risk: "high-risk-write",
309
+ validate: (ctx) => {
310
+ validateTarget(ctx);
311
+ identifier(ctx, "context-id");
312
+ },
313
+ dryRun: (ctx) => ({
314
+ method: "POST",
315
+ url: resolveA2aTarget(ctx.host(), ctx.str("url")).rpc,
316
+ headers: { "A2A-Extensions": lifecycleExtension },
317
+ body: rpc("DeleteContext", { contextId: ctx.str("context-id") })
318
+ }),
319
+ execute: (ctx) => requestA2a(ctx.host(), ctx.str("url"), rpc("DeleteContext", { contextId: ctx.str("context-id") }), [lifecycleExtension])
320
+ };
47
321
 
48
322
  // src/commands/te-agent/notifications.ts
49
323
  import { openSync, closeSync, fstatSync, readSync } from "fs";
@@ -89,7 +363,7 @@ function ids(ctx, key) {
89
363
  );
90
364
  return value;
91
365
  }
92
- function identifier(ctx) {
366
+ function identifier2(ctx) {
93
367
  const value = ctx.str("notificationId");
94
368
  if (!validId(value))
95
369
  throw new CliValidationError(
@@ -97,7 +371,7 @@ function identifier(ctx) {
97
371
  );
98
372
  return encodeURIComponent(value);
99
373
  }
100
- function sendBody(ctx) {
374
+ function sendBody2(ctx) {
101
375
  const title = ctx.str("title");
102
376
  if (!title.trim() || [...title].length > 200 || invalidUnicode.test(title))
103
377
  throw new CliValidationError(
@@ -308,7 +582,7 @@ var notificationSend = command(
308
582
  ],
309
583
  "POST",
310
584
  () => "notifications",
311
- sendBody
585
+ sendBody2
312
586
  );
313
587
  var notificationList = command(
314
588
  "list",
@@ -326,7 +600,7 @@ var notificationGet = command(
326
600
  "Read a notification and its opaque business data",
327
601
  [flag("notification-id", "Notification ID", "string", true)],
328
602
  "GET",
329
- (ctx) => `notifications/${identifier(ctx)}`
603
+ (ctx) => `notifications/${identifier2(ctx)}`
330
604
  );
331
605
  var notificationUnreadCount = command(
332
606
  "unread-count",
@@ -4022,11 +4296,11 @@ var retryApprovalEffect = {
4022
4296
  };
4023
4297
 
4024
4298
  // src/commands/te-agent/resource-packages.ts
4025
- import { randomUUID as randomUUID2 } from "crypto";
4299
+ import { randomUUID as randomUUID3 } from "crypto";
4026
4300
  import { readFileSync as readFileSync3 } from "fs";
4027
4301
 
4028
4302
  // src/commands/te-agent/resource-package-transfer.ts
4029
- import { createHash, randomUUID } from "crypto";
4303
+ import { createHash, randomUUID as randomUUID2 } from "crypto";
4030
4304
  import { createReadStream, createWriteStream } from "fs";
4031
4305
  import { chmod, link, lstat, mkdir, open, readFile, rename, stat, unlink, writeFile } from "fs/promises";
4032
4306
  import path from "path";
@@ -4138,7 +4412,7 @@ async function uploadPackage(ctx, input) {
4138
4412
  if (saved?.requestKey && input.requestKey && saved.requestKey !== input.requestKey) {
4139
4413
  throw new Error("--request-key differs from the existing upload state; reuse its original key");
4140
4414
  }
4141
- const requestKey = input.requestKey || saved?.requestKey || randomUUID();
4415
+ const requestKey = input.requestKey || saved?.requestKey || randomUUID2();
4142
4416
  const trustedLocalState = Boolean(saved && saved.uploadId === active.id && sameIdentity(saved, before));
4143
4417
  const state = {
4144
4418
  version: 1,
@@ -4454,7 +4728,7 @@ var previewResourcePackageExport = {
4454
4728
  };
4455
4729
  function exportBody(ctx) {
4456
4730
  return {
4457
- requestKey: ctx.str("requestKey") || randomUUID2(),
4731
+ requestKey: ctx.str("requestKey") || randomUUID3(),
4458
4732
  kind: "export",
4459
4733
  scope: scope(ctx),
4460
4734
  payload: {
@@ -4669,6 +4943,12 @@ var resourcePackageCommands = [
4669
4943
 
4670
4944
  // src/commands/te-agent/index.ts
4671
4945
  var commands = [
4946
+ a2aCard,
4947
+ a2aSend,
4948
+ a2aGet,
4949
+ a2aList,
4950
+ a2aCancel,
4951
+ a2aDeleteContext,
4672
4952
  ...notificationCommands,
4673
4953
  // Agent CRUD
4674
4954
  listAgents,
@@ -4772,6 +5052,12 @@ var commands = [
4772
5052
  ];
4773
5053
  var te_agent_default = commands;
4774
5054
  export {
5055
+ a2aCancel,
5056
+ a2aCard,
5057
+ a2aDeleteContext,
5058
+ a2aGet,
5059
+ a2aList,
5060
+ a2aSend,
4775
5061
  cancelResourcePackage,
4776
5062
  te_agent_default as default,
4777
5063
  downloadResourcePackageCommand,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  evalApi
4
- } from "./chunk-6M7ZEDT2.js";
4
+ } from "./chunk-BQFLABJQ.js";
5
5
  import {
6
6
  assertOutputPathAvailable,
7
7
  clientWaitTimeoutSeconds,
@@ -10,15 +10,15 @@ import {
10
10
  waitForAnalysisRun,
11
11
  withAsyncArtifactLifecycle,
12
12
  withInterruptSignal
13
- } from "./chunk-T7WF4HYW.js";
13
+ } from "./chunk-7DHSB3FL.js";
14
14
  import {
15
15
  EvalApiError
16
- } from "./chunk-P7QDCWJ6.js";
16
+ } from "./chunk-LFJ7N36I.js";
17
17
  import {
18
18
  createCapabilityCommand,
19
19
  definitionIntentSnapshotFlag,
20
20
  modelDefinitionIntentSnapshotFlag
21
- } from "./chunk-TMQGS4TO.js";
21
+ } from "./chunk-RC3PPCYD.js";
22
22
  import {
23
23
  registerCapabilityGatewayRoute,
24
24
  resolveGatewayDomain
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  unwrapOutputData,
28
28
  withOutputMetadata
29
- } from "./chunk-3ULDJJTZ.js";
29
+ } from "./chunk-O45NOIWR.js";
30
30
  import {
31
31
  CapabilityGatewayError,
32
32
  buildCapabilityGatewayUrl,
@@ -40,16 +40,17 @@ import {
40
40
  uploadInputFile,
41
41
  validateCapability,
42
42
  validateCapabilityWithEnvelope
43
- } from "./chunk-4XKTRCRK.js";
44
- import "./chunk-Y74WTIKJ.js";
45
- import "./chunk-DWBYNGSR.js";
43
+ } from "./chunk-4IQYPWCX.js";
44
+ import "./chunk-NNK3JBH4.js";
45
+ import "./chunk-E3ONSFUN.js";
46
+ import "./chunk-PUSFEC6B.js";
46
47
  import {
47
48
  getCliToken
48
- } from "./chunk-HTZ2MLYA.js";
49
- import "./chunk-4PSTYEG5.js";
49
+ } from "./chunk-PLNS5J33.js";
50
+ import "./chunk-AMURHMS3.js";
50
51
  import {
51
52
  CliValidationError
52
- } from "./chunk-Z3Q2AEIN.js";
53
+ } from "./chunk-R2SVAO4G.js";
53
54
 
54
55
  // src/commands/te-analysis/capability-shared.ts
55
56
  var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
@@ -4133,7 +4134,7 @@ var expectedSnapshotHashFlag = {
4133
4134
  name: "expected-snapshot-hash",
4134
4135
  type: "string",
4135
4136
  required: false,
4136
- desc: "Optional snapshot_hash from the export sidecar. A mismatch rejects the whole update."
4137
+ desc: "Deprecated compatibility no-op. Project snapshots are not checked; only specified assets are updated."
4137
4138
  };
4138
4139
  var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabilityCommand({
4139
4140
  resource: "asset-authentication",
@@ -4151,13 +4152,17 @@ var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabi
4151
4152
  requestIdFlag
4152
4153
  ],
4153
4154
  risk: "write",
4154
- buildInput: (ctx) => compactInput({
4155
- project_id: ctx.num("project-id"),
4156
- authentication_status: ctx.num("authentication-status"),
4157
- asset_refs: assetRefsInput(ctx),
4158
- expected_snapshot_hash: optionalString(ctx, "expected-snapshot-hash"),
4159
- request_id: optionalString(ctx, "request-id")
4160
- })
4155
+ buildInput: (ctx) => {
4156
+ if (optionalString(ctx, "expected-snapshot-hash") !== void 0) {
4157
+ process.stderr.write("Warning: --expected-snapshot-hash is deprecated and ignored. Only the specified assets are updated; project snapshots are not checked.\n");
4158
+ }
4159
+ return compactInput({
4160
+ project_id: ctx.num("project-id"),
4161
+ authentication_status: ctx.num("authentication-status"),
4162
+ asset_refs: assetRefsInput(ctx),
4163
+ request_id: optionalString(ctx, "request-id")
4164
+ });
4165
+ }
4161
4166
  });
4162
4167
 
4163
4168
  // src/commands/te-analysis/governance/index.ts
@@ -8711,7 +8716,7 @@ var projectOwnerUpdate = createAnalysisCapabilityCommand({
8711
8716
  flags: [
8712
8717
  projectIdFlag,
8713
8718
  { name: "company-id", type: "number", required: true, desc: "Company ID." },
8714
- { name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Omit to only downgrade existing owner." },
8719
+ { name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Common treats a company root as company-admin management. Omit for the same behavior; the existing owner is downgraded." },
8715
8720
  { name: "project-name", type: "string", required: false, desc: "Optional project name update." },
8716
8721
  { name: "project-remark", type: "string", required: false, desc: "Optional project remark update." }
8717
8722
  ],
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createCapabilityCommand
4
- } from "./chunk-TMQGS4TO.js";
4
+ } from "./chunk-RC3PPCYD.js";
5
5
  import {
6
6
  registerCapabilityGatewayRoute,
7
7
  resolveGatewayDomain
@@ -9,32 +9,34 @@ import {
9
9
  import {
10
10
  unwrapOutputData,
11
11
  withOutputMetadata
12
- } from "./chunk-3ULDJJTZ.js";
12
+ } from "./chunk-O45NOIWR.js";
13
13
  import {
14
14
  CapabilityGatewayError,
15
15
  buildCapabilityGatewayUrl,
16
16
  requestCapabilityGatewayWithEnvelope
17
- } from "./chunk-4XKTRCRK.js";
17
+ } from "./chunk-4IQYPWCX.js";
18
18
  import {
19
- internalCallSourceHeaders
20
- } from "./chunk-Y74WTIKJ.js";
21
- import "./chunk-DWBYNGSR.js";
19
+ sourceLoggedFetch
20
+ } from "./chunk-NNK3JBH4.js";
21
+ import "./chunk-E3ONSFUN.js";
22
+ import "./chunk-PUSFEC6B.js";
22
23
  import {
23
24
  SecureStoreAuthError,
24
- getCliToken
25
- } from "./chunk-HTZ2MLYA.js";
25
+ getCliToken,
26
+ internalCallSourceHeaders
27
+ } from "./chunk-PLNS5J33.js";
26
28
  import {
27
29
  getActiveHost,
28
30
  parseJsonRequest,
29
31
  safeJsonParse,
30
32
  stringifyJsonRequest
31
- } from "./chunk-4PSTYEG5.js";
33
+ } from "./chunk-AMURHMS3.js";
32
34
  import {
33
35
  CliValidationError,
34
36
  PermissionError,
35
37
  externalCliTokenRequestOptions,
36
38
  logger
37
- } from "./chunk-Z3Q2AEIN.js";
39
+ } from "./chunk-R2SVAO4G.js";
38
40
 
39
41
  // src/core/mcp.ts
40
42
  async function permissionDetails(resp) {
@@ -109,7 +111,7 @@ async function mcpRequest(url, method, params = {}, hostOverride) {
109
111
  ...internalCallSourceHeaders(),
110
112
  ...buildAuthHeaders(token)
111
113
  };
112
- const resp = await fetch(url, {
114
+ const resp = await sourceLoggedFetch(url, {
113
115
  method: "POST",
114
116
  headers,
115
117
  body: stringifyJsonRequest(body),
@@ -1,28 +1,30 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  resolveHost
4
- } from "./chunk-2F64AZYH.js";
4
+ } from "./chunk-KA5WKR5P.js";
5
5
  import {
6
6
  printError
7
- } from "./chunk-3ULDJJTZ.js";
7
+ } from "./chunk-O45NOIWR.js";
8
8
  import {
9
- internalCallSourceHeaders
10
- } from "./chunk-Y74WTIKJ.js";
11
- import "./chunk-DWBYNGSR.js";
9
+ sourceLoggedFetch
10
+ } from "./chunk-NNK3JBH4.js";
11
+ import "./chunk-E3ONSFUN.js";
12
+ import "./chunk-PUSFEC6B.js";
12
13
  import {
13
14
  SecureStoreAuthError,
14
- getCliToken
15
- } from "./chunk-HTZ2MLYA.js";
15
+ getCliToken,
16
+ internalCallSourceHeaders
17
+ } from "./chunk-PLNS5J33.js";
16
18
  import {
17
19
  safeJsonParse
18
- } from "./chunk-4PSTYEG5.js";
20
+ } from "./chunk-AMURHMS3.js";
19
21
  import {
20
22
  CliApiError,
21
23
  CliValidationError,
22
24
  PermissionError,
23
25
  externalCliTokenRequestOptions,
24
26
  logger
25
- } from "./chunk-Z3Q2AEIN.js";
27
+ } from "./chunk-R2SVAO4G.js";
26
28
 
27
29
  // src/commands/te-dataops/shared.ts
28
30
  import { randomBytes } from "crypto";
@@ -172,7 +174,7 @@ async function downloadDataopsApi(ctx, path, params, targetPath) {
172
174
  const host = resolveHost(ctx.host());
173
175
  const token = await getCliToken(host);
174
176
  const url = buildUrl(host, path, compactArgs(params));
175
- const resp = await fetch(url, {
177
+ const resp = await sourceLoggedFetch(url, {
176
178
  method: "GET",
177
179
  ...externalCliTokenRequestOptions(url),
178
180
  headers: {
@@ -231,7 +233,7 @@ async function dataopsRequest(ctx, method, path, params = {}, body) {
231
233
  if (method !== "GET") {
232
234
  options.body = JSON.stringify(body ?? {});
233
235
  }
234
- const resp = await fetch(url, { ...options, ...externalCliTokenRequestOptions(url) });
236
+ const resp = await sourceLoggedFetch(url, { ...options, ...externalCliTokenRequestOptions(url) });
235
237
  const text = await resp.text();
236
238
  const data = parseResponseBody(text, url, resp.status, !resp.ok);
237
239
  logger.api(method, url, resp.status, body, data);
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createCapabilityCommand
4
- } from "./chunk-TMQGS4TO.js";
4
+ } from "./chunk-RC3PPCYD.js";
5
5
  import {
6
6
  registerCapabilityGatewayRoute,
7
7
  resolveGatewayDomain
@@ -9,21 +9,22 @@ import {
9
9
  import {
10
10
  printError,
11
11
  withOutputMetadata
12
- } from "./chunk-3ULDJJTZ.js";
12
+ } from "./chunk-O45NOIWR.js";
13
13
  import {
14
14
  CapabilityGatewayError,
15
15
  buildCapabilityGatewayUrl,
16
16
  fetchCapabilityGateway,
17
17
  requestCapabilityGateway,
18
18
  requestCapabilityGatewayWithEnvelope
19
- } from "./chunk-4XKTRCRK.js";
20
- import "./chunk-Y74WTIKJ.js";
21
- import "./chunk-DWBYNGSR.js";
22
- import "./chunk-HTZ2MLYA.js";
23
- import "./chunk-4PSTYEG5.js";
19
+ } from "./chunk-4IQYPWCX.js";
20
+ import "./chunk-NNK3JBH4.js";
21
+ import "./chunk-E3ONSFUN.js";
22
+ import "./chunk-PUSFEC6B.js";
23
+ import "./chunk-PLNS5J33.js";
24
+ import "./chunk-AMURHMS3.js";
24
25
  import {
25
26
  CliValidationError
26
- } from "./chunk-Z3Q2AEIN.js";
27
+ } from "./chunk-R2SVAO4G.js";
27
28
 
28
29
  // src/commands/te-engage/shared.ts
29
30
  function createEngageCapabilityCommand(cliService, config) {