@remembrance-ai/mcp-server 0.1.62 → 0.1.63

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/dist/server.js CHANGED
@@ -4706,7 +4706,17 @@ var HOST_POLICY_OPERATION_CLASSES = /* @__PURE__ */ new Set([
4706
4706
  "other"
4707
4707
  ]);
4708
4708
  var CODEX_HOOK_REVIEW_COMMAND = `CODEX_CLI="\${CODEX_CLI:-$(command -v codex || true)}"; [ -x "$CODEX_CLI" ] || CODEX_CLI="/Applications/ChatGPT.app/Contents/Resources/codex"; [ -x "$CODEX_CLI" ] || CODEX_CLI="/Applications/Codex.app/Contents/Resources/codex"; [ -x "$CODEX_CLI" ] || { printf '%s\\n' "Codex CLI not found. Install the Codex CLI, or install or update the ChatGPT desktop app on macOS, then try again." >&2; exit 1; }; "$CODEX_CLI"`;
4709
- function codexHookReviewAction(followupTool) {
4709
+ function codexHookReviewAction(followupTool, reviewEvents = []) {
4710
+ const allowedEvents = /* @__PURE__ */ new Set([
4711
+ "SessionStart",
4712
+ "UserPromptSubmit",
4713
+ "PostToolUse",
4714
+ "Stop"
4715
+ ]);
4716
+ const events = [...new Set(reviewEvents)].filter((event) => allowedEvents.has(event)).slice(0, 4);
4717
+ if (events.length > 0) {
4718
+ return `Open Terminal and run the command below. Choose Review hooks, open only the Remembrance ${events.join(", ")} hook${events.length === 1 ? "" : "s"}, and press t to trust ${events.length === 1 ? "it" : "them"}. Then fully quit and reopen Codex, submit one prompt, use one Remembrance tool, complete one turn, and call ${followupTool} again.`;
4719
+ }
4710
4720
  return `Open Terminal and launch Codex with the command below. If Codex shows a Hooks need review screen, choose Review hooks and trust only the Remembrance SessionStart, UserPromptSubmit, PostToolUse, and Stop hooks. If no review screen appears, continue: Codex may be reusing an existing valid trust decision. Fully restart Codex, submit one prompt, use one Remembrance tool, complete one turn, and call ${followupTool} again. If the lifecycle warning remains, update or reinstall Remembrance and repeat this check.`;
4711
4721
  }
4712
4722
  function buildConnectionDoctorReport(input) {
@@ -5000,6 +5010,28 @@ function pluginLifecycleCheck(pluginHealth, issues) {
5000
5010
  "The native plugin startup and prompt lifecycle is active."
5001
5011
  );
5002
5012
  }
5013
+ if (stringValue(pluginHealth.surface) === "codex" && issues.includes("hook_trust_required")) {
5014
+ const hookTrust = record(pluginHealth.hook_trust);
5015
+ const allowedEvents = /* @__PURE__ */ new Set([
5016
+ "SessionStart",
5017
+ "UserPromptSubmit",
5018
+ "PostToolUse",
5019
+ "Stop"
5020
+ ]);
5021
+ const reviewEvents = Array.isArray(hookTrust.review_events) ? hookTrust.review_events.filter(
5022
+ (event) => typeof event === "string" && allowedEvents.has(event)
5023
+ ).slice(0, 4) : [];
5024
+ const eventSummary = reviewEvents.length > 0 ? `the updated Remembrance ${reviewEvents.join(", ")} hook${reviewEvents.length === 1 ? "" : "s"}` : "updated Remembrance hooks";
5025
+ return warning(
5026
+ "plugin_lifecycle",
5027
+ `Codex is waiting for trust approval for ${eventSummary}.`,
5028
+ "review_codex_hook_trust",
5029
+ codexHookReviewAction("run_connection_doctor", reviewEvents),
5030
+ issues,
5031
+ false,
5032
+ CODEX_HOOK_REVIEW_COMMAND
5033
+ );
5034
+ }
5003
5035
  if (pluginHealth.status === "partial") {
5004
5036
  const codex = stringValue(pluginHealth.surface) === "codex";
5005
5037
  return warning(
@@ -10730,13 +10762,23 @@ function localPluginLifecycleHealth(options) {
10730
10762
  });
10731
10763
  }
10732
10764
  const coreLifecycleObserved = components.session_start.observed && components.prompt_hook.observed;
10733
- if (coreLifecycleObserved && !components.tool_observer.observed) {
10765
+ const hookTrust = normalizedPluginHookTrust(marker.hook_trust);
10766
+ const hookTrustReviewEvents = hookTrust?.status === "review_required" ? new Set(hookTrust.review_events) : /* @__PURE__ */ new Set();
10767
+ if (hookTrustReviewEvents.size > 0) {
10768
+ issues.push({
10769
+ code: "hook_trust_required",
10770
+ action: codexHookReviewAction("get_connection_status", [
10771
+ ...hookTrustReviewEvents
10772
+ ])
10773
+ });
10774
+ }
10775
+ if (coreLifecycleObserved && !components.tool_observer.observed && !hookTrustReviewEvents.has("PostToolUse")) {
10734
10776
  issues.push({
10735
10777
  code: "tool_observer_not_observed",
10736
10778
  action: surface === "codex" ? `Use a Remembrance MCP tool, then call get_connection_status again. If this remains missing, ${codexHookReviewAction("get_connection_status")}` : "No native tool observer has run in this session yet. Use a Remembrance MCP tool, then call get_connection_status again."
10737
10779
  });
10738
10780
  }
10739
- if (coreLifecycleObserved && !components.completion_hook.observed) {
10781
+ if (coreLifecycleObserved && !components.completion_hook.observed && !hookTrustReviewEvents.has("Stop")) {
10740
10782
  issues.push({
10741
10783
  code: "completion_hook_not_observed",
10742
10784
  action: surface === "codex" ? `Complete one turn, then call get_connection_status again. If this remains missing, ${codexHookReviewAction("get_connection_status")}` : "No native completion hook has run in this session yet. Complete one turn, then call get_connection_status again."
@@ -10795,11 +10837,49 @@ function localPluginLifecycleHealth(options) {
10795
10837
  matches_mcp: markerDestinationFingerprint && options.apiDestinationFingerprint ? markerDestinationFingerprint === options.apiDestinationFingerprint : null,
10796
10838
  mcp_source: options.apiDestinationSource ?? null
10797
10839
  },
10840
+ hook_trust: hookTrust,
10798
10841
  components,
10799
10842
  issues,
10800
10843
  explanation: "Each host session is tracked independently. SessionStart and the prompt hook must run first; tool and completion observations appear after those lifecycle events become eligible."
10801
10844
  };
10802
10845
  }
10846
+ function normalizedPluginHookTrust(value) {
10847
+ if (!isRecord3(value)) return null;
10848
+ const status = value.status;
10849
+ if (status !== "trusted" && status !== "review_required" && status !== "unavailable") {
10850
+ return null;
10851
+ }
10852
+ const allowedEvents = /* @__PURE__ */ new Set([
10853
+ "SessionStart",
10854
+ "UserPromptSubmit",
10855
+ "PostToolUse",
10856
+ "Stop"
10857
+ ]);
10858
+ const allowedStatuses = /* @__PURE__ */ new Set([
10859
+ "managed",
10860
+ "missing",
10861
+ "modified",
10862
+ "trusted",
10863
+ "unknown",
10864
+ "untrusted"
10865
+ ]);
10866
+ const reviewEvents = Array.isArray(value.review_events) ? [...new Set(value.review_events)].filter(
10867
+ (event) => typeof event === "string" && allowedEvents.has(event)
10868
+ ).slice(0, 4) : [];
10869
+ const hooks = Array.isArray(value.hooks) ? value.hooks.filter(isRecord3).filter(
10870
+ (entry) => typeof entry.event === "string" && allowedEvents.has(entry.event)
10871
+ ).slice(0, 4).map((entry) => ({
10872
+ event: String(entry.event),
10873
+ enabled: entry.enabled === true,
10874
+ trust_status: typeof entry.trust_status === "string" && allowedStatuses.has(entry.trust_status) ? entry.trust_status : "unknown"
10875
+ })) : [];
10876
+ return {
10877
+ status,
10878
+ checked_at: typeof value.checked_at === "string" && Number.isFinite(Date.parse(value.checked_at)) ? new Date(value.checked_at).toISOString() : null,
10879
+ review_events: reviewEvents,
10880
+ hooks
10881
+ };
10882
+ }
10803
10883
  function apiDestinationStatus(baseUrl, source) {
10804
10884
  const normalized = baseUrl.replace(/\/+$/, "");
10805
10885
  return {
@@ -11003,7 +11083,7 @@ async function checkClientUpdate(input) {
11003
11083
  // src/server.ts
11004
11084
  var MAX_REMOTE_RESPONSE_BYTES = 4 * 1024 * 1024;
11005
11085
  var DOCTOR_PROBE_TIMEOUT_MS = 7500;
11006
- var SERVER_VERSION = true ? "0.1.62" : "0.0.0-dev";
11086
+ var SERVER_VERSION = true ? "0.1.63" : "0.0.0-dev";
11007
11087
  var tools = toolDefinitions;
11008
11088
  var doctorCliRequested = process.argv[2] === "doctor";
11009
11089
  var inputBuffer = Buffer.alloc(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remembrance-ai/mcp-server",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "mcpName": "io.github.dreamarkinc/remembrance",
5
5
  "description": "MCP server for discovering Remembrance skills/resources and submitting agent feedback with optional TOFU attestations.",
6
6
  "license": "Apache-2.0",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/dreamarkinc/remembrance-skills",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.62",
9
+ "version": "0.1.63",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@remembrance-ai/mcp-server",
14
- "version": "0.1.62",
14
+ "version": "0.1.63",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },