@alan512/experienceengine 0.2.0 → 0.3.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.
Files changed (182) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.mcp.json +5 -6
  3. package/README.md +65 -54
  4. package/README.zh-CN.md +64 -53
  5. package/dist/adapters/codex/action-registry.d.ts +23 -1
  6. package/dist/adapters/codex/action-registry.js +73 -0
  7. package/dist/adapters/codex/action-registry.js.map +1 -1
  8. package/dist/adapters/codex/behavior-loop.d.ts +80 -0
  9. package/dist/adapters/codex/behavior-loop.js +189 -0
  10. package/dist/adapters/codex/behavior-loop.js.map +1 -0
  11. package/dist/adapters/codex/mcp-server.d.ts +27 -72
  12. package/dist/adapters/codex/mcp-server.js +36 -160
  13. package/dist/adapters/codex/mcp-server.js.map +1 -1
  14. package/dist/cli/commands/claude-hook.d.ts +4 -0
  15. package/dist/cli/commands/claude-hook.js +105 -21
  16. package/dist/cli/commands/claude-hook.js.map +1 -1
  17. package/dist/cli/commands/codex-hook.d.ts +22 -0
  18. package/dist/cli/commands/codex-hook.js +298 -0
  19. package/dist/cli/commands/codex-hook.js.map +1 -0
  20. package/dist/cli/commands/config.js +9 -1
  21. package/dist/cli/commands/config.js.map +1 -1
  22. package/dist/cli/commands/doctor.js +77 -2
  23. package/dist/cli/commands/doctor.js.map +1 -1
  24. package/dist/cli/commands/inspect.d.ts +1 -1
  25. package/dist/cli/commands/inspect.js +329 -4
  26. package/dist/cli/commands/inspect.js.map +1 -1
  27. package/dist/cli/commands/install.js +2 -0
  28. package/dist/cli/commands/install.js.map +1 -1
  29. package/dist/cli/commands/maintenance.js +4 -0
  30. package/dist/cli/commands/maintenance.js.map +1 -1
  31. package/dist/cli/commands/repair.js +33 -3
  32. package/dist/cli/commands/repair.js.map +1 -1
  33. package/dist/cli/commands/status.js +33 -0
  34. package/dist/cli/commands/status.js.map +1 -1
  35. package/dist/cli/dispatch.js +8 -3
  36. package/dist/cli/dispatch.js.map +1 -1
  37. package/dist/cli/index.js +0 -0
  38. package/dist/config/config-schema.d.ts +8 -0
  39. package/dist/config/config-schema.js +6 -0
  40. package/dist/config/config-schema.js.map +1 -1
  41. package/dist/config/default-config.js +1 -0
  42. package/dist/config/default-config.js.map +1 -1
  43. package/dist/config/load-config.js +3 -0
  44. package/dist/config/load-config.js.map +1 -1
  45. package/dist/controller/candidate-retriever.d.ts +5 -1
  46. package/dist/controller/candidate-retriever.js +237 -13
  47. package/dist/controller/candidate-retriever.js.map +1 -1
  48. package/dist/controller/injection-renderer.d.ts +2 -2
  49. package/dist/controller/injection-renderer.js +22 -3
  50. package/dist/controller/injection-renderer.js.map +1 -1
  51. package/dist/controller/injection-scorecard.js +3 -0
  52. package/dist/controller/injection-scorecard.js.map +1 -1
  53. package/dist/controller/intervention-controller.d.ts +2 -2
  54. package/dist/controller/intervention-controller.js +185 -25
  55. package/dist/controller/intervention-controller.js.map +1 -1
  56. package/dist/controller/model-reranker-mode.d.ts +4 -0
  57. package/dist/controller/model-reranker-mode.js +14 -0
  58. package/dist/controller/model-reranker-mode.js.map +1 -0
  59. package/dist/controller/model-reranker.d.ts +0 -1
  60. package/dist/controller/model-reranker.js +1 -13
  61. package/dist/controller/model-reranker.js.map +1 -1
  62. package/dist/controller/policy-enricher.d.ts +2 -1
  63. package/dist/controller/policy-enricher.js +71 -11
  64. package/dist/controller/policy-enricher.js.map +1 -1
  65. package/dist/controller/trigger-evaluator.d.ts +2 -1
  66. package/dist/controller/trigger-evaluator.js +24 -0
  67. package/dist/controller/trigger-evaluator.js.map +1 -1
  68. package/dist/evaluation/openclaw-scenarios.js +12 -5
  69. package/dist/evaluation/openclaw-scenarios.js.map +1 -1
  70. package/dist/experience-management/repo-policy.d.ts +53 -0
  71. package/dist/experience-management/repo-policy.js +175 -0
  72. package/dist/experience-management/repo-policy.js.map +1 -0
  73. package/dist/hybrid/capsule-builder.js +2 -0
  74. package/dist/hybrid/capsule-builder.js.map +1 -1
  75. package/dist/input/scope-resolver.js +16 -4
  76. package/dist/input/scope-resolver.js.map +1 -1
  77. package/dist/install/claude-cli.js +38 -21
  78. package/dist/install/claude-cli.js.map +1 -1
  79. package/dist/install/claude-code-doctor.js +8 -3
  80. package/dist/install/claude-code-doctor.js.map +1 -1
  81. package/dist/install/claude-code-installer.js +5 -2
  82. package/dist/install/claude-code-installer.js.map +1 -1
  83. package/dist/install/claude-runtime-target.d.ts +5 -0
  84. package/dist/install/claude-runtime-target.js +32 -2
  85. package/dist/install/claude-runtime-target.js.map +1 -1
  86. package/dist/install/codex-cli.d.ts +7 -0
  87. package/dist/install/codex-cli.js +43 -20
  88. package/dist/install/codex-cli.js.map +1 -1
  89. package/dist/install/codex-hooks.d.ts +42 -0
  90. package/dist/install/codex-hooks.js +258 -0
  91. package/dist/install/codex-hooks.js.map +1 -0
  92. package/dist/install/codex-installer.d.ts +28 -3
  93. package/dist/install/codex-installer.js +120 -9
  94. package/dist/install/codex-installer.js.map +1 -1
  95. package/dist/install/codex-runtime-target.d.ts +20 -0
  96. package/dist/install/codex-runtime-target.js +85 -17
  97. package/dist/install/codex-runtime-target.js.map +1 -1
  98. package/dist/install/openclaw-cli.d.ts +1 -0
  99. package/dist/install/openclaw-cli.js +52 -3
  100. package/dist/install/openclaw-cli.js.map +1 -1
  101. package/dist/install/openclaw-installer.d.ts +5 -0
  102. package/dist/install/openclaw-installer.js +24 -5
  103. package/dist/install/openclaw-installer.js.map +1 -1
  104. package/dist/interaction/repo-summary.d.ts +17 -0
  105. package/dist/interaction/repo-summary.js +33 -15
  106. package/dist/interaction/repo-summary.js.map +1 -1
  107. package/dist/interaction/retrieval-policy-inspection.d.ts +19 -0
  108. package/dist/interaction/retrieval-policy-inspection.js +33 -0
  109. package/dist/interaction/retrieval-policy-inspection.js.map +1 -0
  110. package/dist/interaction/service.d.ts +24 -1
  111. package/dist/interaction/service.js +186 -23
  112. package/dist/interaction/service.js.map +1 -1
  113. package/dist/maintenance/claude-validate-print.d.ts +8 -1
  114. package/dist/maintenance/claude-validate-print.js +52 -2
  115. package/dist/maintenance/claude-validate-print.js.map +1 -1
  116. package/dist/maintenance/experience-export-drafts.d.ts +56 -0
  117. package/dist/maintenance/experience-export-drafts.js +217 -0
  118. package/dist/maintenance/experience-export-drafts.js.map +1 -0
  119. package/dist/maintenance/experience-hygiene.d.ts +38 -0
  120. package/dist/maintenance/experience-hygiene.js +266 -0
  121. package/dist/maintenance/experience-hygiene.js.map +1 -0
  122. package/dist/maintenance/operator-review-flow.d.ts +81 -0
  123. package/dist/maintenance/operator-review-flow.js +172 -0
  124. package/dist/maintenance/operator-review-flow.js.map +1 -0
  125. package/dist/plugin/openclaw-plugin.d.ts +5 -0
  126. package/dist/plugin/runtime-helpers.js +43 -1
  127. package/dist/plugin/runtime-helpers.js.map +1 -1
  128. package/dist/runtime/prompt-service.d.ts +51 -0
  129. package/dist/runtime/prompt-service.js +209 -0
  130. package/dist/runtime/prompt-service.js.map +1 -0
  131. package/dist/runtime/service.d.ts +8 -2
  132. package/dist/runtime/service.js +234 -44
  133. package/dist/runtime/service.js.map +1 -1
  134. package/dist/store/sqlite/db.js +15 -0
  135. package/dist/store/sqlite/db.js.map +1 -1
  136. package/dist/store/sqlite/repositories/attribution-record-repo.d.ts +15 -0
  137. package/dist/store/sqlite/repositories/attribution-record-repo.js +111 -0
  138. package/dist/store/sqlite/repositories/attribution-record-repo.js.map +1 -0
  139. package/dist/store/sqlite/repositories/episode-repo.d.ts +14 -0
  140. package/dist/store/sqlite/repositories/episode-repo.js +84 -0
  141. package/dist/store/sqlite/repositories/episode-repo.js.map +1 -0
  142. package/dist/store/sqlite/repositories/injection-repo.d.ts +2 -0
  143. package/dist/store/sqlite/repositories/injection-repo.js +32 -5
  144. package/dist/store/sqlite/repositories/injection-repo.js.map +1 -1
  145. package/dist/store/sqlite/repositories/input-record-repo.d.ts +1 -0
  146. package/dist/store/sqlite/repositories/input-record-repo.js +23 -10
  147. package/dist/store/sqlite/repositories/input-record-repo.js.map +1 -1
  148. package/dist/store/sqlite/repositories/node-repo.d.ts +2 -0
  149. package/dist/store/sqlite/repositories/node-repo.js +19 -0
  150. package/dist/store/sqlite/repositories/node-repo.js.map +1 -1
  151. package/dist/store/sqlite/repositories/outcome-record-repo.d.ts +1 -0
  152. package/dist/store/sqlite/repositories/outcome-record-repo.js +11 -2
  153. package/dist/store/sqlite/repositories/outcome-record-repo.js.map +1 -1
  154. package/dist/store/sqlite/repositories/repo-policy-repo.d.ts +11 -0
  155. package/dist/store/sqlite/repositories/repo-policy-repo.js +87 -0
  156. package/dist/store/sqlite/repositories/repo-policy-repo.js.map +1 -0
  157. package/dist/store/sqlite/repositories/review-event-repo.d.ts +1 -0
  158. package/dist/store/sqlite/repositories/review-event-repo.js +11 -2
  159. package/dist/store/sqlite/repositories/review-event-repo.js.map +1 -1
  160. package/dist/store/sqlite/repositories/task-run-repo.d.ts +1 -0
  161. package/dist/store/sqlite/repositories/task-run-repo.js +11 -2
  162. package/dist/store/sqlite/repositories/task-run-repo.js.map +1 -1
  163. package/dist/store/sqlite/schema.sql +43 -0
  164. package/dist/store/vector/api-embedding-provider.js +14 -3
  165. package/dist/store/vector/api-embedding-provider.js.map +1 -1
  166. package/dist/store/vector/embeddings.js +7 -1
  167. package/dist/store/vector/embeddings.js.map +1 -1
  168. package/dist/types/domain.d.ts +105 -3
  169. package/dist/utils/text.js +5 -1
  170. package/dist/utils/text.js.map +1 -1
  171. package/docs/assets/readme/inspect-last-example.svg +37 -0
  172. package/docs/releases/v0.2.1.md +30 -0
  173. package/docs/releases/v0.3.0.md +17 -0
  174. package/docs/user-guide.md +91 -5
  175. package/openclaw.plugin.json +1 -1
  176. package/package.json +16 -14
  177. package/plugins/claude-code-experienceengine/.claude-plugin/plugin.json +1 -1
  178. package/plugins/claude-code-experienceengine/.mcp.json +3 -9
  179. package/plugins/claude-code-experienceengine/scripts/install-deps.sh +1 -1
  180. package/plugins/claude-code-experienceengine/scripts/mcp-server.sh +43 -0
  181. package/scripts/claude-plugin/claude-hook.sh +6 -1
  182. package/scripts/claude-plugin/mcp-server.sh +45 -0
@@ -11,13 +11,32 @@ export type ValidationState = "pending_reuse_validation" | "validated_by_reuse"
11
11
  export type CorrectionScope = "task_local" | "repo_local" | "workflow_local" | "host_local" | "cross_repo_candidate";
12
12
  export type CorrectionCategory = "goal_interpretation" | "quality_bar" | "interaction_behavior" | "verification_order" | "implementation_boundary" | "style_constraint";
13
13
  export type InjectionMode = "skip" | "inject_conservative" | "inject";
14
+ export type InterventionStrength = "diagnostic_hint" | "soft_recommendation" | "strong_recommendation" | "hard_constraint";
14
15
  export type InjectionRiskLevel = "low" | "medium" | "high";
16
+ export type MatchBand = "high" | "medium" | "low";
17
+ export type ScopeMatchBand = "same" | "related" | "cross" | "none";
18
+ export type MatchScorecard = {
19
+ scopeMatch: ScopeMatchBand;
20
+ taskTypeMatch: MatchBand;
21
+ techStackMatch: MatchBand;
22
+ failureSignatureMatch: MatchBand;
23
+ artifactMatch: MatchBand;
24
+ intentMatch: MatchBand;
25
+ negativeEvidence: string[];
26
+ overallMatchBand: MatchBand;
27
+ directInjectEligible: boolean;
28
+ };
15
29
  export type InterventionConfidence = "low" | "medium" | "high";
16
30
  export type InterventionBudgetClass = "none" | "single_hint" | "multi_hint";
17
31
  export type SyncSecondOpinionDecision = "allow" | "allow_conservative" | "skip";
18
32
  export type SyncSecondOpinionTrigger = "conservative_delivery_state" | "harm_history" | "close_score_margin" | "expectation_correction";
19
33
  export type EvaluationMode = "live" | "shadow" | "holdout";
20
34
  export type OutcomeSignal = "success" | "failure" | "unknown";
35
+ export type AttributionVerdict = "strong_helped" | "weak_helped" | "neutral" | "unknown" | "weak_harmed" | "strong_harmed";
36
+ export type AttributionConfidence = "low" | "medium" | "high";
37
+ export type AttributionSource = "automatic" | "manual_override" | "diagnostic_record";
38
+ export type RepoExperienceMode = "safe" | "fast_learning" | "strict";
39
+ export type RepoCircuitState = "clear" | "tripped";
21
40
  export type ToolEventStatus = "success" | "failure" | "unknown";
22
41
  export type CandidateLifecycleState = "pending" | "distilled" | "failed" | "discarded";
23
42
  export type DistillationJobState = "pending" | "processing" | "succeeded" | "failed" | "discarded";
@@ -69,8 +88,27 @@ export type RetrievalContext = {
69
88
  modulePaths?: string[];
70
89
  expectationCorrectionIntent?: boolean;
71
90
  };
91
+ export type RetrievalPolicyStageName = "retrieval_context" | "hard_filter" | "shortlist" | "semantic_rerank_backfill" | "policy_enrichment" | "decision_assembly";
92
+ export type RetrievalPolicyStageDiagnostic = {
93
+ stage: RetrievalPolicyStageName;
94
+ acceptedCount?: number;
95
+ rejectedCount?: number;
96
+ passedCount?: number;
97
+ reasonCodes: string[];
98
+ };
99
+ export type RetrievalPolicyDiagnostics = {
100
+ stages: RetrievalPolicyStageDiagnostic[];
101
+ };
102
+ export type PolicyEnrichmentComponentCategory = "family_fit" | "specificity" | "feedback" | "maturity" | "penalty" | "expectation_correction" | "task_alignment" | "retrieval_context";
103
+ export type PolicyEnrichmentComponent = {
104
+ name: string;
105
+ category: PolicyEnrichmentComponentCategory;
106
+ value: number;
107
+ reason: string;
108
+ };
72
109
  export type ExperienceInputRecord = {
73
110
  record_id: string;
111
+ episode_id?: string;
74
112
  scope_id: string;
75
113
  session_id?: string;
76
114
  task_type: ResolvedTaskType;
@@ -83,6 +121,7 @@ export type ExperienceInputRecord = {
83
121
  };
84
122
  export type TaskRun = {
85
123
  id: string;
124
+ episode_id?: string;
86
125
  host: "openclaw" | "claude-code" | "codex";
87
126
  scope_id: string;
88
127
  session_id?: string;
@@ -101,6 +140,7 @@ export type TaskRun = {
101
140
  };
102
141
  export type OutcomeRecord = {
103
142
  id: string;
143
+ episode_id?: string;
104
144
  task_run_id: string;
105
145
  outcome_signal: OutcomeSignal;
106
146
  failure_signature?: string;
@@ -109,9 +149,10 @@ export type OutcomeRecord = {
109
149
  };
110
150
  export type ReviewEvent = {
111
151
  id: string;
152
+ episode_id?: string;
112
153
  node_id: string;
113
154
  task_run_id?: string;
114
- event_type: "mark_helped" | "mark_harmed" | "mark_uncertain" | "cool" | "retire" | "quarantine" | "restore_conservative" | "restore_eligible";
155
+ event_type: "mark_helped" | "mark_harmed" | "mark_uncertain" | "cool" | "retire" | "quarantine" | "restore_conservative" | "restore_eligible" | "promote_eligible";
115
156
  source: "automatic" | "user";
116
157
  created_at: string;
117
158
  };
@@ -208,11 +249,12 @@ export type ExperienceNode = {
208
249
  };
209
250
  export type InjectionEvent = {
210
251
  injection_id: string;
252
+ episode_id?: string;
211
253
  session_id?: string;
212
254
  scope_id: string;
213
255
  task_type: TaskType;
214
256
  task_summary?: string;
215
- mode: Exclude<InjectionMode, "skip">;
257
+ mode: InjectionMode;
216
258
  delivery_mode: EvaluationMode;
217
259
  delivered: boolean;
218
260
  injected_node_ids: string[];
@@ -224,6 +266,58 @@ export type InjectionEvent = {
224
266
  created_at: string;
225
267
  resolved_at?: string;
226
268
  };
269
+ export type AttributionRecord = {
270
+ id: string;
271
+ injection_id?: string;
272
+ node_id: string;
273
+ episode_id?: string;
274
+ intervention_strength?: InterventionStrength;
275
+ injection_mode?: InjectionMode;
276
+ delivery_mode?: EvaluationMode;
277
+ delivered: boolean;
278
+ outcome: OutcomeSignal;
279
+ attribution_verdict: AttributionVerdict;
280
+ confidence: AttributionConfidence;
281
+ evidence_refs: string[];
282
+ user_override?: "helped" | "harmed" | "neutral";
283
+ source: AttributionSource;
284
+ attribution_reason?: FeedbackAttributionReason | "manual_override" | "diagnostic_record";
285
+ created_at: string;
286
+ resolved_at?: string;
287
+ };
288
+ export type RepoPolicy = {
289
+ scope_id: string;
290
+ configured_mode: RepoExperienceMode;
291
+ effective_mode: RepoExperienceMode;
292
+ circuit_state: RepoCircuitState;
293
+ circuit_reason?: string;
294
+ live_diagnostics_disabled: boolean;
295
+ created_at: string;
296
+ updated_at: string;
297
+ last_tripped_at?: string;
298
+ restored_at?: string;
299
+ };
300
+ export type EpisodeProjection = {
301
+ episode_id: string;
302
+ scope_id?: string;
303
+ session_id?: string;
304
+ task_run?: TaskRun;
305
+ input_records: ExperienceInputRecord[];
306
+ outcome_records: OutcomeRecord[];
307
+ injection_events: InjectionEvent[];
308
+ attribution_records: AttributionRecord[];
309
+ review_events: ReviewEvent[];
310
+ };
311
+ export type EpisodeSummary = {
312
+ episode_id: string;
313
+ scope_id: string;
314
+ session_id?: string;
315
+ task_type?: ResolvedTaskType;
316
+ task_summary?: string;
317
+ outcome?: OutcomeSignal;
318
+ created_at: string;
319
+ updated_at: string;
320
+ };
227
321
  export type InjectionScorecardNode = {
228
322
  id: string;
229
323
  nodeType: ExperienceNodeType;
@@ -240,6 +334,7 @@ export type InjectionScorecardNode = {
240
334
  };
241
335
  export type InjectionScorecardCandidate = {
242
336
  id: string;
337
+ matchScorecard?: MatchScorecard;
243
338
  semanticScore?: number;
244
339
  lexicalScore?: number;
245
340
  fusedScore?: number;
@@ -251,6 +346,7 @@ export type InjectionScorecardCandidate = {
251
346
  rerankSource?: "heuristic" | "model";
252
347
  retrievalReasons?: string[];
253
348
  policyReasons?: string[];
349
+ policyComponents?: PolicyEnrichmentComponent[];
254
350
  taskFamilyMatch: boolean;
255
351
  };
256
352
  export type InterventionRejectedCandidate = {
@@ -261,6 +357,9 @@ export type InterventionRejectedCandidate = {
261
357
  totalScore?: number;
262
358
  };
263
359
  export type InterventionDecisionDiagnostics = {
360
+ interventionStrength?: InterventionStrength;
361
+ recordOnlyDiagnosticCandidateIds?: string[];
362
+ retrievalPolicyDiagnostics?: RetrievalPolicyDiagnostics;
264
363
  topCandidates: InjectionScorecardCandidate[];
265
364
  topCandidateScore?: number;
266
365
  scoreMargin?: number;
@@ -286,7 +385,8 @@ export type InjectionScorecard = {
286
385
  scopeId: string;
287
386
  taskType: TaskType;
288
387
  taskSummary: string;
289
- mode: Exclude<InjectionMode, "skip">;
388
+ mode: InjectionMode;
389
+ interventionStrength?: InterventionStrength;
290
390
  riskLevel: InjectionRiskLevel;
291
391
  recommendation: string;
292
392
  reasons: string[];
@@ -308,6 +408,8 @@ export type InjectionScorecard = {
308
408
  secondOpinionReason?: string;
309
409
  secondOpinionTrigger?: SyncSecondOpinionTrigger;
310
410
  selectedCandidateIds?: string[];
411
+ recordOnlyDiagnosticCandidateIds?: string[];
412
+ retrievalPolicyDiagnostics?: RetrievalPolicyDiagnostics;
311
413
  rejectedCandidates?: InterventionRejectedCandidate[];
312
414
  nodes: InjectionScorecardNode[];
313
415
  createdAt: string;
@@ -13,7 +13,11 @@ export const tokenize = (value) => normalizeWhitespace(value)
13
13
  .filter(Boolean);
14
14
  const EXPERIENCE_INJECTION_HEADINGS = [
15
15
  "Execution hints from prior similar tasks:",
16
- "Conservative execution hints:"
16
+ "Conservative execution hints:",
17
+ "Diagnostic lead from prior experience:",
18
+ "Relevant prior experience:",
19
+ "Validated prior experience:",
20
+ "Project constraint or explicit instruction:"
17
21
  ];
18
22
  export const stripLeadingExperienceInjection = (value) => {
19
23
  let next = value.trimStart();
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/utils/text.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,GAAG,GAAG,GAAG,EAAU,EAAE,CAC3D,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEhG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE;IAClD,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OA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AAC;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAa,EAAU,EAAE,CAClE,mBAAmB,CACjB,KAAK,CAAC,OAAO,CACX,4DAA4D,EAC5D,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CACrF,CACF,CAAC"}
@@ -0,0 +1,37 @@
1
+ <svg width="1200" height="920" viewBox="0 0 1200 920" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="1200" height="920" rx="20" fill="#0B1020"/>
3
+ <rect x="24" y="24" width="1152" height="64" rx="14" fill="#131A2E"/>
4
+ <circle cx="60" cy="56" r="9" fill="#FF5F57"/>
5
+ <circle cx="88" cy="56" r="9" fill="#FEBB2E"/>
6
+ <circle cx="116" cy="56" r="9" fill="#28C840"/>
7
+ <text x="600" y="62" text-anchor="middle" fill="#DDE7FF" font-family="DejaVu Sans Mono, monospace" font-size="24">ee inspect --last --verbose</text>
8
+
9
+ <rect x="24" y="104" width="1152" height="792" rx="14" fill="#0F172A"/>
10
+
11
+ <g font-family="DejaVu Sans Mono, monospace" font-size="24">
12
+ <text x="48" y="152" fill="#93C5FD">$ ee inspect --last --verbose</text>
13
+
14
+ <text x="48" y="198" fill="#E5E7EB">Session: session_last</text>
15
+ <text x="48" y="232" fill="#E5E7EB">Scope: scope_current_repo</text>
16
+ <text x="48" y="266" fill="#E5E7EB">Task type: test_debug</text>
17
+ <text x="48" y="300" fill="#E5E7EB">Intervention: inject</text>
18
+ <text x="48" y="334" fill="#E5E7EB">Delivery style: normal hint delivery</text>
19
+ <text x="48" y="368" fill="#E5E7EB">Automatic feedback: helped</text>
20
+
21
+ <text x="48" y="426" fill="#A7F3D0">Injected nodes:</text>
22
+ <text x="72" y="460" fill="#E5E7EB">- node_inspect strategy active system_derived</text>
23
+ <text x="96" y="494" fill="#E5E7EB">Trigger: Fix the failing auth test</text>
24
+ <text x="96" y="528" fill="#E5E7EB">Quality: strong</text>
25
+ <text x="96" y="562" fill="#E5E7EB">Best fit: test_debug tasks in this repo scope</text>
26
+
27
+ <text x="48" y="620" fill="#FDE68A">Scorecard:</text>
28
+ <text x="72" y="654" fill="#E5E7EB">- Risk: low</text>
29
+ <text x="72" y="688" fill="#E5E7EB">- Recommendation: Apply these hints, then mark helped or harmed.</text>
30
+ <text x="72" y="722" fill="#E5E7EB">- Why ExperienceEngine acted: best reusable guidance for this task.</text>
31
+ <text x="72" y="756" fill="#E5E7EB">- Trust summary: low-risk active guidance with helped signals.</text>
32
+
33
+ <text x="48" y="814" fill="#67E8F9">Hints:</text>
34
+ <text x="72" y="848" fill="#E5E7EB">- Run the failing auth test before editing and verify after the fix.</text>
35
+ <text x="48" y="882" fill="#C4B5FD">Outcome: success</text>
36
+ </g>
37
+ </svg>
@@ -0,0 +1,30 @@
1
+ # ExperienceEngine v0.2.1
2
+
3
+ Release date: 2026-05-02
4
+
5
+ ## Summary
6
+
7
+ This development slice tightens Codex-era live-delivery quality after reviewing recent local ExperienceEngine usage.
8
+
9
+ ## Included
10
+
11
+ - skipped delivery decisions are now persisted, so the latest turn can be explained even when no hint was injected
12
+ - retrieval candidates now carry deterministic match scorecards before live delivery
13
+ - high-trust, high-match same-scope experience can inject directly
14
+ - high-match same-scope conservative experience can promote to normal eligible delivery after successful reuse
15
+ - cross-scope reuse is available only through conservative candidates, not direct injection
16
+ - `ee status` and `ee doctor codex` now report whether the `ee` CLI fallback is available on `PATH`
17
+ - Codex managed setup now targets Codex-native hooks plus MCP: `codex_hooks` is enabled, ExperienceEngine-owned Codex hook entries are installed, and stale `experienceengine-claude-hook` drift can be repaired safely.
18
+ - Codex project hooks now support the practical Windows Codex App + WSL Codex CLI split: repo hooks are shared through `.codex/hooks.json`, while MCP registration stays owned by each runtime's Codex home.
19
+ - Codex hook runtime is leaner on the prompt path: prompt-time lookup uses a light runtime, full runtime/provider loading is deferred, and `PostToolUse` / `Stop` are queued for background processing.
20
+ - Codex hook launchers use a fast path for hook execution so missing local embedding fallback dependencies do not block normal host interaction.
21
+ - Source-repo host validation now covers Windows Codex App, WSL Codex CLI, Claude Code, and WSL OpenClaw writing to the same project scope.
22
+ - OpenClaw prompt payloads now resolve the real project root from explicit host fields or nearby repo markers before scope selection; unresolved global OpenClaw workspace payloads are session-isolated instead of being reused as a broad project scope.
23
+
24
+ ## Notes
25
+
26
+ - LLM usage remains in the existing places: posttask distillation and selective second-opinion review.
27
+ - The new routing layer is deterministic and is intended to reduce both over-conservative same-scope skips and harmful broad reuse.
28
+ - `UserPromptSubmit` remains intentionally synchronous because it owns live injection. The async queue applies to follow-up capture and finalize hooks.
29
+ - Host validation statements in this release note refer to source-repo validation, not published npm package or host marketplace validation.
30
+ - OpenClaw validation used the OpenClaw-compatible `openrouter/tencent/hy3-preview:free` model id. The bare `tencent/hy3-preview:free` id matched the Claude Code spelling but is marked missing by OpenClaw's model registry.
@@ -0,0 +1,17 @@
1
+ # ExperienceEngine v0.3.0
2
+
3
+ v0.3.0 focuses on making the same project-level EE experience state usable across the current host set without leaking host-specific installation details into the published package.
4
+
5
+ ## Highlights
6
+
7
+ - Added cross-runtime Codex hook launchers so a shared project can work from both Windows Codex App and WSL Codex CLI while writing to the same configured EE home.
8
+ - Added cross-runtime Claude Code hook launchers and plugin MCP startup flow so marketplace installs no longer depend on local source-repo paths.
9
+ - Improved Claude Code validation by checking both the Claude print transcript and the underlying EE MCP server tool list.
10
+ - Improved OpenClaw repair diagnostics so a loaded, matching host-native plugin is not reported as needing restart.
11
+ - Kept Codex `PreToolUse` disabled by default; Codex live injection remains on `UserPromptSubmit`, with `PostToolUse` and `Stop` used for learning and finalization.
12
+
13
+ ## Upgrade Notes
14
+
15
+ - New npm users should install with `npm install -g @alan512/experienceengine@0.3.0`, then run `ee install <host>` or `ee upgrade <host>` for the hosts they use.
16
+ - Existing users should run `ee upgrade codex`, `ee upgrade claude-code`, or `ee upgrade openclaw` after updating the npm package so host wiring is regenerated with the current launchers.
17
+ - Mixed Windows App and WSL CLI Codex use should keep `EXPERIENCE_ENGINE_HOME` pointed at the same shared EE data directory if the user wants both hosts to share one project experience store.
@@ -59,10 +59,12 @@ When it injects guidance, you will usually see a lightweight notice like:
59
59
  [ExperienceEngine] Injected 1 strategy hint for this task.
60
60
  ```
61
61
 
62
- If there is no intervention, it stays silent.
62
+ If there is no intervention, it stays silent during the task. The delivery decision is still recorded, so `ee inspect --last` and host-side inspection can explain whether ExperienceEngine skipped because the match was weak, the node was not safe to ship yet, or the decision stayed in a conservative path.
63
63
 
64
64
  When ExperienceEngine is less certain but still sees a credible same-family match, it may choose a conservative injection instead of skipping entirely. In that case the injected block stays smaller by default, but mature low-risk nodes can still include a short `Goal / Steps / Avoid` structure when that makes the guidance more actionable.
65
65
 
66
+ ExperienceEngine now uses a deterministic match scorecard before live delivery. Same-repo, high-match experience can ship directly when trust is already strong. Same-repo conservative experience can be promoted after a successful high-match reuse. Cross-repo matches are allowed only as conservative candidates unless later evidence proves they are safe in the new scope.
67
+
66
68
  When you inspect the latest turn, you may also see a learning decision such as:
67
69
 
68
70
  ```text
@@ -105,7 +107,8 @@ Install ExperienceEngine through the host setup flow for:
105
107
  - `ee install codex`
106
108
  - native/manual fallback:
107
109
  - `codex mcp add experienceengine --env EXPERIENCE_ENGINE_HOME=$HOME/.experienceengine -- npx -y @alan512/experienceengine codex-mcp-server`
108
- - after either path, start a new Codex session in this repo so the MCP wiring and `AGENTS.md` instruction block are picked up
110
+ - after the managed path, start a new Codex session in this repo so Codex-native hooks, MCP wiring, and the `AGENTS.md` instruction block are picked up
111
+ - the manual MCP fallback only installs the tool surface; use `ee install codex` or `ee repair codex` when hook lifecycle capture/injection is needed
109
112
  - `Claude Code`
110
113
  - host-native marketplace install:
111
114
  - add the bundled marketplace from GitHub:
@@ -155,6 +158,8 @@ ee status
155
158
 
156
159
  Use `ee init` once to initialize ExperienceEngine's shared distillation, embedding, and secret state. New host installations should reuse that same shared EE state instead of asking you to re-enter the same API key per host window.
157
160
 
161
+ For Codex, `ee status` and `ee doctor codex` also show whether the `ee` CLI fallback is available on `PATH`. Codex MCP wiring can still be healthy without that fallback, but explicit operator commands such as `ee inspect --last` need either a PATH-visible `ee` binary or an explicit package invocation.
162
+
158
163
  In practical terms, the routine loop currently looks like this:
159
164
 
160
165
  - `Codex`
@@ -249,6 +254,53 @@ When you inspect a specific node, ExperienceEngine now also shows a lightweight
249
254
  - the short drivers behind that judgment
250
255
  - a compact applicability profile covering best fit, scope validity, confidence, risk, and when to avoid reuse
251
256
 
257
+ ### Operator Review Workflow
258
+
259
+ Use the operator review workflow when you want one read-only checkpoint across the current repo before deciding what to inspect next.
260
+
261
+ The fallback CLI entry point is:
262
+
263
+ ```bash
264
+ ee inspect review
265
+ ```
266
+
267
+ For a specific workspace and a smaller checklist:
268
+
269
+ ```bash
270
+ ee inspect review --cwd /path/to/repo --limit 3
271
+ ```
272
+
273
+ The review report summarizes:
274
+
275
+ - repo policy health and circuit state
276
+ - hygiene finding counts
277
+ - export draft counts
278
+ - recommended review order
279
+ - prioritized review items
280
+ - review-only next actions
281
+ - drill-down commands for detailed read-only reports
282
+
283
+ The drill-down commands are manual inspection steps:
284
+
285
+ ```bash
286
+ ee inspect repo
287
+ ee inspect hygiene
288
+ ee inspect export-drafts
289
+ ```
290
+
291
+ In MCP-capable hosts, ask the host agent to inspect the ExperienceEngine operator review or read `experienceengine://review`. The structured payload uses the same source names as the CLI: `repo_policy`, `hygiene`, and `export_drafts`.
292
+
293
+ This workflow is intentionally read-only. It does not:
294
+
295
+ - restore repo policy
296
+ - cool or retire nodes
297
+ - write attribution or review events
298
+ - create backups or snapshots
299
+ - write instruction files, skills, or docs
300
+ - export guidance automatically
301
+ - open a console or mutation dashboard
302
+ - coordinate team workflows
303
+
252
304
  ## How MCP Interaction Works
253
305
 
254
306
  For `Codex` and `Claude Code`, ExperienceEngine is designed to keep routine review and management inside the host session first.
@@ -518,10 +570,12 @@ ee install codex
518
570
  What happens:
519
571
  - ExperienceEngine registers its shared MCP server with Codex
520
572
  - new Codex MCP sessions can use ExperienceEngine interaction surfaces
573
+ - ExperienceEngine writes Codex-native project hooks and enables `codex_hooks`
521
574
  - install ends with a short cold-start note so users know capture is active before the first formal hint appears
522
575
 
523
576
  Local state changes:
524
- - Codex MCP config in `~/.codex/config.toml`
577
+ - project hook config in `.codex/hooks.json`
578
+ - Codex MCP config in the active runtime's `~/.codex/config.toml`
525
579
  - ExperienceEngine-managed product state under `~/.experienceengine`
526
580
 
527
581
  Useful commands:
@@ -544,12 +598,19 @@ codex mcp get experienceengine
544
598
  Success looks like:
545
599
  - doctor reports the adapter as installed
546
600
  - `codex mcp get experienceengine` shows the server as enabled
601
+ - doctor reports Codex hooks as healthy and `codex_hooks` as enabled
547
602
  - a new `codex exec` session can call ExperienceEngine MCP resources or tools
548
603
 
549
604
  Host note:
550
605
  - ExperienceEngine installs a longer `startup_timeout_sec` for Codex automatically
551
606
  - this avoids MCP handshake failures on slower local startups
552
- - if Codex still cannot see ExperienceEngine in new sessions, re-run `ee install codex`
607
+ - ExperienceEngine installs Codex-native hooks for prompt-time guidance, tool-result capture, and stop/finalize writeback
608
+ - `UserPromptSubmit` is synchronous because it decides prompt-time injection
609
+ - `PostToolUse` and `Stop` are queued for background processing by default
610
+ - `PreToolUse` is not registered by default; set `EXPERIENCE_ENGINE_CODEX_PRETOOL_HOOK_ENABLED=1` only for synchronous gating experiments
611
+ - in a Windows Codex App + WSL Codex CLI repo, `.codex/hooks.json` is shared project hook wiring, while MCP config is owned by each runtime's Codex home
612
+ - `ee repair codex` refreshes project hooks and removes stale project-scoped ExperienceEngine MCP config
613
+ - if Codex still cannot see ExperienceEngine or doctor reports hook drift, run `ee repair codex`
553
614
  - `ee codex exec` is a deterministic wrapper for non-interactive runs
554
615
  - the wrapper owns `lookup -> child codex exec -> record -> finalize` outside the child process
555
616
  - for wrapped runs, ExperienceEngine removes the nested `experienceengine` MCP server from the child Codex config temporarily so lifecycle evidence is not double-written
@@ -557,6 +618,27 @@ Host note:
557
618
  - use `--ee-session-id <id>` when CI or debugging needs a stable ExperienceEngine session id
558
619
  - `codex exec review` is not wrapped yet; keep using native Codex review or the MCP/CLI surfaces for review workflows
559
620
 
621
+ Diagnostics note:
622
+ - `ee doctor codex` separates project hook health, `codex_hooks` enablement, MCP registration, and PATH-visible `ee` CLI fallback
623
+ - Windows Codex App can have healthy project hooks even when a Windows `codex` CLI is not installed
624
+ - WSL Codex CLI must have its own MCP registration in the WSL Codex home; it can still reuse the same repo `.codex/hooks.json`
625
+ - on WSL, `ee doctor codex` also warns when `codex` resolves to a WindowsApps shim instead of the Linux Codex CLI
626
+
627
+ Developer source-repo host validation lives at:
628
+
629
+ - [docs/development/source-repo-host-validation.md](development/source-repo-host-validation.md)
630
+
631
+ Source-repo host validation matrix:
632
+
633
+ | Host path | Source-repo validation status | Notes |
634
+ | --- | --- | --- |
635
+ | Windows Codex App | Validated | Project hooks are healthy, default events are `UserPromptSubmit`, `PostToolUse`, and `Stop`, and task runs write to the shared project scope. |
636
+ | WSL Codex CLI | Validated | WSL `codex exec` with shared `.codex/hooks.json` writes to the same ExperienceEngine home and `scope_id` as Windows Codex App. |
637
+ | Claude Code on Windows | Validated | Real hooks fired `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, and `SessionEnd`; `SessionEnd` drained through the background queue and wrote to the shared project scope. |
638
+ | OpenClaw on WSL | Validated | WSL OpenClaw gateway loaded the current ExperienceEngine plugin and wrote task runs to the shared ExperienceEngine home. ExperienceEngine now resolves the real project root from OpenClaw hook payloads or nearby repo markers before scope resolution. If OpenClaw only reports its global workspace, ExperienceEngine isolates that session instead of reusing unrelated global-workspace experience. OpenClaw validated with `openrouter/tencent/hy3-preview:free`; the bare `tencent/hy3-preview:free` id is marked missing by OpenClaw's model registry. |
639
+
640
+ This matrix is source-repo validation only. Published npm package validation and host-native marketplace validation must be called out separately during release preparation.
641
+
560
642
  Developer validation docs:
561
643
 
562
644
  - [docs/development/codex-runtime-validation.md](development/codex-runtime-validation.md)
@@ -587,6 +669,10 @@ Useful fallback commands:
587
669
  ```bash
588
670
  ee inspect --last
589
671
  ee inspect recent injected 10
672
+ ee inspect review
673
+ ee inspect repo
674
+ ee inspect hygiene
675
+ ee inspect export-drafts
590
676
  ee inspect backups
591
677
  ee inspect active
592
678
  ee inspect node <id>
@@ -860,7 +946,7 @@ Claude Code:
860
946
  Codex:
861
947
  - run `ee doctor codex`
862
948
  - verify `codex mcp get experienceengine`
863
- - if a new Codex session still cannot see ExperienceEngine, run `ee install codex`
949
+ - if doctor reports disabled hooks, stale Claude hook entries, WSL path drift, or missing MCP wiring, run `ee repair codex`
864
950
  - then start a new Codex session so the MCP connection is recreated
865
951
 
866
952
  ### What ExperienceEngine does not back up
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "experienceengine",
3
3
  "name": "ExperienceEngine",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "description": "Context-aware experience intervention controller for coding and debugging tasks.",
6
6
  "configSchema": {
7
7
  "type": "object",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@alan512/experienceengine",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Experience governance for coding agents: learn from real task outcomes, inject reusable hints, and retire low-value guidance.",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/Alan-512/ExperienceEngine.git"
9
+ "url": "git+https://github.com/Alan-512/ExperienceEngine.git"
10
10
  },
11
11
  "openclaw": {
12
12
  "extensions": [
@@ -34,23 +34,13 @@
34
34
  "hooks",
35
35
  "plugins/claude-code-experienceengine",
36
36
  "README.md",
37
+ "docs/assets/readme",
37
38
  "docs/user-guide.md",
38
39
  "docs/releases",
39
40
  "openclaw.plugin.json",
40
41
  "scripts/claude-plugin",
41
42
  ".env.example"
42
43
  ],
43
- "dependencies": {
44
- "@huggingface/transformers": "^3.8.1",
45
- "@modelcontextprotocol/sdk": "^1.27.1",
46
- "zod": "^3.25.76"
47
- },
48
- "devDependencies": {
49
- "@types/node": "^22.13.14",
50
- "tsx": "^4.19.3",
51
- "typescript": "^5.8.2",
52
- "vitest": "^3.0.9"
53
- },
54
44
  "scripts": {
55
45
  "build": "node scripts/build/clean-dist.mjs && tsc -p tsconfig.build.json && node scripts/build/copy-sqlite-schema.mjs",
56
46
  "dev": "tsx watch src/cli/index.ts",
@@ -60,8 +50,20 @@
60
50
  "maintenance:merge-warning-variants": "tsx scripts/maintenance/merge-warning-variants.ts",
61
51
  "runtime:promote-payload": "tsx scripts/openclaw/promote-runtime-payload.ts",
62
52
  "runtime:replay-fixture": "tsx scripts/openclaw/replay-runtime-fixture.ts",
53
+ "prepack": "pnpm build",
63
54
  "typecheck": "tsc --noEmit",
64
55
  "test": "vitest run",
65
56
  "check": "pnpm typecheck && pnpm test && pnpm build"
57
+ },
58
+ "dependencies": {
59
+ "@huggingface/transformers": "^3.8.1",
60
+ "@modelcontextprotocol/sdk": "^1.27.1",
61
+ "zod": "^3.25.76"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^22.13.14",
65
+ "tsx": "^4.19.3",
66
+ "typescript": "^5.8.2",
67
+ "vitest": "^3.0.9"
66
68
  }
67
- }
69
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "experienceengine",
3
3
  "description": "Context-aware experience intervention controller for Claude Code.",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "author": {
6
6
  "name": "ExperienceEngine"
7
7
  },
@@ -2,16 +2,10 @@
2
2
  "mcpServers": {
3
3
  "experienceengine": {
4
4
  "type": "stdio",
5
- "command": "node",
5
+ "command": "bash",
6
6
  "args": [
7
- "${CLAUDE_PLUGIN_ROOT}/node_modules/@alan512/experienceengine/dist/cli/index.js",
8
- "mcp-server"
9
- ],
10
- "env": {
11
- "NODE_PATH": "${CLAUDE_PLUGIN_ROOT}/node_modules",
12
- "EXPERIENCE_ENGINE_HOME": "${CLAUDE_PLUGIN_ROOT}/experienceengine-home",
13
- "EXPERIENCE_ENGINE_CLAUDE_HOOK_SOURCE": "marketplace"
14
- }
7
+ "${CLAUDE_PLUGIN_ROOT}/scripts/mcp-server.sh"
8
+ ]
15
9
  }
16
10
  }
17
11
  }
@@ -11,7 +11,7 @@ PACKAGE_ENTRY="${PACKAGE_DIR}/dist/cli/index.js"
11
11
  STAMP_PATH="${PLUGIN_DATA}/.experienceengine-plugin-version"
12
12
  EXPERIENCE_ENGINE_HOME_PATH="${EXPERIENCE_ENGINE_HOME:-${PLUGIN_DATA}/experienceengine-home}"
13
13
  STATE_PATH="${EXPERIENCE_ENGINE_HOME_PATH}/claude-marketplace-state.json"
14
- PACKAGE_VERSION="0.2.0"
14
+ PACKAGE_VERSION="0.3.0"
15
15
  PACKAGE_SPEC="${EXPERIENCE_ENGINE_PLUGIN_PACKAGE_SPEC:-@alan512/experienceengine@${PACKAGE_VERSION}}"
16
16
 
17
17
  mkdir -p "${PLUGIN_DATA}"
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ PLUGIN_DATA="${CLAUDE_PLUGIN_DATA:-${CLAUDE_PLUGIN_ROOT:-}}"
5
+ if [[ -z "${PLUGIN_DATA}" ]]; then
6
+ echo "CLAUDE_PLUGIN_DATA or CLAUDE_PLUGIN_ROOT is required" >&2
7
+ exit 1
8
+ fi
9
+
10
+ INSTALL_SCRIPT="${PLUGIN_DATA}/scripts/install-deps.sh"
11
+ if [[ -x "${INSTALL_SCRIPT}" ]]; then
12
+ "${INSTALL_SCRIPT}" >&2
13
+ fi
14
+
15
+ export NODE_PATH="${PLUGIN_DATA}/node_modules${NODE_PATH:+:${NODE_PATH}}"
16
+ export EXPERIENCE_ENGINE_HOME="${EXPERIENCE_ENGINE_HOME:-${PLUGIN_DATA}/experienceengine-home}"
17
+ STATE_PATH="${EXPERIENCE_ENGINE_HOME}/claude-marketplace-state.json"
18
+
19
+ node - "${STATE_PATH}" <<'NODE'
20
+ const fs = require("node:fs");
21
+ const path = require("node:path");
22
+
23
+ const [statePath] = process.argv.slice(2);
24
+ let current = {};
25
+ try {
26
+ current = JSON.parse(fs.readFileSync(statePath, "utf8"));
27
+ } catch {}
28
+
29
+ const next = {
30
+ adapter: "claude-code",
31
+ install_mode: "marketplace",
32
+ hook_source: "marketplace",
33
+ package_version: current.package_version,
34
+ written_at: current.written_at ?? new Date().toISOString(),
35
+ last_hook_seen_at: current.last_hook_seen_at,
36
+ last_mcp_seen_at: new Date().toISOString()
37
+ };
38
+
39
+ fs.mkdirSync(path.dirname(statePath), { recursive: true });
40
+ fs.writeFileSync(statePath, `${JSON.stringify(next, null, 2)}\n`);
41
+ NODE
42
+
43
+ exec node --no-warnings "${PLUGIN_DATA}/node_modules/@alan512/experienceengine/dist/cli/index.js" mcp-server "$@"