@openlife/cli 1.7.13 → 1.8.2

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.
Files changed (35) hide show
  1. package/INSTALL.md +29 -1
  2. package/dist/cli/ChatTui.js +32 -0
  3. package/dist/cli/InstallModules.js +17 -2
  4. package/dist/cli/InstallWizardV2.js +110 -0
  5. package/dist/cli/install/Multiselect.js +285 -0
  6. package/dist/cli/install/OAuthRunner.js +170 -0
  7. package/dist/cli/install/Phases.js +864 -0
  8. package/dist/cli/install/ProvidersCatalog.js +320 -0
  9. package/dist/cli/install/WizardIO.js +271 -0
  10. package/dist/cli/install/types.js +17 -0
  11. package/dist/index.js +170 -35
  12. package/dist/orchestrator/ConsequenceForecaster.js +24 -1
  13. package/dist/orchestrator/DreamGoalStore.js +130 -0
  14. package/dist/orchestrator/Gatekeeper.js +14 -0
  15. package/dist/orchestrator/Gateway.js +194 -15
  16. package/dist/orchestrator/ModelManager.js +7 -1
  17. package/dist/orchestrator/OrchestrationLoop.js +12 -0
  18. package/dist/orchestrator/ParallelOrchestrationLoop.js +12 -2
  19. package/dist/orchestrator/RuntimePolicy.js +4 -1
  20. package/dist/orchestrator/ServiceCompletionPolicy.js +15 -0
  21. package/dist/orchestrator/SynthesizerAgent.js +20 -1
  22. package/dist/orchestrator/TaskExecutor.js +53 -0
  23. package/dist/orchestrator/capability/CapabilityGenesisEngine.js +66 -11
  24. package/dist/test_capability_genesis_engine.js +1 -1
  25. package/dist/test_chat_smoke_command.js +59 -0
  26. package/dist/test_dream_goal_commands.js +76 -0
  27. package/dist/test_gateway_telegram_formatting.js +74 -0
  28. package/dist/test_install_wizard_v2.js +193 -0
  29. package/dist/test_on_demand_voice_reply.js +65 -0
  30. package/dist/test_remaining_sprints_contracts.js +103 -0
  31. package/dist/test_runtime_policy.js +25 -6
  32. package/dist/test_service_completion_policy.js +7 -0
  33. package/dist/test_subsystems_routing_governance.js +13 -3
  34. package/dist/test_task_executor_gemini_api.js +68 -0
  35. package/package.json +5 -3
@@ -137,9 +137,14 @@ async function testGovernanceLayer() {
137
137
  }
138
138
  async function testRuntimePolicy() {
139
139
  const policy = new RuntimePolicy_1.RuntimePolicy();
140
- // ALLOW: codex healthy by default
140
+ // ALLOW: codex healthy by default.
141
+ // Pass explicit executors so the test is deterministic regardless of
142
+ // the repo's models.json (otherwise getStrictModelExecutors() reads
143
+ // cwd's models.json and biases `base`). The test exercises the
144
+ // health/cooldown filter, not chain detection.
141
145
  policy.recordResult('codex', true, 'ok');
142
- const allow = policy.decide('ENGINEERING_BUILD');
146
+ const baseExecutors = ['gemini', 'claude', 'codex'];
147
+ const allow = policy.decide('ENGINEERING_BUILD', [...baseExecutors]);
143
148
  if (!Array.isArray(allow.preferred)) {
144
149
  throw new Error('RUNTIME_POLICY_ALLOW_FAILED: preferred not array');
145
150
  }
@@ -148,10 +153,13 @@ async function testRuntimePolicy() {
148
153
  }
149
154
  // DENY: all-but-codex cooled down, then allowlist restricts to gemini only -> no executors
150
155
  const prevAllow = process.env.OPENLIFE_ALLOWED_LLM_EXECUTORS;
156
+ const prevGemini = process.env.GEMINI_API_KEY;
151
157
  process.env.OPENLIFE_ALLOWED_LLM_EXECUTORS = 'gemini';
158
+ // Unset GEMINI_API_KEY so the cooldown bypass doesn't keep gemini preferred.
159
+ delete process.env.GEMINI_API_KEY;
152
160
  policy.recordResult('gemini', false, 'quota exhausted');
153
161
  try {
154
- const restricted = policy.decide('RESEARCH_ANALYSIS');
162
+ const restricted = policy.decide('RESEARCH_ANALYSIS', [...baseExecutors]);
155
163
  if (restricted.preferred.length !== 0) {
156
164
  throw new Error(`RUNTIME_POLICY_DENY_FAILED: expected empty preferred, got ${restricted.preferred.join(',')}`);
157
165
  }
@@ -164,6 +172,8 @@ async function testRuntimePolicy() {
164
172
  delete process.env.OPENLIFE_ALLOWED_LLM_EXECUTORS;
165
173
  else
166
174
  process.env.OPENLIFE_ALLOWED_LLM_EXECUTORS = prevAllow;
175
+ if (prevGemini !== undefined)
176
+ process.env.GEMINI_API_KEY = prevGemini;
167
177
  }
168
178
  }
169
179
  async function testSandboxPolicy() {
@@ -0,0 +1,68 @@
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 assert = __importStar(require("assert"));
37
+ const fs = __importStar(require("fs"));
38
+ const os = __importStar(require("os"));
39
+ const path = __importStar(require("path"));
40
+ const TaskExecutor_1 = require("./orchestrator/TaskExecutor");
41
+ async function main() {
42
+ const key = process.env.GEMINI_API_KEY;
43
+ if (!key) {
44
+ console.log('TEST_TASK_EXECUTOR_GEMINI_API_SKIPPED missing GEMINI_API_KEY');
45
+ return;
46
+ }
47
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'openlife-gemini-executor-'));
48
+ const prevCwd = process.cwd();
49
+ process.chdir(root);
50
+ try {
51
+ const executor = new TaskExecutor_1.TaskExecutor();
52
+ const result = await executor.execute('gemini', 'Responda exatamente: TASK_EXECUTOR_GEMINI_API_OK', 'gemini_api_smoke');
53
+ assert.strictEqual(result.ok, true, result.stderr || result.stdout);
54
+ assert.strictEqual(result.executor, 'gemini');
55
+ assert.ok(result.commandProvenance?.startsWith('gemini-api/'), `expected gemini-api provenance, got ${result.commandProvenance}`);
56
+ assert.ok(result.stdout.includes('TASK_EXECUTOR_GEMINI_API_OK'), `unexpected stdout: ${result.stdout}`);
57
+ assert.ok(fs.existsSync(result.artifactPath), 'artifact path should exist');
58
+ }
59
+ finally {
60
+ process.chdir(prevCwd);
61
+ fs.rmSync(root, { recursive: true, force: true });
62
+ }
63
+ console.log('TEST_TASK_EXECUTOR_GEMINI_API_OK');
64
+ }
65
+ main().catch((err) => {
66
+ console.error('TEST_TASK_EXECUTOR_GEMINI_API_FAIL:', err instanceof Error ? err.message : err);
67
+ process.exit(1);
68
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlife/cli",
3
- "version": "1.7.13",
3
+ "version": "1.8.2",
4
4
  "description": "OPEN-LIFE Córtex Orquestrador Dual-Core",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -162,11 +162,13 @@
162
162
  "test:matrix-rain": "npm run build && node dist/test_matrix_rain.js",
163
163
  "test:chat-tui": "npm run build && node dist/test_chat_tui.js",
164
164
  "test:config-tui": "npm run build && node dist/test_config_tui.js",
165
+ "test:install-wizard-v2": "npm run build && node dist/test_install_wizard_v2.js",
165
166
  "pretest:all": "node scripts/clean-test-pollution.js",
166
- "test:all": "npm run build && node dist/test_distribution_installability.js && node dist/test_orchestration_assets_lifecycle.js && node dist/test_openlife_runtime_source_truth.js && node dist/test_openlife_evolution_surface.js && node dist/test_openlife_routing_surface.js && node dist/test_openlife_auto_creator_routing.js && node dist/test_openlife_gatekeeper_routing.js && node dist/test_enterprise_agentic_core.js && node dist/test_admin_teams_networks.js && node dist/test_agent_team_skill_network.js && node dist/test_benchmark_engine.js && node dist/test_cli_service_commands.js && node dist/test_consequence_forecaster.js && node dist/test_conversation_memory.js && node dist/test_create_entities.js && node dist/test_designmd_import_registry.js && node dist/test_designmd_mode.js && node dist/test_designmd_mode_workspace.js && node dist/test_dream_organizer.js && node dist/test_dual_mode.js && node dist/test_governance.js && node dist/test_governance_advanced.js && node dist/test_install_flow.js && node dist/test_job_lifecycle.js && node dist/test_memory_orchestrator.js && node dist/test_memory_promotion.js && node dist/test_memory_retention.js && node dist/test_operating_system.js && node dist/test_optimization_loop.js && node dist/test_outcome_simulator.js && node dist/test_performance_scorecard.js && node dist/test_phase6_board.js && node dist/test_phase6_cadence.js && node dist/test_phase6_ops.js && node dist/test_release_gate.js && node dist/test_reversa_contracts_e2e.js && node dist/test_reversa_export_and_strict.js && node dist/test_reversa_full_execution.js && node dist/test_reversa_lite.js && node dist/test_runtime_policy.js && node dist/test_runtime_probe.js && node dist/test_runtime_registry.js && node dist/test_security_download_guard.js && node dist/test_service_command_surface.js && node dist/test_service_completion_policy.js && node dist/test_service_guardrails_delete.js && node dist/test_sources_import_ref.js && node dist/test_sources_scaffold.js && node dist/test_teammate_learning.js && node dist/test_telegram_delete_guardrail.js && node dist/test_daemon_sigterm.js && node dist/test_ask_exit.js && node dist/test_brain_error_diagnostics.js && node dist/test_cli_doc_parity.js && node dist/test_trigger_basic_auth.js && node dist/test_brain_fallback_chain.js && node dist/test_cli_help_surface.js && node dist/test_cli_diagnostics.js && node dist/test_cli_crud_roundtrip.js && node dist/test_subsystems_routing_governance.js && node dist/test_subsystems_org_state.js && node dist/test_subsystems_promotion_memory_assets.js && node dist/test_phase1_check_exit.js && node dist/test_install_flow_host_validation.js && node dist/test_dist_templates_layout.js && node dist/test_host_installer.js && node dist/test_host_uninstaller.js && node dist/test_install_wizard.js && node dist/test_multi_host_docs_parity.js && node dist/test_host_install_e2e.js && node dist/test_runtime_profile_oauth_only.js && node dist/test_atomic_writer.js && node dist/test_mission_checkpoint.js && node dist/test_workflow_parser.js && node dist/test_workflow_engine.js && node dist/test_workflow_e2e.js && node dist/test_distributed_lock.js && node dist/test_watchdog_heartbeat.js && node dist/test_runtime_health_backoff.js && node dist/test_queue_scheduler.js && node dist/test_squad_skill_creator.js && node dist/test_aiobuilder_cli_parity.js && node dist/test_catalog_quality.js && node dist/test_royal_stack_golden.js && node dist/test_capability_pack_schema.js && node dist/test_capability_genesis_engine.js && node dist/test_workflow_schema_backward_compat.js && node dist/test_service_mode_explicit_only.js && node dist/test_deep_research_capability.js && node dist/test_guided_creator_cli.js && node dist/test_governance_v13_policies.js && node dist/test_gateway_telegram_guardrails.js && node dist/test_cron_manager.js && node dist/test_profile_toolset_mcp.js && node dist/test_squad_skill_design_llm.js && node dist/test_workflow_condition_parser.js && node dist/test_security_download_and_scan.js && node dist/test_host_installers_gemini_codex.js && node dist/test_toolset_enforcement.js && node dist/test_creator_placeholders_completed.js && node dist/test_performance_latency.js && node dist/test_post_mission_evaluation.js && node dist/test_governance_scope_ledger.js && node dist/test_consequence_forecast_brain.js && node dist/test_remote_publish.js && node dist/test_process_sandbox.js && node dist/test_v15_e2e_integration.js && node dist/test_doctor_sandbox_check.js && node dist/test_task_executor_sandbox_optin.js && node dist/test_forecast_brain_wiring.js && node dist/test_status_command.js && node dist/test_logs_command.js && node dist/test_agent_creator.js && node dist/test_matrix_rain.js && node dist/test_chat_tui.js && node dist/test_config_tui.js",
167
+ "test:all": "npm run build && node dist/test_distribution_installability.js && node dist/test_orchestration_assets_lifecycle.js && node dist/test_openlife_runtime_source_truth.js && node dist/test_openlife_evolution_surface.js && node dist/test_openlife_routing_surface.js && node dist/test_openlife_auto_creator_routing.js && node dist/test_openlife_gatekeeper_routing.js && node dist/test_enterprise_agentic_core.js && node dist/test_admin_teams_networks.js && node dist/test_agent_team_skill_network.js && node dist/test_benchmark_engine.js && node dist/test_cli_service_commands.js && node dist/test_consequence_forecaster.js && node dist/test_conversation_memory.js && node dist/test_create_entities.js && node dist/test_designmd_import_registry.js && node dist/test_designmd_mode.js && node dist/test_designmd_mode_workspace.js && node dist/test_dream_organizer.js && node dist/test_dual_mode.js && node dist/test_governance.js && node dist/test_governance_advanced.js && node dist/test_install_flow.js && node dist/test_job_lifecycle.js && node dist/test_memory_orchestrator.js && node dist/test_memory_promotion.js && node dist/test_memory_retention.js && node dist/test_operating_system.js && node dist/test_optimization_loop.js && node dist/test_outcome_simulator.js && node dist/test_performance_scorecard.js && node dist/test_phase6_board.js && node dist/test_phase6_cadence.js && node dist/test_phase6_ops.js && node dist/test_release_gate.js && node dist/test_reversa_contracts_e2e.js && node dist/test_reversa_export_and_strict.js && node dist/test_reversa_full_execution.js && node dist/test_reversa_lite.js && node dist/test_runtime_policy.js && node dist/test_runtime_probe.js && node dist/test_runtime_registry.js && node dist/test_security_download_guard.js && node dist/test_service_command_surface.js && node dist/test_service_completion_policy.js && node dist/test_service_guardrails_delete.js && node dist/test_sources_import_ref.js && node dist/test_sources_scaffold.js && node dist/test_teammate_learning.js && node dist/test_telegram_delete_guardrail.js && node dist/test_daemon_sigterm.js && node dist/test_ask_exit.js && node dist/test_brain_error_diagnostics.js && node dist/test_cli_doc_parity.js && node dist/test_trigger_basic_auth.js && node dist/test_brain_fallback_chain.js && node dist/test_cli_help_surface.js && node dist/test_cli_diagnostics.js && node dist/test_cli_crud_roundtrip.js && node dist/test_subsystems_routing_governance.js && node dist/test_subsystems_org_state.js && node dist/test_subsystems_promotion_memory_assets.js && node dist/test_phase1_check_exit.js && node dist/test_install_flow_host_validation.js && node dist/test_dist_templates_layout.js && node dist/test_host_installer.js && node dist/test_host_uninstaller.js && node dist/test_install_wizard.js && node dist/test_multi_host_docs_parity.js && node dist/test_host_install_e2e.js && node dist/test_runtime_profile_oauth_only.js && node dist/test_atomic_writer.js && node dist/test_mission_checkpoint.js && node dist/test_workflow_parser.js && node dist/test_workflow_engine.js && node dist/test_workflow_e2e.js && node dist/test_distributed_lock.js && node dist/test_watchdog_heartbeat.js && node dist/test_runtime_health_backoff.js && node dist/test_queue_scheduler.js && node dist/test_squad_skill_creator.js && node dist/test_aiobuilder_cli_parity.js && node dist/test_catalog_quality.js && node dist/test_royal_stack_golden.js && node dist/test_capability_pack_schema.js && node dist/test_capability_genesis_engine.js && node dist/test_workflow_schema_backward_compat.js && node dist/test_service_mode_explicit_only.js && node dist/test_deep_research_capability.js && node dist/test_guided_creator_cli.js && node dist/test_governance_v13_policies.js && node dist/test_gateway_telegram_guardrails.js && node dist/test_cron_manager.js && node dist/test_profile_toolset_mcp.js && node dist/test_squad_skill_design_llm.js && node dist/test_workflow_condition_parser.js && node dist/test_security_download_and_scan.js && node dist/test_host_installers_gemini_codex.js && node dist/test_toolset_enforcement.js && node dist/test_creator_placeholders_completed.js && node dist/test_performance_latency.js && node dist/test_post_mission_evaluation.js && node dist/test_governance_scope_ledger.js && node dist/test_consequence_forecast_brain.js && node dist/test_remote_publish.js && node dist/test_process_sandbox.js && node dist/test_v15_e2e_integration.js && node dist/test_doctor_sandbox_check.js && node dist/test_task_executor_sandbox_optin.js && node dist/test_forecast_brain_wiring.js && node dist/test_status_command.js && node dist/test_logs_command.js && node dist/test_agent_creator.js && node dist/test_matrix_rain.js && node dist/test_chat_tui.js && node dist/test_config_tui.js && node dist/test_install_wizard_v2.js",
167
168
  "prepublishOnly": "npm run test:all",
168
169
  "test:no-automatic-messages": "npm run build && node dist/test_no_automatic_messages.js",
169
- "test:gateway-fast-ack": "npm run build && node dist/test_gateway_fast_ack.js"
170
+ "test:gateway-fast-ack": "npm run build && node dist/test_gateway_fast_ack.js",
171
+ "test:gateway-telegram-formatting": "npm run build && node dist/test_gateway_telegram_formatting.js"
170
172
  },
171
173
  "dependencies": {
172
174
  "@anthropic-ai/sdk": "^0.86.1",