@atmem/architect 0.0.0-stage → 0.2.0-alpha.4.1
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.
- package/CONSTITUTION.md +144 -0
- package/README.md +33 -2
- package/agent-skills/discovery/SKILL.md +48 -0
- package/agent-skills/discovery/topics.json +139 -0
- package/agent-skills/generation-capabilities.json +760 -0
- package/agent-skills/service-lifecycle.json +21 -0
- package/agent-skills/specialists/architecture/SKILL.md +15 -0
- package/agent-skills/specialists/aws/SKILL.md +17 -0
- package/agent-skills/specialists/azure/SKILL.md +7 -0
- package/agent-skills/specialists/composition/SKILL.md +17 -0
- package/agent-skills/specialists/devops/SKILL.md +10 -0
- package/agent-skills/specialists/finops/SKILL.md +7 -0
- package/agent-skills/specialists/gcp/SKILL.md +7 -0
- package/agent-skills/specialists/ibm/SKILL.md +7 -0
- package/agent-skills/specialists/manifest.json +13 -0
- package/agent-skills/specialists/pulumi/SKILL.md +7 -0
- package/agent-skills/specialists/security/SKILL.md +7 -0
- package/agent-skills/specialists/terraform/SKILL.md +14 -0
- package/agent-skills/upstream/aws/LICENSE +175 -0
- package/agent-skills/upstream/aws/SKILL.md +125 -0
- package/agent-skills/upstream/azure/LICENSE +21 -0
- package/agent-skills/upstream/azure/SKILL.md +387 -0
- package/agent-skills/upstream/gcp/LICENSE +202 -0
- package/agent-skills/upstream/gcp/SKILL.md +159 -0
- package/agent-skills/upstream/manifest.json +57 -0
- package/agent-skills/upstream/pulumi/LICENSE +201 -0
- package/agent-skills/upstream/pulumi/SKILL.md +501 -0
- package/agent-skills/upstream/terraform/LICENSE +373 -0
- package/agent-skills/upstream/terraform/SKILL.md +316 -0
- package/agent-skills/workflows/workflows.json +601 -0
- package/cli/architect.mjs +3 -0
- package/cli/runtime.mjs +115 -0
- package/dist/assets/html2canvas.esm-QH1iLAAe.js +22 -0
- package/dist/assets/index-B97MkVMs.css +1 -0
- package/dist/assets/index-qtCM2D7O.js +21271 -0
- package/dist/assets/index.es-C6C0sneB.js +18 -0
- package/dist/assets/purify.es-CAi2OJFm.js +3 -0
- package/dist/assets/visual-export-DjbjgQbA.js +173 -0
- package/dist/favicon.svg +2 -0
- package/dist/fonts/DM-Sans-OFL.txt +93 -0
- package/dist/fonts/Manrope-OFL.txt +93 -0
- package/dist/fonts/NotoSans-Regular.ttf +0 -0
- package/dist/fonts/OFL.txt +94 -0
- package/dist/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/dist/index.html +4 -0
- package/dist/licenses/aws-architect-LICENSE.txt +17 -0
- package/dist/licenses/aws-mcp-LICENSE.txt +175 -0
- package/dist/licenses/aws-mcp-NOTICE.txt +1 -0
- package/dist/licenses/cloud-emulation-notices.txt +36619 -0
- package/dist/licenses/dependency-notices.txt +6379 -0
- package/dist/licenses/emulation-notices.txt +717 -0
- package/dist/licenses/github-copilot-sdk-LICENSE.txt +21 -0
- package/dist/licenses/memory-dependency-notices.txt +3319 -0
- package/dist/licenses/openarchflow-LICENSE.txt +21 -0
- package/dist/licenses/python-dependency-notices.txt +11951 -0
- package/docs/upstream-lock.json +26 -0
- package/knowledge/engineering-practices.json +536 -0
- package/package.json +30 -4
- package/packaging/uv-release-lock.json +54 -0
- package/public/licenses/aws-architect-LICENSE.txt +17 -0
- package/public/licenses/aws-mcp-LICENSE.txt +175 -0
- package/public/licenses/aws-mcp-NOTICE.txt +1 -0
- package/public/licenses/cloud-emulation-notices.txt +36619 -0
- package/public/licenses/dependency-notices.txt +6379 -0
- package/public/licenses/emulation-notices.txt +717 -0
- package/public/licenses/github-copilot-sdk-LICENSE.txt +21 -0
- package/public/licenses/memory-dependency-notices.txt +3319 -0
- package/public/licenses/openarchflow-LICENSE.txt +21 -0
- package/public/licenses/python-dependency-notices.txt +11951 -0
- package/scripts/terraform-render.mjs +8 -0
- package/server/__init__.py +0 -0
- package/server/abstraction.py +28 -0
- package/server/agent_runtime.py +153 -0
- package/server/app.py +257 -0
- package/server/architect.py +112 -0
- package/server/architecture_activity.py +67 -0
- package/server/attachments.py +101 -0
- package/server/cloud-emulation-requirements.txt +29 -0
- package/server/codex_app_server.py +219 -0
- package/server/codex_engineering_backend.py +266 -0
- package/server/codex_worker_policy.py +170 -0
- package/server/contracts.py +315 -0
- package/server/copilot_worker.py +16 -0
- package/server/dependency_mirror.py +54 -0
- package/server/design_patch.py +43 -0
- package/server/emulation-requirements.txt +8 -0
- package/server/emulation_adapters.py +20 -0
- package/server/emulation_routes.py +98 -0
- package/server/emulation_worker.py +351 -0
- package/server/engineering_artifacts.py +215 -0
- package/server/engineering_assets/application-runtime.json +4372 -0
- package/server/engineering_assets/architecture_work.schema.json +79 -0
- package/server/engineering_assets/materialize_runtime.py +62 -0
- package/server/engineering_assets/prepare_tools.py +96 -0
- package/server/engineering_assets/sql_validation.py +59 -0
- package/server/engineering_contexts.py +120 -0
- package/server/engineering_delivery.py +210 -0
- package/server/engineering_finalization.py +210 -0
- package/server/engineering_handoff.py +163 -0
- package/server/engineering_jobs.py +206 -0
- package/server/engineering_knowledge.py +75 -0
- package/server/engineering_reconciliation.py +159 -0
- package/server/engineering_routes.py +469 -0
- package/server/engineering_sessions.py +273 -0
- package/server/engineering_tools.py +166 -0
- package/server/generation_lint.py +18 -0
- package/server/local_providers.py +181 -0
- package/server/local_validation.py +236 -0
- package/server/memory-requirements.lock +181 -0
- package/server/memory-requirements.txt +6 -0
- package/server/memory_routes.py +82 -0
- package/server/memory_service.py +273 -0
- package/server/memory_worker.py +66 -0
- package/server/openai_voice.py +80 -0
- package/server/packaged_app.py +9 -0
- package/server/pricing.py +84 -0
- package/server/process_control_observation.py +31 -0
- package/server/prompts.py +123 -0
- package/server/public_faq_emulation_worker.py +44 -0
- package/server/requirements.lock +1618 -0
- package/server/requirements.txt +68 -0
- package/server/runtime_dependency_locks.py +27 -0
- package/server/runtime_evidence.py +93 -0
- package/server/settings.py +14 -0
- package/server/skills.py +103 -0
- package/server/storage_emulation_worker.py +160 -0
- package/server/structured_emulation_worker.py +48 -0
- package/server/terraform_routes.py +118 -0
- package/server/upstream/__init__.py +0 -0
- package/server/upstream/agent/__init__.py +1 -0
- package/server/upstream/agent/aws_architect.py +600 -0
- package/server/upstream/agent/config/__init__.py +1 -0
- package/server/upstream/agent/config/agent_config.py +82 -0
- package/server/upstream/agent/config/prompts.py +138 -0
- package/server/upstream/agent/rate_limiter.py +62 -0
- package/server/upstream/utils/__init__.py +1 -0
- package/server/upstream/utils/file_writer.py +43 -0
- package/server/validation_applicability.py +85 -0
- package/server/validation_jobs.py +252 -0
- package/server/validation_workers.py +48 -0
- package/server/voice_routes.py +91 -0
- package/server/voice_worker.py +26 -0
- package/specs/028-convergence-evaluation/evidence/20261110-ibm-invoice-native/registry-structured/qualification.json +72 -0
- package/specs/028-convergence-evaluation/evidence/20261110-invoice-runtime/durable-current/receipt.json +61 -0
- package/specs/029-general-purpose-engine/evidence/20261111-runtime-dependencies/sdk/receipt.json +22 -0
- package/src/ArchitectureActivity.jsx +54 -0
- package/src/ArchitectureWorkPanel.jsx +46 -0
- package/src/ArtifactChecks.jsx +49 -0
- package/src/BlockRequirements.jsx +13 -0
- package/src/BrainActivity.jsx +11 -0
- package/src/ChatMessage.jsx +19 -0
- package/src/ChatResizeHandle.jsx +6 -0
- package/src/CodePreview.jsx +8 -0
- package/src/ComponentReview.jsx +31 -0
- package/src/DeliveryViews.jsx +59 -0
- package/src/EmulationPanel.jsx +44 -0
- package/src/EngagementViews.jsx +385 -0
- package/src/EngineeringPanel.jsx +151 -0
- package/src/ImplementationDelivery.jsx +55 -0
- package/src/JourneyViews.jsx +400 -0
- package/src/MemoryPanel.jsx +46 -0
- package/src/OpenAIVoicePanel.jsx +65 -0
- package/src/OutputsView.jsx +65 -0
- package/src/TerraformView.jsx +57 -0
- package/src/WorkbenchDialogs.jsx +532 -0
- package/src/activity-presentation.mjs +28 -0
- package/src/ai-qualification-scenarios.mjs +31 -0
- package/src/approval-application-files.mjs +32 -0
- package/src/approval-applications.mjs +82 -0
- package/src/approval-spec-kit.mjs +30 -0
- package/src/architecture-activity.css +28 -0
- package/src/architecture-activity.mjs +63 -0
- package/src/architecture-work.mjs +176 -0
- package/src/artifact-work.mjs +103 -0
- package/src/async-documents.mjs +191 -0
- package/src/atflow.css +1140 -0
- package/src/atforma.css +748 -0
- package/src/atmem-tokens.css +79 -0
- package/src/aws-preflight.mjs +60 -0
- package/src/aws-public-faq.mjs +102 -0
- package/src/aws-validation-scenarios.mjs +10 -0
- package/src/aws-validation.mjs +48 -0
- package/src/azure-plan-mocks.mjs +25 -0
- package/src/azure-structured.mjs +133 -0
- package/src/bedrock-summary.mjs +152 -0
- package/src/bounded-rag.mjs +60 -0
- package/src/brand.css +9 -0
- package/src/canvas-view.mjs +28 -0
- package/src/capability-composition.mjs +44 -0
- package/src/chat-attachments.mjs +13 -0
- package/src/cloud-provider-locks.mjs +9 -0
- package/src/cloud-storage-scenarios.mjs +2 -0
- package/src/component-review.mjs +55 -0
- package/src/composition-spec-kit.mjs +30 -0
- package/src/consultation-context.mjs +15 -0
- package/src/consultation.mjs +52 -0
- package/src/container-contracts.mjs +5 -0
- package/src/container-inspection.mjs +75 -0
- package/src/container-runtime.mjs +30 -0
- package/src/container-security-inspection.mjs +49 -0
- package/src/container-terraform.mjs +109 -0
- package/src/conversation.mjs +17 -0
- package/src/core.mjs +863 -0
- package/src/cross-cloud-storage.mjs +100 -0
- package/src/delivery-capabilities.mjs +25 -0
- package/src/delivery.mjs +58 -0
- package/src/deployment-ownership.mjs +10 -0
- package/src/deployment-region.mjs +11 -0
- package/src/derive.mjs +31 -0
- package/src/design-build-flow.mjs +10 -0
- package/src/diagram-attention.mjs +24 -0
- package/src/discovery.mjs +359 -0
- package/src/document.mjs +170 -0
- package/src/emulation-feedback.mjs +61 -0
- package/src/emulation-guidance.mjs +37 -0
- package/src/engagement.mjs +274 -0
- package/src/engineering-client.mjs +73 -0
- package/src/engineering-defaults.mjs +17 -0
- package/src/engineering.css +31 -0
- package/src/enterprise-application.mjs +76 -0
- package/src/enterprise-aws-host-infrastructure.mjs +62 -0
- package/src/enterprise-aws-host-tests.mjs +15 -0
- package/src/enterprise-aws-infrastructure-tests.mjs +38 -0
- package/src/enterprise-aws-infrastructure.mjs +138 -0
- package/src/enterprise-google-infrastructure.mjs +84 -0
- package/src/enterprise-google-tests.mjs +25 -0
- package/src/estimate.mjs +188 -0
- package/src/existing-references.mjs +18 -0
- package/src/external-identities.mjs +17 -0
- package/src/faq-lambda-build.mjs +28 -0
- package/src/gcp-structured.mjs +104 -0
- package/src/generation-provider.mjs +7 -0
- package/src/generation-quality.mjs +69 -0
- package/src/handoff.mjs +141 -0
- package/src/ibm-registry.mjs +12 -0
- package/src/ibm-structured.mjs +103 -0
- package/src/identifiers.mjs +15 -0
- package/src/implementation-map.mjs +14 -0
- package/src/implementation-outcome.mjs +8 -0
- package/src/incomplete-terraform.mjs +9 -0
- package/src/integrations.ts +137 -0
- package/src/interface-contracts.mjs +30 -0
- package/src/invoice-application.mjs +66 -0
- package/src/invoice-aws-operations.mjs +136 -0
- package/src/invoice-aws.mjs +143 -0
- package/src/invoice-azure-operations.mjs +147 -0
- package/src/invoice-azure.mjs +134 -0
- package/src/invoice-builder.mjs +35 -0
- package/src/invoice-dependencies.mjs +43 -0
- package/src/invoice-gcp-operations.mjs +178 -0
- package/src/invoice-gcp.mjs +104 -0
- package/src/invoice-ibm-operations.mjs +278 -0
- package/src/invoice-ibm.mjs +142 -0
- package/src/invoice-operations.mjs +143 -0
- package/src/invoice-plan.mjs +45 -0
- package/src/invoice-region.mjs +6 -0
- package/src/invoice-spec-kit.mjs +61 -0
- package/src/invoice-state.mjs +7 -0
- package/src/invoice-terraform.mjs +29 -0
- package/src/invoice-tests.mjs +122 -0
- package/src/journey-workspace.css +72 -0
- package/src/journey.mjs +87 -0
- package/src/levels.mjs +145 -0
- package/src/local-agent.mjs +184 -0
- package/src/main.jsx +2458 -0
- package/src/model-policy-preflight.mjs +34 -0
- package/src/openai-voice.mjs +102 -0
- package/src/output-bundle.mjs +11 -0
- package/src/ownership-inspection.mjs +28 -0
- package/src/pack.mjs +201 -0
- package/src/pricing.mjs +31 -0
- package/src/production-state.mjs +8 -0
- package/src/project-copy.mjs +10 -0
- package/src/project-file.mjs +160 -0
- package/src/project-links.mjs +3 -0
- package/src/protected-state.mjs +43 -0
- package/src/public-faq-builder.mjs +19 -0
- package/src/public-faq-clouds.mjs +251 -0
- package/src/public-faq.mjs +122 -0
- package/src/pulumi.mjs +123 -0
- package/src/python-container.mjs +25 -0
- package/src/python-runtime.mjs +50 -0
- package/src/rag-handler.mjs +43 -0
- package/src/rag-web-assets.mjs +52 -0
- package/src/rag-web.mjs +68 -0
- package/src/records.mjs +177 -0
- package/src/resources.mjs +163 -0
- package/src/review.mjs +252 -0
- package/src/runtime/EnterpriseDocument.java +89 -0
- package/src/runtime/approved_http_destination.py +72 -0
- package/src/runtime/aws-lambda-qualification-lock.json +7 -0
- package/src/runtime/aws-python-lock.json +82 -0
- package/src/runtime/aws-web-python-lock.json +887 -0
- package/src/runtime/aws_json_model.py +42 -0
- package/src/runtime/azure-python-lock.json +863 -0
- package/src/runtime/azure-sources.json +8 -0
- package/src/runtime/azure-test-lock.json +23 -0
- package/src/runtime/azure_acceptance.py +192 -0
- package/src/runtime/azure_structured.py +153 -0
- package/src/runtime/bounded_rag.py +126 -0
- package/src/runtime/catalog_admin.py +70 -0
- package/src/runtime/cloud-sql-proxy-lock.json +8 -0
- package/src/runtime/cloud-sql-proxy-security-review.json +30 -0
- package/src/runtime/connector_cli.py +50 -0
- package/src/runtime/connector_sync.py +70 -0
- package/src/runtime/durable-python-lock.json +247 -0
- package/src/runtime/durable_workflow.py +325 -0
- package/src/runtime/enterprise-application-manifest.json +110 -0
- package/src/runtime/enterprise-application-sources.json +266 -0
- package/src/runtime/enterprise-auth-python-lock.json +592 -0
- package/src/runtime/enterprise-aws-host-bootstrap-source.json +1 -0
- package/src/runtime/enterprise-aws-host-probe-source.json +1 -0
- package/src/runtime/enterprise-aws-task-template.json +235 -0
- package/src/runtime/enterprise-document-lock.json +18 -0
- package/src/runtime/enterprise-document.Dockerfile +15 -0
- package/src/runtime/enterprise-runtime-aws-python-lock.json +1115 -0
- package/src/runtime/enterprise-runtime-azure-python-lock.json +1106 -0
- package/src/runtime/enterprise-runtime-gcp-python-lock.json +1060 -0
- package/src/runtime/enterprise-runtime-ibm-python-lock.json +1096 -0
- package/src/runtime/enterprise-runtime-python-lock.json +1058 -0
- package/src/runtime/enterprise-runtime.Dockerfile +15 -0
- package/src/runtime/enterprise-web-app.js +1 -0
- package/src/runtime/enterprise-web-entry.js +105 -0
- package/src/runtime/enterprise-web-lock.json +29 -0
- package/src/runtime/enterprise-web-notices.txt +229 -0
- package/src/runtime/enterprise-web.css +4 -0
- package/src/runtime/enterprise-web.html +8 -0
- package/src/runtime/enterprise_audit.py +91 -0
- package/src/runtime/enterprise_audit_schema.sql +25 -0
- package/src/runtime/enterprise_auth_schema.sql +67 -0
- package/src/runtime/enterprise_auth_store.py +241 -0
- package/src/runtime/enterprise_aws_host_bootstrap.py +120 -0
- package/src/runtime/enterprise_aws_host_probe.py +105 -0
- package/src/runtime/enterprise_aws_hosts.py +136 -0
- package/src/runtime/enterprise_aws_jobs.py +300 -0
- package/src/runtime/enterprise_aws_objects.py +93 -0
- package/src/runtime/enterprise_aws_transfer.py +83 -0
- package/src/runtime/enterprise_azure_batch_api.py +128 -0
- package/src/runtime/enterprise_azure_host.py +599 -0
- package/src/runtime/enterprise_azure_jobs.py +294 -0
- package/src/runtime/enterprise_azure_objects.py +234 -0
- package/src/runtime/enterprise_azure_pool.py +161 -0
- package/src/runtime/enterprise_azure_transfer.py +122 -0
- package/src/runtime/enterprise_configuration.py +136 -0
- package/src/runtime/enterprise_document.py +116 -0
- package/src/runtime/enterprise_document_cli.py +32 -0
- package/src/runtime/enterprise_document_contract.py +54 -0
- package/src/runtime/enterprise_document_job.py +109 -0
- package/src/runtime/enterprise_document_jobs.py +122 -0
- package/src/runtime/enterprise_document_jobs_schema.sql +23 -0
- package/src/runtime/enterprise_extraction_cache.py +186 -0
- package/src/runtime/enterprise_extraction_schema.sql +17 -0
- package/src/runtime/enterprise_google_jobs.py +275 -0
- package/src/runtime/enterprise_google_transfer.py +85 -0
- package/src/runtime/enterprise_http.py +212 -0
- package/src/runtime/enterprise_identity.py +52 -0
- package/src/runtime/enterprise_knowledge.py +152 -0
- package/src/runtime/enterprise_models.py +94 -0
- package/src/runtime/enterprise_native.py +181 -0
- package/src/runtime/enterprise_oauth.py +132 -0
- package/src/runtime/enterprise_operator.py +160 -0
- package/src/runtime/enterprise_parser_service.py +136 -0
- package/src/runtime/enterprise_parser_transport.py +68 -0
- package/src/runtime/enterprise_queries.py +255 -0
- package/src/runtime/enterprise_queries_schema.sql +27 -0
- package/src/runtime/enterprise_query_service.py +111 -0
- package/src/runtime/enterprise_secrets.py +110 -0
- package/src/runtime/enterprise_sessions.py +95 -0
- package/src/runtime/enterprise_sources.py +260 -0
- package/src/runtime/enterprise_web.py +39 -0
- package/src/runtime/enterprise_worker.py +68 -0
- package/src/runtime/export_contract_acceptance.py +18 -0
- package/src/runtime/faq-output-contract.json +40 -0
- package/src/runtime/faq-web-app.js +41 -0
- package/src/runtime/faq-web.css +1 -0
- package/src/runtime/faq-web.html +6 -0
- package/src/runtime/gcp-sources.json +9 -0
- package/src/runtime/gcp_acceptance.py +110 -0
- package/src/runtime/gcp_structured.py +150 -0
- package/src/runtime/http_acceptance.py +39 -0
- package/src/runtime/iap-web-app.js +36 -0
- package/src/runtime/iap-web-source.json +1 -0
- package/src/runtime/ibm-python-lock.json +856 -0
- package/src/runtime/ibm-sources.json +9 -0
- package/src/runtime/ibm_acceptance.py +133 -0
- package/src/runtime/ibm_structured.py +113 -0
- package/src/runtime/invoice-azapi-provider-lock.json +7 -0
- package/src/runtime/invoice-ibm-provider-lock.json +7 -0
- package/src/runtime/invoice-parser-lock.json +1199 -0
- package/src/runtime/invoice-parser-python-lock.json +56 -0
- package/src/runtime/invoice-parser.Dockerfile +190 -0
- package/src/runtime/invoice-sources.json +58 -0
- package/src/runtime/invoice-test-sources.json +24 -0
- package/src/runtime/invoice-web.css +2 -0
- package/src/runtime/invoice-web.html +12 -0
- package/src/runtime/invoice-web.js +112 -0
- package/src/runtime/invoice_configuration.py +17 -0
- package/src/runtime/invoice_document.py +95 -0
- package/src/runtime/invoice_extraction.py +96 -0
- package/src/runtime/invoice_http.py +129 -0
- package/src/runtime/invoice_identity.py +5 -0
- package/src/runtime/invoice_maintenance.py +40 -0
- package/src/runtime/invoice_native.py +77 -0
- package/src/runtime/invoice_object_store.py +153 -0
- package/src/runtime/invoice_operations.py +108 -0
- package/src/runtime/invoice_operator.py +79 -0
- package/src/runtime/invoice_operator_core.py +39 -0
- package/src/runtime/invoice_operator_job.py +147 -0
- package/src/runtime/invoice_parser_cli.py +17 -0
- package/src/runtime/invoice_parser_identity.py +39 -0
- package/src/runtime/invoice_parser_service.py +89 -0
- package/src/runtime/invoice_parser_transport.py +89 -0
- package/src/runtime/invoice_processing.py +24 -0
- package/src/runtime/invoice_retention.py +16 -0
- package/src/runtime/invoice_runtime_secrets.py +43 -0
- package/src/runtime/invoice_stage.py +80 -0
- package/src/runtime/invoice_web.py +39 -0
- package/src/runtime/invoice_worker.py +50 -0
- package/src/runtime/lambda_faq.py +5 -0
- package/src/runtime/parser-requirements.lock +4 -0
- package/src/runtime/policy_review.py +18 -0
- package/src/runtime/postgres-qualification-lock.json +21 -0
- package/src/runtime/public-faq-sources.json +22 -0
- package/src/runtime/public_catalog_admin.py +122 -0
- package/src/runtime/public_catalog_store.py +125 -0
- package/src/runtime/public_faq.py +144 -0
- package/src/runtime/public_faq_app.py +49 -0
- package/src/runtime/python-container-lock.json +18 -0
- package/src/runtime/rag-sources.json +10 -0
- package/src/runtime/rag_acceptance.py +60 -0
- package/src/runtime/rag_aws_adapter.py +95 -0
- package/src/runtime/rds-ca-source.json +9 -0
- package/src/runtime/rds-global-ca.pem +2888 -0
- package/src/runtime/state-contract-check-source.json +4 -0
- package/src/runtime/state_contract_check.py +338 -0
- package/src/runtime/structured-source.json +1 -0
- package/src/runtime/structured-web-app.js +71 -0
- package/src/runtime/structured-web-source.json +1 -0
- package/src/runtime/structured_http.py +105 -0
- package/src/runtime/structured_output.py +48 -0
- package/src/runtime/web-python-lock.json +802 -0
- package/src/runtime/web_user_admin.py +44 -0
- package/src/runtime/workflow_application.py +62 -0
- package/src/runtime/workflow_bindings.py +128 -0
- package/src/runtime/workflow_configuration.py +40 -0
- package/src/runtime/workflow_connection.py +105 -0
- package/src/runtime/workflow_contract.py +54 -0
- package/src/runtime/workflow_database.py +94 -0
- package/src/runtime/workflow_errors.py +6 -0
- package/src/runtime/workflow_http.py +178 -0
- package/src/runtime/workflow_identity.py +69 -0
- package/src/runtime/workflow_payload.py +118 -0
- package/src/runtime/workflow_process_stage.py +88 -0
- package/src/runtime/workflow_profile.py +91 -0
- package/src/runtime/workflow_review.py +106 -0
- package/src/runtime/workflow_role_bootstrap.py +104 -0
- package/src/runtime/workflow_schema.sql +72 -0
- package/src/runtime/workflow_worker.py +142 -0
- package/src/runtime-settings.mjs +15 -0
- package/src/s3-access.mjs +14 -0
- package/src/source-contracts.mjs +17 -0
- package/src/spec-kit.mjs +186 -0
- package/src/state-custody.mjs +32 -0
- package/src/state-inspection.mjs +45 -0
- package/src/state-spec-kit.mjs +13 -0
- package/src/storage-tests.mjs +25 -0
- package/src/structured-api.mjs +133 -0
- package/src/structured-contract.mjs +19 -0
- package/src/structured-operation-policy.mjs +2 -0
- package/src/structured-web.mjs +17 -0
- package/src/style.css +1 -0
- package/src/system-description.mjs +26 -0
- package/src/terraform-admission.mjs +66 -0
- package/src/terraform-composition.mjs +83 -0
- package/src/terraform-expressions.mjs +46 -0
- package/src/terraform-validation-coverage.mjs +11 -0
- package/src/terraform.mjs +128 -0
- package/src/text-statistics.mjs +51 -0
- package/src/upstream/openarchflow/format-payload.ts +26 -0
- package/src/upstream/openarchflow/import/mermaid.ts +205 -0
- package/src/upstream/openarchflow/import/sql-ddl.ts +109 -0
- package/src/upstream/openarchflow/layout.ts +54 -0
- package/src/upstream/openarchflow/providers/aws.ts +196 -0
- package/src/upstream/openarchflow/providers/azure.ts +126 -0
- package/src/upstream/openarchflow/providers/cloudnative.ts +71 -0
- package/src/upstream/openarchflow/providers/generic.ts +227 -0
- package/src/upstream/openarchflow/providers/integration.ts +22 -0
- package/src/upstream/openarchflow/providers/types.ts +2 -0
- package/src/upstream/openarchflow/templates.ts +937 -0
- package/src/upstream-catalog.mjs +10 -0
- package/src/useChatScroll.jsx +36 -0
- package/src/useEmulation.jsx +36 -0
- package/src/validation-receipt.mjs +10 -0
- package/src/visual-export.mjs +92 -0
- package/src/voice-conversation.mjs +117 -0
- package/src/work-intake.mjs +24 -0
- package/src/workflow-runtime-inventory.mjs +3 -0
package/src/levels.mjs
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Zoom levels for AtMem AI Architect: System (layers) → Flow (blocks) → Block (detail).
|
|
2
|
+
// Explicit responsibility groups share the same underlying component graph; legacy behavior groups remain supported.
|
|
3
|
+
import { orderProject } from "./core.mjs";
|
|
4
|
+
|
|
5
|
+
export const LAYERS = [
|
|
6
|
+
{ id: "data", label: "Data", kinds: ["source", "stream", "history"] },
|
|
7
|
+
{ id: "ml", label: "ML pipeline", kinds: ["features", "train", "registry", "monitor"] },
|
|
8
|
+
{ id: "integration", label: "Integration", kinds: ["tool"] },
|
|
9
|
+
{ id: "intelligence", label: "Intelligence", kinds: ["predict", "agent"] },
|
|
10
|
+
{ id: "governance", label: "Governance", kinds: ["guard"] },
|
|
11
|
+
{ id: "delivery", label: "Delivery", kinds: ["output"] },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export function layerOf(node) {
|
|
15
|
+
const group=String(node.data.topologyGroup||'').trim();
|
|
16
|
+
if(group)return {id:'responsibility:'+encodeURIComponent(group),label:group,explicit:true};
|
|
17
|
+
if(node.id&&node.data.kind==='resource'&&!node.data.category)return {id:'component:'+node.id,label:node.data.label,ungrouped:true};
|
|
18
|
+
const layer = LAYERS.find((l) => l.kinds.includes(node.data.kind));
|
|
19
|
+
if (layer) return { id: layer.id, label: layer.label };
|
|
20
|
+
const category = String(node.data.category || "Infrastructure").trim();
|
|
21
|
+
// Sketch blocks name the layer they belong to.
|
|
22
|
+
const named = LAYERS.find((l) => l.label.toLowerCase() === category.toLowerCase());
|
|
23
|
+
if (named) return { id: named.id, label: named.label };
|
|
24
|
+
return { id: `infra:${category.toLowerCase()}`, label: category };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function depths(p) {
|
|
28
|
+
const depth = {};
|
|
29
|
+
let order;
|
|
30
|
+
try {
|
|
31
|
+
order = orderProject(p);
|
|
32
|
+
} catch {
|
|
33
|
+
order = p.nodes;
|
|
34
|
+
}
|
|
35
|
+
for (const n of order)
|
|
36
|
+
depth[n.id] = Math.max(
|
|
37
|
+
0,
|
|
38
|
+
...p.edges
|
|
39
|
+
.filter((e) => e.target === n.id && depth[e.source] !== undefined)
|
|
40
|
+
.map((e) => depth[e.source] + 1),
|
|
41
|
+
);
|
|
42
|
+
return depth;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function aggregate(states) {
|
|
46
|
+
if (!states.length) return "idle";
|
|
47
|
+
if (states.includes("failed")) return "failed";
|
|
48
|
+
if (states.includes("running")) return "running";
|
|
49
|
+
if (states.includes("cancelled")) return "cancelled";
|
|
50
|
+
if (states.every((s) => s === "passed")) return "passed";
|
|
51
|
+
if (states.every((s) => s === "skipped")) return "skipped";
|
|
52
|
+
return "partial";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function systemView(p, runStates = {}) {
|
|
56
|
+
const depth = depths(p);
|
|
57
|
+
const groups = new Map();
|
|
58
|
+
for (const n of p.nodes.filter((x) => x.data.kind !== "note")) {
|
|
59
|
+
const layer = layerOf(n);
|
|
60
|
+
if (!groups.has(layer.id))
|
|
61
|
+
groups.set(layer.id, { ...layer, blocks: [], providers: new Set() });
|
|
62
|
+
const g = groups.get(layer.id);
|
|
63
|
+
g.blocks.push(n.id);
|
|
64
|
+
g.providers.add(n.data.provider);
|
|
65
|
+
}
|
|
66
|
+
const owner = Object.fromEntries(
|
|
67
|
+
p.nodes.filter((x) => x.data.kind !== "note").map((n) => [n.id, layerOf(n).id]),
|
|
68
|
+
);
|
|
69
|
+
const columns = new Map();
|
|
70
|
+
const ranked = [...groups.values()]
|
|
71
|
+
.map((g) => ({ ...g, rank: Math.min(...g.blocks.map((id) => depth[id] ?? 0)) }))
|
|
72
|
+
.sort((a, b) => a.rank - b.rank);
|
|
73
|
+
const dense = [...new Set(ranked.map((g) => g.rank))];
|
|
74
|
+
const nodes = ranked
|
|
75
|
+
.map((g) => ({ ...g, rank: dense.indexOf(g.rank) }))
|
|
76
|
+
.map((g) => {
|
|
77
|
+
const row = columns.get(g.rank) || 0;
|
|
78
|
+
columns.set(g.rank, row + 1);
|
|
79
|
+
const states = g.blocks.map((id) => runStates[id]).filter(Boolean);
|
|
80
|
+
return {
|
|
81
|
+
id: `layer:${g.id}`,
|
|
82
|
+
type: "layer",
|
|
83
|
+
position: { x: g.rank * 320, y: row * 180 },
|
|
84
|
+
data: {
|
|
85
|
+
layer: g.id,
|
|
86
|
+
label: g.label,
|
|
87
|
+
explicit:!!g.explicit,
|
|
88
|
+
ungrouped:!!g.ungrouped,
|
|
89
|
+
blocks: g.blocks,
|
|
90
|
+
providers: [...g.providers],
|
|
91
|
+
status: aggregate(states),
|
|
92
|
+
done: states.filter((s) => s === "passed").length,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const wires = new Map();
|
|
97
|
+
for (const e of p.edges) {
|
|
98
|
+
const a = owner[e.source],
|
|
99
|
+
b = owner[e.target];
|
|
100
|
+
if (!a || !b || a === b) continue;
|
|
101
|
+
const id = `${a}->${b}`;
|
|
102
|
+
if (!wires.has(id))
|
|
103
|
+
wires.set(id, {
|
|
104
|
+
id: `layer-wire:${id}`,
|
|
105
|
+
source: `layer:${a}`,
|
|
106
|
+
target: `layer:${b}`,
|
|
107
|
+
type: "smoothstep",
|
|
108
|
+
data: { sources: [], labels: [] },
|
|
109
|
+
});
|
|
110
|
+
const w = wires.get(id);
|
|
111
|
+
w.data.sources.push(e.source);
|
|
112
|
+
if (e.label) w.data.labels.push(e.label);
|
|
113
|
+
}
|
|
114
|
+
const edges = [...wires.values()].map((w) => ({
|
|
115
|
+
...w,
|
|
116
|
+
label: [...new Set(w.data.labels)].slice(0,2).join(' · ') + (new Set(w.data.labels).size>2?' …':''),
|
|
117
|
+
}));
|
|
118
|
+
return { nodes, edges };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Summarise what a proposal changes relative to the current design.
|
|
122
|
+
export function proposalDiff(current, next) {
|
|
123
|
+
const before = new Set(current.nodes.map((n) => n.id));
|
|
124
|
+
const after = new Set(next.nodes.map((n) => n.id));
|
|
125
|
+
const wiresBefore = new Set(current.edges.map((e) => `${e.source}>${e.target}`));
|
|
126
|
+
const wiresAfter = new Set(next.edges.map((e) => `${e.source}>${e.target}`));
|
|
127
|
+
const labels = Object.fromEntries(current.nodes.map((n) => [n.id, n.data]));
|
|
128
|
+
return {
|
|
129
|
+
added: next.nodes.filter((n) => !before.has(n.id)).map((n) => n.data.label),
|
|
130
|
+
changed: next.nodes
|
|
131
|
+
.filter(
|
|
132
|
+
(n) =>
|
|
133
|
+
before.has(n.id) &&
|
|
134
|
+
(labels[n.id].label !== n.data.label ||
|
|
135
|
+
labels[n.id].provider !== n.data.provider ||
|
|
136
|
+
labels[n.id].kind !== n.data.kind),
|
|
137
|
+
)
|
|
138
|
+
.map((n) => n.data.label),
|
|
139
|
+
removed: current.nodes
|
|
140
|
+
.filter((n) => !after.has(n.id))
|
|
141
|
+
.map((n) => n.data.label),
|
|
142
|
+
wiresAdded: [...wiresAfter].filter((w) => !wiresBefore.has(w)).length,
|
|
143
|
+
wiresRemoved: [...wiresBefore].filter((w) => !wiresAfter.has(w)).length,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import {architectureWork} from './architecture-work.mjs';
|
|
2
|
+
import {consultationContext} from './consultation-context.mjs';
|
|
3
|
+
import { runtimeSettings } from "./runtime-settings.mjs";
|
|
4
|
+
import { handoffAssessment } from './handoff.mjs';
|
|
5
|
+
import { journey } from "./journey.mjs";
|
|
6
|
+
import { requirementNumber } from "./derive.mjs";
|
|
7
|
+
import { estimate, consultingEstimate } from "./estimate.mjs";
|
|
8
|
+
import { resourcePlan } from "./resources.mjs";
|
|
9
|
+
import { toProjectFile } from "./project-file.mjs";
|
|
10
|
+
|
|
11
|
+
export function toAgentProject(p) {
|
|
12
|
+
return {
|
|
13
|
+
version: 1,
|
|
14
|
+
revision: p.revision,
|
|
15
|
+
name: p.name.slice(0, 200),
|
|
16
|
+
provider: p.provider || "tools",
|
|
17
|
+
...(p.domain ? { domain: p.domain } : {}),
|
|
18
|
+
requirements: String(p.requirements || ""),
|
|
19
|
+
nodes: p.nodes.map((n) => ({
|
|
20
|
+
id: n.id,
|
|
21
|
+
type: "resource",
|
|
22
|
+
position: n.position,
|
|
23
|
+
data: {
|
|
24
|
+
// A whitespace-only annotation also works with older sidecars requiring min_length=1.
|
|
25
|
+
label: n.data.kind === "note" && !n.data.label ? " " : n.data.label,
|
|
26
|
+
kind: n.data.kind,
|
|
27
|
+
provider: n.data.provider,
|
|
28
|
+
description: String(n.data.description || ""),
|
|
29
|
+
config: {
|
|
30
|
+
...runtimeSettings(n.data.config),
|
|
31
|
+
region: n.data.config?.region || "To be selected",
|
|
32
|
+
classification: ["Public", "Internal", "Confidential"].includes(
|
|
33
|
+
n.data.config?.classification,
|
|
34
|
+
)
|
|
35
|
+
? n.data.config.classification
|
|
36
|
+
: "Internal",
|
|
37
|
+
timeout: 5000,
|
|
38
|
+
},
|
|
39
|
+
inputPosition: n.data.inputPosition || "left",
|
|
40
|
+
outputPosition: n.data.outputPosition || "right",
|
|
41
|
+
...(n.data.topologyGroup ? {topologyGroup:String(n.data.topologyGroup)}:{}),
|
|
42
|
+
...(["reference","create"].includes(n.data.deploymentMode)?{deploymentMode:n.data.deploymentMode}:{}),
|
|
43
|
+
origin: String(n.data.origin || "proposed").slice(0, 100),
|
|
44
|
+
...(n.data.service ? { service: n.data.service } : {}),
|
|
45
|
+
...(["public-catalog-editor","cloud-storage-principal","aws-iam-principal","aws-bedrock-model","normalized-source-contract","web-browser","existing-service"].includes(n.data.binding) ? { binding: n.data.binding } : {}),
|
|
46
|
+
...(["invoice-workflow","public-faq-app","ibm-structured-app","gcp-structured-app","azure-structured-app","container-service","private-object-storage","rag-web-app","rag-user-pool","bounded-keyword-rag","iam-rag-api","bounded-rag-catalog","text-statistics","bedrock-summary","bedrock-structured","structured-api","structured-web-app","structured-user-pool","async-word-count","sqs-standard","sqs-dead-letter","word-count-results"].includes(n.data.implementation) ? { implementation: n.data.implementation } : {}),
|
|
47
|
+
...(n.data.category ? { category: n.data.category } : {}),
|
|
48
|
+
...(n.data.poc ? { poc: true } : {}),
|
|
49
|
+
...(n.data.role ? { role: n.data.role } : {}),
|
|
50
|
+
...(n.data.measures?.length ? { measures: n.data.measures } : {}),
|
|
51
|
+
},
|
|
52
|
+
})),
|
|
53
|
+
edges: p.edges.map((e) => ({
|
|
54
|
+
id: e.id,
|
|
55
|
+
source: e.source,
|
|
56
|
+
target: e.target,
|
|
57
|
+
type: "smoothstep",
|
|
58
|
+
label: String(e.label || "data").slice(0, 150),
|
|
59
|
+
...(["storage-object-admin","s3-read", "s3-read-write", "lambda-invoke", "api-invoke"].includes(e.access) ? { access: e.access } : {}),
|
|
60
|
+
...(["approved-accounting-api","public-catalog-edit","browser-https","web-rag-api","oauth-pkce","jwt-authorizer","source-catalog-sync","http-api-lambda","lambda-catalog-read","bedrock-converse","s3-object-created","sqs-lambda","lambda-s3-read","lambda-dynamodb-write","sqs-redrive"].includes(e.integration) ? { integration: e.integration } : {}),
|
|
61
|
+
})),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Read-only records for the architect: it may only change them through a proposal.
|
|
65
|
+
export function agentContext(p) {
|
|
66
|
+
const item = (type, id, text) => ({ type, id: String(id).slice(0, 60), text: String(text) });
|
|
67
|
+
const measure = (m) => (m ? ` [${m.metric} ${m.op} ${m.target}${m.unit || ""}]` : "");
|
|
68
|
+
const next = journey(p);
|
|
69
|
+
const costs = estimate(p), work = consultingEstimate(p), resources = resourcePlan(p), handoff = handoffAssessment(p);
|
|
70
|
+
const shared=p.extensions?.architectureWork?architectureWork(p):null;
|
|
71
|
+
const workContext=shared?shared.entities.filter(e=>e.id.startsWith('intent:')&&e.id!=='intent:project'||e.id.startsWith('work:')).map((e,i)=>item('discovery','shared-work-'+i,JSON.stringify({reference:e.id,kind:e.kind,contextStatus:e.contextStatus,changedRefs:e.changedRefs,missingRefs:e.missingRefs,value:e.value,boundary:'Recorded intent or proposed mapping; context review is not verified execution or business acceptance.'}))):[];
|
|
72
|
+
return consultationContext([
|
|
73
|
+
...(p.extensions?.externalReferences?.references||[]).map((ref,index)=>item('discovery','external-reference-'+index,JSON.stringify({reference:ref,boundary:'Observed state metadata only. Preserve external ownership; the URN is not a native physical ID, verified behavior or permission to adopt/create/migrate.'}))),
|
|
74
|
+
...(p.extensions?.terraformState?[item('discovery','terraform-state-custody',JSON.stringify({contract:p.extensions.terraformState,boundary:'Preserve this root state choice and linked owner/residency decisions. Selection is not backend verification, migration approval or deployment authorization.'}))]:[]),
|
|
75
|
+
...workContext,
|
|
76
|
+
item("discovery","guided-journey",`Current journey step: ${next.id} — ${next.title}. ${next.reason} Next action: ${next.action}. Add or refine the needed components and their connections from known answers. Keep topology reasoning internal and explain components in plain language. Ask only a material question that unlocks the next design decision; defer packaging details. Later stages remain hidden until the working draft progresses; never direct the user to a hidden tab. Named service mapping is not verified cloud compatibility.`),
|
|
77
|
+
item("discovery", "estimate-summary", `Current estimate stage: ${costs.maturity}. Monthly cloud subtotal ${costs.expected ?? "unknown"} ${costs.currency || "currency unresolved"}; range ${costs.low ?? "?"}–${costs.high ?? "?"}; ${costs.gaps.length} worksheet gaps. One-off consulting/build subtotal ${work.expected ?? "unknown"} ${work.currency}; ${work.complete ? "all phases entered" : "incomplete"}. Values are user inputs, not provider quotes. Later journey stages provide costs and a downloadable delivery draft with a Terraform sketch. Follow guided-journey before directing the user to those stages.`),
|
|
78
|
+
...costs.gaps.slice(0, 5).map((g, i) => item("discovery", `cost-gap-${i}`, g)),
|
|
79
|
+
item("discovery", "infrastructure-coverage", `${resources.rows.length} diagram components; ${resources.gaps.length} infrastructure/integration gaps. Use the server-supplied current compiler capability catalogue and actual selected contracts. Named services and supplied-image footprints do not establish application implementation. Preserve unsupported scope and treat missing implementation as engineering work; never replace a required system with a smaller demo or ask users to repair compiler gaps.`),
|
|
80
|
+
item("discovery", "handoff-readiness", `Handoff: ${handoff.status}; ${handoff.counts.priorityDecisions} priority decisions. Next: ${handoff.nextAction} Preserve accepted design decisions, distinguish country from deployment region, and advance connected workstreams together; ask only a consequential business decision while owning routine engineering choices. Do not equate schema validation with deployed behavior.`),
|
|
81
|
+
...handoff.findings.filter(f=>f.priority===1).slice(0,5).map(f=>item("question",`handoff-${f.id}`,`${f.message} ${f.action}`)),
|
|
82
|
+
...(p.needs || []).map((r) => item("requirement", r.id, `${requirementNumber(p,r.id)} — ${r.priority} ${r.kind} ${r.category}: ${r.statement}${measure(r.measure)} (${r.status})`)),
|
|
83
|
+
...(p.assumptions || []).map((a) => item("assumption", a.id, `${a.statement} (stated ${a.madeAt})`)),
|
|
84
|
+
...(p.openQuestions || []).filter(q=>q.status==='open'||q.answer?.trim()).map(q=>item('question',q.id,q.status==='answered'?`Answered: ${q.question} User-recorded answer: ${q.answer}`:q.question)),
|
|
85
|
+
...(p.decisions || [])
|
|
86
|
+
.filter((d) => d.status !== "Superseded")
|
|
87
|
+
.map((d) => item("decision", d.id, `${d.subject} — ${d.title}: ${d.decision} (${d.status}${d.owner ? `, owner ${d.owner}` : ""})`)),
|
|
88
|
+
...(p.lastAsked?.question ? [item("discovery", "next-question", `Optional planner candidate (${p.lastAsked.topic}; defer if a larger decision matters more): ${p.lastAsked.question} Beginner wording: ${p.lastAsked.beginner || ""}`)] : []),
|
|
89
|
+
...Object.entries(p.brief || {})
|
|
90
|
+
.filter(([, v]) => String(v).trim())
|
|
91
|
+
.map(([k, v]) => item("discovery", `brief-${k}`, `${k}: ${v}`)),
|
|
92
|
+
...(p.workflow ? [item("discovery", "workflow", `Detected workflow: ${p.workflow}`)] : []),
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
export async function discoverLocalAgent() {
|
|
96
|
+
const response = await fetch("/api/session", {
|
|
97
|
+
// Native account status probes can each take up to eight seconds.
|
|
98
|
+
signal: AbortSignal.timeout(20000),
|
|
99
|
+
});
|
|
100
|
+
if (!response.ok) throw Error("Local sidecar unavailable");
|
|
101
|
+
const session = await response.json();
|
|
102
|
+
if (!session.token || session.status !== "local-sidecar")
|
|
103
|
+
throw Error("Invalid local sidecar response");
|
|
104
|
+
return session;
|
|
105
|
+
}
|
|
106
|
+
// Plain reasons instead of status codes or validation dumps.
|
|
107
|
+
export function explain(status, detail) {
|
|
108
|
+
if (typeof detail === "string") return detail;
|
|
109
|
+
if (status === 401) return "AtMem AI Architect's helper restarted, so this page lost its session. Reload the page.";
|
|
110
|
+
if (status === 422 && Array.isArray(detail) && detail.length) {
|
|
111
|
+
const d = detail[0];
|
|
112
|
+
const where = (d.loc || []).filter((x) => x !== "body").join(" → ");
|
|
113
|
+
return `Part of our request didn't fit (${where || "request"}: ${d.msg}). Reload the page; if it keeps happening, tell us what you were doing.`;
|
|
114
|
+
}
|
|
115
|
+
if (status === 409) return "Still working on your last message — give it a moment.";
|
|
116
|
+
if (status >= 500) return "The model didn't answer. Let's check the connection.";
|
|
117
|
+
return "Something went wrong talking to the model. Let's check the connection.";
|
|
118
|
+
}
|
|
119
|
+
export async function requestArchitect({
|
|
120
|
+
session,
|
|
121
|
+
connection,
|
|
122
|
+
message,
|
|
123
|
+
project,
|
|
124
|
+
history,
|
|
125
|
+
stage = "discover",
|
|
126
|
+
origin = "chat",
|
|
127
|
+
extra = [],
|
|
128
|
+
attachments = [],
|
|
129
|
+
activityId,
|
|
130
|
+
signal,
|
|
131
|
+
}) {
|
|
132
|
+
const scoped = project.id && !/^Connection check/.test(message);
|
|
133
|
+
if (scoped) {
|
|
134
|
+
try { await memoryCall(session, "sync", { projectId: project.id, file: toProjectFile(project) }, signal); }
|
|
135
|
+
catch (error) { if (error.name === "AbortError") throw error; }
|
|
136
|
+
}
|
|
137
|
+
const response = await fetch("/api/architect", {
|
|
138
|
+
method: "POST",
|
|
139
|
+
headers: {
|
|
140
|
+
"Content-Type": "application/json",
|
|
141
|
+
Authorization: `Bearer ${session.token}`,
|
|
142
|
+
},
|
|
143
|
+
body: JSON.stringify({
|
|
144
|
+
provider: connection.provider,
|
|
145
|
+
...(scoped ? { projectId: project.id } : {}),
|
|
146
|
+
...(scoped&&session.architectureActivityEnabled&&activityId?{activityId}:{}),
|
|
147
|
+
origin,
|
|
148
|
+
model: connection.model,
|
|
149
|
+
...(connection.effort ? { effort: connection.effort } : {}),
|
|
150
|
+
message,
|
|
151
|
+
...(attachments.length?{attachments:attachments.map(({name,mime,data})=>({name,mime,data}))}:{}),
|
|
152
|
+
project: toAgentProject(project),
|
|
153
|
+
stage,
|
|
154
|
+
context: consultationContext([...agentContext(project), ...extra]),
|
|
155
|
+
history: history
|
|
156
|
+
.slice(-12)
|
|
157
|
+
.map((m) => ({ role: m.role, text: m.text.slice(0, 12000) })),
|
|
158
|
+
}),
|
|
159
|
+
signal,
|
|
160
|
+
});
|
|
161
|
+
const result = await response.json();
|
|
162
|
+
if (!response.ok) throw Error(explain(response.status, result.detail));
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export async function memoryCall(session, action, payload, signal) {
|
|
167
|
+
if (!session?.token) throw Error("AtMem AI Architect's local service is not connected.");
|
|
168
|
+
const response = await fetch(`/api/memory/${action}`, { method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${session.token}`},body:JSON.stringify(payload),signal:signal || AbortSignal.timeout(30000) });
|
|
169
|
+
const value = await response.json();
|
|
170
|
+
if (!response.ok) throw Error(typeof value.detail === "string" ? value.detail : "The memory request was rejected.");
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Projects saved by AtMem AI Architect's helper under the user's account on this computer.
|
|
175
|
+
export async function projects(session, action, body = {}) {
|
|
176
|
+
const response = await fetch(`/api/projects/${action}`, {
|
|
177
|
+
method: "POST",
|
|
178
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${session.token}` },
|
|
179
|
+
body: JSON.stringify(body),
|
|
180
|
+
});
|
|
181
|
+
const result = await response.json().catch(() => ({}));
|
|
182
|
+
if (!response.ok) throw Error(typeof result.detail === "string" ? result.detail : "Couldn't reach your saved projects.");
|
|
183
|
+
return result;
|
|
184
|
+
}
|