@niracler/encore 0.2.0 → 0.4.0

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/bin/encore.mjs CHANGED
@@ -1,30 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from 'node:fs'
3
- import { on } from 'node:events'
4
- import { dirname, join, relative, resolve } from 'node:path'
3
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
5
4
  import { fileURLToPath } from 'node:url'
6
- import { parseArgs } from 'node:util'
7
5
  import readline from 'node:readline'
8
- import { iterateRecentSessions } from '../src/detect.mjs'
6
+ import { parseArgs } from 'node:util'
7
+ import { pickSession } from '../src/session-picker.mjs'
9
8
  import {
10
9
  buildReplay,
11
10
  rebuildReplayDir,
12
11
  scanRecentSessions,
12
+ tools,
13
13
  serveReplayDir,
14
14
  } from '../src/index.mjs'
15
15
 
16
16
  const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json')
17
17
 
18
18
  const HELP = `
19
- encore (@niracler/encore) — Bring your AI agent sessions back on stage.
19
+ encore (@niracler/encore) — Replay an AI Agent session to see how it worked and what it delivered.
20
20
 
21
21
  Usage:
22
- encore Scan recent Codex, Claude Code & WorkBuddy sessions and pick one interactively
23
- encore <log.jsonl | dir> [options] Build a standalone replay directory from a log or re-render an edited session.json
22
+ encore Scan recent Codex, Claude Code, WorkBuddy & Antigravity sessions and pick one interactively
23
+ encore <log.jsonl | dir> [options] Build a replay from a raw log, or rebuild an existing replay directory
24
24
  encore play <dir> [--port 4180] Start local preview server for an existing replay directory
25
25
 
26
26
  Options:
27
- -o, --out <dir> Output directory (default: ./replays/<session-slug>)
27
+ -o, --out <dir> Output directory (default: temporary directory)
28
+ --asset-root <dir> Set allowed asset roots for attachments and deliverables (repeatable; defaults to cwd and native session workspace)
28
29
  -l, --lang <zh|en|auto> Player UI language (default: auto)
29
30
  --title <text> Override session title
30
31
  --desc <text> Set opening description shown before playback starts
@@ -44,25 +45,46 @@ Options:
44
45
  -h, --help Show this help message
45
46
  `.trim()
46
47
 
47
- function printBuildReport(result) {
48
+ async function withBuildProgress(build) {
49
+ const output = process.stderr
50
+ if (!output.isTTY) return build()
51
+
52
+ const frames = '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
53
+ let index = 0
54
+ const draw = () => output.write(`\r${frames[index++ % frames.length]} Building replay…`)
55
+ draw()
56
+ const timer = setInterval(draw, 100)
57
+ try {
58
+ return await build()
59
+ } finally {
60
+ clearInterval(timer)
61
+ readline.cursorTo(output, 0)
62
+ readline.clearLine(output, 0)
63
+ }
64
+ }
65
+
66
+ function printBuildReport(result, { isTempDefault = false } = {}) {
48
67
  const { mode, toolLabel, dir, sessionFile, session, leaks } = result
49
- const relDir = relative(process.cwd(), dir) || '.'
50
- const relSession = relative(process.cwd(), sessionFile) || 'session.json'
68
+ const shownDir = displayPath(dir)
69
+ const shownSession = displayPath(sessionFile)
51
70
  const count = type => (session.items || []).filter(item => item.type === type).length
52
71
  const framesCount = (session.frames || []).length
53
- const action = mode === 'rebuild' ? 'Re-rendered' : 'Generated'
72
+ const action = mode === 'rebuild' ? 'Rebuilt' : 'Built'
54
73
 
55
- console.log(`\n✨ ${action} replay in ${relDir}/`)
74
+ console.log(`\n✨ ${action} replay in ${shownDir.endsWith(sep) ? shownDir : `${shownDir}${sep}`}`)
56
75
  console.log(` Title : ${session.title}`)
57
76
  console.log(` Agent : ${toolLabel}${session.model ? ` · ${session.model}` : ''}`)
58
- console.log(` Steps : ${count('user')} prompts · ${count('assistant')} replies · ${count('tool')} tool calls${count('compact') ? ` · ${count('compact')} compactions` : ''}`)
77
+ console.log(` Events : ${count('user')} user messages · ${count('assistant')} replies · ${count('tool')} tool calls${count('compact') ? ` · ${count('compact')} compactions` : ''}`)
59
78
  if (framesCount) {
60
- console.log(` Frames : ${framesCount} WebP image(s) in frames[] (edit ${relSession} to prune or rename labels)`)
79
+ console.log(` Frames : ${framesCount} WebP frame(s) in frames[] (edit ${shownSession} to curate or relabel)`)
61
80
  }
62
81
  console.log(` Files : index.html, session.json, encore-player.js, encore-player.css`)
82
+ if (mode === 'import' && isTempDefault) {
83
+ console.log(` Note : Saved to a temporary directory. Pass -o <dir> to keep a portable copy.`)
84
+ }
63
85
 
64
86
  if (leaks.length) {
65
- console.log(`\n⚠️ Privacy check found ${leaks.length} potential sensitive snippet(s) (non-blocking — review in ${relSession}):`)
87
+ console.log(`\n⚠️ Leak check found ${leaks.length} potential sensitive snippet(s) (non-blocking — review in ${shownSession}):`)
66
88
  for (const leak of leaks.slice(0, 12)) {
67
89
  console.log(` - ${leak.path} · ${leak.rule} · ${leak.match}`)
68
90
  }
@@ -72,20 +94,13 @@ function printBuildReport(result) {
72
94
  }
73
95
  }
74
96
 
75
- function truncateToColumns(str, maxCols) {
76
- let width = 0
77
- let out = ''
78
- for (const ch of String(str)) {
79
- const code = ch.codePointAt(0)
80
- const w = code > 0x1f00 ? 2 : 1
81
- if (width + w > maxCols - 1) return `${out}…`
82
- out += ch
83
- width += w
84
- }
85
- return out
97
+ function displayPath(targetPath) {
98
+ const rel = relative(process.cwd(), targetPath)
99
+ if (!rel) return '.'
100
+ return rel !== '..' && !rel.startsWith(`..${sep}`) && !isAbsolute(rel) ? rel : targetPath
86
101
  }
87
102
 
88
- async function pickRecentSessionInteractive() {
103
+ async function pickRecentSessionInteractive(lang) {
89
104
  const pageSize = 10
90
105
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
91
106
  const sessions = await scanRecentSessions({ limit: pageSize })
@@ -98,89 +113,11 @@ async function pickRecentSessionInteractive() {
98
113
  console.log(` [${idx + 1}] ${s.timeLabel} · ${s.toolLabel.padEnd(11)} · ${s.preview}`)
99
114
  console.log(` ${s.file} (${s.sizeKB} KB)`)
100
115
  })
101
- console.log('\nRun: encore <file-path> -o ./replays/my-session')
102
- return null
103
- }
104
-
105
- const history = iterateRecentSessions()
106
- const sessions = []
107
- let exhausted = false
108
- let selected = 0
109
- let renderedLines = 0
110
-
111
- async function loadPage(start) {
112
- while (!exhausted && sessions.length <= start + pageSize) {
113
- const next = await history.next()
114
- if (next.done) exhausted = true
115
- else sessions.push(next.value)
116
- }
117
- }
118
-
119
- await loadPage(0)
120
- if (!sessions.length) {
121
- console.log(HELP)
116
+ console.log('\nRun: encore <file-path> -o ./my-replay')
122
117
  return null
123
118
  }
124
119
 
125
- function renderMenu(start) {
126
- if (renderedLines) {
127
- readline.moveCursor(process.stdout, 0, -renderedLines)
128
- readline.clearScreenDown(process.stdout)
129
- }
130
- const cols = Math.max(1, (process.stdout.columns || 80) - 2)
131
- const page = sessions.slice(start, start + pageSize)
132
- const last = exhausted && start + pageSize >= sessions.length
133
- const heading = `Page ${start / pageSize + 1}${last ? ' (last)' : ''} · ←/→ page · ↑/↓ move · Enter select · q quit`
134
- process.stdout.write(`${truncateToColumns(heading, cols)}\n\n`)
135
- page.forEach((session, index) => {
136
- const active = start + index === selected
137
- const prefix = active ? ' ❯ ' : ' '
138
- const num = String(index + 1).padStart(2, ' ')
139
- const badge = `[${session.toolLabel}]`.padEnd(13, ' ')
140
- const line = truncateToColumns(`${prefix}${num}. ${session.timeLabel} ${badge} ${session.preview} (${session.sizeKB} KB)`, cols)
141
- process.stdout.write(`${active ? `\x1b[36m\x1b[1m${line}\x1b[0m` : line}\n`)
142
- })
143
- process.stdout.write('\n')
144
- renderedLines = page.length + 3
145
- }
146
-
147
- readline.emitKeypressEvents(process.stdin)
148
- const wasRaw = process.stdin.isRaw
149
- process.stdin.setRawMode(true)
150
- try {
151
- let start = 0
152
- renderMenu(start)
153
- for await (const [str, key] of on(process.stdin, 'keypress')) {
154
- if (key.name === 'q' || key.name === 'escape' || (key.ctrl && key.name === 'c')) {
155
- return null
156
- }
157
- if (key.name === 'return' || key.name === 'enter') return sessions[selected]
158
- if (key.name === 'left' || key.name === 'pageup') {
159
- if (!start) continue
160
- selected = start - pageSize
161
- } else if (key.name === 'right' || key.name === 'pagedown') {
162
- if (start + pageSize >= sessions.length) continue
163
- selected = start + pageSize
164
- } else if (key.name === 'up' || key.name === 'k') {
165
- selected = Math.max(0, selected - 1)
166
- } else if (key.name === 'down' || key.name === 'j') {
167
- selected = Math.min(sessions.length - 1, selected + 1)
168
- } else if (/^\d$/.test(str)) {
169
- const index = start + (Number(str) || pageSize) - 1
170
- if (index >= sessions.length) continue
171
- selected = index
172
- } else {
173
- continue
174
- }
175
- start = Math.floor(selected / pageSize) * pageSize
176
- await loadPage(start)
177
- renderMenu(start)
178
- }
179
- } finally {
180
- process.stdin.setRawMode(Boolean(wasRaw))
181
- process.stdin.pause()
182
- await history.return()
183
- }
120
+ return pickSession({ lang })
184
121
  }
185
122
 
186
123
  async function main() {
@@ -197,6 +134,7 @@ async function main() {
197
134
  allowPositionals: true,
198
135
  options: {
199
136
  out: { type: 'string', short: 'o' },
137
+ 'asset-root': { type: 'string', multiple: true },
200
138
  lang: { type: 'string', short: 'l' },
201
139
  title: { type: 'string' },
202
140
  desc: { type: 'string' },
@@ -229,22 +167,23 @@ async function main() {
229
167
  // Subcommand: `encore play <dir>` or `encore preview <dir>`
230
168
  if (positionals[0] === 'play' || positionals[0] === 'preview') {
231
169
  const targetDir = resolve(positionals[1] || '.')
232
- const rebuilt = await rebuildReplayDir(targetDir, {
170
+ const rebuilt = await withBuildProgress(() => rebuildReplayDir(targetDir, {
171
+ assetRoots: values['asset-root'],
233
172
  lang: values.lang,
234
173
  title: values.title,
235
174
  description: values.desc,
236
- })
175
+ }))
237
176
  printBuildReport(rebuilt)
238
177
  const { url } = await serveReplayDir(rebuilt.dir, { port, open: !hasNoOpen })
239
- console.log(`\n🎬 Encore stage live at ${url} (Ctrl+C to stop)`)
240
- console.log(` Tip: Edit ${relative(process.cwd(), rebuilt.sessionFile) || 'session.json'} and refresh the browser to see changes immediately.`)
178
+ console.log(`\n🎬 Replay live at ${url} (Ctrl+C to stop)`)
179
+ console.log(` Tip: Edit ${displayPath(rebuilt.sessionFile)} and refresh the browser to see changes immediately.`)
241
180
  return
242
181
  }
243
182
 
244
183
  if (values.list) {
245
184
  const recent = await scanRecentSessions({ limit: 15 })
246
185
  if (!recent.length) {
247
- console.log('No recent Codex, Claude Code, or WorkBuddy sessions found in ~/.codex/sessions, ~/.claude/projects, or ~/.workbuddy/projects.')
186
+ console.log('No recent local AI Agent sessions found.')
248
187
  return
249
188
  }
250
189
  console.log('Recent local AI Agent sessions:\n')
@@ -260,19 +199,20 @@ async function main() {
260
199
  targets = targets.slice(1)
261
200
  }
262
201
  let explicitTool
263
- if (['codex', 'claude-code', 'claude-ai', 'workbuddy'].includes(targets[0]) && targets.length > 1) {
202
+ if (Object.hasOwn(tools, targets[0]) && targets.length > 1) {
264
203
  explicitTool = targets[0]
265
204
  targets = targets.slice(1)
266
205
  }
267
206
 
268
207
  if (!targets.length) {
269
- const picked = await pickRecentSessionInteractive()
208
+ const picked = await pickRecentSessionInteractive(values.lang)
270
209
  if (!picked) return
271
210
  targets = [picked.file]
272
211
  explicitTool = picked.tool
273
212
  }
274
213
 
275
- const result = await buildReplay(targets, {
214
+ const result = await withBuildProgress(() => buildReplay(targets, {
215
+ assetRoots: values['asset-root'],
276
216
  tool: explicitTool,
277
217
  outDir: values.out,
278
218
  lang: values.lang || 'auto',
@@ -285,15 +225,15 @@ async function main() {
285
225
  clip: values.clip ? Number(values.clip) : undefined,
286
226
  conversation: values.conversation,
287
227
  includeMemory: hasIncludeMemory,
288
- })
228
+ }))
289
229
 
290
- printBuildReport(result)
230
+ printBuildReport(result, { isTempDefault: !values.out })
291
231
 
292
232
  const shouldServe = hasServe || (!hasNoServe && Boolean(process.stdin.isTTY && process.stdout.isTTY))
293
233
  if (shouldServe) {
294
234
  const { url } = await serveReplayDir(result.dir, { port, open: !hasNoOpen })
295
- console.log(`\n🎬 Encore stage live at ${url} (Ctrl+C to stop)`)
296
- console.log(` Tip: Edit ${relative(process.cwd(), result.sessionFile) || 'session.json'} and refresh the browser to see changes immediately.`)
235
+ console.log(`\n🎬 Replay live at ${url} (Ctrl+C to stop)`)
236
+ console.log(` Tip: Edit ${displayPath(result.sessionFile)} and refresh the browser to see changes immediately.`)
297
237
  }
298
238
  }
299
239
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@niracler/encore",
3
- "version": "0.2.0",
4
- "description": "A curtain call for your AI agent runs. Replay Codex, Claude Code, Claude.ai, and WorkBuddy sessions as an interactive web stage with a live context-window inspector.",
3
+ "version": "0.4.0",
4
+ "description": "A curtain call for your AI agent runs. Replay Codex, Claude Code, Claude.ai, WorkBuddy, and Antigravity sessions as an interactive web stage with a live context-window inspector.",
5
5
  "type": "module",
6
6
  "types": "./src/index.d.ts",
7
7
  "repository": {
@@ -55,6 +55,8 @@
55
55
  "node": ">=20.10.0"
56
56
  },
57
57
  "dependencies": {
58
+ "@hyzyla/pdfium": "2.1.13",
59
+ "node-xlsx": "0.25.0",
58
60
  "sharp": "^0.35.5"
59
61
  },
60
62
  "devDependencies": {
@@ -63,7 +65,7 @@
63
65
  "scripts": {
64
66
  "build:player": "node -e \"import('./src/player-assets.mjs').then(m => m.buildStandalonePlayerJs())\"",
65
67
  "build:site": "node scripts/build-site.mjs",
66
- "pretest": "npm run build:player",
68
+ "pretest": "node -e \"import('./src/player-assets.mjs').then(m => m.buildStandalonePlayerJs())\"",
67
69
  "release": "pnpm publish && git push origin main --follow-tags && gh release create \"v$(node -p \"require('./package.json').version\")\" --generate-notes",
68
70
  "test": "node --test test/*.test.mjs"
69
71
  }
@@ -30,6 +30,29 @@
30
30
  -webkit-font-smoothing: antialiased;
31
31
  }
32
32
 
33
+ .encore-loading {
34
+ display: flex;
35
+ min-height: 100dvh;
36
+ align-items: center;
37
+ justify-content: center;
38
+ gap: .75rem;
39
+ color: var(--site-muted);
40
+ }
41
+ .encore-loading::before {
42
+ content: "";
43
+ width: 1rem;
44
+ height: 1rem;
45
+ border: 2px solid currentColor;
46
+ border-right-color: transparent;
47
+ border-radius: 50%;
48
+ }
49
+ @media (prefers-reduced-motion: no-preference) {
50
+ .encore-loading::before { animation: encore-loading-spin .8s linear infinite; }
51
+ }
52
+ @keyframes encore-loading-spin {
53
+ to { transform: rotate(1turn); }
54
+ }
55
+
33
56
  :where(.session-bubble, .session-detail) a {
34
57
  display: inline;
35
58
  color: #2563eb;
@@ -72,6 +95,8 @@
72
95
  border-bottom: 1px solid #e5e7eb;
73
96
  background: #ffffff;
74
97
  }
98
+ .session-back { flex: none; color: #475569; font-size: 13px; text-decoration: none; }
99
+ .session-back:hover, .session-back:focus-visible { color: #1e40af; text-decoration: underline; }
75
100
  .session-topbar-left {
76
101
  display: flex;
77
102
  align-items: center;
@@ -306,19 +331,7 @@ html.js-session .session-log:not(.is-staged) > * {
306
331
  border-color: rgb(122, 170, 255);
307
332
  box-shadow: 0 4px 22px rgba(65, 118, 230, .1);
308
333
  }
309
- .session-composer-progress {
310
- position: absolute;
311
- left: 0;
312
- right: 0;
313
- bottom: -1px;
314
- height: 2px;
315
- background: rgb(65, 118, 230);
316
- opacity: 0;
317
- transform: scaleX(0);
318
- transform-origin: left center;
319
- transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
320
- pointer-events: none;
321
- }
334
+
322
335
  .session-composer-editor {
323
336
  min-height: 24px;
324
337
  max-height: 132px;
@@ -554,9 +567,6 @@ html.js-session .session-log:not(.is-staged) > * {
554
567
  .session-ai .session-bubble { width: 100%; max-width: none; padding: 2px 0; border-radius: 0; background: transparent; font-size: 14.5px; line-height: 1.72; color: #111827; }
555
568
  .session-entry[data-step] { position: relative; cursor: pointer; border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; margin: 0 -10px; transition: background-color .16s ease, border-color .16s ease; }
556
569
  .session-entry[data-step]:hover { background: #fafafa; }
557
- .session-entry.is-selected, .session-entry[data-step].is-selected:hover { background: #f8fafc; border-color: #cbd5e1; }
558
- .session-you.is-selected .session-bubble { background: rgb(228, 237, 253); box-shadow: none; }
559
- .session-inspect-tag { position: absolute; top: -9px; right: 10px; z-index: 2; padding: 1px 8px; border-radius: 999px; background: #ffffff; border: 1px solid #cbd5e1; color: #2563eb; font: 500 10.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); pointer-events: none; }
560
570
  .session-frame-deck { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; width: 100%; }
561
571
  .session-frame-deck[hidden] { display: none !important; }
562
572
  .session-artifact-cards { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
@@ -635,51 +645,122 @@ html.js-session .session-log:not(.is-staged) > * {
635
645
  .session-steps .session-thumbs { margin-left: 80px; }
636
646
  .session-thumbs img { display: block; width: 96px; height: auto; border: 1px solid var(--site-line); background: var(--site-surface); }
637
647
  .session-files .session-bubble { display: grid; gap: 6px; }
648
+ .session-file-missing { display: grid; gap: 3px; padding: 10px 14px; border: 1px dashed #c7cdd3; border-radius: 8px; overflow-wrap: anywhere; }
649
+ .session-file-copy > small, .session-file-missing small { display: block; margin: 3px 0; color: #5b626b; font-size: 12px; }
650
+ .session-file-download { display: inline-block; overflow-wrap: anywhere; }
651
+ .session-attachment { position: relative; min-width: 0; padding: 14px 16px; border: 1px solid #dce2e8; border-radius: 12px; background: #fff; color: #172029; }
652
+ .session-files .session-bubble:has(.session-attachment) { grid-template-columns: minmax(0, 1fr); gap: 10px; }
653
+ .session-attachment-head, .session-attachment-actions, .session-attachment-dialog header, .session-attachment-toolbar { display: flex; align-items: center; gap: 12px; }
654
+ .session-attachment-head strong { display: block; font-size: 15px; line-height: 1.45; }
655
+ .session-attachment-head small { color: #596573; font-size: 12px; }
656
+ .session-pdf-cover { width: 56px; height: 78px; object-fit: contain; border: 1px solid #dce2e8; }
657
+ .session-attachment-actions { justify-content: space-between; margin-top: 10px; }
658
+ .session-attachment button, .session-attachment-toolbar select, .session-attachment-toolbar input { font: inherit; }
659
+ .session-attachment-actions button { padding: 4px 12px; border: 1px solid #cbd5df; border-radius: 6px; background: #f8fafb; color: #152c43; font-size: 13px; font-weight: 600; cursor: pointer; }
660
+ .session-attachment-actions button::after { position: absolute; inset: 0; content: ''; border-radius: 12px; }
661
+ .session-attachment a[download] { position: relative; color: #315b80; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
662
+ .session-revision { position: relative; margin-top: 12px; padding-top: 8px; border-top: 1px solid #dce2e8; }
663
+ .session-revision summary { width: fit-content; cursor: pointer; font-weight: 600; color: #234562; }
664
+ .session-revision-context { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin: 10px 0 6px; }
665
+ .session-revision-context span { font-size: 12px; color: #53616e; }
666
+ .session-revision-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 8px; }
667
+ .session-revision-pair section { min-width: 0; padding: 10px 12px; border: 1px solid #dae0e6; border-radius: 6px; }
668
+ .session-revision-pair strong, .session-revision-pair a { font-size: 12px; }
669
+ .session-revision-pair p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
670
+ .session-revision-pair del { color: #742e34; background: #ffdee0; }
671
+ .session-revision-pair ins { color: #174b32; background: #d6f2e2; }
672
+ .session-sheet-sample { margin-top: 10px; overflow: hidden; border: 1px solid #dee6e5; border-radius: 6px; }
673
+ .session-attachment .session-sheet-sample table { display: table; width: 100%; table-layout: fixed; margin: 0; border-collapse: collapse; font-size: 12px; }
674
+ .session-sheet-sample :is(th, td) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
675
+ .session-sheet-sample :is(th, td):first-child { width: 52%; }
676
+ .session-attachment .session-sheet-sample :is(td, th), .session-attachment-dialog :is(td, th) { padding: 5px 9px; text-align: start; border-bottom: 1px solid #e1e8e5; }
677
+ .session-sheet-sample th, .session-attachment-dialog th { background: #edf4f0; color: #2f5141; font-weight: 600; }
678
+ .session-attachment-dialog { width: min(1040px, 94vw); height: min(860px, 88dvh); max-width: 100%; max-height: 100dvh; box-sizing: border-box; margin: auto; padding: 0; border: 1px solid #cbd3d8; border-radius: 12px; color: #172029; background: white; font: 14px/1.5 system-ui, sans-serif; }
679
+ .session-attachment-dialog[open] { display: flex; flex-direction: column; }
680
+ .session-attachment-dialog::backdrop { background: rgb(16 24 32 / 52%); }
681
+ .session-attachment-dialog header, .session-attachment-toolbar { flex: none; padding: 9px 16px; border-bottom: 1px solid #dce2e8; }
682
+ .session-attachment-dialog header strong { margin-inline-end: auto; min-width: 0; }
683
+ .session-attachment-dialog header a { flex: none; }
684
+ .session-attachment-dialog button, .session-attachment-toolbar select, .session-attachment-toolbar input { border: 1px solid #cbd3d8; border-radius: 5px; background: white; padding: 3px 7px; color: inherit; min-height: 30px; }
685
+ .session-attachment-dialog button { cursor: pointer; min-width: 32px; }
686
+ .session-attachment-dialog button:disabled { opacity: .45; }
687
+ .session-attachment-toolbar { flex-wrap: wrap; gap: 6px; font-size: 13px; }
688
+ .session-attachment-toolbar select { max-width: 100%; }
689
+ .session-attachment-toolbar input { width: 4.4em; }
690
+ .session-attachment-viewport { min-height: 0; overflow: auto; overscroll-behavior: contain; flex: 1; }
691
+ [data-attachment="pdf"] .session-attachment-viewport { padding: 12px; background: #e8ecef; }
692
+ .session-attachment-viewport img { display: block; width: var(--attachment-page-width, 100%); max-width: none; height: auto; margin: 0 auto 12px; box-shadow: 0 1px 4px #bac0c5; }
693
+ .session-attachment-dialog .session-attachment-viewport table { display: table; max-width: none; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; }
694
+ .session-attachment-dialog .session-attachment-viewport :is(td, th) { min-width: 6em; max-width: 32em; border-inline-end: 1px solid #e4e9e6; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
695
+ .session-attachment-viewport th { position: sticky; top: 0; }
696
+ .session-attachment-viewport summary { min-width: 15em; cursor: pointer; }
697
+ @media (max-width: 600px) {
698
+ .session-attachment-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
699
+ .session-attachment { padding: 10px; }
700
+ }
638
701
  .session-file { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px; border-radius: 10px; text-decoration: none; color: inherit; }
639
702
  .session-file:hover { color: inherit; background: var(--site-tint); }
640
703
  .session-file img { display: block; width: 56px; height: auto; aspect-ratio: 236 / 334; object-fit: cover; border: 1px solid var(--site-line); background: var(--site-surface); }
641
704
  .session-file b, .session-video b { display: block; font-weight: 600; }
642
705
  .session-file small, .session-video small { display: block; color: var(--site-muted); font-size: 13px; }
643
706
  .session-video { margin: 0; padding: 6px; }
644
- .session-video video { display: block; width: 100%; height: auto; margin-bottom: 8px; border: 1px solid var(--site-line); border-radius: 6px; background: var(--site-surface); }
707
+ .session-chat-scroll:has(.session-video-formats) { container-type: size; }
708
+ .session-video figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 8px; }
709
+ .session-video-formats { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: #f1f5f9; }
710
+ .session-video-formats button { border: 0; padding: 5px 10px; border-radius: 5px; font: inherit; font-size: 13px; color: #334155; background: transparent; cursor: pointer; }
711
+ .session-video-formats button[aria-pressed="true"] { background: #334155; color: #fff; }
712
+ .session-video video { display: block; width: 100%; height: auto; max-height: 54vh; border-radius: 8px; background: #101418; }
713
+ .session-video video[data-format="portrait"] { width: auto; max-width: 100%; height: min(54vh, calc(100cqh - 5rem)); aspect-ratio: 9 / 16; margin-inline: auto; }
645
714
  .session-audio { display: grid; gap: 6px; margin: 4px 0 8px 80px; padding: 0; list-style: none; }
646
715
  .session-audio li { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 8px; align-items: center; }
647
716
  .session-audio audio { width: 100%; height: 32px; }
648
717
 
649
718
  /* Bottom Segmented Chapter Timeline & Lightbox */
650
719
  .session-timeline-bar { position: relative; flex: none; z-index: 5; display: flex; align-items: center; gap: 18px; min-height: 52px; padding: 8px 20px 10px; border-top: 1px solid #e5e7eb; background: #fcfcfd; }
651
- .session-timeline-bar .session-composer-progress { top: -9px; bottom: auto; }
652
- .session-tl-track-wrap { flex: 1; min-width: 0; position: relative; padding: 18px 0 2px; }
653
- .session-tl-pins { position: absolute; left: 0; right: 0; top: 0; height: 16px; pointer-events: none; }
654
- .session-tl-pin { pointer-events: auto; position: absolute; top: 0; transform: translateX(-50%); border: 1px solid #e5e7eb; border-radius: 4px; background: #ffffff; color: #6b7280; font: 500 10px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; padding: 1px 5px; cursor: pointer; white-space: nowrap; transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease; }
655
- .session-tl-pin.is-turn.is-compact { top: 5px; width: 6px; height: 6px; padding: 0; border-radius: 50%; background: #cbd5e1; border: 0; }
656
- .session-tl-pin.is-turn.is-compact.is-reached { background: #60a5fa; }
657
- .session-tl-pin.is-turn.is-compact.is-on, .session-tl-pin.is-turn.is-compact:hover { background: #2563eb; transform: translateX(-50%) scale(1.25); }
658
- .session-tl-pin.is-turn.has-label.is-reached { color: #1d4ed8; border-color: #bfdbfe; }
659
- .session-tl-pin.is-turn.has-label.is-on, .session-tl-pin.is-turn.has-label:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; z-index: 2; }
660
- .session-tl-pin.is-frame { color: #6d28d9; border-color: #ddd6fe; background: #faf5ff; }
661
- .session-tl-pin.is-frame.is-compact { padding: 0 3px; font-size: 9.5px; }
662
- .session-tl-pin.is-frame.is-on, .session-tl-pin.is-frame:hover { background: #ede9fe; border-color: #a78bfa; color: #5b21b6; z-index: 3; }
663
- .session-tl-pin.is-doc { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
664
- .session-tl-pin.is-doc.is-compact { padding: 0 3px; font-size: 9.5px; }
665
- .session-tl-pin.is-doc.is-on, .session-tl-pin.is-doc:hover { background: #e0f2fe; border-color: #7dd3fc; color: #075985; z-index: 3; }
666
- .session-tl-pin.is-compress { color: #b45309; border-color: #fcd34d; background: #fffbeb; font-weight: 600; }
667
- .session-tl-pin.is-compress.is-compact { padding: 0 3px; font-size: 9.5px; }
668
- .session-tl-pin.is-compress.is-on, .session-tl-pin.is-compress:hover { background: #fef3c7; border-color: #f59e0b; color: #92400e; z-index: 4; }
669
- .session-tl-segs { display: flex; gap: var(--tl-gap, 2px); align-items: center; height: 10px; width: 100%; min-width: 0; }
670
- .session-tl-seg { flex: 1 1 0; min-width: 0; height: 6px; border-radius: 3px; background: #e5e7eb; cursor: pointer; transition: height .15s ease, background-color .15s ease, opacity .15s ease; }
671
- .session-tl-seg.has-compress { background: #fbbf24; height: 8px; }
672
- .session-tl-seg.has-frame { background: #ddd6fe; }
673
- .session-tl-seg.has-doc { background: #bae6fd; }
674
- .session-tl-seg.is-past { background: #2563eb; opacity: .45; }
675
- .session-tl-seg.is-active, .session-tl-seg:hover { height: 9px; background: #2563eb; opacity: 1; }
676
- .session-tl-pop { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 10px; width: max-content; max-width: 260px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; box-shadow: 0 10px 26px rgba(15, 23, 42, .12); pointer-events: none; }
720
+ .session-tl-track-wrap { flex: 1; min-width: 0; position: relative; padding: 0; }
721
+ .session-tl-pins { position: relative; height: 20px; }
722
+ .session-tl-pin {
723
+ visibility: hidden; position: absolute; display: flex; align-items: center; gap: 3px;
724
+ transform: none; max-width: min(18ch, 100%); padding: 1px 4px; border: 1px solid;
725
+ border-radius: 4px; cursor: pointer; white-space: nowrap; font: 500 10.5px/1.4 system-ui, sans-serif;
726
+ }
727
+ .session-tl-caption { overflow: hidden; text-overflow: ellipsis; }
728
+ .session-tl-pin[data-kind="frame"] { color: #6d28d9; border-color: #ddd6fe; background: #faf5ff; }
729
+ .session-tl-pin[data-kind="doc"] { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
730
+ .session-tl-pin[data-kind="compress"] { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
731
+ .session-tl-pin.is-visible { visibility: visible; }
732
+ .session-tl-pin.is-compact { padding-inline: 2px; }
733
+ .session-tl-pin.is-compact .session-tl-caption { display: none; }
734
+ .session-tl-pin[data-kind="turn"] { top: 6px; width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: #94a3b8; }
735
+ .session-tl-pin.is-on { outline: 1px solid #2563eb; }
736
+ .session-tl-rail { position: relative; height: 24px; }
737
+ .session-tl-cells { height: 100%; display: grid; grid-template-columns: repeat(var(--tl-count), minmax(0, 1fr)); align-items: center; }
738
+ .session-tl-cell { margin-inline: min(0.8px, 10%); height: 6px; border-radius: 3px; background: #e2e8f0; }
739
+ .session-tl-cell.frame { background: #ddd6fe; }
740
+ .session-tl-cell.doc { background: #bae6fd; }
741
+ .session-tl-cell.compress { background: #fbbf24; height: 8px; }
742
+ .session-tl-cell.is-past { background: #c3d6f7; }
743
+ .session-tl-cell.is-active { background: #2563eb; height: 12px; min-width: 2px; }
744
+ .session-tl-range {
745
+ position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
746
+ appearance: none; cursor: pointer; background: transparent; border: 0;
747
+ }
748
+ .session-tl-range::-webkit-slider-runnable-track { background: transparent; }
749
+ .session-tl-range::-webkit-slider-thumb { appearance: none; width: calc(100% / var(--tl-count)); height: 24px; background: transparent; }
750
+ .session-tl-range::-moz-range-track, .session-tl-range::-moz-range-progress { background: transparent; }
751
+ .session-tl-range::-moz-range-thumb { width: calc(100% / var(--tl-count)); height: 24px; background: transparent; border: 0; }
752
+ .session-tl-range:focus-visible, .session-tl-pin:focus-visible { outline: 2px solid #1e40af; outline-offset: 2px; }
753
+ @media (forced-colors: active) {
754
+ .session-tl-cell { background: GrayText; }
755
+ .session-tl-cell.is-active { forced-color-adjust: none; background: Highlight; }
756
+ }
757
+ .session-tl-pop { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(260px, 100%); padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; box-shadow: 0 10px 26px rgba(15, 23, 42, .12); pointer-events: none; }
677
758
  .session-tl-pop[hidden] { display: none !important; }
678
759
  .session-tl-pop-thumb { flex: none; width: 40px; height: 54px; border-radius: 5px; overflow: hidden; border: 1px solid #e5e7eb; background: #f8fafc; }
679
760
  .session-tl-pop-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
680
761
  .session-tl-pop-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
681
762
  .session-tl-pop-meta small { color: #6b7280; font: 500 10.5px/1.25 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
682
- .session-tl-pop-meta b { color: #111827; font-size: 12px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
763
+ .session-tl-pop-meta b { color: #111827; font-size: 12px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; max-width: 190px; }
683
764
  .session-tl-pop-meta span { color: #2563eb; font: 500 10.5px/1.25 ui-monospace, "SF Mono", Menlo, monospace; }
684
765
 
685
766
  .session-lightbox { border: 1px solid #e5e7eb; border-radius: 14px; padding: 0; max-width: min(92vw, 960px); max-height: 90dvh; background: #ffffff; color: #111827; box-shadow: 0 24px 60px rgba(15, 23, 42, .24); overflow: hidden; }