arcade-core 3.3.3__py3-none-any.whl → 3.3.5__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.
arcade_core/executor.py CHANGED
@@ -59,7 +59,7 @@ class ToolExecutor:
59
59
  if asyncio.iscoroutinefunction(func):
60
60
  results = await func(**func_args)
61
61
  else:
62
- results = func(**func_args)
62
+ results = await asyncio.to_thread(func, **func_args)
63
63
 
64
64
  # serialize the output model
65
65
  output = await ToolExecutor._serialize_output(output_model, results)
arcade_core/schema.py CHANGED
@@ -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."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arcade-core
3
- Version: 3.3.3
3
+ Version: 3.3.5
4
4
  Summary: Arcade Core - Core library for Arcade platform
5
5
  Author-email: Arcade <dev@arcade.dev>
6
6
  License: MIT
@@ -8,11 +8,11 @@ arcade_core/constants.py,sha256=wakdklI7TyJ0agq9n-Cmb2lbVa95D0oUaMGm30eiv9Y,375
8
8
  arcade_core/context.py,sha256=J2MgbVznhJC2qarHq3dTL72W4NGYOM1pjXdI_YwgkA4,3316
9
9
  arcade_core/discovery.py,sha256=PluKGhNtJ7RYjJuPDMB8LCNinQLKzlqoAtc3dwKb6IA,8397
10
10
  arcade_core/errors.py,sha256=fsi7m6TQQSsdSNHl4rBoSN_YH3ZV910gjvBFqB207f4,13326
11
- arcade_core/executor.py,sha256=aFRqB4OdC4b8JJN3zekx0hOWYmihWHAZqVWVlSFXzE4,4308
11
+ arcade_core/executor.py,sha256=RKUmh0by3CVcNSKSbmuSLhk5TzcWrH8PYOSUhR9tRsI,4333
12
12
  arcade_core/output.py,sha256=CMY1pHlQIR27Beiz2I-Yg1aO-P-pbsEbhBZ1RdYuflc,4040
13
13
  arcade_core/parse.py,sha256=arKGKL9C6g__tRfZ4re6IM_wAqr1v3LrOzTOBEDLhDc,2366
14
14
  arcade_core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- arcade_core/schema.py,sha256=l1eE4__sliPIMOp70YxQMlEIpiYQWlBUWEUvr9K1wxA,16927
15
+ arcade_core/schema.py,sha256=y32Ndlb1b3Hw7_Wm3eVXxh0kSg3oGitWUYBfwFLjHuY,21198
16
16
  arcade_core/toolkit.py,sha256=lLlOL6fA6Lmo-dtLTMMcPCzKDf9YQObwxG1LdVADv3E,14431
17
17
  arcade_core/utils.py,sha256=_3bM-yfIDFmMVqt-NFYp2Lx1QcNWp7xytGjUQzPs2LY,3255
18
18
  arcade_core/version.py,sha256=CpXi3jGlx23RvRyU7iytOMZrnspdWw4yofS8lpP1AJU,18
@@ -23,6 +23,6 @@ arcade_core/usage/constants.py,sha256=1FQIhkFFMZUhU-H4A7GvMb7KQ3qLFrNAZb2-LEvSF3
23
23
  arcade_core/usage/identity.py,sha256=2dP1iusI9pE_GrPlz3VXEdz51R5JlNo9_-OXbe6vn7I,6716
24
24
  arcade_core/usage/usage_service.py,sha256=xzWWSEktm58liiNYugBHRactSru8V5foriHcsoH0j1A,3407
25
25
  arcade_core/usage/utils.py,sha256=FqBOmlhwT68cbnpI5Vx9ZW6vLRYPVg4FJ0GaMEp8qEM,398
26
- arcade_core-3.3.3.dist-info/METADATA,sha256=8nGu1vA03CHzJBDBp4ucs3GJxHGp8O1JRSVVBQAF7Cw,2383
27
- arcade_core-3.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- arcade_core-3.3.3.dist-info/RECORD,,
26
+ arcade_core-3.3.5.dist-info/METADATA,sha256=tpSyZEemCE-ODXccXybY1ocTp6wF-OjgyGw5QlcqMrA,2383
27
+ arcade_core-3.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ arcade_core-3.3.5.dist-info/RECORD,,