mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:37:19 +01:00
feat(loki): queue the next message while a turn runs; show the command under each step
Two more places the thread differed from the chat the operator uses all
day, closed.
Queue. A send during a turn was refused — Send went dark until the spinner
stopped, the one place a chat makes the person wait on the machine. Now
the composer takes it (chatkit 5f9d737, `queue`: Send stays live beside
Stop, placeholder "Queue a message…"), the workspace holds it in order and
shows it as a pill with a way to take it back, and sends it through the
same `send` when the turn ends. Held, not dropped, when the turn failed:
the error and its Try again stand in front of it. The draft is cleared
under the key it was typed in, like any send.
Detail. Each tool step in the work trail now carries its arguments as one
short line (`query: "Elena"`) — the command under the step — in the code
face, cut to one line, streamed live and persisted with the rest of the
work. Empty arguments are no line rather than `{}`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtBnGxwf5ddXTzRNyjHVP7
This commit is contained in:
13 files changed
+169
-21
No files matched your search
+1
-1
@@ -116,7 +116,7 @@
|
||||
"@auth/drizzle-adapter": "^1.11.3",
|
||||
"@bitbaum/accountkit": "github:bitbaum/accountkit#v0.1.0",
|
||||
"@bitbaum/ai-kit": "^1.18.0",
|
||||
"@bitbaum/chatkit": "github:bitbaum/chatkit#b30c843f7df714e496828d3958146d037cfe0f15",
|
||||
"@bitbaum/chatkit": "github:bitbaum/chatkit#5f9d737bbc8590a661a9bb196914dca7e73dbf7f",
|
||||
"@bitbaum/mail-kit": "^0.1.1",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
|
||||
Generated
+6
-6
@@ -31,8 +31,8 @@ importers:
|
||||
specifier: ^1.18.0
|
||||
version: 1.18.0(react@19.2.8)
|
||||
'@bitbaum/chatkit':
|
||||
specifier: github:bitbaum/chatkit#b30c843f7df714e496828d3958146d037cfe0f15
|
||||
version: https://codeload.github.com/bitbaum/chatkit/tar.gz/b30c843f7df714e496828d3958146d037cfe0f15(react@19.2.8)
|
||||
specifier: github:bitbaum/chatkit#5f9d737bbc8590a661a9bb196914dca7e73dbf7f
|
||||
version: https://codeload.github.com/bitbaum/chatkit/tar.gz/5f9d737bbc8590a661a9bb196914dca7e73dbf7f(react@19.2.8)
|
||||
'@bitbaum/mail-kit':
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1
|
||||
@@ -398,9 +398,9 @@ packages:
|
||||
react:
|
||||
optional: true
|
||||
|
||||
'@bitbaum/chatkit@https://codeload.github.com/bitbaum/chatkit/tar.gz/b30c843f7df714e496828d3958146d037cfe0f15':
|
||||
resolution: {gitHosted: true, integrity: sha512-Uy74cHWso/3UAOyutTdb9cDaMAbrq7TFWSno1NXD+cO35I9ayqUCdNSDJPR27XZsqoTIHIa/UG2oxmwEGHcX/A==, tarball: https://codeload.github.com/bitbaum/chatkit/tar.gz/b30c843f7df714e496828d3958146d037cfe0f15}
|
||||
version: 0.3.0
|
||||
'@bitbaum/chatkit@https://codeload.github.com/bitbaum/chatkit/tar.gz/5f9d737bbc8590a661a9bb196914dca7e73dbf7f':
|
||||
resolution: {gitHosted: true, integrity: sha512-ZxiUanxQ5owNd4kGDN7ZBe1wlRhl3taZUa9EFRJp2TKaGSYBWf7zWimI7ofYluWsvqjaWpy/f4yeKU7k2v/C2A==, tarball: https://codeload.github.com/bitbaum/chatkit/tar.gz/5f9d737bbc8590a661a9bb196914dca7e73dbf7f}
|
||||
version: 0.3.1
|
||||
engines: {node: '>=20'}
|
||||
peerDependencies:
|
||||
react: '>=18'
|
||||
@@ -5240,7 +5240,7 @@ snapshots:
|
||||
optionalDependencies:
|
||||
react: 19.2.8
|
||||
|
||||
'@bitbaum/chatkit@https://codeload.github.com/bitbaum/chatkit/tar.gz/b30c843f7df714e496828d3958146d037cfe0f15(react@19.2.8)':
|
||||
'@bitbaum/chatkit@https://codeload.github.com/bitbaum/chatkit/tar.gz/5f9d737bbc8590a661a9bb196914dca7e73dbf7f(react@19.2.8)':
|
||||
dependencies:
|
||||
react: 19.2.8
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ async function main() {
|
||||
});
|
||||
assert.deepEqual(r.work, [
|
||||
{ kind: "note", text: "Checking who Elena is first." },
|
||||
{ kind: "tool", name: "search_people", phase: "end", facts: 1 },
|
||||
{ kind: "tool", name: "search_people", phase: "end", facts: 1, detail: 'query: "Elena"' },
|
||||
]);
|
||||
assert.equal(r.text, "Elena Weber SINGA Switzerland — whatsapp +41774730093 [F1].");
|
||||
const noteAt = events.findIndex((e) => e.type === "note");
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import {
|
||||
DETAIL_MAX_CHARS,
|
||||
applyNote,
|
||||
applyToolStep,
|
||||
describeArgs,
|
||||
groupWork,
|
||||
readWork,
|
||||
summarizeTools,
|
||||
@@ -75,13 +77,22 @@ assert.deepEqual(noted, [
|
||||
{ kind: "note", text: "Found it — checking who owns it." },
|
||||
]);
|
||||
|
||||
// The command under a step: arguments as one short line, never `{}`.
|
||||
assert.equal(describeArgs({ query: "Elena", limit: 5 }), 'query: "Elena", limit: 5');
|
||||
assert.equal(describeArgs({}), undefined);
|
||||
assert.equal(describeArgs({ q: "" }), undefined);
|
||||
assert.equal(describeArgs("nope"), undefined);
|
||||
const long = describeArgs({ query: "x".repeat(200) })!;
|
||||
assert.ok(long.length <= DETAIL_MAX_CHARS && long.endsWith("…"), "cut to one line");
|
||||
assert.equal(describeArgs({ q: "two\nlines" })!.includes("\n"), false, "one line");
|
||||
|
||||
// Persisted meta: only finished steps and real notes; junk is ignored.
|
||||
assert.deepEqual(
|
||||
readWork({
|
||||
work: [
|
||||
{ kind: "note", text: "x" },
|
||||
{ kind: "tool", name: "a", phase: "start" },
|
||||
{ kind: "tool", name: "b", phase: "end", facts: 4 },
|
||||
{ kind: "tool", name: "b", phase: "end", facts: 4, detail: 'q: "x"' },
|
||||
{ kind: "tool", name: "c", phase: "fail" },
|
||||
null,
|
||||
"nope",
|
||||
@@ -90,10 +101,29 @@ assert.deepEqual(
|
||||
}),
|
||||
[
|
||||
{ kind: "note", text: "x" },
|
||||
{ kind: "tool", name: "b", phase: "end", facts: 4 },
|
||||
{ kind: "tool", name: "b", phase: "end", facts: 4, detail: 'q: "x"' },
|
||||
{ kind: "tool", name: "c", phase: "fail" },
|
||||
],
|
||||
);
|
||||
|
||||
// The queue: a send during a turn is taken, shown, and flushed after.
|
||||
const workspace = readFileSync("src/components/loki/LokiWorkspace.tsx", "utf8");
|
||||
assert.match(
|
||||
workspace,
|
||||
/if \(sending && !dispatchOnly\) \{\s*setQueue/,
|
||||
"a send while running is queued",
|
||||
);
|
||||
assert.match(
|
||||
workspace,
|
||||
/if \(sending \|\| stream\.error \|\| queue\.length === 0\) return;/,
|
||||
"flushed only when the turn ended cleanly",
|
||||
);
|
||||
assert.match(workspace, /className="ui-loki-queue-item"/, "queued messages are shown");
|
||||
assert.match(
|
||||
workspace,
|
||||
/<LokiComposer[\s\S]*?\n\s+queue\n/,
|
||||
"the composer takes messages while running",
|
||||
);
|
||||
assert.deepEqual(readWork(null), []);
|
||||
assert.deepEqual(readWork({}), []);
|
||||
|
||||
|
||||
@@ -5966,6 +5966,11 @@
|
||||
.ui-loki-trail-icon {
|
||||
@apply h-3 w-3 shrink-0;
|
||||
}
|
||||
/* The command under a step: what was asked of the tool, in the code face,
|
||||
cut to one line. The record count stays the thing that reads first. */
|
||||
.ui-loki-trail-detail {
|
||||
@apply min-w-0 truncate font-mono text-micro text-text-muted;
|
||||
}
|
||||
.ui-loki-trail-count {
|
||||
@apply shrink-0 text-micro text-text-muted;
|
||||
}
|
||||
@@ -6153,6 +6158,18 @@
|
||||
single sine sweep. */
|
||||
|
||||
/* Composer context — scoped project + quick-action chips. */
|
||||
/* ── Queued messages ──────────────────────────────────────────────────────
|
||||
Typed while a turn ran; sent, in order, when it ends. Shown so the
|
||||
operator knows the words were taken, with a way to take them back. */
|
||||
.ui-loki-queue {
|
||||
@apply flex flex-wrap items-center gap-1.5 px-1 text-xs text-text-muted;
|
||||
}
|
||||
.ui-loki-queue-item {
|
||||
@apply inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle bg-surface-raised py-0.5 pl-2.5 pr-1 text-xs text-text-secondary;
|
||||
}
|
||||
.ui-loki-queue-remove {
|
||||
@apply inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-text-muted transition-colors hover:bg-surface-overlay hover:text-text-primary;
|
||||
}
|
||||
.ui-loki-scope-pill {
|
||||
@apply inline-flex max-w-44 items-center gap-1 rounded-full border border-accent-primary/30 bg-accent-muted px-2.5 py-1 text-xs font-medium text-accent-text;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ export type ComposerProps = {
|
||||
onStop?: () => void;
|
||||
/** What an attachments-only send says. Omit and an empty text cannot send. */
|
||||
attachmentOnlyText?: string;
|
||||
/** Take the next message while a turn runs; the caller sends it after. */
|
||||
queue?: boolean;
|
||||
attach?: boolean;
|
||||
voice?: boolean;
|
||||
/** Offer the Loki model picker (chat turns). Off where the model is the
|
||||
|
||||
@@ -45,6 +45,7 @@ export function LokiComposer({
|
||||
dispatchHonesty = null,
|
||||
showStarters = true,
|
||||
draftKey,
|
||||
queue = false,
|
||||
}: {
|
||||
disabled: boolean;
|
||||
sending: boolean;
|
||||
@@ -69,6 +70,8 @@ export function LokiComposer({
|
||||
/** Where the draft is mirrored so a discarded tab gives it back (see
|
||||
* lib/loki/draft.ts). Omit and the draft lives in memory only. */
|
||||
draftKey?: string;
|
||||
/** Take the next message while a turn runs (the workspace queues it). */
|
||||
queue?: boolean;
|
||||
}) {
|
||||
const [text, setTextState] = useState(defaultText);
|
||||
// Restore once, on the client, after the server-rendered empty box: reading
|
||||
@@ -201,6 +204,7 @@ export function LokiComposer({
|
||||
sending={sending}
|
||||
onStop={onStop}
|
||||
attachmentOnlyText={IMAGE_ONLY_DEFAULT}
|
||||
queue={queue}
|
||||
modelPicker
|
||||
above={suggestions}
|
||||
header={scopeRow}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { PanelLeft, SquarePen } from "lucide-react";
|
||||
import { getJson, postJson, deleteJson, throwApiError } from "@/lib/api/fetch";
|
||||
import { useLokiStream } from "@/hooks/use-loki-stream";
|
||||
import { resolveLokiProjectSelection } from "@/lib/loki/project-selection";
|
||||
import { conversationIdFromParam } from "@/lib/loki/conversation-param";
|
||||
import { X } from "lucide-react";
|
||||
import { clearLokiDraft, lokiDraftKey } from "@/lib/loki/draft";
|
||||
import { rememberFleetProject } from "@/lib/fleet-context";
|
||||
import { deriveExecutorHonestyLabel } from "@/lib/executor-honesty";
|
||||
@@ -340,6 +341,24 @@ export function LokiWorkspace({
|
||||
const stream = useLokiStream({ onMessage: handleMessage });
|
||||
const sending = stream.sending;
|
||||
|
||||
/**
|
||||
* Messages typed while a turn ran. The reference chat takes the next thought
|
||||
* the moment it is finished being typed — "Queue a message…" — and sends it
|
||||
* when the turn ends; refusing it until a spinner stops is the one place a
|
||||
* chat makes the person wait on the machine. Sent in order, one per turn,
|
||||
* through the same `send`, so a queued message is no different from a typed
|
||||
* one by the time the server sees it. Held (not dropped) if the turn failed:
|
||||
* the error and its Try again stand in front of it.
|
||||
*/
|
||||
type QueuedSend = {
|
||||
id: number;
|
||||
text: string;
|
||||
choice: ModelChoice;
|
||||
attachments: Attachment[];
|
||||
chatOnly?: boolean;
|
||||
};
|
||||
const [queue, setQueue] = useState<QueuedSend[]>([]);
|
||||
|
||||
// Client-side project filter over the full list (deselect = show all).
|
||||
const visibleConversations = useMemo(() => {
|
||||
if (selectedProjects.length === 0) return conversations;
|
||||
@@ -410,6 +429,14 @@ export function LokiWorkspace({
|
||||
const scopedProjects = opts.selectedProjectsOverride ?? selectedProjects;
|
||||
const dispatchOnly = opts.dispatchOnly ?? false;
|
||||
const chatOnly = opts.chatOnly ?? false;
|
||||
if (sending && !dispatchOnly) {
|
||||
setQueue((prev) => [
|
||||
...prev,
|
||||
{ id: Date.now() + prev.length, text, choice, attachments, chatOnly },
|
||||
]);
|
||||
clearLokiDraft(lokiDraftKey(activeId));
|
||||
return;
|
||||
}
|
||||
setError(null);
|
||||
setLastSent({ text, choice });
|
||||
// The draft is leaving the composer. Clear it under the key it was written
|
||||
@@ -452,6 +479,19 @@ export function LokiWorkspace({
|
||||
});
|
||||
};
|
||||
|
||||
// The turn ended: the next queued message goes. Through a ref, so the
|
||||
// effect does not re-run on every render that recreates `send`.
|
||||
const sendRef = useRef(send);
|
||||
useEffect(() => {
|
||||
sendRef.current = send;
|
||||
});
|
||||
useEffect(() => {
|
||||
if (sending || stream.error || queue.length === 0) return;
|
||||
const [next, ...rest] = queue;
|
||||
setQueue(rest);
|
||||
void sendRef.current(next.text, next.choice, next.attachments, { chatOnly: next.chatOnly });
|
||||
}, [sending, stream.error, queue]);
|
||||
|
||||
/**
|
||||
* Re-ask the last question.
|
||||
*
|
||||
@@ -557,6 +597,26 @@ export function LokiWorkspace({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{queue.length > 0 && (
|
||||
<div className="ui-loki-queue" role="status" aria-live="polite">
|
||||
<span>Next:</span>
|
||||
{queue.map((q) => (
|
||||
<span key={q.id} className="ui-loki-queue-item">
|
||||
<span className="truncate">{q.text}</span>
|
||||
<button
|
||||
type="button"
|
||||
className="ui-loki-queue-remove"
|
||||
onClick={() => setQueue((prev) => prev.filter((x) => x.id !== q.id))}
|
||||
aria-label={`Don't send: ${q.text}`}
|
||||
title="Don't send"
|
||||
>
|
||||
<X className="h-3 w-3" aria-hidden />
|
||||
</button>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<LokiComposer
|
||||
// Re-keyed only on a PREFILL, never on the thread id. Keying on
|
||||
// `activeId` remounted the composer the moment a first message created
|
||||
@@ -572,6 +632,7 @@ export function LokiWorkspace({
|
||||
onOpenProjects={() => setFilterOpen(true)}
|
||||
disabled={false}
|
||||
sending={sending}
|
||||
queue
|
||||
onStop={stream.stop}
|
||||
showStarters={isStart}
|
||||
dispatchHonesty={dispatchHonesty}
|
||||
|
||||
@@ -94,6 +94,7 @@ function ToolGroup({ tools, live }: { tools: WorkTool[]; live: boolean }) {
|
||||
<Check className="ui-loki-trail-icon text-status-positive" aria-hidden />
|
||||
)}
|
||||
<span className="truncate">{toolLabel(tool.name, tool.phase)}</span>
|
||||
{tool.detail && <span className="ui-loki-trail-detail">{tool.detail}</span>}
|
||||
{tool.phase === "end" && (
|
||||
<span className="ui-loki-trail-count">
|
||||
{tool.facts ?? 0} {(tool.facts ?? 0) === 1 ? "record" : "records"}
|
||||
|
||||
@@ -146,6 +146,7 @@ export function useLokiStream({
|
||||
name: event.name,
|
||||
phase: event.phase,
|
||||
facts: event.facts,
|
||||
detail: event.detail,
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
+11
-9
@@ -34,7 +34,7 @@
|
||||
* "answer with what you have" rather than to an error.
|
||||
*/
|
||||
import { assignFactIds, renderFacts, type Fact } from "@bitbaum/ai-kit/grounding";
|
||||
import type { WorkStep } from "@/lib/loki/work";
|
||||
import { describeArgs, type WorkStep } from "@/lib/loki/work";
|
||||
import {
|
||||
trimFactsToBudget,
|
||||
mergeFactsWithCap,
|
||||
@@ -123,11 +123,11 @@ export type LokiTurnEvent =
|
||||
/** What the model said in a gathering round, kept as a working note (see
|
||||
* lib/loki/work.ts) rather than discarded by the `reset` that follows. */
|
||||
| { type: "note"; text: string }
|
||||
| { type: "tool"; name: string; phase: "start" }
|
||||
| { type: "tool"; name: string; phase: "end"; facts: number }
|
||||
| { type: "tool"; name: string; phase: "start"; detail?: string }
|
||||
| { type: "tool"; name: string; phase: "end"; facts: number; detail?: string }
|
||||
// A failed tool is its own state, never "returned nothing" — the same
|
||||
// distinction the model is given in the note it receives.
|
||||
| { type: "tool"; name: string; phase: "fail" }
|
||||
| { type: "tool"; name: string; phase: "fail"; detail?: string }
|
||||
| { type: "status"; label: "verifying" };
|
||||
|
||||
/** A citation the UI can resolve — what [F8] or [D1] actually refers to. */
|
||||
@@ -301,12 +301,14 @@ async function runToolCalls(
|
||||
}
|
||||
attempted.add(key);
|
||||
used.push(call.name);
|
||||
emit({ type: "tool", name: call.name, phase: "start" });
|
||||
const detail = describeArgs(parsed.data);
|
||||
emit({ type: "tool", name: call.name, phase: "start", detail });
|
||||
try {
|
||||
const result = await tool.handler(parsed.data, ctx);
|
||||
facts.push(...result.facts);
|
||||
emit({ type: "tool", name: call.name, phase: "end", facts: result.facts.length });
|
||||
work.push({ kind: "tool", name: call.name, phase: "end", facts: result.facts.length });
|
||||
const facts_ = result.facts.length;
|
||||
emit({ type: "tool", name: call.name, phase: "end", facts: facts_, detail });
|
||||
work.push({ kind: "tool", name: call.name, phase: "end", facts: facts_, detail });
|
||||
messages.push({
|
||||
role: "user",
|
||||
content:
|
||||
@@ -317,8 +319,8 @@ async function runToolCalls(
|
||||
} catch (e) {
|
||||
// A failed tool must read as "unknown", never as "none" — otherwise the
|
||||
// model reports an outage as an empty result and the operator believes it.
|
||||
emit({ type: "tool", name: call.name, phase: "fail" });
|
||||
work.push({ kind: "tool", name: call.name, phase: "fail" });
|
||||
emit({ type: "tool", name: call.name, phase: "fail", detail });
|
||||
work.push({ kind: "tool", name: call.name, phase: "fail", detail });
|
||||
messages.push({
|
||||
role: "user",
|
||||
content: `[tool ${call.name}] FAILED (${e instanceof Error ? e.message.slice(0, 80) : "error"}). Treat this as unknown, not as empty.`,
|
||||
|
||||
@@ -48,7 +48,14 @@ export type LokiStreamEvent =
|
||||
* (lib/loki/work.ts), the narration between groups of tools. */
|
||||
| { type: "note"; text: string }
|
||||
/** One tool, as it runs. `facts` is how many records it actually returned. */
|
||||
| { type: "tool"; name: string; phase: "start" | "end" | "fail"; facts?: number }
|
||||
| {
|
||||
type: "tool";
|
||||
name: string;
|
||||
phase: "start" | "end" | "fail";
|
||||
facts?: number;
|
||||
/** The call's arguments as one line (lib/loki/work.ts describeArgs). */
|
||||
detail?: string;
|
||||
}
|
||||
/** Named waiting — what the turn is doing while no prose is arriving. */
|
||||
| { type: "status"; label: LokiStatusLabel }
|
||||
/** The authoritative persisted turn. Replaces the preview; ends the stream. */
|
||||
|
||||
@@ -32,6 +32,9 @@ export type WorkTool = {
|
||||
phase: "start" | "end" | "fail";
|
||||
/** Records it returned. Only meaningful once `phase` is "end". */
|
||||
facts?: number;
|
||||
/** The call's arguments, one short line (`query: "Elena"`) — what the
|
||||
* reference chat shows as the command under each step. */
|
||||
detail?: string;
|
||||
};
|
||||
export type WorkNote = { kind: "note"; text: string };
|
||||
export type WorkStep = WorkTool | WorkNote;
|
||||
@@ -80,6 +83,25 @@ export function applyNote(work: readonly WorkStep[], text: string): WorkStep[] {
|
||||
return [...work, { kind: "note", text }];
|
||||
}
|
||||
|
||||
/** How long a step's detail line may be. One line on a phone. */
|
||||
export const DETAIL_MAX_CHARS = 80;
|
||||
|
||||
/**
|
||||
* A tool call's arguments as one short line: `query: "Elena", limit: 5`.
|
||||
* Strings are quoted, nested values flattened to JSON, the whole thing cut
|
||||
* to one line — it is the command under the step, not the record of it.
|
||||
* Empty arguments are no detail at all rather than `{}`.
|
||||
*/
|
||||
export function describeArgs(args: unknown): string | undefined {
|
||||
if (!args || typeof args !== "object" || Array.isArray(args)) return undefined;
|
||||
const parts = Object.entries(args as Record<string, unknown>)
|
||||
.filter(([, v]) => v !== undefined && v !== null && v !== "")
|
||||
.map(([k, v]) => `${k}: ${typeof v === "string" ? JSON.stringify(v) : JSON.stringify(v)}`);
|
||||
if (parts.length === 0) return undefined;
|
||||
const line = parts.join(", ").replace(/\s+/g, " ");
|
||||
return line.length > DETAIL_MAX_CHARS ? `${line.slice(0, DETAIL_MAX_CHARS - 1)}…` : line;
|
||||
}
|
||||
|
||||
/** The one-line summary of a finished tool group. "0 records" is a real and
|
||||
* useful answer — it is how an operator learns the tool ran and their data is
|
||||
* genuinely empty, rather than assuming it never ran. */
|
||||
@@ -115,6 +137,7 @@ export function readWork(meta: Record<string, unknown> | null | undefined): Work
|
||||
name: e.name,
|
||||
phase: e.phase,
|
||||
...(typeof e.facts === "number" ? { facts: e.facts } : {}),
|
||||
...(typeof e.detail === "string" && e.detail ? { detail: e.detail } : {}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user