aiex-cli 0.1.1-beta.1 → 0.1.1-beta.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.
@@ -1 +1 @@
1
- import{A as e,H as t,O as n,S as r,T as i,W as a,gt as o,ht as s,lt as c,n as l,r as u,tt as d,w as f,x as p,yt as m}from"./vue-i18n-Du42D0vb.js";import{i as h,m as g,v as _}from"./api-client-EJKabzZK.js";var v={class:`flex h-full min-w-0 overflow-hidden`},y={key:0,class:`flex-1 flex flex-col items-center justify-center text-muted-foreground`},b={class:`text-sm`},x={key:1,class:`flex-1 flex items-center justify-center text-muted-foreground`},S={key:2,class:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden p-4`},C={class:`mb-4 flex shrink-0 flex-wrap items-center justify-between gap-2`},w={class:`m-0 text-lg font-semibold text-foreground`},T={class:`flex shrink-0 flex-wrap items-center justify-end gap-2`},E={key:0,class:`rounded bg-secondary px-2 py-1 text-xs font-medium text-muted-foreground`},D={key:1,class:`rounded bg-secondary px-2 py-1 text-xs font-medium text-muted-foreground`},O={class:`flex-1 min-h-0 overflow-auto`},k={class:`text-sm font-mono whitespace-pre-wrap text-foreground bg-secondary border border-border rounded-lg p-4`},A=e({__name:`ExtractionViewer`,props:{extractionName:{},record:{}},emits:[`notionSynced`],setup(e,{emit:A}){let j=e,M=A,{t:N}=l(),P=c(``),F=c(!1),I=c(!1),L=p(()=>j.record?.notionStatus===`synced`?N(`app.notionSynced`):j.record?.notionStatus===`failed`?N(`app.retryNotion`):N(`app.syncNotion`)),R=p(()=>G(j.record?.inputProcessing)),z=p(()=>q(j.record));async function B(){if(j.extractionName){F.value=!0,P.value=``;try{let e=await h(j.extractionName);e.success&&e.content?P.value=e.content:_.error(e.error||N(`app.failedToLoadExtraction`))}catch{_.error(N(`app.failedToLoadExtraction`))}F.value=!1}}function V(){if(!j.extractionName||!P.value)return;let e=new Blob([P.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=j.extractionName,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}async function H(){if(j.extractionName){I.value=!0;try{let e=await g(j.extractionName);_.success(N(`app.notionSyncedToNotionDetail`,{count:e.notionPages?.length??0})),M(`notionSynced`)}catch(e){_.error(e instanceof Error?e.message:N(`app.notionSyncFailed`))}I.value=!1}}function U(e){return N(e===`synced`?`app.notionStatusSynced`:e===`failed`?`app.notionStatusFailed`:`app.notionStatusNotSynced`)}function W(e){return e.handler===`image_vision`?`Vision`:e.handler===`image_local_ocr`?`Local OCR`:e.handler===`pdf_converter`?e.converter?`PDF ${e.converter}`:`PDF converter`:`Text`}function G(e){return e?`${e.mime??e.kind} -> ${W(e)}`:``}function K(e){return`${Math.round(e*100)}%`}function q(e){let t=[],n=e?.quality;if(n?.input?.pdf){let e=n.input.pdf;t.push(`PDF ${e.pageCount}p/${e.textLength} chars${e.fallbackUsed?`/fallback`:``}`)}else n?.input?.ocr?t.push(`OCR ${K(n.input.ocr.confidence)}/${n.input.ocr.textLength} chars`):n?.input?.textLength!==void 0&&t.push(`Text ${n.input.textLength} chars`);return n?.ai&&(t.push(`AI ${n.ai.attempts} attempt${n.ai.attempts===1?``:`s`}`),n.ai.missingFieldRate!==void 0&&t.push(`missing ${K(n.ai.missingFieldRate)}`)),e?.failureStage&&t.push(`failed at ${e.failureStage}`),t.join(` · `)}function J(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}return d(()=>j.extractionName,B),t(B),(t,c)=>(a(),i(`div`,v,[e.extractionName?F.value?(a(),i(`div`,x,m(t.$t(`app.loading`)),1)):(a(),i(`div`,S,[r(`div`,C,[r(`h2`,w,m(e.extractionName),1),r(`div`,T,[R.value?(a(),i(`span`,E,m(R.value),1)):f(``,!0),z.value?(a(),i(`span`,D,m(z.value),1)):f(``,!0),e.record?(a(),i(`span`,{key:2,class:o([`rounded px-2 py-1 text-xs font-medium`,[e.record.notionStatus===`synced`?`bg-green-500/10 text-green-700`:e.record.notionStatus===`failed`?`bg-red-500/10 text-red-700`:`bg-secondary text-muted-foreground`]])},m(U(e.record.notionStatus)),3)):f(``,!0),n(s(u),{icon:`pi pi-refresh`,label:L.value,severity:`secondary`,size:`small`,loading:I.value,disabled:e.record?.notionStatus===`synced`,onClick:H},null,8,[`label`,`loading`,`disabled`]),n(s(u),{icon:`pi pi-download`,label:t.$t(`app.download`),severity:`secondary`,size:`small`,onClick:V},null,8,[`label`])])]),r(`div`,O,[r(`pre`,k,m(J(P.value)),1)])])):(a(),i(`div`,y,[c[0]||=r(`i`,{class:`pi pi-file text-4xl mb-3 opacity-50`},null,-1),r(`p`,b,m(t.$t(`app.selectExtraction`)),1)]))]))}});export{A as default};
1
+ import{A as e,H as t,O as n,S as r,T as i,W as a,gt as o,ht as s,lt as c,n as l,r as u,tt as d,w as f,x as p,yt as m}from"./vue-i18n-Du42D0vb.js";import{a as h,h as g,y as _}from"./api-client-CpqFbcyH.js";var v={class:`flex h-full min-w-0 overflow-hidden`},y={key:0,class:`flex-1 flex flex-col items-center justify-center text-muted-foreground`},b={class:`text-sm`},x={key:1,class:`flex-1 flex items-center justify-center text-muted-foreground`},S={key:2,class:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden p-4`},C={class:`mb-4 flex shrink-0 flex-wrap items-center justify-between gap-2`},w={class:`m-0 text-lg font-semibold text-foreground`},T={class:`flex shrink-0 flex-wrap items-center justify-end gap-2`},E={key:0,class:`rounded bg-secondary px-2 py-1 text-xs font-medium text-muted-foreground`},D={key:1,class:`rounded bg-secondary px-2 py-1 text-xs font-medium text-muted-foreground`},O={class:`flex-1 min-h-0 overflow-auto`},k={class:`text-sm font-mono whitespace-pre-wrap text-foreground bg-secondary border border-border rounded-lg p-4`},A=e({__name:`ExtractionViewer`,props:{extractionName:{},record:{}},emits:[`notionSynced`],setup(e,{emit:A}){let j=e,M=A,{t:N}=l(),P=c(``),F=c(!1),I=c(!1),L=p(()=>j.record?.notionStatus===`synced`?N(`app.notionSynced`):j.record?.notionStatus===`failed`?N(`app.retryNotion`):N(`app.syncNotion`)),R=p(()=>G(j.record?.inputProcessing)),z=p(()=>q(j.record));async function B(){if(j.extractionName){F.value=!0,P.value=``;try{let e=await h(j.extractionName);e.success&&e.content?P.value=e.content:_.error(e.error||N(`app.failedToLoadExtraction`))}catch{_.error(N(`app.failedToLoadExtraction`))}F.value=!1}}function V(){if(!j.extractionName||!P.value)return;let e=new Blob([P.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=j.extractionName,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}async function H(){if(j.extractionName){I.value=!0;try{let e=await g(j.extractionName);_.success(N(`app.notionSyncedToNotionDetail`,{count:e.notionPages?.length??0})),M(`notionSynced`)}catch(e){_.error(e instanceof Error?e.message:N(`app.notionSyncFailed`))}I.value=!1}}function U(e){return N(e===`synced`?`app.notionStatusSynced`:e===`failed`?`app.notionStatusFailed`:`app.notionStatusNotSynced`)}function W(e){return e.handler===`image_vision`?`Vision`:e.handler===`image_local_ocr`?`Local OCR`:e.handler===`pdf_converter`?e.converter?`PDF ${e.converter}`:`PDF converter`:`Text`}function G(e){return e?`${e.mime??e.kind} -> ${W(e)}`:``}function K(e){return`${Math.round(e*100)}%`}function q(e){let t=[],n=e?.quality;if(n?.input?.pdf){let e=n.input.pdf;t.push(`PDF ${e.pageCount}p/${e.textLength} chars${e.fallbackUsed?`/fallback`:``}`)}else n?.input?.ocr?t.push(`OCR ${K(n.input.ocr.confidence)}/${n.input.ocr.textLength} chars`):n?.input?.textLength!==void 0&&t.push(`Text ${n.input.textLength} chars`);return n?.ai&&(t.push(`AI ${n.ai.attempts} attempt${n.ai.attempts===1?``:`s`}`),n.ai.missingFieldRate!==void 0&&t.push(`missing ${K(n.ai.missingFieldRate)}`)),e?.failureStage&&t.push(`failed at ${e.failureStage}`),t.join(` · `)}function J(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}return d(()=>j.extractionName,B),t(B),(t,c)=>(a(),i(`div`,v,[e.extractionName?F.value?(a(),i(`div`,x,m(t.$t(`app.loading`)),1)):(a(),i(`div`,S,[r(`div`,C,[r(`h2`,w,m(e.extractionName),1),r(`div`,T,[R.value?(a(),i(`span`,E,m(R.value),1)):f(``,!0),z.value?(a(),i(`span`,D,m(z.value),1)):f(``,!0),e.record?(a(),i(`span`,{key:2,class:o([`rounded px-2 py-1 text-xs font-medium`,[e.record.notionStatus===`synced`?`bg-green-500/10 text-green-700`:e.record.notionStatus===`failed`?`bg-red-500/10 text-red-700`:`bg-secondary text-muted-foreground`]])},m(U(e.record.notionStatus)),3)):f(``,!0),n(s(u),{icon:`pi pi-refresh`,label:L.value,severity:`secondary`,size:`small`,loading:I.value,disabled:e.record?.notionStatus===`synced`,onClick:H},null,8,[`label`,`loading`,`disabled`]),n(s(u),{icon:`pi pi-download`,label:t.$t(`app.download`),severity:`secondary`,size:`small`,onClick:V},null,8,[`label`])])]),r(`div`,O,[r(`pre`,k,m(J(P.value)),1)])])):(a(),i(`div`,y,[c[0]||=r(`i`,{class:`pi pi-file text-4xl mb-3 opacity-50`},null,-1),r(`p`,b,m(t.$t(`app.selectExtraction`)),1)]))]))}});export{A as default};