flatagents 2.2.0__tar.gz → 2.2.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 (32) hide show
  1. {flatagents-2.2.0 → flatagents-2.2.2}/.gitignore +2 -0
  2. {flatagents-2.2.0 → flatagents-2.2.2}/PKG-INFO +1 -1
  3. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/__init__.py +1 -1
  4. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagent.d.ts +1 -1
  5. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagent.slim.d.ts +1 -1
  6. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagents-runtime.d.ts +1 -1
  7. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagents-runtime.schema.json +1 -1
  8. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagents-runtime.slim.d.ts +1 -1
  9. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatmachine.d.ts +5 -3
  10. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatmachine.schema.json +10 -1
  11. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatmachine.slim.d.ts +3 -2
  12. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/profiles.d.ts +1 -1
  13. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/profiles.slim.d.ts +1 -1
  14. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/flatagent.py +7 -2
  15. {flatagents-2.2.0 → flatagents-2.2.2}/pyproject.toml +1 -1
  16. {flatagents-2.2.0 → flatagents-2.2.2}/MACHINES.md +0 -0
  17. {flatagents-2.2.0 → flatagents-2.2.2}/README.md +0 -0
  18. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/README.md +0 -0
  19. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/__init__.py +0 -0
  20. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/flatagent.schema.json +0 -0
  21. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/assets/profiles.schema.json +0 -0
  22. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/baseagent.py +0 -0
  23. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/monitoring.py +0 -0
  24. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/profiles.py +0 -0
  25. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/providers/__init__.py +0 -0
  26. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/providers/anthropic.py +0 -0
  27. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/providers/cerebras.py +0 -0
  28. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/providers/openai.py +0 -0
  29. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/tool_loop.py +0 -0
  30. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/tools.py +0 -0
  31. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/utils.py +0 -0
  32. {flatagents-2.2.0 → flatagents-2.2.2}/flatagents/validation.py +0 -0
@@ -13,3 +13,5 @@ data
13
13
  .checkpoints
14
14
 
15
15
  logs
16
+
17
+ .aider.tags.cache.v4/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flatagents
3
- Version: 2.2.0
3
+ Version: 2.2.2
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__ = "2.2.0"
1
+ __version__ = "2.2.2"
2
2
 
3
3
  from .baseagent import (
4
4
  # Base agent (abstract, for multi-step agents)
@@ -149,7 +149,7 @@
149
149
  * The profile field specifies which profile name to use as base.
150
150
  */
151
151
 
152
- export const SPEC_VERSION = "2.2.0";
152
+ export const SPEC_VERSION = "2.2.2";
153
153
 
154
154
  export interface AgentWrapper {
155
155
  spec: "flatagent";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "2.2.0";
1
+ export const SPEC_VERSION = "2.2.2";
2
2
  export interface AgentWrapper {
3
3
  spec: "flatagent";
4
4
  spec_version: string;
@@ -800,7 +800,7 @@ export interface BackendConfig {
800
800
  aws_region?: string;
801
801
  }
802
802
 
803
- export const SPEC_VERSION = "2.2.0";
803
+ export const SPEC_VERSION = "2.2.2";
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": "2.2.0"
14
+ "const": "2.2.2"
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 = "2.2.0";
255
+ export const SPEC_VERSION = "2.2.2";
256
256
  export interface SDKRuntimeWrapper {
257
257
  spec: "flatagents-runtime";
258
258
  spec_version: typeof SPEC_VERSION;
@@ -240,7 +240,7 @@
240
240
  * PERSISTENCE (v0.2.0):
241
241
  * --------------------
242
242
  * MachineSnapshot - Wire format for checkpoints (execution_id, state, context, step)
243
- * PersistenceConfig - Backend config: {enabled: true, backend: "local"|"memory"}
243
+ * PersistenceConfig - Backend config: {enabled: true, backend: "local"|"memory"|"sqlite"}
244
244
  * checkpoint_on - Events to checkpoint: ["machine_start", "execute", "machine_end"]
245
245
  *
246
246
  * MACHINE LAUNCHING:
@@ -319,7 +319,7 @@
319
319
  * config_hash - Content-addressed machine config key for cross-SDK resume (v2.1.0)
320
320
  */
321
321
 
322
- export const SPEC_VERSION = "2.2.0";
322
+ export const SPEC_VERSION = "2.2.2";
323
323
 
324
324
  export interface MachineWrapper {
325
325
  spec: "flatmachine";
@@ -467,7 +467,9 @@ export interface MachineSnapshot {
467
467
 
468
468
  export interface PersistenceConfig {
469
469
  enabled: boolean;
470
- backend: "local" | "redis" | "memory" | string;
470
+ backend: "local" | "sqlite" | "memory";
471
+ /** Database file path for sqlite backend. Defaults to "flatmachines.sqlite". */
472
+ db_path?: string;
471
473
  checkpoint_on?: string[];
472
474
  [key: string]: any;
473
475
  }
@@ -707,7 +707,16 @@
707
707
  "type": "boolean"
708
708
  },
709
709
  "backend": {
710
- "type": "string"
710
+ "type": "string",
711
+ "enum": [
712
+ "local",
713
+ "sqlite",
714
+ "memory"
715
+ ]
716
+ },
717
+ "db_path": {
718
+ "type": "string",
719
+ "description": "Database file path for sqlite backend. Defaults to \"flatmachines.sqlite\"."
711
720
  },
712
721
  "checkpoint_on": {
713
722
  "type": "array",
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "2.2.0";
1
+ export const SPEC_VERSION = "2.2.2";
2
2
  export interface MachineWrapper {
3
3
  spec: "flatmachine";
4
4
  spec_version: string;
@@ -127,7 +127,8 @@ export interface MachineSnapshot {
127
127
  }
128
128
  export interface PersistenceConfig {
129
129
  enabled: boolean;
130
- backend: "local" | "redis" | "memory" | string;
130
+ backend: "local" | "sqlite" | "memory";
131
+ db_path?: string;
131
132
  checkpoint_on?: string[];
132
133
  [key: string]: any;
133
134
  }
@@ -108,7 +108,7 @@
108
108
  * stream - Enable streaming responses (default: false)
109
109
  */
110
110
 
111
- export const SPEC_VERSION = "2.2.0";
111
+ export const SPEC_VERSION = "2.2.2";
112
112
 
113
113
  export interface ProfilesWrapper {
114
114
  spec: "flatprofiles";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "2.2.0";
1
+ export const SPEC_VERSION = "2.2.2";
2
2
  export interface ProfilesWrapper {
3
3
  spec: "flatprofiles";
4
4
  spec_version: string;
@@ -686,6 +686,11 @@ class FlatAgent:
686
686
  # Render prompts
687
687
  system_prompt = self._render_system_prompt(input_data, tools_prompt=tools_prompt, tools=_mcp_tools)
688
688
  user_prompt = self._render_user_prompt(input_data, tools_prompt=tools_prompt, tools=_mcp_tools)
689
+ rendered_user_prompt = user_prompt
690
+ if messages is not None and not input_data:
691
+ # Continuation call without fresh input should not report a synthetic
692
+ # rendered prompt (it wasn't added to request messages).
693
+ rendered_user_prompt = None
689
694
 
690
695
  # Build messages
691
696
  if messages:
@@ -854,7 +859,7 @@ class FlatAgent:
854
859
  rate_limit=rate_limit_info,
855
860
  finish_reason=FinishReason.ERROR,
856
861
  raw_response=getattr(e, 'response', None),
857
- rendered_user_prompt=user_prompt,
862
+ rendered_user_prompt=rendered_user_prompt,
858
863
  )
859
864
 
860
865
  # Track usage
@@ -904,7 +909,7 @@ class FlatAgent:
904
909
  usage=usage_info,
905
910
  rate_limit=rate_limit_info,
906
911
  finish_reason=finish_reason,
907
- rendered_user_prompt=user_prompt,
912
+ rendered_user_prompt=rendered_user_prompt,
908
913
  )
909
914
 
910
915
  def _extract_cache_tokens(self, usage: Any) -> tuple[int, int]:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "flatagents"
7
- version = "2.2.0"
7
+ version = "2.2.2"
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