trustgraph-cli 2.3.19__tar.gz → 2.4.0__tar.gz
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.
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/PKG-INFO +2 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/pyproject.toml +3 -1
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/add_library_document.py +18 -12
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/delete_collection.py +22 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/delete_config_item.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/delete_flow_blueprint.py +19 -2
- trustgraph_cli-2.4.0/trustgraph/cli/delete_kg_core.py +66 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/delete_mcp_tool.py +21 -3
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/delete_tool.py +21 -3
- trustgraph_cli-2.4.0/trustgraph/cli/export_workspace_config.py +114 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/get_config_item.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/get_document_content.py +8 -10
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/get_flow_blueprint.py +18 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/get_kg_core.py +16 -17
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/graph_to_turtle.py +12 -11
- trustgraph_cli-2.4.0/trustgraph/cli/import_workspace_config.py +143 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/init_trustgraph.py +17 -5
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_agent.py +17 -19
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_document_embeddings.py +10 -10
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_document_rag.py +21 -24
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_embeddings.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_graph_embeddings.py +10 -10
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_graph_rag.py +46 -56
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_llm.py +10 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_mcp_tool.py +18 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_nlp_query.py +20 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_prompt.py +10 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_row_embeddings.py +10 -10
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_rows_query.py +19 -12
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_sparql_query.py +14 -14
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/invoke_structured_query.py +21 -11
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/list_collections.py +22 -16
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/list_config_items.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/list_explain_traces.py +5 -7
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_doc_embeds.py +3 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_kg_core.py +21 -15
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_knowledge.py +11 -27
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_sample_documents.py +14 -15
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_structured_data.py +31 -32
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/load_turtle.py +11 -18
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/put_config_item.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/put_flow_blueprint.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/put_kg_core.py +21 -22
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/query_graph.py +13 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/remove_library_document.py +15 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/save_doc_embeds.py +2 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/set_collection.py +12 -13
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/set_mcp_tool.py +11 -1
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/set_prompt.py +11 -4
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/set_token_costs.py +11 -4
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/set_tool.py +11 -1
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_config.py +10 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_explain_trace.py +26 -33
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_extraction_provenance.py +19 -21
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_flow_blueprints.py +18 -5
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_flow_state.py +14 -3
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_flows.py +22 -6
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_graph.py +10 -11
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_kg_cores.py +10 -11
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_library_documents.py +8 -8
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_library_processing.py +15 -14
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_mcp_tools.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_prompts.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_token_costs.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_tools.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/start_flow.py +11 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/start_library_processing.py +18 -20
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/stop_flow.py +10 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/stop_library_processing.py +13 -17
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/unload_kg_core.py +10 -14
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/verify_system_status.py +21 -10
- trustgraph_cli-2.4.0/trustgraph/cli_version.py +1 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/PKG-INFO +2 -2
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/SOURCES.txt +2 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/entry_points.txt +2 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/requires.txt +1 -1
- trustgraph_cli-2.3.19/trustgraph/cli/delete_kg_core.py +0 -59
- trustgraph_cli-2.3.19/trustgraph/cli_version.py +0 -1
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/README.md +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/setup.cfg +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/__init__.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/dump_msgpack.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/dump_queues.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/init_pulsar_manager.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/monitor_prompts.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_parameter_types.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_processor_state.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph/cli/show_token_rate.py +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
- {trustgraph_cli-2.3.19 → trustgraph_cli-2.4.0}/trustgraph_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
@@ -8,7 +8,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
9
9
|
Requires-Python: >=3.8
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
|
-
Requires-Dist: trustgraph-base<2.
|
|
11
|
+
Requires-Dist: trustgraph-base<2.5,>=2.4
|
|
12
12
|
Requires-Dist: requests
|
|
13
13
|
Requires-Dist: pulsar-client
|
|
14
14
|
Requires-Dist: aiohttp
|
|
@@ -10,7 +10,7 @@ description = "TrustGraph provides a means to run a pipeline of flexible AI proc
|
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
dependencies = [
|
|
13
|
-
"trustgraph-base>=2.
|
|
13
|
+
"trustgraph-base>=2.4,<2.5",
|
|
14
14
|
"requests",
|
|
15
15
|
"pulsar-client",
|
|
16
16
|
"aiohttp",
|
|
@@ -95,6 +95,8 @@ tg-list-config-items = "trustgraph.cli.list_config_items:main"
|
|
|
95
95
|
tg-get-config-item = "trustgraph.cli.get_config_item:main"
|
|
96
96
|
tg-put-config-item = "trustgraph.cli.put_config_item:main"
|
|
97
97
|
tg-delete-config-item = "trustgraph.cli.delete_config_item:main"
|
|
98
|
+
tg-export-workspace-config = "trustgraph.cli.export_workspace_config:main"
|
|
99
|
+
tg-import-workspace-config = "trustgraph.cli.import_workspace_config:main"
|
|
98
100
|
tg-list-collections = "trustgraph.cli.list_collections:main"
|
|
99
101
|
tg-set-collection = "trustgraph.cli.set_collection:main"
|
|
100
102
|
tg-delete-collection = "trustgraph.cli.delete_collection:main"
|
|
@@ -15,17 +15,17 @@ from trustgraph.knowledge import Organization, PublicationEvent
|
|
|
15
15
|
from trustgraph.knowledge import DigitalDocument
|
|
16
16
|
|
|
17
17
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
18
|
-
|
|
18
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
19
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
19
20
|
|
|
20
21
|
class Loader:
|
|
21
22
|
|
|
22
23
|
def __init__(
|
|
23
|
-
self, id, url,
|
|
24
|
-
):
|
|
24
|
+
self, id, url, metadata, title, comments, kind, tags
|
|
25
|
+
, token=None, workspace="default"):
|
|
25
26
|
|
|
26
|
-
self.api = Api(url).library()
|
|
27
|
+
self.api = Api(url, token=token, workspace=workspace).library()
|
|
27
28
|
|
|
28
|
-
self.user = user
|
|
29
29
|
self.metadata = metadata
|
|
30
30
|
self.title = title
|
|
31
31
|
self.comments = comments
|
|
@@ -55,13 +55,13 @@ class Loader:
|
|
|
55
55
|
else:
|
|
56
56
|
id = hash(data)
|
|
57
57
|
id = to_uri(PREF_DOC, id)
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
|
|
60
60
|
self.metadata.id = id
|
|
61
61
|
|
|
62
62
|
self.api.add_document(
|
|
63
|
-
document=data, id=id, metadata=self.metadata,
|
|
64
|
-
|
|
63
|
+
document=data, id=id, metadata=self.metadata,
|
|
64
|
+
kind=self.kind, title=self.title,
|
|
65
65
|
comments=self.comments, tags=self.tags
|
|
66
66
|
)
|
|
67
67
|
|
|
@@ -83,11 +83,16 @@ def main():
|
|
|
83
83
|
default=default_url,
|
|
84
84
|
help=f'API URL (default: {default_url})',
|
|
85
85
|
)
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
'-t', '--token',
|
|
88
|
+
default=default_token,
|
|
89
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
90
|
+
)
|
|
86
91
|
|
|
87
92
|
parser.add_argument(
|
|
88
|
-
'-
|
|
89
|
-
default=
|
|
90
|
-
help=f'
|
|
93
|
+
'-w', '--workspace',
|
|
94
|
+
default=default_workspace,
|
|
95
|
+
help=f'Workspace (default: {default_workspace})',
|
|
91
96
|
)
|
|
92
97
|
|
|
93
98
|
parser.add_argument(
|
|
@@ -186,12 +191,13 @@ def main():
|
|
|
186
191
|
p = Loader(
|
|
187
192
|
id=args.identifier,
|
|
188
193
|
url=args.url,
|
|
189
|
-
user=args.user,
|
|
190
194
|
metadata=document,
|
|
191
195
|
title=args.name,
|
|
192
196
|
comments=args.description,
|
|
193
197
|
kind=args.kind,
|
|
194
198
|
tags=args.tags,
|
|
199
|
+
token=args.token,
|
|
200
|
+
workspace=args.workspace,
|
|
195
201
|
)
|
|
196
202
|
|
|
197
203
|
p.load(args.files)
|
|
@@ -7,9 +7,11 @@ import os
|
|
|
7
7
|
from trustgraph.api import Api
|
|
8
8
|
|
|
9
9
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
10
|
-
|
|
10
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
11
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
def delete_collection(url, collection, confirm, token=None, workspace="default"):
|
|
13
15
|
|
|
14
16
|
if not confirm:
|
|
15
17
|
response = input(f"Are you sure you want to delete collection '{collection}' and all its data? (y/N): ")
|
|
@@ -17,9 +19,9 @@ def delete_collection(url, user, collection, confirm):
|
|
|
17
19
|
print("Operation cancelled.")
|
|
18
20
|
return
|
|
19
21
|
|
|
20
|
-
api = Api(url).collection()
|
|
22
|
+
api = Api(url, token=token, workspace=workspace).collection()
|
|
21
23
|
|
|
22
|
-
api.delete_collection(
|
|
24
|
+
api.delete_collection(collection=collection)
|
|
23
25
|
|
|
24
26
|
print(f"Collection '{collection}' deleted successfully.")
|
|
25
27
|
|
|
@@ -41,27 +43,34 @@ def main():
|
|
|
41
43
|
help=f'API URL (default: {default_url})',
|
|
42
44
|
)
|
|
43
45
|
|
|
44
|
-
parser.add_argument(
|
|
45
|
-
'-U', '--user',
|
|
46
|
-
default=default_user,
|
|
47
|
-
help=f'User ID (default: {default_user})'
|
|
48
|
-
)
|
|
49
|
-
|
|
50
46
|
parser.add_argument(
|
|
51
47
|
'-y', '--yes',
|
|
52
48
|
action='store_true',
|
|
53
49
|
help='Skip confirmation prompt'
|
|
54
50
|
)
|
|
55
51
|
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
'-t', '--token',
|
|
54
|
+
default=default_token,
|
|
55
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
parser.add_argument(
|
|
59
|
+
'-w', '--workspace',
|
|
60
|
+
default=default_workspace,
|
|
61
|
+
help=f'Workspace (default: {default_workspace})',
|
|
62
|
+
)
|
|
63
|
+
|
|
56
64
|
args = parser.parse_args()
|
|
57
65
|
|
|
58
66
|
try:
|
|
59
67
|
|
|
60
68
|
delete_collection(
|
|
61
69
|
url = args.api_url,
|
|
62
|
-
user = args.user,
|
|
63
70
|
collection = args.collection,
|
|
64
|
-
confirm = args.yes
|
|
71
|
+
confirm = args.yes,
|
|
72
|
+
token = args.token,
|
|
73
|
+
workspace = args.workspace,
|
|
65
74
|
)
|
|
66
75
|
|
|
67
76
|
except Exception as e:
|
|
@@ -69,4 +78,4 @@ def main():
|
|
|
69
78
|
print("Exception:", e, flush=True)
|
|
70
79
|
|
|
71
80
|
if __name__ == "__main__":
|
|
72
|
-
main()
|
|
81
|
+
main()
|
|
@@ -9,10 +9,11 @@ from trustgraph.api.types import ConfigKey
|
|
|
9
9
|
|
|
10
10
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
11
11
|
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
12
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
12
13
|
|
|
13
|
-
def delete_config_item(url, config_type, key, token=None):
|
|
14
|
+
def delete_config_item(url, config_type, key, token=None, workspace="default"):
|
|
14
15
|
|
|
15
|
-
api = Api(url, token=token).config()
|
|
16
|
+
api = Api(url, token=token, workspace=workspace).config()
|
|
16
17
|
|
|
17
18
|
config_key = ConfigKey(type=config_type, key=key)
|
|
18
19
|
api.delete([config_key])
|
|
@@ -50,6 +51,12 @@ def main():
|
|
|
50
51
|
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
51
52
|
)
|
|
52
53
|
|
|
54
|
+
parser.add_argument(
|
|
55
|
+
'-w', '--workspace',
|
|
56
|
+
default=default_workspace,
|
|
57
|
+
help=f'Workspace (default: {default_workspace})',
|
|
58
|
+
)
|
|
59
|
+
|
|
53
60
|
args = parser.parse_args()
|
|
54
61
|
|
|
55
62
|
try:
|
|
@@ -59,6 +66,8 @@ def main():
|
|
|
59
66
|
config_type=args.type,
|
|
60
67
|
key=args.key,
|
|
61
68
|
token=args.token,
|
|
69
|
+
|
|
70
|
+
workspace=args.workspace,
|
|
62
71
|
)
|
|
63
72
|
|
|
64
73
|
except Exception as e:
|
|
@@ -9,10 +9,13 @@ from trustgraph.api import Api
|
|
|
9
9
|
import json
|
|
10
10
|
|
|
11
11
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
12
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
13
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
12
14
|
|
|
13
|
-
def delete_flow_blueprint(url, blueprint_name
|
|
15
|
+
def delete_flow_blueprint(url, blueprint_name, token=None,
|
|
16
|
+
workspace="default"):
|
|
14
17
|
|
|
15
|
-
api = Api(url).flow()
|
|
18
|
+
api = Api(url, token=token, workspace=workspace).flow()
|
|
16
19
|
|
|
17
20
|
blueprint_names = api.delete_blueprint(blueprint_name)
|
|
18
21
|
|
|
@@ -29,6 +32,18 @@ def main():
|
|
|
29
32
|
help=f'API URL (default: {default_url})',
|
|
30
33
|
)
|
|
31
34
|
|
|
35
|
+
parser.add_argument(
|
|
36
|
+
'-t', '--token',
|
|
37
|
+
default=default_token,
|
|
38
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
parser.add_argument(
|
|
42
|
+
'-w', '--workspace',
|
|
43
|
+
default=default_workspace,
|
|
44
|
+
help=f'Workspace (default: {default_workspace})',
|
|
45
|
+
)
|
|
46
|
+
|
|
32
47
|
parser.add_argument(
|
|
33
48
|
'-n', '--blueprint-name',
|
|
34
49
|
help=f'Flow blueprint name',
|
|
@@ -41,6 +56,8 @@ def main():
|
|
|
41
56
|
delete_flow_blueprint(
|
|
42
57
|
url=args.api_url,
|
|
43
58
|
blueprint_name=args.blueprint_name,
|
|
59
|
+
token=args.token,
|
|
60
|
+
workspace=args.workspace,
|
|
44
61
|
)
|
|
45
62
|
|
|
46
63
|
except Exception as e:
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Deletes a knowledge core
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import os
|
|
7
|
+
from trustgraph.api import Api
|
|
8
|
+
|
|
9
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
10
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
11
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
12
|
+
|
|
13
|
+
def delete_kg_core(url, id, token=None, workspace="default"):
|
|
14
|
+
|
|
15
|
+
api = Api(url, token=token, workspace=workspace).knowledge()
|
|
16
|
+
|
|
17
|
+
api.delete_kg_core(id=id)
|
|
18
|
+
|
|
19
|
+
def main():
|
|
20
|
+
|
|
21
|
+
parser = argparse.ArgumentParser(
|
|
22
|
+
prog='tg-delete-kg-core',
|
|
23
|
+
description=__doc__,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
'-u', '--api-url',
|
|
28
|
+
default=default_url,
|
|
29
|
+
help=f'API URL (default: {default_url})',
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
'--id', '--identifier',
|
|
34
|
+
required=True,
|
|
35
|
+
help=f'Knowledge core ID',
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
parser.add_argument(
|
|
39
|
+
'-t', '--token',
|
|
40
|
+
default=default_token,
|
|
41
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
parser.add_argument(
|
|
45
|
+
'-w', '--workspace',
|
|
46
|
+
default=default_workspace,
|
|
47
|
+
help=f'Workspace (default: {default_workspace})',
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
args = parser.parse_args()
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
|
|
54
|
+
delete_kg_core(
|
|
55
|
+
url=args.api_url,
|
|
56
|
+
id=args.id,
|
|
57
|
+
token=args.token,
|
|
58
|
+
workspace=args.workspace,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
except Exception as e:
|
|
62
|
+
|
|
63
|
+
print("Exception:", e, flush=True)
|
|
64
|
+
|
|
65
|
+
if __name__ == "__main__":
|
|
66
|
+
main()
|
|
@@ -10,12 +10,16 @@ import textwrap
|
|
|
10
10
|
|
|
11
11
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
12
12
|
|
|
13
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
14
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
13
15
|
def delete_mcp_tool(
|
|
14
16
|
url : str,
|
|
15
17
|
id : str,
|
|
18
|
+
token=None,
|
|
19
|
+
workspace="default",
|
|
16
20
|
):
|
|
17
21
|
|
|
18
|
-
api = Api(url).config()
|
|
22
|
+
api = Api(url, token=token, workspace=workspace).config()
|
|
19
23
|
|
|
20
24
|
# Check if the tool exists first
|
|
21
25
|
try:
|
|
@@ -73,6 +77,18 @@ def main():
|
|
|
73
77
|
help='MCP tool ID to delete',
|
|
74
78
|
)
|
|
75
79
|
|
|
80
|
+
parser.add_argument(
|
|
81
|
+
'-t', '--token',
|
|
82
|
+
default=default_token,
|
|
83
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
'-w', '--workspace',
|
|
88
|
+
default=default_workspace,
|
|
89
|
+
help=f'Workspace (default: {default_workspace})',
|
|
90
|
+
)
|
|
91
|
+
|
|
76
92
|
args = parser.parse_args()
|
|
77
93
|
|
|
78
94
|
try:
|
|
@@ -81,8 +97,10 @@ def main():
|
|
|
81
97
|
raise RuntimeError("Must specify --id for MCP tool to delete")
|
|
82
98
|
|
|
83
99
|
delete_mcp_tool(
|
|
84
|
-
url=args.api_url,
|
|
85
|
-
id=args.id
|
|
100
|
+
url=args.api_url,
|
|
101
|
+
id=args.id,
|
|
102
|
+
token=args.token,
|
|
103
|
+
workspace=args.workspace,
|
|
86
104
|
)
|
|
87
105
|
|
|
88
106
|
except Exception as e:
|
|
@@ -12,12 +12,16 @@ import textwrap
|
|
|
12
12
|
|
|
13
13
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
14
14
|
|
|
15
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
16
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
15
17
|
def delete_tool(
|
|
16
18
|
url : str,
|
|
17
19
|
id : str,
|
|
20
|
+
token=None,
|
|
21
|
+
workspace="default",
|
|
18
22
|
):
|
|
19
23
|
|
|
20
|
-
api = Api(url).config()
|
|
24
|
+
api = Api(url, token=token, workspace=workspace).config()
|
|
21
25
|
|
|
22
26
|
# Check if the tool configuration exists
|
|
23
27
|
try:
|
|
@@ -78,6 +82,18 @@ def main():
|
|
|
78
82
|
help='Tool ID to delete',
|
|
79
83
|
)
|
|
80
84
|
|
|
85
|
+
parser.add_argument(
|
|
86
|
+
'-t', '--token',
|
|
87
|
+
default=default_token,
|
|
88
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
parser.add_argument(
|
|
92
|
+
'-w', '--workspace',
|
|
93
|
+
default=default_workspace,
|
|
94
|
+
help=f'Workspace (default: {default_workspace})',
|
|
95
|
+
)
|
|
96
|
+
|
|
81
97
|
args = parser.parse_args()
|
|
82
98
|
|
|
83
99
|
try:
|
|
@@ -86,8 +102,10 @@ def main():
|
|
|
86
102
|
raise RuntimeError("Must specify --id for tool to delete")
|
|
87
103
|
|
|
88
104
|
delete_tool(
|
|
89
|
-
url=args.api_url,
|
|
90
|
-
id=args.id
|
|
105
|
+
url=args.api_url,
|
|
106
|
+
id=args.id,
|
|
107
|
+
token=args.token,
|
|
108
|
+
workspace=args.workspace,
|
|
91
109
|
)
|
|
92
110
|
|
|
93
111
|
except Exception as e:
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Exports a curated subset of a workspace's configuration to a JSON file
|
|
3
|
+
for later reload into another workspace (useful for cloning test setups).
|
|
4
|
+
|
|
5
|
+
The subset covers the config types that define workspace behaviour:
|
|
6
|
+
mcp-tool, tool, flow-blueprint, token-cost, agent-pattern,
|
|
7
|
+
agent-task-type, parameter-type, interface-description, prompt.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import os
|
|
12
|
+
import json
|
|
13
|
+
import sys
|
|
14
|
+
from trustgraph.api import Api
|
|
15
|
+
|
|
16
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
17
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
18
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
19
|
+
|
|
20
|
+
EXPORT_TYPES = [
|
|
21
|
+
"mcp-tool",
|
|
22
|
+
"tool",
|
|
23
|
+
"flow-blueprint",
|
|
24
|
+
"token-cost",
|
|
25
|
+
"agent-pattern",
|
|
26
|
+
"agent-task-type",
|
|
27
|
+
"parameter-type",
|
|
28
|
+
"interface-description",
|
|
29
|
+
"prompt",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def export_workspace_config(url, workspace, output, token=None):
|
|
34
|
+
|
|
35
|
+
api = Api(url, token=token, workspace=workspace).config()
|
|
36
|
+
|
|
37
|
+
config, version = api.all()
|
|
38
|
+
|
|
39
|
+
subset = {}
|
|
40
|
+
for t in EXPORT_TYPES:
|
|
41
|
+
if t in config:
|
|
42
|
+
subset[t] = config[t]
|
|
43
|
+
|
|
44
|
+
payload = {
|
|
45
|
+
"source_workspace": workspace,
|
|
46
|
+
"source_version": version,
|
|
47
|
+
"config": subset,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if output == "-":
|
|
51
|
+
json.dump(payload, sys.stdout, indent=2)
|
|
52
|
+
sys.stdout.write("\n")
|
|
53
|
+
else:
|
|
54
|
+
with open(output, "w") as f:
|
|
55
|
+
json.dump(payload, f, indent=2)
|
|
56
|
+
|
|
57
|
+
total = sum(len(v) for v in subset.values())
|
|
58
|
+
print(
|
|
59
|
+
f"Exported {total} items across {len(subset)} types "
|
|
60
|
+
f"from workspace '{workspace}' (version {version}).",
|
|
61
|
+
file=sys.stderr,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def main():
|
|
66
|
+
|
|
67
|
+
parser = argparse.ArgumentParser(
|
|
68
|
+
prog='tg-export-workspace-config',
|
|
69
|
+
description=__doc__,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
parser.add_argument(
|
|
73
|
+
'-u', '--api-url',
|
|
74
|
+
default=default_url,
|
|
75
|
+
help=f'API URL (default: {default_url})',
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
parser.add_argument(
|
|
79
|
+
'-t', '--token',
|
|
80
|
+
default=default_token,
|
|
81
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
parser.add_argument(
|
|
85
|
+
'-w', '--workspace',
|
|
86
|
+
default=default_workspace,
|
|
87
|
+
help=f'Source workspace (default: {default_workspace})',
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
parser.add_argument(
|
|
91
|
+
'-o', '--output',
|
|
92
|
+
required=True,
|
|
93
|
+
help='Output JSON file path (use "-" for stdout)',
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
args = parser.parse_args()
|
|
97
|
+
|
|
98
|
+
try:
|
|
99
|
+
|
|
100
|
+
export_workspace_config(
|
|
101
|
+
url=args.api_url,
|
|
102
|
+
workspace=args.workspace,
|
|
103
|
+
output=args.output,
|
|
104
|
+
token=args.token,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
except Exception as e:
|
|
108
|
+
|
|
109
|
+
print("Exception:", e, flush=True)
|
|
110
|
+
sys.exit(1)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
main()
|
|
@@ -10,10 +10,12 @@ from trustgraph.api.types import ConfigKey
|
|
|
10
10
|
|
|
11
11
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
12
12
|
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
13
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
13
14
|
|
|
14
|
-
def get_config_item(url, config_type, key, format_type, token=None
|
|
15
|
+
def get_config_item(url, config_type, key, format_type, token=None,
|
|
16
|
+
workspace="default"):
|
|
15
17
|
|
|
16
|
-
api = Api(url, token=token).config()
|
|
18
|
+
api = Api(url, token=token, workspace=workspace).config()
|
|
17
19
|
|
|
18
20
|
config_key = ConfigKey(type=config_type, key=key)
|
|
19
21
|
values = api.get([config_key])
|
|
@@ -66,6 +68,12 @@ def main():
|
|
|
66
68
|
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
67
69
|
)
|
|
68
70
|
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
'-w', '--workspace',
|
|
73
|
+
default=default_workspace,
|
|
74
|
+
help=f'Workspace (default: {default_workspace})',
|
|
75
|
+
)
|
|
76
|
+
|
|
69
77
|
args = parser.parse_args()
|
|
70
78
|
|
|
71
79
|
try:
|
|
@@ -76,6 +84,7 @@ def main():
|
|
|
76
84
|
key=args.key,
|
|
77
85
|
format_type=args.format,
|
|
78
86
|
token=args.token,
|
|
87
|
+
workspace=args.workspace,
|
|
79
88
|
)
|
|
80
89
|
|
|
81
90
|
except Exception as e:
|
|
@@ -9,21 +9,19 @@ from trustgraph.api import Api
|
|
|
9
9
|
|
|
10
10
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
11
11
|
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
12
|
-
|
|
12
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
13
13
|
|
|
14
|
-
def get_content(url,
|
|
14
|
+
def get_content(url, document_id, output_file, token=None, workspace="default"):
|
|
15
15
|
|
|
16
|
-
api = Api(url, token=token).library()
|
|
16
|
+
api = Api(url, token=token, workspace=workspace).library()
|
|
17
17
|
|
|
18
|
-
content = api.get_document_content(
|
|
18
|
+
content = api.get_document_content(id=document_id)
|
|
19
19
|
|
|
20
20
|
if output_file:
|
|
21
21
|
with open(output_file, 'wb') as f:
|
|
22
22
|
f.write(content)
|
|
23
23
|
print(f"Written {len(content)} bytes to {output_file}")
|
|
24
24
|
else:
|
|
25
|
-
# Write to stdout
|
|
26
|
-
# Try to decode as text, fall back to binary info
|
|
27
25
|
try:
|
|
28
26
|
text = content.decode('utf-8')
|
|
29
27
|
print(text)
|
|
@@ -51,9 +49,9 @@ def main():
|
|
|
51
49
|
)
|
|
52
50
|
|
|
53
51
|
parser.add_argument(
|
|
54
|
-
'-
|
|
55
|
-
default=
|
|
56
|
-
help=f'
|
|
52
|
+
'-w', '--workspace',
|
|
53
|
+
default=default_workspace,
|
|
54
|
+
help=f'Workspace (default: {default_workspace})',
|
|
57
55
|
)
|
|
58
56
|
|
|
59
57
|
parser.add_argument(
|
|
@@ -73,10 +71,10 @@ def main():
|
|
|
73
71
|
|
|
74
72
|
get_content(
|
|
75
73
|
url=args.api_url,
|
|
76
|
-
user=args.user,
|
|
77
74
|
document_id=args.document_id,
|
|
78
75
|
output_file=args.output,
|
|
79
76
|
token=args.token,
|
|
77
|
+
workspace=args.workspace,
|
|
80
78
|
)
|
|
81
79
|
|
|
82
80
|
except Exception as e:
|
|
@@ -9,10 +9,12 @@ from trustgraph.api import Api
|
|
|
9
9
|
import json
|
|
10
10
|
|
|
11
11
|
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|
12
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
13
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
12
14
|
|
|
13
|
-
def get_flow_blueprint(url, blueprint_name):
|
|
15
|
+
def get_flow_blueprint(url, blueprint_name, token=None, workspace="default"):
|
|
14
16
|
|
|
15
|
-
api = Api(url).flow()
|
|
17
|
+
api = Api(url, token=token, workspace=workspace).flow()
|
|
16
18
|
|
|
17
19
|
cls = api.get_blueprint(blueprint_name)
|
|
18
20
|
|
|
@@ -31,6 +33,18 @@ def main():
|
|
|
31
33
|
help=f'API URL (default: {default_url})',
|
|
32
34
|
)
|
|
33
35
|
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
'-t', '--token',
|
|
38
|
+
default=default_token,
|
|
39
|
+
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
'-w', '--workspace',
|
|
44
|
+
default=default_workspace,
|
|
45
|
+
help=f'Workspace (default: {default_workspace})',
|
|
46
|
+
)
|
|
47
|
+
|
|
34
48
|
parser.add_argument(
|
|
35
49
|
'-n', '--blueprint-name',
|
|
36
50
|
required=True,
|
|
@@ -44,6 +58,8 @@ def main():
|
|
|
44
58
|
get_flow_blueprint(
|
|
45
59
|
url=args.api_url,
|
|
46
60
|
blueprint_name=args.blueprint_name,
|
|
61
|
+
token=args.token,
|
|
62
|
+
workspace=args.workspace,
|
|
47
63
|
)
|
|
48
64
|
|
|
49
65
|
except Exception as e:
|