@mulmochat-plugin/summarize-pdf 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -83
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -9
- package/dist/plugin-CKI99T7w.js +78 -0
- package/dist/plugin-DAF0z9t_.cjs +1 -0
- package/dist/style.css +3 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +86 -121
- package/package.json +17 -15
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugin-DAF0z9t_.cjs`);exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.createUploadedPdfResult=e.t,exports.executeSummarizePdf=e.n,exports.pluginCore=e.r;
|
package/dist/core.js
CHANGED
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
name: i,
|
|
4
|
-
description: "Summarize the content of a currently selected PDF file using Claude.",
|
|
5
|
-
parameters: {
|
|
6
|
-
type: "object",
|
|
7
|
-
properties: {
|
|
8
|
-
prompt: {
|
|
9
|
-
type: "string",
|
|
10
|
-
description: "Instructions for Claude on how to summarize or analyze the PDF"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
required: ["prompt"]
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
function u(e, a) {
|
|
17
|
-
return {
|
|
18
|
-
toolName: i,
|
|
19
|
-
data: { pdfData: e, fileName: a },
|
|
20
|
-
message: "",
|
|
21
|
-
title: a
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const l = async (e, a) => {
|
|
25
|
-
const { prompt: n } = a, r = e.currentResult?.data;
|
|
26
|
-
if (!r?.pdfData)
|
|
27
|
-
return {
|
|
28
|
-
message: "No PDF file available to summarize. Please select a PDF file first.",
|
|
29
|
-
instructions: "Tell the user that no PDF file is currently selected and they need to upload a PDF file first."
|
|
30
|
-
};
|
|
31
|
-
if (!e.app?.summarizePdf)
|
|
32
|
-
return {
|
|
33
|
-
message: "summarizePdf function not available",
|
|
34
|
-
instructions: "Tell the user that the PDF summarization failed."
|
|
35
|
-
};
|
|
36
|
-
try {
|
|
37
|
-
const t = (await e.app.summarizePdf({
|
|
38
|
-
prompt: n,
|
|
39
|
-
pdfData: r.pdfData
|
|
40
|
-
})).summary || "";
|
|
41
|
-
return {
|
|
42
|
-
data: {
|
|
43
|
-
...r,
|
|
44
|
-
summary: t
|
|
45
|
-
},
|
|
46
|
-
jsonData: {
|
|
47
|
-
fileName: r.fileName,
|
|
48
|
-
summary: t
|
|
49
|
-
},
|
|
50
|
-
message: "PDF summarized successfully",
|
|
51
|
-
instructions: "Give the user a brief summary of the PDF.",
|
|
52
|
-
instructionsRequired: !0,
|
|
53
|
-
updating: !0
|
|
54
|
-
};
|
|
55
|
-
} catch (s) {
|
|
56
|
-
console.error("PDF summarization failed", s);
|
|
57
|
-
const t = s instanceof Error ? s.message : "Unknown error";
|
|
58
|
-
return {
|
|
59
|
-
message: `PDF summarization failed: ${t}`,
|
|
60
|
-
instructions: `Tell the user that the PDF summarization failed with error: ${t}`
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}, m = {
|
|
64
|
-
toolDefinition: o,
|
|
65
|
-
execute: l,
|
|
66
|
-
generatingMessage: "Summarizing PDF...",
|
|
67
|
-
uploadMessage: "PDF file is available. Call 'summarizePDF' to see its summary",
|
|
68
|
-
isEnabled: (e) => !!e?.hasAnthropicApiKey,
|
|
69
|
-
inputHandlers: [
|
|
70
|
-
{
|
|
71
|
-
type: "file",
|
|
72
|
-
acceptedTypes: ["application/pdf"],
|
|
73
|
-
handleInput: u
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
77
|
-
export {
|
|
78
|
-
o as TOOL_DEFINITION,
|
|
79
|
-
i as TOOL_NAME,
|
|
80
|
-
u as createUploadedPdfResult,
|
|
81
|
-
l as executeSummarizePdf,
|
|
82
|
-
m as pluginCore
|
|
83
|
-
};
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./plugin-CKI99T7w.js";
|
|
2
|
+
export { t as TOOL_DEFINITION, e as TOOL_NAME, i as createUploadedPdfResult, n as executeSummarizePdf, r as pluginCore };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin-DAF0z9t_.cjs`);require(`./core.cjs`),exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.createUploadedPdfResult=e.t,exports.default=e.r,exports.pluginCore=e.r,exports.executeSummarizePdf=e.n;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* import "@mulmochat-plugin/summarize-pdf/style.css";
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export * from "./core";
|
|
19
|
-
export { pluginCore as default } from "./core";
|
|
20
|
-
export { createUploadedPdfResult } from "./core";
|
|
18
|
+
export * from "./core/index";
|
|
19
|
+
export { pluginCore as default } from "./core/index";
|
|
20
|
+
export { createUploadedPdfResult } from "./core/index";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
a as TOOL_NAME,
|
|
5
|
-
d as createUploadedPdfResult,
|
|
6
|
-
l as default,
|
|
7
|
-
o as executeSummarizePdf,
|
|
8
|
-
t as pluginCore
|
|
9
|
-
};
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./plugin-CKI99T7w.js";
|
|
2
|
+
import "./core.js";
|
|
3
|
+
export { t as TOOL_DEFINITION, e as TOOL_NAME, i as createUploadedPdfResult, r as default, r as pluginCore, n as executeSummarizePdf };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//#region src/core/definition.ts
|
|
2
|
+
var e = "summarizePDF", t = {
|
|
3
|
+
type: "function",
|
|
4
|
+
name: e,
|
|
5
|
+
description: "Summarize the content of a currently selected PDF file using Claude.",
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: { prompt: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Instructions for Claude on how to summarize or analyze the PDF"
|
|
11
|
+
} },
|
|
12
|
+
required: ["prompt"]
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/core/plugin.ts
|
|
17
|
+
function n(t, n) {
|
|
18
|
+
return {
|
|
19
|
+
toolName: e,
|
|
20
|
+
data: {
|
|
21
|
+
pdfData: t,
|
|
22
|
+
fileName: n
|
|
23
|
+
},
|
|
24
|
+
message: "",
|
|
25
|
+
title: n
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var r = async (e, t) => {
|
|
29
|
+
let { prompt: n } = t, r = e.currentResult?.data;
|
|
30
|
+
if (!r?.pdfData) return {
|
|
31
|
+
message: "No PDF file available to summarize. Please select a PDF file first.",
|
|
32
|
+
instructions: "Tell the user that no PDF file is currently selected and they need to upload a PDF file first."
|
|
33
|
+
};
|
|
34
|
+
if (!e.app?.summarizePdf) return {
|
|
35
|
+
message: "summarizePdf function not available",
|
|
36
|
+
instructions: "Tell the user that the PDF summarization failed."
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
let t = (await e.app.summarizePdf({
|
|
40
|
+
prompt: n,
|
|
41
|
+
pdfData: r.pdfData
|
|
42
|
+
})).summary || "";
|
|
43
|
+
return {
|
|
44
|
+
data: {
|
|
45
|
+
...r,
|
|
46
|
+
summary: t
|
|
47
|
+
},
|
|
48
|
+
jsonData: {
|
|
49
|
+
fileName: r.fileName,
|
|
50
|
+
summary: t
|
|
51
|
+
},
|
|
52
|
+
message: "PDF summarized successfully",
|
|
53
|
+
instructions: "Give the user a brief summary of the PDF.",
|
|
54
|
+
instructionsRequired: !0,
|
|
55
|
+
updating: !0
|
|
56
|
+
};
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.error("PDF summarization failed", e);
|
|
59
|
+
let t = e instanceof Error ? e.message : "Unknown error";
|
|
60
|
+
return {
|
|
61
|
+
message: `PDF summarization failed: ${t}`,
|
|
62
|
+
instructions: `Tell the user that the PDF summarization failed with error: ${t}`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}, i = {
|
|
66
|
+
toolDefinition: t,
|
|
67
|
+
execute: r,
|
|
68
|
+
generatingMessage: "Summarizing PDF...",
|
|
69
|
+
waitingMessage: "PDF file is available. Call 'summarizePDF' to see its summary",
|
|
70
|
+
isEnabled: (e) => !!e?.hasAnthropicApiKey,
|
|
71
|
+
inputHandlers: [{
|
|
72
|
+
type: "file",
|
|
73
|
+
acceptedTypes: ["application/pdf"],
|
|
74
|
+
handleInput: n
|
|
75
|
+
}]
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { e as a, t as i, r as n, i as r, n as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`summarizePDF`,t={type:`function`,name:e,description:`Summarize the content of a currently selected PDF file using Claude.`,parameters:{type:`object`,properties:{prompt:{type:`string`,description:`Instructions for Claude on how to summarize or analyze the PDF`}},required:[`prompt`]}};function n(t,n){return{toolName:e,data:{pdfData:t,fileName:n},message:``,title:n}}var r=async(e,t)=>{let{prompt:n}=t,r=e.currentResult?.data;if(!r?.pdfData)return{message:`No PDF file available to summarize. Please select a PDF file first.`,instructions:`Tell the user that no PDF file is currently selected and they need to upload a PDF file first.`};if(!e.app?.summarizePdf)return{message:`summarizePdf function not available`,instructions:`Tell the user that the PDF summarization failed.`};try{let t=(await e.app.summarizePdf({prompt:n,pdfData:r.pdfData})).summary||``;return{data:{...r,summary:t},jsonData:{fileName:r.fileName,summary:t},message:`PDF summarized successfully`,instructions:`Give the user a brief summary of the PDF.`,instructionsRequired:!0,updating:!0}}catch(e){console.error(`PDF summarization failed`,e);let t=e instanceof Error?e.message:`Unknown error`;return{message:`PDF summarization failed: ${t}`,instructions:`Tell the user that the PDF summarization failed with error: ${t}`}}},i={toolDefinition:t,execute:r,generatingMessage:`Summarizing PDF...`,waitingMessage:`PDF file is available. Call 'summarizePDF' to see its summary`,isEnabled:e=>!!e?.hasAnthropicApiKey,inputHandlers:[{type:`file`,acceptedTypes:[`application/pdf`],handleInput:n}]};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
package/dist/style.css
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.block{display:block}.contents{display:contents}.flex{display:flex}.h-12{height:calc(var(--spacing)*12)}.h-32{height:calc(var(--spacing)*32)}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing)*64)}.min-h-0{min-height:calc(var(--spacing)*0)}.w-12{width:calc(var(--spacing)*12)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.max-w-none{max-width:none}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-none{--tw-border-style:none;border-style:none}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-red-500{color:var(--color-red-500)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.file\:mr-4::file-selector-button{margin-right:calc(var(--spacing)*4)}.file\:rounded-md::file-selector-button{border-radius:var(--radius-md)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-indigo-50::file-selector-button{background-color:var(--color-indigo-50)}.file\:px-4::file-selector-button{padding-inline:calc(var(--spacing)*4)}.file\:py-2::file-selector-button{padding-block:calc(var(--spacing)*2)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-semibold::file-selector-button{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.file\:text-indigo-700::file-selector-button{color:var(--color-indigo-700)}@media(hover:hover){.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:file\:bg-indigo-100:hover::file-selector-button{background-color:var(--color-indigo-100)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media(prefers-color-scheme:dark){.dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark\:text-gray-300{color:var(--color-gray-300)}}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.block{display:block}.contents{display:contents}.flex{display:flex}.h-12{height:calc(var(--spacing) * 12)}.h-32{height:calc(var(--spacing) * 32)}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing) * 64)}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-12{width:calc(var(--spacing) * 12)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.max-w-none{max-width:none}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-none{--tw-border-style:none;border-style:none}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-red-500{color:var(--color-red-500)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.file\:mr-4::file-selector-button{margin-right:calc(var(--spacing) * 4)}.file\:rounded-md::file-selector-button{border-radius:var(--radius-md)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-indigo-50::file-selector-button{background-color:var(--color-indigo-50)}.file\:px-4::file-selector-button{padding-inline:calc(var(--spacing) * 4)}.file\:py-2::file-selector-button{padding-block:calc(var(--spacing) * 2)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-semibold::file-selector-button{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.file\:text-indigo-700::file-selector-button{color:var(--color-indigo-700)}@media (hover:hover){.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:file\:bg-indigo-100:hover::file-selector-button{background-color:var(--color-indigo-100)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab, red, red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media (prefers-color-scheme:dark){.dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark\:text-gray-300{color:var(--color-gray-300)}}}body{margin:calc(var(--spacing) * 0);background-color:var(--color-gray-100);padding:calc(var(--spacing) * 5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
3
|
+
/*$vite$:1*/
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin-DAF0z9t_.cjs`);let t=require(`vue`),n=require(`marked`);var r={class:`w-full h-full flex flex-col p-4`},i={class:`flex-1 w-full min-h-0`},a=[`src`],o={key:0,class:`mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded-lg flex-shrink-0`},s={class:`text-sm text-gray-700 dark:text-gray-300`},c={key:1,class:`mt-2 p-3 bg-white rounded-lg flex-shrink-0 max-h-64 overflow-y-auto border border-gray-200`},l=[`innerHTML`],u=(0,t.defineComponent)({__name:`View`,props:{selectedResult:{}},setup(e){let u=e,d=(0,t.ref)(null),f=(0,t.ref)(``);(0,t.watch)(()=>u.selectedResult,e=>{e?.toolName===`summarizePDF`&&e.data&&(d.value=e.data,m(e))},{immediate:!0,deep:!0});let p=(0,t.computed)(()=>{let e=d.value?.summary;return e?(0,n.marked)(e):``});async function m(e){let t=e.data,n=e.uuid;if(t?.pdfData){if(!n){f.value=t.pdfData;return}try{let e=await fetch(`/api/save-pdf`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pdfData:t.pdfData,uuid:n,fileName:t.fileName||`document.pdf`})});if(!e.ok)throw Error(`Failed to save PDF`);f.value=(await e.json()).pdfUrl}catch(e){console.error(`Failed to save PDF to output folder:`,e),f.value=t.pdfData}}}return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`div`,i,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(`iframe`,{key:0,src:f.value,class:`w-full h-full border-0 rounded`,title:`PDF Viewer`},null,8,a)):(0,t.createCommentVNode)(``,!0)]),d.value?.fileName?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,o,[(0,t.createElementVNode)(`p`,s,[n[0]||=(0,t.createElementVNode)(`span`,{class:`font-medium`},`File:`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(d.value.fileName),1)])])):(0,t.createCommentVNode)(``,!0),d.value?.summary?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,c,[n[1]||=(0,t.createElementVNode)(`p`,{class:`text-sm font-medium text-gray-700 mb-2`},`Summary:`,-1),(0,t.createElementVNode)(`div`,{class:`markdown-content prose prose-sm prose-slate max-w-none`,innerHTML:p.value},null,8,l)])):(0,t.createCommentVNode)(``,!0)]))}}),d={class:`w-full h-32 bg-gray-200 dark:bg-gray-700 rounded flex items-center justify-center`},f={class:`text-center`},p={class:`text-xs mt-2 text-gray-600 dark:text-gray-300`},m=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let n=e,r=(0,t.computed)(()=>n.result.data);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,d,[(0,t.createElementVNode)(`div`,f,[n[0]||=(0,t.createElementVNode)(`svg`,{class:`w-12 h-12 mx-auto text-red-500`,fill:`currentColor`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{"fill-rule":`evenodd`,d:`M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z`,"clip-rule":`evenodd`})],-1),(0,t.createElementVNode)(`p`,p,(0,t.toDisplayString)(r.value?.fileName||`PDF`),1)])]))}}),h={...e.r,viewComponent:u,previewComponent:m},g={plugin:h};exports.Preview=m,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.View=u,exports.createUploadedPdfResult=e.t,exports.default=g,exports.executeSummarizePdf=e.n,exports.plugin=h,exports.pluginCore=e.r;
|
package/dist/vue.js
CHANGED
|
@@ -1,121 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const u = i, a = v(() => u.result.data);
|
|
88
|
-
return (o, n) => (l(), s("div", S, [
|
|
89
|
-
r("div", E, [
|
|
90
|
-
n[0] || (n[0] = r("svg", {
|
|
91
|
-
class: "w-12 h-12 mx-auto text-red-500",
|
|
92
|
-
fill: "currentColor",
|
|
93
|
-
viewBox: "0 0 20 20",
|
|
94
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
95
|
-
}, [
|
|
96
|
-
r("path", {
|
|
97
|
-
"fill-rule": "evenodd",
|
|
98
|
-
d: "M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",
|
|
99
|
-
"clip-rule": "evenodd"
|
|
100
|
-
})
|
|
101
|
-
], -1)),
|
|
102
|
-
r("p", L, x(a.value?.fileName || "PDF"), 1)
|
|
103
|
-
])
|
|
104
|
-
]));
|
|
105
|
-
}
|
|
106
|
-
}), $ = {
|
|
107
|
-
...h,
|
|
108
|
-
viewComponent: O,
|
|
109
|
-
previewComponent: M
|
|
110
|
-
}, H = { plugin: $ };
|
|
111
|
-
export {
|
|
112
|
-
M as Preview,
|
|
113
|
-
z as TOOL_DEFINITION,
|
|
114
|
-
g as TOOL_NAME,
|
|
115
|
-
O as View,
|
|
116
|
-
J as createUploadedPdfResult,
|
|
117
|
-
H as default,
|
|
118
|
-
R as executeSummarizePdf,
|
|
119
|
-
$ as plugin,
|
|
120
|
-
h as pluginCore
|
|
121
|
-
};
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./plugin-CKI99T7w.js";
|
|
2
|
+
import { computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, openBlock as d, ref as f, toDisplayString as p, watch as m } from "vue";
|
|
3
|
+
import { marked as h } from "marked";
|
|
4
|
+
//#region src/vue/View.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var g = { class: "w-full h-full flex flex-col p-4" }, _ = { class: "flex-1 w-full min-h-0" }, v = ["src"], y = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded-lg flex-shrink-0"
|
|
8
|
+
}, b = { class: "text-sm text-gray-700 dark:text-gray-300" }, x = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "mt-2 p-3 bg-white rounded-lg flex-shrink-0 max-h-64 overflow-y-auto border border-gray-200"
|
|
11
|
+
}, S = ["innerHTML"], C = /* @__PURE__ */ u({
|
|
12
|
+
__name: "View",
|
|
13
|
+
props: { selectedResult: {} },
|
|
14
|
+
setup(e) {
|
|
15
|
+
let t = e, n = f(null), r = f("");
|
|
16
|
+
m(() => t.selectedResult, (e) => {
|
|
17
|
+
e?.toolName === "summarizePDF" && e.data && (n.value = e.data, u(e));
|
|
18
|
+
}, {
|
|
19
|
+
immediate: !0,
|
|
20
|
+
deep: !0
|
|
21
|
+
});
|
|
22
|
+
let i = a(() => {
|
|
23
|
+
let e = n.value?.summary;
|
|
24
|
+
return e ? h(e) : "";
|
|
25
|
+
});
|
|
26
|
+
async function u(e) {
|
|
27
|
+
let t = e.data, n = e.uuid;
|
|
28
|
+
if (t?.pdfData) {
|
|
29
|
+
if (!n) {
|
|
30
|
+
r.value = t.pdfData;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
let e = await fetch("/api/save-pdf", {
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: { "Content-Type": "application/json" },
|
|
37
|
+
body: JSON.stringify({
|
|
38
|
+
pdfData: t.pdfData,
|
|
39
|
+
uuid: n,
|
|
40
|
+
fileName: t.fileName || "document.pdf"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
if (!e.ok) throw Error("Failed to save PDF");
|
|
44
|
+
r.value = (await e.json()).pdfUrl;
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error("Failed to save PDF to output folder:", e), r.value = t.pdfData;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return (e, t) => (d(), s("div", g, [
|
|
51
|
+
c("div", _, [r.value ? (d(), s("iframe", {
|
|
52
|
+
key: 0,
|
|
53
|
+
src: r.value,
|
|
54
|
+
class: "w-full h-full border-0 rounded",
|
|
55
|
+
title: "PDF Viewer"
|
|
56
|
+
}, null, 8, v)) : o("", !0)]),
|
|
57
|
+
n.value?.fileName ? (d(), s("div", y, [c("p", b, [t[0] ||= c("span", { class: "font-medium" }, "File:", -1), l(" " + p(n.value.fileName), 1)])])) : o("", !0),
|
|
58
|
+
n.value?.summary ? (d(), s("div", x, [t[1] ||= c("p", { class: "text-sm font-medium text-gray-700 mb-2" }, "Summary:", -1), c("div", {
|
|
59
|
+
class: "markdown-content prose prose-sm prose-slate max-w-none",
|
|
60
|
+
innerHTML: i.value
|
|
61
|
+
}, null, 8, S)])) : o("", !0)
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
}), w = { class: "w-full h-32 bg-gray-200 dark:bg-gray-700 rounded flex items-center justify-center" }, T = { class: "text-center" }, E = { class: "text-xs mt-2 text-gray-600 dark:text-gray-300" }, D = /* @__PURE__ */ u({
|
|
65
|
+
__name: "Preview",
|
|
66
|
+
props: { result: {} },
|
|
67
|
+
setup(e) {
|
|
68
|
+
let t = e, n = a(() => t.result.data);
|
|
69
|
+
return (e, t) => (d(), s("div", w, [c("div", T, [t[0] ||= c("svg", {
|
|
70
|
+
class: "w-12 h-12 mx-auto text-red-500",
|
|
71
|
+
fill: "currentColor",
|
|
72
|
+
viewBox: "0 0 20 20",
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
74
|
+
}, [c("path", {
|
|
75
|
+
"fill-rule": "evenodd",
|
|
76
|
+
d: "M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",
|
|
77
|
+
"clip-rule": "evenodd"
|
|
78
|
+
})], -1), c("p", E, p(n.value?.fileName || "PDF"), 1)])]));
|
|
79
|
+
}
|
|
80
|
+
}), O = {
|
|
81
|
+
...r,
|
|
82
|
+
viewComponent: C,
|
|
83
|
+
previewComponent: D
|
|
84
|
+
}, k = { plugin: O };
|
|
85
|
+
//#endregion
|
|
86
|
+
export { D as Preview, t as TOOL_DEFINITION, e as TOOL_NAME, C as View, i as createUploadedPdfResult, k as default, n as executeSummarizePdf, O as plugin, r as pluginCore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mulmochat-plugin/summarize-pdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "PDF summarization plugin for MulmoChat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -37,23 +37,25 @@
|
|
|
37
37
|
"vue": "^3.5.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"gui-chat-protocol": "^0.0
|
|
40
|
+
"gui-chat-protocol": "^0.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"eslint
|
|
49
|
-
"
|
|
43
|
+
"@eslint/js": "^10.0.1",
|
|
44
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
47
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
48
|
+
"eslint": "^10.1.0",
|
|
49
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
50
|
+
"globals": "^17.4.0",
|
|
51
|
+
"gui-chat-protocol": "^0.1.0",
|
|
50
52
|
"marked": "^17.0.1",
|
|
51
|
-
"tailwindcss": "^4.
|
|
52
|
-
"typescript": "~
|
|
53
|
-
"vite": "^
|
|
54
|
-
"vue": "^3.5.
|
|
55
|
-
"vue-eslint-parser": "^10.
|
|
56
|
-
"vue-tsc": "^3.2.
|
|
53
|
+
"tailwindcss": "^4.2.2",
|
|
54
|
+
"typescript": "~6.0.2",
|
|
55
|
+
"vite": "^8.0.3",
|
|
56
|
+
"vue": "^3.5.31",
|
|
57
|
+
"vue-eslint-parser": "^10.4.0",
|
|
58
|
+
"vue-tsc": "^3.2.6"
|
|
57
59
|
},
|
|
58
60
|
"keywords": [
|
|
59
61
|
"mulmochat",
|