victor-contracts 0.7.2__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.
- victor_contracts/__init__.py +497 -0
- victor_contracts/agent_spec_runtime.py +46 -0
- victor_contracts/capabilities/__init__.py +183 -0
- victor_contracts/capabilities/runtime.py +588 -0
- victor_contracts/capability_runtime.py +113 -0
- victor_contracts/chain_runtime.py +29 -0
- victor_contracts/cli.py +46 -0
- victor_contracts/constants/__init__.py +34 -0
- victor_contracts/constants/capability_ids.py +53 -0
- victor_contracts/constants/tool_names.py +226 -0
- victor_contracts/conversation.py +400 -0
- victor_contracts/core/__init__.py +80 -0
- victor_contracts/core/api_version.py +14 -0
- victor_contracts/core/capability_contract.py +87 -0
- victor_contracts/core/exceptions.py +72 -0
- victor_contracts/core/plugins.py +355 -0
- victor_contracts/core/types.py +1412 -0
- victor_contracts/database_runtime.py +24 -0
- victor_contracts/discovery.py +769 -0
- victor_contracts/enrichment_runtime.py +61 -0
- victor_contracts/feature_flag_runtime.py +25 -0
- victor_contracts/framework/__init__.py +14 -0
- victor_contracts/framework/protocols/__init__.py +11 -0
- victor_contracts/framework/protocols/orchestrator.py +86 -0
- victor_contracts/framework/protocols/teams.py +58 -0
- victor_contracts/framework/protocols/workflows.py +63 -0
- victor_contracts/graph_rag_runtime.py +24 -0
- victor_contracts/graph_runtime.py +29 -0
- victor_contracts/handler_runtime.py +153 -0
- victor_contracts/indexing_runtime.py +37 -0
- victor_contracts/init_runtime.py +25 -0
- victor_contracts/lsp_runtime.py +85 -0
- victor_contracts/middleware_runtime.py +47 -0
- victor_contracts/multi_agent.py +310 -0
- victor_contracts/processing_runtime.py +98 -0
- victor_contracts/protocols.py +92 -0
- victor_contracts/provider_runtime.py +32 -0
- victor_contracts/providers/__init__.py +10 -0
- victor_contracts/providers/protocols/__init__.py +7 -0
- victor_contracts/providers/protocols/llm.py +109 -0
- victor_contracts/registries.py +70 -0
- victor_contracts/rl.py +129 -0
- victor_contracts/rl_runtime.py +65 -0
- victor_contracts/safety/__init__.py +75 -0
- victor_contracts/safety/framework.py +162 -0
- victor_contracts/safety/patterns.py +64 -0
- victor_contracts/safety/pii.py +275 -0
- victor_contracts/safety/runtime.py +402 -0
- victor_contracts/safety_patterns.py +100 -0
- victor_contracts/safety_policy.py +46 -0
- victor_contracts/search_runtime.py +57 -0
- victor_contracts/skills/__init__.py +10 -0
- victor_contracts/skills/definition.py +84 -0
- victor_contracts/skills/provider.py +24 -0
- victor_contracts/subagent_runtime.py +40 -0
- victor_contracts/team_schema.py +351 -0
- victor_contracts/testing/__init__.py +197 -0
- victor_contracts/testing/fixtures.py +179 -0
- victor_contracts/tool_runtime.py +29 -0
- victor_contracts/tools.py +153 -0
- victor_contracts/utils/__init__.py +0 -0
- victor_contracts/utils/ast_helpers.py +246 -0
- victor_contracts/validation.py +189 -0
- victor_contracts/verticals/__init__.py +126 -0
- victor_contracts/verticals/extensions.py +241 -0
- victor_contracts/verticals/manifest.py +154 -0
- victor_contracts/verticals/metadata.py +183 -0
- victor_contracts/verticals/mixins/__init__.py +24 -0
- victor_contracts/verticals/mixins/extension_provider_mixin.py +107 -0
- victor_contracts/verticals/mixins/prompt_metadata_mixin.py +39 -0
- victor_contracts/verticals/mixins/rl_mixin.py +24 -0
- victor_contracts/verticals/mixins/team_mixin.py +54 -0
- victor_contracts/verticals/mixins/workflow_metadata_mixin.py +53 -0
- victor_contracts/verticals/mode_config.py +266 -0
- victor_contracts/verticals/protocols/__init__.py +250 -0
- victor_contracts/verticals/protocols/base.py +503 -0
- victor_contracts/verticals/protocols/capabilities.py +108 -0
- victor_contracts/verticals/protocols/compaction.py +42 -0
- victor_contracts/verticals/protocols/config.py +133 -0
- victor_contracts/verticals/protocols/conversation.py +91 -0
- victor_contracts/verticals/protocols/enrichment.py +69 -0
- victor_contracts/verticals/protocols/handlers.py +75 -0
- victor_contracts/verticals/protocols/hooks.py +66 -0
- victor_contracts/verticals/protocols/mcp.py +59 -0
- victor_contracts/verticals/protocols/memory.py +73 -0
- victor_contracts/verticals/protocols/middleware.py +54 -0
- victor_contracts/verticals/protocols/modes.py +57 -0
- victor_contracts/verticals/protocols/permissions.py +48 -0
- victor_contracts/verticals/protocols/plugins.py +47 -0
- victor_contracts/verticals/protocols/promoted.py +756 -0
- victor_contracts/verticals/protocols/promoted_types.py +288 -0
- victor_contracts/verticals/protocols/prompts.py +104 -0
- victor_contracts/verticals/protocols/rl.py +49 -0
- victor_contracts/verticals/protocols/safety.py +116 -0
- victor_contracts/verticals/protocols/sandbox.py +42 -0
- victor_contracts/verticals/protocols/services.py +72 -0
- victor_contracts/verticals/protocols/storage.py +187 -0
- victor_contracts/verticals/protocols/teams.py +51 -0
- victor_contracts/verticals/protocols/tool_plugins.py +159 -0
- victor_contracts/verticals/protocols/tools.py +185 -0
- victor_contracts/verticals/protocols/workflows.py +87 -0
- victor_contracts/verticals/registration.py +88 -0
- victor_contracts/verticals/tool_dependencies.py +655 -0
- victor_contracts/verticals/validation.py +230 -0
- victor_contracts/workflow_executor_runtime.py +49 -0
- victor_contracts/workflow_runtime.py +70 -0
- victor_contracts/workflows.py +99 -0
- victor_contracts-0.7.2.dist-info/METADATA +264 -0
- victor_contracts-0.7.2.dist-info/RECORD +113 -0
- victor_contracts-0.7.2.dist-info/WHEEL +5 -0
- victor_contracts-0.7.2.dist-info/entry_points.txt +2 -0
- victor_contracts-0.7.2.dist-info/top_level.txt +2 -0
- victor_sdk/__init__.py +82 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Victor Contracts - Protocol definitions for vertical development.
|
|
3
|
+
|
|
4
|
+
This package provides pure protocol/ABC definitions that external verticals
|
|
5
|
+
can depend on without pulling in the entire Victor framework.
|
|
6
|
+
|
|
7
|
+
Version: Synchronized with victor-ai
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
# ruff: noqa: E402
|
|
11
|
+
|
|
12
|
+
import sys
|
|
13
|
+
from typing import TYPE_CHECKING, Any
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from victor_contracts.workflow_runtime import (
|
|
17
|
+
BaseYAMLWorkflowProvider,
|
|
18
|
+
WorkflowBuilder,
|
|
19
|
+
WorkflowDefinition,
|
|
20
|
+
workflow,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
_MIN_SUPPORTED_PYTHON = (3, 10)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _ensure_supported_python() -> None:
|
|
27
|
+
"""Fail fast with a clear error on unsupported interpreters."""
|
|
28
|
+
current = sys.version_info[:3]
|
|
29
|
+
if current >= _MIN_SUPPORTED_PYTHON:
|
|
30
|
+
return
|
|
31
|
+
|
|
32
|
+
required = ".".join(str(part) for part in _MIN_SUPPORTED_PYTHON)
|
|
33
|
+
running = ".".join(str(part) for part in current)
|
|
34
|
+
raise RuntimeError(
|
|
35
|
+
f"victor-contracts requires Python {required}+; current interpreter is Python {running}. "
|
|
36
|
+
"Use Python 3.10 or newer."
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
_ensure_supported_python()
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
from importlib.metadata import version as _get_version
|
|
44
|
+
|
|
45
|
+
__version__ = _get_version("victor-contracts")
|
|
46
|
+
except Exception:
|
|
47
|
+
__version__ = "0.0.0"
|
|
48
|
+
|
|
49
|
+
# Core types
|
|
50
|
+
from victor_contracts.core.types import (
|
|
51
|
+
CapabilityRequirement,
|
|
52
|
+
CapabilityRequirementLike,
|
|
53
|
+
CURRENT_DEFINITION_VERSION,
|
|
54
|
+
MINIMUM_SUPPORTED_DEFINITION_VERSION,
|
|
55
|
+
PromptMetadata,
|
|
56
|
+
PromptTemplateDefinition,
|
|
57
|
+
PromptTemplateLike,
|
|
58
|
+
TeamDefinition,
|
|
59
|
+
TeamDefinitionLike,
|
|
60
|
+
TeamMemberDefinition,
|
|
61
|
+
TeamMemberDefinitionLike,
|
|
62
|
+
TeamMetadata,
|
|
63
|
+
StageDefinitionLike,
|
|
64
|
+
TaskTypeHintDefinition,
|
|
65
|
+
TaskTypeHintLike,
|
|
66
|
+
ToolRequirement,
|
|
67
|
+
ToolRequirementLike,
|
|
68
|
+
VerticalConfig,
|
|
69
|
+
VerticalDefinition,
|
|
70
|
+
is_supported_definition_version,
|
|
71
|
+
WorkflowMetadata,
|
|
72
|
+
StageDefinition,
|
|
73
|
+
TieredToolConfig,
|
|
74
|
+
ToolSet,
|
|
75
|
+
normalize_capability_requirement,
|
|
76
|
+
normalize_capability_requirements,
|
|
77
|
+
normalize_prompt_metadata,
|
|
78
|
+
normalize_prompt_template,
|
|
79
|
+
normalize_prompt_templates,
|
|
80
|
+
normalize_stage_definition,
|
|
81
|
+
normalize_stage_definitions,
|
|
82
|
+
normalize_task_type_hint,
|
|
83
|
+
normalize_task_type_hints,
|
|
84
|
+
normalize_team_definition,
|
|
85
|
+
normalize_team_definitions,
|
|
86
|
+
normalize_team_member_definition,
|
|
87
|
+
normalize_team_member_definitions,
|
|
88
|
+
normalize_team_metadata,
|
|
89
|
+
normalize_tool_requirement,
|
|
90
|
+
normalize_tool_requirements,
|
|
91
|
+
validate_definition_version,
|
|
92
|
+
normalize_workflow_metadata,
|
|
93
|
+
)
|
|
94
|
+
from victor_contracts.capabilities import (
|
|
95
|
+
BaseCapabilityProvider,
|
|
96
|
+
CapabilityConfigMergePolicy,
|
|
97
|
+
CapabilityConfigScopePortProtocol,
|
|
98
|
+
CapabilityConfigService,
|
|
99
|
+
CapabilityEntry,
|
|
100
|
+
CapabilityLoaderPortProtocol,
|
|
101
|
+
CapabilityMetadata,
|
|
102
|
+
CapabilityType,
|
|
103
|
+
DEFAULT_CAPABILITY_CONFIG_SCOPE_KEY,
|
|
104
|
+
FileOperation,
|
|
105
|
+
FileOperationsCapability,
|
|
106
|
+
FileOperationType,
|
|
107
|
+
OrchestratorCapability,
|
|
108
|
+
PromptContribution,
|
|
109
|
+
PromptContributionCapability,
|
|
110
|
+
build_capability_loader,
|
|
111
|
+
capability,
|
|
112
|
+
load_capability_config,
|
|
113
|
+
register_capability_entries,
|
|
114
|
+
resolve_capability_config_scope_key,
|
|
115
|
+
resolve_capability_config_service,
|
|
116
|
+
store_capability_config,
|
|
117
|
+
update_capability_config_section,
|
|
118
|
+
)
|
|
119
|
+
from victor_contracts.rl import (
|
|
120
|
+
BaseRLConfig,
|
|
121
|
+
DEFAULT_ACTIVE_LEARNERS,
|
|
122
|
+
DEFAULT_PATIENCE_MAP,
|
|
123
|
+
LearnerType,
|
|
124
|
+
)
|
|
125
|
+
from victor_contracts.conversation import (
|
|
126
|
+
ConversationContext,
|
|
127
|
+
ConversationCoordinator,
|
|
128
|
+
ConversationStats,
|
|
129
|
+
ConversationTurn,
|
|
130
|
+
TurnType,
|
|
131
|
+
)
|
|
132
|
+
from victor_contracts.multi_agent import (
|
|
133
|
+
CommunicationStyle,
|
|
134
|
+
ExpertiseLevel,
|
|
135
|
+
PersonaTemplate,
|
|
136
|
+
PersonaTraits,
|
|
137
|
+
TaskAssignmentStrategy,
|
|
138
|
+
TeamMember,
|
|
139
|
+
TeamSpec,
|
|
140
|
+
TeamTemplate,
|
|
141
|
+
TeamTopology,
|
|
142
|
+
)
|
|
143
|
+
from victor_contracts.tools import (
|
|
144
|
+
AccessMode,
|
|
145
|
+
CostTier,
|
|
146
|
+
DangerLevel,
|
|
147
|
+
ExecutionCategory,
|
|
148
|
+
ToolCategory,
|
|
149
|
+
ToolContract,
|
|
150
|
+
)
|
|
151
|
+
from victor_contracts.tools import CONTRACT as TOOL_CONTRACT
|
|
152
|
+
from victor_contracts.safety import (
|
|
153
|
+
SafetyAction,
|
|
154
|
+
SafetyCategory,
|
|
155
|
+
SafetyCheckResult,
|
|
156
|
+
SafetyCoordinator,
|
|
157
|
+
SafetyRule,
|
|
158
|
+
SafetyStats,
|
|
159
|
+
)
|
|
160
|
+
from victor_contracts.workflows import (
|
|
161
|
+
ComputeHandlerProtocol,
|
|
162
|
+
ComputeHandlerRegistrar,
|
|
163
|
+
ComputeNodeProtocol,
|
|
164
|
+
ExecutorNodeStatus,
|
|
165
|
+
NodeResult,
|
|
166
|
+
WorkflowContextProtocol,
|
|
167
|
+
register_compute_handlers,
|
|
168
|
+
)
|
|
169
|
+
from victor_contracts.core.plugins import PluginContext, VictorPlugin
|
|
170
|
+
from victor_contracts.registries import (
|
|
171
|
+
PersonaRegistryProtocol,
|
|
172
|
+
TeamRegistryProtocol,
|
|
173
|
+
get_default_persona_registry,
|
|
174
|
+
get_default_team_registry,
|
|
175
|
+
set_default_persona_registry,
|
|
176
|
+
set_default_team_registry,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
# Core exceptions
|
|
180
|
+
from victor_contracts.core.exceptions import (
|
|
181
|
+
VerticalException,
|
|
182
|
+
VerticalConfigurationError,
|
|
183
|
+
VerticalProtocolError,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# Vertical protocols
|
|
187
|
+
from victor_contracts.verticals import (
|
|
188
|
+
ExtensionDependency,
|
|
189
|
+
MiddlewarePriority,
|
|
190
|
+
MiddlewareResult,
|
|
191
|
+
SafetyPattern,
|
|
192
|
+
StaticModeConfigProvider,
|
|
193
|
+
TaskTypeHint,
|
|
194
|
+
ToolDependencyConfig,
|
|
195
|
+
ToolDependency,
|
|
196
|
+
ToolDependencyLoadError,
|
|
197
|
+
ToolDependencyLoader,
|
|
198
|
+
ToolDependencyProviderProtocol,
|
|
199
|
+
YAMLToolDependencyProvider,
|
|
200
|
+
VerticalModeConfig,
|
|
201
|
+
create_tool_dependency_provider,
|
|
202
|
+
get_cached_provider,
|
|
203
|
+
invalidate_provider_cache,
|
|
204
|
+
load_tool_dependency_yaml,
|
|
205
|
+
register_vertical,
|
|
206
|
+
)
|
|
207
|
+
from victor_contracts.verticals.protocols.storage import CCGBuilderProtocol
|
|
208
|
+
from victor_contracts.verticals.mode_config import ModeDefinition
|
|
209
|
+
from victor_contracts.verticals.protocols.base import VerticalBase
|
|
210
|
+
from victor_contracts.verticals.protocols.capabilities import (
|
|
211
|
+
CapabilityProvider,
|
|
212
|
+
ChainProvider,
|
|
213
|
+
PersonaProvider,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
# Extension manifest
|
|
217
|
+
from victor_contracts.verticals.manifest import ExtensionManifest, ExtensionType
|
|
218
|
+
from victor_contracts.verticals.extensions import VerticalExtensions
|
|
219
|
+
from victor_contracts.verticals.protocols.mcp import McpProvider, McpToolProvider
|
|
220
|
+
from victor_contracts.verticals.protocols.sandbox import SandboxProvider
|
|
221
|
+
from victor_contracts.verticals.protocols.hooks import HookProvider, HookConfigProvider
|
|
222
|
+
from victor_contracts.verticals.protocols.permissions import PermissionProvider
|
|
223
|
+
from victor_contracts.verticals.protocols.compaction import CompactionProvider
|
|
224
|
+
from victor_contracts.verticals.protocols.plugins import ExternalPluginProvider
|
|
225
|
+
from victor_contracts.core.api_version import (
|
|
226
|
+
CURRENT_API_VERSION,
|
|
227
|
+
MIN_SUPPORTED_API_VERSION,
|
|
228
|
+
is_compatible,
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
# Discovery and registration
|
|
232
|
+
from victor_contracts.discovery import (
|
|
233
|
+
ProtocolRegistry,
|
|
234
|
+
ProtocolMetadata,
|
|
235
|
+
DiscoveryStats,
|
|
236
|
+
collect_verticals_from_candidate,
|
|
237
|
+
get_global_registry,
|
|
238
|
+
reset_global_registry,
|
|
239
|
+
discover_verticals,
|
|
240
|
+
discover_protocols,
|
|
241
|
+
get_discovery_summary,
|
|
242
|
+
reload_discovery,
|
|
243
|
+
)
|
|
244
|
+
from victor_contracts.skills import SkillDefinition, SkillProvider
|
|
245
|
+
|
|
246
|
+
# Phase 4 promotions: types heavily used by external verticals
|
|
247
|
+
from victor_contracts.multi_agent import TeamFormation, TeamMemberSpec
|
|
248
|
+
from victor_contracts.rl import RLOutcome, RLRecommendation
|
|
249
|
+
from victor_contracts.safety import SafetyLevel
|
|
250
|
+
|
|
251
|
+
from victor_contracts.validation import (
|
|
252
|
+
ValidationIssue,
|
|
253
|
+
ValidationReport,
|
|
254
|
+
validate_vertical_package,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
# Stable SDK constants
|
|
258
|
+
from victor_contracts.constants import (
|
|
259
|
+
CapabilityIds,
|
|
260
|
+
CANONICAL_TO_ALIASES,
|
|
261
|
+
TOOL_ALIASES,
|
|
262
|
+
ToolNameEntry,
|
|
263
|
+
ToolNames,
|
|
264
|
+
get_all_capability_ids,
|
|
265
|
+
get_aliases,
|
|
266
|
+
get_all_canonical_names,
|
|
267
|
+
get_canonical_name,
|
|
268
|
+
get_name_mapping,
|
|
269
|
+
is_known_capability_id,
|
|
270
|
+
is_valid_tool_name,
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
__all__ = [
|
|
274
|
+
# Version
|
|
275
|
+
"__version__",
|
|
276
|
+
# Core types
|
|
277
|
+
"CapabilityRequirement",
|
|
278
|
+
"CapabilityRequirementLike",
|
|
279
|
+
"CURRENT_DEFINITION_VERSION",
|
|
280
|
+
"MINIMUM_SUPPORTED_DEFINITION_VERSION",
|
|
281
|
+
"PromptMetadata",
|
|
282
|
+
"PromptTemplateDefinition",
|
|
283
|
+
"PromptTemplateLike",
|
|
284
|
+
"TeamDefinition",
|
|
285
|
+
"TeamDefinitionLike",
|
|
286
|
+
"TeamMemberDefinition",
|
|
287
|
+
"TeamMemberDefinitionLike",
|
|
288
|
+
"TeamMetadata",
|
|
289
|
+
"StageDefinitionLike",
|
|
290
|
+
"TaskTypeHintDefinition",
|
|
291
|
+
"TaskTypeHintLike",
|
|
292
|
+
"DEFAULT_ACTIVE_LEARNERS",
|
|
293
|
+
"DEFAULT_PATIENCE_MAP",
|
|
294
|
+
"ToolRequirement",
|
|
295
|
+
"ToolRequirementLike",
|
|
296
|
+
"VerticalConfig",
|
|
297
|
+
"VerticalDefinition",
|
|
298
|
+
"LearnerType",
|
|
299
|
+
"WorkflowContextProtocol",
|
|
300
|
+
"ConversationContext",
|
|
301
|
+
"ConversationCoordinator",
|
|
302
|
+
"ConversationStats",
|
|
303
|
+
"ConversationTurn",
|
|
304
|
+
"CommunicationStyle",
|
|
305
|
+
"ExpertiseLevel",
|
|
306
|
+
"is_supported_definition_version",
|
|
307
|
+
"PersonaTemplate",
|
|
308
|
+
"PersonaTraits",
|
|
309
|
+
"TaskAssignmentStrategy",
|
|
310
|
+
"TeamMember",
|
|
311
|
+
"TeamSpec",
|
|
312
|
+
"TeamTemplate",
|
|
313
|
+
"TeamTopology",
|
|
314
|
+
# Tool contract (FEP-0009)
|
|
315
|
+
"ToolContract",
|
|
316
|
+
"ToolCategory",
|
|
317
|
+
"AccessMode",
|
|
318
|
+
"DangerLevel",
|
|
319
|
+
"ExecutionCategory",
|
|
320
|
+
"CostTier",
|
|
321
|
+
"TOOL_CONTRACT",
|
|
322
|
+
"WorkflowMetadata",
|
|
323
|
+
"StageDefinition",
|
|
324
|
+
"TurnType",
|
|
325
|
+
"TieredToolConfig",
|
|
326
|
+
"ToolSet",
|
|
327
|
+
"normalize_capability_requirement",
|
|
328
|
+
"normalize_capability_requirements",
|
|
329
|
+
"normalize_prompt_metadata",
|
|
330
|
+
"normalize_prompt_template",
|
|
331
|
+
"normalize_prompt_templates",
|
|
332
|
+
"normalize_stage_definition",
|
|
333
|
+
"normalize_stage_definitions",
|
|
334
|
+
"normalize_task_type_hint",
|
|
335
|
+
"normalize_task_type_hints",
|
|
336
|
+
"normalize_team_definition",
|
|
337
|
+
"normalize_team_definitions",
|
|
338
|
+
"normalize_team_member_definition",
|
|
339
|
+
"normalize_team_member_definitions",
|
|
340
|
+
"normalize_team_metadata",
|
|
341
|
+
"normalize_tool_requirement",
|
|
342
|
+
"normalize_tool_requirements",
|
|
343
|
+
"validate_definition_version",
|
|
344
|
+
"normalize_workflow_metadata",
|
|
345
|
+
# Plugins
|
|
346
|
+
"FileOperation",
|
|
347
|
+
"FileOperationsCapability",
|
|
348
|
+
"FileOperationType",
|
|
349
|
+
"BaseCapabilityProvider",
|
|
350
|
+
"BaseRLConfig",
|
|
351
|
+
"ComputeHandlerProtocol",
|
|
352
|
+
"ComputeHandlerRegistrar",
|
|
353
|
+
"ComputeNodeProtocol",
|
|
354
|
+
"CapabilityConfigMergePolicy",
|
|
355
|
+
"CapabilityConfigScopePortProtocol",
|
|
356
|
+
"CapabilityConfigService",
|
|
357
|
+
"CapabilityEntry",
|
|
358
|
+
"CapabilityLoaderPortProtocol",
|
|
359
|
+
"CapabilityMetadata",
|
|
360
|
+
"CapabilityType",
|
|
361
|
+
"DEFAULT_CAPABILITY_CONFIG_SCOPE_KEY",
|
|
362
|
+
"ExecutorNodeStatus",
|
|
363
|
+
"SafetyAction",
|
|
364
|
+
"SafetyCategory",
|
|
365
|
+
"SafetyCheckResult",
|
|
366
|
+
"SafetyCoordinator",
|
|
367
|
+
"SafetyRule",
|
|
368
|
+
"SafetyStats",
|
|
369
|
+
"NodeResult",
|
|
370
|
+
"OrchestratorCapability",
|
|
371
|
+
"PromptContribution",
|
|
372
|
+
"PromptContributionCapability",
|
|
373
|
+
"build_capability_loader",
|
|
374
|
+
"capability",
|
|
375
|
+
"load_capability_config",
|
|
376
|
+
"register_compute_handlers",
|
|
377
|
+
"register_capability_entries",
|
|
378
|
+
"resolve_capability_config_scope_key",
|
|
379
|
+
"resolve_capability_config_service",
|
|
380
|
+
"store_capability_config",
|
|
381
|
+
"update_capability_config_section",
|
|
382
|
+
"PersonaRegistryProtocol",
|
|
383
|
+
"TeamRegistryProtocol",
|
|
384
|
+
"get_default_persona_registry",
|
|
385
|
+
"get_default_team_registry",
|
|
386
|
+
"set_default_persona_registry",
|
|
387
|
+
"set_default_team_registry",
|
|
388
|
+
"PluginContext",
|
|
389
|
+
"VictorPlugin",
|
|
390
|
+
# Exceptions
|
|
391
|
+
"VerticalException",
|
|
392
|
+
"VerticalConfigurationError",
|
|
393
|
+
"VerticalProtocolError",
|
|
394
|
+
# Base class
|
|
395
|
+
"VerticalBase",
|
|
396
|
+
"register_vertical",
|
|
397
|
+
"CCGBuilderProtocol",
|
|
398
|
+
"ExtensionDependency",
|
|
399
|
+
# Capability protocols
|
|
400
|
+
"CapabilityProvider",
|
|
401
|
+
"ChainProvider",
|
|
402
|
+
"PersonaProvider",
|
|
403
|
+
"ToolDependencyConfig",
|
|
404
|
+
"ToolDependency",
|
|
405
|
+
"ToolDependencyLoadError",
|
|
406
|
+
"ToolDependencyLoader",
|
|
407
|
+
"ToolDependencyProviderProtocol",
|
|
408
|
+
"YAMLToolDependencyProvider",
|
|
409
|
+
"create_tool_dependency_provider",
|
|
410
|
+
"get_cached_provider",
|
|
411
|
+
"invalidate_provider_cache",
|
|
412
|
+
"load_tool_dependency_yaml",
|
|
413
|
+
"MiddlewarePriority",
|
|
414
|
+
"MiddlewareResult",
|
|
415
|
+
"SafetyPattern",
|
|
416
|
+
"StaticModeConfigProvider",
|
|
417
|
+
"TaskTypeHint",
|
|
418
|
+
# Extension manifest
|
|
419
|
+
"ExtensionManifest",
|
|
420
|
+
"ExtensionType",
|
|
421
|
+
"CURRENT_API_VERSION",
|
|
422
|
+
"MIN_SUPPORTED_API_VERSION",
|
|
423
|
+
"is_compatible",
|
|
424
|
+
# Discovery (Phase 4)
|
|
425
|
+
"ProtocolRegistry",
|
|
426
|
+
"ProtocolMetadata",
|
|
427
|
+
"DiscoveryStats",
|
|
428
|
+
"collect_verticals_from_candidate",
|
|
429
|
+
"get_global_registry",
|
|
430
|
+
"reset_global_registry",
|
|
431
|
+
"discover_verticals",
|
|
432
|
+
"discover_protocols",
|
|
433
|
+
"get_discovery_summary",
|
|
434
|
+
"reload_discovery",
|
|
435
|
+
# Validation
|
|
436
|
+
"ValidationIssue",
|
|
437
|
+
"ValidationReport",
|
|
438
|
+
"validate_vertical_package",
|
|
439
|
+
# Stable constants
|
|
440
|
+
"CapabilityIds",
|
|
441
|
+
"ToolNames",
|
|
442
|
+
"ToolNameEntry",
|
|
443
|
+
"TOOL_ALIASES",
|
|
444
|
+
"CANONICAL_TO_ALIASES",
|
|
445
|
+
"get_all_capability_ids",
|
|
446
|
+
"get_canonical_name",
|
|
447
|
+
"get_aliases",
|
|
448
|
+
"is_valid_tool_name",
|
|
449
|
+
"get_all_canonical_names",
|
|
450
|
+
"get_name_mapping",
|
|
451
|
+
"is_known_capability_id",
|
|
452
|
+
# Lazy extension container
|
|
453
|
+
"VerticalExtensions",
|
|
454
|
+
# Extended vertical protocols: MCP, sandbox, hooks, permissions, compaction, plugins
|
|
455
|
+
"McpProvider",
|
|
456
|
+
"McpToolProvider",
|
|
457
|
+
"SandboxProvider",
|
|
458
|
+
"HookProvider",
|
|
459
|
+
"HookConfigProvider",
|
|
460
|
+
"PermissionProvider",
|
|
461
|
+
"CompactionProvider",
|
|
462
|
+
"ExternalPluginProvider",
|
|
463
|
+
"VerticalModeConfig",
|
|
464
|
+
"ModeDefinition",
|
|
465
|
+
# Skills
|
|
466
|
+
"SkillDefinition",
|
|
467
|
+
"SkillProvider",
|
|
468
|
+
# Phase 4 promotions: types used by 6+ external verticals
|
|
469
|
+
"TeamFormation",
|
|
470
|
+
"TeamMemberSpec",
|
|
471
|
+
"SafetyLevel",
|
|
472
|
+
"RLOutcome",
|
|
473
|
+
"RLRecommendation",
|
|
474
|
+
]
|
|
475
|
+
|
|
476
|
+
# Runtime-backed workflow helpers resolved from the Victor host runtime.
|
|
477
|
+
# Deferred via PEP 562 so `import victor_contracts` works without victor-ai
|
|
478
|
+
# installed; accessing these names without the host runtime raises ImportError.
|
|
479
|
+
# Intentionally excluded from __all__ so `from victor_contracts import *`
|
|
480
|
+
# (and the victor_sdk shim's re-export) stays standalone-safe.
|
|
481
|
+
_HOST_RUNTIME_EXPORTS = frozenset(
|
|
482
|
+
{
|
|
483
|
+
"BaseYAMLWorkflowProvider",
|
|
484
|
+
"WorkflowBuilder",
|
|
485
|
+
"WorkflowDefinition",
|
|
486
|
+
"workflow",
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
def __getattr__(name: str) -> Any:
|
|
492
|
+
"""Resolve host-runtime-backed exports lazily (PEP 562)."""
|
|
493
|
+
if name in _HOST_RUNTIME_EXPORTS:
|
|
494
|
+
from victor_contracts import workflow_runtime
|
|
495
|
+
|
|
496
|
+
return getattr(workflow_runtime, name)
|
|
497
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""SDK host adapters for agent-spec runtime models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from victor.agent.specs.models import (
|
|
10
|
+
AgentCapabilities,
|
|
11
|
+
AgentConstraints,
|
|
12
|
+
AgentSpec,
|
|
13
|
+
DelegationPolicy,
|
|
14
|
+
ModelPreference,
|
|
15
|
+
OutputFormat,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"AgentSpec",
|
|
20
|
+
"AgentCapabilities",
|
|
21
|
+
"AgentConstraints",
|
|
22
|
+
"ModelPreference",
|
|
23
|
+
"OutputFormat",
|
|
24
|
+
"DelegationPolicy",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
_LAZY_IMPORTS = {
|
|
28
|
+
"AgentSpec": "victor.agent.specs.models",
|
|
29
|
+
"AgentCapabilities": "victor.agent.specs.models",
|
|
30
|
+
"AgentConstraints": "victor.agent.specs.models",
|
|
31
|
+
"ModelPreference": "victor.agent.specs.models",
|
|
32
|
+
"OutputFormat": "victor.agent.specs.models",
|
|
33
|
+
"DelegationPolicy": "victor.agent.specs.models",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def __getattr__(name: str) -> Any:
|
|
38
|
+
"""Resolve agent-spec helpers lazily from the Victor host runtime."""
|
|
39
|
+
module_name = _LAZY_IMPORTS.get(name)
|
|
40
|
+
if module_name is None:
|
|
41
|
+
raise AttributeError(
|
|
42
|
+
f"module 'victor_contracts.agent_spec_runtime' has no attribute {name!r}"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
module = importlib.import_module(module_name)
|
|
46
|
+
return getattr(module, name)
|