fred-sdk 3.3.0__tar.gz → 3.3.2__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 (58) hide show
  1. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/PKG-INFO +2 -2
  2. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/__init__.py +0 -2
  3. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/context.py +2 -3
  4. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/resources/__init__.py +0 -2
  5. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/resources/prompts.py +16 -32
  6. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk.egg-info/PKG-INFO +2 -2
  7. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk.egg-info/requires.txt +1 -1
  8. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/pyproject.toml +2 -2
  9. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_conversational_memory.py +1 -2
  10. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_execution_contracts.py +1 -3
  11. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_graph_models.py +0 -1
  12. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_openai_compat.py +0 -1
  13. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_prompt_bundles.py +20 -20
  14. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_prompt_utils.py +0 -1
  15. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_react_contract.py +0 -1
  16. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_tool_args_schema.py +1 -2
  17. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_tool_context_workspace_fs.py +0 -1
  18. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/README.md +0 -0
  19. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/__init__.py +0 -0
  20. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/api.py +0 -0
  21. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/authored_tool_runtime.py +0 -0
  22. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/inspection.py +0 -0
  23. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/knowledge_flow_mcp.py +0 -0
  24. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/tool_args_schema.py +0 -0
  25. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/authoring/tool_context_helpers.py +0 -0
  26. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/__init__.py +0 -0
  27. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/eval.py +0 -0
  28. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/execution.py +0 -0
  29. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/models.py +0 -0
  30. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/openai_compat.py +0 -0
  31. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/prompt_utils.py +0 -0
  32. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/react_contract.py +0 -0
  33. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/contracts/runtime.py +0 -0
  34. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/deep/__init__.py +0 -0
  35. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/graph/__init__.py +0 -0
  36. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/graph/authoring/__init__.py +0 -0
  37. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/graph/authoring/api.py +0 -0
  38. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/graph/authoring/team_api.py +0 -0
  39. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/graph/runtime.py +0 -0
  40. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/hello.py +0 -0
  41. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/react/__init__.py +0 -0
  42. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/resources/packaged.py +0 -0
  43. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/resources/prompts/mermaid_output_contract.md +0 -0
  44. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/runtime_support/__init__.py +0 -0
  45. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/runtime_support/remote_agent_invoker.py +0 -0
  46. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/support/__init__.py +0 -0
  47. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/support/authored_toolsets.py +0 -0
  48. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/support/builtins/__init__.py +0 -0
  49. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/support/builtins/catalog.py +0 -0
  50. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk/support/mcp_utils.py +0 -0
  51. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk.egg-info/SOURCES.txt +0 -0
  52. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk.egg-info/dependency_links.txt +0 -0
  53. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/fred_sdk.egg-info/top_level.txt +0 -0
  54. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/setup.cfg +0 -0
  55. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_graph_choice_step.py +0 -0
  56. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_hello.py +0 -0
  57. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_mcp_utils.py +0 -0
  58. {fred_sdk-3.3.0 → fred_sdk-3.3.2}/tests/test_sdk_purity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-sdk
3
- Version: 3.3.0
3
+ Version: 3.3.2
4
4
  Summary: Authoring SDK for Fred agents — graph, ReAct, and team agent primitives.
5
5
  Author-email: Thales <noreply@thalesgroup.com>
6
6
  License: Apache-2.0
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
12
12
  Classifier: Operating System :: OS Independent
13
13
  Requires-Python: <3.13,>=3.12
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: fred-core>=3.4.0
15
+ Requires-Dist: fred-core>=3.4.2
16
16
  Requires-Dist: pydantic<3.0.0,>=2.7.0
17
17
  Requires-Dist: langchain-core>=0.3.0
18
18
  Requires-Dist: langchain>=0.3.0
@@ -149,7 +149,6 @@ from fred_sdk.graph.runtime import (
149
149
  # Resource loading helpers
150
150
  # ---------------------------------------------------------------------------
151
151
  from fred_sdk.resources import (
152
- apply_global_base_prompts,
153
152
  load_agent_prompt_markdown,
154
153
  load_packaged_markdown,
155
154
  )
@@ -244,7 +243,6 @@ __all__ = [
244
243
  "RuntimeContext",
245
244
  "ToolContentKind",
246
245
  # Resource helpers
247
- "apply_global_base_prompts",
248
246
  "load_agent_prompt_markdown",
249
247
  "load_packaged_markdown",
250
248
  # Built-in tool references
@@ -118,8 +118,8 @@ class RuntimeContext(BaseModel):
118
118
  selected_document_uids, context_prompt_text, search_policy, search_rag_scope,
119
119
  include_session_scope, include_corpus_scope, deep_search, selected_chat_context_ids.
120
120
  These are the core fields — set by the frontend per turn, read by retrieval logic.
121
- - Group D (content/preferences): language, user_groups, attachments_markdown.
122
- Will migrate to session preferences / identity over time.
121
+ - Group D (content/preferences): language, attachments_markdown. Will
122
+ migrate to session preferences / identity over time.
123
123
  """
124
124
 
125
125
  # Group A — Identity (managed execution authorizes on team_id via pod-side OpenFGA)
@@ -152,7 +152,6 @@ class RuntimeContext(BaseModel):
152
152
 
153
153
  # Group D — Content and preferences (will migrate to proper homes over time)
154
154
  language: Optional[str] = None
155
- user_groups: list[str] | None = None
156
155
  attachments_markdown: Optional[str] = None
157
156
 
158
157
 
@@ -31,13 +31,11 @@ Example:
31
31
  """
32
32
 
33
33
  from .prompts import (
34
- apply_global_base_prompts,
35
34
  load_agent_prompt_markdown,
36
35
  load_packaged_markdown,
37
36
  )
38
37
 
39
38
  __all__ = [
40
- "apply_global_base_prompts",
41
39
  "load_agent_prompt_markdown",
42
40
  "load_packaged_markdown",
43
41
  ]
@@ -18,9 +18,13 @@ from collections.abc import Sequence
18
18
 
19
19
  from .packaged import load_packaged_resource
20
20
 
21
- # Add one `(package, path_parts)` tuple here for each shared prompt fragment
22
- # that should be available to authored agent pods. Fragments are appended in
23
- # declaration order.
21
+ # Add one `(package, path_parts)` tuple here for each shared prompt fragment that
22
+ # must apply to every agent turn. Fragments are concatenated in declaration order
23
+ # into `GLOBAL_BASE_PROMPT_MARKDOWN` and injected at execution time by the runtime
24
+ # (`build_global_base_prompt_suffix` in fred-runtime). They are deliberately NOT
25
+ # baked into any agent's editable `system_prompt_template`, so they stay out of
26
+ # the operator-facing agent editor and apply even when an operator overrides the
27
+ # whole prompt.
24
28
  GLOBAL_BASE_PROMPT_RESOURCES: tuple[tuple[str, tuple[str, ...]], ...] = (
25
29
  ("fred_sdk", ("resources", "prompts", "mermaid_output_contract.md")),
26
30
  )
@@ -56,7 +60,6 @@ def load_agent_prompt_markdown(
56
60
  package: str,
57
61
  file_name: str,
58
62
  prompts_subdir: Sequence[str] = ("prompts",),
59
- include_global_base_prompts: bool = False,
60
63
  ) -> str:
61
64
  """
62
65
  Load a packaged Markdown prompt for a v2 agent module.
@@ -71,49 +74,30 @@ def load_agent_prompt_markdown(
71
74
 
72
75
  How to use it:
73
76
  - pass the package owning the `prompts/` directory and the file name to load
74
- - set `include_global_base_prompts=True` for default system prompts that
75
- should inherit Fred's shared renderer/output contracts
77
+
78
+ Note:
79
+ - Fred's shared renderer/output contracts (`GLOBAL_BASE_PROMPT_MARKDOWN`) are
80
+ NOT appended here. They are injected at execution time by the runtime
81
+ (`build_global_base_prompt_suffix`) so they stay out of the editable prompt.
76
82
 
77
83
  Example:
78
- - `prompt = load_agent_prompt_markdown(package="my_package.agents.search_agent", file_name="system_prompt.md", include_global_base_prompts=True)`
84
+ - `prompt = load_agent_prompt_markdown(package="my_package.agents.search_agent", file_name="system_prompt.md")`
79
85
  """
80
- prompt = load_packaged_markdown(
86
+ return load_packaged_markdown(
81
87
  package=package,
82
88
  path_parts=(*prompts_subdir, file_name),
83
89
  )
84
- if include_global_base_prompts:
85
- return apply_global_base_prompts(prompt)
86
- return prompt
87
90
 
88
91
 
89
92
  def _join_prompt_sections(sections: Sequence[str]) -> str:
90
93
  return "\n\n".join(section for section in sections if section)
91
94
 
92
95
 
96
+ # Single source of truth for Fred's shared global base prompt. Consumed at
97
+ # execution time by the runtime suffix builder, never baked into agent templates.
93
98
  GLOBAL_BASE_PROMPT_MARKDOWN: str = _join_prompt_sections(
94
99
  tuple(
95
100
  load_packaged_markdown(package=package, path_parts=path_parts).strip()
96
101
  for package, path_parts in GLOBAL_BASE_PROMPT_RESOURCES
97
102
  )
98
103
  )
99
-
100
-
101
- def apply_global_base_prompts(prompt: str) -> str:
102
- """
103
- Append Fred's shared base prompt fragments to one agent prompt.
104
-
105
- Why this helper exists:
106
- - renderer-oriented output contracts should be reusable across agent pods
107
- instead of copied into each application package
108
- - prompt composition remains an authoring-time default, not a runtime
109
- injection layer
110
-
111
- How to use it:
112
- - pass the agent's local system prompt and assign the returned text to the
113
- template's default `system_prompt_template`
114
-
115
- Example:
116
- - `system_prompt_template = apply_global_base_prompts(local_prompt)`
117
- """
118
-
119
- return _join_prompt_sections((prompt.strip(), GLOBAL_BASE_PROMPT_MARKDOWN))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-sdk
3
- Version: 3.3.0
3
+ Version: 3.3.2
4
4
  Summary: Authoring SDK for Fred agents — graph, ReAct, and team agent primitives.
5
5
  Author-email: Thales <noreply@thalesgroup.com>
6
6
  License: Apache-2.0
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
12
12
  Classifier: Operating System :: OS Independent
13
13
  Requires-Python: <3.13,>=3.12
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: fred-core>=3.4.0
15
+ Requires-Dist: fred-core>=3.4.2
16
16
  Requires-Dist: pydantic<3.0.0,>=2.7.0
17
17
  Requires-Dist: langchain-core>=0.3.0
18
18
  Requires-Dist: langchain>=0.3.0
@@ -1,4 +1,4 @@
1
- fred-core>=3.4.0
1
+ fred-core>=3.4.2
2
2
  pydantic<3.0.0,>=2.7.0
3
3
  langchain-core>=0.3.0
4
4
  langchain>=0.3.0
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "fred-sdk"
3
- version = "3.3.0"
3
+ version = "3.3.2"
4
4
  description = "Authoring SDK for Fred agents — graph, ReAct, and team agent primitives."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12,<3.13"
7
7
  license = { text = "Apache-2.0" }
8
8
  authors = [{ name = "Thales", email = "noreply@thalesgroup.com" }]
9
9
  dependencies = [
10
- "fred-core>=3.4.0",
10
+ "fred-core>=3.4.2",
11
11
  "pydantic>=2.7.0,<3.0.0",
12
12
  "langchain-core>=0.3.0",
13
13
  "langchain>=0.3.0",
@@ -36,8 +36,6 @@ from __future__ import annotations
36
36
  from collections.abc import Mapping
37
37
 
38
38
  import pytest
39
- from pydantic import BaseModel
40
-
41
39
  from fred_sdk.contracts.context import (
42
40
  AgentInvocationRequest,
43
41
  BoundRuntimeContext,
@@ -60,6 +58,7 @@ from fred_sdk.graph.authoring.team_api import (
60
58
  TeamState,
61
59
  _format_conversation_history,
62
60
  )
61
+ from pydantic import BaseModel
63
62
 
64
63
  # ---------------------------------------------------------------------------
65
64
  # Test fixtures
@@ -28,7 +28,6 @@ All tests run without any external services.
28
28
  from __future__ import annotations
29
29
 
30
30
  import pytest
31
-
32
31
  from fred_sdk.contracts.context import RuntimeContext
33
32
  from fred_sdk.contracts.execution import (
34
33
  ActorContext,
@@ -327,9 +326,8 @@ def test_turn_persisted_event_serialises_as_dict() -> None:
327
326
 
328
327
 
329
328
  def test_turn_persisted_event_discriminator_roundtrip() -> None:
330
- from pydantic import TypeAdapter
331
-
332
329
  from fred_sdk.contracts.runtime import RuntimeEvent
330
+ from pydantic import TypeAdapter
333
331
 
334
332
  raw = {"kind": "turn_persisted", "session_id": "sess-abc", "sequence": 0}
335
333
  ta = TypeAdapter(RuntimeEvent)
@@ -25,7 +25,6 @@ Covers:
25
25
  from __future__ import annotations
26
26
 
27
27
  import pytest
28
-
29
28
  from fred_sdk.contracts.models import (
30
29
  GraphConditionalDefinition,
31
30
  GraphDefinition,
@@ -25,7 +25,6 @@ from __future__ import annotations
25
25
  import json
26
26
 
27
27
  import pytest
28
-
29
28
  from fred_sdk.contracts.openai_compat import (
30
29
  OpenAIChatRequest,
31
30
  OpenAICompletionChunk,
@@ -1,20 +1,22 @@
1
1
  from fred_sdk import (
2
- apply_global_base_prompts,
3
2
  load_agent_prompt_markdown,
4
3
  load_packaged_markdown,
5
4
  )
5
+ from fred_sdk.resources.prompts import GLOBAL_BASE_PROMPT_MARKDOWN
6
6
 
7
7
  _EXPECTED_FRAGMENT = "When you include Mermaid diagrams, follow these rules strictly so the diagram always parses:"
8
8
  _EXPECTED_FALLBACK_RULE = "If you are unsure the Mermaid will parse, do not return Mermaid, return a simpler Markdown list or table instead."
9
9
 
10
10
 
11
- def test_apply_global_base_prompts_appends_mermaid_contract() -> None:
11
+ def test_global_base_prompt_markdown_bundles_mermaid_contract() -> None:
12
12
  """
13
- Verify the SDK-owned shared prompt bundle appends the Mermaid output contract.
13
+ Verify the SDK-owned global base prompt bundle carries the Mermaid contract.
14
14
 
15
15
  Why this test exists:
16
- - shared prompt fragments are loaded as packaged SDK resources and should
17
- remain available to every agent pod
16
+ - `GLOBAL_BASE_PROMPT_MARKDOWN` is the single source of truth that the runtime
17
+ injects at execution time (see fred-runtime `build_global_base_prompt_suffix`)
18
+ - the contract is no longer baked into agent templates, so this constant is the
19
+ only place that still guarantees the renderer rules ship with the platform
18
20
 
19
21
  How to use it:
20
22
  - run via the default fred-sdk test suite
@@ -23,26 +25,24 @@ def test_apply_global_base_prompts_appends_mermaid_contract() -> None:
23
25
  - `pytest tests/test_prompt_bundles.py -q`
24
26
  """
25
27
 
26
- prompt = apply_global_base_prompts("Local instructions.")
28
+ assert _EXPECTED_FRAGMENT in GLOBAL_BASE_PROMPT_MARKDOWN
29
+ assert _EXPECTED_FALLBACK_RULE in GLOBAL_BASE_PROMPT_MARKDOWN
27
30
 
28
- assert prompt.startswith("Local instructions.")
29
- assert _EXPECTED_FRAGMENT in prompt
30
- assert _EXPECTED_FALLBACK_RULE in prompt
31
31
 
32
-
33
- def test_load_agent_prompt_markdown_can_include_global_base_prompts() -> None:
32
+ def test_load_agent_prompt_markdown_does_not_append_global_base_prompt() -> None:
34
33
  """
35
- Verify the conventional agent prompt loader can opt into shared base prompts.
34
+ Verify the conventional agent prompt loader returns the raw file only.
36
35
 
37
36
  Why this test exists:
38
- - default agent modules should be able to declare shared prompt composition
39
- at the load site without nesting `apply_global_base_prompts(...)`
37
+ - the global base prompt moved from authoring-time baking to runtime injection;
38
+ `load_agent_prompt_markdown` must return exactly the packaged file with no
39
+ shared renderer/output contract appended
40
40
 
41
41
  How to use it:
42
- - pass `include_global_base_prompts=True` when loading a system prompt file
42
+ - run via the default fred-sdk test suite
43
43
 
44
44
  Example:
45
- - `load_agent_prompt_markdown(package="fred_sdk.resources", file_name="sample.md", include_global_base_prompts=True)`
45
+ - `pytest tests/test_prompt_bundles.py -q`
46
46
  """
47
47
 
48
48
  base_prompt = load_packaged_markdown(
@@ -52,12 +52,12 @@ def test_load_agent_prompt_markdown_can_include_global_base_prompts() -> None:
52
52
  prompt = load_agent_prompt_markdown(
53
53
  package="fred_sdk.resources",
54
54
  file_name="mermaid_output_contract.md",
55
- include_global_base_prompts=True,
56
55
  )
57
56
 
58
- assert prompt.startswith(base_prompt)
59
- assert prompt.count(_EXPECTED_FRAGMENT) == 2
60
- assert prompt.count(_EXPECTED_FALLBACK_RULE) == 2
57
+ # The loader returns the file verbatim — the contract appears exactly once,
58
+ # not twice (no global base prompt is appended).
59
+ assert prompt == base_prompt
60
+ assert prompt.count(_EXPECTED_FRAGMENT) == 1
61
61
 
62
62
 
63
63
  def test_mermaid_contract_does_not_embed_executable_placeholder_fences() -> None:
@@ -21,7 +21,6 @@ Ref: docs/backlog/BACKLOG.md §3d.9 (P1) — PROMPT_SAFE_TOKENS registry,
21
21
  """
22
22
 
23
23
  import pytest
24
-
25
24
  from fred_sdk.contracts.prompt_utils import (
26
25
  PROMPT_SAFE_TOKENS,
27
26
  validate_prompt_template,
@@ -26,7 +26,6 @@ Covers:
26
26
  from __future__ import annotations
27
27
 
28
28
  import pytest
29
-
30
29
  from fred_sdk.contracts.react_contract import (
31
30
  ReActInput,
32
31
  ReActMessage,
@@ -29,9 +29,8 @@ from __future__ import annotations
29
29
  from typing import Any
30
30
 
31
31
  import pytest
32
- from pydantic import BaseModel
33
-
34
32
  from fred_sdk.authoring.tool_args_schema import build_args_schema
33
+ from pydantic import BaseModel
35
34
 
36
35
  # ---------------------------------------------------------------------------
37
36
  # Dummy ToolContext placeholder (not imported; just a positional stand-in)
@@ -14,7 +14,6 @@ import asyncio
14
14
  from types import SimpleNamespace
15
15
 
16
16
  import pytest
17
-
18
17
  from fred_sdk.authoring.api import ToolContext
19
18
  from fred_sdk.contracts.context import FsEntry, LinkPart, PublishedArtifact
20
19
  from fred_sdk.contracts.runtime import WorkspaceFileNotFound
File without changes
File without changes
File without changes
File without changes