lightpdf-aipdf-mcp 0.1.78__py3-none-any.whl → 0.1.80__py3-none-any.whl
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.
- lightpdf_aipdf_mcp/common.py +1 -0
- lightpdf_aipdf_mcp/converter.py +5 -2
- lightpdf_aipdf_mcp/editor.py +10 -4
- lightpdf_aipdf_mcp/server.py +6 -0
- {lightpdf_aipdf_mcp-0.1.78.dist-info → lightpdf_aipdf_mcp-0.1.80.dist-info}/METADATA +1 -1
- lightpdf_aipdf_mcp-0.1.80.dist-info/RECORD +9 -0
- lightpdf_aipdf_mcp-0.1.78.dist-info/RECORD +0 -9
- {lightpdf_aipdf_mcp-0.1.78.dist-info → lightpdf_aipdf_mcp-0.1.80.dist-info}/WHEEL +0 -0
- {lightpdf_aipdf_mcp-0.1.78.dist-info → lightpdf_aipdf_mcp-0.1.80.dist-info}/entry_points.txt +0 -0
lightpdf_aipdf_mcp/common.py
CHANGED
lightpdf_aipdf_mcp/converter.py
CHANGED
@@ -243,6 +243,7 @@ class Converter(BaseApiClient):
|
|
243
243
|
|
244
244
|
import httpx
|
245
245
|
async with httpx.AsyncClient(timeout=3600.0) as client:
|
246
|
+
task_id = None
|
246
247
|
try:
|
247
248
|
# 初始化extra_params(如果为None)
|
248
249
|
if extra_params is None:
|
@@ -269,7 +270,8 @@ class Converter(BaseApiClient):
|
|
269
270
|
file_path=file_path,
|
270
271
|
error_message=None,
|
271
272
|
download_url=download_url,
|
272
|
-
original_name=original_name
|
273
|
+
original_name=original_name,
|
274
|
+
task_id=task_id
|
273
275
|
)
|
274
276
|
|
275
277
|
except Exception as e:
|
@@ -278,7 +280,8 @@ class Converter(BaseApiClient):
|
|
278
280
|
file_path=file_path,
|
279
281
|
error_message=str(e),
|
280
282
|
download_url=None,
|
281
|
-
original_name=original_name
|
283
|
+
original_name=original_name,
|
284
|
+
task_id=task_id
|
282
285
|
)
|
283
286
|
|
284
287
|
async def _create_task(self, client: httpx.AsyncClient, file_path: str, format: str, extra_params: dict = None) -> str:
|
lightpdf_aipdf_mcp/editor.py
CHANGED
@@ -138,6 +138,7 @@ class Editor(BaseApiClient):
|
|
138
138
|
|
139
139
|
# 合并PDF需要特殊处理,因为涉及多个文件
|
140
140
|
async with httpx.AsyncClient(timeout=3600.0) as client:
|
141
|
+
task_id = None
|
141
142
|
try:
|
142
143
|
# 创建合并任务
|
143
144
|
task_id = await self._create_merge_task(client, file_paths, password, original_name)
|
@@ -153,7 +154,8 @@ class Editor(BaseApiClient):
|
|
153
154
|
file_path=file_paths[0], # 使用第一个文件路径作为参考
|
154
155
|
error_message=None,
|
155
156
|
download_url=download_url,
|
156
|
-
original_name=original_name
|
157
|
+
original_name=original_name,
|
158
|
+
task_id=task_id
|
157
159
|
)
|
158
160
|
|
159
161
|
except Exception as e:
|
@@ -162,7 +164,8 @@ class Editor(BaseApiClient):
|
|
162
164
|
file_path=file_paths[0],
|
163
165
|
error_message=str(e),
|
164
166
|
download_url=None,
|
165
|
-
original_name=original_name
|
167
|
+
original_name=original_name,
|
168
|
+
task_id=task_id
|
166
169
|
)
|
167
170
|
|
168
171
|
async def rotate_pdf(self, file_path: str, angle_params: Dict[str, str], password: Optional[str] = None, original_name: Optional[str] = None) -> EditResult:
|
@@ -445,6 +448,7 @@ class Editor(BaseApiClient):
|
|
445
448
|
return EditResult(success=False, file_path=file_path, error_message="文件不存在", original_name=original_name)
|
446
449
|
|
447
450
|
async with httpx.AsyncClient(timeout=3600.0) as client:
|
451
|
+
task_id = None
|
448
452
|
try:
|
449
453
|
# 初始化extra_params(如果为None)
|
450
454
|
if extra_params is None:
|
@@ -471,7 +475,8 @@ class Editor(BaseApiClient):
|
|
471
475
|
file_path=file_path,
|
472
476
|
error_message=None,
|
473
477
|
download_url=download_url,
|
474
|
-
original_name=original_name
|
478
|
+
original_name=original_name,
|
479
|
+
task_id=task_id
|
475
480
|
)
|
476
481
|
|
477
482
|
except Exception as e:
|
@@ -480,7 +485,8 @@ class Editor(BaseApiClient):
|
|
480
485
|
file_path=file_path,
|
481
486
|
error_message=str(e),
|
482
487
|
download_url=None,
|
483
|
-
original_name=original_name
|
488
|
+
original_name=original_name,
|
489
|
+
task_id=task_id
|
484
490
|
)
|
485
491
|
|
486
492
|
async def _create_task(self, client: httpx.AsyncClient, file_path: str, edit_type: EditType, extra_params: Dict[str, Any] = None) -> str:
|
lightpdf_aipdf_mcp/server.py
CHANGED
@@ -57,12 +57,18 @@ def generate_result_report(
|
|
57
57
|
report_obj["success_files"].append({
|
58
58
|
"download_url": result.download_url,
|
59
59
|
"original_name": result.original_name,
|
60
|
+
"debug": {
|
61
|
+
"task_id": result.task_id
|
62
|
+
}
|
60
63
|
})
|
61
64
|
else:
|
62
65
|
# 添加失败的文件信息
|
63
66
|
report_obj["failed_files"].append({
|
64
67
|
"error_message": result.error_message,
|
65
68
|
"original_name": result.original_name,
|
69
|
+
"debug": {
|
70
|
+
"task_id": result.task_id
|
71
|
+
}
|
66
72
|
})
|
67
73
|
|
68
74
|
# 返回JSON字符串
|
@@ -0,0 +1,9 @@
|
|
1
|
+
lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
|
2
|
+
lightpdf_aipdf_mcp/common.py,sha256=_UO1f6S9Qr_3k6u5iBpdVDpvTK5U-tHEpu9KsDGqV8Y,6635
|
3
|
+
lightpdf_aipdf_mcp/converter.py,sha256=vdcir8O1_inbVmzjxcHlCDDr8Nzus1A5ARuVVXl-_1U,14669
|
4
|
+
lightpdf_aipdf_mcp/editor.py,sha256=O7wF_HWs5l-IiXLbZYLNYjj1ygo2v4yGJEYMJtn7jpo,26916
|
5
|
+
lightpdf_aipdf_mcp/server.py,sha256=gVu99QUN-9impuOMQnAfkBVtAaFF3lIsZuutb8pqVls,47395
|
6
|
+
lightpdf_aipdf_mcp-0.1.80.dist-info/METADATA,sha256=rQF6Vzt8VHEJ0sdkwKKCcqB95Whk1TrAFMGaEyMDSBk,8119
|
7
|
+
lightpdf_aipdf_mcp-0.1.80.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
lightpdf_aipdf_mcp-0.1.80.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
9
|
+
lightpdf_aipdf_mcp-0.1.80.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
|
2
|
-
lightpdf_aipdf_mcp/common.py,sha256=m_fNxU9NqJOgF3FpTWPpprPkIe60YjnU1tEN6cI660Q,6601
|
3
|
-
lightpdf_aipdf_mcp/converter.py,sha256=CNdR2uUsA79_6Mzk6eHxo_F7Ripl14S8BdsmKJkV-94,14568
|
4
|
-
lightpdf_aipdf_mcp/editor.py,sha256=NEBu6QUcU6xYIa8ZsAoNABEr0ADxFVKWVrHrb28mjxY,26714
|
5
|
-
lightpdf_aipdf_mcp/server.py,sha256=ggKfRPZVAjn6Piwg-WcMAld_h7KcuijITm-gjDa__Kw,47213
|
6
|
-
lightpdf_aipdf_mcp-0.1.78.dist-info/METADATA,sha256=yVnWirRXC0Mijh4OORHYbBMqlGKax4CD_NGS9jxUJV0,8119
|
7
|
-
lightpdf_aipdf_mcp-0.1.78.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
-
lightpdf_aipdf_mcp-0.1.78.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
9
|
-
lightpdf_aipdf_mcp-0.1.78.dist-info/RECORD,,
|
File without changes
|
{lightpdf_aipdf_mcp-0.1.78.dist-info → lightpdf_aipdf_mcp-0.1.80.dist-info}/entry_points.txt
RENAMED
File without changes
|