@workflow-code/cli 0.2.4-20261011008.codex-cli-web → 0.2.4-20261012001.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
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-V5NX5ERI.js");
|
|
28
28
|
return webCli.main(argv.slice(1));
|
|
29
29
|
}
|
|
30
30
|
if (argv[0] === "workspace") {
|
|
@@ -2704,6 +2704,87 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
2704
2704
|
});
|
|
2705
2705
|
}
|
|
2706
2706
|
|
|
2707
|
+
// src/web/ui/trace-bridge.ts
|
|
2708
|
+
function traceSnapshot(state2) {
|
|
2709
|
+
const project2 = state2.project;
|
|
2710
|
+
if (!project2 || !["conversation", "workflow"].includes(project2.projectType)) {
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
const base = { project: { id: project2.id, name: project2.name, projectType: project2.projectType }, running: state2.running };
|
|
2714
|
+
if (project2.projectType === "workflow") {
|
|
2715
|
+
return { ...base, runs: state2.runs, selectedId: state2.selectedId, run: state2.run, occupiedRun: state2.occupiedRun, history: state2.history };
|
|
2716
|
+
}
|
|
2717
|
+
return { ...base, activeId: state2.activeId, sessions: (state2.sessions ?? []).map((session) => ({
|
|
2718
|
+
id: session.id,
|
|
2719
|
+
title: session.title,
|
|
2720
|
+
createdAt: session.createdAt,
|
|
2721
|
+
updatedAt: session.updatedAt,
|
|
2722
|
+
messages: (session.messages ?? []).map((message) => {
|
|
2723
|
+
const { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs } = message;
|
|
2724
|
+
return { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs };
|
|
2725
|
+
})
|
|
2726
|
+
})) };
|
|
2727
|
+
}
|
|
2728
|
+
var TraceBridge = class {
|
|
2729
|
+
constructor(send) {
|
|
2730
|
+
this.send = send;
|
|
2731
|
+
}
|
|
2732
|
+
send;
|
|
2733
|
+
enabled = false;
|
|
2734
|
+
snapshot;
|
|
2735
|
+
status = "connecting";
|
|
2736
|
+
get active() {
|
|
2737
|
+
return this.enabled;
|
|
2738
|
+
}
|
|
2739
|
+
enable(version) {
|
|
2740
|
+
this.enabled = version === 1;
|
|
2741
|
+
if (this.enabled) {
|
|
2742
|
+
this.publish("status", { status: this.status });
|
|
2743
|
+
if (this.snapshot) {
|
|
2744
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
receive(message) {
|
|
2749
|
+
if (message.type === "state") {
|
|
2750
|
+
this.snapshot = traceSnapshot(message);
|
|
2751
|
+
if (this.snapshot) {
|
|
2752
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
if (message.type === "connection") {
|
|
2756
|
+
this.status = message.status;
|
|
2757
|
+
this.publish("status", { status: this.status });
|
|
2758
|
+
}
|
|
2759
|
+
if (message.type === "trace-run") {
|
|
2760
|
+
this.publish("run", { run: message.run, runId: message.runId, error: message.error });
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
open(target) {
|
|
2764
|
+
if (!this.enabled) {
|
|
2765
|
+
return false;
|
|
2766
|
+
}
|
|
2767
|
+
this.publish("open", { target: { sessionId: target.sessionId, messageId: target.messageId, runId: target.runId } });
|
|
2768
|
+
return true;
|
|
2769
|
+
}
|
|
2770
|
+
command(value) {
|
|
2771
|
+
if (!this.enabled || this.snapshot?.project.projectType !== "workflow") {
|
|
2772
|
+
return;
|
|
2773
|
+
}
|
|
2774
|
+
if (value?.type === "run" && typeof value.runId === "string") {
|
|
2775
|
+
return { type: "workflow-trace", id: value.runId };
|
|
2776
|
+
}
|
|
2777
|
+
if (value?.type === "more") {
|
|
2778
|
+
return { type: "workflow-history", query: "", more: true };
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
publish(kind, value) {
|
|
2782
|
+
if (this.enabled) {
|
|
2783
|
+
this.send({ type: "workflow-trace", version: 1, kind, ...value });
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
};
|
|
2787
|
+
|
|
2707
2788
|
// src/web/ui/host.ts
|
|
2708
2789
|
function acquireWorkflowHost() {
|
|
2709
2790
|
const embedded = globalThis.acquireVsCodeApi;
|
|
@@ -2720,10 +2801,16 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
2720
2801
|
}
|
|
2721
2802
|
const storageKey = `workflow-web:${document.querySelector("meta[name=workflow-project]")?.content ?? location.pathname}`;
|
|
2722
2803
|
const emit = (message) => window.dispatchEvent(new MessageEvent("message", { data: message }));
|
|
2804
|
+
const trace = new TraceBridge((message) => {
|
|
2805
|
+
if (window.parent !== window) {
|
|
2806
|
+
window.parent.postMessage(message, "*");
|
|
2807
|
+
}
|
|
2808
|
+
});
|
|
2723
2809
|
const connection = new BrowserConnection((message) => {
|
|
2724
2810
|
if (message.type === "state" && message.account) {
|
|
2725
2811
|
accountPanel.update(message.account);
|
|
2726
2812
|
}
|
|
2813
|
+
trace.receive(message);
|
|
2727
2814
|
emit(message);
|
|
2728
2815
|
});
|
|
2729
2816
|
const request2 = async (message) => {
|
|
@@ -2738,11 +2825,25 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
2738
2825
|
if (event.data.theme === "dark" || event.data.theme === "light") {
|
|
2739
2826
|
document.documentElement.dataset.theme = event.data.theme;
|
|
2740
2827
|
}
|
|
2828
|
+
if (event.data.traceVersion !== void 0) {
|
|
2829
|
+
trace.enable(event.data.traceVersion);
|
|
2830
|
+
}
|
|
2831
|
+
const traceCommand = trace.command(event.data.traceCommand);
|
|
2832
|
+
if (traceCommand) {
|
|
2833
|
+
void request2(traceCommand).catch((error) => trace.receive({ type: "trace-run", runId: traceCommand.id, error: error.message }));
|
|
2834
|
+
}
|
|
2741
2835
|
if (event.data.command === "new" || event.data.command === "history") {
|
|
2742
2836
|
emit({ type: "assistant-command", command: event.data.command });
|
|
2743
2837
|
}
|
|
2744
2838
|
});
|
|
2745
2839
|
const handleReply = (reply) => {
|
|
2840
|
+
trace.receive(reply);
|
|
2841
|
+
if (reply.type === "trace-run") {
|
|
2842
|
+
if (!trace.active) {
|
|
2843
|
+
handleReply({ type: "preview", title: "\u8F68\u8FF9", content: reply.run });
|
|
2844
|
+
}
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2746
2847
|
if (reply.type === "download") {
|
|
2747
2848
|
const url = URL.createObjectURL(new Blob([reply.content], { type: reply.mimeType ?? "application/json" }));
|
|
2748
2849
|
const link = document.createElement("a");
|
|
@@ -2810,6 +2911,14 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
2810
2911
|
if (message.type === "ready") {
|
|
2811
2912
|
return;
|
|
2812
2913
|
}
|
|
2914
|
+
if (message.type === "trace") {
|
|
2915
|
+
if (trace.open(message)) {
|
|
2916
|
+
return;
|
|
2917
|
+
}
|
|
2918
|
+
if (message.runId && !message.messageId) {
|
|
2919
|
+
message = { type: "workflow-trace", id: message.runId };
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2813
2922
|
if (message.type === "copy") {
|
|
2814
2923
|
void navigator.clipboard.writeText(message.text).catch((error) => emit({ type: "error", message: error.message }));
|
|
2815
2924
|
return;
|
package/dist/web/workflow-ui.js
CHANGED
|
@@ -4395,6 +4395,87 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4395
4395
|
});
|
|
4396
4396
|
}
|
|
4397
4397
|
|
|
4398
|
+
// src/web/ui/trace-bridge.ts
|
|
4399
|
+
function traceSnapshot(state) {
|
|
4400
|
+
const project = state.project;
|
|
4401
|
+
if (!project || !["conversation", "workflow"].includes(project.projectType)) {
|
|
4402
|
+
return;
|
|
4403
|
+
}
|
|
4404
|
+
const base = { project: { id: project.id, name: project.name, projectType: project.projectType }, running: state.running };
|
|
4405
|
+
if (project.projectType === "workflow") {
|
|
4406
|
+
return { ...base, runs: state.runs, selectedId: state.selectedId, run: state.run, occupiedRun: state.occupiedRun, history: state.history };
|
|
4407
|
+
}
|
|
4408
|
+
return { ...base, activeId: state.activeId, sessions: (state.sessions ?? []).map((session) => ({
|
|
4409
|
+
id: session.id,
|
|
4410
|
+
title: session.title,
|
|
4411
|
+
createdAt: session.createdAt,
|
|
4412
|
+
updatedAt: session.updatedAt,
|
|
4413
|
+
messages: (session.messages ?? []).map((message) => {
|
|
4414
|
+
const { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs } = message;
|
|
4415
|
+
return { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs };
|
|
4416
|
+
})
|
|
4417
|
+
})) };
|
|
4418
|
+
}
|
|
4419
|
+
var TraceBridge = class {
|
|
4420
|
+
constructor(send) {
|
|
4421
|
+
this.send = send;
|
|
4422
|
+
}
|
|
4423
|
+
send;
|
|
4424
|
+
enabled = false;
|
|
4425
|
+
snapshot;
|
|
4426
|
+
status = "connecting";
|
|
4427
|
+
get active() {
|
|
4428
|
+
return this.enabled;
|
|
4429
|
+
}
|
|
4430
|
+
enable(version) {
|
|
4431
|
+
this.enabled = version === 1;
|
|
4432
|
+
if (this.enabled) {
|
|
4433
|
+
this.publish("status", { status: this.status });
|
|
4434
|
+
if (this.snapshot) {
|
|
4435
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
}
|
|
4439
|
+
receive(message) {
|
|
4440
|
+
if (message.type === "state") {
|
|
4441
|
+
this.snapshot = traceSnapshot(message);
|
|
4442
|
+
if (this.snapshot) {
|
|
4443
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
if (message.type === "connection") {
|
|
4447
|
+
this.status = message.status;
|
|
4448
|
+
this.publish("status", { status: this.status });
|
|
4449
|
+
}
|
|
4450
|
+
if (message.type === "trace-run") {
|
|
4451
|
+
this.publish("run", { run: message.run, runId: message.runId, error: message.error });
|
|
4452
|
+
}
|
|
4453
|
+
}
|
|
4454
|
+
open(target) {
|
|
4455
|
+
if (!this.enabled) {
|
|
4456
|
+
return false;
|
|
4457
|
+
}
|
|
4458
|
+
this.publish("open", { target: { sessionId: target.sessionId, messageId: target.messageId, runId: target.runId } });
|
|
4459
|
+
return true;
|
|
4460
|
+
}
|
|
4461
|
+
command(value) {
|
|
4462
|
+
if (!this.enabled || this.snapshot?.project.projectType !== "workflow") {
|
|
4463
|
+
return;
|
|
4464
|
+
}
|
|
4465
|
+
if (value?.type === "run" && typeof value.runId === "string") {
|
|
4466
|
+
return { type: "workflow-trace", id: value.runId };
|
|
4467
|
+
}
|
|
4468
|
+
if (value?.type === "more") {
|
|
4469
|
+
return { type: "workflow-history", query: "", more: true };
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
publish(kind, value) {
|
|
4473
|
+
if (this.enabled) {
|
|
4474
|
+
this.send({ type: "workflow-trace", version: 1, kind, ...value });
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
};
|
|
4478
|
+
|
|
4398
4479
|
// src/web/ui/host.ts
|
|
4399
4480
|
function acquireWorkflowHost() {
|
|
4400
4481
|
const embedded = globalThis.acquireVsCodeApi;
|
|
@@ -4411,10 +4492,16 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4411
4492
|
}
|
|
4412
4493
|
const storageKey = `workflow-web:${document.querySelector("meta[name=workflow-project]")?.content ?? location.pathname}`;
|
|
4413
4494
|
const emit = (message) => window.dispatchEvent(new MessageEvent("message", { data: message }));
|
|
4495
|
+
const trace = new TraceBridge((message) => {
|
|
4496
|
+
if (window.parent !== window) {
|
|
4497
|
+
window.parent.postMessage(message, "*");
|
|
4498
|
+
}
|
|
4499
|
+
});
|
|
4414
4500
|
const connection = new BrowserConnection((message) => {
|
|
4415
4501
|
if (message.type === "state" && message.account) {
|
|
4416
4502
|
accountPanel.update(message.account);
|
|
4417
4503
|
}
|
|
4504
|
+
trace.receive(message);
|
|
4418
4505
|
emit(message);
|
|
4419
4506
|
});
|
|
4420
4507
|
const request = async (message) => {
|
|
@@ -4429,11 +4516,25 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4429
4516
|
if (event.data.theme === "dark" || event.data.theme === "light") {
|
|
4430
4517
|
document.documentElement.dataset.theme = event.data.theme;
|
|
4431
4518
|
}
|
|
4519
|
+
if (event.data.traceVersion !== void 0) {
|
|
4520
|
+
trace.enable(event.data.traceVersion);
|
|
4521
|
+
}
|
|
4522
|
+
const traceCommand = trace.command(event.data.traceCommand);
|
|
4523
|
+
if (traceCommand) {
|
|
4524
|
+
void request(traceCommand).catch((error) => trace.receive({ type: "trace-run", runId: traceCommand.id, error: error.message }));
|
|
4525
|
+
}
|
|
4432
4526
|
if (event.data.command === "new" || event.data.command === "history") {
|
|
4433
4527
|
emit({ type: "assistant-command", command: event.data.command });
|
|
4434
4528
|
}
|
|
4435
4529
|
});
|
|
4436
4530
|
const handleReply = (reply) => {
|
|
4531
|
+
trace.receive(reply);
|
|
4532
|
+
if (reply.type === "trace-run") {
|
|
4533
|
+
if (!trace.active) {
|
|
4534
|
+
handleReply({ type: "preview", title: "\u8F68\u8FF9", content: reply.run });
|
|
4535
|
+
}
|
|
4536
|
+
return;
|
|
4537
|
+
}
|
|
4437
4538
|
if (reply.type === "download") {
|
|
4438
4539
|
const url = URL.createObjectURL(new Blob([reply.content], { type: reply.mimeType ?? "application/json" }));
|
|
4439
4540
|
const link = document.createElement("a");
|
|
@@ -4501,6 +4602,14 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
4501
4602
|
if (message.type === "ready") {
|
|
4502
4603
|
return;
|
|
4503
4604
|
}
|
|
4605
|
+
if (message.type === "trace") {
|
|
4606
|
+
if (trace.open(message)) {
|
|
4607
|
+
return;
|
|
4608
|
+
}
|
|
4609
|
+
if (message.runId && !message.messageId) {
|
|
4610
|
+
message = { type: "workflow-trace", id: message.runId };
|
|
4611
|
+
}
|
|
4612
|
+
}
|
|
4504
4613
|
if (message.type === "copy") {
|
|
4505
4614
|
void navigator.clipboard.writeText(message.text).catch((error) => emit({ type: "error", message: error.message }));
|
|
4506
4615
|
return;
|
|
@@ -5268,7 +5377,7 @@ ${state.user?.avatarUrl ?? ""}`;
|
|
|
5268
5377
|
resource: (card) => post({ type: "resource", messageId: view.message.id, cardId: card.id })
|
|
5269
5378
|
});
|
|
5270
5379
|
const actions = root.querySelector(".message-actions");
|
|
5271
|
-
actions.prepend(iconButton("
|
|
5380
|
+
actions.prepend(iconButton("history", "\u8F68\u8FF9", () => post({ type: "trace", messageId: view.message.id, runId: view.message.runId })));
|
|
5272
5381
|
const exportButton = iconButton("export", "\u5BFC\u51FA\u8FD0\u884C\u8BB0\u5F55", () => {
|
|
5273
5382
|
exportButton.disabled = true;
|
|
5274
5383
|
exportButton.innerHTML = iconHtml("loading");
|
|
@@ -6248,6 +6248,87 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6248
6248
|
});
|
|
6249
6249
|
}
|
|
6250
6250
|
|
|
6251
|
+
// src/web/ui/trace-bridge.ts
|
|
6252
|
+
function traceSnapshot(state2) {
|
|
6253
|
+
const project = state2.project;
|
|
6254
|
+
if (!project || !["conversation", "workflow"].includes(project.projectType)) {
|
|
6255
|
+
return;
|
|
6256
|
+
}
|
|
6257
|
+
const base = { project: { id: project.id, name: project.name, projectType: project.projectType }, running: state2.running };
|
|
6258
|
+
if (project.projectType === "workflow") {
|
|
6259
|
+
return { ...base, runs: state2.runs, selectedId: state2.selectedId, run: state2.run, occupiedRun: state2.occupiedRun, history: state2.history };
|
|
6260
|
+
}
|
|
6261
|
+
return { ...base, activeId: state2.activeId, sessions: (state2.sessions ?? []).map((session) => ({
|
|
6262
|
+
id: session.id,
|
|
6263
|
+
title: session.title,
|
|
6264
|
+
createdAt: session.createdAt,
|
|
6265
|
+
updatedAt: session.updatedAt,
|
|
6266
|
+
messages: (session.messages ?? []).map((message) => {
|
|
6267
|
+
const { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs } = message;
|
|
6268
|
+
return { id, role, content, items, error, status, durationMs, createdAt, model, runId, report, events, pendingInput, resolvedInputs };
|
|
6269
|
+
})
|
|
6270
|
+
})) };
|
|
6271
|
+
}
|
|
6272
|
+
var TraceBridge = class {
|
|
6273
|
+
constructor(send) {
|
|
6274
|
+
this.send = send;
|
|
6275
|
+
}
|
|
6276
|
+
send;
|
|
6277
|
+
enabled = false;
|
|
6278
|
+
snapshot;
|
|
6279
|
+
status = "connecting";
|
|
6280
|
+
get active() {
|
|
6281
|
+
return this.enabled;
|
|
6282
|
+
}
|
|
6283
|
+
enable(version) {
|
|
6284
|
+
this.enabled = version === 1;
|
|
6285
|
+
if (this.enabled) {
|
|
6286
|
+
this.publish("status", { status: this.status });
|
|
6287
|
+
if (this.snapshot) {
|
|
6288
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
6289
|
+
}
|
|
6290
|
+
}
|
|
6291
|
+
}
|
|
6292
|
+
receive(message) {
|
|
6293
|
+
if (message.type === "state") {
|
|
6294
|
+
this.snapshot = traceSnapshot(message);
|
|
6295
|
+
if (this.snapshot) {
|
|
6296
|
+
this.publish("state", { snapshot: this.snapshot });
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6299
|
+
if (message.type === "connection") {
|
|
6300
|
+
this.status = message.status;
|
|
6301
|
+
this.publish("status", { status: this.status });
|
|
6302
|
+
}
|
|
6303
|
+
if (message.type === "trace-run") {
|
|
6304
|
+
this.publish("run", { run: message.run, runId: message.runId, error: message.error });
|
|
6305
|
+
}
|
|
6306
|
+
}
|
|
6307
|
+
open(target) {
|
|
6308
|
+
if (!this.enabled) {
|
|
6309
|
+
return false;
|
|
6310
|
+
}
|
|
6311
|
+
this.publish("open", { target: { sessionId: target.sessionId, messageId: target.messageId, runId: target.runId } });
|
|
6312
|
+
return true;
|
|
6313
|
+
}
|
|
6314
|
+
command(value) {
|
|
6315
|
+
if (!this.enabled || this.snapshot?.project.projectType !== "workflow") {
|
|
6316
|
+
return;
|
|
6317
|
+
}
|
|
6318
|
+
if (value?.type === "run" && typeof value.runId === "string") {
|
|
6319
|
+
return { type: "workflow-trace", id: value.runId };
|
|
6320
|
+
}
|
|
6321
|
+
if (value?.type === "more") {
|
|
6322
|
+
return { type: "workflow-history", query: "", more: true };
|
|
6323
|
+
}
|
|
6324
|
+
}
|
|
6325
|
+
publish(kind, value) {
|
|
6326
|
+
if (this.enabled) {
|
|
6327
|
+
this.send({ type: "workflow-trace", version: 1, kind, ...value });
|
|
6328
|
+
}
|
|
6329
|
+
}
|
|
6330
|
+
};
|
|
6331
|
+
|
|
6251
6332
|
// src/web/ui/host.ts
|
|
6252
6333
|
function acquireWorkflowHost() {
|
|
6253
6334
|
const embedded = globalThis.acquireVsCodeApi;
|
|
@@ -6264,10 +6345,16 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6264
6345
|
}
|
|
6265
6346
|
const storageKey = `workflow-web:${document.querySelector("meta[name=workflow-project]")?.content ?? location.pathname}`;
|
|
6266
6347
|
const emit = (message) => window.dispatchEvent(new MessageEvent("message", { data: message }));
|
|
6348
|
+
const trace = new TraceBridge((message) => {
|
|
6349
|
+
if (window.parent !== window) {
|
|
6350
|
+
window.parent.postMessage(message, "*");
|
|
6351
|
+
}
|
|
6352
|
+
});
|
|
6267
6353
|
const connection = new BrowserConnection((message) => {
|
|
6268
6354
|
if (message.type === "state" && message.account) {
|
|
6269
6355
|
accountPanel.update(message.account);
|
|
6270
6356
|
}
|
|
6357
|
+
trace.receive(message);
|
|
6271
6358
|
emit(message);
|
|
6272
6359
|
});
|
|
6273
6360
|
const request = async (message) => {
|
|
@@ -6282,11 +6369,25 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6282
6369
|
if (event.data.theme === "dark" || event.data.theme === "light") {
|
|
6283
6370
|
document.documentElement.dataset.theme = event.data.theme;
|
|
6284
6371
|
}
|
|
6372
|
+
if (event.data.traceVersion !== void 0) {
|
|
6373
|
+
trace.enable(event.data.traceVersion);
|
|
6374
|
+
}
|
|
6375
|
+
const traceCommand = trace.command(event.data.traceCommand);
|
|
6376
|
+
if (traceCommand) {
|
|
6377
|
+
void request(traceCommand).catch((error) => trace.receive({ type: "trace-run", runId: traceCommand.id, error: error.message }));
|
|
6378
|
+
}
|
|
6285
6379
|
if (event.data.command === "new" || event.data.command === "history") {
|
|
6286
6380
|
emit({ type: "assistant-command", command: event.data.command });
|
|
6287
6381
|
}
|
|
6288
6382
|
});
|
|
6289
6383
|
const handleReply = (reply) => {
|
|
6384
|
+
trace.receive(reply);
|
|
6385
|
+
if (reply.type === "trace-run") {
|
|
6386
|
+
if (!trace.active) {
|
|
6387
|
+
handleReply({ type: "preview", title: "\u8F68\u8FF9", content: reply.run });
|
|
6388
|
+
}
|
|
6389
|
+
return;
|
|
6390
|
+
}
|
|
6290
6391
|
if (reply.type === "download") {
|
|
6291
6392
|
const url = URL.createObjectURL(new Blob([reply.content], { type: reply.mimeType ?? "application/json" }));
|
|
6292
6393
|
const link = document.createElement("a");
|
|
@@ -6354,6 +6455,14 @@ ${state2.user?.avatarUrl ?? ""}`;
|
|
|
6354
6455
|
if (message.type === "ready") {
|
|
6355
6456
|
return;
|
|
6356
6457
|
}
|
|
6458
|
+
if (message.type === "trace") {
|
|
6459
|
+
if (trace.open(message)) {
|
|
6460
|
+
return;
|
|
6461
|
+
}
|
|
6462
|
+
if (message.runId && !message.messageId) {
|
|
6463
|
+
message = { type: "workflow-trace", id: message.runId };
|
|
6464
|
+
}
|
|
6465
|
+
}
|
|
6357
6466
|
if (message.type === "copy") {
|
|
6358
6467
|
void navigator.clipboard.writeText(message.text).catch((error) => emit({ type: "error", message: error.message }));
|
|
6359
6468
|
return;
|
|
@@ -8306,6 +8415,9 @@ ${JSON.stringify(output2.details, null, 2)}` : "");
|
|
|
8306
8415
|
</main><dialog id="history-dialog" class="conversation-dialog"><header><label class="history-search">${iconHtml("search")}<input id="search-history" type="search" placeholder="\u641C\u7D22\u8FD0\u884C\u8BB0\u5F55" aria-label="\u641C\u7D22\u8FD0\u884C\u8BB0\u5F55"></label><button id="close-history" class="icon-button" title="\u5173\u95ED" aria-label="\u5173\u95ED">${iconHtml("close")}</button></header><div id="search-results" class="dialog-body"></div><button id="search-more" class="all-history" hidden>\u52A0\u8F7D\u66F4\u591A</button></dialog>
|
|
8307
8416
|
<dialog id="node-dialog" class="conversation-dialog"><header><h2 id="node-title"></h2><button id="close-node" class="icon-button" title="\u5173\u95ED" aria-label="\u5173\u95ED">${iconHtml("close")}</button></header><pre id="node-detail" class="dialog-body web-preview"></pre></dialog>`;
|
|
8308
8417
|
var element = (id) => document.getElementById(id);
|
|
8418
|
+
var traceButton = iconButton("history", "\u8F68\u8FF9", () => post({ type: "trace", runId: state?.run?.id }));
|
|
8419
|
+
traceButton.id = "open-trace";
|
|
8420
|
+
document.querySelector(".run-heading-actions").prepend(traceButton);
|
|
8309
8421
|
var state;
|
|
8310
8422
|
var entrypointId;
|
|
8311
8423
|
var entrySignature = "";
|
|
@@ -481,8 +481,9 @@ var ConversationController = class {
|
|
|
481
481
|
answer.report = report;
|
|
482
482
|
answer.status = report.status;
|
|
483
483
|
answer.durationMs = report.durationMs;
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
const items = report.output?.items ?? [];
|
|
485
|
+
if (report.output && (report.status === "success" || !answer.items?.length || report.status !== "waiting_for_input" && items.length)) {
|
|
486
|
+
answer.items = items;
|
|
486
487
|
answer.content = outputText(answer.items);
|
|
487
488
|
}
|
|
488
489
|
answer.pendingInput = report.status === "waiting_for_input" ? report.pendingUserInput : void 0;
|
|
@@ -1004,8 +1005,9 @@ var WorkflowController = class {
|
|
|
1004
1005
|
record2.report = report;
|
|
1005
1006
|
record2.durationMs = report.durationMs;
|
|
1006
1007
|
record2.status = report.status;
|
|
1007
|
-
|
|
1008
|
-
|
|
1008
|
+
const items = report.output?.items ?? [];
|
|
1009
|
+
if (report.output && (report.status === "success" || !record2.items.length || report.status !== "waiting_for_input" && items.length)) {
|
|
1010
|
+
record2.items = items;
|
|
1009
1011
|
}
|
|
1010
1012
|
record2.nodes = report.nodes ?? record2.nodes;
|
|
1011
1013
|
record2.logs = report.logs ?? record2.logs;
|
|
@@ -2026,6 +2028,14 @@ function createWorkflowActions(controller, runtime, project, revision, changed)
|
|
|
2026
2028
|
case "workflow-select":
|
|
2027
2029
|
await controller.select(message.id ? String(message.id) : void 0);
|
|
2028
2030
|
break;
|
|
2031
|
+
case "workflow-trace": {
|
|
2032
|
+
const run = controller.runs.find((record2) => record2.id === message.id);
|
|
2033
|
+
if (!run) {
|
|
2034
|
+
throw new Error("Run no longer exists.");
|
|
2035
|
+
}
|
|
2036
|
+
replies.push({ type: "trace-run", runId: run.id, run });
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2029
2039
|
case "workflow-draft": {
|
|
2030
2040
|
const draft = { values: values(message.params ?? {}, id) };
|
|
2031
2041
|
if (message.inputMode !== void 0) {
|
|
@@ -2853,7 +2863,7 @@ ${token}`;
|
|
|
2853
2863
|
if (message.type === "export-message") {
|
|
2854
2864
|
replies.push({ type: "download", name: `run-${answer.id}.json`, content: JSON.stringify(redactWorkflowData(answer, [...sensitiveTokens], false), null, 2) }, { type: "exported", sessionId: current.id, messageId: answer.id });
|
|
2855
2865
|
} else {
|
|
2856
|
-
replies.push({ type: "preview", title: message.type === "logs" ? "\u8FD0\u884C\u65E5\u5FD7" : "\
|
|
2866
|
+
replies.push({ type: "preview", title: message.type === "logs" ? "\u8FD0\u884C\u65E5\u5FD7" : "\u8F68\u8FF9", content: message.type === "logs" ? answer.report?.logs ?? "" : { report: answer.report, events: answer.events, items: answer.items } });
|
|
2857
2867
|
}
|
|
2858
2868
|
break;
|
|
2859
2869
|
}
|
|
@@ -3275,7 +3285,7 @@ async function main(argv) {
|
|
|
3275
3285
|
};
|
|
3276
3286
|
process.once("SIGINT", close);
|
|
3277
3287
|
process.once("SIGTERM", close);
|
|
3278
|
-
console.log(options.json ? JSON.stringify({ type: "ready", protocolVersion: 1, hostProtocolVersion: 1, assistantProtocolVersion: host?.assistant ? ASSISTANT_PROTOCOL_VERSION : void 0, url: app.url, project: { id: app.project.id, name: app.project.name, projectType: app.project.projectType }, runtime: app.project.runtime }) : `Workflow Web: ${app.url}`);
|
|
3288
|
+
console.log(options.json ? JSON.stringify({ type: "ready", protocolVersion: 1, hostProtocolVersion: 1, traceProtocolVersion: 1, assistantProtocolVersion: host?.assistant ? ASSISTANT_PROTOCOL_VERSION : void 0, url: app.url, project: { id: app.project.id, name: app.project.name, projectType: app.project.projectType }, runtime: app.project.runtime }) : `Workflow Web: ${app.url}`);
|
|
3279
3289
|
if (lines) {
|
|
3280
3290
|
void (async () => {
|
|
3281
3291
|
try {
|
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-20261012001.codex-cli-web",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"workflow-code": "./dist/index.js"
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@workflow-code/project-dependencies": "0.1.0",
|
|
45
45
|
"@workflow-code/project-info": "0.1.0",
|
|
46
46
|
"@workflow-code/runtime-compatibility": "0.1.0",
|
|
47
|
-
"@workflow-code/
|
|
47
|
+
"@workflow-code/workflow-ids": "0.1.0",
|
|
48
48
|
"@workflow-code/workflow-mcp": "0.1.0",
|
|
49
|
-
"@workflow-code/
|
|
49
|
+
"@workflow-code/project-upload": "0.1.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"bootstrap": "node scripts/bootstrap.mjs",
|