ework-web 0.10.46 → 0.10.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-web",
3
- "version": "0.10.46",
3
+ "version": "0.10.48",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
package/src/config.ts CHANGED
@@ -82,7 +82,6 @@ export const configSchema = z.object({
82
82
  internalAuthHook: z.string().default(""),
83
83
  userAuthHook: z.string().default(""),
84
84
  loginPage: z.string().default(""),
85
- statusHook: z.string().default(""),
86
85
  // Default "provider/model" string passed to `opencode run --model <X>`.
87
86
  // Empty = let opencode pick per its own opencode.json + env. ework-daemon
88
87
  // pushes this (or the per-project override) on every spawn to defend
@@ -193,7 +192,6 @@ export async function loadConfig(): Promise<Config> {
193
192
  internalAuthHook: process.env.WORK_INTERNAL_AUTH_HOOK ?? "",
194
193
  userAuthHook: process.env.WORK_USER_AUTH_HOOK ?? "",
195
194
  loginPage: process.env.WORK_LOGIN_PAGE ?? "",
196
- statusHook: process.env.WORK_STATUS_HOOK ?? "",
197
195
  defaultModel: db.defaultModel ?? process.env.WORK_DEFAULT_MODEL,
198
196
  autowireActive: process.env.WORK_AUTOWIRE_ACTIVE !== "false",
199
197
  webhookMaxConcurrent: Number(process.env.WORK_WEBHOOK_MAX_CONCURRENT ?? "6"),
@@ -17,7 +17,6 @@ export interface LayoutProps {
17
17
  labels?: { id: number; name: string; color: string }[];
18
18
  canEditLabels?: boolean;
19
19
  aiStatus?: string;
20
- statusHook?: string;
21
20
  }
22
21
 
23
22
  export const THEME_CSS = `
@@ -251,6 +250,18 @@ export function escapeHtml(s: string): string {
251
250
  .replace(/'/g, "&#39;");
252
251
  }
253
252
 
253
+ export function aiStatusBadge(status: string | undefined): string {
254
+ const s = status ?? "";
255
+ if (!s) return "";
256
+ const map: Record<string, string> = {
257
+ processing: '<span class="ai-status-list" style="color:var(--accent)">⚙️ 处理中</span>',
258
+ halted: '<span class="ai-status-list" style="color:#bf8700">⏸️ 已暂停</span>',
259
+ completed: '<span class="ai-status-list" style="color:var(--green)">✓ 已完成</span>',
260
+ failed: '<span class="ai-status-list" style="color:#cf222e">✗ 失败</span>',
261
+ };
262
+ return map[s] ?? "";
263
+ }
264
+
254
265
  export function escapeAttr(s: string): string {
255
266
  return escapeHtml(s);
256
267
  }
@@ -1,4 +1,4 @@
1
- import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML } from "../render/layout";
1
+ import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML, aiStatusBadge } from "../render/layout";
2
2
  import { getProject, listIssues, listLabelsForIssues, type IssueWithMeta, type LabelRow } from "../store";
3
3
  import { relTime } from "../render/components";
4
4
 
@@ -22,9 +22,10 @@ function issueRow(
22
22
  const chips = labels.length
23
23
  ? `<span class="row-labels">${labels.map((l) => labelChip(l, owner, repo, state)).join("")}</span>`
24
24
  : "";
25
+ const aiBadge = aiStatusBadge(it.ai_status);
25
26
  return `<a class="row" href="${escapeAttr(href)}">
26
27
  <div class="row-title">${title}${chips}</div>
27
- <div class="row-meta">#${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}</div>
28
+ <div class="row-meta">#${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}${aiBadge ? ` · ${aiBadge}` : ""}</div>
28
29
  </a>`;
29
30
  }
30
31
 
@@ -131,7 +131,6 @@ export async function buildIssueThread(
131
131
  labels: labels.map((l) => ({ id: l.id, name: l.name, color: l.color })),
132
132
  canEditLabels: cfg.writesEnabled !== false,
133
133
  aiStatus: issue.ai_status ?? "",
134
- statusHook: cfg.statusHook ?? "",
135
134
  },
136
135
  safeJsonEmbed(payload),
137
136
  displayViews.map((v) => renderCommentCard(v, cfg)).join("")
@@ -1,4 +1,4 @@
1
- import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML } from "../render/layout";
1
+ import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML, aiStatusBadge } from "../render/layout";
2
2
  import { listAllIssues, listLabelsForIssues, type IssueWithMeta, type LabelRow } from "../store";
3
3
  import { relTime } from "../render/components";
4
4
 
@@ -16,9 +16,10 @@ function issueRow(it: IssueWithMeta, q: string, state: string, labels: LabelRow[
16
16
  const chips = labels.length
17
17
  ? `<span class="row-labels">${labels.map((l) => labelChip(l, it.project_owner, it.project_name, state)).join("")}</span>`
18
18
  : "";
19
+ const aiBadge = aiStatusBadge(it.ai_status);
19
20
  return `<a class="row" href="${escapeAttr(href)}">
20
21
  <div class="row-title">${title}${chips}</div>
21
- <div class="row-meta">${projectStr} · #${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}</div>
22
+ <div class="row-meta">${projectStr} · #${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}${aiBadge ? ` · ${aiBadge}` : ""}</div>
22
23
  </a>`;
23
24
  }
24
25