@workflow-code/cli 0.2.4-20261011005.codex-cli-web → 0.2.4-20261011007.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.
@@ -74,6 +74,8 @@ try {
74
74
  createLocalWorkflowKVStore, createWorkflowKVContext, createWorkflowPersistentValueContext,
75
75
  listLocalWorkflowKVEntries, deleteLocalWorkflowKVEntry, getKnowledgeDocument, listKnowledgeDocuments,
76
76
  } = await import(coreUrl);
77
+ const core = await import(coreUrl);
78
+ const { readKanbanProjectInfo, runKanbanDataCall } = await import(new URL(import.meta.url.includes('/src/web/') ? './kanban-data.ts' : './kanban-data.mjs', import.meta.url));
77
79
  if (request.method === 'inspect') {
78
80
  const projects = [];
79
81
  const errors = [];
@@ -95,6 +97,8 @@ try {
95
97
  diagnostics: structure.diagnostics,
96
98
  defaultEntrypoint: structure.defaultEntrypoint,
97
99
  artifactEntry: structure.kanban ? createKanbanArtifactEntryPath(structure.kanban) : undefined,
100
+ kanban: structure.kanban ? { artifactDir: structure.kanban.artifactDir, entry: structure.kanban.entry } : undefined,
101
+ projectInfo: structure.kanban ? readKanbanProjectInfo(pkg) : undefined,
98
102
  conversation: structure.conversation,
99
103
  requiresLogin: await requiresSystemAi(folderPath),
100
104
  });
@@ -138,7 +142,9 @@ try {
138
142
  const reference = JSON.parse(await readFile(path.join(filesDir, id, 'metadata.json'), 'utf8'));
139
143
  return { reference, path: reference.path };
140
144
  };
141
- if (request.method === 'resolve') {
145
+ if (request.method === 'kanban-bridge') {
146
+ send('result', await runKanbanDataCall(core, request.project, request.storageDir, request.call));
147
+ } else if (request.method === 'resolve') {
142
148
  send('result', await resolveLocalWorkflowParams({
143
149
  workflowDir: request.project.folderPath,
144
150
  entrypointId: request.entrypointId,
@@ -4147,6 +4147,7 @@ ${state.user?.avatarUrl ?? ""}`;
4147
4147
  }, { once: true });
4148
4148
  }
4149
4149
  emit;
4150
+ clientId = crypto.randomUUID();
4150
4151
  source;
4151
4152
  banner;
4152
4153
  connecting;
@@ -4213,7 +4214,9 @@ ${state.user?.avatarUrl ?? ""}`;
4213
4214
  if (!session.ok) {
4214
4215
  throw new Error("Cannot connect to the project.");
4215
4216
  }
4216
- const source = this.source = new EventSource(this.fileUrl("/api/events"));
4217
+ const eventsUrl = new URL(this.fileUrl("/api/events"), location.href);
4218
+ eventsUrl.searchParams.set("clientId", this.clientId);
4219
+ const source = this.source = new EventSource(eventsUrl.href);
4217
4220
  source.onopen = () => {
4218
4221
  this.attempts = 0;
4219
4222
  this.update("connected");
@@ -4246,7 +4249,8 @@ ${state.user?.avatarUrl ?? ""}`;
4246
4249
  }
4247
4250
  let response;
4248
4251
  try {
4249
- response = await fetch("/api/message", { method: "POST", headers: { ...this.headers(), "Content-Type": "application/json" }, body: JSON.stringify(message) });
4252
+ const body = ["kanban-method-state", "kanban-method-reply"].includes(message.type) ? { ...message, clientId: this.clientId } : message;
4253
+ response = await fetch("/api/message", { method: "POST", headers: { ...this.headers(), "Content-Type": "application/json" }, body: JSON.stringify(body) });
4250
4254
  } catch {
4251
4255
  this.interrupted();
4252
4256
  throw new ConnectionError("\u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002");
@@ -6001,6 +6001,7 @@ ${state2.user?.avatarUrl ?? ""}`;
6001
6001
  }, { once: true });
6002
6002
  }
6003
6003
  emit;
6004
+ clientId = crypto.randomUUID();
6004
6005
  source;
6005
6006
  banner;
6006
6007
  connecting;
@@ -6067,7 +6068,9 @@ ${state2.user?.avatarUrl ?? ""}`;
6067
6068
  if (!session.ok) {
6068
6069
  throw new Error("Cannot connect to the project.");
6069
6070
  }
6070
- const source = this.source = new EventSource(this.fileUrl("/api/events"));
6071
+ const eventsUrl = new URL(this.fileUrl("/api/events"), location.href);
6072
+ eventsUrl.searchParams.set("clientId", this.clientId);
6073
+ const source = this.source = new EventSource(eventsUrl.href);
6071
6074
  source.onopen = () => {
6072
6075
  this.attempts = 0;
6073
6076
  this.update("connected");
@@ -6100,7 +6103,8 @@ ${state2.user?.avatarUrl ?? ""}`;
6100
6103
  }
6101
6104
  let response;
6102
6105
  try {
6103
- response = await fetch("/api/message", { method: "POST", headers: { ...this.headers(), "Content-Type": "application/json" }, body: JSON.stringify(message) });
6106
+ const body = ["kanban-method-state", "kanban-method-reply"].includes(message.type) ? { ...message, clientId: this.clientId } : message;
6107
+ response = await fetch("/api/message", { method: "POST", headers: { ...this.headers(), "Content-Type": "application/json" }, body: JSON.stringify(body) });
6104
6108
  } catch {
6105
6109
  this.interrupted();
6106
6110
  throw new ConnectionError("\u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002");
@@ -6979,11 +6983,33 @@ ${state2.user?.avatarUrl ?? ""}`;
6979
6983
  try {
6980
6984
  const files = JSON.parse(String(value || "[]"));
6981
6985
  const list = Array.isArray(files) ? files : [files];
6982
- view.root.querySelector(".param-file-summary").textContent = list.map((file) => file?.name ?? "").join(", ");
6986
+ const summary = view.root.querySelector(".param-file-summary");
6987
+ if (this.options.downloadFile && summary.getAttribute("data-value") !== String(value)) {
6988
+ summary.setAttribute("data-value", String(value));
6989
+ summary.replaceChildren();
6990
+ for (const file of list.filter((file2) => file2 && typeof file2.id === "string")) {
6991
+ const row = document.createElement("span");
6992
+ row.className = "param-file-row";
6993
+ const name2 = document.createElement("span");
6994
+ name2.textContent = file.name;
6995
+ row.append(name2);
6996
+ const download = iconButton("cloud-download", "\u4E0B\u8F7D\u6587\u4EF6", () => this.options.downloadFile(file.id));
6997
+ const remove = iconButton("close", "\u79FB\u9664\u6587\u4EF6", () => this.options.change(field.name, JSON.stringify(list.filter((item) => item !== file))));
6998
+ download.classList.add("param-file-download");
6999
+ remove.classList.add("param-file-remove");
7000
+ row.append(download, remove);
7001
+ summary.append(row);
7002
+ }
7003
+ } else if (!this.options.downloadFile) {
7004
+ summary.textContent = list.map((file) => file?.name ?? "").join(", ");
7005
+ }
7006
+ for (const button of summary.querySelectorAll("button")) {
7007
+ button.disabled = this.options.disabled() || button.classList.contains("param-file-remove") && this.options.loading();
7008
+ }
6983
7009
  } catch {
6984
7010
  view.root.querySelector(".param-file-summary").textContent = "";
6985
7011
  }
6986
- view.root.querySelector("button").disabled = this.options.disabled() || this.options.loading() || !!state2?.disabled;
7012
+ view.root.querySelector(".param-file-button").disabled = this.options.disabled() || this.options.loading() || !!state2?.disabled;
6987
7013
  }
6988
7014
  }
6989
7015
  this.root.hidden = !Array.from(this.root.children).some((root) => !root.hidden);