@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,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* test_deep_research_capability.ts — Story 3.4
|
|
4
|
+
*
|
|
5
|
+
* Asserts the bundled `.catalog/capabilities/deep-research/` pack exists,
|
|
6
|
+
* parses cleanly via CapabilityPackParser, and exposes the 5 skills + 1
|
|
7
|
+
* squad + 1 workflow promised by the Hermes brief.
|
|
8
|
+
*
|
|
9
|
+
* This is a seed-asset regression: if anyone moves/breaks the deep-research
|
|
10
|
+
* pack, this test fails fast.
|
|
11
|
+
*/
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const CapabilityPackParser_1 = require("./orchestrator/capability/CapabilityPackParser");
|
|
49
|
+
function assertTrue(cond, label) {
|
|
50
|
+
if (!cond)
|
|
51
|
+
throw new Error(`ASSERT_FAILED[${label}]`);
|
|
52
|
+
}
|
|
53
|
+
const packDir = path.join(process.cwd(), '.catalog', 'capabilities', 'deep-research');
|
|
54
|
+
assertTrue(fs.existsSync(packDir), `pack dir exists at ${packDir}`);
|
|
55
|
+
const manifestPath = path.join(packDir, 'capability.yaml');
|
|
56
|
+
assertTrue(fs.existsSync(manifestPath), 'capability.yaml present');
|
|
57
|
+
console.log('[3.4] manifest present ✓');
|
|
58
|
+
const r = (0, CapabilityPackParser_1.parseCapabilityPackFile)(manifestPath);
|
|
59
|
+
assertTrue(r.ok, `manifest parses cleanly (errors=${JSON.stringify(r.errors)})`);
|
|
60
|
+
const pack = r.pack;
|
|
61
|
+
assertTrue(pack.id === 'deep-research', 'id matches');
|
|
62
|
+
assertTrue(pack.status === 'draft', 'status starts at draft');
|
|
63
|
+
console.log('[3.4] manifest parses ✓');
|
|
64
|
+
// Hermes brief asks for: 5 skills + 1 squad + 1 workflow.
|
|
65
|
+
const skillIds = new Set((pack.skills || []).map((s) => s.id));
|
|
66
|
+
const expectedSkills = ['source-credibility-scoring', 'evidence-synthesis', 'contradiction-analysis', 'advanced-query-planning', 'executive-briefing'];
|
|
67
|
+
for (const s of expectedSkills) {
|
|
68
|
+
assertTrue(skillIds.has(s), `skill '${s}' present`);
|
|
69
|
+
}
|
|
70
|
+
console.log(`[3.4] ${expectedSkills.length}/5 expected skills present ✓`);
|
|
71
|
+
const squadIds = new Set((pack.squads || []).map((s) => s.id));
|
|
72
|
+
assertTrue(squadIds.has('research-squad'), 'research-squad present');
|
|
73
|
+
console.log('[3.4] research-squad present ✓');
|
|
74
|
+
const workflowIds = new Set((pack.workflows || []).map((s) => s.id));
|
|
75
|
+
assertTrue(workflowIds.has('deep-research-flow'), 'deep-research-flow present');
|
|
76
|
+
console.log('[3.4] deep-research-flow present ✓');
|
|
77
|
+
// All embedded refs must have corresponding files.
|
|
78
|
+
for (const s of expectedSkills) {
|
|
79
|
+
assertTrue(fs.existsSync(path.join(packDir, 'skills', `${s}.md`)), `skill file ${s}.md exists`);
|
|
80
|
+
}
|
|
81
|
+
assertTrue(fs.existsSync(path.join(packDir, 'squads', 'research-squad', 'SQUAD.md')), 'research-squad SQUAD.md exists');
|
|
82
|
+
assertTrue(fs.existsSync(path.join(packDir, 'workflows', 'deep-research-flow.yaml')), 'deep-research-flow.yaml exists');
|
|
83
|
+
console.log('[3.4] all embedded files present ✓');
|
|
84
|
+
// INDEX.md
|
|
85
|
+
assertTrue(fs.existsSync(path.join(packDir, 'INDEX.md')), 'INDEX.md present');
|
|
86
|
+
console.log('[3.4] INDEX.md present ✓');
|
|
87
|
+
console.log('TEST_DEEP_RESEARCH_CAPABILITY_OK');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DesignMdImporter_1 = require("./design/DesignMdImporter");
|
|
4
|
+
const DesignMdRegistry_1 = require("./design/DesignMdRegistry");
|
|
5
|
+
const importer = new DesignMdImporter_1.DesignMdImporter();
|
|
6
|
+
const imported = importer.importFromVendor('vendor/awesome-design-md');
|
|
7
|
+
if (!imported.length)
|
|
8
|
+
throw new Error('expected imported profiles');
|
|
9
|
+
const reg = new DesignMdRegistry_1.DesignMdRegistry();
|
|
10
|
+
const list = reg.list();
|
|
11
|
+
if (!list.length)
|
|
12
|
+
throw new Error('expected registry list');
|
|
13
|
+
const one = reg.get(list[0].id);
|
|
14
|
+
if (!one.meta || !one.design)
|
|
15
|
+
throw new Error('expected profile details');
|
|
16
|
+
console.log('TEST_DESIGNMD_IMPORT_REGISTRY_OK');
|
|
@@ -0,0 +1,50 @@
|
|
|
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 ReversaAgent_1 = require("./reversa/ReversaAgent");
|
|
37
|
+
const DesignMdMode_1 = require("./design/DesignMdMode");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const r = new ReversaAgent_1.ReversaAgent();
|
|
41
|
+
const s = r.setMode('designmd', 'voltagent-claude');
|
|
42
|
+
if (s.mode !== 'designmd')
|
|
43
|
+
throw new Error('reversa mode not set');
|
|
44
|
+
const dm = new DesignMdMode_1.DesignMdMode('testws');
|
|
45
|
+
const applied = dm.applyProfile({ id: 'voltagent-claude', source: 'awesome-design-md', title: 'Claude style', appliedAt: new Date().toISOString() }, '# DESIGN\n\nSample', { force: true });
|
|
46
|
+
if (!applied.id)
|
|
47
|
+
throw new Error('design profile not applied');
|
|
48
|
+
if (!fs.existsSync(path.join(process.cwd(), 'DESIGN.md')))
|
|
49
|
+
throw new Error('DESIGN.md not written');
|
|
50
|
+
console.log('TEST_DESIGNMD_MODE_OK');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DesignMdMode_1 = require("./design/DesignMdMode");
|
|
4
|
+
const DesignMdImporter_1 = require("./design/DesignMdImporter");
|
|
5
|
+
new DesignMdImporter_1.DesignMdImporter().importFromVendor('vendor/awesome-design-md');
|
|
6
|
+
const mode = new DesignMdMode_1.DesignMdMode('testws2');
|
|
7
|
+
const profiles = mode.listProfiles();
|
|
8
|
+
if (!profiles.length)
|
|
9
|
+
throw new Error('profiles should exist');
|
|
10
|
+
const applied = mode.applyByProfileId(profiles[0].id, { force: true });
|
|
11
|
+
if (!applied.id)
|
|
12
|
+
throw new Error('applyByProfileId should apply');
|
|
13
|
+
console.log('TEST_DESIGNMD_MODE_WORKSPACE_OK');
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
/*
|
|
37
|
+
* Story 3.2 — dist-templates layout regression test.
|
|
38
|
+
*
|
|
39
|
+
* Asserts:
|
|
40
|
+
* 1. dist-templates/claude-code/{agents,commands/openlife,mcp} all exist
|
|
41
|
+
* 2. The 5 starter agents (MAESTRO/LYRA/FORGE/ATLAS/GENESIS) ship as `openlife-*.md`
|
|
42
|
+
* 3. Each agent file parses: YAML frontmatter with required keys (name, description), and a non-empty body
|
|
43
|
+
* 4. The 4 starter slash commands ship under commands/openlife/
|
|
44
|
+
* 5. Each slash command has a `description` in its frontmatter
|
|
45
|
+
* 6. The MCP manifest is valid JSON with a `name` field
|
|
46
|
+
* 7. dist-templates/ is included in package.json `files` so npm publishes it
|
|
47
|
+
*/
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
function assert(cond, msg) {
|
|
51
|
+
if (!cond)
|
|
52
|
+
throw new Error(`ASSERTION_FAILED: ${msg}`);
|
|
53
|
+
}
|
|
54
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
55
|
+
const DIST = path.join(ROOT, 'dist-templates');
|
|
56
|
+
const CC = path.join(DIST, 'claude-code');
|
|
57
|
+
function parseFrontmatter(content) {
|
|
58
|
+
if (!content.startsWith('---\n')) {
|
|
59
|
+
throw new Error('Missing frontmatter opening "---\\n"');
|
|
60
|
+
}
|
|
61
|
+
const rest = content.slice(4);
|
|
62
|
+
const endIdx = rest.indexOf('\n---\n');
|
|
63
|
+
if (endIdx === -1)
|
|
64
|
+
throw new Error('Missing frontmatter closing "\\n---\\n"');
|
|
65
|
+
const fmRaw = rest.slice(0, endIdx);
|
|
66
|
+
const body = rest.slice(endIdx + 5).trim();
|
|
67
|
+
const fm = {};
|
|
68
|
+
for (const line of fmRaw.split('\n')) {
|
|
69
|
+
const m = line.match(/^([a-zA-Z0-9_-]+):\s*(.*)$/);
|
|
70
|
+
if (m)
|
|
71
|
+
fm[m[1]] = m[2].trim();
|
|
72
|
+
}
|
|
73
|
+
return { fm, body };
|
|
74
|
+
}
|
|
75
|
+
function testDirectoryLayout() {
|
|
76
|
+
assert(fs.existsSync(DIST), 'dist-templates/ must exist');
|
|
77
|
+
assert(fs.existsSync(CC), 'dist-templates/claude-code/ must exist');
|
|
78
|
+
assert(fs.existsSync(path.join(CC, 'agents')), 'agents/ must exist');
|
|
79
|
+
assert(fs.existsSync(path.join(CC, 'commands', 'openlife')), 'commands/openlife/ must exist');
|
|
80
|
+
assert(fs.existsSync(path.join(CC, 'mcp')), 'mcp/ must exist');
|
|
81
|
+
assert(fs.existsSync(path.join(DIST, 'README.md')), 'dist-templates/README.md must exist');
|
|
82
|
+
}
|
|
83
|
+
function testStarterAgents() {
|
|
84
|
+
const expected = ['openlife-maestro', 'openlife-lyra', 'openlife-forge', 'openlife-atlas', 'openlife-genesis'];
|
|
85
|
+
for (const name of expected) {
|
|
86
|
+
const file = path.join(CC, 'agents', `${name}.md`);
|
|
87
|
+
assert(fs.existsSync(file), `${file} must exist`);
|
|
88
|
+
const { fm, body } = parseFrontmatter(fs.readFileSync(file, 'utf-8'));
|
|
89
|
+
assert(fm.name === name, `${name}.md frontmatter.name must equal ${name}, got "${fm.name}"`);
|
|
90
|
+
assert(fm.description && fm.description.length > 30, `${name}.md description too short or missing`);
|
|
91
|
+
assert(body.length > 200, `${name}.md body too short (${body.length} chars) — system prompts should be substantive`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function testStarterSlashCommands() {
|
|
95
|
+
const expected = ['status', 'ask', 'doctor', 'dream'];
|
|
96
|
+
for (const name of expected) {
|
|
97
|
+
const file = path.join(CC, 'commands', 'openlife', `${name}.md`);
|
|
98
|
+
assert(fs.existsSync(file), `${file} must exist`);
|
|
99
|
+
const { fm, body } = parseFrontmatter(fs.readFileSync(file, 'utf-8'));
|
|
100
|
+
assert(fm.description && fm.description.length > 10, `${name}.md needs a description`);
|
|
101
|
+
assert(body.length > 50, `${name}.md body too short`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function testMcpManifest() {
|
|
105
|
+
const file = path.join(CC, 'mcp', 'openlife-orchestrator.json');
|
|
106
|
+
assert(fs.existsSync(file), `${file} must exist`);
|
|
107
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
108
|
+
let parsed;
|
|
109
|
+
try {
|
|
110
|
+
parsed = JSON.parse(content);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
throw new Error(`MCP manifest is not valid JSON: ${err.message}`);
|
|
114
|
+
}
|
|
115
|
+
assert(parsed.name === 'openlife-orchestrator', 'MCP manifest.name must be openlife-orchestrator');
|
|
116
|
+
assert(Array.isArray(parsed.tools) && parsed.tools.length > 0, 'MCP manifest.tools must be a non-empty array');
|
|
117
|
+
assert(typeof parsed.command === 'string' && parsed.command.length > 0, 'MCP manifest.command required');
|
|
118
|
+
}
|
|
119
|
+
function testPackageJsonIncludesTemplates() {
|
|
120
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf-8'));
|
|
121
|
+
assert(Array.isArray(pkg.files), 'package.json.files must be an array');
|
|
122
|
+
assert(pkg.files.includes('dist-templates'), `package.json.files must include "dist-templates" so npm distributes it; got: ${JSON.stringify(pkg.files)}`);
|
|
123
|
+
}
|
|
124
|
+
async function main() {
|
|
125
|
+
testDirectoryLayout();
|
|
126
|
+
testStarterAgents();
|
|
127
|
+
testStarterSlashCommands();
|
|
128
|
+
testMcpManifest();
|
|
129
|
+
testPackageJsonIncludesTemplates();
|
|
130
|
+
console.log('TEST_DIST_TEMPLATES_LAYOUT_OK');
|
|
131
|
+
}
|
|
132
|
+
main().catch((err) => {
|
|
133
|
+
console.error('TEST_DIST_TEMPLATES_LAYOUT_FAIL:', err?.message || err);
|
|
134
|
+
process.exit(1);
|
|
135
|
+
});
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* test_distributed_lock — Story 6.4 regression suite.
|
|
4
|
+
*
|
|
5
|
+
* Four scenarios:
|
|
6
|
+
* 1. Acquire + release happy path; peek round-trips the record
|
|
7
|
+
* 2. Collision — second acquire on same key fails while first holds
|
|
8
|
+
* 3. TTL expiry — stale lock can be taken over after ttlMs elapses
|
|
9
|
+
* (test uses a tiny ttlMs and a controlled busy-wait, no sleep)
|
|
10
|
+
* 4. Renew + steal-detection — renewing a lock we no longer own
|
|
11
|
+
* (file overwritten by an attacker simulation) returns false
|
|
12
|
+
*
|
|
13
|
+
* Prints TEST_DISTRIBUTED_LOCK_OK on full pass.
|
|
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 DistributedLock_1 = require("./orchestrator/util/DistributedLock");
|
|
53
|
+
const AtomicWriter_1 = require("./orchestrator/util/AtomicWriter");
|
|
54
|
+
function assert(cond, msg) {
|
|
55
|
+
if (!cond)
|
|
56
|
+
throw new Error(`assertion failed: ${msg}`);
|
|
57
|
+
}
|
|
58
|
+
function mkTmp() {
|
|
59
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'lock-test-'));
|
|
60
|
+
}
|
|
61
|
+
function rmTmp(dir) {
|
|
62
|
+
try {
|
|
63
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
64
|
+
}
|
|
65
|
+
catch { /* ignore */ }
|
|
66
|
+
}
|
|
67
|
+
function busyWait(ms) {
|
|
68
|
+
const deadline = Date.now() + ms;
|
|
69
|
+
while (Date.now() < deadline) { /* spin */ }
|
|
70
|
+
}
|
|
71
|
+
// ─────────────────────────────────────────────────────────────
|
|
72
|
+
// Scenario 1 — acquire + release happy path
|
|
73
|
+
// ─────────────────────────────────────────────────────────────
|
|
74
|
+
function scenarioHappyPath() {
|
|
75
|
+
const tmp = mkTmp();
|
|
76
|
+
try {
|
|
77
|
+
const lock = new DistributedLock_1.DistributedLock({ baseDir: path.join(tmp, 'locks') });
|
|
78
|
+
const r = lock.acquire('mission-001', 30_000, { startHeartbeat: false });
|
|
79
|
+
assert(r.ok, `expected ok=true, got: ${JSON.stringify(r)}`);
|
|
80
|
+
assert(typeof r.lockId === 'string' && r.lockId.length > 0, 'lockId must be present');
|
|
81
|
+
assert(fs.existsSync(r.filePath), 'lock file must exist on disk');
|
|
82
|
+
const peeked = lock.peek('mission-001');
|
|
83
|
+
assert(peeked !== null, 'peek must return record while held');
|
|
84
|
+
assert(peeked.pid === process.pid, 'pid round-trip');
|
|
85
|
+
assert(peeked.key === 'mission-001', 'key round-trip');
|
|
86
|
+
assert(peeked.ttlMs === 30_000, 'ttlMs round-trip');
|
|
87
|
+
lock.release(r.lockId);
|
|
88
|
+
assert(lock.peek('mission-001') === null, 'peek must return null after release');
|
|
89
|
+
console.log('✅ scenario 1: acquire + release + peek round-trip');
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
rmTmp(tmp);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ─────────────────────────────────────────────────────────────
|
|
96
|
+
// Scenario 2 — collision while held
|
|
97
|
+
// ─────────────────────────────────────────────────────────────
|
|
98
|
+
function scenarioCollision() {
|
|
99
|
+
const tmp = mkTmp();
|
|
100
|
+
try {
|
|
101
|
+
const baseDir = path.join(tmp, 'locks');
|
|
102
|
+
const lockA = new DistributedLock_1.DistributedLock({ baseDir });
|
|
103
|
+
const lockB = new DistributedLock_1.DistributedLock({ baseDir });
|
|
104
|
+
const a = lockA.acquire('shared', 30_000, { startHeartbeat: false });
|
|
105
|
+
assert(a.ok, 'A must acquire');
|
|
106
|
+
const b = lockB.acquire('shared', 30_000, { startHeartbeat: false });
|
|
107
|
+
assert(!b.ok, `B must collide, got ok=true: ${JSON.stringify(b)}`);
|
|
108
|
+
assert(b.ok === false && b.error === 'collision', `expected error=collision, got ${JSON.stringify(b)}`);
|
|
109
|
+
assert(b.ok === false && b.heldBy?.pid === process.pid, 'heldBy must report current pid');
|
|
110
|
+
lockA.release(a.lockId);
|
|
111
|
+
const bAgain = lockB.acquire('shared', 30_000, { startHeartbeat: false });
|
|
112
|
+
assert(bAgain.ok, 'B must acquire after A releases');
|
|
113
|
+
lockB.release(bAgain.lockId);
|
|
114
|
+
console.log('✅ scenario 2: collision while held');
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
rmTmp(tmp);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// ─────────────────────────────────────────────────────────────
|
|
121
|
+
// Scenario 3 — TTL expiry takeover
|
|
122
|
+
// ─────────────────────────────────────────────────────────────
|
|
123
|
+
function scenarioTtlExpiry() {
|
|
124
|
+
const tmp = mkTmp();
|
|
125
|
+
try {
|
|
126
|
+
const baseDir = path.join(tmp, 'locks');
|
|
127
|
+
const lockA = new DistributedLock_1.DistributedLock({ baseDir });
|
|
128
|
+
const lockB = new DistributedLock_1.DistributedLock({ baseDir });
|
|
129
|
+
// A acquires with a tiny TTL, no heartbeat so it goes stale
|
|
130
|
+
const a = lockA.acquire('expiring', 50, { startHeartbeat: false });
|
|
131
|
+
assert(a.ok, 'A must acquire');
|
|
132
|
+
// Immediate B attempt collides
|
|
133
|
+
const bNow = lockB.acquire('expiring', 1000, { startHeartbeat: false });
|
|
134
|
+
assert(!bNow.ok, 'B must collide before TTL expires');
|
|
135
|
+
// Wait past TTL
|
|
136
|
+
busyWait(70);
|
|
137
|
+
const bLater = lockB.acquire('expiring', 1000, { startHeartbeat: false });
|
|
138
|
+
assert(bLater.ok, `B must take over after TTL, got: ${JSON.stringify(bLater)}`);
|
|
139
|
+
assert(bLater.ok && bLater.lockId !== a.lockId, 'B must have a new lockId');
|
|
140
|
+
// After takeover, A's renew should fail (different lockId on disk now)
|
|
141
|
+
const aRenew = lockA.renew(a.lockId);
|
|
142
|
+
assert(aRenew === false, "A's renew must fail after B took over");
|
|
143
|
+
lockB.release(bLater.lockId);
|
|
144
|
+
console.log('✅ scenario 3: TTL expiry takeover');
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
rmTmp(tmp);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// ─────────────────────────────────────────────────────────────
|
|
151
|
+
// Scenario 4 — renew detects external overwrite (steal-detection)
|
|
152
|
+
// ─────────────────────────────────────────────────────────────
|
|
153
|
+
function scenarioStealDetection() {
|
|
154
|
+
const tmp = mkTmp();
|
|
155
|
+
try {
|
|
156
|
+
const baseDir = path.join(tmp, 'locks');
|
|
157
|
+
const lock = new DistributedLock_1.DistributedLock({ baseDir });
|
|
158
|
+
const a = lock.acquire('steal-test', 30_000, { startHeartbeat: false });
|
|
159
|
+
assert(a.ok, 'must acquire');
|
|
160
|
+
// Simulate an attacker / TTL takeover: overwrite the lock file with a
|
|
161
|
+
// different lockId
|
|
162
|
+
const stolen = {
|
|
163
|
+
pid: 99999,
|
|
164
|
+
host: 'attacker',
|
|
165
|
+
lockId: 'stolen-id',
|
|
166
|
+
key: 'steal-test',
|
|
167
|
+
acquiredAt: Date.now(),
|
|
168
|
+
ts: Date.now(),
|
|
169
|
+
ttlMs: 30_000,
|
|
170
|
+
};
|
|
171
|
+
(0, AtomicWriter_1.writeJsonAtomic)(a.filePath, stolen);
|
|
172
|
+
const renewed = lock.renew(a.lockId);
|
|
173
|
+
assert(renewed === false, 'renew must return false when our lockId no longer matches on disk');
|
|
174
|
+
// peek shows the stolen record (different pid)
|
|
175
|
+
const after = lock.peek('steal-test');
|
|
176
|
+
assert(after?.pid === 99999, 'peek reflects the new holder');
|
|
177
|
+
console.log('✅ scenario 4: renew detects external steal');
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
rmTmp(tmp);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// ─────────────────────────────────────────────────────────────
|
|
184
|
+
// Driver
|
|
185
|
+
// ─────────────────────────────────────────────────────────────
|
|
186
|
+
function main() {
|
|
187
|
+
console.log('🧪 test_distributed_lock — Story 6.4 regression suite');
|
|
188
|
+
scenarioHappyPath();
|
|
189
|
+
scenarioCollision();
|
|
190
|
+
scenarioTtlExpiry();
|
|
191
|
+
scenarioStealDetection();
|
|
192
|
+
console.log('');
|
|
193
|
+
console.log('TEST_DISTRIBUTED_LOCK_OK');
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
main();
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
console.error('❌ test_distributed_lock FAILED:', err instanceof Error ? err.message : err);
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 fs = __importStar(require("fs"));
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
function assert(condition, message) {
|
|
39
|
+
if (!condition)
|
|
40
|
+
throw new Error(message);
|
|
41
|
+
}
|
|
42
|
+
function fileExists(filePath) {
|
|
43
|
+
return fs.existsSync(filePath);
|
|
44
|
+
}
|
|
45
|
+
async function main() {
|
|
46
|
+
const root = path.resolve(__dirname, '..');
|
|
47
|
+
const requiredFiles = [
|
|
48
|
+
path.join(root, 'bin', 'openlife.js'),
|
|
49
|
+
path.join(root, 'scripts', 'postinstall-check.sh'),
|
|
50
|
+
path.join(root, 'scripts', 'openlife-autonomous-install.sh'),
|
|
51
|
+
path.join(root, 'docs', 'autonomous-install.md')
|
|
52
|
+
];
|
|
53
|
+
for (const file of requiredFiles) {
|
|
54
|
+
assert(fileExists(file), `required distribution file missing: ${file}`);
|
|
55
|
+
}
|
|
56
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'));
|
|
57
|
+
assert(packageJson.bin?.openlife === './bin/openlife.js', 'package.json bin.openlife must point to ./bin/openlife.js');
|
|
58
|
+
assert(Boolean(packageJson.scripts?.postinstall), 'package.json must define scripts.postinstall');
|
|
59
|
+
const doc = fs.readFileSync(path.join(root, 'docs', 'autonomous-install.md'), 'utf-8');
|
|
60
|
+
assert(doc.includes('openlife agent install'), 'autonomous-install.md must document openlife agent install');
|
|
61
|
+
assert(doc.toLowerCase().includes('supervisor'), 'autonomous-install.md must include supervisor fallback instructions');
|
|
62
|
+
console.log('TEST_DISTRIBUTION_INSTALLABILITY_OK');
|
|
63
|
+
}
|
|
64
|
+
main().catch((error) => {
|
|
65
|
+
console.error(error.message || error);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* test_doctor_sandbox_check.ts — Story 18.1 (v1.6)
|
|
4
|
+
*
|
|
5
|
+
* Asserts SystemDoctor's new `runtime:process-sandbox` check:
|
|
6
|
+
* 1. Returns a DoctorCheck shape.
|
|
7
|
+
* 2. ok=true on the current Node runner (the wrapper falls back
|
|
8
|
+
* gracefully on Node 18 and reports enforcement state honestly
|
|
9
|
+
* on Node 20+).
|
|
10
|
+
* 3. detail string contains the Node major version so operators can
|
|
11
|
+
* tell at a glance whether enforcement is active.
|
|
12
|
+
* 4. The check appears in runRuntimeChecks() output.
|
|
13
|
+
*
|
|
14
|
+
* The test spawns a real `node -e` subprocess via ProcessSandbox —
|
|
15
|
+
* it's an integration-style probe but stays fast (<200ms).
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const SystemDoctor_1 = require("./orchestrator/SystemDoctor");
|
|
19
|
+
function assertTrue(cond, label) {
|
|
20
|
+
if (!cond)
|
|
21
|
+
throw new Error(`ASSERT_FAILED[${label}]`);
|
|
22
|
+
}
|
|
23
|
+
async function main() {
|
|
24
|
+
const doctor = new SystemDoctor_1.SystemDoctor();
|
|
25
|
+
const checks = await doctor.runRuntimeChecks();
|
|
26
|
+
const sandboxCheck = checks.find((c) => c.name === 'runtime:process-sandbox');
|
|
27
|
+
assertTrue(!!sandboxCheck, '[18.1] runtime:process-sandbox check is emitted');
|
|
28
|
+
assertTrue(typeof sandboxCheck.ok === 'boolean', '[18.1] check has boolean ok');
|
|
29
|
+
assertTrue(typeof sandboxCheck.detail === 'string' && sandboxCheck.detail.length > 0, '[18.1] check has non-empty detail');
|
|
30
|
+
// Detail should mention the Node major version so operators see at a glance.
|
|
31
|
+
assertTrue(/Node\s+\d+/.test(sandboxCheck.detail), `[18.1] detail mentions Node version (got: ${sandboxCheck.detail})`);
|
|
32
|
+
// On the test runner the wrapper should at minimum spawn a child successfully —
|
|
33
|
+
// graceful downgrade on Node 18 still produces ok=true. The only failure path
|
|
34
|
+
// we expect here is a wrapper bug (spawn failed or enforced flag inconsistent).
|
|
35
|
+
if (!sandboxCheck.ok) {
|
|
36
|
+
throw new Error(`[18.1] sandbox check failed unexpectedly: ${sandboxCheck.detail}`);
|
|
37
|
+
}
|
|
38
|
+
console.log(`[18.1] runtime:process-sandbox = ${sandboxCheck.ok ? '✅' : '❌'} ${sandboxCheck.detail}`);
|
|
39
|
+
console.log('TEST_DOCTOR_SANDBOX_CHECK_OK');
|
|
40
|
+
}
|
|
41
|
+
main().catch((err) => {
|
|
42
|
+
console.error('[doctor-sandbox-check] FAILED:', err instanceof Error ? err.message : err);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DreamOrganizer_1 = require("./cli/DreamOrganizer");
|
|
4
|
+
function assert(condition, message) {
|
|
5
|
+
if (!condition)
|
|
6
|
+
throw new Error(message);
|
|
7
|
+
}
|
|
8
|
+
function main() {
|
|
9
|
+
const organizer = new DreamOrganizer_1.DreamOrganizer(process.cwd());
|
|
10
|
+
const raw = 'Hoje tive uma ideia de criar um motor de memória. Preciso estudar embeddings e depois implementar comando /dream. Também refleti sobre foco e disciplina.';
|
|
11
|
+
const note = organizer.organize(raw);
|
|
12
|
+
assert(note.categories.includes('ideias'), 'should classify ideas');
|
|
13
|
+
assert(note.categories.includes('aprendizado'), 'should classify learning');
|
|
14
|
+
assert(note.categories.includes('reflexoes'), 'should classify reflections');
|
|
15
|
+
assert(note.tags.includes('dream'), 'should include dream tag');
|
|
16
|
+
assert(note.summary.length > 10, 'should generate non-empty summary');
|
|
17
|
+
console.log('TEST_DREAM_ORGANIZER_OK');
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
main();
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error(error.message || error);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ExecutionIntent_1 = require("./orchestrator/ExecutionIntent");
|
|
4
|
+
const ExecutionRouter_1 = require("./orchestrator/ExecutionRouter");
|
|
5
|
+
function assert(condition, message) {
|
|
6
|
+
if (!condition)
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
9
|
+
const router = new ExecutionRouter_1.ExecutionRouter();
|
|
10
|
+
const defaultIntent = (0, ExecutionIntent_1.normalizeExecutionIntent)({ goal: 'foo' });
|
|
11
|
+
assert(defaultIntent.mode === 'task', 'default mode should be task');
|
|
12
|
+
assert(router.route(defaultIntent) === 'task', 'router should route default to task');
|
|
13
|
+
const serviceIntent = (0, ExecutionIntent_1.normalizeExecutionIntent)({ goal: 'foo', mode: 'service' });
|
|
14
|
+
assert(router.route(serviceIntent) === 'service', 'router should route explicit service');
|
|
15
|
+
console.log('TEST_DUAL_MODE_OK');
|