Server: one summary builder for both Wikipedia APIs, one reset-time conversion

summary() and summaryFromAction() assembled the same record field by field; the subscription
code converted reset times the way usage.ts's epochIso already does; attribution() spelled out
restTitle(). The "|0" cache-key comment says why it stays rather than how it came about.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Opus 5.5 committed 2026-11-17 16:07:12 -05:00
1 parent 63593fdb22
commit 7f6b9d8e77
3 files changed
+14 -26

No files matched your search

+2 -3
View File
@@ -25,7 +25,7 @@ import { TOOLS } from "../src/llm/tasks";
import type { Block, JsonReq, LLM, Req, Turn, TurnReq } from "../src/llm/types";
import { normUrl, type Research, type WebSource, type WebStep } from "../src/llm/web";
import { schemas } from "./schemas";
import { usage } from "./usage";
import { epochIso, usage } from "./usage";
/** A failed call, with the SDK's own words and an HTTP status for the browser. */
export class SubscriptionError extends Error {
@@ -91,8 +91,7 @@ export const bare = (model: string): Options => ({
permissionMode: "dontAsk",
});
const resetTime = (info?: SDKRateLimitInfo) =>
info?.resetsAt ? ` It resets at ${new Date(info.resetsAt * (info.resetsAt < 1e12 ? 1000 : 1)).toLocaleString()}.` : "";
const resetTime = (info?: SDKRateLimitInfo) => (info?.resetsAt ? ` It resets at ${new Date(epochIso(info.resetsAt)!).toLocaleString()}.` : "");
interface Call {
system: string;