offagent 0.10.0__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.
- offagent/__init__.py +3 -0
- offagent/__main__.py +5 -0
- offagent/adapters/__init__.py +1 -0
- offagent/adapters/docx_adapter.py +1237 -0
- offagent/adapters/embedding_provider.py +132 -0
- offagent/adapters/pptx_adapter.py +940 -0
- offagent/adapters/xlsx_adapter.py +1266 -0
- offagent/app/__init__.py +1 -0
- offagent/app/progress.py +52 -0
- offagent/app/services.py +4267 -0
- offagent/config.py +287 -0
- offagent/domain/__init__.py +1 -0
- offagent/domain/locators.py +444 -0
- offagent/domain/models.py +477 -0
- offagent/domain/text_fragments.py +136 -0
- offagent/errors.py +29 -0
- offagent/indexing/__init__.py +1 -0
- offagent/indexing/store.py +795 -0
- offagent/interfaces/__init__.py +1 -0
- offagent/interfaces/cli.py +438 -0
- offagent/interfaces/cli_output.py +139 -0
- offagent/interfaces/cli_progress.py +120 -0
- offagent/interfaces/mcp.py +1145 -0
- offagent/interfaces/mcp_converters.py +80 -0
- offagent/interfaces/mcp_models.py +923 -0
- offagent/objects/__init__.py +3 -0
- offagent/objects/base.py +26 -0
- offagent/objects/docx_objects.py +951 -0
- offagent/objects/pptx_objects.py +895 -0
- offagent/objects/xlsx_objects.py +962 -0
- offagent/path_policy.py +42 -0
- offagent/storage/__init__.py +1 -0
- offagent/storage/versioning.py +31 -0
- offagent-0.10.0.dist-info/METADATA +546 -0
- offagent-0.10.0.dist-info/RECORD +39 -0
- offagent-0.10.0.dist-info/WHEEL +5 -0
- offagent-0.10.0.dist-info/entry_points.txt +2 -0
- offagent-0.10.0.dist-info/licenses/LICENSE +21 -0
- offagent-0.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from offagent.domain.models import (
|
|
4
|
+
BatchResult,
|
|
5
|
+
ChildSummary,
|
|
6
|
+
DocxTablesResult,
|
|
7
|
+
InsertContentResult,
|
|
8
|
+
MutationResult,
|
|
9
|
+
NodePayload,
|
|
10
|
+
NodeWriteResult,
|
|
11
|
+
ObjectPayload,
|
|
12
|
+
SectionPayload,
|
|
13
|
+
StructureCollection,
|
|
14
|
+
XlsxInsertRowsResult,
|
|
15
|
+
)
|
|
16
|
+
from offagent.interfaces.mcp_models import (
|
|
17
|
+
BatchResultModel,
|
|
18
|
+
DocxGetTablesResult,
|
|
19
|
+
GetNodeResult,
|
|
20
|
+
GetObjectResult,
|
|
21
|
+
GetSectionResult,
|
|
22
|
+
GetStructureResult,
|
|
23
|
+
InsertContentResultModel,
|
|
24
|
+
ListChildrenResult,
|
|
25
|
+
MutationResultModel,
|
|
26
|
+
WriteNodeResult,
|
|
27
|
+
XlsxInsertRowsResultModel,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def convert_get_structure(result: StructureCollection) -> GetStructureResult:
|
|
32
|
+
return GetStructureResult.from_domain(result)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def convert_get_section(result: SectionPayload) -> GetSectionResult:
|
|
36
|
+
return GetSectionResult.from_domain(result)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def convert_get_node(result: NodePayload) -> GetNodeResult:
|
|
40
|
+
return GetNodeResult.from_domain(result)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def convert_get_object(result: ObjectPayload) -> GetObjectResult:
|
|
44
|
+
return GetObjectResult.from_domain(result)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def convert_list_children(result: list[ChildSummary]) -> ListChildrenResult:
|
|
48
|
+
return ListChildrenResult.from_domain(result)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def convert_write_node(result: NodeWriteResult) -> WriteNodeResult:
|
|
52
|
+
return WriteNodeResult.from_domain(result)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def convert_insert_content(result: InsertContentResult) -> InsertContentResultModel:
|
|
56
|
+
return InsertContentResultModel.from_domain(result)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def convert_mutation_result(result: MutationResult) -> MutationResultModel:
|
|
60
|
+
return MutationResultModel.from_domain(result)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def convert_batch_result(result: BatchResult) -> BatchResultModel:
|
|
64
|
+
return BatchResultModel.from_domain(result)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def convert_xlsx_insert_rows(result: XlsxInsertRowsResult) -> XlsxInsertRowsResultModel:
|
|
68
|
+
return XlsxInsertRowsResultModel.from_domain(result)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def convert_xlsx_insert_rows_result(
|
|
72
|
+
result: XlsxInsertRowsResult | MutationResult,
|
|
73
|
+
) -> XlsxInsertRowsResultModel:
|
|
74
|
+
if isinstance(result, MutationResult):
|
|
75
|
+
return XlsxInsertRowsResultModel.from_mutation_result(result)
|
|
76
|
+
return XlsxInsertRowsResultModel.from_domain(result)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def convert_docx_get_tables(result: DocxTablesResult) -> DocxGetTablesResult:
|
|
80
|
+
return DocxGetTablesResult.from_domain(result)
|