@workflow-code/cli 0.2.4-20261011003.codex-cli-web → 0.2.4-20261011005.codex-cli-web
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/index.js +1 -1
- package/dist/web/worker.mjs +4 -1
- package/dist/web/workflow-ui.css +41 -3
- package/dist/web/workflow-ui.js +86 -12
- package/dist/web/workflow-workspace.css +41 -3
- package/dist/web/workflow-workspace.js +94 -19
- package/dist/{web-O6FZ5URK.js → web-A3HVQRKB.js} +2 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
24
24
|
const prepared = prepareCliInvocation(argv);
|
|
25
25
|
argv = prepared.argv;
|
|
26
26
|
if (argv[0] === "web") {
|
|
27
|
-
const webCli = await import("./web-
|
|
27
|
+
const webCli = await import("./web-A3HVQRKB.js");
|
|
28
28
|
return webCli.main(argv.slice(1));
|
|
29
29
|
}
|
|
30
30
|
if (argv[0] === "workspace") {
|
package/dist/web/worker.mjs
CHANGED
|
@@ -43,7 +43,10 @@ async function requiresSystemAi(directory) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
try {
|
|
46
|
-
|
|
46
|
+
// Pipe requests can arrive in several chunks, including inside a UTF-8 sequence.
|
|
47
|
+
const chunks = [];
|
|
48
|
+
for await (const chunk of process.stdin) { chunks.push(chunk); }
|
|
49
|
+
const request = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
47
50
|
const projectDir = path.resolve(request.project?.folderPath ?? request.paths?.[0]);
|
|
48
51
|
const runtimeProjectDir = path.resolve(request.runtimeProjectDir ?? projectDir);
|
|
49
52
|
let coreUrl;
|
package/dist/web/workflow-ui.css
CHANGED
|
@@ -1238,6 +1238,29 @@ main {
|
|
|
1238
1238
|
overflow: auto;
|
|
1239
1239
|
padding: 16px;
|
|
1240
1240
|
}
|
|
1241
|
+
.action-dialog {
|
|
1242
|
+
width: min(380px, calc(100vw - 32px));
|
|
1243
|
+
}
|
|
1244
|
+
.action-dialog label {
|
|
1245
|
+
display: grid;
|
|
1246
|
+
gap: 8px;
|
|
1247
|
+
}
|
|
1248
|
+
.action-dialog input {
|
|
1249
|
+
width: 100%;
|
|
1250
|
+
min-width: 0;
|
|
1251
|
+
padding: 8px;
|
|
1252
|
+
color: inherit;
|
|
1253
|
+
background: var(--vscode-input-background);
|
|
1254
|
+
border: 1px solid var(--border);
|
|
1255
|
+
border-radius: 4px;
|
|
1256
|
+
}
|
|
1257
|
+
.action-dialog .prompt-navigation {
|
|
1258
|
+
justify-content: flex-end;
|
|
1259
|
+
margin-top: 16px;
|
|
1260
|
+
}
|
|
1261
|
+
.action-dialog .danger {
|
|
1262
|
+
color: var(--vscode-errorForeground);
|
|
1263
|
+
}
|
|
1241
1264
|
.permissions-table {
|
|
1242
1265
|
width: 100%;
|
|
1243
1266
|
border-collapse: collapse;
|
|
@@ -1890,10 +1913,25 @@ textarea::placeholder {
|
|
|
1890
1913
|
overflow-wrap: anywhere;
|
|
1891
1914
|
}
|
|
1892
1915
|
@media (max-width: 680px) {
|
|
1916
|
+
.project-menu {
|
|
1917
|
+
position: relative;
|
|
1918
|
+
}
|
|
1919
|
+
.project-menu .menu-heading {
|
|
1920
|
+
padding-right: 52px;
|
|
1921
|
+
}
|
|
1893
1922
|
.web-account {
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1923
|
+
position: absolute;
|
|
1924
|
+
right: 10px;
|
|
1925
|
+
top: 6px;
|
|
1926
|
+
margin: 0;
|
|
1927
|
+
width: 28px;
|
|
1928
|
+
height: 28px;
|
|
1929
|
+
min-height: 28px;
|
|
1930
|
+
padding: 2px;
|
|
1931
|
+
border: 0;
|
|
1932
|
+
}
|
|
1933
|
+
.web-account-name {
|
|
1934
|
+
display: none;
|
|
1897
1935
|
}
|
|
1898
1936
|
}
|
|
1899
1937
|
@media (max-width: 420px) {
|
package/dist/web/workflow-ui.js
CHANGED
|
@@ -2681,6 +2681,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2681
2681
|
const id = value.match(/(?:^|[/?#])(wf_[a-f0-9]{32})(?:$|[/?#])/i)?.[1];
|
|
2682
2682
|
return files.find((file) => file.id === id || value === file.path || value === file.url || value === `file://${file.path}`);
|
|
2683
2683
|
}
|
|
2684
|
+
function mediaUrl(source, kind, files, baseUrl) {
|
|
2685
|
+
const file = managedFileForUrl(source, files);
|
|
2686
|
+
const preview = file?.previewUrl ?? source;
|
|
2687
|
+
if (new RegExp(`^data:${kind}/[a-z0-9.+-]+;base64,`, "i").test(preview)) {
|
|
2688
|
+
return preview;
|
|
2689
|
+
}
|
|
2690
|
+
try {
|
|
2691
|
+
const url = file?.previewUrl ? new URL(preview, baseUrl) : new URL(preview);
|
|
2692
|
+
if (url.protocol === "http:" || url.protocol === "https:") {
|
|
2693
|
+
return url.href;
|
|
2694
|
+
}
|
|
2695
|
+
} catch {
|
|
2696
|
+
}
|
|
2697
|
+
return void 0;
|
|
2698
|
+
}
|
|
2684
2699
|
function markdownHtml(text3, files = []) {
|
|
2685
2700
|
const renderer = new d.Renderer();
|
|
2686
2701
|
renderer.image = (token) => {
|
|
@@ -3854,9 +3869,8 @@ ${JSON.stringify(output.details, null, 2)}` : "");
|
|
|
3854
3869
|
summary.innerHTML = `${iconHtml(status === "running" ? "loading" : status === "failed" ? "error" : status === "success" ? "check" : "chevron-right")}<span>${escapeHtml(content?.tool ?? item.title ?? "\u8BE6\u60C5")}</span>`;
|
|
3855
3870
|
root.append(summary);
|
|
3856
3871
|
if (["audio", "video"].includes(item.contentType ?? "") && typeof content?.src === "string") {
|
|
3857
|
-
const
|
|
3858
|
-
|
|
3859
|
-
if (/^https?:\/\//i.test(src) || new RegExp(`^data:${item.contentType}/[a-z0-9.+-]+;base64,`, "i").test(src)) {
|
|
3872
|
+
const src = mediaUrl(content.src, item.contentType === "audio" ? "audio" : "video", files, location.href);
|
|
3873
|
+
if (src) {
|
|
3860
3874
|
const media = document.createElement(item.contentType === "audio" ? "audio" : "video");
|
|
3861
3875
|
media.controls = true;
|
|
3862
3876
|
media.preload = "metadata";
|
|
@@ -4274,6 +4288,66 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4274
4288
|
}
|
|
4275
4289
|
};
|
|
4276
4290
|
|
|
4291
|
+
// src/web/ui/action-dialog.ts
|
|
4292
|
+
function requestAction(options) {
|
|
4293
|
+
return new Promise((resolve) => {
|
|
4294
|
+
const dialog = document.createElement("dialog");
|
|
4295
|
+
dialog.className = "conversation-dialog action-dialog";
|
|
4296
|
+
const title = document.createElement("h2");
|
|
4297
|
+
title.id = `action-${crypto.randomUUID()}`;
|
|
4298
|
+
title.textContent = options.title;
|
|
4299
|
+
dialog.setAttribute("aria-labelledby", title.id);
|
|
4300
|
+
const header = document.createElement("header");
|
|
4301
|
+
header.append(title, iconButton("close", "\u5173\u95ED", () => dialog.close()));
|
|
4302
|
+
const form = document.createElement("form");
|
|
4303
|
+
form.className = "dialog-body";
|
|
4304
|
+
let input, result;
|
|
4305
|
+
if (options.label) {
|
|
4306
|
+
const label = document.createElement("label");
|
|
4307
|
+
label.textContent = options.label;
|
|
4308
|
+
input = document.createElement("input");
|
|
4309
|
+
input.type = "text";
|
|
4310
|
+
input.required = true;
|
|
4311
|
+
input.autofocus = true;
|
|
4312
|
+
input.value = options.value ?? "";
|
|
4313
|
+
label.append(input);
|
|
4314
|
+
form.append(label);
|
|
4315
|
+
}
|
|
4316
|
+
const actions = document.createElement("div");
|
|
4317
|
+
actions.className = "prompt-navigation";
|
|
4318
|
+
const cancel = document.createElement("button");
|
|
4319
|
+
cancel.type = "button";
|
|
4320
|
+
cancel.className = "prompt-button";
|
|
4321
|
+
cancel.textContent = "\u53D6\u6D88";
|
|
4322
|
+
cancel.onclick = () => dialog.close();
|
|
4323
|
+
const confirm = document.createElement("button");
|
|
4324
|
+
confirm.type = "submit";
|
|
4325
|
+
confirm.className = "prompt-button";
|
|
4326
|
+
confirm.textContent = options.confirm;
|
|
4327
|
+
if (options.danger) {
|
|
4328
|
+
confirm.classList.add("danger");
|
|
4329
|
+
}
|
|
4330
|
+
actions.append(cancel, confirm);
|
|
4331
|
+
form.append(actions);
|
|
4332
|
+
dialog.append(header, form);
|
|
4333
|
+
form.onsubmit = (event) => {
|
|
4334
|
+
event.preventDefault();
|
|
4335
|
+
if (input && !input.value.trim()) {
|
|
4336
|
+
input.focus();
|
|
4337
|
+
return;
|
|
4338
|
+
}
|
|
4339
|
+
result = input?.value.trim() ?? "";
|
|
4340
|
+
dialog.close();
|
|
4341
|
+
};
|
|
4342
|
+
dialog.addEventListener("close", () => {
|
|
4343
|
+
dialog.remove();
|
|
4344
|
+
resolve(result);
|
|
4345
|
+
}, { once: true });
|
|
4346
|
+
document.body.append(dialog);
|
|
4347
|
+
dialog.showModal();
|
|
4348
|
+
});
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4277
4351
|
// src/web/ui/host.ts
|
|
4278
4352
|
function acquireWorkflowHost() {
|
|
4279
4353
|
const embedded = globalThis.acquireVsCodeApi;
|
|
@@ -4376,7 +4450,7 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4376
4450
|
accountPanel = new AccountPanel(document.querySelector("#project-menu"), request);
|
|
4377
4451
|
});
|
|
4378
4452
|
return {
|
|
4379
|
-
postMessage: (message) => {
|
|
4453
|
+
postMessage: async (message) => {
|
|
4380
4454
|
if (message.type === "ready") {
|
|
4381
4455
|
return;
|
|
4382
4456
|
}
|
|
@@ -4389,13 +4463,13 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4389
4463
|
return;
|
|
4390
4464
|
}
|
|
4391
4465
|
if (message.type === "session-action" && message.action === "rename") {
|
|
4392
|
-
const title =
|
|
4393
|
-
if (
|
|
4466
|
+
const title = await requestAction({ title: "\u91CD\u547D\u540D\u5BF9\u8BDD", label: "\u5BF9\u8BDD\u540D\u79F0", value: message.currentTitle, confirm: "\u4FDD\u5B58" });
|
|
4467
|
+
if (title === void 0) {
|
|
4394
4468
|
return;
|
|
4395
4469
|
}
|
|
4396
4470
|
message = { ...message, title };
|
|
4397
4471
|
}
|
|
4398
|
-
if (message.type === "session-action" && message.action === "delete" &&
|
|
4472
|
+
if (message.type === "session-action" && message.action === "delete" && await requestAction({ title: "\u5220\u9664\u8FD9\u4E2A\u5BF9\u8BDD\uFF1F", confirm: "\u5220\u9664", danger: true }) === void 0) {
|
|
4399
4473
|
return;
|
|
4400
4474
|
}
|
|
4401
4475
|
if (message.type === "open-file") {
|
|
@@ -5446,7 +5520,7 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
5446
5520
|
const id = sessionMenuId;
|
|
5447
5521
|
closeSessionMenu(true);
|
|
5448
5522
|
if (id) {
|
|
5449
|
-
post({ type: "session-action", id, action: button.dataset.action });
|
|
5523
|
+
post({ type: "session-action", id, action: button.dataset.action, currentTitle: state?.sessions.find((session) => session.id === id)?.title });
|
|
5450
5524
|
}
|
|
5451
5525
|
});
|
|
5452
5526
|
}
|
|
@@ -5602,11 +5676,11 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
5602
5676
|
} else if (message.type === "attachments" && state && message.projectUri === state.project.uri && message.sessionId === state.activeId) {
|
|
5603
5677
|
uploading = Math.max(0, uploading - 1);
|
|
5604
5678
|
if (message.messageId) {
|
|
5605
|
-
const
|
|
5606
|
-
if (
|
|
5607
|
-
const field =
|
|
5679
|
+
const prompt = messages.get(message.messageId)?.prompt;
|
|
5680
|
+
if (prompt && prompt.request.requestId === message.requestId) {
|
|
5681
|
+
const field = prompt.request.params.find((field2) => field2.name === message.paramName);
|
|
5608
5682
|
if (field) {
|
|
5609
|
-
|
|
5683
|
+
prompt.fileValue(field.name, JSON.stringify((field.multiple ? message.files : message.files.slice(0, 1)).map(({ previewUrl: _2, ...file }) => file)));
|
|
5610
5684
|
}
|
|
5611
5685
|
}
|
|
5612
5686
|
} else if (message.paramName && fields.has(message.paramName)) {
|
|
@@ -1238,6 +1238,29 @@ main {
|
|
|
1238
1238
|
overflow: auto;
|
|
1239
1239
|
padding: 16px;
|
|
1240
1240
|
}
|
|
1241
|
+
.action-dialog {
|
|
1242
|
+
width: min(380px, calc(100vw - 32px));
|
|
1243
|
+
}
|
|
1244
|
+
.action-dialog label {
|
|
1245
|
+
display: grid;
|
|
1246
|
+
gap: 8px;
|
|
1247
|
+
}
|
|
1248
|
+
.action-dialog input {
|
|
1249
|
+
width: 100%;
|
|
1250
|
+
min-width: 0;
|
|
1251
|
+
padding: 8px;
|
|
1252
|
+
color: inherit;
|
|
1253
|
+
background: var(--vscode-input-background);
|
|
1254
|
+
border: 1px solid var(--border);
|
|
1255
|
+
border-radius: 4px;
|
|
1256
|
+
}
|
|
1257
|
+
.action-dialog .prompt-navigation {
|
|
1258
|
+
justify-content: flex-end;
|
|
1259
|
+
margin-top: 16px;
|
|
1260
|
+
}
|
|
1261
|
+
.action-dialog .danger {
|
|
1262
|
+
color: var(--vscode-errorForeground);
|
|
1263
|
+
}
|
|
1241
1264
|
.permissions-table {
|
|
1242
1265
|
width: 100%;
|
|
1243
1266
|
border-collapse: collapse;
|
|
@@ -2298,10 +2321,25 @@ textarea::placeholder {
|
|
|
2298
2321
|
overflow-wrap: anywhere;
|
|
2299
2322
|
}
|
|
2300
2323
|
@media (max-width: 680px) {
|
|
2324
|
+
.project-menu {
|
|
2325
|
+
position: relative;
|
|
2326
|
+
}
|
|
2327
|
+
.project-menu .menu-heading {
|
|
2328
|
+
padding-right: 52px;
|
|
2329
|
+
}
|
|
2301
2330
|
.web-account {
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2331
|
+
position: absolute;
|
|
2332
|
+
right: 10px;
|
|
2333
|
+
top: 6px;
|
|
2334
|
+
margin: 0;
|
|
2335
|
+
width: 28px;
|
|
2336
|
+
height: 28px;
|
|
2337
|
+
min-height: 28px;
|
|
2338
|
+
padding: 2px;
|
|
2339
|
+
border: 0;
|
|
2340
|
+
}
|
|
2341
|
+
.web-account-name {
|
|
2342
|
+
display: none;
|
|
2305
2343
|
}
|
|
2306
2344
|
}
|
|
2307
2345
|
@media (max-width: 420px) {
|
|
@@ -5737,6 +5737,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
5737
5737
|
const id = value.match(/(?:^|[/?#])(wf_[a-f0-9]{32})(?:$|[/?#])/i)?.[1];
|
|
5738
5738
|
return files.find((file) => file.id === id || value === file.path || value === file.url || value === `file://${file.path}`);
|
|
5739
5739
|
}
|
|
5740
|
+
function mediaUrl(source, kind, files, baseUrl) {
|
|
5741
|
+
const file = managedFileForUrl(source, files);
|
|
5742
|
+
const preview = file?.previewUrl ?? source;
|
|
5743
|
+
if (new RegExp(`^data:${kind}/[a-z0-9.+-]+;base64,`, "i").test(preview)) {
|
|
5744
|
+
return preview;
|
|
5745
|
+
}
|
|
5746
|
+
try {
|
|
5747
|
+
const url = file?.previewUrl ? new URL(preview, baseUrl) : new URL(preview);
|
|
5748
|
+
if (url.protocol === "http:" || url.protocol === "https:") {
|
|
5749
|
+
return url.href;
|
|
5750
|
+
}
|
|
5751
|
+
} catch {
|
|
5752
|
+
}
|
|
5753
|
+
return void 0;
|
|
5754
|
+
}
|
|
5740
5755
|
function markdownHtml(text3, files = []) {
|
|
5741
5756
|
const renderer = new d.Renderer();
|
|
5742
5757
|
renderer.image = (token) => {
|
|
@@ -6127,6 +6142,66 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6127
6142
|
}
|
|
6128
6143
|
};
|
|
6129
6144
|
|
|
6145
|
+
// src/web/ui/action-dialog.ts
|
|
6146
|
+
function requestAction(options) {
|
|
6147
|
+
return new Promise((resolve2) => {
|
|
6148
|
+
const dialog = document.createElement("dialog");
|
|
6149
|
+
dialog.className = "conversation-dialog action-dialog";
|
|
6150
|
+
const title = document.createElement("h2");
|
|
6151
|
+
title.id = `action-${crypto.randomUUID()}`;
|
|
6152
|
+
title.textContent = options.title;
|
|
6153
|
+
dialog.setAttribute("aria-labelledby", title.id);
|
|
6154
|
+
const header = document.createElement("header");
|
|
6155
|
+
header.append(title, iconButton("close", "\u5173\u95ED", () => dialog.close()));
|
|
6156
|
+
const form = document.createElement("form");
|
|
6157
|
+
form.className = "dialog-body";
|
|
6158
|
+
let input, result;
|
|
6159
|
+
if (options.label) {
|
|
6160
|
+
const label = document.createElement("label");
|
|
6161
|
+
label.textContent = options.label;
|
|
6162
|
+
input = document.createElement("input");
|
|
6163
|
+
input.type = "text";
|
|
6164
|
+
input.required = true;
|
|
6165
|
+
input.autofocus = true;
|
|
6166
|
+
input.value = options.value ?? "";
|
|
6167
|
+
label.append(input);
|
|
6168
|
+
form.append(label);
|
|
6169
|
+
}
|
|
6170
|
+
const actions = document.createElement("div");
|
|
6171
|
+
actions.className = "prompt-navigation";
|
|
6172
|
+
const cancel = document.createElement("button");
|
|
6173
|
+
cancel.type = "button";
|
|
6174
|
+
cancel.className = "prompt-button";
|
|
6175
|
+
cancel.textContent = "\u53D6\u6D88";
|
|
6176
|
+
cancel.onclick = () => dialog.close();
|
|
6177
|
+
const confirm = document.createElement("button");
|
|
6178
|
+
confirm.type = "submit";
|
|
6179
|
+
confirm.className = "prompt-button";
|
|
6180
|
+
confirm.textContent = options.confirm;
|
|
6181
|
+
if (options.danger) {
|
|
6182
|
+
confirm.classList.add("danger");
|
|
6183
|
+
}
|
|
6184
|
+
actions.append(cancel, confirm);
|
|
6185
|
+
form.append(actions);
|
|
6186
|
+
dialog.append(header, form);
|
|
6187
|
+
form.onsubmit = (event) => {
|
|
6188
|
+
event.preventDefault();
|
|
6189
|
+
if (input && !input.value.trim()) {
|
|
6190
|
+
input.focus();
|
|
6191
|
+
return;
|
|
6192
|
+
}
|
|
6193
|
+
result = input?.value.trim() ?? "";
|
|
6194
|
+
dialog.close();
|
|
6195
|
+
};
|
|
6196
|
+
dialog.addEventListener("close", () => {
|
|
6197
|
+
dialog.remove();
|
|
6198
|
+
resolve2(result);
|
|
6199
|
+
}, { once: true });
|
|
6200
|
+
document.body.append(dialog);
|
|
6201
|
+
dialog.showModal();
|
|
6202
|
+
});
|
|
6203
|
+
}
|
|
6204
|
+
|
|
6130
6205
|
// src/web/ui/host.ts
|
|
6131
6206
|
function acquireWorkflowHost() {
|
|
6132
6207
|
const embedded = globalThis.acquireVsCodeApi;
|
|
@@ -6229,7 +6304,7 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6229
6304
|
accountPanel = new AccountPanel(document.querySelector("#project-menu"), request);
|
|
6230
6305
|
});
|
|
6231
6306
|
return {
|
|
6232
|
-
postMessage: (message) => {
|
|
6307
|
+
postMessage: async (message) => {
|
|
6233
6308
|
if (message.type === "ready") {
|
|
6234
6309
|
return;
|
|
6235
6310
|
}
|
|
@@ -6242,13 +6317,13 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6242
6317
|
return;
|
|
6243
6318
|
}
|
|
6244
6319
|
if (message.type === "session-action" && message.action === "rename") {
|
|
6245
|
-
const title =
|
|
6246
|
-
if (
|
|
6320
|
+
const title = await requestAction({ title: "\u91CD\u547D\u540D\u5BF9\u8BDD", label: "\u5BF9\u8BDD\u540D\u79F0", value: message.currentTitle, confirm: "\u4FDD\u5B58" });
|
|
6321
|
+
if (title === void 0) {
|
|
6247
6322
|
return;
|
|
6248
6323
|
}
|
|
6249
6324
|
message = { ...message, title };
|
|
6250
6325
|
}
|
|
6251
|
-
if (message.type === "session-action" && message.action === "delete" &&
|
|
6326
|
+
if (message.type === "session-action" && message.action === "delete" && await requestAction({ title: "\u5220\u9664\u8FD9\u4E2A\u5BF9\u8BDD\uFF1F", confirm: "\u5220\u9664", danger: true }) === void 0) {
|
|
6252
6327
|
return;
|
|
6253
6328
|
}
|
|
6254
6329
|
if (message.type === "open-file") {
|
|
@@ -7553,9 +7628,8 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
7553
7628
|
summary.innerHTML = `${iconHtml(status === "running" ? "loading" : status === "failed" ? "error" : status === "success" ? "check" : "chevron-right")}<span>${escapeHtml(content?.tool ?? item.title ?? "\u8BE6\u60C5")}</span>`;
|
|
7554
7629
|
root.append(summary);
|
|
7555
7630
|
if (["audio", "video"].includes(item.contentType ?? "") && typeof content?.src === "string") {
|
|
7556
|
-
const
|
|
7557
|
-
|
|
7558
|
-
if (/^https?:\/\//i.test(src) || new RegExp(`^data:${item.contentType}/[a-z0-9.+-]+;base64,`, "i").test(src)) {
|
|
7631
|
+
const src = mediaUrl(content.src, item.contentType === "audio" ? "audio" : "video", files, location.href);
|
|
7632
|
+
if (src) {
|
|
7559
7633
|
const media = document.createElement(item.contentType === "audio" ? "audio" : "video");
|
|
7560
7634
|
media.controls = true;
|
|
7561
7635
|
media.preload = "metadata";
|
|
@@ -8184,7 +8258,7 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8184
8258
|
var graphSignature = "";
|
|
8185
8259
|
var editTimer;
|
|
8186
8260
|
var searchTimer;
|
|
8187
|
-
var
|
|
8261
|
+
var prompt;
|
|
8188
8262
|
var promptKey = "";
|
|
8189
8263
|
var narrow = matchMedia("(max-width: 680px)");
|
|
8190
8264
|
var dialogs = new ConversationTools();
|
|
@@ -8348,7 +8422,7 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8348
8422
|
}
|
|
8349
8423
|
element("usage").hidden = state?.account.status !== "authenticated";
|
|
8350
8424
|
element("tools").disabled = !connected;
|
|
8351
|
-
|
|
8425
|
+
prompt?.setBusy(!connected || state?.run?.status === "running" || submitting);
|
|
8352
8426
|
app.dataset.connection = connected ? "connected" : "disconnected";
|
|
8353
8427
|
}
|
|
8354
8428
|
function historyRows(root) {
|
|
@@ -8474,7 +8548,7 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8474
8548
|
renderedRun = run.id;
|
|
8475
8549
|
tab = "result";
|
|
8476
8550
|
graphSignature = "";
|
|
8477
|
-
|
|
8551
|
+
prompt = void 0;
|
|
8478
8552
|
promptKey = "";
|
|
8479
8553
|
element("run-prompt").replaceChildren();
|
|
8480
8554
|
}
|
|
@@ -8516,9 +8590,9 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8516
8590
|
if (key !== promptKey) {
|
|
8517
8591
|
promptKey = key;
|
|
8518
8592
|
element("run-prompt").replaceChildren();
|
|
8519
|
-
|
|
8593
|
+
prompt = void 0;
|
|
8520
8594
|
if (run.pendingInput) {
|
|
8521
|
-
|
|
8595
|
+
prompt = new InputPrompt(run.pendingInput, {
|
|
8522
8596
|
submit: (values) => {
|
|
8523
8597
|
submitting = true;
|
|
8524
8598
|
controls();
|
|
@@ -8527,7 +8601,7 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8527
8601
|
stop: () => post({ type: "workflow-stop" }),
|
|
8528
8602
|
files: (name) => post({ type: "attach", runId: run.id, requestId: run.pendingInput.requestId, paramName: name, entrypointId: run.entrypointId })
|
|
8529
8603
|
});
|
|
8530
|
-
element("run-prompt").append(
|
|
8604
|
+
element("run-prompt").append(prompt.root);
|
|
8531
8605
|
}
|
|
8532
8606
|
}
|
|
8533
8607
|
element("logs-view").textContent = run.logs || "\u6682\u65E0\u65E5\u5FD7";
|
|
@@ -8614,9 +8688,10 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8614
8688
|
post({ type: "workflow-rerun", id: state?.run?.id });
|
|
8615
8689
|
};
|
|
8616
8690
|
element("export-run").onclick = () => post({ type: "workflow-export", id: state?.run?.id });
|
|
8617
|
-
element("delete-run").onclick = () => {
|
|
8618
|
-
|
|
8619
|
-
|
|
8691
|
+
element("delete-run").onclick = async () => {
|
|
8692
|
+
const id = state?.run?.id;
|
|
8693
|
+
if (id && await requestAction({ title: "\u5220\u9664\u8FD9\u6761\u8FD0\u884C\u8BB0\u5F55\uFF1F", confirm: "\u5220\u9664", danger: true }) !== void 0) {
|
|
8694
|
+
post({ type: "workflow-delete", id });
|
|
8620
8695
|
}
|
|
8621
8696
|
};
|
|
8622
8697
|
for (const name of ["result", "flow", "logs"]) {
|
|
@@ -8654,8 +8729,8 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8654
8729
|
}
|
|
8655
8730
|
controls();
|
|
8656
8731
|
} else if (message?.type === "attachments") {
|
|
8657
|
-
if (message.runId &&
|
|
8658
|
-
|
|
8732
|
+
if (message.runId && prompt && message.requestId === prompt.request.requestId) {
|
|
8733
|
+
prompt.fileValue(message.paramName, JSON.stringify(message.files));
|
|
8659
8734
|
} else if (message.entrypointId === entrypointId) {
|
|
8660
8735
|
const field = parameters().fields.find((field2) => field2.name === message.paramName);
|
|
8661
8736
|
if (field) {
|
|
@@ -8676,7 +8751,7 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8676
8751
|
element("error").hidden = false;
|
|
8677
8752
|
}
|
|
8678
8753
|
if (message.requestType === "workflow-resume") {
|
|
8679
|
-
|
|
8754
|
+
prompt?.setBusy(false, message.message);
|
|
8680
8755
|
}
|
|
8681
8756
|
if (message.requestType === "usage") {
|
|
8682
8757
|
dialogs.usageResult(void 0, message.message);
|
|
@@ -991,7 +991,8 @@ var WorkflowController = class {
|
|
|
991
991
|
this.confirmInput(record2, record2.submittingInput);
|
|
992
992
|
}
|
|
993
993
|
if (report.status === "failed") {
|
|
994
|
-
|
|
994
|
+
const data = report.result?.data;
|
|
995
|
+
record2.error = report.result?.error?.message || (data && typeof data === "object" && "errMessage" in data && typeof data.errMessage === "string" ? data.errMessage : "") || "Workflow failed.";
|
|
995
996
|
}
|
|
996
997
|
if (record2.submittingInput && pending && report.status === "failed") {
|
|
997
998
|
record2.status = "waiting_for_input";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow-code/cli",
|
|
3
|
-
"version": "0.2.4-
|
|
3
|
+
"version": "0.2.4-20261011005.codex-cli-web",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"workflow-code": "./dist/index.js"
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@workflow-code/execution-targets": "0.1.0",
|
|
41
41
|
"@workflow-code/i18n": "0.1.0",
|
|
42
42
|
"@workflow-code/openai-responses": "0.1.0",
|
|
43
|
-
"@workflow-code/project-dependencies": "0.1.0",
|
|
44
43
|
"@workflow-code/project-info": "0.1.0",
|
|
44
|
+
"@workflow-code/project-dependencies": "0.1.0",
|
|
45
45
|
"@workflow-code/project-upload": "0.1.0",
|
|
46
46
|
"@workflow-code/runtime-compatibility": "0.1.0",
|
|
47
47
|
"@workflow-code/workflow-ids": "0.1.0",
|