ework-web 0.10.117 → 0.10.119

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.117",
3
+ "version": "0.10.119",
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",
@@ -189,6 +189,7 @@ export function renderLayout(props: LayoutProps, inner: string, initialItems: st
189
189
  const s = props.aiStatus ?? "";
190
190
  const map: Record<string, { cls: string; label: string }> = {
191
191
  processing: { cls: "ai-processing", label: "🔄 AI 处理中" },
192
+ queued: { cls: "ai-queued", label: "⏳ 排队中" },
192
193
  completed: { cls: "ai-completed", label: "✅ AI 已完成" },
193
194
  failed: { cls: "ai-failed", label: "⚠️ AI 失败" },
194
195
  halted: { cls: "ai-halted", label: "⏹ 已停止" },
@@ -312,6 +313,7 @@ export function aiStatusBadge(status: string | undefined): string {
312
313
  if (!s) return "";
313
314
  const map: Record<string, string> = {
314
315
  processing: '<span class="ai-status-list" style="color:var(--accent)">⚙️ 处理中</span>',
316
+ queued: '<span class="ai-status-list" style="color:var(--accent)">⏳ 排队中</span>',
315
317
  halted: '<span class="ai-status-list" style="color:#bf8700">⏹️ 已停止</span>',
316
318
  dispatch_off: '<span class="ai-status-list" style="color:#6f7781">🔕 不接单</span>',
317
319
  completed: '<span class="ai-status-list" style="color:var(--green)">✓ 已完成</span>',
package/src/store.ts CHANGED
@@ -451,6 +451,9 @@ export async function listAllIssues(opts: ListIssuesOpts = {}): Promise<IssueWit
451
451
  }
452
452
 
453
453
  export interface CreateIssueOpts {
454
+ /** Preferred local number (upstream imports keep local==upstream). Falls
455
+ * back to autoincrement when the number is taken. */
456
+ number?: number;
454
457
  createdAt?: string;
455
458
  updatedAt?: string;
456
459
  state?: "open" | "closed";
@@ -484,9 +487,15 @@ export async function createIssue(
484
487
  const state: "open" | "closed" = opts.state ?? "open";
485
488
  const closedAt = state === "closed" ? isoOr(opts.closedAt ?? undefined, updatedAt) : null;
486
489
  return await getDB().transaction(async () => {
487
- const next = (await getDB().get<{ n: number }>(
488
- "SELECT COALESCE(MAX(number), 0) + 1 AS n FROM {{issues}} WHERE project_id = ?", [projectId]
489
- ))!;
490
+ const want = opts.number && opts.number > 0 ? opts.number : null;
491
+ const taken = want
492
+ ? await getDB().get<{ id: number }>("SELECT id FROM {{issues}} WHERE project_id = ? AND number = ?", [projectId, want])
493
+ : undefined;
494
+ const next = want && !taken
495
+ ? { n: want }
496
+ : (await getDB().get<{ n: number }>(
497
+ "SELECT COALESCE(MAX(number), 0) + 1 AS n FROM {{issues}} WHERE project_id = ?", [projectId]
498
+ ))!;
490
499
  const info = await getDB().run(
491
500
  "INSERT INTO {{issues}} (project_id, number, title, body, state, author, created_at, updated_at, closed_at, model, runtime, upstream_issue_number) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
492
501
  [projectId, next.n, title, body, state, author, createdAt, updatedAt, closedAt, opts.model ?? "", opts.runtime ?? "", opts.upstreamIssueNumber ?? null]
@@ -139,6 +139,7 @@ export class UpstreamSync {
139
139
  updatedAt: gi.updated_at,
140
140
  state: gi.state === "closed" ? "closed" : "open",
141
141
  upstreamIssueNumber: gi.number,
142
+ number: gi.number,
142
143
  }
143
144
  );
144
145
  // PRs the sandbox agent opens itself carry the ework-agent-pr marker;