@thinkingai/ae-cli 6.0.40 → 6.0.42

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 (148) hide show
  1. package/README.md +0 -2
  2. package/README.zh.md +0 -2
  3. package/dist/{auth-NN55553T.js → auth-GBMV6TEJ.js} +2 -2
  4. package/dist/{auth-GDV3H5I4.js → auth-NDSXE54J.js} +4 -4
  5. package/dist/{capability-TPORIKRQ.js → capability-CETVHGXF.js} +25 -15
  6. package/dist/{capability-VQNC5CF7.js → capability-ZSQBMNOE.js} +25 -15
  7. package/dist/{chunk-GJJA4CQZ.js → chunk-3FY3RJ26.js} +0 -4
  8. package/dist/chunk-4E3DB4MM.js +556 -0
  9. package/dist/{chunk-GS2P7LFD.js → chunk-5XUSIK27.js} +2 -2
  10. package/dist/{chunk-VTXHDCBW.js → chunk-AFXA7BRK.js} +2 -2
  11. package/dist/{chunk-7KQWSBSL.js → chunk-FNZA5RZA.js} +8 -8
  12. package/dist/{chunk-TS6BUGUY.js → chunk-J2N4PB56.js} +8 -8
  13. package/dist/{chunk-RBNKI5ZW.js → chunk-JUW4AJXN.js} +2 -2
  14. package/dist/{chunk-Z3OXWCIA.js → chunk-S5NTSDBS.js} +2 -2
  15. package/dist/{chunk-VKD5WQKN.js → chunk-VLWOLBGZ.js} +142 -24
  16. package/dist/chunk-WANVG6SY.js +556 -0
  17. package/dist/{chunk-YTG6Q75E.js → chunk-WZRX4KOH.js} +25 -3
  18. package/dist/{chunk-YV52FB5G.js → chunk-ZQKDZXDO.js} +1 -1
  19. package/dist/{cli-token-GL5MS5FK.js → cli-token-4UPER74P.js} +3 -3
  20. package/dist/{chunk-6A2FUCIS.js → client-L2YDMHQ6.js} +5 -6
  21. package/dist/{config-4VZNLBKF.js → config-OL2LWGBV.js} +4 -33
  22. package/dist/index.js +31 -44
  23. package/dist/{memory-RWJW4XFO.js → memory-MUP7PPL7.js} +4 -4
  24. package/dist/{memory-VO2ZJCRT.js → memory-U4O5PMXH.js} +4 -4
  25. package/dist/{metadata-ZRN2GHPN.js → metadata-BD6BXAYE.js} +33 -20
  26. package/dist/{metadata-YGTHR2XJ.js → metadata-HXOFACDE.js} +33 -20
  27. package/dist/{model-CLUIK3K5.js → model-JTUEO5M4.js} +2 -2
  28. package/dist/{sync-3REDHGY6.js → sync-MOSFNBVR.js} +5 -5
  29. package/dist/{te-agent-XNPELAKX.js → te-agent-IFKZDHZI.js} +25 -18
  30. package/dist/{te-analysis-GJI5FZUL.js → te-analysis-PXNF7ZJT.js} +1273 -498
  31. package/dist/{te-analysis-N2BRDJZ5.js → te-analysis-T7C7WSAH.js} +1273 -498
  32. package/dist/{te-community-SQXKE5OO.js → te-community-HNKVTERD.js} +207 -12
  33. package/dist/{te-community-TYSNU3NQ.js → te-community-IWE5B7W6.js} +208 -12
  34. package/dist/{te-dataops-OWIADNSM.js → te-dataops-KQPYNAE3.js} +262 -145
  35. package/dist/{te-dataops-5TM7WZDI.js → te-dataops-KXCEB4CS.js} +262 -145
  36. package/dist/{te-engage-L72HWRGO.js → te-engage-BVB7RGEO.js} +952 -18
  37. package/dist/{te-engage-QWM4GFS7.js → te-engage-LCEGC7G4.js} +952 -18
  38. package/dist/{te-kb-VRMEY3D4.js → te-kb-OIH3T6CS.js} +4 -4
  39. package/dist/{te-system-XGS5EQIQ.js → te-system-AZ3URMUO.js} +515 -11
  40. package/dist/{te-team-BZRDV2CM.js → te-team-GZPU6UWA.js} +5 -5
  41. package/dist/{update-HEDXGOJH.js → update-TOBFXF2V.js} +4 -4
  42. package/package.json +5 -5
  43. package/skills/ae-agent/SKILL.md +3 -3
  44. package/skills/ae-agent/references/list-skill-references.md +4 -4
  45. package/skills/ae-agent/references/read-skill-reference.md +10 -7
  46. package/skills/ae-agent/references/upload-skill-reference.md +11 -9
  47. package/skills/ae-analysis/SKILL.md +15 -12
  48. package/skills/ae-analysis/metadata_resolution.md +150 -0
  49. package/skills/ae-analysis/references/adhoc_export.md +17 -2
  50. package/skills/ae-analysis/references/adhoc_run.md +12 -8
  51. package/skills/ae-analysis/references/ai_models.md +35 -6
  52. package/skills/ae-analysis/references/alert_list.md +2 -3
  53. package/skills/ae-analysis/references/analysis_data_retrieval.md +104 -16
  54. package/skills/ae-analysis/references/analysis_drilldown_contract.md +4 -4
  55. package/skills/ae-analysis/references/analysis_gateway_assets.md +17 -15
  56. package/skills/ae-analysis/references/artifact_download.md +4 -3
  57. package/skills/ae-analysis/references/asset_abnormal_list.md +5 -3
  58. package/skills/ae-analysis/references/asset_authentication_list.md +5 -3
  59. package/skills/ae-analysis/references/asset_search.md +5 -3
  60. package/skills/ae-analysis/references/bi_panel_list.md +2 -2
  61. package/skills/ae-analysis/references/bi_panel_page_data_export.md +1 -1
  62. package/skills/ae-analysis/references/bi_panel_page_data_run.md +4 -4
  63. package/skills/ae-analysis/references/catalog_export.md +28 -0
  64. package/skills/ae-analysis/references/catalog_list.md +44 -0
  65. package/skills/ae-analysis/references/command_index.md +78 -69
  66. package/skills/ae-analysis/references/dashboard_list.md +2 -2
  67. package/skills/ae-analysis/references/dashboard_report_data_run.md +11 -4
  68. package/skills/ae-analysis/references/datatable_version_list.md +5 -3
  69. package/skills/ae-analysis/references/drilldown_entities_run.md +4 -4
  70. package/skills/ae-analysis/references/drilldown_events_run.md +2 -2
  71. package/skills/ae-analysis/references/drilldown_user_events_export.md +1 -1
  72. package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -2
  73. package/skills/ae-analysis/references/entity_detail_run.md +4 -4
  74. package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
  75. package/skills/ae-analysis/references/event_detail_run.md +4 -4
  76. package/skills/ae-analysis/references/event_export.md +21 -0
  77. package/skills/ae-analysis/references/event_list.md +7 -6
  78. package/skills/ae-analysis/references/exchange_rule_list.md +5 -3
  79. package/skills/ae-analysis/references/favorite_add.md +2 -2
  80. package/skills/ae-analysis/references/favorite_remove.md +2 -2
  81. package/skills/ae-analysis/references/history_tag_data_drilldown_export.md +4 -2
  82. package/skills/ae-analysis/references/history_tag_data_drilldown_run.md +2 -2
  83. package/skills/ae-analysis/references/history_tag_data_run.md +2 -2
  84. package/skills/ae-analysis/references/metric_create.md +7 -8
  85. package/skills/ae-analysis/references/metric_export.md +21 -0
  86. package/skills/ae-analysis/references/metric_list.md +8 -7
  87. package/skills/ae-analysis/references/project_space_list.md +2 -2
  88. package/skills/ae-analysis/references/property_export.md +21 -0
  89. package/skills/ae-analysis/references/property_list.md +9 -8
  90. package/skills/ae-analysis/references/public_link_list.md +2 -2
  91. package/skills/ae-analysis/references/query_context_get.md +20 -0
  92. package/skills/ae-analysis/references/query_create_result_cluster.md +1 -1
  93. package/skills/ae-analysis/references/report_change_log_list.md +1 -1
  94. package/skills/ae-analysis/references/report_create.md +3 -3
  95. package/skills/ae-analysis/references/report_data_run.md +8 -8
  96. package/skills/ae-analysis/references/report_list.md +3 -3
  97. package/skills/ae-analysis/references/report_list_export.md +2 -2
  98. package/skills/ae-analysis/references/report_update.md +3 -3
  99. package/skills/ae-analysis/references/report_version_rollback.md +1 -1
  100. package/skills/ae-analysis/references/rule_list.md +6 -4
  101. package/skills/ae-analysis/references/run_inspect.md +8 -5
  102. package/skills/ae-analysis/references/run_wait.md +37 -0
  103. package/skills/ae-analysis/references/sql_table_list.md +3 -2
  104. package/skills/ae-analysis/references/user_cluster_export.md +13 -0
  105. package/skills/ae-analysis/references/user_cluster_list.md +6 -2
  106. package/skills/ae-analysis/references/user_cluster_member_export.md +5 -3
  107. package/skills/ae-analysis/references/user_cluster_member_list.md +4 -4
  108. package/skills/ae-analysis/references/user_cluster_update.md +4 -2
  109. package/skills/ae-analysis/references/user_tag_export.md +13 -0
  110. package/skills/ae-analysis/references/user_tag_list.md +6 -2
  111. package/skills/ae-analysis/references/user_tag_member_export.md +5 -3
  112. package/skills/ae-analysis/references/user_tag_member_list.md +4 -4
  113. package/skills/ae-analysis/references/user_tag_update.md +4 -2
  114. package/skills/ae-analysis/references/virtual_property_create.md +2 -2
  115. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +3 -3
  116. package/skills/ae-community/SKILL.md +2 -2
  117. package/skills/ae-dataops/SKILL.md +4 -3
  118. package/skills/ae-dataops/references/dataops-flow-create.md +47 -3
  119. package/skills/ae-engage/SKILL.md +55 -7
  120. package/skills/ae-engage/references/build-task-save-guide.md +12 -0
  121. package/skills/ae-engage/references/cancel-query-run.md +31 -0
  122. package/skills/ae-engage/references/config-item-analysis-report.md +14 -1
  123. package/skills/ae-engage/references/config-item-strategy-comparison.md +11 -1
  124. package/skills/ae-engage/references/config-item-trigger-report.md +15 -1
  125. package/skills/ae-engage/references/flow-metric-detail-report.md +134 -0
  126. package/skills/ae-engage/references/flow-metric-update.md +77 -0
  127. package/skills/ae-engage/references/flow-metric-user.md +119 -0
  128. package/skills/ae-engage/references/flow-node-metric-user.md +123 -0
  129. package/skills/ae-engage/references/flow-node-user.md +123 -0
  130. package/skills/ae-engage/references/push-record-query.md +32 -1
  131. package/skills/ae-engage/references/save-task.md +9 -0
  132. package/skills/ae-engage/references/task-data-detail.md +9 -2
  133. package/skills/ae-engage/references/task-indicator-user.md +104 -0
  134. package/skills/ae-engage/references/task-metric-detail.md +9 -2
  135. package/skills/ae-engage/references/task-submit-approval.md +3 -0
  136. package/skills/ae-engage/references/task-user-detail-export.md +31 -0
  137. package/skills/ae-metadata/SKILL.md +2 -1
  138. package/skills/ae-metadata/references/metadata_data_table_download.md +10 -2
  139. package/skills/ae-metadata/references/metadata_data_table_list.md +5 -2
  140. package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
  141. package/skills/ae-system/SKILL.md +66 -3
  142. package/dist/chunk-DT6Y3TD7.js +0 -232
  143. package/dist/chunk-MVDZ7DBQ.js +0 -231
  144. package/dist/chunk-NBPKWKRA.js +0 -51
  145. package/dist/client-DAIPF7XN.js +0 -23
  146. package/dist/raw-52B4UKO4.js +0 -71
  147. package/dist/te-meta-53BVXPFI.js +0 -95
  148. package/dist/te-meta-TOCBPBXI.js +0 -95
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getActiveHost,
3
3
  getSandboxRuntimeRoot
4
- } from "./chunk-GJJA4CQZ.js";
4
+ } from "./chunk-3FY3RJ26.js";
5
5
 
6
6
  // src/core/te-agent-credentials.ts
7
7
  import { readFileSync } from "fs";
@@ -94,6 +94,10 @@ function getClaudeConfigDir() {
94
94
  }
95
95
 
96
96
  // src/core/te-agent-client.ts
97
+ import { open, unlink } from "fs/promises";
98
+ import path from "path";
99
+ import { Readable } from "stream";
100
+ import { pipeline } from "stream/promises";
97
101
  var TeAgentApiError = class extends Error {
98
102
  constructor(message, status, code, body) {
99
103
  super(message);
@@ -108,6 +112,7 @@ var TeAgentApiError = class extends Error {
108
112
  };
109
113
  var DEFAULT_TIMEOUT_MS = 3e4;
110
114
  var UPLOAD_TIMEOUT_MS = 12e4;
115
+ var DOWNLOAD_TIMEOUT_MS = 12e4;
111
116
  async function fetchWithTimeout(url, init, timeoutMs = DEFAULT_TIMEOUT_MS) {
112
117
  const controller = new AbortController();
113
118
  const timer = setTimeout(() => controller.abort(), timeoutMs);
@@ -131,7 +136,7 @@ function teClaudeBaseFromActiveHost(hostOverride) {
131
136
  const bp = process.env.TE_CLAUDE_BASE_PATH || "/agent";
132
137
  return base.endsWith(bp) ? base : base + bp;
133
138
  }
134
- async function signRequest(method, path, rawBody, hostOverride) {
139
+ async function signRequest(method, path2, rawBody, hostOverride) {
135
140
  const sandboxCred = tryLoadTeAgentSandboxCredentials();
136
141
  if (!hostOverride && sandboxCred && sandboxCred.sandboxId && sandboxCred.sandboxSecretKey) {
137
142
  const headers = {
@@ -142,13 +147,13 @@ async function signRequest(method, path, rawBody, hostOverride) {
142
147
  headers["Content-Type"] = "application/json";
143
148
  }
144
149
  return {
145
- url: `${sandboxCred.url.replace(/\/$/, "")}${path}`,
150
+ url: `${sandboxCred.url.replace(/\/$/, "")}${path2}`,
146
151
  headers,
147
152
  rawBody
148
153
  };
149
154
  }
150
- const { getToken } = await import("./auth-NN55553T.js");
151
- const { getCliToken } = await import("./cli-token-GL5MS5FK.js");
155
+ const { getToken } = await import("./auth-GBMV6TEJ.js");
156
+ const { getCliToken } = await import("./cli-token-4UPER74P.js");
152
157
  const baseUrl = hostOverride ? teClaudeBaseFromActiveHost(hostOverride) : sandboxCred?.url || teClaudeBaseFromActiveHost();
153
158
  if (!baseUrl) {
154
159
  throw new TeAgentCredentialsError(
@@ -166,7 +171,7 @@ async function signRequest(method, path, rawBody, hostOverride) {
166
171
  }
167
172
  if (accessToken) {
168
173
  return {
169
- url: `${baseUrl.replace(/\/$/, "")}${path}`,
174
+ url: `${baseUrl.replace(/\/$/, "")}${path2}`,
170
175
  headers: {
171
176
  "Authorization": `bearer ${accessToken}`,
172
177
  ...contentTypeHeader
@@ -182,7 +187,7 @@ async function signRequest(method, path, rawBody, hostOverride) {
182
187
  }
183
188
  if (cliToken) {
184
189
  return {
185
- url: `${baseUrl.replace(/\/$/, "")}${path}`,
190
+ url: `${baseUrl.replace(/\/$/, "")}${path2}`,
186
191
  headers: {
187
192
  "cli-token": cliToken,
188
193
  ...contentTypeHeader
@@ -220,9 +225,9 @@ async function parseResponse(response, defaultErrorPrefix) {
220
225
  }
221
226
  return parsed;
222
227
  }
223
- async function postToMainApp(path, body, hostOverride) {
228
+ async function postToMainApp(path2, body, hostOverride) {
224
229
  const rawBody = JSON.stringify(body);
225
- const signed = await signRequest("POST", path, rawBody, hostOverride);
230
+ const signed = await signRequest("POST", path2, rawBody, hostOverride);
226
231
  const response = await fetchWithTimeout(signed.url, {
227
232
  method: "POST",
228
233
  headers: signed.headers,
@@ -230,8 +235,8 @@ async function postToMainApp(path, body, hostOverride) {
230
235
  });
231
236
  return parseResponse(response, "Main app returned");
232
237
  }
233
- async function getFromMainApp(path, hostOverride) {
234
- const signed = await signRequest("GET", path, "", hostOverride);
238
+ async function getFromMainApp(path2, hostOverride) {
239
+ const signed = await signRequest("GET", path2, "", hostOverride);
235
240
  const response = await fetchWithTimeout(signed.url, {
236
241
  method: "GET",
237
242
  headers: signed.headers
@@ -264,17 +269,17 @@ async function postSandboxSyncPull(args) {
264
269
  mode: "merge"
265
270
  });
266
271
  }
267
- async function deleteFromMainApp(path, hostOverride) {
268
- const signed = await signRequest("DELETE", path, "", hostOverride);
272
+ async function deleteFromMainApp(path2, hostOverride) {
273
+ const signed = await signRequest("DELETE", path2, "", hostOverride);
269
274
  const response = await fetchWithTimeout(signed.url, {
270
275
  method: "DELETE",
271
276
  headers: signed.headers
272
277
  });
273
278
  return parseResponse(response, "Main app returned");
274
279
  }
275
- async function patchToMainApp(path, body, hostOverride) {
280
+ async function patchToMainApp(path2, body, hostOverride) {
276
281
  const rawBody = JSON.stringify(body);
277
- const signed = await signRequest("PATCH", path, rawBody, hostOverride);
282
+ const signed = await signRequest("PATCH", path2, rawBody, hostOverride);
278
283
  const response = await fetchWithTimeout(signed.url, {
279
284
  method: "PATCH",
280
285
  headers: signed.headers,
@@ -282,9 +287,9 @@ async function patchToMainApp(path, body, hostOverride) {
282
287
  });
283
288
  return parseResponse(response, "Main app returned");
284
289
  }
285
- async function putToMainApp(path, body, hostOverride) {
290
+ async function putToMainApp(path2, body, hostOverride) {
286
291
  const rawBody = JSON.stringify(body);
287
- const signed = await signRequest("PUT", path, rawBody, hostOverride);
292
+ const signed = await signRequest("PUT", path2, rawBody, hostOverride);
288
293
  const response = await fetchWithTimeout(signed.url, {
289
294
  method: "PUT",
290
295
  headers: signed.headers,
@@ -292,8 +297,8 @@ async function putToMainApp(path, body, hostOverride) {
292
297
  });
293
298
  return parseResponse(response, "Main app returned");
294
299
  }
295
- async function getBufferFromMainApp(path, hostOverride) {
296
- const signed = await signRequest("GET", path, "", hostOverride);
300
+ async function getBufferFromMainApp(path2, hostOverride) {
301
+ const signed = await signRequest("GET", path2, "", hostOverride);
297
302
  const response = await fetchWithTimeout(signed.url, {
298
303
  method: "GET",
299
304
  headers: signed.headers
@@ -325,9 +330,121 @@ async function getBufferFromMainApp(path, hostOverride) {
325
330
  const cd = response.headers.get("Content-Disposition") || "";
326
331
  const match = cd.match(/filename\*=UTF-8''([^;]+)/);
327
332
  const fileName = match ? decodeURIComponent(match[1]) : null;
328
- return { buffer, fileName };
333
+ const contentType = response.headers.get("Content-Type");
334
+ return { buffer, fileName, contentType };
329
335
  }
330
- async function uploadToMainApp(path, formData, hostOverride) {
336
+ function responseFileName(response) {
337
+ const disposition = response.headers.get("Content-Disposition") ?? "";
338
+ const encoded = disposition.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
339
+ if (encoded) {
340
+ try {
341
+ return decodeURIComponent(encoded.trim());
342
+ } catch {
343
+ return encoded.trim();
344
+ }
345
+ }
346
+ return disposition.match(/filename="([^"]+)"/i)?.[1] ?? disposition.match(/filename=([^;]+)/i)?.[1]?.trim() ?? null;
347
+ }
348
+ async function* responseBodyChunks(body) {
349
+ const reader = body.getReader();
350
+ try {
351
+ while (true) {
352
+ const chunk = await reader.read();
353
+ if (chunk.done) return;
354
+ yield chunk.value;
355
+ }
356
+ } finally {
357
+ reader.releaseLock();
358
+ }
359
+ }
360
+ async function downloadFromMainApp(requestPath, outputPath, hostOverride) {
361
+ const absolutePath = path.resolve(outputPath);
362
+ let fileHandle;
363
+ let created = false;
364
+ const controller = new AbortController();
365
+ const timer = setTimeout(() => controller.abort(), DOWNLOAD_TIMEOUT_MS);
366
+ try {
367
+ try {
368
+ fileHandle = await open(absolutePath, "wx");
369
+ created = true;
370
+ } catch (error) {
371
+ if (error.code === "EEXIST") {
372
+ throw new TeAgentApiError(
373
+ `Output file already exists: ${absolutePath}`,
374
+ 0,
375
+ "OUTPUT_EXISTS"
376
+ );
377
+ }
378
+ throw new TeAgentApiError(
379
+ `Unable to create output file: ${absolutePath}`,
380
+ 0,
381
+ "OUTPUT_ERROR"
382
+ );
383
+ }
384
+ const signed = await signRequest("GET", requestPath, "", hostOverride);
385
+ let response;
386
+ try {
387
+ response = await fetch(signed.url, {
388
+ method: "GET",
389
+ headers: signed.headers,
390
+ signal: controller.signal
391
+ });
392
+ } catch (error) {
393
+ if (error?.name === "AbortError") {
394
+ throw new TeAgentApiError(
395
+ `Request timed out (${DOWNLOAD_TIMEOUT_MS}ms): ${signed.url}`,
396
+ 0,
397
+ "TIMEOUT"
398
+ );
399
+ }
400
+ throw new TeAgentApiError(
401
+ `Network request failed: ${error instanceof Error ? error.message : String(error)}`,
402
+ 0,
403
+ "NETWORK_ERROR"
404
+ );
405
+ }
406
+ if (!response.ok) {
407
+ await parseResponse(response, "Main app returned");
408
+ }
409
+ if (!response.body) {
410
+ throw new TeAgentApiError("Main app returned an empty download stream", 0, "EMPTY_BODY");
411
+ }
412
+ const output = fileHandle.createWriteStream();
413
+ try {
414
+ await pipeline(
415
+ Readable.from(responseBodyChunks(response.body)),
416
+ output
417
+ );
418
+ } catch (error) {
419
+ if (error?.name === "AbortError") {
420
+ throw new TeAgentApiError(
421
+ `Request timed out (${DOWNLOAD_TIMEOUT_MS}ms): ${signed.url}`,
422
+ 0,
423
+ "TIMEOUT"
424
+ );
425
+ }
426
+ throw new TeAgentApiError(
427
+ `Download failed: ${error instanceof Error ? error.message : String(error)}`,
428
+ 0,
429
+ "DOWNLOAD_ERROR"
430
+ );
431
+ }
432
+ return {
433
+ path: absolutePath,
434
+ bytes: output.bytesWritten,
435
+ fileName: responseFileName(response),
436
+ contentType: response.headers.get("Content-Type")
437
+ };
438
+ } catch (error) {
439
+ if (fileHandle) await fileHandle.close().catch(() => void 0);
440
+ if (created) await unlink(absolutePath).catch(() => void 0);
441
+ throw error;
442
+ } finally {
443
+ clearTimeout(timer);
444
+ controller.abort();
445
+ }
446
+ }
447
+ async function uploadToMainApp(path2, formData, hostOverride) {
331
448
  const sandboxCred = tryLoadTeAgentSandboxCredentials();
332
449
  let baseUrl;
333
450
  let authHeaders;
@@ -338,8 +455,8 @@ async function uploadToMainApp(path, formData, hostOverride) {
338
455
  "X-Sandbox-Secret-Key": sandboxCred.sandboxSecretKey
339
456
  };
340
457
  } else {
341
- const { getToken } = await import("./auth-NN55553T.js");
342
- const { getCliToken } = await import("./cli-token-GL5MS5FK.js");
458
+ const { getToken } = await import("./auth-GBMV6TEJ.js");
459
+ const { getCliToken } = await import("./cli-token-4UPER74P.js");
343
460
  baseUrl = (hostOverride ? teClaudeBaseFromActiveHost(hostOverride) : sandboxCred?.url || teClaudeBaseFromActiveHost())?.replace(/\/$/, "") || "";
344
461
  if (!baseUrl) {
345
462
  throw new TeAgentCredentialsError(
@@ -373,7 +490,7 @@ async function uploadToMainApp(path, formData, hostOverride) {
373
490
  }
374
491
  }
375
492
  const response = await fetchWithTimeout(
376
- `${baseUrl}${path}`,
493
+ `${baseUrl}${path2}`,
377
494
  {
378
495
  method: "POST",
379
496
  headers: authHeaders,
@@ -399,5 +516,6 @@ export {
399
516
  patchToMainApp,
400
517
  putToMainApp,
401
518
  getBufferFromMainApp,
519
+ downloadFromMainApp,
402
520
  uploadToMainApp
403
521
  };