xgen-dex-cli 1.52.0 → 1.54.0
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/chunks/{chunk-RMBU3ELD.js → chunk-TCCQ3OMQ.js} +91 -2
- package/dist/chunks/chunk-TCCQ3OMQ.js.map +7 -0
- package/dist/chunks/{tui-SFYYO3XZ.js → tui-UBE5MRFL.js} +2 -2
- package/dist/cli.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/chunk-RMBU3ELD.js.map +0 -7
- /package/dist/chunks/{tui-SFYYO3XZ.js.map → tui-UBE5MRFL.js.map} +0 -0
|
@@ -143,6 +143,28 @@ var AgentDataApi = class {
|
|
|
143
143
|
}
|
|
144
144
|
// ── 아티팩트 ──────────────────────────────────────────────────
|
|
145
145
|
/** 이 에이전트의 아티팩트 목록 (열 수 없는 것도 이유와 함께 온다). */
|
|
146
|
+
/**
|
|
147
|
+
* 격리 프레임(한 파일 아티팩트)의 fetch 를 **대신** 부른다.
|
|
148
|
+
*
|
|
149
|
+
* 프레임에는 네트워크가 없다 — 그래서 아티팩트가 fetch('__xgen/api/prices') 라고
|
|
150
|
+
* 쓰면 "Failed to fetch" 로 죽었다. 여기서는 우리 자격으로 서버에 요청한다.
|
|
151
|
+
* 상대 주소는 그 아티팩트의 주소(…/{slug}/app/) 아래에서 풀리므로 폴더의
|
|
152
|
+
* api/*.py·도구·프록시가 그대로 닿고, /api/… 는 우리 API 다. 그 밖으로는
|
|
153
|
+
* 나가지 않는다(그건 서버의 __xgen/fetch 몫이다).
|
|
154
|
+
*/
|
|
155
|
+
artifactHttp(workflowId, slug, req) {
|
|
156
|
+
const base = `/api/agentflow/agent-artifacts/${encodeURIComponent(workflowId)}/${encodeURIComponent(slug)}/app/`;
|
|
157
|
+
const target = new URL(req.url, `http://artifact.local${base}`);
|
|
158
|
+
if (target.host !== "artifact.local" || !target.pathname.startsWith("/api/")) {
|
|
159
|
+
return Promise.reject(new Error(`'${req.url}' \uC740(\uB294) \uC774 \uD654\uBA74\uC5D0\uC11C \uBD80\uB97C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 __xgen/fetch \uB97C \uC4F0\uC138\uC694`));
|
|
160
|
+
}
|
|
161
|
+
const headers = { ...req.headers };
|
|
162
|
+
delete headers.cookie;
|
|
163
|
+
delete headers.Cookie;
|
|
164
|
+
delete headers.authorization;
|
|
165
|
+
delete headers.Authorization;
|
|
166
|
+
return this.http.raw(req.method, target.pathname + target.search, { headers, body: req.body });
|
|
167
|
+
}
|
|
146
168
|
artifactList(workflowId) {
|
|
147
169
|
return this.http.get(
|
|
148
170
|
`/api/agentflow/agent-artifacts/${encodeURIComponent(workflowId)}/list`
|
|
@@ -747,6 +769,45 @@ var HttpClient = class {
|
|
|
747
769
|
const ab = await res.arrayBuffer();
|
|
748
770
|
return { bytes: new Uint8Array(ab), contentType: res.headers.get("content-type") ?? "" };
|
|
749
771
|
}
|
|
772
|
+
/**
|
|
773
|
+
* 원시 요청 — 상태·헤더·본문을 그대로 돌려준다(JSON 으로 풀지 않는다).
|
|
774
|
+
*
|
|
775
|
+
* 아티팩트 프레임의 fetch 를 대신 부르는 자리다: 그 응답이 JSON 일지 텍스트일지
|
|
776
|
+
* 바이너리일지는 아티팩트의 스크립트가 정한다. 우리가 미리 해석하면 틀린다.
|
|
777
|
+
*/
|
|
778
|
+
async raw(method, path, opts) {
|
|
779
|
+
const controller = new AbortController();
|
|
780
|
+
const timer = setTimeout(() => controller.abort(), opts?.timeoutMs ?? 12e4);
|
|
781
|
+
let res;
|
|
782
|
+
try {
|
|
783
|
+
res = await this.fetchImpl(this.url(path), {
|
|
784
|
+
method,
|
|
785
|
+
headers: this.headers({ Accept: "*/*", ...opts?.headers ?? {} }),
|
|
786
|
+
body: opts?.body ?? void 0,
|
|
787
|
+
signal: controller.signal
|
|
788
|
+
});
|
|
789
|
+
} finally {
|
|
790
|
+
clearTimeout(timer);
|
|
791
|
+
}
|
|
792
|
+
if (res.status === 401) this.onAuthFailure?.();
|
|
793
|
+
const headers = {};
|
|
794
|
+
res.headers.forEach((v, k) => {
|
|
795
|
+
headers[k] = v;
|
|
796
|
+
});
|
|
797
|
+
const type = res.headers.get("content-type") ?? "";
|
|
798
|
+
const textual = !type || /^(text\/|application\/(json|javascript|xml|x-www-form-urlencoded)|image\/svg)/i.test(type);
|
|
799
|
+
if (textual) {
|
|
800
|
+
return { status: res.status, statusText: res.statusText, headers, body: await res.text() };
|
|
801
|
+
}
|
|
802
|
+
const bytes = new Uint8Array(await res.arrayBuffer());
|
|
803
|
+
return {
|
|
804
|
+
status: res.status,
|
|
805
|
+
statusText: res.statusText,
|
|
806
|
+
headers,
|
|
807
|
+
body: null,
|
|
808
|
+
bodyB64: Buffer.from(bytes).toString("base64")
|
|
809
|
+
};
|
|
810
|
+
}
|
|
750
811
|
put(path, body, opts) {
|
|
751
812
|
return this.json("PUT", path, body, opts);
|
|
752
813
|
}
|
|
@@ -1210,6 +1271,33 @@ function stripBrowserContext(text) {
|
|
|
1210
1271
|
}
|
|
1211
1272
|
|
|
1212
1273
|
// ../../packages/protocol/src/history.ts
|
|
1274
|
+
function toHistoryProcess(value) {
|
|
1275
|
+
if (!Array.isArray(value)) return void 0;
|
|
1276
|
+
const out = [];
|
|
1277
|
+
for (const raw of value) {
|
|
1278
|
+
if (!raw || typeof raw !== "object") continue;
|
|
1279
|
+
const item = raw;
|
|
1280
|
+
const at = typeof item.at === "number" ? item.at : 0;
|
|
1281
|
+
if (item.kind === "text" && typeof item.text === "string") {
|
|
1282
|
+
out.push({ kind: "text", text: item.text, at });
|
|
1283
|
+
continue;
|
|
1284
|
+
}
|
|
1285
|
+
if (item.kind === "tool" && item.event && typeof item.event === "object") {
|
|
1286
|
+
const e = item.event;
|
|
1287
|
+
const event = {
|
|
1288
|
+
eventType: String(e.event_type ?? "tool"),
|
|
1289
|
+
toolName: typeof e.tool_name === "string" ? e.tool_name : void 0,
|
|
1290
|
+
toolInput: e.tool_input,
|
|
1291
|
+
result: typeof e.result === "string" ? e.result : void 0,
|
|
1292
|
+
error: typeof e.error === "string" ? e.error : void 0,
|
|
1293
|
+
toolUseId: typeof e.tool_use_id === "string" ? e.tool_use_id : void 0,
|
|
1294
|
+
durationMs: typeof e.duration_ms === "number" ? e.duration_ms : void 0
|
|
1295
|
+
};
|
|
1296
|
+
out.push({ kind: "tool", event, at });
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return out.length > 0 ? out : void 0;
|
|
1300
|
+
}
|
|
1213
1301
|
function toHistoryAttachments(value) {
|
|
1214
1302
|
if (!Array.isArray(value)) return [];
|
|
1215
1303
|
const result = [];
|
|
@@ -1293,7 +1381,8 @@ var HistoryApi = class {
|
|
|
1293
1381
|
input: toDisplayText(r.input_data),
|
|
1294
1382
|
output: toDisplayText(r.output_data),
|
|
1295
1383
|
attachments: toHistoryAttachments(r.attachments),
|
|
1296
|
-
updatedAt: r.updated_at
|
|
1384
|
+
updatedAt: r.updated_at,
|
|
1385
|
+
process: toHistoryProcess(r.process)
|
|
1297
1386
|
}));
|
|
1298
1387
|
return { turns, running: res.running === true };
|
|
1299
1388
|
}
|
|
@@ -5965,4 +6054,4 @@ export {
|
|
|
5965
6054
|
credentialBackend,
|
|
5966
6055
|
SystemCredentialStore
|
|
5967
6056
|
};
|
|
5968
|
-
//# sourceMappingURL=chunk-
|
|
6057
|
+
//# sourceMappingURL=chunk-TCCQ3OMQ.js.map
|