pith-ui 0.1.4 → 0.2.0-app.2
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 +21 -7
- package/API.md +263 -262
- package/APP-API.md +2023 -0
- package/APP.md +141 -0
- package/README.md +35 -4
- package/dist/app/files.d.ts +68 -0
- package/dist/app/files.d.ts.map +1 -0
- package/dist/app/files.js +177 -0
- package/dist/app/files.js.map +1 -0
- package/dist/app/index.d.ts +57 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +300 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/internal.d.ts +31 -0
- package/dist/app/internal.d.ts.map +1 -0
- package/dist/app/internal.js +2 -0
- package/dist/app/internal.js.map +1 -0
- package/dist/app/resources.d.ts +89 -0
- package/dist/app/resources.d.ts.map +1 -0
- package/dist/app/resources.js +190 -0
- package/dist/app/resources.js.map +1 -0
- package/dist/app/session.d.ts +14 -0
- package/dist/app/session.d.ts.map +1 -0
- package/dist/app/session.js +12 -0
- package/dist/app/session.js.map +1 -0
- package/dist/app/settings.d.ts +109 -0
- package/dist/app/settings.d.ts.map +1 -0
- package/dist/app/settings.js +283 -0
- package/dist/app/settings.js.map +1 -0
- package/dist/app/workspace.d.ts +232 -0
- package/dist/app/workspace.d.ts.map +1 -0
- package/dist/app/workspace.js +413 -0
- package/dist/app/workspace.js.map +1 -0
- package/dist/forms/actions.d.ts +1 -0
- package/dist/forms/actions.d.ts.map +1 -1
- package/dist/forms/actions.js +3 -2
- package/dist/forms/actions.js.map +1 -1
- package/dist/styles.css +4 -1
- package/dist/tasks/runtime.js +2 -2
- package/dist/tasks/runtime.js.map +1 -1
- package/package.json +42 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/forms/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EA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AU,EAAC,iBAAiB,EAAC,KAAK,CAAC,WAAW,EAAC,IAAI,EAAC,KAAK,CAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,CAAC,IAAI,EAAC,EAAC,CAAC,CAAC;QAAC,OAAO,MAAM,CAAC;IACrM,CAAC,EAAC,OAAO,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { UIBlock, UIAction } from '../core.js';\nimport { escape, setText } from '../dom.js';\nimport {adoptAction, type ActionController} from '../foundations.js';\nimport {reconcileKeyed} from '../reconcile.js';\nexport interface ProviderActionsState {id: string; oauth: boolean; signedIn: boolean; custom: boolean}\nexport type ResourceKind = 'instructions' | 'skill' | 'template';\nexport interface ResourceActionsState {kind: string; resource: {name: string; path: string}; workspaceId: string}\nexport type ProviderAction = 'login' | 'logout' | 'custom' | 'remove-connection';\nexport type ResourceAction = 'use-resource' | 'resource';\nexport interface ProviderActionTarget {readonly id: string}\nexport interface ResourceActionTarget {readonly workspaceId: string; readonly kind: string; readonly resource: {readonly name: string; readonly path: string}; readonly command?: string}\nexport function providerActionsMarkup(provider: ProviderActionsState): string {return `<div class=\"pui-feature-toolbar\">${provider.oauth ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"${provider.signedIn ? 'logout' : 'login'}\" data-id=\"${escape(provider.id)}\">${provider.signedIn ? 'Sign out' : 'Sign in with provider'}</button>` : ''}${provider.custom ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"custom\" data-id=\"${escape(provider.id)}\">Edit models and prices</button><button type=\"button\" class=\"pui-secondary-button pui-destructive-button\" data-sdk=\"remove-connection\" data-id=\"${escape(provider.id)}\">Remove connection</button>` : ''}</div>`;}\nconst resourceCommand = (kind: string, name: string) => kind === 'skill' ? `/skill:${name} ` : `/${name} `;\nexport function resourceActionsMarkup(kind: string, resource: {name: string; path: string}, workspaceId: string): string {\n return `<div class=\"pui-file-actions\">${kind !== 'instructions' ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"use-resource\" data-command=\"${escape(resourceCommand(kind,resource.name))}\">Use</button>` : ''}<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"resource\" data-resource-workspace=\"${escape(workspaceId)}\" data-kind=\"${escape(kind)}\" data-path=\"${escape(resource.path)}\">View / edit</button></div>`;\n}\nexport interface FeatureActionOptions {onAction?: (action: string, target: DOMStringMap) => ReturnType<UIAction>; onError?: (message: string) => void}\nexport interface ProviderActionOptions extends FeatureActionOptions {onProviderAction?: (action: ProviderAction, target: ProviderActionTarget) => ReturnType<UIAction>}\nexport interface ResourceActionOptions extends FeatureActionOptions {onResourceAction?: (action: ResourceAction, target: ResourceActionTarget) => ReturnType<UIAction>}\ntype ActionView<Action, Target> = {key: string; action: Action; label: string; target: Target; dataset: Record<string,string>; destructive?: boolean};\nfunction actions<State, Action extends string, Target>(initial: State, className: string, describe: (state: Readonly<State>) => readonly ActionView<Action,Target>[], options: FeatureActionOptions, onAction?: (action: Action,target: Target) => ReturnType<UIAction>): UIBlock<State> {\n const element = document.createElement('div'); element.className = 'pui-feature-actions'; const toolbar = document.createElement('div'); toolbar.className = className; element.append(toolbar);\n type Row = {element: HTMLButtonElement; view: ActionView<Action,Target>; handle: ActionController; stop?: (event: Event) => void};\n const rows = new Map<string,Row>(); let destroyed = false;\n const release = (row: Row) => {if (row.stop) row.element.removeEventListener('click',row.stop); row.handle.destroy();};\n const update = (state: Readonly<State>) => {\n if (destroyed) return;\n reconcileKeyed(toolbar,rows,describe(state),{key:view=>view.key,element:row=>row.element,create(view) {\n const button = document.createElement('button'); button.type = 'button';\n const stop = onAction || options.onAction ? (event: Event) => event.stopPropagation() : undefined;\n // Stop before the callback: it can synchronously destroy this owner.\n if (stop) button.addEventListener('click',stop);\n const row: Row = {element:button,view,handle:adoptAction(button,{onAction:stop ? () => onAction ? onAction(row.view.action,row.view.target) : options.onAction!(row.view.action,button.dataset) : undefined,onError:options.onError}),stop}; return row;\n },update(row,view) {row.view = view; row.element.className = `pui-secondary-button${view.destructive ? ' pui-destructive-button' : ''}`; setText(row.element,view.label); for (const [name,value] of Object.entries(view.dataset)) row.element.dataset[name] = value;},destroy:release});\n }; update(initial);\n return {element, update, destroy() {if (destroyed) return; destroyed = true; for (const row of rows.values()) release(row); rows.clear(); element.remove();}};\n}\nexport function createProviderActions(state: ProviderActionsState, options: ProviderActionOptions = {}): UIBlock<ProviderActionsState> {\n return actions(state,'pui-feature-toolbar',value => {\n const target = Object.freeze({id:value.id}); const result: ActionView<ProviderAction,ProviderActionTarget>[] = [];\n const add = (action: ProviderAction,label: string,destructive = false) => result.push({key:JSON.stringify([value.id,action]),action,label,target,dataset:{sdk:action,id:value.id},destructive});\n if (value.oauth) add(value.signedIn ? 'logout' : 'login',value.signedIn ? 'Sign out' : 'Sign in with provider');\n if (value.custom) {add('custom','Edit models and prices'); add('remove-connection','Remove connection',true);} return result;\n },options,options.onProviderAction);\n}\nexport function createResourceActions(state: ResourceActionsState, options: ResourceActionOptions = {}): UIBlock<ResourceActionsState> {\n return actions(state,'pui-file-actions',value => {\n const resource = Object.freeze({...value.resource}); const identity = JSON.stringify([value.workspaceId,value.kind,resource.name,resource.path]);\n const target = Object.freeze({workspaceId:value.workspaceId,kind:value.kind,resource}); const result: ActionView<ResourceAction,ResourceActionTarget>[] = [];\n if (value.kind !== 'instructions') {const command = resourceCommand(value.kind,resource.name); result.push({key:identity+'use-resource',action:'use-resource',label:'Use',target:Object.freeze({...target,command}),dataset:{sdk:'use-resource',command}});}\n result.push({key:identity+'resource',action:'resource',label:'View / edit',target,dataset:{sdk:'resource',resourceWorkspace:value.workspaceId,kind:value.kind,path:resource.path}}); return result;\n },options,options.onResourceAction);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/forms/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAC,WAAW,EAAwB,MAAM,mB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;QAC5P,MAAM,CAAC,IAAI,CAAC,EAAC,GAAG,EAAC,QAAQ,GAAC,UAAU,EAAC,MAAM,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,MAAM,EAAC,OAAO,EAAC,EAAC,GAAG,EAAC,UAAU,EAAC,iBAAiB,EAAC,KAAK,CAAC,WAAW,EAAC,IAAI,EAAC,KAAK,CAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,CAAC,IAAI,EAAC,EAAC,CAAC,CAAC;QAAC,OAAO,MAAM,CAAC;IACrM,CAAC,EAAC,OAAO,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { UIBlock, UIAction } from '../core.js';\nimport { escape, setText } from '../dom.js';\nimport {adoptAction, type ActionController} from '../foundations.js';\nimport {reconcileKeyed} from '../reconcile.js';\nexport interface ProviderActionsState {id: string; oauth: boolean; signedIn: boolean; custom: boolean; disabled?: boolean}\nexport type ResourceKind = 'instructions' | 'skill' | 'template';\nexport interface ResourceActionsState {kind: string; resource: {name: string; path: string}; workspaceId: string}\nexport type ProviderAction = 'login' | 'logout' | 'custom' | 'remove-connection';\nexport type ResourceAction = 'use-resource' | 'resource';\nexport interface ProviderActionTarget {readonly id: string}\nexport interface ResourceActionTarget {readonly workspaceId: string; readonly kind: string; readonly resource: {readonly name: string; readonly path: string}; readonly command?: string}\nexport function providerActionsMarkup(provider: ProviderActionsState): string {return `<div class=\"pui-feature-toolbar\">${provider.oauth ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"${provider.signedIn ? 'logout' : 'login'}\" data-id=\"${escape(provider.id)}\">${provider.signedIn ? 'Sign out' : 'Sign in with provider'}</button>` : ''}${provider.custom ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"custom\" data-id=\"${escape(provider.id)}\">Edit models and prices</button><button type=\"button\" class=\"pui-secondary-button pui-destructive-button\" data-sdk=\"remove-connection\" data-id=\"${escape(provider.id)}\">Remove connection</button>` : ''}</div>`;}\nconst resourceCommand = (kind: string, name: string) => kind === 'skill' ? `/skill:${name} ` : `/${name} `;\nexport function resourceActionsMarkup(kind: string, resource: {name: string; path: string}, workspaceId: string): string {\n return `<div class=\"pui-file-actions\">${kind !== 'instructions' ? `<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"use-resource\" data-command=\"${escape(resourceCommand(kind,resource.name))}\">Use</button>` : ''}<button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"resource\" data-resource-workspace=\"${escape(workspaceId)}\" data-kind=\"${escape(kind)}\" data-path=\"${escape(resource.path)}\">View / edit</button></div>`;\n}\nexport interface FeatureActionOptions {onAction?: (action: string, target: DOMStringMap) => ReturnType<UIAction>; onError?: (message: string) => void}\nexport interface ProviderActionOptions extends FeatureActionOptions {onProviderAction?: (action: ProviderAction, target: ProviderActionTarget) => ReturnType<UIAction>}\nexport interface ResourceActionOptions extends FeatureActionOptions {onResourceAction?: (action: ResourceAction, target: ResourceActionTarget) => ReturnType<UIAction>}\ntype ActionView<Action, Target> = {key: string; action: Action; label: string; target: Target; dataset: Record<string,string>; destructive?: boolean; disabled?: boolean};\nfunction actions<State, Action extends string, Target>(initial: State, className: string, describe: (state: Readonly<State>) => readonly ActionView<Action,Target>[], options: FeatureActionOptions, onAction?: (action: Action,target: Target) => ReturnType<UIAction>): UIBlock<State> {\n const element = document.createElement('div'); element.className = 'pui-feature-actions'; const toolbar = document.createElement('div'); toolbar.className = className; element.append(toolbar);\n type Row = {element: HTMLButtonElement; view: ActionView<Action,Target>; handle: ActionController; stop?: (event: Event) => void};\n const rows = new Map<string,Row>(); let destroyed = false;\n const release = (row: Row) => {if (row.stop) row.element.removeEventListener('click',row.stop); row.handle.destroy();};\n const update = (state: Readonly<State>) => {\n if (destroyed) return;\n reconcileKeyed(toolbar,rows,describe(state),{key:view=>view.key,element:row=>row.element,create(view) {\n const button = document.createElement('button'); button.type = 'button';\n const stop = onAction || options.onAction ? (event: Event) => event.stopPropagation() : undefined;\n // Stop before the callback: it can synchronously destroy this owner.\n if (stop) button.addEventListener('click',stop);\n const row: Row = {element:button,view,handle:adoptAction(button,{onAction:stop ? () => onAction ? onAction(row.view.action,row.view.target) : options.onAction!(row.view.action,button.dataset) : undefined,onError:options.onError}),stop}; return row;\n },update(row,view) {row.view = view; row.element.className = `pui-secondary-button${view.destructive ? ' pui-destructive-button' : ''}`; setText(row.element,view.label); for (const [name,value] of Object.entries(view.dataset)) row.element.dataset[name] = value; if (view.disabled !== undefined) row.handle.update({disabled:view.disabled});},destroy:release});\n }; update(initial);\n return {element, update, destroy() {if (destroyed) return; destroyed = true; for (const row of rows.values()) release(row); rows.clear(); element.remove();}};\n}\nexport function createProviderActions(state: ProviderActionsState, options: ProviderActionOptions = {}): UIBlock<ProviderActionsState> {\n return actions(state,'pui-feature-toolbar',value => {\n const target = Object.freeze({id:value.id}); const result: ActionView<ProviderAction,ProviderActionTarget>[] = [];\n const add = (action: ProviderAction,label: string,destructive = false) => result.push({key:JSON.stringify([value.id,action]),action,label,target,dataset:{sdk:action,id:value.id},destructive,disabled:!!value.disabled});\n if (value.oauth) add(value.signedIn ? 'logout' : 'login',value.signedIn ? 'Sign out' : 'Sign in with provider');\n if (value.custom) {add('custom','Edit models and prices'); add('remove-connection','Remove connection',true);} return result;\n },options,options.onProviderAction);\n}\nexport function createResourceActions(state: ResourceActionsState, options: ResourceActionOptions = {}): UIBlock<ResourceActionsState> {\n return actions(state,'pui-file-actions',value => {\n const resource = Object.freeze({...value.resource}); const identity = JSON.stringify([value.workspaceId,value.kind,resource.name,resource.path]);\n const target = Object.freeze({workspaceId:value.workspaceId,kind:value.kind,resource}); const result: ActionView<ResourceAction,ResourceActionTarget>[] = [];\n if (value.kind !== 'instructions') {const command = resourceCommand(value.kind,resource.name); result.push({key:identity+'use-resource',action:'use-resource',label:'Use',target:Object.freeze({...target,command}),dataset:{sdk:'use-resource',command}});}\n result.push({key:identity+'resource',action:'resource',label:'View / edit',target,dataset:{sdk:'resource',resourceWorkspace:value.workspaceId,kind:value.kind,path:resource.path}}); return result;\n },options,options.onResourceAction);\n}\n"]}
|
package/dist/styles.css
CHANGED
|
@@ -370,6 +370,9 @@
|
|
|
370
370
|
.pui .pui-sidebar { width: var(--pui-sidebar-width); background: var(--pui-bg-sidebar); display: flex; flex-direction: column; flex-shrink: 0; padding: var(--pui-space-xl) var(--pui-space-lg) var(--pui-space-lg); border-right: 1px solid var(--pui-border); }
|
|
371
371
|
.pui .pui-brand { display: flex; align-items: center; gap: var(--pui-space-md); text-decoration: none; color: var(--pui-text); font-size: var(--pui-text-large); letter-spacing: normal; font-weight: var(--pui-weight-strong); padding: 0 var(--pui-space-sm); }
|
|
372
372
|
.pui .pui-brand-light { font-weight: var(--pui-weight-regular); color: var(--pui-muted); }
|
|
373
|
+
.pui .pui-app-brand { display: contents; }
|
|
374
|
+
.pui .pui-app-brand-image { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
|
|
375
|
+
.pui .pui-welcome-mark .pui-app-brand-image { width: 32px; height: 32px; }
|
|
373
376
|
.pui .pui-logo-mark { display: inline-grid; width: 24px; height: 24px; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-8deg); }
|
|
374
377
|
.pui .pui-logo-mark i { background: var(--pui-accent); border-radius: 2px; }
|
|
375
378
|
.pui .pui-logo-mark i:nth-child(2) { border-radius: 2px 9px 2px 2px; opacity: .7; }
|
|
@@ -752,7 +755,7 @@
|
|
|
752
755
|
.pui .pui-chat-scroll { padding: 0 var(--pui-space-lg); }
|
|
753
756
|
.pui .pui-welcome { padding-top: var(--pui-space-xl); padding-bottom: var(--pui-space-xl); }
|
|
754
757
|
.pui .pui-welcome-mark { width: 52px; height: 52px; border-radius: 14px; margin-bottom: var(--pui-space-xl); }
|
|
755
|
-
.pui .pui-welcome-mark .pui-logo-mark { width: 27px; height: 27px; }
|
|
758
|
+
.pui .pui-welcome-mark .pui-logo-mark, .pui .pui-welcome-mark .pui-app-brand-image { width: 27px; height: 27px; }
|
|
756
759
|
.pui .pui-setup-card { margin-top: var(--pui-space-xl); padding: var(--pui-space-lg) var(--pui-space-md) var(--pui-space-xs); }
|
|
757
760
|
.pui .pui-setup-step small { max-width: 230px; font-size: var(--pui-text-small); }
|
|
758
761
|
.pui .pui-setup-card-heading { font-size: var(--pui-text-small); }
|
package/dist/tasks/runtime.js
CHANGED
|
@@ -9,8 +9,8 @@ export function createRuntimePanel(initial, options = {}) {
|
|
|
9
9
|
if (options.costs)
|
|
10
10
|
element.querySelector('#run-status-details').append(options.costs);
|
|
11
11
|
}
|
|
12
|
-
const summary = element.querySelector('
|
|
13
|
-
const values = element.querySelector('
|
|
12
|
+
const summary = element.querySelector('[id$="run-status-summary"]');
|
|
13
|
+
const values = element.querySelector('[id$="runtime-values"]');
|
|
14
14
|
const prefix = options.idPrefix ?? uniqueId('pui-runtime') + '-';
|
|
15
15
|
for (const child of element.children)
|
|
16
16
|
scopeIds(child, prefix);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/tasks/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAE/C,MAAM,UAAU,kBAAkB,CAAC,OAA0B,EAAE,UAAoE,EAAE;IACpI,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAAA,OAAO,CAAC,SAAS,GAAG,kCAAkC,CAAC;QAAC,OAAO,CAAC,SAAS,GAAG,+GAA+G,CAAC;QAAC,IAAI,OAAO,CAAC,KAAK;YAAE,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAE,CAAC,MAAM,CAAC,OA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QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,UAAU,IAAI,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC;oBAAA,IAAI,CAAC,EAAE,GAAG,MAAM,GAAC,UAAU,GAAC,GAAG,CAAC,EAAE,CAAC;oBAAC,IAAI,CAAC,YAAY,CAAC,eAAe,GAAC,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;gBAAA,CAAC,CAAC,OAAO,IAAI,CAAC,CAAA,CAAC,EAAC,MAAM,CAAC,IAAI,EAAC,GAAG,IAAG,OAAO,CAAC,IAAI,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA,CAAC,EAAC,OAAO,KAAI,CAAC,EAAC,CAAC,CAAC;QACpW,CAAC;QACD,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IACF,MAAM,CAAC,OAAO,CAAC,CAAC;IAAC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,KAAI,IAAI,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AACrK,CAAC","sourcesContent":["import {scopeIds} from '../forms/identity.js';\nimport type { UIBlock } from '../core.js';\nimport { setText, uniqueId } from '../dom.js';\nimport {reconcileKeyed} from '../reconcile.js';\nexport interface RuntimePanelState {visible: boolean; summary: string; duration: string; speed: string; provider?: string; thinkingLevel?: string; inputTokens: string; outputTokens: string; cacheRead: string; cacheWrite: string; contextTokens: string; contextWindow: string; compactions: string; toolFailures: string; recordedCost: string; latestCost: string}\nexport function createRuntimePanel(initial: RuntimePanelState, options: {element?: HTMLElement; idPrefix?: string; costs?: Node} = {}): UIBlock<RuntimePanelState> & {updateTiming(value: {summary: string; duration: string; speed: string}): void} {\n const element = options.element || document.createElement('details');\n if (!options.element) {element.className = 'pui-run-status pui-runtime-panel'; element.innerHTML = '<summary id=\"run-status-summary\"></summary><div id=\"run-status-details\"><div id=\"runtime-values\"></div></div>'; if (options.costs) element.querySelector('#run-status-details')!.append(options.costs);}\n const summary = element.querySelector<HTMLElement>('[id$=\"run-status-summary\"]')!; const values = element.querySelector<HTMLElement>('[id$=\"runtime-values\"]')!; const prefix = options.idPrefix ?? uniqueId('pui-runtime') + '-'; for (const child of element.children) scopeIds(child as HTMLElement, prefix); let destroyed = false;\n const list = document.createElement('dl'), note = document.createElement('p');\n note.textContent = 'Duration and average speed cover the latest task, including tools and waits. Speed uses reported output tokens, including reasoning, retries and summaries; input, cache and earlier tasks are excluded. An interrupted checkpoint shows only a lower bound for duration. Session token figures come from Pith records. Context excludes system instructions and tool schemas. Costs estimate recorded requests; unknown prices and older unrecorded requests are excluded. This is not a provider bill.';\n const rows = new Map<string,HTMLElement>();\n const updateTiming = (state: {summary: string; duration: string; speed: string}) => {if (destroyed) return; setText(summary,state.summary); const duration = rows.get('duration-value'), speed = rows.get('speed-value'); if (duration) setText(duration,state.duration); if (speed) setText(speed,state.speed);};\n const update = (state: Readonly<RuntimePanelState>) => {\n if (destroyed) return; element.hidden = !state.visible;\n if (state.visible) {\n if (list.parentElement !== values) values.replaceChildren(list,note);\n const fields: Array<[string,string,string]> = [];\n if (state.provider) fields.push(['provider','Provider',state.provider]);\n if (state.thinkingLevel) fields.push(['thinking','Thinking effort',state.thinkingLevel]);\n fields.push(['duration','Latest task duration',state.duration],['speed','Avg. output tokens/s',state.speed],['tokens','Session input / output',`${state.inputTokens} / ${state.outputTokens}`],['cache','Cache read / write',`${state.cacheRead} / ${state.cacheWrite}`],['context','Estimated conversation context',`~${state.contextTokens} / ${state.contextWindow} tokens`],['compactions','Context summaries',state.compactions],['failures','Tool failures recorded',state.toolFailures],['recorded','Recorded cost (USD)',state.recordedCost],['latest','Latest task (USD)',state.latestCost],['execution','Execution','Codemode enabled · durable local task journal']);\n const entries = fields.flatMap(([id,label,value]) => [{key:id+'-label',tag:'dt',text:label,id},{key:id+'-value',tag:'dd',text:value,id}]);\n reconcileKeyed(list,rows,entries,{key:row=>row.key,element:row=>row,create(row) {const node = document.createElement(row.tag); if (row.tag === 'dd' && (row.id === 'duration' || row.id === 'speed')) {node.id = prefix+'runtime-'+row.id; node.setAttribute('data-runtime-'+row.id,'');} return node;},update(node,row) {setText(node,row.text);},destroy() {}});\n }\n updateTiming(state);\n };\n update(initial); return {element, update, updateTiming, destroy() {if (destroyed) return; destroyed = true; rows.clear(); if (!options.element) element.remove();}};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,29 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pith-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-app.2",
|
|
4
4
|
"description": "Native TypeScript building blocks with explicit behavior and a human-verifiable component showroom.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
7
|
-
"repository": {
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/minifish-org/pith-ui.git"
|
|
10
|
+
},
|
|
8
11
|
"exports": {
|
|
9
|
-
".": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./app": {
|
|
17
|
+
"types": "./dist/app/index.d.ts",
|
|
18
|
+
"import": "./dist/app/index.js"
|
|
19
|
+
},
|
|
10
20
|
"./styles.css": "./dist/styles.css"
|
|
11
21
|
},
|
|
12
22
|
"types": "./dist/index.d.ts",
|
|
13
23
|
"main": "./dist/index.js",
|
|
14
|
-
"files": [
|
|
15
|
-
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"AI.md",
|
|
28
|
+
"API.md",
|
|
29
|
+
"APP.md",
|
|
30
|
+
"APP-API.md",
|
|
31
|
+
"LICENSE"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"**/*.css"
|
|
35
|
+
],
|
|
16
36
|
"scripts": {
|
|
37
|
+
"precheck": "npm run build",
|
|
17
38
|
"check": "tsc --noEmit",
|
|
18
39
|
"build": "tsc -p tsconfig.build.json && node scripts/build.ts",
|
|
40
|
+
"pretest": "npm run build",
|
|
19
41
|
"test": "tsc -p tsconfig.test.json && node --test test-dist/tests/*.test.js",
|
|
20
42
|
"test:browser": "playwright test",
|
|
43
|
+
"predev": "npm run build",
|
|
21
44
|
"dev": "vite --host 127.0.0.1",
|
|
45
|
+
"preshowroom:build": "npm run build",
|
|
22
46
|
"showroom:build": "vite build",
|
|
23
47
|
"preview": "vite preview --host 127.0.0.1",
|
|
24
48
|
"prepack": "npm run build"
|
|
25
49
|
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
|
|
28
|
-
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"dompurify": "3.4.16",
|
|
52
|
+
"marked": "16.4.2"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@playwright/test": "1.64.0",
|
|
56
|
+
"@types/node": "^25.0.0",
|
|
57
|
+
"typescript": "5.9.3",
|
|
58
|
+
"vite": "7.3.6"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=22.18.0"
|
|
62
|
+
}
|
|
29
63
|
}
|