flock-core 0.5.5__py3-none-any.whl → 0.5.6__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.

Potentially problematic release.


This version of flock-core might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flock-core
3
- Version: 0.5.5
3
+ Version: 0.5.6
4
4
  Summary: Flock: A declrative framework for building and orchestrating AI agents.
5
5
  Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
6
6
  License: MIT
@@ -484,13 +484,77 @@ await flock.run_until_idle()
484
484
  # Total time: ~1x single execution (parallel)
485
485
  ```
486
486
 
487
+ ### Agent Components (Agent Lifecycle Hooks)
488
+
489
+ **Extend agent behavior through composable lifecycle hooks:**
490
+
491
+ Agent components let you inject custom logic at specific points in an agent's execution without modifying core agent code:
492
+
493
+ ```python
494
+ from flock.components import AgentComponent
495
+
496
+ # Custom component: Log inputs/outputs
497
+ class LoggingComponent(AgentComponent):
498
+ async def on_pre_evaluate(self, agent, ctx, inputs):
499
+ logger.info(f"Agent {agent.name} evaluating: {inputs}")
500
+ return inputs # Pass through unchanged
501
+
502
+ async def on_post_evaluate(self, agent, ctx, inputs, result):
503
+ logger.info(f"Agent {agent.name} produced: {result}")
504
+ return result
505
+
506
+ # Attach to any agent
507
+ analyzer = (
508
+ flock.agent("analyzer")
509
+ .consumes(Data)
510
+ .publishes(Report)
511
+ .with_utilities(LoggingComponent())
512
+ )
513
+ ```
514
+
515
+ **Built-in components**: Rate limiting, caching, metrics collection, budget tracking, guardrails
516
+
517
+ **📖 [Learn more: Agent Components Guide](https://whiteducksoftware.github.io/flock/guides/components/)**
518
+
519
+ ---
520
+
521
+ ### Orchestrator Components (Orchestrator Lifecycle Hooks)
522
+
523
+ **Extend orchestrator behavior through composable lifecycle hooks:**
524
+
525
+ Orchestrator components let you inject custom logic into the orchestrator's scheduling pipeline:
526
+
527
+ ```python
528
+ from flock.orchestrator_component import OrchestratorComponent, ScheduleDecision
529
+
530
+ # Custom component: Skip scheduling during maintenance window
531
+ class MaintenanceWindowComponent(OrchestratorComponent):
532
+ async def on_before_schedule(self, orch, artifact, agent, subscription):
533
+ if self.is_maintenance_window():
534
+ logger.info(f"Deferring {agent.name} during maintenance")
535
+ return ScheduleDecision.DEFER
536
+ return ScheduleDecision.CONTINUE
537
+
538
+ # Add to orchestrator
539
+ flock = Flock("openai/gpt-4.1")
540
+ flock.add_component(MaintenanceWindowComponent())
541
+ ```
542
+
543
+ **Built-in components**:
544
+ - `CircuitBreakerComponent` - Prevent runaway agent execution
545
+ - `DeduplicationComponent` - Skip duplicate artifact/agent processing
546
+
547
+ **8 Lifecycle Hooks**: Artifact publication, scheduling decisions, artifact collection, agent scheduling, idle/shutdown
548
+
549
+ ---
550
+
487
551
  ### Production Safety Features
488
552
 
489
553
  **Built-in safeguards prevent common production failures:**
490
554
 
491
555
  ```python
492
- # Circuit breakers prevent runaway costs
493
- flock = Flock("openai/gpt-4.1", max_agent_iterations=1000)
556
+ # Circuit breakers prevent runaway costs (via OrchestratorComponent)
557
+ flock = Flock("openai/gpt-4.1") # Auto-adds CircuitBreakerComponent(max_iterations=1000)
494
558
 
495
559
  # Feedback loop protection
496
560
  critic = (
@@ -1,13 +1,14 @@
1
1
  flock/__init__.py,sha256=fvp4ltfaAGmYliShuTY_XVIpOUN6bMXbWiBnwb1NBoM,310
2
- flock/agent.py,sha256=zlhrY8jWE6LK8hmOHaQWbfnX7_T_6Eg6Qb7oviujJiY,42715
2
+ flock/agent.py,sha256=hJY9oT16u-TnP3BoXsm6y_-tnRShHwYuz_EPAe48AkA,48049
3
3
  flock/artifact_collector.py,sha256=8rsg5NzmXeXKNT07TqX1_Z6aAGud2dXKzvS0jhjX3gQ,6372
4
4
  flock/artifacts.py,sha256=3vQQ1J7QxTzeQBUGaNLiyojlmBv1NfdhFC98-qj8fpU,2541
5
5
  flock/batch_accumulator.py,sha256=YcZSpdYMhm8wAGqKEF49NJ_Jl2HZX78NrJYqfyHqTuE,8003
6
6
  flock/cli.py,sha256=lPtKxEXnGtyuTh0gyG3ixEIFS4Ty6Y0xsPd6SpUTD3U,4526
7
- flock/components.py,sha256=7y2UWaIU0wBl44xO0SkU1m04ixbj4gd_FP9wFpsuZhY,7609
7
+ flock/components.py,sha256=WDCOFSk_y69cncK5aAz7UAGZ1ErXdBzh_p0qW1eLmPM,7761
8
8
  flock/correlation_engine.py,sha256=iGB6-G5F-B-pw-clLx4-pZEiUrK_Q2l3kOn4jtEO_kw,8103
9
9
  flock/examples.py,sha256=eQb8k6EYBbUhauFuSN_0EIIu5KW0mTqJU0HM4-p14sc,3632
10
- flock/orchestrator.py,sha256=YJ8M7HxCUjq4hZ9wj3XKbOfLPVq-_zeTPclhI0YBaA0,54530
10
+ flock/orchestrator.py,sha256=EzS7K6ZTxfVzuincnK3NRc_sqkbiSYimbpJhKGj_mac,62900
11
+ flock/orchestrator_component.py,sha256=jHYKv-58Rsu3Qsa6QYEx4iMWyJfpSqjowGZWfv-BKDI,25017
11
12
  flock/registry.py,sha256=s0-H-TMtOsDZiZQCc7T1tYiWQg3OZHn5T--jaI_INIc,4786
12
13
  flock/runtime.py,sha256=uEq_zpCd--zqVAGU95uQt9QXqp2036iWo2lRr1JGlM8,8651
13
14
  flock/service.py,sha256=JDdjjPTPH6NFezAr8x6svtqxIGXA7-AyHS11GF57g9Q,11041
@@ -17,7 +18,7 @@ flock/utilities.py,sha256=bqTPnFF6E-pDqx1ISswDNEzTU2-ED_URlkyKWLjF3mU,12109
17
18
  flock/visibility.py,sha256=Cu2PMBjRtqjiWzlwHLCIC2AUFBjJ2augecG-jvK8ky0,2949
18
19
  flock/api/themes.py,sha256=BOj1e0LHx6BDLdnVdXh1LKsbQ_ZeubH9UCoj08dC1yc,1886
19
20
  flock/dashboard/__init__.py,sha256=_W6Id_Zb7mkSz0iHY1nfdUqF9p9uV_NyHsU7PFsRnFI,813
20
- flock/dashboard/collector.py,sha256=m0dh1HNvJsf-9vM9NGpvPz6wYjzSSQdc8UgVCVbMN-k,21685
21
+ flock/dashboard/collector.py,sha256=ucH76Fp_MKs1sDgwHXzzqe1qmGljiX1DQibPExHRiqk,21765
21
22
  flock/dashboard/events.py,sha256=ICqpBKE68HjevJg7GAT7rrUbPV8Adkird34ZC45_oYA,7679
22
23
  flock/dashboard/graph_builder.py,sha256=jdiaruce5uRybndlA4aiOXW-gKkHeGtnndzYQ1WyU9Y,32006
23
24
  flock/dashboard/launcher.py,sha256=dCfwaeMLtyIkik3aVSEsbBdABS5ADRlKWYkih7sF5hM,8196
@@ -529,8 +530,8 @@ flock/themes/zenburned.toml,sha256=UEmquBbcAO3Zj652XKUwCsNoC2iQSlIh-q5c6DH-7Kc,1
529
530
  flock/themes/zenwritten-dark.toml,sha256=-dgaUfg1iCr5Dv4UEeHv_cN4GrPUCWAiHSxWK20X1kI,1663
530
531
  flock/themes/zenwritten-light.toml,sha256=G1iEheCPfBNsMTGaVpEVpDzYBHA_T-MV27rolUYolmE,1666
531
532
  flock/utility/output_utility_component.py,sha256=yVHhlIIIoYKziI5UyT_zvQb4G-NsxCTgLwA1wXXTTj4,9047
532
- flock_core-0.5.5.dist-info/METADATA,sha256=t-87LUTaHtfmkBW4U37oAhenOGcoq3WITQfRpuvrgsc,39584
533
- flock_core-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
534
- flock_core-0.5.5.dist-info/entry_points.txt,sha256=UQdPmtHd97gSA_IdLt9MOd-1rrf_WO-qsQeIiHWVrp4,42
535
- flock_core-0.5.5.dist-info/licenses/LICENSE,sha256=U3IZuTbC0yLj7huwJdldLBipSOHF4cPf6cUOodFiaBE,1072
536
- flock_core-0.5.5.dist-info/RECORD,,
533
+ flock_core-0.5.6.dist-info/METADATA,sha256=HxIB8GkFjBRu-DTuN0zcIdOq0TPUnAqZJ4rKwkTuPyw,41805
534
+ flock_core-0.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
535
+ flock_core-0.5.6.dist-info/entry_points.txt,sha256=UQdPmtHd97gSA_IdLt9MOd-1rrf_WO-qsQeIiHWVrp4,42
536
+ flock_core-0.5.6.dist-info/licenses/LICENSE,sha256=U3IZuTbC0yLj7huwJdldLBipSOHF4cPf6cUOodFiaBE,1072
537
+ flock_core-0.5.6.dist-info/RECORD,,