@openlife/cli 1.7.3
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/INSTALL.md +266 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/bin/openlife.js +3 -0
- package/dist/admin_panel_server.js +66 -0
- package/dist/cli/AgentManager.js +109 -0
- package/dist/cli/AutonomousInstaller.js +134 -0
- package/dist/cli/DreamOrganizer.js +88 -0
- package/dist/cli/HostInstaller.js +426 -0
- package/dist/cli/InstallBanner.js +16 -0
- package/dist/cli/InstallFlow.js +256 -0
- package/dist/cli/InstallHeadless.js +47 -0
- package/dist/cli/InstallModules.js +148 -0
- package/dist/cli/InstallStateStore.js +75 -0
- package/dist/cli/InstallWizard.js +364 -0
- package/dist/cli/ProfileManager.js +163 -0
- package/dist/cli/SystemInstaller.js +89 -0
- package/dist/cli/WorldClassCommands.js +208 -0
- package/dist/design/DesignMdImporter.js +82 -0
- package/dist/design/DesignMdMode.js +93 -0
- package/dist/design/DesignMdRegistry.js +67 -0
- package/dist/index.js +2575 -0
- package/dist/memory/ConversationMemory.js +33 -0
- package/dist/memory/LocalMemoryProvider.js +86 -0
- package/dist/memory/Mem0Provider.js +16 -0
- package/dist/memory/MemoryNamespacePolicy.js +27 -0
- package/dist/memory/MemoryOrchestrator.js +65 -0
- package/dist/memory/MemoryPromotionFlow.js +32 -0
- package/dist/memory/MemoryProvider.js +2 -0
- package/dist/memory/MemoryProviderRegistry.js +27 -0
- package/dist/memory/MemoryRetentionPolicy.js +60 -0
- package/dist/memory/MempalaceProvider.js +72 -0
- package/dist/memory/OmniMemory.js +106 -0
- package/dist/memory/RedisAgentMemoryProvider.js +16 -0
- package/dist/memory/SessionManager.js +86 -0
- package/dist/memory/ZepGraphitiProvider.js +16 -0
- package/dist/orchestrator/AgentRegistry.js +56 -0
- package/dist/orchestrator/AgentScoring.js +82 -0
- package/dist/orchestrator/AgentTeam.js +22 -0
- package/dist/orchestrator/ArbitrationAgent.js +43 -0
- package/dist/orchestrator/ArbitrationScorecard.js +17 -0
- package/dist/orchestrator/AssetPromotionEngine.js +65 -0
- package/dist/orchestrator/AssetReuseRouter.js +63 -0
- package/dist/orchestrator/BenchmarkEngine.js +75 -0
- package/dist/orchestrator/Brain.js +298 -0
- package/dist/orchestrator/CadenceEngine.js +76 -0
- package/dist/orchestrator/CapabilityRouter.js +36 -0
- package/dist/orchestrator/CommandLanguage.js +27 -0
- package/dist/orchestrator/CommandRouter.js +70 -0
- package/dist/orchestrator/ConsequenceForecaster.js +286 -0
- package/dist/orchestrator/CronManager.js +286 -0
- package/dist/orchestrator/DynamicAgentBuilder.js +48 -0
- package/dist/orchestrator/DynamicAgentExecutor.js +15 -0
- package/dist/orchestrator/EnterpriseAgenticCore.js +276 -0
- package/dist/orchestrator/ExecutionBoard.js +86 -0
- package/dist/orchestrator/ExecutionIntent.js +13 -0
- package/dist/orchestrator/ExecutionModePolicy.js +48 -0
- package/dist/orchestrator/ExecutionRouter.js +9 -0
- package/dist/orchestrator/ExecutionState.js +20 -0
- package/dist/orchestrator/ExecutorHealth.js +86 -0
- package/dist/orchestrator/ExternalCatalogRegistry.js +83 -0
- package/dist/orchestrator/Gatekeeper.js +414 -0
- package/dist/orchestrator/Gateway.js +508 -0
- package/dist/orchestrator/GovernanceConsentStore.js +66 -0
- package/dist/orchestrator/GovernanceLayer.js +179 -0
- package/dist/orchestrator/GovernancePolicyStore.js +53 -0
- package/dist/orchestrator/GovernanceScopeLedger.js +134 -0
- package/dist/orchestrator/GovernanceScopePolicy.js +67 -0
- package/dist/orchestrator/IntentClassifier.js +45 -0
- package/dist/orchestrator/JobLifecycle.js +91 -0
- package/dist/orchestrator/LearningRouter.js +24 -0
- package/dist/orchestrator/MediaManager.js +92 -0
- package/dist/orchestrator/MemoryCuratorAgent.js +41 -0
- package/dist/orchestrator/MissionState.js +155 -0
- package/dist/orchestrator/ModelManager.js +84 -0
- package/dist/orchestrator/OperatingSystem.js +71 -0
- package/dist/orchestrator/OperationalMemoryStore.js +94 -0
- package/dist/orchestrator/OptimizationLoop.js +72 -0
- package/dist/orchestrator/OrchestrationLoop.js +905 -0
- package/dist/orchestrator/OrgStructure.js +88 -0
- package/dist/orchestrator/OutcomeSimulator.js +46 -0
- package/dist/orchestrator/ParallelOrchestrationLoop.js +36 -0
- package/dist/orchestrator/PerformanceScorecard.js +105 -0
- package/dist/orchestrator/PlannerAgent.js +46 -0
- package/dist/orchestrator/ProcessSandbox.js +129 -0
- package/dist/orchestrator/PromotionPipeline.js +74 -0
- package/dist/orchestrator/PromotionReviewGate.js +11 -0
- package/dist/orchestrator/QueueScheduler.js +260 -0
- package/dist/orchestrator/ReleaseGate.js +36 -0
- package/dist/orchestrator/ReleaseWorkflow.js +68 -0
- package/dist/orchestrator/RemotePublisher.js +139 -0
- package/dist/orchestrator/ReuseEngine.js +89 -0
- package/dist/orchestrator/ReviewerAgent.js +49 -0
- package/dist/orchestrator/RoleHandoff.js +65 -0
- package/dist/orchestrator/RuntimeHealthMonitor.js +143 -0
- package/dist/orchestrator/RuntimePolicy.js +105 -0
- package/dist/orchestrator/RuntimeProbe.js +97 -0
- package/dist/orchestrator/RuntimeRegistry.js +73 -0
- package/dist/orchestrator/SandboxPolicy.js +22 -0
- package/dist/orchestrator/SecurityDownloadGuard.js +169 -0
- package/dist/orchestrator/SecurityEventStore.js +58 -0
- package/dist/orchestrator/ServiceCompletionPolicy.js +36 -0
- package/dist/orchestrator/ServiceState.js +195 -0
- package/dist/orchestrator/SkillCreator.js +404 -0
- package/dist/orchestrator/SkillLearningLoop.js +57 -0
- package/dist/orchestrator/SkillManager.js +75 -0
- package/dist/orchestrator/SkillNetwork.js +29 -0
- package/dist/orchestrator/SkillRegistryV2.js +28 -0
- package/dist/orchestrator/SkillScoring.js +70 -0
- package/dist/orchestrator/SquadAutoCreator.js +64 -0
- package/dist/orchestrator/SquadCreator.js +727 -0
- package/dist/orchestrator/SquadRegistry.js +28 -0
- package/dist/orchestrator/SquadRouter.js +33 -0
- package/dist/orchestrator/SquadScoring.js +70 -0
- package/dist/orchestrator/SubagentLifecycle.js +90 -0
- package/dist/orchestrator/SynthesizerAgent.js +48 -0
- package/dist/orchestrator/SystemDoctor.js +224 -0
- package/dist/orchestrator/TaskExecutor.js +422 -0
- package/dist/orchestrator/TeammateBoard.js +61 -0
- package/dist/orchestrator/TestHarness.js +184 -0
- package/dist/orchestrator/VoiceManager.js +203 -0
- package/dist/orchestrator/VoiceRouter.js +89 -0
- package/dist/orchestrator/capability/CapabilityGenesisEngine.js +278 -0
- package/dist/orchestrator/capability/CapabilityPackParser.js +223 -0
- package/dist/orchestrator/capability/CapabilityPackSchema.js +62 -0
- package/dist/orchestrator/capability/CapabilityPackState.js +163 -0
- package/dist/orchestrator/providers/AgentProvider.js +2 -0
- package/dist/orchestrator/providers/CapabilityProvider.js +12 -0
- package/dist/orchestrator/providers/CloudAgentProvider.js +55 -0
- package/dist/orchestrator/providers/CloudSkillProvider.js +55 -0
- package/dist/orchestrator/providers/CloudSquadProvider.js +55 -0
- package/dist/orchestrator/providers/CompositeAgentProvider.js +16 -0
- package/dist/orchestrator/providers/CompositeCapabilityProvider.js +25 -0
- package/dist/orchestrator/providers/CompositeSkillProvider.js +16 -0
- package/dist/orchestrator/providers/CompositeSquadProvider.js +16 -0
- package/dist/orchestrator/providers/CompositeWorkflowProvider.js +46 -0
- package/dist/orchestrator/providers/FileAgentProvider.js +105 -0
- package/dist/orchestrator/providers/FileCapabilityProvider.js +106 -0
- package/dist/orchestrator/providers/FileSkillProvider.js +65 -0
- package/dist/orchestrator/providers/FileSquadProvider.js +69 -0
- package/dist/orchestrator/providers/FileWorkflowProvider.js +103 -0
- package/dist/orchestrator/providers/SkillProvider.js +2 -0
- package/dist/orchestrator/providers/SquadProvider.js +2 -0
- package/dist/orchestrator/toolset/ToolsetGuard.js +69 -0
- package/dist/orchestrator/toolset/ToolsetRegistry.js +65 -0
- package/dist/orchestrator/toolset/ToolsetSchema.js +21 -0
- package/dist/orchestrator/util/AtomicWriter.js +204 -0
- package/dist/orchestrator/util/DistributedLock.js +232 -0
- package/dist/orchestrator/util/TemplateRenderer.js +87 -0
- package/dist/orchestrator/util/WatchdogHeartbeat.js +116 -0
- package/dist/orchestrator/workflow/ConditionParser.js +232 -0
- package/dist/orchestrator/workflow/WorkflowEngine.js +379 -0
- package/dist/orchestrator/workflow/WorkflowParser.js +368 -0
- package/dist/orchestrator/workflow/WorkflowSchema.js +65 -0
- package/dist/orchestrator/workflow/WorkflowState.js +11 -0
- package/dist/reversa/ReversaAgent.js +134 -0
- package/dist/reversa/ReversaContracts.js +62 -0
- package/dist/reversa/ReversaExecutors.js +65 -0
- package/dist/skills/SkillRegistry.js +71 -0
- package/dist/squads/SquadManager.js +87 -0
- package/dist/test_admin_teams_networks.js +54 -0
- package/dist/test_agent_team_skill_network.js +15 -0
- package/dist/test_aiobuilder_cli_parity.js +169 -0
- package/dist/test_ask_exit.js +73 -0
- package/dist/test_atomic_writer.js +209 -0
- package/dist/test_autonomous_soak.js +141 -0
- package/dist/test_benchmark_engine.js +41 -0
- package/dist/test_brain_error_diagnostics.js +51 -0
- package/dist/test_brain_fallback_chain.js +93 -0
- package/dist/test_capability_genesis_engine.js +225 -0
- package/dist/test_capability_pack_schema.js +214 -0
- package/dist/test_catalog_quality.js +150 -0
- package/dist/test_cli_crud_roundtrip.js +154 -0
- package/dist/test_cli_diagnostics.js +131 -0
- package/dist/test_cli_doc_parity.js +126 -0
- package/dist/test_cli_help_surface.js +106 -0
- package/dist/test_cli_service_commands.js +83 -0
- package/dist/test_consequence_forecast_brain.js +165 -0
- package/dist/test_consequence_forecaster.js +24 -0
- package/dist/test_conversation_memory.js +36 -0
- package/dist/test_create_entities.js +54 -0
- package/dist/test_creator_placeholders_completed.js +177 -0
- package/dist/test_cron_manager.js +123 -0
- package/dist/test_daemon_sigterm.js +72 -0
- package/dist/test_deep_research_capability.js +87 -0
- package/dist/test_designmd_import_registry.js +16 -0
- package/dist/test_designmd_mode.js +50 -0
- package/dist/test_designmd_mode_workspace.js +13 -0
- package/dist/test_dist_templates_layout.js +135 -0
- package/dist/test_distributed_lock.js +201 -0
- package/dist/test_distribution_installability.js +67 -0
- package/dist/test_doctor_sandbox_check.js +44 -0
- package/dist/test_dream_organizer.js +25 -0
- package/dist/test_dual_mode.js +15 -0
- package/dist/test_enterprise_agentic_core.js +128 -0
- package/dist/test_forecast_brain_wiring.js +87 -0
- package/dist/test_gateway_telegram_guardrails.js +52 -0
- package/dist/test_governance.js +34 -0
- package/dist/test_governance_advanced.js +75 -0
- package/dist/test_governance_scope_ledger.js +147 -0
- package/dist/test_governance_v13_policies.js +44 -0
- package/dist/test_guided_creator_cli.js +100 -0
- package/dist/test_host_install_e2e.js +324 -0
- package/dist/test_host_installer.js +259 -0
- package/dist/test_host_installers_gemini_codex.js +95 -0
- package/dist/test_host_uninstaller.js +295 -0
- package/dist/test_install_flow.js +70 -0
- package/dist/test_install_flow_host_validation.js +143 -0
- package/dist/test_install_wizard.js +272 -0
- package/dist/test_integration_gemini_live.js +95 -0
- package/dist/test_integration_http_trigger_live.js +154 -0
- package/dist/test_integration_telegram_live.js +102 -0
- package/dist/test_job_lifecycle.js +16 -0
- package/dist/test_memory_orchestrator.js +33 -0
- package/dist/test_memory_promotion.js +36 -0
- package/dist/test_memory_retention.js +37 -0
- package/dist/test_mission_checkpoint.js +204 -0
- package/dist/test_multi_host_docs_parity.js +125 -0
- package/dist/test_openlife_auto_creator_routing.js +69 -0
- package/dist/test_openlife_evolution_surface.js +77 -0
- package/dist/test_openlife_gatekeeper_routing.js +15 -0
- package/dist/test_openlife_routing_surface.js +27 -0
- package/dist/test_openlife_runtime_source_truth.js +25 -0
- package/dist/test_operating_system.js +45 -0
- package/dist/test_optimization_loop.js +38 -0
- package/dist/test_orchestration_assets_lifecycle.js +78 -0
- package/dist/test_outcome_simulator.js +38 -0
- package/dist/test_performance_latency.js +215 -0
- package/dist/test_performance_scorecard.js +38 -0
- package/dist/test_phase1_check_exit.js +103 -0
- package/dist/test_phase6_board.js +31 -0
- package/dist/test_phase6_cadence.js +29 -0
- package/dist/test_phase6_ops.js +37 -0
- package/dist/test_post_mission_evaluation.js +190 -0
- package/dist/test_process_sandbox.js +88 -0
- package/dist/test_profile_toolset_mcp.js +125 -0
- package/dist/test_queue_scheduler.js +239 -0
- package/dist/test_release_gate.js +23 -0
- package/dist/test_remote_publish.js +193 -0
- package/dist/test_reversa_contracts_e2e.js +48 -0
- package/dist/test_reversa_export_and_strict.js +51 -0
- package/dist/test_reversa_full_execution.js +12 -0
- package/dist/test_reversa_lite.js +9 -0
- package/dist/test_royal_stack_golden.js +179 -0
- package/dist/test_runtime_health_backoff.js +154 -0
- package/dist/test_runtime_policy.js +26 -0
- package/dist/test_runtime_probe.js +19 -0
- package/dist/test_runtime_profile_oauth_only.js +262 -0
- package/dist/test_runtime_registry.js +11 -0
- package/dist/test_security_download_and_scan.js +103 -0
- package/dist/test_security_download_guard.js +14 -0
- package/dist/test_service_command_surface.js +12 -0
- package/dist/test_service_completion_policy.js +32 -0
- package/dist/test_service_guardrails_delete.js +12 -0
- package/dist/test_service_mode_explicit_only.js +174 -0
- package/dist/test_sources_import_ref.js +46 -0
- package/dist/test_sources_scaffold.js +43 -0
- package/dist/test_squad_skill_creator.js +305 -0
- package/dist/test_squad_skill_design_llm.js +176 -0
- package/dist/test_subsystems_org_state.js +271 -0
- package/dist/test_subsystems_promotion_memory_assets.js +343 -0
- package/dist/test_subsystems_routing_governance.js +234 -0
- package/dist/test_task_executor_sandbox_optin.js +127 -0
- package/dist/test_teammate_learning.js +15 -0
- package/dist/test_telegram_delete_guardrail.js +21 -0
- package/dist/test_toolset_enforcement.js +188 -0
- package/dist/test_trigger_basic_auth.js +112 -0
- package/dist/test_util/doc_parity.js +120 -0
- package/dist/test_v15_e2e_integration.js +207 -0
- package/dist/test_watchdog_heartbeat.js +152 -0
- package/dist/test_workflow_condition_parser.js +63 -0
- package/dist/test_workflow_e2e.js +240 -0
- package/dist/test_workflow_engine.js +330 -0
- package/dist/test_workflow_parser.js +245 -0
- package/dist/test_workflow_schema_backward_compat.js +197 -0
- package/dist-templates/README.md +91 -0
- package/dist-templates/claude-code/agents/openlife-atlas.md +52 -0
- package/dist-templates/claude-code/agents/openlife-forge.md +42 -0
- package/dist-templates/claude-code/agents/openlife-genesis.md +59 -0
- package/dist-templates/claude-code/agents/openlife-lyra.md +40 -0
- package/dist-templates/claude-code/agents/openlife-maestro.md +45 -0
- package/dist-templates/claude-code/commands/openlife/ask.md +14 -0
- package/dist-templates/claude-code/commands/openlife/doctor.md +19 -0
- package/dist-templates/claude-code/commands/openlife/dream.md +20 -0
- package/dist-templates/claude-code/commands/openlife/status.md +14 -0
- package/dist-templates/claude-code/mcp/openlife-orchestrator.json +46 -0
- package/dist-templates/codex/README.md +7 -0
- package/dist-templates/codex/agents/openlife-atlas.md +52 -0
- package/dist-templates/codex/agents/openlife-forge.md +42 -0
- package/dist-templates/codex/agents/openlife-genesis.md +59 -0
- package/dist-templates/codex/agents/openlife-lyra.md +40 -0
- package/dist-templates/codex/agents/openlife-maestro.md +45 -0
- package/dist-templates/codex/commands/openlife/ask.md +14 -0
- package/dist-templates/codex/commands/openlife/doctor.md +19 -0
- package/dist-templates/codex/commands/openlife/dream.md +20 -0
- package/dist-templates/codex/commands/openlife/status.md +14 -0
- package/dist-templates/codex/mcp/openlife-orchestrator.json +46 -0
- package/dist-templates/gemini-cli/README.md +8 -0
- package/dist-templates/gemini-cli/agents/openlife-atlas.md +52 -0
- package/dist-templates/gemini-cli/agents/openlife-forge.md +42 -0
- package/dist-templates/gemini-cli/agents/openlife-genesis.md +59 -0
- package/dist-templates/gemini-cli/agents/openlife-lyra.md +40 -0
- package/dist-templates/gemini-cli/agents/openlife-maestro.md +45 -0
- package/dist-templates/gemini-cli/commands/openlife/ask.md +14 -0
- package/dist-templates/gemini-cli/commands/openlife/doctor.md +19 -0
- package/dist-templates/gemini-cli/commands/openlife/dream.md +20 -0
- package/dist-templates/gemini-cli/commands/openlife/status.md +14 -0
- package/dist-templates/gemini-cli/mcp/openlife-orchestrator.json +46 -0
- package/dist-templates/skill-template/README.md +34 -0
- package/dist-templates/skill-template/SKILL.md.template +59 -0
- package/dist-templates/squad-template/README.md +82 -0
- package/dist-templates/squad-template/SQUAD.md.template +51 -0
- package/dist-templates/squad-template/agent-template.md +51 -0
- package/dist-templates/squad-template/checklist-template.md +25 -0
- package/dist-templates/squad-template/task-template.md +36 -0
- package/dist-templates/workflows/PORTED_WORKFLOWS.md +60 -0
- package/dist-templates/workflows/brownfield-discovery.yaml +137 -0
- package/dist-templates/workflows/greenfield-fullstack.yaml +132 -0
- package/dist-templates/workflows/qa-loop.yaml +125 -0
- package/dist-templates/workflows/story-development-cycle.yaml +80 -0
- package/docs/CHANGELOG_FEATURE_ROLLOUT_DESIGNMD.md +43 -0
- package/docs/EXTERNAL_SOURCES_AND_SECURITY_GUARD.md +33 -0
- package/docs/OPENLIFE_AUDIT_2026-05-06.md +170 -0
- package/docs/OPENLIFE_CONSOLIDATED_PLAN_2026-05-06.md +299 -0
- package/docs/OPENLIFE_DUAL_MODE_IMPLEMENTATION_PLAN.md +205 -0
- package/docs/OPENLIFE_EVOLUTION_SURFACE_2026-05-07.md +53 -0
- package/docs/OPENLIFE_SKILLS_IMPORT_2026-05-07.json +223 -0
- package/docs/OPENLIFE_SQUADS_IMPORT_2026-05-07.json +184 -0
- package/docs/PAPERCLIP_OPENLIFE_INVESTIGATION.md +85 -0
- package/docs/README.md +28 -0
- package/docs/RELEASE_ORGANIZATION_PLAN.md +164 -0
- package/docs/audit/CLI-EXECUTION-RESULTS.md +113 -0
- package/docs/audit/CLI-MATRIX.md +556 -0
- package/docs/audit/DOC-PARITY-GAPS.md +351 -0
- package/docs/audit/ORCHESTRATOR-MATRIX.md +136 -0
- package/docs/audit/TEST-COVERAGE-GAPS.md +334 -0
- package/docs/audit/integrations/SKIPPED.md +101 -0
- package/docs/autonomous-install.md +79 -0
- package/docs/capability-genesis.md +137 -0
- package/docs/capability-pack-schema.md +157 -0
- package/docs/commands.md +82 -0
- package/docs/deep-research-capability.md +114 -0
- package/docs/development/typescript-conventions.md +95 -0
- package/docs/host-installers.md +68 -0
- package/docs/install/aiobuilder.md +70 -0
- package/docs/install/claude-code.md +83 -0
- package/docs/install/codex.md +64 -0
- package/docs/install/gemini-cli.md +64 -0
- package/docs/install/runtime-profiles.md +83 -0
- package/docs/openlife-agent-os-blueprint.md +114 -0
- package/docs/openlife-install-backlog.md +115 -0
- package/docs/openlife-install-spec.md +306 -0
- package/docs/operations/CLOUD_CUTOVER_AUDIT.md +37 -0
- package/docs/operations/PHASE_PROGRESS_CONTINUATION.md +24 -0
- package/docs/performance-benchmarks.md +83 -0
- package/docs/planning/v1.3-capability-genesis.md +157 -0
- package/docs/plans/2026-05-05-admin-interface-professional-dark-premium-plan.md +84 -0
- package/docs/plans/2026-05-05-openlife-autonomous-domain-marketplace-masterplan.md +122 -0
- package/docs/quickstart.md +60 -0
- package/docs/release-process.md +236 -0
- package/docs/roadmap/OPENLIFE_MASTER_PLAN_CLOUD_V3.md +97 -0
- package/docs/sandboxing-research.md +117 -0
- package/docs/stories/epic-feature-audit/1.1.story.md +84 -0
- package/docs/stories/epic-feature-audit/1.2.story.md +102 -0
- package/docs/stories/epic-feature-audit/1.3.story.md +93 -0
- package/docs/stories/epic-feature-audit/1.5.story.md +121 -0
- package/docs/stories/epic-feature-audit/1.6.story.md +80 -0
- package/docs/stories/epic-feature-completeness/2.1.story.md +70 -0
- package/docs/stories/epic-feature-completeness/2.2.story.md +49 -0
- package/docs/stories/epic-feature-completeness/2.3.story.md +74 -0
- package/docs/stories/epic-feature-completeness/2.4.story.md +71 -0
- package/docs/stories/epic-feature-completeness/3.1.story.md +56 -0
- package/docs/stories/epic-feature-completeness/3.2.story.md +80 -0
- package/docs/stories/epic-feature-completeness/3.3.story.md +68 -0
- package/docs/stories/epic-feature-completeness/3.4.story.md +71 -0
- package/docs/stories/epic-feature-completeness/3.5.story.md +72 -0
- package/docs/stories/epic-feature-completeness/3.6.story.md +69 -0
- package/docs/stories/epic-feature-completeness/3.7.story.md +68 -0
- package/docs/stories/epic-feature-completeness/3.8.story.md +57 -0
- package/docs/toolset-enforcement.md +122 -0
- package/docs/v1.4-changelog.md +159 -0
- package/docs/v1.5-changelog.md +106 -0
- package/docs/v1.5-roadmap.md +121 -0
- package/docs/v1.6-changelog.md +67 -0
- package/docs/v1.6-roadmap.md +89 -0
- package/docs/v1.7-changelog.md +98 -0
- package/docs/workflow-schema.md +177 -0
- package/package.json +177 -0
- package/scripts/clean-test-pollution.js +61 -0
- package/scripts/openlife-agent-start.sh +6 -0
- package/scripts/openlife-agent.service.example +13 -0
- package/scripts/openlife-agent.supervisord.conf.example +8 -0
- package/scripts/openlife-autonomous-install.sh +29 -0
- package/scripts/postinstall-check.sh +37 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const child_process_1 = require("child_process");
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
(0, child_process_1.execSync)('node dist/index.js sources import-ref skill sample-from-url https://skills.sh/', { stdio: 'pipe' });
|
|
40
|
+
const p = path.join(process.cwd(), '.catalog', 'skills', 'sample-from-url', 'IMPORTED_REFERENCE.md');
|
|
41
|
+
if (!fs.existsSync(p))
|
|
42
|
+
throw new Error('imported reference missing');
|
|
43
|
+
const txt = fs.readFileSync(p, 'utf-8');
|
|
44
|
+
if (!txt.includes('source: https://skills.sh/'))
|
|
45
|
+
throw new Error('missing source stamp');
|
|
46
|
+
console.log('TEST_SOURCES_IMPORT_REF_OK');
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const child_process_1 = require("child_process");
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
(0, child_process_1.execSync)('node dist/index.js sources scaffold skill test-skill --notes "seed"', { stdio: 'pipe' });
|
|
40
|
+
const p = path.join(process.cwd(), '.catalog', 'skills', 'test-skill', 'REFERENCE.md');
|
|
41
|
+
if (!fs.existsSync(p))
|
|
42
|
+
throw new Error('scaffold file missing');
|
|
43
|
+
console.log('TEST_SOURCES_SCAFFOLD_OK');
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* test_squad_skill_creator — Stories 5.1 + 5.2 combined regression.
|
|
4
|
+
*
|
|
5
|
+
* SquadCreator scenarios:
|
|
6
|
+
* 1. create — full directory layout with 3 agents + 2 tasks + 1 checklist
|
|
7
|
+
* 2. validate — frontmatter & component refs detected
|
|
8
|
+
* 3. list — returns squads filtered by status
|
|
9
|
+
* 4. analyze — surfaces orphan agents + missing checklist suggestion
|
|
10
|
+
* 5. create reject — duplicate id and no agents both fail with stable codes
|
|
11
|
+
* 6. v1.3 placeholders return clean "not_implemented" envelopes
|
|
12
|
+
*
|
|
13
|
+
* SkillCreator scenarios:
|
|
14
|
+
* 7. create — single SKILL.md generated with all sections
|
|
15
|
+
* 8. validate + analyze — frontmatter ok, section detection works
|
|
16
|
+
*
|
|
17
|
+
* Prints TEST_SQUAD_SKILL_CREATOR_OK on full pass.
|
|
18
|
+
*/
|
|
19
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}) : (function(o, m, k, k2) {
|
|
27
|
+
if (k2 === undefined) k2 = k;
|
|
28
|
+
o[k2] = m[k];
|
|
29
|
+
}));
|
|
30
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
31
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
32
|
+
}) : function(o, v) {
|
|
33
|
+
o["default"] = v;
|
|
34
|
+
});
|
|
35
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
36
|
+
var ownKeys = function(o) {
|
|
37
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const os = __importStar(require("os"));
|
|
55
|
+
const path = __importStar(require("path"));
|
|
56
|
+
const SquadCreator_1 = require("./orchestrator/SquadCreator");
|
|
57
|
+
const SkillCreator_1 = require("./orchestrator/SkillCreator");
|
|
58
|
+
function assert(cond, msg) {
|
|
59
|
+
if (!cond)
|
|
60
|
+
throw new Error(`assertion failed: ${msg}`);
|
|
61
|
+
}
|
|
62
|
+
function mkTmp() {
|
|
63
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'creator-test-'));
|
|
64
|
+
}
|
|
65
|
+
function rmTmp(dir) {
|
|
66
|
+
try {
|
|
67
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
68
|
+
}
|
|
69
|
+
catch { /* ignore */ }
|
|
70
|
+
}
|
|
71
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
72
|
+
const SQUAD_TEMPLATE = path.join(REPO_ROOT, 'dist-templates', 'squad-template');
|
|
73
|
+
const SKILL_TEMPLATE = path.join(REPO_ROOT, 'dist-templates', 'skill-template');
|
|
74
|
+
// ─────────────────────────────────────────────────────────────
|
|
75
|
+
// SquadCreator scenarios
|
|
76
|
+
// ─────────────────────────────────────────────────────────────
|
|
77
|
+
function scenarioSquadCreate() {
|
|
78
|
+
const tmp = mkTmp();
|
|
79
|
+
try {
|
|
80
|
+
const sc = new SquadCreator_1.SquadCreator({
|
|
81
|
+
catalogRoot: path.join(tmp, '.catalog', 'squads'),
|
|
82
|
+
templateRoot: SQUAD_TEMPLATE,
|
|
83
|
+
});
|
|
84
|
+
const proposal = {
|
|
85
|
+
id: 'test-research-squad',
|
|
86
|
+
name: 'test-research-squad',
|
|
87
|
+
description: 'Test squad for research workflows',
|
|
88
|
+
tags: ['research', 'synthesis'],
|
|
89
|
+
agents: [
|
|
90
|
+
{ id: 'research-lead', name: 'Research Lead', role: 'Lead coordinator' },
|
|
91
|
+
{ id: 'source-hunter', name: 'Source Hunter', role: 'Source discovery' },
|
|
92
|
+
{ id: 'synthesis-writer', name: 'Synthesis Writer', role: 'Report writing' },
|
|
93
|
+
],
|
|
94
|
+
tasks: [
|
|
95
|
+
{ id: 'discover-sources', ownerAgentId: 'source-hunter', purpose: 'Find primary sources' },
|
|
96
|
+
{ id: 'write-summary', ownerAgentId: 'synthesis-writer', purpose: 'Produce executive summary' },
|
|
97
|
+
],
|
|
98
|
+
checklists: [{
|
|
99
|
+
id: 'quality-gate',
|
|
100
|
+
purpose: 'Ensure deep-research outputs meet professional bar',
|
|
101
|
+
items: ['Has at least 3 primary sources', 'Conclusions cite evidence', 'Contradictions logged'],
|
|
102
|
+
}],
|
|
103
|
+
};
|
|
104
|
+
const result = sc.create(proposal);
|
|
105
|
+
assert(result.ok === true, `create must succeed, got: ${JSON.stringify(result)}`);
|
|
106
|
+
if (result.ok) {
|
|
107
|
+
// SQUAD.md (1) + agents (3) + tasks (2) + checklists (1) = 7
|
|
108
|
+
assert(result.filesCreated.length === 7, `expected 7 files, got ${result.filesCreated.length}`);
|
|
109
|
+
assert(fs.existsSync(path.join(result.squadDir, 'SQUAD.md')), 'SQUAD.md must exist');
|
|
110
|
+
assert(fs.existsSync(path.join(result.squadDir, 'agents', 'research-lead.md')), 'agent file must exist');
|
|
111
|
+
assert(fs.existsSync(path.join(result.squadDir, 'tasks', 'discover-sources.md')), 'task file must exist');
|
|
112
|
+
assert(fs.existsSync(path.join(result.squadDir, 'checklists', 'quality-gate.md')), 'checklist file must exist');
|
|
113
|
+
}
|
|
114
|
+
console.log('✅ scenario 1: SquadCreator.create — full directory layout');
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
rmTmp(tmp);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function scenarioSquadValidate() {
|
|
121
|
+
const tmp = mkTmp();
|
|
122
|
+
try {
|
|
123
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads'), templateRoot: SQUAD_TEMPLATE });
|
|
124
|
+
sc.create({
|
|
125
|
+
id: 'val-squad',
|
|
126
|
+
name: 'val-squad',
|
|
127
|
+
description: 'Validation test',
|
|
128
|
+
agents: [{ id: 'a-1', name: 'A1', role: 'lead' }],
|
|
129
|
+
});
|
|
130
|
+
const ok = sc.validate('val-squad');
|
|
131
|
+
assert(ok.ok, `validate must pass, errors: ${ok.errors.join(',')}`);
|
|
132
|
+
assert(ok.errors.length === 0, 'no errors expected');
|
|
133
|
+
const missing = sc.validate('does-not-exist');
|
|
134
|
+
assert(!missing.ok, 'validate must fail for missing squad');
|
|
135
|
+
console.log('✅ scenario 2: SquadCreator.validate');
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
rmTmp(tmp);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function scenarioSquadList() {
|
|
142
|
+
const tmp = mkTmp();
|
|
143
|
+
try {
|
|
144
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads'), templateRoot: SQUAD_TEMPLATE });
|
|
145
|
+
sc.create({ id: 'a-sq', name: 'A', description: '', status: 'active', agents: [{ id: 'x', name: 'X', role: 'r' }] });
|
|
146
|
+
sc.create({ id: 'b-sq', name: 'B', description: '', status: 'draft', agents: [{ id: 'y', name: 'Y', role: 'r' }] });
|
|
147
|
+
const all = sc.list();
|
|
148
|
+
assert(all.length === 2, `expected 2 squads, got ${all.length}`);
|
|
149
|
+
const drafts = sc.list({ status: 'draft' });
|
|
150
|
+
assert(drafts.length === 1 && drafts[0].id === 'b-sq', `draft filter mismatch: ${JSON.stringify(drafts)}`);
|
|
151
|
+
console.log('✅ scenario 3: SquadCreator.list (filter by status)');
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
rmTmp(tmp);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function scenarioSquadAnalyze() {
|
|
158
|
+
const tmp = mkTmp();
|
|
159
|
+
try {
|
|
160
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads'), templateRoot: SQUAD_TEMPLATE });
|
|
161
|
+
sc.create({
|
|
162
|
+
id: 'anal-sq',
|
|
163
|
+
name: 'anal-sq',
|
|
164
|
+
description: 'Analysis test',
|
|
165
|
+
agents: [
|
|
166
|
+
{ id: 'used-agent', name: 'U', role: 'r' },
|
|
167
|
+
{ id: 'orphan-agent', name: 'O', role: 'r' },
|
|
168
|
+
],
|
|
169
|
+
tasks: [{ id: 'a-task', ownerAgentId: 'used-agent', purpose: 'x' }],
|
|
170
|
+
});
|
|
171
|
+
const a = sc.analyze('anal-sq');
|
|
172
|
+
assert(a !== null, 'analyze must return result');
|
|
173
|
+
assert(a.agentCount === 2, `expected 2 agents, got ${a.agentCount}`);
|
|
174
|
+
assert(a.taskCount === 1, `expected 1 task, got ${a.taskCount}`);
|
|
175
|
+
assert(a.orphanAgents.includes('orphan-agent'), `expected orphan-agent in orphanAgents, got: ${a.orphanAgents.join(',')}`);
|
|
176
|
+
assert(a.suggestions.some((s) => /quality gates|checklist/i.test(s)), 'should suggest adding a checklist');
|
|
177
|
+
console.log('✅ scenario 4: SquadCreator.analyze (orphans + suggestions)');
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
rmTmp(tmp);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function scenarioSquadCreateRejects() {
|
|
184
|
+
const tmp = mkTmp();
|
|
185
|
+
try {
|
|
186
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads'), templateRoot: SQUAD_TEMPLATE });
|
|
187
|
+
// First creation succeeds
|
|
188
|
+
const first = sc.create({ id: 'dup-test', name: 'dup', description: '', agents: [{ id: 'a', name: 'A', role: 'r' }] });
|
|
189
|
+
assert(first.ok, 'first create must succeed');
|
|
190
|
+
// Second with same id fails
|
|
191
|
+
const dup = sc.create({ id: 'dup-test', name: 'dup', description: '', agents: [{ id: 'a', name: 'A', role: 'r' }] });
|
|
192
|
+
assert(!dup.ok && dup.error === 'squad_already_exists', `expected squad_already_exists, got: ${JSON.stringify(dup)}`);
|
|
193
|
+
// No agents → no_agents error
|
|
194
|
+
const noAgents = sc.create({ id: 'no-agents-sq', name: 'X', description: '', agents: [] });
|
|
195
|
+
assert(!noAgents.ok && noAgents.error === 'no_agents', `expected no_agents, got: ${JSON.stringify(noAgents)}`);
|
|
196
|
+
console.log('✅ scenario 5: SquadCreator.create rejects (dup id + no agents)');
|
|
197
|
+
}
|
|
198
|
+
finally {
|
|
199
|
+
rmTmp(tmp);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function scenarioPlaceholders() {
|
|
203
|
+
const tmp = mkTmp();
|
|
204
|
+
try {
|
|
205
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads'), templateRoot: SQUAD_TEMPLATE });
|
|
206
|
+
// v1.3 (Story 3.1): design() now produces a proposal heuristically.
|
|
207
|
+
const designed = sc.design('research mid-cap medical devices', { mode: 'professional' });
|
|
208
|
+
assert(designed.ok === true, 'design produces proposal');
|
|
209
|
+
if (designed.ok) {
|
|
210
|
+
assert(designed.proposal.agents.length >= 3, 'design includes >=3 agents in professional mode');
|
|
211
|
+
}
|
|
212
|
+
// v1.4 (Story 11.1-11.3): migrate/extend/publish are now real;
|
|
213
|
+
// calling them on a non-existent squad should surface squad_not_found.
|
|
214
|
+
assert(sc.migrate('demo-x', '1.0', '1.1').error === 'squad_not_found', 'migrate squad_not_found');
|
|
215
|
+
assert(sc.extend('demo-x', { kind: 'agent', spec: { id: 'a1', name: 'A1', role: 'r' } }).error === 'squad_not_found', 'extend squad_not_found');
|
|
216
|
+
assert(sc.publish('demo-x').error === 'squad_not_found', 'publish squad_not_found');
|
|
217
|
+
console.log('✅ scenario 6: design() heuristic + migrate/extend/publish real (Stories 11.1-11.3)');
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
rmTmp(tmp);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// ─────────────────────────────────────────────────────────────
|
|
224
|
+
// SkillCreator scenarios
|
|
225
|
+
// ─────────────────────────────────────────────────────────────
|
|
226
|
+
function scenarioSkillCreate() {
|
|
227
|
+
const tmp = mkTmp();
|
|
228
|
+
try {
|
|
229
|
+
const sk = new SkillCreator_1.SkillCreator({ catalogRoot: path.join(tmp, '.catalog', 'skills'), templateRoot: SKILL_TEMPLATE });
|
|
230
|
+
const proposal = {
|
|
231
|
+
id: 'source-credibility',
|
|
232
|
+
name: 'Source Credibility Scoring',
|
|
233
|
+
description: 'Score sources by authority, recency, bias, and primary-ness',
|
|
234
|
+
whenToUse: ['Evaluating an unfamiliar source', 'Resolving contradictions'],
|
|
235
|
+
procedure: ['Check author', 'Check date', 'Check primary-ness', 'Assign confidence band'],
|
|
236
|
+
inputs: ['Source URL or doc'],
|
|
237
|
+
outputs: ['Confidence score 0-1'],
|
|
238
|
+
validations: ['Score is in [0,1]'],
|
|
239
|
+
guardrails: ['Never assign 1.0 without a primary source link'],
|
|
240
|
+
};
|
|
241
|
+
const r = sk.create(proposal);
|
|
242
|
+
assert(r.ok === true, `skill create must succeed: ${JSON.stringify(r)}`);
|
|
243
|
+
if (r.ok) {
|
|
244
|
+
assert(fs.existsSync(r.filePath), 'SKILL.md must exist');
|
|
245
|
+
const content = fs.readFileSync(r.filePath, 'utf-8');
|
|
246
|
+
assert(/## When to use/.test(content), 'rendered content must have When to use section');
|
|
247
|
+
assert(/## Procedure/.test(content), 'rendered content must have Procedure section');
|
|
248
|
+
assert(content.includes('Score sources by authority'), 'description must round-trip');
|
|
249
|
+
}
|
|
250
|
+
console.log('✅ scenario 7: SkillCreator.create — SKILL.md rendered');
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
rmTmp(tmp);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function scenarioSkillValidateAnalyze() {
|
|
257
|
+
const tmp = mkTmp();
|
|
258
|
+
try {
|
|
259
|
+
const sk = new SkillCreator_1.SkillCreator({ catalogRoot: path.join(tmp, '.catalog', 'skills'), templateRoot: SKILL_TEMPLATE });
|
|
260
|
+
sk.create({
|
|
261
|
+
id: 'analyze-test-skill',
|
|
262
|
+
name: 'Analyze Test',
|
|
263
|
+
description: 'd',
|
|
264
|
+
whenToUse: ['always'],
|
|
265
|
+
procedure: ['step'],
|
|
266
|
+
});
|
|
267
|
+
const v = sk.validate('analyze-test-skill');
|
|
268
|
+
assert(v.ok, `validate must pass: ${v.errors.join(',')}`);
|
|
269
|
+
const a = sk.analyze('analyze-test-skill');
|
|
270
|
+
assert(a !== null, 'analyze must return result');
|
|
271
|
+
assert(a.hasProcedure === true, 'procedure section present');
|
|
272
|
+
assert(a.hasWhenToUse === true, 'when-to-use section present');
|
|
273
|
+
// Missing skill
|
|
274
|
+
assert(sk.analyze('nope') === null, 'analyze returns null for missing skill');
|
|
275
|
+
const missing = sk.validate('nope');
|
|
276
|
+
assert(!missing.ok, 'validate fails for missing skill');
|
|
277
|
+
console.log('✅ scenario 8: SkillCreator.validate + analyze');
|
|
278
|
+
}
|
|
279
|
+
finally {
|
|
280
|
+
rmTmp(tmp);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// ─────────────────────────────────────────────────────────────
|
|
284
|
+
// Driver
|
|
285
|
+
// ─────────────────────────────────────────────────────────────
|
|
286
|
+
function main() {
|
|
287
|
+
console.log('🧪 test_squad_skill_creator — Stories 5.1 + 5.2 regression suite');
|
|
288
|
+
scenarioSquadCreate();
|
|
289
|
+
scenarioSquadValidate();
|
|
290
|
+
scenarioSquadList();
|
|
291
|
+
scenarioSquadAnalyze();
|
|
292
|
+
scenarioSquadCreateRejects();
|
|
293
|
+
scenarioPlaceholders();
|
|
294
|
+
scenarioSkillCreate();
|
|
295
|
+
scenarioSkillValidateAnalyze();
|
|
296
|
+
console.log('');
|
|
297
|
+
console.log('TEST_SQUAD_SKILL_CREATOR_OK');
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
main();
|
|
301
|
+
}
|
|
302
|
+
catch (err) {
|
|
303
|
+
console.error('❌ test_squad_skill_creator FAILED:', err instanceof Error ? err.message : err);
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* test_squad_skill_design_llm.ts — Stories 8.1 + 8.2
|
|
4
|
+
*
|
|
5
|
+
* Asserts that:
|
|
6
|
+
* 1. Brain.isAnyProviderAvailable() returns false when no env keys.
|
|
7
|
+
* 2. SquadCreator.designWithBrain() falls back to heuristic when
|
|
8
|
+
* Brain reports no provider.
|
|
9
|
+
* 3. With a mocked Brain that returns valid JSON, designWithBrain()
|
|
10
|
+
* returns source='brain'.
|
|
11
|
+
* 4. With a mocked Brain that throws / returns junk, designWithBrain()
|
|
12
|
+
* gracefully falls back to source='heuristic'.
|
|
13
|
+
* 5. Same four scenarios for SkillCreator.designWithBrain().
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
const fs = __importStar(require("fs"));
|
|
50
|
+
const os = __importStar(require("os"));
|
|
51
|
+
const path = __importStar(require("path"));
|
|
52
|
+
const Brain_1 = require("./orchestrator/Brain");
|
|
53
|
+
const SquadCreator_1 = require("./orchestrator/SquadCreator");
|
|
54
|
+
const SkillCreator_1 = require("./orchestrator/SkillCreator");
|
|
55
|
+
function assertTrue(cond, label) {
|
|
56
|
+
if (!cond)
|
|
57
|
+
throw new Error(`ASSERT_FAILED[${label}]`);
|
|
58
|
+
}
|
|
59
|
+
async function main() {
|
|
60
|
+
// ── Scenario 1: real Brain reports no providers when env is clean ──
|
|
61
|
+
const origKeys = {
|
|
62
|
+
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
|
63
|
+
ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY,
|
|
64
|
+
GEMINI_API_KEY: process.env.GEMINI_API_KEY,
|
|
65
|
+
OPENROUTER_API_KEY: process.env.OPENROUTER_API_KEY,
|
|
66
|
+
OLLAMA_URL: process.env.OLLAMA_URL,
|
|
67
|
+
};
|
|
68
|
+
delete process.env.OPENAI_API_KEY;
|
|
69
|
+
delete process.env.ANTHROPIC_API_KEY;
|
|
70
|
+
delete process.env.GEMINI_API_KEY;
|
|
71
|
+
delete process.env.OPENROUTER_API_KEY;
|
|
72
|
+
delete process.env.OLLAMA_URL;
|
|
73
|
+
const cleanBrain = new Brain_1.Brain();
|
|
74
|
+
assertTrue(!cleanBrain.isAnyProviderAvailable(), 'Brain reports unavailable with no env');
|
|
75
|
+
console.log('[8.1] Brain.isAnyProviderAvailable returns false when clean ✓');
|
|
76
|
+
// ── Scenario 2: SquadCreator.designWithBrain with unavailable Brain → heuristic ──
|
|
77
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'design-llm-'));
|
|
78
|
+
try {
|
|
79
|
+
const sc = new SquadCreator_1.SquadCreator({ catalogRoot: path.join(tmp, '.catalog', 'squads') });
|
|
80
|
+
const noBrain = {
|
|
81
|
+
isAnyProviderAvailable: () => false,
|
|
82
|
+
think: async () => { throw new Error('should not be called'); },
|
|
83
|
+
};
|
|
84
|
+
const r1 = await sc.designWithBrain(noBrain, 'research mid-cap medical devices', { mode: 'professional' });
|
|
85
|
+
assertTrue(r1.ok, 'designWithBrain ok when no provider');
|
|
86
|
+
if (r1.ok) {
|
|
87
|
+
assertTrue(r1.source === 'heuristic', `source=heuristic (got ${r1.source})`);
|
|
88
|
+
assertTrue(r1.proposal.agents.length >= 3, 'heuristic professional has >=3 agents');
|
|
89
|
+
}
|
|
90
|
+
console.log('[8.1] SquadCreator.designWithBrain unavailable → heuristic ✓');
|
|
91
|
+
// ── Scenario 3: Mocked Brain returns valid JSON → source=brain ──
|
|
92
|
+
const validBrain = {
|
|
93
|
+
isAnyProviderAvailable: () => true,
|
|
94
|
+
think: async () => `\`\`\`json
|
|
95
|
+
{
|
|
96
|
+
"agents": [
|
|
97
|
+
{ "id": "research-lead", "role": "lead" },
|
|
98
|
+
{ "id": "research-executor", "role": "executor" },
|
|
99
|
+
{ "id": "research-reviewer", "role": "reviewer" }
|
|
100
|
+
],
|
|
101
|
+
"tasks": [
|
|
102
|
+
{ "id": "research-default", "ownerAgentId": "research-lead", "purpose": "do the research" }
|
|
103
|
+
],
|
|
104
|
+
"checklists": []
|
|
105
|
+
}
|
|
106
|
+
\`\`\``,
|
|
107
|
+
};
|
|
108
|
+
const r2 = await sc.designWithBrain(validBrain, 'research medical devices', { mode: 'professional', id: 'mock-brain-squad' });
|
|
109
|
+
assertTrue(r2.ok, 'designWithBrain ok with valid mocked Brain');
|
|
110
|
+
if (r2.ok) {
|
|
111
|
+
assertTrue(r2.source === 'brain', `source=brain (got ${r2.source})`);
|
|
112
|
+
assertTrue(r2.proposal.agents.length === 3, '3 agents from mocked response');
|
|
113
|
+
assertTrue(r2.proposal.agents[0].id === 'research-lead', 'first agent id preserved');
|
|
114
|
+
}
|
|
115
|
+
console.log('[8.1] SquadCreator.designWithBrain valid JSON → source=brain ✓');
|
|
116
|
+
// ── Scenario 4: Mocked Brain returns junk → falls back to heuristic ──
|
|
117
|
+
const junkBrain = {
|
|
118
|
+
isAnyProviderAvailable: () => true,
|
|
119
|
+
think: async () => 'definitely not JSON, just prose',
|
|
120
|
+
};
|
|
121
|
+
const r3 = await sc.designWithBrain(junkBrain, 'something weird', { mode: 'quick', id: 'junk-test-squad' });
|
|
122
|
+
assertTrue(r3.ok, 'designWithBrain ok despite junk');
|
|
123
|
+
if (r3.ok) {
|
|
124
|
+
assertTrue(r3.source === 'heuristic', `source=heuristic on junk (got ${r3.source})`);
|
|
125
|
+
}
|
|
126
|
+
console.log('[8.1] SquadCreator.designWithBrain junk → heuristic fallback ✓');
|
|
127
|
+
// ── Scenario 5: Mocked Brain throws → falls back ──
|
|
128
|
+
const throwBrain = {
|
|
129
|
+
isAnyProviderAvailable: () => true,
|
|
130
|
+
think: async () => { throw new Error('network'); },
|
|
131
|
+
};
|
|
132
|
+
const r4 = await sc.designWithBrain(throwBrain, 'will throw', { mode: 'quick', id: 'throw-test-squad' });
|
|
133
|
+
assertTrue(r4.ok, 'designWithBrain ok despite throw');
|
|
134
|
+
if (r4.ok)
|
|
135
|
+
assertTrue(r4.source === 'heuristic', `source=heuristic on throw (got ${r4.source})`);
|
|
136
|
+
console.log('[8.1] SquadCreator.designWithBrain throw → heuristic fallback ✓');
|
|
137
|
+
// ── Scenarios 6–9: same for SkillCreator ──
|
|
138
|
+
const skc = new SkillCreator_1.SkillCreator({ catalogRoot: path.join(tmp, '.catalog', 'skills') });
|
|
139
|
+
const r5 = await skc.designWithBrain(noBrain, 'extract images from PDFs', { mode: 'professional' });
|
|
140
|
+
assertTrue(r5.ok && r5.source === 'heuristic', '[8.2] SkillCreator unavailable → heuristic');
|
|
141
|
+
console.log('[8.2] SkillCreator.designWithBrain unavailable → heuristic ✓');
|
|
142
|
+
const validSkillBrain = {
|
|
143
|
+
isAnyProviderAvailable: () => true,
|
|
144
|
+
think: async () => `{
|
|
145
|
+
"description": "extract structured data from PDFs",
|
|
146
|
+
"whenToUse": ["pdf parsing needed", "structured extraction"],
|
|
147
|
+
"procedure": ["open pdf", "OCR pages", "parse layout", "emit JSON"],
|
|
148
|
+
"validation": ["json schema valid"],
|
|
149
|
+
"guardrails": ["never store raw pdf content"]
|
|
150
|
+
}`,
|
|
151
|
+
};
|
|
152
|
+
const r6 = await skc.designWithBrain(validSkillBrain, 'pdf-extract', { mode: 'professional', id: 'pdf-extract' });
|
|
153
|
+
assertTrue(r6.ok && r6.source === 'brain', '[8.2] SkillCreator valid → brain');
|
|
154
|
+
if (r6.ok) {
|
|
155
|
+
assertTrue(r6.proposal.procedure.length === 4, '4 procedure steps');
|
|
156
|
+
assertTrue(r6.proposal.guardrails?.[0] === 'never store raw pdf content', 'guardrail preserved');
|
|
157
|
+
}
|
|
158
|
+
console.log('[8.2] SkillCreator.designWithBrain valid → source=brain ✓');
|
|
159
|
+
const r7 = await skc.designWithBrain(junkBrain, 'junk skill', { mode: 'quick', id: 'junk-skill' });
|
|
160
|
+
assertTrue(r7.ok && r7.source === 'heuristic', '[8.2] SkillCreator junk → heuristic');
|
|
161
|
+
console.log('[8.2] SkillCreator.designWithBrain junk → heuristic ✓');
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
165
|
+
// restore env
|
|
166
|
+
for (const [k, v] of Object.entries(origKeys)) {
|
|
167
|
+
if (v !== undefined)
|
|
168
|
+
process.env[k] = v;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
console.log('TEST_SQUAD_SKILL_DESIGN_LLM_OK');
|
|
172
|
+
}
|
|
173
|
+
main().catch((err) => {
|
|
174
|
+
console.error('[design-llm] FAILED:', err instanceof Error ? err.message : err);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
});
|