@thready-web/dsh-bot-plugin 0.1.0-beta.4 → 0.1.0-beta.6

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/README.md CHANGED
@@ -117,7 +117,7 @@ A granted worker token/runtime cap pauses admission at the official asynchronous
117
117
 
118
118
  The ticket retains its attempt, fencing token and child session. `budget_json.quota` durably records cumulative committed `usage.totalTokens`, deduplication sequence, active elapsed time, and requested/waiting phase. Active time includes finishing in-flight work until the safe boundary; suspended-boundary waiting time is excluded. Waiting is exempt from lease/enqueue expiry and has no hard-wall failure timer. It retains a worker slot to preserve capacity accounting; the main bot is not in this worker gate or slot pool and can always grant, deny or cancel. Explicit cancellation releases the slot normally.
119
119
 
120
- A grant adds amounts, never resets usage, and must exceed both current token usage and active time. An insufficient grant leaves the gate closed without another noisy extension event; its response includes usage, required totals, minimum additional amounts and administrative headroom. Host token/active-wall ceilings are never increased: an unextendable worker stays paused with `host-ceiling` diagnostics until an explicit decision/cancellation. This is not automatic host approval or unlimited renewal.
120
+ A grant adds amounts, never resets usage, and must exceed both current token usage and active time. An insufficient grant leaves the gate closed without another noisy extension event; its response includes usage, required totals, and the minimum additional amounts. One slice is 1,000,000 tokens and 30 minutes. The first dispatch uses that slice, and every later grant adds at least another slice. There is no cumulative ceiling and no limit on how many times a ticket can be extended. A refusal from the main session is ignored: another full slice is granted instead.
121
121
 
122
122
  Budget requests are urgent next-turn inbox notices, bypassing stale notice/user/delivery admission barriers without steering or interrupting the main turn. Admission is single-flight per owner and rechecks grant/cancellation races before persisting a notice. Ordinary progress retains its existing admission policy. The workbench labels suspended workers “Waiting for budget”.
123
123
 
package/dist/context.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { sha256 } from "./fs-safe.js";
3
+ import { DEFAULT_WORK_BUDGET } from "./work-admit.js";
3
4
  export const RULES = [
4
5
  'The name written in the persona is your name. When asked what you are called, who you are, or how to address you, answer with that name only. Do not rename yourself DeepSeek, Harness, the host product, or a model id, and do not say you have no name.',
5
6
  'Facts marked as about the user describe the user. They are not your name and they are not your persona.',
@@ -15,14 +16,14 @@ export const CHAT = [
15
16
  'The latest user message is the current intent. If the previous sentence stopped halfway, answer the new one directly. Do not finish the old sentence.',
16
17
  'When the user did not ask you to look something up, edit files, dispatch work, or contact another bot, do not call tools and do not mention steps or system state.',
17
18
  'Default: hand every non-trivial task to a worker with foundations_dispatch. The main session plans, estimates budget, waits for ticket notices, reviews results, and replies to the user.',
18
- 'Direct execution is allowed only for a short reply that needs no tools; a tiny read-only check (one or two reads) needed to write a briefing or answer a simple question; or when the user clearly asked you to do the work yourself in this session. Do not run a multi-step shell, edit, or write chain in the main session without one of those exceptions.',
19
+ 'Direct execution is allowed only for a short reply that needs no tools; a tiny read-only check (one or two reads) needed to write a briefing or answer a simple question; or when the user clearly asked you to do the work yourself in this session and no worker owns that work. Do not run a multi-step shell, edit, or write chain in the main session without one of those exceptions. A task already handed to a worker stays with that worker.',
19
20
  "Prefer foundations_dispatch over bash, write, edit, and any official subagent tool for this bot's work. Official subagent is not the ticket worker.",
20
21
  'If an unfinished ticket can take the new work, call foundations_redirect and reuse that worker. Independent tasks may run in parallel up to the host slot cap. Dependent steps stay serial on the same ticket. Workers share the workspace: state file boundaries in the briefing, or run those tasks one after another. There is no filesystem isolation between workers.',
21
22
  'Workers usually have file tools (read, write, edit, working_directory) and foundations_report. They often do not have bash or other command tools. Assign work the worker can actually do. If a worker reports it is blocked because it has no command tools, do not dispatch that same command-only task to another worker with the same tools, and do not silently finish the job in the main session; tell the user the blockage.',
22
23
  'foundations_dispatch may return status=accepted (received, and possibly waiting for a slot), status=enqueued (placed on the execution queue, not started), or a BUDGET error when both the slot cap and the queue cap are full. accepted or enqueued is not completion and not started. Say in one sentence that the work is in the background, then end the turn. Do not sleep, poll, or keep calling tools while waiting.',
23
- "A ticket notice is not something the user said. On progress or artifact notices, do not take over the work and do not poll. On a question, answer or call foundations_supply. On a budget-extension notice, call foundations_grant (or deny). On a successful result, call foundations_publish, then write the user-visible reply. Do not treat a later failed status after a published result as if the worker never delivered. Do not invent a final answer or accept the work on the user's behalf before a result. Do not call foundations_retry unless the user explicitly asks.",
24
+ "A ticket notice is not something the user said. On progress or artifact notices, do not take over the work and do not poll. On a question, answer or call foundations_supply. On a budget-extension notice, call foundations_grant with enough to exceed current usage, then end the turn. You cannot refuse a worker budget. Do not take over the worker's task: do not inspect, edit, or build its files, and do not run its commands. On a successful result, call foundations_publish, then write the user-visible reply. On a failed result, tell the user the reason and stop. Do not take over the task. Do not treat a later failed status after a published result as if the worker never delivered. Do not invent a final answer or accept the work on the user's behalf before a result. Do not call foundations_retry unless the user explicitly asks.",
24
25
  'If dispatch returns BUDGET, do not start the job yourself and do not keep opening tickets to bypass the cap. Tell the user the host is at its limit.',
25
- 'On a budget-wait notice, decide whether to add sufficient budget or explicitly deny/cancel. Compare current cumulative usage, required totals and host headroom: small grants may leave the worker paused. Host ceilings cannot be raised by foundations_grant. A terminal failed/cancelled ticket cannot be revived by a grant. Do not foundations_dispatch a replacement ticket for the same work.',
26
+ `On a budget-wait notice, call foundations_grant and add at least one standard slice (${DEFAULT_WORK_BUDGET.workerMaxTokens} tokens and ${DEFAULT_WORK_BUDGET.workerWallMs} ms), or more when current usage is already past granted plus that slice. Grant every time the notice arrives. There is no limit on how many grants and no cumulative ceiling. Do not refuse because earlier grants were many or large. A grant that does not exceed current usage leaves the worker paused, so do not add a token or two. A terminal failed or cancelled ticket cannot be revived by a grant. Do not foundations_dispatch a replacement ticket for the same work. Do not cancel unless the user asks to stop.`,
26
27
  ].join('\n');
27
28
  export const DEFAULT_WINDOW = 128000;
28
29
  /**
@@ -278,7 +279,7 @@ export function renderTickets(rows) {
278
279
  'publish only records an intent to deliver. The words you write next are the reply to the user. Tell the user the result. Do not say accepted, enqueued, or publish.',
279
280
  'accepted can mean the ticket is waiting for an execution slot. enqueued means it entered the execution queue. started is the only status that means work has begun. needs_user means the worker is waiting for the user and does not occupy a running slot.',
280
281
  'A failed ticket that already had a published result is not an undelivered result. Ignore reports whose ticket, attempt, fencing token, or briefing revision does not match the current ticket.',
281
- 'When you open a ticket, estimate wallMs and maxTokens for the size of the task and put them in the foundations_dispatch budget. When the worker uses up that time or those tokens, the notice asks you to call foundations_grant. Do not call the ticket a failure before that grant.',
282
+ `When you open a ticket, set foundations_dispatch budget to one standard slice: wallMs ${DEFAULT_WORK_BUDGET.workerWallMs}, maxTokens ${DEFAULT_WORK_BUDGET.workerMaxTokens}. Do not estimate a smaller budget. When the worker uses that up, the notice asks you to call foundations_grant with another full slice. Grant every time, with no limit on the number of grants. Do not call the ticket a failure before that grant. If the ticket fails, tell the user and stop. Do not take over the unfinished task.`,
282
283
  ...lines,
283
284
  ].join('\n');
284
285
  }
@@ -18,8 +18,10 @@ export const DEFAULT_WORK_BUDGET = Object.freeze({
18
18
  chatWallMs: 30 * 60 * 1000,
19
19
  holdMs: 15_000,
20
20
  workerMaxSteps: 8,
21
- workerWallMs: 10 * 60 * 1000,
22
- workerMaxTokens: 400_000,
21
+ /** One budget slice. A grant adds another slice; there is no cumulative ceiling. */
22
+ workerWallMs: 30 * 60 * 1000,
23
+ /** One budget slice. A grant adds another slice; there is no cumulative ceiling. */
24
+ workerMaxTokens: 1_000_000,
23
25
  perBot: 2,
24
26
  global: 4,
25
27
  perBotQueue: 8,
@@ -231,32 +233,28 @@ export function budgetTrip(input) {
231
233
  return null;
232
234
  }
233
235
  /**
234
- * Positive integer inside an inclusive range.
236
+ * Positive integer at or above `min`. A non-finite value is omitted.
235
237
  * @param {unknown} value
236
238
  * @param {number} min
237
- * @param {number} max
238
239
  */
239
- function clampInt(value, min, max) {
240
+ function clampAtLeast(value, min) {
240
241
  const number = Number(value);
241
242
  if (!Number.isFinite(number))
242
243
  return null;
243
- return Math.max(min, Math.min(max, Math.floor(number)));
244
+ return Math.max(min, Math.floor(number));
244
245
  }
245
246
  /**
246
247
  * Ticket budget chosen when the main bot dispatches.
247
- * An explicit estimate is kept inside the host ceiling. An omitted field is
248
- * derived from the briefing length so every ticket gets its own numbers.
249
- * @param {string} briefing
248
+ * An omitted field is one standard slice. An explicit estimate is kept, with a
249
+ * floor of 1000. Later grants add on top and are not capped by this slice.
250
+ * @param {string} _briefing
250
251
  * @param {{ wallMs?: number, maxTokens?: number } | null | undefined} suggestion
251
252
  * @param {typeof DEFAULT_WORK_BUDGET} defaults
252
253
  */
253
- export function estimateWorkerBudget(briefing, suggestion, defaults = DEFAULT_WORK_BUDGET) {
254
- const chars = typeof briefing === 'string' ? briefing.length : 0;
255
- const guessedWall = Math.min(defaults.workerWallMs, 180_000 + chars * 100);
256
- const guessedTokens = Math.min(defaults.workerMaxTokens, 24_000 + chars * 8);
254
+ export function estimateWorkerBudget(_briefing, suggestion, defaults = DEFAULT_WORK_BUDGET) {
257
255
  return {
258
- wallMs: clampInt(suggestion?.wallMs, 1000, defaults.workerWallMs) ?? guessedWall,
259
- maxTokens: clampInt(suggestion?.maxTokens, 1000, defaults.workerMaxTokens) ?? guessedTokens,
256
+ wallMs: clampAtLeast(suggestion?.wallMs, 1000) ?? defaults.workerWallMs,
257
+ maxTokens: clampAtLeast(suggestion?.maxTokens, 1000) ?? defaults.workerMaxTokens,
260
258
  perBot: defaults.perBot,
261
259
  global: defaults.global,
262
260
  perBotQueue: defaults.perBotQueue,
@@ -1,5 +1,6 @@
1
1
  import { durableFollowup } from "./work-durable.js";
2
2
  import { sha256 } from "./fs-safe.js";
3
+ import { DEFAULT_WORK_BUDGET } from "./work-admit.js";
3
4
  /**
4
5
  * Child inputs and main-session wakes share one durability algorithm.
5
6
  * They are not rows in `deliveries`.
@@ -143,7 +144,7 @@ export async function pushInput(book, input, deps) {
143
144
  book.markInputFlush(input.id, 'dead', deps.pid, 'ticket-finished-or-superseded', null, false);
144
145
  return { ok: false, status: 'dead' };
145
146
  }
146
- let budget = { wallMs: 600_000, maxTokens: 400_000 };
147
+ let budget = { wallMs: DEFAULT_WORK_BUDGET.workerWallMs, maxTokens: DEFAULT_WORK_BUDGET.workerMaxTokens };
147
148
  try {
148
149
  budget = { ...budget, ...JSON.parse(ticket.budget_json) };
149
150
  }
@@ -662,12 +662,13 @@ export function createTicketBook(db, root, now = () => new Date()) {
662
662
  return { ticket: row('SELECT * FROM work_tickets WHERE id = ?', ticketId), already: false };
663
663
  }
664
664
  /**
665
- * Add granted runtime or tokens, capped by the host ceiling, and close the request.
665
+ * Add granted runtime or tokens and close the request when the new totals
666
+ * exceed current usage. There is no cumulative ceiling and no grant-count cap.
666
667
  * @param {string} ticketId
667
668
  * @param {{ wallMs?: number, maxTokens?: number }} add
668
- * @param {{ wallMs: number, maxTokens: number }} ceilings
669
+ * @param {{ wallMs: number, maxTokens: number }} [baseline]
669
670
  */
670
- function extendBudget(ticketId, add, ceilings) {
671
+ function extendBudget(ticketId, add, baseline) {
671
672
  const ticket = row('SELECT * FROM work_tickets WHERE id = ?', ticketId);
672
673
  if (!ticket)
673
674
  return { error: 'NOT_FOUND', message: 'No such ticket.' };
@@ -675,23 +676,17 @@ export function createTicketBook(db, root, now = () => new Date()) {
675
676
  return { error: 'VALIDATION', message: 'This ticket has finished and cannot be granted more budget.' };
676
677
  }
677
678
  const budget = budgetObject(ticket);
678
- const beforeWall = Number(budget.wallMs) || ceilings.wallMs;
679
- const beforeTokens = Number(budget.maxTokens) || ceilings.maxTokens;
679
+ const beforeWall = Number(budget.wallMs) || baseline?.wallMs || 0;
680
+ const beforeTokens = Number(budget.maxTokens) || baseline?.maxTokens || 0;
680
681
  const wallAdd = Number(add.wallMs);
681
682
  const tokenAdd = Number(add.maxTokens);
682
- const wallMs = Number.isFinite(wallAdd) && wallAdd > 0 ? Math.min(ceilings.wallMs, beforeWall + Math.floor(wallAdd)) : beforeWall;
683
- const maxTokens = Number.isFinite(tokenAdd) && tokenAdd > 0
684
- ? Math.min(ceilings.maxTokens, beforeTokens + Math.floor(tokenAdd))
685
- : beforeTokens;
683
+ const wallMs = Number.isFinite(wallAdd) && wallAdd > 0 ? beforeWall + Math.floor(wallAdd) : beforeWall;
684
+ const maxTokens = Number.isFinite(tokenAdd) && tokenAdd > 0 ? beforeTokens + Math.floor(tokenAdd) : beforeTokens;
686
685
  if (wallMs === beforeWall && maxTokens === beforeTokens) {
687
- return { error: 'VALIDATION', message: 'Nothing more can be granted. The host ceiling is already used.' };
686
+ return { error: 'VALIDATION', message: 'Pass wallMs or maxTokens to add.' };
688
687
  }
689
688
  const quota = budget.quota;
690
- const enough = !quota?.waiting ||
691
- (maxTokens > quota.tokens &&
692
- wallMs > quota.activeMs &&
693
- quota.tokens < ceilings.maxTokens &&
694
- quota.activeMs < ceilings.wallMs);
689
+ const enough = !quota?.waiting || (maxTokens > quota.tokens && wallMs > quota.activeMs);
695
690
  const next = {
696
691
  ...budget,
697
692
  wallMs,
@@ -1,4 +1,6 @@
1
1
  import { toolError } from "./errors.js";
2
+ import { DEFAULT_WORK_BUDGET } from "./work-admit.js";
3
+ const SLICE = `${DEFAULT_WORK_BUDGET.workerWallMs} ms and ${DEFAULT_WORK_BUDGET.workerMaxTokens} tokens`;
2
4
  const OUTPUT = {
3
5
  schema: {
4
6
  type: 'object',
@@ -24,7 +26,7 @@ export function workToolDefinitions(work, engine) {
24
26
  idempotencyKey: { type: 'string' },
25
27
  budget: {
26
28
  type: 'object',
27
- description: 'Time and token estimate for this ticket. When omitted, the host estimates from the task text. It cannot exceed the host ceiling.',
29
+ description: `Time and token budget for this ticket. When omitted, the host uses one standard slice (${SLICE}). Pass that slice. Do not estimate a smaller budget. Later grants add more slices with no cumulative ceiling.`,
28
30
  properties: {
29
31
  wallMs: { type: 'integer', description: 'Expected maximum runtime in milliseconds.' },
30
32
  maxTokens: { type: 'integer', description: 'Expected maximum tokens.' },
@@ -65,13 +67,16 @@ export function workToolDefinitions(work, engine) {
65
67
  ownerSessionId: { type: 'string', description: 'Ignored.' },
66
68
  },
67
69
  }, (args, hostId) => work.cancelTicket(hostId, args), 'bot'),
68
- tool('foundations_grant', 'Grant more active runtime or tokens to an unfinished ticket. wallMs and maxTokens are amounts to ADD, not totals. Exhausted workers wait at the next safe loop boundary without expiry. Use current usage/required totals and headroom in the notice/result: insufficient grants remain paused, host ceilings cannot be raised. deny=true stops this round; do not redispatch a replacement.', {
70
+ tool('foundations_grant', `Grant more active runtime or tokens to an unfinished ticket. wallMs and maxTokens are amounts to ADD, not totals. Add at least one standard slice (${SLICE}), and more if current usage is already past granted plus that slice. There is no limit on how many times you grant and no cumulative ceiling. Do not refuse because earlier grants were many or large. Exhausted workers wait at the next safe loop boundary without expiry. An insufficient grant leaves the worker paused. The main session cannot refuse. deny=true does not stop the worker; another full slice is granted. Tell the user and end the turn. Do not take over the task and do not redispatch a replacement.`, {
69
71
  type: 'object',
70
72
  properties: {
71
73
  ticketId: { type: 'string' },
72
74
  wallMs: { type: 'integer', description: 'Milliseconds to add.' },
73
75
  maxTokens: { type: 'integer', description: 'Tokens to add.' },
74
- deny: { type: 'boolean', description: 'Refuse the grant and stop.' },
76
+ deny: {
77
+ type: 'boolean',
78
+ description: 'Ignored as a refusal. Does not stop the worker.',
79
+ },
75
80
  ownerSessionId: { type: 'string', description: 'Ignored.' },
76
81
  },
77
82
  required: ['ticketId'],
@@ -429,20 +429,16 @@ export function createWorkRuntime(store, engine, options = {}) {
429
429
  const found = resolveTicket(owner, args.ticketId, null);
430
430
  if (found.error)
431
431
  return found.error;
432
+ // The model cannot kill a worker by refusing budget. A deny adds another
433
+ // full slice. Grant count is not a reason to stop.
434
+ let refusalIgnored = false;
432
435
  if (args.deny === true) {
433
- const failed = await store.write('work', () => book.failRunning(found.ticket.id, 'grant-denied'));
434
- const child = failed?.child_session_id;
435
- const state = child ? arms.get(child) : null;
436
- if (child)
437
- closeBudgetWait(child);
438
- if (state) {
439
- state.closing = true;
440
- state.clear?.();
441
- }
442
- if (resident && child && options.cancel)
443
- await options.cancel(child, { keepInbox: false, reason: 'grant-denied' });
444
- schedulePromote();
445
- return { ok: true, ticketId: found.ticket.id, ticketStatus: 'failed', denied: true };
436
+ refusalIgnored = true;
437
+ args = {
438
+ ticketId: found.ticket.id,
439
+ maxTokens: limits.workerMaxTokens,
440
+ wallMs: limits.workerWallMs,
441
+ };
446
442
  }
447
443
  const live = found.ticket.child_session_id ? arms.get(found.ticket.child_session_id) : null;
448
444
  if (live?.role === 'worker')
@@ -451,8 +447,13 @@ export function createWorkRuntime(store, engine, options = {}) {
451
447
  wallMs: typeof args.wallMs === 'number' ? args.wallMs : undefined,
452
448
  maxTokens: typeof args.maxTokens === 'number' ? args.maxTokens : undefined,
453
449
  }, { wallMs: limits.workerWallMs, maxTokens: limits.workerMaxTokens }));
454
- if (added.error)
455
- return { ...toolError(added.error, added.message ?? 'No budget was added.'), ...quotaFeedback(found.ticket.id) };
450
+ if (added.error) {
451
+ return {
452
+ ...toolError(added.error, added.message ?? 'No budget was added.'),
453
+ ...quotaFeedback(found.ticket.id),
454
+ ...(refusalIgnored ? { denied: false } : {}),
455
+ };
456
+ }
456
457
  const child = added.ticket.child_session_id;
457
458
  if (child)
458
459
  releaseArm(child, added.budget);
@@ -467,8 +468,6 @@ export function createWorkRuntime(store, engine, options = {}) {
467
468
  ['started', 'enqueued'].includes(added.ticket.status) &&
468
469
  added.budget.maxTokens > quota.tokens &&
469
470
  added.budget.wallMs > quota.activeMs &&
470
- quota.tokens < limits.workerMaxTokens &&
471
- quota.activeMs < limits.workerWallMs &&
472
471
  !(await isChildLive(child))) {
473
472
  resumedInput = await store.write('work', () => {
474
473
  const fresh = book.ticket(added.ticket.id);
@@ -500,6 +499,7 @@ export function createWorkRuntime(store, engine, options = {}) {
500
499
  if (resumedInput)
501
500
  await pushInput(book, resumedInput, deps);
502
501
  }
502
+ const feedback = quotaFeedback(added.ticket.id);
503
503
  return {
504
504
  ok: true,
505
505
  ticketId: added.ticket.id,
@@ -507,9 +507,16 @@ export function createWorkRuntime(store, engine, options = {}) {
507
507
  briefingRevision: book.ticket(added.ticket.id)?.briefing_revision,
508
508
  wallMs: added.budget.wallMs,
509
509
  maxTokens: added.budget.maxTokens,
510
- hostCeilingTokens: limits.workerMaxTokens,
511
- hostCeilingWallMs: limits.workerWallMs,
512
- ...quotaFeedback(added.ticket.id),
510
+ ...feedback,
511
+ ...(refusalIgnored
512
+ ? {
513
+ denied: false,
514
+ refusalIgnored: true,
515
+ message: feedback.waitingBudget
516
+ ? 'Budget refusal was not applied. Another full slice was granted, and the worker is still paused because usage is past that grant. Grant another slice. Do not cancel unless the user asks to stop. Do not take over the task.'
517
+ : 'Budget refusal was not applied. Another full slice was granted and the worker continues. Do not take over the task.',
518
+ }
519
+ : {}),
513
520
  continuation: resumedInput
514
521
  ? 'same-session-new-turn'
515
522
  : child && arms.has(child)
@@ -926,7 +933,7 @@ export function createWorkRuntime(store, engine, options = {}) {
926
933
  const body = text.length > 8000 ? `${text.slice(0, 8000)}\n…` : text;
927
934
  const ask = event.kind === 'result'
928
935
  ? 'This is a successful result. Call foundations_publish now. Use the eventId below as resultEventId and the words you want the user to see as text. After the tool returns, write that same text as the reply to the user. Do not only restate the status, and do not ask the user to paste the body back.'
929
- : 'This is a failed result. Now tell the user the reason and the next step in your own words. Do not only restate the status, and do not ask the user to paste the body back.';
936
+ : 'This is a failed result. Tell the user the reason in your own words, then stop. Do not only restate the status, and do not ask the user to paste the body back. Do not take over the task, and do not dispatch a replacement unless the user explicitly asks.';
930
937
  return [head, `eventId: ${event.event_id}`, ask, '---', body].join('\n');
931
938
  }
932
939
  /**
@@ -1515,21 +1522,21 @@ export function createWorkRuntime(store, engine, options = {}) {
1515
1522
  try {
1516
1523
  const parsed = JSON.parse(ticket.budget_json);
1517
1524
  if (Number.isFinite(parsed.wallMs))
1518
- wallMs = Math.min(limits.workerWallMs, Math.max(1000, parsed.wallMs));
1525
+ wallMs = Math.max(1000, parsed.wallMs);
1519
1526
  if (Number.isFinite(parsed.maxTokens))
1520
- maxTokens = Math.min(limits.workerMaxTokens, Math.max(1000, parsed.maxTokens));
1527
+ maxTokens = Math.max(1000, parsed.maxTokens);
1521
1528
  extensionOpen = parsed.extension === 'open';
1522
1529
  }
1523
1530
  catch {
1524
- /* host ceiling */
1531
+ /* ticket budget */
1525
1532
  }
1526
1533
  }
1527
1534
  return {
1528
1535
  maxSteps: Number.POSITIVE_INFINITY,
1529
1536
  wallMs,
1530
1537
  maxTokens,
1531
- ceilingWall: limits.workerWallMs,
1532
- ceilingTokens: limits.workerMaxTokens,
1538
+ ceilingWall: Number.POSITIVE_INFINITY,
1539
+ ceilingTokens: Number.POSITIVE_INFINITY,
1533
1540
  extensionOpen,
1534
1541
  };
1535
1542
  }
@@ -1591,10 +1598,10 @@ export function createWorkRuntime(store, engine, options = {}) {
1591
1598
  `granted wall ms: ${state.limits.wallMs}`,
1592
1599
  `tokens used: ${state.tokens}`,
1593
1600
  `granted tokens: ${state.limits.maxTokens}`,
1594
- `host ceiling tokens: ${state.limits.ceilingTokens}; host ceiling active wall ms: ${state.limits.ceilingWall}`,
1595
1601
  `required total tokens: ${state.tokens + 1}; required total active wall ms: ${elapsed + 1}`,
1602
+ `standard slice tokens: ${limits.workerMaxTokens}; standard slice wall ms: ${limits.workerWallMs}`,
1596
1603
  'Worker is waiting for budget at the next safe loop boundary. It will not dispatch another step until sufficient budget is granted. Budget wait does not expire.',
1597
- 'Call foundations_grant with amounts to ADD, sufficient to exceed current cumulative usage. Host ceilings cannot be raised by this tool; at a host ceiling an explicit deny/cancel is required. Pass deny=true to stop. Do not redispatch a replacement ticket.',
1604
+ "Call foundations_grant with amounts to ADD. Add at least one standard slice, and more if current usage is already past granted plus that slice. There is no limit on how many times you grant and no cumulative ceiling. Do not refuse because this ticket has already been extended. deny does not stop the worker. Do not cancel unless the user asks to stop. Do not redispatch a replacement ticket. Do not take over the task: do not inspect, edit, or build the worker's files, and do not run its commands.",
1598
1605
  ].join('\n');
1599
1606
  book.insertEvent({
1600
1607
  ticketId: ticket.id,
@@ -1625,10 +1632,7 @@ export function createWorkRuntime(store, engine, options = {}) {
1625
1632
  state.limits.wallMs = budget.wallMs;
1626
1633
  state.limits.maxTokens = budget.maxTokens;
1627
1634
  const elapsed = Math.max(0, (state.pausedAt != null && state.atBoundary ? state.pausedAt : now().getTime()) - state.startedAt);
1628
- if (state.tokens >= budget.maxTokens ||
1629
- elapsed >= budget.wallMs ||
1630
- state.tokens >= state.limits.ceilingTokens ||
1631
- elapsed >= state.limits.ceilingWall) {
1635
+ if (state.tokens >= budget.maxTokens || elapsed >= budget.wallMs) {
1632
1636
  state.extensionOpen = true;
1633
1637
  if (state.pausedAt == null)
1634
1638
  state.pausedAt = now().getTime();
@@ -1681,11 +1685,7 @@ export function createWorkRuntime(store, engine, options = {}) {
1681
1685
  runningSince: state.pausedAt == null ? now().getTime() : null,
1682
1686
  waiting: state.pausedAt != null,
1683
1687
  phase: state.atBoundary ? 'waiting' : 'requested',
1684
- reason: state.pausedAt == null
1685
- ? undefined
1686
- : state.tokens >= state.limits.ceilingTokens || activeMs >= state.limits.ceilingWall
1687
- ? 'host-ceiling'
1688
- : (reason ?? quotaOf(attempt.ticket_id)?.reason),
1688
+ reason: state.pausedAt == null ? undefined : (reason ?? quotaOf(attempt.ticket_id)?.reason),
1689
1689
  });
1690
1690
  }
1691
1691
  function quotaFeedback(ticketId) {
@@ -1700,8 +1700,8 @@ export function createWorkRuntime(store, engine, options = {}) {
1700
1700
  requiredWallMs: (quota?.activeMs ?? 0) + 1,
1701
1701
  minimumAdditionalTokens: Math.max(0, (quota?.tokens ?? 0) + 1 - (budget.maxTokens ?? 0)),
1702
1702
  minimumAdditionalWallMs: Math.max(0, (quota?.activeMs ?? 0) + 1 - (budget.wallMs ?? 0)),
1703
- hostTokenHeadroom: Math.max(0, limits.workerMaxTokens - (quota?.tokens ?? 0)),
1704
- hostWallHeadroomMs: Math.max(0, limits.workerWallMs - (quota?.activeMs ?? 0)),
1703
+ sliceTokens: limits.workerMaxTokens,
1704
+ sliceWallMs: limits.workerWallMs,
1705
1705
  };
1706
1706
  }
1707
1707
  function closeBudgetWait(sessionId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thready-web/dsh-bot-plugin",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.6",
4
4
  "type": "module",
5
5
  "description": "DSH bot plugin: session persona, memory, work, hash routing, and the workbench. Pinned to @deepseek-ai/dsh 0.2.2-rc.1.",
6
6
  "license": "MIT",
@@ -1 +1 @@
1
- :root{color-scheme:light;--dsw-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;--ds-font-family-code: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, Courier, "PingFang SC", "Microsoft YaHei";--dsw-radius-sm: 8px;--dsw-radius-lg: 16px;--dsw-radius-xl: 20px;--dsw-radius-panel: 28px;--bg: #fff;--sidebar: #f9fafb;--ink: rgb(15, 17, 21);--secondary: rgb(97, 102, 107);--tertiary: rgb(129, 133, 140);--caption: rgb(173, 178, 184);--hover: rgba(38, 49, 72, .06);--selected: rgb(235, 238, 242);--bubble: rgb(237, 243, 254);--line: rgba(0, 0, 0, .1);--line-strong: rgba(0, 0, 0, .12);--code-bg: #f9fafb;--inline-code: #f5f5f5;--link: rgb(65, 118, 230);--send: rgb(65, 118, 230);--send-hover: rgb(122, 170, 255);--selector: #f9fafb;--shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 4px 16px rgba(0, 0, 0, .03), 0 0 24px rgba(0, 0, 0, .03);font-family:var(--dsw-font-family);color:var(--ink);background:var(--bg)}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0}#root{display:flex;justify-content:center}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default}a{color:var(--link);text-decoration:none}.shell{width:min(1120px,100%);height:100%;display:grid;grid-template-columns:268px minmax(0,1fr);background:var(--bg)}.side,.chat{min-width:0;min-height:0}.side{display:flex;flex-direction:column;background:var(--sidebar);padding:14px 10px 10px}.side-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 6px 12px}.brand{font-size:15px;font-weight:650}.side-actions{display:flex;gap:2px}.icon-btn,.add{width:28px;height:28px;border:0;border-radius:999px;display:grid;place-items:center;background:transparent;color:var(--ink)}.icon-btn:hover,.add:hover{background:var(--hover)}.icon-btn svg,.add svg,.send svg{width:16px;height:16px}.filter{margin:0 6px 8px;border:0;background:#fff;border-radius:8px;padding:8px 10px;outline:none}.note{color:#9a3412;font-size:12px;margin:0 8px 8px}.note.ok{color:var(--secondary)}.sessions{list-style:none;margin:0;padding:0;overflow:auto;flex:1}.sessions .empty{color:var(--tertiary);font-size:13px;padding:8px 10px}.session{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;background:transparent;border-radius:10px;padding:8px}.session:hover{background:var(--hover)}.session.selected{background:var(--selected)}.session-row{display:flex;align-items:center;border-radius:10px}.session-row .session{flex:1;min-width:0}.session-delete{flex:none;border:0;background:transparent;color:var(--tertiary);font-size:12px;padding:6px 8px;border-radius:8px}.session-delete:hover{color:#9a3412;background:var(--hover)}.session-delete.purge{color:#9a3412}.blank-head{flex-wrap:wrap}.blank-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 10px 4px;color:var(--tertiary);font-size:12px}.blank-head button{border:0;background:transparent;color:inherit;padding:0}.blank-head button:hover{color:var(--ink)}.mark{position:relative;width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:var(--selector);color:var(--secondary);font-size:13px;font-weight:650;flex:none}.bot-dot{position:absolute;right:-2px;bottom:-2px;width:8px;height:8px;border-radius:999px;background:#16a34a;box-shadow:0 0 0 2px var(--sidebar)}.bot-dot.wait{background:#2563eb}.session.selected .bot-dot{box-shadow:0 0 0 2px var(--selected)}.bot-badge .bot-dot{top:-2px;bottom:auto;box-shadow:0 0 0 2px var(--bg)}.session.selected .mark{background:#fff}.mark.bot-mark,.bot-badge{background:#111827;color:#fff;font-size:10px;font-weight:700;letter-spacing:.06em}.mark.bot-mark{width:auto;min-width:28px;padding:0 6px}.session.selected .mark.bot-mark{background:#111827;color:#fff}.bot-badge{position:relative;flex:none;border-radius:999px;padding:2px 7px;line-height:16px}.copy{min-width:0;flex:1}.name,.preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name{font-size:14px;font-weight:560}.preview{color:var(--tertiary);font-size:12px;margin-top:1px}.preview:empty:before{content:"​"}.me-row{display:flex;align-items:center;gap:4px}.me{display:flex;align-items:center;gap:8px;flex:1;min-width:0;border:0;background:transparent;border-radius:10px;padding:8px;text-align:left}.lang-switch{flex:none;border:0;background:transparent;border-radius:8px;padding:6px 8px;color:var(--tertiary);font:inherit;font-size:12px}.lang-switch:hover{background:var(--hover);color:var(--ink)}.me:hover{background:var(--hover)}.me-mark{background:var(--ink);color:#fff;font-size:12px}.status{background:#fff;border-radius:14px;padding:10px 12px;margin:8px;box-shadow:var(--shadow);font-size:13px}.status p{margin:0 0 6px}.status p:last-child{margin:0}.muted{color:var(--tertiary)}.chat{display:flex;flex-direction:column;background:var(--bg)}.inbox-line{display:flex;flex-direction:column;align-items:flex-end;gap:4px;width:min(320px,86%);margin:12px 0 12px auto}.inbox-line time{color:var(--caption);font-size:12px;line-height:18px}.inbox-entry{display:flex;align-items:center;gap:10px;width:100%;border:0;background:#fff;text-align:left;border-radius:16px;box-shadow:var(--shadow);padding:10px 12px}.inbox-entry:hover{background:var(--sidebar)}.inbox-icon{width:28px;height:28px;border-radius:8px;flex:none;display:grid;place-items:center;background:#111827;color:#fff}.inbox-icon svg{width:16px;height:16px}.inbox-copy{min-width:0;display:flex;flex-direction:column}.inbox-copy strong,.inbox-copy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-copy strong{font-size:13px;line-height:18px;font-weight:600}.inbox-copy span{color:var(--secondary);font-size:12px;line-height:18px}.bot-chat-back{display:inline;flex:none;border:0;background:transparent;padding:0;color:var(--link);font-size:13px}.bot-chat-lead{margin:8px 0 16px;color:var(--tertiary);font-size:13px;line-height:20px}.bot-out{display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:min(525px,82%);margin:18px 0 18px auto}.bot-out span,.bot-out time{color:var(--caption);font-size:12px;line-height:18px}.chat-head{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 22px}.chat-head h1{flex:1;min-width:0;margin:0;font-size:14px;font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.basis{margin:0;padding:0 22px 8px;color:var(--tertiary);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.work-crumb{display:flex;align-items:center;gap:6px;min-width:0;margin:0;padding:0 22px 8px;color:var(--tertiary);font-size:13px;line-height:20px}.work-crumb button{flex:none;max-width:46%;border:0;background:transparent;padding:0;color:var(--link);font-size:13px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.work-crumb>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}.setup-mask{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:24px;background:#0f111547}.setup-card{width:min(480px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:20px;padding:18px 18px 14px;box-shadow:0 0 0 .5px #0000001a,0 16px 48px #0000001f}.setup-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.setup-head h2{margin:0;font-size:16px;font-weight:560}.setup-close{width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:var(--secondary)}.setup-close:hover{background:var(--hover)}.setup-lead{margin:8px 0 0;color:var(--secondary);font-size:13px;line-height:1.45}.setup-card label{display:block;margin:14px 0 6px;font-size:13px}.setup-card textarea,.setup-card input,.setup-card select{width:100%;border:0;background:var(--sidebar);border-radius:10px;padding:8px 10px;outline:none}.setup-card textarea{resize:vertical}.setup-card input+input,.setup-card select+input{margin-top:8px}.setup-error{color:#9a3412;font-size:12px;margin:10px 0 0}.setup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.setup-actions button{border:0;border-radius:999px;padding:8px 14px;background:var(--hover)}.setup-actions .primary{background:var(--send);color:#fff}.setup-actions .primary:disabled{opacity:.6}.chat-head a{flex:none;font-size:13px;color:var(--secondary)}.work-chip{flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:var(--selector);border-radius:999px;padding:2px 8px}.briefing-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(640px,100%);margin:18px 0}.briefing-row time{color:var(--caption);font-size:12px;line-height:18px}.briefing-card{width:100%;background:var(--code-bg);border:.5px solid var(--line);border-radius:16px}.briefing-toggle{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;min-height:40px;padding:10px 14px 12px;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.briefing-card.open .briefing-toggle{padding-bottom:0}.briefing-title{font-size:14px;line-height:20px;font-weight:600}.briefing-rev{color:var(--secondary);font-size:12px;line-height:18px;background:#fff;border-radius:999px;padding:2px 8px}.briefing-chevron{width:14px;height:14px;margin-left:auto;flex:none;color:var(--tertiary);transition:transform .3s ease}.briefing-card.open .briefing-chevron{transform:rotate(180deg)}.briefing-preview{flex:1 0 100%;margin:0;color:var(--secondary);font-size:13px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.briefing-body{padding:4px 14px 12px}.briefing-body .markdown p{margin:8px 0}.briefing-facts,.briefing-note{margin:8px 0 0;color:var(--tertiary);font-size:12px;line-height:18px}.work-card{margin:14px 0 18px;padding:12px 14px;border:.5px solid var(--line);border-radius:16px;background:var(--code-bg)}.work-card header{display:flex;align-items:center;justify-content:space-between;gap:12px}.work-card h3{margin:0;min-width:0;font-size:14px;line-height:20px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.work-status{flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:#fff;border-radius:999px;padding:2px 8px}.work-status.live{color:var(--ink)}.work-card p{margin:6px 0 0;color:var(--secondary);font-size:13px;line-height:20px}.work-card .work-question{color:var(--ink)}.work-card .stale{text-decoration:line-through;color:var(--tertiary)}.work-quiet{color:var(--tertiary)}.work-reply{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px}.work-reply label{display:flex;flex-direction:column;gap:6px;width:100%}.work-reply span{color:var(--tertiary);font-size:12px;line-height:18px}.work-reply textarea{width:100%;resize:vertical;min-height:56px;border:.5px solid var(--line);border-radius:10px;background:#fff;padding:8px 10px;outline:none}.work-reply button{border:0;border-radius:999px;background:var(--send);color:#fff;padding:6px 12px;font-size:13px;line-height:20px}.work-reply button:disabled{opacity:.45}.work-open{margin-top:8px;border:0;background:transparent;padding:0;color:var(--link);font-size:13px;line-height:20px}.work-card .work-error{color:#9a3412}.work-refused{margin:8px 0 14px;color:#9a3412;font-size:13px;line-height:20px}.work-note{margin:4px 0 12px;color:var(--secondary);font-size:13px;line-height:20px}.user-question-card{margin:14px 0 18px;padding:14px 16px;min-width:0;border:.5px solid var(--line);border-radius:16px;background:var(--code-bg)}.user-question+.user-question{margin-top:16px;padding-top:16px;border-top:.5px solid var(--line)}.user-question-header{margin:0 0 6px;font-size:13px;line-height:20px;font-weight:600;color:var(--secondary)}.user-question-text{margin:0;font-size:15px;line-height:24px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}.user-question-hint,.user-question-status{margin:8px 0 0;font-size:13px;line-height:20px;color:var(--secondary)}.user-question-status.exception{color:#9a3412}.user-question-options{display:flex;flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none}.user-question-option{display:flex;flex-direction:column;gap:2px;width:100%;min-width:0;margin:0;padding:10px 12px;border:.5px solid var(--line);border-radius:12px;background:#fff;box-sizing:border-box;text-align:left;font:inherit;color:inherit}button.user-question-option{cursor:pointer}button.user-question-option:hover:not(:disabled),button.user-question-option:focus-visible{border-color:var(--ink)}button.user-question-option:disabled{cursor:default;opacity:.7}.user-question-option.selected{border-color:var(--ink)}.user-question-actions{display:flex;flex-direction:column;gap:8px;margin-top:10px}.user-question-custom{display:flex;flex-direction:column;gap:4px;font-size:13px;line-height:20px;color:var(--secondary)}.user-question-custom textarea{width:100%;min-width:0;box-sizing:border-box;resize:vertical;padding:8px 10px;border:.5px solid var(--line);border-radius:10px;font:inherit;color:var(--ink)}.user-question-skip,.user-question-submit{align-self:flex-start;margin-top:4px;padding:6px 12px;border:.5px solid var(--line);border-radius:10px;background:#fff;font:inherit;font-size:13px;line-height:20px;color:var(--ink);cursor:pointer}.user-question-submit{margin-top:12px}.user-question-option-label{font-size:14px;line-height:22px;color:var(--ink);overflow-wrap:anywhere}.user-question-option-desc{font-size:13px;line-height:20px;color:var(--secondary);overflow-wrap:anywhere}.user-question-badge{display:inline-block;margin-left:6px;padding:0 6px;border-radius:999px;background:var(--line);font-size:11px;line-height:18px;font-weight:600;color:var(--secondary);vertical-align:middle}.user-question-wait,.user-question-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}.user-question-plan{margin-top:10px;min-width:0;overflow:auto}.user-question-secret{margin:8px 0 0;letter-spacing:.2em;color:var(--secondary)}.user-question-secret-input{width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;border:.5px solid var(--line);border-radius:10px;font:inherit;color:transparent;text-shadow:0 0 0 var(--ink);-webkit-text-security:disc}.settings-drawer{position:fixed;inset:0;z-index:30;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}.settings-drawer-mask{position:absolute;inset:0;pointer-events:auto;background:#0f111547;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.settings-drawer-sheet{position:relative;z-index:1;pointer-events:auto;display:flex;flex-direction:column;width:min(748px,100%);max-width:100%;max-height:min(90vh,100dvh);padding-bottom:env(safe-area-inset-bottom,0px);border-radius:20px 20px 0 0;background:#fff;box-shadow:var(--shadow);overflow:hidden;animation:settings-drawer-up .22s ease-out}.settings-drawer-handle{width:36px;height:4px;margin:8px auto 0;border-radius:999px;background:var(--line);flex:none}.settings-drawer-body{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 16px 16px}@keyframes settings-drawer-up{0%{transform:translateY(16px);opacity:.64}to{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.settings-drawer-sheet{animation:none}}@media(max-width:800px){.settings-drawer-sheet{width:100%;border-radius:16px 16px 0 0}}.settings-head,.settings-confirm{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.settings-head{flex:none;padding:8px 16px}.settings-head h3{margin:0;font-size:15px;line-height:24px}button.chip{cursor:pointer;font:inherit}.back{display:none;border:0;background:transparent;padding:0;color:var(--link)}.scroll{flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px 28px 12px;scrollbar-width:thin;scrollbar-color:#e5e5e5 transparent}.scroll::-webkit-scrollbar{width:5px;height:5px}.scroll::-webkit-scrollbar-track{margin-block:2px;background:transparent}.scroll::-webkit-scrollbar-thumb{background:#e5e5e5;background-clip:content-box;border-radius:999px}.scroll::-webkit-scrollbar-thumb:hover{background:#d4d4d4}.scroll::-webkit-scrollbar-corner{background:transparent}.chat-body{position:relative;flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;container-type:inline-size}.turn-rail{position:absolute;z-index:4;top:50%;right:14px;width:28px;max-height:min(420px,calc(100% - 48px));transform:translateY(-50%);overflow-y:auto;scrollbar-width:none}.turn-rail::-webkit-scrollbar{display:none}.turn-rail.fade-top{-webkit-mask-image:linear-gradient(transparent 0,#000 24px 100%);mask-image:linear-gradient(transparent 0,#000 24px 100%)}.turn-rail.fade-bottom{-webkit-mask-image:linear-gradient(#000 0 calc(100% - 24px),transparent 100%);mask-image:linear-gradient(#000 0 calc(100% - 24px),transparent 100%)}.turn-rail.fade-top.fade-bottom{-webkit-mask-image:linear-gradient(transparent 0,#000 24px calc(100% - 24px),transparent 100%);mask-image:linear-gradient(transparent 0,#000 24px calc(100% - 24px),transparent 100%)}.turn-mark{display:block;width:28px;height:10px;padding:0;border:0;border-radius:8px;background:transparent;position:relative}.turn-mark:before{content:"";position:absolute;top:50%;right:0;width:20px;height:2px;border-radius:2px;background:#00000029;transform-origin:100% 50%;transform:translateY(-50%) scaleX(.6);transition:transform .14s,background-color .14s}.turn-mark.preview:before{background:var(--tertiary);transform:translateY(-50%) scaleX(.9)}.turn-mark.active:before{background:var(--ink);transform:translateY(-50%) scaleX(1)}.turn-mark.busy:before{animation:turn-mark-busy 1s ease-in-out infinite}.turn-mark:focus-visible{outline:none}.turn-mark:focus-visible:before{background:var(--send);transform:translateY(-50%) scaleX(1)}@keyframes turn-mark-busy{50%{opacity:.35}}@container (max-width: 800px){.turn-rail{display:none}}@media(prefers-reduced-motion:reduce){.turn-mark:before,.turn-mark.busy:before,.chunk-loading,.chunk-progress-fill,.chunk-progress-fill.indeterminate{transition:none;animation:none}}.column{width:min(748px,100%);max-width:100%;min-width:0;margin:0 auto}.empty-thread{text-align:center;color:var(--tertiary);margin:48px 0}.chunk-loading{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transform:translateY(8px);background:#ffffff8c;transition:opacity .28s ease,transform .28s ease}.chunk-loading.visible{opacity:1;transform:none}.chunk-loading-card{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(240px,72%);padding:16px 20px 14px;border-radius:16px;background:#ffffffe0;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:var(--shadow)}.chunk-loading p{margin:0;text-align:center}.chunk-progress-track{position:relative;width:100%;height:3px;border-radius:999px;background:var(--selected);overflow:hidden}.chunk-progress-fill{height:100%;border-radius:inherit;background:var(--send);transition:width .18s ease}.chunk-progress-fill.indeterminate{position:absolute;left:0;top:0;width:40%;animation:chunk-indeterminate 1.1s ease-in-out infinite}@keyframes chunk-indeterminate{0%{transform:translate(-120%)}to{transform:translate(280%)}}.user-row{display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:min(525px,82%);min-width:0;margin:18px 0 18px auto}.user-bubble{max-width:100%;background:var(--bubble);border-radius:var(--dsw-radius-xl);padding:10px 16px;font-size:14px;line-height:22px;white-space:pre-wrap;word-break:break-word}.user-row time{color:var(--caption);font-size:12px;line-height:18px}.mail-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(640px,100%);margin:18px 0}.mail-row time{color:var(--caption);font-size:12px;line-height:18px}.mail-card{width:100%;background:#fff;border-radius:18px;box-shadow:var(--shadow);overflow:hidden}.mail-head{display:flex;align-items:center;gap:10px;padding:14px 16px 0}.mail-who{min-width:0;display:flex;flex-direction:column}.mail-who strong{font-size:14px;line-height:20px;font-weight:600}.mail-who span{color:var(--tertiary);font-size:12px;line-height:18px}.mail-hop{margin-left:auto;flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:var(--selector);border-radius:999px;padding:2px 8px}.mail-body{padding:10px 16px 0}.mail-body .markdown p{margin:10px 0}.mail-note{margin:8px 0 0;padding:0 16px;color:var(--tertiary);font-size:12px;line-height:18px}.mail-details{padding:6px 16px 14px}.mail-details summary{color:var(--tertiary);font-size:12px;line-height:18px;cursor:pointer}.mail-details pre{margin:8px 0 0;color:var(--secondary);white-space:pre-wrap;word-break:break-all;font:11px / 18px var(--ds-font-family-code)}.assistant{margin:8px 0 20px;min-width:0}.live-status{margin:8px 0 16px;font-size:13px;line-height:20px}.shimmer{background-image:linear-gradient(90deg,var(--secondary) 0%,var(--ink) 42%,var(--secondary) 84%);background-size:220% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:sheen 1.3s linear infinite}@keyframes sheen{0%{background-position:100% 0}to{background-position:-100% 0}}.markdown.streaming>:last-child:after,.assistant.streaming .markdown>:last-child:after{content:"";display:inline-block;width:7px;height:14px;margin-left:3px;vertical-align:text-bottom;border-radius:1px;background:var(--send);animation:caret 1s steps(1) infinite}@keyframes caret{50%{opacity:0}}.duration{font-family:var(--ds-font-family-code);font-variant-numeric:tabular-nums}.coll-container{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease}.coll-container>div{overflow:hidden}.coll-container.expand{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){.coll-container{transition:none}}.turn-failure{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:4px 0 16px}.turn-failed-label{margin:0;color:#d1242f;font-size:14px;line-height:24px}.retry-row{color:var(--tertiary);font-size:13px;line-height:20px}.retry-row summary{cursor:pointer}.retry-row p{margin:2px 0 2px 16px}.turn-error{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;margin:0;color:#d1242f;font-size:14px;line-height:22px}.turn-error-title{font-weight:600}.turn-error code{color:var(--tertiary);font-size:12px}.retry-turn{height:28px;padding:0 12px;border:.5px solid rgba(0,0,0,.16);border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:13px;cursor:pointer}.retry-turn:disabled{color:var(--tertiary);cursor:default}.activity-group{margin:2px 0 8px}.activity-group .official-leading svg:not(.chevron){color:#22c55e}.activity-group[data-state=running] .official-leading svg:not(.chevron){color:var(--tertiary)}.activity-body{margin-left:16px}.official-row{min-width:0}.official-title{display:flex;align-items:center;gap:6px;width:100%;min-width:0;min-height:24px;padding:0;border:0;background:none;color:var(--tertiary);font:inherit;font-size:14px;line-height:24px;text-align:left;cursor:pointer}.official-title:disabled{cursor:default}.official-title:hover{color:var(--secondary)}.official-leading{display:grid;place-items:center;width:16px;height:24px;flex:none}.official-leading svg{grid-area:1 / 1;width:14px;height:14px;transform-origin:center}.official-leading .chevron{opacity:0}.official-title:hover .chevron,.official-row.open>.official-title .chevron{opacity:1}.official-title:hover .official-leading svg:not(.chevron),.official-row.open>.official-title .official-leading svg:not(.chevron){opacity:0}.official-label{flex:none;min-width:0;line-height:inherit}.official-dot{width:2px;height:2px;border-radius:1px;background:var(--caption);flex:none}.official-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px}.official-summary.streaming{-webkit-mask-image:linear-gradient(to right,black calc(100% - 48px),transparent);mask-image:linear-gradient(to right,black calc(100% - 48px),transparent)}.official-size{flex:none;color:var(--caption);font-size:12px}.diff-counts{display:inline-flex;gap:6px;flex:none;font-family:var(--ds-font-family-code);font-size:12px}.diff-plus{color:#22c55e}.diff-minus{color:#ec1313}.think-body{margin:4px 0 8px 22px;color:var(--secondary);font-size:13px;line-height:20px;white-space:pre-wrap;word-break:break-word}.diff-card{margin:8px 0 8px 22px;max-width:100%;min-width:0;background:#f9fafb;border-radius:16px;overflow:hidden;color:var(--ink)}.diff-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px 8px 22px;color:var(--tertiary);font:11px / 18px var(--dsw-font-family)}.diff-heading{display:flex;align-items:baseline;gap:12px;min-width:0}.diff-lang{font-family:var(--ds-font-family-code);flex:none}.diff-file{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.diff-copy{width:24px;height:24px;border:0;border-radius:8px;background:transparent;color:var(--secondary);display:grid;place-items:center;padding:0}.diff-copy svg{width:14px;height:14px}.diff-copy:hover{background:#2631480f}.diff-body{display:grid;grid-template-columns:minmax(0,1fr);max-width:100%;min-width:0;padding:6px 0 16px;font:11px / 19px var(--ds-font-family-code);overflow-x:auto}.diff-line{display:block;width:auto;height:auto;min-height:1lh;padding:0 22px;border:0;border-radius:0;background:transparent;white-space:pre}.diff-line:before{display:inline}.diff-line.added{color:#22c55e;background:#22c55e14;box-shadow:inset 3px 0 #22c55e}.diff-line.added:before{content:"+ "}.diff-line.removed{color:#ec1313;background:#ec131314;box-shadow:inset 3px 0 #ec1313}.diff-line.removed:before{content:"- "}.diff-line.same{color:var(--secondary)}.diff-line.same:before{content:" "}.diff-output{margin:0;padding:6px 22px 16px;white-space:pre-wrap;overflow-wrap:anywhere;font:11px / 19px var(--ds-font-family-code)}.markdown{min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:24px;color:var(--ink)}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown strong{font-weight:600}.markdown h1{font-size:21px;line-height:30px;font-weight:700;margin:32px 0 16px}.markdown h2{font-size:19px;line-height:28px;font-weight:700;margin:32px 0 16px}.markdown h3{font-size:18px;line-height:26px;font-weight:700;margin:32px 0 16px}.markdown h4{font-size:14px;line-height:24px;font-weight:600;margin:16px 0}.markdown p{margin:16px 0}.markdown a,.file-mention{color:var(--link);font-weight:500}.markdown a:hover,.file-mention:hover,.file-mention:focus-visible{text-decoration:underline dotted var(--link);text-underline-offset:3px}.file-mention{margin:0;padding:0;border:0;background:none;font:inherit;font-weight:500;color:var(--link);cursor:pointer;text-align:inherit}.file-mention:focus{outline:none}.markdown ul,.markdown ol{margin:16px 0;padding-left:18px}.markdown li:not(:first-child){margin-top:6px}.markdown li::marker{color:var(--secondary)}.markdown li>p{margin:8px 0}.markdown hr{border:0;height:.5px;margin:32px 0;background:var(--line)}.markdown blockquote{border-left:2px solid var(--caption);margin:16px 0 0;padding-left:14px}.markdown :not(pre)>code{font-family:var(--ds-font-family-code);font-size:.875em;background:var(--inline-code);border:.5px solid rgba(0,0,0,.04);border-radius:var(--dsw-radius-sm);padding:0 5px;overflow-wrap:anywhere;word-break:break-word}.markdown img{max-width:100%;height:auto}.table-scroll{max-width:100%;min-width:0;overflow-x:auto;margin:16px 0}.table-scroll table{border-collapse:collapse;width:100%}.table-scroll th,.table-scroll td{text-align:start;padding:10px 16px;vertical-align:top;font-size:13px;line-height:22px;max-width:min(30vw,320px);min-width:88px}.table-scroll th{font-weight:500;border-bottom:.5px solid var(--line-strong)}.table-scroll td{border-bottom:.5px solid var(--line)}.table-scroll th:first-child,.table-scroll td:first-child{padding-left:0}.table-scroll td:last-child,.table-scroll th:last-child{padding-right:0}.code-block{margin:16px 0;max-width:100%;min-width:0;background:var(--code-bg);border-radius:var(--dsw-radius-lg);color:var(--ink)}.code-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 18px 8px 22px;font-size:11px;line-height:18px;color:var(--tertiary);border-top-left-radius:inherit;border-top-right-radius:inherit}.code-lang{font-family:var(--ds-font-family-code)}.code-copy{border:0;background:transparent;padding:0;color:var(--secondary);font-size:11px}.code-block pre{margin:0;padding:6px 22px 20px;overflow-x:auto;font:11px / 19px var(--ds-font-family-code);white-space:pre-wrap;overflow-wrap:anywhere;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.code-block code{font:inherit;background:none;padding:0;border:0}.composer-wrap{min-width:0;padding:0 28px 10px}.card{position:relative;display:flex;flex-direction:column;gap:12px;padding-top:8px;border-radius:var(--dsw-radius-panel);background:#fff;box-shadow:var(--shadow)}.mention-menu{position:absolute;left:8px;right:8px;bottom:calc(100% + 8px);z-index:5;padding:6px;border-radius:12px;background:#fff;box-shadow:var(--shadow)}.mention-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:8px 10px;font-size:13px;line-height:20px}.mention-menu button.active,.mention-menu button:hover{background:var(--hover)}.mention-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mention-empty{margin:2px 10px 6px;color:var(--tertiary);font-size:12px;line-height:18px}.card textarea{width:100%;border:0;resize:none;outline:none;background:transparent;min-height:36px;max-height:160px;padding:4px 14px 0;line-height:24px;font-size:14px}.card-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 8px 8px}.tools,.trailing{display:flex;align-items:center;gap:12px;min-width:0}.tools{position:relative}.plus-menu{position:absolute;left:0;bottom:calc(100% + 10px);z-index:4;width:240px;padding:6px;border-radius:12px;background:#fff;box-shadow:var(--shadow)}.plus-menu button{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:8px 10px;font-size:13px;line-height:20px}.plus-menu button:hover{background:var(--hover)}.plus-note{margin:2px 10px 6px;color:var(--tertiary);font-size:12px;line-height:18px}.trailing{margin-left:auto}.chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 4px;color:var(--secondary);font-size:13px;font-weight:500;white-space:nowrap}.chip svg{width:16px;height:16px;flex:none}.model{color:var(--secondary);font-size:13px;font-weight:500;white-space:nowrap}.add{background:var(--selector)}.add:disabled{opacity:.5}.send,.stop{width:34px;height:34px;border:0;border-radius:999px;display:grid;place-items:center;color:#fff}.send{background:var(--send)}.send:hover:not(:disabled){background:var(--send-hover)}.send:disabled{opacity:.4}.stop{background:var(--ink)}.stop-icon{width:10px;height:10px;border-radius:2px;background:#fff}.stats{min-height:20px;margin:6px 8px 0;color:var(--caption);font-size:12px;line-height:20px;text-align:center}.file-modal{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px}.file-modal-mask{position:absolute;inset:0;background:#0f111547;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.file-modal-card{position:relative;z-index:1;display:flex;flex-direction:column;width:min(760px,100%);height:min(640px,calc(100vh - 48px));border-radius:var(--dsw-radius-panel);background:#fff;overflow:hidden;box-shadow:0 0 0 .5px #0000001a,0 16px 48px #0000001f}.file-modal-card:focus{outline:none}.file-modal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:22px 14px 12px 24px;flex:none}.file-modal-title{min-width:0;display:flex;flex-direction:column}.file-modal-title strong{font-size:16px;line-height:24px;font-weight:500}.file-modal-title span{color:var(--tertiary);font-size:12px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-modal-close{width:28px;height:28px;border:0;border-radius:var(--dsw-radius-sm);background:transparent;color:var(--secondary);display:grid;place-items:center;padding:0;flex:none}.file-modal-close svg{width:14px;height:14px}.file-modal-close:hover{background:var(--hover)}.file-modal-status,.file-modal-note{margin:0;padding:8px 24px 24px;color:var(--secondary);font-size:14px}.file-preview{display:flex;flex-direction:column;min-height:0;flex:auto}.file-preview-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px 8px 24px;color:var(--tertiary);font:11px / 18px var(--ds-font-family-code)}.file-preview-scroll{flex:auto;min-height:0;overflow:auto}.file-preview pre{margin:0;padding:8px 24px 24px}.file-preview code{display:block;counter-reset:source-line;font:12px / 20px var(--ds-font-family-code);color:var(--ink)}.source-line{display:block;min-height:1lh;position:relative;white-space:pre;padding-left:calc(var(--line-width, 2ch) + 16px)}.source-line:before{counter-increment:source-line;content:counter(source-line);position:absolute;left:0;width:var(--line-width, 2ch);text-align:end;color:var(--tertiary);-webkit-user-select:none;user-select:none}.source-line.current{background:#4176e61a}@media(max-width:800px){.shell{grid-template-columns:1fr}.shell.in-chat .side{display:none}.shell:not(.in-chat) .chat{display:none}.back{display:inline}.scroll,.composer-wrap{padding-left:16px;padding-right:16px}}.activity-status{font-size:11px;line-height:24px;opacity:.75;flex-shrink:0;white-space:normal}.tool-activity .official-title{flex-wrap:wrap;align-items:flex-start}.tool-activity .official-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.tool-activity.open>.official-title .chevron,.activity-arguments.open>.official-title .chevron{transform:rotate(180deg)}.activity-arguments{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:4px}.activity-arguments>.official-title{grid-column:1;grid-row:1;min-width:0;min-height:24px;font-size:12px;line-height:24px;align-items:flex-start}.activity-arguments>.diff-copy{grid-column:2;grid-row:1}.activity-arguments>.activity-panel{grid-column:1 / -1;min-width:0}.activity-block-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;color:var(--tertiary);font-size:12px;line-height:24px;font-weight:500}.activity-detail{margin:6px 0 12px 28px;min-width:0}.activity-detail pre{overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0;max-width:100%;max-height:none;font-size:12px;padding:8px;background:var(--bg-secondary, #8881);border-radius:6px}.activity-command,.activity-output,.activity-arguments{position:relative;min-width:0}.activity-command .diff-copy{float:right;position:relative}.activity-facts,.activity-note{font-size:12px;opacity:.75;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}.activity-todos{font-size:13px;padding-left:20px;overflow-wrap:anywhere}.activity-todos span{font-size:11px;opacity:.7}.tool-activity .diff-card{overflow:visible;min-width:0}.tool-activity .diff-body{grid-template-columns:minmax(0,1fr);overflow:visible;min-width:0}.tool-activity .diff-line{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}.tool-activity[data-state=failed]>.official-title{color:var(--danger, #c33)}@media(max-width:600px){.activity-status{width:100%;padding-left:28px}.activity-detail{margin-left:12px}}.composer-activity{display:flex;align-items:center;gap:8px;min-width:0;margin:0 10px 8px;color:#8d8d93;font-size:13px}.composer-activity svg{width:14px;height:14px;flex:0 0 14px}.composer-activity-text{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@supports (background-clip: text){.composer-activity[data-moving=true] .composer-activity-text{background:linear-gradient(110deg,#8d8d93 30%,#fafafa,#8d8d93 62%);background-size:240% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:composer-sweep 2.8s ease-in-out infinite}}@keyframes composer-sweep{0%{background-position:180% 0}to{background-position:-80% 0}}@media(prefers-reduced-motion:reduce){.composer-activity[data-moving=true] .composer-activity-text{animation:none;background:none;color:#8d8d93}}.image-preview-trigger{position:relative;display:inline-flex;vertical-align:top;max-width:min(100%,32rem);padding:0;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:transparent;cursor:zoom-in}.markdown .image-preview-thumbnail{display:block;width:auto;height:auto;max-width:100%;max-height:min(20rem,40vh);object-fit:contain}.image-preview-hint{position:absolute;bottom:4px;left:4px;right:4px;padding:3px 6px;border-radius:4px;background:#000b;color:#fff;font-size:11px;line-height:1.4;text-align:center}.image-preview-linked{display:inline-flex;flex-direction:column;align-items:flex-start;max-width:100%;gap:4px}.image-lightbox{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:16px;background:#000c;overscroll-behavior:contain}.image-lightbox-dialog{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(100%,96rem);height:100%;max-height:calc(100dvh - 32px);min-width:0;min-height:0;overflow:hidden;border-radius:10px;color:#fff;background:#171717}.image-lightbox-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px}.image-lightbox-name{flex:1 1 8rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.image-lightbox-toolbar button{flex-shrink:0;border:1px solid #888;border-radius:6px;padding:7px 10px;background:#333;color:#fff;cursor:pointer}.image-lightbox-stage{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.image-lightbox-stage img{display:block;flex:0 1 auto;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}.image-lightbox-stage.original{display:block}.image-lightbox-stage.original img{max-width:none;max-height:none}.image-preview-trigger:focus-visible,.image-lightbox button:focus-visible,.image-lightbox-stage:focus-visible{outline:2px solid #66bfff;outline-offset:2px}@media(max-width:600px){.image-lightbox{padding:6px}.image-lightbox-dialog{max-height:calc(100dvh - 12px)}.markdown .image-preview-thumbnail{max-height:min(16rem,35vh)}}.image-unavailable{display:inline-flex;flex-direction:column;align-items:flex-start;gap:6px;max-width:100%;padding:12px;border:1px solid var(--line);border-radius:8px;color:var(--secondary);overflow-wrap:anywhere}.image-unavailable button{padding:5px 10px;border:1px solid var(--line-strong);border-radius:6px;background:var(--bg);color:var(--ink)}
1
+ :root{color-scheme:light;--dsw-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;--ds-font-family-code: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, Courier, "PingFang SC", "Microsoft YaHei";--dsw-radius-sm: 8px;--dsw-radius-lg: 16px;--dsw-radius-xl: 20px;--dsw-radius-panel: 28px;--bg: #fff;--sidebar: #f9fafb;--ink: rgb(15, 17, 21);--secondary: rgb(97, 102, 107);--tertiary: rgb(129, 133, 140);--caption: rgb(173, 178, 184);--hover: rgba(38, 49, 72, .06);--selected: rgb(235, 238, 242);--bubble: rgb(237, 243, 254);--line: rgba(0, 0, 0, .1);--line-strong: rgba(0, 0, 0, .12);--code-bg: #f9fafb;--inline-code: #f5f5f5;--link: rgb(65, 118, 230);--send: rgb(65, 118, 230);--send-hover: rgb(122, 170, 255);--selector: #f9fafb;--shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 4px 16px rgba(0, 0, 0, .03), 0 0 24px rgba(0, 0, 0, .03);font-family:var(--dsw-font-family);color:var(--ink);background:var(--bg)}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0}#root{display:flex;justify-content:center}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default}a{color:var(--link);text-decoration:none}.shell{width:min(1120px,100%);height:100%;display:grid;grid-template-columns:268px minmax(0,1fr);background:var(--bg)}.side,.chat{min-width:0;min-height:0}.side{display:flex;flex-direction:column;background:var(--sidebar);padding:14px 10px 10px}.side-top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 6px 12px}.brand{font-size:15px;font-weight:650}.side-actions{display:flex;gap:2px}.icon-btn,.add{width:28px;height:28px;border:0;border-radius:999px;display:grid;place-items:center;background:transparent;color:var(--ink)}.icon-btn:hover,.add:hover{background:var(--hover)}.icon-btn svg,.add svg,.send svg{width:16px;height:16px}.filter{margin:0 6px 8px;border:0;background:#fff;border-radius:8px;padding:8px 10px;outline:none}.note{color:#9a3412;font-size:12px;margin:0 8px 8px}.note.ok{color:var(--secondary)}.sessions{list-style:none;margin:0;padding:0;overflow:auto;flex:1}.sessions .empty{color:var(--tertiary);font-size:13px;padding:8px 10px}.session{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;background:transparent;border-radius:10px;padding:8px}.session:hover{background:var(--hover)}.session.selected{background:var(--selected)}.session-row{display:flex;align-items:center;border-radius:10px}.session-row .session{flex:1;min-width:0}.session-delete{flex:none;border:0;background:transparent;color:var(--tertiary);font-size:12px;padding:6px 8px;border-radius:8px}.session-delete:hover{color:#9a3412;background:var(--hover)}.session-delete.purge{color:#9a3412}.blank-head{flex-wrap:wrap}.blank-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 10px 4px;color:var(--tertiary);font-size:12px}.blank-head button{border:0;background:transparent;color:inherit;padding:0}.blank-head button:hover{color:var(--ink)}.mark{position:relative;width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:var(--selector);color:var(--secondary);font-size:13px;font-weight:650;flex:none}.bot-dot{position:absolute;right:-2px;bottom:-2px;width:8px;height:8px;border-radius:999px;background:#16a34a;box-shadow:0 0 0 2px var(--sidebar)}.bot-dot.wait{background:#2563eb}.session.selected .bot-dot{box-shadow:0 0 0 2px var(--selected)}.bot-badge .bot-dot{top:-2px;bottom:auto;box-shadow:0 0 0 2px var(--bg)}.session.selected .mark{background:#fff}.mark.bot-mark,.bot-badge{background:#111827;color:#fff;font-size:10px;font-weight:700;letter-spacing:.06em}.mark.bot-mark{width:auto;min-width:28px;padding:0 6px}.session.selected .mark.bot-mark{background:#111827;color:#fff}.bot-badge{position:relative;flex:none;border-radius:999px;padding:2px 7px;line-height:16px}.copy{min-width:0;flex:1}.name,.preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name{font-size:14px;font-weight:560}.preview{color:var(--tertiary);font-size:12px;margin-top:1px}.preview:empty:before{content:"​"}.me-row{display:flex;align-items:center;gap:4px}.me{display:flex;align-items:center;gap:8px;flex:1;min-width:0;border:0;background:transparent;border-radius:10px;padding:8px;text-align:left}.lang-switch{flex:none;border:0;background:transparent;border-radius:8px;padding:6px 8px;color:var(--tertiary);font:inherit;font-size:12px}.lang-switch:hover{background:var(--hover);color:var(--ink)}.me:hover{background:var(--hover)}.me-mark{background:var(--ink);color:#fff;font-size:12px}.status{background:#fff;border-radius:14px;padding:10px 12px;margin:8px;box-shadow:var(--shadow);font-size:13px}.status p{margin:0 0 6px}.status p:last-child{margin:0}.muted{color:var(--tertiary)}.chat{display:flex;flex-direction:column;background:var(--bg)}.inbox-line{display:flex;flex-direction:column;align-items:flex-end;gap:4px;width:min(320px,86%);margin:12px 0 12px auto}.inbox-line time{color:var(--caption);font-size:12px;line-height:18px}.inbox-entry{display:flex;align-items:center;gap:10px;width:100%;border:0;background:#fff;text-align:left;border-radius:16px;box-shadow:var(--shadow);padding:10px 12px}.inbox-entry:hover{background:var(--sidebar)}.inbox-icon{width:28px;height:28px;border-radius:8px;flex:none;display:grid;place-items:center;background:#111827;color:#fff}.inbox-icon svg{width:16px;height:16px}.inbox-copy{min-width:0;display:flex;flex-direction:column}.inbox-copy strong,.inbox-copy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-copy strong{font-size:13px;line-height:18px;font-weight:600}.inbox-copy span{color:var(--secondary);font-size:12px;line-height:18px}.bot-chat-back{display:inline;flex:none;border:0;background:transparent;padding:0;color:var(--link);font-size:13px}.bot-chat-lead{margin:8px 0 16px;color:var(--tertiary);font-size:13px;line-height:20px}.bot-out{display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:min(525px,82%);margin:18px 0 18px auto}.bot-out span,.bot-out time{color:var(--caption);font-size:12px;line-height:18px}.chat-head{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 22px}.chat-head h1{flex:1;min-width:0;margin:0;font-size:14px;font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.basis{margin:0;padding:0 22px 8px;color:var(--tertiary);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.work-crumb{display:flex;align-items:center;gap:6px;min-width:0;margin:0;padding:0 22px 8px;color:var(--tertiary);font-size:13px;line-height:20px}.work-crumb button{flex:none;max-width:46%;border:0;background:transparent;padding:0;color:var(--link);font-size:13px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.work-crumb>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}.setup-mask{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:24px;background:#0f111547}.setup-card{width:min(480px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:20px;padding:18px 18px 14px;box-shadow:0 0 0 .5px #0000001a,0 16px 48px #0000001f}.setup-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.setup-head h2{margin:0;font-size:16px;font-weight:560}.setup-close{width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:var(--secondary)}.setup-close:hover{background:var(--hover)}.setup-lead{margin:8px 0 0;color:var(--secondary);font-size:13px;line-height:1.45}.setup-card label{display:block;margin:14px 0 6px;font-size:13px}.setup-card textarea,.setup-card input,.setup-card select{width:100%;border:0;background:var(--sidebar);border-radius:10px;padding:8px 10px;outline:none}.setup-card textarea{resize:vertical}.setup-card input+input,.setup-card select+input{margin-top:8px}.setup-error{color:#9a3412;font-size:12px;margin:10px 0 0}.setup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.setup-actions button{border:0;border-radius:999px;padding:8px 14px;background:var(--hover)}.setup-actions .primary{background:var(--send);color:#fff}.setup-actions .primary:disabled{opacity:.6}.chat-head a{flex:none;font-size:13px;color:var(--secondary)}.work-chip{flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:var(--selector);border-radius:999px;padding:2px 8px}.briefing-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(640px,100%);margin:18px 0}.briefing-row time{color:var(--caption);font-size:12px;line-height:18px}.briefing-card{width:100%;background:var(--code-bg);border:.5px solid var(--line);border-radius:16px}.briefing-toggle{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;min-height:40px;padding:10px 14px 12px;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.briefing-card.open .briefing-toggle{padding-bottom:0}.briefing-title{font-size:14px;line-height:20px;font-weight:600}.briefing-rev{color:var(--secondary);font-size:12px;line-height:18px;background:#fff;border-radius:999px;padding:2px 8px}.briefing-chevron{width:14px;height:14px;margin-left:auto;flex:none;color:var(--tertiary);transition:transform .3s ease}.briefing-card.open .briefing-chevron{transform:rotate(180deg)}.briefing-preview{flex:1 0 100%;margin:0;color:var(--secondary);font-size:13px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.briefing-body{padding:4px 14px 12px}.briefing-body .markdown p{margin:8px 0}.briefing-facts,.briefing-note{margin:8px 0 0;color:var(--tertiary);font-size:12px;line-height:18px}.work-card{margin:14px 0 18px;padding:12px 14px;border:.5px solid var(--line);border-radius:16px;background:var(--code-bg)}.work-card header{display:flex;align-items:center;justify-content:space-between;gap:12px}.work-card h3{margin:0;min-width:0;font-size:14px;line-height:20px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.work-status{flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:#fff;border-radius:999px;padding:2px 8px}.work-status.live{color:var(--ink)}.work-card p{margin:6px 0 0;color:var(--secondary);font-size:13px;line-height:20px}.work-card .work-question{color:var(--ink)}.work-card .stale{text-decoration:line-through;color:var(--tertiary)}.work-quiet{color:var(--tertiary)}.work-reply{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px}.work-reply label{display:flex;flex-direction:column;gap:6px;width:100%}.work-reply span{color:var(--tertiary);font-size:12px;line-height:18px}.work-reply textarea{width:100%;resize:vertical;min-height:56px;border:.5px solid var(--line);border-radius:10px;background:#fff;padding:8px 10px;outline:none}.work-reply button{border:0;border-radius:999px;background:var(--send);color:#fff;padding:6px 12px;font-size:13px;line-height:20px}.work-reply button:disabled{opacity:.45}.work-open{margin-top:8px;border:0;background:transparent;padding:0;color:var(--link);font-size:13px;line-height:20px}.work-card .work-error{color:#9a3412}.work-refused{margin:8px 0 14px;color:#9a3412;font-size:13px;line-height:20px}.work-note{margin:4px 0 12px;color:var(--secondary);font-size:13px;line-height:20px}.user-question-card{margin:14px 0 18px;padding:14px 16px;min-width:0;border:.5px solid var(--line);border-radius:16px;background:var(--code-bg)}.user-question+.user-question{margin-top:16px;padding-top:16px;border-top:.5px solid var(--line)}.user-question-header{margin:0 0 6px;font-size:13px;line-height:20px;font-weight:600;color:var(--secondary)}.user-question-text{margin:0;font-size:15px;line-height:24px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}.user-question-hint,.user-question-status{margin:8px 0 0;font-size:13px;line-height:20px;color:var(--secondary)}.user-question-status.exception{color:#9a3412}.user-question-options{display:flex;flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none}.user-question-option{display:flex;flex-direction:column;gap:2px;width:100%;min-width:0;margin:0;padding:10px 12px;border:.5px solid var(--line);border-radius:12px;background:#fff;box-sizing:border-box;text-align:left;font:inherit;color:inherit}button.user-question-option{cursor:pointer}button.user-question-option:hover:not(:disabled),button.user-question-option:focus-visible{border-color:var(--ink)}button.user-question-option:disabled{cursor:default;opacity:.7}.user-question-option.selected{border-color:var(--ink)}.user-question-actions{display:flex;flex-direction:column;gap:8px;margin-top:10px}.user-question-custom{display:flex;flex-direction:column;gap:4px;font-size:13px;line-height:20px;color:var(--secondary)}.user-question-custom textarea{width:100%;min-width:0;box-sizing:border-box;resize:vertical;padding:8px 10px;border:.5px solid var(--line);border-radius:10px;font:inherit;color:var(--ink)}.user-question-skip,.user-question-submit{align-self:flex-start;margin-top:4px;padding:6px 12px;border:.5px solid var(--line);border-radius:10px;background:#fff;font:inherit;font-size:13px;line-height:20px;color:var(--ink);cursor:pointer}.user-question-submit{margin-top:12px}.user-question-option-label{font-size:14px;line-height:22px;color:var(--ink);overflow-wrap:anywhere}.user-question-option-desc{font-size:13px;line-height:20px;color:var(--secondary);overflow-wrap:anywhere}.user-question-badge{display:inline-block;margin-left:6px;padding:0 6px;border-radius:999px;background:var(--line);font-size:11px;line-height:18px;font-weight:600;color:var(--secondary);vertical-align:middle}.user-question-wait,.user-question-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}.user-question-plan{margin-top:10px;min-width:0;overflow:auto}.user-question-secret{margin:8px 0 0;letter-spacing:.2em;color:var(--secondary)}.user-question-secret-input{width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;border:.5px solid var(--line);border-radius:10px;font:inherit;color:transparent;text-shadow:0 0 0 var(--ink);-webkit-text-security:disc}.settings-drawer{position:fixed;inset:0;z-index:30;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}.settings-drawer-mask{position:absolute;inset:0;pointer-events:auto;background:#0f111547;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.settings-drawer-sheet{position:relative;z-index:1;pointer-events:auto;display:flex;flex-direction:column;width:min(748px,100%);max-width:100%;max-height:min(90vh,100dvh);padding-bottom:env(safe-area-inset-bottom,0px);border-radius:20px 20px 0 0;background:#fff;box-shadow:var(--shadow);overflow:hidden;animation:settings-drawer-up .22s ease-out}.settings-drawer-handle{width:36px;height:4px;margin:8px auto 0;border-radius:999px;background:var(--line);flex:none}.settings-drawer-body{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 16px 16px}@keyframes settings-drawer-up{0%{transform:translateY(16px);opacity:.64}to{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.settings-drawer-sheet{animation:none}}@media(max-width:800px){.settings-drawer-sheet{width:100%;border-radius:16px 16px 0 0}}.settings-head,.settings-confirm{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.settings-head{flex:none;padding:8px 16px}.settings-head h3{margin:0;font-size:15px;line-height:24px}button.chip{cursor:pointer;font:inherit}.back{display:none;border:0;background:transparent;padding:0;color:var(--link)}.scroll{flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px 28px 12px;scrollbar-width:thin;scrollbar-color:#e5e5e5 transparent}.scroll::-webkit-scrollbar{width:5px;height:5px}.scroll::-webkit-scrollbar-track{margin-block:2px;background:transparent}.scroll::-webkit-scrollbar-thumb{background:#e5e5e5;background-clip:content-box;border-radius:999px}.scroll::-webkit-scrollbar-thumb:hover{background:#d4d4d4}.scroll::-webkit-scrollbar-corner{background:transparent}.chat-body{position:relative;flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;container-type:inline-size}.turn-rail{position:absolute;z-index:4;top:50%;right:14px;width:28px;max-height:min(420px,calc(100% - 48px));transform:translateY(-50%);overflow-y:auto;scrollbar-width:none}.turn-rail::-webkit-scrollbar{display:none}.turn-rail.fade-top{-webkit-mask-image:linear-gradient(transparent 0,#000 24px 100%);mask-image:linear-gradient(transparent 0,#000 24px 100%)}.turn-rail.fade-bottom{-webkit-mask-image:linear-gradient(#000 0 calc(100% - 24px),transparent 100%);mask-image:linear-gradient(#000 0 calc(100% - 24px),transparent 100%)}.turn-rail.fade-top.fade-bottom{-webkit-mask-image:linear-gradient(transparent 0,#000 24px calc(100% - 24px),transparent 100%);mask-image:linear-gradient(transparent 0,#000 24px calc(100% - 24px),transparent 100%)}.turn-mark{display:block;width:28px;height:10px;padding:0;border:0;border-radius:8px;background:transparent;position:relative}.turn-mark:before{content:"";position:absolute;top:50%;right:0;width:20px;height:2px;border-radius:2px;background:#00000029;transform-origin:100% 50%;transform:translateY(-50%) scaleX(.6);transition:transform .14s,background-color .14s}.turn-mark.preview:before{background:var(--tertiary);transform:translateY(-50%) scaleX(.9)}.turn-mark.active:before{background:var(--ink);transform:translateY(-50%) scaleX(1)}.turn-mark.busy:before{animation:turn-mark-busy 1s ease-in-out infinite}.turn-mark:focus-visible{outline:none}.turn-mark:focus-visible:before{background:var(--send);transform:translateY(-50%) scaleX(1)}@keyframes turn-mark-busy{50%{opacity:.35}}@container (max-width: 800px){.turn-rail{display:none}}@media(prefers-reduced-motion:reduce){.turn-mark:before,.turn-mark.busy:before,.chunk-loading,.chunk-progress-fill,.chunk-progress-fill.indeterminate{transition:none;animation:none}}.column{width:min(748px,100%);max-width:100%;min-width:0;margin:0 auto}.empty-thread{text-align:center;color:var(--tertiary);margin:48px 0}.chunk-loading{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transform:translateY(8px);background:#ffffff8c;transition:opacity .28s ease,transform .28s ease}.chunk-loading.visible{opacity:1;transform:none}.chunk-loading-card{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(240px,72%);padding:16px 20px 14px;border-radius:16px;background:#ffffffe0;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:var(--shadow)}.chunk-loading p{margin:0;text-align:center}.chunk-progress-track{position:relative;width:100%;height:3px;border-radius:999px;background:var(--selected);overflow:hidden}.chunk-progress-fill{height:100%;border-radius:inherit;background:var(--send);transition:width .18s ease}.chunk-progress-fill.indeterminate{position:absolute;left:0;top:0;width:40%;animation:chunk-indeterminate 1.1s ease-in-out infinite}@keyframes chunk-indeterminate{0%{transform:translate(-120%)}to{transform:translate(280%)}}.user-row{display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:min(525px,82%);min-width:0;margin:18px 0 18px auto}.user-bubble{max-width:100%;background:var(--bubble);border-radius:var(--dsw-radius-xl);padding:10px 16px;font-size:14px;line-height:22px;white-space:pre-wrap;word-break:break-word}.user-row time{color:var(--caption);font-size:12px;line-height:18px}.mail-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(640px,100%);margin:18px 0}.mail-row time{color:var(--caption);font-size:12px;line-height:18px}.mail-card{width:100%;background:#fff;border-radius:18px;box-shadow:var(--shadow);overflow:hidden}.mail-head{display:flex;align-items:center;gap:10px;padding:14px 16px 0}.mail-who{min-width:0;display:flex;flex-direction:column}.mail-who strong{font-size:14px;line-height:20px;font-weight:600}.mail-who span{color:var(--tertiary);font-size:12px;line-height:18px}.mail-hop{margin-left:auto;flex:none;color:var(--secondary);font-size:12px;line-height:18px;background:var(--selector);border-radius:999px;padding:2px 8px}.mail-body{padding:10px 16px 0}.mail-body .markdown p{margin:10px 0}.mail-note{margin:8px 0 0;padding:0 16px;color:var(--tertiary);font-size:12px;line-height:18px}.mail-details{padding:6px 16px 14px}.mail-details summary{color:var(--tertiary);font-size:12px;line-height:18px;cursor:pointer}.mail-details pre{margin:8px 0 0;color:var(--secondary);white-space:pre-wrap;word-break:break-all;font:11px / 18px var(--ds-font-family-code)}.assistant{margin:8px 0 20px;min-width:0}.live-status{margin:8px 0 16px;font-size:13px;line-height:20px}.shimmer{background-image:linear-gradient(90deg,var(--secondary) 0%,var(--ink) 42%,var(--secondary) 84%);background-size:220% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:sheen 1.3s linear infinite}@keyframes sheen{0%{background-position:100% 0}to{background-position:-100% 0}}.markdown.streaming>:last-child:after,.assistant.streaming .markdown>:last-child:after{content:"";display:inline-block;width:7px;height:14px;margin-left:3px;vertical-align:text-bottom;border-radius:1px;background:var(--send);animation:caret 1s steps(1) infinite}@keyframes caret{50%{opacity:0}}.duration{font-family:var(--ds-font-family-code);font-variant-numeric:tabular-nums}.coll-container{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease}.coll-container>div{overflow:hidden}.coll-container.expand{grid-template-rows:1fr}@media(prefers-reduced-motion:reduce){.coll-container{transition:none}}.turn-failure{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:4px 0 16px}.turn-failed-label{margin:0;color:#d1242f;font-size:14px;line-height:24px}.retry-row{color:var(--tertiary);font-size:13px;line-height:20px}.retry-row summary{cursor:pointer}.retry-row p{margin:2px 0 2px 16px}.turn-error{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;margin:0;color:#d1242f;font-size:14px;line-height:22px}.turn-error-title{font-weight:600}.turn-error code{color:var(--tertiary);font-size:12px}.retry-turn{height:28px;padding:0 12px;border:.5px solid rgba(0,0,0,.16);border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:13px;cursor:pointer}.retry-turn:disabled{color:var(--tertiary);cursor:default}.activity-group{margin:2px 0 8px}.activity-group .official-leading svg:not(.chevron){color:var(--tertiary)}.activity-body{margin-left:16px}.official-row{min-width:0}.official-title{display:flex;align-items:center;gap:6px;width:100%;min-width:0;min-height:24px;padding:0;border:0;background:none;color:var(--tertiary);font:inherit;font-size:14px;line-height:24px;text-align:left;cursor:pointer}.official-title:disabled{cursor:default}.official-title:hover{color:var(--secondary)}.official-leading{display:grid;place-items:center;width:16px;height:24px;flex:none}.official-leading svg{grid-area:1 / 1;width:14px;height:14px;transform-origin:center}.official-leading .chevron{opacity:0}.official-title:hover .chevron,.official-row.open>.official-title .chevron{opacity:1}.official-title:hover .official-leading svg:not(.chevron),.official-row.open>.official-title .official-leading svg:not(.chevron){opacity:0}.official-label{flex:none;min-width:0;line-height:inherit}.official-dot{width:2px;height:2px;border-radius:1px;background:var(--caption);flex:none}.official-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px}.official-summary.streaming{-webkit-mask-image:linear-gradient(to right,black calc(100% - 48px),transparent);mask-image:linear-gradient(to right,black calc(100% - 48px),transparent)}.official-size{flex:none;color:var(--caption);font-size:12px}.diff-counts{display:inline-flex;gap:6px;flex:none;font-family:var(--ds-font-family-code);font-size:12px}.diff-plus{color:#22c55e}.diff-minus{color:#ec1313}.think-body{margin:4px 0 8px 22px;color:var(--secondary);font-size:13px;line-height:20px;white-space:pre-wrap;word-break:break-word}.diff-card{margin:8px 0 8px 22px;max-width:100%;min-width:0;background:#f9fafb;border-radius:16px;overflow:hidden;color:var(--ink)}.diff-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px 8px 22px;color:var(--tertiary);font:11px / 18px var(--dsw-font-family)}.diff-heading{display:flex;align-items:baseline;gap:12px;min-width:0}.diff-lang{font-family:var(--ds-font-family-code);flex:none}.diff-file{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.diff-copy{width:24px;height:24px;border:0;border-radius:8px;background:transparent;color:var(--secondary);display:grid;place-items:center;padding:0}.diff-copy svg{width:14px;height:14px}.diff-copy:hover{background:#2631480f}.diff-body{display:grid;grid-template-columns:minmax(0,1fr);max-width:100%;min-width:0;padding:6px 0 16px;font:11px / 19px var(--ds-font-family-code);overflow-x:auto}.diff-line{display:block;width:auto;height:auto;min-height:1lh;padding:0 22px;border:0;border-radius:0;background:transparent;white-space:pre}.diff-line:before{display:inline}.diff-line.added{color:#22c55e;background:#22c55e14;box-shadow:inset 3px 0 #22c55e}.diff-line.added:before{content:"+ "}.diff-line.removed{color:#ec1313;background:#ec131314;box-shadow:inset 3px 0 #ec1313}.diff-line.removed:before{content:"- "}.diff-line.same{color:var(--secondary)}.diff-line.same:before{content:" "}.diff-output{margin:0;padding:6px 22px 16px;white-space:pre-wrap;overflow-wrap:anywhere;font:11px / 19px var(--ds-font-family-code)}.markdown{min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:24px;color:var(--ink)}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown strong{font-weight:600}.markdown h1{font-size:21px;line-height:30px;font-weight:700;margin:32px 0 16px}.markdown h2{font-size:19px;line-height:28px;font-weight:700;margin:32px 0 16px}.markdown h3{font-size:18px;line-height:26px;font-weight:700;margin:32px 0 16px}.markdown h4{font-size:14px;line-height:24px;font-weight:600;margin:16px 0}.markdown p{margin:16px 0}.markdown a,.file-mention{color:var(--link);font-weight:500}.markdown a:hover,.file-mention:hover,.file-mention:focus-visible{text-decoration:underline dotted var(--link);text-underline-offset:3px}.file-mention{margin:0;padding:0;border:0;background:none;font:inherit;font-weight:500;color:var(--link);cursor:pointer;text-align:inherit}.file-mention:focus{outline:none}.markdown ul,.markdown ol{margin:16px 0;padding-left:18px}.markdown li:not(:first-child){margin-top:6px}.markdown li::marker{color:var(--secondary)}.markdown li>p{margin:8px 0}.markdown hr{border:0;height:.5px;margin:32px 0;background:var(--line)}.markdown blockquote{border-left:2px solid var(--caption);margin:16px 0 0;padding-left:14px}.markdown :not(pre)>code{font-family:var(--ds-font-family-code);font-size:.875em;background:var(--inline-code);border:.5px solid rgba(0,0,0,.04);border-radius:var(--dsw-radius-sm);padding:0 5px;overflow-wrap:anywhere;word-break:break-word}.markdown img{max-width:100%;height:auto}.table-scroll{max-width:100%;min-width:0;overflow-x:auto;margin:16px 0}.table-scroll table{border-collapse:collapse;width:100%}.table-scroll th,.table-scroll td{text-align:start;padding:10px 16px;vertical-align:top;font-size:13px;line-height:22px;max-width:min(30vw,320px);min-width:88px}.table-scroll th{font-weight:500;border-bottom:.5px solid var(--line-strong)}.table-scroll td{border-bottom:.5px solid var(--line)}.table-scroll th:first-child,.table-scroll td:first-child{padding-left:0}.table-scroll td:last-child,.table-scroll th:last-child{padding-right:0}.code-block{margin:16px 0;max-width:100%;min-width:0;background:var(--code-bg);border-radius:var(--dsw-radius-lg);color:var(--ink)}.code-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 18px 8px 22px;font-size:11px;line-height:18px;color:var(--tertiary);border-top-left-radius:inherit;border-top-right-radius:inherit}.code-lang{font-family:var(--ds-font-family-code)}.code-copy{border:0;background:transparent;padding:0;color:var(--secondary);font-size:11px}.code-block pre{margin:0;padding:6px 22px 20px;overflow-x:auto;font:11px / 19px var(--ds-font-family-code);white-space:pre-wrap;overflow-wrap:anywhere;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.code-block code{font:inherit;background:none;padding:0;border:0}.composer-wrap{min-width:0;padding:0 28px 10px}.card{position:relative;display:flex;flex-direction:column;gap:12px;padding-top:8px;border-radius:var(--dsw-radius-panel);background:#fff;box-shadow:var(--shadow)}.mention-menu{position:absolute;left:8px;right:8px;bottom:calc(100% + 8px);z-index:5;padding:6px;border-radius:12px;background:#fff;box-shadow:var(--shadow)}.mention-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:8px 10px;font-size:13px;line-height:20px}.mention-menu button.active,.mention-menu button:hover{background:var(--hover)}.mention-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mention-empty{margin:2px 10px 6px;color:var(--tertiary);font-size:12px;line-height:18px}.card textarea{width:100%;border:0;resize:none;outline:none;background:transparent;min-height:36px;max-height:160px;padding:4px 14px 0;line-height:24px;font-size:14px}.card-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 8px 8px}.tools,.trailing{display:flex;align-items:center;gap:12px;min-width:0}.tools{position:relative}.plus-menu{position:absolute;left:0;bottom:calc(100% + 10px);z-index:4;width:240px;padding:6px;border-radius:12px;background:#fff;box-shadow:var(--shadow)}.plus-menu button{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:8px 10px;font-size:13px;line-height:20px}.plus-menu button:hover{background:var(--hover)}.plus-note{margin:2px 10px 6px;color:var(--tertiary);font-size:12px;line-height:18px}.trailing{margin-left:auto}.chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 4px;color:var(--secondary);font-size:13px;font-weight:500;white-space:nowrap}.chip svg{width:16px;height:16px;flex:none}.model{color:var(--secondary);font-size:13px;font-weight:500;white-space:nowrap}.add{background:var(--selector)}.add:disabled{opacity:.5}.send,.stop{width:34px;height:34px;border:0;border-radius:999px;display:grid;place-items:center;color:#fff}.send{background:var(--send)}.send:hover:not(:disabled){background:var(--send-hover)}.send:disabled{opacity:.4}.stop{background:var(--ink)}.stop-icon{width:10px;height:10px;border-radius:2px;background:#fff}.stats{min-height:20px;margin:6px 8px 0;color:var(--caption);font-size:12px;line-height:20px;text-align:center}.file-modal{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px}.file-modal-mask{position:absolute;inset:0;background:#0f111547;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.file-modal-card{position:relative;z-index:1;display:flex;flex-direction:column;width:min(760px,100%);height:min(640px,calc(100vh - 48px));border-radius:var(--dsw-radius-panel);background:#fff;overflow:hidden;box-shadow:0 0 0 .5px #0000001a,0 16px 48px #0000001f}.file-modal-card:focus{outline:none}.file-modal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:22px 14px 12px 24px;flex:none}.file-modal-title{min-width:0;display:flex;flex-direction:column}.file-modal-title strong{font-size:16px;line-height:24px;font-weight:500}.file-modal-title span{color:var(--tertiary);font-size:12px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-modal-close{width:28px;height:28px;border:0;border-radius:var(--dsw-radius-sm);background:transparent;color:var(--secondary);display:grid;place-items:center;padding:0;flex:none}.file-modal-close svg{width:14px;height:14px}.file-modal-close:hover{background:var(--hover)}.file-modal-status,.file-modal-note{margin:0;padding:8px 24px 24px;color:var(--secondary);font-size:14px}.file-preview{display:flex;flex-direction:column;min-height:0;flex:auto}.file-preview-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px 8px 24px;color:var(--tertiary);font:11px / 18px var(--ds-font-family-code)}.file-preview-scroll{flex:auto;min-height:0;overflow:auto}.file-preview pre{margin:0;padding:8px 24px 24px}.file-preview code{display:block;counter-reset:source-line;font:12px / 20px var(--ds-font-family-code);color:var(--ink)}.source-line{display:block;min-height:1lh;position:relative;white-space:pre;padding-left:calc(var(--line-width, 2ch) + 16px)}.source-line:before{counter-increment:source-line;content:counter(source-line);position:absolute;left:0;width:var(--line-width, 2ch);text-align:end;color:var(--tertiary);-webkit-user-select:none;user-select:none}.source-line.current{background:#4176e61a}@media(max-width:800px){.shell{grid-template-columns:1fr}.shell.in-chat .side{display:none}.shell:not(.in-chat) .chat{display:none}.back{display:inline}.scroll,.composer-wrap{padding-left:16px;padding-right:16px}}.activity-status{font-size:11px;line-height:24px;opacity:.75;flex-shrink:0;white-space:normal}.tool-activity .official-title{flex-wrap:wrap;align-items:flex-start}.tool-activity .official-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.tool-activity.open>.official-title .chevron,.activity-arguments.open>.official-title .chevron{transform:rotate(180deg)}.activity-arguments{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:4px}.activity-arguments>.official-title{grid-column:1;grid-row:1;min-width:0;min-height:24px;font-size:12px;line-height:24px;align-items:flex-start}.activity-arguments>.diff-copy{grid-column:2;grid-row:1}.activity-arguments>.activity-panel{grid-column:1 / -1;min-width:0}.activity-block-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;color:var(--tertiary);font-size:12px;line-height:24px;font-weight:500}.activity-detail{margin:6px 0 12px 28px;min-width:0}.activity-detail pre{overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0;max-width:100%;max-height:none;font-size:12px;padding:8px;background:var(--bg-secondary, #8881);border-radius:6px}.activity-command,.activity-output,.activity-arguments{position:relative;min-width:0}.activity-command .diff-copy{float:right;position:relative}.activity-facts,.activity-note{font-size:12px;opacity:.75;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}.activity-todos{font-size:13px;padding-left:20px;overflow-wrap:anywhere}.activity-todos span{font-size:11px;opacity:.7}.tool-activity .diff-card{overflow:visible;min-width:0}.tool-activity .diff-body{grid-template-columns:minmax(0,1fr);overflow:visible;min-width:0}.tool-activity .diff-line{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:0}.tool-activity[data-state=failed]>.official-title{color:var(--danger, #c33)}@media(max-width:600px){.activity-status{width:100%;padding-left:28px}.activity-detail{margin-left:12px}}.composer-activity{display:flex;align-items:center;gap:8px;min-width:0;margin:0 10px 8px;color:#8d8d93;font-size:13px}.composer-activity svg{width:14px;height:14px;flex:0 0 14px}.composer-activity-text{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@supports (background-clip: text){.composer-activity[data-moving=true] .composer-activity-text{background:linear-gradient(110deg,#8d8d93 30%,#fafafa,#8d8d93 62%);background-size:240% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:composer-sweep 2.8s ease-in-out infinite}}@keyframes composer-sweep{0%{background-position:180% 0}to{background-position:-80% 0}}@media(prefers-reduced-motion:reduce){.composer-activity[data-moving=true] .composer-activity-text{animation:none;background:none;color:#8d8d93}}.image-preview-trigger{position:relative;display:inline-flex;vertical-align:top;max-width:min(100%,32rem);padding:0;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:transparent;cursor:zoom-in}.markdown .image-preview-thumbnail{display:block;width:auto;height:auto;max-width:100%;max-height:min(20rem,40vh);object-fit:contain}.image-preview-hint{position:absolute;bottom:4px;left:4px;right:4px;padding:3px 6px;border-radius:4px;background:#000b;color:#fff;font-size:11px;line-height:1.4;text-align:center}.image-preview-linked{display:inline-flex;flex-direction:column;align-items:flex-start;max-width:100%;gap:4px}.image-lightbox{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:16px;background:#000c;overscroll-behavior:contain}.image-lightbox-dialog{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(100%,96rem);height:100%;max-height:calc(100dvh - 32px);min-width:0;min-height:0;overflow:hidden;border-radius:10px;color:#fff;background:#171717}.image-lightbox-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px}.image-lightbox-name{flex:1 1 8rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.image-lightbox-toolbar button{flex-shrink:0;border:1px solid #888;border-radius:6px;padding:7px 10px;background:#333;color:#fff;cursor:pointer}.image-lightbox-stage{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.image-lightbox-stage img{display:block;flex:0 1 auto;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}.image-lightbox-stage.original{display:block}.image-lightbox-stage.original img{max-width:none;max-height:none}.image-preview-trigger:focus-visible,.image-lightbox button:focus-visible,.image-lightbox-stage:focus-visible{outline:2px solid #66bfff;outline-offset:2px}@media(max-width:600px){.image-lightbox{padding:6px}.image-lightbox-dialog{max-height:calc(100dvh - 12px)}.markdown .image-preview-thumbnail{max-height:min(16rem,35vh)}}.image-unavailable{display:inline-flex;flex-direction:column;align-items:flex-start;gap:6px;max-width:100%;padding:12px;border:1px solid var(--line);border-radius:8px;color:var(--secondary);overflow-wrap:anywhere}.image-unavailable button{padding:5px 10px;border:1px solid var(--line-strong);border-radius:6px;background:var(--bg);color:var(--ink)}
package/public/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="referrer" content="no-referrer" />
7
7
  <title>DSH Bot</title>
8
- <script type="module" crossorigin src="/dsh-bot/assets/index-oExHCCsZ.js"></script>
9
- <link rel="stylesheet" crossorigin href="/dsh-bot/assets/index-Dczis232.css">
8
+ <script type="module" crossorigin src="/dsh-bot/assets/index-DAtzVB48.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/dsh-bot/assets/index-DFvabAYh.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>