flock-core 0.1.2__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.2.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.2.dist-info/METADATA +0 -476
- flock_core-0.1.2.dist-info/RECORD +0 -48
- flock_core-0.1.2.dist-info/entry_points.txt +0 -2
- /flock/{core/config/declarative_agent_config.py → workflow/__init__.py} +0 -0
- {flock_core-0.1.2.dist-info → flock_core-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from fasthtml.common import *
|
|
2
|
-
from fasthtml.svg import *
|
|
3
|
-
from monsterui.all import *
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def AgentWorkflowChart():
|
|
7
|
-
return Div(
|
|
8
|
-
Div(
|
|
9
|
-
style="max-width:100%;border:1px solid transparent;",
|
|
10
|
-
data_mxgraph='{"highlight":"#0000ff","nav":true,"resize":true,"page":1,"toolbar":"pages zoom layers tags lightbox","edit":"_blank","xml":"<mxfile><diagram id=\\"l7_B5a2V6sOU66k4eApJ\\" name=\\"Core Architecture\\"><mxGraphModel dx=\\"1139\\" dy=\\"934\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#FFFFFF\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"3\\" value=\\"graph TB subgraph User Application UA[User Code] --> |Uses| SM[Flock Manager] end subgraph Flock Core SM --> |Manages| AR[Agent Registry] SM --> |Executes| WF[Workflow System] subgraph Agents AR --> |Registers| DA[Declarative Agent] DA --> |Uses| TS[Type System] DA --> |Uses| TM[Tool Manager] end subgraph Workflow WF --> |Runs| AC[Activities] WF --> |Uses| TW[Temporal Worker] AC --> |Executes| DA end end subgraph External Systems TW --> |Connects to| TS1[Temporal Server] TM --> |Integrates| T1[Web Search] TM --> |Integrates| T2[Code Eval] TM --> |Integrates| T3[Math Tools] DA --> |Uses| LLM[LLM Provider] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef external fill:#bbf,stroke:#333,stroke-width:2px classDef user fill:#bfb,stroke:#333,stroke-width:2px class SM,AR,DA,WF,AC,TM,TS core class TS1,T1,T2,T3,LLM external class UA user \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;rounded=1;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"200\\" y=\\"310\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"m33Os__FMXyp1zJ4IDTH\\" name=\\"Agent Workflow\\"><mxGraphModel dx=\\"1139\\" dy=\\"934\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"Yf0mmGmI6B4_u023lZ5C-1\\" value=\\"sequenceDiagram participant User participant Flock participant Agent participant Tools participant LLM participant Temporal User->>Flock: Create Agent Flock->>Agent: Initialize User->>Flock: activate(agent, input) alt Local Debug Mode Flock->>Agent: Execute Directly else Production Mode Flock->>Temporal: Start Workflow Temporal->>Agent: Execute via Activity end loop Agent Execution Agent->>LLM: Process Input opt Tool Usage Agent->>Tools: Execute Tool Tools-->>Agent: Tool Result end Agent->>LLM: Generate Output end alt Has Hand-off Agent->>Flock: Hand off to Next Agent Flock->>Agent: Start Next Agent else No Hand-off Agent-->>Flock: Return Result end Flock-->>User: Return Final Result\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"275\\" y=\\"114\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"zsmzvY-bLYlccnSXdfzv\\" name=\\"Temporal Workflow\\">\\n <mxGraphModel dx=\\"205\\" dy=\\"165\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"LGo0nXY-PDX6Si-UCiUW-1\\" value=\\"graph TB subgraph Temporal Integration WF[Workflow System] --> |Manages| TW[Temporal Worker] TW --> |Executes| AC[Activities] TW --> |Connects to| TS[Temporal Server] subgraph State Management TS --> |Manages| WS[Workflow State] WS --> |Tracks| AS[Agent State] WS --> |Tracks| TS1[Tool State] WS --> |Tracks| ES[Error State] end subgraph Reliability Features TS --> |Provides| R1[Automatic Retries] TS --> |Provides| R2[Error Recovery] TS --> |Provides| R3[State Persistence] TS --> |Provides| R4[Workflow History] end subgraph Monitoring TS --> |Enables| M1[Execution Metrics] TS --> |Enables| M2[Error Tracking] TS --> |Enables| M3[Performance Stats] TS --> |Enables| M4[Workflow Visualization] end end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef state fill:#bbf,stroke:#333,stroke-width:2px classDef feature fill:#bfb,stroke:#333,stroke-width:2px classDef monitor fill:#fbb,stroke:#333,stroke-width:2px class WF,TW,AC,TS core class WS,AS,TS1,ES state class R1,R2,R3,R4 feature class M1,M2,M3,M4 monitor \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram><diagram id=\\"FU8wRJNSLGF58lYnAYQQ\\" name=\\"Tool System\\">\\n <mxGraphModel dx=\\"307\\" dy=\\"248\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"T-pgXY2fyKOihok5m5tA-1\\" value=\\"graph TB subgraph Tool Management TM[Tool Manager] --> |Manages| TR[Tool Registry] TR --> |Registers| T1[Web Search Tool] TR --> |Registers| T2[Code Eval Tool] TR --> |Registers| T3[Math Tool] TM --> |Provides| TI[Tool Interface] TI --> |Used by| DA[Declarative Agent] end subgraph Tool Execution T1 --> |Uses| WS[Web Search API] T2 --> |Uses| CE[Code Executor] T3 --> |Uses| ME[Math Engine] WS --> |Returns| R1[Search Results] CE --> |Returns| R2[Execution Results] ME --> |Returns| R3[Math Results] end subgraph Error Handling TM --> |Manages| EH[Error Handler] EH --> |Handles| E1[API Errors] EH --> |Handles| E2[Execution Errors] EH --> |Handles| E3[Validation Errors] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef tool fill:#bbf,stroke:#333,stroke-width:2px classDef handler fill:#bfb,stroke:#333,stroke-width:2px class TM,TR,TI core class T1,T2,T3,WS,CE,ME tool class EH,E1,E2,E3 handler\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"240\\" y=\\"170\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram><diagram id=\\"44PLLl0pgulDx2n2xTWC\\" name=\\"Type System\\">\\n <mxGraphModel dx=\\"767\\" dy=\\"620\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"jTONh3Pudjw2xIwc2DDu-1\\" value=\\"classDiagram class TypeSystem { +register_type(name, validator, serializer) +validate(value, type_def) +parse_type_string(type_str) -_validate_complex_type(value, type_def) } class TypeDefinition { +name: str +validators: List +serializers: Optional +validate(value) +serialize(value) } class DeclarativeAgent { +input: str +output: str +tools: List +validate_input(value) +validate_output(value) } class Validator { +validate(value) +coerce(value) } TypeSystem --> TypeDefinition : manages DeclarativeAgent --> TypeSystem : uses TypeDefinition --> Validator : uses \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram></mxfile>"}',
|
|
11
|
-
cls="mxgraph",
|
|
12
|
-
),
|
|
13
|
-
Script(type="text/javascript", src="https://viewer.diagrams.net/js/viewer-static.min.js"),
|
|
14
|
-
)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from fasthtml.common import *
|
|
2
|
-
from fasthtml.svg import *
|
|
3
|
-
from monsterui.all import *
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def CoreArchitectureChart():
|
|
7
|
-
return Div(
|
|
8
|
-
Div(
|
|
9
|
-
style="max-width:100%;border:1px solid transparent;",
|
|
10
|
-
data_mxgraph='{"highlight":"#0000ff","nav":true,"resize":true,"page":0,"toolbar":"pages zoom layers tags lightbox","edit":"_blank","xml":"<mxfile><diagram id=\\"l7_B5a2V6sOU66k4eApJ\\" name=\\"Core Architecture\\"><mxGraphModel dx=\\"1139\\" dy=\\"934\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#FFFFFF\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"3\\" value=\\"graph TB subgraph User Application UA[User Code] --> |Uses| SM[Flock Manager] end subgraph Flock Core SM --> |Manages| AR[Agent Registry] SM --> |Executes| WF[Workflow System] subgraph Agents AR --> |Registers| DA[Declarative Agent] DA --> |Uses| TS[Type System] DA --> |Uses| TM[Tool Manager] end subgraph Workflow WF --> |Runs| AC[Activities] WF --> |Uses| TW[Temporal Worker] AC --> |Executes| DA end end subgraph External Systems TW --> |Connects to| TS1[Temporal Server] TM --> |Integrates| T1[Web Search] TM --> |Integrates| T2[Code Eval] TM --> |Integrates| T3[Math Tools] DA --> |Uses| LLM[LLM Provider] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef external fill:#bbf,stroke:#333,stroke-width:2px classDef user fill:#bfb,stroke:#333,stroke-width:2px class SM,AR,DA,WF,AC,TM,TS core class TS1,T1,T2,T3,LLM external class UA user \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;rounded=1;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"200\\" y=\\"310\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"m33Os__FMXyp1zJ4IDTH\\" name=\\"Agent Workflow\\"><mxGraphModel dx=\\"1139\\" dy=\\"934\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"Yf0mmGmI6B4_u023lZ5C-1\\" value=\\"sequenceDiagram participant User participant Flock participant Agent participant Tools participant LLM participant Temporal User->>Flock: Create Agent Flock->>Agent: Initialize User->>Flock: activate(agent, input) alt Local Debug Mode Flock->>Agent: Execute Directly else Production Mode Flock->>Temporal: Start Workflow Temporal->>Agent: Execute via Activity end loop Agent Execution Agent->>LLM: Process Input opt Tool Usage Agent->>Tools: Execute Tool Tools-->>Agent: Tool Result end Agent->>LLM: Generate Output end alt Has Hand-off Agent->>Flock: Hand off to Next Agent Flock->>Agent: Start Next Agent else No Hand-off Agent-->>Flock: Return Result end Flock-->>User: Return Final Result\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"275\\" y=\\"114\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"zsmzvY-bLYlccnSXdfzv\\" name=\\"Temporal Workflow\\">\\n <mxGraphModel dx=\\"205\\" dy=\\"165\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"LGo0nXY-PDX6Si-UCiUW-1\\" value=\\"graph TB subgraph Temporal Integration WF[Workflow System] --> |Manages| TW[Temporal Worker] TW --> |Executes| AC[Activities] TW --> |Connects to| TS[Temporal Server] subgraph State Management TS --> |Manages| WS[Workflow State] WS --> |Tracks| AS[Agent State] WS --> |Tracks| TS1[Tool State] WS --> |Tracks| ES[Error State] end subgraph Reliability Features TS --> |Provides| R1[Automatic Retries] TS --> |Provides| R2[Error Recovery] TS --> |Provides| R3[State Persistence] TS --> |Provides| R4[Workflow History] end subgraph Monitoring TS --> |Enables| M1[Execution Metrics] TS --> |Enables| M2[Error Tracking] TS --> |Enables| M3[Performance Stats] TS --> |Enables| M4[Workflow Visualization] end end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef state fill:#bbf,stroke:#333,stroke-width:2px classDef feature fill:#bfb,stroke:#333,stroke-width:2px classDef monitor fill:#fbb,stroke:#333,stroke-width:2px class WF,TW,AC,TS core class WS,AS,TS1,ES state class R1,R2,R3,R4 feature class M1,M2,M3,M4 monitor \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram><diagram id=\\"FU8wRJNSLGF58lYnAYQQ\\" name=\\"Tool System\\">\\n <mxGraphModel dx=\\"307\\" dy=\\"248\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"T-pgXY2fyKOihok5m5tA-1\\" value=\\"graph TB subgraph Tool Management TM[Tool Manager] --> |Manages| TR[Tool Registry] TR --> |Registers| T1[Web Search Tool] TR --> |Registers| T2[Code Eval Tool] TR --> |Registers| T3[Math Tool] TM --> |Provides| TI[Tool Interface] TI --> |Used by| DA[Declarative Agent] end subgraph Tool Execution T1 --> |Uses| WS[Web Search API] T2 --> |Uses| CE[Code Executor] T3 --> |Uses| ME[Math Engine] WS --> |Returns| R1[Search Results] CE --> |Returns| R2[Execution Results] ME --> |Returns| R3[Math Results] end subgraph Error Handling TM --> |Manages| EH[Error Handler] EH --> |Handles| E1[API Errors] EH --> |Handles| E2[Execution Errors] EH --> |Handles| E3[Validation Errors] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef tool fill:#bbf,stroke:#333,stroke-width:2px classDef handler fill:#bfb,stroke:#333,stroke-width:2px class TM,TR,TI core class T1,T2,T3,WS,CE,ME tool class EH,E1,E2,E3 handler\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"240\\" y=\\"170\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram><diagram id=\\"44PLLl0pgulDx2n2xTWC\\" name=\\"Type System\\">\\n <mxGraphModel dx=\\"767\\" dy=\\"620\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\">\\n <root>\\n <mxCell id=\\"0\\"/>\\n <mxCell id=\\"1\\" parent=\\"0\\"/>\\n <mxCell id=\\"jTONh3Pudjw2xIwc2DDu-1\\" value=\\"classDiagram class TypeSystem { +register_type(name, validator, serializer) +validate(value, type_def) +parse_type_string(type_str) -_validate_complex_type(value, type_def) } class TypeDefinition { +name: str +validators: List +serializers: Optional +validate(value) +serialize(value) } class DeclarativeAgent { +input: str +output: str +tools: List +validate_input(value) +validate_output(value) } class Validator { +validate(value) +coerce(value) } TypeSystem --> TypeDefinition : manages DeclarativeAgent --> TypeSystem : uses TypeDefinition --> Validator : uses \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" vertex=\\"1\\" parent=\\"1\\">\\n <mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/>\\n </mxCell>\\n </root>\\n </mxGraphModel>\\n </diagram></mxfile>"}',
|
|
11
|
-
cls="mxgraph",
|
|
12
|
-
),
|
|
13
|
-
Script(type="text/javascript", src="https://viewer.diagrams.net/js/viewer-static.min.js"),
|
|
14
|
-
)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from fasthtml.common import *
|
|
2
|
-
from fasthtml.svg import *
|
|
3
|
-
from monsterui.all import *
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def ToolSystemChart():
|
|
7
|
-
return Div(
|
|
8
|
-
Div(
|
|
9
|
-
style="max-width:100%;border:1px solid transparent;",
|
|
10
|
-
data_mxgraph='{"highlight":"#0000ff","nav":true,"resize":true,"page":3,"toolbar":"pages zoom layers tags lightbox","edit":"_blank","xml":"<mxfile><diagram id=\\"l7_B5a2V6sOU66k4eApJ\\" name=\\"Core Architecture\\"><mxGraphModel dx=\\"380\\" dy=\\"311\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#FFFFFF\\" math=\\"0\\" shadow=\\"0\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"3\\" value=\\"graph TB subgraph User Application UA[User Code] --> |Uses| SM[Flock Manager] end subgraph Flock Core SM --> |Manages| AR[Agent Registry] SM --> |Executes| WF[Workflow System] subgraph Agents AR --> |Registers| DA[Declarative Agent] DA --> |Uses| TS[Type System] DA --> |Uses| TM[Tool Manager] end subgraph Workflow WF --> |Runs| AC[Activities] WF --> |Uses| TW[Temporal Worker] AC --> |Executes| DA end end subgraph External Systems TW --> |Connects to| TS1[Temporal Server] TM --> |Integrates| T1[Web Search] TM --> |Integrates| T2[Code Eval] TM --> |Integrates| T3[Math Tools] DA --> |Uses| LLM[LLM Provider] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef external fill:#bbf,stroke:#333,stroke-width:2px classDef user fill:#bfb,stroke:#333,stroke-width:2px class SM,AR,DA,WF,AC,TM,TS core class TS1,T1,T2,T3,LLM external class UA user \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;rounded=1;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"200\\" y=\\"310\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"m33Os__FMXyp1zJ4IDTH\\" name=\\"Agent Workflow\\"><mxGraphModel dx=\\"316\\" dy=\\"259\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"0\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"Yf0mmGmI6B4_u023lZ5C-1\\" value=\\"sequenceDiagram participant User participant Flock participant Agent participant Tools participant LLM participant Temporal User->>Flock: Create Agent Flock->>Agent: Initialize User->>Flock: activate(agent, input) alt Local Debug Mode Flock->>Agent: Execute Directly else Production Mode Flock->>Temporal: Start Workflow Temporal->>Agent: Execute via Activity end loop Agent Execution Agent->>LLM: Process Input opt Tool Usage Agent->>Tools: Execute Tool Tools-->>Agent: Tool Result end Agent->>LLM: Generate Output end alt Has Hand-off Agent->>Flock: Hand off to Next Agent Flock->>Agent: Start Next Agent else No Hand-off Agent-->>Flock: Return Result end Flock-->>User: Return Final Result\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"275\\" y=\\"114\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"zsmzvY-bLYlccnSXdfzv\\" name=\\"Temporal Workflow\\"><mxGraphModel dx=\\"1139\\" dy=\\"934\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"LGo0nXY-PDX6Si-UCiUW-1\\" value=\\"graph TB subgraph Temporal Integration WF[Workflow System] --> |Manages| TW[Temporal Worker] TW --> |Executes| AC[Activities] TW --> |Connects to| TS[Temporal Server] subgraph State Management TS --> |Manages| WS[Workflow State] WS --> |Tracks| AS[Agent State] WS --> |Tracks| TS1[Tool State] WS --> |Tracks| ES[Error State] end subgraph Reliability Features TS --> |Provides| R1[Automatic Retries] TS --> |Provides| R2[Error Recovery] TS --> |Provides| R3[State Persistence] TS --> |Provides| R4[Workflow History] end subgraph Monitoring TS --> |Enables| M1[Execution Metrics] TS --> |Enables| M2[Error Tracking] TS --> |Enables| M3[Performance Stats] TS --> |Enables| M4[Workflow Visualization] end end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef state fill:#bbf,stroke:#333,stroke-width:2px classDef feature fill:#bfb,stroke:#333,stroke-width:2px classDef monitor fill:#fbb,stroke:#333,stroke-width:2px class WF,TW,AC,TS core class WS,AS,TS1,ES state class R1,R2,R3,R4 feature class M1,M2,M3,M4 monitor \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"FU8wRJNSLGF58lYnAYQQ\\" name=\\"Tool System\\"><mxGraphModel dx=\\"316\\" dy=\\"259\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"0\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"T-pgXY2fyKOihok5m5tA-1\\" value=\\"graph TB subgraph Tool Management TM[Tool Manager] --> |Manages| TR[Tool Registry] TR --> |Registers| T1[Web Search Tool] TR --> |Registers| T2[Code Eval Tool] TR --> |Registers| T3[Math Tool] TM --> |Provides| TI[Tool Interface] TI --> |Used by| DA[Declarative Agent] end subgraph Tool Execution T1 --> |Uses| WS[Web Search API] T2 --> |Uses| CE[Code Executor] T3 --> |Uses| ME[Math Engine] WS --> |Returns| R1[Search Results] CE --> |Returns| R2[Execution Results] ME --> |Returns| R3[Math Results] end subgraph Error Handling TM --> |Manages| EH[Error Handler] EH --> |Handles| E1[API Errors] EH --> |Handles| E2[Execution Errors] EH --> |Handles| E3[Validation Errors] end classDef core fill:#f9f,stroke:#333,stroke-width:2px classDef tool fill:#bbf,stroke:#333,stroke-width:2px classDef handler fill:#bfb,stroke:#333,stroke-width:2px class TM,TR,TI core class T1,T2,T3,WS,CE,ME tool class EH,E1,E2,E3 handler\\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"224\\" y=\\"232\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram><diagram id=\\"44PLLl0pgulDx2n2xTWC\\" name=\\"Type System\\"><mxGraphModel dx=\\"380\\" dy=\\"311\\" grid=\\"0\\" gridSize=\\"10\\" guides=\\"1\\" tooltips=\\"1\\" connect=\\"1\\" arrows=\\"1\\" fold=\\"1\\" page=\\"1\\" pageScale=\\"1\\" pageWidth=\\"850\\" pageHeight=\\"1100\\" background=\\"#ffffff\\" math=\\"0\\" shadow=\\"1\\"><root><mxCell id=\\"0\\"/><mxCell id=\\"1\\" parent=\\"0\\"/><mxCell id=\\"jTONh3Pudjw2xIwc2DDu-1\\" value=\\"classDiagram class TypeSystem { +register_type(name, validator, serializer) +validate(value, type_def) +parse_type_string(type_str) -_validate_complex_type(value, type_def) } class TypeDefinition { +name: str +validators: List +serializers: Optional +validate(value) +serialize(value) } class DeclarativeAgent { +input: str +output: str +tools: List +validate_input(value) +validate_output(value) } class Validator { +validate(value) +coerce(value) } TypeSystem --> TypeDefinition : manages DeclarativeAgent --> TypeSystem : uses TypeDefinition --> Validator : uses \\" style=\\"shadow=0;dashed=0;align=left;strokeWidth=1;shape=mxgraph.mermaid.abstract.mermaid;labelBackgroundColor=#ffffff;noLabel=1;theme=default;\\" parent=\\"1\\" vertex=\\"1\\"><mxGeometry x=\\"242\\" y=\\"169\\" width=\\"300\\" height=\\"300\\" as=\\"geometry\\"/></mxCell></root></mxGraphModel></diagram></mxfile>"}',
|
|
11
|
-
cls="mxgraph",
|
|
12
|
-
),
|
|
13
|
-
Script(type="text/javascript", src="https://viewer.diagrams.net/js/viewer-static.min.js"),
|
|
14
|
-
)
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"""Agent History Explorer built with MonsterUI"""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
|
|
6
|
-
from fasthtml.common import *
|
|
7
|
-
from monsterui.all import *
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def load_history(page=1, per_page=10, search=None):
|
|
11
|
-
with open("data/history.json") as f:
|
|
12
|
-
data = json.load(f)
|
|
13
|
-
|
|
14
|
-
if search:
|
|
15
|
-
search = search.lower()
|
|
16
|
-
data = [
|
|
17
|
-
d
|
|
18
|
-
for d in data
|
|
19
|
-
if search in d["agent_name"].lower() or search in d["location"].lower() or search in d["date"].lower()
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
total = len(data)
|
|
23
|
-
pages = (total + per_page - 1) // per_page
|
|
24
|
-
start = (page - 1) * per_page
|
|
25
|
-
return {"data": data[start : start + per_page], "total": total, "pages": pages, "page": page}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def format_date(iso_date):
|
|
29
|
-
return datetime.fromisoformat(iso_date).strftime("%b %d, %Y %H:%M")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def json_preview(value):
|
|
33
|
-
return Pre(json.dumps(value, indent=2), cls="text-xs p-2 bg-muted rounded-md max-h-40 overflow-auto")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def header_render(col):
|
|
37
|
-
return Th(col, cls="p-2 text-left")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def cell_render(col, val):
|
|
41
|
-
"""Modified cell renderer that only uses column value"""
|
|
42
|
-
match col:
|
|
43
|
-
case "Agent":
|
|
44
|
-
return Td(cls="p-2 font-medium")(Div(val))
|
|
45
|
-
case "Date":
|
|
46
|
-
return Td(cls="p-2 text-sm")(format_date(val))
|
|
47
|
-
case "Location":
|
|
48
|
-
return Td(cls="p-2 capitalize")(val) # val is already location string
|
|
49
|
-
case "Input" | "Output":
|
|
50
|
-
return Td(cls="p-2")(json_preview(val))
|
|
51
|
-
case "Details":
|
|
52
|
-
# val contains the full record here
|
|
53
|
-
return Td(cls="p-2")(Button("View", cls=ButtonT.primary, uk_toggle=f"target: #details-{val['agent_id']}"))
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def details_modal(record):
|
|
57
|
-
return Modal(
|
|
58
|
-
Div(cls="p-6 space-y-4")(
|
|
59
|
-
ModalTitle(f"{record['agent_name']} - {format_date(record['date'])}"),
|
|
60
|
-
Grid(
|
|
61
|
-
Div(cls="space-y-2")(H4("Input Details", cls="text-sm font-medium"), json_preview(record["input"])),
|
|
62
|
-
Div(cls="space-y-2")(H4("Output Details", cls="text-sm font-medium"), json_preview(record["output"])),
|
|
63
|
-
),
|
|
64
|
-
DivRAligned(ModalCloseButton("Close", cls=ButtonT.ghost)),
|
|
65
|
-
),
|
|
66
|
-
id=f"details-{record['agent_id']}",
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def get_history(page: int = 1, per_page: int = 5, search: str = None, reduced=False):
|
|
71
|
-
history = load_history(page, per_page, search)
|
|
72
|
-
|
|
73
|
-
controls = DivFullySpaced(cls="mt-8")(
|
|
74
|
-
Div(cls="flex gap-4 items-center")(
|
|
75
|
-
Input(
|
|
76
|
-
placeholder="Search agents...",
|
|
77
|
-
value=search,
|
|
78
|
-
name="search",
|
|
79
|
-
hx_get="/history",
|
|
80
|
-
hx_trigger="keyup changed delay:500ms",
|
|
81
|
-
hx_target="#history-content",
|
|
82
|
-
hx_include="[name='per_page']",
|
|
83
|
-
cls="w-64",
|
|
84
|
-
),
|
|
85
|
-
Select(
|
|
86
|
-
Option("5", value="5"),
|
|
87
|
-
Option("10", value="10"),
|
|
88
|
-
Option("20", value="20"),
|
|
89
|
-
name="per_page",
|
|
90
|
-
value=str(per_page),
|
|
91
|
-
hx_get="/history",
|
|
92
|
-
hx_trigger="change",
|
|
93
|
-
hx_target="#history-content",
|
|
94
|
-
cls="w-24",
|
|
95
|
-
),
|
|
96
|
-
)
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
if reduced:
|
|
100
|
-
header_data = ["Agent", "Date", "Details"]
|
|
101
|
-
bodydata = [
|
|
102
|
-
{
|
|
103
|
-
"Agent": d["agent_name"],
|
|
104
|
-
"Date": d["date"],
|
|
105
|
-
"Details": d, # Store full record here
|
|
106
|
-
}
|
|
107
|
-
for d in history["data"]
|
|
108
|
-
]
|
|
109
|
-
else:
|
|
110
|
-
header_data = ["Agent", "Date", "Input", "Output", "Details"]
|
|
111
|
-
bodydata = [
|
|
112
|
-
{
|
|
113
|
-
"Agent": d["agent_name"],
|
|
114
|
-
"Date": d["date"],
|
|
115
|
-
# "Location": d["input"]["location"], # Pre-extract location
|
|
116
|
-
"Input": d["input"],
|
|
117
|
-
"Output": d["output"],
|
|
118
|
-
"Details": d, # Store full record here
|
|
119
|
-
}
|
|
120
|
-
for d in history["data"]
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
table = TableFromDicts(
|
|
124
|
-
header_data=header_data,
|
|
125
|
-
body_data=bodydata,
|
|
126
|
-
body_cell_render=cell_render,
|
|
127
|
-
header_cell_render=header_render,
|
|
128
|
-
cls=TableT.responsive,
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
footer = DivFullySpaced(cls="mt-4")(
|
|
132
|
-
Div(
|
|
133
|
-
f"Showing {min(history['total'], per_page)} of {history['total']} records",
|
|
134
|
-
cls="text-sm text-muted-foreground",
|
|
135
|
-
),
|
|
136
|
-
Div(cls="flex items-center gap-4")(
|
|
137
|
-
Button(
|
|
138
|
-
"< Prev",
|
|
139
|
-
hx_get=f"/history?page={history['page'] - 1}",
|
|
140
|
-
hx_target="#history-content",
|
|
141
|
-
disabled=history["page"] == 1,
|
|
142
|
-
cls=ButtonT.primary,
|
|
143
|
-
),
|
|
144
|
-
Span(f"Page {history['page']} of {history['pages']}"),
|
|
145
|
-
Button(
|
|
146
|
-
"Next >",
|
|
147
|
-
hx_get=f"/history?page={history['page'] + 1}",
|
|
148
|
-
hx_target="#history-content",
|
|
149
|
-
disabled=history["page"] == history["pages"],
|
|
150
|
-
cls=ButtonT.primary,
|
|
151
|
-
),
|
|
152
|
-
),
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
return Div(id="history-content")(controls, table, footer, *[details_modal(d) for d in history["data"]])
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def HistoryGrid(reduced=False):
|
|
159
|
-
if reduced:
|
|
160
|
-
return get_history(reduced)
|
|
161
|
-
|
|
162
|
-
return Div(cls="flex flex-col")(
|
|
163
|
-
Div(cls="px-4 py-2 ")(
|
|
164
|
-
H3("Agent History Explorer"),
|
|
165
|
-
P("Review historical agent executions and their outcomes", cls=TextFont.muted_sm),
|
|
166
|
-
),
|
|
167
|
-
get_history(reduced),
|
|
168
|
-
)
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"""Agent History Explorer built with MonsterUI"""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
|
|
6
|
-
from fasthtml.common import *
|
|
7
|
-
from monsterui.all import *
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def format_date(iso_date):
|
|
11
|
-
return datetime.fromisoformat(iso_date).strftime("%b %d, %Y %H:%M")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def json_preview(value):
|
|
15
|
-
return Pre(json.dumps(value, indent=2), cls="text-xs p-2 bg-muted rounded-md max-h-40 overflow-auto")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def header_render(col):
|
|
19
|
-
return Th(col, cls="p-2 text-left")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def cell_render(col, val):
|
|
23
|
-
"""Modified cell renderer that only uses column value"""
|
|
24
|
-
match col:
|
|
25
|
-
case "Agent":
|
|
26
|
-
return Td(cls="p-2 font-medium")(Div(val))
|
|
27
|
-
case "Date":
|
|
28
|
-
return Td(cls="p-2 text-sm")(format_date(val))
|
|
29
|
-
case "Location":
|
|
30
|
-
return Td(cls="p-2 capitalize")(val) # val is already location string
|
|
31
|
-
case "Input" | "Output":
|
|
32
|
-
return Td(cls="p-2")(json_preview(val))
|
|
33
|
-
case "Details":
|
|
34
|
-
# val contains the full record here
|
|
35
|
-
return Td(cls="p-2")(Button("View", cls=ButtonT.primary, uk_toggle=f"target: #details-{val['agent_id']}"))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def load_history(page=1, per_page=10, search=None):
|
|
39
|
-
with open("data/history.json") as f:
|
|
40
|
-
data = json.load(f)
|
|
41
|
-
|
|
42
|
-
# Full-text search across all fields
|
|
43
|
-
if search:
|
|
44
|
-
search = search.lower()
|
|
45
|
-
data = [
|
|
46
|
-
d
|
|
47
|
-
for d in data
|
|
48
|
-
if any(search in str(v).lower() for v in d.values())
|
|
49
|
-
or any(search in str(v).lower() for sub in [d["input"], d["output"]] for v in sub.values())
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
total = len(data)
|
|
53
|
-
pages = (total + per_page - 1) // per_page
|
|
54
|
-
start = (page - 1) * per_page
|
|
55
|
-
return {"data": data[start : start + per_page], "total": total, "pages": pages, "page": page}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def json_tree(value, depth=0):
|
|
59
|
-
if isinstance(value, dict):
|
|
60
|
-
return Div(cls=f"ml-{depth * 2} space-y-1")(
|
|
61
|
-
*[Details(Summary(k, cls="inline-flex items-center"), json_tree(v, depth + 1)) for k, v in value.items()]
|
|
62
|
-
)
|
|
63
|
-
elif isinstance(value, list):
|
|
64
|
-
return Div(cls=f"ml-{depth * 2} space-y-1")(
|
|
65
|
-
*[
|
|
66
|
-
Div(cls="flex items-center gap-2")(Span("•", cls="text-muted-foreground"), json_tree(item, depth + 1))
|
|
67
|
-
for item in value
|
|
68
|
-
]
|
|
69
|
-
)
|
|
70
|
-
return Span(str(value), cls="text-muted-foreground")
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def render_cell(col, val):
|
|
74
|
-
match col:
|
|
75
|
-
case "date":
|
|
76
|
-
return datetime.fromisoformat(val).strftime("%b %d, %Y %H:%M")
|
|
77
|
-
case "input" | "output":
|
|
78
|
-
return Div(cls="max-w-[300px] overflow-auto p-2 bg-muted rounded-md")(json_tree(val))
|
|
79
|
-
case "_expand":
|
|
80
|
-
return Button("Expand", cls=ButtonT.primary, uk_toggle=f"target: #details-{val['agent_id']}")
|
|
81
|
-
case _:
|
|
82
|
-
return val if isinstance(val, str) else json.dumps(val, default=str)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def details_modal(record):
|
|
86
|
-
return Modal(
|
|
87
|
-
Div(cls="p-6 space-y-4")(
|
|
88
|
-
ModalTitle(f"Agent Execution Details - {record['agent_id']}"),
|
|
89
|
-
Div(cls="space-y-4")(
|
|
90
|
-
Div(cls="grid grid-cols-2 gap-4")(
|
|
91
|
-
Div(cls="space-y-2")(H4("Input", cls="text-sm font-medium"), json_tree(record["input"])),
|
|
92
|
-
Div(cls="space-y-2")(H4("Output", cls="text-sm font-medium"), json_tree(record["output"])),
|
|
93
|
-
),
|
|
94
|
-
Div(cls="space-y-2")(
|
|
95
|
-
H4("Metadata", cls="text-sm font-medium"),
|
|
96
|
-
json_tree({k: v for k, v in record.items() if k not in ["input", "output"]}),
|
|
97
|
-
),
|
|
98
|
-
),
|
|
99
|
-
DivRAligned(ModalCloseButton("Close", cls=ButtonT.ghost)),
|
|
100
|
-
),
|
|
101
|
-
id=f"details-{record['agent_id']}",
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def Pagination(current_page, total_pages, hx_get, hx_target):
|
|
106
|
-
return Div(cls="flex items-center gap-2")(
|
|
107
|
-
Button(
|
|
108
|
-
"Previous",
|
|
109
|
-
disabled=current_page == 1,
|
|
110
|
-
hx_get=f"{hx_get}?page={current_page - 1}",
|
|
111
|
-
hx_target=hx_target,
|
|
112
|
-
cls=ButtonT.primary,
|
|
113
|
-
),
|
|
114
|
-
Span(f"Page {current_page} of {total_pages}", cls="text-sm"),
|
|
115
|
-
Button(
|
|
116
|
-
"Next",
|
|
117
|
-
disabled=current_page >= total_pages,
|
|
118
|
-
hx_get=f"{hx_get}?page={current_page + 1}",
|
|
119
|
-
hx_target=hx_target,
|
|
120
|
-
cls=ButtonT.primary,
|
|
121
|
-
),
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def get_history(page: int = 1, per_page: int = 10, search: str = None):
|
|
126
|
-
history = load_history(page, per_page, search)
|
|
127
|
-
|
|
128
|
-
# Dynamic columns from first record (if exists)
|
|
129
|
-
columns = []
|
|
130
|
-
if history["data"]:
|
|
131
|
-
sample = history["data"][0]
|
|
132
|
-
columns = [k for k in sample.keys() if k not in ["input", "output", "agent_id"]]
|
|
133
|
-
columns += ["input", "output", "_expand"]
|
|
134
|
-
|
|
135
|
-
controls = DivFullySpaced(cls="mt-8")(
|
|
136
|
-
Input(
|
|
137
|
-
placeholder="Search history...",
|
|
138
|
-
value=search,
|
|
139
|
-
name="search",
|
|
140
|
-
hx_get="/history",
|
|
141
|
-
hx_trigger="keyup changed delay:500ms",
|
|
142
|
-
hx_target="#history-content",
|
|
143
|
-
hx_include="[name='per_page']",
|
|
144
|
-
cls="w-64",
|
|
145
|
-
),
|
|
146
|
-
Select(
|
|
147
|
-
*[Option(str(n), value=str(n)) for n in [5, 10, 20, 50]],
|
|
148
|
-
name="per_page",
|
|
149
|
-
value=str(per_page),
|
|
150
|
-
hx_get="/history",
|
|
151
|
-
hx_trigger="change",
|
|
152
|
-
hx_target="#history-content",
|
|
153
|
-
cls="w-24",
|
|
154
|
-
),
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
table = TableFromDicts(
|
|
158
|
-
header_data=columns,
|
|
159
|
-
body_data=[{**d, "_expand": d} for d in history["data"]],
|
|
160
|
-
body_cell_render=lambda col, val: Td(render_cell(col, val)),
|
|
161
|
-
header_cell_render=lambda col: Th(col.replace("_", " ").title(), cls="p-2 text-left"),
|
|
162
|
-
cls=f"{TableT.responsive} {TableT.hover}",
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
footer = DivFullySpaced(cls="mt-4")(
|
|
166
|
-
Div(
|
|
167
|
-
f"Showing {(page - 1) * per_page + 1}-{min(page * per_page, history['total'])} of {history['total']} records",
|
|
168
|
-
cls="text-sm text-muted-foreground",
|
|
169
|
-
),
|
|
170
|
-
Pagination(current_page=page, total_pages=history["pages"], hx_get="/history", hx_target="#history-content"),
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
return Div(id="history-content")(
|
|
174
|
-
controls,
|
|
175
|
-
table if history["data"] else P("No records found", cls=TextFont.muted),
|
|
176
|
-
footer,
|
|
177
|
-
*[details_modal(d) for d in history["data"]],
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
def HistoryGrid(reduced=False):
|
|
182
|
-
return Container(
|
|
183
|
-
Div(cls="space-y-4")(
|
|
184
|
-
H1("Agent History Explorer"),
|
|
185
|
-
P("Inspect agent executions with dynamic JSON exploration", cls=TextFont.muted_sm),
|
|
186
|
-
),
|
|
187
|
-
get_history(),
|
|
188
|
-
cls="p-8",
|
|
189
|
-
)
|
flock/app/components/sidebar.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from fasthtml.common import *
|
|
2
|
-
from fasthtml.svg import *
|
|
3
|
-
from monsterui.all import *
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def SidebarLi(icon, title=None, href=None):
|
|
7
|
-
if icon == "---":
|
|
8
|
-
return Li(Hr())
|
|
9
|
-
return Li(
|
|
10
|
-
AX(DivLAligned(Span(UkIcon(icon)), Span(title)), hx_get=href, hx_target="#main-grid", hx_swap="outerHTML")
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def Sidebar(sidebar):
|
|
15
|
-
return NavContainer(
|
|
16
|
-
NavHeaderLi(H1("Flock UI", cls="text-xxl font-semibold")),
|
|
17
|
-
*[SidebarLi(icon, title, href) for icon, title, href in sidebar],
|
|
18
|
-
cls="space-y-6 mt-3",
|
|
19
|
-
)
|
flock/app/components/theme.py
DELETED
flock/app/components/util.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
|
|
3
|
-
from fasthtml.common import *
|
|
4
|
-
from fasthtml.svg import *
|
|
5
|
-
from monsterui.all import *
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def format_date(date_str):
|
|
9
|
-
date_obj = datetime.fromisoformat(date_str)
|
|
10
|
-
return date_obj.strftime("%Y-%m-%d %I:%M %p")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def IconNavItem(*d):
|
|
14
|
-
return [Li(A(UkIcon(o[0], uk_tooltip=o[1]))) for o in d]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def IconNav(*c, cls=""):
|
|
18
|
-
return Ul(cls=f"uk-iconnav {cls}")(*c)
|
flock/app/hive_app.py
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
from fasthtml.common import *
|
|
2
|
-
from fasthtml.svg import *
|
|
3
|
-
from monsterui.all import *
|
|
4
|
-
|
|
5
|
-
from flock.app.components import HistoryGrid, Sidebar
|
|
6
|
-
from flock.app.modules import AgentContent, AgentDetailView, Playground, Settings, agent_data
|
|
7
|
-
from flock.app.modules.about import AboutPage
|
|
8
|
-
|
|
9
|
-
hdrs = Theme.blue.headers()
|
|
10
|
-
|
|
11
|
-
app, rt = fast_app(hdrs=hdrs, live=True)
|
|
12
|
-
|
|
13
|
-
##############################
|
|
14
|
-
# Sidebar
|
|
15
|
-
##############################
|
|
16
|
-
|
|
17
|
-
sidebar = (
|
|
18
|
-
("layout-dashboard", "Dashboard", "/"),
|
|
19
|
-
("---", "", ""),
|
|
20
|
-
("bot", "Agents", "/agents"),
|
|
21
|
-
("server", "Agent Systems", "/systems"),
|
|
22
|
-
("scroll", "History", "/history"),
|
|
23
|
-
("---", "", ""),
|
|
24
|
-
("wrench", "Tools", "/tools"),
|
|
25
|
-
("test-tube", "Playground", "/playground"),
|
|
26
|
-
("---", "", ""),
|
|
27
|
-
("settings", "Settings", "/settings"),
|
|
28
|
-
("info", "About", "/about"),
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
##############################
|
|
33
|
-
# MAIN
|
|
34
|
-
##############################
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@rt
|
|
38
|
-
def index():
|
|
39
|
-
return (
|
|
40
|
-
Title("Flock UI"),
|
|
41
|
-
Container(
|
|
42
|
-
Grid(
|
|
43
|
-
Div(Sidebar(sidebar), cls="col-span-1 w-48 flex"),
|
|
44
|
-
Grid(
|
|
45
|
-
Div(AgentContent(), cls="col-span-2"),
|
|
46
|
-
Div(AgentDetailView(agent_data[0]), cls="col-span-3"),
|
|
47
|
-
cols=5,
|
|
48
|
-
cls="col-span-5",
|
|
49
|
-
id="main-grid",
|
|
50
|
-
),
|
|
51
|
-
cols_sm=2,
|
|
52
|
-
cols_md=2,
|
|
53
|
-
cols_lg=6,
|
|
54
|
-
cols_xl=6,
|
|
55
|
-
gap=5,
|
|
56
|
-
cls="flex-1",
|
|
57
|
-
),
|
|
58
|
-
cls=("flex", ContainerT.xl),
|
|
59
|
-
),
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@rt("/history")
|
|
64
|
-
def get():
|
|
65
|
-
return Grid(
|
|
66
|
-
Div(HistoryGrid(), cls="col-span-5"),
|
|
67
|
-
cols=5,
|
|
68
|
-
cls="col-span-5",
|
|
69
|
-
id="main-grid",
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@rt("/playground")
|
|
74
|
-
def get():
|
|
75
|
-
return Grid(
|
|
76
|
-
Div(Playground(), cls="col-span-5"), # noqa: F405
|
|
77
|
-
cols=5,
|
|
78
|
-
cls="col-span-5",
|
|
79
|
-
id="main-grid",
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
@rt("/settings")
|
|
84
|
-
def get():
|
|
85
|
-
return Grid(
|
|
86
|
-
Div(Settings(), cls="col-span-5"),
|
|
87
|
-
cols=5,
|
|
88
|
-
cls="col-span-5",
|
|
89
|
-
id="main-grid",
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
@rt("/agents")
|
|
94
|
-
def get():
|
|
95
|
-
return Grid(
|
|
96
|
-
Div(AgentContent(), cls="col-span-2"),
|
|
97
|
-
Div(AgentDetailView(agent=agent_data[0]), cls="col-span-3"),
|
|
98
|
-
cols=5,
|
|
99
|
-
cls="col-span-5",
|
|
100
|
-
id="main-grid",
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@rt("/about")
|
|
105
|
-
def get():
|
|
106
|
-
return Grid(
|
|
107
|
-
Div(AboutPage(), cls="col-span-5"),
|
|
108
|
-
cols=5,
|
|
109
|
-
cls="col-span-5",
|
|
110
|
-
id="main-grid",
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
serve()
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def main():
|
|
118
|
-
serve()
|