@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,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositeSkillProvider = void 0;
|
|
4
|
+
class CompositeSkillProvider {
|
|
5
|
+
primary;
|
|
6
|
+
fallback;
|
|
7
|
+
constructor(primary, fallback) {
|
|
8
|
+
this.primary = primary;
|
|
9
|
+
this.fallback = fallback;
|
|
10
|
+
}
|
|
11
|
+
load() {
|
|
12
|
+
const data = this.primary.load();
|
|
13
|
+
return data.length ? data : this.fallback.load();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CompositeSkillProvider = CompositeSkillProvider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositeSquadProvider = void 0;
|
|
4
|
+
class CompositeSquadProvider {
|
|
5
|
+
primary;
|
|
6
|
+
fallback;
|
|
7
|
+
constructor(primary, fallback) {
|
|
8
|
+
this.primary = primary;
|
|
9
|
+
this.fallback = fallback;
|
|
10
|
+
}
|
|
11
|
+
load() {
|
|
12
|
+
const data = this.primary.load();
|
|
13
|
+
return data.length ? data : this.fallback.load();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CompositeSquadProvider = CompositeSquadProvider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CompositeWorkflowProvider — primary/fallback composite for workflows.
|
|
4
|
+
*
|
|
5
|
+
* Story 1.3 — OpenLife v1.3 Agent OS Integration.
|
|
6
|
+
*
|
|
7
|
+
* Aligns the workflow provider stack with the established Composite{X}
|
|
8
|
+
* pattern (Agent, Skill, Squad, Capability). Pure refactor: existing
|
|
9
|
+
* FileWorkflowProvider already searches two roots internally, so the
|
|
10
|
+
* composite layer is for *external* sources like cloud catalogs in v1.4.
|
|
11
|
+
*
|
|
12
|
+
* For v1.3 we just wrap the existing FileWorkflowProvider so callers can
|
|
13
|
+
* upgrade to the composite shape without changing the loader.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CompositeWorkflowProvider = void 0;
|
|
17
|
+
exports.defaultWorkflowProvider = defaultWorkflowProvider;
|
|
18
|
+
const FileWorkflowProvider_1 = require("./FileWorkflowProvider");
|
|
19
|
+
class CompositeWorkflowProvider {
|
|
20
|
+
primary;
|
|
21
|
+
fallback;
|
|
22
|
+
constructor(primary, fallback) {
|
|
23
|
+
this.primary = primary;
|
|
24
|
+
this.fallback = fallback;
|
|
25
|
+
}
|
|
26
|
+
list() {
|
|
27
|
+
const data = this.primary.list();
|
|
28
|
+
if (data.length)
|
|
29
|
+
return data;
|
|
30
|
+
return this.fallback ? this.fallback.list() : [];
|
|
31
|
+
}
|
|
32
|
+
load(id) {
|
|
33
|
+
const primaryHit = this.primary.load(id);
|
|
34
|
+
if (primaryHit)
|
|
35
|
+
return primaryHit;
|
|
36
|
+
return this.fallback ? this.fallback.load(id) : null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.CompositeWorkflowProvider = CompositeWorkflowProvider;
|
|
40
|
+
/**
|
|
41
|
+
* Factory: the default v1.3 composite — FileWorkflowProvider only.
|
|
42
|
+
* v1.4 will add a CloudWorkflowProvider as fallback.
|
|
43
|
+
*/
|
|
44
|
+
function defaultWorkflowProvider() {
|
|
45
|
+
return new CompositeWorkflowProvider(new FileWorkflowProvider_1.FileWorkflowProvider());
|
|
46
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
exports.FileAgentProvider = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
class FileAgentProvider {
|
|
40
|
+
roots;
|
|
41
|
+
constructor(roots = []) {
|
|
42
|
+
this.roots = roots;
|
|
43
|
+
}
|
|
44
|
+
load() {
|
|
45
|
+
const agents = [];
|
|
46
|
+
for (const root of this.roots) {
|
|
47
|
+
if (!fs.existsSync(root))
|
|
48
|
+
continue;
|
|
49
|
+
const files = this.walk(root).filter(f => f.endsWith('.md'));
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const fullPath = path.isAbsolute(file) ? file : path.join(root, file);
|
|
52
|
+
const content = fs.readFileSync(fullPath, 'utf-8');
|
|
53
|
+
agents.push(this.parseAgent(path.basename(fullPath), fullPath, content));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return agents;
|
|
57
|
+
}
|
|
58
|
+
walk(dir) {
|
|
59
|
+
const out = [];
|
|
60
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
61
|
+
const full = path.join(dir, entry.name);
|
|
62
|
+
if (entry.isDirectory())
|
|
63
|
+
out.push(...this.walk(full));
|
|
64
|
+
else
|
|
65
|
+
out.push(full);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
parseAgent(fileName, fullPath, content) {
|
|
70
|
+
const id = path.basename(path.dirname(fullPath)) === '.' || fileName !== 'AGENT.md'
|
|
71
|
+
? fileName.replace(/\.md$/, '')
|
|
72
|
+
: path.basename(path.dirname(fullPath));
|
|
73
|
+
const nameMatch = content.match(/name:\s*(.+)/i);
|
|
74
|
+
const roleMatch = content.match(/role:\s*"([^"]+)"/i) || content.match(/role:\s*(.+)/i);
|
|
75
|
+
const squadMatch = content.match(/squad:\s*([^\n]+)/i);
|
|
76
|
+
const tags = [];
|
|
77
|
+
const tagRegex = /tags:\s*\[([^\]]+)\]/gi;
|
|
78
|
+
let m;
|
|
79
|
+
while ((m = tagRegex.exec(content)) !== null) {
|
|
80
|
+
m[1].split(',').map(s => s.trim().replace(/^'+|'+$/g, '')).filter(Boolean).forEach(s => { if (!tags.includes(s))
|
|
81
|
+
tags.push(s); });
|
|
82
|
+
}
|
|
83
|
+
const capabilities = [];
|
|
84
|
+
const addCap = (s) => { if (s && !capabilities.includes(s))
|
|
85
|
+
capabilities.push(s); };
|
|
86
|
+
const whenToUseMatch = content.match(/whenToUse:\s*"([^"]+)"/i);
|
|
87
|
+
if (whenToUseMatch)
|
|
88
|
+
whenToUseMatch[1].split(',').map(s => s.trim()).filter(Boolean).forEach(addCap);
|
|
89
|
+
const focusMatch = content.match(/focus:\s*"([^"]+)"/i);
|
|
90
|
+
if (focusMatch)
|
|
91
|
+
focusMatch[1].split(',').map(s => s.trim()).filter(Boolean).forEach(addCap);
|
|
92
|
+
tags.forEach(addCap);
|
|
93
|
+
let priority = 1;
|
|
94
|
+
if (id.startsWith('ai-builder-'))
|
|
95
|
+
priority += 5;
|
|
96
|
+
if (id.includes('orchestrator'))
|
|
97
|
+
priority += 3;
|
|
98
|
+
if (id.includes('review'))
|
|
99
|
+
priority += 2;
|
|
100
|
+
if (id.includes('builder'))
|
|
101
|
+
priority += 2;
|
|
102
|
+
return { id, name: nameMatch?.[1]?.trim() || id, role: roleMatch?.[1]?.trim() || 'specialist', capabilities, sourcePath: fullPath, priority, squad: squadMatch?.[1]?.trim(), tags };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.FileAgentProvider = FileAgentProvider;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* FileCapabilityProvider — load Capability Packs from the filesystem.
|
|
4
|
+
*
|
|
5
|
+
* Two roots searched in priority order (same pattern as FileWorkflowProvider):
|
|
6
|
+
* 1. <cwd>/.catalog/capabilities/ (project-local override)
|
|
7
|
+
* 2. <packageRoot>/dist-templates/capabilities/ (npm-shipped defaults)
|
|
8
|
+
*
|
|
9
|
+
* Local catalog wins on id collision. Honors `.catalog/`-as-runtime-SoT.
|
|
10
|
+
*
|
|
11
|
+
* Story 1.2 — OpenLife v1.3 Agent OS Integration.
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.FileCapabilityProvider = void 0;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const CapabilityPackParser_1 = require("../capability/CapabilityPackParser");
|
|
51
|
+
class FileCapabilityProvider {
|
|
52
|
+
roots;
|
|
53
|
+
constructor(opts = {}) {
|
|
54
|
+
const cwd = opts.cwd || process.cwd();
|
|
55
|
+
const packageRoot = opts.packageRoot || path.resolve(__dirname, '..', '..', '..');
|
|
56
|
+
const catalogRoot = opts.catalogRoot || path.join(cwd, '.catalog', 'capabilities');
|
|
57
|
+
const templateRoot = opts.templateRoot || path.join(packageRoot, 'dist-templates', 'capabilities');
|
|
58
|
+
this.roots = [
|
|
59
|
+
{ dir: catalogRoot, source: 'catalog' },
|
|
60
|
+
{ dir: templateRoot, source: 'dist-templates' },
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
list() {
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
const out = [];
|
|
66
|
+
for (const { dir, source } of this.roots) {
|
|
67
|
+
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
|
|
68
|
+
continue;
|
|
69
|
+
for (const entry of fs.readdirSync(dir)) {
|
|
70
|
+
if (entry.startsWith('.'))
|
|
71
|
+
continue;
|
|
72
|
+
const packDir = path.join(dir, entry);
|
|
73
|
+
const stat = fs.statSync(packDir);
|
|
74
|
+
if (!stat.isDirectory())
|
|
75
|
+
continue;
|
|
76
|
+
const manifest = path.join(packDir, 'capability.yaml');
|
|
77
|
+
if (!fs.existsSync(manifest))
|
|
78
|
+
continue;
|
|
79
|
+
const parsed = (0, CapabilityPackParser_1.parseCapabilityPackFile)(manifest);
|
|
80
|
+
// Tolerate parse failures at list-time: skip with a console hint
|
|
81
|
+
// (the registry layer will re-validate when actually loading).
|
|
82
|
+
if (!parsed.ok || !parsed.pack)
|
|
83
|
+
continue;
|
|
84
|
+
const pack = parsed.pack;
|
|
85
|
+
if (seen.has(pack.id))
|
|
86
|
+
continue; // catalog wins
|
|
87
|
+
seen.add(pack.id);
|
|
88
|
+
out.push({
|
|
89
|
+
id: pack.id,
|
|
90
|
+
name: pack.name,
|
|
91
|
+
description: pack.description,
|
|
92
|
+
version: pack.version,
|
|
93
|
+
status: pack.status,
|
|
94
|
+
filePath: manifest,
|
|
95
|
+
packDir,
|
|
96
|
+
source,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
load(id) {
|
|
103
|
+
return this.list().find((e) => e.id === id) || null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.FileCapabilityProvider = FileCapabilityProvider;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
exports.FileSkillProvider = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
class FileSkillProvider {
|
|
40
|
+
roots;
|
|
41
|
+
constructor(roots = []) {
|
|
42
|
+
this.roots = roots;
|
|
43
|
+
}
|
|
44
|
+
load() {
|
|
45
|
+
const skills = [];
|
|
46
|
+
for (const root of this.roots) {
|
|
47
|
+
if (!fs.existsSync(root))
|
|
48
|
+
continue;
|
|
49
|
+
const entries = fs.readdirSync(root, { withFileTypes: true }).filter(e => e.isDirectory());
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const skillFile = path.join(root, entry.name, 'SKILL.md');
|
|
52
|
+
if (!fs.existsSync(skillFile))
|
|
53
|
+
continue;
|
|
54
|
+
const content = fs.readFileSync(skillFile, 'utf-8');
|
|
55
|
+
const caps = new Set();
|
|
56
|
+
const m = content.match(/<description>([\s\S]*?)<\/description>/i);
|
|
57
|
+
if (m)
|
|
58
|
+
m[1].split(/[,.\n]/).map(s => s.trim()).filter(Boolean).forEach(s => caps.add(s));
|
|
59
|
+
skills.push({ id: entry.name, name: entry.name, sourcePath: skillFile, capabilities: Array.from(caps) });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return skills;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.FileSkillProvider = FileSkillProvider;
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
exports.FileSquadProvider = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
class FileSquadProvider {
|
|
40
|
+
root;
|
|
41
|
+
constructor(root) {
|
|
42
|
+
this.root = root;
|
|
43
|
+
}
|
|
44
|
+
load() {
|
|
45
|
+
if (!this.root || !fs.existsSync(this.root))
|
|
46
|
+
return [];
|
|
47
|
+
const files = this.walk(this.root).filter(f => f.endsWith('.md'));
|
|
48
|
+
return files.map(file => this.parse(file, fs.readFileSync(file, 'utf-8')));
|
|
49
|
+
}
|
|
50
|
+
walk(dir) {
|
|
51
|
+
const out = [];
|
|
52
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
53
|
+
const full = path.join(dir, entry.name);
|
|
54
|
+
if (entry.isDirectory())
|
|
55
|
+
out.push(...this.walk(full));
|
|
56
|
+
else
|
|
57
|
+
out.push(full);
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
parse(filePath, content) {
|
|
62
|
+
const id = path.basename(filePath) === 'SQUAD.md' ? path.basename(path.dirname(filePath)) : path.basename(filePath, '.md');
|
|
63
|
+
const title = content.split('\n').find(l => l.trim().startsWith('# '))?.replace(/^#\s*/, '') || id;
|
|
64
|
+
const capabilities = content.split(/[\n,.]/).map(s => s.trim()).filter(Boolean).slice(0, 20);
|
|
65
|
+
const domain = filePath.split('/squads/')[1]?.split('/')[0] || filePath.split('/Squads/')[1]?.split('/')[0] || 'general';
|
|
66
|
+
return { id, name: title, sourcePath: filePath, domain, capabilities };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.FileSquadProvider = FileSquadProvider;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* FileWorkflowProvider — load workflow YAMLs from the filesystem.
|
|
4
|
+
*
|
|
5
|
+
* Two roots are searched in priority order:
|
|
6
|
+
* 1. <process.cwd()>/.catalog/workflows/ (project-local override)
|
|
7
|
+
* 2. <packageRoot>/dist-templates/workflows/ (npm-shipped defaults)
|
|
8
|
+
*
|
|
9
|
+
* IDs collide → local catalog wins. The full list is the union of both
|
|
10
|
+
* roots, de-duplicated by id (id read from `workflow.id` after parse).
|
|
11
|
+
*
|
|
12
|
+
* Story 4.4 — OpenLife v1.2 Royal Stack.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.FileWorkflowProvider = void 0;
|
|
49
|
+
const fs = __importStar(require("fs"));
|
|
50
|
+
const path = __importStar(require("path"));
|
|
51
|
+
const WorkflowParser_1 = require("../workflow/WorkflowParser");
|
|
52
|
+
class FileWorkflowProvider {
|
|
53
|
+
roots;
|
|
54
|
+
constructor(opts = {}) {
|
|
55
|
+
const cwd = opts.cwd || process.cwd();
|
|
56
|
+
const packageRoot = opts.packageRoot || path.resolve(__dirname, '..', '..', '..');
|
|
57
|
+
this.roots = [
|
|
58
|
+
{ dir: path.join(cwd, '.catalog', 'workflows'), source: 'catalog' },
|
|
59
|
+
{ dir: path.join(packageRoot, 'dist-templates', 'workflows'), source: 'dist-templates' },
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
list() {
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
const out = [];
|
|
65
|
+
for (const { dir, source } of this.roots) {
|
|
66
|
+
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory())
|
|
67
|
+
continue;
|
|
68
|
+
for (const f of fs.readdirSync(dir)) {
|
|
69
|
+
if (!f.endsWith('.yaml') && !f.endsWith('.yml'))
|
|
70
|
+
continue;
|
|
71
|
+
const filePath = path.join(dir, f);
|
|
72
|
+
const parsed = (0, WorkflowParser_1.parseWorkflowFile)(filePath);
|
|
73
|
+
if (!parsed.ok || !parsed.workflow)
|
|
74
|
+
continue;
|
|
75
|
+
const wf = parsed.workflow;
|
|
76
|
+
if (seen.has(wf.id))
|
|
77
|
+
continue; // local catalog wins
|
|
78
|
+
seen.add(wf.id);
|
|
79
|
+
out.push({
|
|
80
|
+
id: wf.id,
|
|
81
|
+
name: wf.name,
|
|
82
|
+
type: wf.type,
|
|
83
|
+
version: wf.version,
|
|
84
|
+
filePath,
|
|
85
|
+
source,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
load(id) {
|
|
92
|
+
for (const entry of this.list()) {
|
|
93
|
+
if (entry.id !== id)
|
|
94
|
+
continue;
|
|
95
|
+
const parsed = (0, WorkflowParser_1.parseWorkflowFile)(entry.filePath);
|
|
96
|
+
if (!parsed.ok || !parsed.workflow)
|
|
97
|
+
return null;
|
|
98
|
+
return { entry, workflow: parsed.workflow };
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.FileWorkflowProvider = FileWorkflowProvider;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ToolsetGuard — thin enforcement point for executor sandboxes.
|
|
4
|
+
*
|
|
5
|
+
* Story 10.1 + 10.2 — OpenLife v1.4.
|
|
6
|
+
*
|
|
7
|
+
* Wraps `ToolsetRegistry.isAllowed()` with an env-flag gate so v1.4 can
|
|
8
|
+
* land enforcement at all 5 critical execution sites without breaking
|
|
9
|
+
* existing flows. Default: OFF.
|
|
10
|
+
*
|
|
11
|
+
* Locked decision 1 of v1.4 plan: `OPENLIFE_TOOLSET_ENFORCEMENT=on` is
|
|
12
|
+
* opt-in for v1.4; flips to default-on in v1.5 after soak.
|
|
13
|
+
*
|
|
14
|
+
* Stable error code: `toolset_blocked:<category>`.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ToolsetBlockedError = void 0;
|
|
18
|
+
exports.isToolsetAllowed = isToolsetAllowed;
|
|
19
|
+
exports.assertToolsetAllowed = assertToolsetAllowed;
|
|
20
|
+
exports._resetToolsetGuardCache = _resetToolsetGuardCache;
|
|
21
|
+
const ToolsetRegistry_1 = require("./ToolsetRegistry");
|
|
22
|
+
let _registryCache = null;
|
|
23
|
+
class ToolsetBlockedError extends Error {
|
|
24
|
+
code;
|
|
25
|
+
toolset;
|
|
26
|
+
constructor(toolset, reason) {
|
|
27
|
+
super(`toolset_blocked:${toolset} (${reason})`);
|
|
28
|
+
this.name = 'ToolsetBlockedError';
|
|
29
|
+
this.code = `toolset_blocked:${toolset}`;
|
|
30
|
+
this.toolset = toolset;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ToolsetBlockedError = ToolsetBlockedError;
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a toolset category is allowed for the current process.
|
|
36
|
+
*
|
|
37
|
+
* - When `OPENLIFE_TOOLSET_ENFORCEMENT` is anything other than 'on',
|
|
38
|
+
* returns true unconditionally (enforcement disabled).
|
|
39
|
+
* - When enabled, consults the active Profile via ToolsetRegistry.
|
|
40
|
+
*
|
|
41
|
+
* Never throws — callers wanting to throw use `assertAllowed`.
|
|
42
|
+
*/
|
|
43
|
+
function isToolsetAllowed(toolset) {
|
|
44
|
+
if ((process.env.OPENLIFE_TOOLSET_ENFORCEMENT || '').toLowerCase() !== 'on') {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (!_registryCache)
|
|
48
|
+
_registryCache = new ToolsetRegistry_1.ToolsetRegistry();
|
|
49
|
+
return _registryCache.isAllowed(toolset).allowed;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Throw `ToolsetBlockedError` if the toolset is not allowed. Use at
|
|
53
|
+
* hook points before spawning processes, writing files, or making
|
|
54
|
+
* network calls.
|
|
55
|
+
*/
|
|
56
|
+
function assertToolsetAllowed(toolset, hint) {
|
|
57
|
+
if ((process.env.OPENLIFE_TOOLSET_ENFORCEMENT || '').toLowerCase() !== 'on')
|
|
58
|
+
return;
|
|
59
|
+
if (!_registryCache)
|
|
60
|
+
_registryCache = new ToolsetRegistry_1.ToolsetRegistry();
|
|
61
|
+
const decision = _registryCache.isAllowed(toolset);
|
|
62
|
+
if (!decision.allowed) {
|
|
63
|
+
throw new ToolsetBlockedError(toolset, hint || decision.reason);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Test seam — reset the cache so a test can swap profiles. */
|
|
67
|
+
function _resetToolsetGuardCache() {
|
|
68
|
+
_registryCache = null;
|
|
69
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ToolsetRegistry — per-profile toolset allow/deny enforcement.
|
|
4
|
+
*
|
|
5
|
+
* Story 5.3 — OpenLife v1.3 Agent OS Integration.
|
|
6
|
+
*
|
|
7
|
+
* Reads the active Profile (via ProfileManager) and decides whether a
|
|
8
|
+
* given toolset is in scope. Callers ask via `isAllowed(toolset)` before
|
|
9
|
+
* dispatching tool use.
|
|
10
|
+
*
|
|
11
|
+
* Profile.toolsetAllowed:
|
|
12
|
+
* - ['*'] → all 15 categories allowed (backwards-compatible default)
|
|
13
|
+
* - ['file', 'web', 'memory'] → only these three allowed
|
|
14
|
+
* - [] → nothing allowed (locked-down profile)
|
|
15
|
+
*
|
|
16
|
+
* v1.3 also persists the registry's last decision per session for audit;
|
|
17
|
+
* v1.4 will wire this to the executor sandbox.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ToolsetRegistry = void 0;
|
|
21
|
+
const ProfileManager_1 = require("../../cli/ProfileManager");
|
|
22
|
+
const ToolsetSchema_1 = require("./ToolsetSchema");
|
|
23
|
+
class ToolsetRegistry {
|
|
24
|
+
profileManager;
|
|
25
|
+
constructor(opts = {}) {
|
|
26
|
+
this.profileManager = opts.profileManager || new ProfileManager_1.ProfileManager();
|
|
27
|
+
}
|
|
28
|
+
/** Return the set of toolsets allowed by the active profile, or all when no profile set. */
|
|
29
|
+
allowedForActiveProfile() {
|
|
30
|
+
const { profile } = this.profileManager.active();
|
|
31
|
+
return this.computeAllowed(profile);
|
|
32
|
+
}
|
|
33
|
+
allowedForProfile(profileId) {
|
|
34
|
+
const profile = this.profileManager.show(profileId);
|
|
35
|
+
return this.computeAllowed(profile);
|
|
36
|
+
}
|
|
37
|
+
computeAllowed(profile) {
|
|
38
|
+
if (!profile)
|
|
39
|
+
return new Set(ToolsetSchema_1.ALL_TOOLSETS);
|
|
40
|
+
if (!profile.toolsetAllowed || profile.toolsetAllowed.length === 0)
|
|
41
|
+
return new Set();
|
|
42
|
+
if (profile.toolsetAllowed.includes('*'))
|
|
43
|
+
return new Set(ToolsetSchema_1.ALL_TOOLSETS);
|
|
44
|
+
const out = new Set();
|
|
45
|
+
for (const item of profile.toolsetAllowed) {
|
|
46
|
+
if (ToolsetSchema_1.ALL_TOOLSETS.includes(item)) {
|
|
47
|
+
out.add(item);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
isAllowed(toolset, profileId) {
|
|
53
|
+
const allowed = profileId
|
|
54
|
+
? this.allowedForProfile(profileId)
|
|
55
|
+
: this.allowedForActiveProfile();
|
|
56
|
+
if (allowed.has(toolset)) {
|
|
57
|
+
return { allowed: true, reason: 'in_profile_allowlist', toolset };
|
|
58
|
+
}
|
|
59
|
+
return { allowed: false, reason: 'not_in_profile_allowlist', toolset };
|
|
60
|
+
}
|
|
61
|
+
list() {
|
|
62
|
+
return ToolsetSchema_1.ALL_TOOLSETS;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ToolsetRegistry = ToolsetRegistry;
|