openforma 0.4.0__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.
- forma_cli/__init__.py +5 -0
- forma_cli/app.py +1139 -0
- forma_cli/config.py +112 -0
- forma_cli/credentials.py +141 -0
- forma_cli/local.py +562 -0
- forma_cli/metadata_api.py +138 -0
- forma_cli/project_artifacts.py +182 -0
- forma_cli/sdk.py +571 -0
- forma_core/__init__.py +9 -0
- forma_core/__main__.py +4 -0
- forma_core/_version.py +3 -0
- forma_core/agents/__init__.py +50 -0
- forma_core/agents/clarification.py +194 -0
- forma_core/agents/component_reconciliation.py +99 -0
- forma_core/agents/context_gathering.py +115 -0
- forma_core/agents/continuous.py +537 -0
- forma_core/agents/contracts.py +247 -0
- forma_core/agents/firecrawl_mcp.py +484 -0
- forma_core/agents/lattice.py +239 -0
- forma_core/agents/orchestrator.py +3724 -0
- forma_core/agents/pipeline.py +843 -0
- forma_core/agents/project_correction.py +83 -0
- forma_core/agents/prompt_compaction.py +428 -0
- forma_core/agents/system_architecture.py +345 -0
- forma_core/agents/video_correction.py +119 -0
- forma_core/agents/web_research_workflow.py +1256 -0
- forma_core/agents/workflows.py +176 -0
- forma_core/assets/__init__.py +1 -0
- forma_core/assets/models.py +156 -0
- forma_core/assets/project.py +17 -0
- forma_core/assets/repository.py +48 -0
- forma_core/assets/service.py +142 -0
- forma_core/assets/validation.py +35 -0
- forma_core/benchmarks/__init__.py +5 -0
- forma_core/benchmarks/ir_triad_v1.py +477 -0
- forma_core/biology/__init__.py +28 -0
- forma_core/biology/benchmark.py +80 -0
- forma_core/biology/ewart_liverchip.py +279 -0
- forma_core/biology/ir.py +25 -0
- forma_core/biology/liverbench.py +416 -0
- forma_core/biology/liverbench_assay.py +251 -0
- forma_core/biology/liverbench_baselines.py +133 -0
- forma_core/biology/liverbench_independent.py +229 -0
- forma_core/biology/liverchip_demo.py +154 -0
- forma_core/biology/liverchip_evidence.py +149 -0
- forma_core/biology/models.py +247 -0
- forma_core/biology/validation.py +72 -0
- forma_core/cad_migrations/__init__.py +6 -0
- forma_core/cad_migrations/cli.py +101 -0
- forma_core/cad_migrations/emitters.py +227 -0
- forma_core/cad_migrations/models.py +121 -0
- forma_core/cad_migrations/planner.py +68 -0
- forma_core/chemistry/__init__.py +5 -0
- forma_core/chemistry/models.py +215 -0
- forma_core/chemistry/stoichiometry.py +272 -0
- forma_core/chemistry/validation.py +179 -0
- forma_core/cli/__init__.py +1 -0
- forma_core/cli/__main__.py +4 -0
- forma_core/cli/main.py +370 -0
- forma_core/config/__init__.py +28 -0
- forma_core/config/compatibility.py +282 -0
- forma_core/config/contract.py +184 -0
- forma_core/config/environment.py +129 -0
- forma_core/config/parti.py +34 -0
- forma_core/config/runtime.py +303 -0
- forma_core/control/__init__.py +10 -0
- forma_core/control/actions.py +136 -0
- forma_core/control/adapters.py +36 -0
- forma_core/control/cli.py +49 -0
- forma_core/control/client.py +124 -0
- forma_core/control/models.py +168 -0
- forma_core/control/opencode_worker.py +80 -0
- forma_core/control/package.py +318 -0
- forma_core/control/rover_scene/__init__.py +1 -0
- forma_core/control/rover_scene/__main__.py +34 -0
- forma_core/control/rover_scene/assets.py +65 -0
- forma_core/control/rover_scene/fleet.py +214 -0
- forma_core/control/rover_scene/host.py +258 -0
- forma_core/control/rover_scene/kinematics.py +35 -0
- forma_core/control/rover_scene/machine.py +347 -0
- forma_core/control/rover_scene/robot.py +166 -0
- forma_core/control/rover_scene/scene.py +206 -0
- forma_core/control/rover_scene/view.py +80 -0
- forma_core/control/rover_scene/web/index.html +25 -0
- forma_core/control/rover_scene/web/viewer.js +148 -0
- forma_core/control/runtime.py +356 -0
- forma_core/control/so101.py +235 -0
- forma_core/control/tasks.py +287 -0
- forma_core/database.py +2362 -0
- forma_core/debug.py +314 -0
- forma_core/domains/__init__.py +7 -0
- forma_core/domains/agents.py +85 -0
- forma_core/domains/base.py +69 -0
- forma_core/domains/benchmark.py +87 -0
- forma_core/domains/cli.py +48 -0
- forma_core/domains/compatibility.py +234 -0
- forma_core/domains/composition.py +372 -0
- forma_core/domains/diagnostics.py +15 -0
- forma_core/domains/generation.py +479 -0
- forma_core/domains/interaction.py +301 -0
- forma_core/domains/planning.py +140 -0
- forma_core/domains/providers.py +214 -0
- forma_core/domains/registry.py +267 -0
- forma_core/domains/selection.py +75 -0
- forma_core/domains/storage.py +60 -0
- forma_core/domains/tools.py +180 -0
- forma_core/electronics/__init__.py +1 -0
- forma_core/electronics/models.py +84 -0
- forma_core/electronics/primitives.py +43 -0
- forma_core/electronics/rules.py +340 -0
- forma_core/external_sources.py +497 -0
- forma_core/fabricator/__init__.py +33 -0
- forma_core/fabricator/__main__.py +7 -0
- forma_core/fabricator/main.py +578 -0
- forma_core/firmware/__init__.py +60 -0
- forma_core/firmware/drivers.py +140 -0
- forma_core/firmware/examples.py +503 -0
- forma_core/firmware/generate.py +520 -0
- forma_core/firmware/models.py +34 -0
- forma_core/firmware/sil/__init__.py +5 -0
- forma_core/firmware/sil/adapter.py +71 -0
- forma_core/firmware/sil/build.py +49 -0
- forma_core/firmware/sil/native/CMakeLists.txt +9 -0
- forma_core/firmware/sil/native/bridge.cpp +112 -0
- forma_core/firmware/sil/native/controller.cpp +123 -0
- forma_core/firmware/sil/native/controller.h +49 -0
- forma_core/firmware/sil/simulator.py +139 -0
- forma_core/firmware/targets.py +111 -0
- forma_core/firmware/validation.py +130 -0
- forma_core/fluidics/__init__.py +6 -0
- forma_core/fluidics/benchmark.py +217 -0
- forma_core/fluidics/calculations.py +79 -0
- forma_core/fluidics/examples.py +54 -0
- forma_core/fluidics/ir.py +25 -0
- forma_core/fluidics/models.py +132 -0
- forma_core/fluidics/topology.py +47 -0
- forma_core/fluidics/validation.py +134 -0
- forma_core/generation.py +32 -0
- forma_core/geometry_bindings/__init__.py +20 -0
- forma_core/geometry_bindings/cad_adapter.py +80 -0
- forma_core/geometry_bindings/models.py +163 -0
- forma_core/geometry_bindings/resolution.py +340 -0
- forma_core/geometry_bindings/tools.py +125 -0
- forma_core/image_providers.py +3049 -0
- forma_core/images.py +3 -0
- forma_core/integrations/__init__.py +1 -0
- forma_core/integrations/huggingface/__init__.py +29 -0
- forma_core/integrations/huggingface/huggingface_artifacts.py +272 -0
- forma_core/jobs/__init__.py +1 -0
- forma_core/jobs/context.py +277 -0
- forma_core/jobs/continuous.py +719 -0
- forma_core/jobs/metrics.py +124 -0
- forma_core/jobs/migrations.py +161 -0
- forma_core/jobs/persistence.py +28 -0
- forma_core/jobs/repositories.py +422 -0
- forma_core/jobs/schema.py +28 -0
- forma_core/jobs/source_usage.py +230 -0
- forma_core/jobs/store.py +476 -0
- forma_core/llm.py +3 -0
- forma_core/llm_providers.py +2682 -0
- forma_core/logs.py +107 -0
- forma_core/mechanics/__init__.py +1 -0
- forma_core/mechanics/gear_benchmark.py +85 -0
- forma_core/mechanics/mechanism_benchmarks.py +345 -0
- forma_core/mechanics/models.py +72 -0
- forma_core/mechanics/primitives.py +109 -0
- forma_core/mechanics/solid_cad.py +83 -0
- forma_core/observability.py +237 -0
- forma_core/openai_streams.py +780 -0
- forma_core/opencode/__init__.py +25 -0
- forma_core/opencode/architecture.py +82 -0
- forma_core/opencode/capabilities.py +130 -0
- forma_core/opencode/models.py +419 -0
- forma_core/opencode/persistence.py +62 -0
- forma_core/opencode/public_events.py +91 -0
- forma_core/opencode/schema.py +28 -0
- forma_core/opencode/store.py +874 -0
- forma_core/persistence/__init__.py +16 -0
- forma_core/persistence/base.py +38 -0
- forma_core/persistence/images.py +598 -0
- forma_core/persistence/migrations.py +200 -0
- forma_core/persistence/models.py +439 -0
- forma_core/persistence/project_artifacts.py +341 -0
- forma_core/persistence/project_reconciliation.py +1094 -0
- forma_core/persistence/providers/__init__.py +4 -0
- forma_core/persistence/providers/sqlite.py +114 -0
- forma_core/persistence/providers/supabase.py +31 -0
- forma_core/persistence/repositories/__init__.py +9 -0
- forma_core/persistence/repositories/base.py +335 -0
- forma_core/persistence/repositories/sqlite.py +1571 -0
- forma_core/persistence/repositories/supabase.py +1576 -0
- forma_core/persistence/schema.py +176 -0
- forma_core/processes/__init__.py +5 -0
- forma_core/processes/models.py +338 -0
- forma_core/processes/validation.py +141 -0
- forma_core/project_list_cache.py +316 -0
- forma_core/prompt_continuity.py +387 -0
- forma_core/providers/__init__.py +39 -0
- forma_core/providers/base.py +28 -0
- forma_core/providers/models.py +138 -0
- forma_core/providers/openai.py +92 -0
- forma_core/providers/openai_compatible.py +190 -0
- forma_core/providers/registry.py +68 -0
- forma_core/providers/registry_utils.py +46 -0
- forma_core/py.typed +1 -0
- forma_core/runtime.py +3 -0
- forma_core/selectors.py +36 -0
- forma_core/signups/__init__.py +5 -0
- forma_core/signups/models.py +49 -0
- forma_core/terminal/__init__.py +1 -0
- forma_core/terminal/dashboard.py +475 -0
- forma_core/terminal/images.py +156 -0
- forma_core/thermal/__init__.py +5 -0
- forma_core/thermal/models.py +361 -0
- forma_core/thermal/validation.py +175 -0
- forma_core/user_integrations.py +2069 -0
- forma_core/utils.py +291 -0
- forma_core/validation.py +83 -0
- forma_core/vertex_auth.py +92 -0
- forma_core/video_prompts.py +193 -0
- forma_core/video_review.py +1006 -0
- forma_core/wiring.py +356 -0
- forma_core/workers/__init__.py +120 -0
- forma_core/workers/contracts.py +183 -0
- forma_core/workers/generation.py +753 -0
- forma_core/workers/orchestration.py +805 -0
- forma_core/workers/registry.py +222 -0
- forma_core/workers/reverse_engineering.py +272 -0
- forma_core/workers/validation.py +291 -0
- forma_core/workspaces/__init__.py +5 -0
- forma_core/workspaces/chats/__init__.py +11 -0
- forma_core/workspaces/chats/models.py +48 -0
- forma_core/workspaces/context/__init__.py +15 -0
- forma_core/workspaces/context/agent.py +260 -0
- forma_core/workspaces/context/models.py +117 -0
- forma_core/workspaces/context/pdf.py +418 -0
- forma_core/workspaces/design_briefs/__init__.py +25 -0
- forma_core/workspaces/design_briefs/models.py +85 -0
- forma_core/workspaces/design_briefs/references.py +56 -0
- forma_core/workspaces/models.py +41 -0
- forma_core/workspaces/projects/__init__.py +88 -0
- forma_core/workspaces/projects/cad_generation.py +1016 -0
- forma_core/workspaces/projects/context_governance.py +365 -0
- forma_core/workspaces/projects/design_lifecycle.py +668 -0
- forma_core/workspaces/projects/fabrication/__init__.py +54 -0
- forma_core/workspaces/projects/fabrication/demo_printers.py +236 -0
- forma_core/workspaces/projects/fabrication/models.py +120 -0
- forma_core/workspaces/projects/fabrication/printer_config.py +205 -0
- forma_core/workspaces/projects/fabrication/slicers/__init__.py +7 -0
- forma_core/workspaces/projects/fabrication/slicers/base.py +25 -0
- forma_core/workspaces/projects/fabrication/slicers/cura.py +125 -0
- forma_core/workspaces/projects/fabrication/slicers/orca.py +208 -0
- forma_core/workspaces/projects/fabrication/slicing.py +202 -0
- forma_core/workspaces/projects/fabrication/validation.py +103 -0
- forma_core/workspaces/projects/gear_benchmark.py +6 -0
- forma_core/workspaces/projects/generation_mode.py +70 -0
- forma_core/workspaces/projects/identity.py +28 -0
- forma_core/workspaces/projects/iteration.py +680 -0
- forma_core/workspaces/projects/manifest.py +362 -0
- forma_core/workspaces/projects/mechanism_benchmarks.py +12 -0
- forma_core/workspaces/projects/models.py +913 -0
- forma_core/workspaces/projects/objects.py +731 -0
- forma_core/workspaces/projects/outcomes.py +47 -0
- forma_core/workspaces/projects/output.py +735 -0
- forma_core/workspaces/projects/resolver.py +397 -0
- forma_core/workspaces/projects/solid_cad.py +8 -0
- forma_core/workspaces/projects/state.py +622 -0
- forma_core/workspaces/readiness/__init__.py +28 -0
- forma_core/workspaces/readiness/evaluator.py +103 -0
- forma_core/workspaces/readiness/models.py +97 -0
- forma_core/workspaces/readiness/service.py +225 -0
- forma_core/workspaces/reverse_engineering/__init__.py +37 -0
- forma_core/workspaces/reverse_engineering/analyzer.py +246 -0
- forma_core/workspaces/reverse_engineering/models.py +128 -0
- forma_core/workspaces/validation/__init__.py +37 -0
- forma_core/workspaces/validation/evaluator.py +327 -0
- forma_core/workspaces/validation/models.py +146 -0
- forma_core/workspaces/validation/service.py +212 -0
- forma_core/workspaces/workflow/__init__.py +29 -0
- forma_core/workspaces/workflow/guard.py +33 -0
- forma_core/workspaces/workflow/models.py +77 -0
- forma_core/workspaces/workflow/service.py +287 -0
- openforma-0.4.0.dist-info/METADATA +247 -0
- openforma-0.4.0.dist-info/RECORD +288 -0
- openforma-0.4.0.dist-info/WHEEL +5 -0
- openforma-0.4.0.dist-info/entry_points.txt +4 -0
- openforma-0.4.0.dist-info/licenses/LICENSE +373 -0
- openforma-0.4.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Explicit generation strategy selection for Forma projects.
|
|
2
|
+
|
|
3
|
+
Regular generation preserves the existing one-shot pipeline and is the default
|
|
4
|
+
for projects that do not opt into a mode. Progressive generation enables the
|
|
5
|
+
cost-aware hierarchical lifecycle introduced by issue #511 / PR #512.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from enum import Enum
|
|
11
|
+
from typing import Any, Mapping
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
GENERATION_MODE_METADATA_KEY = "generation_mode"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class GenerationMode(str, Enum):
|
|
18
|
+
"""Top-level project generation strategy."""
|
|
19
|
+
|
|
20
|
+
REGULAR = "regular"
|
|
21
|
+
PROGRESSIVE = "progressive"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_generation_mode(project_or_metadata: Any) -> GenerationMode:
|
|
25
|
+
"""Return the persisted generation mode, defaulting safely to regular.
|
|
26
|
+
|
|
27
|
+
The mode is intentionally explicit. Presence of design-brief, lifecycle,
|
|
28
|
+
image, or approval metadata must never opt a project into progressive
|
|
29
|
+
generation by itself.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
if isinstance(project_or_metadata, Mapping):
|
|
33
|
+
metadata = project_or_metadata
|
|
34
|
+
else:
|
|
35
|
+
metadata = getattr(project_or_metadata, "assembly_metadata", None) or {}
|
|
36
|
+
|
|
37
|
+
raw = metadata.get(GENERATION_MODE_METADATA_KEY)
|
|
38
|
+
if raw in (None, ""):
|
|
39
|
+
return GenerationMode.REGULAR
|
|
40
|
+
try:
|
|
41
|
+
return raw if isinstance(raw, GenerationMode) else GenerationMode(str(raw).strip().lower())
|
|
42
|
+
except ValueError:
|
|
43
|
+
# Unknown persisted values should not silently enable expensive behavior.
|
|
44
|
+
return GenerationMode.REGULAR
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def is_progressive_generation(project_or_metadata: Any) -> bool:
|
|
48
|
+
"""Return True only for an explicit progressive-mode opt in."""
|
|
49
|
+
|
|
50
|
+
return get_generation_mode(project_or_metadata) == GenerationMode.PROGRESSIVE
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def set_generation_mode(project: Any, mode: GenerationMode | str) -> GenerationMode:
|
|
54
|
+
"""Persist a validated generation mode on a HardwareIntermediateRepresentation-compatible object."""
|
|
55
|
+
|
|
56
|
+
normalized = mode if isinstance(mode, GenerationMode) else GenerationMode(str(mode).strip().lower())
|
|
57
|
+
project.assembly_metadata = {
|
|
58
|
+
**(getattr(project, "assembly_metadata", None) or {}),
|
|
59
|
+
GENERATION_MODE_METADATA_KEY: normalized.value,
|
|
60
|
+
}
|
|
61
|
+
return normalized
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
__all__ = [
|
|
65
|
+
"GENERATION_MODE_METADATA_KEY",
|
|
66
|
+
"GenerationMode",
|
|
67
|
+
"get_generation_mode",
|
|
68
|
+
"is_progressive_generation",
|
|
69
|
+
"set_generation_mode",
|
|
70
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Shared identity types for every project creation channel."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from enum import StrEnum
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ProjectCreationChannel(StrEnum):
|
|
10
|
+
"""The product surface through which a project entered Forma."""
|
|
11
|
+
|
|
12
|
+
HOSTED = "hosted"
|
|
13
|
+
CLI = "cli"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass(frozen=True)
|
|
17
|
+
class ProjectIdentity:
|
|
18
|
+
"""Common project identity shared by hosted and CLI project variants."""
|
|
19
|
+
|
|
20
|
+
project_id: str
|
|
21
|
+
owner_user_id: str | None
|
|
22
|
+
title: str
|
|
23
|
+
creation_channel: ProjectCreationChannel
|
|
24
|
+
created_at: str
|
|
25
|
+
updated_at: str | None = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
__all__ = ["ProjectCreationChannel", "ProjectIdentity"]
|