arcade-core 3.3.3__tar.gz → 3.3.4__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.
- {arcade_core-3.3.3 → arcade_core-3.3.4}/PKG-INFO +1 -1
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/schema.py +139 -1
- {arcade_core-3.3.3 → arcade_core-3.3.4}/pyproject.toml +1 -1
- {arcade_core-3.3.3 → arcade_core-3.3.4}/.gitignore +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/README.md +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/__init__.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/annotations.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/auth.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/catalog.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/config.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/config_model.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/constants.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/context.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/converters/openai.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/discovery.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/errors.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/executor.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/output.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/parse.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/py.typed +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/toolkit.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/__init__.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/__main__.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/constants.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/identity.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/usage_service.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/usage/utils.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/utils.py +0 -0
- {arcade_core-3.3.3 → arcade_core-3.3.4}/arcade_core/version.py +0 -0
|
@@ -19,7 +19,7 @@ from __future__ import annotations
|
|
|
19
19
|
import os
|
|
20
20
|
from dataclasses import dataclass
|
|
21
21
|
from enum import Enum
|
|
22
|
-
from typing import Any, Literal
|
|
22
|
+
from typing import Any, Literal, Protocol
|
|
23
23
|
|
|
24
24
|
from pydantic import BaseModel, Field
|
|
25
25
|
|
|
@@ -29,6 +29,75 @@ from arcade_core.errors import ErrorKind
|
|
|
29
29
|
TOOL_NAME_SEPARATOR = os.getenv("ARCADE_TOOL_NAME_SEPARATOR", ".")
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
# =====================
|
|
33
|
+
# MCP Feature Protocols and No-Op Implementations
|
|
34
|
+
# =====================
|
|
35
|
+
# These protocols and stubs enable graceful degradation of MCP features
|
|
36
|
+
# in deployed (non-local) environments where the full MCP context is not available.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class LogsProtocol(Protocol):
|
|
40
|
+
"""Protocol for logging interface."""
|
|
41
|
+
|
|
42
|
+
async def log(
|
|
43
|
+
self,
|
|
44
|
+
level: str,
|
|
45
|
+
message: str,
|
|
46
|
+
logger_name: str | None = None,
|
|
47
|
+
extra: dict[str, Any] | None = None,
|
|
48
|
+
) -> None: ...
|
|
49
|
+
|
|
50
|
+
async def debug(self, message: str, **kwargs: Any) -> None: ...
|
|
51
|
+
|
|
52
|
+
async def info(self, message: str, **kwargs: Any) -> None: ...
|
|
53
|
+
|
|
54
|
+
async def warning(self, message: str, **kwargs: Any) -> None: ...
|
|
55
|
+
|
|
56
|
+
async def error(self, message: str, **kwargs: Any) -> None: ...
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ProgressProtocol(Protocol):
|
|
60
|
+
"""Protocol for progress reporting interface."""
|
|
61
|
+
|
|
62
|
+
async def report(
|
|
63
|
+
self, progress: float, total: float | None = None, message: str | None = None
|
|
64
|
+
) -> None: ...
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class _NoOpLogs:
|
|
68
|
+
"""No-op implementation for logging in deployed environments."""
|
|
69
|
+
|
|
70
|
+
async def log(
|
|
71
|
+
self,
|
|
72
|
+
level: str,
|
|
73
|
+
message: str,
|
|
74
|
+
logger_name: str | None = None,
|
|
75
|
+
extra: dict[str, Any] | None = None,
|
|
76
|
+
) -> None:
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
async def debug(self, message: str, **kwargs: Any) -> None:
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
async def info(self, message: str, **kwargs: Any) -> None:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
async def warning(self, message: str, **kwargs: Any) -> None:
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
async def error(self, message: str, **kwargs: Any) -> None:
|
|
89
|
+
pass
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class _NoOpProgress:
|
|
93
|
+
"""No-op implementation for progress in deployed environments."""
|
|
94
|
+
|
|
95
|
+
async def report(
|
|
96
|
+
self, progress: float, total: float | None = None, message: str | None = None
|
|
97
|
+
) -> None:
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
|
|
32
101
|
class ValueSchema(BaseModel):
|
|
33
102
|
"""Value schema for input parameters and outputs."""
|
|
34
103
|
|
|
@@ -390,6 +459,75 @@ class ToolContext(BaseModel):
|
|
|
390
459
|
|
|
391
460
|
raise ValueError(f"{item_name.capitalize()} '{key}' not found in context.")
|
|
392
461
|
|
|
462
|
+
# ============ MCP Feature Properties ============
|
|
463
|
+
# Non-critical features (no-op in deployed environments)
|
|
464
|
+
|
|
465
|
+
@property
|
|
466
|
+
def log(self) -> LogsProtocol:
|
|
467
|
+
"""No-op logging interface (not supported in deployed environments)."""
|
|
468
|
+
return _NoOpLogs()
|
|
469
|
+
|
|
470
|
+
@property
|
|
471
|
+
def progress(self) -> ProgressProtocol:
|
|
472
|
+
"""No-op progress reporting (not supported in deployed environments)."""
|
|
473
|
+
return _NoOpProgress()
|
|
474
|
+
|
|
475
|
+
# Critical features (raise error in deployed environments)
|
|
476
|
+
|
|
477
|
+
@property
|
|
478
|
+
def resources(self) -> Any:
|
|
479
|
+
"""Resources are not available in deployed environments."""
|
|
480
|
+
raise RuntimeError(
|
|
481
|
+
"The resources feature is not supported for Arcade managed servers (non-local)"
|
|
482
|
+
)
|
|
483
|
+
|
|
484
|
+
@property
|
|
485
|
+
def tools(self) -> Any:
|
|
486
|
+
"""Tool calling is not available in deployed environments."""
|
|
487
|
+
raise RuntimeError(
|
|
488
|
+
"The tools feature is not supported for Arcade managed servers (non-local)"
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
@property
|
|
492
|
+
def prompts(self) -> Any:
|
|
493
|
+
"""Prompts are not available in deployed environments."""
|
|
494
|
+
raise RuntimeError(
|
|
495
|
+
"The prompts feature is not supported for Arcade managed servers (non-local)"
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
@property
|
|
499
|
+
def sampling(self) -> Any:
|
|
500
|
+
"""Sampling is not available in deployed environments."""
|
|
501
|
+
raise RuntimeError(
|
|
502
|
+
"The sampling feature is not supported for Arcade managed servers (non-local)"
|
|
503
|
+
)
|
|
504
|
+
|
|
505
|
+
@property
|
|
506
|
+
def ui(self) -> Any:
|
|
507
|
+
"""UI/elicitation is not available in deployed environments."""
|
|
508
|
+
raise RuntimeError("The ui feature is not supported for Arcade managed servers (non-local)")
|
|
509
|
+
|
|
510
|
+
@property
|
|
511
|
+
def notifications(self) -> Any:
|
|
512
|
+
"""Notifications are not available in deployed environments."""
|
|
513
|
+
raise RuntimeError(
|
|
514
|
+
"The notifications feature is not supported for Arcade managed servers (non-local)"
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
@property
|
|
518
|
+
def request_id(self) -> Any:
|
|
519
|
+
"""Request ID is not available in deployed environments."""
|
|
520
|
+
raise RuntimeError(
|
|
521
|
+
"The request_id feature is not supported for Arcade managed servers (non-local)"
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
@property
|
|
525
|
+
def session_id(self) -> Any:
|
|
526
|
+
"""Session ID is not available in deployed environments."""
|
|
527
|
+
raise RuntimeError(
|
|
528
|
+
"The session_id feature is not supported for Arcade managed servers (non-local)"
|
|
529
|
+
)
|
|
530
|
+
|
|
393
531
|
|
|
394
532
|
class ToolCallRequest(BaseModel):
|
|
395
533
|
"""The request to call (invoke) a tool."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|