pith-ui 0.1.0 → 0.1.4
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/AI.md +20 -1
- package/API.md +834 -272
- package/README.md +3 -1
- package/dist/composer.d.ts.map +1 -1
- package/dist/composer.js +48 -29
- package/dist/composer.js.map +1 -1
- package/dist/content/conversation-reader.d.ts.map +1 -1
- package/dist/content/conversation-reader.js +8 -1
- package/dist/content/conversation-reader.js.map +1 -1
- package/dist/content/conversation-view.d.ts +21 -4
- package/dist/content/conversation-view.d.ts.map +1 -1
- package/dist/content/conversation-view.js +72 -13
- package/dist/content/conversation-view.js.map +1 -1
- package/dist/content/image-viewer.d.ts +4 -2
- package/dist/content/image-viewer.d.ts.map +1 -1
- package/dist/content/image-viewer.js +36 -15
- package/dist/content/image-viewer.js.map +1 -1
- package/dist/content/paged-preview.d.ts +1 -1
- package/dist/content/paged-preview.d.ts.map +1 -1
- package/dist/content/paged-preview.js +10 -5
- package/dist/content/paged-preview.js.map +1 -1
- package/dist/content/views.d.ts +3 -0
- package/dist/content/views.d.ts.map +1 -1
- package/dist/content/views.js +110 -41
- package/dist/content/views.js.map +1 -1
- package/dist/content/welcome.d.ts.map +1 -1
- package/dist/content/welcome.js +19 -7
- package/dist/content/welcome.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/dom.js.map +1 -1
- package/dist/files/panels.d.ts +8 -1
- package/dist/files/panels.d.ts.map +1 -1
- package/dist/files/panels.js +235 -120
- package/dist/files/panels.js.map +1 -1
- package/dist/files/systems.d.ts.map +1 -1
- package/dist/files/systems.js +81 -91
- package/dist/files/systems.js.map +1 -1
- package/dist/forms/actions.d.ts +28 -7
- package/dist/forms/actions.d.ts.map +1 -1
- package/dist/forms/actions.js +59 -11
- package/dist/forms/actions.js.map +1 -1
- package/dist/forms/custom-connection.d.ts +2 -1
- package/dist/forms/custom-connection.d.ts.map +1 -1
- package/dist/forms/custom-connection.js +36 -28
- package/dist/forms/custom-connection.js.map +1 -1
- package/dist/forms/dialog-frame.d.ts +2 -0
- package/dist/forms/dialog-frame.d.ts.map +1 -1
- package/dist/forms/dialog-frame.js +46 -26
- package/dist/forms/dialog-frame.js.map +1 -1
- package/dist/forms/history.d.ts +1 -1
- package/dist/forms/history.d.ts.map +1 -1
- package/dist/forms/history.js +78 -15
- package/dist/forms/history.js.map +1 -1
- package/dist/forms/identity.d.ts +12 -0
- package/dist/forms/identity.d.ts.map +1 -1
- package/dist/forms/identity.js +16 -0
- package/dist/forms/identity.js.map +1 -1
- package/dist/forms/model-editor.d.ts +8 -3
- package/dist/forms/model-editor.d.ts.map +1 -1
- package/dist/forms/model-editor.js +73 -62
- package/dist/forms/model-editor.js.map +1 -1
- package/dist/forms/panels.d.ts +103 -7
- package/dist/forms/panels.d.ts.map +1 -1
- package/dist/forms/panels.js +183 -77
- package/dist/forms/panels.js.map +1 -1
- package/dist/forms/provider-login.d.ts.map +1 -1
- package/dist/forms/provider-login.js +25 -39
- package/dist/forms/provider-login.js.map +1 -1
- package/dist/forms/resource-editor.d.ts +9 -5
- package/dist/forms/resource-editor.d.ts.map +1 -1
- package/dist/forms/resource-editor.js +20 -9
- package/dist/forms/resource-editor.js.map +1 -1
- package/dist/foundations.d.ts +95 -0
- package/dist/foundations.d.ts.map +1 -0
- package/dist/foundations.js +299 -0
- package/dist/foundations.js.map +1 -0
- package/dist/navigation/context-menu.d.ts +8 -1
- package/dist/navigation/context-menu.d.ts.map +1 -1
- package/dist/navigation/context-menu.js +67 -50
- package/dist/navigation/context-menu.js.map +1 -1
- package/dist/navigation/navigation.d.ts +55 -7
- package/dist/navigation/navigation.d.ts.map +1 -1
- package/dist/navigation/navigation.js +167 -18
- package/dist/navigation/navigation.js.map +1 -1
- package/dist/operation.d.ts +12 -0
- package/dist/operation.d.ts.map +1 -0
- package/dist/operation.js +49 -0
- package/dist/operation.js.map +1 -0
- package/dist/primitives.d.ts +11 -1
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +164 -301
- package/dist/primitives.js.map +1 -1
- package/dist/reconcile.d.ts +11 -0
- package/dist/reconcile.d.ts.map +1 -0
- package/dist/reconcile.js +36 -0
- package/dist/reconcile.js.map +1 -0
- package/dist/select.d.ts +14 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +304 -0
- package/dist/select.js.map +1 -0
- package/dist/styles.css +452 -382
- package/dist/surface.d.ts +60 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +344 -0
- package/dist/surface.js.map +1 -0
- package/dist/tasks/approval.d.ts.map +1 -1
- package/dist/tasks/approval.js +86 -45
- package/dist/tasks/approval.js.map +1 -1
- package/dist/tasks/permission-element.d.ts +3 -0
- package/dist/tasks/permission-element.d.ts.map +1 -0
- package/dist/tasks/permission-element.js +10 -0
- package/dist/tasks/permission-element.js.map +1 -0
- package/dist/tasks/permission.d.ts +5 -3
- package/dist/tasks/permission.d.ts.map +1 -1
- package/dist/tasks/permission.js +47 -22
- package/dist/tasks/permission.js.map +1 -1
- package/dist/tasks/runtime.d.ts.map +1 -1
- package/dist/tasks/runtime.js +30 -13
- package/dist/tasks/runtime.js.map +1 -1
- package/dist/workspace.d.ts +58 -4
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +202 -44
- package/dist/workspace.js.map +1 -1
- package/package.json +1 -1
package/dist/files/panels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.js","sourceRoot":"","sources":["../../src/files/panels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAoB,MAAM,6BAA6B,CAAC;AAOnF,MAAM,UAAU,iBAAiB,CAAC,OAA0B;IAC1D,MAAM,UAAU,GAAG,mBAAmB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,OA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AC;gBAAC,KAAK,CAAC,KAAK,GAAG,kBAAkB,CAAC;gBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjH,CAAC;;gBAAM,IAAI,GAAG,kBAAkB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YAChG,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;gBAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBAAC,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC;gBAAC,IAAI,CAAC,WAAW,GAAG,0DAA0D,CAAC;gBAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAAC,CAAC;QAC3M,CAAC;QACD,OAAO,KAAW,IAAI,SAAS;YAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;KACnH,CAAC;AACJ,CAAC","sourcesContent":["import { dialogHeading, escape, icon, uniqueId, setText } from '../dom.js';\nimport type { UIBlock } from '../core.js';\nimport { createPagedPreview, type PreviewKind } from '../content/paged-preview.js';\n\nexport interface FileActionOptions {\n kind: string; ownerId: string; path: string; preview?: boolean;\n copyMode?: 'file' | 'path' | 'none';\n onAction?: (action: 'preview' | 'open' | 'reveal' | 'copy' | 'copy-path') => void;\n}\nexport function fileActionsMarkup(options: FileActionOptions): string {\n const attributes = `data-file-kind=\"${escape(options.kind)}\" data-file-owner=\"${escape(options.ownerId)}\" data-file-path=\"${escape(options.path)}\"`;\n const preview = options.preview ? `<button type=\"button\" class=\"pui-secondary-button\" data-preview-path=\"${escape(options.path)}\" data-preview-id=\"${escape(options.ownerId)}\">Preview</button>` : '';\n const copy = options.copyMode && options.copyMode !== 'none' ? `<button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"${options.copyMode === 'file' ? 'copy' : 'copy-path'}\">${options.copyMode === 'file' ? 'Copy file' : 'Copy path'}</button>` : '';\n return `<div class=\"pui-file-actions\">${preview}<button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"open\">Open</button><button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"reveal\">Reveal</button>${copy}</div>`;\n}\nexport function createFileActions(options: FileActionOptions) {\n const template = document.createElement('template');\n template.innerHTML = fileActionsMarkup(options);\n const element = template.content.firstElementChild as HTMLElement;\n const click = (event: Event) => {\n const target = (event.target as Element).closest<HTMLElement>('button');\n if (target && !(target as HTMLButtonElement).disabled) options.onAction?.(target.dataset.fileAction as 'open' | 'reveal' | 'copy' | 'copy-path' || 'preview');\n };\n if (options.onAction) element.addEventListener('click', click);\n return { element, destroy(): void { element.removeEventListener('click', click); element.remove(); } };\n}\n\nexport interface ArtifactPanelState { ownerId: string; files: readonly { name: string; path: string }[]; loading: boolean; error: string; copyMode: 'file' | 'path' }\nexport interface ArtifactPanelOptions { container: HTMLElement; control: HTMLElement; toggle: HTMLElement; count: HTMLElement; headingId?: string }\nexport function createArtifactPanel(options: ArtifactPanelOptions) {\n const { container: element, control, toggle, count } = options;\n element.innerHTML = `<div class=\"pui-artifacts-heading\"><h2${options.headingId ? ` id=\"${escape(options.headingId)}\"` : ''}>Files <span data-file-count></span></h2><button type=\"button\" class=\"pui-quiet-icon\" data-artifacts-close aria-label=\"Close files\">${icon('close')}</button></div><p class=\"pui-artifacts-status\" role=\"status\" hidden>Looking for files…</p><div class=\"pui-artifacts-content\"><div data-file-rows></div><p class=\"pui-form-error\" role=\"alert\" hidden></p></div>`;\n const total = element.querySelector<HTMLElement>('[data-file-count]')!;\n const loading = element.querySelector<HTMLElement>('[role=\"status\"]')!;\n const rows = element.querySelector<HTMLElement>('[data-file-rows]')!;\n const error = element.querySelector<HTMLElement>('[role=\"alert\"]')!;\n const entries = new Map<string, { element: HTMLElement; name: HTMLElement; copy: HTMLButtonElement }>();\n let open = false;\n let destroyed = false;\n function setOpen(value: boolean, restoreFocus = false): void {\n if (destroyed) return;\n open = value && !control.hidden;\n element.hidden = !open;\n toggle.setAttribute('aria-expanded', String(open));\n if (open) element.focus();\n else if (restoreFocus && !control.hidden) toggle.focus();\n }\n return {\n element, setOpen, get open() { return open; },\n update(state: Readonly<ArtifactPanelState>): void {\n if (destroyed) return;\n const focused = document.activeElement;\n control.hidden = !state.ownerId || (!state.files.length && !state.error);\n if (control.hidden) setOpen(false);\n const number = `${state.files.length} ${state.files.length === 1 ? 'file' : 'files'}`;\n const label = state.error ? 'Conversation files unavailable' : `Conversation files (${number})`;\n toggle.setAttribute('aria-label', label); toggle.title = label;\n count.textContent = state.files.length ? String(state.files.length) : '!';\n total.textContent = number;\n loading.hidden = !state.loading;\n error.hidden = !state.error;\n error.textContent = state.error;\n const keep = new Set(state.files.map(file => `${state.ownerId}/${file.path}`));\n for (const [key, entry] of entries) if (!keep.has(key)) { entry.element.remove(); entries.delete(key); }\n let cursor = rows.firstElementChild;\n for (const file of state.files) {\n const key = `${state.ownerId}/${file.path}`;\n let entry = entries.get(key);\n if (!entry) {\n const article = document.createElement('article'); article.className = 'pui-file-card';\n article.innerHTML = `${icon('file')}<div class=\"pui-file-info\"><strong></strong><span class=\"pui-file-path\">${escape(file.path)}</span></div>${fileActionsMarkup({ kind: 'artifact', ownerId: state.ownerId, path: file.path, preview: true, copyMode: state.copyMode })}`;\n entry = { element: article, name: article.querySelector('strong')!, copy: article.querySelector<HTMLButtonElement>('[data-file-action=\"copy\"], [data-file-action=\"copy-path\"]')! };\n entries.set(key, entry);\n }\n setText(entry.name, file.name);\n const copyAction = state.copyMode === 'file' ? 'copy' : 'copy-path';\n if (entry.copy.dataset.fileAction !== copyAction) entry.copy.dataset.fileAction = copyAction;\n if (entry.copy.dataset.copyPending !== 'true') setText(entry.copy, state.copyMode === 'file' ? 'Copy file' : 'Copy path');\n if (entry.element !== cursor) rows.insertBefore(entry.element, cursor);\n cursor = entry.element.nextElementSibling;\n }\n if (focused instanceof HTMLElement && element.contains(focused) && document.activeElement !== focused) focused.focus({ preventScroll: true });\n },\n destroy(): void { destroyed = true; entries.clear(); element.replaceChildren(); },\n };\n}\n\nexport interface ResourceDisplayEntry { name: string; path: string; description?: string; content?: string; fileActions?: Node; actions?: Node }\nexport interface ResourcesPanelState {\n instructions: readonly ResourceDisplayEntry[]; skills: readonly ResourceDisplayEntry[]; templates: readonly ResourceDisplayEntry[];\n diagnostics: readonly string[]; createInstructions?: Node;\n}\nexport interface ResourcesPanelOptions { container?: HTMLElement; titleId?: string; dialogId?: string; listId?: string; errorId?: string; onClose?: () => void }\nexport function createResourcesPanel(options: ResourcesPanelOptions = {}) {\n const element = options.container || document.createElement('div');\n const ids = { titleId: options.titleId || uniqueId('pui-resources-title'), dialogId: options.dialogId || uniqueId('pui-resources-dialog'), listId: options.listId || uniqueId('pui-resources-list'), errorId: options.errorId || uniqueId('pui-resources-error') };\n const close = (event: Event) => {\n if (!(event.target as Element).closest('[data-close]')) return;\n if (options.onClose) options.onClose();\n else { const dialog = element.closest('dialog'); if (dialog?.open) dialog.close(); else element.hidden = true; }\n };\n element.addEventListener('click', close);\n let list: HTMLElement | undefined, error: HTMLElement | undefined;\n let destroyed = false;\n function row(entry: ResourceDisplayEntry, type: 'instructions' | 'skill' | 'template'): HTMLElement {\n const outer = document.createElement('article'); outer.className = type === 'instructions' ? 'pui-resource-card' : 'pui-file-card';\n const body = type === 'instructions' ? document.createElement('div') : outer;\n if (type === 'instructions') body.className = 'pui-file-card';\n body.innerHTML = `${type === 'template' ? '' : icon('file')}<div class=\"pui-file-info\"><strong>${escape(entry.name)}</strong>${type !== 'instructions' ? `<p>${escape(entry.description || '')}</p>` : ''}<span class=\"pui-file-path\">${escape(entry.path)}</span></div>`;\n if (entry.fileActions) body.append(entry.fileActions);\n if (entry.actions) body.append(entry.actions);\n if (type === 'instructions') { outer.append(body); const details = document.createElement('details'); details.className = 'pui-resource-preview'; details.innerHTML = `<summary>View instructions</summary><pre>${escape(entry.content || '')}</pre>`; outer.append(details); }\n return outer;\n }\n return {\n element,\n open(workspaceName: string, toolbar: Node): void {\n if (destroyed) return;\n element.hidden = false;\n element.innerHTML = `${dialogHeading('Workspace resources', ids.titleId, ids.dialogId, workspaceName)}<p class=\"pui-modal-description\">Instructions, skills and prompt templates are loaded by Pith for each task. Edit them here or open their Markdown files.</p><div class=\"pui-feature-toolbar\" data-resources-toolbar></div><div id=\"${escape(ids.listId)}\" data-resources-list><p class=\"pui-feature-hint\">Loading workspace resources…</p></div><div id=\"${escape(ids.errorId)}\" data-resources-error class=\"pui-form-error\" role=\"alert\"></div>`;\n element.querySelector('[data-resources-toolbar]')!.append(toolbar);\n list = element.querySelector<HTMLElement>('[data-resources-list]')!;\n error = element.querySelector<HTMLElement>('[data-resources-error]')!;\n },\n setError(message: string): void { if (!destroyed && error) error.textContent = message; },\n update(state: Readonly<ResourcesPanelState>): void {\n if (destroyed || !list) return;\n list.replaceChildren();\n for (const [title, entries, type, empty] of [\n ['Instructions', state.instructions, 'instructions', 'No workspace instructions found.'],\n ['Skills', state.skills, 'skill', 'No skills found. Add .pi/skills/<skill-name>/SKILL.md in this workspace, then refresh.'],\n ['Prompt templates', state.templates, 'template', 'No prompt templates yet.'],\n ] as const) {\n const section = document.createElement('section'); section.className = 'pui-resource-section';\n const heading = document.createElement('h3'); heading.textContent = title; section.append(heading);\n if (entries.length) entries.forEach((entry) => section.append(row(entry, type)));\n else { const hint = document.createElement('p'); hint.className = 'pui-feature-hint'; hint.textContent = empty; section.append(hint); }\n if (type === 'instructions' && state.createInstructions) section.append(state.createInstructions);\n list.append(section);\n }\n if (state.diagnostics.length) {\n const section = document.createElement('section'); section.className = 'pui-resource-section pui-resource-diagnostics';\n section.innerHTML = `<h3>Resource notes</h3>${state.diagnostics.map((note) => `<p>${escape(note)}</p>`).join('')}`;\n list.append(section);\n }\n },\n destroy(): void { destroyed = true; element.removeEventListener('click', close); element.replaceChildren(); },\n };\n}\n\nexport interface FilePreviewState { kind: PreviewKind | 'image'; text?: string; imageSrc?: string; imageAlt?: string; truncated?: boolean; error?: string }\nexport interface FilePreviewOptions { container?: HTMLElement; titleId?: string; dialogId?: string; bodyId?: string; onClose?: () => void }\nexport function createFilePreview(options: FilePreviewOptions = {}) {\n const element = options.container || document.createElement('div');\n const ids = { titleId: options.titleId || uniqueId('pui-preview-title'), dialogId: options.dialogId || uniqueId('pui-preview-dialog'), bodyId: options.bodyId || uniqueId('pui-preview-body') };\n const close = (event: Event) => {\n if (!(event.target as Element).closest('[data-close]')) return;\n if (options.onClose) options.onClose();\n else { const dialog = element.closest('dialog'); if (dialog?.open) dialog.close(); else element.hidden = true; }\n };\n element.addEventListener('click', close);\n let body: HTMLElement | undefined;\n let page: UIBlock<{ text: string; kind: PreviewKind }> | undefined;\n let destroyed = false;\n function clear(): void { page?.destroy(); page = undefined; element.replaceChildren(); body = undefined; }\n return {\n element, clear,\n open(input: { name: string; path: string; actions: Node }): void {\n if (destroyed) return;\n clear();\n element.hidden = false;\n element.innerHTML = `${dialogHeading(input.name, ids.titleId, ids.dialogId, 'File preview')}<p class=\"pui-file-preview-path\">${escape(input.path)}</p><div id=\"${escape(ids.bodyId)}\" data-file-preview-body class=\"pui-file-preview-body\" aria-live=\"polite\">Loading preview…</div><div class=\"pui-file-preview-actions\"></div>`;\n element.querySelector('.pui-file-preview-actions')!.append(input.actions);\n body = element.querySelector<HTMLElement>('[data-file-preview-body]')!;\n },\n update(state: Readonly<FilePreviewState>): void {\n if (destroyed || !body) return;\n page?.destroy(); page = undefined; body.replaceChildren();\n if (state.error) body.textContent = state.error;\n else if (state.kind === 'image') {\n const image = document.createElement('img'); image.className = 'pui-file-preview-image';\n image.src = state.imageSrc || ''; image.alt = state.imageAlt || '';\n image.setAttribute('role', 'button'); image.tabIndex = 0; image.title = 'Click to enlarge'; body.append(image);\n } else page = createPagedPreview({ container: body, text: state.text || '', kind: state.kind });\n if (state.truncated) { const note = document.createElement('p'); note.className = 'pui-preview-note'; note.textContent = 'Showing the first 8 MiB. Use Open for the complete file.'; body.append(note); }\n },\n destroy(): void { if (destroyed) return; clear(); element.removeEventListener('click', close); destroyed = true; },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panels.js","sourceRoot":"","sources":["../../src/files/panels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAoB,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOjD,MAAM,UAAU,iBAAiB,CAAC,OAA0B;IAC1D,MAAM,KAAK,GAAG,oBAAoB,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,wBAAwB,KAAK,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;IAChJ,MAAM,UAAU,GAAG,GAAG,KAAK,oBAAoB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;IAC7J,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,sDAAsD,KAAK,uBAAuB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC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;gBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;oBAAC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;oBAAC,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC;oBAAC,IAAI,CAAC,WAAW,GAAG,0DAA0D,CAAC;gBAAC,CAAC;gBACtK,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI;oBAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,EAAE,CAAC;gBAAC,IAAI,GAAG,SAAS,CAAC;YAAC,CAAC;QAC9C,CAAC;QACD,OAAO,KAAW,IAAI,SAAS;YAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;KACvF,CAAC;AACJ,CAAC","sourcesContent":["import { dialogHeading, escape, icon, uniqueId, setText } from '../dom.js';\nimport type { UIBlock } from '../core.js';\nimport { createPagedPreview, type PreviewKind } from '../content/paged-preview.js';\nimport { adoptProductParts } from '../foundations.js';\nimport { createButton } from '../primitives.js';\nimport { bindContentClose, installAnchoredSurface } from '../surface.js';\nimport { reconcileKeyed } from '../reconcile.js';\n\nexport interface FileActionOptions {\n kind: string; ownerId: string; path: string; preview?: boolean;\n copyMode?: 'file' | 'path' | 'none';\n onAction?: (action: 'preview' | 'open' | 'reveal' | 'copy' | 'copy-path') => void;\n}\nexport function fileActionsMarkup(options: FileActionOptions): string {\n const scope = `data-idle-action ${options.kind === 'resource' ? 'data-idle-workspace' : 'data-idle-conversation'}=\"${escape(options.ownerId)}\"`;\n const attributes = `${scope} data-file-kind=\"${escape(options.kind)}\" data-file-owner=\"${escape(options.ownerId)}\" data-file-path=\"${escape(options.path)}\"`;\n const preview = options.preview ? `<button type=\"button\" class=\"pui-secondary-button\" ${scope} data-preview-path=\"${escape(options.path)}\" data-preview-id=\"${escape(options.ownerId)}\">Preview</button>` : '';\n const copy = options.copyMode && options.copyMode !== 'none' ? `<button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"${options.copyMode === 'file' ? 'copy' : 'copy-path'}\">${options.copyMode === 'file' ? 'Copy file' : 'Copy path'}</button>` : '';\n return `<div class=\"pui-file-actions\">${preview}<button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"open\">Open</button><button type=\"button\" class=\"pui-secondary-button\" ${attributes} data-file-action=\"reveal\">Reveal</button>${copy}</div>`;\n}\nexport function createFileActions(options: FileActionOptions) {\n const template = document.createElement('template');\n template.innerHTML = fileActionsMarkup(options);\n const element = template.content.firstElementChild as HTMLElement;\n const parts = adoptProductParts(element);\n let destroyed = false;\n const click = (event: Event) => {\n const target = (event.target as Element).closest<HTMLElement>('button');\n if (target && element.contains(target) && !(target as HTMLButtonElement).disabled) {\n event.stopPropagation(); options.onAction?.(target.dataset.fileAction as 'open' | 'reveal' | 'copy' | 'copy-path' || 'preview');\n }\n };\n if (options.onAction) element.addEventListener('click', click);\n return {\n element,\n setDisabled(disabled: boolean): void { if (!destroyed) for (const button of element.querySelectorAll('button')) parts.action(button).update({disabled}); },\n destroy(): void { if (destroyed) return; destroyed = true; parts.destroy(); element.removeEventListener('click', click); element.remove(); },\n };\n}\n\nexport interface ArtifactPanelState { ownerId: string; files: readonly { name: string; path: string }[]; loading: boolean; error: string; copyMode: 'file' | 'path' }\nexport interface ArtifactPanelOptions { container: HTMLElement; control: HTMLElement; toggle: HTMLElement; count: HTMLElement; headingId?: string; dismissExclusions?: readonly HTMLElement[] }\nexport function createArtifactPanel(options: ArtifactPanelOptions) {\n const { container: element, control, toggle, count } = options;\n element.innerHTML = `<div class=\"pui-artifacts-heading\"><h2${options.headingId ? ` id=\"${escape(options.headingId)}\"` : ''}>Files <span data-file-count></span></h2><button type=\"button\" class=\"pui-quiet-icon\" data-artifacts-close aria-label=\"Close files\">${icon('close')}</button></div><p class=\"pui-artifacts-status\" role=\"status\" hidden>Looking for files…</p><div class=\"pui-artifacts-content\"><div data-file-rows></div><p class=\"pui-form-error\" role=\"alert\" hidden></p></div>`;\n const total = element.querySelector<HTMLElement>('[data-file-count]')!;\n const loading = element.querySelector<HTMLElement>('[role=\"status\"]')!;\n const rows = element.querySelector<HTMLElement>('[data-file-rows]')!;\n const error = element.querySelector<HTMLElement>('[role=\"alert\"]')!;\n const parts = adoptProductParts(element);\n const entries = new Map<string, { element: HTMLElement; name: HTMLElement; copy: HTMLButtonElement }>();\n let destroyed = false;\n const surface = installAnchoredSurface({\n trigger: toggle,\n panel: element,\n position: false,\n closeOnFocusOut: true,\n exclusions: [control, ...(options.dismissExclusions ?? [])],\n canOpen: () => !control.hidden,\n canEscape: () => !document.querySelector('dialog[open]'),\n onToggle(open) { if (open) element.focus(); },\n });\n function setOpen(value: boolean, restoreFocus = false): void {\n if (destroyed) return;\n if (value) surface.open();\n else surface.close(restoreFocus && !control.hidden);\n }\n const abort = new AbortController();\n toggle.addEventListener('click', () => setOpen(!surface.isOpen()), { signal: abort.signal });\n element.addEventListener('click', event => { if ((event.target as Element).closest('[data-artifacts-close]')) setOpen(false, true); }, { signal: abort.signal });\n return {\n element, setOpen, get open() { return surface.isOpen(); },\n update(state: Readonly<ArtifactPanelState>): void {\n if (destroyed) return;\n control.hidden = !state.ownerId || (!state.files.length && !state.error);\n if (control.hidden) setOpen(false);\n const number = `${state.files.length} ${state.files.length === 1 ? 'file' : 'files'}`;\n const label = state.error ? 'Conversation files unavailable' : `Conversation files (${number})`;\n toggle.setAttribute('aria-label', label); toggle.title = label;\n count.textContent = state.files.length ? String(state.files.length) : '!';\n total.textContent = number;\n loading.hidden = !state.loading;\n error.hidden = !state.error;\n parts.feedback(error).update({ message: state.error, tone: 'error' });\n reconcileKeyed(rows, entries, state.files, {\n key: file => `${state.ownerId}/${file.path}`,\n element: entry => entry.element,\n create(file) {\n const article = document.createElement('article'); article.className = 'pui-file-card';\n article.innerHTML = `${icon('file')}<div class=\"pui-file-info\"><strong></strong><span class=\"pui-file-path\">${escape(file.path)}</span></div>${fileActionsMarkup({ kind: 'artifact', ownerId: state.ownerId, path: file.path, preview: true, copyMode: state.copyMode })}`;\n return { element: article, name: article.querySelector('strong')!, copy: article.querySelector<HTMLButtonElement>('[data-file-action=\"copy\"], [data-file-action=\"copy-path\"]')! };\n },\n update(entry, file) {\n setText(entry.name, file.name);\n const copyAction = state.copyMode === 'file' ? 'copy' : 'copy-path';\n if (entry.copy.dataset.fileAction !== copyAction) entry.copy.dataset.fileAction = copyAction;\n if (entry.copy.dataset.copyPending !== 'true') setText(entry.copy, state.copyMode === 'file' ? 'Copy file' : 'Copy path');\n },\n destroy() {},\n });\n parts.update();\n },\n destroy(): void { destroyed = true; surface.destroy(); abort.abort(); parts.destroy(); entries.clear(); element.replaceChildren(); },\n };\n}\n\nexport interface ResourceDisplayEntry { name: string; path: string; description?: string; content?: string; fileActions?: Node; actions?: Node }\nexport interface ResourcesPanelState {\n instructions: readonly ResourceDisplayEntry[]; skills: readonly ResourceDisplayEntry[]; templates: readonly ResourceDisplayEntry[];\n diagnostics: readonly string[]; createInstructions?: Node; canCreateInstructions?: boolean;\n}\nexport interface ResourcesPanelOptions { container?: HTMLElement; titleId?: string; dialogId?: string; listId?: string; errorId?: string; onClose?: () => void; onRefresh?: () => void; onCreate?: (kind: 'instructions' | 'skill' | 'template') => void }\nexport function createResourcesPanel(options: ResourcesPanelOptions = {}) {\n const element = options.container || document.createElement('div');\n const ids = { titleId: options.titleId || uniqueId('pui-resources-title'), dialogId: options.dialogId || uniqueId('pui-resources-dialog'), listId: options.listId || uniqueId('pui-resources-list'), errorId: options.errorId || uniqueId('pui-resources-error') };\n const close = bindContentClose(element, { dialogId: ids.dialogId, onClose: options.onClose });\n let list: HTMLElement | undefined, error: HTMLElement | undefined;\n let destroyed = false;\n const parts = adoptProductParts(element);\n const buttons: ReturnType<typeof createButton>[] = [];\n const rowButtons: ReturnType<typeof createButton>[] = [];\n type Slot = { source?: Node; nodes: ChildNode[] };\n type ResourceRow = { element: HTMLElement; body?: HTMLElement; name?: HTMLElement; description?: HTMLElement; path?: HTMLElement; content?: HTMLElement; slots?: [Slot, Slot] };\n type Section = { element: HTMLElement; rows: Map<string, ResourceRow>; create: Slot };\n const sections = new Map<string, Section>();\n let diagnostics: Section | undefined;\n let instructionButton: ReturnType<typeof createButton> | undefined;\n const createActions = new Map<ReturnType<typeof createButton>,string>(); let createDisabled = false;\n const button = (label: string, onAction: () => void, row = false, create = false) => { const block = createButton({label,appearance:'secondary',onAction,disabled:create && createDisabled}); (row ? rowButtons : buttons).push(block); if (create) createActions.set(block,label); return block.element; };\n const clearButtons = (list = buttons) => { for (const block of list.splice(0)) {createActions.delete(block); block.destroy();} };\n function updateSlot(parent: HTMLElement, slot: Slot, source?: Node): void {\n if (slot.source === source) return;\n for (const node of slot.nodes) if (node.parentNode === parent) node.remove();\n slot.source = source;\n slot.nodes = source ? source instanceof DocumentFragment ? [...source.childNodes] : [source as ChildNode] : [];\n }\n function row(type: 'instructions' | 'skill' | 'template'): ResourceRow {\n const outer = document.createElement('article'); outer.className = type === 'instructions' ? 'pui-resource-card' : 'pui-file-card';\n const body = type === 'instructions' ? document.createElement('div') : outer;\n if (type === 'instructions') body.className = 'pui-file-card';\n body.innerHTML = `${type === 'template' ? '' : icon('file')}<div class=\"pui-file-info\"><strong></strong>${type !== 'instructions' ? '<p></p>' : ''}<span class=\"pui-file-path\"></span></div>`;\n let content: HTMLElement | undefined;\n if (type === 'instructions') { outer.append(body); const details = document.createElement('details'); details.className = 'pui-resource-preview'; details.innerHTML = '<summary>View instructions</summary><pre></pre>'; outer.append(details); content = details.querySelector('pre')!; }\n return { element: outer, body, name: body.querySelector('strong')!, description: body.querySelector('p') || undefined, path: body.querySelector<HTMLElement>('.pui-file-path')!, content, slots: [{nodes:[]}, {nodes:[]}] };\n }\n function updateRow(row: ResourceRow, entry: ResourceDisplayEntry): void {\n setText(row.name!, entry.name); setText(row.path!, entry.path);\n if (row.description) setText(row.description, entry.description || '');\n if (row.content) setText(row.content, entry.content || '');\n updateSlot(row.body!, row.slots![0], entry.fileActions); updateSlot(row.body!, row.slots![1], entry.actions);\n let cursor = row.body!.querySelector('.pui-file-info')!.nextSibling;\n for (const node of row.slots!.flatMap(slot => slot.nodes)) {\n if (node !== cursor) row.body!.insertBefore(node, cursor);\n cursor = node.nextSibling;\n }\n }\n function section(): Section {\n const element = document.createElement('section'); element.className = 'pui-resource-section';\n return {element, rows:new Map(), create:{nodes:[]}};\n }\n return {\n element,\n open(workspaceName: string, toolbar?: Node): void {\n if (destroyed) return;\n clearButtons();\n clearButtons(rowButtons);\n instructionButton = undefined; sections.clear(); diagnostics = undefined;\n element.hidden = false;\n element.innerHTML = `${dialogHeading('Workspace resources', ids.titleId, ids.dialogId, workspaceName)}<p class=\"pui-modal-description\">Instructions, skills and prompt templates are loaded by Pith for each task. Edit them here or open their Markdown files.</p><div class=\"pui-feature-toolbar\" data-resources-toolbar></div><div id=\"${escape(ids.listId)}\" data-resources-list><p class=\"pui-feature-hint\">Loading workspace resources…</p></div><div id=\"${escape(ids.errorId)}\" data-resources-error class=\"pui-form-error\" role=\"alert\"></div>`;\n const actions = element.querySelector<HTMLElement>('[data-resources-toolbar]')!;\n if (toolbar) actions.append(toolbar);\n else actions.append(button('Refresh', () => options.onRefresh?.()), button('Add skill', () => options.onCreate?.('skill'),false,true), button('Add prompt template', () => options.onCreate?.('template'),false,true));\n list = element.querySelector<HTMLElement>('[data-resources-list]')!;\n error = element.querySelector<HTMLElement>('[data-resources-error]')!;\n parts.layout(actions, 'toolbar').update({});\n },\n setError(message: string): void { if (!destroyed && error) parts.feedback(error).update({ message, tone: 'error' }); },\n setCreateDisabled(disabled: boolean): void {if (destroyed) return; createDisabled = disabled; for (const [block,label] of createActions) block.update({label,appearance:'secondary',disabled});},\n update(state: Readonly<ResourcesPanelState>): void {\n if (destroyed || !list) return;\n if (!sections.size) list.replaceChildren();\n for (const [title, entries, type, empty] of [\n ['Instructions', state.instructions, 'instructions', 'No workspace instructions found.'],\n ['Skills', state.skills, 'skill', 'No skills found. Add .pi/skills/<skill-name>/SKILL.md in this workspace, then refresh.'],\n ['Prompt templates', state.templates, 'template', 'No prompt templates yet.'],\n ] as const) {\n let current = sections.get(type);\n if (!current) { current = section(); sections.set(type, current); list.append(current.element); }\n type Item = { key: string; kind: 'heading' | 'empty' | 'entry'; entry?: ResourceDisplayEntry };\n const items: Item[] = [{key:'heading', kind:'heading'}, ...entries.map(entry => ({key:`entry:${entry.path}`, kind:'entry' as const, entry}))];\n if (!entries.length) items.push({key:'empty', kind:'empty'});\n reconcileKeyed(current.element, current.rows, items, {\n key: item => item.key, element: row => row.element,\n create(item) {\n if (item.kind === 'entry') return row(type);\n const element = document.createElement(item.kind === 'heading' ? 'h3' : 'p');\n if (item.kind === 'empty') element.className = 'pui-feature-hint';\n return {element};\n },\n update(row, item) { if (item.entry) updateRow(row, item.entry); else setText(row.element, item.kind === 'heading' ? title : empty); },\n destroy() {},\n });\n if (type === 'instructions') {\n let create = state.createInstructions;\n if (!create && state.canCreateInstructions) {\n if (!instructionButton) {\n const element = button('Create AGENTS.md in this workspace', () => options.onCreate?.('instructions'), true, true);\n instructionButton = rowButtons.find(block => block.element === element)!;\n }\n create = instructionButton.element;\n }\n updateSlot(current.element, current.create, create);\n for (const node of current.create.nodes) if (node.parentNode !== current.element) current.element.append(node);\n }\n }\n if (state.diagnostics.length) {\n if (!diagnostics) { diagnostics = section(); diagnostics.element.classList.add('pui-resource-diagnostics'); list.append(diagnostics.element); }\n reconcileKeyed(diagnostics.element, diagnostics.rows, [{key:'heading', text:'Resource notes'}, ...state.diagnostics.map((text,index) => ({key:`note:${index}`, text}))], {\n key: value => value.key, element: row => row.element,\n create(value) { return {element:document.createElement(value.key === 'heading' ? 'h3' : 'p')}; },\n update(row, value) {setText(row.element, value.text);}, destroy() {},\n });\n } else if (diagnostics) { diagnostics.element.remove(); diagnostics = undefined; }\n parts.update();\n },\n destroy(): void { if (destroyed) return; destroyed = true; clearButtons(); clearButtons(rowButtons); sections.clear(); diagnostics = undefined; parts.destroy(); close.destroy(); element.replaceChildren(); },\n };\n}\n\nexport interface FilePreviewState { kind: PreviewKind | 'image'; text?: string; imageSrc?: string; imageAlt?: string; truncated?: boolean; error?: string }\nexport interface FilePreviewOptions { container?: HTMLElement; titleId?: string; dialogId?: string; bodyId?: string; onClose?: () => void; onCopyCode?: (text: string, button: HTMLButtonElement) => void }\nexport function createFilePreview(options: FilePreviewOptions = {}) {\n const element = options.container || document.createElement('div');\n const ids = { titleId: options.titleId || uniqueId('pui-preview-title'), dialogId: options.dialogId || uniqueId('pui-preview-dialog'), bodyId: options.bodyId || uniqueId('pui-preview-body') };\n const close = bindContentClose(element, { dialogId: ids.dialogId, onClose: options.onClose });\n let body: HTMLElement | undefined;\n let page: UIBlock<{ text: string; kind: PreviewKind }> | undefined;\n let image: HTMLImageElement | undefined;\n let note: HTMLElement | undefined;\n let mode: FilePreviewState['kind'] | 'error' | undefined;\n let destroyed = false;\n function clear(): void {\n if (destroyed) return;\n page?.destroy(); page = undefined; image = undefined; note = undefined; mode = undefined;\n element.replaceChildren(); body = undefined;\n }\n return {\n element, clear,\n open(input: { name: string; path: string; actions: Node }): void {\n if (destroyed) return;\n clear();\n element.hidden = false;\n element.innerHTML = `${dialogHeading(input.name, ids.titleId, ids.dialogId, 'File preview')}<p class=\"pui-file-preview-path\">${escape(input.path)}</p><div id=\"${escape(ids.bodyId)}\" data-file-preview-body class=\"pui-file-preview-body\" aria-live=\"polite\">Loading preview…</div><div class=\"pui-file-preview-actions\"></div>`;\n element.querySelector('.pui-file-preview-actions')!.append(input.actions);\n body = element.querySelector<HTMLElement>('[data-file-preview-body]')!;\n },\n update(state: Readonly<FilePreviewState>): void {\n if (destroyed || !body) return;\n const nextMode = state.error ? 'error' : state.kind;\n if (mode !== nextMode) {\n page?.destroy(); page = undefined; image = undefined; note = undefined;\n body.replaceChildren(); mode = nextMode;\n }\n if (state.error) setText(body, state.error);\n else if (state.kind === 'image') {\n if (!image) {\n image = document.createElement('img'); image.className = 'pui-file-preview-image';\n image.setAttribute('role', 'button'); image.tabIndex = 0; image.title = 'Click to enlarge'; body.append(image);\n }\n if (image.getAttribute('src') !== (state.imageSrc || '')) image.src = state.imageSrc || '';\n if (image.alt !== (state.imageAlt || '')) image.alt = state.imageAlt || '';\n } else if (page) page.update({ text: state.text || '', kind: state.kind });\n else page = createPagedPreview({ container: body, text: state.text || '', kind: state.kind, onCopyCode: options.onCopyCode });\n if (state.truncated) {\n if (!note) { note = document.createElement('p'); note.className = 'pui-preview-note'; note.textContent = 'Showing the first 8 MiB. Use Open for the complete file.'; }\n if (note.parentElement !== body) body.append(note);\n } else { note?.remove(); note = undefined; }\n },\n destroy(): void { if (destroyed) return; clear(); close.destroy(); destroyed = true; },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/files/systems.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/files/systems.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAO1C,MAAM,WAAW,kBAAkB;IAAG,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AAC9L,wBAAgB,UAAU,CAAC,IAAI,EAAE,kBAAkB,GAAG,SAAS,EAAE,UAAU,UAAQ,GAAG,MAAM,CAO3F;AACD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,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
|
3
|
+
import { reconcileKeyed } from '../reconcile.js';
|
|
2
4
|
const currency = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2, maximumFractionDigits: 6 });
|
|
3
5
|
const numbers = new Intl.NumberFormat();
|
|
4
6
|
export function formatCost(cost, latestTask = false) {
|
|
@@ -52,47 +54,30 @@ export function createCostLedger(options = {}) {
|
|
|
52
54
|
update(report) {
|
|
53
55
|
if (destroyed)
|
|
54
56
|
return;
|
|
55
|
-
const focused = document.activeElement;
|
|
56
57
|
ensure();
|
|
57
58
|
setText(note, `USD estimates for recorded requests, not a provider bill. Prices are saved per request; retries and context summaries are included when usage is reported. ${report.unknownRequests ? `${report.unknownRequests} request(s) have unknown prices or usage and are excluded. ` : ''}Older requests made before recording began are not reconstructed.`);
|
|
58
59
|
const requests = report.requests || [];
|
|
59
|
-
const keep = new Set(requests.map(request => request.id));
|
|
60
|
-
for (const [id, row] of rows)
|
|
61
|
-
if (!keep.has(id)) {
|
|
62
|
-
row.element.remove();
|
|
63
|
-
rows.delete(id);
|
|
64
|
-
}
|
|
65
|
-
if (!requests.length) {
|
|
66
|
-
if (!empty.parentElement)
|
|
67
|
-
table.append(empty);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
60
|
empty.remove();
|
|
71
|
-
let cursor = table.firstElementChild;
|
|
72
61
|
const n = (value) => numbers.format(value || 0);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
row
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
cursor = row.element.nextElementSibling;
|
|
93
|
-
}
|
|
94
|
-
if (focused instanceof HTMLElement && element.contains(focused) && document.activeElement !== focused)
|
|
95
|
-
focused.focus({ preventScroll: true });
|
|
62
|
+
reconcileKeyed(table, rows, requests, {
|
|
63
|
+
key: request => request.id, element: row => row.element, create: request => makeRow(request.id),
|
|
64
|
+
update(row, request) {
|
|
65
|
+
setText(row.purpose, `${request.purpose} · ${request.status}`);
|
|
66
|
+
setText(row.identity, `${request.providerName || request.provider} / ${request.modelName || request.model}`);
|
|
67
|
+
setText(row.time, request.time);
|
|
68
|
+
setText(row.source, request.source);
|
|
69
|
+
setText(row.price, JSON.stringify(request.price, null, 2));
|
|
70
|
+
row.reasoning.hidden = request.usage.reasoning == null;
|
|
71
|
+
setText(row.reasoning, request.usage.reasoning == null ? '' : `Reasoning tokens: ${n(request.usage.reasoning)} (included in output)`);
|
|
72
|
+
setText(row.cells[1], n(request.usage.input));
|
|
73
|
+
setText(row.cells[2], n(request.usage.output));
|
|
74
|
+
setText(row.cells[3], `${n(request.usage.cacheRead)} / ${n(request.usage.cacheWrite)}`);
|
|
75
|
+
setText(row.cells[4], request.known ? currency.format(request.usage.cost.total) : 'Unknown');
|
|
76
|
+
},
|
|
77
|
+
destroy() { },
|
|
78
|
+
});
|
|
79
|
+
if (!requests.length)
|
|
80
|
+
table.append(empty);
|
|
96
81
|
},
|
|
97
82
|
destroy() { if (!destroyed)
|
|
98
83
|
clear(); destroyed = true; },
|
|
@@ -107,6 +92,7 @@ export function createUpdatePanel(options = {}) {
|
|
|
107
92
|
const check = element.querySelector('[data-update-check]');
|
|
108
93
|
const install = element.querySelector('[data-update-install]');
|
|
109
94
|
const progress = element.querySelector('progress');
|
|
95
|
+
const parts = adoptProductParts(element);
|
|
110
96
|
let state;
|
|
111
97
|
let pending = false, destroyed = false;
|
|
112
98
|
let error = '';
|
|
@@ -118,17 +104,17 @@ export function createUpdatePanel(options = {}) {
|
|
|
118
104
|
if (destroyed)
|
|
119
105
|
return;
|
|
120
106
|
if (!state) {
|
|
121
|
-
check.
|
|
122
|
-
|
|
107
|
+
parts.action(check).update({ pending });
|
|
108
|
+
parts.action(install).update({ pending });
|
|
109
|
+
parts.feedback(message).update({ message: error, tone: 'info' });
|
|
123
110
|
return;
|
|
124
111
|
}
|
|
125
112
|
version.textContent = `${options.productName || 'Application'} ${state.version}`;
|
|
126
|
-
message.
|
|
113
|
+
parts.feedback(message).update({ message: error || state.message, tone: 'info' });
|
|
127
114
|
const busy = ['checking', 'installing', 'restarting'].includes(state.phase);
|
|
128
|
-
check.disabled
|
|
115
|
+
parts.action(check).update({ disabled: !state.enabled || (busy && !retryCheck), pending });
|
|
129
116
|
install.hidden = !state.availableVersion;
|
|
130
|
-
install.disabled
|
|
131
|
-
install.textContent = 'Update and restart';
|
|
117
|
+
parts.action(install).update({ disabled: !state.enabled || busy, pending, label: 'Update and restart' });
|
|
132
118
|
progress.hidden = state.phase !== 'installing';
|
|
133
119
|
progress.value = state.progress;
|
|
134
120
|
}
|
|
@@ -142,7 +128,7 @@ export function createUpdatePanel(options = {}) {
|
|
|
142
128
|
render();
|
|
143
129
|
} },
|
|
144
130
|
destroy() { if (destroyed)
|
|
145
|
-
return; destroyed = true; check.removeEventListener('click', checkAction); install.removeEventListener('click', installAction); },
|
|
131
|
+
return; destroyed = true; parts.destroy(); check.removeEventListener('click', checkAction); install.removeEventListener('click', installAction); },
|
|
146
132
|
};
|
|
147
133
|
}
|
|
148
134
|
export function historyStatusMarkup(status) {
|
|
@@ -156,6 +142,7 @@ export function historyStatusMarkup(status) {
|
|
|
156
142
|
}
|
|
157
143
|
export function createCompletionNotices(options = {}) {
|
|
158
144
|
const element = options.container || document.createElement('div');
|
|
145
|
+
const parts = adoptProductParts(element);
|
|
159
146
|
const entries = new Map();
|
|
160
147
|
let destroyed = false;
|
|
161
148
|
const click = (event) => {
|
|
@@ -174,83 +161,86 @@ export function createCompletionNotices(options = {}) {
|
|
|
174
161
|
update(notices) {
|
|
175
162
|
if (destroyed)
|
|
176
163
|
return;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (!keep.has(id)) {
|
|
181
|
-
entry.element.remove();
|
|
182
|
-
entries.delete(id);
|
|
183
|
-
}
|
|
184
|
-
let cursor = element.firstElementChild;
|
|
185
|
-
for (const notice of notices) {
|
|
186
|
-
let entry = entries.get(notice.runID);
|
|
187
|
-
if (!entry) {
|
|
164
|
+
reconcileKeyed(element, entries, notices, {
|
|
165
|
+
key: notice => notice.runID, element: entry => entry.element,
|
|
166
|
+
create() {
|
|
188
167
|
const article = document.createElement('article');
|
|
189
168
|
article.className = 'pui-completion-notice';
|
|
190
169
|
article.innerHTML = `<span class="pui-completion-check" aria-hidden="true">${icon('check')}</span><div class="pui-completion-content"><strong>Task completed</strong><p></p><button class="pui-text-button" type="button" data-conversation>Open conversation</button></div><button class="pui-quiet-icon pui-completion-dismiss" type="button" data-dismiss-completion aria-label="Dismiss completion notification">${icon('close')}</button>`;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
entry.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
170
|
+
return { element: article, text: article.querySelector('p'), open: article.querySelector('[data-conversation]'), dismiss: article.querySelector('[data-dismiss-completion]') };
|
|
171
|
+
},
|
|
172
|
+
update(entry, notice) {
|
|
173
|
+
setText(entry.text, `${notice.workspace} · ${notice.title}`);
|
|
174
|
+
parts.action(entry.open).update({ label: 'Open conversation' });
|
|
175
|
+
parts.action(entry.dismiss).update({ label: 'Dismiss completion notification' });
|
|
176
|
+
if (entry.open.dataset.conversation !== notice.id)
|
|
177
|
+
entry.open.dataset.conversation = notice.id;
|
|
178
|
+
if (entry.dismiss.dataset.dismissCompletion !== notice.runID)
|
|
179
|
+
entry.dismiss.dataset.dismissCompletion = notice.runID;
|
|
180
|
+
},
|
|
181
|
+
destroy() { },
|
|
182
|
+
});
|
|
183
|
+
parts.update();
|
|
205
184
|
},
|
|
206
185
|
destroy() { if (destroyed)
|
|
207
|
-
return; destroyed = true; entries.clear(); element.removeEventListener?.('click', click); element.replaceChildren(); },
|
|
186
|
+
return; destroyed = true; parts.destroy(); entries.clear(); element.removeEventListener?.('click', click); element.replaceChildren(); },
|
|
208
187
|
};
|
|
209
188
|
}
|
|
210
189
|
export function createCopyFeedback(options) {
|
|
211
190
|
let destroyed = false;
|
|
212
|
-
const
|
|
191
|
+
const notice = adoptFeedback(options.status, { presentation: 'inline', autoHide: false });
|
|
192
|
+
const entries = new Map();
|
|
193
|
+
const release = (button, entry) => {
|
|
194
|
+
if (entry.timer)
|
|
195
|
+
clearTimeout(entry.timer);
|
|
196
|
+
if (entry.displayed && button.isConnected) {
|
|
197
|
+
button.replaceChildren(...entry.original);
|
|
198
|
+
if (entry.label === null)
|
|
199
|
+
button.removeAttribute('aria-label');
|
|
200
|
+
else
|
|
201
|
+
button.setAttribute('aria-label', entry.label);
|
|
202
|
+
button.title = entry.title;
|
|
203
|
+
}
|
|
204
|
+
delete button.dataset.copyPending;
|
|
205
|
+
entry.controller.update({ disabled: options.isDisabled(button) });
|
|
206
|
+
entry.controller.destroy();
|
|
207
|
+
entries.delete(button);
|
|
208
|
+
};
|
|
213
209
|
return {
|
|
214
210
|
async copy(button, action, announcement) {
|
|
215
211
|
if (destroyed || button.dataset.copyPending === 'true')
|
|
216
212
|
return;
|
|
217
|
-
const
|
|
218
|
-
|
|
213
|
+
const entry = { controller: adoptAction(button), original: [...button.childNodes], label: button.getAttribute('aria-label'), title: button.title, displayed: false };
|
|
214
|
+
entries.set(button, entry);
|
|
215
|
+
notice.update({ message: '', tone: 'info' });
|
|
219
216
|
button.dataset.copyPending = 'true';
|
|
220
|
-
|
|
217
|
+
entry.controller.update({ disabled: options.isDisabled(button) });
|
|
221
218
|
try {
|
|
222
219
|
await action();
|
|
223
220
|
if (destroyed)
|
|
224
221
|
return;
|
|
225
|
-
|
|
226
|
-
if (!button.isConnected)
|
|
222
|
+
notice.update({ message: announcement, tone: 'info' });
|
|
223
|
+
if (!button.isConnected) {
|
|
224
|
+
release(button, entry);
|
|
227
225
|
return;
|
|
226
|
+
}
|
|
228
227
|
button.innerHTML = button.classList.contains('pui-message-action') ? icon('check') : 'Copied';
|
|
229
228
|
button.setAttribute('aria-label', announcement);
|
|
230
229
|
button.title = announcement;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return;
|
|
235
|
-
button.innerHTML = original;
|
|
236
|
-
if (label === null)
|
|
237
|
-
button.removeAttribute('aria-label');
|
|
238
|
-
else
|
|
239
|
-
button.setAttribute('aria-label', label);
|
|
240
|
-
button.title = title;
|
|
241
|
-
delete button.dataset.copyPending;
|
|
242
|
-
button.disabled = options.isDisabled(button);
|
|
243
|
-
}, 1500));
|
|
230
|
+
entry.displayed = true;
|
|
231
|
+
entry.timer = setTimeout(() => { if (!destroyed && entries.get(button) === entry)
|
|
232
|
+
release(button, entry); }, 1500);
|
|
244
233
|
}
|
|
245
234
|
catch (error) {
|
|
246
235
|
if (destroyed)
|
|
247
236
|
return;
|
|
248
|
-
|
|
249
|
-
button.disabled = false;
|
|
237
|
+
release(button, entry);
|
|
250
238
|
options.onError(error);
|
|
251
239
|
}
|
|
252
240
|
},
|
|
253
|
-
destroy() {
|
|
241
|
+
destroy() { if (destroyed)
|
|
242
|
+
return; destroyed = true; for (const [button, entry] of entries)
|
|
243
|
+
release(button, entry); notice.destroy(); },
|
|
254
244
|
};
|
|
255
245
|
}
|
|
256
246
|
//# sourceMappingURL=systems.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/files/systems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,EAAE,qBAAqB,EAAE,CAAC,EAAE,CA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BAAE,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;wBAAM,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;oBACxG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;oBAAC,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;oBAAC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBACxG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YACZ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,SAAS;oBAAE,OAAO;gBACtB,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;gBAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACrF,CAAC;QACH,CAAC;QACD,OAAO,KAAW,SAAS,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACpF,CAAC;AACJ,CAAC","sourcesContent":["import { icon, setText } from '../dom.js';\nimport type { UIBlock } from '../core.js';\n\nconst currency = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2, maximumFractionDigits: 6 });\nconst numbers = new Intl.NumberFormat();\nexport interface CostSummaryDisplay { unavailable?: boolean; requestCount: number; unknownRequests: number; runRequests: number; runUnknownRequests: number; total: number; runTotal: number }\nexport function formatCost(cost: CostSummaryDisplay | undefined, latestTask = false): string {\n if (cost?.unavailable) return 'Unavailable';\n const count = latestTask ? cost?.runRequests : cost?.requestCount;\n const unknown = (latestTask ? cost?.runUnknownRequests : cost?.unknownRequests) || 0;\n if (!count) return 'Not recorded';\n if (count === unknown) return 'Unknown';\n return `~${currency.format((latestTask ? cost?.runTotal : cost?.total) || 0)}${unknown ? ' (partial)' : ''}`;\n}\nexport interface CostRequestDisplay {\n id: string; purpose: string; status: string; provider: string; providerName?: string; model: string; modelName?: string;\n time: string; source: string; price: unknown; known: boolean;\n usage: { input: number; output: number; cacheRead: number; cacheWrite: number; reasoning?: number; cost: { total: number } };\n}\nexport interface CostLedgerState { unknownRequests: number; requests: readonly CostRequestDisplay[] | null }\nexport function createCostLedger(options: { container?: HTMLElement } = {}) {\n const element = options.container || document.createElement('div');\n type Row = { element: HTMLTableRowElement; purpose: HTMLElement; identity: HTMLElement; time: HTMLElement; details: HTMLDetailsElement; source: HTMLElement; price: HTMLElement; reasoning: HTMLElement; cells: HTMLTableCellElement[] };\n const rows = new Map<string, Row>();\n let table: HTMLTableSectionElement | undefined;\n let note: HTMLElement | undefined;\n let empty: HTMLTableRowElement | undefined;\n let destroyed = false;\n function clear(): void { rows.clear(); table = undefined; note = undefined; empty = undefined; element.replaceChildren(); }\n function ensure(): void {\n if (table) return;\n element.innerHTML = '<p class=\"pui-cost-note\"></p><div class=\"pui-cost-table\"><table><thead><tr><th>Request</th><th>Input</th><th>Output</th><th>Cache read / write</th><th>Estimate</th></tr></thead><tbody></tbody></table></div>';\n table = element.querySelector('tbody')!; note = element.querySelector<HTMLElement>('.pui-cost-note')!;\n empty = document.createElement('tr'); const cell = document.createElement('td'); cell.colSpan = 5; cell.textContent = 'No recorded requests yet.'; empty.append(cell);\n }\n function makeRow(id: string): Row {\n const row = document.createElement('tr');\n row.innerHTML = '<td><strong data-purpose></strong><br><span data-identity></span><br><small data-time></small><details><summary>Price source and rates (USD / million tokens)</summary><p data-source></p><pre data-price></pre><p data-reasoning hidden></p></details></td><td></td><td></td><td></td><td></td>';\n const details = row.querySelector('details')!; details.dataset.costId = id;\n return { element: row, purpose: row.querySelector('[data-purpose]')!, identity: row.querySelector('[data-identity]')!, time: row.querySelector('[data-time]')!, details, source: row.querySelector('[data-source]')!, price: row.querySelector('[data-price]')!, reasoning: row.querySelector('[data-reasoning]')!, cells: [...row.querySelectorAll('td')] };\n }\n return {\n element,\n clear(): void { if (!destroyed) clear(); },\n loading(): void { if (!destroyed && !element.childElementCount) element.textContent = 'Loading request breakdown…'; },\n setError(message: string): void { if (!destroyed) { clear(); element.textContent = message; } },\n update(report: Readonly<CostLedgerState>): void {\n if (destroyed) return;\n const focused = document.activeElement;\n ensure();\n setText(note!, `USD estimates for recorded requests, not a provider bill. Prices are saved per request; retries and context summaries are included when usage is reported. ${report.unknownRequests ? `${report.unknownRequests} request(s) have unknown prices or usage and are excluded. ` : ''}Older requests made before recording began are not reconstructed.`);\n const requests = report.requests || [];\n const keep = new Set(requests.map(request => request.id));\n for (const [id, row] of rows) if (!keep.has(id)) { row.element.remove(); rows.delete(id); }\n if (!requests.length) { if (!empty!.parentElement) table!.append(empty!); return; }\n empty!.remove();\n let cursor = table!.firstElementChild;\n const n = (value: number) => numbers.format(value || 0);\n for (const request of requests) {\n let row = rows.get(request.id);\n if (!row) { row = makeRow(request.id); rows.set(request.id, row); }\n setText(row.purpose, `${request.purpose} · ${request.status}`);\n setText(row.identity, `${request.providerName || request.provider} / ${request.modelName || request.model}`);\n setText(row.time, request.time); setText(row.source, request.source); setText(row.price, JSON.stringify(request.price, null, 2));\n row.reasoning.hidden = request.usage.reasoning == null;\n setText(row.reasoning, request.usage.reasoning == null ? '' : `Reasoning tokens: ${n(request.usage.reasoning)} (included in output)`);\n setText(row.cells[1]!, n(request.usage.input)); setText(row.cells[2]!, n(request.usage.output));\n setText(row.cells[3]!, `${n(request.usage.cacheRead)} / ${n(request.usage.cacheWrite)}`);\n setText(row.cells[4]!, request.known ? currency.format(request.usage.cost.total) : 'Unknown');\n if (row.element !== cursor) table!.insertBefore(row.element, cursor);\n cursor = row.element.nextElementSibling;\n }\n if (focused instanceof HTMLElement && element.contains(focused) && document.activeElement !== focused) focused.focus({ preventScroll: true });\n },\n destroy(): void { if (!destroyed) clear(); destroyed = true; },\n };\n}\n\nexport interface UpdatePanelState { version: string; enabled: boolean; phase: string; availableVersion: string; progress: number; message: string }\nexport function createUpdatePanel(options: { container?: HTMLElement; productName?: string; onCheck?: () => void; onInstall?: () => void } = {}) {\n const element = options.container || document.createElement('section');\n if (!element.querySelector('[data-update-version]')) element.innerHTML = '<p data-update-version></p><p data-update-message role=\"status\"></p><div class=\"pui-feature-toolbar\"><button type=\"button\" class=\"pui-secondary-button\" data-update-check>Check for updates</button><button type=\"button\" class=\"pui-secondary-button\" data-update-install hidden>Update and restart</button></div><progress max=\"100\" hidden></progress>';\n const version = element.querySelector<HTMLElement>('[data-update-version]')!;\n const message = element.querySelector<HTMLElement>('[data-update-message]')!;\n const check = element.querySelector<HTMLButtonElement>('[data-update-check]')!;\n const install = element.querySelector<HTMLButtonElement>('[data-update-install]')!;\n const progress = element.querySelector<HTMLProgressElement>('progress')!;\n let state: Readonly<UpdatePanelState> | undefined;\n let pending = false, destroyed = false;\n let error = '';\n let retryCheck = false;\n const checkAction = () => options.onCheck?.(), installAction = () => options.onInstall?.();\n check.addEventListener('click', checkAction); install.addEventListener('click', installAction);\n function render(): void {\n if (destroyed) return;\n if (!state) { check.disabled = install.disabled = pending; message.textContent = error; return; }\n version.textContent = `${options.productName || 'Application'} ${state.version}`;\n message.textContent = error || state.message;\n const busy = ['checking', 'installing', 'restarting'].includes(state.phase);\n check.disabled = !state.enabled || (busy && !retryCheck) || pending;\n install.hidden = !state.availableVersion; install.disabled = busy || pending; install.textContent = 'Update and restart';\n progress.hidden = state.phase !== 'installing'; progress.value = state.progress;\n }\n return {\n element,\n update(value: Readonly<UpdatePanelState>): void { state = value; error = ''; retryCheck = false; render(); },\n setPending(value: boolean): void { pending = value; render(); },\n setError(value: string, options: { allowCheckRetry?: boolean } = {}): void { if (!destroyed) { error = value; retryCheck = !!options.allowCheckRetry; render(); } },\n destroy(): void { if (destroyed) return; destroyed = true; check.removeEventListener('click', checkAction); install.removeEventListener('click', installAction); },\n };\n}\n\nexport interface CompletionNoticeDisplay { id: string; runID: string; title: string; workspace: string }\nexport function historyStatusMarkup(status: 'approval' | 'running' | 'unread' | 'idle'): string {\n if (status === 'approval') return '<span class=\"pui-history-status pui-needs-approval\" role=\"img\" aria-label=\"Waiting for approval\" title=\"Waiting for approval\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v6m0 4h.01\"/></svg></span>';\n if (status === 'running') return '<span class=\"pui-history-status\" role=\"img\" aria-label=\"Running\" title=\"Running\"><i class=\"pui-history-spinner\" aria-hidden=\"true\"></i></span>';\n if (status === 'unread') return '<span class=\"pui-history-status\" role=\"img\" aria-label=\"Completed, unread\" title=\"Completed, unread\"><i class=\"pui-history-unread\" aria-hidden=\"true\"></i></span>';\n return '<span class=\"pui-history-status\" aria-hidden=\"true\"></span>';\n}\nexport function createCompletionNotices(options: { container?: HTMLElement; onOpen?: (id: string) => void; onDismiss?: (runID: string) => void } = {}): UIBlock<readonly CompletionNoticeDisplay[]> {\n const element = options.container || document.createElement('div');\n const entries = new Map<string, { element: HTMLElement; text: HTMLElement; open: HTMLButtonElement; dismiss: HTMLButtonElement }>();\n let destroyed = false;\n const click = (event: Event) => {\n const target = (event.target as Element).closest<HTMLElement>('[data-conversation], [data-dismiss-completion]');\n if (!target || !element.contains(target)) return;\n if (target.dataset.conversation) options.onOpen?.(target.dataset.conversation);\n else if (target.dataset.dismissCompletion) options.onDismiss?.(target.dataset.dismissCompletion);\n };\n if (options.onOpen || options.onDismiss) element.addEventListener('click', click);\n return {\n element,\n update(notices): void {\n if (destroyed) return;\n const focused = document.activeElement;\n const keep = new Set(notices.map(notice => notice.runID));\n for (const [id, entry] of entries) if (!keep.has(id)) { entry.element.remove(); entries.delete(id); }\n let cursor = element.firstElementChild;\n for (const notice of notices) {\n let entry = entries.get(notice.runID);\n if (!entry) {\n const article = document.createElement('article'); article.className = 'pui-completion-notice';\n article.innerHTML = `<span class=\"pui-completion-check\" aria-hidden=\"true\">${icon('check')}</span><div class=\"pui-completion-content\"><strong>Task completed</strong><p></p><button class=\"pui-text-button\" type=\"button\" data-conversation>Open conversation</button></div><button class=\"pui-quiet-icon pui-completion-dismiss\" type=\"button\" data-dismiss-completion aria-label=\"Dismiss completion notification\">${icon('close')}</button>`;\n entry = { element: article, text: article.querySelector('p')!, open: article.querySelector('[data-conversation]')!, dismiss: article.querySelector('[data-dismiss-completion]')! };\n entries.set(notice.runID, entry);\n }\n setText(entry.text, `${notice.workspace} · ${notice.title}`);\n if (entry.open.dataset.conversation !== notice.id) entry.open.dataset.conversation = notice.id;\n if (entry.dismiss.dataset.dismissCompletion !== notice.runID) entry.dismiss.dataset.dismissCompletion = notice.runID;\n if (entry.element !== cursor) element.insertBefore(entry.element, cursor);\n cursor = entry.element.nextElementSibling;\n }\n if (focused instanceof HTMLElement && element.contains(focused) && document.activeElement !== focused) focused.focus({ preventScroll: true });\n },\n destroy(): void { if (destroyed) return; destroyed = true; entries.clear(); element.removeEventListener?.('click', click); element.replaceChildren(); },\n };\n}\n\nexport function createCopyFeedback(options: { status: HTMLElement; isDisabled: (button: HTMLButtonElement) => boolean; onError: (error: unknown) => void }) {\n let destroyed = false;\n const timers = new Map<HTMLButtonElement, ReturnType<typeof setTimeout>>();\n return {\n async copy(button: HTMLButtonElement, action: () => Promise<void>, announcement: string): Promise<void> {\n if (destroyed || button.dataset.copyPending === 'true') return;\n const original = button.innerHTML, label = button.getAttribute('aria-label'), title = button.title;\n options.status.textContent = ''; button.dataset.copyPending = 'true'; button.disabled = true;\n try {\n await action();\n if (destroyed) return;\n options.status.textContent = announcement;\n if (!button.isConnected) return;\n button.innerHTML = button.classList.contains('pui-message-action') ? icon('check') : 'Copied';\n button.setAttribute('aria-label', announcement); button.title = announcement;\n timers.set(button, setTimeout(() => {\n timers.delete(button);\n if (destroyed || !button.isConnected) return;\n button.innerHTML = original;\n if (label === null) button.removeAttribute('aria-label'); else button.setAttribute('aria-label', label);\n button.title = title; delete button.dataset.copyPending; button.disabled = options.isDisabled(button);\n }, 1500));\n } catch (error) {\n if (destroyed) return;\n delete button.dataset.copyPending; button.disabled = false; options.onError(error);\n }\n },\n destroy(): void { destroyed = true; timers.forEach(clearTimeout); timers.clear(); },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/files/systems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAC;AAC5I,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;AAExC,MAAM,UAAU,UAAU,CAAC,IAAoC,EAAE,UAAU,GAAG,KAAK;IACjF,IAAI,IAAI,EAAE,WAAW;QAAE,OAAO,aAAa,CAAC;IAC5C,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,CAAC;IAClE,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IACrF,IAAI,CAAC,KAAK;QAAE,OAAO,cAAc,CAAC;IAClC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,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AC,CAAC;gBAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QACD,OAAO,KAAW,IAAI,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;KAC9I,CAAC;AACJ,CAAC","sourcesContent":["import { icon, setText } from '../dom.js';\nimport type { UIBlock } from '../core.js';\nimport { adoptAction, adoptFeedback, adoptProductParts } from '../foundations.js';\nimport type { ActionController } from '../foundations.js';\nimport { reconcileKeyed } from '../reconcile.js';\n\nconst currency = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2, maximumFractionDigits: 6 });\nconst numbers = new Intl.NumberFormat();\nexport interface CostSummaryDisplay { unavailable?: boolean; requestCount: number; unknownRequests: number; runRequests: number; runUnknownRequests: number; total: number; runTotal: number }\nexport function formatCost(cost: CostSummaryDisplay | undefined, latestTask = false): string {\n if (cost?.unavailable) return 'Unavailable';\n const count = latestTask ? cost?.runRequests : cost?.requestCount;\n const unknown = (latestTask ? cost?.runUnknownRequests : cost?.unknownRequests) || 0;\n if (!count) return 'Not recorded';\n if (count === unknown) return 'Unknown';\n return `~${currency.format((latestTask ? cost?.runTotal : cost?.total) || 0)}${unknown ? ' (partial)' : ''}`;\n}\nexport interface CostRequestDisplay {\n id: string; purpose: string; status: string; provider: string; providerName?: string; model: string; modelName?: string;\n time: string; source: string; price: unknown; known: boolean;\n usage: { input: number; output: number; cacheRead: number; cacheWrite: number; reasoning?: number; cost: { total: number } };\n}\nexport interface CostLedgerState { unknownRequests: number; requests: readonly CostRequestDisplay[] | null }\nexport function createCostLedger(options: { container?: HTMLElement } = {}) {\n const element = options.container || document.createElement('div');\n type Row = { element: HTMLTableRowElement; purpose: HTMLElement; identity: HTMLElement; time: HTMLElement; details: HTMLDetailsElement; source: HTMLElement; price: HTMLElement; reasoning: HTMLElement; cells: HTMLTableCellElement[] };\n const rows = new Map<string, Row>();\n let table: HTMLTableSectionElement | undefined;\n let note: HTMLElement | undefined;\n let empty: HTMLTableRowElement | undefined;\n let destroyed = false;\n function clear(): void { rows.clear(); table = undefined; note = undefined; empty = undefined; element.replaceChildren(); }\n function ensure(): void {\n if (table) return;\n element.innerHTML = '<p class=\"pui-cost-note\"></p><div class=\"pui-cost-table\"><table><thead><tr><th>Request</th><th>Input</th><th>Output</th><th>Cache read / write</th><th>Estimate</th></tr></thead><tbody></tbody></table></div>';\n table = element.querySelector('tbody')!; note = element.querySelector<HTMLElement>('.pui-cost-note')!;\n empty = document.createElement('tr'); const cell = document.createElement('td'); cell.colSpan = 5; cell.textContent = 'No recorded requests yet.'; empty.append(cell);\n }\n function makeRow(id: string): Row {\n const row = document.createElement('tr');\n row.innerHTML = '<td><strong data-purpose></strong><br><span data-identity></span><br><small data-time></small><details><summary>Price source and rates (USD / million tokens)</summary><p data-source></p><pre data-price></pre><p data-reasoning hidden></p></details></td><td></td><td></td><td></td><td></td>';\n const details = row.querySelector('details')!; details.dataset.costId = id;\n return { element: row, purpose: row.querySelector('[data-purpose]')!, identity: row.querySelector('[data-identity]')!, time: row.querySelector('[data-time]')!, details, source: row.querySelector('[data-source]')!, price: row.querySelector('[data-price]')!, reasoning: row.querySelector('[data-reasoning]')!, cells: [...row.querySelectorAll('td')] };\n }\n return {\n element,\n clear(): void { if (!destroyed) clear(); },\n loading(): void { if (!destroyed && !element.childElementCount) element.textContent = 'Loading request breakdown…'; },\n setError(message: string): void { if (!destroyed) { clear(); element.textContent = message; } },\n update(report: Readonly<CostLedgerState>): void {\n if (destroyed) return;\n ensure();\n setText(note!, `USD estimates for recorded requests, not a provider bill. Prices are saved per request; retries and context summaries are included when usage is reported. ${report.unknownRequests ? `${report.unknownRequests} request(s) have unknown prices or usage and are excluded. ` : ''}Older requests made before recording began are not reconstructed.`);\n const requests = report.requests || [];\n empty!.remove();\n const n = (value: number) => numbers.format(value || 0);\n reconcileKeyed(table!, rows, requests, {\n key: request => request.id, element: row => row.element, create: request => makeRow(request.id),\n update(row, request) {\n setText(row.purpose, `${request.purpose} · ${request.status}`);\n setText(row.identity, `${request.providerName || request.provider} / ${request.modelName || request.model}`);\n setText(row.time, request.time); setText(row.source, request.source); setText(row.price, JSON.stringify(request.price, null, 2));\n row.reasoning.hidden = request.usage.reasoning == null;\n setText(row.reasoning, request.usage.reasoning == null ? '' : `Reasoning tokens: ${n(request.usage.reasoning)} (included in output)`);\n setText(row.cells[1]!, n(request.usage.input)); setText(row.cells[2]!, n(request.usage.output));\n setText(row.cells[3]!, `${n(request.usage.cacheRead)} / ${n(request.usage.cacheWrite)}`);\n setText(row.cells[4]!, request.known ? currency.format(request.usage.cost.total) : 'Unknown');\n },\n destroy() {},\n });\n if (!requests.length) table!.append(empty!);\n },\n destroy(): void { if (!destroyed) clear(); destroyed = true; },\n };\n}\n\nexport interface UpdatePanelState { version: string; enabled: boolean; phase: string; availableVersion: string; progress: number; message: string }\nexport function createUpdatePanel(options: { container?: HTMLElement; productName?: string; onCheck?: () => void; onInstall?: () => void } = {}) {\n const element = options.container || document.createElement('section');\n if (!element.querySelector('[data-update-version]')) element.innerHTML = '<p data-update-version></p><p data-update-message role=\"status\"></p><div class=\"pui-feature-toolbar\"><button type=\"button\" class=\"pui-secondary-button\" data-update-check>Check for updates</button><button type=\"button\" class=\"pui-secondary-button\" data-update-install hidden>Update and restart</button></div><progress max=\"100\" hidden></progress>';\n const version = element.querySelector<HTMLElement>('[data-update-version]')!;\n const message = element.querySelector<HTMLElement>('[data-update-message]')!;\n const check = element.querySelector<HTMLButtonElement>('[data-update-check]')!;\n const install = element.querySelector<HTMLButtonElement>('[data-update-install]')!;\n const progress = element.querySelector<HTMLProgressElement>('progress')!;\n const parts = adoptProductParts(element);\n let state: Readonly<UpdatePanelState> | undefined;\n let pending = false, destroyed = false;\n let error = '';\n let retryCheck = false;\n const checkAction = () => options.onCheck?.(), installAction = () => options.onInstall?.();\n check.addEventListener('click', checkAction); install.addEventListener('click', installAction);\n function render(): void {\n if (destroyed) return;\n if (!state) { parts.action(check).update({pending}); parts.action(install).update({pending}); parts.feedback(message).update({message:error,tone:'info'}); return; }\n version.textContent = `${options.productName || 'Application'} ${state.version}`;\n parts.feedback(message).update({message:error || state.message,tone:'info'});\n const busy = ['checking', 'installing', 'restarting'].includes(state.phase);\n parts.action(check).update({disabled:!state.enabled || (busy && !retryCheck),pending});\n install.hidden = !state.availableVersion; parts.action(install).update({disabled:!state.enabled || busy,pending,label:'Update and restart'});\n progress.hidden = state.phase !== 'installing'; progress.value = state.progress;\n }\n return {\n element,\n update(value: Readonly<UpdatePanelState>): void { state = value; error = ''; retryCheck = false; render(); },\n setPending(value: boolean): void { pending = value; render(); },\n setError(value: string, options: { allowCheckRetry?: boolean } = {}): void { if (!destroyed) { error = value; retryCheck = !!options.allowCheckRetry; render(); } },\n destroy(): void { if (destroyed) return; destroyed = true; parts.destroy(); check.removeEventListener('click', checkAction); install.removeEventListener('click', installAction); },\n };\n}\n\nexport interface CompletionNoticeDisplay { id: string; runID: string; title: string; workspace: string }\nexport function historyStatusMarkup(status: 'approval' | 'running' | 'unread' | 'idle'): string {\n if (status === 'approval') return '<span class=\"pui-history-status pui-needs-approval\" role=\"img\" aria-label=\"Waiting for approval\" title=\"Waiting for approval\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v6m0 4h.01\"/></svg></span>';\n if (status === 'running') return '<span class=\"pui-history-status\" role=\"img\" aria-label=\"Running\" title=\"Running\"><i class=\"pui-history-spinner\" aria-hidden=\"true\"></i></span>';\n if (status === 'unread') return '<span class=\"pui-history-status\" role=\"img\" aria-label=\"Completed, unread\" title=\"Completed, unread\"><i class=\"pui-history-unread\" aria-hidden=\"true\"></i></span>';\n return '<span class=\"pui-history-status\" aria-hidden=\"true\"></span>';\n}\nexport function createCompletionNotices(options: { container?: HTMLElement; onOpen?: (id: string) => void; onDismiss?: (runID: string) => void } = {}): UIBlock<readonly CompletionNoticeDisplay[]> {\n const element = options.container || document.createElement('div');\n const parts = adoptProductParts(element);\n const entries = new Map<string, { element: HTMLElement; text: HTMLElement; open: HTMLButtonElement; dismiss: HTMLButtonElement }>();\n let destroyed = false;\n const click = (event: Event) => {\n const target = (event.target as Element).closest<HTMLElement>('[data-conversation], [data-dismiss-completion]');\n if (!target || !element.contains(target)) return;\n if (target.dataset.conversation) options.onOpen?.(target.dataset.conversation);\n else if (target.dataset.dismissCompletion) options.onDismiss?.(target.dataset.dismissCompletion);\n };\n if (options.onOpen || options.onDismiss) element.addEventListener('click', click);\n return {\n element,\n update(notices): void {\n if (destroyed) return;\n reconcileKeyed(element, entries, notices, {\n key: notice => notice.runID, element: entry => entry.element,\n create() {\n const article = document.createElement('article'); article.className = 'pui-completion-notice';\n article.innerHTML = `<span class=\"pui-completion-check\" aria-hidden=\"true\">${icon('check')}</span><div class=\"pui-completion-content\"><strong>Task completed</strong><p></p><button class=\"pui-text-button\" type=\"button\" data-conversation>Open conversation</button></div><button class=\"pui-quiet-icon pui-completion-dismiss\" type=\"button\" data-dismiss-completion aria-label=\"Dismiss completion notification\">${icon('close')}</button>`;\n return { element: article, text: article.querySelector('p')!, open: article.querySelector<HTMLButtonElement>('[data-conversation]')!, dismiss: article.querySelector<HTMLButtonElement>('[data-dismiss-completion]')! };\n },\n update(entry, notice) {\n setText(entry.text, `${notice.workspace} · ${notice.title}`);\n parts.action(entry.open).update({label:'Open conversation'});\n parts.action(entry.dismiss).update({label:'Dismiss completion notification'});\n if (entry.open.dataset.conversation !== notice.id) entry.open.dataset.conversation = notice.id;\n if (entry.dismiss.dataset.dismissCompletion !== notice.runID) entry.dismiss.dataset.dismissCompletion = notice.runID;\n },\n destroy() {},\n });\n parts.update();\n },\n destroy(): void { if (destroyed) return; destroyed = true; parts.destroy(); entries.clear(); element.removeEventListener?.('click', click); element.replaceChildren(); },\n };\n}\n\nexport function createCopyFeedback(options: { status: HTMLElement; isDisabled: (button: HTMLButtonElement) => boolean; onError: (error: unknown) => void }) {\n let destroyed = false;\n const notice = adoptFeedback(options.status, {presentation:'inline',autoHide:false});\n type CopyEntry = { controller: ActionController; original: ChildNode[]; label: string | null; title: string; displayed: boolean; timer?: ReturnType<typeof setTimeout> };\n const entries = new Map<HTMLButtonElement, CopyEntry>();\n const release = (button: HTMLButtonElement, entry: CopyEntry): void => {\n if (entry.timer) clearTimeout(entry.timer);\n if (entry.displayed && button.isConnected) {\n button.replaceChildren(...entry.original);\n if (entry.label === null) button.removeAttribute('aria-label'); else button.setAttribute('aria-label', entry.label);\n button.title = entry.title;\n }\n delete button.dataset.copyPending;\n entry.controller.update({disabled:options.isDisabled(button)});\n entry.controller.destroy();\n entries.delete(button);\n };\n return {\n async copy(button: HTMLButtonElement, action: () => Promise<void>, announcement: string): Promise<void> {\n if (destroyed || button.dataset.copyPending === 'true') return;\n const entry: CopyEntry = { controller:adoptAction(button), original:[...button.childNodes], label:button.getAttribute('aria-label'), title:button.title, displayed:false };\n entries.set(button, entry);\n notice.update({message:'',tone:'info'}); button.dataset.copyPending = 'true'; entry.controller.update({disabled:options.isDisabled(button)});\n try {\n await action();\n if (destroyed) return;\n notice.update({message:announcement,tone:'info'});\n if (!button.isConnected) { release(button, entry); return; }\n button.innerHTML = button.classList.contains('pui-message-action') ? icon('check') : 'Copied';\n button.setAttribute('aria-label', announcement); button.title = announcement;\n entry.displayed = true;\n entry.timer = setTimeout(() => { if (!destroyed && entries.get(button) === entry) release(button, entry); }, 1500);\n } catch (error) {\n if (destroyed) return;\n release(button, entry); options.onError(error);\n }\n },\n destroy(): void { if (destroyed) return; destroyed = true; for (const [button, entry] of entries) release(button, entry); notice.destroy(); },\n };\n}\n"]}
|