cap-sdk-python 2.0.6__tar.gz → 2.0.7__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.
Files changed (32) hide show
  1. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/PKG-INFO +1 -1
  2. cap_sdk_python-2.0.7/cap/__init__.py +30 -0
  3. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/alert_pb2.py +2 -2
  4. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/buspacket_pb2.py +3 -3
  5. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/heartbeat_pb2.py +2 -2
  6. cap_sdk_python-2.0.7/cap/pb/coretex/agent/v1/job_pb2.py +67 -0
  7. cap_sdk_python-2.0.7/cap/pb/coretex/agent/v1/safety_pb2.py +62 -0
  8. cap_sdk_python-2.0.7/cap/pb/coretex/agent/v1/safety_pb2_grpc.py +272 -0
  9. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap_sdk_python.egg-info/PKG-INFO +1 -1
  10. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/pyproject.toml +1 -1
  11. cap_sdk_python-2.0.6/cap/__init__.py +0 -5
  12. cap_sdk_python-2.0.6/cap/pb/coretex/agent/v1/job_pb2.py +0 -55
  13. cap_sdk_python-2.0.6/cap/pb/coretex/agent/v1/safety_pb2.py +0 -48
  14. cap_sdk_python-2.0.6/cap/pb/coretex/agent/v1/safety_pb2_grpc.py +0 -100
  15. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/README.md +0 -0
  16. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/bus.py +0 -0
  17. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/client.py +0 -0
  18. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/__init__.py +0 -0
  19. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/__init__.py +0 -0
  20. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/__init__.py +0 -0
  21. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/__init__.py +0 -0
  22. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/alert_pb2_grpc.py +0 -0
  23. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/buspacket_pb2_grpc.py +0 -0
  24. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/heartbeat_pb2_grpc.py +0 -0
  25. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/pb/coretex/agent/v1/job_pb2_grpc.py +0 -0
  26. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap/worker.py +0 -0
  27. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap_sdk_python.egg-info/SOURCES.txt +0 -0
  28. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap_sdk_python.egg-info/dependency_links.txt +0 -0
  29. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap_sdk_python.egg-info/requires.txt +0 -0
  30. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/cap_sdk_python.egg-info/top_level.txt +0 -0
  31. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/setup.cfg +0 -0
  32. {cap_sdk_python-2.0.6 → cap_sdk_python-2.0.7}/tests/test_sdk.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cap-sdk-python
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: CAP (coretex Agent Protocol) Python SDK
5
5
  Project-URL: Homepage, https://github.com/coretexos/cap
6
6
  Requires-Python: >=3.9
@@ -0,0 +1,30 @@
1
+ import sys
2
+ import types
3
+
4
+ try:
5
+ from google.protobuf import runtime_version as _runtime_version # noqa: F401
6
+ except Exception:
7
+ try:
8
+ import google.protobuf as _protobuf
9
+ except Exception:
10
+ _protobuf = None
11
+
12
+ _shim = types.SimpleNamespace()
13
+
14
+ class _Domain:
15
+ PUBLIC = 0
16
+
17
+ def _validate(*_args, **_kwargs):
18
+ return None
19
+
20
+ _shim.Domain = _Domain
21
+ _shim.ValidateProtobufRuntimeVersion = _validate
22
+ sys.modules["google.protobuf.runtime_version"] = _shim
23
+ if _protobuf is not None:
24
+ setattr(_protobuf, "runtime_version", _shim)
25
+
26
+ from .client import submit_job
27
+ from .worker import run_worker
28
+ from .bus import connect_nats
29
+
30
+ __all__ = ["submit_job", "run_worker", "connect_nats"]
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63oretex/agent/v1/alert.proto\x12\x10\x63oretex.agent.v1\"N\n\x0bSystemAlert\x12\r\n\x05level\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\tB\x87\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63oretex/agent/v1/alert.proto\x12\x10\x63oretex.agent.v1\"N\n\x0bSystemAlert\x12\r\n\x05level\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\tB\x84\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z,github.com/coretexos/cap/v2/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.alert_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z,github.com/coretexos/cap/v2/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
35
35
  _globals['_SYSTEMALERT']._serialized_start=50
36
36
  _globals['_SYSTEMALERT']._serialized_end=128
37
37
  # @@protoc_insertion_point(module_scope)
@@ -28,14 +28,14 @@ from coretex.agent.v1 import heartbeat_pb2 as coretex_dot_agent_dot_v1_dot_heart
28
28
  from coretex.agent.v1 import alert_pb2 as coretex_dot_agent_dot_v1_dot_alert__pb2
29
29
 
30
30
 
31
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n coretex/agent/v1/buspacket.proto\x12\x10\x63oretex.agent.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1a\x63oretex/agent/v1/job.proto\x1a coretex/agent/v1/heartbeat.proto\x1a\x1c\x63oretex/agent/v1/alert.proto\"\xe2\x02\n\tBusPacket\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x11\n\tsender_id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10protocol_version\x18\x04 \x01(\x05\x12\x33\n\x0bjob_request\x18\n \x01(\x0b\x32\x1c.coretex.agent.v1.JobRequestH\x00\x12\x31\n\njob_result\x18\x0b \x01(\x0b\x32\x1b.coretex.agent.v1.JobResultH\x00\x12\x30\n\theartbeat\x18\x0c \x01(\x0b\x32\x1b.coretex.agent.v1.HeartbeatH\x00\x12.\n\x05\x61lert\x18\r \x01(\x0b\x32\x1d.coretex.agent.v1.SystemAlertH\x00\x12\x11\n\tsignature\x18\x0e \x01(\x0c\x42\t\n\x07payloadB\x87\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
31
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n coretex/agent/v1/buspacket.proto\x12\x10\x63oretex.agent.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1a\x63oretex/agent/v1/job.proto\x1a coretex/agent/v1/heartbeat.proto\x1a\x1c\x63oretex/agent/v1/alert.proto\"\xcc\x03\n\tBusPacket\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x11\n\tsender_id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10protocol_version\x18\x04 \x01(\x05\x12\x33\n\x0bjob_request\x18\n \x01(\x0b\x32\x1c.coretex.agent.v1.JobRequestH\x00\x12\x31\n\njob_result\x18\x0b \x01(\x0b\x32\x1b.coretex.agent.v1.JobResultH\x00\x12\x30\n\theartbeat\x18\x0c \x01(\x0b\x32\x1b.coretex.agent.v1.HeartbeatH\x00\x12.\n\x05\x61lert\x18\r \x01(\x0b\x32\x1d.coretex.agent.v1.SystemAlertH\x00\x12\x35\n\x0cjob_progress\x18\x0f \x01(\x0b\x32\x1d.coretex.agent.v1.JobProgressH\x00\x12\x31\n\njob_cancel\x18\x10 \x01(\x0b\x32\x1b.coretex.agent.v1.JobCancelH\x00\x12\x11\n\tsignature\x18\x0e \x01(\x0c\x42\t\n\x07payloadB\x84\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z,github.com/coretexos/cap/v2/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
32
32
 
33
33
  _globals = globals()
34
34
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
35
35
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.buspacket_pb2', _globals)
36
36
  if not _descriptor._USE_C_DESCRIPTORS:
37
37
  _globals['DESCRIPTOR']._loaded_options = None
38
- _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
38
+ _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z,github.com/coretexos/cap/v2/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
39
39
  _globals['_BUSPACKET']._serialized_start=180
40
- _globals['_BUSPACKET']._serialized_end=534
40
+ _globals['_BUSPACKET']._serialized_end=640
41
41
  # @@protoc_insertion_point(module_scope)
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n coretex/agent/v1/heartbeat.proto\x12\x10\x63oretex.agent.v1\"\xa3\x02\n\tHeartbeat\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06region\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x10\n\x08\x63pu_load\x18\x04 \x01(\x02\x12\x17\n\x0fgpu_utilization\x18\x05 \x01(\x02\x12\x13\n\x0b\x61\x63tive_jobs\x18\x06 \x01(\x05\x12\x14\n\x0c\x63\x61pabilities\x18\x07 \x03(\t\x12\x0c\n\x04pool\x18\x0b \x01(\t\x12\x19\n\x11max_parallel_jobs\x18\x0c \x01(\x05\x12\x37\n\x06labels\x18\r \x03(\x0b\x32\'.coretex.agent.v1.Heartbeat.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x87\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n coretex/agent/v1/heartbeat.proto\x12\x10\x63oretex.agent.v1\"\xa3\x02\n\tHeartbeat\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\x0e\n\x06region\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x10\n\x08\x63pu_load\x18\x04 \x01(\x02\x12\x17\n\x0fgpu_utilization\x18\x05 \x01(\x02\x12\x13\n\x0b\x61\x63tive_jobs\x18\x06 \x01(\x05\x12\x14\n\x0c\x63\x61pabilities\x18\x07 \x03(\t\x12\x0c\n\x04pool\x18\x0b \x01(\t\x12\x19\n\x11max_parallel_jobs\x18\x0c \x01(\x05\x12\x37\n\x06labels\x18\r \x03(\x0b\x32\'.coretex.agent.v1.Heartbeat.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x84\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z,github.com/coretexos/cap/v2/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.heartbeat_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z,github.com/coretexos/cap/v2/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
35
35
  _globals['_HEARTBEAT_LABELSENTRY']._loaded_options = None
36
36
  _globals['_HEARTBEAT_LABELSENTRY']._serialized_options = b'8\001'
37
37
  _globals['_HEARTBEAT']._serialized_start=55
@@ -0,0 +1,67 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: coretex/agent/v1/job.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'coretex/agent/v1/job.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x63oretex/agent/v1/job.proto\x12\x10\x63oretex.agent.v1\"l\n\x0c\x43ontextHints\x12\x18\n\x10max_input_tokens\x18\x01 \x01(\x05\x12\x1b\n\x13\x61llow_summarization\x18\x02 \x01(\x08\x12\x17\n\x0f\x61llow_retrieval\x18\x03 \x01(\x08\x12\x0c\n\x04tags\x18\x04 \x03(\t\"l\n\x06\x42udget\x12\x18\n\x10max_input_tokens\x18\x01 \x01(\x03\x12\x19\n\x11max_output_tokens\x18\x02 \x01(\x03\x12\x18\n\x10max_total_tokens\x18\x03 \x01(\x03\x12\x13\n\x0b\x64\x65\x61\x64line_ms\x18\x04 \x01(\x03\"\xb0\x02\n\x0bJobMetadata\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x10\n\x08\x61\x63tor_id\x18\x02 \x01(\t\x12/\n\nactor_type\x18\x03 \x01(\x0e\x32\x1b.coretex.agent.v1.ActorType\x12\x17\n\x0fidempotency_key\x18\x04 \x01(\t\x12\x12\n\ncapability\x18\x05 \x01(\t\x12\x11\n\trisk_tags\x18\x06 \x03(\t\x12\x10\n\x08requires\x18\x07 \x03(\t\x12\x0f\n\x07pack_id\x18\x08 \x01(\t\x12\x39\n\x06labels\x18\t \x03(\x0b\x32).coretex.agent.v1.JobMetadata.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd8\x04\n\nJobRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12/\n\x08priority\x18\x03 \x01(\x0e\x32\x1d.coretex.agent.v1.JobPriority\x12\x13\n\x0b\x63ontext_ptr\x18\x04 \x01(\t\x12\x12\n\nadapter_id\x18\x05 \x01(\t\x12\x32\n\x03\x65nv\x18\x06 \x03(\x0b\x32%.coretex.agent.v1.JobRequest.EnvEntry\x12\x15\n\rparent_job_id\x18\x07 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x08 \x01(\t\x12\x12\n\nstep_index\x18\t \x01(\x05\x12\x11\n\tmemory_id\x18\n \x01(\t\x12\x35\n\rcontext_hints\x18\x0b \x01(\x0b\x32\x1e.coretex.agent.v1.ContextHints\x12(\n\x06\x62udget\x18\x0c \x01(\x0b\x32\x18.coretex.agent.v1.Budget\x12\x11\n\ttenant_id\x18\r \x01(\t\x12\x14\n\x0cprincipal_id\x18\x0e \x01(\t\x12\x38\n\x06labels\x18\x0f \x03(\x0b\x32(.coretex.agent.v1.JobRequest.LabelsEntry\x12+\n\x04meta\x18\x10 \x01(\x0b\x32\x1d.coretex.agent.v1.JobMetadata\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\tJobResult\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12+\n\x06status\x18\x02 \x01(\x0e\x32\x1b.coretex.agent.v1.JobStatus\x12\x12\n\nresult_ptr\x18\x03 \x01(\t\x12\x11\n\tworker_id\x18\x04 \x01(\t\x12\x14\n\x0c\x65xecution_ms\x18\x05 \x01(\x03\x12\x12\n\nerror_code\x18\x06 \x01(\t\x12\x15\n\rerror_message\x18\x07 \x01(\t\x12\x15\n\rartifact_ptrs\x18\x08 \x03(\t\"\xa8\x01\n\x0bJobProgress\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\x0f\n\x07step_id\x18\x02 \x01(\t\x12\x0f\n\x07percent\x18\x03 \x01(\x05\x12\x0f\n\x07message\x18\x04 \x01(\t\x12\x12\n\nresult_ptr\x18\x05 \x01(\t\x12\x15\n\rartifact_ptrs\x18\x06 \x03(\t\x12+\n\x06status\x18\x07 \x01(\x0e\x32\x1b.coretex.agent.v1.JobStatus\"A\n\tJobCancel\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x14\n\x0crequested_by\x18\x03 \x01(\t*|\n\x0bJobPriority\x12\x1c\n\x18JOB_PRIORITY_UNSPECIFIED\x10\x00\x12\x1c\n\x18JOB_PRIORITY_INTERACTIVE\x10\x01\x12\x16\n\x12JOB_PRIORITY_BATCH\x10\x02\x12\x19\n\x15JOB_PRIORITY_CRITICAL\x10\x03*\x86\x02\n\tJobStatus\x12\x1a\n\x16JOB_STATUS_UNSPECIFIED\x10\x00\x12\x16\n\x12JOB_STATUS_PENDING\x10\x01\x12\x18\n\x14JOB_STATUS_SCHEDULED\x10\x02\x12\x19\n\x15JOB_STATUS_DISPATCHED\x10\x03\x12\x16\n\x12JOB_STATUS_RUNNING\x10\x04\x12\x18\n\x14JOB_STATUS_SUCCEEDED\x10\x05\x12\x15\n\x11JOB_STATUS_FAILED\x10\x06\x12\x18\n\x14JOB_STATUS_CANCELLED\x10\x07\x12\x15\n\x11JOB_STATUS_DENIED\x10\x08\x12\x16\n\x12JOB_STATUS_TIMEOUT\x10\t*U\n\tActorType\x12\x1a\n\x16\x41\x43TOR_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41\x43TOR_TYPE_HUMAN\x10\x01\x12\x16\n\x12\x41\x43TOR_TYPE_SERVICE\x10\x02\x42\x84\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z,github.com/coretexos/cap/v2/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.job_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ _globals['DESCRIPTOR']._loaded_options = None
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z,github.com/coretexos/cap/v2/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
35
+ _globals['_JOBMETADATA_LABELSENTRY']._loaded_options = None
36
+ _globals['_JOBMETADATA_LABELSENTRY']._serialized_options = b'8\001'
37
+ _globals['_JOBREQUEST_ENVENTRY']._loaded_options = None
38
+ _globals['_JOBREQUEST_ENVENTRY']._serialized_options = b'8\001'
39
+ _globals['_JOBREQUEST_LABELSENTRY']._loaded_options = None
40
+ _globals['_JOBREQUEST_LABELSENTRY']._serialized_options = b'8\001'
41
+ _globals['_JOBPRIORITY']._serialized_start=1618
42
+ _globals['_JOBPRIORITY']._serialized_end=1742
43
+ _globals['_JOBSTATUS']._serialized_start=1745
44
+ _globals['_JOBSTATUS']._serialized_end=2007
45
+ _globals['_ACTORTYPE']._serialized_start=2009
46
+ _globals['_ACTORTYPE']._serialized_end=2094
47
+ _globals['_CONTEXTHINTS']._serialized_start=48
48
+ _globals['_CONTEXTHINTS']._serialized_end=156
49
+ _globals['_BUDGET']._serialized_start=158
50
+ _globals['_BUDGET']._serialized_end=266
51
+ _globals['_JOBMETADATA']._serialized_start=269
52
+ _globals['_JOBMETADATA']._serialized_end=573
53
+ _globals['_JOBMETADATA_LABELSENTRY']._serialized_start=528
54
+ _globals['_JOBMETADATA_LABELSENTRY']._serialized_end=573
55
+ _globals['_JOBREQUEST']._serialized_start=576
56
+ _globals['_JOBREQUEST']._serialized_end=1176
57
+ _globals['_JOBREQUEST_ENVENTRY']._serialized_start=1087
58
+ _globals['_JOBREQUEST_ENVENTRY']._serialized_end=1129
59
+ _globals['_JOBREQUEST_LABELSENTRY']._serialized_start=528
60
+ _globals['_JOBREQUEST_LABELSENTRY']._serialized_end=573
61
+ _globals['_JOBRESULT']._serialized_start=1179
62
+ _globals['_JOBRESULT']._serialized_end=1378
63
+ _globals['_JOBPROGRESS']._serialized_start=1381
64
+ _globals['_JOBPROGRESS']._serialized_end=1549
65
+ _globals['_JOBCANCEL']._serialized_start=1551
66
+ _globals['_JOBCANCEL']._serialized_end=1616
67
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,62 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: coretex/agent/v1/safety.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'coretex/agent/v1/safety.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from coretex.agent.v1 import job_pb2 as coretex_dot_agent_dot_v1_dot_job__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x63oretex/agent/v1/safety.proto\x12\x10\x63oretex.agent.v1\x1a\x1a\x63oretex/agent/v1/job.proto\"\x97\x03\n\x12PolicyCheckRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\x12/\n\x08priority\x18\x04 \x01(\x0e\x32\x1d.coretex.agent.v1.JobPriority\x12\x16\n\x0e\x65stimated_cost\x18\x05 \x01(\x01\x12(\n\x06\x62udget\x18\x06 \x01(\x0b\x32\x18.coretex.agent.v1.Budget\x12\x14\n\x0cprincipal_id\x18\x07 \x01(\t\x12@\n\x06labels\x18\x08 \x03(\x0b\x32\x30.coretex.agent.v1.PolicyCheckRequest.LabelsEntry\x12\x11\n\tmemory_id\x18\t \x01(\t\x12\x18\n\x10\x65\x66\x66\x65\x63tive_config\x18\n \x01(\x0c\x12+\n\x04meta\x18\x0b \x01(\x0b\x32\x1d.coretex.agent.v1.JobMetadata\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x11\x42udgetConstraints\x12\x16\n\x0emax_runtime_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_retries\x18\x02 \x01(\x05\x12\x1a\n\x12max_artifact_bytes\x18\x03 \x01(\x03\x12\x1b\n\x13max_concurrent_jobs\x18\x04 \x01(\x05\"j\n\x0eSandboxProfile\x12\x10\n\x08isolated\x18\x01 \x01(\x08\x12\x19\n\x11network_allowlist\x18\x02 \x03(\t\x12\x14\n\x0c\x66s_read_only\x18\x03 \x03(\t\x12\x15\n\rfs_read_write\x18\x04 \x03(\t\"G\n\x14ToolchainConstraints\x12\x15\n\rallowed_tools\x18\x01 \x03(\t\x12\x18\n\x10\x61llowed_commands\x18\x02 \x03(\t\"P\n\x0f\x44iffConstraints\x12\x11\n\tmax_files\x18\x01 \x01(\x05\x12\x11\n\tmax_lines\x18\x02 \x01(\x05\x12\x17\n\x0f\x64\x65ny_path_globs\x18\x03 \x03(\t\"\x81\x02\n\x11PolicyConstraints\x12\x34\n\x07\x62udgets\x18\x01 \x01(\x0b\x32#.coretex.agent.v1.BudgetConstraints\x12\x31\n\x07sandbox\x18\x02 \x01(\x0b\x32 .coretex.agent.v1.SandboxProfile\x12\x39\n\ttoolchain\x18\x03 \x01(\x0b\x32&.coretex.agent.v1.ToolchainConstraints\x12/\n\x04\x64iff\x18\x04 \x01(\x0b\x32!.coretex.agent.v1.DiffConstraints\x12\x17\n\x0fredaction_level\x18\x05 \x01(\t\"\x8a\x02\n\x13PolicyCheckResponse\x12\x30\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\x1e.coretex.agent.v1.DecisionType\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x1c\n\x14redacted_context_ptr\x18\x03 \x01(\t\x12\x17\n\x0fpolicy_snapshot\x18\x04 \x01(\t\x12\x0f\n\x07rule_id\x18\x05 \x01(\t\x12\x38\n\x0b\x63onstraints\x18\x06 \x01(\x0b\x32#.coretex.agent.v1.PolicyConstraints\x12\x19\n\x11\x61pproval_required\x18\x07 \x01(\x08\x12\x14\n\x0c\x61pproval_ref\x18\x08 \x01(\t\"\x16\n\x14ListSnapshotsRequest\"*\n\x15ListSnapshotsResponse\x12\x11\n\tsnapshots\x18\x01 \x03(\t*\xc5\x01\n\x0c\x44\x65\x63isionType\x12\x1d\n\x19\x44\x45\x43ISION_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x45\x43ISION_TYPE_ALLOW\x10\x01\x12\x16\n\x12\x44\x45\x43ISION_TYPE_DENY\x10\x02\x12\x1f\n\x1b\x44\x45\x43ISION_TYPE_REQUIRE_HUMAN\x10\x03\x12\x1a\n\x16\x44\x45\x43ISION_TYPE_THROTTLE\x10\x04\x12(\n$DECISION_TYPE_ALLOW_WITH_CONSTRAINTS\x10\x05\x32\xd0\x03\n\x0cSafetyKernel\x12T\n\x05\x43heck\x12$.coretex.agent.v1.PolicyCheckRequest\x1a%.coretex.agent.v1.PolicyCheckResponse\x12W\n\x08\x45valuate\x12$.coretex.agent.v1.PolicyCheckRequest\x1a%.coretex.agent.v1.PolicyCheckResponse\x12V\n\x07\x45xplain\x12$.coretex.agent.v1.PolicyCheckRequest\x1a%.coretex.agent.v1.PolicyCheckResponse\x12W\n\x08Simulate\x12$.coretex.agent.v1.PolicyCheckRequest\x1a%.coretex.agent.v1.PolicyCheckResponse\x12`\n\rListSnapshots\x12&.coretex.agent.v1.ListSnapshotsRequest\x1a\'.coretex.agent.v1.ListSnapshotsResponseB\x84\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z,github.com/coretexos/cap/v2/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.safety_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z,github.com/coretexos/cap/v2/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
36
+ _globals['_POLICYCHECKREQUEST_LABELSENTRY']._loaded_options = None
37
+ _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_options = b'8\001'
38
+ _globals['_DECISIONTYPE']._serialized_start=1473
39
+ _globals['_DECISIONTYPE']._serialized_end=1670
40
+ _globals['_POLICYCHECKREQUEST']._serialized_start=80
41
+ _globals['_POLICYCHECKREQUEST']._serialized_end=487
42
+ _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_start=442
43
+ _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_end=487
44
+ _globals['_BUDGETCONSTRAINTS']._serialized_start=489
45
+ _globals['_BUDGETCONSTRAINTS']._serialized_end=610
46
+ _globals['_SANDBOXPROFILE']._serialized_start=612
47
+ _globals['_SANDBOXPROFILE']._serialized_end=718
48
+ _globals['_TOOLCHAINCONSTRAINTS']._serialized_start=720
49
+ _globals['_TOOLCHAINCONSTRAINTS']._serialized_end=791
50
+ _globals['_DIFFCONSTRAINTS']._serialized_start=793
51
+ _globals['_DIFFCONSTRAINTS']._serialized_end=873
52
+ _globals['_POLICYCONSTRAINTS']._serialized_start=876
53
+ _globals['_POLICYCONSTRAINTS']._serialized_end=1133
54
+ _globals['_POLICYCHECKRESPONSE']._serialized_start=1136
55
+ _globals['_POLICYCHECKRESPONSE']._serialized_end=1402
56
+ _globals['_LISTSNAPSHOTSREQUEST']._serialized_start=1404
57
+ _globals['_LISTSNAPSHOTSREQUEST']._serialized_end=1426
58
+ _globals['_LISTSNAPSHOTSRESPONSE']._serialized_start=1428
59
+ _globals['_LISTSNAPSHOTSRESPONSE']._serialized_end=1470
60
+ _globals['_SAFETYKERNEL']._serialized_start=1673
61
+ _globals['_SAFETYKERNEL']._serialized_end=2137
62
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,272 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from coretex.agent.v1 import safety_pb2 as coretex_dot_agent_dot_v1_dot_safety__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.76.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + ' but the generated code in coretex/agent/v1/safety_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class SafetyKernelStub(object):
29
+ """SafetyKernel defines the policy decision service.
30
+ """
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.Check = channel.unary_unary(
39
+ '/coretex.agent.v1.SafetyKernel/Check',
40
+ request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
41
+ response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
42
+ _registered_method=True)
43
+ self.Evaluate = channel.unary_unary(
44
+ '/coretex.agent.v1.SafetyKernel/Evaluate',
45
+ request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
46
+ response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
47
+ _registered_method=True)
48
+ self.Explain = channel.unary_unary(
49
+ '/coretex.agent.v1.SafetyKernel/Explain',
50
+ request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
51
+ response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
52
+ _registered_method=True)
53
+ self.Simulate = channel.unary_unary(
54
+ '/coretex.agent.v1.SafetyKernel/Simulate',
55
+ request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
56
+ response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
57
+ _registered_method=True)
58
+ self.ListSnapshots = channel.unary_unary(
59
+ '/coretex.agent.v1.SafetyKernel/ListSnapshots',
60
+ request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsRequest.SerializeToString,
61
+ response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsResponse.FromString,
62
+ _registered_method=True)
63
+
64
+
65
+ class SafetyKernelServicer(object):
66
+ """SafetyKernel defines the policy decision service.
67
+ """
68
+
69
+ def Check(self, request, context):
70
+ """Missing associated documentation comment in .proto file."""
71
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
72
+ context.set_details('Method not implemented!')
73
+ raise NotImplementedError('Method not implemented!')
74
+
75
+ def Evaluate(self, request, context):
76
+ """Missing associated documentation comment in .proto file."""
77
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
78
+ context.set_details('Method not implemented!')
79
+ raise NotImplementedError('Method not implemented!')
80
+
81
+ def Explain(self, request, context):
82
+ """Missing associated documentation comment in .proto file."""
83
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
84
+ context.set_details('Method not implemented!')
85
+ raise NotImplementedError('Method not implemented!')
86
+
87
+ def Simulate(self, request, context):
88
+ """Missing associated documentation comment in .proto file."""
89
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
90
+ context.set_details('Method not implemented!')
91
+ raise NotImplementedError('Method not implemented!')
92
+
93
+ def ListSnapshots(self, request, context):
94
+ """Missing associated documentation comment in .proto file."""
95
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
96
+ context.set_details('Method not implemented!')
97
+ raise NotImplementedError('Method not implemented!')
98
+
99
+
100
+ def add_SafetyKernelServicer_to_server(servicer, server):
101
+ rpc_method_handlers = {
102
+ 'Check': grpc.unary_unary_rpc_method_handler(
103
+ servicer.Check,
104
+ request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.FromString,
105
+ response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.SerializeToString,
106
+ ),
107
+ 'Evaluate': grpc.unary_unary_rpc_method_handler(
108
+ servicer.Evaluate,
109
+ request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.FromString,
110
+ response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.SerializeToString,
111
+ ),
112
+ 'Explain': grpc.unary_unary_rpc_method_handler(
113
+ servicer.Explain,
114
+ request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.FromString,
115
+ response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.SerializeToString,
116
+ ),
117
+ 'Simulate': grpc.unary_unary_rpc_method_handler(
118
+ servicer.Simulate,
119
+ request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.FromString,
120
+ response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.SerializeToString,
121
+ ),
122
+ 'ListSnapshots': grpc.unary_unary_rpc_method_handler(
123
+ servicer.ListSnapshots,
124
+ request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsRequest.FromString,
125
+ response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsResponse.SerializeToString,
126
+ ),
127
+ }
128
+ generic_handler = grpc.method_handlers_generic_handler(
129
+ 'coretex.agent.v1.SafetyKernel', rpc_method_handlers)
130
+ server.add_generic_rpc_handlers((generic_handler,))
131
+ server.add_registered_method_handlers('coretex.agent.v1.SafetyKernel', rpc_method_handlers)
132
+
133
+
134
+ # This class is part of an EXPERIMENTAL API.
135
+ class SafetyKernel(object):
136
+ """SafetyKernel defines the policy decision service.
137
+ """
138
+
139
+ @staticmethod
140
+ def Check(request,
141
+ target,
142
+ options=(),
143
+ channel_credentials=None,
144
+ call_credentials=None,
145
+ insecure=False,
146
+ compression=None,
147
+ wait_for_ready=None,
148
+ timeout=None,
149
+ metadata=None):
150
+ return grpc.experimental.unary_unary(
151
+ request,
152
+ target,
153
+ '/coretex.agent.v1.SafetyKernel/Check',
154
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
155
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
156
+ options,
157
+ channel_credentials,
158
+ insecure,
159
+ call_credentials,
160
+ compression,
161
+ wait_for_ready,
162
+ timeout,
163
+ metadata,
164
+ _registered_method=True)
165
+
166
+ @staticmethod
167
+ def Evaluate(request,
168
+ target,
169
+ options=(),
170
+ channel_credentials=None,
171
+ call_credentials=None,
172
+ insecure=False,
173
+ compression=None,
174
+ wait_for_ready=None,
175
+ timeout=None,
176
+ metadata=None):
177
+ return grpc.experimental.unary_unary(
178
+ request,
179
+ target,
180
+ '/coretex.agent.v1.SafetyKernel/Evaluate',
181
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
182
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
183
+ options,
184
+ channel_credentials,
185
+ insecure,
186
+ call_credentials,
187
+ compression,
188
+ wait_for_ready,
189
+ timeout,
190
+ metadata,
191
+ _registered_method=True)
192
+
193
+ @staticmethod
194
+ def Explain(request,
195
+ target,
196
+ options=(),
197
+ channel_credentials=None,
198
+ call_credentials=None,
199
+ insecure=False,
200
+ compression=None,
201
+ wait_for_ready=None,
202
+ timeout=None,
203
+ metadata=None):
204
+ return grpc.experimental.unary_unary(
205
+ request,
206
+ target,
207
+ '/coretex.agent.v1.SafetyKernel/Explain',
208
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
209
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
210
+ options,
211
+ channel_credentials,
212
+ insecure,
213
+ call_credentials,
214
+ compression,
215
+ wait_for_ready,
216
+ timeout,
217
+ metadata,
218
+ _registered_method=True)
219
+
220
+ @staticmethod
221
+ def Simulate(request,
222
+ target,
223
+ options=(),
224
+ channel_credentials=None,
225
+ call_credentials=None,
226
+ insecure=False,
227
+ compression=None,
228
+ wait_for_ready=None,
229
+ timeout=None,
230
+ metadata=None):
231
+ return grpc.experimental.unary_unary(
232
+ request,
233
+ target,
234
+ '/coretex.agent.v1.SafetyKernel/Simulate',
235
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
236
+ coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
237
+ options,
238
+ channel_credentials,
239
+ insecure,
240
+ call_credentials,
241
+ compression,
242
+ wait_for_ready,
243
+ timeout,
244
+ metadata,
245
+ _registered_method=True)
246
+
247
+ @staticmethod
248
+ def ListSnapshots(request,
249
+ target,
250
+ options=(),
251
+ channel_credentials=None,
252
+ call_credentials=None,
253
+ insecure=False,
254
+ compression=None,
255
+ wait_for_ready=None,
256
+ timeout=None,
257
+ metadata=None):
258
+ return grpc.experimental.unary_unary(
259
+ request,
260
+ target,
261
+ '/coretex.agent.v1.SafetyKernel/ListSnapshots',
262
+ coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsRequest.SerializeToString,
263
+ coretex_dot_agent_dot_v1_dot_safety__pb2.ListSnapshotsResponse.FromString,
264
+ options,
265
+ channel_credentials,
266
+ insecure,
267
+ call_credentials,
268
+ compression,
269
+ wait_for_ready,
270
+ timeout,
271
+ metadata,
272
+ _registered_method=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cap-sdk-python
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: CAP (coretex Agent Protocol) Python SDK
5
5
  Project-URL: Homepage, https://github.com/coretexos/cap
6
6
  Requires-Python: >=3.9
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cap-sdk-python"
7
- version = "2.0.6"
7
+ version = "2.0.7"
8
8
  description = "CAP (coretex Agent Protocol) Python SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,5 +0,0 @@
1
- from .client import submit_job
2
- from .worker import run_worker
3
- from .bus import connect_nats
4
-
5
- __all__ = ["submit_job", "run_worker", "connect_nats"]
@@ -1,55 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
- # source: coretex/agent/v1/job.proto
5
- # Protobuf Python Version: 6.31.1
6
- """Generated protocol buffer code."""
7
- from google.protobuf import descriptor as _descriptor
8
- from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
- from google.protobuf import symbol_database as _symbol_database
11
- from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 6,
15
- 31,
16
- 1,
17
- '',
18
- 'coretex/agent/v1/job.proto'
19
- )
20
- # @@protoc_insertion_point(imports)
21
-
22
- _sym_db = _symbol_database.Default()
23
-
24
-
25
-
26
-
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x63oretex/agent/v1/job.proto\x12\x10\x63oretex.agent.v1\"l\n\x0c\x43ontextHints\x12\x18\n\x10max_input_tokens\x18\x01 \x01(\x05\x12\x1b\n\x13\x61llow_summarization\x18\x02 \x01(\x08\x12\x17\n\x0f\x61llow_retrieval\x18\x03 \x01(\x08\x12\x0c\n\x04tags\x18\x04 \x03(\t\"l\n\x06\x42udget\x12\x18\n\x10max_input_tokens\x18\x01 \x01(\x03\x12\x19\n\x11max_output_tokens\x18\x02 \x01(\x03\x12\x18\n\x10max_total_tokens\x18\x03 \x01(\x03\x12\x13\n\x0b\x64\x65\x61\x64line_ms\x18\x04 \x01(\x03\"\xab\x04\n\nJobRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12/\n\x08priority\x18\x03 \x01(\x0e\x32\x1d.coretex.agent.v1.JobPriority\x12\x13\n\x0b\x63ontext_ptr\x18\x04 \x01(\t\x12\x12\n\nadapter_id\x18\x05 \x01(\t\x12\x32\n\x03\x65nv\x18\x06 \x03(\x0b\x32%.coretex.agent.v1.JobRequest.EnvEntry\x12\x15\n\rparent_job_id\x18\x07 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x08 \x01(\t\x12\x12\n\nstep_index\x18\t \x01(\x05\x12\x11\n\tmemory_id\x18\n \x01(\t\x12\x35\n\rcontext_hints\x18\x0b \x01(\x0b\x32\x1e.coretex.agent.v1.ContextHints\x12(\n\x06\x62udget\x18\x0c \x01(\x0b\x32\x18.coretex.agent.v1.Budget\x12\x11\n\ttenant_id\x18\r \x01(\t\x12\x14\n\x0cprincipal_id\x18\x0e \x01(\t\x12\x38\n\x06labels\x18\x0f \x03(\x0b\x32(.coretex.agent.v1.JobRequest.LabelsEntry\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb0\x01\n\tJobResult\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12+\n\x06status\x18\x02 \x01(\x0e\x32\x1b.coretex.agent.v1.JobStatus\x12\x12\n\nresult_ptr\x18\x03 \x01(\t\x12\x11\n\tworker_id\x18\x04 \x01(\t\x12\x14\n\x0c\x65xecution_ms\x18\x05 \x01(\x03\x12\x12\n\nerror_code\x18\x06 \x01(\t\x12\x15\n\rerror_message\x18\x07 \x01(\t*|\n\x0bJobPriority\x12\x1c\n\x18JOB_PRIORITY_UNSPECIFIED\x10\x00\x12\x1c\n\x18JOB_PRIORITY_INTERACTIVE\x10\x01\x12\x16\n\x12JOB_PRIORITY_BATCH\x10\x02\x12\x19\n\x15JOB_PRIORITY_CRITICAL\x10\x03*\x86\x02\n\tJobStatus\x12\x1a\n\x16JOB_STATUS_UNSPECIFIED\x10\x00\x12\x16\n\x12JOB_STATUS_PENDING\x10\x01\x12\x18\n\x14JOB_STATUS_SCHEDULED\x10\x02\x12\x19\n\x15JOB_STATUS_DISPATCHED\x10\x03\x12\x16\n\x12JOB_STATUS_RUNNING\x10\x04\x12\x18\n\x14JOB_STATUS_SUCCEEDED\x10\x05\x12\x15\n\x11JOB_STATUS_FAILED\x10\x06\x12\x18\n\x14JOB_STATUS_CANCELLED\x10\x07\x12\x15\n\x11JOB_STATUS_DENIED\x10\x08\x12\x16\n\x12JOB_STATUS_TIMEOUT\x10\tB\x87\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
28
-
29
- _globals = globals()
30
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.job_pb2', _globals)
32
- if not _descriptor._USE_C_DESCRIPTORS:
33
- _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
35
- _globals['_JOBREQUEST_ENVENTRY']._loaded_options = None
36
- _globals['_JOBREQUEST_ENVENTRY']._serialized_options = b'8\001'
37
- _globals['_JOBREQUEST_LABELSENTRY']._loaded_options = None
38
- _globals['_JOBREQUEST_LABELSENTRY']._serialized_options = b'8\001'
39
- _globals['_JOBPRIORITY']._serialized_start=1005
40
- _globals['_JOBPRIORITY']._serialized_end=1129
41
- _globals['_JOBSTATUS']._serialized_start=1132
42
- _globals['_JOBSTATUS']._serialized_end=1394
43
- _globals['_CONTEXTHINTS']._serialized_start=48
44
- _globals['_CONTEXTHINTS']._serialized_end=156
45
- _globals['_BUDGET']._serialized_start=158
46
- _globals['_BUDGET']._serialized_end=266
47
- _globals['_JOBREQUEST']._serialized_start=269
48
- _globals['_JOBREQUEST']._serialized_end=824
49
- _globals['_JOBREQUEST_ENVENTRY']._serialized_start=735
50
- _globals['_JOBREQUEST_ENVENTRY']._serialized_end=777
51
- _globals['_JOBREQUEST_LABELSENTRY']._serialized_start=779
52
- _globals['_JOBREQUEST_LABELSENTRY']._serialized_end=824
53
- _globals['_JOBRESULT']._serialized_start=827
54
- _globals['_JOBRESULT']._serialized_end=1003
55
- # @@protoc_insertion_point(module_scope)
@@ -1,48 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
- # source: coretex/agent/v1/safety.proto
5
- # Protobuf Python Version: 6.31.1
6
- """Generated protocol buffer code."""
7
- from google.protobuf import descriptor as _descriptor
8
- from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
- from google.protobuf import symbol_database as _symbol_database
11
- from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 6,
15
- 31,
16
- 1,
17
- '',
18
- 'coretex/agent/v1/safety.proto'
19
- )
20
- # @@protoc_insertion_point(imports)
21
-
22
- _sym_db = _symbol_database.Default()
23
-
24
-
25
- from coretex.agent.v1 import job_pb2 as coretex_dot_agent_dot_v1_dot_job__pb2
26
-
27
-
28
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x63oretex/agent/v1/safety.proto\x12\x10\x63oretex.agent.v1\x1a\x1a\x63oretex/agent/v1/job.proto\"\xea\x02\n\x12PolicyCheckRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\x12/\n\x08priority\x18\x04 \x01(\x0e\x32\x1d.coretex.agent.v1.JobPriority\x12\x16\n\x0e\x65stimated_cost\x18\x05 \x01(\x01\x12(\n\x06\x62udget\x18\x06 \x01(\x0b\x32\x18.coretex.agent.v1.Budget\x12\x14\n\x0cprincipal_id\x18\x07 \x01(\t\x12@\n\x06labels\x18\x08 \x03(\x0b\x32\x30.coretex.agent.v1.PolicyCheckRequest.LabelsEntry\x12\x11\n\tmemory_id\x18\t \x01(\t\x12\x18\n\x10\x65\x66\x66\x65\x63tive_config\x18\n \x01(\x0c\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"u\n\x13PolicyCheckResponse\x12\x30\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\x1e.coretex.agent.v1.DecisionType\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x1c\n\x14redacted_context_ptr\x18\x03 \x01(\t*\x9b\x01\n\x0c\x44\x65\x63isionType\x12\x1d\n\x19\x44\x45\x43ISION_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x45\x43ISION_TYPE_ALLOW\x10\x01\x12\x16\n\x12\x44\x45\x43ISION_TYPE_DENY\x10\x02\x12\x1f\n\x1b\x44\x45\x43ISION_TYPE_REQUIRE_HUMAN\x10\x03\x12\x1a\n\x16\x44\x45\x43ISION_TYPE_THROTTLE\x10\x04\x32\x64\n\x0cSafetyKernel\x12T\n\x05\x43heck\x12$.coretex.agent.v1.PolicyCheckRequest\x1a%.coretex.agent.v1.PolicyCheckResponseB\x87\x01\n\x17\x61i.coretex.cap.agent.v1P\x01Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\xaa\x02\x10\x63oretex.Agent.V1\xca\x02\x10\x63oretex\\Agent\\V1\xea\x02\x12\x63oretex::Agent::V1b\x06proto3')
29
-
30
- _globals = globals()
31
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'coretex.agent.v1.safety_pb2', _globals)
33
- if not _descriptor._USE_C_DESCRIPTORS:
34
- _globals['DESCRIPTOR']._loaded_options = None
35
- _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.coretex.cap.agent.v1P\001Z/github.com/coretexos/cap/v2/go/coretex/agent/v1\252\002\020coretex.Agent.V1\312\002\020coretex\\Agent\\V1\352\002\022coretex::Agent::V1'
36
- _globals['_POLICYCHECKREQUEST_LABELSENTRY']._loaded_options = None
37
- _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_options = b'8\001'
38
- _globals['_DECISIONTYPE']._serialized_start=564
39
- _globals['_DECISIONTYPE']._serialized_end=719
40
- _globals['_POLICYCHECKREQUEST']._serialized_start=80
41
- _globals['_POLICYCHECKREQUEST']._serialized_end=442
42
- _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_start=397
43
- _globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_end=442
44
- _globals['_POLICYCHECKRESPONSE']._serialized_start=444
45
- _globals['_POLICYCHECKRESPONSE']._serialized_end=561
46
- _globals['_SAFETYKERNEL']._serialized_start=721
47
- _globals['_SAFETYKERNEL']._serialized_end=821
48
- # @@protoc_insertion_point(module_scope)
@@ -1,100 +0,0 @@
1
- # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
- """Client and server classes corresponding to protobuf-defined services."""
3
- import grpc
4
- import warnings
5
-
6
- from coretex.agent.v1 import safety_pb2 as coretex_dot_agent_dot_v1_dot_safety__pb2
7
-
8
- GRPC_GENERATED_VERSION = '1.76.0'
9
- GRPC_VERSION = grpc.__version__
10
- _version_not_supported = False
11
-
12
- try:
13
- from grpc._utilities import first_version_is_lower
14
- _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
- except ImportError:
16
- _version_not_supported = True
17
-
18
- if _version_not_supported:
19
- raise RuntimeError(
20
- f'The grpc package installed is at version {GRPC_VERSION},'
21
- + ' but the generated code in coretex/agent/v1/safety_pb2_grpc.py depends on'
22
- + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
- + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
- + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
- )
26
-
27
-
28
- class SafetyKernelStub(object):
29
- """SafetyKernel defines the policy decision service.
30
- """
31
-
32
- def __init__(self, channel):
33
- """Constructor.
34
-
35
- Args:
36
- channel: A grpc.Channel.
37
- """
38
- self.Check = channel.unary_unary(
39
- '/coretex.agent.v1.SafetyKernel/Check',
40
- request_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
41
- response_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
42
- _registered_method=True)
43
-
44
-
45
- class SafetyKernelServicer(object):
46
- """SafetyKernel defines the policy decision service.
47
- """
48
-
49
- def Check(self, request, context):
50
- """Missing associated documentation comment in .proto file."""
51
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
52
- context.set_details('Method not implemented!')
53
- raise NotImplementedError('Method not implemented!')
54
-
55
-
56
- def add_SafetyKernelServicer_to_server(servicer, server):
57
- rpc_method_handlers = {
58
- 'Check': grpc.unary_unary_rpc_method_handler(
59
- servicer.Check,
60
- request_deserializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.FromString,
61
- response_serializer=coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.SerializeToString,
62
- ),
63
- }
64
- generic_handler = grpc.method_handlers_generic_handler(
65
- 'coretex.agent.v1.SafetyKernel', rpc_method_handlers)
66
- server.add_generic_rpc_handlers((generic_handler,))
67
- server.add_registered_method_handlers('coretex.agent.v1.SafetyKernel', rpc_method_handlers)
68
-
69
-
70
- # This class is part of an EXPERIMENTAL API.
71
- class SafetyKernel(object):
72
- """SafetyKernel defines the policy decision service.
73
- """
74
-
75
- @staticmethod
76
- def Check(request,
77
- target,
78
- options=(),
79
- channel_credentials=None,
80
- call_credentials=None,
81
- insecure=False,
82
- compression=None,
83
- wait_for_ready=None,
84
- timeout=None,
85
- metadata=None):
86
- return grpc.experimental.unary_unary(
87
- request,
88
- target,
89
- '/coretex.agent.v1.SafetyKernel/Check',
90
- coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckRequest.SerializeToString,
91
- coretex_dot_agent_dot_v1_dot_safety__pb2.PolicyCheckResponse.FromString,
92
- options,
93
- channel_credentials,
94
- insecure,
95
- call_credentials,
96
- compression,
97
- wait_for_ready,
98
- timeout,
99
- metadata,
100
- _registered_method=True)
File without changes
File without changes