fred-sdk 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. fred_sdk-0.1.0/PKG-INFO +59 -0
  2. fred_sdk-0.1.0/README.md +30 -0
  3. fred_sdk-0.1.0/fred_sdk/__init__.py +221 -0
  4. fred_sdk-0.1.0/fred_sdk/authoring/__init__.py +89 -0
  5. fred_sdk-0.1.0/fred_sdk/authoring/api.py +976 -0
  6. fred_sdk-0.1.0/fred_sdk/authoring/authored_tool_runtime.py +429 -0
  7. fred_sdk-0.1.0/fred_sdk/authoring/inspection.py +25 -0
  8. fred_sdk-0.1.0/fred_sdk/authoring/knowledge_flow_mcp.py +76 -0
  9. fred_sdk-0.1.0/fred_sdk/authoring/tool_args_schema.py +84 -0
  10. fred_sdk-0.1.0/fred_sdk/authoring/tool_context_helpers.py +196 -0
  11. fred_sdk-0.1.0/fred_sdk/contracts/__init__.py +28 -0
  12. fred_sdk-0.1.0/fred_sdk/contracts/context.py +407 -0
  13. fred_sdk-0.1.0/fred_sdk/contracts/models.py +1078 -0
  14. fred_sdk-0.1.0/fred_sdk/contracts/react_contract.py +188 -0
  15. fred_sdk-0.1.0/fred_sdk/contracts/runtime.py +468 -0
  16. fred_sdk-0.1.0/fred_sdk/deep/__init__.py +17 -0
  17. fred_sdk-0.1.0/fred_sdk/deep/runtime.py +263 -0
  18. fred_sdk-0.1.0/fred_sdk/graph/__init__.py +51 -0
  19. fred_sdk-0.1.0/fred_sdk/graph/authoring/__init__.py +66 -0
  20. fred_sdk-0.1.0/fred_sdk/graph/authoring/api.py +821 -0
  21. fred_sdk-0.1.0/fred_sdk/graph/authoring/team_api.py +827 -0
  22. fred_sdk-0.1.0/fred_sdk/graph/graph_runtime.py +1870 -0
  23. fred_sdk-0.1.0/fred_sdk/graph/runtime.py +257 -0
  24. fred_sdk-0.1.0/fred_sdk/hello.py +18 -0
  25. fred_sdk-0.1.0/fred_sdk/react/__init__.py +14 -0
  26. fred_sdk-0.1.0/fred_sdk/react/react_langchain_adapter.py +99 -0
  27. fred_sdk-0.1.0/fred_sdk/react/react_message_codec.py +256 -0
  28. fred_sdk-0.1.0/fred_sdk/react/react_model_adapter.py +250 -0
  29. fred_sdk-0.1.0/fred_sdk/react/react_prompting.py +169 -0
  30. fred_sdk-0.1.0/fred_sdk/react/react_runtime.py +605 -0
  31. fred_sdk-0.1.0/fred_sdk/react/react_stream_adapter.py +310 -0
  32. fred_sdk-0.1.0/fred_sdk/react/react_tool_binding.py +228 -0
  33. fred_sdk-0.1.0/fred_sdk/react/react_tool_loop.py +327 -0
  34. fred_sdk-0.1.0/fred_sdk/react/react_tool_rendering.py +136 -0
  35. fred_sdk-0.1.0/fred_sdk/react/react_tool_resolution.py +647 -0
  36. fred_sdk-0.1.0/fred_sdk/react/react_tool_utils.py +75 -0
  37. fred_sdk-0.1.0/fred_sdk/resources/__init__.py +24 -0
  38. fred_sdk-0.1.0/fred_sdk/resources/packaged.py +46 -0
  39. fred_sdk-0.1.0/fred_sdk/resources/prompts.py +59 -0
  40. fred_sdk-0.1.0/fred_sdk/runtime_support/__init__.py +16 -0
  41. fred_sdk-0.1.0/fred_sdk/runtime_support/checkpoints.py +72 -0
  42. fred_sdk-0.1.0/fred_sdk/runtime_support/model_metadata.py +216 -0
  43. fred_sdk-0.1.0/fred_sdk/runtime_support/session_agent.py +398 -0
  44. fred_sdk-0.1.0/fred_sdk/support/__init__.py +15 -0
  45. fred_sdk-0.1.0/fred_sdk/support/authored_toolsets.py +253 -0
  46. fred_sdk-0.1.0/fred_sdk/support/builtins/__init__.py +42 -0
  47. fred_sdk-0.1.0/fred_sdk/support/builtins/catalog.py +381 -0
  48. fred_sdk-0.1.0/fred_sdk/support/filesystem_context.py +647 -0
  49. fred_sdk-0.1.0/fred_sdk/support/mcp_utils.py +50 -0
  50. fred_sdk-0.1.0/fred_sdk/support/tool_approval.py +82 -0
  51. fred_sdk-0.1.0/fred_sdk/support/tool_loop.py +244 -0
  52. fred_sdk-0.1.0/fred_sdk.egg-info/PKG-INFO +59 -0
  53. fred_sdk-0.1.0/fred_sdk.egg-info/SOURCES.txt +57 -0
  54. fred_sdk-0.1.0/fred_sdk.egg-info/dependency_links.txt +1 -0
  55. fred_sdk-0.1.0/fred_sdk.egg-info/requires.txt +15 -0
  56. fred_sdk-0.1.0/fred_sdk.egg-info/top_level.txt +1 -0
  57. fred_sdk-0.1.0/pyproject.toml +64 -0
  58. fred_sdk-0.1.0/setup.cfg +4 -0
  59. fred_sdk-0.1.0/tests/test_hello.py +23 -0
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: fred-sdk
3
+ Version: 0.1.0
4
+ Summary: Authoring SDK for Fred agents — graph, ReAct, and team agent primitives.
5
+ Author-email: Thales <noreply@thalesgroup.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://fredk8.dev
8
+ Project-URL: Repository, https://github.com/ThalesGroup/fred
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: <3.13,>=3.12
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: fred-core>=1.3.1
16
+ Requires-Dist: fred-portable>=0.1.1
17
+ Requires-Dist: pydantic<3.0.0,>=2.7.0
18
+ Requires-Dist: langchain-core>=0.3.0
19
+ Requires-Dist: langchain>=0.3.0
20
+ Requires-Dist: langgraph>=1.1.3
21
+ Requires-Dist: deepagents>=0.4.11
22
+ Provides-Extra: dev
23
+ Requires-Dist: bandit>=1.8.6; extra == "dev"
24
+ Requires-Dist: basedpyright==1.31.0; extra == "dev"
25
+ Requires-Dist: detect-secrets>=1.5.0; extra == "dev"
26
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
27
+ Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
28
+ Requires-Dist: ruff>=0.12.5; extra == "dev"
29
+
30
+ # Fred SDK
31
+
32
+ `fred-sdk` is the authoring SDK for Fred agents. It packages the public
33
+ interfaces used by agent authors (ReAct, graph workflows, team agents, HITL)
34
+ so you can build workflows without wiring platform internals.
35
+
36
+ Install
37
+ -------
38
+ ```bash
39
+ pip install fred-sdk
40
+ ```
41
+
42
+ Quickstart
43
+ ----------
44
+ ```python
45
+ from fred_sdk import hello_message
46
+
47
+ print(hello_message("Ada"))
48
+ ```
49
+
50
+ Notes
51
+ -----
52
+ - `fred-sdk` depends on `fred-core` and `fred-portable` and pulls them in
53
+ automatically.
54
+ - The SDK surface lives in `fred_sdk/__init__.py` for top-level imports.
55
+
56
+ Resources
57
+ ---------
58
+ - Homepage: https://fredk8.dev
59
+ - Repository: https://github.com/ThalesGroup/fred
@@ -0,0 +1,30 @@
1
+ # Fred SDK
2
+
3
+ `fred-sdk` is the authoring SDK for Fred agents. It packages the public
4
+ interfaces used by agent authors (ReAct, graph workflows, team agents, HITL)
5
+ so you can build workflows without wiring platform internals.
6
+
7
+ Install
8
+ -------
9
+ ```bash
10
+ pip install fred-sdk
11
+ ```
12
+
13
+ Quickstart
14
+ ----------
15
+ ```python
16
+ from fred_sdk import hello_message
17
+
18
+ print(hello_message("Ada"))
19
+ ```
20
+
21
+ Notes
22
+ -----
23
+ - `fred-sdk` depends on `fred-core` and `fred-portable` and pulls them in
24
+ automatically.
25
+ - The SDK surface lives in `fred_sdk/__init__.py` for top-level imports.
26
+
27
+ Resources
28
+ ---------
29
+ - Homepage: https://fredk8.dev
30
+ - Repository: https://github.com/ThalesGroup/fred
@@ -0,0 +1,221 @@
1
+ # Copyright Thales 2026
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ fred-sdk public authoring surface.
17
+
18
+ Everything an agent author needs is importable directly from this package.
19
+ No submodule paths are required.
20
+
21
+ ReAct agents
22
+ ------------
23
+ from fred_sdk import ReActAgent, tool, ToolContext, ToolOutput
24
+
25
+ Graph agents
26
+ ------------
27
+ from fred_sdk import GraphAgent, GraphWorkflow, typed_node, StepResult
28
+
29
+ Team agents
30
+ -----------
31
+ from fred_sdk import TeamAgent, AgentSpec
32
+
33
+ Human-in-the-loop
34
+ -----------------
35
+ from fred_sdk import HumanInputRequest, HumanChoiceOption
36
+
37
+ MCP server references
38
+ ---------------------
39
+ from fred_sdk import MCPServerRef, MCP_SERVER_KNOWLEDGE_FLOW_CORPUS
40
+
41
+ What is NOT exported here (platform internals):
42
+ - ReActRuntime, GraphRuntime, DeepAgentRuntime → agentic-backend wiring
43
+ - ChatModelFactoryPort, RuntimeServices → platform port interfaces
44
+ - BoundRuntimeContext, PortableContext → platform execution context
45
+ - ReActInput, ReActOutput, ReActMessage → runtime transport types
46
+ """
47
+
48
+ # ---------------------------------------------------------------------------
49
+ # ReAct agent authoring
50
+ # ---------------------------------------------------------------------------
51
+ from fred_sdk.authoring.api import (
52
+ ArtifactPublicationError,
53
+ ModelInvocationError,
54
+ ReActAgent,
55
+ ResourceFetchError,
56
+ ResourceNotFoundError,
57
+ ToolContext,
58
+ ToolInvocationError,
59
+ ToolOutput,
60
+ UIHints,
61
+ prompt_md,
62
+ tool,
63
+ ui_field,
64
+ )
65
+ from fred_sdk.authoring.inspection import inspect_agent
66
+
67
+ # ---------------------------------------------------------------------------
68
+ # MCP server references
69
+ # ---------------------------------------------------------------------------
70
+ from fred_sdk.authoring.knowledge_flow_mcp import (
71
+ MCP_SERVER_KNOWLEDGE_FLOW_CORPUS,
72
+ MCP_SERVER_KNOWLEDGE_FLOW_FS,
73
+ MCP_SERVER_KNOWLEDGE_FLOW_OPENSEARCH_OPS,
74
+ MCP_SERVER_KNOWLEDGE_FLOW_STATISTICS,
75
+ MCP_SERVER_KNOWLEDGE_FLOW_TABULAR,
76
+ MCPServerRef,
77
+ )
78
+
79
+ # ---------------------------------------------------------------------------
80
+ # Graph agent authoring
81
+ # ---------------------------------------------------------------------------
82
+ from fred_sdk.graph.authoring.api import (
83
+ GraphAgent,
84
+ GraphWorkflow,
85
+ StepResult,
86
+ WorkflowNode,
87
+ choice_step,
88
+ finalize_step,
89
+ intent_router_step,
90
+ model_text_step,
91
+ structured_model_step,
92
+ typed_node,
93
+ )
94
+
95
+ # ---------------------------------------------------------------------------
96
+ # Team / multi-agent authoring
97
+ # ---------------------------------------------------------------------------
98
+ from fred_sdk.graph.authoring.team_api import (
99
+ AgentSpec,
100
+ TeamAgent,
101
+ TeamInput,
102
+ TeamMemberResult,
103
+ TeamState,
104
+ )
105
+
106
+ # ---------------------------------------------------------------------------
107
+ # Shared types visible to agent authors inside node handlers and tool contexts
108
+ # ---------------------------------------------------------------------------
109
+ from fred_sdk.graph.runtime import (
110
+ GraphExecutionOutput,
111
+ GraphNodeContext,
112
+ GraphNodeResult,
113
+ )
114
+ from fred_sdk.contracts.context import (
115
+ AgentInvocationResult,
116
+ ArtifactScope,
117
+ PublishedArtifact,
118
+ RuntimeContext,
119
+ ToolContentKind,
120
+ )
121
+ from fred_sdk.contracts.models import (
122
+ DeepAgentDefinition,
123
+ FieldSpec,
124
+ GuardrailDefinition,
125
+ ReActAgentDefinition,
126
+ ReActPolicy,
127
+ ToolApprovalPolicy,
128
+ ToolRefRequirement,
129
+ )
130
+ from fred_sdk.contracts.runtime import HumanChoiceOption, HumanInputRequest
131
+
132
+ # ---------------------------------------------------------------------------
133
+ # Resource loading helpers
134
+ # ---------------------------------------------------------------------------
135
+ from fred_sdk.resources import load_agent_prompt_markdown, load_packaged_markdown
136
+
137
+ # ---------------------------------------------------------------------------
138
+ # Built-in tool references
139
+ # ---------------------------------------------------------------------------
140
+ from fred_sdk.support.builtins import (
141
+ TOOL_REF_ARTIFACTS_PUBLISH_TEXT,
142
+ TOOL_REF_GEO_RENDER_POINTS,
143
+ TOOL_REF_KNOWLEDGE_SEARCH,
144
+ TOOL_REF_LOGS_QUERY,
145
+ TOOL_REF_RESOURCES_FETCH_TEXT,
146
+ TOOL_REF_TRACES_SUMMARIZE_CONVERSATION,
147
+ )
148
+
149
+ # ---------------------------------------------------------------------------
150
+ # Public surface declaration
151
+ # ---------------------------------------------------------------------------
152
+ __all__ = [
153
+ # ReAct authoring
154
+ "ReActAgent",
155
+ "tool",
156
+ "ToolContext",
157
+ "ToolOutput",
158
+ "UIHints",
159
+ "ui_field",
160
+ "prompt_md",
161
+ "ToolInvocationError",
162
+ "ModelInvocationError",
163
+ "ArtifactPublicationError",
164
+ "ResourceFetchError",
165
+ "ResourceNotFoundError",
166
+ "inspect_agent",
167
+ # MCP server references
168
+ "MCPServerRef",
169
+ "MCP_SERVER_KNOWLEDGE_FLOW_CORPUS",
170
+ "MCP_SERVER_KNOWLEDGE_FLOW_FS",
171
+ "MCP_SERVER_KNOWLEDGE_FLOW_OPENSEARCH_OPS",
172
+ "MCP_SERVER_KNOWLEDGE_FLOW_STATISTICS",
173
+ "MCP_SERVER_KNOWLEDGE_FLOW_TABULAR",
174
+ # Graph authoring
175
+ "GraphAgent",
176
+ "GraphWorkflow",
177
+ "StepResult",
178
+ "WorkflowNode",
179
+ "typed_node",
180
+ "choice_step",
181
+ "finalize_step",
182
+ "intent_router_step",
183
+ "model_text_step",
184
+ "structured_model_step",
185
+ # Team authoring
186
+ "TeamAgent",
187
+ "AgentSpec",
188
+ "TeamInput",
189
+ "TeamMemberResult",
190
+ "TeamState",
191
+ # Shared types authors encounter in node/tool contexts
192
+ "GraphExecutionOutput",
193
+ "GraphNodeContext",
194
+ "GraphNodeResult",
195
+ "AgentInvocationResult",
196
+ "ArtifactScope",
197
+ "PublishedArtifact",
198
+ "HumanInputRequest",
199
+ "HumanChoiceOption",
200
+ # Agent definition metadata and policies (used when subclassing GraphAgent/ReActAgent)
201
+ "DeepAgentDefinition",
202
+ "ReActAgentDefinition",
203
+ "ReActPolicy",
204
+ "ToolApprovalPolicy",
205
+ "FieldSpec",
206
+ "GuardrailDefinition",
207
+ "ToolRefRequirement",
208
+ # Request context (language, user, session info visible inside nodes)
209
+ "RuntimeContext",
210
+ "ToolContentKind",
211
+ # Resource helpers
212
+ "load_agent_prompt_markdown",
213
+ "load_packaged_markdown",
214
+ # Built-in tool references
215
+ "TOOL_REF_ARTIFACTS_PUBLISH_TEXT",
216
+ "TOOL_REF_GEO_RENDER_POINTS",
217
+ "TOOL_REF_KNOWLEDGE_SEARCH",
218
+ "TOOL_REF_LOGS_QUERY",
219
+ "TOOL_REF_RESOURCES_FETCH_TEXT",
220
+ "TOOL_REF_TRACES_SUMMARIZE_CONVERSATION",
221
+ ]
@@ -0,0 +1,89 @@
1
+ # Copyright Thales 2026
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """
15
+ Agent-author-facing v2 authoring surface.
16
+
17
+ Why this package exists:
18
+ - keep the v2 package root focused on the public facade instead of loose files
19
+ - group the helpers that an agent author reads directly: Python tool authoring,
20
+ inspection entrypoints, and named MCP server references
21
+
22
+ Who this package is for:
23
+ - `agent author` means an SDK consumer who defines a new Fred agent, profile,
24
+ or small Python-authored toolset
25
+ - `Fred developer` means a maintainer of the SDK/runtime itself
26
+ - this package is primarily for the `agent author`
27
+ - Fred developers may read it too, but they should treat it as the public
28
+ authoring surface, not as the place for runtime internals
29
+
30
+ How to use it:
31
+ - import `ReActAgent`, `tool`, and related helper types from this package when
32
+ authoring small v2 agents in Python
33
+ - define tool inputs with normal Python type annotations; `@tool(...)` will
34
+ usually infer the Pydantic input schema for you from the function signature
35
+ - import `inspect_agent` for non-activating inspection
36
+ - import `MCPServerRef` and `MCP_SERVER_KNOWLEDGE_FLOW_*` constants for
37
+ author-facing default MCP server declarations
38
+ - if you intentionally want optional Fred-specific shortcuts, access them
39
+ through `context.helpers` inside a tool
40
+
41
+ Example:
42
+ - `from fred_sdk.authoring import ReActAgent, tool`
43
+ """
44
+
45
+ from .api import (
46
+ ArtifactPublicationError,
47
+ ModelInvocationError,
48
+ ReActAgent,
49
+ ResourceFetchError,
50
+ ResourceNotFoundError,
51
+ ToolContext,
52
+ ToolInvocationError,
53
+ ToolOutput,
54
+ UIHints,
55
+ prompt_md,
56
+ tool,
57
+ ui_field,
58
+ )
59
+ from .inspection import inspect_agent
60
+ from .knowledge_flow_mcp import (
61
+ MCP_SERVER_KNOWLEDGE_FLOW_CORPUS,
62
+ MCP_SERVER_KNOWLEDGE_FLOW_FS,
63
+ MCP_SERVER_KNOWLEDGE_FLOW_OPENSEARCH_OPS,
64
+ MCP_SERVER_KNOWLEDGE_FLOW_STATISTICS,
65
+ MCP_SERVER_KNOWLEDGE_FLOW_TABULAR,
66
+ MCPServerRef,
67
+ )
68
+
69
+ __all__ = [
70
+ "ArtifactPublicationError",
71
+ "MCPServerRef",
72
+ "ModelInvocationError",
73
+ "MCP_SERVER_KNOWLEDGE_FLOW_CORPUS",
74
+ "MCP_SERVER_KNOWLEDGE_FLOW_FS",
75
+ "MCP_SERVER_KNOWLEDGE_FLOW_OPENSEARCH_OPS",
76
+ "MCP_SERVER_KNOWLEDGE_FLOW_STATISTICS",
77
+ "MCP_SERVER_KNOWLEDGE_FLOW_TABULAR",
78
+ "ReActAgent",
79
+ "ResourceFetchError",
80
+ "ResourceNotFoundError",
81
+ "ToolContext",
82
+ "ToolInvocationError",
83
+ "ToolOutput",
84
+ "UIHints",
85
+ "inspect_agent",
86
+ "prompt_md",
87
+ "tool",
88
+ "ui_field",
89
+ ]