@alan512/experienceengine 0.1.3 → 0.2.0
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/.claude-plugin/marketplace.json +0 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.env.example +0 -0
- package/.mcp.json +0 -0
- package/LICENSE +0 -0
- package/README.md +196 -114
- package/README.zh-CN.md +230 -100
- package/dist/adapters/claude-code/event-store.d.ts +0 -0
- package/dist/adapters/claude-code/event-store.js +0 -0
- package/dist/adapters/claude-code/event-store.js.map +0 -0
- package/dist/adapters/claude-code/hook-normalizer.d.ts +0 -0
- package/dist/adapters/claude-code/hook-normalizer.js +0 -0
- package/dist/adapters/claude-code/hook-normalizer.js.map +0 -0
- package/dist/adapters/claude-code/runtime-projection.d.ts +0 -0
- package/dist/adapters/claude-code/runtime-projection.js +0 -0
- package/dist/adapters/claude-code/runtime-projection.js.map +0 -0
- package/dist/adapters/claude-code/session-store.d.ts +1 -0
- package/dist/adapters/claude-code/session-store.js +24 -1
- package/dist/adapters/claude-code/session-store.js.map +1 -1
- package/dist/adapters/codex/action-registry.d.ts +84 -0
- package/dist/adapters/codex/action-registry.js +277 -0
- package/dist/adapters/codex/action-registry.js.map +1 -0
- package/dist/adapters/codex/broker-tools.d.ts +114 -0
- package/dist/adapters/codex/broker-tools.js +130 -0
- package/dist/adapters/codex/broker-tools.js.map +1 -0
- package/dist/adapters/codex/instruction-template.d.ts +0 -0
- package/dist/adapters/codex/instruction-template.js +0 -0
- package/dist/adapters/codex/instruction-template.js.map +0 -0
- package/dist/adapters/codex/mcp-server.d.ts +21 -0
- package/dist/adapters/codex/mcp-server.js +103 -423
- package/dist/adapters/codex/mcp-server.js.map +1 -1
- package/dist/analyzer/candidate-signals.d.ts +3 -1
- package/dist/analyzer/candidate-signals.js +159 -0
- package/dist/analyzer/candidate-signals.js.map +1 -1
- package/dist/analyzer/experience-analyzer.d.ts +0 -0
- package/dist/analyzer/experience-analyzer.js +0 -0
- package/dist/analyzer/experience-analyzer.js.map +0 -0
- package/dist/analyzer/extraction-evidence.d.ts +0 -0
- package/dist/analyzer/extraction-evidence.js +0 -0
- package/dist/analyzer/extraction-evidence.js.map +0 -0
- package/dist/analyzer/llm-learning-gate.d.ts +12 -1
- package/dist/analyzer/llm-learning-gate.js +633 -16
- package/dist/analyzer/llm-learning-gate.js.map +1 -1
- package/dist/analyzer/node-deduper.d.ts +0 -0
- package/dist/analyzer/node-deduper.js +0 -0
- package/dist/analyzer/node-deduper.js.map +0 -0
- package/dist/analyzer/node-normalizer.d.ts +0 -0
- package/dist/analyzer/node-normalizer.js +0 -0
- package/dist/analyzer/node-normalizer.js.map +0 -0
- package/dist/analyzer/storage-gate.d.ts +0 -0
- package/dist/analyzer/storage-gate.js +0 -0
- package/dist/analyzer/storage-gate.js.map +0 -0
- package/dist/analyzer/strategy-extractor.d.ts +0 -0
- package/dist/analyzer/strategy-extractor.js +0 -0
- package/dist/analyzer/strategy-extractor.js.map +0 -0
- package/dist/analyzer/warning-extractor.d.ts +0 -0
- package/dist/analyzer/warning-extractor.js +0 -0
- package/dist/analyzer/warning-extractor.js.map +0 -0
- package/dist/cli/commands/backup.d.ts +0 -0
- package/dist/cli/commands/backup.js +0 -0
- package/dist/cli/commands/backup.js.map +0 -0
- package/dist/cli/commands/claude-hook.d.ts +0 -0
- package/dist/cli/commands/claude-hook.js +11 -4
- package/dist/cli/commands/claude-hook.js.map +1 -1
- package/dist/cli/commands/codex-mcp-server.d.ts +0 -0
- package/dist/cli/commands/codex-mcp-server.js +0 -0
- package/dist/cli/commands/codex-mcp-server.js.map +0 -0
- package/dist/cli/commands/codex.d.ts +60 -0
- package/dist/cli/commands/codex.js +188 -0
- package/dist/cli/commands/codex.js.map +1 -0
- package/dist/cli/commands/config.d.ts +0 -0
- package/dist/cli/commands/config.js +0 -0
- package/dist/cli/commands/config.js.map +0 -0
- package/dist/cli/commands/cool.d.ts +0 -0
- package/dist/cli/commands/cool.js +0 -0
- package/dist/cli/commands/cool.js.map +0 -0
- package/dist/cli/commands/disable.d.ts +0 -0
- package/dist/cli/commands/disable.js +0 -0
- package/dist/cli/commands/disable.js.map +0 -0
- package/dist/cli/commands/doctor.d.ts +0 -0
- package/dist/cli/commands/doctor.js +20 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/enable.d.ts +0 -0
- package/dist/cli/commands/enable.js +0 -0
- package/dist/cli/commands/enable.js.map +0 -0
- package/dist/cli/commands/evaluate.d.ts +9 -3
- package/dist/cli/commands/evaluate.js +31 -5
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/export.d.ts +0 -0
- package/dist/cli/commands/export.js +0 -0
- package/dist/cli/commands/export.js.map +0 -0
- package/dist/cli/commands/feedback.d.ts +0 -0
- package/dist/cli/commands/feedback.js +0 -0
- package/dist/cli/commands/feedback.js.map +0 -0
- package/dist/cli/commands/import.d.ts +0 -0
- package/dist/cli/commands/import.js +0 -0
- package/dist/cli/commands/import.js.map +0 -0
- package/dist/cli/commands/init.d.ts +0 -0
- package/dist/cli/commands/init.js +21 -8
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/inspect.d.ts +0 -0
- package/dist/cli/commands/inspect.js +69 -1
- package/dist/cli/commands/inspect.js.map +1 -1
- package/dist/cli/commands/install.d.ts +0 -0
- package/dist/cli/commands/install.js +0 -0
- package/dist/cli/commands/install.js.map +0 -0
- package/dist/cli/commands/maintenance.d.ts +0 -0
- package/dist/cli/commands/maintenance.js +0 -0
- package/dist/cli/commands/maintenance.js.map +0 -0
- package/dist/cli/commands/mcp-server.d.ts +0 -0
- package/dist/cli/commands/mcp-server.js +0 -0
- package/dist/cli/commands/mcp-server.js.map +0 -0
- package/dist/cli/commands/models.d.ts +0 -0
- package/dist/cli/commands/models.js +0 -0
- package/dist/cli/commands/models.js.map +0 -0
- package/dist/cli/commands/repair.d.ts +0 -0
- package/dist/cli/commands/repair.js +3 -3
- package/dist/cli/commands/repair.js.map +1 -1
- package/dist/cli/commands/retire.d.ts +0 -0
- package/dist/cli/commands/retire.js +0 -0
- package/dist/cli/commands/retire.js.map +0 -0
- package/dist/cli/commands/rollback.d.ts +0 -0
- package/dist/cli/commands/rollback.js +0 -0
- package/dist/cli/commands/rollback.js.map +0 -0
- package/dist/cli/commands/stats.d.ts +0 -0
- package/dist/cli/commands/stats.js +0 -0
- package/dist/cli/commands/stats.js.map +0 -0
- package/dist/cli/commands/status.d.ts +0 -0
- package/dist/cli/commands/status.js +32 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +0 -0
- package/dist/cli/commands/upgrade.js +0 -0
- package/dist/cli/commands/upgrade.js.map +0 -0
- package/dist/cli/dispatch.d.ts +0 -0
- package/dist/cli/dispatch.js +16 -4
- package/dist/cli/dispatch.js.map +1 -1
- package/dist/cli/index.d.ts +0 -0
- package/dist/cli/index.js.map +0 -0
- package/dist/cli/state-model.d.ts +0 -0
- package/dist/cli/state-model.js +0 -0
- package/dist/cli/state-model.js.map +0 -0
- package/dist/config/config-schema.d.ts +177 -0
- package/dist/config/config-schema.js +142 -1
- package/dist/config/config-schema.js.map +1 -1
- package/dist/config/default-config.d.ts +0 -0
- package/dist/config/default-config.js +19 -1
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/load-config.d.ts +0 -0
- package/dist/config/load-config.js +72 -1
- package/dist/config/load-config.js.map +1 -1
- package/dist/config/path-resolver.d.ts +0 -0
- package/dist/config/path-resolver.js +0 -0
- package/dist/config/path-resolver.js.map +0 -0
- package/dist/config/runtime-env.d.ts +0 -0
- package/dist/config/runtime-env.js +0 -0
- package/dist/config/runtime-env.js.map +0 -0
- package/dist/config/secrets-store.d.ts +0 -0
- package/dist/config/secrets-store.js +0 -0
- package/dist/config/secrets-store.js.map +0 -0
- package/dist/config/settings-store.d.ts +19 -0
- package/dist/config/settings-store.js +11 -0
- package/dist/config/settings-store.js.map +1 -1
- package/dist/controller/candidate-retriever.d.ts +15 -1
- package/dist/controller/candidate-retriever.js +91 -137
- package/dist/controller/candidate-retriever.js.map +1 -1
- package/dist/controller/injection-renderer.d.ts +0 -0
- package/dist/controller/injection-renderer.js +0 -0
- package/dist/controller/injection-renderer.js.map +0 -0
- package/dist/controller/injection-scorecard.d.ts +2 -14
- package/dist/controller/injection-scorecard.js +29 -0
- package/dist/controller/injection-scorecard.js.map +1 -1
- package/dist/controller/inline-notice.d.ts +0 -0
- package/dist/controller/inline-notice.js +0 -0
- package/dist/controller/inline-notice.js.map +0 -0
- package/dist/controller/intervention-controller.d.ts +3 -15
- package/dist/controller/intervention-controller.js +217 -57
- package/dist/controller/intervention-controller.js.map +1 -1
- package/dist/controller/lexical-retriever.d.ts +0 -0
- package/dist/controller/lexical-retriever.js +0 -0
- package/dist/controller/lexical-retriever.js.map +0 -0
- package/dist/controller/model-reranker.d.ts +0 -0
- package/dist/controller/model-reranker.js +0 -0
- package/dist/controller/model-reranker.js.map +0 -0
- package/dist/controller/node-ranker.d.ts +0 -0
- package/dist/controller/node-ranker.js +0 -0
- package/dist/controller/node-ranker.js.map +0 -0
- package/dist/controller/policy-enricher.d.ts +10 -0
- package/dist/controller/policy-enricher.js +186 -0
- package/dist/controller/policy-enricher.js.map +1 -0
- package/dist/controller/query-rewrite.d.ts +0 -0
- package/dist/controller/query-rewrite.js +0 -0
- package/dist/controller/query-rewrite.js.map +0 -0
- package/dist/controller/retrieval-context.d.ts +3 -0
- package/dist/controller/retrieval-context.js +37 -0
- package/dist/controller/retrieval-context.js.map +1 -0
- package/dist/controller/second-opinion-gate.d.ts +41 -0
- package/dist/controller/second-opinion-gate.js +225 -0
- package/dist/controller/second-opinion-gate.js.map +1 -0
- package/dist/controller/trigger-evaluator.d.ts +4 -0
- package/dist/controller/trigger-evaluator.js +8 -2
- package/dist/controller/trigger-evaluator.js.map +1 -1
- package/dist/distillation/errors.d.ts +0 -0
- package/dist/distillation/errors.js +0 -0
- package/dist/distillation/errors.js.map +0 -0
- package/dist/distillation/experience-family.d.ts +0 -0
- package/dist/distillation/experience-family.js +0 -0
- package/dist/distillation/experience-family.js.map +0 -0
- package/dist/distillation/host-llm.d.ts +0 -0
- package/dist/distillation/host-llm.js +0 -0
- package/dist/distillation/host-llm.js.map +0 -0
- package/dist/distillation/llm-distiller.d.ts +0 -0
- package/dist/distillation/llm-distiller.js +0 -0
- package/dist/distillation/llm-distiller.js.map +0 -0
- package/dist/distillation/merge-decider.d.ts +0 -0
- package/dist/distillation/merge-decider.js +0 -0
- package/dist/distillation/merge-decider.js.map +0 -0
- package/dist/distillation/model-catalog.d.ts +0 -0
- package/dist/distillation/model-catalog.js +0 -0
- package/dist/distillation/model-catalog.js.map +0 -0
- package/dist/distillation/prompt-contract.d.ts +1 -1
- package/dist/distillation/prompt-contract.js +3 -1
- package/dist/distillation/prompt-contract.js.map +1 -1
- package/dist/distillation/providers/anthropic.d.ts +0 -0
- package/dist/distillation/providers/anthropic.js +0 -0
- package/dist/distillation/providers/anthropic.js.map +0 -0
- package/dist/distillation/providers/azure-openai.d.ts +0 -0
- package/dist/distillation/providers/azure-openai.js +0 -0
- package/dist/distillation/providers/azure-openai.js.map +0 -0
- package/dist/distillation/providers/baidu-qianfan.d.ts +0 -0
- package/dist/distillation/providers/baidu-qianfan.js +0 -0
- package/dist/distillation/providers/baidu-qianfan.js.map +0 -0
- package/dist/distillation/providers/bedrock.d.ts +0 -0
- package/dist/distillation/providers/bedrock.js +0 -0
- package/dist/distillation/providers/bedrock.js.map +0 -0
- package/dist/distillation/providers/dashscope.d.ts +0 -0
- package/dist/distillation/providers/dashscope.js +0 -0
- package/dist/distillation/providers/dashscope.js.map +0 -0
- package/dist/distillation/providers/deepseek.d.ts +0 -0
- package/dist/distillation/providers/deepseek.js +0 -0
- package/dist/distillation/providers/deepseek.js.map +0 -0
- package/dist/distillation/providers/gemini.d.ts +0 -0
- package/dist/distillation/providers/gemini.js +5 -1
- package/dist/distillation/providers/gemini.js.map +1 -1
- package/dist/distillation/providers/google-adc.d.ts +0 -0
- package/dist/distillation/providers/google-adc.js +0 -0
- package/dist/distillation/providers/google-adc.js.map +0 -0
- package/dist/distillation/providers/minimax.d.ts +0 -0
- package/dist/distillation/providers/minimax.js +0 -0
- package/dist/distillation/providers/minimax.js.map +0 -0
- package/dist/distillation/providers/moonshot.d.ts +0 -0
- package/dist/distillation/providers/moonshot.js +0 -0
- package/dist/distillation/providers/moonshot.js.map +0 -0
- package/dist/distillation/providers/openai-compatible-factory.d.ts +0 -0
- package/dist/distillation/providers/openai-compatible-factory.js +0 -0
- package/dist/distillation/providers/openai-compatible-factory.js.map +0 -0
- package/dist/distillation/providers/openai-compatible.d.ts +0 -0
- package/dist/distillation/providers/openai-compatible.js +0 -0
- package/dist/distillation/providers/openai-compatible.js.map +0 -0
- package/dist/distillation/providers/openai.d.ts +0 -0
- package/dist/distillation/providers/openai.js +0 -0
- package/dist/distillation/providers/openai.js.map +0 -0
- package/dist/distillation/providers/openrouter.d.ts +0 -0
- package/dist/distillation/providers/openrouter.js +0 -0
- package/dist/distillation/providers/openrouter.js.map +0 -0
- package/dist/distillation/providers/registry.d.ts +0 -0
- package/dist/distillation/providers/registry.js +0 -0
- package/dist/distillation/providers/registry.js.map +0 -0
- package/dist/distillation/providers/siliconflow.d.ts +0 -0
- package/dist/distillation/providers/siliconflow.js +0 -0
- package/dist/distillation/providers/siliconflow.js.map +0 -0
- package/dist/distillation/providers/tencent-hunyuan.d.ts +0 -0
- package/dist/distillation/providers/tencent-hunyuan.js +0 -0
- package/dist/distillation/providers/tencent-hunyuan.js.map +0 -0
- package/dist/distillation/providers/types.d.ts +0 -0
- package/dist/distillation/providers/types.js +0 -0
- package/dist/distillation/providers/types.js.map +0 -0
- package/dist/distillation/providers/volcengine-ark.d.ts +0 -0
- package/dist/distillation/providers/volcengine-ark.js +0 -0
- package/dist/distillation/providers/volcengine-ark.js.map +0 -0
- package/dist/distillation/providers/zhipu.d.ts +0 -0
- package/dist/distillation/providers/zhipu.js +0 -0
- package/dist/distillation/providers/zhipu.js.map +0 -0
- package/dist/distillation/queue-worker.d.ts +0 -0
- package/dist/distillation/queue-worker.js +22 -3
- package/dist/distillation/queue-worker.js.map +1 -1
- package/dist/distillation/types.d.ts +0 -0
- package/dist/distillation/types.js +0 -0
- package/dist/distillation/types.js.map +0 -0
- package/dist/evaluation/benchmark-report.d.ts +0 -0
- package/dist/evaluation/benchmark-report.js +0 -0
- package/dist/evaluation/benchmark-report.js.map +0 -0
- package/dist/evaluation/benchmark-summary.d.ts +0 -0
- package/dist/evaluation/benchmark-summary.js +0 -0
- package/dist/evaluation/benchmark-summary.js.map +0 -0
- package/dist/evaluation/codex-lifecycle-validation.d.ts +60 -0
- package/dist/evaluation/codex-lifecycle-validation.js +233 -0
- package/dist/evaluation/codex-lifecycle-validation.js.map +1 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.d.ts +63 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.js +108 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.js.map +1 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.d.ts +26 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.js +23 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.js.map +1 -0
- package/dist/evaluation/openclaw-baseline.d.ts +8 -0
- package/dist/evaluation/openclaw-baseline.js +27 -0
- package/dist/evaluation/openclaw-baseline.js.map +1 -1
- package/dist/evaluation/openclaw-scenarios.d.ts +0 -0
- package/dist/evaluation/openclaw-scenarios.js +0 -0
- package/dist/evaluation/openclaw-scenarios.js.map +0 -0
- package/dist/experience-management/governance-observability.d.ts +13 -0
- package/dist/experience-management/governance-observability.js +37 -0
- package/dist/experience-management/governance-observability.js.map +1 -0
- package/dist/experience-management/node-lifecycle-governance.d.ts +8 -0
- package/dist/experience-management/node-lifecycle-governance.js +80 -0
- package/dist/experience-management/node-lifecycle-governance.js.map +1 -0
- package/dist/experience-management/task-management-signals.d.ts +29 -0
- package/dist/experience-management/task-management-signals.js +148 -0
- package/dist/experience-management/task-management-signals.js.map +1 -0
- package/dist/feedback/automatic-attribution.d.ts +0 -0
- package/dist/feedback/automatic-attribution.js +0 -0
- package/dist/feedback/automatic-attribution.js.map +0 -0
- package/dist/feedback/feedback-manager.d.ts +4 -1
- package/dist/feedback/feedback-manager.js +11 -22
- package/dist/feedback/feedback-manager.js.map +1 -1
- package/dist/feedback/harm-detector.d.ts +0 -0
- package/dist/feedback/harm-detector.js +0 -0
- package/dist/feedback/harm-detector.js.map +0 -0
- package/dist/feedback/state-transition.d.ts +6 -1
- package/dist/feedback/state-transition.js +6 -3
- package/dist/feedback/state-transition.js.map +1 -1
- package/dist/feedback/stats-updater.d.ts +0 -0
- package/dist/feedback/stats-updater.js +0 -0
- package/dist/feedback/stats-updater.js.map +0 -0
- package/dist/hybrid/capsule-builder.d.ts +23 -0
- package/dist/hybrid/capsule-builder.js +114 -0
- package/dist/hybrid/capsule-builder.js.map +1 -0
- package/dist/hybrid/explain-provider-client.d.ts +19 -0
- package/dist/hybrid/explain-provider-client.js +34 -0
- package/dist/hybrid/explain-provider-client.js.map +1 -0
- package/dist/hybrid/postmortem-provider-client.d.ts +19 -0
- package/dist/hybrid/postmortem-provider-client.js +34 -0
- package/dist/hybrid/postmortem-provider-client.js.map +1 -0
- package/dist/hybrid/rollout.d.ts +9 -0
- package/dist/hybrid/rollout.js +49 -0
- package/dist/hybrid/rollout.js.map +1 -0
- package/dist/hybrid/router.d.ts +4 -0
- package/dist/hybrid/router.js +62 -0
- package/dist/hybrid/router.js.map +1 -0
- package/dist/hybrid/types.d.ts +140 -0
- package/dist/hybrid/types.js +2 -0
- package/dist/hybrid/types.js.map +1 -0
- package/dist/hybrid/validators.d.ts +5 -0
- package/dist/hybrid/validators.js +94 -0
- package/dist/hybrid/validators.js.map +1 -0
- package/dist/hybrid/worker-client.d.ts +61 -0
- package/dist/hybrid/worker-client.js +196 -0
- package/dist/hybrid/worker-client.js.map +1 -0
- package/dist/hybrid/workers/explain-decision-llm.d.ts +8 -0
- package/dist/hybrid/workers/explain-decision-llm.js +152 -0
- package/dist/hybrid/workers/explain-decision-llm.js.map +1 -0
- package/dist/hybrid/workers/explain-decision.d.ts +2 -0
- package/dist/hybrid/workers/explain-decision.js +40 -0
- package/dist/hybrid/workers/explain-decision.js.map +1 -0
- package/dist/hybrid/workers/postmortem-review-llm.d.ts +8 -0
- package/dist/hybrid/workers/postmortem-review-llm.js +398 -0
- package/dist/hybrid/workers/postmortem-review-llm.js.map +1 -0
- package/dist/hybrid/workers/postmortem-review.d.ts +2 -0
- package/dist/hybrid/workers/postmortem-review.js +66 -0
- package/dist/hybrid/workers/postmortem-review.js.map +1 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/input/context-summary-adapter.d.ts +0 -0
- package/dist/input/context-summary-adapter.js +0 -0
- package/dist/input/context-summary-adapter.js.map +0 -0
- package/dist/input/input-adapter.d.ts +0 -0
- package/dist/input/input-adapter.js +0 -0
- package/dist/input/input-adapter.js.map +0 -0
- package/dist/input/outcome-resolver.d.ts +0 -0
- package/dist/input/outcome-resolver.js +0 -0
- package/dist/input/outcome-resolver.js.map +0 -0
- package/dist/input/scope-resolver.d.ts +0 -0
- package/dist/input/scope-resolver.js +0 -0
- package/dist/input/scope-resolver.js.map +0 -0
- package/dist/input/tasktype-resolver.d.ts +0 -0
- package/dist/input/tasktype-resolver.js +0 -0
- package/dist/input/tasktype-resolver.js.map +0 -0
- package/dist/input/tool-event-significance.d.ts +0 -0
- package/dist/input/tool-event-significance.js +0 -0
- package/dist/input/tool-event-significance.js.map +0 -0
- package/dist/install/claude-cli.d.ts +0 -0
- package/dist/install/claude-cli.js +0 -0
- package/dist/install/claude-cli.js.map +0 -0
- package/dist/install/claude-code-doctor.d.ts +1 -0
- package/dist/install/claude-code-doctor.js +20 -4
- package/dist/install/claude-code-doctor.js.map +1 -1
- package/dist/install/claude-code-installer.d.ts +0 -0
- package/dist/install/claude-code-installer.js +50 -1
- package/dist/install/claude-code-installer.js.map +1 -1
- package/dist/install/claude-marketplace-state.d.ts +0 -0
- package/dist/install/claude-marketplace-state.js +0 -0
- package/dist/install/claude-marketplace-state.js.map +0 -0
- package/dist/install/claude-runtime-target.d.ts +0 -0
- package/dist/install/claude-runtime-target.js +0 -0
- package/dist/install/claude-runtime-target.js.map +0 -0
- package/dist/install/codex-cli.d.ts +15 -0
- package/dist/install/codex-cli.js +55 -3
- package/dist/install/codex-cli.js.map +1 -1
- package/dist/install/codex-installer.d.ts +0 -0
- package/dist/install/codex-installer.js +0 -0
- package/dist/install/codex-installer.js.map +0 -0
- package/dist/install/codex-runtime-target.d.ts +0 -0
- package/dist/install/codex-runtime-target.js +0 -0
- package/dist/install/codex-runtime-target.js.map +0 -0
- package/dist/install/host-detection.d.ts +0 -0
- package/dist/install/host-detection.js +0 -0
- package/dist/install/host-detection.js.map +0 -0
- package/dist/install/openclaw-cli.d.ts +11 -0
- package/dist/install/openclaw-cli.js +0 -0
- package/dist/install/openclaw-cli.js.map +1 -1
- package/dist/install/openclaw-installer.d.ts +12 -7
- package/dist/install/openclaw-installer.js +197 -46
- package/dist/install/openclaw-installer.js.map +1 -1
- package/dist/install/public-install.d.ts +0 -0
- package/dist/install/public-install.js +0 -0
- package/dist/install/public-install.js.map +0 -0
- package/dist/install/registry-health.d.ts +0 -0
- package/dist/install/registry-health.js +0 -0
- package/dist/install/registry-health.js.map +0 -0
- package/dist/interaction/operational-actions-service.d.ts +0 -0
- package/dist/interaction/operational-actions-service.js +0 -0
- package/dist/interaction/operational-actions-service.js.map +0 -0
- package/dist/interaction/operational-service.d.ts +0 -0
- package/dist/interaction/operational-service.js +0 -0
- package/dist/interaction/operational-service.js.map +0 -0
- package/dist/interaction/repo-summary.d.ts +0 -0
- package/dist/interaction/repo-summary.js +0 -0
- package/dist/interaction/repo-summary.js.map +0 -0
- package/dist/interaction/service.d.ts +15 -0
- package/dist/interaction/service.js +174 -20
- package/dist/interaction/service.js.map +1 -1
- package/dist/interaction/state-artifact-service.d.ts +0 -0
- package/dist/interaction/state-artifact-service.js +0 -0
- package/dist/interaction/state-artifact-service.js.map +0 -0
- package/dist/maintenance/claude-validate-print.d.ts +0 -0
- package/dist/maintenance/claude-validate-print.js +0 -0
- package/dist/maintenance/claude-validate-print.js.map +0 -0
- package/dist/maintenance/embedding-smoke.d.ts +0 -0
- package/dist/maintenance/embedding-smoke.js +0 -0
- package/dist/maintenance/embedding-smoke.js.map +0 -0
- package/dist/maintenance/redistill-rule-nodes.d.ts +0 -0
- package/dist/maintenance/redistill-rule-nodes.js +0 -0
- package/dist/maintenance/redistill-rule-nodes.js.map +0 -0
- package/dist/maintenance/scope-merge.d.ts +0 -0
- package/dist/maintenance/scope-merge.js +0 -0
- package/dist/maintenance/scope-merge.js.map +0 -0
- package/dist/maintenance/warning-variant-cleanup.d.ts +0 -0
- package/dist/maintenance/warning-variant-cleanup.js +0 -0
- package/dist/maintenance/warning-variant-cleanup.js.map +0 -0
- package/dist/plugin/fixture-sanitizer.d.ts +0 -0
- package/dist/plugin/fixture-sanitizer.js +0 -0
- package/dist/plugin/fixture-sanitizer.js.map +0 -0
- package/dist/plugin/hooks/before-prompt-build.d.ts +1 -0
- package/dist/plugin/hooks/before-prompt-build.js +4 -1
- package/dist/plugin/hooks/before-prompt-build.js.map +1 -1
- package/dist/plugin/hooks/message-sent.d.ts +0 -0
- package/dist/plugin/hooks/message-sent.js +0 -0
- package/dist/plugin/hooks/message-sent.js.map +0 -0
- package/dist/plugin/hooks/tool-result-persist.d.ts +0 -0
- package/dist/plugin/hooks/tool-result-persist.js +0 -0
- package/dist/plugin/hooks/tool-result-persist.js.map +0 -0
- package/dist/plugin/openclaw-install-state.d.ts +39 -0
- package/dist/plugin/openclaw-install-state.js +24 -0
- package/dist/plugin/openclaw-install-state.js.map +1 -0
- package/dist/plugin/openclaw-plugin.d.ts +125 -0
- package/dist/plugin/openclaw-plugin.js +18 -7
- package/dist/plugin/openclaw-plugin.js.map +1 -1
- package/dist/plugin/openclaw-routine-interaction.d.ts +2 -1
- package/dist/plugin/openclaw-routine-interaction.js +12 -7
- package/dist/plugin/openclaw-routine-interaction.js.map +1 -1
- package/dist/plugin/openclaw-runtime-defaults.d.ts +16 -0
- package/dist/plugin/openclaw-runtime-defaults.js +16 -0
- package/dist/plugin/openclaw-runtime-defaults.js.map +1 -0
- package/dist/plugin/runtime-capture.d.ts +0 -0
- package/dist/plugin/runtime-capture.js +0 -0
- package/dist/plugin/runtime-capture.js.map +0 -0
- package/dist/plugin/runtime-helpers.d.ts +0 -0
- package/dist/plugin/runtime-helpers.js +0 -0
- package/dist/plugin/runtime-helpers.js.map +0 -0
- package/dist/runtime/service.d.ts +33 -5
- package/dist/runtime/service.js +408 -22
- package/dist/runtime/service.js.map +1 -1
- package/dist/store/logs/jsonl-logger.d.ts +0 -0
- package/dist/store/logs/jsonl-logger.js +0 -0
- package/dist/store/logs/jsonl-logger.js.map +0 -0
- package/dist/store/sqlite/db.d.ts +0 -0
- package/dist/store/sqlite/db.js +28 -0
- package/dist/store/sqlite/db.js.map +1 -1
- package/dist/store/sqlite/migrations.d.ts +0 -0
- package/dist/store/sqlite/migrations.js +0 -0
- package/dist/store/sqlite/migrations.js.map +0 -0
- package/dist/store/sqlite/repositories/candidate-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/candidate-repo.js +0 -0
- package/dist/store/sqlite/repositories/candidate-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.js +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.d.ts +11 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.js +76 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.js.map +1 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.d.ts +11 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.js +73 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.js.map +1 -0
- package/dist/store/sqlite/repositories/injection-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/injection-repo.js +0 -0
- package/dist/store/sqlite/repositories/injection-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/input-record-repo.d.ts +1 -0
- package/dist/store/sqlite/repositories/input-record-repo.js +13 -0
- package/dist/store/sqlite/repositories/input-record-repo.js.map +1 -1
- package/dist/store/sqlite/repositories/node-repo.d.ts +3 -0
- package/dist/store/sqlite/repositories/node-repo.js +45 -6
- package/dist/store/sqlite/repositories/node-repo.js.map +1 -1
- package/dist/store/sqlite/repositories/outcome-record-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/outcome-record-repo.js +0 -0
- package/dist/store/sqlite/repositories/outcome-record-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.js +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/scope-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/scope-repo.js +0 -0
- package/dist/store/sqlite/repositories/scope-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/stats-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/stats-repo.js +0 -0
- package/dist/store/sqlite/repositories/stats-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.js +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.js.map +0 -0
- package/dist/store/sqlite/schema.sql +40 -0
- package/dist/store/vector/api-embedding-provider.d.ts +0 -0
- package/dist/store/vector/api-embedding-provider.js +0 -0
- package/dist/store/vector/api-embedding-provider.js.map +0 -0
- package/dist/store/vector/embeddings.d.ts +0 -0
- package/dist/store/vector/embeddings.js +26 -8
- package/dist/store/vector/embeddings.js.map +1 -1
- package/dist/store/vector/lancedb.d.ts +0 -0
- package/dist/store/vector/lancedb.js +0 -0
- package/dist/store/vector/lancedb.js.map +0 -0
- package/dist/store/vector/local-provider.d.ts +0 -0
- package/dist/store/vector/local-provider.js +0 -0
- package/dist/store/vector/local-provider.js.map +0 -0
- package/dist/store/vector/node-index.d.ts +0 -0
- package/dist/store/vector/node-index.js +0 -0
- package/dist/store/vector/node-index.js.map +0 -0
- package/dist/store/vector/provider-types.d.ts +0 -0
- package/dist/store/vector/provider-types.js +0 -0
- package/dist/store/vector/provider-types.js.map +0 -0
- package/dist/types/analyzer.d.ts +0 -0
- package/dist/types/analyzer.js +0 -0
- package/dist/types/analyzer.js.map +0 -0
- package/dist/types/domain.d.ts +136 -1
- package/dist/types/domain.js +0 -0
- package/dist/types/domain.js.map +0 -0
- package/dist/types/plugin.d.ts +2 -1
- package/dist/types/plugin.js +0 -0
- package/dist/types/plugin.js.map +0 -0
- package/dist/types/storage.d.ts +0 -0
- package/dist/types/storage.js +0 -0
- package/dist/types/storage.js.map +0 -0
- package/dist/utils/clock.d.ts +0 -0
- package/dist/utils/clock.js +0 -0
- package/dist/utils/clock.js.map +0 -0
- package/dist/utils/errors.d.ts +0 -0
- package/dist/utils/errors.js +0 -0
- package/dist/utils/errors.js.map +0 -0
- package/dist/utils/hashing.d.ts +0 -0
- package/dist/utils/hashing.js +0 -0
- package/dist/utils/hashing.js.map +0 -0
- package/dist/utils/ids.d.ts +0 -0
- package/dist/utils/ids.js +0 -0
- package/dist/utils/ids.js.map +0 -0
- package/dist/utils/text.d.ts +0 -0
- package/dist/utils/text.js +0 -0
- package/dist/utils/text.js.map +0 -0
- package/dist/version/package-version.d.ts +0 -0
- package/dist/version/package-version.js +0 -0
- package/dist/version/package-version.js.map +0 -0
- package/dist/version/remote-release.d.ts +0 -0
- package/dist/version/remote-release.js +0 -0
- package/dist/version/remote-release.js.map +0 -0
- package/docs/releases/v0.1.0.md +0 -0
- package/docs/releases/v0.1.1.md +0 -0
- package/docs/releases/v0.1.2.md +0 -0
- package/docs/releases/v0.1.3.md +3 -2
- package/docs/releases/v0.2.0.md +85 -0
- package/docs/user-guide.md +39 -12
- package/hooks/hooks.json +0 -0
- package/openclaw.plugin.json +81 -1
- package/package.json +23 -15
- package/plugins/claude-code-experienceengine/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code-experienceengine/.mcp.json +0 -0
- package/plugins/claude-code-experienceengine/hooks/hooks.json +0 -0
- package/plugins/claude-code-experienceengine/scripts/claude-hook.sh +0 -0
- package/plugins/claude-code-experienceengine/scripts/install-deps.sh +1 -1
- package/scripts/claude-plugin/claude-hook.sh +0 -0
- package/scripts/claude-plugin/install-deps.sh +0 -0
|
@@ -9,31 +9,38 @@ import { ExperienceOperationalActionsService, } from "../../interaction/operatio
|
|
|
9
9
|
import { ExperienceStateArtifactService } from "../../interaction/state-artifact-service.js";
|
|
10
10
|
import { ExperienceRuntimeService } from "../../runtime/service.js";
|
|
11
11
|
import { fetchLatestGitHubReleaseStatus } from "../../version/remote-release.js";
|
|
12
|
+
import { createCodexActionRegistry } from "./action-registry.js";
|
|
13
|
+
import { createCodexBrokerFacade, executeCodexActionSchema, listCodexActionsSchema, prepareCodexActionSchema } from "./broker-tools.js";
|
|
12
14
|
const NODE_STATES = ["candidate", "priority_candidate", "active", "cooling", "retired"];
|
|
13
15
|
const NODE_TYPES = ["strategy", "warning"];
|
|
14
16
|
const EXPERIENCE_ADAPTERS = ["openclaw", "claude-code", "codex"];
|
|
15
17
|
const HIGH_IMPACT_OPERATIONS = ["install", "repair", "upgrade"];
|
|
16
18
|
const buildExperienceCapabilities = () => ({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
core_actions: [
|
|
20
|
+
"experienceengine_lookup_hints",
|
|
21
|
+
"experienceengine_explain_last_decision",
|
|
22
|
+
"experienceengine_record_tool_result",
|
|
23
|
+
"experienceengine_finalize_task",
|
|
24
|
+
"experienceengine_feedback_last",
|
|
25
|
+
"experienceengine_get_capabilities",
|
|
26
|
+
"experienceengine_doctor"
|
|
22
27
|
],
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
],
|
|
26
|
-
resources: [
|
|
28
|
+
routine_read_surfaces: [
|
|
29
|
+
"experienceengine://doctor/{adapter}",
|
|
27
30
|
"experienceengine://capabilities",
|
|
28
|
-
"experienceengine://repo-summary",
|
|
29
31
|
"experienceengine://last",
|
|
30
|
-
"experienceengine://
|
|
32
|
+
"experienceengine://repo-summary"
|
|
33
|
+
],
|
|
34
|
+
advanced_actions: [
|
|
35
|
+
"brokered admin actions",
|
|
36
|
+
"brokered maintenance actions",
|
|
37
|
+
"brokered inspect actions"
|
|
31
38
|
],
|
|
32
|
-
|
|
39
|
+
high_risk_actions: [
|
|
33
40
|
"install / repair / upgrade",
|
|
34
|
-
"backup / export / import / rollback"
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
"backup / export / import / rollback"
|
|
42
|
+
],
|
|
43
|
+
surface_model: "public core loop + public routine reads + brokered long-tail actions"
|
|
37
44
|
});
|
|
38
45
|
const createCodexRuntime = (options = {}) => {
|
|
39
46
|
const paths = resolveExperienceEnginePaths({
|
|
@@ -48,7 +55,7 @@ const createCodexRuntime = (options = {}) => {
|
|
|
48
55
|
}, {
|
|
49
56
|
env: options.env ?? process.env,
|
|
50
57
|
homeDir: options.homeDir
|
|
51
|
-
}));
|
|
58
|
+
}), undefined, options.runtimeOptions);
|
|
52
59
|
};
|
|
53
60
|
const createCodexInteractionService = (options = {}) => {
|
|
54
61
|
const paths = resolveExperienceEnginePaths({
|
|
@@ -90,6 +97,23 @@ const toTextToolResult = (result) => ({
|
|
|
90
97
|
}
|
|
91
98
|
]
|
|
92
99
|
});
|
|
100
|
+
const toNoticeAwareToolResult = (result) => ({
|
|
101
|
+
content: [
|
|
102
|
+
...(result.notice
|
|
103
|
+
? [
|
|
104
|
+
{
|
|
105
|
+
type: "text",
|
|
106
|
+
text: result.notice
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
: []),
|
|
110
|
+
{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: JSON.stringify(result ?? null, null, 2)
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
structuredContent: result
|
|
116
|
+
});
|
|
93
117
|
const toStructuredToolResult = (result) => ({
|
|
94
118
|
content: [
|
|
95
119
|
{
|
|
@@ -108,19 +132,6 @@ const toJsonResourceResult = (uri, result) => ({
|
|
|
108
132
|
}
|
|
109
133
|
]
|
|
110
134
|
});
|
|
111
|
-
const parseRecentMode = (value) => {
|
|
112
|
-
if (value === "all" || value === "injected") {
|
|
113
|
-
return value;
|
|
114
|
-
}
|
|
115
|
-
throw new Error(`Unsupported recent mode: ${value}`);
|
|
116
|
-
};
|
|
117
|
-
const parsePositiveLimit = (value) => {
|
|
118
|
-
const parsed = Number(value);
|
|
119
|
-
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
120
|
-
throw new Error(`Invalid positive limit: ${value}`);
|
|
121
|
-
}
|
|
122
|
-
return parsed;
|
|
123
|
-
};
|
|
124
135
|
const parseNodeState = (value) => {
|
|
125
136
|
if (NODE_STATES.includes(value)) {
|
|
126
137
|
return value;
|
|
@@ -172,7 +183,8 @@ const summarizeTrust = (scorecard) => {
|
|
|
172
183
|
if (!scorecard.riskLevel || !primaryNode?.state) {
|
|
173
184
|
return undefined;
|
|
174
185
|
}
|
|
175
|
-
|
|
186
|
+
const confidence = scorecard.confidence ? ` ${scorecard.confidence}-confidence` : "";
|
|
187
|
+
return `${scorecard.riskLevel}-risk${confidence} ${primaryNode.state} guidance with ${primaryNode.helped ?? 0} helped and ${primaryNode.harmed ?? 0} harmed signal(s).`;
|
|
176
188
|
};
|
|
177
189
|
const summarizeRetrievalNotes = (scorecard) => {
|
|
178
190
|
const notes = [];
|
|
@@ -186,6 +198,16 @@ const summarizeRetrievalNotes = (scorecard) => {
|
|
|
186
198
|
if (scorecard.fastPathApplied) {
|
|
187
199
|
notes.push("A strong candidate fast path was used.");
|
|
188
200
|
}
|
|
201
|
+
const topCandidate = scorecard.topCandidates?.[0];
|
|
202
|
+
if (topCandidate?.retrievalReasons?.length) {
|
|
203
|
+
notes.push(`Top retrieval signals: ${topCandidate.retrievalReasons.slice(0, 2).join(", ")}.`);
|
|
204
|
+
}
|
|
205
|
+
if (topCandidate?.policyReasons?.length) {
|
|
206
|
+
notes.push(`Top policy signals: ${topCandidate.policyReasons.slice(0, 2).join(", ")}.`);
|
|
207
|
+
}
|
|
208
|
+
if (scorecard.rejectedCandidates?.length) {
|
|
209
|
+
notes.push(`Runner-up candidates withheld: ${scorecard.rejectedCandidates.map((candidate) => candidate.id).join(", ")}.`);
|
|
210
|
+
}
|
|
189
211
|
return notes;
|
|
190
212
|
};
|
|
191
213
|
const summarizeScorecard = (scorecard) => scorecard
|
|
@@ -196,6 +218,13 @@ const summarizeScorecard = (scorecard) => scorecard
|
|
|
196
218
|
actionReason: summarizeActionReason(scorecard),
|
|
197
219
|
trustSummary: summarizeTrust(scorecard),
|
|
198
220
|
retrievalNotes: summarizeRetrievalNotes(scorecard),
|
|
221
|
+
confidence: scorecard.confidence,
|
|
222
|
+
budgetClass: scorecard.budgetClass,
|
|
223
|
+
selectedCandidateIds: scorecard.selectedCandidateIds,
|
|
224
|
+
rejectedCandidates: scorecard.rejectedCandidates?.slice(0, 3).map((candidate) => ({
|
|
225
|
+
id: candidate.id,
|
|
226
|
+
reasonCodes: candidate.reasonCodes
|
|
227
|
+
})) ?? [],
|
|
199
228
|
reasons: scorecard.reasons?.slice(0, 2),
|
|
200
229
|
nodes: scorecard.nodes?.slice(0, 3).map((node) => ({
|
|
201
230
|
id: node.id,
|
|
@@ -264,6 +293,9 @@ export const createCodexBehaviorLoop = (options = {}) => {
|
|
|
264
293
|
? "If the injected guidance helped or harmed this task, call experienceengine_quick_feedback."
|
|
265
294
|
: undefined
|
|
266
295
|
};
|
|
296
|
+
},
|
|
297
|
+
async waitForBackgroundLearning() {
|
|
298
|
+
await runtime.waitForBackgroundLearning();
|
|
267
299
|
}
|
|
268
300
|
};
|
|
269
301
|
};
|
|
@@ -297,6 +329,9 @@ export const createCodexInteractionSurface = (options = {}) => {
|
|
|
297
329
|
async inspectRepoSummary(args = {}) {
|
|
298
330
|
return interaction.inspectRepoSummary(args.cwd);
|
|
299
331
|
},
|
|
332
|
+
async explainLastDecision(args) {
|
|
333
|
+
return interaction.explainLastDecision(args.cwd, args.userMessage);
|
|
334
|
+
},
|
|
300
335
|
async feedbackLast(args) {
|
|
301
336
|
return interaction.feedbackLast(args.feedback);
|
|
302
337
|
},
|
|
@@ -327,9 +362,16 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
327
362
|
const operationalSurface = createCodexOperationalService(options);
|
|
328
363
|
const operationalActions = createCodexOperationalActionsService(options);
|
|
329
364
|
const stateArtifacts = createCodexStateArtifactService(options);
|
|
365
|
+
const actionRegistry = createCodexActionRegistry({
|
|
366
|
+
interactionSurface,
|
|
367
|
+
operationalSurface,
|
|
368
|
+
operationalActions,
|
|
369
|
+
stateArtifacts
|
|
370
|
+
});
|
|
371
|
+
const brokerFacade = createCodexBrokerFacade(actionRegistry);
|
|
330
372
|
const server = new McpServer({
|
|
331
373
|
name: "experienceengine",
|
|
332
|
-
version: "0.
|
|
374
|
+
version: "0.2.0"
|
|
333
375
|
});
|
|
334
376
|
server.registerResource("experienceengine_doctor", new ResourceTemplate("experienceengine://doctor/{adapter}", {
|
|
335
377
|
list: undefined,
|
|
@@ -341,43 +383,14 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
341
383
|
description: "Structured ExperienceEngine adapter health and installation state.",
|
|
342
384
|
mimeType: "application/json"
|
|
343
385
|
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await operationalSurface.inspectDoctor(parseAdapter(String(variables.adapter)))));
|
|
344
|
-
server.registerResource("experienceengine_updates_latest", new ResourceTemplate("experienceengine://updates/latest/{adapter}", {
|
|
345
|
-
list: undefined,
|
|
346
|
-
complete: {
|
|
347
|
-
adapter: () => [...EXPERIENCE_ADAPTERS]
|
|
348
|
-
}
|
|
349
|
-
}), {
|
|
350
|
-
title: "ExperienceEngine Latest Update State",
|
|
351
|
-
description: "Latest release/update status for an ExperienceEngine adapter context.",
|
|
352
|
-
mimeType: "application/json"
|
|
353
|
-
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await operationalSurface.checkUpdate(parseAdapter(String(variables.adapter)))));
|
|
354
|
-
server.registerResource("experienceengine_backups", "experienceengine://backups", {
|
|
355
|
-
title: "ExperienceEngine Backup Inventory",
|
|
356
|
-
description: "Managed ExperienceEngine backups available for rollback or export review.",
|
|
357
|
-
mimeType: "application/json"
|
|
358
|
-
}, async (uri) => toJsonResourceResult(uri.toString(), stateArtifacts.listBackups()));
|
|
359
386
|
server.registerResource("experienceengine_last", "experienceengine://last", {
|
|
360
387
|
title: "ExperienceEngine Last Interaction",
|
|
361
388
|
description: "The most recent persisted ExperienceEngine input record and any injected nodes.",
|
|
362
389
|
mimeType: "application/json"
|
|
363
390
|
}, async (uri) => toJsonResourceResult(uri.toString(), await interactionSurface.inspectLast()));
|
|
364
|
-
server.registerResource("experienceengine_recent", new ResourceTemplate("experienceengine://recent/{mode}/{limit}", {
|
|
365
|
-
list: undefined,
|
|
366
|
-
complete: {
|
|
367
|
-
mode: () => ["all", "injected"],
|
|
368
|
-
limit: () => ["5", "10", "20"]
|
|
369
|
-
}
|
|
370
|
-
}), {
|
|
371
|
-
title: "ExperienceEngine Recent History",
|
|
372
|
-
description: "Recent ExperienceEngine input records, optionally filtered to injected turns only.",
|
|
373
|
-
mimeType: "application/json"
|
|
374
|
-
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await interactionSurface.inspectRecent({
|
|
375
|
-
mode: parseRecentMode(String(variables.mode ?? "all")),
|
|
376
|
-
limit: parsePositiveLimit(String(variables.limit ?? "10"))
|
|
377
|
-
})));
|
|
378
391
|
server.registerResource("experienceengine_capabilities", "experienceengine://capabilities", {
|
|
379
392
|
title: "ExperienceEngine Capabilities",
|
|
380
|
-
description: "Agent-first overview of ExperienceEngine MCP tools,
|
|
393
|
+
description: "Agent-first overview of ExperienceEngine MCP tools, routine reads, brokered actions, and fallback boundaries.",
|
|
381
394
|
mimeType: "application/json"
|
|
382
395
|
}, async (uri) => toJsonResourceResult(uri.toString(), buildExperienceCapabilities()));
|
|
383
396
|
server.registerResource("experienceengine_repo_summary", "experienceengine://repo-summary", {
|
|
@@ -385,308 +398,21 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
385
398
|
description: "Repo-level ExperienceEngine summary for the current scope, including benchmark and next action.",
|
|
386
399
|
mimeType: "application/json"
|
|
387
400
|
}, async (uri) => toJsonResourceResult(uri.toString(), await interactionSurface.inspectRepoSummary()));
|
|
388
|
-
server.
|
|
389
|
-
title: "ExperienceEngine
|
|
390
|
-
description: "
|
|
391
|
-
|
|
392
|
-
}, async (
|
|
393
|
-
server.
|
|
394
|
-
title: "ExperienceEngine
|
|
395
|
-
description: "
|
|
396
|
-
|
|
397
|
-
}, async (
|
|
398
|
-
server.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
mimeType: "application/json"
|
|
404
|
-
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await interactionSurface.inspectNode({ nodeId: String(variables.id) })));
|
|
405
|
-
server.registerResource("experienceengine_nodes_by_state", new ResourceTemplate("experienceengine://nodes/state/{state}", {
|
|
406
|
-
list: undefined,
|
|
407
|
-
complete: {
|
|
408
|
-
state: () => [...NODE_STATES]
|
|
409
|
-
}
|
|
410
|
-
}), {
|
|
411
|
-
title: "ExperienceEngine Nodes By State",
|
|
412
|
-
description: "ExperienceEngine nodes filtered by lifecycle state.",
|
|
413
|
-
mimeType: "application/json"
|
|
414
|
-
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await interactionSurface.listNodesByState({
|
|
415
|
-
state: parseNodeState(String(variables.state))
|
|
416
|
-
})));
|
|
417
|
-
server.registerResource("experienceengine_nodes_by_type", new ResourceTemplate("experienceengine://nodes/type/{type}", {
|
|
418
|
-
list: undefined,
|
|
419
|
-
complete: {
|
|
420
|
-
type: () => [...NODE_TYPES]
|
|
421
|
-
}
|
|
422
|
-
}), {
|
|
423
|
-
title: "ExperienceEngine Nodes By Type",
|
|
424
|
-
description: "ExperienceEngine nodes filtered by node type.",
|
|
425
|
-
mimeType: "application/json"
|
|
426
|
-
}, async (uri, variables) => toJsonResourceResult(uri.toString(), await interactionSurface.listNodesByType({
|
|
427
|
-
nodeType: parseNodeType(String(variables.type))
|
|
428
|
-
})));
|
|
429
|
-
server.registerPrompt("experienceengine_review_repo_status", {
|
|
430
|
-
title: "ExperienceEngine Review Repo Status",
|
|
431
|
-
description: "Guide the host agent to review the current repo's ExperienceEngine state before deciding what to do next."
|
|
432
|
-
}, async () => ({
|
|
433
|
-
messages: [
|
|
434
|
-
{
|
|
435
|
-
role: "user",
|
|
436
|
-
content: {
|
|
437
|
-
type: "text",
|
|
438
|
-
text: "Read experienceengine://repo-summary first. Summarize the repo verdict, suggested mode, and safest next action."
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
]
|
|
442
|
-
}));
|
|
443
|
-
server.registerPrompt("experienceengine_review_capabilities", {
|
|
444
|
-
title: "ExperienceEngine Review Capabilities",
|
|
445
|
-
description: "Guide the host agent to review ExperienceEngine's agent-first MCP surface before using advanced ExperienceEngine operations."
|
|
446
|
-
}, async () => ({
|
|
447
|
-
messages: [
|
|
448
|
-
{
|
|
449
|
-
role: "user",
|
|
450
|
-
content: {
|
|
451
|
-
type: "text",
|
|
452
|
-
text: "Read experienceengine://capabilities first. Summarize which ExperienceEngine actions are direct tools, which need confirmation, and which stay CLI/operator-only."
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
]
|
|
456
|
-
}));
|
|
457
|
-
server.registerPrompt("experienceengine_prepare_state_operation", {
|
|
458
|
-
title: "ExperienceEngine Prepare State Operation",
|
|
459
|
-
description: "Review a backup, export, import, or rollback plan before execution.",
|
|
460
|
-
argsSchema: {
|
|
461
|
-
operation: z.enum(["backup", "export", "import", "rollback"]),
|
|
462
|
-
backupId: z.string().optional(),
|
|
463
|
-
importPath: z.string().optional()
|
|
464
|
-
}
|
|
465
|
-
}, async ({ operation, backupId, importPath }) => {
|
|
466
|
-
const planTool = operation === "backup"
|
|
467
|
-
? "experienceengine_plan_backup"
|
|
468
|
-
: operation === "export"
|
|
469
|
-
? "experienceengine_plan_export"
|
|
470
|
-
: operation === "import"
|
|
471
|
-
? "experienceengine_plan_import"
|
|
472
|
-
: "experienceengine_plan_rollback";
|
|
473
|
-
const suffix = operation === "rollback"
|
|
474
|
-
? ` with backupId=${backupId ?? "<backup-id>"}`
|
|
475
|
-
: operation === "import"
|
|
476
|
-
? ` with importPath=${importPath ?? "<snapshot-path>"}`
|
|
477
|
-
: "";
|
|
478
|
-
return {
|
|
479
|
-
messages: [
|
|
480
|
-
{
|
|
481
|
-
role: "user",
|
|
482
|
-
content: {
|
|
483
|
-
type: "text",
|
|
484
|
-
text: `Call ${planTool}${suffix} first. Review the summary, effects, and artifact path with the user. Only after explicit confirmation should you call experienceengine_execute_planned_state_operation with the returned planId and confirmationToken.`
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
]
|
|
488
|
-
};
|
|
489
|
-
});
|
|
490
|
-
server.registerPrompt("experienceengine_prepare_operational_change", {
|
|
491
|
-
title: "ExperienceEngine Prepare Operational Change",
|
|
492
|
-
description: "Plan a high-impact ExperienceEngine install, repair, or upgrade before execution.",
|
|
493
|
-
argsSchema: {
|
|
494
|
-
adapter: z.enum(EXPERIENCE_ADAPTERS),
|
|
495
|
-
operation: z.enum(HIGH_IMPACT_OPERATIONS)
|
|
496
|
-
}
|
|
497
|
-
}, async ({ adapter, operation }) => ({
|
|
498
|
-
messages: [
|
|
499
|
-
{
|
|
500
|
-
role: "user",
|
|
501
|
-
content: {
|
|
502
|
-
type: "text",
|
|
503
|
-
text: `Call experienceengine_plan_${operation} with adapter=${adapter} first. Review the summary, effects, and commandHint with the user. Only after explicit confirmation should you call experienceengine_execute_planned_operation with the returned planId and confirmationToken.`
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
]
|
|
507
|
-
}));
|
|
508
|
-
server.registerPrompt("experienceengine_show_last_intervention", {
|
|
509
|
-
title: "ExperienceEngine Show Last Intervention",
|
|
510
|
-
description: "Review the most recent ExperienceEngine interaction and summarize what happened."
|
|
511
|
-
}, async () => ({
|
|
512
|
-
messages: [
|
|
513
|
-
{
|
|
514
|
-
role: "user",
|
|
515
|
-
content: {
|
|
516
|
-
type: "text",
|
|
517
|
-
text: "Review the latest ExperienceEngine interaction in this Codex session. Summarize whether guidance was injected, which nodes were involved, and the recorded outcome. Use CLI fallback only if the host surface is unavailable."
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
role: "user",
|
|
522
|
-
content: createJsonResourceLink("experienceengine://last", "ExperienceEngine Last Interaction", "The latest persisted ExperienceEngine record and any resolved injected nodes.")
|
|
523
|
-
}
|
|
524
|
-
]
|
|
525
|
-
}));
|
|
526
|
-
server.registerPrompt("experienceengine_review_recent_injected", {
|
|
527
|
-
title: "ExperienceEngine Review Recent Injected",
|
|
528
|
-
description: "Review recent ExperienceEngine turns that actually injected guidance.",
|
|
529
|
-
argsSchema: {
|
|
530
|
-
limit: z.string().optional()
|
|
531
|
-
}
|
|
532
|
-
}, async ({ limit }) => {
|
|
533
|
-
const resolvedLimit = limit ? parsePositiveLimit(limit) : 5;
|
|
534
|
-
const uri = `experienceengine://recent/injected/${resolvedLimit}`;
|
|
535
|
-
return {
|
|
536
|
-
messages: [
|
|
537
|
-
{
|
|
538
|
-
role: "user",
|
|
539
|
-
content: {
|
|
540
|
-
type: "text",
|
|
541
|
-
text: `Review the ${resolvedLimit} most recent ExperienceEngine turns that injected guidance. Summarize recurring wins and harmful repeats.`
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
role: "user",
|
|
546
|
-
content: createJsonResourceLink(uri, "ExperienceEngine Recent Injected History", "Recent ExperienceEngine records filtered to injected turns.")
|
|
547
|
-
}
|
|
548
|
-
]
|
|
549
|
-
};
|
|
550
|
-
});
|
|
551
|
-
server.registerPrompt("experienceengine_review_warning_nodes", {
|
|
552
|
-
title: "ExperienceEngine Review Warning Nodes",
|
|
553
|
-
description: "Review current warning nodes to assess whether they are still useful or noisy."
|
|
554
|
-
}, async () => ({
|
|
555
|
-
messages: [
|
|
556
|
-
{
|
|
557
|
-
role: "user",
|
|
558
|
-
content: {
|
|
559
|
-
type: "text",
|
|
560
|
-
text: "Review the current ExperienceEngine warning nodes. Identify stale warnings and any warning that appears noisy or over-firing."
|
|
561
|
-
}
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
role: "user",
|
|
565
|
-
content: createJsonResourceLink("experienceengine://nodes/type/warning", "ExperienceEngine Warning Nodes", "All ExperienceEngine nodes currently classified as warning nodes.")
|
|
566
|
-
}
|
|
567
|
-
]
|
|
568
|
-
}));
|
|
569
|
-
server.registerPrompt("experienceengine_pause_current_project", {
|
|
570
|
-
title: "ExperienceEngine Pause Current Project",
|
|
571
|
-
description: "Guide the agent to pause ExperienceEngine interventions for the current project.",
|
|
572
|
-
argsSchema: {
|
|
573
|
-
cwd: z.string().optional()
|
|
574
|
-
}
|
|
575
|
-
}, async ({ cwd }) => ({
|
|
576
|
-
messages: [
|
|
577
|
-
{
|
|
578
|
-
role: "user",
|
|
579
|
-
content: {
|
|
580
|
-
type: "text",
|
|
581
|
-
text: `Pause ExperienceEngine interventions for the current project${cwd ? ` at ${cwd}` : ""}. Confirm first, then call experienceengine_set_scope_intervention_state with action=disable and summarize the changed scope.`
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
]
|
|
585
|
-
}));
|
|
586
|
-
server.registerPrompt("experienceengine_resume_current_project", {
|
|
587
|
-
title: "ExperienceEngine Resume Current Project",
|
|
588
|
-
description: "Guide the agent to resume ExperienceEngine interventions for the current project.",
|
|
589
|
-
argsSchema: {
|
|
590
|
-
cwd: z.string().optional()
|
|
591
|
-
}
|
|
592
|
-
}, async ({ cwd }) => ({
|
|
593
|
-
messages: [
|
|
594
|
-
{
|
|
595
|
-
role: "user",
|
|
596
|
-
content: {
|
|
597
|
-
type: "text",
|
|
598
|
-
text: `Resume ExperienceEngine interventions for the current project${cwd ? ` at ${cwd}` : ""}. Confirm first, then call experienceengine_set_scope_intervention_state with action=enable and summarize the changed scope.`
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
]
|
|
602
|
-
}));
|
|
603
|
-
server.registerPrompt("experienceengine_mark_last_experience_helpful", {
|
|
604
|
-
title: "ExperienceEngine Mark Last Experience Helpful",
|
|
605
|
-
description: "Guide the agent to mark the last injected experience as helpful."
|
|
606
|
-
}, async () => ({
|
|
607
|
-
messages: [
|
|
608
|
-
{
|
|
609
|
-
role: "user",
|
|
610
|
-
content: {
|
|
611
|
-
type: "text",
|
|
612
|
-
text: "Mark the last injected ExperienceEngine guidance as helpful in this Codex session. If needed, confirm first, call experienceengine_feedback_last with feedback=helped, and summarize updated nodes. Use CLI fallback only if the host path is unavailable."
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
]
|
|
616
|
-
}));
|
|
617
|
-
server.registerPrompt("experienceengine_mark_last_experience_harmful", {
|
|
618
|
-
title: "ExperienceEngine Mark Last Experience Harmful",
|
|
619
|
-
description: "Guide the agent to mark the last injected experience as harmful."
|
|
620
|
-
}, async () => ({
|
|
621
|
-
messages: [
|
|
622
|
-
{
|
|
623
|
-
role: "user",
|
|
624
|
-
content: {
|
|
625
|
-
type: "text",
|
|
626
|
-
text: "Mark the last injected ExperienceEngine guidance as harmful in this Codex session. If needed, confirm first, call experienceengine_feedback_last with feedback=harmed, and summarize updated nodes. Use CLI fallback only if the host path is unavailable."
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
]
|
|
630
|
-
}));
|
|
631
|
-
server.registerTool("experienceengine_plan_backup", {
|
|
632
|
-
title: "ExperienceEngine Plan Backup",
|
|
633
|
-
description: "Create a structured plan for backing up ExperienceEngine-managed state."
|
|
634
|
-
}, async () => toStructuredToolResult(stateArtifacts.planOperation({ operation: "backup" })));
|
|
635
|
-
server.registerTool("experienceengine_plan_export", {
|
|
636
|
-
title: "ExperienceEngine Plan Export",
|
|
637
|
-
description: "Create a structured plan for exporting ExperienceEngine-managed state."
|
|
638
|
-
}, async () => toStructuredToolResult(stateArtifacts.planOperation({ operation: "export" })));
|
|
639
|
-
server.registerTool("experienceengine_plan_import", {
|
|
640
|
-
title: "ExperienceEngine Plan Import",
|
|
641
|
-
description: "Create a structured plan for importing an ExperienceEngine snapshot.",
|
|
642
|
-
inputSchema: z.object({
|
|
643
|
-
importPath: z.string().min(1)
|
|
644
|
-
})
|
|
645
|
-
}, async ({ importPath }) => toStructuredToolResult(stateArtifacts.planOperation({ operation: "import", importPath })));
|
|
646
|
-
server.registerTool("experienceengine_plan_rollback", {
|
|
647
|
-
title: "ExperienceEngine Plan Rollback",
|
|
648
|
-
description: "Create a structured plan for rolling back ExperienceEngine state to a managed backup.",
|
|
649
|
-
inputSchema: z.object({
|
|
650
|
-
backupId: z.string().min(1)
|
|
651
|
-
})
|
|
652
|
-
}, async ({ backupId }) => toStructuredToolResult(stateArtifacts.planOperation({ operation: "rollback", backupId })));
|
|
653
|
-
server.registerTool("experienceengine_execute_planned_state_operation", {
|
|
654
|
-
title: "ExperienceEngine Execute Planned State Operation",
|
|
655
|
-
description: "Execute a previously planned ExperienceEngine backup, export, import, or rollback after explicit confirmation.",
|
|
656
|
-
inputSchema: z.object({
|
|
657
|
-
planId: z.string().min(1),
|
|
658
|
-
confirmationToken: z.string().min(1)
|
|
659
|
-
})
|
|
660
|
-
}, async ({ planId, confirmationToken }) => toStructuredToolResult(stateArtifacts.executePlannedOperation({ planId, confirmationToken })));
|
|
661
|
-
server.registerTool("experienceengine_plan_install", {
|
|
662
|
-
title: "ExperienceEngine Plan Install",
|
|
663
|
-
description: "Create a structured plan for installing ExperienceEngine on a supported adapter.",
|
|
664
|
-
inputSchema: z.object({
|
|
665
|
-
adapter: z.enum(EXPERIENCE_ADAPTERS)
|
|
666
|
-
})
|
|
667
|
-
}, async ({ adapter }) => toStructuredToolResult(operationalActions.planOperation({ adapter, operation: "install" })));
|
|
668
|
-
server.registerTool("experienceengine_plan_repair", {
|
|
669
|
-
title: "ExperienceEngine Plan Repair",
|
|
670
|
-
description: "Create a structured plan for repairing ExperienceEngine wiring on a supported adapter.",
|
|
671
|
-
inputSchema: z.object({
|
|
672
|
-
adapter: z.enum(EXPERIENCE_ADAPTERS)
|
|
673
|
-
})
|
|
674
|
-
}, async ({ adapter }) => toStructuredToolResult(operationalActions.planOperation({ adapter, operation: "repair" })));
|
|
675
|
-
server.registerTool("experienceengine_plan_upgrade", {
|
|
676
|
-
title: "ExperienceEngine Plan Upgrade",
|
|
677
|
-
description: "Create a structured plan for upgrading ExperienceEngine on a supported adapter.",
|
|
678
|
-
inputSchema: z.object({
|
|
679
|
-
adapter: z.enum(EXPERIENCE_ADAPTERS)
|
|
680
|
-
})
|
|
681
|
-
}, async ({ adapter }) => toStructuredToolResult(operationalActions.planOperation({ adapter, operation: "upgrade" })));
|
|
682
|
-
server.registerTool("experienceengine_execute_planned_operation", {
|
|
683
|
-
title: "ExperienceEngine Execute Planned Operation",
|
|
684
|
-
description: "Execute a previously planned high-impact ExperienceEngine operation after explicit user confirmation.",
|
|
685
|
-
inputSchema: z.object({
|
|
686
|
-
planId: z.string().min(1),
|
|
687
|
-
confirmationToken: z.string().min(1)
|
|
688
|
-
})
|
|
689
|
-
}, async ({ planId, confirmationToken }) => toStructuredToolResult(operationalActions.executePlannedOperation({ planId, confirmationToken })));
|
|
401
|
+
server.registerTool("experienceengine_list_actions", {
|
|
402
|
+
title: "ExperienceEngine List Actions",
|
|
403
|
+
description: "List brokered EE long-tail actions without exposing full schemas.",
|
|
404
|
+
inputSchema: listCodexActionsSchema
|
|
405
|
+
}, async (args) => toStructuredToolResult(brokerFacade.listActions(args)));
|
|
406
|
+
server.registerTool("experienceengine_prepare_action", {
|
|
407
|
+
title: "ExperienceEngine Prepare Action",
|
|
408
|
+
description: "Read detailed metadata for one brokered EE action.",
|
|
409
|
+
inputSchema: prepareCodexActionSchema
|
|
410
|
+
}, async (args) => toStructuredToolResult(brokerFacade.prepareAction(args)));
|
|
411
|
+
server.registerTool("experienceengine_execute_action", {
|
|
412
|
+
title: "ExperienceEngine Execute Action",
|
|
413
|
+
description: "Execute one brokered EE action through the internal action registry.",
|
|
414
|
+
inputSchema: executeCodexActionSchema
|
|
415
|
+
}, async (args) => toStructuredToolResult(await brokerFacade.executeAction(args)));
|
|
690
416
|
server.registerTool("experienceengine_doctor", {
|
|
691
417
|
title: "ExperienceEngine Doctor",
|
|
692
418
|
description: "Inspect structured ExperienceEngine adapter health and installation state.",
|
|
@@ -698,26 +424,27 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
698
424
|
openWorldHint: false
|
|
699
425
|
}
|
|
700
426
|
}, async ({ adapter }) => toTextToolResult(await operationalSurface.inspectDoctor(adapter)));
|
|
701
|
-
server.registerTool("experienceengine_check_update", {
|
|
702
|
-
title: "ExperienceEngine Check Update",
|
|
703
|
-
description: "Check structured ExperienceEngine release/update state for an adapter context.",
|
|
704
|
-
inputSchema: z.object({
|
|
705
|
-
adapter: z.enum(EXPERIENCE_ADAPTERS)
|
|
706
|
-
}),
|
|
707
|
-
annotations: {
|
|
708
|
-
readOnlyHint: true,
|
|
709
|
-
openWorldHint: true
|
|
710
|
-
}
|
|
711
|
-
}, async ({ adapter }) => toTextToolResult(await operationalSurface.checkUpdate(adapter)));
|
|
712
427
|
server.registerTool("experienceengine_get_capabilities", {
|
|
713
428
|
title: "ExperienceEngine Capabilities",
|
|
714
|
-
description: "Read the current ExperienceEngine MCP capabilities, including direct tools,
|
|
429
|
+
description: "Read the current ExperienceEngine MCP capabilities, including direct tools, routine reads, brokered actions, and CLI-only fallbacks.",
|
|
715
430
|
inputSchema: z.object({}),
|
|
716
431
|
annotations: {
|
|
717
432
|
readOnlyHint: true,
|
|
718
433
|
openWorldHint: false
|
|
719
434
|
}
|
|
720
435
|
}, async () => toStructuredToolResult(buildExperienceCapabilities()));
|
|
436
|
+
server.registerTool("experienceengine_explain_last_decision", {
|
|
437
|
+
title: "ExperienceEngine Explain Last Decision",
|
|
438
|
+
description: "Explain why the latest ExperienceEngine intervention matched or stayed quiet for the current workspace.",
|
|
439
|
+
inputSchema: z.object({
|
|
440
|
+
cwd: z.string().optional(),
|
|
441
|
+
userMessage: z.string().min(1)
|
|
442
|
+
}),
|
|
443
|
+
annotations: {
|
|
444
|
+
readOnlyHint: true,
|
|
445
|
+
openWorldHint: false
|
|
446
|
+
}
|
|
447
|
+
}, async ({ cwd, userMessage }) => toTextToolResult(await interactionSurface.explainLastDecision({ cwd, userMessage })));
|
|
721
448
|
server.registerTool("experienceengine_lookup_hints", {
|
|
722
449
|
title: "ExperienceEngine Lookup Hints",
|
|
723
450
|
description: "Use once at task start for a real coding or debugging task to check whether ExperienceEngine has relevant prior guidance.",
|
|
@@ -726,7 +453,7 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
726
453
|
prompt: z.string().min(1),
|
|
727
454
|
sessionId: z.string().optional()
|
|
728
455
|
})
|
|
729
|
-
}, async ({ cwd, prompt, sessionId }) =>
|
|
456
|
+
}, async ({ cwd, prompt, sessionId }) => toNoticeAwareToolResult(await behaviorLoop.lookupHints({ cwd, prompt, sessionId })));
|
|
730
457
|
server.registerTool("experienceengine_record_tool_result", {
|
|
731
458
|
title: "ExperienceEngine Record Tool Result",
|
|
732
459
|
description: "Record only important tool outcomes that changed the task direction, especially notable shell, test, build, or edit results, before finalization.",
|
|
@@ -764,53 +491,6 @@ export const createCodexMcpServer = (options = {}) => {
|
|
|
764
491
|
nodeId: z.string().optional()
|
|
765
492
|
})
|
|
766
493
|
}, async ({ feedback }) => toStructuredToolResult(await interactionSurface.feedbackLast({ feedback })));
|
|
767
|
-
server.registerTool("experienceengine_feedback_node", {
|
|
768
|
-
title: "ExperienceEngine Feedback Node",
|
|
769
|
-
description: "Record helped or harmed feedback for a specific ExperienceEngine node.",
|
|
770
|
-
inputSchema: z.object({
|
|
771
|
-
nodeId: z.string().min(1),
|
|
772
|
-
feedback: z.enum(["helped", "harmed"])
|
|
773
|
-
}),
|
|
774
|
-
outputSchema: z.object({
|
|
775
|
-
status: z.enum(["updated", "not_found"]),
|
|
776
|
-
feedback: z.enum(["helped", "harmed"]).optional(),
|
|
777
|
-
nodeIds: z.array(z.string()).optional(),
|
|
778
|
-
reason: z.enum(["last_injected_missing", "node_missing"]).optional(),
|
|
779
|
-
nodeId: z.string().optional()
|
|
780
|
-
})
|
|
781
|
-
}, async ({ nodeId, feedback }) => toStructuredToolResult(await interactionSurface.feedbackNode({ nodeId, feedback })));
|
|
782
|
-
server.registerTool("experienceengine_set_scope_intervention_state", {
|
|
783
|
-
title: "ExperienceEngine Set Scope Intervention State",
|
|
784
|
-
description: "Enable or disable ExperienceEngine interventions for the provided working directory scope.",
|
|
785
|
-
inputSchema: z.object({
|
|
786
|
-
action: z.enum(["enable", "disable"]),
|
|
787
|
-
cwd: z.string().optional()
|
|
788
|
-
}),
|
|
789
|
-
outputSchema: z.object({
|
|
790
|
-
scopeId: z.string(),
|
|
791
|
-
scopeName: z.string(),
|
|
792
|
-
rootPath: z.string().optional(),
|
|
793
|
-
isDisabled: z.boolean(),
|
|
794
|
-
changed: z.boolean()
|
|
795
|
-
})
|
|
796
|
-
}, async ({ action, cwd }) => toStructuredToolResult(action === "disable"
|
|
797
|
-
? await interactionSurface.disableScope({ cwd })
|
|
798
|
-
: await interactionSurface.enableScope({ cwd })));
|
|
799
|
-
server.registerTool("experienceengine_set_node_lifecycle", {
|
|
800
|
-
title: "ExperienceEngine Set Node Lifecycle",
|
|
801
|
-
description: "Move a specific ExperienceEngine node into cooling or retired lifecycle state.",
|
|
802
|
-
inputSchema: z.object({
|
|
803
|
-
action: z.enum(["cool", "retire"]),
|
|
804
|
-
nodeId: z.string().min(1)
|
|
805
|
-
}),
|
|
806
|
-
outputSchema: z.object({
|
|
807
|
-
status: z.enum(["updated", "not_found"]),
|
|
808
|
-
nodeId: z.string(),
|
|
809
|
-
state: z.enum(["candidate", "priority_candidate", "active", "cooling", "retired"]).optional()
|
|
810
|
-
})
|
|
811
|
-
}, async ({ action, nodeId }) => toStructuredToolResult(action === "cool"
|
|
812
|
-
? await interactionSurface.coolNode({ nodeId })
|
|
813
|
-
: await interactionSurface.retireNode({ nodeId })));
|
|
814
494
|
return server;
|
|
815
495
|
};
|
|
816
496
|
export const runCodexMcpServer = async () => {
|