velm 0.1.2__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.
- velm/__init__.py +17 -0
- velm/__main__.py +24 -0
- velm/archetypes/__init__.py +10 -0
- velm/archetypes/genesis/ai-agent-swarm.scaffold +117 -0
- velm/archetypes/genesis/astro-basic.scaffold +76 -0
- velm/archetypes/genesis/chrome-extension.scaffold +101 -0
- velm/archetypes/genesis/cli-tool.scaffold +198 -0
- velm/archetypes/genesis/data-science-crucible.scaffold +96 -0
- velm/archetypes/genesis/docs-mkdocs.scaffold +123 -0
- velm/archetypes/genesis/electron-forge.scaffold +103 -0
- velm/archetypes/genesis/express-api.scaffold +163 -0
- velm/archetypes/genesis/fastapi-service.scaffold +343 -0
- velm/archetypes/genesis/fastapi-sqlalchemy.scaffold +130 -0
- velm/archetypes/genesis/fullstack-monorepo.scaffold +200 -0
- velm/archetypes/genesis/generic-container.scaffold +188 -0
- velm/archetypes/genesis/generic-script.scaffold +48 -0
- velm/archetypes/genesis/generic.scaffold +33 -0
- velm/archetypes/genesis/gnostic-library.scaffold +79 -0
- velm/archetypes/genesis/gnostic-symphony.scaffold +77 -0
- velm/archetypes/genesis/go-cli.scaffold +127 -0
- velm/archetypes/genesis/graphene-api.scaffold +86 -0
- velm/archetypes/genesis/grpc-microservice.scaffold +103 -0
- velm/archetypes/genesis/langchain-nexus.scaffold +91 -0
- velm/archetypes/genesis/monorepo-citadel.scaffold +0 -0
- velm/archetypes/genesis/new-artisan.scaffold +42 -0
- velm/archetypes/genesis/nextjs-fortress.scaffold +120 -0
- velm/archetypes/genesis/node-basic.scaffold +130 -0
- velm/archetypes/genesis/node.scaffold +63 -0
- velm/archetypes/genesis/poetry-basic.scaffold +114 -0
- velm/archetypes/genesis/python-basic.scaffold +115 -0
- velm/archetypes/genesis/python-cli.scaffold +124 -0
- velm/archetypes/genesis/python-universal.scaffold +159 -0
- velm/archetypes/genesis/react-vite.scaffold +198 -0
- velm/archetypes/genesis/rust-lib.scaffold +145 -0
- velm/archetypes/genesis/serverless-synapse.scaffold +61 -0
- velm/artisans/TODO.txt +4 -0
- velm/artisans/__init__.py +0 -0
- velm/artisans/adopt.py +194 -0
- velm/artisans/aether/__init__.py +4 -0
- velm/artisans/aether/analyzer.py +56 -0
- velm/artisans/aether/artisan.py +40 -0
- velm/artisans/aether/mesh.py +27 -0
- velm/artisans/agent/Act/__init__.py +0 -0
- velm/artisans/agent/Act/executor.py +83 -0
- velm/artisans/agent/Act/tools/__init__.py +0 -0
- velm/artisans/agent/Act/tools/base.py +25 -0
- velm/artisans/agent/Act/tools/file_system.py +144 -0
- velm/artisans/agent/Act/tools/git.py +258 -0
- velm/artisans/agent/Act/tools/gnostic_tools.py +236 -0
- velm/artisans/agent/Act/tools/testing.py +42 -0
- velm/artisans/agent/Memory/__init__.py +0 -0
- velm/artisans/agent/Memory/long_term.py +187 -0
- velm/artisans/agent/Memory/short_term.py +33 -0
- velm/artisans/agent/Perceive/__init__.py +1 -0
- velm/artisans/agent/Perceive/perceiver.py +41 -0
- velm/artisans/agent/Plan/__init__.py +1 -0
- velm/artisans/agent/Plan/planner.py +61 -0
- velm/artisans/agent/Plan/prompt_forge.py +146 -0
- velm/artisans/agent/Verify/__init__.py +0 -0
- velm/artisans/agent/Verify/critic.py +177 -0
- velm/artisans/agent/__init__.py +3 -0
- velm/artisans/agent/agent.scaffold +32 -0
- velm/artisans/agent/artisan.py +174 -0
- velm/artisans/agent/contracts.py +42 -0
- velm/artisans/agent/engine.py +208 -0
- velm/artisans/akasha/__init__.py +0 -0
- velm/artisans/akasha/artisan.py +68 -0
- velm/artisans/alias/__init__.py +3 -0
- velm/artisans/alias/artisan.py +69 -0
- velm/artisans/analyze/__init__.py +13 -0
- velm/artisans/analyze/artisan.py +457 -0
- velm/artisans/analyze/completion_codex/__init__.py +11 -0
- velm/artisans/analyze/completion_codex/conductor.py +213 -0
- velm/artisans/analyze/completion_codex/scaffold.py +615 -0
- velm/artisans/analyze/completion_codex/symphony.py +275 -0
- velm/artisans/analyze/core/context.py +107 -0
- velm/artisans/analyze/core/shadow.py +57 -0
- velm/artisans/analyze/divination/grammar.py +145 -0
- velm/artisans/analyze/graph_generator.py +57 -0
- velm/artisans/analyze/orchestrator.py +138 -0
- velm/artisans/analyze/processing/base.py +13 -0
- velm/artisans/analyze/processing/foreign.py +67 -0
- velm/artisans/analyze/processing/scaffold.py +319 -0
- velm/artisans/analyze/redemption/healer.py +82 -0
- velm/artisans/analyze/reporting/console.py +95 -0
- velm/artisans/analyze/reporting/diagnostics.py +169 -0
- velm/artisans/analyze/reporting/privacy.py +86 -0
- velm/artisans/analyze/rites/inquisition.py +35 -0
- velm/artisans/analyze/rites/prophecy.py +74 -0
- velm/artisans/analyze/rites/symbolism.py +62 -0
- velm/artisans/analyze/rites/visualization.py +146 -0
- velm/artisans/analyze/static_inquisitor/__init__.py +5 -0
- velm/artisans/analyze/static_inquisitor/detectors/atomic.py +325 -0
- velm/artisans/analyze/static_inquisitor/detectors/base.py +116 -0
- velm/artisans/analyze/static_inquisitor/detectors/paths.py +184 -0
- velm/artisans/analyze/static_inquisitor/detectors/variables.py +202 -0
- velm/artisans/analyze/static_inquisitor/inquisitor.py +101 -0
- velm/artisans/analyze/structure_visualizer.py +294 -0
- velm/artisans/arch.py +281 -0
- velm/artisans/archetypes/artisan.py +242 -0
- velm/artisans/architect/__init__.py +13 -0
- velm/artisans/architect/artisan.py +241 -0
- velm/artisans/architect/contracts.py +19 -0
- velm/artisans/architect/inquest.py +58 -0
- velm/artisans/architect/planner.py +85 -0
- velm/artisans/astrolabe/__init__.py +4 -0
- velm/artisans/astrolabe/artisan.py +45 -0
- velm/artisans/astrolabe/tui.py +124 -0
- velm/artisans/audit/__init__.py +5 -0
- velm/artisans/audit/architectural_auditor.py +124 -0
- velm/artisans/audit/artisan.py +38 -0
- velm/artisans/audit/license_auditor.py +158 -0
- velm/artisans/babel/__init__.py +0 -0
- velm/artisans/babel/artisan.py +93 -0
- velm/artisans/beautify.py +250 -0
- velm/artisans/biome/__init__.py +5 -0
- velm/artisans/biome/analyst.py +102 -0
- velm/artisans/biome/artisan.py +55 -0
- velm/artisans/biome/template.py +298 -0
- velm/artisans/blame.py +334 -0
- velm/artisans/blueprint_add.py +200 -0
- velm/artisans/blueprint_optimize/__init__.py +2 -0
- velm/artisans/blueprint_optimize/artisan.py +105 -0
- velm/artisans/blueprint_optimize/biologist.py +115 -0
- velm/artisans/blueprint_remove.py +225 -0
- velm/artisans/bridge/__init__.py +3 -0
- velm/artisans/bridge/artisan.py +137 -0
- velm/artisans/canon/__init__.py +4 -0
- velm/artisans/canon/artisan.py +51 -0
- velm/artisans/canon/law.py +23 -0
- velm/artisans/changelog/artisan.py +137 -0
- velm/artisans/chaos_game/__init__.py +3 -0
- velm/artisans/chaos_game/artisan.py +93 -0
- velm/artisans/ci_optimize/__init__.py +2 -0
- velm/artisans/ci_optimize/artisan.py +97 -0
- velm/artisans/ci_optimize/engine.py +122 -0
- velm/artisans/cli_bridge/artisan.py +199 -0
- velm/artisans/codex/__init__.py +0 -0
- velm/artisans/codex/artisan.py +130 -0
- velm/artisans/completion_artisan/__init__.py +10 -0
- velm/artisans/completion_artisan/artisan.py +286 -0
- velm/artisans/completion_artisan/cartographer.py +424 -0
- velm/artisans/completion_artisan/grimoire/reader.py +164 -0
- velm/artisans/completion_artisan/grimoire/snippets/scaffold.jsonc +1728 -0
- velm/artisans/completion_artisan/grimoire/snippets/symphony.jsonc +1073 -0
- velm/artisans/completion_artisan/prophets/__init__.py +13 -0
- velm/artisans/completion_artisan/prophets/alchemist.py +205 -0
- velm/artisans/completion_artisan/prophets/base.py +133 -0
- velm/artisans/completion_artisan/prophets/canon.py +156 -0
- velm/artisans/completion_artisan/prophets/directives.py +242 -0
- velm/artisans/completion_artisan/prophets/snippets.py +24 -0
- velm/artisans/compose/__init__.py +14 -0
- velm/artisans/compose/artisan.py +198 -0
- velm/artisans/compose/parser.py +220 -0
- velm/artisans/configuration/__init__.py +2 -0
- velm/artisans/configuration/artisan.py +81 -0
- velm/artisans/conform.py +260 -0
- velm/artisans/create/__init__.py +13 -0
- velm/artisans/create/artisan.py +240 -0
- velm/artisans/create/builder.py +477 -0
- velm/artisans/create/create.scaffold +7 -0
- velm/artisans/create/safety.py +70 -0
- velm/artisans/daemon_artisan/__init__.py +14 -0
- velm/artisans/daemon_artisan/conductor.py +122 -0
- velm/artisans/daemon_artisan/contracts.py +23 -0
- velm/artisans/daemon_artisan/governance.py +22 -0
- velm/artisans/daemon_artisan/lifecycle.py +498 -0
- velm/artisans/daemon_artisan/telemetry.py +63 -0
- velm/artisans/data/__init__.py +0 -0
- velm/artisans/data/artisan.py +152 -0
- velm/artisans/definition/__init__.py +17 -0
- velm/artisans/definition/alchemist.py +48 -0
- velm/artisans/definition/hierophant.py +138 -0
- velm/artisans/definition/oracle.py +148 -0
- velm/artisans/deploy/__init__.py +14 -0
- velm/artisans/deploy/artisan.py +237 -0
- velm/artisans/distill/__init__.py +15 -0
- velm/artisans/distill/artisan.py +407 -0
- velm/artisans/distill/celestial.py +55 -0
- velm/artisans/distill/codex_of_anti_patterns.py +54 -0
- velm/artisans/distill/core/__init__.py +14 -0
- velm/artisans/distill/core/analyzer/architectural.py +93 -0
- velm/artisans/distill/core/assembler/__init__.py +14 -0
- velm/artisans/distill/core/assembler/budget.py +37 -0
- velm/artisans/distill/core/assembler/content/__init__.py +14 -0
- velm/artisans/distill/core/assembler/content/artisans/__init__.py +19 -0
- velm/artisans/distill/core/assembler/content/artisans/annotator.py +102 -0
- velm/artisans/distill/core/assembler/content/artisans/formatter.py +352 -0
- velm/artisans/distill/core/assembler/content/artisans/reader.py +35 -0
- velm/artisans/distill/core/assembler/content/artisans/sanitizer.py +39 -0
- velm/artisans/distill/core/assembler/content/artisans/summarizer.py +60 -0
- velm/artisans/distill/core/assembler/content/artisans/transformer.py +46 -0
- velm/artisans/distill/core/assembler/content/contracts.py +35 -0
- velm/artisans/distill/core/assembler/content/facade.py +84 -0
- velm/artisans/distill/core/assembler/content/orchestrator.py +96 -0
- velm/artisans/distill/core/assembler/contracts.py +25 -0
- velm/artisans/distill/core/assembler/engine.py +212 -0
- velm/artisans/distill/core/assembler/header.py +84 -0
- velm/artisans/distill/core/assembler/seer.py +70 -0
- velm/artisans/distill/core/causality/__init__.py +15 -0
- velm/artisans/distill/core/causality/constants.py +30 -0
- velm/artisans/distill/core/causality/contracts.py +57 -0
- velm/artisans/distill/core/causality/engine.py +77 -0
- velm/artisans/distill/core/causality/graph_walker.py +138 -0
- velm/artisans/distill/core/consts.py +47 -0
- velm/artisans/distill/core/contracts.py +89 -0
- velm/artisans/distill/core/forensics/__init__.py +7 -0
- velm/artisans/distill/core/forensics/contracts.py +36 -0
- velm/artisans/distill/core/forensics/detectives.py +115 -0
- velm/artisans/distill/core/forensics/engine.py +121 -0
- velm/artisans/distill/core/forensics/filters.py +36 -0
- velm/artisans/distill/core/forensics/grimoire.py +48 -0
- velm/artisans/distill/core/governance/__init__.py +22 -0
- velm/artisans/distill/core/governance/contracts.py +51 -0
- velm/artisans/distill/core/governance/engine.py +273 -0
- velm/artisans/distill/core/governance/estimator.py +76 -0
- velm/artisans/distill/core/governance/policies.py +52 -0
- velm/artisans/distill/core/inquisitor/architectural.py +58 -0
- velm/artisans/distill/core/inquisitor/config.py +86 -0
- velm/artisans/distill/core/inquisitor/temporal.py +105 -0
- velm/artisans/distill/core/inquisitor/testing.py +59 -0
- velm/artisans/distill/core/oracle/__init__.py +18 -0
- velm/artisans/distill/core/oracle/adjudicator.py +113 -0
- velm/artisans/distill/core/oracle/contracts.py +66 -0
- velm/artisans/distill/core/oracle/diviner.py +222 -0
- velm/artisans/distill/core/oracle/engine.py +138 -0
- velm/artisans/distill/core/oracle/perceiver.py +121 -0
- velm/artisans/distill/core/oracle/propagator.py +304 -0
- velm/artisans/distill/core/oracle/reviewer.py +124 -0
- velm/artisans/distill/core/oracle/scribe/__init__.py +8 -0
- velm/artisans/distill/core/oracle/scribe/content.py +121 -0
- velm/artisans/distill/core/oracle/scribe/critique.py +57 -0
- velm/artisans/distill/core/oracle/scribe/facade.py +87 -0
- velm/artisans/distill/core/oracle/scribe/header.py +119 -0
- velm/artisans/distill/core/oracle/scribe/manifest.py +67 -0
- velm/artisans/distill/core/oracle/scribe/topology.py +54 -0
- velm/artisans/distill/core/scribes/mermaid_scribe.py +65 -0
- velm/artisans/distill/core/skeletonizer/__init__.py +7 -0
- velm/artisans/distill/core/skeletonizer/contracts.py +30 -0
- velm/artisans/distill/core/skeletonizer/engine.py +84 -0
- velm/artisans/distill/core/skeletonizer/utils.py +117 -0
- velm/artisans/distill/core/skeletonizer/visitors/base.py +15 -0
- velm/artisans/distill/core/skeletonizer/visitors/c_style.py +173 -0
- velm/artisans/distill/core/skeletonizer/visitors/python.py +170 -0
- velm/artisans/distill/core/skeletonizer/visitors/ruby.py +71 -0
- velm/artisans/distill/core/skeletonizer/visitors/web.py +57 -0
- velm/artisans/distill/core/slicer/__init__.py +15 -0
- velm/artisans/distill/core/slicer/contracts.py +76 -0
- velm/artisans/distill/core/slicer/engine.py +76 -0
- velm/artisans/distill/core/slicer/graph.py +95 -0
- velm/artisans/distill/core/slicer/languages/base.py +26 -0
- velm/artisans/distill/core/slicer/languages/python.py +87 -0
- velm/artisans/distill/core/slicer/weavers/__init__.py +4 -0
- velm/artisans/distill/core/slicer/weavers/base_strategy.py +28 -0
- velm/artisans/distill/core/slicer/weavers/contracts.py +21 -0
- velm/artisans/distill/core/slicer/weavers/facade.py +134 -0
- velm/artisans/distill/core/slicer/weavers/python_strategy.py +135 -0
- velm/artisans/distill/core/tracer/__init__.py +6 -0
- velm/artisans/distill/core/tracer/contracts.py +66 -0
- velm/artisans/distill/core/tracer/coverage_bridge.py +105 -0
- velm/artisans/distill/core/tracer/engine.py +170 -0
- velm/artisans/distill/core/tracer/probes/base.py +21 -0
- velm/artisans/distill/core/tracer/probes/python_probe.py +153 -0
- velm/artisans/distill/core/tracer/snapshot.py +58 -0
- velm/artisans/distill/core/tracer/symbolic.py +38 -0
- velm/artisans/distill/core/utils/__init__.py +1 -0
- velm/artisans/distill/core/utils/core.py +175 -0
- velm/artisans/distill/io.py +110 -0
- velm/artisans/distill/modes.py +81 -0
- velm/artisans/distill/resolution.py +185 -0
- velm/artisans/distill/scribes/dossier_scribe.py +196 -0
- velm/artisans/dream.py +41 -0
- velm/artisans/env_tools.py +298 -0
- velm/artisans/excise.py +213 -0
- velm/artisans/expose/__init__.py +3 -0
- velm/artisans/expose/artisan.py +64 -0
- velm/artisans/forge/__init__.py +3 -0
- velm/artisans/forge/artisan.py +117 -0
- velm/artisans/fortress/__init__.py +0 -0
- velm/artisans/fortress/artisan.py +86 -0
- velm/artisans/freeze_artisan.py +82 -0
- velm/artisans/fusion/__init__.py +3 -0
- velm/artisans/fusion/artisan.py +187 -0
- velm/artisans/garden/__init__.py +6 -0
- velm/artisans/garden/analyst.py +183 -0
- velm/artisans/garden/artisan.py +76 -0
- velm/artisans/garden/contracts.py +22 -0
- velm/artisans/garden/pruner.py +69 -0
- velm/artisans/genesis/__init__.py +6 -0
- velm/artisans/genesis/conductor.py +366 -0
- velm/artisans/genesis/materializer.py +514 -0
- velm/artisans/ghost_hunter/__init__.py +3 -0
- velm/artisans/ghost_hunter/artisan.py +106 -0
- velm/artisans/graph/__init__.py +3 -0
- velm/artisans/graph/architect.py +70 -0
- velm/artisans/graph/artisan.py +39 -0
- velm/artisans/graph/cartographer.py +275 -0
- velm/artisans/graph/layout.py +27 -0
- velm/artisans/gui/__init__.py +3 -0
- velm/artisans/gui/app.py +124 -0
- velm/artisans/gui/artisan.py +49 -0
- velm/artisans/guild/__init__.py +4 -0
- velm/artisans/guild/artisan.py +111 -0
- velm/artisans/guild/packer.py +33 -0
- velm/artisans/guild/registry.py +99 -0
- velm/artisans/harvest.py +206 -0
- velm/artisans/heal/__init__.py +6 -0
- velm/artisans/heal/artisan.py +306 -0
- velm/artisans/heal/contracts.py +74 -0
- velm/artisans/heal/healers/javascript_import_healer.py +150 -0
- velm/artisans/heal/healers/python_import_healer.py +149 -0
- velm/artisans/heal/healers/typescript_import_healer.py +165 -0
- velm/artisans/help.py +339 -0
- velm/artisans/history/__init__.py +15 -0
- velm/artisans/history/artisan.py +184 -0
- velm/artisans/history/contracts.py +80 -0
- velm/artisans/history/differ.py +248 -0
- velm/artisans/history/scribe.py +121 -0
- velm/artisans/history/tui.py +256 -0
- velm/artisans/hivemind/__init__.py +4 -0
- velm/artisans/hivemind/arena.py +174 -0
- velm/artisans/hivemind/artisan.py +66 -0
- velm/artisans/hivemind/contracts.py +36 -0
- velm/artisans/hivemind/grimoire.py +66 -0
- velm/artisans/holocron/__init__.py +4 -0
- velm/artisans/holocron/artisan.py +35 -0
- velm/artisans/holocron/contracts.py +21 -0
- velm/artisans/holocron/curator.py +63 -0
- velm/artisans/holocron/engine.py +154 -0
- velm/artisans/holocron/graph.py +209 -0
- velm/artisans/holocron/slicer.py +135 -0
- velm/artisans/holograph_artisan.py +98 -0
- velm/artisans/holographic/__init__.py +3 -0
- velm/artisans/holographic/artisan.py +59 -0
- velm/artisans/hover/__init__.py +16 -0
- velm/artisans/hover/canon.py +46 -0
- velm/artisans/hover/command_grimoire.py +1147 -0
- velm/artisans/hover/formatter.py +290 -0
- velm/artisans/hover/hierophant.py +457 -0
- velm/artisans/hover/hover_mentor/__init__.py +54 -0
- velm/artisans/hover/hover_mentor/grimoire.py +458 -0
- velm/artisans/hover/hover_mentor/inquisitor.py +68 -0
- velm/artisans/hover/hover_mentor/warden.py +51 -0
- velm/artisans/hover/perception.py +236 -0
- velm/artisans/ignore/artisan.py +70 -0
- velm/artisans/indexer/__init__.py +3 -0
- velm/artisans/indexer/artisan.py +50 -0
- velm/artisans/indexer/core/contracts.py +14 -0
- velm/artisans/indexer/core/engine.py +51 -0
- velm/artisans/indexer/languages/base.py +33 -0
- velm/artisans/indexer/languages/factory.py +25 -0
- velm/artisans/indexer/languages/go.py +13 -0
- velm/artisans/indexer/languages/java.py +13 -0
- velm/artisans/indexer/languages/javascript.py +17 -0
- velm/artisans/indexer/languages/python.py +14 -0
- velm/artisans/indexer/languages/ruby.py +13 -0
- velm/artisans/indexer/languages/rust.py +15 -0
- velm/artisans/init/__init__.py +12 -0
- velm/artisans/init/artisan.py +288 -0
- velm/artisans/init/manual.py +156 -0
- velm/artisans/initialize/artisan.py +262 -0
- velm/artisans/inspect/__init__.py +3 -0
- velm/artisans/inspect/artisan.py +643 -0
- velm/artisans/introspect/__init__.py +13 -0
- velm/artisans/introspect/conductor.py +80 -0
- velm/artisans/introspect/registry_scribe.py +109 -0
- velm/artisans/introspect/scaffold_scribe.py +348 -0
- velm/artisans/introspect/symphony_scribe.py +291 -0
- velm/artisans/introspect/ui_scribe.py +105 -0
- velm/artisans/isolate/__init__.py +3 -0
- velm/artisans/isolate/artisan.py +103 -0
- velm/artisans/lazarus/__init__.py +0 -0
- velm/artisans/lazarus/artisan.py +97 -0
- velm/artisans/lfg/artisan.py +60 -0
- velm/artisans/lint/__init__.py +13 -0
- velm/artisans/lint/artisan.py +117 -0
- velm/artisans/lint/contracts.py +130 -0
- velm/artisans/lint/engine.py +28 -0
- velm/artisans/lint/rules/base.py +37 -0
- velm/artisans/lint/rules/graph.py +118 -0
- velm/artisans/lint/rules/layers.py +67 -0
- velm/artisans/lint/rules/structural.py +75 -0
- velm/artisans/lint_blueprint/__init__.py +3 -0
- velm/artisans/lint_blueprint/artisan.py +71 -0
- velm/artisans/manifest.py +278 -0
- velm/artisans/matrix/__init__.py +3 -0
- velm/artisans/matrix/artisan.py +140 -0
- velm/artisans/mimic/__init__.py +4 -0
- velm/artisans/mimic/artisan.py +92 -0
- velm/artisans/mimic/generator.py +106 -0
- velm/artisans/mimic/reflector.py +64 -0
- velm/artisans/mock/__init__.py +3 -0
- velm/artisans/mock/artisan.py +75 -0
- velm/artisans/mri/__init__.py +3 -0
- velm/artisans/mri/artisan.py +120 -0
- velm/artisans/muse/__init__.py +3 -0
- velm/artisans/muse/analyst.py +103 -0
- velm/artisans/muse/artisan.py +97 -0
- velm/artisans/neural/__init__.py +14 -0
- velm/artisans/neural/artisan.py +116 -0
- velm/artisans/neural/contracts.py +14 -0
- velm/artisans/neural/tui.py +323 -0
- velm/artisans/neural_link/__init__.py +4 -0
- velm/artisans/neural_link/artisan.py +48 -0
- velm/artisans/neural_link/dashboard.py +129 -0
- velm/artisans/observatory/__init__.py +26 -0
- velm/artisans/observatory/artisan.py +249 -0
- velm/artisans/observatory/contracts.py +62 -0
- velm/artisans/ocular/__init__.py +4 -0
- velm/artisans/ocular/artisan.py +118 -0
- velm/artisans/pad.py +103 -0
- velm/artisans/patch/__init__.py +12 -0
- velm/artisans/patch/artisan.py +321 -0
- velm/artisans/patch/contracts.py +114 -0
- velm/artisans/patch/mutators/__init__.py +11 -0
- velm/artisans/patch/mutators/base.py +12 -0
- velm/artisans/patch/mutators/facade.py +58 -0
- velm/artisans/patch/mutators/regex.py +76 -0
- velm/artisans/patch/mutators/semantic/__init__.py +12 -0
- velm/artisans/patch/mutators/semantic/contracts.py +15 -0
- velm/artisans/patch/mutators/semantic/router.py +94 -0
- velm/artisans/patch/mutators/semantic/strategies.py +184 -0
- velm/artisans/patch/mutators/structured.py +91 -0
- velm/artisans/patch/mutators/textual.py +60 -0
- velm/artisans/patch/parser.py +74 -0
- velm/artisans/patch/patch.scaffold +6 -0
- velm/artisans/plugins/__init__.py +2 -0
- velm/artisans/plugins/artisan.py +286 -0
- velm/artisans/preview/__init__.py +2 -0
- velm/artisans/preview/artisan.py +155 -0
- velm/artisans/preview/contracts.py +27 -0
- velm/artisans/preview/parsers/__init__.py +61 -0
- velm/artisans/preview/parsers/base.py +20 -0
- velm/artisans/preview/parsers/html.py +273 -0
- velm/artisans/preview/parsers/react.py +351 -0
- velm/artisans/prophesy/__init__.py +4 -0
- velm/artisans/prophesy/artisan.py +47 -0
- velm/artisans/qr/__init__.py +3 -0
- velm/artisans/qr/artisan.py +75 -0
- velm/artisans/query/__init__.py +2 -0
- velm/artisans/query/artisan.py +535 -0
- velm/artisans/read_soul/__init__.py +3 -0
- velm/artisans/read_soul/artisan.py +30 -0
- velm/artisans/refactor.py +200 -0
- velm/artisans/repair/__init__.py +5 -0
- velm/artisans/repair/artisan.py +381 -0
- velm/artisans/repair/heuristics.py +282 -0
- velm/artisans/repair/surgery.py +61 -0
- velm/artisans/repl_artisan.py +161 -0
- velm/artisans/replay.py +309 -0
- velm/artisans/resonate/__init__.py +3 -0
- velm/artisans/resonate/artisan.py +82 -0
- velm/artisans/review/artisan.py +93 -0
- velm/artisans/risk/__init__.py +3 -0
- velm/artisans/risk/artisan.py +98 -0
- velm/artisans/run/__init__.py +6 -0
- velm/artisans/run/bridge.py +84 -0
- velm/artisans/run/conductor.py +211 -0
- velm/artisans/run/polyglot_bridge.py +213 -0
- velm/artisans/run/prophet/__init__.py +15 -0
- velm/artisans/run/prophet/conductor.py +79 -0
- velm/artisans/run/prophet/contracts.py +21 -0
- velm/artisans/run/prophet/grimoire.py +63 -0
- velm/artisans/run/prophet/language_oracle.py +96 -0
- velm/artisans/run/prophet/rite_adjudicator.py +41 -0
- velm/artisans/run/prophet/sanctum_seer.py +35 -0
- velm/artisans/run/scribe.py +321 -0
- velm/artisans/run/vigil.py +99 -0
- velm/artisans/runtimes.py +458 -0
- velm/artisans/save_artisan.py +118 -0
- velm/artisans/schema/__init__.py +4 -0
- velm/artisans/schema/artisan.py +116 -0
- velm/artisans/schema/engine.py +123 -0
- velm/artisans/scribe/__init__.py +5 -0
- velm/artisans/scribe/base_scribe.py +42 -0
- velm/artisans/scribe/conductor.py +153 -0
- velm/artisans/scribe/form_scribe.py +30 -0
- velm/artisans/scribe/monad_scribe.py +28 -0
- velm/artisans/scribe/will_scribe.py +27 -0
- velm/artisans/seed/__init__.py +4 -0
- velm/artisans/seed/artisan.py +54 -0
- velm/artisans/seed/fabricator.py +44 -0
- velm/artisans/self_test.py +114 -0
- velm/artisans/semantic_fs/__init__.py +3 -0
- velm/artisans/semantic_fs/artisan.py +106 -0
- velm/artisans/semantic_fs/operations.py +101 -0
- velm/artisans/semdiff/__init__.py +3 -0
- velm/artisans/semdiff/artisan.py +86 -0
- velm/artisans/services/__init__.py +0 -0
- velm/artisans/services/billing/__init__.py +0 -0
- velm/artisans/services/billing/artisan.py +91 -0
- velm/artisans/services/billing/client.py +34 -0
- velm/artisans/services/billing/domains/customers.py +32 -0
- velm/artisans/services/billing/domains/invoices.py +27 -0
- velm/artisans/services/billing/domains/links.py +18 -0
- velm/artisans/services/billing/domains/portal.py +13 -0
- velm/artisans/services/billing/domains/products.py +23 -0
- velm/artisans/services/billing/domains/subscriptions.py +32 -0
- velm/artisans/services/browser/__init__.py +2 -0
- velm/artisans/services/browser/artisan.py +49 -0
- velm/artisans/services/browser/engine.py +68 -0
- velm/artisans/services/cache/__init__.py +2 -0
- velm/artisans/services/cache/artisan.py +41 -0
- velm/artisans/services/cache/engine.py +78 -0
- velm/artisans/services/calendar/artisan.py +258 -0
- velm/artisans/services/calendar/brain.py +45 -0
- velm/artisans/services/calendar/client.py +151 -0
- velm/artisans/services/clerk/__init__.py +0 -0
- velm/artisans/services/clerk/artisan.py +141 -0
- velm/artisans/services/clerk/client.py +32 -0
- velm/artisans/services/clerk/constants.py +22 -0
- velm/artisans/services/clerk/domains/base.py +50 -0
- velm/artisans/services/clerk/domains/invitations.py +70 -0
- velm/artisans/services/clerk/domains/organizations.py +42 -0
- velm/artisans/services/clerk/domains/sessions.py +31 -0
- velm/artisans/services/clerk/domains/users.py +149 -0
- velm/artisans/services/clerk/simulation/engine.py +65 -0
- velm/artisans/services/clerk/simulation/generators.py +53 -0
- velm/artisans/services/clerk/simulation/state.py +57 -0
- velm/artisans/services/communication/__init__.py +0 -0
- velm/artisans/services/communication/artisan.py +695 -0
- velm/artisans/services/communication/channels/base.py +15 -0
- velm/artisans/services/communication/channels/email_api.py +51 -0
- velm/artisans/services/communication/channels/email_smtp.py +77 -0
- velm/artisans/services/communication/channels/mock.py +96 -0
- velm/artisans/services/communication/channels/sms_twilio.py +270 -0
- velm/artisans/services/communication/channels/social.py +379 -0
- velm/artisans/services/communication/contracts.py +18 -0
- velm/artisans/services/communication/herald.py +167 -0
- velm/artisans/services/crm/__init__.py +0 -0
- velm/artisans/services/crm/artisan.py +97 -0
- velm/artisans/services/crm/factory.py +19 -0
- velm/artisans/services/crm/providers/base.py +58 -0
- velm/artisans/services/crm/providers/hubspot.py +81 -0
- velm/artisans/services/document/__init__.py +2 -0
- velm/artisans/services/document/artisan.py +66 -0
- velm/artisans/services/document/domains/data.py +35 -0
- velm/artisans/services/document/domains/pdf.py +14 -0
- velm/artisans/services/intelligence/__init__.py +0 -0
- velm/artisans/services/intelligence/artisan.py +96 -0
- velm/artisans/services/memory/__init__.py +2 -0
- velm/artisans/services/memory/artisan.py +76 -0
- velm/artisans/services/memory/encoder.py +19 -0
- velm/artisans/services/memory/store.py +25 -0
- velm/artisans/services/network/__init__.py +0 -0
- velm/artisans/services/network/artisan.py +65 -0
- velm/artisans/services/network/client.py +31 -0
- velm/artisans/services/network/domains/graphql.py +48 -0
- velm/artisans/services/network/domains/rest.py +78 -0
- velm/artisans/services/network/domains/webhook.py +50 -0
- velm/artisans/services/sheets/__init__.py +2 -0
- velm/artisans/services/sheets/artisan.py +48 -0
- velm/artisans/services/sheets/domains/airtable.py +41 -0
- velm/artisans/services/sheets/domains/google.py +49 -0
- velm/artisans/services/storage/__init__.py +4 -0
- velm/artisans/services/storage/artisan.py +311 -0
- velm/artisans/services/storage/client.py +56 -0
- velm/artisans/services/storage/domains/buckets.py +27 -0
- velm/artisans/services/storage/domains/objects.py +79 -0
- velm/artisans/services/storage/domains/security.py +34 -0
- velm/artisans/services/supabase/__init__.py +0 -0
- velm/artisans/services/supabase/artisan.py +63 -0
- velm/artisans/services/supabase/client.py +156 -0
- velm/artisans/services/supabase/domains/auth.py +40 -0
- velm/artisans/services/supabase/domains/database.py +226 -0
- velm/artisans/services/supabase/domains/storage.py +43 -0
- velm/artisans/services/twilio/__init__.py +11 -0
- velm/artisans/services/twilio/artisan.py +394 -0
- velm/artisans/services/twilio/client.py +43 -0
- velm/artisans/services/twilio/constants.py +42 -0
- velm/artisans/services/twilio/domains/base.py +23 -0
- velm/artisans/services/twilio/domains/compliance.py +76 -0
- velm/artisans/services/twilio/domains/intelligence.py +41 -0
- velm/artisans/services/twilio/domains/lookups.py +38 -0
- velm/artisans/services/twilio/domains/management.py +49 -0
- velm/artisans/services/twilio/domains/messaging.py +68 -0
- velm/artisans/services/twilio/domains/numbers.py +95 -0
- velm/artisans/services/twilio/domains/provisioning.py +73 -0
- velm/artisans/services/twilio/simulation/engine.py +158 -0
- velm/artisans/services/twilio/simulation/generators.py +64 -0
- velm/artisans/services/twilio/simulation/physics.py +60 -0
- velm/artisans/services/twilio/simulation/reactor.py +63 -0
- velm/artisans/services/twilio/simulation/state.py +72 -0
- velm/artisans/services/twilio/utils.py +55 -0
- velm/artisans/services/worker/__init__.py +2 -0
- velm/artisans/services/worker/artisan.py +40 -0
- velm/artisans/services/worker/engine.py +64 -0
- velm/artisans/settings.py +96 -0
- velm/artisans/sgrep/__init__.py +3 -0
- velm/artisans/sgrep/artisan.py +95 -0
- velm/artisans/shadow_clone/__init__.py +5 -0
- velm/artisans/shadow_clone/artisan.py +565 -0
- velm/artisans/shadow_clone/catalog.py +58 -0
- velm/artisans/shadow_clone/config_injector.py +58 -0
- velm/artisans/shadow_clone/contracts.py +130 -0
- velm/artisans/shadow_clone/governor.py +241 -0
- velm/artisans/shadow_clone/mirror.py +143 -0
- velm/artisans/shadow_clone/network.py +205 -0
- velm/artisans/shadow_clone/state_cloner.py +76 -0
- velm/artisans/shadow_clone/worktree.py +228 -0
- velm/artisans/shell.py +32 -0
- velm/artisans/signature_artisan.py +256 -0
- velm/artisans/simulacrum/__init__.py +9 -0
- velm/artisans/simulacrum/artisan.py +193 -0
- velm/artisans/simulacrum/bridge.py +196 -0
- velm/artisans/simulacrum/contracts.py +22 -0
- velm/artisans/simulacrum/engine.py +283 -0
- velm/artisans/simulacrum/exceptions.py +18 -0
- velm/artisans/simulacrum/heuristics/__init__.py +9 -0
- velm/artisans/simulacrum/heuristics/engine.py +81 -0
- velm/artisans/simulacrum/heuristics/strategies.py +149 -0
- velm/artisans/simulacrum/runtimes/__init__.py +19 -0
- velm/artisans/simulacrum/runtimes/base.py +34 -0
- velm/artisans/simulacrum/runtimes/go.py +130 -0
- velm/artisans/simulacrum/runtimes/node.py +124 -0
- velm/artisans/simulacrum/runtimes/python.py +38 -0
- velm/artisans/simulacrum/runtimes/rust.py +23 -0
- velm/artisans/simulacrum/runtimes/shell.py +11 -0
- velm/artisans/snippet/artisan.py +108 -0
- velm/artisans/studio.py +50 -0
- velm/artisans/summarize.py +176 -0
- velm/artisans/surveyor/__init__.py +2 -0
- velm/artisans/surveyor/artisan.py +218 -0
- velm/artisans/symphony.py +151 -0
- velm/artisans/telepathy/__init__.py +3 -0
- velm/artisans/telepathy/artisan.py +121 -0
- velm/artisans/telepresence/__init__.py +3 -0
- velm/artisans/telepresence/artisan.py +192 -0
- velm/artisans/telepresence/causal_slicer.py +171 -0
- velm/artisans/telepresence/maestro_bridge.py +184 -0
- velm/artisans/telepresence/shadow_vault.py +163 -0
- velm/artisans/telepresence/url_projector.py +151 -0
- velm/artisans/template_engine/__init__.py +23 -0
- velm/artisans/template_engine/contracts.py +36 -0
- velm/artisans/template_engine/engine/__init__.py +2 -0
- velm/artisans/template_engine/engine/ai_prophet.py +169 -0
- velm/artisans/template_engine/engine/alias_oracle.py +108 -0
- velm/artisans/template_engine/engine/cache_oracle.py +155 -0
- velm/artisans/template_engine/engine/conductor.py +151 -0
- velm/artisans/template_engine/engine/gaze_conductor.py +210 -0
- velm/artisans/template_engine/engine/manifest_oracle.py +148 -0
- velm/artisans/template_engine/system_forge.py +197 -0
- velm/artisans/templates.py +647 -0
- velm/artisans/time_branch.py +60 -0
- velm/artisans/time_machine.py +38 -0
- velm/artisans/tool/ascii_artisan.py +238 -0
- velm/artisans/tool/banner_artisan.py +87 -0
- velm/artisans/tool/chronicle_artisan.py +18 -0
- velm/artisans/tool/doctor_artisan.py +18 -0
- velm/artisans/tool/gnosis_artisan.py +18 -0
- velm/artisans/tool/hash_artisan.py +21 -0
- velm/artisans/tool/keyring_artisan.py +55 -0
- velm/artisans/tool/pack_artisan.py +17 -0
- velm/artisans/tool/read_soul_artisan.py +43 -0
- velm/artisans/tool/sbom_artisan.py +84 -0
- velm/artisans/tool/secrets_artisan.py +66 -0
- velm/artisans/tool/tool_cli.py +60 -0
- velm/artisans/train/__init__.py +2 -0
- velm/artisans/train/artisan.py +27 -0
- velm/artisans/transfigure.py +275 -0
- velm/artisans/translate/__init__.py +3 -0
- velm/artisans/translate/artisan.py +65 -0
- velm/artisans/translocate.py +451 -0
- velm/artisans/translocate_core/__init__.py +11 -0
- velm/artisans/translocate_core/conductor/__init__.py +14 -0
- velm/artisans/translocate_core/conductor/engine.py +86 -0
- velm/artisans/translocate_core/conductor/execution.py +240 -0
- velm/artisans/translocate_core/conductor/perception.py +72 -0
- velm/artisans/translocate_core/conductor/proclamation.py +152 -0
- velm/artisans/translocate_core/conductor/snapshot.py +330 -0
- velm/artisans/translocate_core/contracts.py +31 -0
- velm/artisans/translocate_core/detective.py +717 -0
- velm/artisans/translocate_core/resolvers/ROADMAP.md +35 -0
- velm/artisans/translocate_core/resolvers/__init__.py +18 -0
- velm/artisans/translocate_core/resolvers/cpp/__init__.py +5 -0
- velm/artisans/translocate_core/resolvers/cpp/contracts.py +23 -0
- velm/artisans/translocate_core/resolvers/cpp/engine.py +75 -0
- velm/artisans/translocate_core/resolvers/cpp/inquisitor.py +58 -0
- velm/artisans/translocate_core/resolvers/cpp/pathfinder.py +47 -0
- velm/artisans/translocate_core/resolvers/cpp/surgeon.py +24 -0
- velm/artisans/translocate_core/resolvers/go/__init__.py +1 -0
- velm/artisans/translocate_core/resolvers/go/contracts.py +18 -0
- velm/artisans/translocate_core/resolvers/go/engine.py +70 -0
- velm/artisans/translocate_core/resolvers/go/inquisitor.py +36 -0
- velm/artisans/translocate_core/resolvers/go/pathfinder.py +54 -0
- velm/artisans/translocate_core/resolvers/go/surgeon.py +17 -0
- velm/artisans/translocate_core/resolvers/java/__init__.py +5 -0
- velm/artisans/translocate_core/resolvers/java/contracts.py +29 -0
- velm/artisans/translocate_core/resolvers/java/engine.py +75 -0
- velm/artisans/translocate_core/resolvers/java/inquisitor.py +66 -0
- velm/artisans/translocate_core/resolvers/java/pathfinder.py +45 -0
- velm/artisans/translocate_core/resolvers/java/surgeon.py +24 -0
- velm/artisans/translocate_core/resolvers/javascript/__init__.py +4 -0
- velm/artisans/translocate_core/resolvers/javascript/contracts.py +29 -0
- velm/artisans/translocate_core/resolvers/javascript/engine.py +75 -0
- velm/artisans/translocate_core/resolvers/javascript/inquisitor.py +72 -0
- velm/artisans/translocate_core/resolvers/javascript/pathfinder.py +80 -0
- velm/artisans/translocate_core/resolvers/javascript/surgeon.py +42 -0
- velm/artisans/translocate_core/resolvers/python/__init__.py +6 -0
- velm/artisans/translocate_core/resolvers/python/contracts.py +29 -0
- velm/artisans/translocate_core/resolvers/python/engine.py +147 -0
- velm/artisans/translocate_core/resolvers/python/inquisitor.py +138 -0
- velm/artisans/translocate_core/resolvers/python/intelligence.py +46 -0
- velm/artisans/translocate_core/resolvers/python/pathfinder.py +264 -0
- velm/artisans/translocate_core/resolvers/python/surgeon.py +160 -0
- velm/artisans/translocate_core/resolvers/ruby/__init__.py +5 -0
- velm/artisans/translocate_core/resolvers/ruby/contracts.py +28 -0
- velm/artisans/translocate_core/resolvers/ruby/engine.py +74 -0
- velm/artisans/translocate_core/resolvers/ruby/inquisitor.py +90 -0
- velm/artisans/translocate_core/resolvers/ruby/pathfinder.py +79 -0
- velm/artisans/translocate_core/resolvers/ruby/surgeon.py +32 -0
- velm/artisans/translocate_core/resolvers/rust/__init__.py +5 -0
- velm/artisans/translocate_core/resolvers/rust/contracts.py +22 -0
- velm/artisans/translocate_core/resolvers/rust/engine.py +110 -0
- velm/artisans/translocate_core/resolvers/rust/inquisitor.py +57 -0
- velm/artisans/translocate_core/resolvers/rust/pathfinder.py +75 -0
- velm/artisans/translocate_core/resolvers/rust/surgeon.py +22 -0
- velm/artisans/translocate_core/resolvers/typescript/__init__.py +3 -0
- velm/artisans/translocate_core/resolvers/typescript/engine.py +13 -0
- velm/artisans/translocate_core/resolvers/typescript/pathfinder.py +83 -0
- velm/artisans/translocate_core/will_parser.py +199 -0
- velm/artisans/transmute.py +969 -0
- velm/artisans/transmute_core/seer.py +357 -0
- velm/artisans/tray_guardian.py +75 -0
- velm/artisans/tree.py +253 -0
- velm/artisans/tutorial/__init__.py +4 -0
- velm/artisans/tutorial/artisans.py +92 -0
- velm/artisans/tutorial/engine.py +51 -0
- velm/artisans/tutorial/quest_giver.py +81 -0
- velm/artisans/unambiguous_artisan.py +0 -0
- velm/artisans/undo/__init__.py +15 -0
- velm/artisans/undo/artisan.py +193 -0
- velm/artisans/undo/reverser.py +173 -0
- velm/artisans/upgrade/__init__.py +4 -0
- velm/artisans/upgrade/artisan.py +86 -0
- velm/artisans/upgrade/merger.py +143 -0
- velm/artisans/vector/__init__.py +0 -0
- velm/artisans/vector/artisan.py +111 -0
- velm/artisans/verify.py +319 -0
- velm/artisans/watchman/__init__.py +4 -0
- velm/artisans/watchman/artisan.py +182 -0
- velm/artisans/watchman/engine.py +124 -0
- velm/artisans/watchman/profiles.py +83 -0
- velm/artisans/watchman/ui.py +49 -0
- velm/artisans/weave/__init__.py +15 -0
- velm/artisans/weave/ci_weaver.py +90 -0
- velm/artisans/weave/conductor.py +205 -0
- velm/artisans/weave/oracle.py +90 -0
- velm/artisans/weave/validator.py +24 -0
- velm/artisans/weave/weaver.py +333 -0
- velm/artisans/with_secrets.py +109 -0
- velm/artisans/workspace/__init__.py +6 -0
- velm/artisans/workspace/artisan.py +583 -0
- velm/artisans/workspace/contracts.py +97 -0
- velm/artisans/workspace/pad/app.py +232 -0
- velm/banners/__init__.py +67 -0
- velm/banners/fallback.py +35 -0
- velm/banners/sigil.py +2024 -0
- velm/communion/__init__.py +133 -0
- velm/communion/oracle.py +325 -0
- velm/communion/renderers.py +178 -0
- velm/constants.py +679 -0
- velm/containerization/__init__.py +13 -0
- velm/containerization/engine.py +356 -0
- velm/contracts/architectural_contracts.py +19 -0
- velm/contracts/communion_contracts.py +48 -0
- velm/contracts/data_contracts.py +758 -0
- velm/contracts/heresy_contracts.py +557 -0
- velm/contracts/law_contracts.py +134 -0
- velm/contracts/persona_contracts.py +35 -0
- velm/contracts/symphony_contracts.py +263 -0
- velm/core/__init__.py +6 -0
- velm/core/__main__.py +13 -0
- velm/core/ai/__init__.py +33 -0
- velm/core/ai/akasha.py +112 -0
- velm/core/ai/contracts.py +159 -0
- velm/core/ai/engine/__init__.py +5 -0
- velm/core/ai/engine/audit.py +37 -0
- velm/core/ai/engine/core.py +249 -0
- velm/core/ai/knowledge_base.json +22 -0
- velm/core/ai/providers/__init__.py +21 -0
- velm/core/ai/providers/anthropic.py +134 -0
- velm/core/ai/providers/base.py +219 -0
- velm/core/ai/providers/google.py +143 -0
- velm/core/ai/providers/local.py +118 -0
- velm/core/ai/providers/openai.py +244 -0
- velm/core/ai/rag/__init__.py +30 -0
- velm/core/ai/rag/knowledge/__init__.py +33 -0
- velm/core/ai/rag/knowledge/devops_gnosis.py +61 -0
- velm/core/ai/rag/knowledge/go_gnosis.py +27 -0
- velm/core/ai/rag/knowledge/python_gnosis.py +54 -0
- velm/core/ai/rag/knowledge/rust_gnosis.py +49 -0
- velm/core/ai/rag/knowledge/scaffold_syntax.py +71 -0
- velm/core/ai/rag/knowledge/security_gnosis.py +45 -0
- velm/core/ai/rag/knowledge/symphony_syntax.py +65 -0
- velm/core/ai/rag/knowledge/typescript_gnosis.py +63 -0
- velm/core/ai/rag/librarian/__init__.py +7 -0
- velm/core/ai/rag/librarian/analysis.py +62 -0
- velm/core/ai/rag/librarian/assembly.py +60 -0
- velm/core/ai/rag/librarian/contracts.py +45 -0
- velm/core/ai/rag/librarian/indexers/base.py +18 -0
- velm/core/ai/rag/librarian/indexers/code.py +200 -0
- velm/core/ai/rag/librarian/indexers/text.py +150 -0
- velm/core/ai/rag/librarian/master.py +344 -0
- velm/core/ai/rag/librarian/ranking.py +30 -0
- velm/core/ai/rag/librarian/retrieval/__init__.py +0 -0
- velm/core/ai/rag/librarian/retrieval/engine.py +51 -0
- velm/core/alchemist/__init__.py +14 -0
- velm/core/alchemist/engine.py +202 -0
- velm/core/alchemist/environment.py +126 -0
- velm/core/alchemist/inference.py +114 -0
- velm/core/alchemist/library.py +117 -0
- velm/core/alchemist/resolution.py +297 -0
- velm/core/artisan.py +197 -0
- velm/core/assembler/__init__.py +15 -0
- velm/core/assembler/engine.py +191 -0
- velm/core/assembler/weavers/__init__.py +15 -0
- velm/core/assembler/weavers/base_weaver.py +130 -0
- velm/core/assembler/weavers/python_weaver.py +528 -0
- velm/core/assembler/weavers/react_weaver.py +368 -0
- velm/core/blueprint_scribe/__init__.py +11 -0
- velm/core/blueprint_scribe/canonical_serializer.py +124 -0
- velm/core/blueprint_scribe/content_renderer.py +75 -0
- velm/core/blueprint_scribe/metadata_scribe.py +72 -0
- velm/core/blueprint_scribe/scribe.py +114 -0
- velm/core/blueprint_scribe/sorting_hat.py +33 -0
- velm/core/blueprint_scribe/tree_forger.py +52 -0
- velm/core/chaos_engine.py +229 -0
- velm/core/cli/cli_conductor.py +343 -0
- velm/core/cli/cli_shims.py +795 -0
- velm/core/cli/cli_utils.py +244 -0
- velm/core/cli/core_cli.py +270 -0
- velm/core/cli/grimoire/__init__.py +76 -0
- velm/core/cli/grimoire/_ai_rites.py +247 -0
- velm/core/cli/grimoire/_automation_rites.py +52 -0
- velm/core/cli/grimoire/_core_rites.py +244 -0
- velm/core/cli/grimoire/_evolution_rites.py +212 -0
- velm/core/cli/grimoire/_guild_rites.py +32 -0
- velm/core/cli/grimoire/_history_rites.py +60 -0
- velm/core/cli/grimoire/_mimic_rites.py +20 -0
- velm/core/cli/grimoire/_perception_rites.py +398 -0
- velm/core/cli/grimoire/_security_rites.py +57 -0
- velm/core/cli/grimoire/_service_rites.py +197 -0
- velm/core/cli/grimoire/_ui_rites.py +58 -0
- velm/core/cli/grimoire/_utility_rites.py +172 -0
- velm/core/cli/grimoire/_workspace_rites.py +59 -0
- velm/core/cli/grimoire_data.py +147 -0
- velm/core/cortex/__init__.py +9 -0
- velm/core/cortex/blueprint_merger.py +311 -0
- velm/core/cortex/call_graph.py +160 -0
- velm/core/cortex/contracts.py +515 -0
- velm/core/cortex/data_flow.py +91 -0
- velm/core/cortex/dependency_oracle.py +311 -0
- velm/core/cortex/engine/__init__.py +16 -0
- velm/core/cortex/engine/analysis.py +182 -0
- velm/core/cortex/engine/conductor.py +144 -0
- velm/core/cortex/engine/perception.py +154 -0
- velm/core/cortex/entropy_oracle.py +125 -0
- velm/core/cortex/file_discoverer.py +207 -0
- velm/core/cortex/file_interrogator.py +252 -0
- velm/core/cortex/git_historian.py +320 -0
- velm/core/cortex/graph_builder.py +551 -0
- velm/core/cortex/import_resolver.py +206 -0
- velm/core/cortex/knowledge.py +96 -0
- velm/core/cortex/language_oracle.py +120 -0
- velm/core/cortex/logic_inductor.py +216 -0
- velm/core/cortex/ocular/__init__.py +15 -0
- velm/core/cortex/ocular/engine.py +198 -0
- velm/core/cortex/ranking/__init__.py +16 -0
- velm/core/cortex/ranking/contracts.py +47 -0
- velm/core/cortex/ranking/engine.py +254 -0
- velm/core/cortex/ranking/factors/cohesion.py +152 -0
- velm/core/cortex/ranking/factors/resonance.py +41 -0
- velm/core/cortex/ranking/factors/semantic.py +34 -0
- velm/core/cortex/ranking/factors/structural.py +32 -0
- velm/core/cortex/ranking/factors/symbiosis.py +28 -0
- velm/core/cortex/ranking/factors/temporal.py +30 -0
- velm/core/cortex/ranking/factors/topological.py +62 -0
- velm/core/cortex/ranking/strategies.py +194 -0
- velm/core/cortex/scanner.py +193 -0
- velm/core/cortex/semantic_comparator.py +98 -0
- velm/core/cortex/semantic_indexer.py +353 -0
- velm/core/cortex/tag_extractor.py +49 -0
- velm/core/cortex/tokenomics.py +44 -0
- velm/core/cortex/vector.py +502 -0
- velm/core/daemon/__init__.py +18 -0
- velm/core/daemon/akashic/__init__.py +20 -0
- velm/core/daemon/akashic/broadcaster.py +331 -0
- velm/core/daemon/akashic/constants.py +24 -0
- velm/core/daemon/akashic/engine.py +442 -0
- velm/core/daemon/akashic/envelope.py +187 -0
- velm/core/daemon/akashic/memory.py +154 -0
- velm/core/daemon/constants.py +176 -0
- velm/core/daemon/dispatcher/__init__.py +21 -0
- velm/core/daemon/dispatcher/constants.py +31 -0
- velm/core/daemon/dispatcher/engine.py +335 -0
- velm/core/daemon/dispatcher/errors.py +43 -0
- velm/core/daemon/dispatcher/executor.py +51 -0
- velm/core/daemon/dispatcher/pools.py +114 -0
- velm/core/daemon/dispatcher/triage.py +162 -0
- velm/core/daemon/nexus/__init__.py +17 -0
- velm/core/daemon/nexus/engine.py +543 -0
- velm/core/daemon/nexus/gatekeeper.py +515 -0
- velm/core/daemon/nexus/scout.py +41 -0
- velm/core/daemon/nexus/synapse.py +341 -0
- velm/core/daemon/registry/__init__.py +4 -0
- velm/core/daemon/registry/consecrator.py +123 -0
- velm/core/daemon/registry/guard.py +24 -0
- velm/core/daemon/registry/resolver.py +24 -0
- velm/core/daemon/resolver/__init__.py +17 -0
- velm/core/daemon/resolver/constants.py +33 -0
- velm/core/daemon/resolver/dna.py +74 -0
- velm/core/daemon/resolver/engine.py +65 -0
- velm/core/daemon/resolver/executable.py +49 -0
- velm/core/daemon/resolver/identity.py +48 -0
- velm/core/daemon/resolver/virtual.py +47 -0
- velm/core/daemon/serializer/__init__.py +17 -0
- velm/core/daemon/serializer/constants.py +19 -0
- velm/core/daemon/serializer/encoders/forensic.py +22 -0
- velm/core/daemon/serializer/encoders/meta.py +44 -0
- velm/core/daemon/serializer/encoders/schema.py +45 -0
- velm/core/daemon/serializer/encoders/scientific.py +34 -0
- velm/core/daemon/serializer/encoders/spatial.py +18 -0
- velm/core/daemon/serializer/encoders/temporal.py +20 -0
- velm/core/daemon/serializer/engine.py +88 -0
- velm/core/daemon/serializer/registry.py +33 -0
- velm/core/daemon/server/__init__.py +17 -0
- velm/core/daemon/server/banner.py +20 -0
- velm/core/daemon/server/engine.py +334 -0
- velm/core/daemon/server/signals.py +46 -0
- velm/core/daemon/server/vitality.py +212 -0
- velm/core/daemon/surveyor/constants.py +78 -0
- velm/core/daemon/surveyor/engine.py +330 -0
- velm/core/daemon/surveyor/registry.py +151 -0
- velm/core/daemon/surveyor/sentinels/adapter.py +206 -0
- velm/core/daemon/surveyor/sentinels/base.py +70 -0
- velm/core/daemon/surveyor/sentinels/cpp.py +0 -0
- velm/core/daemon/surveyor/sentinels/docker.py +0 -0
- velm/core/daemon/surveyor/sentinels/golang.py +45 -0
- velm/core/daemon/surveyor/sentinels/infra.py +62 -0
- velm/core/daemon/surveyor/sentinels/java.py +52 -0
- velm/core/daemon/surveyor/sentinels/javascript.py +67 -0
- velm/core/daemon/surveyor/sentinels/python.py +84 -0
- velm/core/daemon/surveyor/sentinels/ruby.py +0 -0
- velm/core/daemon/surveyor/sentinels/rust.py +60 -0
- velm/core/daemon/surveyor/sentinels/scaffold.py +57 -0
- velm/core/daemon/surveyor/sentinels/symphony.py +0 -0
- velm/core/daemon/surveyor/sentinels/typescript.py +40 -0
- velm/core/daemon/transporter/__init__.py +17 -0
- velm/core/daemon/transporter/buffer.py +207 -0
- velm/core/daemon/transporter/constants.py +37 -0
- velm/core/daemon/transporter/engine.py +304 -0
- velm/core/daemon/transporter/physics.py +51 -0
- velm/core/fusion/__init__.py +6 -0
- velm/core/fusion/engine.py +174 -0
- velm/core/guardian/__init__.py +15 -0
- velm/core/guardian/contracts.py +43 -0
- velm/core/guardian/grimoire.py +57 -0
- velm/core/guardian/sentry.py +103 -0
- velm/core/guardian/wards/filesystem.py +93 -0
- velm/core/guardian/wards/semantic.py +45 -0
- velm/core/guardian/wards/syntax.py +56 -0
- velm/core/ignition/__init__.py +40 -0
- velm/core/ignition/conductor.py +169 -0
- velm/core/ignition/contracts.py +248 -0
- velm/core/ignition/diviner/__init__.py +21 -0
- velm/core/ignition/diviner/engine.py +175 -0
- velm/core/ignition/diviner/exceptions.py +37 -0
- velm/core/ignition/diviner/heuristics/__init__.py +8 -0
- velm/core/ignition/diviner/heuristics/base.py +27 -0
- velm/core/ignition/diviner/heuristics/engine.py +57 -0
- velm/core/ignition/diviner/heuristics/node_inquisitor.py +54 -0
- velm/core/ignition/diviner/heuristics/python_inquisitor.py +48 -0
- velm/core/ignition/diviner/heuristics/systems_inquisitor.py +27 -0
- velm/core/ignition/diviner/heuristics/visual_inquisitor.py +21 -0
- velm/core/ignition/diviner/persistence.py +75 -0
- velm/core/ignition/diviner/seekers/__init__.py +29 -0
- velm/core/ignition/diviner/seekers/base.py +54 -0
- velm/core/ignition/diviner/seekers/conductor.py +81 -0
- velm/core/ignition/diviner/seekers/entropy_seeker.py +57 -0
- velm/core/ignition/diviner/seekers/environmental_seeker.py +50 -0
- velm/core/ignition/diviner/seekers/heart_seeker.py +59 -0
- velm/core/ignition/diviner/seekers/magic_seeker.py +46 -0
- velm/core/ignition/diviner/seekers/semantic_seeker.py +35 -0
- velm/core/ignition/diviner/seekers/visual_seeker.py +58 -0
- velm/core/ignition/diviner/strategies.py +261 -0
- velm/core/ignition/diviner/telemetry.py +28 -0
- velm/core/ignition/sentinel/__init__.py +7 -0
- velm/core/ignition/sentinel/biology.py +37 -0
- velm/core/ignition/sentinel/grimoire.py +45 -0
- velm/core/ignition/sentinel/priest.py +100 -0
- velm/core/ignition/sentinel/scanner.py +64 -0
- velm/core/ignition/sentinel/vitality.py +72 -0
- velm/core/jurisprudence/adjudicator.py +172 -0
- velm/core/jurisprudence/contracts.py +41 -0
- velm/core/jurisprudence/vows/__init__.py +75 -0
- velm/core/jurisprudence/vows/base.py +108 -0
- velm/core/jurisprudence/vows/cloud_vows.py +74 -0
- velm/core/jurisprudence/vows/database_vows.py +78 -0
- velm/core/jurisprudence/vows/docker_ops_vows.py +65 -0
- velm/core/jurisprudence/vows/filesystem.py +447 -0
- velm/core/jurisprudence/vows/git_vows.py +63 -0
- velm/core/jurisprudence/vows/http_vows.py +61 -0
- velm/core/jurisprudence/vows/meta.py +43 -0
- velm/core/jurisprudence/vows/network.py +70 -0
- velm/core/jurisprudence/vows/process.py +50 -0
- velm/core/jurisprudence/vows/python_vows.py +80 -0
- velm/core/jurisprudence/vows/quality_vows.py +76 -0
- velm/core/jurisprudence/vows/resource_vows.py +68 -0
- velm/core/jurisprudence/vows/security_vows.py +91 -0
- velm/core/jurisprudence/vows/system.py +37 -0
- velm/core/kernel/__init__.py +15 -0
- velm/core/kernel/archivist/__init__.py +22 -0
- velm/core/kernel/archivist/contracts.py +57 -0
- velm/core/kernel/archivist/engine.py +124 -0
- velm/core/kernel/archivist/filters.py +102 -0
- velm/core/kernel/archivist/manifest.py +37 -0
- velm/core/kernel/archivist/restorer.py +81 -0
- velm/core/kernel/archivist/retention.py +44 -0
- velm/core/kernel/archivist/storage.py +105 -0
- velm/core/kernel/artifact_hoarder.py +170 -0
- velm/core/kernel/chronicle/__init__.py +16 -0
- velm/core/kernel/chronicle/archivist.py +63 -0
- velm/core/kernel/chronicle/facade.py +204 -0
- velm/core/kernel/chronicle/integrity_alchemist.py +77 -0
- velm/core/kernel/chronicle/manifest_federator.py +125 -0
- velm/core/kernel/chronicle/provenance_scribe.py +126 -0
- velm/core/kernel/hologram.py +230 -0
- velm/core/kernel/sentinel_gardener.py +113 -0
- velm/core/kernel/sentinel_watcher.py +561 -0
- velm/core/kernel/transaction/__init__.py +17 -0
- velm/core/kernel/transaction/chronicle_bridge.py +217 -0
- velm/core/kernel/transaction/committer.py +126 -0
- velm/core/kernel/transaction/contracts.py +77 -0
- velm/core/kernel/transaction/facade.py +216 -0
- velm/core/kernel/transaction/locking.py +332 -0
- velm/core/kernel/transaction/rollback.py +122 -0
- velm/core/kernel/transaction/staging.py +132 -0
- velm/core/lsp/STREAMING_PROTOCOL.md +121 -0
- velm/core/lsp/__init__.py +127 -0
- velm/core/lsp/base/__init__.py +39 -0
- velm/core/lsp/base/contracts.py +34 -0
- velm/core/lsp/base/dispatcher.py +390 -0
- velm/core/lsp/base/document.py +227 -0
- velm/core/lsp/base/errors.py +31 -0
- velm/core/lsp/base/features/__init__.py +0 -0
- velm/core/lsp/base/features/call_hierarchy/__init__.py +16 -0
- velm/core/lsp/base/features/call_hierarchy/contracts.py +41 -0
- velm/core/lsp/base/features/call_hierarchy/engine.py +91 -0
- velm/core/lsp/base/features/call_hierarchy/models.py +12 -0
- velm/core/lsp/base/features/code_action/__init__.py +19 -0
- velm/core/lsp/base/features/code_action/contracts.py +47 -0
- velm/core/lsp/base/features/code_action/engine.py +108 -0
- velm/core/lsp/base/features/code_action/models.py +16 -0
- velm/core/lsp/base/features/code_lens/__init__.py +19 -0
- velm/core/lsp/base/features/code_lens/contracts.py +46 -0
- velm/core/lsp/base/features/code_lens/engine.py +111 -0
- velm/core/lsp/base/features/code_lens/models.py +6 -0
- velm/core/lsp/base/features/completion/__init__.py +19 -0
- velm/core/lsp/base/features/completion/contracts.py +126 -0
- velm/core/lsp/base/features/completion/engine.py +183 -0
- velm/core/lsp/base/features/completion/models.py +7 -0
- velm/core/lsp/base/features/definition/__init__.py +19 -0
- velm/core/lsp/base/features/definition/contracts.py +47 -0
- velm/core/lsp/base/features/definition/engine.py +90 -0
- velm/core/lsp/base/features/definition/models.py +6 -0
- velm/core/lsp/base/features/definition/registry.py +19 -0
- velm/core/lsp/base/features/diagnostics/__init__.py +19 -0
- velm/core/lsp/base/features/diagnostics/context.py +75 -0
- velm/core/lsp/base/features/diagnostics/engine.py +186 -0
- velm/core/lsp/base/features/diagnostics/formatter.py +214 -0
- velm/core/lsp/base/features/diagnostics/governor.py +92 -0
- velm/core/lsp/base/features/diagnostics/ledger.py +123 -0
- velm/core/lsp/base/features/diagnostics/manager.py +222 -0
- velm/core/lsp/base/features/diagnostics/registry.py +123 -0
- velm/core/lsp/base/features/document_link/__init__.py +7 -0
- velm/core/lsp/base/features/document_link/contracts.py +37 -0
- velm/core/lsp/base/features/document_link/engine.py +66 -0
- velm/core/lsp/base/features/document_link/models.py +6 -0
- velm/core/lsp/base/features/folding_range/__init__.py +25 -0
- velm/core/lsp/base/features/folding_range/contracts.py +32 -0
- velm/core/lsp/base/features/folding_range/engine.py +84 -0
- velm/core/lsp/base/features/folding_range/models.py +10 -0
- velm/core/lsp/base/features/formatting/__init__.py +19 -0
- velm/core/lsp/base/features/formatting/contracts.py +47 -0
- velm/core/lsp/base/features/formatting/engine.py +88 -0
- velm/core/lsp/base/features/formatting/models.py +6 -0
- velm/core/lsp/base/features/hover/__init__.py +7 -0
- velm/core/lsp/base/features/hover/contracts.py +55 -0
- velm/core/lsp/base/features/hover/engine.py +211 -0
- velm/core/lsp/base/features/hover/models.py +23 -0
- velm/core/lsp/base/features/hover/registry.py +18 -0
- velm/core/lsp/base/features/inlay_hint/__init__.py +19 -0
- velm/core/lsp/base/features/inlay_hint/contracts.py +39 -0
- velm/core/lsp/base/features/inlay_hint/engine.py +98 -0
- velm/core/lsp/base/features/inlay_hint/models.py +6 -0
- velm/core/lsp/base/features/inline_completion/__init__.py +19 -0
- velm/core/lsp/base/features/inline_completion/contracts.py +36 -0
- velm/core/lsp/base/features/inline_completion/engine.py +77 -0
- velm/core/lsp/base/features/inline_completion/models.py +7 -0
- velm/core/lsp/base/features/linter/__init__.py +19 -0
- velm/core/lsp/base/features/linter/contracts.py +53 -0
- velm/core/lsp/base/features/linter/engine.py +94 -0
- velm/core/lsp/base/features/references/__init__.py +19 -0
- velm/core/lsp/base/features/references/contracts.py +39 -0
- velm/core/lsp/base/features/references/engine.py +114 -0
- velm/core/lsp/base/features/references/models.py +6 -0
- velm/core/lsp/base/features/rename/__init__.py +27 -0
- velm/core/lsp/base/features/rename/contracts.py +56 -0
- velm/core/lsp/base/features/rename/engine.py +126 -0
- velm/core/lsp/base/features/rename/models.py +6 -0
- velm/core/lsp/base/features/selection_range/__init__.py +13 -0
- velm/core/lsp/base/features/selection_range/contracts.py +32 -0
- velm/core/lsp/base/features/selection_range/engine.py +67 -0
- velm/core/lsp/base/features/selection_range/models.py +50 -0
- velm/core/lsp/base/features/semantic_tokens/__init__.py +20 -0
- velm/core/lsp/base/features/semantic_tokens/contracts.py +23 -0
- velm/core/lsp/base/features/semantic_tokens/differ.py +66 -0
- velm/core/lsp/base/features/semantic_tokens/encoder.py +50 -0
- velm/core/lsp/base/features/semantic_tokens/engine.py +200 -0
- velm/core/lsp/base/features/semantic_tokens/legend.py +37 -0
- velm/core/lsp/base/features/semantic_tokens/models.py +8 -0
- velm/core/lsp/base/features/signature_help/__init__.py +25 -0
- velm/core/lsp/base/features/signature_help/contracts.py +45 -0
- velm/core/lsp/base/features/signature_help/engine.py +139 -0
- velm/core/lsp/base/features/signature_help/models.py +7 -0
- velm/core/lsp/base/features/symbols/__init__.py +19 -0
- velm/core/lsp/base/features/symbols/contracts.py +64 -0
- velm/core/lsp/base/features/symbols/engine.py +99 -0
- velm/core/lsp/base/features/symbols/models.py +7 -0
- velm/core/lsp/base/features/type_hierarchy/__init__.py +18 -0
- velm/core/lsp/base/features/type_hierarchy/contracts.py +39 -0
- velm/core/lsp/base/features/type_hierarchy/engine.py +91 -0
- velm/core/lsp/base/features/type_hierarchy/models.py +9 -0
- velm/core/lsp/base/features/workspace/__init__.py +8 -0
- velm/core/lsp/base/features/workspace/commands/router.py +30 -0
- velm/core/lsp/base/features/workspace/contracts.py +20 -0
- velm/core/lsp/base/features/workspace/engine.py +42 -0
- velm/core/lsp/base/features/workspace/folders/__init__.py +14 -0
- velm/core/lsp/base/features/workspace/folders/manager.py +110 -0
- velm/core/lsp/base/features/workspace/folders/models.py +38 -0
- velm/core/lsp/base/features/workspace/folders/scryer.py +53 -0
- velm/core/lsp/base/features/workspace/models.py +8 -0
- velm/core/lsp/base/features/workspace/symbols/__init__.py +14 -0
- velm/core/lsp/base/features/workspace/symbols/contracts.py +19 -0
- velm/core/lsp/base/features/workspace/symbols/cortex_bridge.py +34 -0
- velm/core/lsp/base/features/workspace/symbols/engine.py +46 -0
- velm/core/lsp/base/features/workspace/symbols/models.py +21 -0
- velm/core/lsp/base/features/workspace/symbols/scryer.py +46 -0
- velm/core/lsp/base/features/workspace/watcher/core.py +217 -0
- velm/core/lsp/base/features/workspace/watcher/debounce.py +29 -0
- velm/core/lsp/base/foundry.py +62 -0
- velm/core/lsp/base/governor.py +100 -0
- velm/core/lsp/base/kernel.py +363 -0
- velm/core/lsp/base/manager.py +148 -0
- velm/core/lsp/base/middleware.py +112 -0
- velm/core/lsp/base/protocol/__init__.py +31 -0
- velm/core/lsp/base/protocol/constants.py +33 -0
- velm/core/lsp/base/protocol/endpoint.py +258 -0
- velm/core/lsp/base/protocol/framing.py +105 -0
- velm/core/lsp/base/protocol/streams.py +274 -0
- velm/core/lsp/base/protocol/telemetry.py +73 -0
- velm/core/lsp/base/rpc/__init__.py +49 -0
- velm/core/lsp/base/rpc/base.py +17 -0
- velm/core/lsp/base/rpc/cancellation.py +54 -0
- velm/core/lsp/base/rpc/codes.py +30 -0
- velm/core/lsp/base/rpc/converter.py +50 -0
- velm/core/lsp/base/rpc/errors.py +56 -0
- velm/core/lsp/base/rpc/filters.py +30 -0
- velm/core/lsp/base/rpc/messages.py +136 -0
- velm/core/lsp/base/rpc/serializer.py +302 -0
- velm/core/lsp/base/state.py +32 -0
- velm/core/lsp/base/telemetry.py +88 -0
- velm/core/lsp/base/types/__init__.py +187 -0
- velm/core/lsp/base/types/base.py +54 -0
- velm/core/lsp/base/types/call_hierarchy.py +69 -0
- velm/core/lsp/base/types/code_action.py +83 -0
- velm/core/lsp/base/types/code_lens.py +23 -0
- velm/core/lsp/base/types/completion.py +230 -0
- velm/core/lsp/base/types/definition.py +88 -0
- velm/core/lsp/base/types/diagnostics.py +129 -0
- velm/core/lsp/base/types/document_highlight.py +68 -0
- velm/core/lsp/base/types/document_link.py +48 -0
- velm/core/lsp/base/types/folding_range.py +93 -0
- velm/core/lsp/base/types/formatting.py +22 -0
- velm/core/lsp/base/types/hover.py +107 -0
- velm/core/lsp/base/types/inlay_hint.py +31 -0
- velm/core/lsp/base/types/inline_completion.py +65 -0
- velm/core/lsp/base/types/lifecycle.py +182 -0
- velm/core/lsp/base/types/navigation.py +104 -0
- velm/core/lsp/base/types/primitives.py +262 -0
- velm/core/lsp/base/types/references.py +79 -0
- velm/core/lsp/base/types/rename.py +61 -0
- velm/core/lsp/base/types/selection_range.py +73 -0
- velm/core/lsp/base/types/semantic_tokens.py +44 -0
- velm/core/lsp/base/types/signature_help.py +131 -0
- velm/core/lsp/base/types/symbols.py +47 -0
- velm/core/lsp/base/types/sync.py +58 -0
- velm/core/lsp/base/types/type_hierarchy.py +65 -0
- velm/core/lsp/base/types/window.py +98 -0
- velm/core/lsp/base/types/workspace.py +155 -0
- velm/core/lsp/base/utils/__init__.py +13 -0
- velm/core/lsp/base/utils/debounce.py +38 -0
- velm/core/lsp/base/utils/position.py +29 -0
- velm/core/lsp/base/utils/text.py +201 -0
- velm/core/lsp/base/utils/timing.py +64 -0
- velm/core/lsp/base/utils/uri.py +267 -0
- velm/core/lsp/base/utils/validation.py +19 -0
- velm/core/lsp/scaffold_features/call_hierarchy/__init__.py +6 -0
- velm/core/lsp/scaffold_features/call_hierarchy/engine.py +26 -0
- velm/core/lsp/scaffold_features/call_hierarchy/providers/daemon_bridge.py +128 -0
- velm/core/lsp/scaffold_features/code_action/__init__.py +25 -0
- velm/core/lsp/scaffold_features/code_action/engine.py +89 -0
- velm/core/lsp/scaffold_features/code_action/models.py +6 -0
- velm/core/lsp/scaffold_features/code_action/providers/artisan_bridge.py +214 -0
- velm/core/lsp/scaffold_features/code_action/providers/neural_healer.py +52 -0
- velm/core/lsp/scaffold_features/code_action/providers/refactor_surgeon.py +57 -0
- velm/core/lsp/scaffold_features/code_action/providers/syntax_medic.py +64 -0
- velm/core/lsp/scaffold_features/code_lens/__init__.py +15 -0
- velm/core/lsp/scaffold_features/code_lens/engine.py +32 -0
- velm/core/lsp/scaffold_features/code_lens/models.py +5 -0
- velm/core/lsp/scaffold_features/code_lens/providers/blueprint.py +55 -0
- velm/core/lsp/scaffold_features/code_lens/providers/intelligence.py +57 -0
- velm/core/lsp/scaffold_features/code_lens/providers/kinetic.py +56 -0
- velm/core/lsp/scaffold_features/completion/__init__.py +17 -0
- velm/core/lsp/scaffold_features/completion/engine.py +278 -0
- velm/core/lsp/scaffold_features/completion/models.py +7 -0
- velm/core/lsp/scaffold_features/completion/providers/__init__.py +27 -0
- velm/core/lsp/scaffold_features/completion/providers/global_prophet.py +160 -0
- velm/core/lsp/scaffold_features/completion/providers/internal.py +153 -0
- velm/core/lsp/scaffold_features/completion/providers/keyword_prophet.py +246 -0
- velm/core/lsp/scaffold_features/completion/providers/path_prophet.py +330 -0
- velm/core/lsp/scaffold_features/completion/providers/variable_prophet.py +92 -0
- velm/core/lsp/scaffold_features/definition/__init__.py +19 -0
- velm/core/lsp/scaffold_features/definition/engine.py +40 -0
- velm/core/lsp/scaffold_features/definition/models.py +6 -0
- velm/core/lsp/scaffold_features/definition/rules/__init__.py +8 -0
- velm/core/lsp/scaffold_features/definition/rules/file_links.py +57 -0
- velm/core/lsp/scaffold_features/definition/rules/global_symbols.py +57 -0
- velm/core/lsp/scaffold_features/definition/rules/local_vars.py +47 -0
- velm/core/lsp/scaffold_features/definition/rules/macros.py +51 -0
- velm/core/lsp/scaffold_features/definition/rules/stdlib.py +38 -0
- velm/core/lsp/scaffold_features/document_link/__init__.py +6 -0
- velm/core/lsp/scaffold_features/document_link/engine.py +25 -0
- velm/core/lsp/scaffold_features/document_link/providers/gnostic_linker.py +114 -0
- velm/core/lsp/scaffold_features/folding_range/__init__.py +21 -0
- velm/core/lsp/scaffold_features/folding_range/engine.py +42 -0
- velm/core/lsp/scaffold_features/folding_range/providers/commentary.py +50 -0
- velm/core/lsp/scaffold_features/folding_range/providers/content_block.py +64 -0
- velm/core/lsp/scaffold_features/folding_range/providers/gnostic_structure.py +70 -0
- velm/core/lsp/scaffold_features/folding_range/providers/indentation_fallback.py +59 -0
- velm/core/lsp/scaffold_features/formatting/__init__.py +6 -0
- velm/core/lsp/scaffold_features/formatting/engine.py +26 -0
- velm/core/lsp/scaffold_features/formatting/models.py +6 -0
- velm/core/lsp/scaffold_features/formatting/providers/__init__.py +5 -0
- velm/core/lsp/scaffold_features/formatting/providers/beautifier.py +105 -0
- velm/core/lsp/scaffold_features/hover/__init__.py +20 -0
- velm/core/lsp/scaffold_features/hover/engine.py +240 -0
- velm/core/lsp/scaffold_features/hover/grimoire_data.py +239 -0
- velm/core/lsp/scaffold_features/hover/models.py +6 -0
- velm/core/lsp/scaffold_features/hover/providers/__init__.py +29 -0
- velm/core/lsp/scaffold_features/hover/providers/alchemy.py +64 -0
- velm/core/lsp/scaffold_features/hover/providers/internal.py +170 -0
- velm/core/lsp/scaffold_features/hover/providers/matter.py +89 -0
- velm/core/lsp/scaffold_features/hover/providers/mentor.py +63 -0
- velm/core/lsp/scaffold_features/inlay_hint/__init__.py +15 -0
- velm/core/lsp/scaffold_features/inlay_hint/engine.py +32 -0
- velm/core/lsp/scaffold_features/inlay_hint/models.py +6 -0
- velm/core/lsp/scaffold_features/inlay_hint/providers/__init__.py +5 -0
- velm/core/lsp/scaffold_features/inlay_hint/providers/macro_param.py +114 -0
- velm/core/lsp/scaffold_features/inlay_hint/providers/shadow_truth.py +96 -0
- velm/core/lsp/scaffold_features/inlay_hint/providers/variable_type.py +112 -0
- velm/core/lsp/scaffold_features/inline_completion/__init__.py +8 -0
- velm/core/lsp/scaffold_features/inline_completion/engine.py +29 -0
- velm/core/lsp/scaffold_features/inline_completion/providers/muse.py +60 -0
- velm/core/lsp/scaffold_features/inline_completion/providers/snippet.py +40 -0
- velm/core/lsp/scaffold_features/linter/__init__.py +19 -0
- velm/core/lsp/scaffold_features/linter/context.py +74 -0
- velm/core/lsp/scaffold_features/linter/engine.py +59 -0
- velm/core/lsp/scaffold_features/linter/registry.py +63 -0
- velm/core/lsp/scaffold_features/linter/rules/architecture_law.py +79 -0
- velm/core/lsp/scaffold_features/linter/rules/artisan_inquest.py +387 -0
- velm/core/lsp/scaffold_features/linter/rules/base.py +79 -0
- velm/core/lsp/scaffold_features/linter/rules/bond_law.py +57 -0
- velm/core/lsp/scaffold_features/linter/rules/complexity_law.py +47 -0
- velm/core/lsp/scaffold_features/linter/rules/geometry_law.py +45 -0
- velm/core/lsp/scaffold_features/linter/rules/security_law.py +47 -0
- velm/core/lsp/scaffold_features/linter/rules/syntax_law.py +53 -0
- velm/core/lsp/scaffold_features/refactoring/__init__.py +7 -0
- velm/core/lsp/scaffold_features/refactoring/engine.py +41 -0
- velm/core/lsp/scaffold_features/refactoring/handlers/rename_files.py +90 -0
- velm/core/lsp/scaffold_features/references/__init__.py +15 -0
- velm/core/lsp/scaffold_features/references/engine.py +36 -0
- velm/core/lsp/scaffold_features/references/models.py +5 -0
- velm/core/lsp/scaffold_features/references/providers/__init__.py +5 -0
- velm/core/lsp/scaffold_features/references/providers/daemon_bridge.py +55 -0
- velm/core/lsp/scaffold_features/references/providers/inclusion.py +49 -0
- velm/core/lsp/scaffold_features/references/providers/local_usage.py +56 -0
- velm/core/lsp/scaffold_features/rename/__init__.py +12 -0
- velm/core/lsp/scaffold_features/rename/contracts.py +41 -0
- velm/core/lsp/scaffold_features/rename/engine.py +33 -0
- velm/core/lsp/scaffold_features/rename/models.py +6 -0
- velm/core/lsp/scaffold_features/rename/mutators/cortex.py +45 -0
- velm/core/lsp/scaffold_features/rename/mutators/local.py +55 -0
- velm/core/lsp/scaffold_features/rename/validator.py +32 -0
- velm/core/lsp/scaffold_features/selection_range/__init__.py +6 -0
- velm/core/lsp/scaffold_features/selection_range/engine.py +26 -0
- velm/core/lsp/scaffold_features/selection_range/providers/semantic_expander.py +236 -0
- velm/core/lsp/scaffold_features/semantic_tokens/__init__.py +6 -0
- velm/core/lsp/scaffold_features/semantic_tokens/engine.py +26 -0
- velm/core/lsp/scaffold_features/semantic_tokens/legend.py +124 -0
- velm/core/lsp/scaffold_features/semantic_tokens/models.py +8 -0
- velm/core/lsp/scaffold_features/semantic_tokens/providers/__init__.py +6 -0
- velm/core/lsp/scaffold_features/semantic_tokens/providers/gnostic.py +117 -0
- velm/core/lsp/scaffold_features/signature_help/__init__.py +15 -0
- velm/core/lsp/scaffold_features/signature_help/engine.py +32 -0
- velm/core/lsp/scaffold_features/signature_help/models.py +6 -0
- velm/core/lsp/scaffold_features/signature_help/providers/__init__.py +5 -0
- velm/core/lsp/scaffold_features/signature_help/providers/alchemist_oracle.py +55 -0
- velm/core/lsp/scaffold_features/signature_help/providers/bridge.py +41 -0
- velm/core/lsp/scaffold_features/signature_help/providers/macro_oracle.py +47 -0
- velm/core/lsp/scaffold_features/symbols/__init__.py +19 -0
- velm/core/lsp/scaffold_features/symbols/engine.py +37 -0
- velm/core/lsp/scaffold_features/symbols/models.py +7 -0
- velm/core/lsp/scaffold_features/symbols/providers/__init__.py +30 -0
- velm/core/lsp/scaffold_features/symbols/providers/base.py +22 -0
- velm/core/lsp/scaffold_features/symbols/providers/logic.py +58 -0
- velm/core/lsp/scaffold_features/symbols/providers/maestro.py +41 -0
- velm/core/lsp/scaffold_features/symbols/providers/matter.py +65 -0
- velm/core/lsp/scaffold_features/symbols/providers/polyglot.py +31 -0
- velm/core/lsp/scaffold_features/symbols/providers/variables.py +37 -0
- velm/core/lsp/scaffold_features/type_hierarchy/__init__.py +6 -0
- velm/core/lsp/scaffold_features/type_hierarchy/engine.py +26 -0
- velm/core/lsp/scaffold_features/type_hierarchy/providers/daemon_bridge.py +129 -0
- velm/core/lsp/scaffold_features/workspace/__init__.py +14 -0
- velm/core/lsp/scaffold_features/workspace/commands.py +57 -0
- velm/core/lsp/scaffold_features/workspace/engine.py +34 -0
- velm/core/lsp/scaffold_features/workspace/grimoire.py +19 -0
- velm/core/lsp/scaffold_features/workspace/watcher.py +31 -0
- velm/core/lsp/scaffold_server/__init__.py +39 -0
- velm/core/lsp/scaffold_server/__main__.py +22 -0
- velm/core/lsp/scaffold_server/adrenaline.py +208 -0
- velm/core/lsp/scaffold_server/auth.py +183 -0
- velm/core/lsp/scaffold_server/bootstrap.py +233 -0
- velm/core/lsp/scaffold_server/commands.py +267 -0
- velm/core/lsp/scaffold_server/engine.py +1157 -0
- velm/core/lsp/scaffold_server/inquest.py +268 -0
- velm/core/lsp/scaffold_server/lifecycle.py +214 -0
- velm/core/lsp/scaffold_server/mirror.py +162 -0
- velm/core/lsp/scaffold_server/relay.py +264 -0
- velm/core/lsp/scaffold_server/sync.py +224 -0
- velm/core/lsp/scaffold_server/telemetry.py +189 -0
- velm/core/maestro/__init__.py +16 -0
- velm/core/maestro/conductor.py +377 -0
- velm/core/maestro/context.py +227 -0
- velm/core/maestro/contracts.py +39 -0
- velm/core/maestro/handlers/__init__.py +14 -0
- velm/core/maestro/handlers/base.py +38 -0
- velm/core/maestro/handlers/browser.py +53 -0
- velm/core/maestro/handlers/hosts.py +109 -0
- velm/core/maestro/handlers/proclaim.py +40 -0
- velm/core/maestro/handlers/raw.py +40 -0
- velm/core/maestro/handlers/shell.py +306 -0
- velm/core/maestro/handlers/tunnel.py +32 -0
- velm/core/maestro/reverser.py +132 -0
- velm/core/maestro/scribe.py +90 -0
- velm/core/net/__init__.py +13 -0
- velm/core/net/aether/__init__.py +14 -0
- velm/core/net/aether/anonymizer.py +19 -0
- velm/core/net/aether/client.py +32 -0
- velm/core/net/tunnel.py +222 -0
- velm/core/observatory/__init__.py +26 -0
- velm/core/observatory/contracts.py +62 -0
- velm/core/observatory/health.py +57 -0
- velm/core/observatory/manager.py +166 -0
- velm/core/observatory/scanner.py +65 -0
- velm/core/observatory/store.py +67 -0
- velm/core/persona/manager.py +74 -0
- velm/core/persona/registry.py +52 -0
- velm/core/redemption/__init__.py +0 -0
- velm/core/redemption/diagnostician/__init__.py +14 -0
- velm/core/redemption/diagnostician/contracts.py +21 -0
- velm/core/redemption/diagnostician/doctor.py +71 -0
- velm/core/redemption/diagnostician/grimoire.py +39 -0
- velm/core/redemption/diagnostician/specialists/__init__.py +0 -0
- velm/core/redemption/diagnostician/specialists/fs_healer.py +73 -0
- velm/core/redemption/diagnostician/specialists/import_healer.py +64 -0
- velm/core/redemption/diagnostician/specialists/network_healer.py +69 -0
- velm/core/redemption/diagnostician/specialists/system_healer.py +151 -0
- velm/core/resolvers/__init__.py +5 -0
- velm/core/resolvers/pathfinder.py +137 -0
- velm/core/runtime/__init__.py +13 -0
- velm/core/runtime/context.py +199 -0
- velm/core/runtime/engine/__init__.py +15 -0
- velm/core/runtime/engine/constants.py +22 -0
- velm/core/runtime/engine/core.py +775 -0
- velm/core/runtime/engine/execution/__init__.py +27 -0
- velm/core/runtime/engine/execution/context.py +93 -0
- velm/core/runtime/engine/execution/dispatcher.py +365 -0
- velm/core/runtime/engine/execution/executor.py +61 -0
- velm/core/runtime/engine/execution/locking.py +35 -0
- velm/core/runtime/engine/execution/retry.py +44 -0
- velm/core/runtime/engine/execution/transaction.py +143 -0
- velm/core/runtime/engine/intelligence/__init__.py +27 -0
- velm/core/runtime/engine/intelligence/cache.py +49 -0
- velm/core/runtime/engine/intelligence/memory.py +36 -0
- velm/core/runtime/engine/intelligence/optimizer.py +46 -0
- velm/core/runtime/engine/intelligence/predictor.py +355 -0
- velm/core/runtime/engine/lifecycle/__init__.py +34 -0
- velm/core/runtime/engine/lifecycle/bootstrap.py +175 -0
- velm/core/runtime/engine/lifecycle/shutdown.py +54 -0
- velm/core/runtime/engine/lifecycle/signals.py +36 -0
- velm/core/runtime/engine/lifecycle/state.py +31 -0
- velm/core/runtime/engine/lifecycle/vitality.py +212 -0
- velm/core/runtime/engine/resilience/__init__.py +27 -0
- velm/core/runtime/engine/resilience/circuit.py +75 -0
- velm/core/runtime/engine/resilience/forensics.py +45 -0
- velm/core/runtime/engine/resilience/healer.py +187 -0
- velm/core/runtime/engine/resilience/watchdog.py +293 -0
- velm/core/runtime/middleware/__init__.py +96 -0
- velm/core/runtime/middleware/adaptive.py +128 -0
- velm/core/runtime/middleware/auth.py +56 -0
- velm/core/runtime/middleware/budget.py +41 -0
- velm/core/runtime/middleware/caching.py +253 -0
- velm/core/runtime/middleware/chaos.py +173 -0
- velm/core/runtime/middleware/circuit.py +85 -0
- velm/core/runtime/middleware/compliance.py +122 -0
- velm/core/runtime/middleware/concourse.py +46 -0
- velm/core/runtime/middleware/constitution.py +130 -0
- velm/core/runtime/middleware/contract.py +30 -0
- velm/core/runtime/middleware/enrichment.py +138 -0
- velm/core/runtime/middleware/entropy_shield.py +202 -0
- velm/core/runtime/middleware/flags.py +179 -0
- velm/core/runtime/middleware/forensics.py +53 -0
- velm/core/runtime/middleware/governor.py +95 -0
- velm/core/runtime/middleware/harmonizer.py +153 -0
- velm/core/runtime/middleware/healing.py +66 -0
- velm/core/runtime/middleware/librarian.py +212 -0
- velm/core/runtime/middleware/notification.py +78 -0
- velm/core/runtime/middleware/optimization.py +78 -0
- velm/core/runtime/middleware/output_veil.py +86 -0
- velm/core/runtime/middleware/persona_warden.py +92 -0
- velm/core/runtime/middleware/pipeline.py +376 -0
- velm/core/runtime/middleware/policy.py +66 -0
- velm/core/runtime/middleware/prerequisites.py +307 -0
- velm/core/runtime/middleware/privacy.py +299 -0
- velm/core/runtime/middleware/profiler.py +178 -0
- velm/core/runtime/middleware/reflective.py +58 -0
- velm/core/runtime/middleware/resonance.py +79 -0
- velm/core/runtime/middleware/safety.py +48 -0
- velm/core/runtime/middleware/singularity.py +98 -0
- velm/core/runtime/middleware/telemetry.py +334 -0
- velm/core/runtime/middleware/tracing.py +53 -0
- velm/core/runtime/middleware/veil.py +74 -0
- velm/core/runtime/plugin_interface.py +26 -0
- velm/core/runtime/registry.py +368 -0
- velm/core/runtime/remote.py +312 -0
- velm/core/runtime/resilience.py +117 -0
- velm/core/runtime/telemetry.py +391 -0
- velm/core/sanctum/base.py +113 -0
- velm/core/sanctum/local.py +309 -0
- velm/core/sanctum/memory.py +379 -0
- velm/core/sanctum/s3.py +203 -0
- velm/core/sanctum/ssh.py +338 -0
- velm/core/sanitization/__init__.py +13 -0
- velm/core/sanitization/ghost_buster.py +116 -0
- velm/core/scaffold.lock +374 -0
- velm/core/scaffold.scaffold +44 -0
- velm/core/semantics/__init__.py +27 -0
- velm/core/semantics/contracts.py +133 -0
- velm/core/semantics/engine.py +223 -0
- velm/core/semantics/intent.py +87 -0
- velm/core/semantics/reranker.py +95 -0
- velm/core/semantics/retriever.py +124 -0
- velm/core/sentinel_conduit.py +164 -0
- velm/core/simulation/__init__.py +16 -0
- velm/core/simulation/conductor/__init__.py +11 -0
- velm/core/simulation/conductor/gnostic_comparator.py +219 -0
- velm/core/simulation/conductor/orchestrator.py +127 -0
- velm/core/simulation/conductor/reality_forge.py +188 -0
- velm/core/simulation/conductor/simulation_mind.py +115 -0
- velm/core/simulation/prophecy.py +33 -0
- velm/core/simulation/scribe.py +232 -0
- velm/core/state/__init__.py +26 -0
- velm/core/state/contracts.py +141 -0
- velm/core/state/gnostic_db/__init__.py +35 -0
- velm/core/state/gnostic_db/engine.py +299 -0
- velm/core/state/gnostic_db/models.py +176 -0
- velm/core/state/ledger.py +46 -0
- velm/core/state/machine.py +25 -0
- velm/core/state/snapshot.py +30 -0
- velm/core/state/store.py +205 -0
- velm/core/structure_sentinel/__init__.py +15 -0
- velm/core/structure_sentinel/contracts.py +24 -0
- velm/core/structure_sentinel/facade.py +84 -0
- velm/core/structure_sentinel/strategies/__init__.py +38 -0
- velm/core/structure_sentinel/strategies/base_strategy.py +17 -0
- velm/core/structure_sentinel/strategies/boundary_strategy.py +59 -0
- velm/core/structure_sentinel/strategies/cpp_strategy.py +115 -0
- velm/core/structure_sentinel/strategies/go_strategy.py +130 -0
- velm/core/structure_sentinel/strategies/java_strategy.py +99 -0
- velm/core/structure_sentinel/strategies/javascript_strategy.py +12 -0
- velm/core/structure_sentinel/strategies/node_strategy.py +160 -0
- velm/core/structure_sentinel/strategies/python_strategy/__init__.py +6 -0
- velm/core/structure_sentinel/strategies/python_strategy/base_faculty.py +43 -0
- velm/core/structure_sentinel/strategies/python_strategy/contracts.py +19 -0
- velm/core/structure_sentinel/strategies/python_strategy/engine.py +101 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/__init__.py +13 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/contracts.py +52 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/engine.py +96 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/heuristics.py +63 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/strategies/__init__.py +14 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/strategies/django.py +57 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/strategies/fastapi.py +46 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/strategies/flask.py +41 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/strategies/typer.py +40 -0
- velm/core/structure_sentinel/strategies/python_strategy/frameworks/surgeon.py +93 -0
- velm/core/structure_sentinel/strategies/python_strategy/semantic/__init__.py +2 -0
- velm/core/structure_sentinel/strategies/python_strategy/semantic/engine.py +171 -0
- velm/core/structure_sentinel/strategies/python_strategy/semantic/guardian.py +172 -0
- velm/core/structure_sentinel/strategies/python_strategy/semantic/harvester.py +142 -0
- velm/core/structure_sentinel/strategies/python_strategy/semantic/weaver.py +232 -0
- velm/core/structure_sentinel/strategies/python_strategy/structural/__init__.py +2 -0
- velm/core/structure_sentinel/strategies/python_strategy/structural/content.py +239 -0
- velm/core/structure_sentinel/strategies/python_strategy/structural/engine.py +192 -0
- velm/core/structure_sentinel/strategies/python_strategy/structural/layout.py +244 -0
- velm/core/structure_sentinel/strategies/python_strategy/testing/__init__.py +5 -0
- velm/core/structure_sentinel/strategies/python_strategy/testing/analyzer.py +90 -0
- velm/core/structure_sentinel/strategies/python_strategy/testing/contracts.py +31 -0
- velm/core/structure_sentinel/strategies/python_strategy/testing/engine.py +100 -0
- velm/core/structure_sentinel/strategies/python_strategy/testing/generator.py +119 -0
- velm/core/structure_sentinel/strategies/ruby_strategy.py +104 -0
- velm/core/structure_sentinel/strategies/rust_strategy.py +169 -0
- velm/core/structure_sentinel/strategies/typescript_strategy.py +12 -0
- velm/core/symbolic/__init__.py +154 -0
- velm/core/symbolic/contracts.py +134 -0
- velm/core/symbolic/engine.py +230 -0
- velm/core/symbolic/inquisitors/__init__.py +119 -0
- velm/core/symbolic/inquisitors/banker.py +166 -0
- velm/core/symbolic/inquisitors/base.py +157 -0
- velm/core/symbolic/inquisitors/bouncer.py +214 -0
- velm/core/symbolic/inquisitors/chronos.py +190 -0
- velm/core/symbolic/inquisitors/librarian.py +284 -0
- velm/core/symbolic/inquisitors/retina.py +154 -0
- velm/core/symbolic/inquisitors/scrier.py +153 -0
- velm/core/symbolic/inquisitors/sentinel.py +155 -0
- velm/core/symbolic/refinement/__init__.py +89 -0
- velm/core/symbolic/refinement/alchemist.py +198 -0
- velm/core/symbolic/refinement/purifier.py +180 -0
- velm/core/symbolic/sutures/__init__.py +76 -0
- velm/core/symbolic/sutures/neural_bridge.py +440 -0
- velm/core/symbolic/sutures/vision_gate.py +178 -0
- velm/core/symbolic/telemetry/__init__.py +75 -0
- velm/core/symbolic/telemetry/pulse.py +128 -0
- velm/core/symbolic.scaffold +28 -0
- velm/core/system/manager.py +304 -0
- velm/core/traceback/__init__.py +15 -0
- velm/core/traceback/contracts.py +123 -0
- velm/core/traceback/handler.py +188 -0
- velm/core/traceback/inspector.py +222 -0
- velm/core/traceback/renderer.py +138 -0
- velm/creator/__init__.py +15 -0
- velm/creator/alu.py +46 -0
- velm/creator/bootloader.py +66 -0
- velm/creator/cpu.py +148 -0
- velm/creator/engine/__init__.py +12 -0
- velm/creator/engine/adjudicator.py +110 -0
- velm/creator/engine/facade.py +237 -0
- velm/creator/factory.py +46 -0
- velm/creator/io_controller/__init__.py +23 -0
- velm/creator/io_controller/contracts.py +17 -0
- velm/creator/io_controller/facade.py +221 -0
- velm/creator/io_controller/ledger_scribe.py +109 -0
- velm/creator/io_controller/operations.py +128 -0
- velm/creator/io_controller/path_alchemist.py +45 -0
- velm/creator/io_controller/security.py +67 -0
- velm/creator/io_controller/transaction_router.py +66 -0
- velm/creator/io_controller/trash.py +126 -0
- velm/creator/io_validators.py +90 -0
- velm/creator/next_step_oracle.py +143 -0
- velm/creator/opcodes.py +39 -0
- velm/creator/registers.py +152 -0
- velm/creator/reports.py +85 -0
- velm/creator/security.py +108 -0
- velm/creator/writer/__init__.py +13 -0
- velm/creator/writer/atomic.py +58 -0
- velm/creator/writer/contracts.py +27 -0
- velm/creator/writer/differential.py +30 -0
- velm/creator/writer/engine.py +327 -0
- velm/creator/writer/normalizer.py +48 -0
- velm/creator/writer/security.py +32 -0
- velm/creator/writer/validator.py +53 -0
- velm/default_templates/template.alembic.ini.scaffold +27 -0
- velm/default_templates/template.changelog.scaffold +23 -0
- velm/default_templates/template.code_of_conduct.scaffold +25 -0
- velm/default_templates/template.contributing.scaffold +52 -0
- velm/default_templates/template.cpp.scaffold +22 -0
- velm/default_templates/template.cs.scaffold +18 -0
- velm/default_templates/template.css.scaffold +17 -0
- velm/default_templates/template.dart.scaffold +14 -0
- velm/default_templates/template.docker-compose.scaffold +34 -0
- velm/default_templates/template.dockerfile.scaffold +31 -0
- velm/default_templates/template.dockerignore.scaffold +32 -0
- velm/default_templates/template.editorconfig.scaffold +33 -0
- velm/default_templates/template.env.example.scaffold +24 -0
- velm/default_templates/template.gitattributes.scaffold +32 -0
- velm/default_templates/template.github-action-python.scaffold +135 -0
- velm/default_templates/template.gitignore.scaffold +28 -0
- velm/default_templates/template.go.scaffold +17 -0
- velm/default_templates/template.html.scaffold +19 -0
- velm/default_templates/template.java.scaffold +27 -0
- velm/default_templates/template.js.scaffold +22 -0
- velm/default_templates/template.json.scaffold +15 -0
- velm/default_templates/template.justfile.scaffold +54 -0
- velm/default_templates/template.kt.scaffold +23 -0
- velm/default_templates/template.license.scaffold +13 -0
- velm/default_templates/template.lua.scaffold +12 -0
- velm/default_templates/template.makefile.scaffold +23 -0
- velm/default_templates/template.nginx.conf.scaffold +42 -0
- velm/default_templates/template.package.scaffold +21 -0
- velm/default_templates/template.php.scaffold +20 -0
- velm/default_templates/template.pre-commit-config.scaffold +30 -0
- velm/default_templates/template.py.scaffold +23 -0
- velm/default_templates/template.pyproject.scaffold +34 -0
- velm/default_templates/template.pytest.ini.scaffold +22 -0
- velm/default_templates/template.readme.scaffold +27 -0
- velm/default_templates/template.rs.scaffold +14 -0
- velm/default_templates/template.ruby.scaffold +11 -0
- velm/default_templates/template.sbt.scaffold +11 -0
- velm/default_templates/template.scaffold.scaffold +28 -0
- velm/default_templates/template.scala.scaffold +6 -0
- velm/default_templates/template.security.scaffold +26 -0
- velm/default_templates/template.settings.json.scaffold +95 -0
- velm/default_templates/template.sh.scaffold +25 -0
- velm/default_templates/template.swift.scaffold +17 -0
- velm/default_templates/template.ts.scaffold +23 -0
- velm/default_templates/template.tsx.scaffold +20 -0
- velm/default_templates/template.zig.scaffold +26 -0
- velm/forge/__init__.py +4 -0
- velm/forge/adapters/base.py +21 -0
- velm/forge/adapters/huggingface.py +147 -0
- velm/forge/conductor.py +60 -0
- velm/forge/corpus_harvester.py +57 -0
- velm/forge/instruction_forger.py +75 -0
- velm/genesis/__init__.py +0 -0
- velm/genesis/genesis_engine/__init__.py +12 -0
- velm/genesis/genesis_engine/apotheosis.py +155 -0
- velm/genesis/genesis_engine/communion.py +333 -0
- velm/genesis/genesis_engine/engine.py +163 -0
- velm/genesis/genesis_engine/materialization.py +236 -0
- velm/genesis/genesis_engine/perception.py +67 -0
- velm/genesis/genesis_engine/weaving.py +227 -0
- velm/genesis/genesis_grimoires.py +142 -0
- velm/genesis/genesis_orchestrator/__init__.py +13 -0
- velm/genesis/genesis_orchestrator/genesis_pleas.py +257 -0
- velm/genesis/genesis_orchestrator/jurisprudence.py +59 -0
- velm/genesis/genesis_orchestrator/oracle.py +91 -0
- velm/genesis/genesis_orchestrator/orchestrator.py +350 -0
- velm/genesis/genesis_orchestrator/pleas.py +146 -0
- velm/genesis/genesis_orchestrator/prophecy.py +177 -0
- velm/genesis/genesis_orchestrator/review.py +167 -0
- velm/genesis/genesis_profiles.py +204 -0
- velm/gnosis/README.md +1 -0
- velm/gnosis/__init__.py +20 -0
- velm/gnosis/canon.py +569 -0
- velm/gnosis/redemption.py +6210 -0
- velm/gnosis/wisdom.py +25 -0
- velm/gnostic_instrumentarium.py +161 -0
- velm/grammar.py +160 -0
- velm/help_registry.py +170 -0
- velm/herald.py +137 -0
- velm/inquisitor/TODO.md +113 -0
- velm/inquisitor/__init__.py +13 -0
- velm/inquisitor/config.py +161 -0
- velm/inquisitor/config_shim.py +7 -0
- velm/inquisitor/core.py +247 -0
- velm/inquisitor/python_inquisitor.py +217 -0
- velm/inquisitor/queries/react_queries.py +68 -0
- velm/inquisitor/sanctum/__Init__.py +0 -0
- velm/inquisitor/sanctum/diagnostics/__init__.py +9 -0
- velm/inquisitor/sanctum/diagnostics/cpp_symbolic_cortex.py +96 -0
- velm/inquisitor/sanctum/diagnostics/go.py +29 -0
- velm/inquisitor/sanctum/diagnostics/go_symbolic_cortex.py +92 -0
- velm/inquisitor/sanctum/diagnostics/java_symbolic_cortex.py +80 -0
- velm/inquisitor/sanctum/diagnostics/javascript.py +45 -0
- velm/inquisitor/sanctum/diagnostics/javascript_symbolic_cortex.py +83 -0
- velm/inquisitor/sanctum/diagnostics/python.py +47 -0
- velm/inquisitor/sanctum/diagnostics/python_symbolic_cortex.py +317 -0
- velm/inquisitor/sanctum/diagnostics/react.py +150 -0
- velm/inquisitor/sanctum/diagnostics/ruby.py +36 -0
- velm/inquisitor/sanctum/diagnostics/ruby_symbolic_cortex.py +84 -0
- velm/inquisitor/sanctum/diagnostics/rust.py +34 -0
- velm/inquisitor/sanctum/diagnostics/rust_symbolic_cortex.py +117 -0
- velm/inquisitor/sanctum/diagnostics/typescript_symbolic_cortex.py +80 -0
- velm/inquisitor/sanctum/engine.py +298 -0
- velm/interfaces/__init__.py +61 -0
- velm/interfaces/base.py +241 -0
- velm/interfaces/requests.py +4854 -0
- velm/jurisprudence_core/__init__.py +0 -0
- velm/jurisprudence_core/adjudicator_of_souls.py +136 -0
- velm/jurisprudence_core/architectural_grimoire.py +448 -0
- velm/jurisprudence_core/foreign_adjudicators.py +25 -0
- velm/jurisprudence_core/genesis_jurisprudence.py +159 -0
- velm/jurisprudence_core/gnostic_type_system.py +361 -0
- velm/jurisprudence_core/heresy_chronicles/__init__.py +5 -0
- velm/jurisprudence_core/heresy_chronicles/heresy_chronicler.py +205 -0
- velm/jurisprudence_core/heresy_chronicles/living_oracle.py +95 -0
- velm/jurisprudence_core/heresy_codex/__init__.py +45 -0
- velm/jurisprudence_core/heresy_codex/architectural.py +109 -0
- velm/jurisprudence_core/heresy_codex/data.py +39 -0
- velm/jurisprudence_core/heresy_codex/hygiene.py +89 -0
- velm/jurisprudence_core/heresy_codex/infra.py +125 -0
- velm/jurisprudence_core/heresy_codex/lexical.py +120 -0
- velm/jurisprudence_core/heresy_codex/meta.py +60 -0
- velm/jurisprudence_core/heresy_codex/perf.py +59 -0
- velm/jurisprudence_core/heresy_codex/security.py +81 -0
- velm/jurisprudence_core/heresy_codex/supply_chain.py +99 -0
- velm/jurisprudence_core/jurisprudence.py +117 -0
- velm/jurisprudence_core/scaffold_grammar_codex.py +131 -0
- velm/jurisprudence_core/schema_adjudicator.py +225 -0
- velm/jurisprudence_core/symphony_grammar_codex.py +182 -0
- velm/jurisprudence_core/symphony_heresy_codex/__init__.py +34 -0
- velm/jurisprudence_core/symphony_heresy_codex/kinetic.py +124 -0
- velm/jurisprudence_core/symphony_heresy_codex/lexical.py +59 -0
- velm/jurisprudence_core/symphony_heresy_codex/metaphysical.py +153 -0
- velm/jurisprudence_core/symphony_heresy_codex/philosophy.py +186 -0
- velm/jurisprudence_core/symphony_heresy_codex/polyglot.py +99 -0
- velm/language_server_handler.py +121 -0
- velm/logger.py +958 -0
- velm/main.py +328 -0
- velm/parser_core/__init__.py +1 -0
- velm/parser_core/block_consumer.py +135 -0
- velm/parser_core/hierophant.py +52 -0
- velm/parser_core/lexer_core/__init__.py +15 -0
- velm/parser_core/lexer_core/contracts.py +142 -0
- velm/parser_core/lexer_core/deconstructor.py +439 -0
- velm/parser_core/lexer_core/inquisitor.py +280 -0
- velm/parser_core/lexer_core/lexer.py +75 -0
- velm/parser_core/lfg_builder/__init__.py +15 -0
- velm/parser_core/lfg_builder/builders/blueprint.py +94 -0
- velm/parser_core/lfg_builder/builders/codebase_python.py +100 -0
- velm/parser_core/lfg_builder/contracts.py +46 -0
- velm/parser_core/lfg_builder/facade.py +43 -0
- velm/parser_core/lfg_builder/renderers/mermaid.py +50 -0
- velm/parser_core/logic_weaver/__init__.py +16 -0
- velm/parser_core/logic_weaver/contracts.py +45 -0
- velm/parser_core/logic_weaver/engine.py +113 -0
- velm/parser_core/logic_weaver/state.py +59 -0
- velm/parser_core/logic_weaver/traversal.py +282 -0
- velm/parser_core/manifest_parser.py +231 -0
- velm/parser_core/parser/__init__.py +15 -0
- velm/parser_core/parser/ast_weaver/__init__.py +11 -0
- velm/parser_core/parser/ast_weaver/contracts.py +19 -0
- velm/parser_core/parser/ast_weaver/node_factory.py +33 -0
- velm/parser_core/parser/ast_weaver/stack_manager.py +127 -0
- velm/parser_core/parser/ast_weaver/weaver.py +208 -0
- velm/parser_core/parser/engine.py +421 -0
- velm/parser_core/parser/gateway.py +59 -0
- velm/parser_core/parser/parser_scribes/__init__.py +65 -0
- velm/parser_core/parser/parser_scribes/base_scribe.py +44 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/__init__.py +10 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/comment_scribe.py +150 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/contract_scribe.py +163 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/directive_scribe.py +325 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/jinja_scribe.py +40 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/makefile_scribe.py +77 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/on_undo_scribe.py +24 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/post_run_scribe.py +195 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/scaffold_base_scribe.py +16 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/structural_scribe.py +346 -0
- velm/parser_core/parser/parser_scribes/scaffold_scribes/variable_scribe.py +204 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/__init__.py +8 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_atomic_scribe.py +430 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_base_scribe.py +51 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_block_scribe.py +78 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_communion_scribe.py +212 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_directive_scribe.py +657 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_logic_scribe.py +152 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_parallel_scribe.py +156 -0
- velm/parser_core/parser/parser_scribes/symphony_scribes/symphony_polyglot_scribe.py +293 -0
- velm/prophecy/__Init__.py +25 -0
- velm/prophecy/grimoires.py +137 -0
- velm/prophecy/oracle.py +167 -0
- velm/rendering/POSSIBILITIES.txt +73 -0
- velm/rendering/__init__.py +98 -0
- velm/rendering/base_renderer.py +162 -0
- velm/rendering/json_renderer.py +175 -0
- velm/rendering/lfg_scribe.py +101 -0
- velm/rendering/studio.log +12 -0
- velm/rendering/svg_renderer.py +866 -0
- velm/rendering/text_renderer/__init__.py +11 -0
- velm/rendering/text_renderer/canonical_scribe.py +29 -0
- velm/rendering/text_renderer/config.py +19 -0
- velm/rendering/text_renderer/content_previewer.py +49 -0
- velm/rendering/text_renderer/diagnostic_scribe.py +55 -0
- velm/rendering/text_renderer/facade.py +60 -0
- velm/rendering/text_renderer/luminous_scribe.py +92 -0
- velm/rendering/text_renderer/metadata_herald.py +87 -0
- velm/rendering/text_renderer/telemetry.py +15 -0
- velm/rendering/text_renderer/tree_weaver.py +128 -0
- velm/rendering/theme.py +88 -0
- velm/rendering/tree_renderer.py +34 -0
- velm/runtime_manager/__Init__.py +3 -0
- velm/runtime_manager/codex.py +218 -0
- velm/runtime_manager/manager.py +611 -0
- velm/semantic_injection/__init__.py +40 -0
- velm/semantic_injection/contract.py +70 -0
- velm/semantic_injection/directives/__init__.py +15 -0
- velm/semantic_injection/directives/ai_domain.py +312 -0
- velm/semantic_injection/directives/api_domain.py +114 -0
- velm/semantic_injection/directives/auth_domain.py +171 -0
- velm/semantic_injection/directives/cloud_domain.py +228 -0
- velm/semantic_injection/directives/crypto_domain.py +109 -0
- velm/semantic_injection/directives/data_domain.py +94 -0
- velm/semantic_injection/directives/diagram_domain.py +86 -0
- velm/semantic_injection/directives/editor_domain.py +126 -0
- velm/semantic_injection/directives/fetch_domain.py +81 -0
- velm/semantic_injection/directives/flow_domain.py +163 -0
- velm/semantic_injection/directives/git_domain.py +223 -0
- velm/semantic_injection/directives/guide_domain.py +71 -0
- velm/semantic_injection/directives/guide_knowledge/__init__.py +19 -0
- velm/semantic_injection/directives/guide_knowledge/accessibility.py +7 -0
- velm/semantic_injection/directives/guide_knowledge/algorithms.py +11 -0
- velm/semantic_injection/directives/guide_knowledge/architecture_patterns.py +11 -0
- velm/semantic_injection/directives/guide_knowledge/auth_security.py +10 -0
- velm/semantic_injection/directives/guide_knowledge/aws_terms.py +9 -0
- velm/semantic_injection/directives/guide_knowledge/clean_code.py +7 -0
- velm/semantic_injection/directives/guide_knowledge/cloud_native.py +6 -0
- velm/semantic_injection/directives/guide_knowledge/data_structures.py +12 -0
- velm/semantic_injection/directives/guide_knowledge/database_concepts.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/design_patterns.py +13 -0
- velm/semantic_injection/directives/guide_knowledge/devops.py +11 -0
- velm/semantic_injection/directives/guide_knowledge/git_flow.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/graphql.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/javascript_modern.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/python_idioms.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/react_patterns.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/realtime.py +6 -0
- velm/semantic_injection/directives/guide_knowledge/refactoring.py +7 -0
- velm/semantic_injection/directives/guide_knowledge/rest_api.py +10 -0
- velm/semantic_injection/directives/guide_knowledge/solid.py +8 -0
- velm/semantic_injection/directives/guide_knowledge/testing.py +9 -0
- velm/semantic_injection/directives/guide_knowledge/ux_laws.py +7 -0
- velm/semantic_injection/directives/infra_knowledge/__init__.py +3 -0
- velm/semantic_injection/directives/infra_knowledge/registry.py +211 -0
- velm/semantic_injection/directives/integration_domain.py +131 -0
- velm/semantic_injection/directives/kinesis_domain.py +137 -0
- velm/semantic_injection/directives/legal_domain.py +181 -0
- velm/semantic_injection/directives/mock_domain.py +115 -0
- velm/semantic_injection/directives/neuron_domain.py +168 -0
- velm/semantic_injection/directives/neuron_knowledge/__init__.py +11 -0
- velm/semantic_injection/directives/neuron_knowledge/agents.py +423 -0
- velm/semantic_injection/directives/neuron_knowledge/edge.py +263 -0
- velm/semantic_injection/directives/neuron_knowledge/evaluation.py +262 -0
- velm/semantic_injection/directives/neuron_knowledge/memory.py +324 -0
- velm/semantic_injection/directives/neuron_knowledge/optimization.py +284 -0
- velm/semantic_injection/directives/neuron_knowledge/orchestration.py +243 -0
- velm/semantic_injection/directives/neuron_knowledge/providers.py +279 -0
- velm/semantic_injection/directives/ops_domain.py +94 -0
- velm/semantic_injection/directives/policy_domain.py +132 -0
- velm/semantic_injection/directives/shield_domain.py +127 -0
- velm/semantic_injection/directives/stack_domain.py +163 -0
- velm/semantic_injection/directives/struct_domain.py +136 -0
- velm/semantic_injection/directives/test_domain.py +115 -0
- velm/semantic_injection/directives/ui_domain.py +333 -0
- velm/semantic_injection/directives/ui_knowledge/__init__.py +49 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/admin_dashboard.scaffold +379 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/App.tsx +33 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/auth/AuthGuard.tsx +4 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/dashboard/RecentSales.tsx +21 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/dashboard/StatsCards.tsx +28 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/layout/Header.tsx +30 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/layout/Sidebar.tsx +49 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/layout/UserNav.tsx +43 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/avatar.tsx +47 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/badge.tsx +32 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/button.tsx +52 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/card.tsx +66 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/dropdown-menu.tsx +90 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/input.tsx +24 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/skeleton.tsx +15 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/components/ui/table.tsx +116 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/hooks/useAuth.ts +35 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/layouts/DashboardLayout.tsx +25 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/lib/utils.ts +6 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/pages/DashboardPage.tsx +40 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard/src/pages/UsersPage.tsx +39 -0
- velm/semantic_injection/directives/ui_knowledge/admin_dashboard.py +123 -0
- velm/semantic_injection/directives/ui_knowledge/ascend_ui_knowledge.scaffold +421 -0
- velm/semantic_injection/directives/ui_knowledge/auth_form.py +90 -0
- velm/semantic_injection/directives/ui_knowledge/command_palette.py +59 -0
- velm/semantic_injection/directives/ui_knowledge/data_table.py +121 -0
- velm/semantic_injection/directives/ui_knowledge/gnostic_html_kit.scaffold +704 -0
- velm/semantic_injection/directives/ui_knowledge/go_tui.py +51 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/__init__.py +0 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/go.mod +9 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/main.go +145 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/tui_forge.py +58 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/atoms/badge.go +34 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/atoms/button.go +34 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/atoms/separator.go +19 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/atoms/spinner.go +15 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/molecules/card.go +24 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/molecules/input_field.go +22 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/molecules/progress_bar.go +24 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/molecules/status_item.go +17 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/organisms/datatable.go +45 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/organisms/help_footer.go +38 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/organisms/log_viewport.go +28 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/organisms/tabs.go +73 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui/ui/theme/theme.go +37 -0
- velm/semantic_injection/directives/ui_knowledge/go_ui.scaffold +635 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/__init__.py +0 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/html_forge.py +104 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/index.html +44 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/badge.html +13 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/btn_ghost.html +5 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/btn_gradient.html +8 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/btn_icon.html +10 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/btn_outline.html +8 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/btn_primary.html +15 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/checkbox_custom.html +20 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/input_basic.html +13 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/input_floating.html +23 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/loader.html +11 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/radio_custom.html +19 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/atoms/toggle_switch.html +20 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/accordion.html +25 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/alert_card.html +18 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/card_basic.html +19 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/card_glass.html +16 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/modal.html +29 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/search_bar.html +20 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/tooltip_top.html +20 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/molecules/user_profile.html +20 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/data_table.html +25 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/footer.html +28 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/hero_section.html +21 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/navbar.html +21 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/pricing_table.html +37 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/components/organisms/sidebar.html +30 -0
- velm/semantic_injection/directives/ui_knowledge/html_ui/src/css/variables.css +44 -0
- velm/semantic_injection/directives/ui_knowledge/layouts.py +242 -0
- velm/semantic_injection/directives/ui_knowledge/multi_step_wizard.py +95 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/__init__.py +17 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/dash_forge.py +55 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/flet_forge.py +39 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/gradio_forge.py +79 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/nicegui_forge.py +39 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/reflex_forge.py +51 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/streamlit_forge.py +116 -0
- velm/semantic_injection/directives/ui_knowledge/python_ui/textual_forge.py +48 -0
- velm/semantic_injection/directives/ui_knowledge/react/__init__.py +28 -0
- velm/semantic_injection/directives/ui_knowledge/react/atoms.py +128 -0
- velm/semantic_injection/directives/ui_knowledge/react/charts.py +134 -0
- velm/semantic_injection/directives/ui_knowledge/react/data_display.py +139 -0
- velm/semantic_injection/directives/ui_knowledge/react/disclosure.py +92 -0
- velm/semantic_injection/directives/ui_knowledge/react/feedback.py +92 -0
- velm/semantic_injection/directives/ui_knowledge/react/forms_advanced.py +94 -0
- velm/semantic_injection/directives/ui_knowledge/react/menus.py +223 -0
- velm/semantic_injection/directives/ui_knowledge/react/molecules.py +146 -0
- velm/semantic_injection/directives/ui_knowledge/react/navigation_complex.py +73 -0
- velm/semantic_injection/directives/ui_knowledge/react/overlays.py +107 -0
- velm/semantic_injection/directives/ui_knowledge/react/structures.py +423 -0
- velm/semantic_injection/directives/ui_knowledge/react/visuals.py +102 -0
- velm/semantic_injection/directives/ui_knowledge/registry.py +35 -0
- velm/semantic_injection/directives/ui_knowledge/user_loader.py +66 -0
- velm/semantic_injection/injector.py +216 -0
- velm/semantic_injection/loader.py +300 -0
- velm/settings/manager.py +277 -0
- velm/settings/schema.py +236 -0
- velm/settings/tui.py +615 -0
- velm/setup_entry.py +40 -0
- velm/shell/__init__.py +3 -0
- velm/shell/app.py +408 -0
- velm/shell/contracts.py +31 -0
- velm/shell/interpreter.py +123 -0
- velm/shell/shell.css +172 -0
- velm/shell/widgets/dossier.py +114 -0
- velm/shell/widgets/history_screen.py +65 -0
- velm/shell/widgets/orrery.py +111 -0
- velm/shell/widgets/prompter.py +208 -0
- velm/shell/widgets/suggestion_menu.py +32 -0
- velm/studio/IMPORTANT.txt +0 -0
- velm/studio/__init__.py +11 -0
- velm/studio/app.css +213 -0
- velm/studio/app.py +426 -0
- velm/studio/contracts.py +204 -0
- velm/studio/emissary.py +81 -0
- velm/studio/gnostic_events.py +88 -0
- velm/studio/logger.py +84 -0
- velm/studio/main.py +113 -0
- velm/studio/messages.py +62 -0
- velm/studio/pads/__init__.py +5 -0
- velm/studio/pads/distill_pad/__init__.py +3 -0
- velm/studio/pads/distill_pad/distill_pad.css +271 -0
- velm/studio/pads/distill_pad/distill_pad_app.py +294 -0
- velm/studio/pads/distill_pad/state.py +73 -0
- velm/studio/pads/distill_pad/widgets/__init__.py +6 -0
- velm/studio/pads/distill_pad/widgets/config_pane.py +112 -0
- velm/studio/pads/distill_pad/widgets/file_picker.py +158 -0
- velm/studio/pads/distill_pad/widgets/file_selector.py +241 -0
- velm/studio/pads/distill_pad/widgets/preview_pane.py +223 -0
- velm/studio/pads/distill_pad.scaffold +10 -0
- velm/studio/pads/genesis_pad.py +487 -0
- velm/studio/pads/pad.css +112 -0
- velm/studio/pads/pad_launcher.py +200 -0
- velm/studio/pads/refactor.css +222 -0
- velm/studio/pads/refactor_pad.py +888 -0
- velm/studio/pads/scaffold_pad.py +529 -0
- velm/studio/pads/studio.log +1 -0
- velm/studio/screens/__init__.py +5 -0
- velm/studio/screens/form_mode.py +302 -0
- velm/studio/screens/mentors_gaze.py +54 -0
- velm/studio/screens/studio.log +1 -0
- velm/studio/screens/will_mode.py +22 -0
- velm/studio/services/__init__.py +12 -0
- velm/studio/services/command_gnosis.py +78 -0
- velm/studio/services/fs_watcher.py +296 -0
- velm/studio/services/scaffold_bridge.py +232 -0
- velm/studio/state.py +330 -0
- velm/studio/studio.log +11 -0
- velm/studio/studio.scaffold +24 -0
- velm/studio/widgets/__init__.py +13 -0
- velm/studio/widgets/command_altar.py +307 -0
- velm/studio/widgets/context_menu.py +129 -0
- velm/studio/widgets/editor.py +15 -0
- velm/studio/widgets/file_tree.py +322 -0
- velm/studio/widgets/log_viewer.py +174 -0
- velm/studio/widgets/studio.log +11 -0
- velm/symphony/__init__.py +59 -0
- velm/symphony/build.symphony +43 -0
- velm/symphony/conductor/__init__.py +7 -0
- velm/symphony/conductor/events.py +6 -0
- velm/symphony/conductor/orchestrator.py +281 -0
- velm/symphony/conductor_core/__init__.py +26 -0
- velm/symphony/conductor_core/context/__init__.py +14 -0
- velm/symphony/conductor_core/context/chronicle.py +38 -0
- velm/symphony/conductor_core/context/manager.py +307 -0
- velm/symphony/conductor_core/context/scope.py +50 -0
- velm/symphony/conductor_core/context/vault.py +287 -0
- velm/symphony/conductor_core/engine.py +179 -0
- velm/symphony/conductor_core/handlers/TODO.md +3 -0
- velm/symphony/conductor_core/handlers/__init__.py +112 -0
- velm/symphony/conductor_core/handlers/action_handler/__init__.py +15 -0
- velm/symphony/conductor_core/handlers/action_handler/contracts.py +56 -0
- velm/symphony/conductor_core/handlers/action_handler/dispatcher.py +166 -0
- velm/symphony/conductor_core/handlers/action_handler/facade.py +117 -0
- velm/symphony/conductor_core/handlers/action_handler/specialists/interactive.py +108 -0
- velm/symphony/conductor_core/handlers/action_handler/specialists/kinetic.py +176 -0
- velm/symphony/conductor_core/handlers/action_handler/specialists/network.py +171 -0
- velm/symphony/conductor_core/handlers/action_handler/specialists/polyglot.py +89 -0
- velm/symphony/conductor_core/handlers/action_handler/specialists/service.py +96 -0
- velm/symphony/conductor_core/handlers/action_handler/utils/redaction.py +24 -0
- velm/symphony/conductor_core/handlers/base.py +119 -0
- velm/symphony/conductor_core/handlers/logic_handler.py +92 -0
- velm/symphony/conductor_core/handlers/meta_handler.py +75 -0
- velm/symphony/conductor_core/handlers/parallel_handler.py +38 -0
- velm/symphony/conductor_core/handlers/state_handler/__init__.py +13 -0
- velm/symphony/conductor_core/handlers/state_handler/contracts.py +30 -0
- velm/symphony/conductor_core/handlers/state_handler/dispatcher.py +70 -0
- velm/symphony/conductor_core/handlers/state_handler/facade.py +49 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/artifact.py +18 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/environment.py +34 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/lifecycle.py +41 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/proclamation.py +22 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/sanctum.py +33 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/temporal.py +20 -0
- velm/symphony/conductor_core/handlers/state_handler/specialists/variable.py +63 -0
- velm/symphony/conductor_core/handlers/state_handler/utils/path_resolver.py +41 -0
- velm/symphony/conductor_core/handlers/state_handler/utils/time_parser.py +25 -0
- velm/symphony/conductor_core/handlers/state_handler/utils/type_diviner.py +55 -0
- velm/symphony/conductor_core/handlers/vow_handler/__init__.py +13 -0
- velm/symphony/conductor_core/handlers/vow_handler/adjudicator.py +96 -0
- velm/symphony/conductor_core/handlers/vow_handler/contracts.py +24 -0
- velm/symphony/conductor_core/handlers/vow_handler/facade.py +63 -0
- velm/symphony/conductor_core/lifecycle/__init__.py +18 -0
- velm/symphony/conductor_core/lifecycle/contracts.py +35 -0
- velm/symphony/conductor_core/lifecycle/manager.py +208 -0
- velm/symphony/conductor_core/lifecycle/supervisor.py +212 -0
- velm/symphony/conductor_core/resilience/__init__.py +14 -0
- velm/symphony/conductor_core/resilience/artifacts.py +50 -0
- velm/symphony/conductor_core/resilience/contracts.py +55 -0
- velm/symphony/conductor_core/resilience/diagnosis.py +121 -0
- velm/symphony/conductor_core/resilience/intercession.py +225 -0
- velm/symphony/conductor_core/resilience/manager.py +208 -0
- velm/symphony/conductor_core/setup.py +238 -0
- velm/symphony/docs_generator.symphony +45 -0
- velm/symphony/execution/__init__.py +17 -0
- velm/symphony/execution/interface.py +103 -0
- velm/symphony/execution/kinetic_titan/__init__.py +13 -0
- velm/symphony/execution/kinetic_titan/executor.py +221 -0
- velm/symphony/execution/kinetic_titan/renderer.py +255 -0
- velm/symphony/execution/kinetic_titan/security.py +37 -0
- velm/symphony/execution/kinetic_titan/semantics.py +155 -0
- velm/symphony/execution/kinetic_titan/titan/__init__.py +14 -0
- velm/symphony/execution/kinetic_titan/titan/loops.py +406 -0
- velm/symphony/execution/kinetic_titan/titan/orchestrator.py +187 -0
- velm/symphony/execution/kinetic_titan/titan/state.py +185 -0
- velm/symphony/execution/kinetic_titan/titan/visuals.py +73 -0
- velm/symphony/execution/prophetic_oracle.py +113 -0
- velm/symphony/inquisitor/__init__.py +16 -0
- velm/symphony/inquisitor/oracle.py +172 -0
- velm/symphony/inquisitor/renderer.py +145 -0
- velm/symphony/inquisitor/temporal.py +133 -0
- velm/symphony/polyglot/__init__.py +68 -0
- velm/symphony/polyglot/adjudicators.py +77 -0
- velm/symphony/polyglot/artisan.py +396 -0
- velm/symphony/polyglot/grimoire.py +227 -0
- velm/symphony/polyglot/wards/__init__.py +0 -0
- velm/symphony/polyglot/wards/go_ward.py +20 -0
- velm/symphony/polyglot/wards/java_ward.py +21 -0
- velm/symphony/polyglot/wards/python_ward.py +37 -0
- velm/symphony/polyglot/wards/ruby_ward.py +49 -0
- velm/symphony/proclamations/__init__.py +0 -0
- velm/symphony/proclamations/base.py +39 -0
- velm/symphony/proclamations/file_scribe.py +47 -0
- velm/symphony/proclamations/panel_scribe.py +46 -0
- velm/symphony/proclamations/router.py +65 -0
- velm/symphony/proclamations/slack_scribe.py +93 -0
- velm/symphony/proclamations/table_scribe.py +109 -0
- velm/symphony/release.symphony +31 -0
- velm/symphony/renderers/__init__.py +17 -0
- velm/symphony/renderers/base.py +72 -0
- velm/symphony/renderers/basic_renderer/__init__.py +12 -0
- velm/symphony/renderers/basic_renderer/codex.py +16 -0
- velm/symphony/renderers/basic_renderer/emitter.py +59 -0
- velm/symphony/renderers/basic_renderer/facade.py +244 -0
- velm/symphony/renderers/basic_renderer/scribe.py +115 -0
- velm/symphony/renderers/basic_renderer/styler.py +59 -0
- velm/symphony/renderers/cinematic_renderer/__init__.py +12 -0
- velm/symphony/renderers/cinematic_renderer/facade.py +194 -0
- velm/symphony/renderers/cinematic_renderer/layout_engine.py +56 -0
- velm/symphony/renderers/cinematic_renderer/state.py +78 -0
- velm/symphony/renderers/cinematic_renderer/theme.py +40 -0
- velm/symphony/renderers/cinematic_renderer/widgets/__init__.py +8 -0
- velm/symphony/renderers/cinematic_renderer/widgets/context.py +20 -0
- velm/symphony/renderers/cinematic_renderer/widgets/footer.py +15 -0
- velm/symphony/renderers/cinematic_renderer/widgets/header.py +37 -0
- velm/symphony/renderers/cinematic_renderer/widgets/monitor.py +23 -0
- velm/symphony/renderers/cinematic_renderer/widgets/output.py +31 -0
- velm/symphony/renderers/cinematic_renderer/widgets/sparkline.py +105 -0
- velm/symphony/renderers/cinematic_renderer/widgets/timeline.py +49 -0
- velm/symphony/renderers/github_renderer/__init__.py +13 -0
- velm/symphony/renderers/github_renderer/emitter.py +92 -0
- velm/symphony/renderers/github_renderer/facade.py +232 -0
- velm/symphony/renderers/github_renderer/sanitizer.py +41 -0
- velm/symphony/renderers/raw_renderer/__init__.py +2 -0
- velm/symphony/renderers/raw_renderer/facade.py +96 -0
- velm/symphony/renderers/rich_renderer/__init__.py +2 -0
- velm/symphony/renderers/rich_renderer/facade.py +320 -0
- velm/symphony/renderers/rich_renderer/state.py +84 -0
- velm/symphony/renderers/rich_renderer/stream_scribe.py +301 -0
- velm/symphony/renderers/rich_renderer/theme.py +106 -0
- velm/symphony/renderers/rich_renderer/utils.py +29 -0
- velm/symphony/renderers/stream_renderer/__init__.py +13 -0
- velm/symphony/renderers/stream_renderer/codex.py +51 -0
- velm/symphony/renderers/stream_renderer/emitter.py +116 -0
- velm/symphony/renderers/stream_renderer/facade.py +218 -0
- velm/symphony/swarm.py +538 -0
- velm/themes/cyberpunk.css +29 -0
- velm/themes/monokai.css +24 -0
- velm/utils/__init__.py +69 -0
- velm/utils/archetype_utils.py +154 -0
- velm/utils/converters.py +135 -0
- velm/utils/core_utils.py +3238 -0
- velm/utils/dossier_scribe/__init__.py +13 -0
- velm/utils/dossier_scribe/constellation/__init__.py +14 -0
- velm/utils/dossier_scribe/constellation/arch_scribe/__init__.py +14 -0
- velm/utils/dossier_scribe/constellation/arch_scribe/dna.py +290 -0
- velm/utils/dossier_scribe/constellation/arch_scribe/markdown.py +139 -0
- velm/utils/dossier_scribe/constellation/arch_scribe/mermaids.py +60 -0
- velm/utils/dossier_scribe/constellation/arch_scribe/scribe.py +96 -0
- velm/utils/dossier_scribe/constellation/assets.py +74 -0
- velm/utils/dossier_scribe/constellation/crystal.py +66 -0
- velm/utils/dossier_scribe/constellation/hyperlinks.py +176 -0
- velm/utils/dossier_scribe/constellation/renderer.py +163 -0
- velm/utils/dossier_scribe/constellation/scribe.py +108 -0
- velm/utils/dossier_scribe/constellation/xray.py +69 -0
- velm/utils/dossier_scribe/facade.py +270 -0
- velm/utils/dossier_scribe/mentorship_scribe.py +47 -0
- velm/utils/dossier_scribe/prophecy_panel.py +29 -0
- velm/utils/dossier_scribe/security_scribe.py +27 -0
- velm/utils/dossier_scribe/telemetry_grid.py +167 -0
- velm/utils/ephemeral_server.py +53 -0
- velm/utils/gnosis_discovery.py +354 -0
- velm/utils/invocation.py +252 -0
- velm/utils/resolve_gnostic_content.py +140 -0
- velm/utils/workspace_utils.py +35 -0
- velm-0.1.2.dist-info/METADATA +283 -0
- velm-0.1.2.dist-info/RECORD +2195 -0
- velm-0.1.2.dist-info/WHEEL +5 -0
- velm-0.1.2.dist-info/entry_points.txt +2 -0
- velm-0.1.2.dist-info/licenses/LICENSE +52 -0
- velm-0.1.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,4854 @@
|
|
|
1
|
+
# scaffold/interfaces/requests.py
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
=================================================================================
|
|
5
|
+
== THE CODEX OF PLEAS (V-Ω-CORRECTED. THE UNIVERSAL REQUEST CONTRACTS) ==
|
|
6
|
+
=================================================================================
|
|
7
|
+
LIF: 10,000,000,000
|
|
8
|
+
|
|
9
|
+
This scripture defines the exact shape of every Plea (Request) the Engine accepts.
|
|
10
|
+
It serves as the **Unbreakable Contract** between the Mortal Realm (CLI, API) and
|
|
11
|
+
the Divine Realm (The Engine & Artisans).
|
|
12
|
+
|
|
13
|
+
It adheres to the **Law of Pydantic Alignment**: Every validator must target an
|
|
14
|
+
existing field name.
|
|
15
|
+
=================================================================================
|
|
16
|
+
"""
|
|
17
|
+
import hashlib
|
|
18
|
+
import os
|
|
19
|
+
import uuid
|
|
20
|
+
import time
|
|
21
|
+
import re
|
|
22
|
+
import sys
|
|
23
|
+
from datetime import datetime
|
|
24
|
+
from enum import Enum, auto
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
from typing import List, Dict, Any, Optional, Union, Literal
|
|
27
|
+
from uuid import UUID, uuid4
|
|
28
|
+
from urllib.parse import unquote
|
|
29
|
+
from pydantic import (
|
|
30
|
+
BaseModel,
|
|
31
|
+
Field,
|
|
32
|
+
ConfigDict,
|
|
33
|
+
field_validator,
|
|
34
|
+
model_validator,
|
|
35
|
+
computed_field,
|
|
36
|
+
EmailStr
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# --- LOCAL UTILITY (To avoid circular deps with Core) ---
|
|
41
|
+
def _clean_uri_to_path(uri: str) -> str:
|
|
42
|
+
"""Minimalist version of UriUtils for the Interface layer."""
|
|
43
|
+
if not uri: return ""
|
|
44
|
+
try:
|
|
45
|
+
# Decode & Strip Protocol
|
|
46
|
+
clean = uri.replace('file:///', '').replace('file://', '')
|
|
47
|
+
# FIX: Removed 'parse.' prefix since unquote is imported directly
|
|
48
|
+
clean = unquote(clean)
|
|
49
|
+
|
|
50
|
+
# Windows Drive fix: /c:/ -> c:/
|
|
51
|
+
if os.name == 'nt' and clean.startswith('/') and ':' in clean:
|
|
52
|
+
clean = clean.lstrip('/')
|
|
53
|
+
|
|
54
|
+
return str(Path(clean).resolve())
|
|
55
|
+
except:
|
|
56
|
+
return uri
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# =============================================================================
|
|
61
|
+
# == I. THE SHARED GNOSIS (GLOBAL CONTEXT) ==
|
|
62
|
+
# =============================================================================
|
|
63
|
+
|
|
64
|
+
class BaseRequest(BaseModel):
|
|
65
|
+
"""
|
|
66
|
+
=============================================================================
|
|
67
|
+
== THE UNIVERSAL CONTEXT (V-Ω-SELF-HARMONIZING-ULTIMA) ==
|
|
68
|
+
=============================================================================
|
|
69
|
+
LIF: 10,000,000,000 | ROLE: THE_ANCESTRAL_VESSEL
|
|
70
|
+
|
|
71
|
+
The Eternal Foundation for all Gnostic Pleas.
|
|
72
|
+
It carries the Identity, Context, Data, and Vows of the Architect.
|
|
73
|
+
|
|
74
|
+
### THE PANTHEON OF 12 ASCENDED FACULTIES:
|
|
75
|
+
1. **The Context Slot (`context`):** A mutable dictionary for Middleware injection
|
|
76
|
+
(e.g., Transaction IDs), solving the 'AttributeError' forever.
|
|
77
|
+
2. **The Silver Cord (`trace_id`):** A cosmic link for distributed tracing across threads.
|
|
78
|
+
3. **The Spatial Anchor (`project_root`):** Auto-resolves string paths to absolute `Path` objects.
|
|
79
|
+
4. **The Secret Vault (`secrets`):** A secure container for keys, redacted from logs.
|
|
80
|
+
5. **The Alchemical Harmonizer:** Synchronizes `verbose` (bool) and `verbosity` (int) without recursion.
|
|
81
|
+
6. **The Identity Matrix:** Tracks `client_id` (Who summoned me?) and `session_id`.
|
|
82
|
+
7. **The Temporal Seal:** Records the precise `timestamp` of inception.
|
|
83
|
+
8. **The Permissive Gate (`extra='allow'`):** Absorbs unknown flags from CLI without crashing.
|
|
84
|
+
9. **The Simulation Flags:** First-class support for `dry_run` and `preview`.
|
|
85
|
+
10. **The Interaction Guard:** `non_interactive` flag for CI/CD pipelines.
|
|
86
|
+
11. **The Dynamic Variable Store:** `variables` dict for user-injected overrides (`--set`).
|
|
87
|
+
12. **The Type-Safety Bridge:** `arbitrary_types_allowed` permits complex objects in context.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
# [ASCENSION 8 & 12]: SCHEMA CONFIGURATION
|
|
91
|
+
model_config = ConfigDict(
|
|
92
|
+
extra='allow', # Absorb unknown CLI flags without crashing
|
|
93
|
+
arbitrary_types_allowed=True, # Allow complex types in context (e.g. socket objects)
|
|
94
|
+
populate_by_name=True # Allow aliasing
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# =========================================================================
|
|
98
|
+
# == SECTION I: THE CHRONOMANCER'S SEAL (Identity & Time) ==
|
|
99
|
+
# =========================================================================
|
|
100
|
+
|
|
101
|
+
request_id: str = Field(
|
|
102
|
+
default_factory=lambda: uuid.uuid4().hex,
|
|
103
|
+
description="The unique Gnostic fingerprint of this specific intent."
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
trace_id: Optional[str] = Field(
|
|
107
|
+
default=None,
|
|
108
|
+
description="The Cosmic ID linking this rite across time and space (Middleware)."
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
session_id: str = Field(
|
|
112
|
+
default="global",
|
|
113
|
+
description="The timeline this request belongs to (Daemon Session)."
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
client_id: str = Field(
|
|
117
|
+
default="local",
|
|
118
|
+
description="The identity of the summoner (CLI, Daemon, IDE)."
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
timestamp: float = Field(
|
|
122
|
+
default_factory=time.time,
|
|
123
|
+
description="The precise moment the Architect's will was spoken."
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# =========================================================================
|
|
127
|
+
# == SECTION II: THE ANCHOR OF REALITY (Location) ==
|
|
128
|
+
# =========================================================================
|
|
129
|
+
|
|
130
|
+
project_root: Optional[Path] = Field(
|
|
131
|
+
default=None,
|
|
132
|
+
description="The physical anchor of the project. If Void, the Engine divines it."
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# =========================================================================
|
|
136
|
+
# == SECTION III: THE ALCHEMICAL INPUTS (Data & State) ==
|
|
137
|
+
# =========================================================================
|
|
138
|
+
|
|
139
|
+
# [ASCENSION 1: THE CURE]: The Context Slot
|
|
140
|
+
# This field MUST exist for the Dispatcher to inject 'transaction_id'.
|
|
141
|
+
context: Dict[str, Any] = Field(
|
|
142
|
+
default_factory=dict,
|
|
143
|
+
description="Ephemeral storage for Middleware injections (Transactions, Auth)."
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
variables: Dict[str, Any] = Field(
|
|
147
|
+
default_factory=dict,
|
|
148
|
+
description="Dynamic Gnosis injected via --set key=value."
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
secrets: Dict[str, str] = Field(
|
|
152
|
+
default_factory=dict,
|
|
153
|
+
description="The Secure Vault for ephemeral keys. REDACTED from logs."
|
|
154
|
+
)
|
|
155
|
+
# [ASCENSION 13]: THE RECURSIVE DEPTH SENTINEL (THE CURE)
|
|
156
|
+
# Tracks the number of times a request has spawned a sub-request.
|
|
157
|
+
hop_count: int = Field(
|
|
158
|
+
default=0,
|
|
159
|
+
ge=0,
|
|
160
|
+
le=5,
|
|
161
|
+
description="The number of architectural jumps this signal has taken."
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# =========================================================================
|
|
166
|
+
# == SECTION IV: THE MODES OF EXISTENCE (The Vows) ==
|
|
167
|
+
# =========================================================================
|
|
168
|
+
|
|
169
|
+
# --- Output & Logging ---
|
|
170
|
+
verbose: bool = Field(False, description="Enable luminous logging (Level DEBUG).")
|
|
171
|
+
silent: bool = Field(False, description="The Vow of Silence. Suppress stdout.")
|
|
172
|
+
verbosity: int = Field(0, description="Legacy integer level: 0=Normal, 1=Verbose, -1=Silent.")
|
|
173
|
+
debug: bool = Field(False, description="Wait for debugger attachment.")
|
|
174
|
+
|
|
175
|
+
# --- Safety & Simulation ---
|
|
176
|
+
dry_run: bool = Field(False, description="Simulate the rite without material side effects.")
|
|
177
|
+
preview: bool = Field(False, description="Generate a visual prophecy of the outcome.")
|
|
178
|
+
audit: bool = Field(False, description="Generate a forensic dossier of the attempt.")
|
|
179
|
+
force: bool = Field(False, description="Bypass safety guards (The Rite of Absolute Will).")
|
|
180
|
+
|
|
181
|
+
# --- Interaction ---
|
|
182
|
+
non_interactive: bool = Field(False, description="Suppress all prompts (CI Mode).")
|
|
183
|
+
interactive: bool = Field(True, description="Allow Socratic dialogue.")
|
|
184
|
+
|
|
185
|
+
# --- Lifecycle ---
|
|
186
|
+
no_edicts: bool = Field(False, description="Suppress post-run Maestro commands.")
|
|
187
|
+
|
|
188
|
+
# =========================================================================
|
|
189
|
+
# == SECTION V: THE RITES OF HARMONIZATION (Validators) ==
|
|
190
|
+
# =========================================================================
|
|
191
|
+
|
|
192
|
+
@field_validator('project_root', mode='before')
|
|
193
|
+
@classmethod
|
|
194
|
+
def _anchor_root(cls, v: Any) -> Optional[Path]:
|
|
195
|
+
"""
|
|
196
|
+
[ASCENSION 3]: PATH TRANSMUTATION
|
|
197
|
+
Instantly converts string paths into resolved Path objects.
|
|
198
|
+
"""
|
|
199
|
+
if v is None: return None
|
|
200
|
+
if isinstance(v, Path): return v.resolve()
|
|
201
|
+
if isinstance(v, str) and v.strip():
|
|
202
|
+
return Path(v).resolve()
|
|
203
|
+
return v
|
|
204
|
+
|
|
205
|
+
@model_validator(mode='after')
|
|
206
|
+
def harmonize_flags(self) -> 'BaseRequest':
|
|
207
|
+
"""
|
|
208
|
+
[ASCENSION 5]: THE HARMONIZER OF VOICES (RECURSION SHIELDED)
|
|
209
|
+
Surgically synchronizes verbosity states using 'object.__setattr__'
|
|
210
|
+
to bypass Pydantic's validation loop and prevent RecursionError.
|
|
211
|
+
"""
|
|
212
|
+
# 1. Sync Integer -> Boolean
|
|
213
|
+
if self.verbosity > 0:
|
|
214
|
+
object.__setattr__(self, 'verbose', True)
|
|
215
|
+
object.__setattr__(self, 'silent', False)
|
|
216
|
+
elif self.verbosity < 0:
|
|
217
|
+
object.__setattr__(self, 'verbose', False)
|
|
218
|
+
object.__setattr__(self, 'silent', True)
|
|
219
|
+
|
|
220
|
+
# 2. Sync Boolean -> Integer
|
|
221
|
+
if self.verbose:
|
|
222
|
+
object.__setattr__(self, 'verbosity', 1)
|
|
223
|
+
if self.silent:
|
|
224
|
+
object.__setattr__(self, 'verbose', False)
|
|
225
|
+
object.__setattr__(self, 'verbosity', -1)
|
|
226
|
+
|
|
227
|
+
# 3. Initialize Context if Void (Double Safety)
|
|
228
|
+
if self.context is None:
|
|
229
|
+
object.__setattr__(self, 'context', {})
|
|
230
|
+
|
|
231
|
+
return self
|
|
232
|
+
|
|
233
|
+
@model_validator(mode='after')
|
|
234
|
+
def guard_recursion_loop(self) -> 'BaseRequest':
|
|
235
|
+
"""
|
|
236
|
+
[THE CURE]: Prevents the 'Feedback Scream' Paradox.
|
|
237
|
+
If a signal jumps between ChatOps, Strikes, and Alerts more than 3 times,
|
|
238
|
+
it is identified as an infinite loop and vaporized.
|
|
239
|
+
"""
|
|
240
|
+
from ..contracts.heresy_contracts import HeresySeverity, ArtisanHeresy
|
|
241
|
+
# We set the hard ceiling at 4.
|
|
242
|
+
# 0: Ingress -> 1: Dispatch -> 2: Artisan -> 3: Sub-Dispatch (Safe) -> 4: VOID
|
|
243
|
+
if self.hop_count > 3:
|
|
244
|
+
# We raise a Critical Heresy to halt the thread immediately
|
|
245
|
+
raise ArtisanHeresy(
|
|
246
|
+
message=f"Recursive Loop Detected (Hops: {self.hop_count}).",
|
|
247
|
+
severity=HeresySeverity.CRITICAL,
|
|
248
|
+
suggestion="Check your ChatOps or Logic reflexes for circular triggers.",
|
|
249
|
+
details="A signal attempted to jump strata more than 3 times."
|
|
250
|
+
)
|
|
251
|
+
return self
|
|
252
|
+
# =============================================================================
|
|
253
|
+
# == 1. GENESIS RITE (scaffold <blueprint>) ==
|
|
254
|
+
# =============================================================================
|
|
255
|
+
|
|
256
|
+
class GenesisRequest(BaseRequest):
|
|
257
|
+
"""
|
|
258
|
+
Plea to materialize a Blueprint (Form).
|
|
259
|
+
This matches the `scaffold genesis` command and the implicit `scaffold file.scaffold`.
|
|
260
|
+
"""
|
|
261
|
+
blueprint_path: Union[Path, str] = Field(
|
|
262
|
+
default=".",
|
|
263
|
+
description="Path to the blueprint file, URL, or raw content."
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
# ★★★ THE DIVINE HEALING ★★★
|
|
267
|
+
# The 'silent' vow is now an explicit part of the Genesis contract,
|
|
268
|
+
# inheriting its Gnosis from the BaseRequest but making it directly
|
|
269
|
+
# perceivable by the GenesisArtisan. The AttributeError is annihilated.
|
|
270
|
+
silent: bool = Field(
|
|
271
|
+
default=False,
|
|
272
|
+
description="Suppress all non-essential output (derived from verbosity)."
|
|
273
|
+
)
|
|
274
|
+
# ==========================
|
|
275
|
+
|
|
276
|
+
@field_validator('blueprint_path')
|
|
277
|
+
def validate_blueprint_path(cls, v):
|
|
278
|
+
if isinstance(v, str) and not (v.startswith('http') or '\n' in v):
|
|
279
|
+
return Path(v)
|
|
280
|
+
return v
|
|
281
|
+
|
|
282
|
+
# =============================================================================
|
|
283
|
+
# == 2. SYMPHONY RITE (scaffold symphony) ==
|
|
284
|
+
# =============================================================================
|
|
285
|
+
|
|
286
|
+
class SymphonyRequest(BaseRequest):
|
|
287
|
+
"""
|
|
288
|
+
=================================================================================
|
|
289
|
+
== THE VESSEL OF ORCHESTRATION (V-Ω-SYMPHONY-REQUEST-ULTRA-DIVINE) ==
|
|
290
|
+
=================================================================================
|
|
291
|
+
@gnosis:title SymphonyRequest
|
|
292
|
+
@gnosis:summary The supreme, constitutional vessel for conducting a Symphony of Will.
|
|
293
|
+
@gnosis:lif 10,000,000,000,000
|
|
294
|
+
|
|
295
|
+
This is the divine contract that carries the Architect's complete and unambiguous
|
|
296
|
+
will to the Symphony Conductor. It has been ascended to its final, eternal form,
|
|
297
|
+
a masterpiece of Gnostic governance, resilience, and clarity.
|
|
298
|
+
=================================================================================
|
|
299
|
+
"""
|
|
300
|
+
#
|
|
301
|
+
# --- I. The Core Edict (The Architect's Will) ---
|
|
302
|
+
#
|
|
303
|
+
symphony_command: str = Field(
|
|
304
|
+
...,
|
|
305
|
+
description="The primary rite to be conducted (e.g., 'conduct', 'debug')."
|
|
306
|
+
)
|
|
307
|
+
symphony_path: Optional[str] = Field(
|
|
308
|
+
None,
|
|
309
|
+
description="The sacred scripture of will; the path to the .symphony file."
|
|
310
|
+
)
|
|
311
|
+
task: Optional[str] = Field(
|
|
312
|
+
None,
|
|
313
|
+
description="A specific @task to conduct, overriding the main symphony body."
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
#
|
|
317
|
+
# --- II. Execution & Reality (The Realm of Manifestation) ---
|
|
318
|
+
#
|
|
319
|
+
rehearse: bool = Field(
|
|
320
|
+
False,
|
|
321
|
+
description="The Vow of Prophecy. Conducts the symphony in an ephemeral, isolated reality (a temporary directory) to prophesize its effects without altering the mortal realm."
|
|
322
|
+
)
|
|
323
|
+
manifest: bool = Field(
|
|
324
|
+
False,
|
|
325
|
+
description="The Vow of Manifestation. A sacred vow that the symphony MUST be conducted upon the living, current reality. This is the default for `symphony conduct`."
|
|
326
|
+
)
|
|
327
|
+
no_cleanup: bool = Field(
|
|
328
|
+
False,
|
|
329
|
+
description="A Gnostic ward that preserves the ephemeral sanctum after a rehearsal, allowing for forensic inquest."
|
|
330
|
+
)
|
|
331
|
+
parallelism: int = Field(
|
|
332
|
+
4,
|
|
333
|
+
description="The number of concurrent realities to forge for parallel blocks (&&)."
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
#
|
|
337
|
+
# --- III. Resilience & Time (The Wards Against Chaos) ---
|
|
338
|
+
#
|
|
339
|
+
fail_fast: bool = Field(
|
|
340
|
+
False,
|
|
341
|
+
description="If true, the symphony will halt at the first sign of heresy. If false, it will attempt to continue."
|
|
342
|
+
)
|
|
343
|
+
retry_attempts: int = Field(
|
|
344
|
+
0,
|
|
345
|
+
description="A global override for the number of times to retry a failed edict."
|
|
346
|
+
)
|
|
347
|
+
timeout_global: int = Field(
|
|
348
|
+
3600,
|
|
349
|
+
description="A temporal ward. The maximum duration (in seconds) for the entire symphony before it is struck down."
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
#
|
|
353
|
+
# --- IV. Security & Governance (The Laws of the Sanctum) ---
|
|
354
|
+
#
|
|
355
|
+
security_level: str = Field(
|
|
356
|
+
"standard",
|
|
357
|
+
description="The strictness of the Gnostic Sentry's Gaze ('permissive', 'standard', 'paranoid')."
|
|
358
|
+
)
|
|
359
|
+
allow_network: bool = Field(
|
|
360
|
+
True,
|
|
361
|
+
description="A universal ward to permit or forbid any edict that communes with the celestial void (network)."
|
|
362
|
+
)
|
|
363
|
+
allow_destructive: bool = Field(
|
|
364
|
+
True,
|
|
365
|
+
description="A universal ward to permit or forbid rites of annihilation (e.g., `rm`)."
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
#
|
|
369
|
+
# --- V. Telemetry & Forensics (The Gnostic Chronicle) ---
|
|
370
|
+
#
|
|
371
|
+
log: Optional[str] = Field(
|
|
372
|
+
None,
|
|
373
|
+
description="Path to a file for the structured event log (.jsonl). If not set, logs are ephemeral."
|
|
374
|
+
)
|
|
375
|
+
log_level: str = Field(
|
|
376
|
+
"INFO",
|
|
377
|
+
description="The luminosity of the Gnostic Chronicle (DEBUG, INFO, WARNING, ERROR)."
|
|
378
|
+
)
|
|
379
|
+
chronicle_path: Optional[str] = Field(
|
|
380
|
+
None,
|
|
381
|
+
description="The path to a .jsonl chronicle for the `debug` rite."
|
|
382
|
+
)
|
|
383
|
+
trace_id: Optional[str] = Field(
|
|
384
|
+
None,
|
|
385
|
+
description="The Gnostic Trace ID for distributed causality tracking."
|
|
386
|
+
)
|
|
387
|
+
artifact_dir: Optional[str] = Field(
|
|
388
|
+
None,
|
|
389
|
+
description="A dedicated sanctum for forensic artifacts (e.g., crash dumps, failure logs)."
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
#
|
|
393
|
+
# --- VI. The Luminous Voice (Rendering & User Experience) ---
|
|
394
|
+
#
|
|
395
|
+
# [ASCENSION] The Visual Preference
|
|
396
|
+
renderer: str = "auto" # 'auto', 'basic', 'rich', 'cinematic', 'stream'
|
|
397
|
+
|
|
398
|
+
cinematic: bool = Field(
|
|
399
|
+
False,
|
|
400
|
+
description="Summon the Gnostic Orrery, an immersive, real-time TUI dashboard for the symphony."
|
|
401
|
+
)
|
|
402
|
+
no_tui: bool = Field(
|
|
403
|
+
False,
|
|
404
|
+
description="An alias for `--renderer=stream`, ensuring a clean, non-interactive output stream."
|
|
405
|
+
)
|
|
406
|
+
github_actions: bool = Field(
|
|
407
|
+
False,
|
|
408
|
+
description="Format all proclamations using the sacred grammar of GitHub Actions workflow commands."
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
#
|
|
412
|
+
# --- VII. The Gnostic Bridge (Inherited & Universal Vows) ---
|
|
413
|
+
#
|
|
414
|
+
# This re-proclamation of fields from BaseRequest ensures that this sacred contract
|
|
415
|
+
# is whole and self-contained, its every vow luminous and explicit. The Pydantic
|
|
416
|
+
# God-Engine will righteously honor these as the one true definition.
|
|
417
|
+
#
|
|
418
|
+
force: bool = Field(
|
|
419
|
+
False,
|
|
420
|
+
description="The Rite of Absolute Will. Bypasses interactive safeguards and Gnostic Sentinels."
|
|
421
|
+
)
|
|
422
|
+
non_interactive: bool = Field(
|
|
423
|
+
False,
|
|
424
|
+
description="The Vow of Silence. Suppresses all interactive prompts, accepting default Gnosis."
|
|
425
|
+
)
|
|
426
|
+
variables: Dict[str, Any] = Field(
|
|
427
|
+
default_factory=dict,
|
|
428
|
+
alias="var", # Allows `--var key=val` to populate this vessel.
|
|
429
|
+
description="A vessel for all Gnostic variables bestowed upon the symphony at the moment of its birth."
|
|
430
|
+
)
|
|
431
|
+
silent: bool = Field(
|
|
432
|
+
default=False,
|
|
433
|
+
description="The Vow of Silence. Suppresses all but the most critical proclamations."
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
# =============================================================================
|
|
437
|
+
# == 4. CREATE RITE (scaffold create) ==
|
|
438
|
+
# =============================================================================
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
class CreateRequest(BaseRequest):
|
|
442
|
+
"""
|
|
443
|
+
=================================================================================
|
|
444
|
+
== THE VESSEL OF AD-HOC CREATION (V-Ω-ETERNAL-APOTHEOSIS-ULTIMA++) ==
|
|
445
|
+
=================================================================================
|
|
446
|
+
@gnosis:title CreateRequest
|
|
447
|
+
@gnosis:summary The one true, complete, and eternal contract for the `create` rite.
|
|
448
|
+
@gnosis:LIF 1,000,000,000
|
|
449
|
+
|
|
450
|
+
This sacred Pydantic vessel represents the Architect's complete will for a single,
|
|
451
|
+
ad-hoc creation event. It has been ascended to carry not just the plea of *what*
|
|
452
|
+
to create, but the full Gnostic context of *how* and *why*. It is the unbreakable
|
|
453
|
+
link in the chain of causality from the CLI to the Quantum Creator, its every
|
|
454
|
+
attribute a sacred vow, its every comment a verse in the Gnostic Grimoire.
|
|
455
|
+
=================================================================================
|
|
456
|
+
"""
|
|
457
|
+
|
|
458
|
+
# --- I. The Core Plea (The "What") ---
|
|
459
|
+
# The fundamental Gnosis of the rite: the scriptures to be forged.
|
|
460
|
+
paths: List[str] = Field(
|
|
461
|
+
...,
|
|
462
|
+
description="A list of one or more relative paths to the files or directories to be created."
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
# --- II. The Soul of the Scripture (The "How") ---
|
|
466
|
+
# These attributes define the origin of the content for the new scriptures.
|
|
467
|
+
# They are mutually exclusive vows, adjudicated by the GnosticBuilder.
|
|
468
|
+
content: Optional[str] = Field(None, description="Directly provided content for the new file(s).")
|
|
469
|
+
from_template: bool = Field(False, alias="template",
|
|
470
|
+
description="A vow to use a template from the Forge for content.")
|
|
471
|
+
from_source: Optional[str] = Field(None, alias="source", description="A vow to seed content from an existing file.")
|
|
472
|
+
from_stdin: bool = Field(False, alias="stdin",
|
|
473
|
+
description="A vow to read content from the celestial river (stdin).")
|
|
474
|
+
paste: bool = Field(False, description="A vow to paste content from the system clipboard.")
|
|
475
|
+
from_url: Optional[str] = Field(None, alias="url", description="A vow to fetch content from a celestial URL.")
|
|
476
|
+
no_template: bool = Field(False, description="A sacred vow to explicitly forbid the use of any template.")
|
|
477
|
+
kit: Optional[str] = Field(None, description="A plea to expand a pre-defined kit of files from the Forge.")
|
|
478
|
+
of: Optional[List[str]] = Field(None,
|
|
479
|
+
description="A plea to perform a semantic creation (e.g., --of component:Button).")
|
|
480
|
+
needs: List[str] = Field(default_factory=list,
|
|
481
|
+
description="A list of dependencies required for this creation's purity.")
|
|
482
|
+
# --- THE DIVINE ASCENSION ---
|
|
483
|
+
raw: bool = Field(False,
|
|
484
|
+
description="The Vow of Raw Creation. Bypasses templates and uses '--set content' directly.")
|
|
485
|
+
# --- III. The Universal Vows of Execution (THE DIVINE HEALING) ---
|
|
486
|
+
# These attributes were missing, causing the Gnostic Schism. They are now
|
|
487
|
+
# permanently enshrined in this vessel's soul, mirroring the vows available
|
|
488
|
+
# to all major rites and ensuring a unified contract with the QuantumCreator.
|
|
489
|
+
dry_run: bool = Field(False, description="The Vow of Prophecy: Simulate the rite without altering reality.")
|
|
490
|
+
preview: bool = Field(False,
|
|
491
|
+
description="The Vow of Luminous Prophecy: Render a visual diff of the intended changes.")
|
|
492
|
+
audit: bool = Field(False, description="The Vow of the Machine's Gaze: Proclaim a machine-readable JSON Dossier.")
|
|
493
|
+
lint: bool = Field(False, description="The Vow of the Mentor's Gaze: Adjudicate the purity of the final reality.")
|
|
494
|
+
silent: bool = Field(False, description="The Vow of Silence: Suppress all but the most critical proclamations.")
|
|
495
|
+
force: bool = Field(False,
|
|
496
|
+
description="The Vow of Absolute Will: Bypass all interactive safeguards and overwrite existing scriptures.")
|
|
497
|
+
non_interactive: bool = Field(False,
|
|
498
|
+
description="The Vow of Automation: Suppress all interactive dialogues, accepting defaults.")
|
|
499
|
+
no_edicts: bool = Field(False,
|
|
500
|
+
description="The Vow of Stillness: Stay the hand of the Maestro, preventing post-run commands.")
|
|
501
|
+
is_genesis_rite: bool = Field(False,
|
|
502
|
+
description="A Gnostic hint to downstream artisans that this is part of a larger Genesis rite.")
|
|
503
|
+
adjudicate_souls: bool = Field(False, alias="adjudicate",
|
|
504
|
+
description="A plea to summon the Sentinel to adjudicate the purity of newly forged souls.")
|
|
505
|
+
|
|
506
|
+
# --- IV. The Rites of Post-Creation (The Afterlife) ---
|
|
507
|
+
# These vows dictate the actions to be taken after the core creation is complete.
|
|
508
|
+
edit: bool = Field(False, description="A plea to open the newly created file(s) in the default editor.")
|
|
509
|
+
teach: Optional[List[str]] = Field(None,
|
|
510
|
+
description="A plea to teach the created file to the Forge as a new template.")
|
|
511
|
+
|
|
512
|
+
# --- V. The Gnostic Modifiers (The Nuances of Will) ---
|
|
513
|
+
# These attributes refine the very nature of the creation act itself.
|
|
514
|
+
dir: bool = Field(False, description="A vow to force the created path to be a sanctum (directory).")
|
|
515
|
+
create_if_void: bool = Field(True,
|
|
516
|
+
description="A vow to forge a scripture even if it does not yet exist. Defaults to True for the `create` rite.")
|
|
517
|
+
|
|
518
|
+
# ★★★ THE SACRED ALIAS (THE BRIDGE BETWEEN WORLDS) ★★★
|
|
519
|
+
# This computed field is the final, divine healing. It acts as a Gnostic Bridge,
|
|
520
|
+
# allowing the ancient `QuantumCreator` to ask for `base_path` and receive the
|
|
521
|
+
# pure Gnosis of `project_root`. This ensures backward compatibility while we
|
|
522
|
+
# perform the deeper surgery on the Creator's mind.
|
|
523
|
+
@property
|
|
524
|
+
def base_path(self) -> Path:
|
|
525
|
+
"""A luminous, Gnostic alias for `project_root` to heal ancient contracts."""
|
|
526
|
+
return self.project_root
|
|
527
|
+
|
|
528
|
+
# =============================================================================
|
|
529
|
+
# == 5. WEAVE RITE (scaffold weave) ==
|
|
530
|
+
# =============================================================================
|
|
531
|
+
|
|
532
|
+
class WeaveRequest(BaseRequest):
|
|
533
|
+
"""
|
|
534
|
+
A plea to weave an architectural fragment into reality.
|
|
535
|
+
"""
|
|
536
|
+
fragment_name: Optional[str] = Field(None, description="The name of the archetype to weave.")
|
|
537
|
+
target_directory: Optional[str] = Field(None, description="The destination sanctum.")
|
|
538
|
+
list: bool = Field(False, description="If True, proclaim the Grimoire of Archetypes.")
|
|
539
|
+
|
|
540
|
+
# Distillation Options
|
|
541
|
+
distill_path: Optional[str] = None
|
|
542
|
+
archetype_name: Optional[str] = None
|
|
543
|
+
|
|
544
|
+
# Strategies
|
|
545
|
+
is_recursive: bool = False
|
|
546
|
+
conflict_strategy: str = "overwrite"
|
|
547
|
+
|
|
548
|
+
# [THE DIVINE HEALING: THE VOW OF SILENCE]
|
|
549
|
+
# This attribute is restored to the vessel, allowing the Conductor to
|
|
550
|
+
# adjudicate the final proclamation without triggering an AttributeError.
|
|
551
|
+
silent: bool = Field(False, description="If True, the Weaver works in shadows.")
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
# =================================================================================
|
|
555
|
+
# == THE DISTILLATION PLEA (V-Ω-ULTRA-DEFINITIVE-APOTHEOSIS) ==
|
|
556
|
+
# =================================================================================
|
|
557
|
+
class DistillRequest(BaseRequest):
|
|
558
|
+
"""
|
|
559
|
+
=================================================================================
|
|
560
|
+
== THE REVERSE GENESIS CONTRACT (V-Ω-ULTRA-DEFINITIVE-SINGULARITY) ==
|
|
561
|
+
=================================================================================
|
|
562
|
+
@gnosis:title The Gnostic Plea for Distillation (`DistillRequest`)
|
|
563
|
+
@gnosis:summary The sovereign vessel for the `distill` rite, which transmutes a
|
|
564
|
+
living reality (filesystem) into a Gnostic Blueprint.
|
|
565
|
+
@gnosis:LIF 10,000,000,000,000
|
|
566
|
+
|
|
567
|
+
This is the divine, immutable, and hyper-sentient Gnostic Contract for the entire
|
|
568
|
+
distillation cosmos. It is the one true vessel that captures the Architect's
|
|
569
|
+
complete will for a rite of Reverse Genesis, translating pleas from the CLI into
|
|
570
|
+
a pure, unbreakable scripture for the DistillArtisan's Gaze.
|
|
571
|
+
|
|
572
|
+
### THE PANTHEON OF ASCENDED FACULTIES:
|
|
573
|
+
|
|
574
|
+
1. **Gnostic Aliases:** Forged with Pydantic aliases, it creates an unbreakable
|
|
575
|
+
bridge between the Architect's tongue (CLI flags like `--exec`, `--budget`)
|
|
576
|
+
and the Engine's mind (`exec_command`, `token_budget`).
|
|
577
|
+
|
|
578
|
+
2. **Robust Validators:** Its soul contains Alchemical Scribes (`@field_validator`)
|
|
579
|
+
that transmute profane inputs (e.g., `'800k'`, `'auth,db'`) into pure, Gnostic
|
|
580
|
+
types (`800000`, `['auth', 'db']`), preventing heresies at the gate.
|
|
581
|
+
|
|
582
|
+
3. **Complete Gnostic Mapping:** Every plea and vow from the `_perception_rites.py`
|
|
583
|
+
Grimoire has its consecrated place within this vessel, ensuring no intent is
|
|
584
|
+
ever lost in the aether.
|
|
585
|
+
|
|
586
|
+
4. **Logical Grouping:** The contract is a readable scripture, its fields organized
|
|
587
|
+
into sacred movements that mirror the faculties of the Distillation Oracle,
|
|
588
|
+
from the Gaze of Intent to the Socratic Dial.
|
|
589
|
+
|
|
590
|
+
5. **Unbreakable Contract:** Forged in the fires of Pydantic, its every attribute
|
|
591
|
+
is a sacred vow of type and form, guarding the Engine against profane pleas.
|
|
592
|
+
"""
|
|
593
|
+
model_config = ConfigDict(extra='allow')
|
|
594
|
+
|
|
595
|
+
# =============================================================================
|
|
596
|
+
# == I. THE GAZE OF INTENT (TARGETING & SCOPE) ==
|
|
597
|
+
# =============================================================================
|
|
598
|
+
# These fields define the "what" and "where" of the Gaze, anchoring it in
|
|
599
|
+
# spacetime and defining its boundaries.
|
|
600
|
+
|
|
601
|
+
source_path: str = Field(
|
|
602
|
+
default=".",
|
|
603
|
+
description="The physical directory or celestial URL (Git/HTTP) to be distilled."
|
|
604
|
+
)
|
|
605
|
+
|
|
606
|
+
profile: Optional[str] = Field(
|
|
607
|
+
default=None,
|
|
608
|
+
description="A named configuration profile (e.g., 'frontend', 'backend') to apply a pre-defined set of Gnostic filters."
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
focus: List[str] = Field(
|
|
612
|
+
default_factory=list,
|
|
613
|
+
description="Semantic keywords (e.g., 'Causal Slicer', 'auth') to prioritize. Scriptures and symbols resonating with these words are given divine relevance."
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
# [THE GNOSTIC SCHISM HEALED]
|
|
617
|
+
intent: Optional[str] = Field(
|
|
618
|
+
default=None,
|
|
619
|
+
description="A natural language plea of intent (e.g., 'Refactor the auth middleware') that guides the AI Sentinel's Semantic Search."
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
ignore: List[str] = Field(
|
|
623
|
+
default_factory=list,
|
|
624
|
+
description="Glob patterns for scriptures to be banished from the Gaze (e.g., '*.lock', 'dist/')."
|
|
625
|
+
)
|
|
626
|
+
|
|
627
|
+
include: List[str] = Field(
|
|
628
|
+
default_factory=list,
|
|
629
|
+
description="A Gnostic whitelist. If proclaimed, only scriptures matching these glob patterns will be perceived."
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
stub_deps: List[str] = Field(
|
|
633
|
+
default_factory=list,
|
|
634
|
+
description="Dependencies to be replaced with semantic stubs (signatures only) to conserve the token budget."
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
# =============================================================================
|
|
638
|
+
# == II. THE INQUISITOR'S FOCUS (FORENSICS & SEMANTICS) ==
|
|
639
|
+
# =============================================================================
|
|
640
|
+
# These fields command the specialist inquisitors to perform deep, forensic,
|
|
641
|
+
# or semantic analysis upon the target reality.
|
|
642
|
+
|
|
643
|
+
problem: Optional[str] = Field(
|
|
644
|
+
default=None,
|
|
645
|
+
description="Raw error logs, a traceback, or a problem description to anchor the Forensic Gaze, focusing the Gnosis on the locus of a heresy."
|
|
646
|
+
)
|
|
647
|
+
|
|
648
|
+
# Legacy field mapping to 'intent', preserved for backward compatibility in some rituals
|
|
649
|
+
feature: Optional[str] = Field(
|
|
650
|
+
default=None,
|
|
651
|
+
description="Deprecated alias for 'intent'. Use 'intent' for semantic search queries."
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
audit_security: bool = Field(
|
|
655
|
+
default=False,
|
|
656
|
+
description="If True, awakens the Security Inquisitor to scan for vulnerabilities and prioritize profane scriptures."
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
# =============================================================================
|
|
660
|
+
# == III. THE CHRONOMANCER'S GAZE (TEMPORAL CONTEXT) ==
|
|
661
|
+
# =============================================================================
|
|
662
|
+
# These fields command the Oracle to gaze into the Git Chronicle, making the
|
|
663
|
+
# distillation aware of the project's history and recent evolution.
|
|
664
|
+
|
|
665
|
+
since: Optional[str] = Field(
|
|
666
|
+
default=None,
|
|
667
|
+
description="A Git ref (hash, branch, tag). The Chronomancer will use this to highlight scriptures that have been transfigured since this moment in time."
|
|
668
|
+
)
|
|
669
|
+
|
|
670
|
+
focus_change: Optional[str] = Field(
|
|
671
|
+
default=None,
|
|
672
|
+
description="A strict temporal filter. Only souls changed since this Git ref will be perceived."
|
|
673
|
+
)
|
|
674
|
+
|
|
675
|
+
diff_context: bool = Field(
|
|
676
|
+
default=False,
|
|
677
|
+
description="If True, injects inline diffs (`[WAS: ...]`) showing the Gnostic drift between the working tree and the state at HEAD."
|
|
678
|
+
)
|
|
679
|
+
|
|
680
|
+
regression: bool = Field(
|
|
681
|
+
default=False,
|
|
682
|
+
description="If True, awakens the Temporal Inquisitor, which conducts an automated `git bisect` symphony to find the source of a regression."
|
|
683
|
+
)
|
|
684
|
+
|
|
685
|
+
# =============================================================================
|
|
686
|
+
# == IV. THE HIGH PRIEST'S STRATEGY (BUDGET & PHILOSOPHY) ==
|
|
687
|
+
# =============================================================================
|
|
688
|
+
# These fields govern the core philosophy and economic constraints of the
|
|
689
|
+
# distillation rite, balancing detail against the token budget.
|
|
690
|
+
|
|
691
|
+
strategy: str = Field(
|
|
692
|
+
default="balanced",
|
|
693
|
+
description="The distillation philosophy: 'surgical', 'faithful', 'balanced', or 'structure'."
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
token_budget: int = Field(
|
|
697
|
+
default=100000,
|
|
698
|
+
alias="budget",
|
|
699
|
+
description="The maximum token mass allowed for the forged blueprint. The Oracle will prune reality to fit this Gnostic vessel."
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
prioritize_tests: bool = Field(
|
|
703
|
+
default=False,
|
|
704
|
+
description="If True, scriptures of adjudication (tests) are considered as valuable as scriptures of implementation."
|
|
705
|
+
)
|
|
706
|
+
|
|
707
|
+
summarize_arch: bool = Field(
|
|
708
|
+
default=False,
|
|
709
|
+
description="If True, the Gnostic Cartographer will inscribe a high-level architectural summary into the blueprint's header."
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
no_ai: bool = Field(
|
|
713
|
+
default=False,
|
|
714
|
+
description="A sacred vow to forbid the Oracle from communing with the Neural Cortex for intent analysis."
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
# =============================================================================
|
|
718
|
+
# == V. THE ACTIVE WITNESS (EXECUTION & TRACING) ==
|
|
719
|
+
# =============================================================================
|
|
720
|
+
# These fields command the Oracle to become an Active Witness, executing a rite
|
|
721
|
+
# within the target reality to perceive its living, dynamic soul.
|
|
722
|
+
|
|
723
|
+
exec_command: Optional[str] = Field(
|
|
724
|
+
default=None, alias="exec",
|
|
725
|
+
description="A command to execute under the Sentry's gaze to capture execution state and context (e.g., 'pytest')."
|
|
726
|
+
)
|
|
727
|
+
|
|
728
|
+
exec_timeout: int = Field(
|
|
729
|
+
default=60,
|
|
730
|
+
description="The maximum time (seconds) the Active Witness will wait for the execution rite to conclude."
|
|
731
|
+
)
|
|
732
|
+
|
|
733
|
+
profile_perf: bool = Field(
|
|
734
|
+
default=False,
|
|
735
|
+
description="If True, summons the Wraith of Celerity to profile hotspots and weave a performance heatmap into the blueprint."
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
trace_command: Optional[str] = Field(
|
|
739
|
+
default=None, alias="trace",
|
|
740
|
+
description="Execute a command and summon the Runtime Wraith to inject the living state (variables) into the blueprint."
|
|
741
|
+
)
|
|
742
|
+
|
|
743
|
+
snapshot_path: Optional[str] = Field(
|
|
744
|
+
default=None, alias="snapshot",
|
|
745
|
+
description="Inject runtime values into the blueprint from a static JSON crash dump or state snapshot."
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
# =============================================================================
|
|
749
|
+
# == VI. THE OUTPUT SCRIBE (FINAL PROCLAMATION) ==
|
|
750
|
+
# =============================================================================
|
|
751
|
+
# These fields dictate the final form and destination of the distilled Gnosis.
|
|
752
|
+
|
|
753
|
+
output: Optional[str] = Field(
|
|
754
|
+
default=None,
|
|
755
|
+
description="The file path where the forged blueprint shall be inscribed."
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
clipboard: bool = Field(
|
|
759
|
+
default=False, alias="c",
|
|
760
|
+
description="If True, the distilled Gnosis is teleported directly to the system clipboard."
|
|
761
|
+
)
|
|
762
|
+
|
|
763
|
+
format: str = Field(
|
|
764
|
+
default="text",
|
|
765
|
+
description="The tongue of the proclamation: 'text' (default) or 'mermaid' for a visual dependency graph."
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
diff: bool = Field(
|
|
769
|
+
default=False,
|
|
770
|
+
description="If True, the Oracle will proclaim a diff against an existing output file before overwriting."
|
|
771
|
+
)
|
|
772
|
+
|
|
773
|
+
check: bool = Field(
|
|
774
|
+
default=False,
|
|
775
|
+
description="If True, the rite will conclude with a non-zero exit status if the distilled blueprint differs from an existing one on disk."
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
summarize: bool = Field(
|
|
779
|
+
default=False,
|
|
780
|
+
description="If True, the final blueprint is bestowed upon an AI Scribe to generate a README.md summary of the project's soul."
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
# =============================================================================
|
|
784
|
+
# == VII. THE SOCRATIC DIAL (INTERACTION & UI) ==
|
|
785
|
+
# =============================================================================
|
|
786
|
+
# These fields govern the interactive nature of the rite, allowing for communion
|
|
787
|
+
# between the Engine and the Architect.
|
|
788
|
+
|
|
789
|
+
interactive: bool = Field(
|
|
790
|
+
default=False,
|
|
791
|
+
description="If True, the Oracle may pause the rite to ask clarifying questions when its Gaze perceives ambiguity."
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
pad: bool = Field(
|
|
795
|
+
default=False,
|
|
796
|
+
description="If True, summons the interactive TUI (DistillPad) for a visual, real-time distillation experience."
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
lfg: bool = Field(
|
|
800
|
+
default=False,
|
|
801
|
+
description="The Rite of Gnostic Cartography. Injects a Logic Flow Graph of the source blueprint into the distilled output."
|
|
802
|
+
)
|
|
803
|
+
|
|
804
|
+
# =============================================================================
|
|
805
|
+
# == VIII. THE RITES OF ROBUST VALIDATION (THE UNBREAKABLE WARD) ==
|
|
806
|
+
# =============================================================================
|
|
807
|
+
|
|
808
|
+
@field_validator('focus', 'ignore', 'include', 'stub_deps', mode='before')
|
|
809
|
+
@classmethod
|
|
810
|
+
def ensure_list_type(cls, v: Any) -> List[str]:
|
|
811
|
+
"""
|
|
812
|
+
=============================================================================
|
|
813
|
+
== THE GNOSTIC TRANSMUTATOR (VAL-Ω-ROBUST) ==
|
|
814
|
+
=============================================================================
|
|
815
|
+
Annihilates the Schism between CLI Strings and Model Lists. It perceives Gnosis
|
|
816
|
+
in any form—a single string, a comma-separated scripture, or a pure list—and
|
|
817
|
+
transmutes it into the one true form: a `List[str]`.
|
|
818
|
+
"""
|
|
819
|
+
if v is None:
|
|
820
|
+
return []
|
|
821
|
+
|
|
822
|
+
if isinstance(v, str):
|
|
823
|
+
# Handle "Keyword1, Keyword2" -> ["Keyword1", "Keyword2"]
|
|
824
|
+
return [s.strip() for s in v.split(',') if s.strip()]
|
|
825
|
+
|
|
826
|
+
if isinstance(v, list):
|
|
827
|
+
# Ensure every soul in the list is a clean string
|
|
828
|
+
result = []
|
|
829
|
+
for item in v:
|
|
830
|
+
if isinstance(item, str):
|
|
831
|
+
# Handle cases where a list item might contain a comma
|
|
832
|
+
result.extend([s.strip() for s in item.split(',') if s.strip()])
|
|
833
|
+
else:
|
|
834
|
+
result.append(str(item).strip())
|
|
835
|
+
return result
|
|
836
|
+
|
|
837
|
+
return [str(v)]
|
|
838
|
+
|
|
839
|
+
@field_validator('token_budget', mode='before')
|
|
840
|
+
@classmethod
|
|
841
|
+
def parse_budget_shorthand(cls, v: Any) -> int:
|
|
842
|
+
"""
|
|
843
|
+
=============================================================================
|
|
844
|
+
== THE ALCHEMIST OF NUMBERS ==
|
|
845
|
+
=============================================================================
|
|
846
|
+
A divine scribe that transmutes human-readable budget shorthands (e.g.,
|
|
847
|
+
'800k', '1.5m') into their pure, integer soul (800000, 1500000).
|
|
848
|
+
"""
|
|
849
|
+
if isinstance(v, int):
|
|
850
|
+
return v
|
|
851
|
+
if isinstance(v, str):
|
|
852
|
+
clean_v = v.lower().strip().replace(',', '')
|
|
853
|
+
try:
|
|
854
|
+
if clean_v.endswith('k'):
|
|
855
|
+
return int(float(clean_v[:-1]) * 1000)
|
|
856
|
+
if clean_v.endswith('m'):
|
|
857
|
+
return int(float(clean_v[:-1]) * 1000000)
|
|
858
|
+
return int(clean_v)
|
|
859
|
+
except (ValueError, TypeError):
|
|
860
|
+
# If the Gnosis is profane, we fall back to the sacred default.
|
|
861
|
+
return 100000
|
|
862
|
+
# If not a string or int, return the sacred default.
|
|
863
|
+
return 100000
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
# =============================================================================
|
|
867
|
+
# == 7. INIT RITE (scaffold init) ==
|
|
868
|
+
# =============================================================================
|
|
869
|
+
|
|
870
|
+
class InitRequest(BaseRequest):
|
|
871
|
+
"""
|
|
872
|
+
Plea to initialize a new project (The Rite of Inception).
|
|
873
|
+
"""
|
|
874
|
+
launch_pad_with_path: Optional[str] = Field(
|
|
875
|
+
default=None,
|
|
876
|
+
description="Launch the Genesis Pad TUI. Optional starting path."
|
|
877
|
+
)
|
|
878
|
+
quick: bool = Field(
|
|
879
|
+
default=False,
|
|
880
|
+
description="Skip prompts, use intelligent defaults."
|
|
881
|
+
)
|
|
882
|
+
profile: Optional[str] = Field(
|
|
883
|
+
default=None,
|
|
884
|
+
description="Use a specific Genesis Profile (e.g., 'python-universal')."
|
|
885
|
+
)
|
|
886
|
+
type: Optional[str] = Field(
|
|
887
|
+
default=None,
|
|
888
|
+
description="Quick init by type alias (e.g., 'node', 'python')."
|
|
889
|
+
)
|
|
890
|
+
from_remote: Optional[str] = Field(
|
|
891
|
+
default=None,
|
|
892
|
+
description="Initialize from a remote URL/Gist."
|
|
893
|
+
)
|
|
894
|
+
manual: bool = Field(
|
|
895
|
+
default=False,
|
|
896
|
+
description="Manually forge a blank scripture."
|
|
897
|
+
)
|
|
898
|
+
distill: bool = Field(
|
|
899
|
+
default=False,
|
|
900
|
+
description="Initialize by distilling the current directory."
|
|
901
|
+
)
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
# =============================================================================
|
|
905
|
+
# == 8. TEMPLATE RITE (scaffold templates) ==
|
|
906
|
+
# =============================================================================
|
|
907
|
+
|
|
908
|
+
class TemplateRequest(BaseRequest):
|
|
909
|
+
"""
|
|
910
|
+
Plea to manage the Template Forge.
|
|
911
|
+
"""
|
|
912
|
+
template_command: Literal['list', 'edit', 'add', 'rename', 'search', 'pull', 'docs']
|
|
913
|
+
|
|
914
|
+
# Command-Specific Parameters
|
|
915
|
+
extension: Optional[str] = None
|
|
916
|
+
source_file: Optional[str] = None
|
|
917
|
+
old_extension: Optional[str] = None
|
|
918
|
+
new_extension: Optional[str] = None
|
|
919
|
+
keyword: Optional[str] = None
|
|
920
|
+
source: Optional[str] = None # URL/Gist for pull
|
|
921
|
+
name: str = 'remote_kit' # Local name for pull
|
|
922
|
+
|
|
923
|
+
# Future: Force refresh of remote caches
|
|
924
|
+
force_refresh: bool = Field(default=False, description="Bypass cache for 'pull'.")
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
# =============================================================================
|
|
928
|
+
# == 9. TRANSFIGURE RITE (scaffold transfigure) ==
|
|
929
|
+
# =============================================================================
|
|
930
|
+
|
|
931
|
+
class TransfigureRequest(BaseRequest):
|
|
932
|
+
"""
|
|
933
|
+
Plea to modify the soul (content) of a file.
|
|
934
|
+
"""
|
|
935
|
+
path_to_scripture: str = Field(..., description="Target file.")
|
|
936
|
+
|
|
937
|
+
# Content Sources (Mutually Exclusive logic handled by Artisan)
|
|
938
|
+
content: Optional[str] = None
|
|
939
|
+
from_source: Optional[str] = None # Path to source file
|
|
940
|
+
from_stdin: bool = False
|
|
941
|
+
from_template: bool = False
|
|
942
|
+
interactive: bool = False
|
|
943
|
+
|
|
944
|
+
# Modification Mode
|
|
945
|
+
append: bool = False
|
|
946
|
+
prepend: bool = False
|
|
947
|
+
create_if_void: bool = False
|
|
948
|
+
|
|
949
|
+
# Safeguards
|
|
950
|
+
guardian: bool = Field(default=False, description="Require Git tracking.")
|
|
951
|
+
backup: bool = Field(default=False, description="Create .bak before modifying.")
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
# =============================================================================
|
|
955
|
+
# == 10. TRANSLOCATE RITE (scaffold translocate) ==
|
|
956
|
+
# =============================================================================
|
|
957
|
+
|
|
958
|
+
class TranslocateRequest(BaseRequest):
|
|
959
|
+
"""
|
|
960
|
+
Plea to move files intelligently (Refactoring).
|
|
961
|
+
NOW ASCENDED with the Vow of the Living Blueprint.
|
|
962
|
+
"""
|
|
963
|
+
paths: List[str] = Field(default_factory=list, description="[src, dest] or [src... dest_dir]")
|
|
964
|
+
|
|
965
|
+
script: Optional[str] = Field(None, description="Path to a batch migration script (`old -> new`).")
|
|
966
|
+
backup_to: Optional[str] = Field(None, description="Directory for a Gnostic Snapshot of the 'Before' state.")
|
|
967
|
+
|
|
968
|
+
# --- THE DIVINE HEALING ---
|
|
969
|
+
# The profane `const` is annihilated. The vessel's soul is now pure.
|
|
970
|
+
# It simply awaits a string, or a void (None).
|
|
971
|
+
update_blueprint: Optional[str] = Field(
|
|
972
|
+
default=None,
|
|
973
|
+
description="The Vow of Synchronicity. Path to the blueprint to update with the new reality."
|
|
974
|
+
)
|
|
975
|
+
# --- THE APOTHEOSIS IS COMPLETE ---
|
|
976
|
+
|
|
977
|
+
# Conform Logic
|
|
978
|
+
to_blueprint: Optional[str] = None
|
|
979
|
+
conform_from: str = "."
|
|
980
|
+
|
|
981
|
+
# Future: Git Move vs OS Move
|
|
982
|
+
use_git_mv: bool = Field(default=True, description="Use 'git mv' if available.")
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
# =============================================================================
|
|
986
|
+
# == 11. CONFORM RITE (scaffold conform) ==
|
|
987
|
+
# =============================================================================
|
|
988
|
+
|
|
989
|
+
class ConformRequest(BaseRequest):
|
|
990
|
+
"""
|
|
991
|
+
Plea to align directory structure with a blueprint.
|
|
992
|
+
"""
|
|
993
|
+
blueprint_path: str
|
|
994
|
+
conform_from: str = "."
|
|
995
|
+
backup_to: Optional[str] = None
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
# =============================================================================
|
|
1002
|
+
# == 13. BEAUTIFY RITE (scaffold beautify) ==
|
|
1003
|
+
# =============================================================================
|
|
1004
|
+
|
|
1005
|
+
class BeautifyRequest(BaseRequest):
|
|
1006
|
+
"""
|
|
1007
|
+
Plea to format a blueprint file.
|
|
1008
|
+
"""
|
|
1009
|
+
blueprint_path: Optional[str] = None
|
|
1010
|
+
pad: bool = False
|
|
1011
|
+
check: bool = False
|
|
1012
|
+
ignore: List[str] = Field(default_factory=list)
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
# =============================================================================
|
|
1016
|
+
# == 14. PAD RITE (scaffold pad) ==
|
|
1017
|
+
# =============================================================================
|
|
1018
|
+
|
|
1019
|
+
class PadRequest(BaseRequest):
|
|
1020
|
+
"""
|
|
1021
|
+
Plea to launch a specific TUI Pad (Mini-App).
|
|
1022
|
+
"""
|
|
1023
|
+
pad_name: str = "help"
|
|
1024
|
+
initial_path: Optional[str] = None
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
# =============================================================================
|
|
1028
|
+
# == 15. STUDIO RITE (scaffold studio) ==
|
|
1029
|
+
# =============================================================================
|
|
1030
|
+
|
|
1031
|
+
class StudioRequest(BaseRequest):
|
|
1032
|
+
"""
|
|
1033
|
+
Plea to launch the full Design Studio TUI.
|
|
1034
|
+
"""
|
|
1035
|
+
path: Optional[str] = None
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
# =============================================================================
|
|
1039
|
+
# == 16. COMPOSE RITE (scaffold compose) ==
|
|
1040
|
+
# =============================================================================
|
|
1041
|
+
|
|
1042
|
+
class ComposeRequest(BaseRequest):
|
|
1043
|
+
"""
|
|
1044
|
+
Plea to combine architectures via a manifest.
|
|
1045
|
+
"""
|
|
1046
|
+
manifest_path: str
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
# =============================================================================
|
|
1050
|
+
# == 17. ARCH RITE (scaffold arch) ==
|
|
1051
|
+
# =============================================================================
|
|
1052
|
+
|
|
1053
|
+
class ArchRequest(BaseRequest):
|
|
1054
|
+
"""
|
|
1055
|
+
Plea to run a unified .arch file (Form + Will).
|
|
1056
|
+
Now capable of the Rite of Review.
|
|
1057
|
+
"""
|
|
1058
|
+
arch_path: str = Field(
|
|
1059
|
+
...,
|
|
1060
|
+
description="Path to the .arch scripture."
|
|
1061
|
+
)
|
|
1062
|
+
log: Optional[str] = Field(
|
|
1063
|
+
default=None,
|
|
1064
|
+
description="Enable structured logging to a specific file."
|
|
1065
|
+
)
|
|
1066
|
+
|
|
1067
|
+
# [THE ASCENSION] The Rite of Review
|
|
1068
|
+
interactive: bool = Field(
|
|
1069
|
+
default=False,
|
|
1070
|
+
description="If True, summons the Gnostic Studio to review the plan before execution."
|
|
1071
|
+
)
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
# =============================================================================
|
|
1075
|
+
# == 18. SETTINGS RITE (scaffold settings) ==
|
|
1076
|
+
# =============================================================================
|
|
1077
|
+
|
|
1078
|
+
class SettingsRequest(BaseRequest):
|
|
1079
|
+
"""
|
|
1080
|
+
Plea to open the Settings TUI.
|
|
1081
|
+
"""
|
|
1082
|
+
scope: Literal['global', 'project'] = 'global'
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
# =============================================================================
|
|
1086
|
+
# == 19. DAEMON RITE (scaffold daemon) ==
|
|
1087
|
+
# =============================================================================
|
|
1088
|
+
|
|
1089
|
+
class DaemonRequest(BaseRequest):
|
|
1090
|
+
"""
|
|
1091
|
+
=================================================================================
|
|
1092
|
+
== THE SACRED PLEA TO THE GNOSTIC COSMOS (V-Ω-ETERNAL-APOTHEOSIS-ULTIMA) ==
|
|
1093
|
+
=================================================================================
|
|
1094
|
+
LIF: INFINITY (THE SUPREME GOVERNOR)
|
|
1095
|
+
AUTH_CODE: #)(@!#@()!!
|
|
1096
|
+
|
|
1097
|
+
This is the divine, immutable, and ultra-definitive vessel for all pleas directed
|
|
1098
|
+
at the Scaffold daemon cosmos. It defines the parameters for the Nexus's birth,
|
|
1099
|
+
life, and ascension. It is the bridge between the Architect's intent and the
|
|
1100
|
+
persistent background mind of the God-Engine.
|
|
1101
|
+
"""
|
|
1102
|
+
model_config = ConfigDict(
|
|
1103
|
+
arbitrary_types_allowed=True,
|
|
1104
|
+
extra='ignore',
|
|
1105
|
+
populate_by_name=True,
|
|
1106
|
+
validate_assignment=True
|
|
1107
|
+
)
|
|
1108
|
+
|
|
1109
|
+
# [FACULTY 1] The Gnostic Triage of Will
|
|
1110
|
+
command: Literal['start', 'stop', 'status', 'vigil', 'reload', 'rotate_keys', 'logs'] = Field(
|
|
1111
|
+
default='start',
|
|
1112
|
+
description="The specific daemon rite to conduct."
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
# --- Network & Projection Gnosis ---
|
|
1116
|
+
port: int = Field(
|
|
1117
|
+
default=5555,
|
|
1118
|
+
ge=1024,
|
|
1119
|
+
le=65535,
|
|
1120
|
+
description="The primary celestial port. Restricted to non-privileged range."
|
|
1121
|
+
)
|
|
1122
|
+
host: str = Field(
|
|
1123
|
+
default="127.0.0.1",
|
|
1124
|
+
description="The interface to bind. Use '0.0.0.0' for Celestial Projection."
|
|
1125
|
+
)
|
|
1126
|
+
|
|
1127
|
+
allow_remote: bool = Field(
|
|
1128
|
+
default=False,
|
|
1129
|
+
description="[SAFETY OVERRIDE] Explicitly allow binding to external interfaces."
|
|
1130
|
+
)
|
|
1131
|
+
|
|
1132
|
+
# --- Security & Encryption ---
|
|
1133
|
+
ssl_cert: Optional[str] = Field(
|
|
1134
|
+
default=None,
|
|
1135
|
+
description="Path to SSL Certificate for encrypted communion (WSS/HTTPS)."
|
|
1136
|
+
)
|
|
1137
|
+
ssl_key: Optional[str] = Field(
|
|
1138
|
+
default=None,
|
|
1139
|
+
description="Path to SSL Private Key."
|
|
1140
|
+
)
|
|
1141
|
+
allowed_origins: List[str] = Field(
|
|
1142
|
+
default_factory=lambda: ["*"],
|
|
1143
|
+
description="CORS policy for web-based dashboards."
|
|
1144
|
+
)
|
|
1145
|
+
|
|
1146
|
+
# --- Performance & Scaling ---
|
|
1147
|
+
max_workers: Optional[int] = Field(
|
|
1148
|
+
default=None,
|
|
1149
|
+
description="Thread pool size. Auto-scales to CPU count * 5 if None."
|
|
1150
|
+
)
|
|
1151
|
+
|
|
1152
|
+
# --- Behavior & Telemetry ---
|
|
1153
|
+
parent_pid: Optional[int] = Field(
|
|
1154
|
+
default=None,
|
|
1155
|
+
description="The PID of the creator. Triggers Seppuku if the parent vanishes."
|
|
1156
|
+
)
|
|
1157
|
+
telemetry_sink: Optional[str] = Field(
|
|
1158
|
+
default=None,
|
|
1159
|
+
description="Path or URI to mirror traffic logs for forensic analysis."
|
|
1160
|
+
)
|
|
1161
|
+
|
|
1162
|
+
# --- Extensibility ---
|
|
1163
|
+
load_plugins: bool = Field(
|
|
1164
|
+
default=True,
|
|
1165
|
+
description="Command the Nexus to scan and load the Living Grimoire on startup."
|
|
1166
|
+
)
|
|
1167
|
+
|
|
1168
|
+
# --- [HOT-SWAP & ROTATION] ---
|
|
1169
|
+
reload_scope: Literal['all', 'config', 'plugins'] = Field(
|
|
1170
|
+
default='all',
|
|
1171
|
+
description="The depth of the Hot-Swap rite."
|
|
1172
|
+
)
|
|
1173
|
+
new_token: Optional[str] = Field(
|
|
1174
|
+
default=None,
|
|
1175
|
+
description="A specific new token for rotation. Forges a random one if None."
|
|
1176
|
+
)
|
|
1177
|
+
|
|
1178
|
+
# --- [LOG STREAMING] ---
|
|
1179
|
+
follow: bool = Field(
|
|
1180
|
+
default=False,
|
|
1181
|
+
description="If True, the connection remains open, streaming logs eternally."
|
|
1182
|
+
)
|
|
1183
|
+
tail_lines: int = Field(
|
|
1184
|
+
default=100,
|
|
1185
|
+
ge=0,
|
|
1186
|
+
description="Number of past log lines to resurrect from the chronicle."
|
|
1187
|
+
)
|
|
1188
|
+
pulse_file: Optional[str] = None # <--- ADD THIS
|
|
1189
|
+
# =============================================================================
|
|
1190
|
+
# == THE RITES OF VALIDATION (JURISPRUDENCE) ==
|
|
1191
|
+
# =============================================================================
|
|
1192
|
+
|
|
1193
|
+
@field_validator('host')
|
|
1194
|
+
@classmethod
|
|
1195
|
+
def _validate_host_safety(cls, v: str, info) -> str:
|
|
1196
|
+
"""[THE ETHERIC WARD] Ensures remote binding requires explicit consent."""
|
|
1197
|
+
if v == "0.0.0.0" and not info.data.get('allow_remote', False):
|
|
1198
|
+
raise ValueError(
|
|
1199
|
+
"Heresy of Exposure: Binding to 0.0.0.0 requires the 'allow_remote' vow."
|
|
1200
|
+
)
|
|
1201
|
+
return v
|
|
1202
|
+
|
|
1203
|
+
@model_validator(mode='after')
|
|
1204
|
+
def _validate_ssl_trinity(self) -> 'DaemonRequest':
|
|
1205
|
+
"""[THE CRYPTOGRAPHIC SEAL] Validates that encryption is whole or absent."""
|
|
1206
|
+
if (self.ssl_cert and not self.ssl_key) or (self.ssl_key and not self.ssl_cert):
|
|
1207
|
+
raise ValueError(
|
|
1208
|
+
"Paradox of Encryption: Both Certificate and Key must be provided for SSL."
|
|
1209
|
+
)
|
|
1210
|
+
return self
|
|
1211
|
+
|
|
1212
|
+
@model_validator(mode='after')
|
|
1213
|
+
def _recalibrate_workers(self) -> 'DaemonRequest':
|
|
1214
|
+
"""[THE VITALITY OPTIMIZER] Sets default workers based on hardware soul."""
|
|
1215
|
+
if self.max_workers is None:
|
|
1216
|
+
import os
|
|
1217
|
+
# We use a conservative multiplier to respect the host's focus
|
|
1218
|
+
object.__setattr__(self, 'max_workers', (os.cpu_count() or 1) * 5)
|
|
1219
|
+
return self
|
|
1220
|
+
|
|
1221
|
+
@model_validator(mode='before')
|
|
1222
|
+
@classmethod
|
|
1223
|
+
def _harmonize_command_input(cls, data: Any) -> Any:
|
|
1224
|
+
"""
|
|
1225
|
+
[FACULTY: THE GNOSTIC HARMONIZER]
|
|
1226
|
+
Surgically resolves the conflict between 'command' and 'daemon_command'.
|
|
1227
|
+
Annihilates the string 'daemon' if it leaks in from the top-level CLI.
|
|
1228
|
+
"""
|
|
1229
|
+
if not isinstance(data, dict):
|
|
1230
|
+
return data
|
|
1231
|
+
|
|
1232
|
+
# 1. Extract potential values
|
|
1233
|
+
top_level = data.get('command')
|
|
1234
|
+
sub_level = data.get('daemon_command')
|
|
1235
|
+
|
|
1236
|
+
# 2. The Triage
|
|
1237
|
+
# Valid rites for the Literal
|
|
1238
|
+
valid_rites = {'start', 'stop', 'status', 'vigil', 'reload', 'rotate_keys', 'logs'}
|
|
1239
|
+
|
|
1240
|
+
# If 'command' is "daemon", it's a CLI leak. Purge it.
|
|
1241
|
+
if top_level == "daemon":
|
|
1242
|
+
data['command'] = sub_level if sub_level in valid_rites else 'start'
|
|
1243
|
+
|
|
1244
|
+
# If 'command' is missing but 'daemon_command' is there, promote it
|
|
1245
|
+
elif not top_level and sub_level:
|
|
1246
|
+
data['command'] = sub_level
|
|
1247
|
+
|
|
1248
|
+
return data
|
|
1249
|
+
# =============================================================================
|
|
1250
|
+
# == 20. HELP RITE (scaffold help) ==
|
|
1251
|
+
# =============================================================================
|
|
1252
|
+
|
|
1253
|
+
class HelpRequest(BaseRequest):
|
|
1254
|
+
"""Plea for Gnostic Guidance."""
|
|
1255
|
+
topic: Optional[str] = None
|
|
1256
|
+
render_format: Literal['text', 'markdown', 'json'] = 'text'
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
# =============================================================================
|
|
1260
|
+
# == 21. REPLAY RITE (scaffold replay) ==
|
|
1261
|
+
# =============================================================================
|
|
1262
|
+
|
|
1263
|
+
class ReplayRequest(BaseRequest):
|
|
1264
|
+
"""
|
|
1265
|
+
Plea to step through the river of time (Traffic Logs).
|
|
1266
|
+
"""
|
|
1267
|
+
log_path: str = Field(default=".scaffold/daemon_traffic.jsonl", description="Path to the traffic log.")
|
|
1268
|
+
interactive: bool = Field(default=True, description="Step-by-step execution mode.")
|
|
1269
|
+
speed: float = Field(default=1.0, description="Replay speed multiplier (if non-interactive).")
|
|
1270
|
+
filter_command: Optional[str] = Field(default=None, description="Only replay specific commands (e.g., 'weave').")
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
class AnalyzeRequest(BaseRequest):
|
|
1274
|
+
"""
|
|
1275
|
+
=============================================================================
|
|
1276
|
+
== THE GNOSTIC INQUEST VESSEL (V-Ω-TOTALITY-SCHEMA) ==
|
|
1277
|
+
=============================================================================
|
|
1278
|
+
LIF: 10,000,000,000 | ROLE: PERCEPTION_PAYLOAD
|
|
1279
|
+
|
|
1280
|
+
The sacred vessel for the `analyze` rite. It carries the Architect's plea
|
|
1281
|
+
for deep forensic understanding of a scripture or sanctum.
|
|
1282
|
+
|
|
1283
|
+
### THE PANTHEON OF 7 FACULTIES:
|
|
1284
|
+
1. **The Locus (`file_path`):** The absolute coordinate of the target.
|
|
1285
|
+
2. **The Soul (`content`):** Optional raw content. If provided, the Engine
|
|
1286
|
+
analyzes this *ephemeral matter* instead of the physical disk (Shadow Mode).
|
|
1287
|
+
3. **The Focus (`cursor_offset`):** High-precision integer offset for LSP
|
|
1288
|
+
operations (Hover, Completion).
|
|
1289
|
+
4. **The Lens (`semantic_depth`):** Controls the intensity of the Gaze.
|
|
1290
|
+
5. **The Tongue (`grammar`):** Forces a specific parser (e.g. 'python')
|
|
1291
|
+
overriding auto-detection.
|
|
1292
|
+
6. **The Reflex (`auto_redeem`):** Automatically heals simple heresies.
|
|
1293
|
+
7. **The Format (`json_mode`):** Forces machine-readable prophecy.
|
|
1294
|
+
"""
|
|
1295
|
+
|
|
1296
|
+
# --- 1. THE LOCUS (TARGET) ---
|
|
1297
|
+
file_path: Optional[str] = Field(
|
|
1298
|
+
default=None,
|
|
1299
|
+
description="The primary target file or directory for analysis.",
|
|
1300
|
+
alias="path_to_scripture" # [ASCENSION]: Legacy binding
|
|
1301
|
+
)
|
|
1302
|
+
|
|
1303
|
+
# --- 2. THE SOUL (CONTENT) ---
|
|
1304
|
+
content: Optional[str] = Field(
|
|
1305
|
+
default=None,
|
|
1306
|
+
description="The raw content of the file. If provided, overrides disk content (Shadow Mode)."
|
|
1307
|
+
)
|
|
1308
|
+
|
|
1309
|
+
# --- 3. THE FOCUS (CURSOR) ---
|
|
1310
|
+
cursor_offset: int = Field(
|
|
1311
|
+
default=-1,
|
|
1312
|
+
description="The byte offset of the cursor. -1 implies no specific focus."
|
|
1313
|
+
)
|
|
1314
|
+
|
|
1315
|
+
position: Optional[Dict[str, int]] = Field(
|
|
1316
|
+
default=None,
|
|
1317
|
+
description="LSP Position object {line: int, character: int} for legacy adapters."
|
|
1318
|
+
)
|
|
1319
|
+
|
|
1320
|
+
# --- 4. THE GAZE (CONFIGURATION) ---
|
|
1321
|
+
semantic_depth: str = Field(
|
|
1322
|
+
default="structure",
|
|
1323
|
+
pattern=r"^(structure|full|dependencies|minimal)$",
|
|
1324
|
+
description="The intensity of the Gaze. 'structure' (fast), 'full' (linting), 'dependencies' (supply chain)."
|
|
1325
|
+
)
|
|
1326
|
+
|
|
1327
|
+
grammar: Optional[str] = Field(
|
|
1328
|
+
default=None,
|
|
1329
|
+
description="Force a specific language parser (e.g., 'python', 'scaffold', 'rust')."
|
|
1330
|
+
)
|
|
1331
|
+
|
|
1332
|
+
batch: bool = Field(
|
|
1333
|
+
default=False,
|
|
1334
|
+
description="If true, performs a panoptic scan of the entire directory."
|
|
1335
|
+
)
|
|
1336
|
+
|
|
1337
|
+
# --- 5. THE VOWS (FLAGS) ---
|
|
1338
|
+
json_mode: bool = Field(
|
|
1339
|
+
default=False,
|
|
1340
|
+
alias="json",
|
|
1341
|
+
description="If true, output is raw JSON for machine consumption."
|
|
1342
|
+
)
|
|
1343
|
+
|
|
1344
|
+
auto_redeem: bool = Field(
|
|
1345
|
+
default=False,
|
|
1346
|
+
description="If true, automatically attempts to fix simple heresies (imports, formatting)."
|
|
1347
|
+
)
|
|
1348
|
+
|
|
1349
|
+
# --- 6. THE META-CONTEXT ---
|
|
1350
|
+
# Specific metadata for the Analysis Artisan (distinct from system 'context')
|
|
1351
|
+
metadata: Dict[str, Any] = Field(
|
|
1352
|
+
default_factory=dict,
|
|
1353
|
+
description="Arbitrary contextual tags (e.g., client_version, editor_theme)."
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
# =========================================================================
|
|
1357
|
+
# == THE RITES OF HARMONIZATION (VALIDATORS) ==
|
|
1358
|
+
# =========================================================================
|
|
1359
|
+
|
|
1360
|
+
@model_validator(mode='before')
|
|
1361
|
+
@classmethod
|
|
1362
|
+
def _heal_legacy_inputs(cls, data: Any) -> Any:
|
|
1363
|
+
"""
|
|
1364
|
+
[ASCENSION 1]: INPUT TRANSMUTATION
|
|
1365
|
+
Intercepts raw dictionary input before validation to heal legacy aliases.
|
|
1366
|
+
"""
|
|
1367
|
+
if isinstance(data, dict):
|
|
1368
|
+
# 1. Heal path_to_scripture -> file_path
|
|
1369
|
+
if 'path_to_scripture' in data and not data.get('file_path'):
|
|
1370
|
+
data['file_path'] = data['path_to_scripture']
|
|
1371
|
+
|
|
1372
|
+
# 2. Heal target -> file_path (CLI alias)
|
|
1373
|
+
if 'target' in data and not data.get('file_path'):
|
|
1374
|
+
data['file_path'] = data['target']
|
|
1375
|
+
|
|
1376
|
+
# 3. Heal --json flag
|
|
1377
|
+
if 'json' in data:
|
|
1378
|
+
data['json_mode'] = data['json']
|
|
1379
|
+
|
|
1380
|
+
return data
|
|
1381
|
+
|
|
1382
|
+
@model_validator(mode='after')
|
|
1383
|
+
def _unify_paths(self) -> 'AnalyzeRequest':
|
|
1384
|
+
"""
|
|
1385
|
+
[ASCENSION 2]: PATH NORMALIZATION
|
|
1386
|
+
Ensures the file_path is POSIX-compliant before the Artisan sees it.
|
|
1387
|
+
"""
|
|
1388
|
+
if self.file_path:
|
|
1389
|
+
# Annihilate Windows Backslashes
|
|
1390
|
+
self.file_path = self.file_path.replace('\\', '/')
|
|
1391
|
+
|
|
1392
|
+
# Auto-detect batch mode
|
|
1393
|
+
if self.file_path.endswith('/') or (not '.' in self.file_path.split('/')[-1]):
|
|
1394
|
+
# Heuristic: If it looks like a directory, assume batch?
|
|
1395
|
+
# (Actual check happens in Artisan via is_dir(), but we prep the flag)
|
|
1396
|
+
pass
|
|
1397
|
+
|
|
1398
|
+
return self
|
|
1399
|
+
|
|
1400
|
+
@property
|
|
1401
|
+
def is_shadow(self) -> bool:
|
|
1402
|
+
"""
|
|
1403
|
+
[ASCENSION 3]: SHADOW DIVINATION
|
|
1404
|
+
Returns True if we are analyzing ephemeral content (unsaved buffer),
|
|
1405
|
+
False if analyzing physical disk matter.
|
|
1406
|
+
"""
|
|
1407
|
+
return self.content is not None
|
|
1408
|
+
|
|
1409
|
+
class RepairRequest(BaseRequest):
|
|
1410
|
+
"""
|
|
1411
|
+
=================================================================================
|
|
1412
|
+
== THE SACRED PLEA OF RESTORATION (V-Ω-SURGICAL-ULTIMA++) ==
|
|
1413
|
+
=================================================================================
|
|
1414
|
+
LIF: 100x (SYSTEMIC AUTO-HEALING)
|
|
1415
|
+
|
|
1416
|
+
The definitive contract for the 'repair' rite. It has been ascended to support
|
|
1417
|
+
both IDE-driven (LSP) and Cockpit-driven (Background Sentinel) workflows.
|
|
1418
|
+
=================================================================================
|
|
1419
|
+
"""
|
|
1420
|
+
model_config = ConfigDict(extra='allow')
|
|
1421
|
+
|
|
1422
|
+
# --- I. THE LOCUS OF THE WOUND ---
|
|
1423
|
+
file_path: str = Field(
|
|
1424
|
+
...,
|
|
1425
|
+
description="The relative path to the scripture requiring restoration."
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1428
|
+
content: Optional[str] = Field(
|
|
1429
|
+
default=None,
|
|
1430
|
+
description="The active text buffer. If void, the Surgeon gazes directly at the physical disk."
|
|
1431
|
+
)
|
|
1432
|
+
|
|
1433
|
+
# --- II. THE NATURE OF THE SIN ---
|
|
1434
|
+
heresy_key: str = Field(
|
|
1435
|
+
...,
|
|
1436
|
+
description="The unique machine-readable identifier of the paradox (e.g., 'UNDEFINED_VARIABLE')."
|
|
1437
|
+
)
|
|
1438
|
+
|
|
1439
|
+
# --- III. SPATIO-TEMPORAL COORDINATES ---
|
|
1440
|
+
line_num: int = Field(
|
|
1441
|
+
default=1,
|
|
1442
|
+
description="The 1-indexed human line number where the heresy was perceived."
|
|
1443
|
+
)
|
|
1444
|
+
|
|
1445
|
+
internal_line: int = Field(
|
|
1446
|
+
default=0,
|
|
1447
|
+
description="The 0-indexed machine line number for direct alignment with the Monaco Matrix."
|
|
1448
|
+
)
|
|
1449
|
+
|
|
1450
|
+
# --- IV. THE SURGICAL STRATEGY ---
|
|
1451
|
+
strategy: Literal['surgical', 'textual', 'ai', 'template'] = Field(
|
|
1452
|
+
default='surgical',
|
|
1453
|
+
description="The method of mending: 'surgical' (AST), 'textual' (Regex), 'ai' (Neural), or 'template' (Boilerplate)."
|
|
1454
|
+
)
|
|
1455
|
+
|
|
1456
|
+
mutation_mode: Literal['apply', 'preview'] = Field(
|
|
1457
|
+
default='apply',
|
|
1458
|
+
description="If 'preview', the engine returns a unified diff without altering the mortal realm."
|
|
1459
|
+
)
|
|
1460
|
+
|
|
1461
|
+
# --- V. THE GNOSTIC CONTEXT (FORENSIC PAYLOAD) ---
|
|
1462
|
+
# This dictionary carries the specific 'DNA' of the error.
|
|
1463
|
+
# Expected keys for specific heresies:
|
|
1464
|
+
# - UNDEFINED_VARIABLE: {'symbol': 'my_var', 'alternatives': ['my_var_1', 'my_var_2']}
|
|
1465
|
+
# - PROFANE_NAMING: {'current': 'myVar', 'expected': 'my_var'}
|
|
1466
|
+
# - BROKEN_IMPORT: {'module': 'src.old', 'suggestion': 'src.new'}
|
|
1467
|
+
context: Dict[str, Any] = Field(
|
|
1468
|
+
default_factory=dict,
|
|
1469
|
+
description="The detailed forensic metadata required to calculate the cure."
|
|
1470
|
+
)
|
|
1471
|
+
|
|
1472
|
+
# --- VI. THE REQUISITE GNOSIS ---
|
|
1473
|
+
suggested_fix: Optional[str] = Field(
|
|
1474
|
+
default=None,
|
|
1475
|
+
description="An optional pre-calculated string to use as the cure, bypassing the Surgeon's deduction."
|
|
1476
|
+
)
|
|
1477
|
+
|
|
1478
|
+
@property
|
|
1479
|
+
def has_content_overlay(self) -> bool:
|
|
1480
|
+
"""Adjudicates if the plea carries its own reality or relies on the disk."""
|
|
1481
|
+
return self.content is not None and len(self.content.strip()) > 0
|
|
1482
|
+
|
|
1483
|
+
@property
|
|
1484
|
+
def target_symbol(self) -> Optional[str]:
|
|
1485
|
+
"""Surgically extracts the focus of the repair from the context."""
|
|
1486
|
+
return self.context.get('symbol') or self.context.get('current')
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
class IntrospectionRequest(BaseRequest):
|
|
1491
|
+
"""
|
|
1492
|
+
Plea to the Gnostic Oracle for self-awareness.
|
|
1493
|
+
Asks the engine to proclaim its own internal Gnosis.
|
|
1494
|
+
"""
|
|
1495
|
+
topic: str = Field(..., description="The category of Gnosis to inquire about (e.g., 'ui_components').")
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
class TextDocumentIdentifierModel(BaseModel):
|
|
1501
|
+
"""
|
|
1502
|
+
[THE IDENTITY ATOM]
|
|
1503
|
+
Uniquely identifies a scripture via URI.
|
|
1504
|
+
Used by the Interface Layer to validate LSP payloads.
|
|
1505
|
+
"""
|
|
1506
|
+
uri: str = Field(..., description="The Celestial URI of the document.")
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
class CursorPoint(BaseModel):
|
|
1510
|
+
"""
|
|
1511
|
+
=============================================================================
|
|
1512
|
+
== THE ASCENDED CURSOR POINT (V-Ω-SUBSCRIPTABLE-HYBRID) ==
|
|
1513
|
+
=============================================================================
|
|
1514
|
+
Precise 0-indexed coordinates within the scripture.
|
|
1515
|
+
Hardened to support both Dot-Notation and Dictionary-Subscript access.
|
|
1516
|
+
|
|
1517
|
+
### THE PANTHEON OF 12 LEGENDARY ASCENSIONS:
|
|
1518
|
+
1. **Dual-Access Inception (THE FIX):** Implements `__getitem__` to satisfy
|
|
1519
|
+
the 'not subscriptable' heresy, allowing `pos['line']` for legacy logic.
|
|
1520
|
+
2. **Strict Boundary Guard:** Enforces `ge=0` to ensure coordinates never
|
|
1521
|
+
enter the negative spatial void.
|
|
1522
|
+
3. **Holographic Spreading:** Implements `__iter__` and `keys()` to allow
|
|
1523
|
+
the model to be spread into dicts `{**pos}` or function arguments.
|
|
1524
|
+
4. **Frozen Integrity:** `frozen=True` ensures that once a coordinate
|
|
1525
|
+
is manifest, it cannot be profaned by accidental mutation.
|
|
1526
|
+
5. **Isomorphic Comparison:** Overrides `__lt__` and `__eq__` to enable
|
|
1527
|
+
spatial math (e.g., `if cursor < token_start`).
|
|
1528
|
+
6. **Reflexive Introspection:** Supports `values()` and `items()` to mimic
|
|
1529
|
+
the `dict` interface with 100% fidelity.
|
|
1530
|
+
7. **Nanosecond Scribing:** Uses `__slots__` logic (via frozen BaseModel)
|
|
1531
|
+
optimized for high-frequency keystroke events.
|
|
1532
|
+
8. **Type-Safe Coercion:** Validates and casts inputs to integers during
|
|
1533
|
+
the alchemical `model_validate` phase.
|
|
1534
|
+
9. **Alias Sovereignty:** Preserves the `camelCase` to `snake_case`
|
|
1535
|
+
mappings for cross-process synchronization.
|
|
1536
|
+
10. **Null-Key Resilience:** Gracefully handles missing keys in the
|
|
1537
|
+
subscriptor to prevent `KeyError` fractures.
|
|
1538
|
+
11. **Metadata Ingress:** Compatible with the `extra='allow'` directive
|
|
1539
|
+
to absorb future coordinate-level telemetry.
|
|
1540
|
+
12. **The Singularity Seal:** Finalized for direct injection into the
|
|
1541
|
+
Oracle's logic stream.
|
|
1542
|
+
=============================================================================
|
|
1543
|
+
"""
|
|
1544
|
+
model_config = ConfigDict(
|
|
1545
|
+
frozen=True,
|
|
1546
|
+
populate_by_name=True,
|
|
1547
|
+
extra='allow'
|
|
1548
|
+
)
|
|
1549
|
+
|
|
1550
|
+
line: int = Field(..., ge=0, description="0-indexed line number.")
|
|
1551
|
+
character: int = Field(..., ge=0, description="0-indexed character offset.")
|
|
1552
|
+
|
|
1553
|
+
# =========================================================================
|
|
1554
|
+
# == [THE CURE]: THE SUBSCRIPTABLE BRIDGE ==
|
|
1555
|
+
# =========================================================================
|
|
1556
|
+
|
|
1557
|
+
def __getitem__(self, key: str) -> Any:
|
|
1558
|
+
"""
|
|
1559
|
+
Allows the model to be accessed like a dictionary.
|
|
1560
|
+
Supports: pos['line'] and pos['character']
|
|
1561
|
+
"""
|
|
1562
|
+
try:
|
|
1563
|
+
return getattr(self, key)
|
|
1564
|
+
except AttributeError:
|
|
1565
|
+
raise KeyError(f"Geometry Error: '{key}' is not a valid coordinate component.")
|
|
1566
|
+
|
|
1567
|
+
def __iter__(self):
|
|
1568
|
+
"""Allows dictionary conversion via dict(cursor_point)."""
|
|
1569
|
+
yield 'line', self.line
|
|
1570
|
+
yield 'character', self.character
|
|
1571
|
+
|
|
1572
|
+
def keys(self):
|
|
1573
|
+
"""Mimics dict.keys() for compatibility."""
|
|
1574
|
+
return ['line', 'character']
|
|
1575
|
+
|
|
1576
|
+
def values(self):
|
|
1577
|
+
"""Mimics dict.values() for compatibility."""
|
|
1578
|
+
return [self.line, self.character]
|
|
1579
|
+
|
|
1580
|
+
def items(self):
|
|
1581
|
+
"""Mimics dict.items() for compatibility."""
|
|
1582
|
+
return [('line', self.line), ('character', self.character)]
|
|
1583
|
+
|
|
1584
|
+
# =========================================================================
|
|
1585
|
+
# == SPATIAL COMPARISON OPERATORS ==
|
|
1586
|
+
# =========================================================================
|
|
1587
|
+
|
|
1588
|
+
def __lt__(self, other: Union['CursorPoint', Dict]) -> bool:
|
|
1589
|
+
other_line = other['line'] if isinstance(other, dict) else other.line
|
|
1590
|
+
other_char = other['character'] if isinstance(other, dict) else other.character
|
|
1591
|
+
|
|
1592
|
+
if self.line < other_line: return True
|
|
1593
|
+
if self.line == other_line: return self.character < other_char
|
|
1594
|
+
return False
|
|
1595
|
+
|
|
1596
|
+
def __eq__(self, other: object) -> bool:
|
|
1597
|
+
if not isinstance(other, (CursorPoint, dict)): return False
|
|
1598
|
+
other_line = other['line'] if isinstance(other, dict) else other.line
|
|
1599
|
+
other_char = other['character'] if isinstance(other, dict) else other.character
|
|
1600
|
+
return self.line == other_line and self.character == other_char
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
# =================================================================================
|
|
1604
|
+
# == II. THE POLYMORPHIC HOVER REQUEST (THE CURE) ==
|
|
1605
|
+
# =================================================================================
|
|
1606
|
+
|
|
1607
|
+
class HoverRequest(BaseRequest):
|
|
1608
|
+
"""
|
|
1609
|
+
=============================================================================
|
|
1610
|
+
== THE HOVER PLEA (V-Ω-OMNISCIENT-PROBE-HYBRID) ==
|
|
1611
|
+
=============================================================================
|
|
1612
|
+
LIF: 100x | The Request for Enlightenment.
|
|
1613
|
+
|
|
1614
|
+
Sent by the LSP Server (or CLI) to the HoverArtisan.
|
|
1615
|
+
It acts as a **Polymorphic Vessel**, accepting both:
|
|
1616
|
+
1. LSP Standard: `{ textDocument: { uri }, position: { ... } }`
|
|
1617
|
+
2. Kinetic CLI: `{ file_path: "/abs/path", line_num: 10 }`
|
|
1618
|
+
|
|
1619
|
+
The `unify_identity` validator transmutes these inputs into a single,
|
|
1620
|
+
immutable Gnostic Truth before the artisan ever sees them.
|
|
1621
|
+
|
|
1622
|
+
### 12 LEGENDARY ASCENSIONS:
|
|
1623
|
+
1. **Polymorphic Ingestion:** Automatically detects LSP vs CLI shape.
|
|
1624
|
+
2. **Geometric Transmutation:** Converts 1-based CLI lines to 0-based LSP coords.
|
|
1625
|
+
3. **Path Canonization:** Resolves symlinks and normalizes slashes instantly.
|
|
1626
|
+
4. **Field Aliasing:** Maps `textDocument` to `text_document` transparently.
|
|
1627
|
+
5. **Strict Typing:** Enforces `CursorPoint` and `TextDocumentIdentifierModel`.
|
|
1628
|
+
6. **Context Injection:** Allows arbitrary metadata for trace propagation.
|
|
1629
|
+
7. **Language Divination:** Optional override for forced syntax contexts.
|
|
1630
|
+
8. **Dirty Buffer Support:** Accepts `content` payload for unsaved files.
|
|
1631
|
+
9. **Time Dilation:** Configurable `timeout` for heavy analysis.
|
|
1632
|
+
10. **Link Resolution:** Toggle for deep import tracing.
|
|
1633
|
+
11. **Format Negotiation:** Supports Markdown vs Plaintext output.
|
|
1634
|
+
12. **Immutable Config:** `frozen=True` ensures thread safety during dispatch.
|
|
1635
|
+
"""
|
|
1636
|
+
model_config = ConfigDict(
|
|
1637
|
+
frozen=True,
|
|
1638
|
+
populate_by_name=True,
|
|
1639
|
+
arbitrary_types_allowed=True,
|
|
1640
|
+
extra='allow',
|
|
1641
|
+
json_schema_extra={
|
|
1642
|
+
"example": {
|
|
1643
|
+
"file_path": "/abs/path/to/scripture.py",
|
|
1644
|
+
"position": {"line": 10, "character": 4},
|
|
1645
|
+
"content": "def main():\n pass",
|
|
1646
|
+
"metadata": {"trace_id": "tr-8f9a2b", "trigger": "mouse"}
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
)
|
|
1650
|
+
|
|
1651
|
+
# --- I. THE LOCUS (WHERE) ---
|
|
1652
|
+
file_path: str = Field(
|
|
1653
|
+
...,
|
|
1654
|
+
description="Absolute path to the scripture on the physical disk."
|
|
1655
|
+
)
|
|
1656
|
+
|
|
1657
|
+
position: CursorPoint = Field(
|
|
1658
|
+
...,
|
|
1659
|
+
description="The exact geometric point of the Architect's gaze."
|
|
1660
|
+
)
|
|
1661
|
+
|
|
1662
|
+
# [ASCENSION 1]: LSP COMPATIBILITY LAYER
|
|
1663
|
+
# These fields are used during ingestion but merged into file_path/position
|
|
1664
|
+
text_document: Optional[TextDocumentIdentifierModel] = Field(None, alias="textDocument")
|
|
1665
|
+
|
|
1666
|
+
offset: Optional[int] = Field(
|
|
1667
|
+
None,
|
|
1668
|
+
description="Byte offset from start of file (Alternative geometry)."
|
|
1669
|
+
)
|
|
1670
|
+
|
|
1671
|
+
# --- II. THE QUANTUM STATE (WHAT) ---
|
|
1672
|
+
content: Optional[str] = Field(
|
|
1673
|
+
None,
|
|
1674
|
+
description="The 'Dirty' content of the file from the editor buffer. If None, reads from disk."
|
|
1675
|
+
)
|
|
1676
|
+
|
|
1677
|
+
language_id: Optional[str] = Field(
|
|
1678
|
+
None,
|
|
1679
|
+
description="Forced language context (e.g. 'python', 'rust'). Divined if omitted."
|
|
1680
|
+
)
|
|
1681
|
+
|
|
1682
|
+
# --- III. THE CONTEXTUAL SOUL (WHY) ---
|
|
1683
|
+
metadata: Dict[str, Any] = Field(
|
|
1684
|
+
default_factory=dict,
|
|
1685
|
+
description="Arbitrary Gnostic context (Trace IDs, Client Capabilities, Trigger Kinds)."
|
|
1686
|
+
)
|
|
1687
|
+
|
|
1688
|
+
# --- IV. THE TUNING DIALS (HOW) ---
|
|
1689
|
+
verbosity: int = Field(
|
|
1690
|
+
1,
|
|
1691
|
+
ge=0, le=3,
|
|
1692
|
+
description="Depth of Gnosis: 0=TypeOnly, 1=BasicDoc, 2=FullDoc, 3=DeepLinks."
|
|
1693
|
+
)
|
|
1694
|
+
|
|
1695
|
+
format: Literal['markdown', 'plaintext'] = Field(
|
|
1696
|
+
'markdown',
|
|
1697
|
+
description="The requested tongue of the response."
|
|
1698
|
+
)
|
|
1699
|
+
|
|
1700
|
+
resolve_links: bool = Field(
|
|
1701
|
+
False,
|
|
1702
|
+
description="If True, the Artisan will trace imports to find the original definition."
|
|
1703
|
+
)
|
|
1704
|
+
|
|
1705
|
+
timeout: float = Field(
|
|
1706
|
+
2.0,
|
|
1707
|
+
description="Max duration (seconds) before the Gaze averts."
|
|
1708
|
+
)
|
|
1709
|
+
|
|
1710
|
+
# =========================================================================
|
|
1711
|
+
# == THE RITES OF TRANSMUTATION (PRE-VALIDATION) ==
|
|
1712
|
+
# =========================================================================
|
|
1713
|
+
|
|
1714
|
+
@model_validator(mode='before')
|
|
1715
|
+
@classmethod
|
|
1716
|
+
def unify_identity(cls, data: Any) -> Any:
|
|
1717
|
+
"""
|
|
1718
|
+
[THE POLYMORPHIC ALCHEMIST]
|
|
1719
|
+
Detects the shape of the input matter and transmutes it into Gnostic Truth.
|
|
1720
|
+
"""
|
|
1721
|
+
if not isinstance(data, dict): return data
|
|
1722
|
+
|
|
1723
|
+
# CASE A: LSP INGRESS (textDocument + position)
|
|
1724
|
+
# The Dispatcher sends this when receiving 'textDocument/hover'
|
|
1725
|
+
if 'textDocument' in data:
|
|
1726
|
+
# Handle nested dict or object
|
|
1727
|
+
td = data['textDocument']
|
|
1728
|
+
uri = td.get('uri') if isinstance(td, dict) else getattr(td, 'uri', '')
|
|
1729
|
+
|
|
1730
|
+
# 1. Divine file_path from URI
|
|
1731
|
+
if 'file_path' not in data:
|
|
1732
|
+
data['file_path'] = _clean_uri_to_path(uri)
|
|
1733
|
+
|
|
1734
|
+
# 2. Divine Position
|
|
1735
|
+
# Ensure 'position' key exists and maps to the correct shape
|
|
1736
|
+
if 'position' in data:
|
|
1737
|
+
# If it's already a model or dict, we let Pydantic handle it
|
|
1738
|
+
pass
|
|
1739
|
+
|
|
1740
|
+
# CASE B: CLI INGRESS (file_path + line_num)
|
|
1741
|
+
# The CLI user types: scaffold hover --file src/main.py --line 10
|
|
1742
|
+
if 'line_num' in data and 'position' not in data:
|
|
1743
|
+
# Transmute 1-based line to 0-based CursorPoint
|
|
1744
|
+
line0 = int(data['line_num']) - 1
|
|
1745
|
+
char0 = int(data.get('char_num', 1)) - 1
|
|
1746
|
+
data['position'] = {'line': max(0, line0), 'character': max(0, char0)}
|
|
1747
|
+
|
|
1748
|
+
return data
|
|
1749
|
+
|
|
1750
|
+
# =========================================================================
|
|
1751
|
+
# == THE RITES OF PURIFICATION (POST-VALIDATION) ==
|
|
1752
|
+
# =========================================================================
|
|
1753
|
+
|
|
1754
|
+
@field_validator('position', mode='before')
|
|
1755
|
+
@classmethod
|
|
1756
|
+
def _consecrate_geometry(cls, v: Any) -> Any:
|
|
1757
|
+
"""
|
|
1758
|
+
[THE GEOMETER]
|
|
1759
|
+
Transmutes raw dictionaries into the CursorPoint spirit.
|
|
1760
|
+
Handles: {'line': 1, 'character': 5}
|
|
1761
|
+
"""
|
|
1762
|
+
# We rely on Pydantic to do the actual casting, but we handle potential nulls
|
|
1763
|
+
if v is None:
|
|
1764
|
+
return {'line': 0, 'character': 0}
|
|
1765
|
+
return v
|
|
1766
|
+
|
|
1767
|
+
@field_validator('file_path', mode='before')
|
|
1768
|
+
@classmethod
|
|
1769
|
+
def _canonize_path(cls, v: Union[str, Path]) -> str:
|
|
1770
|
+
"""
|
|
1771
|
+
[THE PATHFINDER]
|
|
1772
|
+
Ensures the path is absolute and POSIX-normalized.
|
|
1773
|
+
"""
|
|
1774
|
+
if isinstance(v, Path):
|
|
1775
|
+
return v.resolve().as_posix()
|
|
1776
|
+
if not v:
|
|
1777
|
+
return ""
|
|
1778
|
+
# Basic string normalization if Path object not provided
|
|
1779
|
+
return str(Path(v).resolve()).replace('\\', '/')
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
# =================================================================================
|
|
1783
|
+
# == III. THE CODE ACTION REQUEST (THE MISSING LINK) ==
|
|
1784
|
+
# =================================================================================
|
|
1785
|
+
class PositionModel(BaseModel):
|
|
1786
|
+
"""
|
|
1787
|
+
[THE GEOMETRIC ATOM]
|
|
1788
|
+
Precise 0-indexed coordinates within the scripture.
|
|
1789
|
+
"""
|
|
1790
|
+
line: int
|
|
1791
|
+
character: int
|
|
1792
|
+
|
|
1793
|
+
|
|
1794
|
+
class RangeModel(BaseModel):
|
|
1795
|
+
"""
|
|
1796
|
+
[THE VESSEL OF EXTENT]
|
|
1797
|
+
A range expressed as start and end positions.
|
|
1798
|
+
"""
|
|
1799
|
+
start: PositionModel
|
|
1800
|
+
end: PositionModel
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
class CodeActionContextModel(BaseModel):
|
|
1804
|
+
"""
|
|
1805
|
+
[THE CONTEXT OF REDEMPTION]
|
|
1806
|
+
Carries diagnostics and trigger kinds for code actions.
|
|
1807
|
+
"""
|
|
1808
|
+
diagnostics: List[Dict[str, Any]] = Field(default_factory=list)
|
|
1809
|
+
only: Optional[List[str]] = None
|
|
1810
|
+
triggerKind: Optional[int] = None
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
class CodeActionRequest(BaseRequest):
|
|
1816
|
+
"""
|
|
1817
|
+
[THE RITE OF REDEMPTION]
|
|
1818
|
+
Handles `textDocument/codeAction`.
|
|
1819
|
+
"""
|
|
1820
|
+
model_config = ConfigDict(populate_by_name=True, arbitrary_types_allowed=True)
|
|
1821
|
+
|
|
1822
|
+
text_document: Optional[TextDocumentIdentifierModel] = Field(None, alias="textDocument")
|
|
1823
|
+
range: Optional[RangeModel] = None
|
|
1824
|
+
context: Optional[CodeActionContextModel] = None
|
|
1825
|
+
|
|
1826
|
+
# CLI Compatibility
|
|
1827
|
+
file_path: Optional[str] = None
|
|
1828
|
+
|
|
1829
|
+
@model_validator(mode='before')
|
|
1830
|
+
@classmethod
|
|
1831
|
+
def unify(cls, data: Any) -> Any:
|
|
1832
|
+
if not isinstance(data, dict): return data
|
|
1833
|
+
|
|
1834
|
+
if 'textDocument' in data and 'file_path' not in data:
|
|
1835
|
+
td = data['textDocument']
|
|
1836
|
+
uri = td.get('uri') if isinstance(td, dict) else getattr(td, 'uri', '')
|
|
1837
|
+
data['file_path'] = _clean_uri_to_path(uri)
|
|
1838
|
+
return data
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
class CompletionRequest(BaseRequest):
|
|
1842
|
+
"""
|
|
1843
|
+
=============================================================================
|
|
1844
|
+
== THE COMPLETION PLEA (V-Ω-PROPHETIC-VESSEL-V24) ==
|
|
1845
|
+
=============================================================================
|
|
1846
|
+
LIF: 10,000,000 | ROLE: FORESIGHT_CONDUIT | RANK: SOVEREIGN
|
|
1847
|
+
|
|
1848
|
+
The definitive vessel for the Request for Foresight.
|
|
1849
|
+
It bridges the Ocular Retina (Monaco) with the Council of Prophets.
|
|
1850
|
+
"""
|
|
1851
|
+
model_config = ConfigDict(
|
|
1852
|
+
frozen=True,
|
|
1853
|
+
populate_by_name=True,
|
|
1854
|
+
arbitrary_types_allowed=True,
|
|
1855
|
+
extra='allow',
|
|
1856
|
+
json_schema_extra={
|
|
1857
|
+
"example": {
|
|
1858
|
+
"file_path": "C:/dev/project/scaffold.scaffold",
|
|
1859
|
+
"position": {"line": 22, "character": 4},
|
|
1860
|
+
"trigger_character": "$",
|
|
1861
|
+
"metadata": {"trace_id": "pred-7572FC", "session_id": "oracle-A1"}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
)
|
|
1865
|
+
|
|
1866
|
+
# --- I. THE LOCUS (WHERE) ---
|
|
1867
|
+
file_path: str = Field(
|
|
1868
|
+
...,
|
|
1869
|
+
description="The absolute physical coordinate of the scripture."
|
|
1870
|
+
)
|
|
1871
|
+
|
|
1872
|
+
position: CursorPoint = Field(
|
|
1873
|
+
...,
|
|
1874
|
+
description="The precise Gnostic coordinates of the caret."
|
|
1875
|
+
)
|
|
1876
|
+
|
|
1877
|
+
# LSP Compatibility Layer
|
|
1878
|
+
text_document: Optional[TextDocumentIdentifierModel] = Field(None, alias="textDocument")
|
|
1879
|
+
context: Optional[Dict[str, Any]] = Field(None, description="Raw LSP context payload.")
|
|
1880
|
+
|
|
1881
|
+
# --- II. THE TRIGGER (WHY) ---
|
|
1882
|
+
trigger_character: Optional[str] = Field(
|
|
1883
|
+
None,
|
|
1884
|
+
description="The sacred particle that summoned the Prophet."
|
|
1885
|
+
)
|
|
1886
|
+
|
|
1887
|
+
trigger_kind: int = Field(
|
|
1888
|
+
1,
|
|
1889
|
+
description="1=Invoked, 2=TriggerCharacter, 3=Incomplete."
|
|
1890
|
+
)
|
|
1891
|
+
|
|
1892
|
+
# --- III. THE QUANTUM STATE (WHAT) ---
|
|
1893
|
+
content: Optional[str] = Field(
|
|
1894
|
+
None,
|
|
1895
|
+
description="The 'Dirty' buffer state. Matter takes precedence over Disk."
|
|
1896
|
+
)
|
|
1897
|
+
|
|
1898
|
+
line_prefix: Optional[str] = Field(
|
|
1899
|
+
None,
|
|
1900
|
+
description="The lexical matter to the left of the cursor."
|
|
1901
|
+
)
|
|
1902
|
+
|
|
1903
|
+
# [ASCENSION 1 - THE FIX]: THE SOVEREIGN METADATA HUB
|
|
1904
|
+
metadata: Dict[str, Any] = Field(
|
|
1905
|
+
default_factory=dict,
|
|
1906
|
+
description="Forensic metadata: trace_id, session_id, and telemetry markers."
|
|
1907
|
+
)
|
|
1908
|
+
|
|
1909
|
+
# =========================================================================
|
|
1910
|
+
# == THE RITES OF TRANSMUTATION (VALIDATION) ==
|
|
1911
|
+
# =========================================================================
|
|
1912
|
+
|
|
1913
|
+
@model_validator(mode='before')
|
|
1914
|
+
@classmethod
|
|
1915
|
+
def unify_prophetic_identity(cls, data: Any) -> Any:
|
|
1916
|
+
"""
|
|
1917
|
+
[THE POLYMORPHIC ALCHEMIST]
|
|
1918
|
+
Transmutes the chaotic matter of the network into Gnostic Truth.
|
|
1919
|
+
"""
|
|
1920
|
+
if not isinstance(data, dict): return data
|
|
1921
|
+
|
|
1922
|
+
# --- MOVEMENT I: LSP CONFORMANCE ---
|
|
1923
|
+
if 'textDocument' in data or 'text_document' in data:
|
|
1924
|
+
td = data.get('textDocument') or data.get('text_document')
|
|
1925
|
+
uri = td.get('uri') if isinstance(td, dict) else getattr(td, 'uri', '')
|
|
1926
|
+
|
|
1927
|
+
# [ASCENSION 2 & 3]: TITANIUM PATH RESOLUTION
|
|
1928
|
+
if 'file_path' not in data and uri:
|
|
1929
|
+
# We surgically clean the URI to find the absolute OS path
|
|
1930
|
+
clean_p = str(uri).replace('file:///', '').replace('file://', '')
|
|
1931
|
+
# Windows Drive Surgery
|
|
1932
|
+
if clean_p.startswith('/') and len(clean_p) > 2 and clean_p[2] == ':':
|
|
1933
|
+
clean_p = clean_p[1:]
|
|
1934
|
+
# Artifact Exorcism: Strip trailing quotes and dots
|
|
1935
|
+
data['file_path'] = clean_p.strip("'\"").replace('\\', '/').rstrip('.')
|
|
1936
|
+
|
|
1937
|
+
# [ASCENSION 4]: TRIGGER EXTRACTION
|
|
1938
|
+
ctx = data.get('context')
|
|
1939
|
+
if ctx:
|
|
1940
|
+
if 'trigger_character' not in data:
|
|
1941
|
+
data['trigger_character'] = ctx.get('triggerCharacter')
|
|
1942
|
+
if 'trigger_kind' not in data:
|
|
1943
|
+
data['trigger_kind'] = ctx.get('triggerKind')
|
|
1944
|
+
|
|
1945
|
+
# --- MOVEMENT II: GEOMETRIC SAFETY ---
|
|
1946
|
+
if 'position' in data:
|
|
1947
|
+
p = data['position']
|
|
1948
|
+
# [ASCENSION 5]: BOUNDARY CLAMPING
|
|
1949
|
+
if isinstance(p, dict):
|
|
1950
|
+
p['line'] = max(0, int(p.get('line', 0)))
|
|
1951
|
+
p['character'] = max(0, int(p.get('character', 0)))
|
|
1952
|
+
elif 'line' in data and 'character' in data:
|
|
1953
|
+
data['position'] = {'line': data['line'], 'character': data['character']}
|
|
1954
|
+
|
|
1955
|
+
# --- MOVEMENT III: TRACE INJECTION ---
|
|
1956
|
+
if 'metadata' not in data:
|
|
1957
|
+
data['metadata'] = {}
|
|
1958
|
+
|
|
1959
|
+
if 'trace_id' not in data['metadata']:
|
|
1960
|
+
data['metadata']['trace_id'] = f"pred-{uuid.uuid4().hex[:6].upper()}"
|
|
1961
|
+
|
|
1962
|
+
return data
|
|
1963
|
+
|
|
1964
|
+
@field_validator('file_path')
|
|
1965
|
+
@classmethod
|
|
1966
|
+
def _ensure_absolute_posix(cls, v: str) -> str:
|
|
1967
|
+
"""[ASCENSION 12]: THE FINAL PATH CONSTITUTION"""
|
|
1968
|
+
if not v: return ""
|
|
1969
|
+
# Force absolute resolution and forward-slash harmony
|
|
1970
|
+
return str(Path(v).resolve()).replace('\\', '/')
|
|
1971
|
+
|
|
1972
|
+
class DefinitionRequest(BaseRequest):
|
|
1973
|
+
"""A plea to find the Gnostic origin of a sacred word."""
|
|
1974
|
+
file_path: str = Field(..., description="The URI of the scripture.")
|
|
1975
|
+
content: str = Field(..., description="The current soul of the scripture.")
|
|
1976
|
+
position: Dict[str, int] = Field(..., description="The cursor's Gnostic location.")
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
# =============================================================================
|
|
1980
|
+
# == 22. TRANSMUTE RITE (scaffold transmute) ==
|
|
1981
|
+
# =============================================================================
|
|
1982
|
+
|
|
1983
|
+
# =============================================================================
|
|
1984
|
+
# == 22. TRANSMUTE RITE (scaffold transmute) ==
|
|
1985
|
+
# =============================================================================
|
|
1986
|
+
|
|
1987
|
+
class TransmuteRequest(BaseRequest):
|
|
1988
|
+
"""
|
|
1989
|
+
Plea to evolve the project's reality to match the will of the Blueprint.
|
|
1990
|
+
This vessel's contract is now whole, its soul unified with Genesis.
|
|
1991
|
+
"""
|
|
1992
|
+
# This is the original, but now it serves as an alias.
|
|
1993
|
+
path_to_scripture: Optional[str] = Field(
|
|
1994
|
+
default=None,
|
|
1995
|
+
description="Target file. If None, Sync Mode (scaffold.scaffold) is assumed."
|
|
1996
|
+
)
|
|
1997
|
+
|
|
1998
|
+
# --- THE DIVINE HEALING & UNIFICATION ---
|
|
1999
|
+
# This is the new, one true chamber for the blueprint's path.
|
|
2000
|
+
blueprint_path: Optional[str] = Field(
|
|
2001
|
+
default=None,
|
|
2002
|
+
description="The Gnostic scripture of intent. An alias for path_to_scripture."
|
|
2003
|
+
)
|
|
2004
|
+
# --- THE APOTHEOSIS IS COMPLETE ---
|
|
2005
|
+
|
|
2006
|
+
silent: bool = Field(default=False)
|
|
2007
|
+
anchor: bool = Field(default=False)
|
|
2008
|
+
revert_blueprint: Optional[str] = Field(default=None)
|
|
2009
|
+
|
|
2010
|
+
@model_validator(mode='before')
|
|
2011
|
+
@classmethod
|
|
2012
|
+
def _unify_path_gnosis(cls, data: Any) -> Any:
|
|
2013
|
+
"""
|
|
2014
|
+
A divine alchemist that ensures `blueprint_path` is always pure,
|
|
2015
|
+
honoring the ancient `path_to_scripture` tongue as a sacred alias.
|
|
2016
|
+
"""
|
|
2017
|
+
if isinstance(data, dict):
|
|
2018
|
+
if 'path_to_scripture' in data and data.get('path_to_scripture') is not None:
|
|
2019
|
+
if data.get('blueprint_path') is None:
|
|
2020
|
+
data['blueprint_path'] = data['path_to_scripture']
|
|
2021
|
+
elif 'blueprint_path' in data and data.get('blueprint_path') is not None:
|
|
2022
|
+
if data.get('path_to_scripture') is None:
|
|
2023
|
+
data['path_to_scripture'] = data['blueprint_path']
|
|
2024
|
+
return data
|
|
2025
|
+
|
|
2026
|
+
class HealRequest(BaseRequest):
|
|
2027
|
+
"""
|
|
2028
|
+
Plea to heal the Gnostic connections (imports) of a specific scripture.
|
|
2029
|
+
"""
|
|
2030
|
+
file_path: str = Field(..., description="The path to the wounded scripture.")
|
|
2031
|
+
check_only: bool = Field(default=False, description="If True, only reports broken links without healing.")
|
|
2032
|
+
|
|
2033
|
+
|
|
2034
|
+
class AddRequest(BaseRequest):
|
|
2035
|
+
"""
|
|
2036
|
+
Plea to append a new definition to a Blueprint.
|
|
2037
|
+
"""
|
|
2038
|
+
blueprint_path: str = Field(
|
|
2039
|
+
default="scaffold.scaffold",
|
|
2040
|
+
description="The blueprint to modify."
|
|
2041
|
+
)
|
|
2042
|
+
item_path: str = Field(
|
|
2043
|
+
...,
|
|
2044
|
+
description="The path of the file/directory to add."
|
|
2045
|
+
)
|
|
2046
|
+
content: Optional[str] = Field(
|
|
2047
|
+
default=None,
|
|
2048
|
+
description="Inline content or directive (@...)."
|
|
2049
|
+
)
|
|
2050
|
+
seed_path: Optional[str] = Field(
|
|
2051
|
+
default=None,
|
|
2052
|
+
description="Path to a seed file (<<)."
|
|
2053
|
+
)
|
|
2054
|
+
is_dir: bool = Field(
|
|
2055
|
+
default=False,
|
|
2056
|
+
description="Explicitly mark as directory (appends /)."
|
|
2057
|
+
)
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
class InspectRequest(BaseRequest):
|
|
2061
|
+
"""
|
|
2062
|
+
Plea to gaze upon the soul of a blueprint without materializing it.
|
|
2063
|
+
"""
|
|
2064
|
+
blueprint_path: str = Field(
|
|
2065
|
+
default="scaffold.scaffold",
|
|
2066
|
+
description="The path to the blueprint scripture."
|
|
2067
|
+
)
|
|
2068
|
+
|
|
2069
|
+
json_output: bool = Field(
|
|
2070
|
+
default=False,
|
|
2071
|
+
description="Output raw JSON data (Legacy flag, prefer format='json')."
|
|
2072
|
+
)
|
|
2073
|
+
|
|
2074
|
+
# ★★★ THE DIVINE HEALING: THE FORMAT VESSEL ★★★
|
|
2075
|
+
format: Literal['text', 'mermaid', 'json'] = Field(
|
|
2076
|
+
default='text',
|
|
2077
|
+
description="The medium of proclamation (text, mermaid, json)."
|
|
2078
|
+
)
|
|
2079
|
+
|
|
2080
|
+
class BlueprintExciseRequest(BaseRequest):
|
|
2081
|
+
"""Plea to excise a definition from the blueprint scripture."""
|
|
2082
|
+
blueprint_path: str = Field(default="scaffold.scaffold")
|
|
2083
|
+
target_path: str = Field(..., description="The path key to excise from the text.")
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
class ExciseRequest(BaseRequest):
|
|
2087
|
+
"""
|
|
2088
|
+
Plea to surgically remove all artifacts from the filesystem that were born
|
|
2089
|
+
from a specific blueprint origin.
|
|
2090
|
+
"""
|
|
2091
|
+
blueprint_origin: str = Field(..., description="The blueprint origin to excise (e.g., 'my-feature.scaffold' or 'kit/auth').")
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
class HistoryRequest(BaseRequest):
|
|
2095
|
+
"""
|
|
2096
|
+
Plea to traverse the Gnostic Timeline.
|
|
2097
|
+
"""
|
|
2098
|
+
command: Literal['list', 'undo', 'reset'] = Field(
|
|
2099
|
+
...,
|
|
2100
|
+
description="The temporal rite to perform."
|
|
2101
|
+
)
|
|
2102
|
+
|
|
2103
|
+
target_id: Optional[str] = Field(
|
|
2104
|
+
default=None,
|
|
2105
|
+
description="The Rite ID or Index to jump to (for reset)."
|
|
2106
|
+
)
|
|
2107
|
+
|
|
2108
|
+
class TimeBranchRequest(BaseRequest):
|
|
2109
|
+
"""A plea to forge a new branch of reality from the past."""
|
|
2110
|
+
new_branch_name: str
|
|
2111
|
+
from_rite: str
|
|
2112
|
+
|
|
2113
|
+
class TimeMachineRequest(HistoryRequest):
|
|
2114
|
+
"""A sacred vessel for the `time-machine` rite.
|
|
2115
|
+
It is a Gnostic twin of the HistoryRequest, as they both summon the Altar of Time.
|
|
2116
|
+
"""
|
|
2117
|
+
pass
|
|
2118
|
+
|
|
2119
|
+
class TreeRequest(BaseRequest):
|
|
2120
|
+
"""
|
|
2121
|
+
Plea to visualize the reality of a directory as a Luminous Tree.
|
|
2122
|
+
"""
|
|
2123
|
+
target_path: str = Field(default=".", description="The sanctum to gaze upon.")
|
|
2124
|
+
all: bool = Field(default=False, description="Show hidden and ignored files (pierce the Veil).")
|
|
2125
|
+
depth: int = Field(default=-1, description="Limit the depth of the Gaze.")
|
|
2126
|
+
format: Literal['text', 'svg', 'json'] = Field(default='text', description="The medium of proclamation.")
|
|
2127
|
+
output: Optional[str] = Field(default=None, description="Path to write the visualization to.")
|
|
2128
|
+
|
|
2129
|
+
# ★★★ THE MISSING VESSEL (THE FIX) ★★★
|
|
2130
|
+
serve: bool = Field(default=False, description="Launch an ephemeral server to view SVG output.")
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
# =============================================================================
|
|
2134
|
+
# == 23. VERIFY RITE (scaffold verify) ==
|
|
2135
|
+
# =============================================================================
|
|
2136
|
+
|
|
2137
|
+
class VerifyRequest(BaseRequest):
|
|
2138
|
+
"""
|
|
2139
|
+
Plea to adjudicate the integrity of the current reality against the Gnostic Chronicle.
|
|
2140
|
+
"""
|
|
2141
|
+
target_path: str = Field(
|
|
2142
|
+
default=".",
|
|
2143
|
+
description="The sanctum to verify."
|
|
2144
|
+
)
|
|
2145
|
+
|
|
2146
|
+
fast: bool = Field(
|
|
2147
|
+
default=False,
|
|
2148
|
+
description="The Rite of Speed. Checks file existence and timestamps/size only, skipping hash verification."
|
|
2149
|
+
)
|
|
2150
|
+
|
|
2151
|
+
strict: bool = Field(
|
|
2152
|
+
default=False,
|
|
2153
|
+
description="The Rite of Paranoia. Fails if *any* untracked files (not in lockfile/gitignore) are found."
|
|
2154
|
+
)
|
|
2155
|
+
|
|
2156
|
+
fix_suggestions: bool = Field(
|
|
2157
|
+
default=True,
|
|
2158
|
+
description="Proclaim the commands needed to heal the drift."
|
|
2159
|
+
)
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
# =============================================================================
|
|
2163
|
+
# == 24. ADOPT RITE (scaffold adopt) ==
|
|
2164
|
+
# =============================================================================
|
|
2165
|
+
|
|
2166
|
+
class AdoptRequest(BaseRequest):
|
|
2167
|
+
"""
|
|
2168
|
+
=================================================================================
|
|
2169
|
+
== THE VESSEL OF ADOPTION (V-Ω-UNIFIED-GAZE-ASCENDED) ==
|
|
2170
|
+
=================================================================================
|
|
2171
|
+
The sacred plea to perform the Rite of Adoption. This rite gazes upon the
|
|
2172
|
+
mortal realm (the filesystem) and transmutes its current state into the one
|
|
2173
|
+
true Gnostic Law (a .scaffold file) and Memory (scaffold.lock).
|
|
2174
|
+
|
|
2175
|
+
It has been ascended to possess the full Gnostic Gaze, perfectly mirroring the
|
|
2176
|
+
faculties of the DistillRequest for ignore, include, and focus operations.
|
|
2177
|
+
"""
|
|
2178
|
+
target_path: str = Field(
|
|
2179
|
+
default=".",
|
|
2180
|
+
description="The directory sanctum whose reality is to be adopted."
|
|
2181
|
+
)
|
|
2182
|
+
output_file: str = Field(
|
|
2183
|
+
default="scaffold.scaffold",
|
|
2184
|
+
description="The scripture where the new Gnostic Law shall be inscribed."
|
|
2185
|
+
)
|
|
2186
|
+
full: bool = Field(
|
|
2187
|
+
default=False,
|
|
2188
|
+
description="If True, performs a deep content hash of all scriptures for the lockfile."
|
|
2189
|
+
)
|
|
2190
|
+
|
|
2191
|
+
# --- THE ASCENDED FACULTIES (THE FIX) ---
|
|
2192
|
+
ignore: Optional[List[str]] = Field(
|
|
2193
|
+
default=None,
|
|
2194
|
+
description="A list of glob patterns to avert the Gaze from (e.g., '*.log', 'dist/')."
|
|
2195
|
+
)
|
|
2196
|
+
include: Optional[List[str]] = Field(
|
|
2197
|
+
default=None,
|
|
2198
|
+
description="A list of glob patterns to EXCLUSIVELY focus the Gaze upon (Whitelist)."
|
|
2199
|
+
)
|
|
2200
|
+
focus: Optional[List[str]] = Field(
|
|
2201
|
+
default=None,
|
|
2202
|
+
description="A list of semantic keywords to prioritize during analysis (e.g., 'auth', 'database')."
|
|
2203
|
+
)
|
|
2204
|
+
|
|
2205
|
+
# =============================================================================
|
|
2206
|
+
# == 25. REFACTOR RITE (scaffold refactor) ==
|
|
2207
|
+
# =============================================================================
|
|
2208
|
+
|
|
2209
|
+
class RefactorRequest(BaseRequest):
|
|
2210
|
+
"""
|
|
2211
|
+
Plea to visually restructure the project and forge a Transmutation Plan.
|
|
2212
|
+
"""
|
|
2213
|
+
blueprint_path: str = Field(
|
|
2214
|
+
...,
|
|
2215
|
+
description="The target blueprint scripture to update or create (e.g., 'refactor.scaffold')."
|
|
2216
|
+
)
|
|
2217
|
+
|
|
2218
|
+
from_blueprint: Optional[str] = Field(
|
|
2219
|
+
default=None,
|
|
2220
|
+
description="An optional source blueprint (e.g. from AI) to load as the 'After' state."
|
|
2221
|
+
)
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
# =============================================================================
|
|
2225
|
+
# == 26. PATCH RITE (scaffold patch) ==
|
|
2226
|
+
# =============================================================================
|
|
2227
|
+
|
|
2228
|
+
class PatchRequest(BaseRequest):
|
|
2229
|
+
"""
|
|
2230
|
+
=================================================================================
|
|
2231
|
+
== THE PLEA FOR SURGICAL TRANSMUTATION (V-Ω-ETERNAL) ==
|
|
2232
|
+
=================================================================================
|
|
2233
|
+
A divine plea to the Gnostic Surgeon. It carries a scripture of MUTATION, not
|
|
2234
|
+
definition, commanding the engine to apply a precise set of changes to an
|
|
2235
|
+
existing reality.
|
|
2236
|
+
=================================================================================
|
|
2237
|
+
"""
|
|
2238
|
+
patch_path: str = Field(..., description="Path to the .patch.scaffold scripture containing the mutation edicts.")
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
class RunRequest(BaseRequest):
|
|
2242
|
+
"""
|
|
2243
|
+
=================================================================================
|
|
2244
|
+
== THE SENTIENT VESSEL OF UNIVERSAL CONDUCTION (V-Ω-ETERNAL-APOTHEOSIS++) ==
|
|
2245
|
+
=================================================================================
|
|
2246
|
+
LIF: 100,000,000,000,000
|
|
2247
|
+
|
|
2248
|
+
This is the divine plea to the Universal Conductor. It carries the Gnosis for
|
|
2249
|
+
executing any scripture, in any tongue, in any reality. It has been ascended
|
|
2250
|
+
to explicitly hold the **Vow of Silence** and the **Silver Cord**, ensuring
|
|
2251
|
+
perfect compatibility with the Middleware Pantheon.
|
|
2252
|
+
"""
|
|
2253
|
+
# [FACULTY 1] The Unbreakable Schema
|
|
2254
|
+
model_config = ConfigDict(arbitrary_types_allowed=True, extra='ignore')
|
|
2255
|
+
|
|
2256
|
+
# --- The Core Plea (Now Polymorphic) ---
|
|
2257
|
+
target: Optional[Union[str, Path]] = Field(
|
|
2258
|
+
None,
|
|
2259
|
+
description="Path to the Gnostic scripture or the language for an ephemeral rite."
|
|
2260
|
+
)
|
|
2261
|
+
|
|
2262
|
+
# --- The Ephemeral Scribe's Gnosis ---
|
|
2263
|
+
eval_content: Optional[str] = Field(
|
|
2264
|
+
None,
|
|
2265
|
+
description="A raw string of scripture to execute in memory."
|
|
2266
|
+
)
|
|
2267
|
+
pipe_content: Optional[str] = Field(
|
|
2268
|
+
None,
|
|
2269
|
+
description="Scripture piped from stdin. This vessel receives the final string, not the CLI flag."
|
|
2270
|
+
)
|
|
2271
|
+
create_if_void: bool = Field(
|
|
2272
|
+
False,
|
|
2273
|
+
description="Forge a default scripture if the target path is a void."
|
|
2274
|
+
)
|
|
2275
|
+
|
|
2276
|
+
# --- The Chronomancer's Vow ---
|
|
2277
|
+
vigil: bool = Field(
|
|
2278
|
+
False,
|
|
2279
|
+
description="Awaken the Eternal Sentinel to watch the scripture for changes and re-run the rite."
|
|
2280
|
+
)
|
|
2281
|
+
|
|
2282
|
+
# --- THE GNOSTIC SCHEDULER'S WILL ---
|
|
2283
|
+
runtime: Optional[str] = Field(
|
|
2284
|
+
None,
|
|
2285
|
+
description="Override execution strategy (e.g., 'docker', 'hermetic', 'python@3.12')."
|
|
2286
|
+
)
|
|
2287
|
+
|
|
2288
|
+
# --- THE ORACLE'S GAZE ---
|
|
2289
|
+
codex: bool = Field(
|
|
2290
|
+
False,
|
|
2291
|
+
description="Proclaim the Gnostic codex of all summonable runtimes."
|
|
2292
|
+
)
|
|
2293
|
+
|
|
2294
|
+
# --- The Gnostic Guardian's Vows ---
|
|
2295
|
+
no_lock: bool = Field(
|
|
2296
|
+
False,
|
|
2297
|
+
description="A dangerous vow to conduct a rite without touching or updating the scaffold.lock."
|
|
2298
|
+
)
|
|
2299
|
+
debug: bool = Field(False, description="Launch in Debug Mode (Expose DAP port/Inspect).")
|
|
2300
|
+
|
|
2301
|
+
# [THE FIX] The Vow of Silence
|
|
2302
|
+
# Explicitly defined here to ensure it captures the --silent flag from argparse.
|
|
2303
|
+
silent: bool = Field(
|
|
2304
|
+
False,
|
|
2305
|
+
description="The Vow of Silence. Suppresses non-essential output."
|
|
2306
|
+
)
|
|
2307
|
+
|
|
2308
|
+
# [FACULTY: CELESTIAL PROJECTION]
|
|
2309
|
+
remote: Optional[str] = Field(
|
|
2310
|
+
default=None,
|
|
2311
|
+
description="The URI (host:port) of a remote Scaffold Daemon to conduct this rite."
|
|
2312
|
+
)
|
|
2313
|
+
|
|
2314
|
+
# --- [THE ASCENSION] MIDDLEWARE CONTRACTS ---
|
|
2315
|
+
# These fields are required for the new 12-Ring Pipeline to function without heresy.
|
|
2316
|
+
|
|
2317
|
+
# 2. The Gnostic Context (EnrichmentMiddleware / PrerequisiteMiddleware)
|
|
2318
|
+
context: Dict[str, Any] = Field(
|
|
2319
|
+
default_factory=dict,
|
|
2320
|
+
description="Ephemeral metadata injected by middleware (e.g., binary paths, os info)."
|
|
2321
|
+
)
|
|
2322
|
+
|
|
2323
|
+
# 3. The Vault of Secrets (SecretScrubberMiddleware)
|
|
2324
|
+
secrets: Dict[str, str] = Field(
|
|
2325
|
+
default_factory=dict,
|
|
2326
|
+
description="Secure storage for redacted secrets extracted from variables."
|
|
2327
|
+
)
|
|
2328
|
+
extra_args: List[str] = Field(
|
|
2329
|
+
default_factory=list,
|
|
2330
|
+
description="A vessel for all passthrough arguments for the 'run' rite."
|
|
2331
|
+
)
|
|
2332
|
+
# ★★★ THE DIVINE HEALING: THE PRE-VALIDATION ALCHEMIST ★★★
|
|
2333
|
+
@field_validator('pipe_content', mode='before')
|
|
2334
|
+
@classmethod
|
|
2335
|
+
def transmute_pipe_flag_to_content(cls, v: Any) -> Optional[str]:
|
|
2336
|
+
"""
|
|
2337
|
+
This is the Gnostic Alchemist. It intercepts the raw value for 'pipe_content'
|
|
2338
|
+
before Pydantic's core validation. If it perceives the profane boolean `True`
|
|
2339
|
+
(from `argparse`), it performs the sacred rite of reading from stdin and
|
|
2340
|
+
returns the pure string soul.
|
|
2341
|
+
"""
|
|
2342
|
+
if v is True:
|
|
2343
|
+
try:
|
|
2344
|
+
# The Rite of the Celestial River
|
|
2345
|
+
return sys.stdin.read()
|
|
2346
|
+
except Exception:
|
|
2347
|
+
# The Unbreakable Ward of Grace. If the river is profane, the soul is a void.
|
|
2348
|
+
return None
|
|
2349
|
+
if isinstance(v, str) or v is None:
|
|
2350
|
+
return v
|
|
2351
|
+
return None
|
|
2352
|
+
|
|
2353
|
+
# --- Prophecies of Future Ascensions ---
|
|
2354
|
+
output: Optional[str] = Field(None, description="[Prophecy] Path to crystallize the output of a generative rite.")
|
|
2355
|
+
rehearse: bool = Field(False, description="[Prophecy] Conduct the rite in an ephemeral, temporary sanctum.")
|
|
2356
|
+
vars_from: Optional[str] = Field(None,
|
|
2357
|
+
description="[Prophecy] Path to a YAML/JSON file to load Gnostic variables from.")
|
|
2358
|
+
origin: Optional[str] = Field(None, description="[Prophecy] Manually declare a `blueprint_origin` for this rite.")
|
|
2359
|
+
budget: Optional[int] = Field(None, description="[Prophecy] Set a token budget for AI-driven sub-rites.")
|
|
2360
|
+
|
|
2361
|
+
class RuntimesRequest(BaseRequest):
|
|
2362
|
+
"""
|
|
2363
|
+
=================================================================================
|
|
2364
|
+
== THE PLEA FOR GNOSTIC GOVERNANCE (V-Ω-ULTRA-DEFINITIVE-APOTHEOSIS) ==
|
|
2365
|
+
=================================================================================
|
|
2366
|
+
This is the final, eternal, and ultra-definitive vessel for all pleas directed
|
|
2367
|
+
at the Altar of Control. It is a masterpiece of declarative intent, its soul
|
|
2368
|
+
now whole with the Gnosis of the `setup` rite, the Architect's will for
|
|
2369
|
+
Anointment Strategy, and the sacred `conduct` rite.
|
|
2370
|
+
=================================================================================
|
|
2371
|
+
"""
|
|
2372
|
+
command: Literal[
|
|
2373
|
+
'setup', 'list', 'codex', 'summon', 'purge', 'locate',
|
|
2374
|
+
'consecrate', 'health', 'conduct', 'anoint'
|
|
2375
|
+
] = Field(
|
|
2376
|
+
...,
|
|
2377
|
+
description="The specific rite to perform on the runtime sanctum."
|
|
2378
|
+
)
|
|
2379
|
+
|
|
2380
|
+
spec: Optional[str] = Field(
|
|
2381
|
+
default=None,
|
|
2382
|
+
description="The target runtime specification (e.g., 'python@3.11' or a script path for 'conduct')."
|
|
2383
|
+
)
|
|
2384
|
+
|
|
2385
|
+
ide: Optional[Literal['vscode', 'pycharm', 'vim']] = Field(
|
|
2386
|
+
default=None,
|
|
2387
|
+
description="Explicitly target an IDE for anointment."
|
|
2388
|
+
)
|
|
2389
|
+
|
|
2390
|
+
anoint_strategy: Literal['default', 'add'] = Field(
|
|
2391
|
+
default='default',
|
|
2392
|
+
description="Anointment will: 'default' (set as project interpreter) or 'add' (add to list)."
|
|
2393
|
+
)
|
|
2394
|
+
|
|
2395
|
+
# This vessel will carry all unknown arguments from the IDE's plea during `conduct`.
|
|
2396
|
+
extra_args: List[str] = Field(
|
|
2397
|
+
default_factory=list,
|
|
2398
|
+
description="A vessel for all passthrough arguments for the 'conduct' rite."
|
|
2399
|
+
)
|
|
2400
|
+
|
|
2401
|
+
force: bool = Field(
|
|
2402
|
+
default=False,
|
|
2403
|
+
description="Force re-downloading or bypass safety confirmations."
|
|
2404
|
+
)
|
|
2405
|
+
|
|
2406
|
+
# =============================================================================
|
|
2407
|
+
# == 27. TELEPRESENCE RITE (scaffold telepresence) ==
|
|
2408
|
+
# =============================================================================
|
|
2409
|
+
|
|
2410
|
+
class TelepresenceRequest(BaseRequest):
|
|
2411
|
+
"""
|
|
2412
|
+
=================================================================================
|
|
2413
|
+
== THE TELEPRESENCE CONTRACT (V-Ω-QUANTUM-ENTANGLEMENT) ==
|
|
2414
|
+
=================================================================================
|
|
2415
|
+
"""
|
|
2416
|
+
# Gnostic Verbs
|
|
2417
|
+
operation: Literal[
|
|
2418
|
+
'stat', 'read', 'write', 'readdir', 'delete', 'mkdir', 'rename',
|
|
2419
|
+
'shadow_write', 'shadow_commit', 'shadow_purge',
|
|
2420
|
+
'causal_slice', 'impact_prophecy', 'project_url'
|
|
2421
|
+
] = Field(..., description="The kinetic verb of the remote rite.")
|
|
2422
|
+
|
|
2423
|
+
path: str = Field(..., description="The project-relative path or Celestial URL.")
|
|
2424
|
+
|
|
2425
|
+
# Payload & Parameters
|
|
2426
|
+
content_base64: Optional[str] = None
|
|
2427
|
+
new_path: Optional[str] = None
|
|
2428
|
+
recursive: bool = False
|
|
2429
|
+
|
|
2430
|
+
# Advanced Metadata Control
|
|
2431
|
+
session_id: str = Field(default="global", description="The isolation chamber for Shadow Realities.")
|
|
2432
|
+
include_gnosis: bool = Field(default=False, description="Enrich results with Cortex metrics.")
|
|
2433
|
+
depth: int = Field(default=1, description="Traversal depth for causal slicing.")
|
|
2434
|
+
|
|
2435
|
+
# Simulation Logic
|
|
2436
|
+
patch_scripture: Optional[str] = None # For impact prophecy
|
|
2437
|
+
|
|
2438
|
+
class ManifestRequest(BaseRequest):
|
|
2439
|
+
"""
|
|
2440
|
+
Plea to transmute Natural Language into Structural Reality.
|
|
2441
|
+
"""
|
|
2442
|
+
prompt: str = Field(..., description="The Architect's intent in plain English.")
|
|
2443
|
+
|
|
2444
|
+
# Context Injection
|
|
2445
|
+
with_context: bool = Field(default=True, description="Inject current directory structure as context?")
|
|
2446
|
+
|
|
2447
|
+
# Interaction
|
|
2448
|
+
interactive: bool = Field(default=True, description="Review the AI's plan in the TUI before execution.")
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
class SummarizeRequest(BaseRequest):
|
|
2453
|
+
"""
|
|
2454
|
+
Plea to perform a deep, symbolic analysis and generate an executive summary.
|
|
2455
|
+
"""
|
|
2456
|
+
target_path: str = Field(
|
|
2457
|
+
default=".",
|
|
2458
|
+
description="The directory or file to summarize."
|
|
2459
|
+
)
|
|
2460
|
+
format: Literal['text', 'json', 'md'] = Field(
|
|
2461
|
+
default='text',
|
|
2462
|
+
description="The output format for the summary."
|
|
2463
|
+
)
|
|
2464
|
+
|
|
2465
|
+
|
|
2466
|
+
class WorkspaceRequest(BaseRequest):
|
|
2467
|
+
"""
|
|
2468
|
+
=================================================================================
|
|
2469
|
+
== THE POLYMORPHIC GNOSTIC VESSEL (V-Ω-APOTHEOSIS) ==
|
|
2470
|
+
=================================================================================
|
|
2471
|
+
The sacred, polymorphic vessel that carries the Architect's will to the Gnostic
|
|
2472
|
+
Observatory. Its soul changes form based on the rite being conducted.
|
|
2473
|
+
"""
|
|
2474
|
+
workspace_command: str = Field(description="The primary rite to be conducted (list, health, exec, etc.).")
|
|
2475
|
+
|
|
2476
|
+
# --- Vessels for Specific Rites ---
|
|
2477
|
+
|
|
2478
|
+
command_to_run: Optional[str] = Field(None,
|
|
2479
|
+
description="For the 'exec' rite: The universal edict (shell command) to be conducted.")
|
|
2480
|
+
|
|
2481
|
+
tag: Optional[str] = Field(None,
|
|
2482
|
+
description="For 'exec', 'health', 'git': A Gnostic filter to scope the rite to specific project tags.")
|
|
2483
|
+
|
|
2484
|
+
splane_path: Optional[str] = Field(None,
|
|
2485
|
+
description="For the 'genesis' rite: The path to the cosmic `.splane` scripture.")
|
|
2486
|
+
|
|
2487
|
+
path_to_add: Optional[str] = Field(None,
|
|
2488
|
+
description="For the 'add' rite: The relative path to a new project to be adopted into the cosmos.")
|
|
2489
|
+
|
|
2490
|
+
git_command: Optional[str] = Field(None,
|
|
2491
|
+
description="For the 'git' rite: The arguments to be passed to the Git command (e.g., 'pull origin main').")
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
class ShellRequest(BaseRequest):
|
|
2495
|
+
"""
|
|
2496
|
+
A plea to enter the Gnostic Cockpit (Interactive Shell).
|
|
2497
|
+
"""
|
|
2498
|
+
project_root: Optional[Path] = Field(default=None, description="The sanctum to anchor the shell in.")
|
|
2499
|
+
|
|
2500
|
+
# Configuration Overrides
|
|
2501
|
+
theme: str = Field(default="gnostic", description="Visual theme.")
|
|
2502
|
+
history_file: Optional[str] = Field(None, description="Path to history file.")
|
|
2503
|
+
|
|
2504
|
+
# Context
|
|
2505
|
+
initial_command: Optional[str] = Field(None, description="Command to execute immediately upon entry.")
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
class SelfTestRequest(BaseRequest):
|
|
2509
|
+
pass
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
class BuildRequest(BaseRequest):
|
|
2513
|
+
"""The Will of the Forge."""
|
|
2514
|
+
build_self: bool = False
|
|
2515
|
+
release: bool = False
|
|
2516
|
+
clean: bool = False
|
|
2517
|
+
output_path: Optional[str] = None
|
|
2518
|
+
target_arch: Optional[str] = None
|
|
2519
|
+
builder: str = "pyinstaller"
|
|
2520
|
+
|
|
2521
|
+
# [EXISTING]
|
|
2522
|
+
compress: bool = False
|
|
2523
|
+
dockerize: bool = False
|
|
2524
|
+
ci_export: str = "none"
|
|
2525
|
+
audit: bool = False
|
|
2526
|
+
provenance: bool = True
|
|
2527
|
+
notify: bool = False
|
|
2528
|
+
ai_heal: bool = False
|
|
2529
|
+
|
|
2530
|
+
# [NEW ASCENSIONS]
|
|
2531
|
+
remote: Optional[str] = None # URI for remote builder (ssh://...)
|
|
2532
|
+
sign: bool = False # Enable cosign signing
|
|
2533
|
+
wasm: bool = False # Compile to WebAssembly
|
|
2534
|
+
tree_shake: bool = False # Prune unused code before build
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
class DreamRequest(BaseRequest):
|
|
2538
|
+
prompt: str
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
class GraphRequest(BaseRequest):
|
|
2542
|
+
"""
|
|
2543
|
+
=============================================================================
|
|
2544
|
+
== THE GRAPH PLEA (V-Ω-MULTIMODAL) ==
|
|
2545
|
+
=============================================================================
|
|
2546
|
+
The vessel for all topological intent.
|
|
2547
|
+
If 'graph_data' is manifest, the Engine enters ARCHITECT mode (Writing).
|
|
2548
|
+
If 'graph_data' is void, the Engine enters CARTOGRAPHER mode (Reading/Ingest).
|
|
2549
|
+
"""
|
|
2550
|
+
focus: Optional[str] = Field(None, description="Focus the gaze on a specific symbol or path.")
|
|
2551
|
+
format: str = Field("json", pattern="^(json|mermaid|svg|text)$")
|
|
2552
|
+
|
|
2553
|
+
# [THE WILL]: Data sent from the UI to update reality
|
|
2554
|
+
graph_data: Optional[Dict[str, Any]] = Field(None, description="The JSON Graph (nodes/edges) to manifest on disk.")
|
|
2555
|
+
|
|
2556
|
+
# [THE GAZE]: Flags for the Ingestor
|
|
2557
|
+
include_orphans: bool = Field(True, description="Include files not yet bound to the Gnostic Law.")
|
|
2558
|
+
depth: int = Field(-1, description="Traversal depth for the causal weaver.")
|
|
2559
|
+
|
|
2560
|
+
dry_run: bool = Field(False, description="Simulate structural changes without touching matter.")
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
class BlameRequest(BaseRequest):
|
|
2565
|
+
target_path: str
|
|
2566
|
+
# [THE FIX] Rename field to avoid shadowing Pydantic's .json() method
|
|
2567
|
+
# Use alias='json' to map from CLI argument --json automatically
|
|
2568
|
+
json_output: bool = Field(default=False, alias="json")
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
class LintRequest(BaseRequest):
|
|
2572
|
+
"""
|
|
2573
|
+
=================================================================================
|
|
2574
|
+
== THE SACRED PLEA OF ADJUDICATION (V-Ω-SENTINEL-PRIMED-ULTIMA++) ==
|
|
2575
|
+
=================================================================================
|
|
2576
|
+
LIF: 100x (SYSTEMIC ARCHITECTURAL PURITY)
|
|
2577
|
+
|
|
2578
|
+
The definitive contract for the 'lint' rite. It has been ascended to support
|
|
2579
|
+
surgical background scans, polyglot anti-pattern detection, and deep
|
|
2580
|
+
Sentinel CLI integration.
|
|
2581
|
+
=================================================================================
|
|
2582
|
+
"""
|
|
2583
|
+
|
|
2584
|
+
# --- I. THE SCOPE OF THE GAZE ---
|
|
2585
|
+
target_paths: List[str] = Field(
|
|
2586
|
+
default_factory=list,
|
|
2587
|
+
description="The specific scriptures or sanctums to audit. If empty, the Gaze is Universal."
|
|
2588
|
+
)
|
|
2589
|
+
|
|
2590
|
+
category: Optional[str] = Field(
|
|
2591
|
+
default=None,
|
|
2592
|
+
description="Limits the Inquest to a specific domain (e.g., 'security', 'topology', 'style')."
|
|
2593
|
+
)
|
|
2594
|
+
|
|
2595
|
+
# --- II. THE RIGOR OF THE LAW ---
|
|
2596
|
+
strict: bool = Field(
|
|
2597
|
+
default=False,
|
|
2598
|
+
description="If True, the Mentor treats Warnings as Critical Heresies (Exit Code > 0)."
|
|
2599
|
+
)
|
|
2600
|
+
|
|
2601
|
+
rules: List[str] = Field(
|
|
2602
|
+
default_factory=list,
|
|
2603
|
+
description="Specific Law IDs to enforce, bypassing the standard Grimoire."
|
|
2604
|
+
)
|
|
2605
|
+
|
|
2606
|
+
threshold: float = Field(
|
|
2607
|
+
default=0.7,
|
|
2608
|
+
description="The sensitivity of the Pattern Matcher (0.0 to 1.0). Lower is more paranoid."
|
|
2609
|
+
)
|
|
2610
|
+
|
|
2611
|
+
# --- III. THE KINETIC POTENTIAL ---
|
|
2612
|
+
fix: bool = Field(
|
|
2613
|
+
default=False,
|
|
2614
|
+
description="The Rite of Auto-Redemption. If True, the Mentor applies known cures immediately."
|
|
2615
|
+
)
|
|
2616
|
+
|
|
2617
|
+
# --- IV. THE DEPTH OF PERCEPTION ---
|
|
2618
|
+
depth: int = Field(
|
|
2619
|
+
default=1,
|
|
2620
|
+
description="The recursion depth for dependency graph and circularity analysis."
|
|
2621
|
+
)
|
|
2622
|
+
|
|
2623
|
+
audit_dependencies: bool = Field(
|
|
2624
|
+
default=False,
|
|
2625
|
+
description="If True, performs a forensic audit of external supply-chain souls."
|
|
2626
|
+
)
|
|
2627
|
+
|
|
2628
|
+
# --- V. THE TONGUE OF PROCLAMATION ---
|
|
2629
|
+
json_mode: bool = Field(
|
|
2630
|
+
default=False,
|
|
2631
|
+
description="The Primary machine-communion flag. Forces pure JSON output."
|
|
2632
|
+
)
|
|
2633
|
+
|
|
2634
|
+
json_output: bool = Field(
|
|
2635
|
+
default=False,
|
|
2636
|
+
description="Legacy alias for 'json' mode. Maintained for backward resonance."
|
|
2637
|
+
)
|
|
2638
|
+
|
|
2639
|
+
# --- VI. SENTINEL CLI PRIMING ---
|
|
2640
|
+
sentinel_mode: bool = Field(
|
|
2641
|
+
default=False,
|
|
2642
|
+
description="Activates high-performance mode for integration with the Sentinel God-Engine."
|
|
2643
|
+
)
|
|
2644
|
+
|
|
2645
|
+
@property
|
|
2646
|
+
def is_machine_readable(self) -> bool:
|
|
2647
|
+
"""Determines if the proclamation should be formatted for a Mind (JSON) or a Gaze (Rich)."""
|
|
2648
|
+
return self.json or self.json_output
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
class UndoRequest(HistoryRequest):
|
|
2653
|
+
"""
|
|
2654
|
+
A specific plea to reverse the last N transactions recorded in the Gnostic Ledger.
|
|
2655
|
+
Its purpose is one of action, a command to the Chronomancer to rewind time.
|
|
2656
|
+
"""
|
|
2657
|
+
steps: int = Field(1, description="The number of historical rites to reverse.")
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
class AsciiRequest(BaseRequest):
|
|
2661
|
+
"""
|
|
2662
|
+
A plea to transmute an image's soul into a luminous, injectable ASCII scripture.
|
|
2663
|
+
"""
|
|
2664
|
+
image_path: Optional[Path] = Field(None, description="The path to the source image file.")
|
|
2665
|
+
width: int = Field(default=80, description="The target width of the ASCII art in characters.")
|
|
2666
|
+
style: str = Field(default="color", description="The rendering style ('color', 'grayscale').")
|
|
2667
|
+
|
|
2668
|
+
# --- ASCENDED FACULTIES ---
|
|
2669
|
+
output: Optional[Path] = Field(None, description="Inscribe the output to a specific file path.")
|
|
2670
|
+
append_to: Optional[Path] = Field(None, description="Surgically append/replace the output in an existing file.")
|
|
2671
|
+
marker: str = Field(default="# SCAFFOLD_ASCII_SIGIL",
|
|
2672
|
+
description="The sacred marker to replace when using --append-to.")
|
|
2673
|
+
lang: str = Field(default="python", description="The output language ('python', 'js', 'raw').")
|
|
2674
|
+
var_name: str = Field(default="get_sigil", description="The variable or function name for the generated code.")
|
|
2675
|
+
no_function: bool = Field(False, description="If True, generates only the raw data structure, not a full function.")
|
|
2676
|
+
charset: str = Field(default="detailed",
|
|
2677
|
+
description="Character set for rendering ('block', 'detailed', 'simple', 'double').")
|
|
2678
|
+
invert: bool = Field(False, description="Invert the character ramp for dark backgrounds.")
|
|
2679
|
+
clipboard: bool = Field(False, description="Copy the output scripture to the system clipboard.")
|
|
2680
|
+
contrast: Optional[float] = Field(None, description="Enhance contrast by a factor (e.g., 1.5).")
|
|
2681
|
+
colors: Optional[int] = Field(None, description="Quantize the image to a specific number of colors.")
|
|
2682
|
+
|
|
2683
|
+
|
|
2684
|
+
class GnosisRequest(BaseRequest):
|
|
2685
|
+
"""A plea to discover the Gnostic Void of a blueprint."""
|
|
2686
|
+
blueprint_path: Path
|
|
2687
|
+
|
|
2688
|
+
|
|
2689
|
+
class HashRequest(BaseRequest):
|
|
2690
|
+
"""A plea to forge a cryptographic seal."""
|
|
2691
|
+
file_path: Path
|
|
2692
|
+
algo: str = "sha256"
|
|
2693
|
+
|
|
2694
|
+
|
|
2695
|
+
class DoctorRequest(BaseRequest):
|
|
2696
|
+
"""A plea to conduct a health inquest upon the local toolchain."""
|
|
2697
|
+
pass
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
class ChronicleRequest(BaseRequest):
|
|
2701
|
+
"""A plea to commune with the Gnostic Ledger of past rites."""
|
|
2702
|
+
chronicle_command: str
|
|
2703
|
+
transaction_id: Optional[str] = None
|
|
2704
|
+
|
|
2705
|
+
|
|
2706
|
+
class PackRequest(BaseRequest):
|
|
2707
|
+
"""A plea to encapsulate an archetype into a distributable vessel."""
|
|
2708
|
+
source_path: Path
|
|
2709
|
+
output: Optional[Path] = None
|
|
2710
|
+
|
|
2711
|
+
class BannerRequest(BaseRequest):
|
|
2712
|
+
"""A plea to forge a textual sigil."""
|
|
2713
|
+
text: str = "SCAFFOLD"
|
|
2714
|
+
font: str = "standard"
|
|
2715
|
+
output_path: Optional[str] = None
|
|
2716
|
+
|
|
2717
|
+
class UpgradeRequest(BaseRequest):
|
|
2718
|
+
"""A plea for the Phoenix Protocol."""
|
|
2719
|
+
from_template: str
|
|
2720
|
+
force: bool = False
|
|
2721
|
+
|
|
2722
|
+
class SeedRequest(BaseRequest):
|
|
2723
|
+
"""A plea for the Demiurge to populate the void."""
|
|
2724
|
+
count: int = 10
|
|
2725
|
+
output: str = "seed_data.json"
|
|
2726
|
+
|
|
2727
|
+
class CanonRequest(BaseRequest):
|
|
2728
|
+
"""A plea for the Canonizer to judge architectural purity."""
|
|
2729
|
+
rules_path: str = "scaffold.rules.yaml"
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
class VectorRequest(BaseRequest):
|
|
2733
|
+
"""
|
|
2734
|
+
=================================================================================
|
|
2735
|
+
== THE VESSEL OF SEMANTIC RECALL (V-Ω-HYBRID-RAG-ENABLED) ==
|
|
2736
|
+
=================================================================================
|
|
2737
|
+
@gnosis:title VectorRequest
|
|
2738
|
+
@gnosis:summary The unified command vessel for the Vector Cortex (RAG).
|
|
2739
|
+
@gnosis:LIF 1,000,000,000,000
|
|
2740
|
+
|
|
2741
|
+
This vessel is the plea to the Vector Librarian, capable of commanding the
|
|
2742
|
+
ingestion of reality (`index`), the cleansing of memory (`clear`), or the
|
|
2743
|
+
semantic inquiry of a query (`query`). It is now fully equipped with RAG
|
|
2744
|
+
control parameters.
|
|
2745
|
+
=================================================================================
|
|
2746
|
+
"""
|
|
2747
|
+
vector_command: str = Field(..., description="The rite to perform: 'index', 'query', or 'clear'.")
|
|
2748
|
+
query_text: Optional[str] = Field(None,
|
|
2749
|
+
description="The natural language concept to search for (required for 'query').")
|
|
2750
|
+
|
|
2751
|
+
# --- Indexing and Query Control ---
|
|
2752
|
+
target_dir: Optional[str] = Field(None, description="The directory to scan for indexing (default: project root).")
|
|
2753
|
+
limit: int = Field(5, description="The maximum number of semantic shards to retrieve.")
|
|
2754
|
+
threshold: float = Field(0.75, description="The minimum required cosine similarity score (0.0 to 1.0).")
|
|
2755
|
+
force_reindex: bool = Field(False, description="Forces a full scan and re-embed, bypassing the index cache.")
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
class DeployRequest(BaseRequest):
|
|
2759
|
+
"""
|
|
2760
|
+
A plea to the Celestial Forge to weave deployment scriptures.
|
|
2761
|
+
"""
|
|
2762
|
+
__gnostic_requirements__ = {"docker", "helm"} # Declares its needs
|
|
2763
|
+
|
|
2764
|
+
output_dir: str = "k8s"
|
|
2765
|
+
format: str = "helm"
|
|
2766
|
+
environment: str = "staging"
|
|
2767
|
+
tag: Optional[str] = None
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
class ProphesyRequest(BaseRequest):
|
|
2771
|
+
target_path: str = "."
|
|
2772
|
+
|
|
2773
|
+
class SecretsRequest(BaseRequest):
|
|
2774
|
+
action: str # rotate
|
|
2775
|
+
target: str = ".env"
|
|
2776
|
+
|
|
2777
|
+
class KeyringRequest(BaseRequest):
|
|
2778
|
+
keyring_command: str # list, add, remove
|
|
2779
|
+
key_id: Optional[str] = None
|
|
2780
|
+
key_file: Optional[Path] = None
|
|
2781
|
+
|
|
2782
|
+
class SBOMRequest(BaseRequest):
|
|
2783
|
+
output: str = "sbom.spdx.json"
|
|
2784
|
+
|
|
2785
|
+
class FreezeRequest(BaseRequest):
|
|
2786
|
+
"""A plea to forge the Dependency Time-Capsule."""
|
|
2787
|
+
deep: bool = Field(True, description="Ensures all dependencies are captured.")
|
|
2788
|
+
|
|
2789
|
+
|
|
2790
|
+
class HolographRequest(BaseRequest):
|
|
2791
|
+
"""A plea to forge the Environment Hologram."""
|
|
2792
|
+
output: Optional[str] = Field(None, description="The output path for the hologram.json file.")
|
|
2793
|
+
|
|
2794
|
+
class SignatureRequest(BaseRequest):
|
|
2795
|
+
"""A plea to manage the Architect's Fingerprint."""
|
|
2796
|
+
signature_command: str = Field(description="The rite to perform: 'learn' or 'verify'.")
|
|
2797
|
+
threshold: float = Field(0.7, description="The confidence threshold for verification.")
|
|
2798
|
+
|
|
2799
|
+
class SaveRequest(BaseRequest):
|
|
2800
|
+
"""A plea to the Neural Scribe to save the current work."""
|
|
2801
|
+
intent: str = Field(description="The high-level intent of the changes.")
|
|
2802
|
+
|
|
2803
|
+
class ReplRequest(BaseRequest):
|
|
2804
|
+
"""A plea to awaken the Polyglot Conduit."""
|
|
2805
|
+
pass
|
|
2806
|
+
|
|
2807
|
+
class BiomeRequest(BaseRequest):
|
|
2808
|
+
"""
|
|
2809
|
+
A plea to visualize the codebase as a living 3D terrain.
|
|
2810
|
+
"""
|
|
2811
|
+
target: str = "."
|
|
2812
|
+
port: int = 8080
|
|
2813
|
+
theme: str = "cyberpunk" # cyberpunk, synthwave, engineering
|
|
2814
|
+
threshold_complexity: int = 10 # Height scale factor
|
|
2815
|
+
threshold_churn: int = 50 # Heat scale factor
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
class ResonateRequest(BaseRequest):
|
|
2819
|
+
query: str
|
|
2820
|
+
limit: int = 5
|
|
2821
|
+
reindex: bool = False
|
|
2822
|
+
|
|
2823
|
+
|
|
2824
|
+
class MRIRequest(BaseRequest):
|
|
2825
|
+
pass
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
class GhostRequest(BaseRequest):
|
|
2829
|
+
exorcise: bool = False
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
class BusFactorRequest(BaseRequest):
|
|
2833
|
+
"""
|
|
2834
|
+
A plea to calculate the fragility of knowledge distribution.
|
|
2835
|
+
"""
|
|
2836
|
+
threshold: float = 0.7 # Sensitivity (0.0 to 1.0)
|
|
2837
|
+
limit: int = 10 # Show top N risks
|
|
2838
|
+
|
|
2839
|
+
|
|
2840
|
+
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
class BridgeRequest(BaseRequest):
|
|
2844
|
+
"""A plea to forge a link between two tongues (FFI)."""
|
|
2845
|
+
source_lang: str = "rust"
|
|
2846
|
+
target_lang: str = "python"
|
|
2847
|
+
entry_point: str # Path to the struct/class to bridge
|
|
2848
|
+
|
|
2849
|
+
class IsolateRequest(BaseRequest):
|
|
2850
|
+
"""A plea to execute a command within a hermetic security ward."""
|
|
2851
|
+
command_to_run: str
|
|
2852
|
+
allow_hosts: List[str] = ["pypi.org", "files.pythonhosted.org", "registry.npmjs.org"]
|
|
2853
|
+
audit_only: bool = False
|
|
2854
|
+
|
|
2855
|
+
class ChaosGameRequest(BaseRequest):
|
|
2856
|
+
"""A plea to initiate the Gamified Resilience Loop."""
|
|
2857
|
+
interval: int = 1800 # seconds (30 mins)
|
|
2858
|
+
lives: int = 3
|
|
2859
|
+
mode: str = "standard" # standard, hardcore (no git recovery)
|
|
2860
|
+
|
|
2861
|
+
class TranslateRequest(BaseRequest):
|
|
2862
|
+
"""A plea to transmute the soul of code from one tongue to another."""
|
|
2863
|
+
source_path: str
|
|
2864
|
+
target_lang: str
|
|
2865
|
+
source_lang: str = "auto"
|
|
2866
|
+
|
|
2867
|
+
|
|
2868
|
+
class OptimizeCIRequest(BaseRequest):
|
|
2869
|
+
"""
|
|
2870
|
+
A plea for the CI pipeline to rewrite its own DNA based on past performance.
|
|
2871
|
+
"""
|
|
2872
|
+
workflow_path: str = ".github/workflows/main.yml"
|
|
2873
|
+
stats_file: Optional[str] = None # JSON file with step durations
|
|
2874
|
+
strategy: str = "aggressive" # aggressive (sharding), conservative (caching)
|
|
2875
|
+
|
|
2876
|
+
|
|
2877
|
+
class HolographicBlueprintRequest(BaseRequest):
|
|
2878
|
+
"""
|
|
2879
|
+
A plea to digitize a physical project into a pure .scaffold scripture.
|
|
2880
|
+
"""
|
|
2881
|
+
target_dir: str = "."
|
|
2882
|
+
output_file: str = "hologram.scaffold"
|
|
2883
|
+
full_fidelity: bool = True # Include all content, not just structure
|
|
2884
|
+
|
|
2885
|
+
|
|
2886
|
+
class SemanticMountRequest(BaseRequest):
|
|
2887
|
+
"""
|
|
2888
|
+
A plea to mount the project's Gnostic Soul as a virtual filesystem.
|
|
2889
|
+
"""
|
|
2890
|
+
mount_point: str
|
|
2891
|
+
foreground: bool = True
|
|
2892
|
+
|
|
2893
|
+
|
|
2894
|
+
class TelepathyRequest(BaseRequest):
|
|
2895
|
+
"""
|
|
2896
|
+
A plea to awaken the Clipboard Sentinel.
|
|
2897
|
+
"""
|
|
2898
|
+
auto_format: bool = True
|
|
2899
|
+
save_dir: str = "snippets"
|
|
2900
|
+
|
|
2901
|
+
|
|
2902
|
+
class OptimizeBlueprintRequest(BaseRequest):
|
|
2903
|
+
"""
|
|
2904
|
+
A plea for the Blueprint to evolve based on historical usage patterns.
|
|
2905
|
+
"""
|
|
2906
|
+
target_blueprint: str = "scaffold.scaffold"
|
|
2907
|
+
threshold: float = 0.9 # 90% consistency required to trigger mutation
|
|
2908
|
+
auto_apply: bool = False
|
|
2909
|
+
|
|
2910
|
+
|
|
2911
|
+
class MuseRequest(BaseRequest):
|
|
2912
|
+
"""
|
|
2913
|
+
A plea for the Engine to prophesy the next logical step.
|
|
2914
|
+
"""
|
|
2915
|
+
context_file: Optional[str] = None # The file you just touched/created
|
|
2916
|
+
threshold: float = 0.3 # Minimum confidence to speak
|
|
2917
|
+
auto_draft: bool = False # If True, creates the file as .draft
|
|
2918
|
+
|
|
2919
|
+
|
|
2920
|
+
class SemDiffRequest(BaseRequest):
|
|
2921
|
+
"""
|
|
2922
|
+
A plea to perceive the semantic divergence between two realities.
|
|
2923
|
+
"""
|
|
2924
|
+
target: str = "." # File or Directory
|
|
2925
|
+
reference: str = "HEAD" # Git ref (HEAD, main, commit_hash)
|
|
2926
|
+
format: str = "table" # table, json
|
|
2927
|
+
|
|
2928
|
+
|
|
2929
|
+
class ForgeArtisanRequest(BaseRequest):
|
|
2930
|
+
"""
|
|
2931
|
+
A plea to forge a new Artisan class and its Gnostic kin.
|
|
2932
|
+
"""
|
|
2933
|
+
artisan_name: str # e.g., "deploy" or "database_migrate"
|
|
2934
|
+
description: str = "A new artisan for the Scaffold cosmos."
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
class LintBlueprintRequest(BaseRequest):
|
|
2938
|
+
"""
|
|
2939
|
+
A plea to verify the structural purity of a .scaffold scripture.
|
|
2940
|
+
"""
|
|
2941
|
+
target: str # Path to the blueprint file
|
|
2942
|
+
|
|
2943
|
+
|
|
2944
|
+
class MockRequest(BaseRequest):
|
|
2945
|
+
"""
|
|
2946
|
+
A plea to materialize a temporary reality for testing purposes.
|
|
2947
|
+
"""
|
|
2948
|
+
spec: str # e.g., "src/main.py,tests/test_main.py,README.md"
|
|
2949
|
+
root: Optional[str] = None # Override target dir
|
|
2950
|
+
|
|
2951
|
+
|
|
2952
|
+
class GuiRequest(BaseRequest):
|
|
2953
|
+
"""
|
|
2954
|
+
A plea to summon the Ephemeral Command Palette.
|
|
2955
|
+
"""
|
|
2956
|
+
initial_filter: Optional[str] = None # Pre-fill the search box
|
|
2957
|
+
|
|
2958
|
+
|
|
2959
|
+
class ExposeRequest(BaseRequest):
|
|
2960
|
+
"""
|
|
2961
|
+
A plea to open a wormhole to the internet.
|
|
2962
|
+
"""
|
|
2963
|
+
port: int
|
|
2964
|
+
provider: str = "localhost.run" # or 'serveo'
|
|
2965
|
+
subdomain: Optional[str] = None
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
class SgrepRequest(BaseRequest):
|
|
2969
|
+
"""
|
|
2970
|
+
A plea for Semantic Search.
|
|
2971
|
+
"""
|
|
2972
|
+
pattern: str
|
|
2973
|
+
type: str = "any" # function, class, variable, import
|
|
2974
|
+
show_code: bool = True
|
|
2975
|
+
|
|
2976
|
+
|
|
2977
|
+
|
|
2978
|
+
|
|
2979
|
+
class AliasRequest(BaseRequest):
|
|
2980
|
+
"""
|
|
2981
|
+
A plea to manage the Grimoire of Shortcuts.
|
|
2982
|
+
"""
|
|
2983
|
+
alias_command: str # add, list, remove
|
|
2984
|
+
name: Optional[str] = None
|
|
2985
|
+
expansion: Optional[str] = None
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
class QRRequest(BaseRequest):
|
|
2989
|
+
"""
|
|
2990
|
+
A plea to open a visual portal to the local sanctum.
|
|
2991
|
+
"""
|
|
2992
|
+
port: int
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
class ContextFreezeRequest(BaseRequest):
|
|
2996
|
+
"""
|
|
2997
|
+
A plea to snapshot the current environmental state for debugging.
|
|
2998
|
+
"""
|
|
2999
|
+
output_file: Optional[str] = "debug_context.json"
|
|
3000
|
+
include_env: bool = False # Include safe env vars?
|
|
3001
|
+
|
|
3002
|
+
|
|
3003
|
+
class BenchRequest(BaseRequest):
|
|
3004
|
+
"""
|
|
3005
|
+
A plea to gauge the vitality of the host machine.
|
|
3006
|
+
"""
|
|
3007
|
+
suites: List[str] = Field(default_factory=lambda: ["cpu", "disk", "net"])
|
|
3008
|
+
|
|
3009
|
+
|
|
3010
|
+
class PurgeRequest(BaseRequest):
|
|
3011
|
+
"""
|
|
3012
|
+
A plea to annihilate generated artifacts (node_modules, venv, etc).
|
|
3013
|
+
"""
|
|
3014
|
+
target: str = "."
|
|
3015
|
+
dry_run: bool = False
|
|
3016
|
+
force: bool = False
|
|
3017
|
+
threshold_mb: int = 0 # Only show/delete if larger than X MB
|
|
3018
|
+
|
|
3019
|
+
|
|
3020
|
+
class MatrixRequest(BaseRequest):
|
|
3021
|
+
"""
|
|
3022
|
+
A plea to visualize the dependency graph and version conflicts.
|
|
3023
|
+
"""
|
|
3024
|
+
scope: str = "all" # all, production, dev
|
|
3025
|
+
format: str = "table" # table, json, tree
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
class TodoRequest(BaseRequest):
|
|
3029
|
+
"""
|
|
3030
|
+
A plea to harvest technical debt markers from the codebase.
|
|
3031
|
+
"""
|
|
3032
|
+
path: str = "."
|
|
3033
|
+
author: Optional[str] = None # Filter by git author
|
|
3034
|
+
format: str = "table" # table, json, csv
|
|
3035
|
+
blame: bool = True # Enable git blame lookup (slower)
|
|
3036
|
+
|
|
3037
|
+
|
|
3038
|
+
|
|
3039
|
+
class WithSecretsRequest(BaseRequest):
|
|
3040
|
+
"""
|
|
3041
|
+
A plea to conduct a rite within a sanctum of ephemeral secrets.
|
|
3042
|
+
"""
|
|
3043
|
+
provider: str = "1password"
|
|
3044
|
+
secrets: List[str] = Field(..., description="List of secret keys or references to fetch.")
|
|
3045
|
+
command: List[str] = Field(..., description="The command to execute with the injected secrets.")
|
|
3046
|
+
|
|
3047
|
+
|
|
3048
|
+
# --- NEW REALITY: THE ASTROLABE ---
|
|
3049
|
+
class AstrolabeRequest(BaseRequest):
|
|
3050
|
+
"""A plea to open the Tree-sitter Workbench."""
|
|
3051
|
+
target_file: str
|
|
3052
|
+
|
|
3053
|
+
# --- NEW REALITY: THE WATCHMAN ---
|
|
3054
|
+
class WatchmanRequest(BaseRequest):
|
|
3055
|
+
"""A plea to set a vigil on the filesystem."""
|
|
3056
|
+
glob_pattern: str
|
|
3057
|
+
command_to_run: str
|
|
3058
|
+
debounce: float = 0.5
|
|
3059
|
+
|
|
3060
|
+
# --- NEW REALITY: THE AUDITOR ---
|
|
3061
|
+
class AuditRequest(BaseRequest):
|
|
3062
|
+
"""A plea to audit covenants (licenses)."""
|
|
3063
|
+
audit_target: str = "licenses" # Future expansion: 'security', 'quality'
|
|
3064
|
+
fail_on_heresy: bool = False
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
class NeuralRequest(BaseRequest):
|
|
3068
|
+
"""
|
|
3069
|
+
A plea to enter the Synaptic Console for AI management.
|
|
3070
|
+
"""
|
|
3071
|
+
command: str = "manage" # manage, test, list
|
|
3072
|
+
|
|
3073
|
+
class MountRequest(BaseRequest):
|
|
3074
|
+
"""
|
|
3075
|
+
=============================================================================
|
|
3076
|
+
== THE PLEA OF THE REALITY BINDER ==
|
|
3077
|
+
=============================================================================
|
|
3078
|
+
A plea to mount the Gnostic Cortex as a virtual filesystem, making the
|
|
3079
|
+
project's semantic soul tangible in the mortal realm.
|
|
3080
|
+
"""
|
|
3081
|
+
mount_point: str = Field(
|
|
3082
|
+
"gnostic_fs",
|
|
3083
|
+
description="The local directory path to materialize the virtual filesystem."
|
|
3084
|
+
)
|
|
3085
|
+
|
|
3086
|
+
|
|
3087
|
+
|
|
3088
|
+
class ToolRequest(BaseRequest):
|
|
3089
|
+
"""
|
|
3090
|
+
=================================================================================
|
|
3091
|
+
== THE UNIVERSAL GATEWAY VESSEL (V-Ω-ETERNAL-POLYMORPH) ==
|
|
3092
|
+
=================================================================================
|
|
3093
|
+
The polymorphic soul of the `tool` command. It is a union of all possible
|
|
3094
|
+
arguments for every specialist tool artisan, allowing the ToolArtisan conductor
|
|
3095
|
+
to perform its sacred Gnostic Triage.
|
|
3096
|
+
=================================================================================
|
|
3097
|
+
"""
|
|
3098
|
+
# The Core Triage Key
|
|
3099
|
+
tool_command: str = Field(description="The specific tool rite to conduct (e.g., 'sbom', 'hash').")
|
|
3100
|
+
|
|
3101
|
+
# --- Gnosis for the `ascii` Scribe ---
|
|
3102
|
+
image_path: Optional[Path] = Field(None, description="Path to the source image for ASCII transmutation.")
|
|
3103
|
+
width: int = Field(80, description="The target width of the ASCII art in characters.")
|
|
3104
|
+
charset: str = Field("detailed", description="The character set to use for rendering.")
|
|
3105
|
+
style: str = Field("color", description="The rendering style ('color' or 'mono').")
|
|
3106
|
+
invert: bool = Field(False, description="Invert the luminosity for the character map.")
|
|
3107
|
+
contrast: Optional[float] = Field(None, description="Apply a contrast enhancement factor.")
|
|
3108
|
+
colors: Optional[int] = Field(None, description="Quantize the image to a specific number of colors.")
|
|
3109
|
+
lang: str = Field("python", description="The output language for the generated scripture ('python', 'js', 'raw').")
|
|
3110
|
+
var_name: str = Field("get_sigil", description="The variable or function name for the generated scripture.")
|
|
3111
|
+
no_function: bool = Field(False, description="Output a raw variable assignment instead of a function.")
|
|
3112
|
+
clipboard: bool = Field(False, description="Copy the output scripture to the clipboard instead of printing.")
|
|
3113
|
+
append_to: Optional[Path] = Field(None, description="Path to a file where the output should be grafted.")
|
|
3114
|
+
marker: str = Field("# GNOSTIC_SIGIL_INJECTION", description="The marker to find for the Alchemical Graft.")
|
|
3115
|
+
|
|
3116
|
+
# --- Gnosis for the `banner` Herald ---
|
|
3117
|
+
text: Optional[str] = Field(None, description="The text to render as a banner.")
|
|
3118
|
+
font: Optional[str] = Field(None, description="The Figlet font to use for the banner.")
|
|
3119
|
+
output_path: Optional[str] = Field(None, description="The file path to save the banner to.")
|
|
3120
|
+
|
|
3121
|
+
# --- Gnosis for the `hash` Sealer ---
|
|
3122
|
+
file_path: Optional[Path] = Field(None, description="The path to the file to be hashed.")
|
|
3123
|
+
algo: str = Field("sha256", description="The hashing algorithm to use (e.g., 'sha256', 'md5').")
|
|
3124
|
+
|
|
3125
|
+
# --- Gnosis for the `keyring` Keeper ---
|
|
3126
|
+
keyring_command: Optional[str] = Field(None, description="The keyring rite to perform ('list', 'add').")
|
|
3127
|
+
key_file: Optional[Path] = Field(None, description="Path to the public key file to add.")
|
|
3128
|
+
|
|
3129
|
+
# --- Gnosis for the `pack` Architect ---
|
|
3130
|
+
source_path: Optional[Path] = Field(None, description="The source directory of the archetype to pack.")
|
|
3131
|
+
# `output_path` is already defined for `banner`
|
|
3132
|
+
|
|
3133
|
+
# --- Gnosis for the `sbom` Scribe ---
|
|
3134
|
+
output: Optional[str] = Field("sbom.spdx.json", description="The output file for the Software Bill of Materials.")
|
|
3135
|
+
|
|
3136
|
+
# --- Gnosis for the `secrets` Keymaster ---
|
|
3137
|
+
action: Optional[str] = Field(None, description="The secret management action to perform ('rotate').")
|
|
3138
|
+
target: Optional[str] = Field(".env", description="The target .env file for secret operations.")
|
|
3139
|
+
|
|
3140
|
+
|
|
3141
|
+
class ReadSoulRequest(BaseRequest):
|
|
3142
|
+
"""A plea to read the raw content of a single scripture."""
|
|
3143
|
+
path_to_scripture: str
|
|
3144
|
+
|
|
3145
|
+
class QueryRequest(BaseRequest):
|
|
3146
|
+
"""
|
|
3147
|
+
A plea to the Gnostic Emissary, now ascended to carry a pure, structured
|
|
3148
|
+
Gnostic plea instead of a profane string.
|
|
3149
|
+
"""
|
|
3150
|
+
query: Dict[str, Any] # ★★★ THE APOTHEOSIS ★★★
|
|
3151
|
+
json_output: bool = Field(False, alias='json')
|
|
3152
|
+
|
|
3153
|
+
|
|
3154
|
+
class ArchitectRequest(BaseRequest):
|
|
3155
|
+
"""
|
|
3156
|
+
A plea to the Gnostic Architect.
|
|
3157
|
+
"""
|
|
3158
|
+
prompt: str
|
|
3159
|
+
"""The natural language intent (e.g., 'Add a user authentication module')."""
|
|
3160
|
+
|
|
3161
|
+
interactive: bool = True
|
|
3162
|
+
"""Whether to engage in a confirmation dialogue before materialization."""
|
|
3163
|
+
|
|
3164
|
+
class ChangelogRequest(BaseRequest):
|
|
3165
|
+
"""A plea to the Chronicle Scribe."""
|
|
3166
|
+
from_ref: Optional[str] = Field(None, description="The Git ref (tag, commit) to start the changelog from. Defaults to the latest tag.")
|
|
3167
|
+
next_version: Optional[str] = Field(None, description="The version number to use for the new changelog entry.")
|
|
3168
|
+
output_file: str = Field("CHANGELOG.md", description="The path to the changelog file to update.")
|
|
3169
|
+
|
|
3170
|
+
|
|
3171
|
+
class IgnoreRequest(BaseRequest):
|
|
3172
|
+
"""A plea to the Gatekeeper of Aversion."""
|
|
3173
|
+
templates: List[str] = Field(default_factory=list, description="List of gitignore.io templates to fetch.")
|
|
3174
|
+
append: bool = Field(False, description="If true, appends to the existing .gitignore instead of overwriting.")
|
|
3175
|
+
|
|
3176
|
+
|
|
3177
|
+
class SnippetRequest(BaseRequest):
|
|
3178
|
+
"""A plea to the Fragment Keeper."""
|
|
3179
|
+
snippet_command: str = Field(..., description="The rite to perform (list, save, load, delete).")
|
|
3180
|
+
name: Optional[str] = Field(None, description="The sacred name of the snippet.")
|
|
3181
|
+
source_file: Optional[str] = Field(None, description="Path to a file to save as a snippet.")
|
|
3182
|
+
clipboard: bool = Field(False, description="Use the system clipboard as the source or destination.")
|
|
3183
|
+
|
|
3184
|
+
|
|
3185
|
+
class ArchitecturalAuditRequest(BaseRequest):
|
|
3186
|
+
"""A plea to the Gnostic Adjudicator to verify architectural laws."""
|
|
3187
|
+
audit_target: str = Field(default="arch", description="The specific audit to run.")
|
|
3188
|
+
|
|
3189
|
+
class AgentRequest(BaseRequest):
|
|
3190
|
+
"""
|
|
3191
|
+
=============================================================================
|
|
3192
|
+
== THE VESSEL OF AGENCY (V-Ω-AUTONOMOUS-MISSION-ASCENDED) ==
|
|
3193
|
+
=============================================================================
|
|
3194
|
+
Carries the Architect's high-level mission for the autonomous Agent,
|
|
3195
|
+
now with a vow of interactivity to enable the Guardian's Veto.
|
|
3196
|
+
"""
|
|
3197
|
+
mission: str = Field(..., description="The natural language mission for the Agent to accomplish.")
|
|
3198
|
+
interactive: bool = Field(True, description="If True, the Agent will pause for the Architect's approval before executing a plan.")
|
|
3199
|
+
|
|
3200
|
+
|
|
3201
|
+
# In interfaces/requests.py
|
|
3202
|
+
# Modify the ScribeRequest class
|
|
3203
|
+
|
|
3204
|
+
class ScribeRequest(BaseRequest):
|
|
3205
|
+
"""
|
|
3206
|
+
=============================================================================
|
|
3207
|
+
== THE VESSEL OF PROPHECY (V-Ω-POLYGLOT-ASCENDED) ==
|
|
3208
|
+
=============================================================================
|
|
3209
|
+
Carries the Architect's architectural plea to the Scribe Pantheon, now with
|
|
3210
|
+
the Gnosis to specify which sacred tongue the prophecy should be written in.
|
|
3211
|
+
"""
|
|
3212
|
+
plea: str = Field(..., description="The natural language architectural intent to be transmuted into a scripture.")
|
|
3213
|
+
|
|
3214
|
+
# --- THE ASCENSION: THE VOW OF TONGUES ---
|
|
3215
|
+
language: str = Field(
|
|
3216
|
+
"scaffold",
|
|
3217
|
+
description="The sacred tongue of the prophecy: 'scaffold' (Form), 'symphony' (Will), or 'arch' (Unified Monad)."
|
|
3218
|
+
)
|
|
3219
|
+
# -----------------------------------------
|
|
3220
|
+
|
|
3221
|
+
output_path: Optional[str] = Field(None, description="Optional path to save the generated scripture.")
|
|
3222
|
+
interactive: bool = Field(True,
|
|
3223
|
+
description="If true, the Scribe will offer to execute the scripture after forging it.")
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
class TrainRequest(BaseRequest):
|
|
3227
|
+
"""
|
|
3228
|
+
=============================================================================
|
|
3229
|
+
== THE VESSEL OF ASCENSION (V-Ω-MODEL-TRAINING) ==
|
|
3230
|
+
=============================================================================
|
|
3231
|
+
Carries the Architect's will to fine-tune an AI model upon a corpus of Gnosis.
|
|
3232
|
+
"""
|
|
3233
|
+
# Source of Wisdom
|
|
3234
|
+
corpus_path: str = Field(".", description="Path to the source code or documents to learn from.")
|
|
3235
|
+
|
|
3236
|
+
# The Student
|
|
3237
|
+
base_model: str = Field("unsloth/llama-3-8b-bnb-4bit", description="The base model to fine-tune (HuggingFace ID).")
|
|
3238
|
+
|
|
3239
|
+
# The New Identity
|
|
3240
|
+
output_model_name: str = Field("scaffold-lora-v1", description="The name of the resulting adapter/model.")
|
|
3241
|
+
|
|
3242
|
+
# Training Parameters
|
|
3243
|
+
provider: str = Field("huggingface", description="The training backend (huggingface, ollama, vertex).")
|
|
3244
|
+
epochs: int = Field(1, description="Number of training cycles.")
|
|
3245
|
+
batch_size: int = Field(2, description="Training batch size.")
|
|
3246
|
+
learning_rate: float = Field(2e-4, description="The rate of synaptic plasticity.")
|
|
3247
|
+
|
|
3248
|
+
# Synthetic Data Generation
|
|
3249
|
+
generate_instructions: bool = Field(True, description="Use the AIEngine to hallucinate instructions for raw code.")
|
|
3250
|
+
limit_samples: Optional[int] = Field(None, description="Limit the number of training samples (for testing).")
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
class DataRequest(BaseRequest):
|
|
3254
|
+
"""
|
|
3255
|
+
A plea to the Alchemist of State.
|
|
3256
|
+
Manages the fluid essence of the application (Database & State).
|
|
3257
|
+
"""
|
|
3258
|
+
data_command: Literal["clone", "snapshot", "seed"] = Field(
|
|
3259
|
+
..., description="The specific alchemical rite to perform."
|
|
3260
|
+
)
|
|
3261
|
+
source: Optional[str] = Field(None, description="Source connection string or path.")
|
|
3262
|
+
destination: Optional[str] = Field(None, description="Destination path.")
|
|
3263
|
+
snapshot_name: Optional[str] = Field(None, description="Name of the state freeze.")
|
|
3264
|
+
anonymize: bool = Field(True, description="If True, masks PII during cloning.")
|
|
3265
|
+
|
|
3266
|
+
|
|
3267
|
+
class CodexRequest(BaseRequest):
|
|
3268
|
+
"""
|
|
3269
|
+
A plea to the Living Wiki.
|
|
3270
|
+
Forges self-verifying documentation and architectural maps.
|
|
3271
|
+
"""
|
|
3272
|
+
codex_command: Literal["build", "verify", "cartography"] = Field(
|
|
3273
|
+
..., description="The rite of documentation."
|
|
3274
|
+
)
|
|
3275
|
+
output_dir: str = Field("docs", description="Target directory for the Codex.")
|
|
3276
|
+
serve: bool = Field(False, description="If True, serves the Codex locally after building.")
|
|
3277
|
+
|
|
3278
|
+
|
|
3279
|
+
class ReviewRequest(BaseRequest):
|
|
3280
|
+
"""
|
|
3281
|
+
A plea to the Sentinel's Tribunal.
|
|
3282
|
+
AI-driven adjudication of code changes before they enter the Chronicle.
|
|
3283
|
+
"""
|
|
3284
|
+
review_command: Literal["adjudicate"] = "adjudicate"
|
|
3285
|
+
socratic_mode: bool = Field(
|
|
3286
|
+
False,
|
|
3287
|
+
description="If True, the AI asks guiding questions instead of flagging errors."
|
|
3288
|
+
)
|
|
3289
|
+
focus_files: Optional[List[str]] = Field(None, description="Specific files to review (defaults to staged).")
|
|
3290
|
+
|
|
3291
|
+
class LFGRequest(BaseRequest):
|
|
3292
|
+
"""
|
|
3293
|
+
A plea to the Logic Flow Graph Engine.
|
|
3294
|
+
Requests the visualization of control flow within a Blueprint or Source Code.
|
|
3295
|
+
"""
|
|
3296
|
+
target: str = Field(..., description="The path to the blueprint (.scaffold/.symphony) or source code file/directory.")
|
|
3297
|
+
mode: Literal["blueprint", "codebase"] = Field("blueprint", description="The mode of perception.")
|
|
3298
|
+
format: Literal["mermaid", "json"] = Field("mermaid", description="The output format.")
|
|
3299
|
+
output_path: Optional[str] = Field(None, description="Where to inscribe the graph.")
|
|
3300
|
+
|
|
3301
|
+
class AkashaRequest(BaseRequest):
|
|
3302
|
+
"""
|
|
3303
|
+
A plea to the Global Memory of the Cosmos.
|
|
3304
|
+
"""
|
|
3305
|
+
akasha_command: Literal["query", "stats", "purge", "learn"] = Field(
|
|
3306
|
+
..., description="The rite to perform on the global memory."
|
|
3307
|
+
)
|
|
3308
|
+
query: Optional[str] = Field(None, description="The natural language query for wisdom recall.")
|
|
3309
|
+
source_path: Optional[str] = Field(None, description="Path to a file or directory to manually enshrine.")
|
|
3310
|
+
|
|
3311
|
+
|
|
3312
|
+
class GuildRequest(BaseRequest):
|
|
3313
|
+
"""
|
|
3314
|
+
A plea to the Guild Nexus.
|
|
3315
|
+
Manages the federation of Gnosis across the cosmos.
|
|
3316
|
+
"""
|
|
3317
|
+
guild_command: Literal["publish", "join", "update", "list"] = Field(
|
|
3318
|
+
..., description="The rite of federation."
|
|
3319
|
+
)
|
|
3320
|
+
target: Optional[str] = Field(None, description="The archetype to publish or the guild URI to join.")
|
|
3321
|
+
name: Optional[str] = Field(None, description="The alias for the guild subscription (e.g. '@my-team').")
|
|
3322
|
+
|
|
3323
|
+
|
|
3324
|
+
class MimicRequest(BaseRequest):
|
|
3325
|
+
"""
|
|
3326
|
+
A plea to the Simulacrum.
|
|
3327
|
+
Materializes an ephemeral API from a static type definition.
|
|
3328
|
+
"""
|
|
3329
|
+
source_path: str = Field(...,
|
|
3330
|
+
description="The path to the source definition (Pydantic model, SQL schema, or TS Interface).")
|
|
3331
|
+
port: int = Field(8000, description="The port to bind the ephemeral reality to.")
|
|
3332
|
+
framework: Literal["fastapi", "express"] = Field("fastapi", description="The soul of the mock server.")
|
|
3333
|
+
watch: bool = Field(True, description="If True, regenerates the simulacrum when the source changes.")
|
|
3334
|
+
|
|
3335
|
+
|
|
3336
|
+
class FusionRequest(BaseRequest):
|
|
3337
|
+
"""
|
|
3338
|
+
A plea to the Fusion Core.
|
|
3339
|
+
NOW ASCENDED: Handles both Cache Management (Legacy) and Compilation (New).
|
|
3340
|
+
"""
|
|
3341
|
+
# Expanded commands to include build rites
|
|
3342
|
+
fusion_command: Literal["list", "clean", "bind", "compile"] = Field(
|
|
3343
|
+
..., description="The fusion rite to perform."
|
|
3344
|
+
)
|
|
3345
|
+
# New fields for the Builder
|
|
3346
|
+
source: Optional[str] = Field(None, description="The source file (e.g., 'src/fast_math.rs').")
|
|
3347
|
+
target_lang: Literal["python", "node"] = Field("python", description="The host language to bind into.")
|
|
3348
|
+
output_dir: Optional[str] = Field(None, description="Where to place the compiled artifact.")
|
|
3349
|
+
|
|
3350
|
+
|
|
3351
|
+
"""
|
|
3352
|
+
=================================================================================
|
|
3353
|
+
== THE KINETIC SHADOW REQUEST (V-Ω-TOTALITY-FINAL-V21-SINGULARITY) ==
|
|
3354
|
+
=================================================================================
|
|
3355
|
+
This scripture defines the 'Will of the Architect' for materializing a
|
|
3356
|
+
parallel, functional, and rendered reality within the Shadow Dimension.
|
|
3357
|
+
=================================================================================
|
|
3358
|
+
"""
|
|
3359
|
+
|
|
3360
|
+
|
|
3361
|
+
# ==============================================================================
|
|
3362
|
+
# == THE SHADOW CLONE SCHEMA (V-Ω-TOTALITY-V100) ==
|
|
3363
|
+
# ==============================================================================
|
|
3364
|
+
|
|
3365
|
+
class ShadowCommand(str, Enum):
|
|
3366
|
+
"""The Verbs of Reality Manipulation."""
|
|
3367
|
+
SPAWN = "spawn" # Create a new reality
|
|
3368
|
+
VANISH = "vanish" # Destroy a reality
|
|
3369
|
+
LIST = "list" # Census
|
|
3370
|
+
STATUS = "status" # Health check
|
|
3371
|
+
LOGS = "logs" # Forensic read
|
|
3372
|
+
HIBERNATE = "hibernate" # Freeze state
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
class CloneStrategy(str, Enum):
|
|
3376
|
+
"""The Physics of Materialization."""
|
|
3377
|
+
GIT_WORKTREE = "git_worktree" # Fast, requires clean git state
|
|
3378
|
+
PHYSICAL_COPY = "physical_copy" # Robust, slower, works on dirty state
|
|
3379
|
+
HYBRID = "hybrid" # Try Worktree, fallback to Copy
|
|
3380
|
+
|
|
3381
|
+
|
|
3382
|
+
class ShadowCloneRequest(BaseRequest):
|
|
3383
|
+
"""
|
|
3384
|
+
=============================================================================
|
|
3385
|
+
== THE SHADOW REQUEST (V-Ω-CONTRACT-ASCENDED) ==
|
|
3386
|
+
=============================================================================
|
|
3387
|
+
LIF: 10,000,000,000 | The Immutable Law of Fission.
|
|
3388
|
+
Defines exactly how a parallel reality should be forged.
|
|
3389
|
+
"""
|
|
3390
|
+
model_config = ConfigDict(extra='ignore', arbitrary_types_allowed=True)
|
|
3391
|
+
|
|
3392
|
+
# --- 1. THE VERB (INTENT) ---
|
|
3393
|
+
shadow_command: ShadowCommand = Field(
|
|
3394
|
+
...,
|
|
3395
|
+
description="The rite to perform on the Shadow Realm."
|
|
3396
|
+
)
|
|
3397
|
+
|
|
3398
|
+
# --- 2. THE ANCHOR (LOCATION) ---
|
|
3399
|
+
# Inherited from BaseRequest, but we add a validator to handle 'cwd' alias
|
|
3400
|
+
# project_root: str
|
|
3401
|
+
|
|
3402
|
+
# --- 3. THE IDENTITY (NAMING) ---
|
|
3403
|
+
label: str = Field(
|
|
3404
|
+
default="experiment",
|
|
3405
|
+
pattern=r"^[a-zA-Z0-9_\-]+$",
|
|
3406
|
+
description="Human-readable tag for this reality (e.g. 'feature-x')."
|
|
3407
|
+
)
|
|
3408
|
+
|
|
3409
|
+
target_ref: str = Field(
|
|
3410
|
+
default="HEAD",
|
|
3411
|
+
description="Git reference (branch/hash) to clone from."
|
|
3412
|
+
)
|
|
3413
|
+
|
|
3414
|
+
target_id: Optional[str] = Field(
|
|
3415
|
+
default=None,
|
|
3416
|
+
description="Specific Shadow ID to target for Vanish/Status rites."
|
|
3417
|
+
)
|
|
3418
|
+
|
|
3419
|
+
owner: str = Field(
|
|
3420
|
+
default="architect",
|
|
3421
|
+
description="The entity responsible for this reality."
|
|
3422
|
+
)
|
|
3423
|
+
|
|
3424
|
+
# --- 4. THE PHYSICS (CONFIGURATION) ---
|
|
3425
|
+
strategy: CloneStrategy = Field(
|
|
3426
|
+
default=CloneStrategy.HYBRID,
|
|
3427
|
+
description="The method of materialization."
|
|
3428
|
+
)
|
|
3429
|
+
|
|
3430
|
+
|
|
3431
|
+
port: int = Field(
|
|
3432
|
+
default=0,
|
|
3433
|
+
ge=0,
|
|
3434
|
+
le=65535,
|
|
3435
|
+
description="The port to bind. 0 = Divine a free port automatically."
|
|
3436
|
+
)
|
|
3437
|
+
|
|
3438
|
+
# --- 5. THE SOUL (RUNTIME) ---
|
|
3439
|
+
custom_command: Optional[str] = Field(
|
|
3440
|
+
default=None,
|
|
3441
|
+
description="Override the detected startup command (e.g., 'npm run dev')."
|
|
3442
|
+
)
|
|
3443
|
+
|
|
3444
|
+
variables: Dict[str, str] = Field(
|
|
3445
|
+
default_factory=dict,
|
|
3446
|
+
description="Environment variables to inject into the Shadow's .env file."
|
|
3447
|
+
)
|
|
3448
|
+
|
|
3449
|
+
# [ASCENSION 4]: AUTO_PROVISION
|
|
3450
|
+
auto_provision: bool = Field(
|
|
3451
|
+
default=True,
|
|
3452
|
+
description="If True, performs Lung Transplantation (node_modules linking)."
|
|
3453
|
+
)
|
|
3454
|
+
|
|
3455
|
+
# --- VALIDATORS ---
|
|
3456
|
+
|
|
3457
|
+
@field_validator('project_root', mode='before')
|
|
3458
|
+
@classmethod
|
|
3459
|
+
def canonize_root(cls, v: Any, info: Any) -> str:
|
|
3460
|
+
"""
|
|
3461
|
+
[ASCENSION 2]: PATH CANONIZATION
|
|
3462
|
+
Resolves '~', normalizes slashes, and handles the 'cwd' alias.
|
|
3463
|
+
"""
|
|
3464
|
+
# Handle alias
|
|
3465
|
+
if v is None:
|
|
3466
|
+
# Look for 'cwd' in the raw data if project_root is missing
|
|
3467
|
+
values = info.data if hasattr(info, 'data') else {}
|
|
3468
|
+
if 'cwd' in values:
|
|
3469
|
+
v = values['cwd']
|
|
3470
|
+
|
|
3471
|
+
if not v:
|
|
3472
|
+
return "."
|
|
3473
|
+
|
|
3474
|
+
# Expand and Normalize
|
|
3475
|
+
path_str = str(v)
|
|
3476
|
+
try:
|
|
3477
|
+
expanded = Path(path_str).expanduser().resolve()
|
|
3478
|
+
return expanded.as_posix()
|
|
3479
|
+
except Exception:
|
|
3480
|
+
return path_str.replace('\\', '/')
|
|
3481
|
+
|
|
3482
|
+
@model_validator(mode='before')
|
|
3483
|
+
@classmethod
|
|
3484
|
+
def alias_cwd_to_root(cls, data: Any) -> Any:
|
|
3485
|
+
"""
|
|
3486
|
+
[ASCENSION 3]: DIALECT TRANSLATION
|
|
3487
|
+
Maps 'cwd' -> 'project_root' for clients that use shell terminology.
|
|
3488
|
+
"""
|
|
3489
|
+
if isinstance(data, dict):
|
|
3490
|
+
if 'cwd' in data and 'project_root' not in data:
|
|
3491
|
+
data['project_root'] = data['cwd']
|
|
3492
|
+
|
|
3493
|
+
# Map string command to Enum if possible
|
|
3494
|
+
if 'shadow_command' in data and isinstance(data['shadow_command'], str):
|
|
3495
|
+
try:
|
|
3496
|
+
# Normalize 'spawn' -> ShadowCommand.SPAWN
|
|
3497
|
+
data['shadow_command'] = ShadowCommand(data['shadow_command'].lower())
|
|
3498
|
+
except ValueError:
|
|
3499
|
+
pass # Let Pydantic validation fail natively for clear errors
|
|
3500
|
+
|
|
3501
|
+
return data
|
|
3502
|
+
|
|
3503
|
+
|
|
3504
|
+
# == END OF SCRIPTURE ==
|
|
3505
|
+
|
|
3506
|
+
class GardenRequest(BaseRequest):
|
|
3507
|
+
"""
|
|
3508
|
+
A plea to the Entropy Garden.
|
|
3509
|
+
"""
|
|
3510
|
+
garden_command: Literal["scan", "prune", "report"] = Field(
|
|
3511
|
+
"scan", description="The gardening rite."
|
|
3512
|
+
)
|
|
3513
|
+
aggressiveness: int = Field(1, description="1=Files Only, 3=Symbols (Safe), 5=Ruthless.")
|
|
3514
|
+
focus_path: Optional[str] = Field(None, description="Limit the garden walk to a specific path.")
|
|
3515
|
+
|
|
3516
|
+
class EvolveRequest(BaseRequest):
|
|
3517
|
+
"""
|
|
3518
|
+
A plea to the Schema Engine.
|
|
3519
|
+
Synchronizes the Object Model (Code) with the Persistent State (DB).
|
|
3520
|
+
"""
|
|
3521
|
+
evolve_command: Literal["check", "plan", "apply"] = Field(
|
|
3522
|
+
..., description="The rite of evolution."
|
|
3523
|
+
)
|
|
3524
|
+
message: Optional[str] = Field(None, description="The rationale for this evolution (migration name).")
|
|
3525
|
+
target_env: str = Field("dev", description="The environment to target (dev, staging, prod).")
|
|
3526
|
+
|
|
3527
|
+
class ObserveRequest(BaseRequest):
|
|
3528
|
+
"""
|
|
3529
|
+
A plea to the Neural Link.
|
|
3530
|
+
Summons the TUI Dashboard for runtime introspection.
|
|
3531
|
+
"""
|
|
3532
|
+
target_pid: Optional[int] = Field(None, description="PID of the process to attach to (System Probe).")
|
|
3533
|
+
log_stream: Optional[str] = Field(None, description="Path to a log file to tail and visualize.")
|
|
3534
|
+
port: Optional[int] = Field(None, description="Port to sniff (Traffic Analysis).")
|
|
3535
|
+
demo: bool = Field(False, description="Run in simulation mode to demonstrate capabilities.")
|
|
3536
|
+
|
|
3537
|
+
class TeachRequest(BaseRequest):
|
|
3538
|
+
"""
|
|
3539
|
+
A plea to the Tutorial Forge.
|
|
3540
|
+
Generates interactive coursework from the codebase.
|
|
3541
|
+
"""
|
|
3542
|
+
teach_command: Literal["generate", "start", "verify"] = Field(
|
|
3543
|
+
..., description="The pedagogical rite."
|
|
3544
|
+
)
|
|
3545
|
+
topic: Optional[str] = Field(None, description="Focus of the tutorial (e.g., 'auth', 'database').")
|
|
3546
|
+
difficulty: Literal["novice", "adept", "master"] = Field("novice", description="Complexity of the generated quests.")
|
|
3547
|
+
output_dir: str = Field(".scaffold/tutorial", description="Where to store the course materials.")
|
|
3548
|
+
|
|
3549
|
+
|
|
3550
|
+
class LazarusRequest(BaseRequest):
|
|
3551
|
+
"""
|
|
3552
|
+
A plea to the Lazarus Protocol.
|
|
3553
|
+
Automated debugging and self-healing.
|
|
3554
|
+
"""
|
|
3555
|
+
error_context: Optional[str] = Field(None, description="The stack trace or error message.")
|
|
3556
|
+
command: Optional[str] = Field(None, description="The command that triggers the failure (e.g. 'pytest').")
|
|
3557
|
+
auto_apply: bool = Field(False, description="If True, apply the fix without confirmation.")
|
|
3558
|
+
|
|
3559
|
+
class FortressRequest(BaseRequest):
|
|
3560
|
+
"""
|
|
3561
|
+
A plea to the Fortress.
|
|
3562
|
+
Security auditing and hardening.
|
|
3563
|
+
"""
|
|
3564
|
+
scan_type: Literal["dependencies", "code", "full"] = Field("full", description="The scope of the audit.")
|
|
3565
|
+
fix: bool = Field(False, description="Attempt to auto-patch vulnerabilities.")
|
|
3566
|
+
|
|
3567
|
+
class BabelRequest(BaseRequest):
|
|
3568
|
+
"""
|
|
3569
|
+
A plea to the Babel Engine.
|
|
3570
|
+
Transmutes code from one tongue to another.
|
|
3571
|
+
"""
|
|
3572
|
+
source: str = Field(..., description="The source file or directory to port.")
|
|
3573
|
+
target_lang: Literal["rust", "go", "python", "typescript"] = Field(..., description="The destination language.")
|
|
3574
|
+
fusion_bind: bool = Field(False, description="If True, auto-generates FFI bindings (Fusion) for the new code.")
|
|
3575
|
+
|
|
3576
|
+
|
|
3577
|
+
class HolocronRequest(BaseRequest):
|
|
3578
|
+
"""
|
|
3579
|
+
A plea to the Holocron.
|
|
3580
|
+
Traces the causal chains of reality to define perfect context.
|
|
3581
|
+
"""
|
|
3582
|
+
# [THE FIX] Added 'forge' to the allowed literals
|
|
3583
|
+
holocron_command: Literal["trace", "slice", "forge"] = Field(
|
|
3584
|
+
..., description="The causal rite."
|
|
3585
|
+
)
|
|
3586
|
+
|
|
3587
|
+
# 'entry_point' serves as the Symbol for trace/slice OR the Intent string for forge
|
|
3588
|
+
entry_point: str = Field(
|
|
3589
|
+
..., description="The starting point (Symbol) or Problem Description."
|
|
3590
|
+
)
|
|
3591
|
+
|
|
3592
|
+
input_data: Optional[str] = Field(None, description="JSON payload for dynamic tracing.")
|
|
3593
|
+
depth: int = Field(5, description="How deep to follow the white rabbit.")
|
|
3594
|
+
|
|
3595
|
+
# [THE FIX] Added output_data to match the CLI 'dest' mapping
|
|
3596
|
+
output_data: Optional[str] = Field(None, description="Path to save the result.")
|
|
3597
|
+
|
|
3598
|
+
class OcularRequest(BaseRequest):
|
|
3599
|
+
"""
|
|
3600
|
+
A plea to the Ocular Cortex.
|
|
3601
|
+
Visualizes the application and maps pixels back to code.
|
|
3602
|
+
"""
|
|
3603
|
+
ocular_command: Literal["gaze", "audit", "align"] = Field(..., description="The visual rite.")
|
|
3604
|
+
url: str = Field("http://localhost:3000", description="The live URL to observe.")
|
|
3605
|
+
target_element: Optional[str] = Field(None, description="Selector or text description of the visual element.")
|
|
3606
|
+
design_mock: Optional[str] = Field(None, description="Path to an image file (Design Mock) to align against.")
|
|
3607
|
+
|
|
3608
|
+
class AetherRequest(BaseRequest):
|
|
3609
|
+
"""
|
|
3610
|
+
A plea to the Neural Aether.
|
|
3611
|
+
Communes with the collective subconscious of all Architects.
|
|
3612
|
+
"""
|
|
3613
|
+
aether_command: Literal["sync", "broadcast", "query"] = Field(..., description="The telepathic rite.")
|
|
3614
|
+
pattern_signature: Optional[str] = Field(None, description="Hash or signature of the problem/pattern.")
|
|
3615
|
+
privacy_level: Literal["high", "medium", "low"] = Field("high", description="Differential privacy setting.")
|
|
3616
|
+
|
|
3617
|
+
|
|
3618
|
+
class DebateRequest(BaseRequest):
|
|
3619
|
+
"""
|
|
3620
|
+
=================================================================================
|
|
3621
|
+
== THE SACRED PLEA FOR GNOSTIC DISCOURSE (V-Ω-ETERNAL-APOTHEOSIS-ULTIMA) ==
|
|
3622
|
+
=================================================================================
|
|
3623
|
+
@gnosis:title DebateRequest
|
|
3624
|
+
@gnosis:summary The pure, Pydantic-forged vessel for commanding the Hivemind.
|
|
3625
|
+
|
|
3626
|
+
This is the unbreakable contract for the `debate` rite. It carries the topic of
|
|
3627
|
+
discourse, the chosen council of personas, and the sacred laws that will govern
|
|
3628
|
+
their communion. It is the one true key to unlocking the power of multi-agent
|
|
3629
|
+
AI consensus within the Scaffold cosmos.
|
|
3630
|
+
"""
|
|
3631
|
+
model_config = ConfigDict(extra='allow')
|
|
3632
|
+
|
|
3633
|
+
# --- I. The Core Gnostic Will ---
|
|
3634
|
+
workspace_command: str = Field(default="debate", description="The specific rite to be conducted by the Hivemind.")
|
|
3635
|
+
topic: str = Field(...,
|
|
3636
|
+
description="The subject of the debate, either as a direct string or a path to a scripture of Gnosis.")
|
|
3637
|
+
|
|
3638
|
+
# --- II. The Council of Personas ---
|
|
3639
|
+
personas: List[str] = Field(default_factory=lambda: ["architect", "security", "pragmatist"],
|
|
3640
|
+
description="A list of the AI personas to summon for the debate council.")
|
|
3641
|
+
|
|
3642
|
+
# --- III. The Laws of Communion ---
|
|
3643
|
+
rounds: int = Field(default=1, description="The number of rebuttal rounds to conduct after the initial arguments.")
|
|
3644
|
+
blind: bool = Field(default=False,
|
|
3645
|
+
description="If True, personas do not see each other's arguments in the first round, forcing independent thought.")
|
|
3646
|
+
synthesize: bool = Field(default=True,
|
|
3647
|
+
description="If True, a final AI Moderator will be summoned to analyze the transcript and forge a consensus.")
|
|
3648
|
+
interactive: bool = Field(default=False,
|
|
3649
|
+
description="If True, the rite will pause after each round for the Architect's adjudication.")
|
|
3650
|
+
|
|
3651
|
+
# --- IV. The Gnostic Chronicle ---
|
|
3652
|
+
output_path: Optional[str] = Field(default=None,
|
|
3653
|
+
description="Path to inscribe the final, complete transcript of the debate.")
|
|
3654
|
+
|
|
3655
|
+
# --- V. The Alchemical Context ---
|
|
3656
|
+
variables: Dict[str, Any] = Field(default_factory=dict,
|
|
3657
|
+
description="Gnostic variables to bestow upon the debating council's context.")
|
|
3658
|
+
|
|
3659
|
+
|
|
3660
|
+
class ConduitRequest(BaseRequest):
|
|
3661
|
+
"""
|
|
3662
|
+
The sacred plea to awaken the Gnostic Cockpit (Celestial Bridge).
|
|
3663
|
+
"""
|
|
3664
|
+
workspace_command: str = Field(default="conduit", description="The specific rite to be conducted.") # Corrected field name for consistency
|
|
3665
|
+
url: str = Field(default="https://aistudio.google.com/", description="The URL of the AI altar to embed.")
|
|
3666
|
+
port: int = Field(default=8787, description="The local port to serve the Gnostic Cockpit on.")
|
|
3667
|
+
|
|
3668
|
+
|
|
3669
|
+
class ObservatoryRequest(BaseRequest):
|
|
3670
|
+
"""
|
|
3671
|
+
A plea to manage the Gnostic Observatory.
|
|
3672
|
+
"""
|
|
3673
|
+
obs_command: str = Field(..., description="The specific rite (list, add, switch, etc).")
|
|
3674
|
+
target: Optional[str] = Field(None, description="Path or ID of the project.")
|
|
3675
|
+
name: Optional[str] = Field(None, description="Alias for the project.")
|
|
3676
|
+
json_mode: bool = Field(False, description="Return pure JSON data (for Electron).")
|
|
3677
|
+
# For discover
|
|
3678
|
+
depth: int = 1
|
|
3679
|
+
|
|
3680
|
+
class ArchetypeRequest(BaseRequest):
|
|
3681
|
+
"""
|
|
3682
|
+
=============================================================================
|
|
3683
|
+
== THE ARCHETYPE PLEA (V-Ω-SCHEMA) ==
|
|
3684
|
+
=============================================================================
|
|
3685
|
+
LIF: 100x | The contract for discovering and managing patterns.
|
|
3686
|
+
"""
|
|
3687
|
+
command: str = Field(default="list", description="The rite: list, inspect, pull, or sync.")
|
|
3688
|
+
target: Optional[str] = Field(None, description="The ID of the archetype or a Celestial URL.")
|
|
3689
|
+
output_path: Optional[str] = Field(None, description="Where to save a pulled archetype.")
|
|
3690
|
+
json_mode: bool = Field(default=False, description="Proclaim in machine-readable format.")
|
|
3691
|
+
|
|
3692
|
+
|
|
3693
|
+
|
|
3694
|
+
class GraphManifestRequest(BaseRequest):
|
|
3695
|
+
"""
|
|
3696
|
+
A plea to the Genesis Architect.
|
|
3697
|
+
Carries the full topological definition of a reality to be forged.
|
|
3698
|
+
"""
|
|
3699
|
+
project_root: str = Field(..., description="The physical anchor for manifestation")
|
|
3700
|
+
graph_data: Dict[str, Any] = Field(..., description="The full JSON payload of Nodes and Edges")
|
|
3701
|
+
dry_run: bool = Field(False, description="If true, returns a prophecy without inscription")
|
|
3702
|
+
|
|
3703
|
+
class PreviewRequest(BaseRequest):
|
|
3704
|
+
"""The Plea to Gaze upon the Visual Soul."""
|
|
3705
|
+
path: str
|
|
3706
|
+
depth: int = 2 # How deep to traverse the component tree
|
|
3707
|
+
|
|
3708
|
+
class SimulateRequest(BaseRequest):
|
|
3709
|
+
content: Optional[str] = None
|
|
3710
|
+
target_file: Optional[str] = None
|
|
3711
|
+
language: Optional[str] = None
|
|
3712
|
+
timeout: int = 60
|
|
3713
|
+
env_vars: Optional[Dict[str, str]] = None
|
|
3714
|
+
# [ASCENSION]: The Holographic Lattice
|
|
3715
|
+
# Maps relative file paths to their content.
|
|
3716
|
+
virtual_context: Optional[Dict[str, str]] = None
|
|
3717
|
+
node_id: Optional[str] = None
|
|
3718
|
+
|
|
3719
|
+
|
|
3720
|
+
class GrandSurveyRequest(BaseRequest):
|
|
3721
|
+
"""
|
|
3722
|
+
A plea for the Omniscient Eye to gaze upon the workspace.
|
|
3723
|
+
Used by both CLI ('scaffold survey') and Daemon ('scaffold/grandSurvey').
|
|
3724
|
+
"""
|
|
3725
|
+
rootUri: Optional[str] = Field(None, description="The workspace root URI to scan (RPC).")
|
|
3726
|
+
target_path: Optional[str] = Field(None, description="The CLI path argument.")
|
|
3727
|
+
|
|
3728
|
+
# Internal Metadata (JSON '_meta' -> Python 'meta')
|
|
3729
|
+
meta: Optional[Dict[str, Any]] = Field(None, alias="_meta", description="Internal tracing metadata.")
|
|
3730
|
+
|
|
3731
|
+
@model_validator(mode='after')
|
|
3732
|
+
def harmonize_targets(self) -> 'GrandSurveyRequest':
|
|
3733
|
+
# Unify CLI 'target_path' and RPC 'rootUri'
|
|
3734
|
+
if self.target_path and not self.rootUri:
|
|
3735
|
+
self.rootUri = f"file://{Path(self.target_path).resolve().as_posix()}"
|
|
3736
|
+
return self
|
|
3737
|
+
|
|
3738
|
+
|
|
3739
|
+
# --- [ASCENSION 3]: THE CONFIGURATION PLEA ---
|
|
3740
|
+
class ConfigChangeRequest(BaseRequest):
|
|
3741
|
+
"""
|
|
3742
|
+
A plea to mutate the Neuro-Plasticity of the active Kernel.
|
|
3743
|
+
Primarily used via RPC 'workspace/didChangeConfiguration'.
|
|
3744
|
+
"""
|
|
3745
|
+
settings: Dict[str, Any] = Field(..., description="The new configuration tree.")
|
|
3746
|
+
|
|
3747
|
+
|
|
3748
|
+
class InitializeRequest(BaseRequest):
|
|
3749
|
+
"""
|
|
3750
|
+
[THE FIRST BREATH]
|
|
3751
|
+
The LSP 'initialize' packet. Carries the client's capabilities and root URI.
|
|
3752
|
+
Now fully compliant with LSP 3.17 to prevent AttributeErrors.
|
|
3753
|
+
"""
|
|
3754
|
+
processId: Optional[int] = None
|
|
3755
|
+
|
|
3756
|
+
# [THE CURE]: Restored rootPath to satisfy the Node.js Client
|
|
3757
|
+
rootPath: Optional[str] = None
|
|
3758
|
+
rootUri: Optional[str] = None
|
|
3759
|
+
|
|
3760
|
+
capabilities: Dict[str, Any] = Field(default_factory=dict)
|
|
3761
|
+
initializationOptions: Optional[Dict[str, Any]] = None
|
|
3762
|
+
trace: Optional[str] = "off"
|
|
3763
|
+
workspaceFolders: Optional[List[Any]] = None
|
|
3764
|
+
clientInfo: Optional[Dict[str, Any]] = None
|
|
3765
|
+
locale: Optional[str] = None # Added for completeness
|
|
3766
|
+
|
|
3767
|
+
|
|
3768
|
+
class PluginsRequest(BaseRequest):
|
|
3769
|
+
"""
|
|
3770
|
+
[RITE: CENSUS]
|
|
3771
|
+
A plea to list all active capabilities (Artisans) within the Daemon.
|
|
3772
|
+
"""
|
|
3773
|
+
command: str = "list"
|
|
3774
|
+
category: Optional[str] = None
|
|
3775
|
+
|
|
3776
|
+
|
|
3777
|
+
class CliDispatchRequest(BaseRequest):
|
|
3778
|
+
"""
|
|
3779
|
+
=============================================================================
|
|
3780
|
+
== THE CLI DISPATCH CONTRACT (V-Ω-SHIM-TRANSLATOR) ==
|
|
3781
|
+
=============================================================================
|
|
3782
|
+
A specialized vessel that carries raw command-line arguments from the
|
|
3783
|
+
Rust Shim into the warm heart of the Daemon.
|
|
3784
|
+
"""
|
|
3785
|
+
args: List[str] = Field(..., description="The raw argv sequence from the shim.")
|
|
3786
|
+
auth_token: str = Field(..., description="The security token from the pulse file.")
|
|
3787
|
+
|
|
3788
|
+
class IndexRequest(BaseRequest):
|
|
3789
|
+
"""
|
|
3790
|
+
The Plea for Knowledge.
|
|
3791
|
+
"""
|
|
3792
|
+
force: bool = Field(False, description="Re-index all files regardless of cache state.")
|
|
3793
|
+
target_path: Optional[str] = Field(None, description="Specific file or directory to index.")
|
|
3794
|
+
|
|
3795
|
+
|
|
3796
|
+
class SupabaseDomain(str, Enum):
|
|
3797
|
+
DATABASE = "database"
|
|
3798
|
+
AUTH = "auth"
|
|
3799
|
+
STORAGE = "storage"
|
|
3800
|
+
FUNCTION = "function"
|
|
3801
|
+
|
|
3802
|
+
|
|
3803
|
+
class SupabaseRequest(BaseRequest):
|
|
3804
|
+
"""
|
|
3805
|
+
=============================================================================
|
|
3806
|
+
== THE AKASHIC PLEA (V-Ω-TOTALITY-PERSISTENCE) ==
|
|
3807
|
+
=============================================================================
|
|
3808
|
+
LIF: ∞ | ROLE: DATA_CONTRACT | RANK: SOVEREIGN
|
|
3809
|
+
|
|
3810
|
+
The unified, polymorphic vessel for all interactions with the Supabase Infrastructure.
|
|
3811
|
+
It segregates intent into three domains: DATABASE, AUTH, and STORAGE.
|
|
3812
|
+
|
|
3813
|
+
### THE 7 ASCENSIONS OF DATA:
|
|
3814
|
+
1. **The Optionality Flag:** `optional=True` transforms a `single()` query into
|
|
3815
|
+
`maybe_single()`, returning `None` instead of crashing on empty results.
|
|
3816
|
+
2. **Strict Domain Logic:** Validators ensure that a Database plea must have a Table,
|
|
3817
|
+
and a Storage plea must have a Bucket.
|
|
3818
|
+
3. **The Counter:** Includes `count` strategy (exact/planned/estimated) for pagination.
|
|
3819
|
+
4. **The Binary Carrier:** `file_source` allows streaming physical matter to Storage.
|
|
3820
|
+
5. **The RPC Gateway:** First-class support for Stored Procedures (`rpc`) via `func_name`.
|
|
3821
|
+
6. **Complex Filtering:** Accepts raw dictionary filters for advanced `PostgREST` syntax.
|
|
3822
|
+
7. **Auth Expansion:** Supports admin actions like `generate_link` and `delete_user`.
|
|
3823
|
+
"""
|
|
3824
|
+
model_config = ConfigDict(extra='ignore', populate_by_name=True)
|
|
3825
|
+
|
|
3826
|
+
# --- 1. THE DOMAIN OF OPERATION ---
|
|
3827
|
+
domain: Literal["database", "auth", "storage", "function", "realtime"] = Field(
|
|
3828
|
+
...,
|
|
3829
|
+
description="The realm of the Akashic Record to access."
|
|
3830
|
+
)
|
|
3831
|
+
|
|
3832
|
+
# --- 2. DATABASE GNOSIS (TABLES & ROWS) ---
|
|
3833
|
+
table: Optional[str] = Field(None, description="Target table for DB operations.")
|
|
3834
|
+
|
|
3835
|
+
method: Optional[Literal[
|
|
3836
|
+
"select", "insert", "update", "upsert", "delete", "rpc"
|
|
3837
|
+
]] = Field(None, description="The SQL Verb.")
|
|
3838
|
+
|
|
3839
|
+
# Query Modifiers
|
|
3840
|
+
select_columns: str = Field("*", description="Columns to retrieve (e.g. 'id, name, meta->key').")
|
|
3841
|
+
filters: Optional[Dict[str, Any]] = Field(None, description="Map of 'col': 'val' or 'col': 'op:val'.")
|
|
3842
|
+
order_by: Optional[str] = Field(None, description="Format: 'column:asc' or 'column:desc'.")
|
|
3843
|
+
limit: Optional[int] = Field(None, description="Pagination limit.")
|
|
3844
|
+
offset: Optional[int] = Field(None, description="Pagination offset.")
|
|
3845
|
+
|
|
3846
|
+
# [THE CURE]: EXISTENTIAL MODIFIERS
|
|
3847
|
+
single: bool = Field(False, description="Expect exactly one result.")
|
|
3848
|
+
optional: bool = Field(False, description="If True, 'single' becomes 'maybe_single' (No error on 0 rows).")
|
|
3849
|
+
|
|
3850
|
+
# Meta-Data
|
|
3851
|
+
count: Optional[Literal["exact", "planned", "estimated"]] = Field(None, description="Return total count strategy.")
|
|
3852
|
+
head: bool = Field(False, description="If True, return no data, only count/headers.")
|
|
3853
|
+
csv: bool = Field(False, description="If True, request response as CSV.")
|
|
3854
|
+
|
|
3855
|
+
# RPC Specific
|
|
3856
|
+
func_name: Optional[str] = Field(None, description="Name of the Stored Procedure for 'rpc' method.")
|
|
3857
|
+
|
|
3858
|
+
# --- 3. AUTH GNOSIS (IDENTITIES) ---
|
|
3859
|
+
auth_action: Optional[Literal[
|
|
3860
|
+
"get_user", "list_users", "create_user", "delete_user",
|
|
3861
|
+
"invite_user", "generate_link", "update_user", "sign_out"
|
|
3862
|
+
]] = Field(None, description="The Identity Rite.")
|
|
3863
|
+
|
|
3864
|
+
# Identity Data
|
|
3865
|
+
user_id: Optional[str] = Field(None, description="Target UUID of the soul.")
|
|
3866
|
+
email: Optional[str] = Field(None, description="Email coordinate.")
|
|
3867
|
+
password: Optional[str] = Field(None, description="Secret key for creation.")
|
|
3868
|
+
phone: Optional[str] = Field(None, description="E.164 phone coordinate.")
|
|
3869
|
+
|
|
3870
|
+
# --- 4. STORAGE GNOSIS (ARTIFACTS) ---
|
|
3871
|
+
bucket: Optional[str] = Field(None, description="Target Storage Bucket.")
|
|
3872
|
+
storage_action: Optional[Literal[
|
|
3873
|
+
"upload", "download", "list", "remove", "move", "copy",
|
|
3874
|
+
"create_signed_url", "get_public_url"
|
|
3875
|
+
]] = Field(None, description="The Archive Rite.")
|
|
3876
|
+
|
|
3877
|
+
path: Optional[str] = Field(None, description="Path within the bucket.")
|
|
3878
|
+
file_source: Optional[Union[str, Path]] = Field(None, description="Local path to source file for upload.")
|
|
3879
|
+
destination: Optional[Union[str, Path]] = Field(None, description="Local path to save downloaded matter.")
|
|
3880
|
+
# =========================================================================
|
|
3881
|
+
# == [ASCENSION 1]: THE FORENSIC METADATA ENVELOPE (THE CURE) ==
|
|
3882
|
+
# =========================================================================
|
|
3883
|
+
metadata: Dict[str, Any] = Field(
|
|
3884
|
+
default_factory=dict,
|
|
3885
|
+
description="Forensic context (trace_id, novalym_id) for the Audit Scribe."
|
|
3886
|
+
)
|
|
3887
|
+
# =========================================================================
|
|
3888
|
+
|
|
3889
|
+
# Storage Options
|
|
3890
|
+
content_type: Optional[str] = Field(None, description="MIME type override.")
|
|
3891
|
+
upsert_file: bool = Field(False, description="Overwrite existing file.")
|
|
3892
|
+
expiry_seconds: int = Field(3600, description="TTL for signed URLs.")
|
|
3893
|
+
|
|
3894
|
+
# --- 5. UNIVERSAL PAYLOAD (THE DATA) ---
|
|
3895
|
+
# Used for Insert/Update bodies, RPC params, or User Metadata
|
|
3896
|
+
data: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = Field(
|
|
3897
|
+
None,
|
|
3898
|
+
description="The Gnostic Payload (Rows for DB, Metadata for Auth)."
|
|
3899
|
+
)
|
|
3900
|
+
|
|
3901
|
+
# =========================================================================
|
|
3902
|
+
# == THE RITES OF VALIDATION (LOGIC GATES) ==
|
|
3903
|
+
# =========================================================================
|
|
3904
|
+
|
|
3905
|
+
@model_validator(mode='after')
|
|
3906
|
+
def validate_domain_constraints(self) -> 'SupabaseRequest':
|
|
3907
|
+
"""
|
|
3908
|
+
Ensures the Plea matches the Domain.
|
|
3909
|
+
Prevents asking the Database for a File, or Storage for a User.
|
|
3910
|
+
"""
|
|
3911
|
+
# 1. DATABASE GATE
|
|
3912
|
+
if self.domain == 'database':
|
|
3913
|
+
if not self.table and not self.func_name:
|
|
3914
|
+
# RPC calls might use func_name instead of table, but usually table is required for standard ops
|
|
3915
|
+
if self.method != 'rpc':
|
|
3916
|
+
raise ValueError("Database Rite requires a 'table'.")
|
|
3917
|
+
if not self.method:
|
|
3918
|
+
raise ValueError("Database Rite requires a 'method'.")
|
|
3919
|
+
|
|
3920
|
+
# 2. STORAGE GATE
|
|
3921
|
+
if self.domain == 'storage':
|
|
3922
|
+
if not self.bucket:
|
|
3923
|
+
raise ValueError("Storage Rite requires a 'bucket'.")
|
|
3924
|
+
if not self.storage_action:
|
|
3925
|
+
raise ValueError("Storage Rite requires a 'storage_action'.")
|
|
3926
|
+
|
|
3927
|
+
if self.storage_action == 'upload' and not self.file_source:
|
|
3928
|
+
raise ValueError("Upload Rite requires 'file_source'.")
|
|
3929
|
+
|
|
3930
|
+
# 3. AUTH GATE
|
|
3931
|
+
if self.domain == 'auth':
|
|
3932
|
+
if not self.auth_action:
|
|
3933
|
+
raise ValueError("Auth Rite requires an 'auth_action'.")
|
|
3934
|
+
|
|
3935
|
+
if self.auth_action in ['get_user', 'delete_user'] and not self.user_id:
|
|
3936
|
+
raise ValueError(f"Auth Rite '{self.auth_action}' requires 'user_id'.")
|
|
3937
|
+
|
|
3938
|
+
return self
|
|
3939
|
+
|
|
3940
|
+
|
|
3941
|
+
class CommunicationRequest(BaseRequest):
|
|
3942
|
+
"""
|
|
3943
|
+
[THE HIGH HERALD'S PLEA]
|
|
3944
|
+
A unified request to dispatch information across the ether.
|
|
3945
|
+
"""
|
|
3946
|
+
# Routing
|
|
3947
|
+
channel: Literal["email", "sms", "chat"] = Field(..., description="The medium of transmission.")
|
|
3948
|
+
provider: Optional[str] = Field(None, description="Specific provider override (e.g., 'gmail', 'resend').")
|
|
3949
|
+
metadata: Dict[str, Any] = Field(default_factory=dict, description="Arbitrary context for middleware/Artisans.")
|
|
3950
|
+
# Destination
|
|
3951
|
+
recipient: Union[str, List[str]] = Field(..., description="Primary target(s).")
|
|
3952
|
+
cc: Optional[List[str]] = None
|
|
3953
|
+
bcc: Optional[List[str]] = None
|
|
3954
|
+
|
|
3955
|
+
# Content
|
|
3956
|
+
subject: Optional[str] = None
|
|
3957
|
+
content: Optional[str] = Field(None, description="Raw text content.")
|
|
3958
|
+
template: Optional[str] = Field(None, description="Path to a Jinja2 template.")
|
|
3959
|
+
context: Dict[str, Any] = Field(default_factory=dict, description="Variables for the template.")
|
|
3960
|
+
|
|
3961
|
+
# Artifacts
|
|
3962
|
+
attachments: List[str] = Field(default_factory=list, description="Paths to local files to attach.")
|
|
3963
|
+
|
|
3964
|
+
# Metaphysics
|
|
3965
|
+
html: bool = True
|
|
3966
|
+
priority: str = "normal"
|
|
3967
|
+
|
|
3968
|
+
|
|
3969
|
+
class NetworkProtocol(str, Enum):
|
|
3970
|
+
HTTP = "http"
|
|
3971
|
+
GRAPHQL = "graphql"
|
|
3972
|
+
WEBHOOK = "webhook" # Specialized sending with signing
|
|
3973
|
+
|
|
3974
|
+
|
|
3975
|
+
class NetworkRequest(BaseRequest):
|
|
3976
|
+
"""
|
|
3977
|
+
[THE UNIVERSAL ADAPTER V2]
|
|
3978
|
+
A unified plea for interaction with the external digital ether.
|
|
3979
|
+
"""
|
|
3980
|
+
# Routing
|
|
3981
|
+
protocol: NetworkProtocol = Field(default=NetworkProtocol.HTTP, description="Communication dialect.")
|
|
3982
|
+
url: str = Field(..., description="Target Endpoint.")
|
|
3983
|
+
method: str = Field("GET", description="HTTP Method (GET, POST, PUT, DELETE, PATCH).")
|
|
3984
|
+
|
|
3985
|
+
# Payload
|
|
3986
|
+
headers: Dict[str, str] = Field(default_factory=dict)
|
|
3987
|
+
params: Dict[str, Any] = Field(default_factory=dict, description="Query parameters.")
|
|
3988
|
+
json_body: Optional[Dict[str, Any]] = Field(None, description="JSON payload.")
|
|
3989
|
+
data: Optional[Any] = Field(None, description="Raw body or Form data.")
|
|
3990
|
+
|
|
3991
|
+
# GraphQL Specific
|
|
3992
|
+
query: Optional[str] = Field(None, description="GraphQL Query string.")
|
|
3993
|
+
variables: Optional[Dict[str, Any]] = Field(None, description="GraphQL Variables.")
|
|
3994
|
+
|
|
3995
|
+
# Webhook Specific
|
|
3996
|
+
secret: Optional[str] = Field(None, description="Secret for HMAC signing.")
|
|
3997
|
+
signature_header: str = "X-Signature"
|
|
3998
|
+
|
|
3999
|
+
# Configuration
|
|
4000
|
+
timeout: float = 10.0
|
|
4001
|
+
retries: int = 0
|
|
4002
|
+
auth: Optional[Dict[str, str]] = Field(
|
|
4003
|
+
None,
|
|
4004
|
+
description="Auth config. E.g. {'type': 'bearer', 'token': '...'} or {'type': 'basic', 'user': '...', 'pass': '...'}"
|
|
4005
|
+
)
|
|
4006
|
+
|
|
4007
|
+
|
|
4008
|
+
class BillingEntity(str, Enum):
|
|
4009
|
+
CUSTOMER = "customer"
|
|
4010
|
+
SUBSCRIPTION = "subscription"
|
|
4011
|
+
PRODUCT = "product"
|
|
4012
|
+
PRICE = "price"
|
|
4013
|
+
INVOICE = "invoice"
|
|
4014
|
+
PORTAL = "portal"
|
|
4015
|
+
PAYMENT_LINK = "payment_link"
|
|
4016
|
+
EVENT = "event" # For webhook verification
|
|
4017
|
+
|
|
4018
|
+
|
|
4019
|
+
class BillingRequest(BaseRequest):
|
|
4020
|
+
"""
|
|
4021
|
+
[THE TREASURY RITE V2]
|
|
4022
|
+
A unified plea to the Financial Sovereign (Stripe).
|
|
4023
|
+
"""
|
|
4024
|
+
entity: BillingEntity = Field(..., description="The fiscal object to manipulate.")
|
|
4025
|
+
action: str = Field(..., pattern=r"^(create|retrieve|update|delete|list|search|finalize|void|pay|usage)$")
|
|
4026
|
+
|
|
4027
|
+
# Context
|
|
4028
|
+
id: Optional[str] = Field(None, description="Target ID (cus_..., sub_...).")
|
|
4029
|
+
|
|
4030
|
+
# Payload
|
|
4031
|
+
payload: Dict[str, Any] = Field(default_factory=dict, description="Stripe parameters (metadata, items, etc.).")
|
|
4032
|
+
|
|
4033
|
+
# Advanced Tuning
|
|
4034
|
+
expand: List[str] = Field(default_factory=list,
|
|
4035
|
+
description="Expand nested objects (e.g. ['customer', 'latest_invoice']).")
|
|
4036
|
+
limit: int = Field(10, description="Pagination limit for lists.")
|
|
4037
|
+
idempotency_key: Optional[str] = None
|
|
4038
|
+
|
|
4039
|
+
class StorageRequest(BaseRequest):
|
|
4040
|
+
"""
|
|
4041
|
+
[THE ARCHIVE RITE] Manage heavy matter (Files/S3).
|
|
4042
|
+
"""
|
|
4043
|
+
bucket: str = Field(..., description="Target bucket.")
|
|
4044
|
+
path: str = Field(..., description="File path in the cloud.")
|
|
4045
|
+
action: str = Field(..., pattern=r"^(upload|download|delete|sign_url)$")
|
|
4046
|
+
source_path: Optional[str] = Field(None, description="Local path for upload.")
|
|
4047
|
+
destination_path: Optional[str] = Field(None, description="Local path for download.")
|
|
4048
|
+
content_type: Optional[str] = None
|
|
4049
|
+
expiry_seconds: int = 3600
|
|
4050
|
+
|
|
4051
|
+
|
|
4052
|
+
class CRMProvider(str, Enum):
|
|
4053
|
+
HUBSPOT = "hubspot"
|
|
4054
|
+
SALESFORCE = "salesforce"
|
|
4055
|
+
ZOHO = "zoho"
|
|
4056
|
+
|
|
4057
|
+
|
|
4058
|
+
class CRMRequest(BaseRequest):
|
|
4059
|
+
"""
|
|
4060
|
+
[THE DIPLOMAT'S PLEA]
|
|
4061
|
+
A unified interface for managing Customer Relationships across disparate systems.
|
|
4062
|
+
"""
|
|
4063
|
+
provider: CRMProvider = Field(default=CRMProvider.HUBSPOT, description="Target System.")
|
|
4064
|
+
|
|
4065
|
+
# Targeting
|
|
4066
|
+
entity: str = Field(..., pattern=r"^(contact|company|deal|ticket|product)$")
|
|
4067
|
+
action: str = Field(..., pattern=r"^(create|update|upsert|get|list|search|delete|associate)$")
|
|
4068
|
+
|
|
4069
|
+
# Identity
|
|
4070
|
+
id: Optional[str] = Field(None, description="Native CRM ID (e.g. 12345).")
|
|
4071
|
+
match_key: Optional[str] = Field("email", description="Field to use for Upsert/Search deduplication.")
|
|
4072
|
+
match_value: Optional[str] = Field(None, description="Value to match against.")
|
|
4073
|
+
|
|
4074
|
+
# Payload
|
|
4075
|
+
data: Dict[str, Any] = Field(default_factory=dict, description="Fields/Properties to write.")
|
|
4076
|
+
|
|
4077
|
+
# Linking (The Web of Relations)
|
|
4078
|
+
# Example: {"to_entity": "company", "to_id": "9876"}
|
|
4079
|
+
associations: List[Dict[str, str]] = Field(default_factory=list, description="Links to forge after creation.")
|
|
4080
|
+
|
|
4081
|
+
# Tuning
|
|
4082
|
+
limit: int = 10
|
|
4083
|
+
properties: List[str] = Field(default_factory=list, description="Specific fields to retrieve.")
|
|
4084
|
+
|
|
4085
|
+
|
|
4086
|
+
# =============================================================================
|
|
4087
|
+
# == SECTION I: THE NEURAL TAXONOMY (ENUMS) ==
|
|
4088
|
+
# =============================================================================
|
|
4089
|
+
|
|
4090
|
+
class AIProvider(str, Enum):
|
|
4091
|
+
"""The Silicon Minds available to the Monolith."""
|
|
4092
|
+
OPENAI = "openai"
|
|
4093
|
+
AZURE = "azure"
|
|
4094
|
+
ANTHROPIC = "anthropic"
|
|
4095
|
+
GOOGLE = "google"
|
|
4096
|
+
LOCAL = "local" # Ollama / LM Studio
|
|
4097
|
+
GROQ = "groq" # Hyper-velocity inference
|
|
4098
|
+
PERPLEXITY = "perplexity" # Search-grounded inference
|
|
4099
|
+
|
|
4100
|
+
|
|
4101
|
+
class ModelStrategy(str, Enum):
|
|
4102
|
+
"""Abstract strategies that resolve to concrete models at runtime."""
|
|
4103
|
+
SMART = "smart" # GPT-4o / Claude 3.5 Sonnet / o1
|
|
4104
|
+
FAST = "fast" # GPT-4o-mini / Haiku / Llama 3
|
|
4105
|
+
REASONING = "reasoning" # o1-preview / o3 (Heavy Chain of Thought)
|
|
4106
|
+
CREATIVE = "creative" # High temperature variants
|
|
4107
|
+
CODING = "coding" # Claude 3.5 Sonnet / DeepSeek Coder
|
|
4108
|
+
|
|
4109
|
+
|
|
4110
|
+
class RAGStrategy(str, Enum):
|
|
4111
|
+
"""The method of memory retrieval."""
|
|
4112
|
+
NONE = "none"
|
|
4113
|
+
BASIC = "basic" # Vector Similarity only
|
|
4114
|
+
HYBRID = "hybrid" # Vector + Keyword (BM25)
|
|
4115
|
+
DEEP = "deep" # Recursive / Graph-based traversal
|
|
4116
|
+
AGENTIC = "agentic" # The AI decides what to search
|
|
4117
|
+
|
|
4118
|
+
|
|
4119
|
+
# =============================================================================
|
|
4120
|
+
# == SECTION II: THE GNOSTIC SUB-STRATA (COMPONENTS) ==
|
|
4121
|
+
# =============================================================================
|
|
4122
|
+
|
|
4123
|
+
class MediaAsset(BaseModel):
|
|
4124
|
+
"""
|
|
4125
|
+
[THE SENSORY INPUT]
|
|
4126
|
+
A container for non-textual matter (Images, Audio frames).
|
|
4127
|
+
"""
|
|
4128
|
+
type: Literal["image_url", "image_base64", "audio_base64"] = "image_url"
|
|
4129
|
+
data: str = Field(..., description="The URL or Base64 string.")
|
|
4130
|
+
detail: Literal["auto", "low", "high"] = "auto"
|
|
4131
|
+
|
|
4132
|
+
|
|
4133
|
+
class ToolConfig(BaseModel):
|
|
4134
|
+
"""
|
|
4135
|
+
[THE KINETIC LIMB]
|
|
4136
|
+
Definition of a function the AI is allowed to execute.
|
|
4137
|
+
"""
|
|
4138
|
+
name: str
|
|
4139
|
+
description: str
|
|
4140
|
+
parameters: Dict[str, Any] # JSON Schema
|
|
4141
|
+
strict: bool = False # OpenAI Strict Mode support
|
|
4142
|
+
|
|
4143
|
+
|
|
4144
|
+
# =============================================================================
|
|
4145
|
+
# == SECTION III: THE OMEGA INTELLIGENCE REQUEST ==
|
|
4146
|
+
# =============================================================================
|
|
4147
|
+
|
|
4148
|
+
class IntelligenceRequest(BaseRequest):
|
|
4149
|
+
"""
|
|
4150
|
+
=============================================================================
|
|
4151
|
+
== THE OMEGA INTELLIGENCE REQUEST (V-Ω-TOTALITY-V9000) ==
|
|
4152
|
+
=============================================================================
|
|
4153
|
+
LIF: INFINITY | ROLE: COGNITIVE_PAYLOAD_VESSEL | RANK: OMEGA_SOVEREIGN
|
|
4154
|
+
AUTH_CODE: Ω_NEURAL_REQ_2026_FINALIS
|
|
4155
|
+
|
|
4156
|
+
The definitive, future-proof contract for summoning machine cognition.
|
|
4157
|
+
It contains pockets for every conceivable dimension of AI interaction:
|
|
4158
|
+
Text, Vision, Audio, Tooling, RAG, Forensics, and Economics.
|
|
4159
|
+
|
|
4160
|
+
### THE 12 ASCENSIONS OF THE SCHEMA:
|
|
4161
|
+
1. **Metadata Sovereignty (THE CURE):** `metadata` is now a mandatory,
|
|
4162
|
+
pre-validated dictionary. The `AttributeError` is physically impossible.
|
|
4163
|
+
2. **Multimodal Totality:** Support for `media_assets` list allows mixing
|
|
4164
|
+
text, images, and audio in a single prompt.
|
|
4165
|
+
3. **Reasoning Physics:** Adds `reasoning_effort` (low/medium/high) for
|
|
4166
|
+
next-gen 'Thinking' models (o1/o3).
|
|
4167
|
+
4. **Economic Circuit Breakers:** `budget_cap_usd` allows the request to
|
|
4168
|
+
self-terminate if the predicted cost is too high.
|
|
4169
|
+
5. **Gnostic Context Injection:** A dedicated `context` dictionary for
|
|
4170
|
+
injecting RAG shards without polluting the `user_prompt` string manually.
|
|
4171
|
+
6. **Safety & Compliance:** `safety_settings` dict for controlling
|
|
4172
|
+
guardrails (Gemini BlockNone vs OpenAI Moderation).
|
|
4173
|
+
7. **Deterministic Anchoring:** `seed` field for reproducible outputs
|
|
4174
|
+
during regression testing.
|
|
4175
|
+
8. **Tooling Orchestration:** First-class support for `tools`, `tool_choice`,
|
|
4176
|
+
and `parallel_tool_calls`.
|
|
4177
|
+
9. **Achronal Trace Lineage:** `trace_id` is auto-generated if missing,
|
|
4178
|
+
binding the thought to the global causal chain.
|
|
4179
|
+
10. **Schema Enforcement:** `output_schema` field for forcing Structured Outputs
|
|
4180
|
+
(Pydantic/Zod) at the API level.
|
|
4181
|
+
11. **Provider Agnosticism:** `model` accepts abstract strategies ('smart')
|
|
4182
|
+
which the Provider resolves to concrete deployments.
|
|
4183
|
+
12. **The Finality Vow:** Extra fields are allowed (`extra='allow'`), ensuring
|
|
4184
|
+
this schema never breaks when providers release new parameters.
|
|
4185
|
+
"""
|
|
4186
|
+
model_config = ConfigDict(
|
|
4187
|
+
extra='allow',
|
|
4188
|
+
populate_by_name=True,
|
|
4189
|
+
arbitrary_types_allowed=True,
|
|
4190
|
+
validate_assignment=True
|
|
4191
|
+
)
|
|
4192
|
+
|
|
4193
|
+
# --- 1. THE CORE COGNITION (PROMPTS) ---
|
|
4194
|
+
system_prompt: Optional[str] = Field(
|
|
4195
|
+
default="You are a helpful Gnostic Assistant, an expert in software architecture.",
|
|
4196
|
+
description="The Constitutional Law / Persona of the Mind."
|
|
4197
|
+
)
|
|
4198
|
+
user_prompt: str = Field(
|
|
4199
|
+
...,
|
|
4200
|
+
description="The kinetic query or instruction from the Architect."
|
|
4201
|
+
)
|
|
4202
|
+
|
|
4203
|
+
# [ASCENSION 2]: LIST-BASED HISTORY
|
|
4204
|
+
# Allows passing a full chat history [user, assistant, user] for conversational continuity.
|
|
4205
|
+
messages: Optional[List[Dict[str, Any]]] = Field(
|
|
4206
|
+
default=None,
|
|
4207
|
+
description="Full conversation history. Overrides user_prompt/system_prompt if present."
|
|
4208
|
+
)
|
|
4209
|
+
|
|
4210
|
+
# --- 2. MULTIMODAL SENSORY INPUT ---
|
|
4211
|
+
# Legacy fields for backward compatibility
|
|
4212
|
+
image_data: Optional[str] = Field(None, description="Legacy Base64 image.")
|
|
4213
|
+
image_url: Optional[str] = Field(None, description="Legacy Image URL.")
|
|
4214
|
+
|
|
4215
|
+
# [ASCENSION 2]: THE MEDIA ARRAY
|
|
4216
|
+
media_assets: List[MediaAsset] = Field(
|
|
4217
|
+
default_factory=list,
|
|
4218
|
+
description="A phalanx of visual or audio inputs for the model."
|
|
4219
|
+
)
|
|
4220
|
+
|
|
4221
|
+
# --- 3. ROUTING & STRATEGY ---
|
|
4222
|
+
provider: AIProvider = Field(default=AIProvider.OPENAI)
|
|
4223
|
+
model: str = Field(
|
|
4224
|
+
default=ModelStrategy.SMART,
|
|
4225
|
+
description="Target model ID or abstract strategy ('smart', 'fast')."
|
|
4226
|
+
)
|
|
4227
|
+
|
|
4228
|
+
# --- 4. PHYSICS OF THOUGHT (HYPERPARAMETERS) ---
|
|
4229
|
+
temperature: float = Field(0.7, ge=0.0, le=2.0)
|
|
4230
|
+
max_tokens: int = Field(2048, ge=1)
|
|
4231
|
+
top_p: float = Field(1.0, ge=0.0, le=1.0)
|
|
4232
|
+
frequency_penalty: float = Field(0.0, ge=-2.0, le=2.0)
|
|
4233
|
+
presence_penalty: float = Field(0.0, ge=-2.0, le=2.0)
|
|
4234
|
+
|
|
4235
|
+
# [ASCENSION 7]: DETERMINISM
|
|
4236
|
+
seed: Optional[int] = Field(None, description="The anchor for reproducible outputs.")
|
|
4237
|
+
|
|
4238
|
+
# [ASCENSION 3]: REASONING EFFORT (o1/o3 support)
|
|
4239
|
+
reasoning_effort: Optional[Literal["low", "medium", "high"]] = Field(
|
|
4240
|
+
None,
|
|
4241
|
+
description="Thinking budget for reasoning models."
|
|
4242
|
+
)
|
|
4243
|
+
|
|
4244
|
+
# --- 5. OUTPUT GOVERNANCE ---
|
|
4245
|
+
stream: bool = Field(default=False)
|
|
4246
|
+
json_mode: bool = Field(default=False, description="Enforce JSON object return.")
|
|
4247
|
+
|
|
4248
|
+
# [ASCENSION 10]: STRICT SCHEMA
|
|
4249
|
+
output_schema: Optional[Dict[str, Any]] = Field(
|
|
4250
|
+
None,
|
|
4251
|
+
description="JSON Schema for Structured Outputs (strict mode)."
|
|
4252
|
+
)
|
|
4253
|
+
|
|
4254
|
+
# --- 6. RAG & MEMORY STRATA ---
|
|
4255
|
+
use_rag: bool = Field(default=False)
|
|
4256
|
+
rag_strategy: RAGStrategy = Field(default=RAGStrategy.BASIC)
|
|
4257
|
+
|
|
4258
|
+
# [ASCENSION 5]: CONTEXT INJECTION
|
|
4259
|
+
context: Dict[str, Any] = Field(
|
|
4260
|
+
default_factory=dict,
|
|
4261
|
+
description="Key-value pairs to be injected into the prompt via Jinja."
|
|
4262
|
+
)
|
|
4263
|
+
rag_filters: Optional[Dict[str, Any]] = Field(
|
|
4264
|
+
default=None,
|
|
4265
|
+
description="Metadata filters for the Vector Scry."
|
|
4266
|
+
)
|
|
4267
|
+
|
|
4268
|
+
# --- 7. KINETIC TOOLS ---
|
|
4269
|
+
tools: List[ToolConfig] = Field(default_factory=list)
|
|
4270
|
+
tool_choice: Union[str, Dict[str, Any]] = Field(default="auto")
|
|
4271
|
+
parallel_tool_calls: bool = Field(default=True)
|
|
4272
|
+
|
|
4273
|
+
# --- 8. FORENSICS, METADATA & ECONOMICS (THE CURE) ---
|
|
4274
|
+
# [ASCENSION 1]: THE METADATA ENVELOPE
|
|
4275
|
+
metadata: Dict[str, Any] = Field(
|
|
4276
|
+
default_factory=dict,
|
|
4277
|
+
description="The Forensic Sarcophagus. Holds trace_id, user_grade, and cost_center."
|
|
4278
|
+
)
|
|
4279
|
+
|
|
4280
|
+
# [ASCENSION 9]: TRACE ID
|
|
4281
|
+
trace_id: str = Field(
|
|
4282
|
+
default="tr-void",
|
|
4283
|
+
description="The Silver Cord linking this thought to the Request."
|
|
4284
|
+
)
|
|
4285
|
+
|
|
4286
|
+
# [ASCENSION 4]: FINANCIAL GUARD
|
|
4287
|
+
budget_cap_usd: float = Field(
|
|
4288
|
+
default=1.00,
|
|
4289
|
+
description="Hard stop if predicted cost exceeds this value."
|
|
4290
|
+
)
|
|
4291
|
+
cost_center: str = Field(
|
|
4292
|
+
default="GENERAL_COMPUTE",
|
|
4293
|
+
description="Ledger category for this spend."
|
|
4294
|
+
)
|
|
4295
|
+
|
|
4296
|
+
# [ASCENSION 6]: SAFETY
|
|
4297
|
+
safety_settings: Dict[str, str] = Field(
|
|
4298
|
+
default_factory=dict,
|
|
4299
|
+
description="Provider-specific safety overrides (e.g. BLOCK_NONE)."
|
|
4300
|
+
)
|
|
4301
|
+
|
|
4302
|
+
force: bool = Field(
|
|
4303
|
+
default=False,
|
|
4304
|
+
description="Sovereign Override to bypass budget/rate limits."
|
|
4305
|
+
)
|
|
4306
|
+
|
|
4307
|
+
# =========================================================================
|
|
4308
|
+
# == THE RITE OF PRE-FLIGHT VALIDATION (THE FIX) ==
|
|
4309
|
+
# =========================================================================
|
|
4310
|
+
|
|
4311
|
+
@model_validator(mode='before')
|
|
4312
|
+
@classmethod
|
|
4313
|
+
def forge_defaults(cls, data: Any) -> Any:
|
|
4314
|
+
"""
|
|
4315
|
+
[THE GUARDIAN]: Ensures Metadata and Trace ID are never void.
|
|
4316
|
+
Heals the 'AttributeError' by physically injecting the dict if missing.
|
|
4317
|
+
"""
|
|
4318
|
+
if isinstance(data, dict):
|
|
4319
|
+
# 1. HEAL METADATA FRACTURE
|
|
4320
|
+
if "metadata" not in data or data["metadata"] is None:
|
|
4321
|
+
data["metadata"] = {}
|
|
4322
|
+
|
|
4323
|
+
# 2. TRACE ID HOISTING
|
|
4324
|
+
# If trace_id is at root, copy to metadata. If missing, gen new one.
|
|
4325
|
+
root_trace = data.get("trace_id")
|
|
4326
|
+
meta_trace = data["metadata"].get("trace_id")
|
|
4327
|
+
|
|
4328
|
+
final_trace = root_trace or meta_trace or f"tr-ai-{uuid.uuid4().hex[:8]}"
|
|
4329
|
+
|
|
4330
|
+
data["trace_id"] = final_trace
|
|
4331
|
+
data["metadata"]["trace_id"] = final_trace
|
|
4332
|
+
|
|
4333
|
+
# 3. LEGACY IMAGE COMPATIBILITY
|
|
4334
|
+
# If legacy image fields exist, migrate them to media_assets
|
|
4335
|
+
if data.get("image_data"):
|
|
4336
|
+
assets = data.get("media_assets", [])
|
|
4337
|
+
assets.append({"type": "image_base64", "data": data["image_data"]})
|
|
4338
|
+
data["media_assets"] = assets
|
|
4339
|
+
|
|
4340
|
+
return data
|
|
4341
|
+
|
|
4342
|
+
@computed_field
|
|
4343
|
+
@property
|
|
4344
|
+
def fingerprint(self) -> str:
|
|
4345
|
+
"""[ASCENSION 13]: Deterministic Hash of the Prompt Intent."""
|
|
4346
|
+
import hashlib
|
|
4347
|
+
core_content = f"{self.system_prompt}:{self.user_prompt}:{self.model}"
|
|
4348
|
+
return hashlib.sha256(core_content.encode()).hexdigest()
|
|
4349
|
+
|
|
4350
|
+
def __repr__(self) -> str:
|
|
4351
|
+
return f"<Ω_INTELLIGENCE trace={self.trace_id} model={self.model} rag={self.use_rag}>"
|
|
4352
|
+
|
|
4353
|
+
|
|
4354
|
+
class BrowserRequest(BaseRequest):
|
|
4355
|
+
"""
|
|
4356
|
+
[THE NAVIGATOR'S PLEA]
|
|
4357
|
+
Command a headless browser to interact with the Living Web.
|
|
4358
|
+
"""
|
|
4359
|
+
url: str = Field(..., description="Target URI.")
|
|
4360
|
+
action: str = Field(..., pattern=r"^(scrape|screenshot|pdf|interact)$")
|
|
4361
|
+
|
|
4362
|
+
# Selectors & Interaction
|
|
4363
|
+
selector: Optional[str] = Field(None, description="CSS/XPath selector to target.")
|
|
4364
|
+
input_value: Optional[str] = Field(None, description="Text to type into inputs.")
|
|
4365
|
+
wait_for: Optional[str] = Field(None, description="Selector to wait for before acting.")
|
|
4366
|
+
|
|
4367
|
+
# Extraction
|
|
4368
|
+
extract_fields: Optional[Dict[str, str]] = Field(None, description="Map of {key: selector} for scraping.")
|
|
4369
|
+
|
|
4370
|
+
# Configuration
|
|
4371
|
+
headless: bool = True
|
|
4372
|
+
viewport: Dict[str, int] = Field(default_factory=lambda: {"width": 1280, "height": 720})
|
|
4373
|
+
timeout: float = 30.0
|
|
4374
|
+
|
|
4375
|
+
|
|
4376
|
+
class DocumentFormat(str, Enum):
|
|
4377
|
+
PDF = "pdf"
|
|
4378
|
+
CSV = "csv"
|
|
4379
|
+
EXCEL = "xlsx"
|
|
4380
|
+
HTML = "html"
|
|
4381
|
+
|
|
4382
|
+
|
|
4383
|
+
class DocumentRequest(BaseRequest):
|
|
4384
|
+
"""
|
|
4385
|
+
[THE SCRIBE'S PLEA]
|
|
4386
|
+
Transmute structured data into physical documents, or ingest documents into data.
|
|
4387
|
+
"""
|
|
4388
|
+
action: str = Field(..., pattern=r"^(generate|parse|convert|merge)$")
|
|
4389
|
+
format: DocumentFormat = Field(..., description="Target/Source format.")
|
|
4390
|
+
|
|
4391
|
+
# Inputs
|
|
4392
|
+
source_path: Optional[str] = Field(None, description="Input file for parsing/conversion.")
|
|
4393
|
+
template_path: Optional[str] = Field(None, description="Jinja2 HTML template for PDF generation.")
|
|
4394
|
+
data: Optional[Union[List[Dict], Dict]] = Field(None, description="Data to inject into the document.")
|
|
4395
|
+
|
|
4396
|
+
# Outputs
|
|
4397
|
+
output_path: Optional[str] = Field(None, description="Where to save the result.")
|
|
4398
|
+
|
|
4399
|
+
# Options
|
|
4400
|
+
options: Dict[str, Any] = Field(default_factory=dict, description="Format-specific tuning (e.g. page_size).")
|
|
4401
|
+
|
|
4402
|
+
|
|
4403
|
+
class WorkerRequest(BaseRequest):
|
|
4404
|
+
"""
|
|
4405
|
+
[THE TASKMASTER'S PLEA]
|
|
4406
|
+
Dispatch logic to the background ethers (Queue).
|
|
4407
|
+
"""
|
|
4408
|
+
queue: str = Field("default", description="Target queue name.")
|
|
4409
|
+
task: str = Field(..., description="Name of the function/task to execute.")
|
|
4410
|
+
args: List[Any] = Field(default_factory=list, description="Positional arguments.")
|
|
4411
|
+
kwargs: Dict[str, Any] = Field(default_factory=dict, description="Keyword arguments.")
|
|
4412
|
+
|
|
4413
|
+
# Temporal Control
|
|
4414
|
+
delay_seconds: int = Field(0, description="Execute after delay.")
|
|
4415
|
+
schedule_at: Optional[datetime] = Field(None, description="Execute at specific time.")
|
|
4416
|
+
cron: Optional[str] = Field(None, description="Recurring schedule (CRON format).")
|
|
4417
|
+
|
|
4418
|
+
# Resilience
|
|
4419
|
+
retries: int = Field(3, description="Max retry attempts.")
|
|
4420
|
+
timeout: int = Field(300, description="Execution timeout seconds.")
|
|
4421
|
+
|
|
4422
|
+
|
|
4423
|
+
class VectorModel(str, Enum):
|
|
4424
|
+
OPENAI_ADA = "text-embedding-3-small"
|
|
4425
|
+
COHERE_V3 = "embed-english-v3.0"
|
|
4426
|
+
|
|
4427
|
+
|
|
4428
|
+
class MemoryRequest(BaseRequest):
|
|
4429
|
+
"""
|
|
4430
|
+
[THE CORTEX KEEPER'S PLEA]
|
|
4431
|
+
Manage Semantic Memory (Embeddings & Vector Search).
|
|
4432
|
+
"""
|
|
4433
|
+
collection: str = Field(..., description="Logical grouping (Table/Namespace).")
|
|
4434
|
+
action: str = Field(..., pattern=r"^(upsert|query|delete|purge)$")
|
|
4435
|
+
|
|
4436
|
+
# For Upsert
|
|
4437
|
+
text: Optional[Union[str, List[str]]] = Field(None, description="Raw text to embed and store.")
|
|
4438
|
+
metadata: Optional[Union[Dict, List[Dict]]] = Field(None, description="Payload to store with vectors.")
|
|
4439
|
+
ids: Optional[Union[str, List[str]]] = Field(None, description="Specific IDs (optional, auto-generated if void).")
|
|
4440
|
+
|
|
4441
|
+
# For Query
|
|
4442
|
+
query_text: Optional[str] = Field(None, description="Concept to search for.")
|
|
4443
|
+
top_k: int = Field(5, description="Number of memories to recall.")
|
|
4444
|
+
threshold: float = Field(0.7, description="Minimum similarity score.")
|
|
4445
|
+
|
|
4446
|
+
# Configuration
|
|
4447
|
+
model: VectorModel = Field(VectorModel.OPENAI_ADA, description="Embedding Model.")
|
|
4448
|
+
|
|
4449
|
+
|
|
4450
|
+
class CacheRequest(BaseRequest):
|
|
4451
|
+
"""
|
|
4452
|
+
=============================================================================
|
|
4453
|
+
== THE OMEGA CACHE REQUEST (V-Ω-TOTALITY-V110-HEALED) ==
|
|
4454
|
+
=============================================================================
|
|
4455
|
+
LIF: ∞ | ROLE: EPHEMERAL_STATE_VESSEL | RANK: LEGENDARY
|
|
4456
|
+
|
|
4457
|
+
The definitive contract for all Stratum-8 (Redis) interactions.
|
|
4458
|
+
Healed of the 'AttributeError' heresy through Forensic Metadata Inception.
|
|
4459
|
+
"""
|
|
4460
|
+
model_config = ConfigDict(extra='allow', populate_by_name=True)
|
|
4461
|
+
|
|
4462
|
+
# --- 1. THE COORDINATES ---
|
|
4463
|
+
key: str = Field(..., description="The unique identifier in the Ephemeral Vault.")
|
|
4464
|
+
action: Literal["get", "set", "delete", "increment", "lock", "exists", "unlock", "expire"] = Field(
|
|
4465
|
+
..., description="The kinetic rite to perform on the vault."
|
|
4466
|
+
)
|
|
4467
|
+
|
|
4468
|
+
# --- 2. THE MATTER ---
|
|
4469
|
+
value: Optional[Any] = Field(
|
|
4470
|
+
default=None,
|
|
4471
|
+
description="The data-soul to store (Required for 'set' and 'lock')."
|
|
4472
|
+
)
|
|
4473
|
+
|
|
4474
|
+
# --- 3. THE PHYSICS ---
|
|
4475
|
+
ttl: int = Field(
|
|
4476
|
+
default=3600,
|
|
4477
|
+
description="Time-to-live in seconds. 0 for eternity."
|
|
4478
|
+
)
|
|
4479
|
+
amount: int = Field(
|
|
4480
|
+
default=1,
|
|
4481
|
+
description="The delta for 'increment' operations."
|
|
4482
|
+
)
|
|
4483
|
+
|
|
4484
|
+
# =========================================================================
|
|
4485
|
+
# == [ASCENSION 1]: THE FORENSIC METADATA ENVELOPE (THE CURE) ==
|
|
4486
|
+
# =========================================================================
|
|
4487
|
+
# This slot is now mandatory for all requests to ensure 100% compatibility
|
|
4488
|
+
# with the Gnostic Middleware Spine (Audit Logging, Tracing, Governance).
|
|
4489
|
+
metadata: Dict[str, Any] = Field(
|
|
4490
|
+
default_factory=dict,
|
|
4491
|
+
description="Forensic context (trace_id, novalym_id, etc.) for the Audit Scribe."
|
|
4492
|
+
)
|
|
4493
|
+
|
|
4494
|
+
# =========================================================================
|
|
4495
|
+
|
|
4496
|
+
def __repr__(self) -> str:
|
|
4497
|
+
"""PII-Safe representation for logs."""
|
|
4498
|
+
return f"<Cache:{self.action} key={self.key} trace={self.metadata.get('trace_id', 'None')}>"
|
|
4499
|
+
|
|
4500
|
+
|
|
4501
|
+
class SheetProvider(str, Enum):
|
|
4502
|
+
GOOGLE = "google"
|
|
4503
|
+
AIRTABLE = "airtable"
|
|
4504
|
+
|
|
4505
|
+
|
|
4506
|
+
class SheetRequest(BaseRequest):
|
|
4507
|
+
"""
|
|
4508
|
+
[THE GRID MASTER'S PLEA]
|
|
4509
|
+
Interact with Spreadsheets and Smart Grids.
|
|
4510
|
+
"""
|
|
4511
|
+
provider: SheetProvider = Field(default=SheetProvider.GOOGLE)
|
|
4512
|
+
action: str = Field(..., pattern=r"^(read|append|update|clear|create_tab)$")
|
|
4513
|
+
|
|
4514
|
+
# Targeting
|
|
4515
|
+
base_id: str = Field(..., description="Spreadsheet ID or Airtable Base ID.")
|
|
4516
|
+
table_name: str = Field(..., description="Sheet name or Table name.")
|
|
4517
|
+
|
|
4518
|
+
# Data
|
|
4519
|
+
rows: List[Dict[str, Any]] = Field(default_factory=list, description="Data rows.")
|
|
4520
|
+
row_id: Optional[str] = Field(None, description="Row ID for updates (Airtable only).")
|
|
4521
|
+
|
|
4522
|
+
# Tuning
|
|
4523
|
+
range: Optional[str] = Field(None, description="A1 notation range (Google only).")
|
|
4524
|
+
value_input_option: str = Field("USER_ENTERED", description="Google: RAW or USER_ENTERED.")
|
|
4525
|
+
|
|
4526
|
+
|
|
4527
|
+
class TwilioRequest(BaseRequest):
|
|
4528
|
+
"""
|
|
4529
|
+
=============================================================================
|
|
4530
|
+
== THE TELEPHONIC VESSEL (V-Ω-OMNICHANNEL-GOD-OBJECT) ==
|
|
4531
|
+
=============================================================================
|
|
4532
|
+
LIF: ∞ | ROLE: CARRIER_INTENT | RANK: SOVEREIGN
|
|
4533
|
+
|
|
4534
|
+
The one true vessel for all interactions with the Global Carrier Grid.
|
|
4535
|
+
It unifies Messaging, Provisioning, Intelligence, and Compliance into a
|
|
4536
|
+
single, polymorphic contract.
|
|
4537
|
+
"""
|
|
4538
|
+
model_config = ConfigDict(extra='ignore', populate_by_name=True)
|
|
4539
|
+
|
|
4540
|
+
# --- 1. THE RITE OF ACTION ---
|
|
4541
|
+
action: Literal[
|
|
4542
|
+
# Kinetic
|
|
4543
|
+
"send", "send_sms", "send_mms", "broadcast",
|
|
4544
|
+
# Infrastructure
|
|
4545
|
+
"search", "buy", "configure", "release", "update",
|
|
4546
|
+
# Intelligence
|
|
4547
|
+
"lookup", "validate",
|
|
4548
|
+
# Compliance (A2P 10DLC)
|
|
4549
|
+
"register_brand", "register_campaign", "link_number"
|
|
4550
|
+
] = Field(..., description="The Telephonic Rite to perform.")
|
|
4551
|
+
|
|
4552
|
+
# --- 2. KINETIC TARGETING (MESSAGING) ---
|
|
4553
|
+
to_number: Optional[str] = Field(None, alias="recipient", description="Target E.164 coordinate.")
|
|
4554
|
+
from_number: Optional[str] = Field(None, alias="sender", description="Origin E.164 coordinate.")
|
|
4555
|
+
messaging_service_sid: Optional[str] = Field(None, description="A2P Messaging Service SID (MG...).")
|
|
4556
|
+
|
|
4557
|
+
body: Optional[str] = Field(None, alias="content", description="The text payload.")
|
|
4558
|
+
media_url: Optional[Union[str, List[str]]] = Field(None, description="List of media URLs for MMS.")
|
|
4559
|
+
|
|
4560
|
+
# Advanced Kinetic Physics
|
|
4561
|
+
status_callback: Optional[str] = Field(None, description="Webhook for delivery confirmation.")
|
|
4562
|
+
validity_period: Optional[int] = Field(14400, description="Seconds before message expires (TTL).")
|
|
4563
|
+
schedule_type: Optional[Literal["fixed"]] = Field(None, description="For scheduled messages.")
|
|
4564
|
+
send_at: Optional[str] = Field(None, description="ISO8601 timestamp for scheduled delivery.")
|
|
4565
|
+
|
|
4566
|
+
# --- 3. INFRASTRUCTURE SCRYING (PROVISIONING) ---
|
|
4567
|
+
country_code: str = Field("US", description="ISO 3166-1 alpha-2 Country Code (e.g., US, GB, DE).")
|
|
4568
|
+
area_code: Optional[str] = Field(None, description="3-digit regional prefix.")
|
|
4569
|
+
contains: Optional[str] = Field(None, description="Sequence of digits the number must contain.")
|
|
4570
|
+
limit: int = Field(5, description="Maximum number of results to scry.")
|
|
4571
|
+
|
|
4572
|
+
# Capability Filters
|
|
4573
|
+
sms_enabled: bool = Field(True, description="Must support SMS.")
|
|
4574
|
+
mms_enabled: bool = Field(True, description="Must support MMS.")
|
|
4575
|
+
voice_enabled: bool = Field(True, description="Must support Voice.")
|
|
4576
|
+
|
|
4577
|
+
# --- 4. ASSET MANAGEMENT (CONFIGURATION) ---
|
|
4578
|
+
phone_number: Optional[str] = Field(None, description="The E.164 number to act upon.")
|
|
4579
|
+
sid: Optional[str] = Field(None, description="The Twilio Resource SID (PN..., SM..., MG...).")
|
|
4580
|
+
friendly_name: Optional[str] = Field(None, description="Human-readable label for the asset.")
|
|
4581
|
+
|
|
4582
|
+
# Webhook Bindings
|
|
4583
|
+
voice_url: Optional[str] = Field(None, description="Webhook for inbound calls.")
|
|
4584
|
+
sms_url: Optional[str] = Field(None, description="Webhook for inbound messages.")
|
|
4585
|
+
status_callback_method: Literal["POST", "GET"] = Field("POST", description="HTTP Method for webhooks.")
|
|
4586
|
+
|
|
4587
|
+
# --- 5. INTELLIGENCE (LOOKUPS) ---
|
|
4588
|
+
include_name: bool = Field(False, description="Perform CNAM (Caller ID) lookup.")
|
|
4589
|
+
include_carrier: bool = Field(True, description="Perform HLR Carrier lookup.")
|
|
4590
|
+
|
|
4591
|
+
# --- 6. REGULATORY COMPLIANCE (A2P 10DLC) ---
|
|
4592
|
+
# Identity
|
|
4593
|
+
legal_name: Optional[str] = Field(None, alias="business_name", description="Legal Business Name.")
|
|
4594
|
+
email: Optional[str] = Field(None, description="Contact email for compliance.")
|
|
4595
|
+
website: Optional[str] = Field(None, description="Business URL.")
|
|
4596
|
+
tax_id: Optional[str] = Field(None, alias="ein", description="EIN or Tax ID.")
|
|
4597
|
+
address_sid: Optional[str] = Field(None, description="Twilio Address SID (AD...).")
|
|
4598
|
+
|
|
4599
|
+
# Campaign
|
|
4600
|
+
brand_sid: Optional[str] = Field(None, description="A2P Brand SID (BZ...).")
|
|
4601
|
+
use_case: Optional[str] = Field("LOW_VOLUME_MIXED", description="Campaign Use Case.")
|
|
4602
|
+
description: Optional[str] = Field(None, description="Campaign Description for carrier review.")
|
|
4603
|
+
sample_msgs: Optional[List[str]] = Field(None, description="Sample messages for compliance audit.")
|
|
4604
|
+
policy_sid: Optional[str] = Field(None, description="Regulatory Policy SID.")
|
|
4605
|
+
|
|
4606
|
+
# --- 7. METAPHYSICS ---
|
|
4607
|
+
metadata: Dict[str, Any] = Field(default_factory=dict, description="Contextual Gnosis.")
|
|
4608
|
+
|
|
4609
|
+
@field_validator('media_url', mode='before')
|
|
4610
|
+
@classmethod
|
|
4611
|
+
def unify_list(cls, v: Any) -> Optional[List[str]]:
|
|
4612
|
+
"""Transmutes a single string into a list of strings."""
|
|
4613
|
+
if isinstance(v, str):
|
|
4614
|
+
return [v]
|
|
4615
|
+
return v
|
|
4616
|
+
|
|
4617
|
+
@model_validator(mode='after')
|
|
4618
|
+
def validate_kinetics(self) -> 'TwilioRequest':
|
|
4619
|
+
"""Ensures the Vessel is watertight based on the Rite."""
|
|
4620
|
+
action = self.action
|
|
4621
|
+
|
|
4622
|
+
# Kinetic Validation
|
|
4623
|
+
if action in ['send', 'send_sms', 'send_mms']:
|
|
4624
|
+
if not self.to_number:
|
|
4625
|
+
raise ValueError(f"Rite '{action}' requires 'to_number'.")
|
|
4626
|
+
if not self.body and not self.media_url:
|
|
4627
|
+
raise ValueError(f"Rite '{action}' requires 'body' or 'media_url'.")
|
|
4628
|
+
|
|
4629
|
+
# Provisioning Validation
|
|
4630
|
+
if action == 'buy':
|
|
4631
|
+
if not self.phone_number:
|
|
4632
|
+
raise ValueError(f"Rite '{action}' requires 'phone_number'.")
|
|
4633
|
+
|
|
4634
|
+
# Search Validation
|
|
4635
|
+
if action == 'search':
|
|
4636
|
+
if not self.country_code:
|
|
4637
|
+
# Default applied in field, but safety check
|
|
4638
|
+
raise ValueError("Rite 'search' requires 'country_code'.")
|
|
4639
|
+
|
|
4640
|
+
return self
|
|
4641
|
+
|
|
4642
|
+
|
|
4643
|
+
class TwilioA2PRequest(BaseRequest):
|
|
4644
|
+
"""[THE REGULATORY PLEA] Command Twilio to execute Trust Hub rites."""
|
|
4645
|
+
action: str = Field(..., pattern=r"^(create_brand|create_campaign|link_number|check_status)$")
|
|
4646
|
+
|
|
4647
|
+
# Brand Matter
|
|
4648
|
+
legal_name: Optional[str] = None
|
|
4649
|
+
tax_id: Optional[str] = None # EIN/Registration Number
|
|
4650
|
+
website: Optional[str] = None
|
|
4651
|
+
|
|
4652
|
+
# Campaign Matter
|
|
4653
|
+
use_case: str = Field("CUSTOMER_CARE", description="A2P Use Case code.")
|
|
4654
|
+
description: str = Field(..., description="Nature of the messaging.")
|
|
4655
|
+
sample_msgs: List[str] = Field(default_factory=list)
|
|
4656
|
+
|
|
4657
|
+
# Binding Matter
|
|
4658
|
+
messaging_service_sid: Optional[str] = None
|
|
4659
|
+
phone_number_sid: Optional[str] = None
|
|
4660
|
+
|
|
4661
|
+
|
|
4662
|
+
def get_default_signup_url():
|
|
4663
|
+
"""Dynamically determines the canonical sign-up path based on environment."""
|
|
4664
|
+
# Priority: Env variable > Custom Domain > Default Path
|
|
4665
|
+
domain = os.environ.get("NEXT_PUBLIC_BASE_DOMAIN", "https://novalym.com")
|
|
4666
|
+
# Ensure it uses the explicit sign-up path
|
|
4667
|
+
return f"{domain}/sign-up"
|
|
4668
|
+
|
|
4669
|
+
|
|
4670
|
+
class ClerkRequest(BaseRequest):
|
|
4671
|
+
"""
|
|
4672
|
+
=============================================================================
|
|
4673
|
+
== THE IDENTITY VESSEL (V-Ω-CLERK-ULTIMA-V2) ==
|
|
4674
|
+
=============================================================================
|
|
4675
|
+
LIF: ∞ | ROLE: IDENTITY_GOVERNOR | RANK: LEGENDARY
|
|
4676
|
+
|
|
4677
|
+
The definitive contract for all interactions with the Clerk.com API,
|
|
4678
|
+
optimized for self-service sign-up flows.
|
|
4679
|
+
"""
|
|
4680
|
+
model_config = ConfigDict(extra='ignore', populate_by_name=True)
|
|
4681
|
+
|
|
4682
|
+
# --- THE RITE OF ACTION ---
|
|
4683
|
+
action: Literal[
|
|
4684
|
+
"invite", "revoke_invite", "list_invites", # Invitations
|
|
4685
|
+
"get_user", "update_user", "delete_user", "list_users", # Users
|
|
4686
|
+
"get_org", "create_org", "update_org", "add_member", # Organizations
|
|
4687
|
+
"update_metadata", "get_sessions", "kick_session" # Meta & Governance
|
|
4688
|
+
] = Field(..., description="The Auth Rite to conduct.")
|
|
4689
|
+
|
|
4690
|
+
# --- COORDINATES ---
|
|
4691
|
+
email: Optional[str] = Field(None, description="The primary soul anchor.")
|
|
4692
|
+
user_id: Optional[str] = Field(None, description="Clerk User ID (user_...).")
|
|
4693
|
+
org_id: Optional[str] = Field(None, description="Clerk Org ID (org_...).")
|
|
4694
|
+
invitation_id: Optional[str] = Field(None, description="Invite ID (inv_...).")
|
|
4695
|
+
session_id: Optional[str] = Field(None, description="Session ID (sess_...).")
|
|
4696
|
+
|
|
4697
|
+
# --- THE GNOSTIC PAYLOAD ---
|
|
4698
|
+
public_metadata: Optional[Dict[str, Any]] = Field(None, description="Visible to the frontend UI.")
|
|
4699
|
+
private_metadata: Optional[Dict[str, Any]] = Field(None, description="Visible only to the Python Brain.")
|
|
4700
|
+
unsafe_metadata: Optional[Dict[str, Any]] = Field(None, description="Mutable by the user (rarely used).")
|
|
4701
|
+
|
|
4702
|
+
# --- PARAMETERS ---
|
|
4703
|
+
first_name: Optional[str] = None
|
|
4704
|
+
last_name: Optional[str] = None
|
|
4705
|
+
role: Optional[str] = Field("basic_member", description="Org role (admin/member).")
|
|
4706
|
+
|
|
4707
|
+
# [THE CURE]: DYNAMIC SIGN-UP ANCHOR
|
|
4708
|
+
# The default is now the initial sign-up portal, ensuring the token is processed.
|
|
4709
|
+
# We make it Optional, and the default is defined by the function above.
|
|
4710
|
+
redirect_url: Optional[str] = Field(
|
|
4711
|
+
default_factory=get_default_signup_url,
|
|
4712
|
+
description="URL to redirect user to after an action (e.g., setting password)."
|
|
4713
|
+
)
|
|
4714
|
+
|
|
4715
|
+
limit: int = Field(10, ge=1, le=100)
|
|
4716
|
+
offset: int = Field(0, ge=0)
|
|
4717
|
+
|
|
4718
|
+
# --- SIMULATION ---
|
|
4719
|
+
simulation: bool = Field(False, description="Force Phantom Circuit even in Prod.")
|
|
4720
|
+
|
|
4721
|
+
|
|
4722
|
+
# =============================================================================
|
|
4723
|
+
# == THE TEMPORAL RITE TAXONOMY ==
|
|
4724
|
+
# =============================================================================
|
|
4725
|
+
|
|
4726
|
+
class TemporalAction(str, Enum):
|
|
4727
|
+
SCRY_SLOTS = "scry_slots"
|
|
4728
|
+
BOOK_CONFIRM = "book_confirm"
|
|
4729
|
+
CANCEL_EVENT = "cancel_event"
|
|
4730
|
+
SYNC_CHECK = "sync_check"
|
|
4731
|
+
VERIFY_STATUS = "verify_status"
|
|
4732
|
+
RESCHEDULE = "reschedule"
|
|
4733
|
+
class TemporalProvider(str, Enum):
|
|
4734
|
+
CAL_COM = "cal.com"
|
|
4735
|
+
GOOGLE = "google"
|
|
4736
|
+
OUTLOOK = "outlook"
|
|
4737
|
+
CALENDLY = "calendly"
|
|
4738
|
+
CUSTOM = "custom"
|
|
4739
|
+
|
|
4740
|
+
# =============================================================================
|
|
4741
|
+
# == THE TEMPORAL TARGET (V-Ω-SOVEREIGN_COORDINATE) ==
|
|
4742
|
+
# =============================================================================
|
|
4743
|
+
# =============================================================================
|
|
4744
|
+
# == THE TEMPORAL TARGET (V-Ω-SOVEREIGN_COORDINATE) ==
|
|
4745
|
+
# =============================================================================
|
|
4746
|
+
class CalendarTarget(BaseModel):
|
|
4747
|
+
"""
|
|
4748
|
+
[THE GNOSTIC COORDINATE]
|
|
4749
|
+
The immutable DNA of the target calendar reality (The Client's Config).
|
|
4750
|
+
"""
|
|
4751
|
+
model_config = ConfigDict(extra='ignore', frozen=True)
|
|
4752
|
+
|
|
4753
|
+
# --- PRIMARY IDENTITY ANCHORS (Pulled from Client's JSONB) ---
|
|
4754
|
+
username: str = Field(..., description="The user's unique Cal.com namespace.")
|
|
4755
|
+
event_type_id: Union[int, str] = Field(..., description="The specific event/meeting type slug or ID.")
|
|
4756
|
+
|
|
4757
|
+
# --- KINETIC KEYS (Override Fuel - Defaults to Master Key) ---
|
|
4758
|
+
api_key: Optional[str] = Field(None, description="A tenant-specific Cal.com API key, if overriding Master.")
|
|
4759
|
+
|
|
4760
|
+
# --- PHYSICS & BEHAVIOR ---
|
|
4761
|
+
timezone: str = Field("UTC", description="The target timezone for displaying slots.")
|
|
4762
|
+
buffer_mins: int = Field(60, ge=0, description="The 'Biological Cooldown' - Safety minutes between calls.")
|
|
4763
|
+
|
|
4764
|
+
|
|
4765
|
+
# =============================================================================
|
|
4766
|
+
# == THE CALENDAR REQUEST (V-Ω-ULTIMA_TOTALITY_FINALIS_V3) ==
|
|
4767
|
+
# =============================================================================
|
|
4768
|
+
class CalendarRequest(BaseRequest):
|
|
4769
|
+
"""
|
|
4770
|
+
=============================================================================
|
|
4771
|
+
== THE CALENDAR REQUEST (V-Ω-ULTIMA_TOTALITY_FINALIS_V3) ==
|
|
4772
|
+
=============================================================================
|
|
4773
|
+
LIF: ∞ | ROLE: SPACETIME_COORDINATE_PLEA | RANK: SOVEREIGN
|
|
4774
|
+
|
|
4775
|
+
The final, definitive, and unbreakable Gnostic Contract for all temporal movements.
|
|
4776
|
+
It is the centralized source of truth for the entire Scaffold Monolith.
|
|
4777
|
+
"""
|
|
4778
|
+
model_config = ConfigDict(
|
|
4779
|
+
extra='ignore',
|
|
4780
|
+
frozen=True,
|
|
4781
|
+
populate_by_name=True,
|
|
4782
|
+
arbitrary_types_allowed=True
|
|
4783
|
+
)
|
|
4784
|
+
|
|
4785
|
+
# --- 1. THE SACRED ACTION ---
|
|
4786
|
+
action: TemporalAction = Field(..., description="The specific temporal movement to conduct.")
|
|
4787
|
+
provider: TemporalProvider = Field(default=TemporalProvider.CAL_COM, description="The celestial scheduling engine.")
|
|
4788
|
+
|
|
4789
|
+
# --- 2. THE TARGET REALITY (CRITICAL SUTURE) ---
|
|
4790
|
+
# This carries all the client's config data for the Artisan to use.
|
|
4791
|
+
target: CalendarTarget = Field(..., description="The immutable configuration and identity of the target calendar.")
|
|
4792
|
+
|
|
4793
|
+
# --- 3. THE LEAD'S BIOMETRIC SOUL (For Booking) ---
|
|
4794
|
+
novalym_id: str = Field(..., description="The Sovereign ID of the Client Entity.")
|
|
4795
|
+
lead_phone: str = Field(..., description="The E.164 coordinate of the Lead.")
|
|
4796
|
+
lead_name: Optional[str] = Field("Valued Client", description="The humanized name for the invite.")
|
|
4797
|
+
lead_email: Optional[EmailStr] = Field(None, description="The digital soul coordinate for the invite.")
|
|
4798
|
+
|
|
4799
|
+
# --- 4. THE CONVERSATIONAL STATE (For Multi-Turn Booking) ---
|
|
4800
|
+
selected_option: Optional[Literal["A", "B", "C"]] = Field(None,
|
|
4801
|
+
description="The A/B/C slot identifier chosen by the lead.")
|
|
4802
|
+
explicit_timestamp: Optional[str] = Field(None, description="A direct ISO8601 string for booking.")
|
|
4803
|
+
|
|
4804
|
+
# --- 5. PHYSICS & OVERRIDES ---
|
|
4805
|
+
duration_mins: int = Field(default=15, ge=5, description="The mass of the meeting in time.")
|
|
4806
|
+
force: bool = Field(default=False, description="Bypass safety checks and cache.")
|
|
4807
|
+
|
|
4808
|
+
# --- 6. METADATA & FORENSICS ---
|
|
4809
|
+
metadata: Dict[str, Any] = Field(default_factory=dict,
|
|
4810
|
+
description="Forensic metadata (trace_id, simulation, ui_hints).")
|
|
4811
|
+
|
|
4812
|
+
# =========================================================================
|
|
4813
|
+
# == COMPUTED REALITIES (ASCENSION 6 & 5 & 3) ==
|
|
4814
|
+
# =========================================================================
|
|
4815
|
+
|
|
4816
|
+
@computed_field
|
|
4817
|
+
@property
|
|
4818
|
+
def is_simulation(self) -> bool:
|
|
4819
|
+
"""Adjudicates reality mode from multiple sources."""
|
|
4820
|
+
if self.metadata.get("simulation") is not None:
|
|
4821
|
+
return bool(self.metadata["simulation"])
|
|
4822
|
+
return os.environ.get("SCAFFOLD_ENV") == "development"
|
|
4823
|
+
|
|
4824
|
+
@computed_field
|
|
4825
|
+
@property
|
|
4826
|
+
def merkle_id(self) -> str:
|
|
4827
|
+
"""[ASCENSION 3]: Collision avoidance fingerprint."""
|
|
4828
|
+
raw = f"{self.novalym_id}:{self.lead_phone}:{self.action}"
|
|
4829
|
+
return hashlib.sha256(raw.encode()).hexdigest()[:12]
|
|
4830
|
+
|
|
4831
|
+
# =========================================================================
|
|
4832
|
+
# == THE ALCHEMICAL VALIDATORS (ASCENSION 24 & 4) ==
|
|
4833
|
+
# =========================================================================
|
|
4834
|
+
|
|
4835
|
+
@field_validator('lead_phone', mode='before')
|
|
4836
|
+
@classmethod
|
|
4837
|
+
def purify_phone(cls, v: Any) -> str:
|
|
4838
|
+
"""The Telephonic Healer (E.164 Enforcer)."""
|
|
4839
|
+
if not v: return ""
|
|
4840
|
+
clean = "".join(c for c in str(v) if c.isdigit() or c == '+')
|
|
4841
|
+
if not clean.startswith('+'):
|
|
4842
|
+
if len(clean) == 10: return f"+1{clean}"
|
|
4843
|
+
return f"+{clean}"
|
|
4844
|
+
return clean
|
|
4845
|
+
|
|
4846
|
+
@model_validator(mode="after")
|
|
4847
|
+
def verify_rite_viability(self) -> 'CalendarRequest':
|
|
4848
|
+
"""FINALITY VOW - Logic Gates."""
|
|
4849
|
+
if self.action == TemporalAction.BOOK_CONFIRM and not (self.selected_option or self.explicit_timestamp):
|
|
4850
|
+
if not self.is_simulation:
|
|
4851
|
+
raise ValueError("The 'book_confirm' rite requires a selection.")
|
|
4852
|
+
return self
|
|
4853
|
+
|
|
4854
|
+
# == SCRIPTURE SEALED: THE CALENDAR CONTRACT REACHES TOTALITY ==
|