@niracler/encore 0.1.0 → 0.3.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,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from 'node:fs'
3
- import { dirname, join, relative, resolve } from 'node:path'
3
+ import { on } from 'node:events'
4
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
4
5
  import { fileURLToPath } from 'node:url'
5
6
  import { parseArgs } from 'node:util'
6
7
  import readline from 'node:readline'
8
+ import { iterateRecentSessions } from '../src/detect.mjs'
7
9
  import {
8
10
  buildReplay,
9
11
  rebuildReplayDir,
@@ -14,15 +16,16 @@ import {
14
16
  const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json')
15
17
 
16
18
  const HELP = `
17
- 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.
18
20
 
19
21
  Usage:
20
- encore Scan recent Codex & Claude Code sessions and pick one interactively
21
- 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 sessions and pick one interactively
23
+ encore <log.jsonl | dir> [options] Build a replay from a raw log, or rebuild an existing replay directory
22
24
  encore play <dir> [--port 4180] Start local preview server for an existing replay directory
23
25
 
24
26
  Options:
25
- -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)
26
29
  -l, --lang <zh|en|auto> Player UI language (default: auto)
27
30
  --title <text> Override session title
28
31
  --desc <text> Set opening description shown before playback starts
@@ -42,25 +45,46 @@ Options:
42
45
  -h, --help Show this help message
43
46
  `.trim()
44
47
 
45
- 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 } = {}) {
46
67
  const { mode, toolLabel, dir, sessionFile, session, leaks } = result
47
- const relDir = relative(process.cwd(), dir) || '.'
48
- const relSession = relative(process.cwd(), sessionFile) || 'session.json'
68
+ const shownDir = displayPath(dir)
69
+ const shownSession = displayPath(sessionFile)
49
70
  const count = type => (session.items || []).filter(item => item.type === type).length
50
71
  const framesCount = (session.frames || []).length
51
- const action = mode === 'rebuild' ? 'Re-rendered' : 'Generated'
72
+ const action = mode === 'rebuild' ? 'Rebuilt' : 'Built'
52
73
 
53
- console.log(`\n✨ ${action} replay in ${relDir}/`)
74
+ console.log(`\n✨ ${action} replay in ${shownDir.endsWith(sep) ? shownDir : `${shownDir}${sep}`}`)
54
75
  console.log(` Title : ${session.title}`)
55
76
  console.log(` Agent : ${toolLabel}${session.model ? ` · ${session.model}` : ''}`)
56
- 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` : ''}`)
57
78
  if (framesCount) {
58
- 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)`)
59
80
  }
60
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
+ }
61
85
 
62
86
  if (leaks.length) {
63
- 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}):`)
64
88
  for (const leak of leaks.slice(0, 12)) {
65
89
  console.log(` - ${leak.path} · ${leak.rule} · ${leak.match}`)
66
90
  }
@@ -70,6 +94,12 @@ function printBuildReport(result) {
70
94
  }
71
95
  }
72
96
 
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
101
+ }
102
+
73
103
  function truncateToColumns(str, maxCols) {
74
104
  let width = 0
75
105
  let out = ''
@@ -83,78 +113,102 @@ function truncateToColumns(str, maxCols) {
83
113
  return out
84
114
  }
85
115
 
86
- async function pickRecentSessionInteractive(sessions) {
116
+ async function pickRecentSessionInteractive() {
117
+ const pageSize = 10
87
118
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
119
+ const sessions = await scanRecentSessions({ limit: pageSize })
120
+ if (!sessions.length) {
121
+ console.log(HELP)
122
+ return null
123
+ }
88
124
  console.log('Recent local AI Agent sessions:\n')
89
125
  sessions.forEach((s, idx) => {
90
126
  console.log(` [${idx + 1}] ${s.timeLabel} · ${s.toolLabel.padEnd(11)} · ${s.preview}`)
91
127
  console.log(` ${s.file} (${s.sizeKB} KB)`)
92
128
  })
93
- console.log('\nRun: encore <file-path> -o ./replays/my-session')
129
+ console.log('\nRun: encore <file-path> -o ./my-replay')
94
130
  return null
95
131
  }
96
132
 
97
- return new Promise(resolvePromise => {
98
- let selected = 0
99
- const total = sessions.length
133
+ const history = iterateRecentSessions()
134
+ const sessions = []
135
+ let exhausted = false
136
+ let selected = 0
137
+ let renderedLines = 0
100
138
 
101
- const renderMenu = (firstRender = false) => {
102
- if (!firstRender) {
103
- readline.moveCursor(process.stdout, 0, -(total + 3))
104
- readline.clearScreenDown(process.stdout)
105
- }
106
- const cols = Math.max(40, (process.stdout.columns || 80) - 2)
107
- process.stdout.write(`${truncateToColumns('🎭 Pick a recent AI Agent session to bring back on stage (↑/↓ to move, Enter to select, q to quit):', cols)}\n\n`)
108
- sessions.forEach((s, idx) => {
109
- const active = idx === selected
110
- const prefix = active ? ' ❯ ' : ' '
111
- const num = String(idx + 1).padStart(2, ' ')
112
- const badge = `[${s.toolLabel}]`.padEnd(13, ' ')
113
- const line = truncateToColumns(`${prefix}${num}. ${s.timeLabel} ${badge} ${s.preview} (${s.sizeKB} KB)`, cols)
114
- process.stdout.write(`${active ? `\x1b[36m\x1b[1m${line}\x1b[0m` : line}\n`)
115
- })
116
- process.stdout.write('\n')
139
+ async function loadPage(start) {
140
+ while (!exhausted && sessions.length <= start + pageSize) {
141
+ const next = await history.next()
142
+ if (next.done) exhausted = true
143
+ else sessions.push(next.value)
117
144
  }
145
+ }
118
146
 
119
- renderMenu(true)
120
- readline.emitKeypressEvents(process.stdin)
121
- const wasRaw = process.stdin.isRaw
122
- process.stdin.setRawMode(true)
123
- process.stdin.resume()
147
+ await loadPage(0)
148
+ if (!sessions.length) {
149
+ console.log(HELP)
150
+ return null
151
+ }
124
152
 
125
- const cleanup = () => {
126
- process.stdin.removeListener('keypress', onKeypress)
127
- if (process.stdin.isTTY) process.stdin.setRawMode(Boolean(wasRaw))
128
- process.stdin.pause()
153
+ function renderMenu(start) {
154
+ if (renderedLines) {
155
+ readline.moveCursor(process.stdout, 0, -renderedLines)
156
+ readline.clearScreenDown(process.stdout)
129
157
  }
158
+ const cols = Math.max(1, (process.stdout.columns || 80) - 2)
159
+ const page = sessions.slice(start, start + pageSize)
160
+ const last = exhausted && start + pageSize >= sessions.length
161
+ const heading = `Page ${start / pageSize + 1}${last ? ' (last)' : ''} · ←/→ page · ↑/↓ move · Enter select · q quit`
162
+ process.stdout.write(`${truncateToColumns(heading, cols)}\n\n`)
163
+ page.forEach((session, index) => {
164
+ const active = start + index === selected
165
+ const prefix = active ? ' ❯ ' : ' '
166
+ const num = String(index + 1).padStart(2, ' ')
167
+ const badge = `[${session.toolLabel}]`.padEnd(13, ' ')
168
+ const line = truncateToColumns(`${prefix}${num}. ${session.timeLabel} ${badge} ${session.preview} (${session.sizeKB} KB)`, cols)
169
+ process.stdout.write(`${active ? `\x1b[36m\x1b[1m${line}\x1b[0m` : line}\n`)
170
+ })
171
+ process.stdout.write('\n')
172
+ renderedLines = page.length + 3
173
+ }
130
174
 
131
- const onKeypress = (str, key) => {
132
- if (!key) return
175
+ readline.emitKeypressEvents(process.stdin)
176
+ const wasRaw = process.stdin.isRaw
177
+ process.stdin.setRawMode(true)
178
+ try {
179
+ let start = 0
180
+ renderMenu(start)
181
+ for await (const [str, key] of on(process.stdin, 'keypress')) {
133
182
  if (key.name === 'q' || key.name === 'escape' || (key.ctrl && key.name === 'c')) {
134
- cleanup()
135
- resolvePromise(null)
136
- return
183
+ return null
137
184
  }
138
- if (key.name === 'up' || key.name === 'k') {
139
- selected = (selected - 1 + total) % total
140
- renderMenu(false)
185
+ if (key.name === 'return' || key.name === 'enter') return sessions[selected]
186
+ if (key.name === 'left' || key.name === 'pageup') {
187
+ if (!start) continue
188
+ selected = start - pageSize
189
+ } else if (key.name === 'right' || key.name === 'pagedown') {
190
+ if (start + pageSize >= sessions.length) continue
191
+ selected = start + pageSize
192
+ } else if (key.name === 'up' || key.name === 'k') {
193
+ selected = Math.max(0, selected - 1)
141
194
  } else if (key.name === 'down' || key.name === 'j') {
142
- selected = (selected + 1) % total
143
- renderMenu(false)
144
- } else if (key.name === 'return' || key.name === 'enter') {
145
- cleanup()
146
- resolvePromise(sessions[selected])
147
- } else if (str && /^[1-9]$/.test(str)) {
148
- const idx = Number(str) - 1
149
- if (idx < total) {
150
- selected = idx
151
- renderMenu(false)
152
- }
195
+ selected = Math.min(sessions.length - 1, selected + 1)
196
+ } else if (/^\d$/.test(str)) {
197
+ const index = start + (Number(str) || pageSize) - 1
198
+ if (index >= sessions.length) continue
199
+ selected = index
200
+ } else {
201
+ continue
153
202
  }
203
+ start = Math.floor(selected / pageSize) * pageSize
204
+ await loadPage(start)
205
+ renderMenu(start)
154
206
  }
155
-
156
- process.stdin.on('keypress', onKeypress)
157
- })
207
+ } finally {
208
+ process.stdin.setRawMode(Boolean(wasRaw))
209
+ process.stdin.pause()
210
+ await history.return()
211
+ }
158
212
  }
159
213
 
160
214
  async function main() {
@@ -171,6 +225,7 @@ async function main() {
171
225
  allowPositionals: true,
172
226
  options: {
173
227
  out: { type: 'string', short: 'o' },
228
+ 'asset-root': { type: 'string', multiple: true },
174
229
  lang: { type: 'string', short: 'l' },
175
230
  title: { type: 'string' },
176
231
  desc: { type: 'string' },
@@ -203,22 +258,23 @@ async function main() {
203
258
  // Subcommand: `encore play <dir>` or `encore preview <dir>`
204
259
  if (positionals[0] === 'play' || positionals[0] === 'preview') {
205
260
  const targetDir = resolve(positionals[1] || '.')
206
- const rebuilt = await rebuildReplayDir(targetDir, {
261
+ const rebuilt = await withBuildProgress(() => rebuildReplayDir(targetDir, {
262
+ assetRoots: values['asset-root'],
207
263
  lang: values.lang,
208
264
  title: values.title,
209
265
  description: values.desc,
210
- })
266
+ }))
211
267
  printBuildReport(rebuilt)
212
268
  const { url } = await serveReplayDir(rebuilt.dir, { port, open: !hasNoOpen })
213
- console.log(`\n🎬 Encore stage live at ${url} (Ctrl+C to stop)`)
214
- console.log(` Tip: Edit ${relative(process.cwd(), rebuilt.sessionFile) || 'session.json'} and refresh the browser to see changes immediately.`)
269
+ console.log(`\n🎬 Replay live at ${url} (Ctrl+C to stop)`)
270
+ console.log(` Tip: Edit ${displayPath(rebuilt.sessionFile)} and refresh the browser to see changes immediately.`)
215
271
  return
216
272
  }
217
273
 
218
274
  if (values.list) {
219
275
  const recent = await scanRecentSessions({ limit: 15 })
220
276
  if (!recent.length) {
221
- console.log('No recent Codex or Claude Code sessions found in ~/.codex/sessions or ~/.claude/projects.')
277
+ console.log('No recent Codex, Claude Code, or WorkBuddy sessions found in ~/.codex/sessions, ~/.claude/projects, or ~/.workbuddy/projects.')
222
278
  return
223
279
  }
224
280
  console.log('Recent local AI Agent sessions:\n')
@@ -234,24 +290,20 @@ async function main() {
234
290
  targets = targets.slice(1)
235
291
  }
236
292
  let explicitTool
237
- if (['codex', 'claude-code', 'claude-ai'].includes(targets[0]) && targets.length > 1) {
293
+ if (['codex', 'claude-code', 'claude-ai', 'workbuddy'].includes(targets[0]) && targets.length > 1) {
238
294
  explicitTool = targets[0]
239
295
  targets = targets.slice(1)
240
296
  }
241
297
 
242
298
  if (!targets.length) {
243
- const recent = await scanRecentSessions({ limit: 10 })
244
- if (!recent.length) {
245
- console.log(HELP)
246
- return
247
- }
248
- const picked = await pickRecentSessionInteractive(recent)
299
+ const picked = await pickRecentSessionInteractive()
249
300
  if (!picked) return
250
301
  targets = [picked.file]
251
302
  explicitTool = picked.tool
252
303
  }
253
304
 
254
- const result = await buildReplay(targets, {
305
+ const result = await withBuildProgress(() => buildReplay(targets, {
306
+ assetRoots: values['asset-root'],
255
307
  tool: explicitTool,
256
308
  outDir: values.out,
257
309
  lang: values.lang || 'auto',
@@ -264,15 +316,15 @@ async function main() {
264
316
  clip: values.clip ? Number(values.clip) : undefined,
265
317
  conversation: values.conversation,
266
318
  includeMemory: hasIncludeMemory,
267
- })
319
+ }))
268
320
 
269
- printBuildReport(result)
321
+ printBuildReport(result, { isTempDefault: !values.out })
270
322
 
271
323
  const shouldServe = hasServe || (!hasNoServe && Boolean(process.stdin.isTTY && process.stdout.isTTY))
272
324
  if (shouldServe) {
273
325
  const { url } = await serveReplayDir(result.dir, { port, open: !hasNoOpen })
274
- console.log(`\n🎬 Encore stage live at ${url} (Ctrl+C to stop)`)
275
- console.log(` Tip: Edit ${relative(process.cwd(), result.sessionFile) || 'session.json'} and refresh the browser to see changes immediately.`)
326
+ console.log(`\n🎬 Replay live at ${url} (Ctrl+C to stop)`)
327
+ console.log(` Tip: Edit ${displayPath(result.sessionFile)} and refresh the browser to see changes immediately.`)
276
328
  }
277
329
  }
278
330
 
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@niracler/encore",
3
- "version": "0.1.0",
4
- "description": "Bring your AI agent sessions back on stage — like asciinema, but for AI agents (Codex, Claude Code, Claude).",
3
+ "version": "0.3.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.",
5
5
  "type": "module",
6
+ "types": "./src/index.d.ts",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/niracler/encore.git"
9
10
  },
10
- "homepage": "https://github.com/niracler/encore#readme",
11
+ "homepage": "https://encore.niracler.com",
11
12
  "bugs": {
12
13
  "url": "https://github.com/niracler/encore/issues"
13
14
  },
@@ -15,24 +16,25 @@
15
16
  "encore": "bin/encore.mjs"
16
17
  },
17
18
  "exports": {
18
- ".": "./src/index.mjs",
19
+ ".": {
20
+ "types": "./src/index.d.ts",
21
+ "default": "./src/index.mjs"
22
+ },
19
23
  "./player.js": "./player/encore-player.js",
20
- "./player.css": "./player/encore-player.css"
24
+ "./player.css": "./player/encore-player.css",
25
+ "./session.schema.json": "./schema/session.schema.json"
21
26
  },
22
27
  "files": [
23
28
  "bin",
24
29
  "src",
25
- "player",
30
+ "player/encore-player.js",
31
+ "player/encore-player.css",
32
+ "schema",
26
33
  "skills",
27
34
  "README.md",
28
35
  "README.zh-CN.md",
29
36
  "LICENSE"
30
37
  ],
31
- "scripts": {
32
- "build:player": "node -e \"import('./src/player-assets.mjs').then(m => m.buildStandalonePlayerJs())\"",
33
- "prepack": "npm run build:player",
34
- "test": "node --test test/*.test.mjs"
35
- },
36
38
  "keywords": [
37
39
  "ai",
38
40
  "agent",
@@ -40,6 +42,7 @@
40
42
  "session-player",
41
43
  "codex",
42
44
  "claude-code",
45
+ "workbuddy",
43
46
  "context-engineering",
44
47
  "asciinema"
45
48
  ],
@@ -49,9 +52,21 @@
49
52
  "access": "public"
50
53
  },
51
54
  "engines": {
52
- "node": ">=20.0.0"
55
+ "node": ">=20.10.0"
53
56
  },
54
57
  "dependencies": {
58
+ "@hyzyla/pdfium": "2.1.13",
59
+ "node-xlsx": "0.25.0",
55
60
  "sharp": "^0.35.5"
61
+ },
62
+ "devDependencies": {
63
+ "@playwright/test": "1.65.1"
64
+ },
65
+ "scripts": {
66
+ "build:player": "node -e \"import('./src/player-assets.mjs').then(m => m.buildStandalonePlayerJs())\"",
67
+ "build:site": "node scripts/build-site.mjs",
68
+ "pretest": "node -e \"import('./src/player-assets.mjs').then(m => m.buildStandalonePlayerJs())\"",
69
+ "release": "pnpm publish && git push origin main --follow-tags && gh release create \"v$(node -p \"require('./package.json').version\")\" --generate-notes",
70
+ "test": "node --test test/*.test.mjs"
56
71
  }
57
- }
72
+ }
@@ -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;
@@ -635,13 +658,72 @@ html.js-session .session-log:not(.is-staged) > * {
635
658
  .session-steps .session-thumbs { margin-left: 80px; }
636
659
  .session-thumbs img { display: block; width: 96px; height: auto; border: 1px solid var(--site-line); background: var(--site-surface); }
637
660
  .session-files .session-bubble { display: grid; gap: 6px; }
661
+ .session-file-missing { display: grid; gap: 3px; padding: 10px 14px; border: 1px dashed #c7cdd3; border-radius: 8px; overflow-wrap: anywhere; }
662
+ .session-file-copy > small, .session-file-missing small { display: block; margin: 3px 0; color: #5b626b; font-size: 12px; }
663
+ .session-file-download { display: inline-block; overflow-wrap: anywhere; }
664
+ .session-attachment { position: relative; min-width: 0; padding: 14px 16px; border: 1px solid #dce2e8; border-radius: 12px; background: #fff; color: #172029; }
665
+ .session-files .session-bubble:has(.session-attachment) { grid-template-columns: minmax(0, 1fr); gap: 10px; }
666
+ .session-attachment-head, .session-attachment-actions, .session-attachment-dialog header, .session-attachment-toolbar { display: flex; align-items: center; gap: 12px; }
667
+ .session-attachment-head strong { display: block; font-size: 15px; line-height: 1.45; }
668
+ .session-attachment-head small { color: #596573; font-size: 12px; }
669
+ .session-pdf-cover { width: 56px; height: 78px; object-fit: contain; border: 1px solid #dce2e8; }
670
+ .session-attachment-actions { justify-content: space-between; margin-top: 10px; }
671
+ .session-attachment button, .session-attachment-toolbar select, .session-attachment-toolbar input { font: inherit; }
672
+ .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; }
673
+ .session-attachment-actions button::after { position: absolute; inset: 0; content: ''; border-radius: 12px; }
674
+ .session-attachment a[download] { position: relative; color: #315b80; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
675
+ .session-revision { position: relative; margin-top: 12px; padding-top: 8px; border-top: 1px solid #dce2e8; }
676
+ .session-revision summary { width: fit-content; cursor: pointer; font-weight: 600; color: #234562; }
677
+ .session-revision-context { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin: 10px 0 6px; }
678
+ .session-revision-context span { font-size: 12px; color: #53616e; }
679
+ .session-revision-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 8px; }
680
+ .session-revision-pair section { min-width: 0; padding: 10px 12px; border: 1px solid #dae0e6; border-radius: 6px; }
681
+ .session-revision-pair strong, .session-revision-pair a { font-size: 12px; }
682
+ .session-revision-pair p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
683
+ .session-revision-pair del { color: #742e34; background: #ffdee0; }
684
+ .session-revision-pair ins { color: #174b32; background: #d6f2e2; }
685
+ .session-sheet-sample { margin-top: 10px; overflow: hidden; border: 1px solid #dee6e5; border-radius: 6px; }
686
+ .session-attachment .session-sheet-sample table { display: table; width: 100%; table-layout: fixed; margin: 0; border-collapse: collapse; font-size: 12px; }
687
+ .session-sheet-sample :is(th, td) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
688
+ .session-sheet-sample :is(th, td):first-child { width: 52%; }
689
+ .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; }
690
+ .session-sheet-sample th, .session-attachment-dialog th { background: #edf4f0; color: #2f5141; font-weight: 600; }
691
+ .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; }
692
+ .session-attachment-dialog[open] { display: flex; flex-direction: column; }
693
+ .session-attachment-dialog::backdrop { background: rgb(16 24 32 / 52%); }
694
+ .session-attachment-dialog header, .session-attachment-toolbar { flex: none; padding: 9px 16px; border-bottom: 1px solid #dce2e8; }
695
+ .session-attachment-dialog header strong { margin-inline-end: auto; min-width: 0; }
696
+ .session-attachment-dialog header a { flex: none; }
697
+ .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; }
698
+ .session-attachment-dialog button { cursor: pointer; min-width: 32px; }
699
+ .session-attachment-dialog button:disabled { opacity: .45; }
700
+ .session-attachment-toolbar { flex-wrap: wrap; gap: 6px; font-size: 13px; }
701
+ .session-attachment-toolbar select { max-width: 100%; }
702
+ .session-attachment-toolbar input { width: 4.4em; }
703
+ .session-attachment-viewport { min-height: 0; overflow: auto; overscroll-behavior: contain; flex: 1; }
704
+ [data-attachment="pdf"] .session-attachment-viewport { padding: 12px; background: #e8ecef; }
705
+ .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; }
706
+ .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; }
707
+ .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; }
708
+ .session-attachment-viewport th { position: sticky; top: 0; }
709
+ .session-attachment-viewport summary { min-width: 15em; cursor: pointer; }
710
+ @media (max-width: 600px) {
711
+ .session-attachment-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
712
+ .session-attachment { padding: 10px; }
713
+ }
638
714
  .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
715
  .session-file:hover { color: inherit; background: var(--site-tint); }
640
716
  .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
717
  .session-file b, .session-video b { display: block; font-weight: 600; }
642
718
  .session-file small, .session-video small { display: block; color: var(--site-muted); font-size: 13px; }
643
719
  .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); }
720
+ .session-chat-scroll:has(.session-video-formats) { container-type: size; }
721
+ .session-video figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 8px; }
722
+ .session-video-formats { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: #f1f5f9; }
723
+ .session-video-formats button { border: 0; padding: 5px 10px; border-radius: 5px; font: inherit; font-size: 13px; color: #334155; background: transparent; cursor: pointer; }
724
+ .session-video-formats button[aria-pressed="true"] { background: #334155; color: #fff; }
725
+ .session-video video { display: block; width: 100%; height: auto; max-height: 54vh; border-radius: 8px; background: #101418; }
726
+ .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
727
  .session-audio { display: grid; gap: 6px; margin: 4px 0 8px 80px; padding: 0; list-style: none; }
646
728
  .session-audio li { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 8px; align-items: center; }
647
729
  .session-audio audio { width: 100%; height: 32px; }