@workflow-code/cli 0.2.4-20261013004.codex-studio-integration → 0.2.4-20261013006.codex-studio-integration

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.
@@ -12607,6 +12607,45 @@
12607
12607
  "{0}{1} \xB7 {2} items": "\u5DF2{0}{1} \xB7 {2} \u9879",
12608
12608
  "{1} in {0}": "{0} \u4E2D {1}",
12609
12609
  "Account balance ${0}": "\u8D26\u6237\u4F59\u989D ${0}",
12610
+ "Account balance": "\u8D26\u6237\u4F59\u989D",
12611
+ "Account changed. Refresh usage.": "\u8D26\u53F7\u5DF2\u5207\u6362\uFF0C\u8BF7\u91CD\u65B0\u83B7\u53D6\u7528\u91CF\u3002",
12612
+ "AI usage": "AI \u7528\u91CF",
12613
+ All: "\u5168\u90E8",
12614
+ "Basic information": "\u57FA\u672C\u4FE1\u606F",
12615
+ Declarations: "\u58F0\u660E",
12616
+ "Default name": "\u9ED8\u8BA4\u540D\u79F0",
12617
+ "Entrypoints granted": "\u5165\u53E3\u8C03\u7528\u6388\u6743",
12618
+ "Knowledge read granted": "\u77E5\u8BC6\u5E93\u8BFB\u53D6\u6388\u6743",
12619
+ "Knowledge write granted": "\u77E5\u8BC6\u5E93\u5199\u5165\u6388\u6743",
12620
+ "KV read granted": "KV \u8BFB\u53D6\u6388\u6743",
12621
+ "KV write granted": "KV \u5199\u5165\u6388\u6743",
12622
+ "Limit reached": "\u989D\u5EA6\u5DF2\u7528\u5C3D",
12623
+ "Loading usage...": "\u6B63\u5728\u52A0\u8F7D\u7528\u91CF...",
12624
+ Local: "\u672C\u5730",
12625
+ "Local and server": "\u672C\u5730\u4E0E\u670D\u52A1\u5668",
12626
+ "Local path": "\u672C\u5730\u8DEF\u5F84",
12627
+ "Localized names": "\u591A\u8BED\u8A00\u540D\u79F0",
12628
+ "Multiple languages": "\u591A\u8BED\u8A00",
12629
+ "Multiple platforms": "\u591A\u5E73\u53F0",
12630
+ "Not allowed": "\u4E0D\u5141\u8BB8",
12631
+ "Not available": "\u6682\u65E0\u6570\u636E",
12632
+ "Not declared": "\u672A\u58F0\u660E",
12633
+ "Platform independent": "\u5E73\u53F0\u65E0\u5173",
12634
+ "Platform support": "\u5E73\u53F0\u652F\u6301",
12635
+ Prefixes: "\u524D\u7F00",
12636
+ "Project declarations": "\u9879\u76EE\u58F0\u660E",
12637
+ "Project information": "\u9879\u76EE\u4FE1\u606F",
12638
+ "Project type": "\u9879\u76EE\u7C7B\u578B",
12639
+ "Project UUID": "\u9879\u76EE UUID",
12640
+ "Related project: {0}": "\u5173\u8054\u9879\u76EE\uFF1A{0}",
12641
+ "Storage location": "\u5B58\u50A8\u4F4D\u7F6E",
12642
+ "Usage unavailable": "\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u7528\u91CF",
12643
+ Used: "\u5DF2\u4F7F\u7528",
12644
+ Version: "\u7248\u672C",
12645
+ "Working directory": "\u5DE5\u4F5C\u76EE\u5F55",
12646
+ "{0} (default)": "{0}\uFF08\u9ED8\u8BA4\uFF09",
12647
+ "{0} remaining": "\u5269\u4F59 {0}",
12648
+ "{0} usage": "{0}\u7528\u91CF",
12610
12649
  "Add attachment": "\u6DFB\u52A0\u9644\u4EF6",
12611
12650
  "Agent run": "Agent \u8FD0\u884C",
12612
12651
  "All chats": "\u5168\u90E8\u804A\u5929",
@@ -13014,11 +13053,20 @@
13014
13053
  const label = document.createElement("span");
13015
13054
  label.className = "param-action-label";
13016
13055
  const view = { action, button, label };
13056
+ if (action.kind === "quick" && action.id === "ai") {
13057
+ button.classList.add("param-action-ai");
13058
+ button.append(icon("sparkle"));
13059
+ }
13017
13060
  if (action.kind === "auxiliary") {
13018
13061
  button.append(icon("settings"));
13019
13062
  view.count = document.createElement("small");
13020
13063
  }
13021
13064
  button.append(label);
13065
+ if (action.kind === "quick") {
13066
+ view.summary = document.createElement("span");
13067
+ view.summary.className = "param-action-summary";
13068
+ button.append(view.summary);
13069
+ }
13022
13070
  if (view.count) {
13023
13071
  button.append(view.count);
13024
13072
  }
@@ -13075,14 +13123,17 @@
13075
13123
  view.button.hidden = fields.length === 0;
13076
13124
  view.button.disabled = disabled || (action.kind === "auxiliary" ? loading : fields.every((field) => states[field.name]?.disabled === true || this.visibleOptions(field).length === 0));
13077
13125
  const summaries = action.summary?.map((name) => fields.find((field) => field.name === name)).filter((field) => !!field && !!values[field.name]?.length).map((field) => parameterSelectionLabel(field, values[field.name], states[field.name])) ?? [];
13078
- view.label.textContent = action.kind === "quick" && summaries.length ? `${action.label}: ${summaries.join(" \xB7 ")}` : action.label;
13126
+ view.label.textContent = action.label;
13127
+ if (view.summary) {
13128
+ view.summary.textContent = summaries.join(" \xB7 ");
13129
+ view.summary.hidden = !summaries.length;
13130
+ }
13079
13131
  if (view.count) {
13080
13132
  view.count.textContent = String(fields.length);
13081
13133
  }
13082
13134
  view.button.setAttribute("aria-busy", String(loading));
13083
13135
  }
13084
- view.button.title = view.label.textContent || "";
13085
- view.button.ariaLabel = view.label.textContent || "";
13136
+ view.button.title = view.button.ariaLabel = [view.label.textContent, view.summary?.textContent].filter(Boolean).join(": ");
13086
13137
  }
13087
13138
  if (this.active) {
13088
13139
  if (disabled || this.active.button.hidden) {
@@ -13332,6 +13383,17 @@
13332
13383
  };
13333
13384
 
13334
13385
  // src/web/workflow-types.ts
13386
+ var projectTypeLabels = {
13387
+ get conversation() {
13388
+ return t2("Conversation");
13389
+ },
13390
+ get workflow() {
13391
+ return t2("Workflow");
13392
+ },
13393
+ get kanban() {
13394
+ return t2("Kanban");
13395
+ }
13396
+ };
13335
13397
  function workflowParameters(project, entrypointId) {
13336
13398
  return project.entrypoints.find((entry) => entry.id === entrypointId) ?? project;
13337
13399
  }
@@ -15908,15 +15970,101 @@ Please report this to https://github.com/markedjs/marked.`, e) {
15908
15970
  }
15909
15971
  };
15910
15972
 
15973
+ // src/web/ui/project-information.ts
15974
+ function access(rule) {
15975
+ if (rule?.mode === "all") {
15976
+ return t2("All");
15977
+ }
15978
+ if (rule?.mode === "none") {
15979
+ return t2("Not allowed");
15980
+ }
15981
+ if (rule?.mode === "prefixes") {
15982
+ return `${t2("Prefixes")}: ${rule.prefixes.join(", ")}`;
15983
+ }
15984
+ return t2("Not declared");
15985
+ }
15986
+ function projectInformation(project) {
15987
+ const info = project.projectInfo;
15988
+ const storage = { local: t2("Local"), server: t2("Server"), both: t2("Local and server") };
15989
+ const declarations = { multilingual: t2("Multiple languages"), multiplatform: t2("Multiple platforms") };
15990
+ const platforms = { macos: "macOS", windows: "Windows", web: "Web" };
15991
+ const sections = [{
15992
+ title: t2("Basic information"),
15993
+ expanded: true,
15994
+ rows: [
15995
+ { label: t2("Default name"), value: project.manifest?.name || project.name },
15996
+ { label: t2("Project type"), value: projectTypeLabels[project.projectType] },
15997
+ { label: t2("Version"), value: project.manifest?.version || t2("Not declared") },
15998
+ { label: t2("Project UUID"), value: project.id },
15999
+ { label: project.assistant ? t2("Working directory") : t2("Local path"), value: project.assistant?.workdir || project.folderPath }
16000
+ ]
16001
+ }, {
16002
+ title: t2("Project declarations"),
16003
+ expanded: true,
16004
+ rows: [
16005
+ { label: t2("Storage location"), value: info?.dataStorage ? storage[info.dataStorage.mode] : t2("Not declared") },
16006
+ { label: t2("Platform support"), value: info?.platformSupport.mode === "specific" ? info.platformSupport.platforms.map((id) => platforms[id] || id).join(", ") : t2("Platform independent") },
16007
+ { label: t2("Declarations"), value: info?.declarations.map((id) => declarations[id] || id).join(", ") || t2("Not declared") }
16008
+ ]
16009
+ }];
16010
+ if (info && Object.keys(info.localizedNames).length) {
16011
+ sections.push({ title: t2("Localized names"), rows: Object.entries(info.localizedNames).map(([label, value]) => ({ label, value })) });
16012
+ }
16013
+ for (const relation of info?.relatedProjects ?? []) {
16014
+ const grant = relation.grantToRelatedProject;
16015
+ sections.push({ title: t2("Related project: {0}", relation.alias), rows: [
16016
+ { label: t2("Project UUID"), value: relation.projectId },
16017
+ { label: t2("KV read granted"), value: access(grant.read) },
16018
+ { label: t2("KV write granted"), value: access(grant.write) },
16019
+ { label: t2("Knowledge read granted"), value: access(grant.knowledge?.read) },
16020
+ { label: t2("Knowledge write granted"), value: access(grant.knowledge?.write) },
16021
+ { label: t2("Entrypoints granted"), value: access(grant.entrypoints) }
16022
+ ] });
16023
+ }
16024
+ if (project.entrypoints.length) {
16025
+ sections.push({ title: t2("Entrypoints"), rows: project.entrypoints.map((entry) => ({
16026
+ label: entry.title || entry.id,
16027
+ value: entry.id === project.defaultEntrypoint ? t2("{0} (default)", entry.id) : entry.id
16028
+ })) });
16029
+ }
16030
+ return sections;
16031
+ }
16032
+
16033
+ // src/web/ui/ai-usage.ts
16034
+ function usageAmount(value) {
16035
+ return value != null && Number.isFinite(Number(value)) ? `$${Math.max(0, Number(value)).toFixed(2)}` : t2("Not available");
16036
+ }
16037
+ function usagePeriods(subscription) {
16038
+ const labels = { daily: t2("Daily"), weekly: t2("Weekly"), monthly: t2("Monthly") };
16039
+ return ["daily", "weekly", "monthly"].map((period) => {
16040
+ const rawUsed = subscription[`${period}UsageUsd`], rawLimit = subscription[`${period}LimitUsd`];
16041
+ const used = Number.isFinite(Number(rawUsed)) && rawUsed != null ? Math.max(0, Number(rawUsed)) : void 0;
16042
+ const limit = rawLimit === null ? null : Number.isFinite(Number(rawLimit)) && rawLimit !== void 0 ? Math.max(0, Number(rawLimit)) : void 0;
16043
+ const ratio = used !== void 0 && limit !== null && limit !== void 0 ? limit > 0 ? used / limit : 1 : void 0;
16044
+ return {
16045
+ period,
16046
+ label: labels[period],
16047
+ used,
16048
+ limit,
16049
+ ratio,
16050
+ status: ratio === void 0 ? "" : ratio >= 1 ? "exhausted" : ratio >= 0.8 ? "near-limit" : "",
16051
+ remaining: used !== void 0 && limit !== null && limit !== void 0 ? Math.max(0, limit - used) : void 0
16052
+ };
16053
+ });
16054
+ }
16055
+
15911
16056
  // src/web/ui/conversation-tools.ts
15912
16057
  var ConversationTools = class {
15913
16058
  dialog = document.createElement("dialog");
15914
16059
  body = document.createElement("div");
15915
16060
  title = document.createElement("h2");
15916
16061
  usageOpen = false;
16062
+ usageRequestId;
15917
16063
  refresh;
15918
16064
  constructor() {
15919
16065
  this.dialog.className = "conversation-dialog";
16066
+ this.title.id = "conversation-dialog-title";
16067
+ this.dialog.setAttribute("aria-labelledby", this.title.id);
15920
16068
  const header = document.createElement("header");
15921
16069
  header.append(this.title, iconButton("close", t2("Close"), () => this.close()));
15922
16070
  this.body.className = "dialog-body";
@@ -15930,6 +16078,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
15930
16078
  }
15931
16079
  }
15932
16080
  });
16081
+ this.dialog.addEventListener("cancel", () => this.close());
15933
16082
  }
15934
16083
  get open() {
15935
16084
  return this.dialog.open;
@@ -15937,13 +16086,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
15937
16086
  close() {
15938
16087
  this.dialog.close();
15939
16088
  this.usageOpen = false;
16089
+ this.usageRequestId = void 0;
15940
16090
  this.refresh?.remove();
15941
16091
  this.refresh = void 0;
15942
16092
  }
16093
+ closeUsage() {
16094
+ if (this.usageOpen) {
16095
+ this.close();
16096
+ }
16097
+ }
15943
16098
  show(title) {
15944
16099
  this.close();
15945
16100
  this.title.textContent = title;
15946
16101
  this.body.replaceChildren();
16102
+ this.body.setAttribute("aria-busy", "false");
15947
16103
  this.dialog.showModal();
15948
16104
  }
15949
16105
  plan(content) {
@@ -15961,6 +16117,35 @@ Please report this to https://github.com/markedjs/marked.`, e) {
15961
16117
  image.className = "image-preview";
15962
16118
  this.body.append(image);
15963
16119
  }
16120
+ projectInfo(project) {
16121
+ this.show(t2("Project information"));
16122
+ const heading = document.createElement("h3");
16123
+ heading.className = "project-information-name";
16124
+ heading.textContent = project.name;
16125
+ this.body.append(heading);
16126
+ if (project.manifest?.description) {
16127
+ const description = document.createElement("p");
16128
+ description.className = "project-information-description";
16129
+ description.textContent = project.manifest.description;
16130
+ this.body.append(description);
16131
+ }
16132
+ for (const section of projectInformation(project)) {
16133
+ const details = document.createElement("details");
16134
+ details.className = "project-information-section";
16135
+ details.open = !!section.expanded;
16136
+ const summary = document.createElement("summary");
16137
+ summary.innerHTML = `${iconHtml("chevron-right")}<span>${escapeHtml(section.title)}</span>`;
16138
+ const list = document.createElement("dl");
16139
+ for (const row of section.rows) {
16140
+ const label = document.createElement("dt"), value = document.createElement("dd");
16141
+ label.textContent = row.label;
16142
+ value.textContent = row.value;
16143
+ list.append(label, value);
16144
+ }
16145
+ details.append(summary, list);
16146
+ this.body.append(details);
16147
+ }
16148
+ }
15964
16149
  permissions(parameters, policies, changed) {
15965
16150
  this.show(t2("Tool permissions"));
15966
16151
  const tools = parameters.tools ?? [];
@@ -16004,35 +16189,46 @@ Please report this to https://github.com/markedjs/marked.`, e) {
16004
16189
  }
16005
16190
  }
16006
16191
  usage(load) {
16007
- this.show(t2("System AI"));
16192
+ this.show(t2("AI usage"));
16008
16193
  this.usageOpen = true;
16009
- const refresh = this.refresh = iconButton("refresh", t2("Refresh usage"), () => {
16010
- this.body.textContent = t2("Loading...");
16011
- load();
16012
- });
16194
+ const refresh = this.refresh = iconButton("refresh", t2("Refresh usage"), () => this.loadUsage(load));
16013
16195
  this.dialog.querySelector("header").insertBefore(refresh, this.dialog.querySelector("header > button:last-child"));
16014
- this.body.textContent = t2("Loading...");
16015
- load();
16196
+ this.loadUsage(load);
16016
16197
  }
16017
- usageResult(data, error) {
16018
- if (!this.usageOpen) {
16019
- return;
16198
+ loadUsage(load) {
16199
+ this.body.innerHTML = `<div class="usage-status" role="status">${iconHtml("loading")}<span>${t2("Loading usage...")}</span></div>`;
16200
+ this.body.setAttribute("aria-busy", "true");
16201
+ if (this.refresh) {
16202
+ this.refresh.disabled = true;
16020
16203
  }
16021
- this.body.replaceChildren();
16022
- if (error) {
16023
- this.body.textContent = error;
16204
+ this.usageRequestId = crypto.randomUUID();
16205
+ load(this.usageRequestId);
16206
+ }
16207
+ usageResult(requestId, data, error) {
16208
+ if (!this.usageOpen || requestId !== this.usageRequestId) {
16024
16209
  return;
16025
16210
  }
16026
- if (!data) {
16211
+ this.body.replaceChildren();
16212
+ this.body.setAttribute("aria-busy", "false");
16213
+ if (this.refresh) {
16214
+ this.refresh.disabled = false;
16215
+ }
16216
+ if (error || !data) {
16217
+ const status = document.createElement("p");
16218
+ status.className = error ? "error usage-status" : "usage-status";
16219
+ status.setAttribute("role", error ? "alert" : "status");
16220
+ status.textContent = error || t2("Usage unavailable");
16221
+ this.body.append(status);
16027
16222
  return;
16028
16223
  }
16029
- const balance = document.createElement("p");
16030
- balance.textContent = t2("Account balance ${0}", Number(data.balance ?? 0).toFixed(2));
16224
+ const balance = document.createElement("div");
16225
+ balance.className = "usage-balance";
16226
+ balance.innerHTML = `<span>${t2("Account balance")}</span><strong>${escapeHtml(usageAmount(data.balance))}</strong><small>USD</small>`;
16031
16227
  this.body.append(balance);
16032
- const labels = { daily: t2("Daily"), weekly: t2("Weekly"), monthly: t2("Monthly") };
16033
16228
  const plans = data.groups.filter((group) => group.subscriptionType === "subscription" && group.subscription?.status === "active");
16034
16229
  if (!plans.length) {
16035
16230
  const empty = document.createElement("p");
16231
+ empty.className = "usage-status";
16036
16232
  empty.textContent = t2("No active subscriptions");
16037
16233
  this.body.append(empty);
16038
16234
  }
@@ -16042,19 +16238,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
16042
16238
  const title = document.createElement("h3");
16043
16239
  title.textContent = plan.name;
16044
16240
  section.append(title);
16045
- for (const period of ["daily", "weekly", "monthly"]) {
16046
- const limit = plan.subscription[`${period}LimitUsd`];
16047
- const used = Number(plan.subscription[`${period}UsageUsd`] ?? 0);
16241
+ for (const period of usagePeriods(plan.subscription)) {
16048
16242
  const row = document.createElement("div");
16049
- const label = document.createElement("span");
16050
- label.textContent = `${labels[period]} $${used.toFixed(2)} / ${limit === null ? t2("Unlimited") : `$${Number(limit).toFixed(2)}`}`;
16051
- row.append(label);
16052
- if (limit !== null && limit > 0) {
16243
+ row.className = "usage-period";
16244
+ row.dataset.status = period.status;
16245
+ const used = period.used === void 0 ? t2("Not available") : usageAmount(period.used);
16246
+ const limit = period.limit === null ? t2("Unlimited") : period.limit === void 0 ? t2("Not available") : usageAmount(period.limit);
16247
+ row.innerHTML = `<div class="usage-period-heading"><span>${period.label}</span><strong>${period.ratio === void 0 ? escapeHtml(limit) : `${Math.round(period.ratio * 100)}%`}</strong></div><div class="usage-period-amount"><strong>${escapeHtml(used)}</strong><span>/ ${escapeHtml(limit)}</span></div>`;
16248
+ if (period.ratio !== void 0) {
16053
16249
  const progress = document.createElement("progress");
16054
- progress.max = limit;
16055
- progress.value = used;
16250
+ progress.max = 1;
16251
+ progress.value = Math.min(1, period.ratio);
16252
+ progress.ariaLabel = t2("{0} usage", period.label);
16056
16253
  row.append(progress);
16057
16254
  }
16255
+ const remaining = document.createElement("span");
16256
+ remaining.className = "usage-period-remaining";
16257
+ remaining.textContent = period.status === "exhausted" ? t2("Limit reached") : period.remaining === void 0 ? t2("Used") : t2("{0} remaining", usageAmount(period.remaining));
16258
+ row.append(remaining);
16058
16259
  section.append(row);
16059
16260
  }
16060
16261
  this.body.append(section);
@@ -17881,11 +18082,11 @@ ${state.user?.avatarUrl ?? ""}`;
17881
18082
  app.dataset.initialized = "true";
17882
18083
  app.innerHTML = `
17883
18084
  <header class="toolbar">
17884
- <div class="project-title"><button id="menu-toggle" class="icon-button" title="${t2("Show conversations")}" aria-label="${t2("Show conversations")}" aria-controls="project-menu">${iconHtml("layout-sidebar-left")}</button><span id="project-icon" class="project-icon">${iconHtml("comment-discussion")}</span><div class="project-heading"><h1 id="conversation-title">Workflow</h1><span id="assistant-folder" hidden></span></div><span id="project-name" class="project-name"></span></div>
17885
- <div class="toolbar-actions"><button id="usage" class="icon-button" title="${t2("System AI usage")}" aria-label="${t2("System AI usage")}" hidden>${iconHtml("dashboard")}</button><button id="tools" class="icon-button" title="${t2("Tool permissions")}" aria-label="${t2("Tool permissions")}" hidden>${iconHtml("tools")}</button></div>
18085
+ <div class="project-title"><button id="menu-toggle" class="icon-button" title="${t2("Show conversations")}" aria-label="${t2("Show conversations")}" aria-controls="project-menu">${iconHtml("layout-sidebar-left")}</button><button id="project-info" class="icon-button" title="${t2("Project information")}" aria-label="${t2("Project information")}" aria-haspopup="dialog">${iconHtml("info")}</button><span id="project-icon" class="project-icon">${iconHtml("comment-discussion")}</span><div class="project-heading"><h1 id="conversation-title">Workflow</h1><span id="assistant-folder" hidden></span></div><span id="project-name" class="project-name"></span></div>
18086
+ <div class="toolbar-actions"><button id="new" class="icon-button" title="${t2("New conversation")}" aria-label="${t2("New conversation")}">${iconHtml("comment-add")}</button><button id="usage" class="icon-button usage-button" title="${t2("System AI usage")}" aria-label="${t2("System AI usage")}" aria-haspopup="dialog" hidden>${iconHtml("dashboard")}<span>${t2("AI usage")}</span></button><button id="tools" class="icon-button" title="${t2("Tool permissions")}" aria-label="${t2("Tool permissions")}" hidden>${iconHtml("tools")}</button></div>
17886
18087
  </header>
17887
18088
  <aside id="project-menu" class="project-menu" aria-label="${t2("Conversations")}">
17888
- <div class="menu-heading"><span id="menu-label">${t2("Conversations")}</span><div class="menu-actions"><button id="history-toggle" class="icon-button" title="${t2("Search conversations")}" aria-label="${t2("Search conversations")}" aria-haspopup="dialog" aria-controls="history-popover" aria-expanded="false" popovertarget="history-popover">${iconHtml("search")}</button><button id="new" class="icon-button" title="${t2("New conversation")}" aria-label="${t2("New conversation")}">${iconHtml("edit")}</button><button id="hide-menu" class="icon-button" title="${t2("Hide conversations")}" aria-label="${t2("Hide conversations")}">${iconHtml("chevron-left")}</button></div></div>
18089
+ <div class="menu-heading"><span id="menu-label">${t2("Conversations")}</span><div class="menu-actions"><button id="history-toggle" class="icon-button" title="${t2("Search conversations")}" aria-label="${t2("Search conversations")}" aria-haspopup="dialog" aria-controls="history-popover" aria-expanded="false" popovertarget="history-popover">${iconHtml("search")}</button><button id="hide-menu" class="icon-button" title="${t2("Hide conversations")}" aria-label="${t2("Hide conversations")}">${iconHtml("chevron-left")}</button></div></div>
17889
18090
  <section id="chats"><nav id="session-list" aria-label="${t2("Conversation history")}"></nav><button id="load-more-history" class="all-history" hidden>${iconHtml("chevron-down")}<span>${t2("Load more")}</span></button><button id="all-history" class="all-history" aria-haspopup="dialog" aria-controls="history-popover" aria-expanded="false" popovertarget="history-popover" hidden></button><div id="no-history" class="no-history" hidden>${t2("No conversations")}</div></section>
17890
18091
  </aside>
17891
18092
  <main><div class="transcript-area"><div id="transcript" class="transcript" role="log" aria-label="${t2("Conversation messages")}" aria-live="polite" aria-relevant="additions"></div><button id="latest" class="icon-button latest-button" title="${t2("Go to latest message")}" aria-label="${t2("Go to latest message")}" hidden>${iconHtml("arrow-down")}</button></div>
@@ -17977,8 +18178,6 @@ ${state.user?.avatarUrl ?? ""}`;
17977
18178
  const toggle = document.querySelector("#menu-toggle");
17978
18179
  toggle.hidden = open;
17979
18180
  toggle.setAttribute("aria-expanded", String(open));
17980
- const actions = document.querySelector(narrow.matches && open ? ".menu-actions" : ".toolbar-actions");
17981
- actions.prepend(document.querySelector("#usage"), document.querySelector("#tools"));
17982
18181
  document.querySelector("#menu-label").textContent = narrow.matches ? t2("Chat") : t2("Conversations");
17983
18182
  closeHistory();
17984
18183
  renderHistory(true);
@@ -18689,6 +18888,9 @@ ${state.user?.avatarUrl ?? ""}`;
18689
18888
  folder.title = next.project.assistant?.workdir ?? "";
18690
18889
  const switching = projectChanged || renderedSession !== next.activeId;
18691
18890
  const authenticationChanged = previous && (previous.authenticationRevision !== next.authenticationRevision || previous.parameterRevision !== next.parameterRevision);
18891
+ if (previous && previous.authenticationRevision !== next.authenticationRevision) {
18892
+ dialogs.closeUsage();
18893
+ }
18692
18894
  if (authenticationChanged) {
18693
18895
  ++requestId;
18694
18896
  resolving = false;
@@ -18864,10 +19066,16 @@ ${state.user?.avatarUrl ?? ""}`;
18864
19066
  saveDraft();
18865
19067
  post({ type: "new", text: textarea.value, attachments: draftFiles });
18866
19068
  });
19069
+ document.querySelector("#project-info").addEventListener("click", () => {
19070
+ if (state) {
19071
+ parameterActions.close();
19072
+ dialogs.projectInfo(state.project);
19073
+ }
19074
+ });
18867
19075
  document.querySelector("#attach").addEventListener("click", () => post({ type: "attach" }));
18868
19076
  document.querySelector("#cancel-queue-edit").addEventListener("click", () => post({ type: "queue-cancel-edit" }));
18869
19077
  document.querySelector("#tools").addEventListener("click", () => dialogs.permissions(currentParameters(), currentSession()?.toolPermissionPolicies ?? {}, (policies) => post({ type: "tool-policy", entrypointId: entrypoint.value, policies })));
18870
- document.querySelector("#usage").addEventListener("click", () => dialogs.usage(() => post({ type: "usage" })));
19078
+ document.querySelector("#usage").addEventListener("click", () => dialogs.usage((requestId2) => post({ type: "usage", requestId: requestId2 })));
18871
19079
  document.querySelector("#parameter-login").addEventListener("click", () => vscode.postMessage({ type: "login" }));
18872
19080
  document.querySelector("#menu-toggle").addEventListener("click", () => showMenu(true));
18873
19081
  document.querySelector("#hide-menu").addEventListener("click", () => showMenu(false));
@@ -19009,6 +19217,7 @@ ${state.user?.avatarUrl ?? ""}`;
19009
19217
  if (!connectionAvailable) {
19010
19218
  resolving = false;
19011
19219
  requestId++;
19220
+ dialogs.closeUsage();
19012
19221
  }
19013
19222
  sendButton.disabled = !connectionAvailable || sendButton.disabled;
19014
19223
  updateControls();
@@ -19098,7 +19307,7 @@ ${state.user?.avatarUrl ?? ""}`;
19098
19307
  updateControls();
19099
19308
  textarea.focus();
19100
19309
  } else if (message.type === "usage" && message.sessionId === state?.activeId) {
19101
- dialogs.usageResult(message.usage);
19310
+ dialogs.usageResult(message.requestId, message.usage);
19102
19311
  } else if (message.type === "exported" && message.sessionId === state?.activeId) {
19103
19312
  const button = messages.get(message.messageId)?.root.querySelector(".export-message");
19104
19313
  if (button) {
@@ -19106,14 +19315,15 @@ ${state.user?.avatarUrl ?? ""}`;
19106
19315
  button.innerHTML = iconHtml("export");
19107
19316
  }
19108
19317
  } else if (message.type === "error" && (!message.sessionId || message.sessionId === state?.activeId)) {
19318
+ if (message.requestType === "usage") {
19319
+ dialogs.usageResult(message.requestId, void 0, message.message);
19320
+ return;
19321
+ }
19109
19322
  if (message.requestType === "resume" && messages.get(message.messageId)?.prompt?.request.requestId !== message.requestId) {
19110
19323
  return;
19111
19324
  }
19112
19325
  submitting = false;
19113
19326
  uploading = Math.max(0, uploading - 1);
19114
- if (message.requestType === "usage") {
19115
- dialogs.usageResult(void 0, message.message);
19116
- }
19117
19327
  if (message.requestType === "resume") {
19118
19328
  messages.get(message.messageId)?.prompt?.setBusy(false, message.message);
19119
19329
  }