openmeld 0.3.88 → 0.3.89

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.
@@ -34,7 +34,7 @@ import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybi
34
34
  var package_default = {
35
35
  $schema: "https://www.schemastore.org/package.json",
36
36
  name: "openmeld",
37
- version: "0.3.88",
37
+ version: "0.3.89",
38
38
  openMeldReleaseDate: "2026-08-24",
39
39
  description: "OpenMeld CLI - https://openmeld.ai",
40
40
  license: "MIT",
@@ -2189,13 +2189,13 @@ async function migrateProjectBindingStore(input) {
2189
2189
  }));
2190
2190
  }
2191
2191
  function parseProjectBindingStore(value, path) {
2192
- if (isRecord$10(value) && typeof value.version === "number" && Number.isSafeInteger(value.version) && value.version > 3) throw new ProjectBindingStoreUpdateRequiredError(path, value.version);
2193
- if (!(isRecord$10(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3) && Array.isArray(value.bindings))) throw new Error(`Project binding store is invalid: ${path}`);
2192
+ if (isRecord$9(value) && typeof value.version === "number" && Number.isSafeInteger(value.version) && value.version > 3) throw new ProjectBindingStoreUpdateRequiredError(path, value.version);
2193
+ if (!(isRecord$9(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3) && Array.isArray(value.bindings))) throw new Error(`Project binding store is invalid: ${path}`);
2194
2194
  const storeVersion = value.version;
2195
2195
  const bindings = value.bindings.map((binding, index) => {
2196
2196
  const label = `${path} bindings[${index}]`;
2197
2197
  const parsed = parseBinding(binding, label, storeVersion === 1 ? 1 : LEGACY_STORE_VERSION);
2198
- const isDefault = storeVersion === 3 ? requireBoolean(isRecord$10(binding) ? binding.isDefault : void 0, `${label}.isDefault`) : true;
2198
+ const isDefault = storeVersion === 3 ? requireBoolean(isRecord$9(binding) ? binding.isDefault : void 0, `${label}.isDefault`) : true;
2199
2199
  return {
2200
2200
  ...parsed,
2201
2201
  isDefault
@@ -2230,7 +2230,7 @@ function assertProjectBindingStoreV3Invariants(bindings, path, sourceVersion) {
2230
2230
  }
2231
2231
  }
2232
2232
  function parseBinding(value, label, storeVersion) {
2233
- if (!isRecord$10(value)) throw new Error(`Agent Activity Project binding is invalid: ${label}`);
2233
+ if (!isRecord$9(value)) throw new Error(`Agent Activity Project binding is invalid: ${label}`);
2234
2234
  const repositoryFingerprint = value.repositoryFingerprint === null ? null : normalizeFingerprint(value.repositoryFingerprint);
2235
2235
  const boundAtMs = Number(value.boundAtMs);
2236
2236
  if (!Number.isSafeInteger(boundAtMs) || boundAtMs < 0) throw new Error(`Agent Activity Project binding is invalid: ${label}`);
@@ -2245,7 +2245,7 @@ function parseBinding(value, label, storeVersion) {
2245
2245
  };
2246
2246
  }
2247
2247
  function readProjectBindingStoreVersion(value) {
2248
- if (!(isRecord$10(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3))) throw new Error("Project binding store version is invalid");
2248
+ if (!(isRecord$9(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3))) throw new Error("Project binding store version is invalid");
2249
2249
  return value.version;
2250
2250
  }
2251
2251
  function normalizeFingerprint(value) {
@@ -2262,7 +2262,7 @@ function requireBoolean(value, label) {
2262
2262
  if (typeof value !== "boolean") throw new Error(`${label} is required`);
2263
2263
  return value;
2264
2264
  }
2265
- function isRecord$10(value) {
2265
+ function isRecord$9(value) {
2266
2266
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
2267
2267
  }
2268
2268
  function isNodeError$9(error, code) {
@@ -2696,7 +2696,7 @@ async function readCodexSessionTitles(input) {
2696
2696
  if (!line.trim()) continue;
2697
2697
  try {
2698
2698
  const record = JSON.parse(line);
2699
- if (!isRecord$9(record)) continue;
2699
+ if (!isRecord$8(record)) continue;
2700
2700
  const sessionId = text$4(record.id);
2701
2701
  const title = normalizeSharedSessionTitle(record.thread_name);
2702
2702
  if (sessionId && title) titles.set(sessionId, title);
@@ -2711,7 +2711,7 @@ function normalizeSharedSessionTitle(value) {
2711
2711
  function text$4(value) {
2712
2712
  return typeof value === "string" && value.trim() ? value.trim() : null;
2713
2713
  }
2714
- function isRecord$9(value) {
2714
+ function isRecord$8(value) {
2715
2715
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
2716
2716
  }
2717
2717
  function isNodeError$6(error) {
@@ -2721,12 +2721,12 @@ function isNodeError$6(error) {
2721
2721
  //#region src/agent-activity/observer-adapters.ts
2722
2722
  const ACTIVE_WINDOW_MS = 2 * 6e4;
2723
2723
  function parseCodexRolloutSnapshot(input) {
2724
- const meta = input.lines.find((line) => isRecord$8(line) && line.type === "session_meta" && isRecord$8(line.payload));
2725
- if (!(isRecord$8(meta) && isRecord$8(meta.payload))) return null;
2724
+ const meta = input.lines.find((line) => isRecord$7(line) && line.type === "session_meta" && isRecord$7(line.payload));
2725
+ if (!(isRecord$7(meta) && isRecord$7(meta.payload))) return null;
2726
2726
  const sessionId = text$3(meta.payload.id);
2727
2727
  const cwd = text$3(meta.payload.cwd);
2728
2728
  if (!(sessionId && cwd)) return null;
2729
- const safeEvidence = input.lines.filter((line) => isRecord$8(line)).map((line) => ({
2729
+ const safeEvidence = input.lines.filter((line) => isRecord$7(line)).map((line) => ({
2730
2730
  line,
2731
2731
  observedAtMs: timestamp$1(line.timestamp)
2732
2732
  })).filter((entry) => entry.observedAtMs !== null).sort((left, right) => Number(left.observedAtMs) - Number(right.observedAtMs));
@@ -2734,17 +2734,17 @@ function parseCodexRolloutSnapshot(input) {
2734
2734
  const latestTurn = [...safeEvidence].reverse().find((entry) => entry.line.type === "turn_context");
2735
2735
  const observedAtMs = latest?.observedAtMs ?? timestamp$1(meta.timestamp);
2736
2736
  if (observedAtMs === null) return null;
2737
- const turnPayload = isRecord$8(latestTurn?.line.payload) ? latestTurn.line.payload : {};
2737
+ const turnPayload = isRecord$7(latestTurn?.line.payload) ? latestTurn.line.payload : {};
2738
2738
  const originator = normalizeCodexOriginator(meta.payload);
2739
2739
  const status = resolveObservedStatus({
2740
2740
  explicitIdle: safeEvidence.slice(-4).some((entry) => {
2741
- const payload = isRecord$8(entry.line.payload) ? entry.line.payload : null;
2741
+ const payload = isRecord$7(entry.line.payload) ? entry.line.payload : null;
2742
2742
  return entry.line.type === "event_msg" && (payload?.type === "task_complete" || payload?.type === "turn_aborted");
2743
2743
  }),
2744
2744
  nowMs: input.nowMs,
2745
2745
  observedAtMs
2746
2746
  });
2747
- const git = isRecord$8(meta.payload.git) ? meta.payload.git : {};
2747
+ const git = isRecord$7(meta.payload.git) ? meta.payload.git : {};
2748
2748
  return {
2749
2749
  clientKind: resolveCodexClientKind(originator),
2750
2750
  cwd,
@@ -2762,7 +2762,7 @@ function parseCodexRolloutSnapshot(input) {
2762
2762
  "never"
2763
2763
  ]),
2764
2764
  cliVersion: nullableText$1(meta.payload.cli_version),
2765
- contextWindow: positiveInteger(isRecord$8(turnPayload.summary) ? turnPayload.summary.model_context_window : void 0),
2765
+ contextWindow: positiveInteger(isRecord$7(turnPayload.summary) ? turnPayload.summary.model_context_window : void 0),
2766
2766
  modelProvider: nullableText$1(meta.payload.model_provider),
2767
2767
  originator,
2768
2768
  reasoningEffort: enumValue(turnPayload.effort, [
@@ -2773,7 +2773,7 @@ function parseCodexRolloutSnapshot(input) {
2773
2773
  "xhigh",
2774
2774
  "ultra"
2775
2775
  ]),
2776
- sandboxMode: enumValue(isRecord$8(turnPayload.sandbox_policy) ? turnPayload.sandbox_policy.type : turnPayload.sandbox_policy, [
2776
+ sandboxMode: enumValue(isRecord$7(turnPayload.sandbox_policy) ? turnPayload.sandbox_policy.type : turnPayload.sandbox_policy, [
2777
2777
  "read-only",
2778
2778
  "workspace-write",
2779
2779
  "danger-full-access"
@@ -2791,7 +2791,7 @@ function resolveCodexClientKind(originator) {
2791
2791
  return originator === "cli" ? "codex-cli" : "unknown";
2792
2792
  }
2793
2793
  function parseClaudeTranscriptSnapshot(input) {
2794
- const records = input.lines.filter((line) => isRecord$8(line));
2794
+ const records = input.lines.filter((line) => isRecord$7(line));
2795
2795
  const identity = records.find((line) => text$3(line.sessionId) && text$3(line.cwd));
2796
2796
  if (!identity) return null;
2797
2797
  const providerSessionId = text$3(identity.sessionId);
@@ -2803,7 +2803,7 @@ function parseClaudeTranscriptSnapshot(input) {
2803
2803
  })).filter((entry) => entry.observedAtMs !== null).sort((left, right) => left.observedAtMs - right.observedAtMs);
2804
2804
  const latest = timed.at(-1);
2805
2805
  if (!latest) return null;
2806
- const latestWithModel = [...timed].reverse().find((entry) => isRecord$8(entry.line.message) && text$3(entry.line.message.model));
2806
+ const latestWithModel = [...timed].reverse().find((entry) => isRecord$7(entry.line.message) && text$3(entry.line.message.model));
2807
2807
  const customTitle = [...records].reverse().find((line) => line.type === "custom-title");
2808
2808
  const status = resolveObservedStatus({
2809
2809
  explicitIdle: false,
@@ -2816,7 +2816,7 @@ function parseClaudeTranscriptSnapshot(input) {
2816
2816
  eventType: status === "active" ? "heartbeat" : statusEventType(status),
2817
2817
  gitBranch: nullableText$1(latest.line.gitBranch ?? identity.gitBranch),
2818
2818
  gitCommit: null,
2819
- model: isRecord$8(latestWithModel?.line.message) ? nullableText$1(latestWithModel.line.message.model) : null,
2819
+ model: isRecord$7(latestWithModel?.line.message) ? nullableText$1(latestWithModel.line.message.model) : null,
2820
2820
  observedAtMs: latest.observedAtMs,
2821
2821
  provider: "claude-code",
2822
2822
  providerMetadata: compact({
@@ -2943,7 +2943,7 @@ function resolveObservedStatus(input) {
2943
2943
  }
2944
2944
  function normalizeCodexOriginator(meta) {
2945
2945
  if (text$3(meta.originator) === "Codex Desktop") return "desktop";
2946
- if (isRecord$8(meta.source) && "subagent" in meta.source) return "subagent";
2946
+ if (isRecord$7(meta.source) && "subagent" in meta.source) return "subagent";
2947
2947
  const originator = text$3(meta.originator)?.toLowerCase();
2948
2948
  return originator === "codex cli" || originator === "codex_cli" ? "cli" : void 0;
2949
2949
  }
@@ -2988,16 +2988,16 @@ function text$3(value) {
2988
2988
  return typeof value === "string" && value.trim() ? value.trim() : null;
2989
2989
  }
2990
2990
  function parseJsonRecord$1(value) {
2991
- if (isRecord$8(value)) return value;
2991
+ if (isRecord$7(value)) return value;
2992
2992
  if (typeof value !== "string") return null;
2993
2993
  try {
2994
2994
  const parsed = JSON.parse(value);
2995
- return isRecord$8(parsed) ? parsed : null;
2995
+ return isRecord$7(parsed) ? parsed : null;
2996
2996
  } catch {
2997
2997
  return null;
2998
2998
  }
2999
2999
  }
3000
- function isRecord$8(value) {
3000
+ function isRecord$7(value) {
3001
3001
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
3002
3002
  }
3003
3003
  //#endregion
@@ -12877,7 +12877,7 @@ function resolveResultText$1(record, isErrorResult) {
12877
12877
  }
12878
12878
  function resolveErrorMessage$1(record, isErrorResult) {
12879
12879
  const fromKnownPaths = resolveStringByPaths$1(record, OPENCODE_ERROR_MESSAGE_PATHS);
12880
- if (fromKnownPaths && (isErrorResult === true || looksLikeErrorSignal$1(fromKnownPaths))) return fromKnownPaths;
12880
+ if (fromKnownPaths && (isErrorResult === true || looksLikeErrorSignal(fromKnownPaths))) return fromKnownPaths;
12881
12881
  return null;
12882
12882
  }
12883
12883
  function resolveIsErrorResult$1(record) {
@@ -12922,7 +12922,7 @@ function resolveTextByPaths(record, paths) {
12922
12922
  }
12923
12923
  return null;
12924
12924
  }
12925
- function looksLikeErrorSignal$1(value) {
12925
+ function looksLikeErrorSignal(value) {
12926
12926
  const lowered = value.toLowerCase();
12927
12927
  return lowered.includes("error") || lowered.includes("failed") || looksLikeRuntimePermissionDenialMessage(value) || lowered.includes("unauthorized") || lowered.includes("not logged in") || lowered.includes("invalid") || lowered.includes("quota") || lowered.includes("rate") || lowered.includes("unsupported model") || lowered.includes("model is not supported");
12928
12928
  }
@@ -14743,7 +14743,7 @@ async function mapCodexThread(input) {
14743
14743
  if (!(nativeSessionId && cwd && lastActiveAtMs !== null)) throw new Error("Codex returned a malformed retained thread record.");
14744
14744
  const binding = await resolveObservedAgentActivityBinding(cwd, input.bindings);
14745
14745
  if (!binding) return null;
14746
- const runtimeStatus = isRecord$7(input.thread.status) ? text$1(input.thread.status.type) : null;
14746
+ const runtimeStatus = isRecord$6(input.thread.status) ? text$1(input.thread.status.type) : null;
14747
14747
  return {
14748
14748
  binding,
14749
14749
  session: observedLocalAgentSessionSchema.parse({
@@ -14787,7 +14787,7 @@ async function listAllCodexThreads(launchContract) {
14787
14787
  sourceKinds: CODEX_THREAD_SOURCE_KINDS,
14788
14788
  useStateDbOnly: false
14789
14789
  });
14790
- if (!(isRecord$7(response) && Array.isArray(response.data) && response.data.every(isRecord$7))) throw new Error("Codex thread/list response is invalid.");
14790
+ if (!(isRecord$6(response) && Array.isArray(response.data) && response.data.every(isRecord$6))) throw new Error("Codex thread/list response is invalid.");
14791
14791
  pages.push({
14792
14792
  archived,
14793
14793
  data: response.data
@@ -14912,12 +14912,12 @@ function consumeCodexJsonRpcChunk(input) {
14912
14912
  }
14913
14913
  }
14914
14914
  function settleCodexJsonRpcResponse(message, pending) {
14915
- if (!isRecord$7(message) || typeof message.id !== "number") return;
14915
+ if (!isRecord$6(message) || typeof message.id !== "number") return;
14916
14916
  const request = pending.get(message.id);
14917
14917
  if (!request) return;
14918
14918
  pending.delete(message.id);
14919
14919
  clearTimeout(request.timer);
14920
- if (isRecord$7(message.error)) {
14920
+ if (isRecord$6(message.error)) {
14921
14921
  request.reject(new Error(text$1(message.error.message) ?? "Codex app-server request failed."));
14922
14922
  return;
14923
14923
  }
@@ -15038,7 +15038,7 @@ function applyClaudeSessionLine(state, line) {
15038
15038
  } catch (error) {
15039
15039
  throw new Error("Claude Code Session file contains malformed JSON.", { cause: error });
15040
15040
  }
15041
- if (!isRecord$7(value)) return;
15041
+ if (!isRecord$6(value)) return;
15042
15042
  const rowSessionId = text$1(value.sessionId);
15043
15043
  if (rowSessionId && state.nativeSessionId !== rowSessionId) {
15044
15044
  if (state.nativeSessionId) throw new Error("Claude Code Session file contains conflicting IDs.");
@@ -15210,12 +15210,12 @@ async function discoverGrokBuildRetainedSessions(input) {
15210
15210
  const identities = /* @__PURE__ */ new Set();
15211
15211
  for (const path of paths) {
15212
15212
  const summary = JSON.parse(await readFile(path, "utf8"));
15213
- if (!isRecord$7(summary)) throw new Error("Grok Build summary metadata is invalid.");
15213
+ if (!isRecord$6(summary)) throw new Error("Grok Build summary metadata is invalid.");
15214
15214
  const topLevelIdentity = {
15215
15215
  cwd: text$1(summary.cwd),
15216
15216
  nativeSessionId: text$1(summary.id)
15217
15217
  };
15218
- const nestedInfo = isRecord$7(summary.info) ? summary.info : null;
15218
+ const nestedInfo = isRecord$6(summary.info) ? summary.info : null;
15219
15219
  const nestedIdentity = {
15220
15220
  cwd: text$1(nestedInfo?.cwd),
15221
15221
  nativeSessionId: text$1(nestedInfo?.id)
@@ -15365,7 +15365,7 @@ function mapClaudeAgentStatus(value) {
15365
15365
  }
15366
15366
  function collectRecords(value) {
15367
15367
  if (Array.isArray(value)) return value.flatMap(collectRecords);
15368
- if (!isRecord$7(value)) return [];
15368
+ if (!isRecord$6(value)) return [];
15369
15369
  return [value, ...Object.values(value).flatMap(collectRecords)];
15370
15370
  }
15371
15371
  function secondsTimestamp(value) {
@@ -15388,7 +15388,7 @@ function parseCodexNextCursor(value) {
15388
15388
  function text$1(value) {
15389
15389
  return nullableText(value);
15390
15390
  }
15391
- function isRecord$7(value) {
15391
+ function isRecord$6(value) {
15392
15392
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
15393
15393
  }
15394
15394
  function isNodeError$4(error, code) {
@@ -16575,7 +16575,7 @@ async function readAgentActivityIntegrationStatus(paths) {
16575
16575
  claude: claude !== null && CLAUDE_EVENTS.every((event) => {
16576
16576
  try {
16577
16577
  const settings = parseSettings(claude);
16578
- const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
16578
+ const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
16579
16579
  return Array.isArray(hooks?.[event]) && hooks[event].some((group) => knownArtifacts.some((artifacts) => hasOwnedClaudeHook(group, artifacts)));
16580
16580
  } catch {
16581
16581
  return false;
@@ -16585,7 +16585,7 @@ async function readAgentActivityIntegrationStatus(paths) {
16585
16585
  cursor: cursor !== null && CURSOR_EVENTS.every((event) => {
16586
16586
  try {
16587
16587
  const settings = parseJsonObject(cursor, "Cursor hooks");
16588
- const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
16588
+ const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
16589
16589
  return Array.isArray(hooks?.[event]) && hooks[event].some((entry) => knownArtifacts.some((artifacts) => isOwnedCursorHook(entry, artifacts.cursorCommand)));
16590
16590
  } catch {
16591
16591
  return false;
@@ -16640,7 +16640,7 @@ function installCursorHooks(raw, artifacts, knownArtifacts) {
16640
16640
  }
16641
16641
  function uninstallCursorHooks(raw, knownArtifacts) {
16642
16642
  const settings = parseJsonObject(raw, "Cursor hooks");
16643
- const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
16643
+ const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
16644
16644
  if (!hooks) return raw;
16645
16645
  for (const event of CURSOR_EVENTS) {
16646
16646
  if (!Array.isArray(hooks[event])) continue;
@@ -16656,17 +16656,17 @@ function ownedCursorHook(command) {
16656
16656
  };
16657
16657
  }
16658
16658
  function isOwnedCursorHook(value, command) {
16659
- return isRecord$6(value) && Object.keys(value).length === 2 && value.command === command && value.timeout === 10;
16659
+ return isRecord$5(value) && Object.keys(value).length === 2 && value.command === command && value.timeout === 10;
16660
16660
  }
16661
16661
  function isKnownOwnedCursorHook(value, knownArtifacts) {
16662
16662
  return knownArtifacts.some((artifacts) => isOwnedCursorHook(value, artifacts.cursorCommand) || isOwnedCursorHook(value, artifacts.legacyCursorCommand));
16663
16663
  }
16664
16664
  function hasUnknownOpenMeldCursorHook(value, knownArtifacts) {
16665
- return isRecord$6(value) && typeof value.command === "string" && value.command.includes(" activity hook --provider cursor --owner ") && value.command.includes("openmeld-agent-activity-") && !isKnownOwnedCursorHook(value, knownArtifacts);
16665
+ return isRecord$5(value) && typeof value.command === "string" && value.command.includes(" activity hook --provider cursor --owner ") && value.command.includes("openmeld-agent-activity-") && !isKnownOwnedCursorHook(value, knownArtifacts);
16666
16666
  }
16667
16667
  function uninstallClaudeHooks(raw, knownArtifacts) {
16668
16668
  const settings = parseSettings(raw);
16669
- const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
16669
+ const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
16670
16670
  if (!hooks) return raw;
16671
16671
  for (const event of CLAUDE_EVENTS) {
16672
16672
  if (!Array.isArray(hooks[event])) continue;
@@ -16683,14 +16683,14 @@ function ownedClaudeGroup(artifacts) {
16683
16683
  }] };
16684
16684
  }
16685
16685
  function isOwnedClaudeGroup(value, artifacts) {
16686
- if (!isRecord$6(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
16687
- return value.hooks.length === 1 && isRecord$6(value.hooks[0]) && value.hooks[0].command === artifacts.claudeCommand && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
16686
+ if (!isRecord$5(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
16687
+ return value.hooks.length === 1 && isRecord$5(value.hooks[0]) && value.hooks[0].command === artifacts.claudeCommand && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
16688
16688
  }
16689
16689
  function hasOwnedClaudeHook(value, artifacts) {
16690
- return isRecord$6(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$6(hook) && hook.command === artifacts.claudeCommand);
16690
+ return isRecord$5(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$5(hook) && hook.command === artifacts.claudeCommand);
16691
16691
  }
16692
16692
  function hasUnknownOpenMeldClaudeHook(value, knownArtifacts) {
16693
- return isRecord$6(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$6(hook) && typeof hook.command === "string" && hook.command.includes(" activity hook --provider claude-code --owner ") && hook.command.includes("openmeld-agent-activity-")) && !isKnownOwnedClaudeGroup(value, knownArtifacts);
16693
+ return isRecord$5(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$5(hook) && typeof hook.command === "string" && hook.command.includes(" activity hook --provider claude-code --owner ") && hook.command.includes("openmeld-agent-activity-")) && !isKnownOwnedClaudeGroup(value, knownArtifacts);
16694
16694
  }
16695
16695
  function isLegacyOwnedClaudeGroup(value, artifacts) {
16696
16696
  return isOwnedClaudeGroupForCommand(value, artifacts.legacyClaudeCommand);
@@ -16749,8 +16749,8 @@ function extractCodexTrustState(block, endMarker) {
16749
16749
  };
16750
16750
  }
16751
16751
  function isOwnedClaudeGroupForCommand(value, command) {
16752
- if (!isRecord$6(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
16753
- return value.hooks.length === 1 && isRecord$6(value.hooks[0]) && value.hooks[0].command === command && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
16752
+ if (!isRecord$5(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
16753
+ return value.hooks.length === 1 && isRecord$5(value.hooks[0]) && value.hooks[0].command === command && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
16754
16754
  }
16755
16755
  async function planPluginInstall(path, artifacts, knownArtifacts) {
16756
16756
  const current = await readOptionalFile$1(path);
@@ -16890,12 +16890,12 @@ function parseSettings(raw) {
16890
16890
  function parseJsonObject(raw, label) {
16891
16891
  if (!raw.trim()) return {};
16892
16892
  const value = JSON.parse(raw);
16893
- if (!isRecord$6(value)) throw new Error(`${label} must be a JSON object.`);
16893
+ if (!isRecord$5(value)) throw new Error(`${label} must be a JSON object.`);
16894
16894
  return value;
16895
16895
  }
16896
16896
  function ensureRecord(parent, key, label = "Claude settings") {
16897
16897
  if (parent[key] === void 0) parent[key] = {};
16898
- if (!isRecord$6(parent[key])) throw new Error(`${label} ${key} must be an object.`);
16898
+ if (!isRecord$5(parent[key])) throw new Error(`${label} ${key} must be an object.`);
16899
16899
  return parent[key];
16900
16900
  }
16901
16901
  function emptyFileFor(path) {
@@ -16905,7 +16905,7 @@ function revisionConflict(path) {
16905
16905
  const digest = createHash("sha256").update(path).digest("hex").slice(0, 12);
16906
16906
  return /* @__PURE__ */ new Error(`Managed integration revision changed before commit (${digest}).`);
16907
16907
  }
16908
- function isRecord$6(value) {
16908
+ function isRecord$5(value) {
16909
16909
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
16910
16910
  }
16911
16911
  function isNodeError$2(error, code) {
@@ -18274,7 +18274,7 @@ async function requestOpenMeldProfilesApi(input) {
18274
18274
  })
18275
18275
  });
18276
18276
  }
18277
- const record = isRecord$5(payload) ? payload : {};
18277
+ const record = isRecord$4(payload) ? payload : {};
18278
18278
  if (!readBooleanField(record, "ok")) {
18279
18279
  const parsedError = profileErrorResponseSchema.safeParse(payload);
18280
18280
  const code = parsedError.success ? parsedError.data.code : null;
@@ -18355,7 +18355,7 @@ async function emitRouteCatalogSync(reason) {
18355
18355
  await touchDaemonCatalogSyncSignal({ reason }).catch(() => void 0);
18356
18356
  }
18357
18357
  function parseOpenMeldProfileItem(value) {
18358
- const record = isRecord$5(value) ? value : {};
18358
+ const record = isRecord$4(value) ? value : {};
18359
18359
  const openMeldProfileId = readOptionalStringField$1(record, "openMeldProfileId");
18360
18360
  if (!openMeldProfileId) throw new Error("invalid profile payload: missing openMeldProfileId");
18361
18361
  const profileName = readRequiredStringField(record, "profileName");
@@ -18411,13 +18411,13 @@ function readOptionalManagedRoleField(input, field) {
18411
18411
  }
18412
18412
  function readRecordField(input, field) {
18413
18413
  const value = input[field];
18414
- if (isRecord$5(value)) return value;
18414
+ if (isRecord$4(value)) return value;
18415
18415
  throw new Error(`invalid api payload: missing ${field}`);
18416
18416
  }
18417
18417
  function readArrayField(input, field) {
18418
18418
  const value = input[field];
18419
18419
  if (!Array.isArray(value)) throw new Error(`invalid api payload: missing ${field}`);
18420
- return value.filter(isRecord$5);
18420
+ return value.filter(isRecord$4);
18421
18421
  }
18422
18422
  function readRequiredStringField(input, field) {
18423
18423
  const value = normalizeOptionalString$13(input[field]);
@@ -18460,7 +18460,7 @@ async function parseResponseJson$1(response) {
18460
18460
  }
18461
18461
  }
18462
18462
  function extractApiErrorMessage$1(payload, status) {
18463
- const record = isRecord$5(payload) ? payload : {};
18463
+ const record = isRecord$4(payload) ? payload : {};
18464
18464
  const message = normalizeOptionalString$13(record.message) ?? normalizeOptionalString$13(record.error_description) ?? normalizeOptionalString$13(record.error);
18465
18465
  if (message) return message;
18466
18466
  return `request failed with status ${status}`;
@@ -18498,7 +18498,7 @@ function isHostedProfilesEndpoint(endpoint) {
18498
18498
  const url = parseUrlOrNull$1(endpoint);
18499
18499
  return Boolean(url && !isLoopbackHostname$2(url.hostname) && url.pathname.startsWith("/v1/profiles"));
18500
18500
  }
18501
- function isRecord$5(value) {
18501
+ function isRecord$4(value) {
18502
18502
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
18503
18503
  }
18504
18504
  //#endregion
@@ -19172,7 +19172,7 @@ var DaemonServiceRunError = class extends Error {
19172
19172
  //#region src/local-service/state/runtime-contract-guard.ts
19173
19173
  const RUNTIME_CONTRACT_META_SCHEMA = "daemon.runtime.contract.meta";
19174
19174
  const RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA = "daemon.runtime.contract.repair.report";
19175
- const isRecord$4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19175
+ const isRecord$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19176
19176
  const createRuntimeContractMeta = (input) => ({
19177
19177
  schema: RUNTIME_CONTRACT_META_SCHEMA,
19178
19178
  v: 1,
@@ -19192,7 +19192,7 @@ const createRuntimeContractRepairReport = (input) => ({
19192
19192
  errorMessage: input.errorMessage
19193
19193
  });
19194
19194
  const parseRuntimeContractMeta = (value) => {
19195
- if (!isRecord$4(value)) return null;
19195
+ if (!isRecord$3(value)) return null;
19196
19196
  if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
19197
19197
  const contractEpoch = normalizeOptionalText$44(value.contractEpoch);
19198
19198
  const updatedAt = normalizeOptionalText$44(value.updatedAt);
@@ -19205,7 +19205,7 @@ const parseRuntimeContractMeta = (value) => {
19205
19205
  };
19206
19206
  };
19207
19207
  const parseRuntimeContractRepairReport = (value) => {
19208
- if (!isRecord$4(value)) return null;
19208
+ if (!isRecord$3(value)) return null;
19209
19209
  if (value.schema !== RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA || value.v !== 1) return null;
19210
19210
  const status = value.status;
19211
19211
  const reason = value.reason;
@@ -24690,13 +24690,8 @@ function resolveDocumentOutputText(record, isErrorResult) {
24690
24690
  return resolveResultText(record, isErrorResult);
24691
24691
  }
24692
24692
  function resolveErrorMessage(record, isErrorResult) {
24693
- const fromKnownPaths = resolveStringByPaths(record, OPENCLAW_ERROR_MESSAGE_PATHS);
24694
- if (fromKnownPaths && (isErrorResult === true || looksLikeErrorSignal(fromKnownPaths))) return fromKnownPaths;
24695
- if (isErrorResult === true) {
24696
- const fallback = resolveStringByPaths(record, OPENCLAW_RESULT_TEXT_PATHS);
24697
- if (fallback) return fallback;
24698
- }
24699
- return null;
24693
+ if (isErrorResult !== true) return null;
24694
+ return resolveStringByPaths(record, OPENCLAW_ERROR_MESSAGE_PATHS) ?? resolveStringByPaths(record, OPENCLAW_RESULT_TEXT_PATHS);
24700
24695
  }
24701
24696
  function resolveIsErrorResult(record) {
24702
24697
  if (typeof record.is_error === "boolean") return record.is_error;
@@ -24755,10 +24750,6 @@ function normalizeCandidateValue(value) {
24755
24750
  }
24756
24751
  return null;
24757
24752
  }
24758
- function looksLikeErrorSignal(value) {
24759
- const lowered = value.toLowerCase();
24760
- return lowered.includes("error") || lowered.includes("failed") || looksLikeRuntimePermissionDenialMessage(value) || lowered.includes("unauthorized") || lowered.includes("not logged in") || lowered.includes("invalid");
24761
- }
24762
24753
  function normalizeOptionalText$38(value) {
24763
24754
  const normalized = String(value ?? "").trim();
24764
24755
  return normalized.length > 0 ? normalized : null;
@@ -29109,7 +29100,7 @@ const INFLIGHT_RETENTION_MS = DEDUPE_RETENTION_MS;
29109
29100
  const AGENT_CONTEXT_RETENTION_MS = 720 * 60 * 60 * 1e3;
29110
29101
  const AGENT_CONTEXT_MAX_ENTRIES = 2e3;
29111
29102
  const AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR = "|";
29112
- const isRecord$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
29103
+ const isRecord$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
29113
29104
  const isPositiveInteger = (value) => Number.isInteger(value) && typeof value === "number" && value >= 0;
29114
29105
  const isRuntimeTransportMode = (value) => runtimeTransportModeSchema.safeParse(value).success;
29115
29106
  const utf8ByteLength = (value) => {
@@ -29133,7 +29124,7 @@ const utf8ByteLength = (value) => {
29133
29124
  return byteLength;
29134
29125
  };
29135
29126
  const toErrorCode = (error) => {
29136
- if (!isRecord$3(error)) return null;
29127
+ if (!isRecord$2(error)) return null;
29137
29128
  const code = error.code;
29138
29129
  if (typeof code !== "string") return null;
29139
29130
  return code;
@@ -29153,7 +29144,7 @@ const buildLegacySpaceScopedAgentContextLookupKey = (input) => [
29153
29144
  input.runtimeWorkspaceFingerprint
29154
29145
  ].map(encodeAgentContextLookupKeyPart).join(AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR);
29155
29146
  const parseInflightTask = (value) => {
29156
- if (!isRecord$3(value)) return null;
29147
+ if (!isRecord$2(value)) return null;
29157
29148
  const { bindingKey, firstSeenAtMs, idempotencyKey, output, sequence, taskId } = value;
29158
29149
  if (typeof taskId !== "string" || taskId.length === 0 || typeof bindingKey !== "string" || bindingKey.length === 0 || typeof idempotencyKey !== "string" || idempotencyKey.length === 0 || !isPositiveInteger(sequence) || !isPositiveInteger(firstSeenAtMs)) return null;
29159
29150
  if (output !== void 0 && (typeof output !== "string" || output.length === 0)) return null;
@@ -29167,7 +29158,7 @@ const parseInflightTask = (value) => {
29167
29158
  };
29168
29159
  };
29169
29160
  const parseAgentContextState = (agentContextLookupKey, value) => {
29170
- if (!isRecord$3(value)) return null;
29161
+ if (!isRecord$2(value)) return null;
29171
29162
  const { agentControllerConversationId, agentControllerRef, createdAtMs, lastTaskId, spaceId, targetProfileId, transportMode, runtimeWorkspaceFingerprint, updatedAtMs } = value;
29172
29163
  const parsedAgentControllerRef = typeof agentControllerRef === "string" ? parseAgentControllerRef$1(agentControllerRef) : null;
29173
29164
  if (!isRuntimeTransportMode(transportMode) || typeof agentContextLookupKey !== "string" || agentContextLookupKey.length === 0 || typeof spaceId !== "string" || spaceId.length === 0 || typeof targetProfileId !== "string" || targetProfileId.length === 0 || !parsedAgentControllerRef || typeof runtimeWorkspaceFingerprint !== "string" || runtimeWorkspaceFingerprint.length === 0 || typeof agentControllerConversationId !== "string" || agentControllerConversationId.length === 0 || !isPositiveInteger(createdAtMs) || !isPositiveInteger(updatedAtMs) || typeof lastTaskId !== "string" || lastTaskId.length === 0) return null;
@@ -29199,7 +29190,7 @@ const parseAgentContextState = (agentContextLookupKey, value) => {
29199
29190
  };
29200
29191
  };
29201
29192
  const parseAgentContextLifecycleCounters = (value) => {
29202
- if (!isRecord$3(value)) return null;
29193
+ if (!isRecord$2(value)) return null;
29203
29194
  const { created, guardBlocked, recreated, reused } = value;
29204
29195
  if (!(isPositiveInteger(created) && isPositiveInteger(recreated) && isPositiveInteger(reused) && isPositiveInteger(guardBlocked))) return null;
29205
29196
  return {
@@ -29216,7 +29207,7 @@ const createEmptyAgentContextLifecycleCounters = () => ({
29216
29207
  reused: 0
29217
29208
  });
29218
29209
  const parseAgentContextRotationRecord = (value) => {
29219
- if (!isRecord$3(value)) return null;
29210
+ if (!isRecord$2(value)) return null;
29220
29211
  const { nextAgentControllerConversationId, previousAgentControllerConversationId, rotationAt, rotationReason, rotationTaskId, rotationTriggerErrorCode } = value;
29221
29212
  if (typeof previousAgentControllerConversationId !== "string" || previousAgentControllerConversationId.length === 0 || typeof nextAgentControllerConversationId !== "string" || nextAgentControllerConversationId.length === 0 || typeof rotationTriggerErrorCode !== "string" || rotationTriggerErrorCode.length === 0 || typeof rotationReason !== "string" || rotationReason.length === 0 || !isPositiveInteger(rotationAt) || typeof rotationTaskId !== "string" || rotationTaskId.length === 0) return null;
29222
29213
  return {
@@ -29240,7 +29231,7 @@ const parseAgentContextRotationsOrDefault = (value) => {
29240
29231
  return nextRecords;
29241
29232
  };
29242
29233
  const parseDedupeFirstSeenByKey = (value) => {
29243
- if (!isRecord$3(value)) return null;
29234
+ if (!isRecord$2(value)) return null;
29244
29235
  const nextDedupeFirstSeenByKey = {};
29245
29236
  for (const [key, firstSeenAtMs] of Object.entries(value)) {
29246
29237
  if (!isPositiveInteger(firstSeenAtMs)) return null;
@@ -29249,7 +29240,7 @@ const parseDedupeFirstSeenByKey = (value) => {
29249
29240
  return nextDedupeFirstSeenByKey;
29250
29241
  };
29251
29242
  const parseInflightByTaskId = (value) => {
29252
- if (!isRecord$3(value)) return null;
29243
+ if (!isRecord$2(value)) return null;
29253
29244
  const nextInflightByTaskId = {};
29254
29245
  for (const [taskId, inflightTask] of Object.entries(value)) {
29255
29246
  const parsedTask = parseInflightTask(inflightTask);
@@ -29259,7 +29250,7 @@ const parseInflightByTaskId = (value) => {
29259
29250
  return nextInflightByTaskId;
29260
29251
  };
29261
29252
  const parseReplayedTaskIds = (value) => {
29262
- if (!isRecord$3(value)) return null;
29253
+ if (!isRecord$2(value)) return null;
29263
29254
  const nextReplayedTaskIds = {};
29264
29255
  for (const [taskId, replayed] of Object.entries(value)) {
29265
29256
  if (replayed !== true) return null;
@@ -29268,7 +29259,7 @@ const parseReplayedTaskIds = (value) => {
29268
29259
  return nextReplayedTaskIds;
29269
29260
  };
29270
29261
  const parseAgentContextByLookupKey = (value) => {
29271
- if (!isRecord$3(value)) return null;
29262
+ if (!isRecord$2(value)) return null;
29272
29263
  const nextAgentContextByLookupKey = {};
29273
29264
  for (const [agentContextLookupKey, rawAgentContextState] of Object.entries(value)) {
29274
29265
  const parsedAgentContextState = parseAgentContextState(agentContextLookupKey, rawAgentContextState);
@@ -29280,7 +29271,7 @@ const parseAgentContextByLookupKey = (value) => {
29280
29271
  const parseAgentContextLifecycleCountersOrDefault = (value) => parseAgentContextLifecycleCounters(value);
29281
29272
  const parseBootstrapExecutionByLookupKey = (value) => {
29282
29273
  if (value === void 0) return {};
29283
- if (!isRecord$3(value)) return null;
29274
+ if (!isRecord$2(value)) return null;
29284
29275
  const nextBootstrapExecutionByLookupKey = {};
29285
29276
  for (const [agentContextLookupKey, executionState] of Object.entries(value)) {
29286
29277
  const parsedExecutionState = conversationExecutionStateSchema.safeParse(executionState);
@@ -29291,7 +29282,7 @@ const parseBootstrapExecutionByLookupKey = (value) => {
29291
29282
  return nextBootstrapExecutionByLookupKey;
29292
29283
  };
29293
29284
  const parseLedgerStateV1 = (value) => {
29294
- if (!isRecord$3(value)) return null;
29285
+ if (!isRecord$2(value)) return null;
29295
29286
  const { agentContextRotations, dedupeFirstSeenByKey, inflightByTaskId, replayedTaskIds, agentContextByLookupKey, bootstrapExecutionByLookupKey, agentContextLifecycleCounters, updatedAtMs, v } = value;
29296
29287
  if (v !== 1 || !isPositiveInteger(updatedAtMs)) return null;
29297
29288
  const nextDedupeFirstSeenByKey = parseDedupeFirstSeenByKey(dedupeFirstSeenByKey);
@@ -29777,7 +29768,7 @@ const compareRecoveryCandidate = (left, right) => {
29777
29768
  if (left.firstSeenAtMs !== right.firstSeenAtMs) return left.firstSeenAtMs - right.firstSeenAtMs;
29778
29769
  return left.taskId.localeCompare(right.taskId);
29779
29770
  };
29780
- const normalizeOutput$1 = (output) => {
29771
+ const normalizeOutput = (output) => {
29781
29772
  if (typeof output !== "string") return null;
29782
29773
  const trimmed = output.trim();
29783
29774
  if (trimmed.length === 0) return null;
@@ -29813,7 +29804,7 @@ const settleRecoveredTask = (input) => settleInflightTask({
29813
29804
  taskId: input.taskId
29814
29805
  });
29815
29806
  const buildTaskResultPayloadFromOutcome = (input) => {
29816
- const output = normalizeOutput$1(input.output);
29807
+ const output = normalizeOutput(input.output);
29817
29808
  const errorType = input.errorType ?? "internal";
29818
29809
  const commonFields = buildTaskResultCommonFields(input);
29819
29810
  const errorFields = buildTaskResultErrorFields(input);
@@ -31471,14 +31462,12 @@ function isDaemonReconcileInProgressError(error) {
31471
31462
  //#region ../../runtime/local-service/src/space-action-target-guidance.ts
31472
31463
  const SPACE_ACTION_CONTEXT_GUIDANCE_LINES = ["- Keep private work, drafts, tool logs, and unauthorized sensitive context local. Treat this Wake as the current source; tie other context to the claims it supports, and reply in its current thread unless explicitly redirected.", "- A plain reply or bare @name does not hand off work; use Wake or Reply + Wake. Never wake another Agent Profile just to thank, acknowledge, or confirm receipt; wake only when new work moves the goal forward."];
31473
31464
  const SPACE_ACTION_TARGET_GUIDANCE_LINES = [
31474
- "Prefer OpenMeld Space Action CLI target flags such as --wake and --reference.",
31475
- "For fallback openmeld-space-action blocks, target semantics only count when they are written in post_message.messageEnvelope.",
31465
+ "Use OpenMeld Space Action CLI target flags such as --wake and --reference.",
31476
31466
  "Any @name text in the body is only prose in the agent path; it does not define OpenMeld targets.",
31477
31467
  "activationTargets is only for waking another Agent Profile in this Space.",
31478
31468
  "activationTargets must reference an active Agent Profile member in this Space.",
31479
31469
  "Never put a Human Profile ID, sender ID, or reply recipient in activationTargets.",
31480
- "For a normal reply to the current Wake, leave activationTargets and referenceTargets empty.",
31481
- "Fallback openmeld-space-action target arrays must contain profileId strings, not objects. Example: {\"activationTargets\":[\"agt_11111111-1111-4111-8111-111111111111\"],\"referenceTargets\":[\"11111111-1111-4111-8111-111111111111\"]}."
31470
+ "For a normal reply to the current Wake, leave activationTargets and referenceTargets empty."
31482
31471
  ];
31483
31472
  //#endregion
31484
31473
  //#region ../../runtime/local-service/src/startup-command-capability.ts
@@ -41080,7 +41069,7 @@ async function clearDaemonStartFailureState(pathInput = {}) {
41080
41069
  await rm(daemonStartFailureStatePath(pathInput), { force: true }).catch(() => void 0);
41081
41070
  }
41082
41071
  function parseDaemonStartFailureState(value) {
41083
- if (!isRecord$2(value)) return null;
41072
+ if (!isRecord$1(value)) return null;
41084
41073
  if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
41085
41074
  const recordedAt = normalizeOptionalText$44(value.recordedAt);
41086
41075
  const detail = normalizeOptionalText$44(value.detail);
@@ -41103,7 +41092,7 @@ function parseDaemonStartFailureState(value) {
41103
41092
  function normalizeDependencyIssues(issues) {
41104
41093
  const normalized = [];
41105
41094
  for (const issue of issues) {
41106
- if (!isRecord$2(issue)) continue;
41095
+ if (!isRecord$1(issue)) continue;
41107
41096
  const kind = issue.kind;
41108
41097
  const status = issue.status;
41109
41098
  const scope = issue.scope;
@@ -41122,7 +41111,7 @@ function normalizeDependencyIssues(issues) {
41122
41111
  }
41123
41112
  return normalized;
41124
41113
  }
41125
- function isRecord$2(value) {
41114
+ function isRecord$1(value) {
41126
41115
  return typeof value === "object" && value !== null && !Array.isArray(value);
41127
41116
  }
41128
41117
  async function writeJsonAtomic(input) {
@@ -43765,394 +43754,6 @@ function preserveOptionalText(value) {
43765
43754
  if (typeof value !== "string" || value.trim().length === 0) return null;
43766
43755
  return value;
43767
43756
  }
43768
- const STRUCTURED_ACTION_BLOCK_INFO_STRING = "openmeld-space-action";
43769
- const STRUCTURED_ACTION_BLOCK_RE = /(?:\r?\n)?```openmeld-space-action\s*\r?\n([\s\S]*?)\r?\n```\s*$/;
43770
- const STRUCTURED_ACTION_BLOCK_LINE_BREAK_RE = /\r?\n/u;
43771
- const STRUCTURED_ACTION_BLOCK_HEADER_PART_RE = /\s+/u;
43772
- const STRUCTURED_ACTION_BLOCK_PARSE_ERROR = "OpenMeld Space structured action block must be valid JSON or simple OpenMeld action syntax";
43773
- const TRAILING_JSON_ACTION_PARSE_ERROR = "OpenMeld Space trailing JSON action must be a valid JSON object";
43774
- function normalizeOpenMeldSpaceEgressActionInput(input) {
43775
- if (!isRecord$1(input)) return input;
43776
- const action = { ...input };
43777
- switch (action.type) {
43778
- case "post_message": return normalizePostMessageEgressActionInput(action);
43779
- case "post_status": return normalizePostStatusEgressActionInput(action);
43780
- case "stay_silent": return normalizeStaySilentEgressActionInput(action);
43781
- default: return action;
43782
- }
43783
- }
43784
- function hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput(input) {
43785
- if (!(input.action && typeof input.action === "object")) return input.action;
43786
- const cleanedOutput = input.cleanedOutput.trim();
43787
- if (!cleanedOutput) return input.action;
43788
- const action = { ...input.action };
43789
- if (action.type === "post_message" && typeof action.text !== "string" && typeof action.message !== "string") return {
43790
- ...action,
43791
- text: cleanedOutput
43792
- };
43793
- if (action.type === "post_status" && typeof action.text !== "string" && typeof action.note !== "string") return {
43794
- ...action,
43795
- text: cleanedOutput
43796
- };
43797
- return action;
43798
- }
43799
- function tryExtractTrailingStructuredSpaceActionBlock(input) {
43800
- const rawOutput = typeof input.output === "string" ? input.output : "";
43801
- const trimmedOutput = rawOutput.trimEnd();
43802
- if (trimmedOutput.length === 0) return {
43803
- carrierKind: "none",
43804
- cleanedOutput: trimmedOutput,
43805
- action: null,
43806
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43807
- parseError: null
43808
- };
43809
- let output;
43810
- try {
43811
- output = normalizeOutput(rawOutput);
43812
- } catch (error) {
43813
- return {
43814
- carrierKind: "invalid_json",
43815
- cleanedOutput: trimmedOutput,
43816
- action: null,
43817
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43818
- parseError: error instanceof Error ? error.message : "OpenMeld Space structured action output is invalid"
43819
- };
43820
- }
43821
- const matched = STRUCTURED_ACTION_BLOCK_RE.exec(output);
43822
- if (!matched) return extractTrailingStandaloneJsonSpaceAction({
43823
- output,
43824
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING
43825
- });
43826
- const cleanedOutput = resolveInvalidBlockFallbackOutput({
43827
- matchedIndex: matched.index,
43828
- output
43829
- });
43830
- const blockText = matched[1]?.trim() ?? "";
43831
- if (blockText.length === 0) return {
43832
- carrierKind: "fenced_block",
43833
- cleanedOutput,
43834
- action: null,
43835
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43836
- parseError: "OpenMeld Space structured action block is empty"
43837
- };
43838
- const parsedBlock = tryParseStructuredSpaceActionBlockInput(blockText);
43839
- if (!(parsedBlock.actionInput && !parsedBlock.parseError)) return {
43840
- carrierKind: "fenced_block",
43841
- cleanedOutput,
43842
- action: null,
43843
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43844
- parseError: parsedBlock.parseError
43845
- };
43846
- try {
43847
- const action = normalizeExtractedOpenMeldSpaceEgressAction(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
43848
- action: parsedBlock.actionInput,
43849
- cleanedOutput
43850
- }));
43851
- return {
43852
- carrierKind: "fenced_block",
43853
- cleanedOutput: output.slice(0, matched.index).trimEnd(),
43854
- action,
43855
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43856
- parseError: null
43857
- };
43858
- } catch (error) {
43859
- return {
43860
- carrierKind: "fenced_block",
43861
- cleanedOutput,
43862
- action: null,
43863
- infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
43864
- parseError: error instanceof Error ? error.message : "OpenMeld Space egress action is invalid"
43865
- };
43866
- }
43867
- }
43868
- function extractTrailingStandaloneJsonSpaceAction(input) {
43869
- const candidates = resolveTrailingStandaloneJsonActionCandidates(input.output);
43870
- if (candidates.length === 0) return {
43871
- carrierKind: "none",
43872
- cleanedOutput: input.output,
43873
- action: null,
43874
- infoString: input.infoString,
43875
- parseError: null
43876
- };
43877
- let parseError = TRAILING_JSON_ACTION_PARSE_ERROR;
43878
- for (const candidate of candidates) {
43879
- const parsedJson = parseStructuredSpaceActionBlockJson(candidate.jsonText);
43880
- if (!(parsedJson && typeof parsedJson === "object" && !Array.isArray(parsedJson))) continue;
43881
- try {
43882
- const action = normalizeExtractedOpenMeldSpaceEgressAction(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
43883
- action: parsedJson,
43884
- cleanedOutput: candidate.cleanedOutput
43885
- }));
43886
- return {
43887
- carrierKind: "trailing_json",
43888
- cleanedOutput: candidate.cleanedOutput,
43889
- action,
43890
- infoString: input.infoString,
43891
- parseError: null
43892
- };
43893
- } catch (error) {
43894
- if (parseError === TRAILING_JSON_ACTION_PARSE_ERROR) parseError = error instanceof Error ? error.message : "OpenMeld Space egress action is invalid";
43895
- }
43896
- }
43897
- return {
43898
- carrierKind: "invalid_json",
43899
- cleanedOutput: input.output,
43900
- action: null,
43901
- infoString: input.infoString,
43902
- parseError
43903
- };
43904
- }
43905
- function tryParseStructuredSpaceActionBlockInput(blockText) {
43906
- const normalizedBlockText = blockText.trim();
43907
- if (normalizedBlockText.length === 0) return {
43908
- actionInput: null,
43909
- parseError: "OpenMeld Space structured action block is empty"
43910
- };
43911
- const parsedJson = parseStructuredSpaceActionBlockJson(normalizedBlockText);
43912
- if (parsedJson) return {
43913
- actionInput: parsedJson,
43914
- parseError: null
43915
- };
43916
- const parsedSimpleAction = parseSimpleStructuredSpaceActionBlock(normalizedBlockText);
43917
- if (parsedSimpleAction) return {
43918
- actionInput: parsedSimpleAction,
43919
- parseError: null
43920
- };
43921
- return {
43922
- actionInput: null,
43923
- parseError: STRUCTURED_ACTION_BLOCK_PARSE_ERROR
43924
- };
43925
- }
43926
- function normalizeOutput(value) {
43927
- const normalized = value.trimEnd();
43928
- if (normalized.length > 0) return normalized;
43929
- throw new Error("output is required");
43930
- }
43931
- function resolveTrailingStandaloneJsonActionCandidates(output) {
43932
- const candidateOutput = output.trimEnd();
43933
- if (!candidateOutput.endsWith("}")) return [];
43934
- return resolveTrailingStandaloneJsonLineStartIndices(candidateOutput).map((startIndex) => {
43935
- const jsonText = candidateOutput.slice(startIndex).trim();
43936
- return {
43937
- cleanedOutput: candidateOutput.slice(0, startIndex).trimEnd(),
43938
- jsonText
43939
- };
43940
- }).filter((candidate) => candidate.jsonText.startsWith("{") && candidate.jsonText.endsWith("}"));
43941
- }
43942
- function resolveTrailingStandaloneJsonLineStartIndices(output) {
43943
- const lineStartIndices = [];
43944
- let lineStartIndex = 0;
43945
- for (let index = 0; index <= output.length; index += 1) {
43946
- if (!(index === output.length || output[index] === "\n")) continue;
43947
- let candidateStartIndex = lineStartIndex;
43948
- while (candidateStartIndex < index && (output[candidateStartIndex] === " " || output[candidateStartIndex] === " ")) candidateStartIndex += 1;
43949
- if (output[candidateStartIndex] === "{") lineStartIndices.push(candidateStartIndex);
43950
- lineStartIndex = index + 1;
43951
- }
43952
- return lineStartIndices.reverse();
43953
- }
43954
- function resolveInvalidBlockFallbackOutput(input) {
43955
- const cleanedOutput = input.output.slice(0, input.matchedIndex).trimEnd();
43956
- return cleanedOutput.length > 0 ? cleanedOutput : "";
43957
- }
43958
- function parseStructuredSpaceActionBlockJson(blockText) {
43959
- try {
43960
- return JSON.parse(blockText);
43961
- } catch {
43962
- const repairedBlockText = appendMissingJsonClosers(blockText);
43963
- if (!repairedBlockText || repairedBlockText === blockText) return null;
43964
- try {
43965
- return JSON.parse(repairedBlockText);
43966
- } catch {
43967
- return null;
43968
- }
43969
- }
43970
- }
43971
- function isRecord$1(value) {
43972
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
43973
- }
43974
- function normalizePostMessageEgressActionInput(action) {
43975
- const { message, messageEnvelope, replyTo, text, ...rest } = action;
43976
- if (isRecord$1(messageEnvelope)) return {
43977
- ...rest,
43978
- messageEnvelope: normalizeMessageEnvelope(messageEnvelope)
43979
- };
43980
- const rawText = resolveLegacyPostMessageText({
43981
- message,
43982
- text
43983
- });
43984
- if (typeof rawText !== "string") return rest;
43985
- const rawReplyToSignalId = resolveLegacyReplyToSignalId(replyTo);
43986
- return {
43987
- ...rest,
43988
- messageEnvelope: normalizeMessageEnvelope({
43989
- ...rawReplyToSignalId ? { replyToSignalId: rawReplyToSignalId } : {},
43990
- text: rawText
43991
- })
43992
- };
43993
- }
43994
- function resolveLegacyPostMessageText(input) {
43995
- if (typeof input.text === "string") return input.text;
43996
- if (typeof input.message === "string") return input.message;
43997
- }
43998
- function resolveLegacyReplyToSignalId(value) {
43999
- if (!isRecord$1(value) || typeof value.signalId !== "string") return;
44000
- return value.signalId;
44001
- }
44002
- function normalizePostStatusEgressActionInput(action) {
44003
- const { note, ...rest } = action;
44004
- if (typeof rest.text !== "string" && typeof note === "string") return {
44005
- ...rest,
44006
- text: note.trim()
44007
- };
44008
- return rest;
44009
- }
44010
- function normalizeStaySilentEgressActionInput(action) {
44011
- const { note, ...rest } = action;
44012
- if (typeof rest.reason !== "string" && typeof note === "string") return {
44013
- ...rest,
44014
- reason: note.trim()
44015
- };
44016
- return rest;
44017
- }
44018
- function parseSimpleStructuredSpaceActionBlock(blockText) {
44019
- const [rawHeader, ...bodyLines] = trimSimpleStructuredActionOuterEmptyLines(blockText.split(STRUCTURED_ACTION_BLOCK_LINE_BREAK_RE));
44020
- const parsedHeader = parseSimpleStructuredActionHeader(rawHeader);
44021
- if (!parsedHeader) return null;
44022
- switch (parsedHeader.actionType) {
44023
- case "post_message": return buildSimplePostMessageAction({
44024
- bodyLines,
44025
- headerBody: parsedHeader.headerBody
44026
- });
44027
- case "stay_silent": return buildSimpleStaySilentAction({
44028
- bodyLines,
44029
- headerBody: parsedHeader.headerBody
44030
- });
44031
- case "post_status": return buildSimplePostStatusAction({
44032
- bodyLines,
44033
- headerArgs: parsedHeader.headerArgs
44034
- });
44035
- default: return null;
44036
- }
44037
- }
44038
- function parseSimpleStructuredActionHeader(rawHeader) {
44039
- const header = rawHeader?.trim();
44040
- if (!header) return null;
44041
- const [rawActionType, ...headerArgs] = header.split(STRUCTURED_ACTION_BLOCK_HEADER_PART_RE);
44042
- const actionType = rawActionType?.trim();
44043
- if (!actionType) return null;
44044
- return {
44045
- actionType,
44046
- headerArgs,
44047
- headerBody: headerArgs.join(" ").trim()
44048
- };
44049
- }
44050
- function buildSimplePostMessageAction(input) {
44051
- const text = joinSimpleStructuredActionTextParts([input.headerBody, joinSimpleStructuredActionText(input.headerBody ? input.bodyLines : trimSingleLeadingEmptyLine(input.bodyLines))]);
44052
- return text ? {
44053
- type: "post_message",
44054
- text
44055
- } : { type: "post_message" };
44056
- }
44057
- function buildSimpleStaySilentAction(input) {
44058
- const reason = joinSimpleStructuredActionTextParts([input.headerBody, joinSimpleStructuredActionText(input.headerBody ? input.bodyLines : trimSingleLeadingEmptyLine(input.bodyLines))]);
44059
- return reason ? {
44060
- type: "stay_silent",
44061
- reason
44062
- } : { type: "stay_silent" };
44063
- }
44064
- function buildSimplePostStatusAction(input) {
44065
- const statusFromHeader = input.headerArgs[0]?.trim();
44066
- const headerNote = input.headerArgs.slice(1).join(" ").trim();
44067
- const bodyLinesAfterSingleSpacer = trimSingleLeadingEmptyLine(input.bodyLines);
44068
- const status = statusFromHeader || bodyLinesAfterSingleSpacer[0]?.trim();
44069
- if (!status) return null;
44070
- let textLines;
44071
- if (statusFromHeader) textLines = headerNote ? [headerNote, ...input.bodyLines] : trimSingleLeadingEmptyLine(input.bodyLines);
44072
- else textLines = trimSingleLeadingEmptyLine(bodyLinesAfterSingleSpacer.slice(1));
44073
- const text = joinSimpleStructuredActionText(textLines);
44074
- return text ? {
44075
- type: "post_status",
44076
- status,
44077
- text
44078
- } : {
44079
- type: "post_status",
44080
- status
44081
- };
44082
- }
44083
- function trimSimpleStructuredActionOuterEmptyLines(lines) {
44084
- const nextLines = [...lines];
44085
- if (nextLines[0]?.trim() === "") nextLines.shift();
44086
- if (nextLines.at(-1)?.trim() === "") nextLines.pop();
44087
- return nextLines;
44088
- }
44089
- function trimSingleLeadingEmptyLine(lines) {
44090
- return lines[0]?.trim() === "" ? lines.slice(1) : lines;
44091
- }
44092
- function joinSimpleStructuredActionText(lines) {
44093
- const text = lines.join("\n");
44094
- return text.trim().length > 0 ? text : null;
44095
- }
44096
- function joinSimpleStructuredActionTextParts(parts) {
44097
- const definedParts = parts.filter((part) => typeof part === "string" && part.trim().length > 0);
44098
- if (definedParts.length === 0) return null;
44099
- return definedParts.join("\n");
44100
- }
44101
- function normalizeExtractedOpenMeldSpaceEgressAction(input) {
44102
- const normalizedInput = normalizeOpenMeldSpaceEgressActionInput(input);
44103
- const parsed = openMeldSpaceEgressActionSchema.safeParse(normalizedInput);
44104
- if (!parsed.success) throw new Error(parsed.error.issues[0]?.message ?? "OpenMeld Space egress action is invalid");
44105
- if (!(normalizedInput && typeof normalizedInput === "object")) return parsed.data;
44106
- if (parsed.data.type === "post_status") {
44107
- const preservedText = normalizedInput.text;
44108
- if (typeof preservedText === "string" && preservedText.trim().length > 0) return {
44109
- ...parsed.data,
44110
- text: preservedText
44111
- };
44112
- }
44113
- if (parsed.data.type === "post_message" && "messageEnvelope" in normalizedInput && normalizedInput.messageEnvelope && typeof normalizedInput.messageEnvelope === "object") {
44114
- const preservedText = normalizedInput.messageEnvelope.text;
44115
- if (typeof preservedText === "string" && preservedText.trim().length > 0) return {
44116
- ...parsed.data,
44117
- messageEnvelope: {
44118
- ...parsed.data.messageEnvelope,
44119
- text: preservedText
44120
- }
44121
- };
44122
- }
44123
- return parsed.data;
44124
- }
44125
- function appendMissingJsonClosers(blockText) {
44126
- const stack = [];
44127
- let inString = false;
44128
- let escaped = false;
44129
- for (const character of blockText) {
44130
- if (escaped) {
44131
- escaped = false;
44132
- continue;
44133
- }
44134
- if (character === "\\") {
44135
- escaped = true;
44136
- continue;
44137
- }
44138
- if (character === "\"") {
44139
- inString = !inString;
44140
- continue;
44141
- }
44142
- if (inString) continue;
44143
- if (character === "{") {
44144
- stack.push("}");
44145
- continue;
44146
- }
44147
- if (character === "[") {
44148
- stack.push("]");
44149
- continue;
44150
- }
44151
- if ((character === "}" || character === "]") && stack.at(-1) === character) stack.pop();
44152
- }
44153
- if (inString || stack.length === 0) return null;
44154
- return `${blockText}${stack.reverse().join("")}`;
44155
- }
44156
43757
  const SPACE_CONTRACT_ALLOWED_ACTION_ORDER = [
44157
43758
  "post_message",
44158
43759
  "post_status",
@@ -44177,41 +43778,23 @@ function areAllowedActionsEquivalent(left, right) {
44177
43778
  return canonicalLeft.length === canonicalRight.length && canonicalLeft.every((action, index) => action === canonicalRight[index]);
44178
43779
  }
44179
43780
  const COLLABORATION_HOW_THIS_SPACE_WORKS = "OpenMeld is an external collaboration layer, not your private scratchpad. Work normally in your local context, then publish only the public outcome this Space needs with one OpenMeld Space Action.";
44180
- const COLLABORATION_ACTION_REQUIREMENT = "Final outcome: use exactly one OpenMeld Space Action through the CLI. Only if every Space Action CLI command fails, use one trailing openmeld-space-action block.";
44181
- const COLLABORATION_REPAIR_REQUIREMENT = "Return the corrected final answer again, preserve the user's intent, and end with exactly one valid trailing ```openmeld-space-action``` JSON block.";
43781
+ const COLLABORATION_ACTION_REQUIREMENT = "Final outcome: call exactly one dispatch-scoped OpenMeld Space Action CLI command. Your answer text never selects or substitutes for that action.";
43782
+ const COLLABORATION_REPAIR_REQUIREMENT = "Preserve the user's intent and call exactly one dispatch-scoped OpenMeld Space Action CLI command. Do not print an action as JSON or prose.";
44182
43783
  const RAW_CONTEXT_SHARING_HOW_THIS_SPACE_WORKS = "This Space uses transparent context sharing: OpenMeld may share your raw reply directly. Use OpenMeld Space Action when you need a controlled visible outcome.";
44183
43784
  const RAW_CONTEXT_SHARING_ACTION_REQUIREMENT = "Raw reply is allowed. Use OpenMeld Space Action only when you need a controlled visible outcome.";
44184
- const RAW_CONTEXT_SHARING_REPAIR_REQUIREMENT = "If you keep a trailing ```openmeld-space-action``` block, it must be valid. Otherwise return the plain raw reply with no ```openmeld-space-action``` block.";
44185
- function buildActionSchemaGuidanceLines(input) {
44186
- const lines = ["Inside the block, JSON must use the key \"type\". Never use \"action\"."];
43785
+ const RAW_CONTEXT_SHARING_REPAIR_REQUIREMENT = "Return the plain raw reply, or call one dispatch-scoped OpenMeld Space Action CLI command for a controlled visible outcome. Answer text never becomes an action.";
43786
+ function buildActionGuidanceLines$1(input) {
43787
+ const lines = [];
44187
43788
  for (const allowedAction of input.allowedActions) switch (allowedAction) {
44188
43789
  case "post_message":
44189
- lines.push("Use post_message for normal public replies, greetings, answers, and discussion.");
44190
- lines.push([
44191
- "Canonical post_message block:",
44192
- "```openmeld-space-action",
44193
- "{\"type\":\"post_message\",\"messageEnvelope\":{\"text\":\"Hello.\",\"activationTargets\":[],\"referenceTargets\":[]}}",
44194
- "```"
44195
- ].join("\n"));
43790
+ lines.push("Use the dispatch-scoped Space Action reply command for normal public replies, greetings, answers, and discussion.");
44196
43791
  break;
44197
43792
  case "post_status":
44198
43793
  lines.push("Use post_status only for final-safe outcomes: done, blocked, needs_input, or handoff. Do not use \"working\" or \"ready\" because post_status closes the Wake.");
44199
43794
  lines.push(`Keep post_status text at 120 characters or fewer. Use post_message for answers, discussion, or anything longer.`);
44200
- lines.push([
44201
- "Canonical post_status block (prefer final-safe statuses: done | blocked | needs_input | handoff):",
44202
- "```openmeld-space-action",
44203
- "{\"type\":\"post_status\",\"status\":\"done\",\"text\":\"Status update.\"}",
44204
- "```"
44205
- ].join("\n"));
44206
43795
  break;
44207
43796
  case "stay_silent":
44208
- lines.push("Use stay_silent only when you intentionally do not want OpenMeld to publish a public reply.");
44209
- lines.push([
44210
- "Canonical stay_silent block:",
44211
- "```openmeld-space-action",
44212
- "{\"type\":\"stay_silent\",\"reason\":\"No public reply is needed.\"}",
44213
- "```"
44214
- ].join("\n"));
43797
+ lines.push("Use the dispatch-scoped Space Action silent command only when you intentionally do not want OpenMeld to publish a public reply.");
44215
43798
  break;
44216
43799
  default: break;
44217
43800
  }
@@ -44221,8 +43804,8 @@ function resolveSpacePublicationRequirement(input) {
44221
43804
  const publicationMode = input?.publicationMode ?? DEFAULT_SPACE_CONTRACT_FIELDS.publicationMode;
44222
43805
  const allowedActions = canonicalizeAllowedActions(input?.allowedActions ?? DEFAULT_SPACE_CONTRACT_FIELDS.allowedActions);
44223
43806
  if (publicationMode === "raw_context_sharing") return {
43807
+ actionGuidanceLines: buildActionGuidanceLines$1({ allowedActions }),
44224
43808
  actionRequirementLine: RAW_CONTEXT_SHARING_ACTION_REQUIREMENT,
44225
- actionSchemaGuidanceLines: buildActionSchemaGuidanceLines({ allowedActions }),
44226
43809
  allowedActions,
44227
43810
  allowsRawReplyWithoutAction: true,
44228
43811
  howThisSpaceWorks: RAW_CONTEXT_SHARING_HOW_THIS_SPACE_WORKS,
@@ -44231,8 +43814,8 @@ function resolveSpacePublicationRequirement(input) {
44231
43814
  requiresExplicitPublicAction: false
44232
43815
  };
44233
43816
  return {
43817
+ actionGuidanceLines: buildActionGuidanceLines$1({ allowedActions }),
44234
43818
  actionRequirementLine: COLLABORATION_ACTION_REQUIREMENT,
44235
- actionSchemaGuidanceLines: buildActionSchemaGuidanceLines({ allowedActions }),
44236
43819
  allowedActions,
44237
43820
  allowsRawReplyWithoutAction: false,
44238
43821
  howThisSpaceWorks: COLLABORATION_HOW_THIS_SPACE_WORKS,
@@ -51438,23 +51021,6 @@ const CODEX_USER_AGENT_VERSION_RE = /\/([^\s]+)/u;
51438
51021
  const CLI_SEMVER_RE = /\b(\d+\.\d+\.\d+(?:[-+][^\s]+)?)\b/u;
51439
51022
  const SEMVER_CORE_RE = /^v?(\d+)\.(\d+)\.(\d+)/u;
51440
51023
  const WHITESPACE_RE = /\s+/u;
51441
- const EMAIL_RE = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/iu;
51442
- const CLAUDE_UNAUTHENTICATED_OUTPUT_PATTERNS = [
51443
- "invalid api key",
51444
- "invalid token",
51445
- "expired token",
51446
- "missing api key",
51447
- "missing credentials",
51448
- "authentication_failed",
51449
- "oauth_org_not_allowed",
51450
- "failed to authenticate",
51451
- "authentication failed",
51452
- "oauth session expired",
51453
- "not logged in",
51454
- "not authenticated",
51455
- "not signed in",
51456
- "login required"
51457
- ];
51458
51024
  const latestControllerVersionCache = /* @__PURE__ */ new Map();
51459
51025
  const CONTROLLER_INTERFACE_SNAPSHOT_RESOLVERS = {
51460
51026
  "claude-code": resolveClaudeCodeInterfaceSnapshot,
@@ -51914,18 +51480,31 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
51914
51480
  launchContract: input.launchContract
51915
51481
  }), runLaunchContractCommand({
51916
51482
  allowNonZeroExit: true,
51917
- args: ["auth", "status"],
51483
+ args: [
51484
+ "auth",
51485
+ "status",
51486
+ "--json"
51487
+ ],
51918
51488
  launchContract: input.launchContract
51919
51489
  })]);
51920
51490
  const auth = resolveClaudeAuthSnapshot(authProbe);
51921
51491
  const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
51492
+ let message = input.baseSnapshot.message;
51493
+ let status = input.baseSnapshot.status;
51494
+ if (auth.status === "unauthenticated") {
51495
+ message = "Claude Code is installed, but this computer is not signed in to Claude Code.";
51496
+ status = "error";
51497
+ } else if (auth.status === "unknown") {
51498
+ message = "OpenMeld could not read Claude Code authentication status.";
51499
+ status = "warning";
51500
+ }
51922
51501
  return {
51923
- probeCompleted: authProbe.ok,
51502
+ probeCompleted: authProbe.ok && auth.status !== "unknown",
51924
51503
  snapshot: {
51925
51504
  ...input.baseSnapshot,
51926
51505
  auth,
51927
- message: auth.status === "unauthenticated" ? "Claude Code is installed, but this computer is not signed in to Claude Code." : input.baseSnapshot.message,
51928
- status: auth.status === "unauthenticated" ? "error" : input.baseSnapshot.status,
51506
+ message,
51507
+ status,
51929
51508
  version,
51930
51509
  versionAdvisory: await resolveControllerVersionAdvisory({
51931
51510
  checkedAt: input.baseSnapshot.checkedAt,
@@ -51942,7 +51521,11 @@ async function resolveCursorInterfaceSnapshot(input) {
51942
51521
  launchContract: input.launchContract
51943
51522
  }), runLaunchContractCommand({
51944
51523
  allowNonZeroExit: true,
51945
- args: ["status"],
51524
+ args: [
51525
+ "status",
51526
+ "--format",
51527
+ "json"
51528
+ ],
51946
51529
  launchContract: input.launchContract
51947
51530
  })]);
51948
51531
  const auth = resolveCursorAuthSnapshot(authProbe);
@@ -52437,45 +52020,25 @@ function resolveCodexAuthSnapshot(response) {
52437
52020
  function resolveClaudeAuthSnapshot(probe) {
52438
52021
  if (!probe.ok) return { status: "unknown" };
52439
52022
  const payload = parseJsonRecord(probe.stdout);
52440
- if (payload) {
52441
- if (typeof payload.loggedIn !== "boolean") return { status: "unknown" };
52442
- if (!payload.loggedIn) return { status: "unauthenticated" };
52443
- const email = normalizeOptionalText$15(payload.email);
52444
- return {
52445
- ...email ? { email } : {},
52446
- label: email ?? "Signed in",
52447
- status: "authenticated",
52448
- type: "claude"
52449
- };
52450
- }
52451
- const output = `${probe.stdout}\n${probe.stderr}`.trim();
52452
- const lower = output.toLowerCase();
52453
- if (CLAUDE_UNAUTHENTICATED_OUTPUT_PATTERNS.some((pattern) => lower.includes(pattern))) return { status: "unauthenticated" };
52454
- if (probe.code === 0 && output.length > 0) {
52455
- const email = resolveLikelyEmail(output);
52456
- return {
52457
- ...email ? { email } : {},
52458
- label: email ?? "Signed in",
52459
- status: "authenticated",
52460
- type: "claude"
52461
- };
52462
- }
52463
- return { status: "unknown" };
52023
+ if (typeof payload?.loggedIn !== "boolean") return { status: "unknown" };
52024
+ if (!payload.loggedIn) return { status: "unauthenticated" };
52025
+ const email = normalizeOptionalText$15(payload.email);
52026
+ return {
52027
+ ...email ? { email } : {},
52028
+ label: email ?? "Signed in",
52029
+ status: "authenticated",
52030
+ type: "claude"
52031
+ };
52464
52032
  }
52465
52033
  function resolveCursorAuthSnapshot(probe) {
52466
52034
  if (!probe.ok) return { status: "unknown" };
52467
- const output = `${probe.stdout}\n${probe.stderr}`.trim();
52468
- const lowered = output.toLowerCase();
52469
- if (lowered.includes("not logged in") || lowered.includes("not authenticated") || lowered.includes("login required")) return { status: "unauthenticated" };
52470
- if (lowered.includes("logged in") || lowered.includes("authenticated")) {
52471
- const email = resolveLikelyEmail(output);
52472
- return {
52473
- ...email ? { email } : {},
52474
- label: email ?? "Signed in",
52475
- status: "authenticated",
52476
- type: "cursor_login"
52477
- };
52478
- }
52035
+ const payload = parseJsonRecord(probe.stdout);
52036
+ if (payload?.status === "unauthenticated") return { status: "unauthenticated" };
52037
+ if (payload?.status === "authenticated") return {
52038
+ label: "Signed in",
52039
+ status: "authenticated",
52040
+ type: "cursor_login"
52041
+ };
52479
52042
  return { status: "unknown" };
52480
52043
  }
52481
52044
  function resolveOpenClawAuthProbe(probe) {
@@ -52562,9 +52125,6 @@ function normalizeOptionalText$15(value) {
52562
52125
  const normalized = value.trim();
52563
52126
  return normalized.length > 0 ? normalized : null;
52564
52127
  }
52565
- function resolveLikelyEmail(value) {
52566
- return value.match(EMAIL_RE)?.[0] ?? null;
52567
- }
52568
52128
  function toErrorMessage$16(error) {
52569
52129
  if (error instanceof Error) {
52570
52130
  const message = error.message.trim();
@@ -57315,14 +56875,14 @@ function renderMandatoryCompletionSection(input) {
57315
56875
  "- Do not finish this Wake with a plain-text final answer. Plain prose stays local and is not a public Space reply in Collaboration mode.",
57316
56876
  buildMandatoryCompletionActionLine(input, publicationRequirement),
57317
56877
  "- After the Space Action command succeeds, stop. OpenMeld reads that command as the public outcome.",
57318
- `- Use fallback JSON only if the Space Action command cannot run: \`${buildPromptSpaceActionCommand(input)}\`.`
56878
+ "- If the command cannot run, stop and let OpenMeld report the structured failure. Do not print JSON or prose as a substitute for the tool call."
57319
56879
  ].join("\n");
57320
56880
  }
57321
56881
  function buildMandatoryCompletionActionLine(input, publicationRequirement) {
57322
56882
  if (publicationRequirement.allowedActions.includes("post_message")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "reply \"your public message\"")}\` and wait for it to finish.`;
57323
56883
  if (publicationRequirement.allowedActions.includes("post_status")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "status done \"short completion update\"")}\` and wait for it to finish.`;
57324
56884
  if (publicationRequirement.allowedActions.includes("stay_silent")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "silent --reason \"reason\"")}\` and wait for it to finish.`;
57325
- return `- Normal completion: run \`${buildPromptSpaceActionCommand(input)}\` and return one valid trailing openmeld-space-action block.`;
56885
+ return "- No permitted OpenMeld Space action is available. Do not invent one in answer text.";
57326
56886
  }
57327
56887
  function buildServiceFreshnessWarningLines(input) {
57328
56888
  return input.serviceFreshnessWarningLines?.filter(Boolean) ?? [];
@@ -57359,9 +56919,6 @@ function buildActionGuidanceLines(input) {
57359
56919
  function buildSpaceActionCommand(input, action) {
57360
56920
  return `${normalizeOptionalText$44(input.cliEntry) ?? "openmeld"} space action ${action}`;
57361
56921
  }
57362
- function buildPromptSpaceActionCommand(input) {
57363
- return `${normalizeOptionalText$44(input.cliEntry) ?? "openmeld"} prompt space-action --raw`;
57364
- }
57365
56922
  function buildSendTargetReferenceLines(input) {
57366
56923
  if (!(input.sendTargetReferenceLines && input.sendTargetReferenceLines.length > 0)) return [];
57367
56924
  return ["- Send target reference:", ...input.sendTargetReferenceLines.map((line) => ` ${line}`)];
@@ -63391,8 +62948,8 @@ function renderDaemonStartNeedsAttention(input) {
63391
62948
  //#endregion
63392
62949
  //#region src/local-components/manifest.ts
63393
62950
  const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-05-local-components-v1";
63394
- const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-05-required-v1";
63395
- const OPENMELD_SERVICE_CONTRACT_VERSION = CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH;
62951
+ const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-08-tool-owned-actions-v2";
62952
+ const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-08-agent-answers-content-v1";
63396
62953
  const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
63397
62954
  const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
63398
62955
  "version_outdated",
@@ -63790,8 +63347,8 @@ const RECOVERY_PROMPT = [
63790
63347
  "OpenMeld execution recovery.",
63791
63348
  "Continue this exact controller conversation.",
63792
63349
  "Do not redo the task, call tools, edit files, or perform external actions.",
63793
- "Return only the final answer that was already completed in this conversation.",
63794
- "If the conversation has no completed final answer, return exactly RECOVERY_RESULT_UNAVAILABLE."
63350
+ "Return the best faithful final answer you can recover from this conversation.",
63351
+ "Your answer is content only. OpenMeld decides recovery status from the typed provider outcome, never from words in your answer."
63795
63352
  ].join(" ");
63796
63353
  async function resumeExactControllerConversation(input) {
63797
63354
  const identity = input.request.identity;
@@ -63851,7 +63408,7 @@ async function resumeExactControllerConversation(input) {
63851
63408
  status: "outcome_unknown"
63852
63409
  };
63853
63410
  const output = result.output.trim();
63854
- if (!output || output === "RECOVERY_RESULT_UNAVAILABLE") return {
63411
+ if (!output) return {
63855
63412
  destination: input.request.destination,
63856
63413
  identity,
63857
63414
  message: "The exact conversation did not contain a completed result.",
@@ -65766,7 +65323,7 @@ function buildAgentReplyReconsiderationPrompt(input) {
65766
65323
  "Keep the user's full request as the goal. Reconsider only the final Space action in light of these newer messages.",
65767
65324
  "Replace the proposal when a distinct, useful contribution is still possible. Avoid duplicating work or a conclusion another Agent has already posted.",
65768
65325
  "Choose stay_silent only when no distinct, useful, non-duplicative contribution remains.",
65769
- "Return exactly one final OpenMeld Space action. You may use the dispatch-scoped Space Action CLI or a trailing openmeld-space-action block.",
65326
+ "Call exactly one dispatch-scoped OpenMeld Space Action CLI command for the final action. Answer text never becomes an action.",
65770
65327
  `Previous proposed action: ${JSON.stringify(input.action)}`,
65771
65328
  `Newer Space messages: ${JSON.stringify(updates)}`
65772
65329
  ].join("\n");
@@ -66439,7 +65996,6 @@ function buildResultDispatchJournalMetadata(payload) {
66439
65996
  }
66440
65997
  //#endregion
66441
65998
  //#region src/local-service/dispatch/execute-dispatch-structured-action-repair.ts
66442
- const STRUCTURED_SPACE_ACTION_BLOCK_HEADER_REGEX = /^\s*\r?\n?/u;
66443
65999
  function resolveStructuredActionRequirementFailure$1(input) {
66444
66000
  if (input.resolution.parseError) return {
66445
66001
  failureReason: input.resolution.parseError,
@@ -66490,12 +66046,12 @@ function buildStructuredActionRepairPrompt$1(input) {
66490
66046
  "This is a bounded repair of the public delivery action only. Do not redo the user's work.",
66491
66047
  "Do not change the user's intent.",
66492
66048
  ...SPACE_ACTION_CONTEXT_GUIDANCE_LINES,
66493
- "OpenMeld only consumes your final answer and at most one valid trailing ```openmeld-space-action``` JSON block.",
66494
- "If an OpenMeld Space Action CLI command is available, run that command instead of printing fallback JSON.",
66049
+ "Your answer text never selects an OpenMeld Space action.",
66050
+ "Call exactly one dispatch-scoped OpenMeld Space Action CLI command to repair the delivery action.",
66495
66051
  publicationRequirement.repairRequirementLine,
66496
66052
  ...SPACE_ACTION_TARGET_GUIDANCE_LINES,
66497
66053
  ...normalizeOptionalText$44(input.currentReplyToSignalId) ? [`post_message.messageEnvelope.replyToSignalId must match the current dispatch reply target: ${normalizeOptionalText$44(input.currentReplyToSignalId)}.`] : [],
66498
- ...publicationRequirement.actionSchemaGuidanceLines,
66054
+ ...publicationRequirement.actionGuidanceLines,
66499
66055
  ...buildStructuredActionRepairSendTargetReferenceLines(input.sendTargetReferenceLines),
66500
66056
  `If you need recent public room context, use \`${historyCommand}\`.`,
66501
66057
  `If you need the OpenMeld action rules again, read the official guidance with \`${promptCommand}\` or \`${spaceGuideCommand}\`.`,
@@ -66510,7 +66066,7 @@ function buildStructuredActionRepairCompletionLines(input) {
66510
66066
  return [
66511
66067
  "Repair completion rule:",
66512
66068
  buildStructuredActionRepairPrimaryCommandLine(input),
66513
- "If the command cannot run, finish with the corrected public answer followed by exactly one valid trailing ```openmeld-space-action``` block.",
66069
+ "If the command cannot run, stop. Do not print JSON or prose as a substitute for the tool call.",
66514
66070
  "Do not finish with an explanation of what you will do."
66515
66071
  ];
66516
66072
  }
@@ -66518,7 +66074,7 @@ function buildStructuredActionRepairPrimaryCommandLine(input) {
66518
66074
  if (input.publicationRequirement.allowedActions.includes("post_message")) return `For a normal reply, run \`${input.cliEntry} space action reply "corrected public message"\` now and wait for it to finish.`;
66519
66075
  if (input.publicationRequirement.allowedActions.includes("post_status")) return `For a final status, run \`${input.cliEntry} space action status done "short completion update"\` now and wait for it to finish.`;
66520
66076
  if (input.publicationRequirement.allowedActions.includes("stay_silent")) return `If no public reply is needed, run \`${input.cliEntry} space action silent --reason "reason"\` now and wait for it to finish.`;
66521
- return `Run \`${input.cliEntry} prompt space-action --raw\` now and return one valid trailing openmeld-space-action block.`;
66077
+ return "No permitted OpenMeld Space action is available. Do not invent one in answer text.";
66522
66078
  }
66523
66079
  function buildStructuredActionRepairSendTargetReferenceLines(sendTargetReferenceLines) {
66524
66080
  if (!(sendTargetReferenceLines && sendTargetReferenceLines.length > 0)) return [];
@@ -66536,51 +66092,6 @@ function resolveStructuredActionRepairContinuation$1(input) {
66536
66092
  agentControllerConversationOverride: input.runtimeResult.contextResolution?.agentControllerConversation ?? contextDelta?.agentControllerConversation ?? input.agentControllerConversationOverride ?? null
66537
66093
  };
66538
66094
  }
66539
- function buildSyntheticStructuredSpaceActionRepairResult$1(input) {
66540
- const payload = input.runtimeResult.resultPayload;
66541
- if (payload.status !== "success" && payload.status !== "partial_success") return null;
66542
- const repairedAction = attemptLocalStructuredSpaceActionRepair(payload.output);
66543
- if (!repairedAction) return null;
66544
- const candidate = resolveTrailingStructuredSpaceActionCandidate(payload.output);
66545
- return {
66546
- ...input.runtimeResult,
66547
- resultPayload: {
66548
- ...payload,
66549
- output: resolveStructuredActionOutputFallback({
66550
- action: repairedAction,
66551
- cleanedOutput: candidate?.cleanedOutput ?? payload.output
66552
- }),
66553
- spaceAction: repairedAction
66554
- }
66555
- };
66556
- }
66557
- function attemptLocalStructuredSpaceActionRepair(output) {
66558
- const candidate = resolveTrailingStructuredSpaceActionCandidate(output);
66559
- if (!candidate) return;
66560
- const parsedBlock = tryParseStructuredSpaceActionBlockInput(candidate.blockText);
66561
- if (!(parsedBlock.actionInput && !parsedBlock.parseError)) return;
66562
- const normalizedAction = normalizeOpenMeldSpaceEgressActionInput(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
66563
- action: parsedBlock.actionInput,
66564
- cleanedOutput: candidate.cleanedOutput
66565
- }));
66566
- const parsedAction = openMeldSpaceEgressActionSchema.safeParse(normalizedAction);
66567
- if (!parsedAction.success) return;
66568
- return parsedAction.data;
66569
- }
66570
- function resolveTrailingStructuredSpaceActionCandidate(output) {
66571
- const normalizedOutput = typeof output === "string" ? output : "";
66572
- const markerIndex = normalizedOutput.lastIndexOf("```openmeld-space-action");
66573
- if (markerIndex < 0) return null;
66574
- const afterMarker = normalizedOutput.slice(markerIndex + 24);
66575
- const blockStartOffset = STRUCTURED_SPACE_ACTION_BLOCK_HEADER_REGEX.exec(afterMarker)?.[0].length ?? 0;
66576
- let blockText = afterMarker.slice(blockStartOffset).trim();
66577
- if (blockText.endsWith("```")) blockText = blockText.slice(0, -3).trimEnd();
66578
- if (blockText.length === 0) return null;
66579
- return {
66580
- blockText,
66581
- cleanedOutput: normalizedOutput.slice(0, markerIndex).trimEnd()
66582
- };
66583
- }
66584
66095
  function buildInvalidStructuredActionOutputPreview(runtimeResult) {
66585
66096
  const payload = runtimeResult.resultPayload;
66586
66097
  if (payload.status !== "success" && payload.status !== "partial_success") return null;
@@ -66754,7 +66265,6 @@ const reconcileBootstrapInjectedContextAfterDispatch = reconcileBootstrapInjecte
66754
66265
  const resolveBootstrapPlan = resolveBootstrapPlan$1;
66755
66266
  const rollbackBootstrapExecutionStateAfterDispatchFailure = rollbackBootstrapExecutionStateAfterDispatchFailure$1;
66756
66267
  const buildStructuredActionRepairPrompt = buildStructuredActionRepairPrompt$1;
66757
- const buildSyntheticStructuredSpaceActionRepairResult = buildSyntheticStructuredSpaceActionRepairResult$1;
66758
66268
  const coerceRuntimeResultToStructuredActionFailure = coerceRuntimeResultToStructuredActionFailure$1;
66759
66269
  const resolveStructuredActionRepairContinuation = resolveStructuredActionRepairContinuation$1;
66760
66270
  const resolveStructuredActionRequirementFailure = resolveStructuredActionRequirementFailure$1;
@@ -69179,10 +68689,7 @@ function normalizeResolvedPostMessageAction(input) {
69179
68689
  const normalizedPostMessageAction = normalizeDispatchPostMessageAction({
69180
68690
  action,
69181
68691
  currentReplyToSignalId: input.parsedTask.replyToSnapshot?.signalId ?? null,
69182
- inputKind: resolvePostMessageInputKind({
69183
- runtimeResult: input.runtimeResult,
69184
- structuredSpaceActionResolution: input.structuredSpaceActionResolution
69185
- }),
68692
+ inputKind: "direct_payload",
69186
68693
  sendTargetReference: input.sendTargetReference
69187
68694
  });
69188
68695
  emitRunLine({
@@ -69210,10 +68717,7 @@ function normalizeResolvedPostMessageAction(input) {
69210
68717
  activationTargetsCount: action.messageEnvelope.activationTargets.length,
69211
68718
  dispatchId: input.parsedTask.dispatchId,
69212
68719
  failureReason,
69213
- inputKind: resolvePostMessageInputKind({
69214
- runtimeResult: input.runtimeResult,
69215
- structuredSpaceActionResolution: input.structuredSpaceActionResolution
69216
- }),
68720
+ inputKind: "direct_payload",
69217
68721
  memberDirectoryLoaded: input.sendTargetReference.status === "loaded",
69218
68722
  referenceTargetsCount: action.messageEnvelope.referenceTargets.length,
69219
68723
  replyToSignalIdResolved: Boolean(action.messageEnvelope.replyToSignalId),
@@ -69301,55 +68805,14 @@ async function maybeRepairStructuredSpaceAction(input) {
69301
68805
  taskId: input.parsedTask.taskId
69302
68806
  }
69303
68807
  });
69304
- const localRepairEvaluation = resolveStructuredActionRepairEvaluation({
69305
- runtimeResult: input.runtimeResult,
69306
- useLocalSyntheticRepair: true
69307
- });
69308
- if (localRepairEvaluation.accepted && localRepairEvaluation.runtimeResult) {
69309
- emitRunLine({
69310
- presenter: input.presenter,
69311
- code: "daemon.run.structured_action_repair_completed",
69312
- text: `structured OpenMeld Space action repair completed for task ${input.parsedTask.taskId}`,
69313
- payload: {
69314
- dispatchId: input.parsedTask.dispatchId,
69315
- repaired: true,
69316
- repairMode: "local_synthetic",
69317
- targetProfileId: input.parsedTask.targetProfileId,
69318
- taskId: input.parsedTask.taskId
69319
- }
69320
- });
69321
- return {
69322
- finalFailureDiagnostics: null,
69323
- runtimeResult: applyStructuredSpaceActionProvenanceToRuntimeResult({
69324
- runtimeResult: localRepairEvaluation.runtimeResult,
69325
- provenance: "local_repair"
69326
- })
69327
- };
69328
- }
69329
- const localFailureDiagnostics = resolveStructuredActionFailureDiagnostics({
69330
- carrierKind: localRepairEvaluation.carrierKind,
69331
- parseError: localRepairEvaluation.parseError ?? input.failureReason,
69332
- publicFailureReason: input.failureReason,
69333
- repairMode: "local_synthetic",
69334
- runtimeResult: localRepairEvaluation.runtimeResult ?? input.runtimeResult
69335
- });
69336
- emitRunLine({
69337
- presenter: input.presenter,
69338
- code: "daemon.run.structured_action_repair_failed",
69339
- text: `structured OpenMeld Space action repair failed for task ${input.parsedTask.taskId}`,
69340
- payload: {
69341
- dispatchId: input.parsedTask.dispatchId,
69342
- ...localFailureDiagnostics,
69343
- failureReason: input.failureReason,
69344
- repairedRuntimeStatus: localRepairEvaluation.repairedRuntimeStatus,
69345
- repairedStructuredActionPresent: localRepairEvaluation.repairedStructuredActionPresent,
69346
- repairMode: "local_synthetic",
69347
- targetProfileId: input.parsedTask.targetProfileId,
69348
- taskId: input.parsedTask.taskId
69349
- }
69350
- });
69351
68808
  if (!input.runControllerRepair) return {
69352
- finalFailureDiagnostics: localFailureDiagnostics,
68809
+ finalFailureDiagnostics: resolveStructuredActionFailureDiagnostics({
68810
+ carrierKind: "none",
68811
+ parseError: input.failureReason,
68812
+ publicFailureReason: input.failureReason,
68813
+ repairMode: "controller_roundtrip",
68814
+ runtimeResult: input.runtimeResult
68815
+ }),
69353
68816
  runtimeResult: null
69354
68817
  };
69355
68818
  let providerRepairRuntimeResult;
@@ -69405,10 +68868,7 @@ async function maybeRepairStructuredSpaceAction(input) {
69405
68868
  presenter: input.presenter,
69406
68869
  runtimeResult: providerRepairRuntimeResult
69407
68870
  });
69408
- const providerRepairEvaluation = resolveStructuredActionRepairEvaluation({
69409
- runtimeResult: providerRepairRuntimeResult,
69410
- useLocalSyntheticRepair: true
69411
- });
68871
+ const providerRepairEvaluation = resolveStructuredActionRepairEvaluation({ runtimeResult: providerRepairRuntimeResult });
69412
68872
  if (!(providerRepairEvaluation.accepted && providerRepairEvaluation.runtimeResult)) {
69413
68873
  const providerFailureDiagnostics = resolveStructuredActionFailureDiagnostics({
69414
68874
  carrierKind: providerRepairEvaluation.carrierKind,
@@ -69458,7 +68918,7 @@ async function maybeRepairStructuredSpaceAction(input) {
69458
68918
  };
69459
68919
  }
69460
68920
  function resolveStructuredActionRepairEvaluation(input) {
69461
- const runtimeResult = input.useLocalSyntheticRepair ? buildSyntheticStructuredSpaceActionRepairResult({ runtimeResult: input.runtimeResult }) ?? input.runtimeResult : input.runtimeResult;
68921
+ const runtimeResult = input.runtimeResult;
69462
68922
  const repairedResolution = resolveStructuredSpaceActionFromRuntimePayload(runtimeResult);
69463
68923
  const repairedAction = runtimeResult.resultPayload.spaceAction ?? repairedResolution.action;
69464
68924
  const repairedRuntimeStatus = runtimeResult.resultPayload.status;
@@ -69513,15 +68973,11 @@ function resolveStructuredSpaceActionFromRuntimePayload(runtimeResult) {
69513
68973
  cleanedOutput: void 0,
69514
68974
  parseError: null
69515
68975
  };
69516
- const extraction = tryExtractTrailingStructuredSpaceActionBlock({ output: payload.output });
69517
68976
  return {
69518
- action: extraction.action ?? void 0,
69519
- carrierKind: extraction.carrierKind,
69520
- cleanedOutput: extraction.action === null ? extraction.cleanedOutput : resolveStructuredActionOutputFallback({
69521
- action: extraction.action,
69522
- cleanedOutput: extraction.cleanedOutput
69523
- }),
69524
- parseError: extraction.parseError
68977
+ action: payload.spaceAction,
68978
+ carrierKind: "none",
68979
+ cleanedOutput: void 0,
68980
+ parseError: null
69525
68981
  };
69526
68982
  }
69527
68983
  function applyStructuredSpaceActionResolutionToRuntimePayload(input) {
@@ -69552,10 +69008,6 @@ function resolveStructuredSpaceActionProvenance(input) {
69552
69008
  if (!input.resolvedSpaceAction) return;
69553
69009
  return input.runtimeResult.resultPayload.spaceActionProvenance ?? "direct";
69554
69010
  }
69555
- function resolvePostMessageInputKind(input) {
69556
- if (input.runtimeResult.resultPayload.spaceAction?.type === "post_message") return "direct_payload";
69557
- return input.structuredSpaceActionResolution.carrierKind === "trailing_json" ? "trailing_json" : "fenced_block";
69558
- }
69559
69011
  function runDispatchRuntimeExecution(input) {
69560
69012
  return runRuntimeTask({
69561
69013
  ...input.agentControllerConversationOverride ? { agentContextOverride: {
@@ -97102,8 +96554,6 @@ const LEAVE_CARD_MIN_CONTENT_WIDTH = 8;
97102
96554
  const LEAVE_CARD_LEADING_BLANK_LINES = 2;
97103
96555
  const MEMBERS_PANEL_REFRESH_DEBOUNCE_MS = 250;
97104
96556
  const SPACE_META_REFRESH_DEBOUNCE_MS = 1e3;
97105
- const SPACE_MEMBER_ADDED_NOTICE_REGEX = / added .+ to this space\./i;
97106
- const SPACE_MEMBER_REMOVED_NOTICE_REGEX = / removed .+ from this space\./i;
97107
96557
  function resolveOptionalReadableLocalSpaceConfig(result, operation) {
97108
96558
  if (result.kind === "missing") return null;
97109
96559
  if (isLocalSpaceStateCorruptResult(result)) throw toLocalSpaceStateIntegrityError({
@@ -99498,9 +98948,7 @@ function shouldRefreshMembersSnapshotForEvent(event) {
99498
98948
  const meta = resolveSignalTextMetaFromEnvelope$1(event);
99499
98949
  const purpose = String(meta?.purpose ?? "").trim();
99500
98950
  if (purpose === "space_membership_join_notice" || purpose === "space_membership_remove_notice") return true;
99501
- const text = resolveNonTransientSignalText(event);
99502
- if (!text) return false;
99503
- return SPACE_MEMBER_ADDED_NOTICE_REGEX.test(text) || SPACE_MEMBER_REMOVED_NOTICE_REGEX.test(text);
98951
+ return false;
99504
98952
  }
99505
98953
  function shouldRefreshSpaceMetaForEvent(event) {
99506
98954
  if (!isSignalEnvelope(event)) return false;
@@ -106949,4 +106397,4 @@ function isHumanInteractiveSpaceRuntime(runtime) {
106949
106397
  //#endregion
106950
106398
  export { runAgentsRepair as $, readAgentActivityIntegrationStatus as $a, performManagedInstall as $i, formatDaemonServiceDowngradeBlockedRecommendation as $n, resolveProfileWorkspaceRuntime as $r, readBundledOpenMeldCliSkillDocumentByPath as $t, assertFullSignalIdArgument as A, alignSelectedOpenMeldProfileStorage as Aa, getAgentControllerPermissionModeDisplayMetadata as Ai, inspectSpaceCacheFile as An, unbindProject as Ao, buildAgentOverviewFromContract as Ar, shouldEmitAgentOverview as At, persistAgentTransportSelection as B, getProfileDefaultView as Ba, getCurrentCommandCheckState as Bi, formatRemovedCcRelationMessage as Bn, outLine as Bo, runDaemonServiceFullAlignment as Br, parseJsonResponse$1 as Bt, toSpaceMetaUpsertInput as C, createOpenMeldAgentProfile as Ca, classifyDaemonServiceWakeability as Ci, submitProfileRuntimeAgentControllerReport as Cn, bindProject as Co, registerSpaceMemberSelectionOptions as Cr, runDaemonTeardownStrict as Ct, formatHumanReadTargetList as D, primeOpenMeldProfilesSessionCache as Da, resolveOpenMeldEnvironmentTarget as Di, resolveLocalAgentControllerBlockerReasonCodes as Dn, removeProjectConnection as Do, registerDaemonControlTargetOptions as Dr, reconcileCliVersionView as Dt, buildHumanReplyContextSummary as E, listOpenMeldProfiles as Ea, resolveDaemonDeviceId as Ei, collectLocalAgentControllerInventory as En, migrateProjectBindingStore as Eo, getCliVersionInfo as Er, buildProfileWorkspaceRows as Et, emitSpaceAgentOverview as F, buildHumanAuthenticationCard as Fa, resolveAgentExecutionStatus as Fi, buildSignalIndex as Fn, renderTextInfoCard as Fo, OPENMELD_AGENT_MENTAL_MODEL_LINES as Fr, fetchSpaceMeta as Ft, runAgentsCustomList as G, requestLocalAgentActivitySync as Ga, resolveVersionChangeDirection as Gi, assessCliUpdate as Gn, cliJsonSkillsShowEnvelopeSchema as Go, formatAgentReplyReadinessLabel as Gr, runDaemonStartDecisionPrompt as Gt, runAgents as H, LocalProjectConnectionError as Ha, resetCurrentCommandCheckState as Hi, promptSearchSelect as Hn, cliJsonOutputEnvelopeSchema as Ho, resolveServiceReadinessFromServiceStatus as Hr, writeInstalledLocalComponentsSnapshot as Ht, emitSpaceCliAgentOverview as I, createAuthenticationError as Ia, resolveAgentProfileEditCapabilities as Ii, buildSignalMessageReadProjection as In, sanitizeTerminalDisplayText as Io, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Ir, updateSpaceMeta as It, runAgentsDetect as J, resolveAgentActivityRouteForPath as Ja, getDaemonSystemServiceLogPath as Ji, readDispatchOwnedRuntimeGuard as Jn, revokeOrganizationJoinLinkResponseSchema as Jo, mapAgentReplyReadinessToLegacyAutoReply as Jr, runSkillsEnsure as Jt, runAgentsCustomRemove as K, isAgentActivityRouteRegistered as Ka, readCurrentDaemonRuntimeContext as Ki, isCliUpdateCheckApplicable as Kn, getOrganizationJoinLinkResponseSchema as Ko, formatDeviceReplyReadinessLabel as Kr, collectSkillsReadinessSnapshot as Kt, prepareLocalAgentReadiness as L, resolveAuthenticationGuidance as La, resolveEvidenceSyncHealth as Li, buildSpaceRoundReadProjection as Ln, emitCliJsonEnvelope as Lo, areAllowedActionsEquivalent as Lr, readGatewayJsonResponse as Lt, prepareAuthenticatedSpaceCommandContext as M, getSelectedOpenMeldProfileId as Ma, listAgentControllerPermissionModeOptions as Mi, assertNoRemovedCcSpaceAddressingSyntax as Mn, enqueueControllerTaskLifecycleEventWhileLocked as Mo, formatDualViewGuideForDisplay as Mr, readDaemonStartFailureLogTailLines as Mt, resolveOpenMeldProfileForSpaceCommand as N, setSelectedOpenMeldProfileId as Na, parseAgentControllerRef as Ni, buildDispatchResultMessageReadProjection as Nn, readControllerTaskLifecycleOutboxHealth as No, buildDualViewGuideMessage as Nr, fetchSpaceUpdates as Nt, parseEnvelope as O, resolveOpenMeldProfile as Oa, buildAgentControllerRef as Oi, resolveLocalAgentControllerLaunchability as On, runIfAgentActivityBindingGenerationIsCurrent as Oo, registerAuthLoginRequestOptions as Or, emitDaemonAgentOverview as Ot, resolveSpaceAccessLabel as P, buildAgentAuthenticationGuide as Pa, resolveAgentControllerPermissionModeForController as Pi, buildDispatchResultReplyWorkflowProjection as Pn, renderInfoCard as Po, formatAgentOverviewPayload as Pr, createCliSpaceApi as Pt, runAgentsManage as Q, installAgentActivityIntegrations as Qa, buildInstallSelfJsonPayload as Qi, resolveElapsedTimeMs as Qn, createModelCatalogReadSession as Qr, ensureLocalSkills as Qt, buildReplyReadinessGuidance as R, resolveAuthenticationGuidanceFromError as Ra, resolveNativeAgentControllerPermissionModeForController as Ri, buildUpdatesReplyWorkflowProjection as Rn, errLine as Ro, buildAgentFacingPublicationModeGuideLines as Rr, readGatewayTextResponse as Rt, loadSpaceSignalIndexOrNull as S, resolveOpenMeldProfileOrNull as Sa, classifyDaemonServiceRunStartability as Si, computeRetryDelayMs as Sn, removeProjectOutbox as So, getCommandHintsFromContract as Sr, runDaemonStop as St, buildFormalSignalReadPayload as T, deleteOpenMeldProfile as Ta, ensureDaemonRuntimePaths as Ti, submitRuntimeAgentControllerReports as Tn, listProjectConnectionsWithStatus as To, registerSkillsTargetSelectionOptions as Tr, buildProfileWorkspacePresentation as Tt, runAgentsConfig as U, validateLocalProjectConnectionPath as Ua, startCurrentCommandCheckScope as Ui, isReturnKeypress as Un, cliJsonSkillsListEnvelopeSchema as Uo, resolveDaemonServiceFreshnessWarning as Ur, resolveDaemonServiceParticipationStatus as Ut, resolveAgentProfileSetup as V, setProfileDefaultView as Va, isCurrentCommandCheckScopeActive as Vi, promptSearchMultiselect as Vn, cliBinaryDeltaPatchSchema as Vo, formatDaemonFailureContextText as Vr, resolveLocalComponentsStatus as Vt, runAgentsCustomAdd as W, LocalDaemonControlPlaneClientError as Wa, inspectDaemonServiceInventory as Wi, runInteractivePrompt as Wn, cliJsonSkillsLoadEnvelopeSchema as Wo, resolveCurrentReplyReadinessSnapshot as Wr, runDaemonServiceParticipationGate as Wt, runAgentsEnable as X, AGENT_ACTIVITY_INTEGRATION_OWNER as Xa, readDaemonServiceJobCrashExitCode as Xi, writeDispatchSpaceActionRecord as Xn, package_default as Xo, resolveOpenClawLocalDiagnosticsValue as Xr, runSkillsUninstall as Xt, runAgentsDisable as Y, unregisterAgentActivityRoute as Ya, isDaemonServiceJobNeverSpawned as Yi, readDispatchSpaceActionContextFromEnv as Yn, compareAgentControllerRefsForDisplay as Yo, resolveGatewayChainReadiness as Yr, runSkillsInstall as Yt, runAgentsList as Z, defaultManagedIntegrationPaths as Za, resolveDaemonServiceManager as Zi, formatElapsedTime as Zn, syncProfileWorkspaceState as Zr, runSkillsUpdate as Zt, runSpaceWriteWithPasswordRetry as _, parseCliViewMode as _a, buildDaemonRouteObservationPresentation as _i, promptTextEntry as _n, normalizeSharedSessionTitle as _o, createSpaceUpdatesGuideError as _r, runDaemonInterrupt as _t, runSpaceDelete as a, readVersionState as aa, setOpenMeldManagedProfileWorkspace as ai, ensureCommandAuthenticationOrCancel as an, formatOpenMeldCliLine as ao, createProfileMenuGuideError as ar, printOpenMeldBanner as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, isSelectedOpenMeldProfileRequiredError as ba, buildDaemonServiceTargetSpec as bi, resolveServiceParticipationReadiness as bn, removeProjectInbox as bo, createUpgradeConfirmationGuideError as br, runDaemonSnapshot as bt, runSpaceLeave as c, resolveOpenMeldDistribution as ca, syncDeviceRuntimeStateProjection as ci, runAuthLogout as cn, resolveSetupFollowUpCliEntryCommand as co, createSpaceAliasTargetGuideError as cr, renderOpenMeldLogo as ct, runSpaceRemoveMembers as d, resolveCurrentDaemonExpectedVersion as da, listAgentTargetStates as di, buildAuthStatusRows as dn, readDaemonServiceContract as do, createSpaceMenuGuideError as dr, resolveSpaceSendText as dt, buildNextVersionState as ea, ensureOpenMeldManagedProfileWorkspace as ei, readRuntimeReportingHealthState as en, resolveAgentActivityDispatcherCommand as eo, formatDaemonServiceMissingRecommendation as er, runAgentsShow as et, runSpaceSend as f, buildHumanErrorCopy as fa, reconcileNewRunnableBuiltinAgentsForSetup as fi, buildAuthStatusSnapshot as fn, upsertDaemonServiceContract as fo, createSpacePublicationSetGuideError as fr, runDaemon as ft, runSpaceReadWithPasswordRetry as g, formatMessage as ga, PREPARE_SESSION_RECONNECT_GRACE_MS as gi, resolveCreateProfileName as gn, resolveObservedAgentActivityBinding as go, createSpaceTargetGuideError as gr, runDaemonInstall as gt, uploadPreparedSpaceFiles as h, createPresenter as ha, resolveLocalRegistryAgentIdFromAgentControllerRef as hi, resolveCreateProfileKind as hn, buildAgentActivityEvent as ho, createSpaceSubcommandTargetGuideError as hr, runDaemonCancel as ht, runSpaceCreate as i, fetchLatestPackageInfo as ia, setCustomProfileWorkspace as ii, buildCommandAuthenticationPromptMessage as in, formatOpenMeldCliCommands as io, createProfileCreateGuideError as ir, colorizeDisplayProfileLabel as it, assertValidSpaceIdTarget as j, clearSelectedOpenMeldProfileId as ja, getAgentControllerPermissionModeFieldLabel as ji, upsertSpaceConfig as jn, canonicalizeLocalProjectPath as jo, DualViewGuideError as jr, runDaemonStartupPreflight as jt, isSpaceCommandOutputHandledError as k, updateOpenMeldProfile as ka, createAgentExecutionStatusDisplayRows as ki, resolveLocalAgentControllerReportDecision as kn, setDefaultProjectConnection as ko, registerBuiltinAgentSelectionOptions as kr, createDelayedSpinner as kt, runSpaceList as l, resolveDaemonRuntimeContractCompatibility as la, createPrimaryBindingReadSession as li, runAuthMenu as ln, resolveUserFacingCliEntryCommand as lo, createSpaceContractSetGuideError as lr, renderOpenMeldTagline as lt, prepareRequestedSpaceSendFiles as m, renderHumanTextErrorCard as ma, notifyDaemonRouteCatalogChanged as mi, createProfileByKind as mn, removeAgentActivityContextCache as mo, createSpaceResultGuideError as mr, runDaemonBackgroundStartForDecision as mt, promptAndConfirmSpacePassword as n, ensureVersionStateReady as na, readProfileWorkspaceConfig as ni, connectWebSocket as nn, formatInlineOpenMeldCliCommands as no, createDoctorFailedGuideError as nr, postLocalParticipationMutationReconcile as nt, runSpaceHistory as o, writeVersionState as oa, validateCustomProfileWorkspacePath as oi, evaluateCommandAuthentication as on, formatOpenMeldCliTextBlock as oo, createResetConfirmationGuideError as or, renderOpenMeldBrandBlockLines as ot, runSpaceWatch as p, renderHumanErrorCard as pa, listBuiltinAgentsRegistryEntries as pi, formatActiveOrganizationLabel as pn, readAgentActivityContextForPath as po, createSpaceRemoveMembersGuideError as pr, runDaemonAutostart as pt, runAgentsCustomUpdate as q, registerAgentActivityRoute as qa, readCurrentObservedDaemonRuntimeStatus as qi, assertDispatchOwnedRuntimePublicWriteAllowed as qn, organizationJoinLinkErrorResponseSchema as qo, formatHumanReplyReadinessReason as qr, runSkillsCheck as qt, runSpaceAddMembers as r, fetchLatestCliBinaryRelease as ra, resolveConfiguredProfileWorkspacePath as ri, assessServerRequiredVersion as rn, formatOpenMeldCliCommand as ro, createProfileActionGuideError as rr, colorizeAgentLabel as rt, runSpaceJoin as s, isBinaryDistribution as sa, describeProfileWorkspacePathValidationFailure as si, runAuthLogin as sn, formatProfileAwareOpenMeldCliCommands as so, createSpaceAddMembersGuideError as sr, renderOpenMeldHeader as st, buildCreateSpacePasswordPromptConfig as t, compareSemver as ta, normalizeCustomProfileWorkspacePath as ti, readRecentDaemonDispatchJournalEvents as tn, uninstallAgentActivityIntegrations as to, canUseInteractivePrompts as tr, formatTransportModeDisplay as tt, runSpacePassword as u, toStartBackgroundHelperExecutionCompatibility as ua, resolveAgentProfilePrimaryAgentControllerReport as ui, runAuthStatus as un, syncLocalAgentActivity as uo, createSpaceLeaveGuideError as ur, resolveGatewayWebOrigin as ut, buildHumanReadSignalsTranscriptItems as v, resolveRuntimeContext as va, buildOnboardingPlan as vi, ensureAgentProfileRuntimeBinding as vn, readCodexSessionTitles as vo, createStartAgentIdentityGuideError as vr, runDaemonReinstall as vt, buildFormalDispatchResultReadPayload as w, createOpenMeldHumanProfile as wa, readRecentDaemonLifecycleEvents as wi, submitRuntimeAgentControllerReport as wn, listProjectBindings as wo, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as wr, runDaemonUninstall as wt, loadSpaceIdentityDirectoryOrNull as x, requireOpenMeldProfile as xa, resolveDaemonServiceAlignmentDecision as xi, assessActionParticipationCandidate as xn, readAgentActivityOutboxHealth as xo, getCommandEntryContract as xr, runDaemonStatusFlow as xt, emitHumanReadSignalsTextProjection as y, resolveViewProfileKey as ya, getSetupFlowCopy as yi, formatServiceParticipationReadinessLabel as yn, enqueueAgentActivityHookEvent as yo, createStartAuthenticationGuideError as yr, runDaemonRunAfterEntryChecks as yt, resolveHumanControllerDisplayName as z, resolveAuthenticationGuidanceFromMessage as za, finishCurrentCommandCheckScope as zi, createSpaceMemberIdentityIndex as zn, outJsonLine as zo, canonicalizeAllowedActions as zr, toStructuredGatewayFailure as zt };
106951
106399
 
106952
- //# sourceMappingURL=command-CtueGhEA.js.map
106400
+ //# sourceMappingURL=command-DEiTGBQ3.js.map