flatagents 4.2.0__tar.gz → 4.2.1__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 (56) hide show
  1. {flatagents-4.2.0 → flatagents-4.2.1}/AGENTS.md +1 -1
  2. {flatagents-4.2.0 → flatagents-4.2.1}/PKG-INFO +1 -1
  3. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/__init__.py +1 -1
  4. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagent.d.ts +1 -1
  5. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagent.slim.d.ts +1 -1
  6. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagents-runtime.d.ts +1 -1
  7. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagents-runtime.schema.json +1 -1
  8. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagents-runtime.slim.d.ts +1 -1
  9. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatmachine.d.ts +1 -1
  10. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatmachine.slim.d.ts +1 -1
  11. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/profile.d.ts +1 -1
  12. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/profile.slim.d.ts +1 -1
  13. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/prompt.d.ts +1 -1
  14. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/prompt.slim.d.ts +1 -1
  15. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/flatagent.py +7 -2
  16. {flatagents-4.2.0 → flatagents-4.2.1}/pyproject.toml +1 -1
  17. {flatagents-4.2.0 → flatagents-4.2.1}/.gitignore +0 -0
  18. {flatagents-4.2.0 → flatagents-4.2.1}/README.md +0 -0
  19. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/__init__.py +0 -0
  20. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/call_throttle.py +0 -0
  21. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/claude_code.py +0 -0
  22. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/claude_code_sessions.py +0 -0
  23. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/codex_cli.py +0 -0
  24. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/codex_cli_sessions.py +0 -0
  25. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/compat.py +0 -0
  26. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/pi_agent_bridge.py +0 -0
  27. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/pi_agent_runner.mjs +0 -0
  28. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/adapters/smolagents.py +0 -0
  29. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/README.md +0 -0
  30. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/__init__.py +0 -0
  31. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatagent.schema.json +0 -0
  32. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/flatmachine.schema.json +0 -0
  33. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/profile.schema.json +0 -0
  34. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/assets/prompt.schema.json +0 -0
  35. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/baseagent.py +0 -0
  36. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/monitoring.py +0 -0
  37. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/profiles.py +0 -0
  38. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/__init__.py +0 -0
  39. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/anthropic.py +0 -0
  40. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/cerebras.py +0 -0
  41. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/github_copilot_auth.py +0 -0
  42. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/github_copilot_client.py +0 -0
  43. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/github_copilot_login.py +0 -0
  44. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/github_copilot_types.py +0 -0
  45. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/openai.py +0 -0
  46. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/openai_codex_auth.py +0 -0
  47. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/openai_codex_client.py +0 -0
  48. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/openai_codex_login.py +0 -0
  49. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/providers/openai_codex_types.py +0 -0
  50. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/tests/__init__.py +0 -0
  51. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/tests/test_monitoring.py +0 -0
  52. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/tests/test_profiles.py +0 -0
  53. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/tool_loop.py +0 -0
  54. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/tools.py +0 -0
  55. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/utils.py +0 -0
  56. {flatagents-4.2.0 → flatagents-4.2.1}/flatagents/validation.py +0 -0
@@ -22,7 +22,7 @@
22
22
  ```yaml
23
23
  # profiles.yml — agents reference by name
24
24
  spec: flatprofile
25
- spec_version: "4.2.0"
25
+ spec_version: "4.2.1"
26
26
  data:
27
27
  model_profiles:
28
28
  fast: { provider: cerebras, name: zai-glm-4.6, temperature: 0.6 }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flatagents
3
- Version: 4.2.0
3
+ Version: 4.2.1
4
4
  Summary: A lightweight framework for building LLM-powered agents.
5
5
  Project-URL: Homepage, https://github.com/memgrafter/flatagents
6
6
  Project-URL: Repository, https://github.com/memgrafter/flatagents
@@ -1,4 +1,4 @@
1
- __version__ = "4.2.0"
1
+ __version__ = "4.2.1"
2
2
 
3
3
  from .baseagent import (
4
4
  # Base agent (abstract, for multi-step agents)
@@ -9,7 +9,7 @@
9
9
  * Each may be provided inline or by reference.
10
10
  */
11
11
 
12
- export const SPEC_VERSION = "4.2.0";
12
+ export const SPEC_VERSION = "4.2.1";
13
13
 
14
14
  import {
15
15
  PromptWrapper,
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "4.2.0";
1
+ export const SPEC_VERSION = "4.2.1";
2
2
  import { PromptWrapper, PromptData, PromptRef, OutputSchema, MCPConfig, ToolDefinition, } from "./prompt";
3
3
  import { ProfileWrapper, ProfileData, ProfileRef, ModelConfig, OAuthConfig, } from "./profile";
4
4
  export interface AgentWrapper {
@@ -800,7 +800,7 @@ export interface BackendConfig {
800
800
  aws_region?: string;
801
801
  }
802
802
 
803
- export const SPEC_VERSION = "4.2.0";
803
+ export const SPEC_VERSION = "4.2.1";
804
804
 
805
805
  export interface SDKRuntimeWrapper {
806
806
  spec: "flatagents-runtime";
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "spec_version": {
13
13
  "type": "string",
14
- "const": "4.2.0"
14
+ "const": "4.2.1"
15
15
  },
16
16
  "execution_lock": {
17
17
  "$ref": "#/definitions/ExecutionLock"
@@ -252,7 +252,7 @@ export interface BackendConfig {
252
252
  dynamodb_table?: string;
253
253
  aws_region?: string;
254
254
  }
255
- export const SPEC_VERSION = "4.2.0";
255
+ export const SPEC_VERSION = "4.2.1";
256
256
  export interface SDKRuntimeWrapper {
257
257
  spec: "flatagents-runtime";
258
258
  spec_version: typeof SPEC_VERSION;
@@ -190,7 +190,7 @@ waiting_channel - Signal channel this machine is blocked on (v1.2.0)
190
190
  config_hash - Content-addressed machine config key for cross-SDK resume (v2.1.0)
191
191
  */
192
192
 
193
- export const SPEC_VERSION = "4.2.0";
193
+ export const SPEC_VERSION = "4.2.1";
194
194
 
195
195
  export interface MachineWrapper {
196
196
  spec: "flatmachine";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "4.2.0";
1
+ export const SPEC_VERSION = "4.2.1";
2
2
  export interface MachineWrapper {
3
3
  spec: "flatmachine";
4
4
  spec_version: string;
@@ -14,7 +14,7 @@
14
14
  * It does not define prompt text or output schema.
15
15
  */
16
16
 
17
- export const SPEC_VERSION = "4.2.0";
17
+ export const SPEC_VERSION = "4.2.1";
18
18
 
19
19
  export interface ProfileWrapper {
20
20
  spec: "flatprofile";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "4.2.0";
1
+ export const SPEC_VERSION = "4.2.1";
2
2
  export interface ProfileWrapper {
3
3
  spec: "flatprofile";
4
4
  spec_version: string;
@@ -12,7 +12,7 @@
12
12
  * It does not define runtime, model, profile, or adapter selection.
13
13
  */
14
14
 
15
- export const SPEC_VERSION = "4.2.0";
15
+ export const SPEC_VERSION = "4.2.1";
16
16
 
17
17
  export interface PromptWrapper {
18
18
  spec: "prompt";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "4.2.0";
1
+ export const SPEC_VERSION = "4.2.1";
2
2
  export interface PromptWrapper {
3
3
  spec: "prompt";
4
4
  spec_version: string;
@@ -491,7 +491,7 @@ class FlatAgent:
491
491
  """Apply resolved llm model config to instance attributes."""
492
492
  provider = model_config.get('provider')
493
493
  model_name = model_config.get('name')
494
- if provider and model_name and '/' not in str(model_name):
494
+ if provider and model_name and f"{provider}/" not in str(model_name) and f"{provider}:" not in str(model_name):
495
495
  full_model_name = f"{provider}/{model_name}"
496
496
  else:
497
497
  full_model_name = model_name
@@ -923,9 +923,12 @@ class FlatAgent:
923
923
  input_data: Dict[str, Any],
924
924
  tools_prompt: str = "",
925
925
  tools: Optional[List[Dict]] = None,
926
+ context: Optional[Dict[str, Any]] = None,
926
927
  ) -> str:
927
928
  """
928
- Render post-history instructions with the same template context as prompts.
929
+ Render post-history instructions with the same template context as prompts,
930
+ plus an additional ``context`` variable for data that persists across turns
931
+ (e.g. role state maintained by a FlatMachine tool loop).
929
932
 
930
933
  These instructions are not part of the stored logical conversation. They
931
934
  are appended ephemerally to the final submitted user/tool message after
@@ -951,6 +954,7 @@ class FlatAgent:
951
954
  tools_prompt=tools_prompt,
952
955
  tools=tools or [],
953
956
  model=model_config,
957
+ context=context or {},
954
958
  )
955
959
 
956
960
  def _messages_with_post_history_instructions(
@@ -1252,6 +1256,7 @@ class FlatAgent:
1252
1256
  input_data,
1253
1257
  tools_prompt=tools_prompt,
1254
1258
  tools=_mcp_tools,
1259
+ context=context,
1255
1260
  )
1256
1261
  submit_messages = self._messages_with_post_history_instructions(
1257
1262
  all_messages,
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "flatagents"
7
- version = "4.2.0"
7
+ version = "4.2.1"
8
8
  description = "A lightweight framework for building LLM-powered agents."
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
File without changes
File without changes