flock-core 0.1.1__py3-none-any.whl → 0.2.1__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.
- flock/__init__.py +1 -4
- flock/agents/__init__.py +0 -3
- flock/agents/batch_agent.py +140 -175
- flock/agents/loop_agent.py +117 -178
- flock/agents/trigger_agent.py +113 -191
- flock/agents/user_agent.py +145 -230
- flock/core/__init__.py +1 -7
- flock/core/context/context.py +211 -0
- flock/core/context/context_manager.py +34 -0
- flock/core/{context_vars.py → context/context_vars.py} +8 -6
- flock/core/execution/local_executor.py +27 -0
- flock/core/execution/temporal_executor.py +40 -0
- flock/core/flock.py +199 -208
- flock/core/flock_agent.py +492 -0
- flock/core/logging/__init__.py +2 -18
- flock/core/logging/formatters/base_formatter.py +36 -0
- flock/core/logging/formatters/formatter_factory.py +38 -0
- flock/core/logging/formatters/pprint_formatter.py +18 -0
- flock/core/logging/formatters/rich_formatters.py +132 -0
- flock/core/logging/formatters/theme_builder.py +480 -0
- flock/core/logging/formatters/themed_formatter.py +442 -0
- flock/core/logging/logging.py +123 -0
- flock/core/mixin/dspy_integration.py +171 -0
- flock/core/mixin/prompt_parser.py +125 -0
- flock/core/registry/agent_registry.py +103 -0
- flock/core/tools/basic_tools.py +273 -98
- flock/core/tools/dev_tools/github.py +161 -0
- flock/core/util/cli_helper.py +21 -0
- flock/core/util/input_resolver.py +156 -0
- flock/core/util/serializable.py +93 -0
- flock/themes/3024-day.toml +39 -0
- flock/themes/3024-night.toml +77 -0
- flock/themes/aardvark-blue.toml +77 -0
- flock/themes/abernathy.toml +77 -0
- flock/themes/adventure.toml +77 -0
- flock/themes/adventuretime.toml +77 -0
- flock/themes/afterglow.toml +77 -0
- flock/themes/alabaster.toml +77 -0
- flock/themes/alienblood.toml +77 -0
- flock/themes/andromeda.toml +77 -0
- flock/themes/apple-classic.toml +77 -0
- flock/themes/apple-system-colors.toml +77 -0
- flock/themes/arcoiris.toml +77 -0
- flock/themes/argonaut copy.toml +77 -0
- flock/themes/argonaut.toml +39 -0
- flock/themes/arthur.toml +77 -0
- flock/themes/ateliersulphurpool.toml +77 -0
- flock/themes/atom.toml +38 -0
- flock/themes/atom_test.toml +65 -0
- flock/themes/atomonelight.toml +77 -0
- flock/themes/aurora.toml +77 -0
- flock/themes/ayu copy.toml +77 -0
- flock/themes/ayu-light.toml +77 -0
- flock/themes/ayu-mirage.toml +77 -0
- flock/themes/ayu.toml +39 -0
- flock/themes/banana-blueberry.toml +77 -0
- flock/themes/batman.toml +77 -0
- flock/themes/belafonte-day.toml +77 -0
- flock/themes/belafonte-night.toml +77 -0
- flock/themes/birdsofparadise.toml +77 -0
- flock/themes/blazer.toml +77 -0
- flock/themes/blue-matrix.toml +77 -0
- flock/themes/blueberrypie.toml +77 -0
- flock/themes/bluedolphin.toml +77 -0
- flock/themes/blulocodark.toml +77 -0
- flock/themes/blulocolight.toml +77 -0
- flock/themes/borland.toml +77 -0
- flock/themes/breeze.toml +77 -0
- flock/themes/bright-lights.toml +77 -0
- flock/themes/broadcast.toml +77 -0
- flock/themes/brogrammer.toml +77 -0
- flock/themes/builtin-dark.toml +77 -0
- flock/themes/builtin-light.toml +77 -0
- flock/themes/builtin-pastel-dark.toml +77 -0
- flock/themes/builtin-solarized-dark.toml +77 -0
- flock/themes/builtin-solarized-light.toml +77 -0
- flock/themes/builtin-tango-dark.toml +77 -0
- flock/themes/builtin-tango-light.toml +77 -0
- flock/themes/c64.toml +77 -0
- flock/themes/calamity.toml +77 -0
- flock/themes/catppuccin-frappe.toml +77 -0
- flock/themes/catppuccin-latte.toml +77 -0
- flock/themes/catppuccin-macchiato.toml +77 -0
- flock/themes/catppuccin-mocha.toml +77 -0
- flock/themes/cga.toml +77 -0
- flock/themes/chalk.toml +77 -0
- flock/themes/chalkboard.toml +77 -0
- flock/themes/challengerdeep.toml +77 -0
- flock/themes/chester.toml +77 -0
- flock/themes/ciapre.toml +77 -0
- flock/themes/clrs.toml +77 -0
- flock/themes/cobalt-neon.toml +77 -0
- flock/themes/cobalt2.toml +77 -0
- flock/themes/coffee-theme.toml +77 -0
- flock/themes/crayonponyfish.toml +77 -0
- flock/themes/cutiepro.toml +77 -0
- flock/themes/cyberdyne.toml +77 -0
- flock/themes/cyberpunk.toml +77 -0
- flock/themes/cyberpunkscarletprotocol.toml +77 -0
- flock/themes/dark+.toml +77 -0
- flock/themes/dark-pastel.toml +77 -0
- flock/themes/darkermatrix.toml +77 -0
- flock/themes/darkmatrix.toml +77 -0
- flock/themes/darkside.toml +77 -0
- flock/themes/dayfox.toml +77 -0
- flock/themes/deep.toml +77 -0
- flock/themes/desert.toml +77 -0
- flock/themes/dimidium.toml +77 -0
- flock/themes/dimmedmonokai.toml +77 -0
- flock/themes/django.toml +77 -0
- flock/themes/djangorebornagain.toml +77 -0
- flock/themes/djangosmooth.toml +77 -0
- flock/themes/doom-peacock.toml +77 -0
- flock/themes/doomone.toml +77 -0
- flock/themes/dotgov.toml +77 -0
- flock/themes/dracula+.toml +77 -0
- flock/themes/dracula.toml +77 -0
- flock/themes/duckbones.toml +77 -0
- flock/themes/duotone-dark.toml +77 -0
- flock/themes/earthsong.toml +77 -0
- flock/themes/elemental.toml +77 -0
- flock/themes/elementary.toml +77 -0
- flock/themes/encom.toml +77 -0
- flock/themes/espresso-libre.toml +77 -0
- flock/themes/espresso.toml +77 -0
- flock/themes/everblush.toml +77 -0
- flock/themes/fahrenheit.toml +77 -0
- flock/themes/fairyfloss.toml +77 -0
- flock/themes/farmhouse-dark.toml +77 -0
- flock/themes/farmhouse-light.toml +77 -0
- flock/themes/fideloper.toml +77 -0
- flock/themes/firefly-traditional.toml +77 -0
- flock/themes/firefoxdev.toml +77 -0
- flock/themes/firewatch.toml +77 -0
- flock/themes/fishtank.toml +77 -0
- flock/themes/flat.toml +77 -0
- flock/themes/flatland.toml +77 -0
- flock/themes/flexoki-dark.toml +77 -0
- flock/themes/flexoki-light.toml +77 -0
- flock/themes/floraverse.toml +77 -0
- flock/themes/forestblue.toml +77 -0
- flock/themes/framer.toml +77 -0
- flock/themes/frontenddelight.toml +77 -0
- flock/themes/funforrest.toml +77 -0
- flock/themes/galaxy.toml +77 -0
- flock/themes/galizur.toml +77 -0
- flock/themes/github-dark.toml +77 -0
- flock/themes/github.toml +77 -0
- flock/themes/glacier.toml +77 -0
- flock/themes/grape.toml +77 -0
- flock/themes/grass.toml +77 -0
- flock/themes/grey-green.toml +77 -0
- flock/themes/gruber-darker.toml +77 -0
- flock/themes/gruvboxdark.toml +77 -0
- flock/themes/gruvboxdarkhard.toml +77 -0
- flock/themes/gruvboxlight.toml +77 -0
- flock/themes/guezwhoz.toml +77 -0
- flock/themes/hacktober.toml +77 -0
- flock/themes/hardcore.toml +77 -0
- flock/themes/harper.toml +77 -0
- flock/themes/hax0r-blue.toml +77 -0
- flock/themes/hax0r-gr33n.toml +77 -0
- flock/themes/hax0r-r3d.toml +77 -0
- flock/themes/highway.toml +77 -0
- flock/themes/hipster-green.toml +77 -0
- flock/themes/hivacruz.toml +77 -0
- flock/themes/homebrew.toml +77 -0
- flock/themes/hopscotch.256.toml +77 -0
- flock/themes/hopscotch.toml +77 -0
- flock/themes/hurtado.toml +77 -0
- flock/themes/hybrid.toml +77 -0
- flock/themes/ic-green-ppl.toml +77 -0
- flock/themes/ic-orange-ppl.toml +77 -0
- flock/themes/iceberg-dark.toml +77 -0
- flock/themes/iceberg-light.toml +77 -0
- flock/themes/idea.toml +77 -0
- flock/themes/idletoes.toml +77 -0
- flock/themes/ir-black.toml +77 -0
- flock/themes/iterm2-dark-background.toml +77 -0
- flock/themes/iterm2-default.toml +77 -0
- flock/themes/iterm2-light-background.toml +77 -0
- flock/themes/iterm2-pastel-dark-background.toml +77 -0
- flock/themes/iterm2-smoooooth.toml +77 -0
- flock/themes/iterm2-solarized-dark.toml +77 -0
- flock/themes/iterm2-solarized-light.toml +77 -0
- flock/themes/iterm2-tango-dark.toml +77 -0
- flock/themes/iterm2-tango-light.toml +77 -0
- flock/themes/jackie-brown.toml +77 -0
- flock/themes/japanesque.toml +77 -0
- flock/themes/jellybeans.toml +77 -0
- flock/themes/jetbrains-darcula.toml +77 -0
- flock/themes/jubi.toml +77 -0
- flock/themes/kanagawabones.toml +77 -0
- flock/themes/kibble.toml +77 -0
- flock/themes/kolorit.toml +77 -0
- flock/themes/konsolas.toml +77 -0
- flock/themes/kurokula.toml +77 -0
- flock/themes/lab-fox.toml +77 -0
- flock/themes/laser.toml +77 -0
- flock/themes/later-this-evening.toml +77 -0
- flock/themes/lavandula.toml +77 -0
- flock/themes/liquidcarbon.toml +77 -0
- flock/themes/liquidcarbontransparent.toml +77 -0
- flock/themes/liquidcarbontransparentinverse.toml +77 -0
- flock/themes/lovelace.toml +77 -0
- flock/themes/man-page.toml +77 -0
- flock/themes/mariana.toml +77 -0
- flock/themes/material.toml +77 -0
- flock/themes/materialdark.toml +77 -0
- flock/themes/materialdarker.toml +77 -0
- flock/themes/materialdesigncolors.toml +77 -0
- flock/themes/materialocean.toml +77 -0
- flock/themes/mathias.toml +77 -0
- flock/themes/matrix.toml +77 -0
- flock/themes/medallion.toml +77 -0
- flock/themes/mellifluous.toml +77 -0
- flock/themes/midnight-in-mojave.toml +77 -0
- flock/themes/mirage.toml +77 -0
- flock/themes/misterioso.toml +77 -0
- flock/themes/molokai.toml +77 -0
- flock/themes/monalisa.toml +77 -0
- flock/themes/monokai-remastered.toml +77 -0
- flock/themes/monokai-soda.toml +77 -0
- flock/themes/monokai-vivid.toml +77 -0
- flock/themes/n0tch2k.toml +77 -0
- flock/themes/neobones-dark.toml +77 -0
- flock/themes/neobones-light.toml +77 -0
- flock/themes/neon.toml +77 -0
- flock/themes/neopolitan.toml +77 -0
- flock/themes/neutron.toml +77 -0
- flock/themes/night-owlish-light.toml +77 -0
- flock/themes/nightfox.toml +77 -0
- flock/themes/nightlion-v1.toml +77 -0
- flock/themes/nightlion-v2.toml +77 -0
- flock/themes/niji.toml +77 -0
- flock/themes/nocturnal-winter.toml +77 -0
- flock/themes/nord-light.toml +77 -0
- flock/themes/nord.toml +77 -0
- flock/themes/novel.toml +77 -0
- flock/themes/nvimdark.toml +77 -0
- flock/themes/nvimlight.toml +77 -0
- flock/themes/obsidian.toml +77 -0
- flock/themes/ocean.toml +77 -0
- flock/themes/oceanic-next.toml +77 -0
- flock/themes/oceanicmaterial.toml +77 -0
- flock/themes/ollie.toml +77 -0
- flock/themes/onehalfdark.toml +77 -0
- flock/themes/onehalflight.toml +77 -0
- flock/themes/operator-mono-dark.toml +77 -0
- flock/themes/overnight-slumber.toml +77 -0
- flock/themes/oxocarbon.toml +77 -0
- flock/themes/palenighthc.toml +77 -0
- flock/themes/pandora.toml +77 -0
- flock/themes/paraiso-dark.toml +77 -0
- flock/themes/paulmillr.toml +77 -0
- flock/themes/pencildark.toml +77 -0
- flock/themes/pencillight.toml +77 -0
- flock/themes/peppermint.toml +77 -0
- flock/themes/piatto-light.toml +77 -0
- flock/themes/pnevma.toml +77 -0
- flock/themes/popping-and-locking.toml +77 -0
- flock/themes/primary.toml +77 -0
- flock/themes/pro-light.toml +77 -0
- flock/themes/pro.toml +77 -0
- flock/themes/purple-rain.toml +77 -0
- flock/themes/purplepeter.toml +77 -0
- flock/themes/rapture.toml +77 -0
- flock/themes/raycast-dark.toml +77 -0
- flock/themes/raycast-light.toml +77 -0
- flock/themes/rebecca.toml +77 -0
- flock/themes/red-alert.toml +77 -0
- flock/themes/red-planet.toml +77 -0
- flock/themes/red-sands.toml +77 -0
- flock/themes/relaxed.toml +77 -0
- flock/themes/retro.toml +77 -0
- flock/themes/rippedcasts.toml +77 -0
- flock/themes/rose-pine-dawn.toml +77 -0
- flock/themes/rose-pine-moon.toml +77 -0
- flock/themes/rose-pine.toml +77 -0
- flock/themes/rouge-2.toml +77 -0
- flock/themes/royal.toml +77 -0
- flock/themes/ryuuko.toml +77 -0
- flock/themes/sakura.toml +77 -0
- flock/themes/scarlet-protocol.toml +77 -0
- flock/themes/seafoam-pastel.toml +77 -0
- flock/themes/seashells.toml +77 -0
- flock/themes/seoulbones-dark.toml +77 -0
- flock/themes/seoulbones-light.toml +77 -0
- flock/themes/seti.toml +77 -0
- flock/themes/shades-of-purple.toml +77 -0
- flock/themes/shaman.toml +77 -0
- flock/themes/slate.toml +77 -0
- flock/themes/sleepyhollow.toml +77 -0
- flock/themes/smyck.toml +77 -0
- flock/themes/snazzy.toml +77 -0
- flock/themes/softserver.toml +77 -0
- flock/themes/solarized-darcula.toml +77 -0
- flock/themes/solarized-dark---patched.toml +77 -0
- flock/themes/solarized-dark-higher-contrast.toml +77 -0
- flock/themes/spacedust.toml +77 -0
- flock/themes/spacegray-eighties-dull.toml +77 -0
- flock/themes/spacegray-eighties.toml +77 -0
- flock/themes/spacegray.toml +77 -0
- flock/themes/spiderman.toml +77 -0
- flock/themes/spring.toml +77 -0
- flock/themes/square.toml +77 -0
- flock/themes/sublette.toml +77 -0
- flock/themes/subliminal.toml +77 -0
- flock/themes/sugarplum.toml +77 -0
- flock/themes/sundried.toml +77 -0
- flock/themes/symfonic.toml +77 -0
- flock/themes/synthwave-everything.toml +77 -0
- flock/themes/synthwave.toml +77 -0
- flock/themes/synthwavealpha.toml +77 -0
- flock/themes/tango-adapted.toml +77 -0
- flock/themes/tango-half-adapted.toml +77 -0
- flock/themes/teerb.toml +77 -0
- flock/themes/terafox.toml +77 -0
- flock/themes/terminal-basic.toml +77 -0
- flock/themes/thayer-bright.toml +77 -0
- flock/themes/the-hulk.toml +77 -0
- flock/themes/tinacious-design-(dark).toml +77 -0
- flock/themes/tinacious-design-(light).toml +77 -0
- flock/themes/tokyonight-day.toml +77 -0
- flock/themes/tokyonight-storm.toml +77 -0
- flock/themes/tokyonight.toml +77 -0
- flock/themes/tomorrow-night-blue.toml +77 -0
- flock/themes/tomorrow-night-bright.toml +77 -0
- flock/themes/tomorrow-night-burns.toml +77 -0
- flock/themes/tomorrow-night-eighties.toml +77 -0
- flock/themes/tomorrow-night.toml +77 -0
- flock/themes/tomorrow.toml +77 -0
- flock/themes/toychest.toml +77 -0
- flock/themes/treehouse.toml +77 -0
- flock/themes/twilight.toml +77 -0
- flock/themes/ubuntu.toml +77 -0
- flock/themes/ultradark.toml +77 -0
- flock/themes/ultraviolent.toml +77 -0
- flock/themes/underthesea.toml +77 -0
- flock/themes/unikitty.toml +77 -0
- flock/themes/urple.toml +77 -0
- flock/themes/vaughn.toml +77 -0
- flock/themes/vesper.toml +77 -0
- flock/themes/vibrantink.toml +77 -0
- flock/themes/vimbones.toml +77 -0
- flock/themes/violet-dark.toml +77 -0
- flock/themes/violet-light.toml +77 -0
- flock/themes/warmneon.toml +77 -0
- flock/themes/wez.toml +77 -0
- flock/themes/whimsy.toml +77 -0
- flock/themes/wildcherry.toml +77 -0
- flock/themes/wilmersdorf.toml +77 -0
- flock/themes/wombat.toml +77 -0
- flock/themes/wryan.toml +77 -0
- flock/themes/xcodedark.toml +77 -0
- flock/themes/xcodedarkhc.toml +77 -0
- flock/themes/xcodelight.toml +77 -0
- flock/themes/xcodelighthc.toml +77 -0
- flock/themes/xcodewwdc.toml +77 -0
- flock/themes/zenbones-dark.toml +77 -0
- flock/themes/zenbones-light.toml +77 -0
- flock/themes/zenbones.toml +77 -0
- flock/themes/zenburn.toml +77 -0
- flock/themes/zenburned.toml +77 -0
- flock/themes/zenwritten-dark.toml +77 -0
- flock/themes/zenwritten-light.toml +77 -0
- flock/workflow/activities.py +117 -115
- flock/workflow/agent_activities.py +24 -26
- flock/workflow/temporal_setup.py +38 -37
- flock/workflow/workflow.py +58 -53
- flock_core-0.2.1.dist-info/METADATA +287 -0
- flock_core-0.2.1.dist-info/RECORD +375 -0
- {flock_core-0.1.1.dist-info → flock_core-0.2.1.dist-info}/licenses/LICENSE +21 -21
- flock/agents/declarative_agent.py +0 -166
- flock/app/components/__init__.py +0 -14
- flock/app/components/charts/agent_workflow.py +0 -14
- flock/app/components/charts/core_architecture.py +0 -14
- flock/app/components/charts/tool_system.py +0 -14
- flock/app/components/history_grid.py +0 -168
- flock/app/components/history_grid_alt.py +0 -189
- flock/app/components/sidebar.py +0 -19
- flock/app/components/theme.py +0 -9
- flock/app/components/util.py +0 -18
- flock/app/hive_app.py +0 -118
- flock/app/html/d3.html +0 -179
- flock/app/modules/__init__.py +0 -12
- flock/app/modules/about.py +0 -17
- flock/app/modules/agent_detail.py +0 -70
- flock/app/modules/agent_list.py +0 -59
- flock/app/modules/playground.py +0 -322
- flock/app/modules/settings.py +0 -96
- flock/core/agent.py +0 -150
- flock/core/agent_registry.py +0 -162
- flock/core/context.py +0 -279
- flock/core/handoff/handoff_base.py +0 -12
- flock/core/logging/error_handler.py +0 -84
- flock/core/logging/formatters.py +0 -122
- flock/core/logging/handlers.py +0 -117
- flock/core/logging/logger.py +0 -107
- flock/core/serializable.py +0 -206
- flock_core-0.1.1.dist-info/METADATA +0 -449
- flock_core-0.1.1.dist-info/RECORD +0 -48
- flock_core-0.1.1.dist-info/entry_points.txt +0 -2
- /flock/{core/config/declarative_agent_config.py → workflow/__init__.py} +0 -0
- {flock_core-0.1.1.dist-info → flock_core-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[rich]
|
|
2
|
+
panel_style = "on #f0edec"
|
|
3
|
+
table_header_style = "bold #2c363c on #cbd9e3"
|
|
4
|
+
table_title_style = "bold #2c363c"
|
|
5
|
+
table_border_style = "#1d5573"
|
|
6
|
+
panel_border_style = "#1d5573"
|
|
7
|
+
column_output = "bold #2c363c"
|
|
8
|
+
column_value = "#2c363c"
|
|
9
|
+
bright_black = "#cfc1ba"
|
|
10
|
+
bright_blue = "#1d5573"
|
|
11
|
+
bright_cyan = "#2b747c"
|
|
12
|
+
bright_green = "#3f5a22"
|
|
13
|
+
bright_magenta = "#7b3b70"
|
|
14
|
+
bright_red = "#94253e"
|
|
15
|
+
bright_white = "#4f5e68"
|
|
16
|
+
bright_yellow = "#803d1c"
|
|
17
|
+
normal_black = "#f0edec"
|
|
18
|
+
normal_blue = "#286486"
|
|
19
|
+
normal_cyan = "#3b8992"
|
|
20
|
+
normal_green = "#4f6c31"
|
|
21
|
+
normal_magenta = "#88507d"
|
|
22
|
+
normal_red = "#a8334c"
|
|
23
|
+
normal_white = "#2c363c"
|
|
24
|
+
normal_yellow = "#944927"
|
|
25
|
+
cursor_cursor = "#2c363c"
|
|
26
|
+
cursor_text = "#f0edec"
|
|
27
|
+
table_show_lines = true
|
|
28
|
+
table_box = "MINIMAL"
|
|
29
|
+
panel_padding = [ 1, 2,]
|
|
30
|
+
panel_title_align = "left"
|
|
31
|
+
table_row_styles = [ "", "italic",]
|
|
32
|
+
table_safe_box = true
|
|
33
|
+
table_padding = [ 0, 1,]
|
|
34
|
+
table_collapse_padding = false
|
|
35
|
+
table_pad_edge = true
|
|
36
|
+
table_expand = false
|
|
37
|
+
table_show_footer = false
|
|
38
|
+
table_show_edge = true
|
|
39
|
+
table_leading = 0
|
|
40
|
+
table_style = "none"
|
|
41
|
+
table_footer_style = "none"
|
|
42
|
+
table_caption_style = "none"
|
|
43
|
+
table_title_justify = "center"
|
|
44
|
+
table_caption_justify = "center"
|
|
45
|
+
table_highlight = false
|
|
46
|
+
|
|
47
|
+
[colors.bright]
|
|
48
|
+
black = "#cfc1ba"
|
|
49
|
+
blue = "#1d5573"
|
|
50
|
+
cyan = "#2b747c"
|
|
51
|
+
green = "#3f5a22"
|
|
52
|
+
magenta = "#7b3b70"
|
|
53
|
+
red = "#94253e"
|
|
54
|
+
white = "#4f5e68"
|
|
55
|
+
yellow = "#803d1c"
|
|
56
|
+
|
|
57
|
+
[colors.cursor]
|
|
58
|
+
cursor = "#2c363c"
|
|
59
|
+
text = "#f0edec"
|
|
60
|
+
|
|
61
|
+
[colors.normal]
|
|
62
|
+
black = "#f0edec"
|
|
63
|
+
blue = "#286486"
|
|
64
|
+
cyan = "#3b8992"
|
|
65
|
+
green = "#4f6c31"
|
|
66
|
+
magenta = "#88507d"
|
|
67
|
+
red = "#a8334c"
|
|
68
|
+
white = "#2c363c"
|
|
69
|
+
yellow = "#944927"
|
|
70
|
+
|
|
71
|
+
[colors.primary]
|
|
72
|
+
background = "#f0edec"
|
|
73
|
+
foreground = "#2c363c"
|
|
74
|
+
|
|
75
|
+
[colors.selection]
|
|
76
|
+
background = "#cbd9e3"
|
|
77
|
+
text = "#2c363c"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[rich]
|
|
2
|
+
panel_style = "on #3f3f3f"
|
|
3
|
+
table_header_style = "bold #c2d87a on #21322f"
|
|
4
|
+
table_title_style = "bold #dcdccc"
|
|
5
|
+
table_border_style = "#94bff3"
|
|
6
|
+
panel_border_style = "#94bff3"
|
|
7
|
+
column_output = "bold #dcdccc"
|
|
8
|
+
column_value = "#dcdccc"
|
|
9
|
+
bright_black = "#709080"
|
|
10
|
+
bright_blue = "#94bff3"
|
|
11
|
+
bright_cyan = "#93e0e3"
|
|
12
|
+
bright_green = "#c3bf9f"
|
|
13
|
+
bright_magenta = "#ec93d3"
|
|
14
|
+
bright_red = "#dca3a3"
|
|
15
|
+
bright_white = "#ffffff"
|
|
16
|
+
bright_yellow = "#e0cf9f"
|
|
17
|
+
normal_black = "#4d4d4d"
|
|
18
|
+
normal_blue = "#506070"
|
|
19
|
+
normal_cyan = "#8cd0d3"
|
|
20
|
+
normal_green = "#60b48a"
|
|
21
|
+
normal_magenta = "#dc8cc3"
|
|
22
|
+
normal_red = "#705050"
|
|
23
|
+
normal_white = "#dcdccc"
|
|
24
|
+
normal_yellow = "#f0dfaf"
|
|
25
|
+
cursor_cursor = "#73635a"
|
|
26
|
+
cursor_text = "#000000"
|
|
27
|
+
table_show_lines = false
|
|
28
|
+
table_box = "HEAVY"
|
|
29
|
+
panel_padding = [ 1, 2,]
|
|
30
|
+
panel_title_align = "center"
|
|
31
|
+
table_row_styles = [ "", "italic",]
|
|
32
|
+
table_safe_box = true
|
|
33
|
+
table_padding = [ 0, 1,]
|
|
34
|
+
table_collapse_padding = false
|
|
35
|
+
table_pad_edge = true
|
|
36
|
+
table_expand = false
|
|
37
|
+
table_show_footer = false
|
|
38
|
+
table_show_edge = true
|
|
39
|
+
table_leading = 0
|
|
40
|
+
table_style = "none"
|
|
41
|
+
table_footer_style = "none"
|
|
42
|
+
table_caption_style = "none"
|
|
43
|
+
table_title_justify = "center"
|
|
44
|
+
table_caption_justify = "center"
|
|
45
|
+
table_highlight = false
|
|
46
|
+
|
|
47
|
+
[colors.bright]
|
|
48
|
+
black = "#709080"
|
|
49
|
+
blue = "#94bff3"
|
|
50
|
+
cyan = "#93e0e3"
|
|
51
|
+
green = "#c3bf9f"
|
|
52
|
+
magenta = "#ec93d3"
|
|
53
|
+
red = "#dca3a3"
|
|
54
|
+
white = "#ffffff"
|
|
55
|
+
yellow = "#e0cf9f"
|
|
56
|
+
|
|
57
|
+
[colors.cursor]
|
|
58
|
+
cursor = "#73635a"
|
|
59
|
+
text = "#000000"
|
|
60
|
+
|
|
61
|
+
[colors.normal]
|
|
62
|
+
black = "#4d4d4d"
|
|
63
|
+
blue = "#506070"
|
|
64
|
+
cyan = "#8cd0d3"
|
|
65
|
+
green = "#60b48a"
|
|
66
|
+
magenta = "#dc8cc3"
|
|
67
|
+
red = "#705050"
|
|
68
|
+
white = "#dcdccc"
|
|
69
|
+
yellow = "#f0dfaf"
|
|
70
|
+
|
|
71
|
+
[colors.primary]
|
|
72
|
+
background = "#3f3f3f"
|
|
73
|
+
foreground = "#dcdccc"
|
|
74
|
+
|
|
75
|
+
[colors.selection]
|
|
76
|
+
background = "#21322f"
|
|
77
|
+
text = "#c2d87a"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[rich]
|
|
2
|
+
panel_style = "on #404040"
|
|
3
|
+
table_header_style = "bold #f0e4cf on #746956"
|
|
4
|
+
table_title_style = "bold #f0e4cf"
|
|
5
|
+
table_border_style = "#61abda"
|
|
6
|
+
panel_border_style = "#61abda"
|
|
7
|
+
column_output = "bold #f0e4cf"
|
|
8
|
+
column_value = "#f0e4cf"
|
|
9
|
+
bright_black = "#625a5b"
|
|
10
|
+
bright_blue = "#61abda"
|
|
11
|
+
bright_cyan = "#65b8c1"
|
|
12
|
+
bright_green = "#8bae68"
|
|
13
|
+
bright_magenta = "#cf86c1"
|
|
14
|
+
bright_red = "#ec8685"
|
|
15
|
+
bright_white = "#c0ab86"
|
|
16
|
+
bright_yellow = "#d68c67"
|
|
17
|
+
normal_black = "#404040"
|
|
18
|
+
normal_blue = "#6099c0"
|
|
19
|
+
normal_cyan = "#66a5ad"
|
|
20
|
+
normal_green = "#819b69"
|
|
21
|
+
normal_magenta = "#b279a7"
|
|
22
|
+
normal_red = "#e3716e"
|
|
23
|
+
normal_white = "#f0e4cf"
|
|
24
|
+
normal_yellow = "#b77e64"
|
|
25
|
+
cursor_cursor = "#f3eadb"
|
|
26
|
+
cursor_text = "#404040"
|
|
27
|
+
table_show_lines = true
|
|
28
|
+
table_box = "HEAVY"
|
|
29
|
+
panel_padding = [ 1, 2,]
|
|
30
|
+
panel_title_align = "center"
|
|
31
|
+
table_row_styles = [ "", "dim",]
|
|
32
|
+
table_safe_box = true
|
|
33
|
+
table_padding = [ 0, 1,]
|
|
34
|
+
table_collapse_padding = false
|
|
35
|
+
table_pad_edge = true
|
|
36
|
+
table_expand = false
|
|
37
|
+
table_show_footer = false
|
|
38
|
+
table_show_edge = true
|
|
39
|
+
table_leading = 0
|
|
40
|
+
table_style = "none"
|
|
41
|
+
table_footer_style = "none"
|
|
42
|
+
table_caption_style = "none"
|
|
43
|
+
table_title_justify = "center"
|
|
44
|
+
table_caption_justify = "center"
|
|
45
|
+
table_highlight = false
|
|
46
|
+
|
|
47
|
+
[colors.bright]
|
|
48
|
+
black = "#625a5b"
|
|
49
|
+
blue = "#61abda"
|
|
50
|
+
cyan = "#65b8c1"
|
|
51
|
+
green = "#8bae68"
|
|
52
|
+
magenta = "#cf86c1"
|
|
53
|
+
red = "#ec8685"
|
|
54
|
+
white = "#c0ab86"
|
|
55
|
+
yellow = "#d68c67"
|
|
56
|
+
|
|
57
|
+
[colors.cursor]
|
|
58
|
+
cursor = "#f3eadb"
|
|
59
|
+
text = "#404040"
|
|
60
|
+
|
|
61
|
+
[colors.normal]
|
|
62
|
+
black = "#404040"
|
|
63
|
+
blue = "#6099c0"
|
|
64
|
+
cyan = "#66a5ad"
|
|
65
|
+
green = "#819b69"
|
|
66
|
+
magenta = "#b279a7"
|
|
67
|
+
red = "#e3716e"
|
|
68
|
+
white = "#f0e4cf"
|
|
69
|
+
yellow = "#b77e64"
|
|
70
|
+
|
|
71
|
+
[colors.primary]
|
|
72
|
+
background = "#404040"
|
|
73
|
+
foreground = "#f0e4cf"
|
|
74
|
+
|
|
75
|
+
[colors.selection]
|
|
76
|
+
background = "#746956"
|
|
77
|
+
text = "#f0e4cf"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[rich]
|
|
2
|
+
panel_style = "on #191919"
|
|
3
|
+
table_header_style = "bold #bbbbbb on #404040"
|
|
4
|
+
table_title_style = "bold #bbbbbb"
|
|
5
|
+
table_border_style = "#61abda"
|
|
6
|
+
panel_border_style = "#61abda"
|
|
7
|
+
column_output = "bold #bbbbbb"
|
|
8
|
+
column_value = "#bbbbbb"
|
|
9
|
+
bright_black = "#3d3839"
|
|
10
|
+
bright_blue = "#61abda"
|
|
11
|
+
bright_cyan = "#65b8c1"
|
|
12
|
+
bright_green = "#8bae68"
|
|
13
|
+
bright_magenta = "#cf86c1"
|
|
14
|
+
bright_red = "#e8838f"
|
|
15
|
+
bright_white = "#8e8e8e"
|
|
16
|
+
bright_yellow = "#d68c67"
|
|
17
|
+
normal_black = "#191919"
|
|
18
|
+
normal_blue = "#6099c0"
|
|
19
|
+
normal_cyan = "#66a5ad"
|
|
20
|
+
normal_green = "#819b69"
|
|
21
|
+
normal_magenta = "#b279a7"
|
|
22
|
+
normal_red = "#de6e7c"
|
|
23
|
+
normal_white = "#bbbbbb"
|
|
24
|
+
normal_yellow = "#b77e64"
|
|
25
|
+
cursor_cursor = "#c9c9c9"
|
|
26
|
+
cursor_text = "#191919"
|
|
27
|
+
table_show_lines = true
|
|
28
|
+
table_box = "HEAVY"
|
|
29
|
+
panel_padding = [ 1, 2,]
|
|
30
|
+
panel_title_align = "right"
|
|
31
|
+
table_row_styles = [ "", "underline",]
|
|
32
|
+
table_safe_box = true
|
|
33
|
+
table_padding = [ 0, 1,]
|
|
34
|
+
table_collapse_padding = false
|
|
35
|
+
table_pad_edge = true
|
|
36
|
+
table_expand = false
|
|
37
|
+
table_show_footer = false
|
|
38
|
+
table_show_edge = true
|
|
39
|
+
table_leading = 0
|
|
40
|
+
table_style = "none"
|
|
41
|
+
table_footer_style = "none"
|
|
42
|
+
table_caption_style = "none"
|
|
43
|
+
table_title_justify = "center"
|
|
44
|
+
table_caption_justify = "center"
|
|
45
|
+
table_highlight = false
|
|
46
|
+
|
|
47
|
+
[colors.bright]
|
|
48
|
+
black = "#3d3839"
|
|
49
|
+
blue = "#61abda"
|
|
50
|
+
cyan = "#65b8c1"
|
|
51
|
+
green = "#8bae68"
|
|
52
|
+
magenta = "#cf86c1"
|
|
53
|
+
red = "#e8838f"
|
|
54
|
+
white = "#8e8e8e"
|
|
55
|
+
yellow = "#d68c67"
|
|
56
|
+
|
|
57
|
+
[colors.cursor]
|
|
58
|
+
cursor = "#c9c9c9"
|
|
59
|
+
text = "#191919"
|
|
60
|
+
|
|
61
|
+
[colors.normal]
|
|
62
|
+
black = "#191919"
|
|
63
|
+
blue = "#6099c0"
|
|
64
|
+
cyan = "#66a5ad"
|
|
65
|
+
green = "#819b69"
|
|
66
|
+
magenta = "#b279a7"
|
|
67
|
+
red = "#de6e7c"
|
|
68
|
+
white = "#bbbbbb"
|
|
69
|
+
yellow = "#b77e64"
|
|
70
|
+
|
|
71
|
+
[colors.primary]
|
|
72
|
+
background = "#191919"
|
|
73
|
+
foreground = "#bbbbbb"
|
|
74
|
+
|
|
75
|
+
[colors.selection]
|
|
76
|
+
background = "#404040"
|
|
77
|
+
text = "#bbbbbb"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[rich]
|
|
2
|
+
panel_style = "on #eeeeee"
|
|
3
|
+
table_header_style = "bold #353535 on #d7d7d7"
|
|
4
|
+
table_title_style = "bold #353535"
|
|
5
|
+
table_border_style = "#1d5573"
|
|
6
|
+
panel_border_style = "#1d5573"
|
|
7
|
+
column_output = "bold #353535"
|
|
8
|
+
column_value = "#353535"
|
|
9
|
+
bright_black = "#c6c3c3"
|
|
10
|
+
bright_blue = "#1d5573"
|
|
11
|
+
bright_cyan = "#2b747c"
|
|
12
|
+
bright_green = "#3f5a22"
|
|
13
|
+
bright_magenta = "#7b3b70"
|
|
14
|
+
bright_red = "#94253e"
|
|
15
|
+
bright_white = "#5c5c5c"
|
|
16
|
+
bright_yellow = "#803d1c"
|
|
17
|
+
normal_black = "#eeeeee"
|
|
18
|
+
normal_blue = "#286486"
|
|
19
|
+
normal_cyan = "#3b8992"
|
|
20
|
+
normal_green = "#4f6c31"
|
|
21
|
+
normal_magenta = "#88507d"
|
|
22
|
+
normal_red = "#a8334c"
|
|
23
|
+
normal_white = "#353535"
|
|
24
|
+
normal_yellow = "#944927"
|
|
25
|
+
cursor_cursor = "#353535"
|
|
26
|
+
cursor_text = "#eeeeee"
|
|
27
|
+
table_show_lines = false
|
|
28
|
+
table_box = "SQUARE"
|
|
29
|
+
panel_padding = [ 1, 2,]
|
|
30
|
+
panel_title_align = "center"
|
|
31
|
+
table_row_styles = [ "", "dim",]
|
|
32
|
+
table_safe_box = true
|
|
33
|
+
table_padding = [ 0, 1,]
|
|
34
|
+
table_collapse_padding = false
|
|
35
|
+
table_pad_edge = true
|
|
36
|
+
table_expand = false
|
|
37
|
+
table_show_footer = false
|
|
38
|
+
table_show_edge = true
|
|
39
|
+
table_leading = 0
|
|
40
|
+
table_style = "none"
|
|
41
|
+
table_footer_style = "none"
|
|
42
|
+
table_caption_style = "none"
|
|
43
|
+
table_title_justify = "center"
|
|
44
|
+
table_caption_justify = "center"
|
|
45
|
+
table_highlight = false
|
|
46
|
+
|
|
47
|
+
[colors.bright]
|
|
48
|
+
black = "#c6c3c3"
|
|
49
|
+
blue = "#1d5573"
|
|
50
|
+
cyan = "#2b747c"
|
|
51
|
+
green = "#3f5a22"
|
|
52
|
+
magenta = "#7b3b70"
|
|
53
|
+
red = "#94253e"
|
|
54
|
+
white = "#5c5c5c"
|
|
55
|
+
yellow = "#803d1c"
|
|
56
|
+
|
|
57
|
+
[colors.cursor]
|
|
58
|
+
cursor = "#353535"
|
|
59
|
+
text = "#eeeeee"
|
|
60
|
+
|
|
61
|
+
[colors.normal]
|
|
62
|
+
black = "#eeeeee"
|
|
63
|
+
blue = "#286486"
|
|
64
|
+
cyan = "#3b8992"
|
|
65
|
+
green = "#4f6c31"
|
|
66
|
+
magenta = "#88507d"
|
|
67
|
+
red = "#a8334c"
|
|
68
|
+
white = "#353535"
|
|
69
|
+
yellow = "#944927"
|
|
70
|
+
|
|
71
|
+
[colors.primary]
|
|
72
|
+
background = "#eeeeee"
|
|
73
|
+
foreground = "#353535"
|
|
74
|
+
|
|
75
|
+
[colors.selection]
|
|
76
|
+
background = "#d7d7d7"
|
|
77
|
+
text = "#353535"
|
flock/workflow/activities.py
CHANGED
|
@@ -1,115 +1,117 @@
|
|
|
1
|
-
"""Defines Temporal activities for running a chain of agents."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
|
|
5
|
-
from temporalio import activity
|
|
6
|
-
|
|
7
|
-
from flock.core.
|
|
8
|
-
from flock.core.
|
|
9
|
-
from flock.core.
|
|
10
|
-
from flock.core.
|
|
11
|
-
from flock.core.
|
|
12
|
-
from flock.core.logging import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
The
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
agent
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if handoff_data.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
else:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
agent
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
1
|
+
"""Defines Temporal activities for running a chain of agents."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from temporalio import activity
|
|
6
|
+
|
|
7
|
+
from flock.core.context.context import FlockContext
|
|
8
|
+
from flock.core.context.context_vars import FLOCK_CURRENT_AGENT
|
|
9
|
+
from flock.core.flock_agent import FlockAgent, HandoffBase
|
|
10
|
+
from flock.core.logging.formatters.base_formatter import FormatterOptions
|
|
11
|
+
from flock.core.logging.formatters.formatter_factory import FormatterFactory
|
|
12
|
+
from flock.core.logging.logging import get_logger
|
|
13
|
+
from flock.core.registry.agent_registry import Registry
|
|
14
|
+
from flock.core.util.input_resolver import resolve_inputs
|
|
15
|
+
|
|
16
|
+
logger = get_logger("activities")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@activity.defn
|
|
20
|
+
async def run_agent(
|
|
21
|
+
context: FlockContext, output_formatter: FormatterOptions = None
|
|
22
|
+
) -> dict:
|
|
23
|
+
"""Runs a chain of agents using the provided context.
|
|
24
|
+
|
|
25
|
+
The context contains:
|
|
26
|
+
- A state (e.g., "init_input", "current_agent", etc.),
|
|
27
|
+
- A history of agent runs.
|
|
28
|
+
|
|
29
|
+
Each agent uses the current value of the variable specified in its `input` attribute.
|
|
30
|
+
After each run, its output is merged into the context state.
|
|
31
|
+
The default handoff behavior is to fetch the next agent's input automatically from the context.
|
|
32
|
+
"""
|
|
33
|
+
registry = Registry()
|
|
34
|
+
previous_agent_name = ""
|
|
35
|
+
current_agent_name = context.get_variable(FLOCK_CURRENT_AGENT)
|
|
36
|
+
handoff_data: HandoffBase = None
|
|
37
|
+
|
|
38
|
+
logger.info("Starting agent chain", initial_agent=current_agent_name)
|
|
39
|
+
|
|
40
|
+
agent = registry.get_agent(current_agent_name)
|
|
41
|
+
if not agent:
|
|
42
|
+
logger.error("Agent not found", agent=current_agent_name)
|
|
43
|
+
return {"error": f"Agent '{current_agent_name}' not found."}
|
|
44
|
+
|
|
45
|
+
while agent:
|
|
46
|
+
# Get the inputs for the agent
|
|
47
|
+
|
|
48
|
+
agent_inputs = resolve_inputs(agent.input, context, previous_agent_name)
|
|
49
|
+
|
|
50
|
+
# Execute the agent
|
|
51
|
+
logger.info("Executing agent")
|
|
52
|
+
result = await agent.run(agent_inputs)
|
|
53
|
+
logger.debug("Agent execution completed")
|
|
54
|
+
|
|
55
|
+
if output_formatter:
|
|
56
|
+
formatter = FormatterFactory.create_formatter(output_formatter)
|
|
57
|
+
formatter.display(
|
|
58
|
+
result, agent.name, output_formatter.wait_for_input
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# If no handoff is defined, return the result
|
|
62
|
+
if not agent.hand_off:
|
|
63
|
+
context.record(
|
|
64
|
+
agent.name,
|
|
65
|
+
result,
|
|
66
|
+
timestamp=datetime.now(),
|
|
67
|
+
hand_off=None,
|
|
68
|
+
called_from=previous_agent_name,
|
|
69
|
+
)
|
|
70
|
+
logger.info("No handoff defined, completing chain")
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
# Determine the next agent
|
|
74
|
+
handoff_data = HandoffBase()
|
|
75
|
+
if callable(agent.hand_off):
|
|
76
|
+
logger.debug("Executing handoff function")
|
|
77
|
+
handoff_data = agent.hand_off(context, result)
|
|
78
|
+
if isinstance(handoff_data.next_agent, FlockAgent):
|
|
79
|
+
handoff_data.next_agent = handoff_data.next_agent.name
|
|
80
|
+
|
|
81
|
+
elif isinstance(agent.hand_off, str | FlockAgent):
|
|
82
|
+
handoff_data.next_agent = (
|
|
83
|
+
agent.hand_off
|
|
84
|
+
if isinstance(agent.hand_off, str)
|
|
85
|
+
else agent.hand_off.name
|
|
86
|
+
)
|
|
87
|
+
else:
|
|
88
|
+
logger.error("Unsupported hand_off type")
|
|
89
|
+
return {"error": "Unsupported hand_off type."}
|
|
90
|
+
|
|
91
|
+
context.record(
|
|
92
|
+
agent.name,
|
|
93
|
+
result,
|
|
94
|
+
timestamp=datetime.now().isoformat(),
|
|
95
|
+
hand_off=handoff_data,
|
|
96
|
+
called_from=previous_agent_name,
|
|
97
|
+
)
|
|
98
|
+
previous_agent_name = agent.name
|
|
99
|
+
|
|
100
|
+
# Update the current agent and prepare the next input automatically
|
|
101
|
+
try:
|
|
102
|
+
agent = registry.get_agent(handoff_data.next_agent)
|
|
103
|
+
if not agent:
|
|
104
|
+
logger.error(
|
|
105
|
+
"Next agent not found", agent=handoff_data.next_agent
|
|
106
|
+
)
|
|
107
|
+
return {
|
|
108
|
+
"error": f"Next agent '{handoff_data.next_agent}' not found."
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
context.set_variable(FLOCK_CURRENT_AGENT, agent.name)
|
|
112
|
+
logger.info("Handing off to next agent", next=agent.name)
|
|
113
|
+
except Exception as e:
|
|
114
|
+
logger.error("Error during handoff", error=e)
|
|
115
|
+
return {"error": f"Error during handoff: {e}"}
|
|
116
|
+
|
|
117
|
+
return context.get_variable("init_input")
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
from temporalio import activity
|
|
2
|
-
|
|
3
|
-
from flock.
|
|
4
|
-
from flock.core.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@activity.defn
|
|
8
|
-
async def run_declarative_agent_activity(params: dict) -> dict:
|
|
9
|
-
"""Temporal activity to run a declarative (or batch) agent.
|
|
10
|
-
|
|
11
|
-
Expects a dictionary with:
|
|
12
|
-
- "agent_data": a dict representation of the agent (as produced by .dict()),
|
|
13
|
-
- "context_data": a dict containing the FlockContext state and optionally other fields.
|
|
14
|
-
|
|
15
|
-
The activity reconstructs the agent and a FlockContext, then calls the agent’s _evaluate() method.
|
|
16
|
-
"""
|
|
17
|
-
agent_data = params.get("agent_data")
|
|
18
|
-
context_data = params.get("context_data", {})
|
|
19
|
-
# Reconstruct the agent from its serialized representation.
|
|
20
|
-
agent =
|
|
21
|
-
# Reconstruct the FlockContext from the state.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
result = await agent._evaluate(context)
|
|
26
|
-
return result
|
|
1
|
+
from temporalio import activity
|
|
2
|
+
|
|
3
|
+
from flock.core.context.context import FlockContext
|
|
4
|
+
from flock.core.flock_agent import FlockAgent
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@activity.defn
|
|
8
|
+
async def run_declarative_agent_activity(params: dict) -> dict:
|
|
9
|
+
"""Temporal activity to run a declarative (or batch) agent.
|
|
10
|
+
|
|
11
|
+
Expects a dictionary with:
|
|
12
|
+
- "agent_data": a dict representation of the agent (as produced by .dict()),
|
|
13
|
+
- "context_data": a dict containing the FlockContext state and optionally other fields.
|
|
14
|
+
|
|
15
|
+
The activity reconstructs the agent and a FlockContext, then calls the agent’s _evaluate() method.
|
|
16
|
+
"""
|
|
17
|
+
agent_data = params.get("agent_data")
|
|
18
|
+
context_data = params.get("context_data", {})
|
|
19
|
+
# Reconstruct the agent from its serialized representation.
|
|
20
|
+
agent = FlockAgent.from_dict(agent_data)
|
|
21
|
+
# Reconstruct the FlockContext from the state.
|
|
22
|
+
context = FlockContext.from_dict(context_data)
|
|
23
|
+
result = await agent.evaluate(context)
|
|
24
|
+
return result
|