lightfall 0.1.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.
- lightfall/__init__.py +8 -0
- lightfall/__main__.py +10 -0
- lightfall/_version.py +24 -0
- lightfall/acquire/__init__.py +74 -0
- lightfall/acquire/buffer.py +363 -0
- lightfall/acquire/device_wrapper.py +416 -0
- lightfall/acquire/engine/__init__.py +155 -0
- lightfall/acquire/engine/base.py +587 -0
- lightfall/acquire/engine/bluesky.py +358 -0
- lightfall/acquire/engine/mock.py +165 -0
- lightfall/acquire/engine/plugins/__init__.py +9 -0
- lightfall/acquire/engine/plugins/bluesky_plugin.py +56 -0
- lightfall/acquire/engine/plugins/mock_plugin.py +55 -0
- lightfall/acquire/engine/protocol.py +145 -0
- lightfall/acquire/engine/registry.py +152 -0
- lightfall/acquire/engine/state.py +32 -0
- lightfall/acquire/engine/waiting_hook.py +225 -0
- lightfall/acquire/nats_bridge.py +62 -0
- lightfall/acquire/plan_ui.py +78 -0
- lightfall/acquire/plans/__init__.py +38 -0
- lightfall/acquire/plans/adaptive.py +288 -0
- lightfall/acquire/plans/example_plans.py +995 -0
- lightfall/acquire/plans/lightfall_plans.py +587 -0
- lightfall/acquire/plans/registry.py +543 -0
- lightfall/acquire/plans/standard_plans.py +186 -0
- lightfall/acquire/plans/user_plans.py +470 -0
- lightfall/acquire/runengine.py +36 -0
- lightfall/acquire/signals.py +452 -0
- lightfall/acquire/triggers/__init__.py +16 -0
- lightfall/acquire/triggers/base.py +25 -0
- lightfall/acquire/triggers/filter.py +37 -0
- lightfall/acquire/triggers/manager.py +73 -0
- lightfall/acquire/triggers/manual.py +36 -0
- lightfall/acquire/triggers/run_end.py +74 -0
- lightfall/acquire/triggers/run_start.py +52 -0
- lightfall/auth/__init__.py +38 -0
- lightfall/auth/policy.py +518 -0
- lightfall/auth/providers/__init__.py +30 -0
- lightfall/auth/providers/base.py +124 -0
- lightfall/auth/providers/keycloak.py +1017 -0
- lightfall/auth/providers/local.py +319 -0
- lightfall/auth/providers/pam.py +250 -0
- lightfall/auth/service_key.py +173 -0
- lightfall/auth/service_key_auth.py +79 -0
- lightfall/auth/session.py +656 -0
- lightfall/claude/__init__.py +52 -0
- lightfall/claude/_internal/__init__.py +1 -0
- lightfall/claude/_internal/serialization.py +195 -0
- lightfall/claude/_internal/threading.py +61 -0
- lightfall/claude/_internal/worker.py +757 -0
- lightfall/claude/_session_assembly.py +124 -0
- lightfall/claude/agent.py +596 -0
- lightfall/claude/lightfall_core_tools.py +410 -0
- lightfall/claude/markdown.py +103 -0
- lightfall/claude/permission_manager.py +588 -0
- lightfall/claude/tools/__init__.py +45 -0
- lightfall/claude/tools/controller.py +143 -0
- lightfall/claude/tools/interaction.py +177 -0
- lightfall/claude/tools/introspection.py +127 -0
- lightfall/claude/tools/logs.py +155 -0
- lightfall/claude/tools/screenshot.py +87 -0
- lightfall/claude/widget.py +851 -0
- lightfall/claude/widgets/__init__.py +5 -0
- lightfall/claude/widgets/permission_request.py +282 -0
- lightfall/claude/widgets/question_request.py +227 -0
- lightfall/claude/widgets/task_card.py +223 -0
- lightfall/config/__init__.py +23 -0
- lightfall/config/layers.py +317 -0
- lightfall/config/manager.py +244 -0
- lightfall/config/schema.py +154 -0
- lightfall/core/__init__.py +23 -0
- lightfall/core/application.py +727 -0
- lightfall/core/services.py +235 -0
- lightfall/devices/__init__.py +53 -0
- lightfall/devices/backends/__init__.py +17 -0
- lightfall/devices/backends/bcs.py +448 -0
- lightfall/devices/backends/happi.py +986 -0
- lightfall/devices/backends/mock.py +646 -0
- lightfall/devices/base.py +338 -0
- lightfall/devices/catalog.py +1039 -0
- lightfall/devices/connection_manager.py +676 -0
- lightfall/devices/model.py +290 -0
- lightfall/devices/monitoring.py +442 -0
- lightfall/devices/sim/__init__.py +26 -0
- lightfall/devices/sim/areadetector.py +436 -0
- lightfall/devices/sim/generators.py +223 -0
- lightfall/devices/sim/plugins.py +116 -0
- lightfall/epics/__init__.py +28 -0
- lightfall/epics/ca/__init__.py +10 -0
- lightfall/epics/ca/context.py +100 -0
- lightfall/epics/ca/pv.py +303 -0
- lightfall/epics/widgets/__init__.py +49 -0
- lightfall/epics/widgets/areadetector/__init__.py +16 -0
- lightfall/epics/widgets/areadetector/areadetector.py +281 -0
- lightfall/epics/widgets/areadetector/controls.py +478 -0
- lightfall/epics/widgets/areadetector/image_view.py +447 -0
- lightfall/epics/widgets/auto.py +319 -0
- lightfall/epics/widgets/base.py +404 -0
- lightfall/epics/widgets/checkbox.py +239 -0
- lightfall/epics/widgets/combobox.py +202 -0
- lightfall/epics/widgets/label.py +176 -0
- lightfall/epics/widgets/lineedit.py +253 -0
- lightfall/epics/widgets/motor.py +694 -0
- lightfall/epics/widgets/ophyd_base.py +469 -0
- lightfall/epics/widgets/ophyd_combobox.py +86 -0
- lightfall/epics/widgets/ophyd_label.py +54 -0
- lightfall/epics/widgets/ophyd_lineedit.py +170 -0
- lightfall/epics/widgets/ophyd_spinbox.py +79 -0
- lightfall/epics/widgets/slider.py +272 -0
- lightfall/epics/widgets/status_indicator.py +98 -0
- lightfall/epics/widgets/style.py +188 -0
- lightfall/exporter/__init__.py +1 -0
- lightfall/exporter/cli.py +67 -0
- lightfall/exporter/converters/__init__.py +26 -0
- lightfall/exporter/converters/base.py +39 -0
- lightfall/exporter/converters/noop.py +39 -0
- lightfall/exporter/converters/nxsas.py +73 -0
- lightfall/exporter/service.py +200 -0
- lightfall/exporter/tiled_utils.py +92 -0
- lightfall/ipc/__init__.py +6 -0
- lightfall/ipc/service.py +701 -0
- lightfall/ipc/trust.py +144 -0
- lightfall/logbook/__init__.py +46 -0
- lightfall/logbook/action_dialog.py +207 -0
- lightfall/logbook/action_logger.py +432 -0
- lightfall/logbook/block_mapper.py +562 -0
- lightfall/logbook/client.py +799 -0
- lightfall/logbook/converter.py +273 -0
- lightfall/logbook/editors/__init__.py +19 -0
- lightfall/logbook/editors/highlighter.py +305 -0
- lightfall/logbook/editors/markdown_editor.py +319 -0
- lightfall/logbook/editors/richtext_editor.py +1397 -0
- lightfall/logbook/entry_widget.py +1065 -0
- lightfall/logbook/event_listener.py +221 -0
- lightfall/logbook/fragment_widgets.py +925 -0
- lightfall/logbook/position_mapper.py +320 -0
- lightfall/logbook/protection.py +402 -0
- lightfall/logbook/style.py +394 -0
- lightfall/logbook/url.py +29 -0
- lightfall/logbook/visual_protection.py +330 -0
- lightfall/logbook/widget.py +680 -0
- lightfall/main.py +1091 -0
- lightfall/pipelines/__init__.py +4 -0
- lightfall/pipelines/client.py +148 -0
- lightfall/plugins/__init__.py +119 -0
- lightfall/plugins/agent_plugin.py +106 -0
- lightfall/plugins/agents/__init__.py +10 -0
- lightfall/plugins/agents/_mcp_helpers.py +52 -0
- lightfall/plugins/agents/alignment.py +94 -0
- lightfall/plugins/agents/autonomous_experiment/__init__.py +12 -0
- lightfall/plugins/agents/autonomous_experiment/nats_tools.py +210 -0
- lightfall/plugins/agents/autonomous_experiment/plugin.py +60 -0
- lightfall/plugins/agents/autonomous_experiment/prompts.py +164 -0
- lightfall/plugins/agents/current_esaf.py +435 -0
- lightfall/plugins/agents/device_tools.py +1043 -0
- lightfall/plugins/agents/engine_tools.py +720 -0
- lightfall/plugins/agents/ipython_tools.py +444 -0
- lightfall/plugins/agents/panel_builder.py +637 -0
- lightfall/plugins/agents/panel_design/references/cross_panel_patterns.md +95 -0
- lightfall/plugins/agents/panel_design/references/panel_design.md +680 -0
- lightfall/plugins/agents/panel_design.py +94 -0
- lightfall/plugins/agents/plan_design/references/plan_design.md +398 -0
- lightfall/plugins/agents/plan_design.py +90 -0
- lightfall/plugins/agents/plan_tools.py +878 -0
- lightfall/plugins/agents/scan_planning.py +101 -0
- lightfall/plugins/builtin_manifest.py +348 -0
- lightfall/plugins/controller_plugin.py +162 -0
- lightfall/plugins/engine_plugin.py +124 -0
- lightfall/plugins/errors.py +104 -0
- lightfall/plugins/info.py +112 -0
- lightfall/plugins/loader.py +878 -0
- lightfall/plugins/manifest.py +150 -0
- lightfall/plugins/panel_plugin.py +119 -0
- lightfall/plugins/plan_plugin.py +163 -0
- lightfall/plugins/registry.py +309 -0
- lightfall/plugins/settings_plugin.py +226 -0
- lightfall/plugins/statusbar_plugin.py +289 -0
- lightfall/plugins/theme_plugin.py +165 -0
- lightfall/plugins/types.py +136 -0
- lightfall/plugins/user_plugins.py +764 -0
- lightfall/project/__init__.py +37 -0
- lightfall/project/model.py +375 -0
- lightfall/project/service.py +427 -0
- lightfall/project/welcome.py +106 -0
- lightfall/resources/__init__.py +126 -0
- lightfall/resources/images/__init__.py +1 -0
- lightfall/resources/images/icon.ico +0 -0
- lightfall/resources/images/icon.png +0 -0
- lightfall/resources/images/logo.png +0 -0
- lightfall/services/__init__.py +33 -0
- lightfall/services/_alshub_client.py +73 -0
- lightfall/services/access_stamper.py +240 -0
- lightfall/services/als_beam_status.py +347 -0
- lightfall/services/ca_tunnel.py +325 -0
- lightfall/services/threaded_tiled_writer.py +174 -0
- lightfall/services/tiled_auth.py +21 -0
- lightfall/services/tiled_service.py +971 -0
- lightfall/services/tiled_writer_patch.py +301 -0
- lightfall/settings/__init__.py +1 -0
- lightfall/settings/image_helpers.py +30 -0
- lightfall/settings/user_settings_client.py +232 -0
- lightfall/ui/__init__.py +28 -0
- lightfall/ui/annotations.py +208 -0
- lightfall/ui/common/__init__.py +7 -0
- lightfall/ui/dialogs/__init__.py +26 -0
- lightfall/ui/dialogs/about_dialog.py +131 -0
- lightfall/ui/dialogs/add_trigger_dialog.py +152 -0
- lightfall/ui/dialogs/base.py +44 -0
- lightfall/ui/dialogs/bug_report_dialog.py +353 -0
- lightfall/ui/dialogs/create_plan_dialog.py +189 -0
- lightfall/ui/dialogs/device_edit_dialog.py +183 -0
- lightfall/ui/dialogs/export_dialog.py +565 -0
- lightfall/ui/dialogs/go_to_position_dialog.py +192 -0
- lightfall/ui/dialogs/login_dialog.py +756 -0
- lightfall/ui/dialogs/oauth_browser_dialog.py +305 -0
- lightfall/ui/dialogs/run_pipeline_dialog.py +131 -0
- lightfall/ui/dialogs/sample_metadata_dialog.py +316 -0
- lightfall/ui/docking/__init__.py +22 -0
- lightfall/ui/docking/icon_sidebar.py +806 -0
- lightfall/ui/docking/manager.py +682 -0
- lightfall/ui/docking/state.py +113 -0
- lightfall/ui/docking/theme.py +399 -0
- lightfall/ui/docking/widget.py +214 -0
- lightfall/ui/events.py +75 -0
- lightfall/ui/mainwindow.py +1006 -0
- lightfall/ui/models/__init__.py +49 -0
- lightfall/ui/models/device_selection.py +389 -0
- lightfall/ui/models/device_tree.py +1095 -0
- lightfall/ui/models/thread_model.py +667 -0
- lightfall/ui/models/tiled_model.py +384 -0
- lightfall/ui/panels/__init__.py +28 -0
- lightfall/ui/panels/base.py +525 -0
- lightfall/ui/panels/bluesky_panel.py +619 -0
- lightfall/ui/panels/claude/__init__.py +9 -0
- lightfall/ui/panels/claude/agent_registry.py +168 -0
- lightfall/ui/panels/claude_panel.py +887 -0
- lightfall/ui/panels/device_panel.py +370 -0
- lightfall/ui/panels/documents_panel.py +166 -0
- lightfall/ui/panels/ipython_panel.py +580 -0
- lightfall/ui/panels/logbook_entries_panel.py +84 -0
- lightfall/ui/panels/logbook_panel.py +627 -0
- lightfall/ui/panels/logging_panel.py +587 -0
- lightfall/ui/panels/pipeline_jobs_panel.py +160 -0
- lightfall/ui/panels/pipeline_triggers_panel.py +170 -0
- lightfall/ui/panels/plugins/__init__.py +34 -0
- lightfall/ui/panels/plugins/bluesky_plugin.py +27 -0
- lightfall/ui/panels/plugins/claude_plugin.py +29 -0
- lightfall/ui/panels/plugins/device_plugin.py +27 -0
- lightfall/ui/panels/plugins/documents_plugin.py +26 -0
- lightfall/ui/panels/plugins/ipython_plugin.py +27 -0
- lightfall/ui/panels/plugins/logbook_entries_plugin.py +23 -0
- lightfall/ui/panels/plugins/logbook_plugin.py +27 -0
- lightfall/ui/panels/plugins/logging_plugin.py +27 -0
- lightfall/ui/panels/plugins/pipeline_jobs_plugin.py +23 -0
- lightfall/ui/panels/plugins/pipeline_triggers_plugin.py +25 -0
- lightfall/ui/panels/plugins/queue_plugin.py +29 -0
- lightfall/ui/panels/plugins/synoptic_plugin.py +38 -0
- lightfall/ui/panels/plugins/threads_plugin.py +27 -0
- lightfall/ui/panels/plugins/tiled_browser_plugin.py +27 -0
- lightfall/ui/panels/plugins/visualization_plugin.py +27 -0
- lightfall/ui/panels/queue.py +754 -0
- lightfall/ui/panels/registry.py +483 -0
- lightfall/ui/panels/synoptic/__init__.py +27 -0
- lightfall/ui/panels/synoptic/editors.py +481 -0
- lightfall/ui/panels/synoptic/items.py +556 -0
- lightfall/ui/panels/synoptic/models.py +336 -0
- lightfall/ui/panels/synoptic/panel.py +889 -0
- lightfall/ui/panels/synoptic/serialization.py +300 -0
- lightfall/ui/panels/synoptic/view.py +504 -0
- lightfall/ui/panels/threads_panel.py +621 -0
- lightfall/ui/panels/tiled_browser_panel.py +854 -0
- lightfall/ui/panels/visualization_panel.py +508 -0
- lightfall/ui/preferences/__init__.py +24 -0
- lightfall/ui/preferences/backend.py +148 -0
- lightfall/ui/preferences/builtin.py +220 -0
- lightfall/ui/preferences/claude_settings.py +762 -0
- lightfall/ui/preferences/device_settings.py +461 -0
- lightfall/ui/preferences/dialog.py +234 -0
- lightfall/ui/preferences/editor_settings.py +227 -0
- lightfall/ui/preferences/ipc_settings.py +226 -0
- lightfall/ui/preferences/logbook_settings.py +232 -0
- lightfall/ui/preferences/login_settings.py +183 -0
- lightfall/ui/preferences/manager.py +562 -0
- lightfall/ui/preferences/plugin_settings.py +392 -0
- lightfall/ui/preferences/proxy_settings.py +561 -0
- lightfall/ui/preferences/skill_settings.py +28 -0
- lightfall/ui/preferences/tiled_settings.py +469 -0
- lightfall/ui/preferences/tool_settings.py +393 -0
- lightfall/ui/preferences/user_portable_backend.py +131 -0
- lightfall/ui/preferences/user_profile_settings.py +316 -0
- lightfall/ui/preferences/visualization_settings.py +159 -0
- lightfall/ui/resources/__init__.py +1 -0
- lightfall/ui/resources/logo.png +0 -0
- lightfall/ui/statusbar/__init__.py +11 -0
- lightfall/ui/statusbar/manager.py +379 -0
- lightfall/ui/statusbar/plugins/__init__.py +28 -0
- lightfall/ui/statusbar/plugins/als_beam_status.py +218 -0
- lightfall/ui/statusbar/plugins/auth_status.py +116 -0
- lightfall/ui/statusbar/plugins/connection_status.py +100 -0
- lightfall/ui/statusbar/plugins/thread_status.py +556 -0
- lightfall/ui/statusbar/plugins/tiled_status.py +179 -0
- lightfall/ui/statusbar/plugins/user_status.py +84 -0
- lightfall/ui/theater/__init__.py +28 -0
- lightfall/ui/theater/manager.py +124 -0
- lightfall/ui/theater/overlay.py +279 -0
- lightfall/ui/theater/proxy.py +111 -0
- lightfall/ui/theme/__init__.py +18 -0
- lightfall/ui/theme/builtin.py +1015 -0
- lightfall/ui/theme/manager.py +875 -0
- lightfall/ui/theme/registry.py +195 -0
- lightfall/ui/toast.py +221 -0
- lightfall/ui/tutorial.py +1100 -0
- lightfall/ui/widgets/__init__.py +110 -0
- lightfall/ui/widgets/base_control.py +259 -0
- lightfall/ui/widgets/camera/__init__.py +36 -0
- lightfall/ui/widgets/camera/base.py +815 -0
- lightfall/ui/widgets/camera/dark_frames.py +213 -0
- lightfall/ui/widgets/camera/image_view.py +649 -0
- lightfall/ui/widgets/camera/panels/__init__.py +14 -0
- lightfall/ui/widgets/camera/panels/cooler.py +320 -0
- lightfall/ui/widgets/camera/panels/temperature.py +192 -0
- lightfall/ui/widgets/camera/plan_based.py +202 -0
- lightfall/ui/widgets/compact_motor.py +522 -0
- lightfall/ui/widgets/controller_matcher.py +278 -0
- lightfall/ui/widgets/controller_registry.py +144 -0
- lightfall/ui/widgets/device_control.py +411 -0
- lightfall/ui/widgets/device_selector.py +438 -0
- lightfall/ui/widgets/device_tree_tab.py +461 -0
- lightfall/ui/widgets/document_stream.py +1028 -0
- lightfall/ui/widgets/favorites_tab.py +191 -0
- lightfall/ui/widgets/motor_control.py +1120 -0
- lightfall/ui/widgets/observers/__init__.py +8 -0
- lightfall/ui/widgets/observers/camera.py +48 -0
- lightfall/ui/widgets/observers/image_view.py +130 -0
- lightfall/ui/widgets/plan_config.py +954 -0
- lightfall/ui/widgets/plan_edit_dialog.py +294 -0
- lightfall/ui/widgets/plan_selector.py +452 -0
- lightfall/ui/widgets/profile_avatar.py +128 -0
- lightfall/ui/widgets/queue_view.py +647 -0
- lightfall/ui/widgets/runengine_control.py +549 -0
- lightfall/ui/widgets/signal_control.py +793 -0
- lightfall/ui/widgets/skill_trigger_button.py +183 -0
- lightfall/ui/widgets/tiled_filter_widget.py +314 -0
- lightfall/ui/widgets/tiled_status.py +149 -0
- lightfall/ui/widgets/warning_banner.py +185 -0
- lightfall/utils/__init__.py +53 -0
- lightfall/utils/crash_diagnostics.py +454 -0
- lightfall/utils/data_migration.py +22 -0
- lightfall/utils/editor_launcher.py +594 -0
- lightfall/utils/error_collector.py +245 -0
- lightfall/utils/git_tracker.py +197 -0
- lightfall/utils/log_buffer.py +233 -0
- lightfall/utils/logging.py +229 -0
- lightfall/utils/module_resolver.py +70 -0
- lightfall/utils/sentry.py +722 -0
- lightfall/utils/threads.py +991 -0
- lightfall/utils/tiled_helpers.py +96 -0
- lightfall/visualization/__init__.py +50 -0
- lightfall/visualization/base.py +5 -0
- lightfall/visualization/base_visualization.py +74 -0
- lightfall/visualization/fitting/__init__.py +24 -0
- lightfall/visualization/fitting/base.py +267 -0
- lightfall/visualization/fitting/fitters.py +325 -0
- lightfall/visualization/fitting/panel.py +265 -0
- lightfall/visualization/memory.py +392 -0
- lightfall/visualization/motor_mixin.py +524 -0
- lightfall/visualization/pg.py +156 -0
- lightfall/visualization/registry.py +144 -0
- lightfall/visualization/spec.py +79 -0
- lightfall/visualization/theme.py +266 -0
- lightfall/visualization/widgets/__init__.py +28 -0
- lightfall/visualization/widgets/adaptive/__init__.py +1 -0
- lightfall/visualization/widgets/adaptive/heatmap.py +655 -0
- lightfall/visualization/widgets/adaptive/plot.py +233 -0
- lightfall/visualization/widgets/heatmap.py +264 -0
- lightfall/visualization/widgets/image_stack.py +316 -0
- lightfall/visualization/widgets/image_view_toolbar.py +227 -0
- lightfall/visualization/widgets/lazy_image_view.py +590 -0
- lightfall/visualization/widgets/plot_1d.py +262 -0
- lightfall/visualization/widgets/scatter.py +247 -0
- lightfall/visualization/widgets/table.py +221 -0
- lightfall/visualization/widgets/time_axis.py +93 -0
- lightfall-0.1.1.dist-info/METADATA +223 -0
- lightfall-0.1.1.dist-info/RECORD +388 -0
- lightfall-0.1.1.dist-info/WHEEL +4 -0
- lightfall-0.1.1.dist-info/entry_points.txt +6 -0
- lightfall-0.1.1.dist-info/licenses/LEGAL.md +13 -0
- lightfall-0.1.1.dist-info/licenses/LICENSE.md +33 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Panel design skill plugin.
|
|
2
|
+
|
|
3
|
+
Provides Claude with expertise for designing BasePanel subclasses
|
|
4
|
+
for the Lightfall application. This skill teaches the full panel API
|
|
5
|
+
including metadata, lifecycle, state management, and self-registration.
|
|
6
|
+
|
|
7
|
+
Full API documentation is shipped as references/panel_design.md alongside
|
|
8
|
+
the SKILL.md and surfaced lazily by the SDK's deferred Skill tool.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
from lightfall.plugins.agent_plugin import AgentPlugin
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PanelDesignAgent(AgentPlugin):
|
|
20
|
+
"""Skill for designing Lightfall panel plugins.
|
|
21
|
+
|
|
22
|
+
This skill provides Claude with deep expertise for:
|
|
23
|
+
- BasePanel lifecycle and API
|
|
24
|
+
- PanelMetadata configuration
|
|
25
|
+
- State management and introspection
|
|
26
|
+
- Self-registration pattern for user plugins
|
|
27
|
+
- Qt/PySide6 component patterns
|
|
28
|
+
|
|
29
|
+
Full API documentation is in references/panel_design.md (loaded by
|
|
30
|
+
the SDK's deferred Skill tool when this skill is invoked).
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def name(self) -> str:
|
|
35
|
+
"""Return unique identifier for this skill."""
|
|
36
|
+
return "panel_design"
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def display_name(self) -> str:
|
|
40
|
+
"""Return human-readable display name."""
|
|
41
|
+
return "Panel Design"
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def description(self) -> str:
|
|
45
|
+
"""Return description of this skill's capabilities."""
|
|
46
|
+
return "Expertise in designing Lightfall panel plugins with self-registration"
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def category(self) -> str:
|
|
50
|
+
"""Return category for grouping in settings UI."""
|
|
51
|
+
return "development"
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def enabled_by_default(self) -> bool:
|
|
55
|
+
"""Return whether this skill is enabled by default."""
|
|
56
|
+
return True
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def priority(self) -> int:
|
|
60
|
+
"""Return priority (lower = higher in prompt order)."""
|
|
61
|
+
return 20
|
|
62
|
+
|
|
63
|
+
def get_brief_description(self) -> str:
|
|
64
|
+
"""Return brief hint for system prompt (full docs are on-demand)."""
|
|
65
|
+
return """## Lightfall Panel Design
|
|
66
|
+
|
|
67
|
+
Expert at designing Qt panel plugins for Lightfall with self-registration.
|
|
68
|
+
|
|
69
|
+
**See `references/panel_design.md` (loaded automatically by the SDK Skill tool)** for full API reference covering:
|
|
70
|
+
- `PanelMetadata` - id, name, category, docking preferences
|
|
71
|
+
- `BasePanel` lifecycle - _setup_ui(), signals, state management
|
|
72
|
+
- MCP introspection - _get_specific_introspection_data(), actions
|
|
73
|
+
- User-plugin auto-registration via `PluginType.__init_subclass__`
|
|
74
|
+
- Qt widgets and layout patterns
|
|
75
|
+
|
|
76
|
+
Key imports: `from lightfall.ui.panels.base import BasePanel, PanelMetadata`
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
def get_system_prompt(self) -> str:
|
|
80
|
+
"""Return the system prompt snippet for panel design expertise.
|
|
81
|
+
|
|
82
|
+
Returns the brief description; full documentation in references/
|
|
83
|
+
is loaded on-demand by the SDK's deferred Skill tool.
|
|
84
|
+
"""
|
|
85
|
+
return self.get_brief_description()
|
|
86
|
+
|
|
87
|
+
def create_tools(self) -> list[Any]:
|
|
88
|
+
"""Return tools provided by this skill."""
|
|
89
|
+
# This skill provides guidance only, no additional tools
|
|
90
|
+
return []
|
|
91
|
+
|
|
92
|
+
def get_references_dir(self) -> Path | None:
|
|
93
|
+
"""Return path to the references directory containing supplementary docs."""
|
|
94
|
+
return Path(__file__).parent / "panel_design" / "references"
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# Bluesky Plan Design API Reference
|
|
2
|
+
|
|
3
|
+
This document provides the full API reference for designing Bluesky plans with Lightfall UI annotations.
|
|
4
|
+
|
|
5
|
+
## Required Imports
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
from typing import Annotated, Any, Generator
|
|
10
|
+
from bluesky import plan_stubs as bps
|
|
11
|
+
from bluesky import plans as bp
|
|
12
|
+
from lightfall.ui.annotations import (
|
|
13
|
+
Unit, Decimals, Range, Default,
|
|
14
|
+
DeviceFilter, DeviceFilterAny, DeviceDefault,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# Type aliases
|
|
18
|
+
Device = Any
|
|
19
|
+
Motor = Any
|
|
20
|
+
Detector = Any
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## lightfall-ui-annotations
|
|
24
|
+
|
|
25
|
+
These annotations enable automatic UI generation for plan parameters.
|
|
26
|
+
|
|
27
|
+
### Unit(suffix: str)
|
|
28
|
+
Display unit suffix next to numeric inputs:
|
|
29
|
+
```python
|
|
30
|
+
energy: Annotated[float, Unit("eV")] = 100.0
|
|
31
|
+
exposure: Annotated[float, Unit("s")] = 1.0
|
|
32
|
+
temperature: Annotated[float, Unit("K")] = 300.0
|
|
33
|
+
field: Annotated[float, Unit("G")] = 0.0
|
|
34
|
+
position: Annotated[float, Unit("mm")] = 0.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Decimals(places: int)
|
|
38
|
+
Control float precision in spinbox:
|
|
39
|
+
```python
|
|
40
|
+
step_size: Annotated[float, Decimals(4)] = 0.001 # 0.0001 precision
|
|
41
|
+
position: Annotated[float, Unit("um"), Decimals(7)] = 0.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Range(min, max)
|
|
45
|
+
Set bounds for numeric inputs:
|
|
46
|
+
```python
|
|
47
|
+
num_points: Annotated[int, Range(1, 1000)] = 10
|
|
48
|
+
exposure: Annotated[float, Range(0.001, 3600), Unit("s")] = 1.0
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Default(value)
|
|
52
|
+
Override the function signature default:
|
|
53
|
+
```python
|
|
54
|
+
wait_time: Annotated[float, Default(0.5), Unit("s")] = 0.5
|
|
55
|
+
temperatures: Annotated[list[float], Default([26.9, 26.8, 26.6])]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### DeviceFilter(device_class, category, group, source, name_pattern)
|
|
59
|
+
Filter device selection (all criteria use AND logic):
|
|
60
|
+
```python
|
|
61
|
+
motor: Annotated[Motor, DeviceFilter(device_class="EpicsMotor")]
|
|
62
|
+
detector: Annotated[Detector, DeviceFilter(category="detector", group="areadetectors")]
|
|
63
|
+
magnet: Annotated[Motor, DeviceFilter(group="magnets")]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### DeviceFilterAny(*filters)
|
|
67
|
+
Combine filters with OR logic:
|
|
68
|
+
```python
|
|
69
|
+
axis: Annotated[Device, DeviceFilterAny(
|
|
70
|
+
DeviceFilter(category="motor"),
|
|
71
|
+
DeviceFilter(category="positioner"),
|
|
72
|
+
)]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### DeviceDefault(*names, pattern=None)
|
|
76
|
+
Pre-select devices:
|
|
77
|
+
```python
|
|
78
|
+
detector: Annotated[list[Detector], DeviceDefault("PI_MTE3")]
|
|
79
|
+
motors: Annotated[list[Motor], DeviceDefault(pattern="sample_.*")]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Combining Annotations
|
|
83
|
+
Stack multiple annotations for rich UI:
|
|
84
|
+
```python
|
|
85
|
+
def my_scan(
|
|
86
|
+
detectors: Annotated[
|
|
87
|
+
list[Detector],
|
|
88
|
+
DeviceFilter(group="areadetectors"),
|
|
89
|
+
DeviceDefault("PI_MTE3"),
|
|
90
|
+
],
|
|
91
|
+
energy: Annotated[float, Unit("eV"), Range(100, 2000)],
|
|
92
|
+
step_size: Annotated[float, Unit("um"), Decimals(4), Default(0.1)],
|
|
93
|
+
): ...
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## bluesky-plan-stubs
|
|
97
|
+
|
|
98
|
+
Plan stubs are the **low-level building blocks** for plans. Master these.
|
|
99
|
+
|
|
100
|
+
### Movement Stubs
|
|
101
|
+
|
|
102
|
+
**bps.mv(*args)** - Move devices and wait
|
|
103
|
+
```python
|
|
104
|
+
yield from bps.mv(motor, 10.0)
|
|
105
|
+
yield from bps.mv(motor1, 10.0, motor2, 20.0) # Multiple simultaneous
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**bps.mvr(*args)** - Move relative and wait
|
|
109
|
+
```python
|
|
110
|
+
yield from bps.mvr(motor, 1.0) # Move 1.0 from current position
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**bps.abs_set(obj, value, group=None, wait=False)** - Set absolute position
|
|
114
|
+
```python
|
|
115
|
+
yield from bps.abs_set(motor, 10.0, wait=True)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**bps.rel_set(obj, value, group=None, wait=False)** - Set relative position
|
|
119
|
+
```python
|
|
120
|
+
yield from bps.rel_set(motor, 1.0, wait=True)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Timing/Synchronization Stubs
|
|
124
|
+
|
|
125
|
+
**bps.sleep(time)** - Wait for specified seconds
|
|
126
|
+
```python
|
|
127
|
+
yield from bps.sleep(0.5)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**bps.wait(group=None)** - Wait for a group to complete
|
|
131
|
+
```python
|
|
132
|
+
yield from bps.abs_set(motor, 10.0, group="move")
|
|
133
|
+
yield from bps.wait(group="move")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**bps.checkpoint()** - Mark a resumable point
|
|
137
|
+
```python
|
|
138
|
+
yield from bps.checkpoint() # Plan can resume from here on interrupt
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Reading/Triggering Stubs
|
|
142
|
+
|
|
143
|
+
**bps.trigger(obj, group=None, wait=False)** - Trigger acquisition
|
|
144
|
+
```python
|
|
145
|
+
yield from bps.trigger(detector, wait=True)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**bps.read(obj)** - Read device values
|
|
149
|
+
```python
|
|
150
|
+
yield from bps.read(detector)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**bps.trigger_and_read(devices, name="primary")** - Trigger and read in one step
|
|
154
|
+
```python
|
|
155
|
+
yield from bps.trigger_and_read([detector, motor])
|
|
156
|
+
yield from bps.trigger_and_read([detector], name="dark") # Named stream
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**bps.one_shot(detectors)** - Single acquisition
|
|
160
|
+
```python
|
|
161
|
+
yield from bps.one_shot([detector])
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**bps.one_nd_step(detectors, step, pos_cache, take_reading=None)** - One step in N-D scan
|
|
165
|
+
```python
|
|
166
|
+
# Used in per_step callbacks
|
|
167
|
+
yield from bps.one_nd_step(detectors, step, pos_cache)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Metadata Stubs
|
|
171
|
+
|
|
172
|
+
**bps.open_run(md=None)** / **bps.close_run(exit_status=None)** - Run boundaries
|
|
173
|
+
```python
|
|
174
|
+
yield from bps.open_run(md={"sample": "test"})
|
|
175
|
+
# ... do acquisition ...
|
|
176
|
+
yield from bps.close_run()
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**bps.create(name="primary")** / **bps.save()** - Event boundaries
|
|
180
|
+
```python
|
|
181
|
+
yield from bps.create()
|
|
182
|
+
yield from bps.read(detector)
|
|
183
|
+
yield from bps.save()
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Device State Stubs
|
|
187
|
+
|
|
188
|
+
**bps.stage(obj)** / **bps.unstage(obj)** - Prepare/cleanup device
|
|
189
|
+
```python
|
|
190
|
+
yield from bps.stage(detector)
|
|
191
|
+
# ... use detector ...
|
|
192
|
+
yield from bps.unstage(detector)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**bps.configure(obj, config_dict)** - Configure device
|
|
196
|
+
```python
|
|
197
|
+
yield from bps.configure(detector, {"exposure_time": 1.0})
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Utility Stubs
|
|
201
|
+
|
|
202
|
+
**bps.null()** - No-op (useful for conditional logic)
|
|
203
|
+
```python
|
|
204
|
+
yield from bps.null()
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**bps.repeat(plan, num=1, delay=0)** - Repeat a plan
|
|
208
|
+
```python
|
|
209
|
+
yield from bps.repeat(my_sub_plan, num=5, delay=1.0)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**bps.rd(obj)** - Read single value (returns value, not generator!)
|
|
213
|
+
```python
|
|
214
|
+
current_pos = yield from bps.rd(motor) # Returns the value
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## bluesky-plans
|
|
218
|
+
|
|
219
|
+
High-level plans built from stubs. Use these for common patterns.
|
|
220
|
+
|
|
221
|
+
### Linear Scans
|
|
222
|
+
|
|
223
|
+
**bp.scan(detectors, motor, start, stop, num)** - Absolute linear scan
|
|
224
|
+
```python
|
|
225
|
+
yield from bp.scan([detector], motor, 0, 10, 11)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**bp.rel_scan(detectors, motor, start, stop, num)** - Relative linear scan
|
|
229
|
+
```python
|
|
230
|
+
yield from bp.rel_scan([detector], motor, -5, 5, 11)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### List Scans
|
|
234
|
+
|
|
235
|
+
**bp.list_scan(detectors, motor, positions)** - Scan through list
|
|
236
|
+
```python
|
|
237
|
+
yield from bp.list_scan([detector], motor, [1, 2, 5, 10])
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**bp.rel_list_scan(detectors, motor, positions)** - Relative list scan
|
|
241
|
+
```python
|
|
242
|
+
yield from bp.rel_list_scan([detector], motor, [-1, 0, 1])
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Grid Scans
|
|
246
|
+
|
|
247
|
+
**bp.grid_scan(detectors, motor1, s1, e1, n1, motor2, s2, e2, n2, ...)** - N-D grid
|
|
248
|
+
```python
|
|
249
|
+
yield from bp.grid_scan(
|
|
250
|
+
[detector],
|
|
251
|
+
motor1, 0, 10, 11, # axis 1: start, stop, num
|
|
252
|
+
motor2, 0, 5, 6, # axis 2: start, stop, num
|
|
253
|
+
)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**bp.rel_grid_scan(...)** - Relative grid scan
|
|
257
|
+
```python
|
|
258
|
+
yield from bp.rel_grid_scan([detector], motor1, -5, 5, 11, motor2, -2, 2, 5)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Spiral Scans
|
|
262
|
+
|
|
263
|
+
**bp.spiral(detectors, x_motor, y_motor, x_start, y_start, x_range, y_range, dr, nth)**
|
|
264
|
+
**bp.spiral_fermat(detectors, x_motor, y_motor, x_start, y_start, x_range, y_range, dr, factor)**
|
|
265
|
+
**bp.spiral_square(detectors, x_motor, y_motor, x_center, y_center, x_range, y_range, x_num, y_num)**
|
|
266
|
+
|
|
267
|
+
### Adaptive Scans
|
|
268
|
+
|
|
269
|
+
**bp.adaptive_scan(detectors, target_field, motor, start, stop, min_step, max_step, target_delta, ...)**
|
|
270
|
+
```python
|
|
271
|
+
yield from bp.adaptive_scan([detector], "det_value", motor, 0, 10, 0.01, 1.0, 0.1)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Count
|
|
275
|
+
|
|
276
|
+
**bp.count(detectors, num=1, delay=0)** - Fixed-position acquisition
|
|
277
|
+
```python
|
|
278
|
+
yield from bp.count([detector], num=10, delay=1.0)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Common Parameters in bp.* Plans
|
|
282
|
+
|
|
283
|
+
- **per_step**: Custom step function `def per_step(detectors, step, pos_cache)`
|
|
284
|
+
- **md**: Metadata dictionary to add to run
|
|
285
|
+
- **snake_axes**: For grids, alternate direction (snaking)
|
|
286
|
+
|
|
287
|
+
## plan-design-patterns
|
|
288
|
+
|
|
289
|
+
### Custom per_step for Delays
|
|
290
|
+
```python
|
|
291
|
+
def my_plan(detectors, motor, start, stop, num, wait_time=0.5):
|
|
292
|
+
def wait_per_step(detectors, step, pos_cache):
|
|
293
|
+
yield from bps.sleep(wait_time)
|
|
294
|
+
yield from bps.one_nd_step(detectors, step, pos_cache)
|
|
295
|
+
|
|
296
|
+
yield from bp.scan(detectors, motor, start, stop, num, per_step=wait_per_step)
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Custom Trigger for Dark Collection
|
|
300
|
+
```python
|
|
301
|
+
def my_plan(detectors, motor, start, stop, num, collect_darks=False):
|
|
302
|
+
def custom_trigger(dets, name="primary"):
|
|
303
|
+
yield from bps.trigger_and_read(dets, name=name)
|
|
304
|
+
if collect_darks:
|
|
305
|
+
yield from bps.trigger_and_read(dets, name="dark")
|
|
306
|
+
|
|
307
|
+
def custom_step(detectors, step, pos_cache):
|
|
308
|
+
yield from bps.one_nd_step(detectors, step, pos_cache, take_reading=custom_trigger)
|
|
309
|
+
|
|
310
|
+
yield from bp.scan(detectors, motor, start, stop, num, per_step=custom_step)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Sequential Motor Movement with Delays
|
|
314
|
+
```python
|
|
315
|
+
from bluesky import utils as bsu
|
|
316
|
+
|
|
317
|
+
def sequential_step(detectors, step, pos_cache, delays):
|
|
318
|
+
yield from bps.checkpoint()
|
|
319
|
+
grp = bps._short_uid("set")
|
|
320
|
+
|
|
321
|
+
for (motor, pos), delay in zip(step.items(), delays):
|
|
322
|
+
if pos != pos_cache.get(motor):
|
|
323
|
+
yield bsu.Msg("set", motor, pos, group=grp)
|
|
324
|
+
yield bsu.Msg("wait", None, group=grp)
|
|
325
|
+
yield from bps.sleep(delay)
|
|
326
|
+
pos_cache[motor] = pos
|
|
327
|
+
|
|
328
|
+
yield from bps.trigger_and_read(list(detectors) + list(step.keys()))
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Nested Scans
|
|
332
|
+
```python
|
|
333
|
+
def nested_scan(detectors, outer_motor, outer_vals, inner_motor, inner_start, inner_stop, inner_num):
|
|
334
|
+
for val in outer_vals:
|
|
335
|
+
yield from bps.mv(outer_motor, val)
|
|
336
|
+
yield from bps.sleep(1.0) # Stabilization
|
|
337
|
+
yield from bp.scan(detectors, inner_motor, inner_start, inner_stop, inner_num)
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## plan-signature-best-practices
|
|
341
|
+
|
|
342
|
+
1. **Always include type hints** with Annotated for UI generation
|
|
343
|
+
2. **Order parameters**: detectors first, then motors, then scan parameters
|
|
344
|
+
3. **Use descriptive names**: energy_min/energy_max not e1/e2
|
|
345
|
+
4. **Provide sensible defaults** for optional parameters
|
|
346
|
+
5. **Write clear docstrings** with Args section
|
|
347
|
+
6. **Return type**: `Generator[Any, Any, Any]`
|
|
348
|
+
|
|
349
|
+
## complete-example
|
|
350
|
+
|
|
351
|
+
```python
|
|
352
|
+
def energy_scan_with_wait(
|
|
353
|
+
detectors: Annotated[
|
|
354
|
+
list[Detector],
|
|
355
|
+
DeviceFilter(group="areadetectors"),
|
|
356
|
+
DeviceDefault("PI_MTE3"),
|
|
357
|
+
],
|
|
358
|
+
energy_motor: Annotated[
|
|
359
|
+
Motor,
|
|
360
|
+
DeviceDefault("mono_energy"),
|
|
361
|
+
],
|
|
362
|
+
energy_min: Annotated[float, Unit("eV"), Range(100, 2000)],
|
|
363
|
+
energy_max: Annotated[float, Unit("eV"), Range(100, 2000)],
|
|
364
|
+
num_points: Annotated[int, Range(1, 500)],
|
|
365
|
+
wait_time: Annotated[float, Unit("s"), Default(1.0), Range(0, 60)] = 1.0,
|
|
366
|
+
collect_darks: bool = False,
|
|
367
|
+
) -> Generator[Any, Any, Any]:
|
|
368
|
+
"""Energy scan with configurable wait time at each point.
|
|
369
|
+
|
|
370
|
+
Scans through energy values with optional dark frame collection.
|
|
371
|
+
|
|
372
|
+
Args:
|
|
373
|
+
detectors: Detectors to read at each point.
|
|
374
|
+
energy_motor: Monochromator energy motor.
|
|
375
|
+
energy_min: Starting energy in eV.
|
|
376
|
+
energy_max: Ending energy in eV.
|
|
377
|
+
num_points: Number of energy points.
|
|
378
|
+
wait_time: Time to wait after energy move before reading.
|
|
379
|
+
collect_darks: Whether to collect dark frames.
|
|
380
|
+
|
|
381
|
+
Yields:
|
|
382
|
+
Bluesky plan messages.
|
|
383
|
+
"""
|
|
384
|
+
def custom_trigger(dets, name="primary"):
|
|
385
|
+
yield from bps.sleep(wait_time)
|
|
386
|
+
yield from bps.trigger_and_read(dets, name=name)
|
|
387
|
+
if collect_darks:
|
|
388
|
+
yield from bps.trigger_and_read(dets, name="dark")
|
|
389
|
+
|
|
390
|
+
def custom_step(detectors, step, pos_cache):
|
|
391
|
+
yield from bps.one_nd_step(detectors, step, pos_cache, take_reading=custom_trigger)
|
|
392
|
+
|
|
393
|
+
yield from bp.scan(
|
|
394
|
+
detectors,
|
|
395
|
+
energy_motor, energy_min, energy_max, num_points,
|
|
396
|
+
per_step=custom_step,
|
|
397
|
+
)
|
|
398
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Plan design skill plugin.
|
|
2
|
+
|
|
3
|
+
Provides Claude with expertise for designing Bluesky plans with
|
|
4
|
+
Lightfall UI annotations for procedural UI generation.
|
|
5
|
+
|
|
6
|
+
Full API documentation is shipped as references/plan_design.md alongside
|
|
7
|
+
the SKILL.md and surfaced lazily by the SDK's deferred Skill tool.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
from lightfall.plugins.agent_plugin import AgentPlugin
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PlanDesignAgent(AgentPlugin):
|
|
19
|
+
"""Skill for designing Bluesky plans.
|
|
20
|
+
|
|
21
|
+
This skill provides Claude with deep expertise for:
|
|
22
|
+
- Bluesky plan_stubs (bps) for low-level building blocks
|
|
23
|
+
- Standard Bluesky plans (bp) for high-level scan patterns
|
|
24
|
+
- Lightfall UI annotations for procedural UI generation
|
|
25
|
+
- Best practices for plan composition and error handling
|
|
26
|
+
|
|
27
|
+
Full API documentation is in references/plan_design.md (loaded by
|
|
28
|
+
the SDK's deferred Skill tool when this skill is invoked).
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def name(self) -> str:
|
|
33
|
+
"""Return unique identifier for this skill."""
|
|
34
|
+
return "plan_design"
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def display_name(self) -> str:
|
|
38
|
+
"""Return human-readable display name."""
|
|
39
|
+
return "Bluesky Plan Design"
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def description(self) -> str:
|
|
43
|
+
"""Return description of this skill's capabilities."""
|
|
44
|
+
return "Expertise in designing Bluesky plans with Lightfall UI annotations"
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def category(self) -> str:
|
|
48
|
+
"""Return category for grouping in settings UI."""
|
|
49
|
+
return "development"
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def enabled_by_default(self) -> bool:
|
|
53
|
+
"""Return whether this skill is enabled by default."""
|
|
54
|
+
return True
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def priority(self) -> int:
|
|
58
|
+
"""Return priority (lower = higher in prompt order)."""
|
|
59
|
+
return 15
|
|
60
|
+
|
|
61
|
+
def get_brief_description(self) -> str:
|
|
62
|
+
"""Return brief hint for system prompt (full docs are on-demand)."""
|
|
63
|
+
return """## Bluesky Plan Design
|
|
64
|
+
|
|
65
|
+
Expert at designing Bluesky plans for Lightfall with UI annotations.
|
|
66
|
+
|
|
67
|
+
**See `references/plan_design.md` (loaded automatically by the SDK Skill tool)** for full API reference covering:
|
|
68
|
+
- `bluesky.plan_stubs` (bps.*) - movement, timing, reading stubs
|
|
69
|
+
- `bluesky.plans` (bp.*) - scan, grid_scan, count, etc.
|
|
70
|
+
- `lightfall.ui.annotations` - Unit, Range, DeviceFilter, etc.
|
|
71
|
+
|
|
72
|
+
Key imports: `from bluesky import plan_stubs as bps, plans as bp`
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
def get_system_prompt(self) -> str:
|
|
76
|
+
"""Return the system prompt snippet for plan design expertise.
|
|
77
|
+
|
|
78
|
+
Returns the brief description; full documentation in references/
|
|
79
|
+
is loaded on-demand by the SDK's deferred Skill tool.
|
|
80
|
+
"""
|
|
81
|
+
return self.get_brief_description()
|
|
82
|
+
|
|
83
|
+
def create_tools(self) -> list[Any]:
|
|
84
|
+
"""Return tools provided by this skill."""
|
|
85
|
+
# This skill provides guidance only, no additional tools
|
|
86
|
+
return []
|
|
87
|
+
|
|
88
|
+
def get_references_dir(self) -> Path | None:
|
|
89
|
+
"""Return path to the references directory containing supplementary docs."""
|
|
90
|
+
return Path(__file__).parent / "plan_design" / "references"
|