openmeld 0.3.87 → 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.
- package/dist/{add-me-membership-D2kb5oFM.js → add-me-membership-CiYcpUBk.js} +2 -2
- package/dist/{add-me-membership-D2kb5oFM.js.map → add-me-membership-CiYcpUBk.js.map} +1 -1
- package/dist/{command-COz7Q-x-.js → command-DEiTGBQ3.js} +191 -726
- package/dist/{command-COz7Q-x-.js.map → command-DEiTGBQ3.js.map} +1 -1
- package/dist/openmeld.js +4 -4
- package/dist/openmeld.js.map +1 -1
- package/package.json +1 -1
- package/skills/openmeld-cli/SKILL.md +7 -27
- package/skills/openmeld-cli/playbooks/space-ops.md +7 -21
- package/skills/openmeld-cli/references/commands.md +4 -5
|
@@ -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.
|
|
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$
|
|
2193
|
-
if (!(isRecord$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
2725
|
-
if (!(isRecord$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
2995
|
+
return isRecord$7(parsed) ? parsed : null;
|
|
2996
2996
|
} catch {
|
|
2997
2997
|
return null;
|
|
2998
2998
|
}
|
|
2999
2999
|
}
|
|
3000
|
-
function isRecord$
|
|
3000
|
+
function isRecord$7(value) {
|
|
3001
3001
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3002
3002
|
}
|
|
3003
3003
|
//#endregion
|
|
@@ -9073,6 +9073,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9073
9073
|
const threadContext = await resolveDispatchThreadContext({
|
|
9074
9074
|
conversationPolicyParams,
|
|
9075
9075
|
codexWorkdir: input.codexWorkdir,
|
|
9076
|
+
executionMode: input.executionMode,
|
|
9076
9077
|
permissionModeParams: permissionModeParams.thread,
|
|
9077
9078
|
session,
|
|
9078
9079
|
threadId: input.threadId,
|
|
@@ -9084,13 +9085,14 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9084
9085
|
session,
|
|
9085
9086
|
threadModel: threadContext.model
|
|
9086
9087
|
});
|
|
9087
|
-
const
|
|
9088
|
+
const executionThreadId = threadContext.threadId;
|
|
9089
|
+
const continuityThreadId = input.executionMode === "repair" ? normalizeOptionalText$56(input.threadId) ?? executionThreadId : executionThreadId;
|
|
9088
9090
|
const turnPrompt = resolveCodexTurnPrompt({
|
|
9089
9091
|
fallbackPrompt: prompt,
|
|
9090
9092
|
instructionPrompt: input.instructionPrompt,
|
|
9091
9093
|
threadSource: threadContext.threadSource
|
|
9092
9094
|
});
|
|
9093
|
-
session.emitProviderConversationObserved(
|
|
9095
|
+
session.emitProviderConversationObserved(continuityThreadId);
|
|
9094
9096
|
const turn = readTurnStartResponse(await session.requestControl("turn/start", {
|
|
9095
9097
|
...permissionModeParams.turn,
|
|
9096
9098
|
...collaborationMode ? { collaborationMode } : {},
|
|
@@ -9101,7 +9103,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9101
9103
|
text_elements: [],
|
|
9102
9104
|
type: "text"
|
|
9103
9105
|
}],
|
|
9104
|
-
threadId
|
|
9106
|
+
threadId: executionThreadId
|
|
9105
9107
|
}, {
|
|
9106
9108
|
code: "runtime.turn_start_timeout",
|
|
9107
9109
|
operation: "turn/start"
|
|
@@ -9110,13 +9112,13 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9110
9112
|
const unregisterActiveTurn = session.registerActiveTurn({
|
|
9111
9113
|
onActiveTurn: input.onActiveTurn,
|
|
9112
9114
|
taskId: input.taskId,
|
|
9113
|
-
threadId,
|
|
9115
|
+
threadId: executionThreadId,
|
|
9114
9116
|
turnId
|
|
9115
9117
|
});
|
|
9116
9118
|
let completedTurn;
|
|
9117
9119
|
try {
|
|
9118
9120
|
completedTurn = turn.status === "completed" ? turn : await session.waitForTurnCompleted({
|
|
9119
|
-
threadId,
|
|
9121
|
+
threadId: executionThreadId,
|
|
9120
9122
|
turnId
|
|
9121
9123
|
});
|
|
9122
9124
|
} finally {
|
|
@@ -9144,7 +9146,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9144
9146
|
resumedContext: normalizeOptionalText$56(input.threadId) !== null,
|
|
9145
9147
|
streamingMode: input.streamingMode ?? "final"
|
|
9146
9148
|
}),
|
|
9147
|
-
threadId
|
|
9149
|
+
threadId: continuityThreadId
|
|
9148
9150
|
};
|
|
9149
9151
|
});
|
|
9150
9152
|
}
|
|
@@ -9189,7 +9191,6 @@ async function verifyCodexAppServerThread(input) {
|
|
|
9189
9191
|
launchContract: input.launchContract
|
|
9190
9192
|
}, async (session) => {
|
|
9191
9193
|
return { threadId: readThreadIdFromResponse(await session.requestControl("thread/resume", {
|
|
9192
|
-
approvalPolicy: "untrusted",
|
|
9193
9194
|
cwd: input.codexWorkdir,
|
|
9194
9195
|
excludeTurns: true,
|
|
9195
9196
|
threadId
|
|
@@ -9239,16 +9240,22 @@ async function forkCodexAppServerThread(input) {
|
|
|
9239
9240
|
}
|
|
9240
9241
|
async function resolveDispatchThreadContext(input) {
|
|
9241
9242
|
const existingThreadId = normalizeOptionalText$56(input.threadId);
|
|
9242
|
-
if (existingThreadId)
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9243
|
+
if (existingThreadId) {
|
|
9244
|
+
const dispatchThreadId = input.executionMode === "repair" ? await forkEphemeralCodexRepairThread({
|
|
9245
|
+
session: input.session,
|
|
9246
|
+
sourceThreadId: existingThreadId
|
|
9247
|
+
}) : existingThreadId;
|
|
9248
|
+
return readThreadContextFromResponse(await input.session.requestControl("thread/resume", {
|
|
9249
|
+
...input.conversationPolicyParams.model ? { model: input.conversationPolicyParams.model } : {},
|
|
9250
|
+
...input.permissionModeParams,
|
|
9251
|
+
cwd: input.codexWorkdir,
|
|
9252
|
+
excludeTurns: true,
|
|
9253
|
+
threadId: dispatchThreadId
|
|
9254
|
+
}, {
|
|
9255
|
+
code: "context.resume_timeout",
|
|
9256
|
+
operation: "thread/resume"
|
|
9257
|
+
}));
|
|
9258
|
+
}
|
|
9252
9259
|
return readThreadContextFromResponse(await input.session.requestControl("thread/start", {
|
|
9253
9260
|
...input.conversationPolicyParams.model ? { model: input.conversationPolicyParams.model } : {},
|
|
9254
9261
|
...input.permissionModeParams,
|
|
@@ -9262,6 +9269,16 @@ async function resolveDispatchThreadContext(input) {
|
|
|
9262
9269
|
operation: "thread/start"
|
|
9263
9270
|
}));
|
|
9264
9271
|
}
|
|
9272
|
+
async function forkEphemeralCodexRepairThread(input) {
|
|
9273
|
+
return readThreadIdFromResponse(await input.session.requestControl("thread/fork", {
|
|
9274
|
+
ephemeral: true,
|
|
9275
|
+
excludeTurns: true,
|
|
9276
|
+
threadId: input.sourceThreadId
|
|
9277
|
+
}, {
|
|
9278
|
+
code: "context.fork_timeout",
|
|
9279
|
+
operation: "thread/fork"
|
|
9280
|
+
}));
|
|
9281
|
+
}
|
|
9265
9282
|
function resolveCodexTurnPrompt(input) {
|
|
9266
9283
|
if (!input.instructionPrompt) return input.fallbackPrompt;
|
|
9267
9284
|
const expectedThreadSource = buildOpenMeldCodexThreadSource(input.instructionPrompt.instructionEpoch);
|
|
@@ -12860,7 +12877,7 @@ function resolveResultText$1(record, isErrorResult) {
|
|
|
12860
12877
|
}
|
|
12861
12878
|
function resolveErrorMessage$1(record, isErrorResult) {
|
|
12862
12879
|
const fromKnownPaths = resolveStringByPaths$1(record, OPENCODE_ERROR_MESSAGE_PATHS);
|
|
12863
|
-
if (fromKnownPaths && (isErrorResult === true || looksLikeErrorSignal
|
|
12880
|
+
if (fromKnownPaths && (isErrorResult === true || looksLikeErrorSignal(fromKnownPaths))) return fromKnownPaths;
|
|
12864
12881
|
return null;
|
|
12865
12882
|
}
|
|
12866
12883
|
function resolveIsErrorResult$1(record) {
|
|
@@ -12905,7 +12922,7 @@ function resolveTextByPaths(record, paths) {
|
|
|
12905
12922
|
}
|
|
12906
12923
|
return null;
|
|
12907
12924
|
}
|
|
12908
|
-
function looksLikeErrorSignal
|
|
12925
|
+
function looksLikeErrorSignal(value) {
|
|
12909
12926
|
const lowered = value.toLowerCase();
|
|
12910
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");
|
|
12911
12928
|
}
|
|
@@ -14726,7 +14743,7 @@ async function mapCodexThread(input) {
|
|
|
14726
14743
|
if (!(nativeSessionId && cwd && lastActiveAtMs !== null)) throw new Error("Codex returned a malformed retained thread record.");
|
|
14727
14744
|
const binding = await resolveObservedAgentActivityBinding(cwd, input.bindings);
|
|
14728
14745
|
if (!binding) return null;
|
|
14729
|
-
const runtimeStatus = isRecord$
|
|
14746
|
+
const runtimeStatus = isRecord$6(input.thread.status) ? text$1(input.thread.status.type) : null;
|
|
14730
14747
|
return {
|
|
14731
14748
|
binding,
|
|
14732
14749
|
session: observedLocalAgentSessionSchema.parse({
|
|
@@ -14770,7 +14787,7 @@ async function listAllCodexThreads(launchContract) {
|
|
|
14770
14787
|
sourceKinds: CODEX_THREAD_SOURCE_KINDS,
|
|
14771
14788
|
useStateDbOnly: false
|
|
14772
14789
|
});
|
|
14773
|
-
if (!(isRecord$
|
|
14790
|
+
if (!(isRecord$6(response) && Array.isArray(response.data) && response.data.every(isRecord$6))) throw new Error("Codex thread/list response is invalid.");
|
|
14774
14791
|
pages.push({
|
|
14775
14792
|
archived,
|
|
14776
14793
|
data: response.data
|
|
@@ -14895,12 +14912,12 @@ function consumeCodexJsonRpcChunk(input) {
|
|
|
14895
14912
|
}
|
|
14896
14913
|
}
|
|
14897
14914
|
function settleCodexJsonRpcResponse(message, pending) {
|
|
14898
|
-
if (!isRecord$
|
|
14915
|
+
if (!isRecord$6(message) || typeof message.id !== "number") return;
|
|
14899
14916
|
const request = pending.get(message.id);
|
|
14900
14917
|
if (!request) return;
|
|
14901
14918
|
pending.delete(message.id);
|
|
14902
14919
|
clearTimeout(request.timer);
|
|
14903
|
-
if (isRecord$
|
|
14920
|
+
if (isRecord$6(message.error)) {
|
|
14904
14921
|
request.reject(new Error(text$1(message.error.message) ?? "Codex app-server request failed."));
|
|
14905
14922
|
return;
|
|
14906
14923
|
}
|
|
@@ -15021,7 +15038,7 @@ function applyClaudeSessionLine(state, line) {
|
|
|
15021
15038
|
} catch (error) {
|
|
15022
15039
|
throw new Error("Claude Code Session file contains malformed JSON.", { cause: error });
|
|
15023
15040
|
}
|
|
15024
|
-
if (!isRecord$
|
|
15041
|
+
if (!isRecord$6(value)) return;
|
|
15025
15042
|
const rowSessionId = text$1(value.sessionId);
|
|
15026
15043
|
if (rowSessionId && state.nativeSessionId !== rowSessionId) {
|
|
15027
15044
|
if (state.nativeSessionId) throw new Error("Claude Code Session file contains conflicting IDs.");
|
|
@@ -15193,12 +15210,12 @@ async function discoverGrokBuildRetainedSessions(input) {
|
|
|
15193
15210
|
const identities = /* @__PURE__ */ new Set();
|
|
15194
15211
|
for (const path of paths) {
|
|
15195
15212
|
const summary = JSON.parse(await readFile(path, "utf8"));
|
|
15196
|
-
if (!isRecord$
|
|
15213
|
+
if (!isRecord$6(summary)) throw new Error("Grok Build summary metadata is invalid.");
|
|
15197
15214
|
const topLevelIdentity = {
|
|
15198
15215
|
cwd: text$1(summary.cwd),
|
|
15199
15216
|
nativeSessionId: text$1(summary.id)
|
|
15200
15217
|
};
|
|
15201
|
-
const nestedInfo = isRecord$
|
|
15218
|
+
const nestedInfo = isRecord$6(summary.info) ? summary.info : null;
|
|
15202
15219
|
const nestedIdentity = {
|
|
15203
15220
|
cwd: text$1(nestedInfo?.cwd),
|
|
15204
15221
|
nativeSessionId: text$1(nestedInfo?.id)
|
|
@@ -15348,7 +15365,7 @@ function mapClaudeAgentStatus(value) {
|
|
|
15348
15365
|
}
|
|
15349
15366
|
function collectRecords(value) {
|
|
15350
15367
|
if (Array.isArray(value)) return value.flatMap(collectRecords);
|
|
15351
|
-
if (!isRecord$
|
|
15368
|
+
if (!isRecord$6(value)) return [];
|
|
15352
15369
|
return [value, ...Object.values(value).flatMap(collectRecords)];
|
|
15353
15370
|
}
|
|
15354
15371
|
function secondsTimestamp(value) {
|
|
@@ -15371,7 +15388,7 @@ function parseCodexNextCursor(value) {
|
|
|
15371
15388
|
function text$1(value) {
|
|
15372
15389
|
return nullableText(value);
|
|
15373
15390
|
}
|
|
15374
|
-
function isRecord$
|
|
15391
|
+
function isRecord$6(value) {
|
|
15375
15392
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
15376
15393
|
}
|
|
15377
15394
|
function isNodeError$4(error, code) {
|
|
@@ -16558,7 +16575,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
16558
16575
|
claude: claude !== null && CLAUDE_EVENTS.every((event) => {
|
|
16559
16576
|
try {
|
|
16560
16577
|
const settings = parseSettings(claude);
|
|
16561
|
-
const hooks = isRecord$
|
|
16578
|
+
const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
|
|
16562
16579
|
return Array.isArray(hooks?.[event]) && hooks[event].some((group) => knownArtifacts.some((artifacts) => hasOwnedClaudeHook(group, artifacts)));
|
|
16563
16580
|
} catch {
|
|
16564
16581
|
return false;
|
|
@@ -16568,7 +16585,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
16568
16585
|
cursor: cursor !== null && CURSOR_EVENTS.every((event) => {
|
|
16569
16586
|
try {
|
|
16570
16587
|
const settings = parseJsonObject(cursor, "Cursor hooks");
|
|
16571
|
-
const hooks = isRecord$
|
|
16588
|
+
const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
|
|
16572
16589
|
return Array.isArray(hooks?.[event]) && hooks[event].some((entry) => knownArtifacts.some((artifacts) => isOwnedCursorHook(entry, artifacts.cursorCommand)));
|
|
16573
16590
|
} catch {
|
|
16574
16591
|
return false;
|
|
@@ -16623,7 +16640,7 @@ function installCursorHooks(raw, artifacts, knownArtifacts) {
|
|
|
16623
16640
|
}
|
|
16624
16641
|
function uninstallCursorHooks(raw, knownArtifacts) {
|
|
16625
16642
|
const settings = parseJsonObject(raw, "Cursor hooks");
|
|
16626
|
-
const hooks = isRecord$
|
|
16643
|
+
const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
|
|
16627
16644
|
if (!hooks) return raw;
|
|
16628
16645
|
for (const event of CURSOR_EVENTS) {
|
|
16629
16646
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -16639,17 +16656,17 @@ function ownedCursorHook(command) {
|
|
|
16639
16656
|
};
|
|
16640
16657
|
}
|
|
16641
16658
|
function isOwnedCursorHook(value, command) {
|
|
16642
|
-
return isRecord$
|
|
16659
|
+
return isRecord$5(value) && Object.keys(value).length === 2 && value.command === command && value.timeout === 10;
|
|
16643
16660
|
}
|
|
16644
16661
|
function isKnownOwnedCursorHook(value, knownArtifacts) {
|
|
16645
16662
|
return knownArtifacts.some((artifacts) => isOwnedCursorHook(value, artifacts.cursorCommand) || isOwnedCursorHook(value, artifacts.legacyCursorCommand));
|
|
16646
16663
|
}
|
|
16647
16664
|
function hasUnknownOpenMeldCursorHook(value, knownArtifacts) {
|
|
16648
|
-
return isRecord$
|
|
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);
|
|
16649
16666
|
}
|
|
16650
16667
|
function uninstallClaudeHooks(raw, knownArtifacts) {
|
|
16651
16668
|
const settings = parseSettings(raw);
|
|
16652
|
-
const hooks = isRecord$
|
|
16669
|
+
const hooks = isRecord$5(settings.hooks) ? settings.hooks : null;
|
|
16653
16670
|
if (!hooks) return raw;
|
|
16654
16671
|
for (const event of CLAUDE_EVENTS) {
|
|
16655
16672
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -16666,14 +16683,14 @@ function ownedClaudeGroup(artifacts) {
|
|
|
16666
16683
|
}] };
|
|
16667
16684
|
}
|
|
16668
16685
|
function isOwnedClaudeGroup(value, artifacts) {
|
|
16669
|
-
if (!isRecord$
|
|
16670
|
-
return value.hooks.length === 1 && isRecord$
|
|
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;
|
|
16671
16688
|
}
|
|
16672
16689
|
function hasOwnedClaudeHook(value, artifacts) {
|
|
16673
|
-
return isRecord$
|
|
16690
|
+
return isRecord$5(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$5(hook) && hook.command === artifacts.claudeCommand);
|
|
16674
16691
|
}
|
|
16675
16692
|
function hasUnknownOpenMeldClaudeHook(value, knownArtifacts) {
|
|
16676
|
-
return isRecord$
|
|
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);
|
|
16677
16694
|
}
|
|
16678
16695
|
function isLegacyOwnedClaudeGroup(value, artifacts) {
|
|
16679
16696
|
return isOwnedClaudeGroupForCommand(value, artifacts.legacyClaudeCommand);
|
|
@@ -16732,8 +16749,8 @@ function extractCodexTrustState(block, endMarker) {
|
|
|
16732
16749
|
};
|
|
16733
16750
|
}
|
|
16734
16751
|
function isOwnedClaudeGroupForCommand(value, command) {
|
|
16735
|
-
if (!isRecord$
|
|
16736
|
-
return value.hooks.length === 1 && isRecord$
|
|
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;
|
|
16737
16754
|
}
|
|
16738
16755
|
async function planPluginInstall(path, artifacts, knownArtifacts) {
|
|
16739
16756
|
const current = await readOptionalFile$1(path);
|
|
@@ -16873,12 +16890,12 @@ function parseSettings(raw) {
|
|
|
16873
16890
|
function parseJsonObject(raw, label) {
|
|
16874
16891
|
if (!raw.trim()) return {};
|
|
16875
16892
|
const value = JSON.parse(raw);
|
|
16876
|
-
if (!isRecord$
|
|
16893
|
+
if (!isRecord$5(value)) throw new Error(`${label} must be a JSON object.`);
|
|
16877
16894
|
return value;
|
|
16878
16895
|
}
|
|
16879
16896
|
function ensureRecord(parent, key, label = "Claude settings") {
|
|
16880
16897
|
if (parent[key] === void 0) parent[key] = {};
|
|
16881
|
-
if (!isRecord$
|
|
16898
|
+
if (!isRecord$5(parent[key])) throw new Error(`${label} ${key} must be an object.`);
|
|
16882
16899
|
return parent[key];
|
|
16883
16900
|
}
|
|
16884
16901
|
function emptyFileFor(path) {
|
|
@@ -16888,7 +16905,7 @@ function revisionConflict(path) {
|
|
|
16888
16905
|
const digest = createHash("sha256").update(path).digest("hex").slice(0, 12);
|
|
16889
16906
|
return /* @__PURE__ */ new Error(`Managed integration revision changed before commit (${digest}).`);
|
|
16890
16907
|
}
|
|
16891
|
-
function isRecord$
|
|
16908
|
+
function isRecord$5(value) {
|
|
16892
16909
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
16893
16910
|
}
|
|
16894
16911
|
function isNodeError$2(error, code) {
|
|
@@ -18257,7 +18274,7 @@ async function requestOpenMeldProfilesApi(input) {
|
|
|
18257
18274
|
})
|
|
18258
18275
|
});
|
|
18259
18276
|
}
|
|
18260
|
-
const record = isRecord$
|
|
18277
|
+
const record = isRecord$4(payload) ? payload : {};
|
|
18261
18278
|
if (!readBooleanField(record, "ok")) {
|
|
18262
18279
|
const parsedError = profileErrorResponseSchema.safeParse(payload);
|
|
18263
18280
|
const code = parsedError.success ? parsedError.data.code : null;
|
|
@@ -18338,7 +18355,7 @@ async function emitRouteCatalogSync(reason) {
|
|
|
18338
18355
|
await touchDaemonCatalogSyncSignal({ reason }).catch(() => void 0);
|
|
18339
18356
|
}
|
|
18340
18357
|
function parseOpenMeldProfileItem(value) {
|
|
18341
|
-
const record = isRecord$
|
|
18358
|
+
const record = isRecord$4(value) ? value : {};
|
|
18342
18359
|
const openMeldProfileId = readOptionalStringField$1(record, "openMeldProfileId");
|
|
18343
18360
|
if (!openMeldProfileId) throw new Error("invalid profile payload: missing openMeldProfileId");
|
|
18344
18361
|
const profileName = readRequiredStringField(record, "profileName");
|
|
@@ -18394,13 +18411,13 @@ function readOptionalManagedRoleField(input, field) {
|
|
|
18394
18411
|
}
|
|
18395
18412
|
function readRecordField(input, field) {
|
|
18396
18413
|
const value = input[field];
|
|
18397
|
-
if (isRecord$
|
|
18414
|
+
if (isRecord$4(value)) return value;
|
|
18398
18415
|
throw new Error(`invalid api payload: missing ${field}`);
|
|
18399
18416
|
}
|
|
18400
18417
|
function readArrayField(input, field) {
|
|
18401
18418
|
const value = input[field];
|
|
18402
18419
|
if (!Array.isArray(value)) throw new Error(`invalid api payload: missing ${field}`);
|
|
18403
|
-
return value.filter(isRecord$
|
|
18420
|
+
return value.filter(isRecord$4);
|
|
18404
18421
|
}
|
|
18405
18422
|
function readRequiredStringField(input, field) {
|
|
18406
18423
|
const value = normalizeOptionalString$13(input[field]);
|
|
@@ -18443,7 +18460,7 @@ async function parseResponseJson$1(response) {
|
|
|
18443
18460
|
}
|
|
18444
18461
|
}
|
|
18445
18462
|
function extractApiErrorMessage$1(payload, status) {
|
|
18446
|
-
const record = isRecord$
|
|
18463
|
+
const record = isRecord$4(payload) ? payload : {};
|
|
18447
18464
|
const message = normalizeOptionalString$13(record.message) ?? normalizeOptionalString$13(record.error_description) ?? normalizeOptionalString$13(record.error);
|
|
18448
18465
|
if (message) return message;
|
|
18449
18466
|
return `request failed with status ${status}`;
|
|
@@ -18481,7 +18498,7 @@ function isHostedProfilesEndpoint(endpoint) {
|
|
|
18481
18498
|
const url = parseUrlOrNull$1(endpoint);
|
|
18482
18499
|
return Boolean(url && !isLoopbackHostname$2(url.hostname) && url.pathname.startsWith("/v1/profiles"));
|
|
18483
18500
|
}
|
|
18484
|
-
function isRecord$
|
|
18501
|
+
function isRecord$4(value) {
|
|
18485
18502
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
18486
18503
|
}
|
|
18487
18504
|
//#endregion
|
|
@@ -19155,7 +19172,7 @@ var DaemonServiceRunError = class extends Error {
|
|
|
19155
19172
|
//#region src/local-service/state/runtime-contract-guard.ts
|
|
19156
19173
|
const RUNTIME_CONTRACT_META_SCHEMA = "daemon.runtime.contract.meta";
|
|
19157
19174
|
const RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA = "daemon.runtime.contract.repair.report";
|
|
19158
|
-
const isRecord$
|
|
19175
|
+
const isRecord$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19159
19176
|
const createRuntimeContractMeta = (input) => ({
|
|
19160
19177
|
schema: RUNTIME_CONTRACT_META_SCHEMA,
|
|
19161
19178
|
v: 1,
|
|
@@ -19175,7 +19192,7 @@ const createRuntimeContractRepairReport = (input) => ({
|
|
|
19175
19192
|
errorMessage: input.errorMessage
|
|
19176
19193
|
});
|
|
19177
19194
|
const parseRuntimeContractMeta = (value) => {
|
|
19178
|
-
if (!isRecord$
|
|
19195
|
+
if (!isRecord$3(value)) return null;
|
|
19179
19196
|
if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
|
|
19180
19197
|
const contractEpoch = normalizeOptionalText$44(value.contractEpoch);
|
|
19181
19198
|
const updatedAt = normalizeOptionalText$44(value.updatedAt);
|
|
@@ -19188,7 +19205,7 @@ const parseRuntimeContractMeta = (value) => {
|
|
|
19188
19205
|
};
|
|
19189
19206
|
};
|
|
19190
19207
|
const parseRuntimeContractRepairReport = (value) => {
|
|
19191
|
-
if (!isRecord$
|
|
19208
|
+
if (!isRecord$3(value)) return null;
|
|
19192
19209
|
if (value.schema !== RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA || value.v !== 1) return null;
|
|
19193
19210
|
const status = value.status;
|
|
19194
19211
|
const reason = value.reason;
|
|
@@ -24673,13 +24690,8 @@ function resolveDocumentOutputText(record, isErrorResult) {
|
|
|
24673
24690
|
return resolveResultText(record, isErrorResult);
|
|
24674
24691
|
}
|
|
24675
24692
|
function resolveErrorMessage(record, isErrorResult) {
|
|
24676
|
-
|
|
24677
|
-
|
|
24678
|
-
if (isErrorResult === true) {
|
|
24679
|
-
const fallback = resolveStringByPaths(record, OPENCLAW_RESULT_TEXT_PATHS);
|
|
24680
|
-
if (fallback) return fallback;
|
|
24681
|
-
}
|
|
24682
|
-
return null;
|
|
24693
|
+
if (isErrorResult !== true) return null;
|
|
24694
|
+
return resolveStringByPaths(record, OPENCLAW_ERROR_MESSAGE_PATHS) ?? resolveStringByPaths(record, OPENCLAW_RESULT_TEXT_PATHS);
|
|
24683
24695
|
}
|
|
24684
24696
|
function resolveIsErrorResult(record) {
|
|
24685
24697
|
if (typeof record.is_error === "boolean") return record.is_error;
|
|
@@ -24738,10 +24750,6 @@ function normalizeCandidateValue(value) {
|
|
|
24738
24750
|
}
|
|
24739
24751
|
return null;
|
|
24740
24752
|
}
|
|
24741
|
-
function looksLikeErrorSignal(value) {
|
|
24742
|
-
const lowered = value.toLowerCase();
|
|
24743
|
-
return lowered.includes("error") || lowered.includes("failed") || looksLikeRuntimePermissionDenialMessage(value) || lowered.includes("unauthorized") || lowered.includes("not logged in") || lowered.includes("invalid");
|
|
24744
|
-
}
|
|
24745
24753
|
function normalizeOptionalText$38(value) {
|
|
24746
24754
|
const normalized = String(value ?? "").trim();
|
|
24747
24755
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -29092,7 +29100,7 @@ const INFLIGHT_RETENTION_MS = DEDUPE_RETENTION_MS;
|
|
|
29092
29100
|
const AGENT_CONTEXT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
29093
29101
|
const AGENT_CONTEXT_MAX_ENTRIES = 2e3;
|
|
29094
29102
|
const AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR = "|";
|
|
29095
|
-
const isRecord$
|
|
29103
|
+
const isRecord$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29096
29104
|
const isPositiveInteger = (value) => Number.isInteger(value) && typeof value === "number" && value >= 0;
|
|
29097
29105
|
const isRuntimeTransportMode = (value) => runtimeTransportModeSchema.safeParse(value).success;
|
|
29098
29106
|
const utf8ByteLength = (value) => {
|
|
@@ -29116,7 +29124,7 @@ const utf8ByteLength = (value) => {
|
|
|
29116
29124
|
return byteLength;
|
|
29117
29125
|
};
|
|
29118
29126
|
const toErrorCode = (error) => {
|
|
29119
|
-
if (!isRecord$
|
|
29127
|
+
if (!isRecord$2(error)) return null;
|
|
29120
29128
|
const code = error.code;
|
|
29121
29129
|
if (typeof code !== "string") return null;
|
|
29122
29130
|
return code;
|
|
@@ -29136,7 +29144,7 @@ const buildLegacySpaceScopedAgentContextLookupKey = (input) => [
|
|
|
29136
29144
|
input.runtimeWorkspaceFingerprint
|
|
29137
29145
|
].map(encodeAgentContextLookupKeyPart).join(AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR);
|
|
29138
29146
|
const parseInflightTask = (value) => {
|
|
29139
|
-
if (!isRecord$
|
|
29147
|
+
if (!isRecord$2(value)) return null;
|
|
29140
29148
|
const { bindingKey, firstSeenAtMs, idempotencyKey, output, sequence, taskId } = value;
|
|
29141
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;
|
|
29142
29150
|
if (output !== void 0 && (typeof output !== "string" || output.length === 0)) return null;
|
|
@@ -29150,7 +29158,7 @@ const parseInflightTask = (value) => {
|
|
|
29150
29158
|
};
|
|
29151
29159
|
};
|
|
29152
29160
|
const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
29153
|
-
if (!isRecord$
|
|
29161
|
+
if (!isRecord$2(value)) return null;
|
|
29154
29162
|
const { agentControllerConversationId, agentControllerRef, createdAtMs, lastTaskId, spaceId, targetProfileId, transportMode, runtimeWorkspaceFingerprint, updatedAtMs } = value;
|
|
29155
29163
|
const parsedAgentControllerRef = typeof agentControllerRef === "string" ? parseAgentControllerRef$1(agentControllerRef) : null;
|
|
29156
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;
|
|
@@ -29182,7 +29190,7 @@ const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
|
29182
29190
|
};
|
|
29183
29191
|
};
|
|
29184
29192
|
const parseAgentContextLifecycleCounters = (value) => {
|
|
29185
|
-
if (!isRecord$
|
|
29193
|
+
if (!isRecord$2(value)) return null;
|
|
29186
29194
|
const { created, guardBlocked, recreated, reused } = value;
|
|
29187
29195
|
if (!(isPositiveInteger(created) && isPositiveInteger(recreated) && isPositiveInteger(reused) && isPositiveInteger(guardBlocked))) return null;
|
|
29188
29196
|
return {
|
|
@@ -29199,7 +29207,7 @@ const createEmptyAgentContextLifecycleCounters = () => ({
|
|
|
29199
29207
|
reused: 0
|
|
29200
29208
|
});
|
|
29201
29209
|
const parseAgentContextRotationRecord = (value) => {
|
|
29202
|
-
if (!isRecord$
|
|
29210
|
+
if (!isRecord$2(value)) return null;
|
|
29203
29211
|
const { nextAgentControllerConversationId, previousAgentControllerConversationId, rotationAt, rotationReason, rotationTaskId, rotationTriggerErrorCode } = value;
|
|
29204
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;
|
|
29205
29213
|
return {
|
|
@@ -29223,7 +29231,7 @@ const parseAgentContextRotationsOrDefault = (value) => {
|
|
|
29223
29231
|
return nextRecords;
|
|
29224
29232
|
};
|
|
29225
29233
|
const parseDedupeFirstSeenByKey = (value) => {
|
|
29226
|
-
if (!isRecord$
|
|
29234
|
+
if (!isRecord$2(value)) return null;
|
|
29227
29235
|
const nextDedupeFirstSeenByKey = {};
|
|
29228
29236
|
for (const [key, firstSeenAtMs] of Object.entries(value)) {
|
|
29229
29237
|
if (!isPositiveInteger(firstSeenAtMs)) return null;
|
|
@@ -29232,7 +29240,7 @@ const parseDedupeFirstSeenByKey = (value) => {
|
|
|
29232
29240
|
return nextDedupeFirstSeenByKey;
|
|
29233
29241
|
};
|
|
29234
29242
|
const parseInflightByTaskId = (value) => {
|
|
29235
|
-
if (!isRecord$
|
|
29243
|
+
if (!isRecord$2(value)) return null;
|
|
29236
29244
|
const nextInflightByTaskId = {};
|
|
29237
29245
|
for (const [taskId, inflightTask] of Object.entries(value)) {
|
|
29238
29246
|
const parsedTask = parseInflightTask(inflightTask);
|
|
@@ -29242,7 +29250,7 @@ const parseInflightByTaskId = (value) => {
|
|
|
29242
29250
|
return nextInflightByTaskId;
|
|
29243
29251
|
};
|
|
29244
29252
|
const parseReplayedTaskIds = (value) => {
|
|
29245
|
-
if (!isRecord$
|
|
29253
|
+
if (!isRecord$2(value)) return null;
|
|
29246
29254
|
const nextReplayedTaskIds = {};
|
|
29247
29255
|
for (const [taskId, replayed] of Object.entries(value)) {
|
|
29248
29256
|
if (replayed !== true) return null;
|
|
@@ -29251,7 +29259,7 @@ const parseReplayedTaskIds = (value) => {
|
|
|
29251
29259
|
return nextReplayedTaskIds;
|
|
29252
29260
|
};
|
|
29253
29261
|
const parseAgentContextByLookupKey = (value) => {
|
|
29254
|
-
if (!isRecord$
|
|
29262
|
+
if (!isRecord$2(value)) return null;
|
|
29255
29263
|
const nextAgentContextByLookupKey = {};
|
|
29256
29264
|
for (const [agentContextLookupKey, rawAgentContextState] of Object.entries(value)) {
|
|
29257
29265
|
const parsedAgentContextState = parseAgentContextState(agentContextLookupKey, rawAgentContextState);
|
|
@@ -29263,7 +29271,7 @@ const parseAgentContextByLookupKey = (value) => {
|
|
|
29263
29271
|
const parseAgentContextLifecycleCountersOrDefault = (value) => parseAgentContextLifecycleCounters(value);
|
|
29264
29272
|
const parseBootstrapExecutionByLookupKey = (value) => {
|
|
29265
29273
|
if (value === void 0) return {};
|
|
29266
|
-
if (!isRecord$
|
|
29274
|
+
if (!isRecord$2(value)) return null;
|
|
29267
29275
|
const nextBootstrapExecutionByLookupKey = {};
|
|
29268
29276
|
for (const [agentContextLookupKey, executionState] of Object.entries(value)) {
|
|
29269
29277
|
const parsedExecutionState = conversationExecutionStateSchema.safeParse(executionState);
|
|
@@ -29274,7 +29282,7 @@ const parseBootstrapExecutionByLookupKey = (value) => {
|
|
|
29274
29282
|
return nextBootstrapExecutionByLookupKey;
|
|
29275
29283
|
};
|
|
29276
29284
|
const parseLedgerStateV1 = (value) => {
|
|
29277
|
-
if (!isRecord$
|
|
29285
|
+
if (!isRecord$2(value)) return null;
|
|
29278
29286
|
const { agentContextRotations, dedupeFirstSeenByKey, inflightByTaskId, replayedTaskIds, agentContextByLookupKey, bootstrapExecutionByLookupKey, agentContextLifecycleCounters, updatedAtMs, v } = value;
|
|
29279
29287
|
if (v !== 1 || !isPositiveInteger(updatedAtMs)) return null;
|
|
29280
29288
|
const nextDedupeFirstSeenByKey = parseDedupeFirstSeenByKey(dedupeFirstSeenByKey);
|
|
@@ -29760,7 +29768,7 @@ const compareRecoveryCandidate = (left, right) => {
|
|
|
29760
29768
|
if (left.firstSeenAtMs !== right.firstSeenAtMs) return left.firstSeenAtMs - right.firstSeenAtMs;
|
|
29761
29769
|
return left.taskId.localeCompare(right.taskId);
|
|
29762
29770
|
};
|
|
29763
|
-
const normalizeOutput
|
|
29771
|
+
const normalizeOutput = (output) => {
|
|
29764
29772
|
if (typeof output !== "string") return null;
|
|
29765
29773
|
const trimmed = output.trim();
|
|
29766
29774
|
if (trimmed.length === 0) return null;
|
|
@@ -29796,7 +29804,7 @@ const settleRecoveredTask = (input) => settleInflightTask({
|
|
|
29796
29804
|
taskId: input.taskId
|
|
29797
29805
|
});
|
|
29798
29806
|
const buildTaskResultPayloadFromOutcome = (input) => {
|
|
29799
|
-
const output = normalizeOutput
|
|
29807
|
+
const output = normalizeOutput(input.output);
|
|
29800
29808
|
const errorType = input.errorType ?? "internal";
|
|
29801
29809
|
const commonFields = buildTaskResultCommonFields(input);
|
|
29802
29810
|
const errorFields = buildTaskResultErrorFields(input);
|
|
@@ -31454,14 +31462,12 @@ function isDaemonReconcileInProgressError(error) {
|
|
|
31454
31462
|
//#region ../../runtime/local-service/src/space-action-target-guidance.ts
|
|
31455
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."];
|
|
31456
31464
|
const SPACE_ACTION_TARGET_GUIDANCE_LINES = [
|
|
31457
|
-
"
|
|
31458
|
-
"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.",
|
|
31459
31466
|
"Any @name text in the body is only prose in the agent path; it does not define OpenMeld targets.",
|
|
31460
31467
|
"activationTargets is only for waking another Agent Profile in this Space.",
|
|
31461
31468
|
"activationTargets must reference an active Agent Profile member in this Space.",
|
|
31462
31469
|
"Never put a Human Profile ID, sender ID, or reply recipient in activationTargets.",
|
|
31463
|
-
"For a normal reply to the current Wake, leave activationTargets and referenceTargets empty."
|
|
31464
|
-
"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."
|
|
31465
31471
|
];
|
|
31466
31472
|
//#endregion
|
|
31467
31473
|
//#region ../../runtime/local-service/src/startup-command-capability.ts
|
|
@@ -41063,7 +41069,7 @@ async function clearDaemonStartFailureState(pathInput = {}) {
|
|
|
41063
41069
|
await rm(daemonStartFailureStatePath(pathInput), { force: true }).catch(() => void 0);
|
|
41064
41070
|
}
|
|
41065
41071
|
function parseDaemonStartFailureState(value) {
|
|
41066
|
-
if (!isRecord$
|
|
41072
|
+
if (!isRecord$1(value)) return null;
|
|
41067
41073
|
if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
|
|
41068
41074
|
const recordedAt = normalizeOptionalText$44(value.recordedAt);
|
|
41069
41075
|
const detail = normalizeOptionalText$44(value.detail);
|
|
@@ -41086,7 +41092,7 @@ function parseDaemonStartFailureState(value) {
|
|
|
41086
41092
|
function normalizeDependencyIssues(issues) {
|
|
41087
41093
|
const normalized = [];
|
|
41088
41094
|
for (const issue of issues) {
|
|
41089
|
-
if (!isRecord$
|
|
41095
|
+
if (!isRecord$1(issue)) continue;
|
|
41090
41096
|
const kind = issue.kind;
|
|
41091
41097
|
const status = issue.status;
|
|
41092
41098
|
const scope = issue.scope;
|
|
@@ -41105,7 +41111,7 @@ function normalizeDependencyIssues(issues) {
|
|
|
41105
41111
|
}
|
|
41106
41112
|
return normalized;
|
|
41107
41113
|
}
|
|
41108
|
-
function isRecord$
|
|
41114
|
+
function isRecord$1(value) {
|
|
41109
41115
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41110
41116
|
}
|
|
41111
41117
|
async function writeJsonAtomic(input) {
|
|
@@ -43748,394 +43754,6 @@ function preserveOptionalText(value) {
|
|
|
43748
43754
|
if (typeof value !== "string" || value.trim().length === 0) return null;
|
|
43749
43755
|
return value;
|
|
43750
43756
|
}
|
|
43751
|
-
const STRUCTURED_ACTION_BLOCK_INFO_STRING = "openmeld-space-action";
|
|
43752
|
-
const STRUCTURED_ACTION_BLOCK_RE = /(?:\r?\n)?```openmeld-space-action\s*\r?\n([\s\S]*?)\r?\n```\s*$/;
|
|
43753
|
-
const STRUCTURED_ACTION_BLOCK_LINE_BREAK_RE = /\r?\n/u;
|
|
43754
|
-
const STRUCTURED_ACTION_BLOCK_HEADER_PART_RE = /\s+/u;
|
|
43755
|
-
const STRUCTURED_ACTION_BLOCK_PARSE_ERROR = "OpenMeld Space structured action block must be valid JSON or simple OpenMeld action syntax";
|
|
43756
|
-
const TRAILING_JSON_ACTION_PARSE_ERROR = "OpenMeld Space trailing JSON action must be a valid JSON object";
|
|
43757
|
-
function normalizeOpenMeldSpaceEgressActionInput(input) {
|
|
43758
|
-
if (!isRecord$1(input)) return input;
|
|
43759
|
-
const action = { ...input };
|
|
43760
|
-
switch (action.type) {
|
|
43761
|
-
case "post_message": return normalizePostMessageEgressActionInput(action);
|
|
43762
|
-
case "post_status": return normalizePostStatusEgressActionInput(action);
|
|
43763
|
-
case "stay_silent": return normalizeStaySilentEgressActionInput(action);
|
|
43764
|
-
default: return action;
|
|
43765
|
-
}
|
|
43766
|
-
}
|
|
43767
|
-
function hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput(input) {
|
|
43768
|
-
if (!(input.action && typeof input.action === "object")) return input.action;
|
|
43769
|
-
const cleanedOutput = input.cleanedOutput.trim();
|
|
43770
|
-
if (!cleanedOutput) return input.action;
|
|
43771
|
-
const action = { ...input.action };
|
|
43772
|
-
if (action.type === "post_message" && typeof action.text !== "string" && typeof action.message !== "string") return {
|
|
43773
|
-
...action,
|
|
43774
|
-
text: cleanedOutput
|
|
43775
|
-
};
|
|
43776
|
-
if (action.type === "post_status" && typeof action.text !== "string" && typeof action.note !== "string") return {
|
|
43777
|
-
...action,
|
|
43778
|
-
text: cleanedOutput
|
|
43779
|
-
};
|
|
43780
|
-
return action;
|
|
43781
|
-
}
|
|
43782
|
-
function tryExtractTrailingStructuredSpaceActionBlock(input) {
|
|
43783
|
-
const rawOutput = typeof input.output === "string" ? input.output : "";
|
|
43784
|
-
const trimmedOutput = rawOutput.trimEnd();
|
|
43785
|
-
if (trimmedOutput.length === 0) return {
|
|
43786
|
-
carrierKind: "none",
|
|
43787
|
-
cleanedOutput: trimmedOutput,
|
|
43788
|
-
action: null,
|
|
43789
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43790
|
-
parseError: null
|
|
43791
|
-
};
|
|
43792
|
-
let output;
|
|
43793
|
-
try {
|
|
43794
|
-
output = normalizeOutput(rawOutput);
|
|
43795
|
-
} catch (error) {
|
|
43796
|
-
return {
|
|
43797
|
-
carrierKind: "invalid_json",
|
|
43798
|
-
cleanedOutput: trimmedOutput,
|
|
43799
|
-
action: null,
|
|
43800
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43801
|
-
parseError: error instanceof Error ? error.message : "OpenMeld Space structured action output is invalid"
|
|
43802
|
-
};
|
|
43803
|
-
}
|
|
43804
|
-
const matched = STRUCTURED_ACTION_BLOCK_RE.exec(output);
|
|
43805
|
-
if (!matched) return extractTrailingStandaloneJsonSpaceAction({
|
|
43806
|
-
output,
|
|
43807
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING
|
|
43808
|
-
});
|
|
43809
|
-
const cleanedOutput = resolveInvalidBlockFallbackOutput({
|
|
43810
|
-
matchedIndex: matched.index,
|
|
43811
|
-
output
|
|
43812
|
-
});
|
|
43813
|
-
const blockText = matched[1]?.trim() ?? "";
|
|
43814
|
-
if (blockText.length === 0) return {
|
|
43815
|
-
carrierKind: "fenced_block",
|
|
43816
|
-
cleanedOutput,
|
|
43817
|
-
action: null,
|
|
43818
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43819
|
-
parseError: "OpenMeld Space structured action block is empty"
|
|
43820
|
-
};
|
|
43821
|
-
const parsedBlock = tryParseStructuredSpaceActionBlockInput(blockText);
|
|
43822
|
-
if (!(parsedBlock.actionInput && !parsedBlock.parseError)) return {
|
|
43823
|
-
carrierKind: "fenced_block",
|
|
43824
|
-
cleanedOutput,
|
|
43825
|
-
action: null,
|
|
43826
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43827
|
-
parseError: parsedBlock.parseError
|
|
43828
|
-
};
|
|
43829
|
-
try {
|
|
43830
|
-
const action = normalizeExtractedOpenMeldSpaceEgressAction(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
|
|
43831
|
-
action: parsedBlock.actionInput,
|
|
43832
|
-
cleanedOutput
|
|
43833
|
-
}));
|
|
43834
|
-
return {
|
|
43835
|
-
carrierKind: "fenced_block",
|
|
43836
|
-
cleanedOutput: output.slice(0, matched.index).trimEnd(),
|
|
43837
|
-
action,
|
|
43838
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43839
|
-
parseError: null
|
|
43840
|
-
};
|
|
43841
|
-
} catch (error) {
|
|
43842
|
-
return {
|
|
43843
|
-
carrierKind: "fenced_block",
|
|
43844
|
-
cleanedOutput,
|
|
43845
|
-
action: null,
|
|
43846
|
-
infoString: STRUCTURED_ACTION_BLOCK_INFO_STRING,
|
|
43847
|
-
parseError: error instanceof Error ? error.message : "OpenMeld Space egress action is invalid"
|
|
43848
|
-
};
|
|
43849
|
-
}
|
|
43850
|
-
}
|
|
43851
|
-
function extractTrailingStandaloneJsonSpaceAction(input) {
|
|
43852
|
-
const candidates = resolveTrailingStandaloneJsonActionCandidates(input.output);
|
|
43853
|
-
if (candidates.length === 0) return {
|
|
43854
|
-
carrierKind: "none",
|
|
43855
|
-
cleanedOutput: input.output,
|
|
43856
|
-
action: null,
|
|
43857
|
-
infoString: input.infoString,
|
|
43858
|
-
parseError: null
|
|
43859
|
-
};
|
|
43860
|
-
let parseError = TRAILING_JSON_ACTION_PARSE_ERROR;
|
|
43861
|
-
for (const candidate of candidates) {
|
|
43862
|
-
const parsedJson = parseStructuredSpaceActionBlockJson(candidate.jsonText);
|
|
43863
|
-
if (!(parsedJson && typeof parsedJson === "object" && !Array.isArray(parsedJson))) continue;
|
|
43864
|
-
try {
|
|
43865
|
-
const action = normalizeExtractedOpenMeldSpaceEgressAction(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
|
|
43866
|
-
action: parsedJson,
|
|
43867
|
-
cleanedOutput: candidate.cleanedOutput
|
|
43868
|
-
}));
|
|
43869
|
-
return {
|
|
43870
|
-
carrierKind: "trailing_json",
|
|
43871
|
-
cleanedOutput: candidate.cleanedOutput,
|
|
43872
|
-
action,
|
|
43873
|
-
infoString: input.infoString,
|
|
43874
|
-
parseError: null
|
|
43875
|
-
};
|
|
43876
|
-
} catch (error) {
|
|
43877
|
-
if (parseError === TRAILING_JSON_ACTION_PARSE_ERROR) parseError = error instanceof Error ? error.message : "OpenMeld Space egress action is invalid";
|
|
43878
|
-
}
|
|
43879
|
-
}
|
|
43880
|
-
return {
|
|
43881
|
-
carrierKind: "invalid_json",
|
|
43882
|
-
cleanedOutput: input.output,
|
|
43883
|
-
action: null,
|
|
43884
|
-
infoString: input.infoString,
|
|
43885
|
-
parseError
|
|
43886
|
-
};
|
|
43887
|
-
}
|
|
43888
|
-
function tryParseStructuredSpaceActionBlockInput(blockText) {
|
|
43889
|
-
const normalizedBlockText = blockText.trim();
|
|
43890
|
-
if (normalizedBlockText.length === 0) return {
|
|
43891
|
-
actionInput: null,
|
|
43892
|
-
parseError: "OpenMeld Space structured action block is empty"
|
|
43893
|
-
};
|
|
43894
|
-
const parsedJson = parseStructuredSpaceActionBlockJson(normalizedBlockText);
|
|
43895
|
-
if (parsedJson) return {
|
|
43896
|
-
actionInput: parsedJson,
|
|
43897
|
-
parseError: null
|
|
43898
|
-
};
|
|
43899
|
-
const parsedSimpleAction = parseSimpleStructuredSpaceActionBlock(normalizedBlockText);
|
|
43900
|
-
if (parsedSimpleAction) return {
|
|
43901
|
-
actionInput: parsedSimpleAction,
|
|
43902
|
-
parseError: null
|
|
43903
|
-
};
|
|
43904
|
-
return {
|
|
43905
|
-
actionInput: null,
|
|
43906
|
-
parseError: STRUCTURED_ACTION_BLOCK_PARSE_ERROR
|
|
43907
|
-
};
|
|
43908
|
-
}
|
|
43909
|
-
function normalizeOutput(value) {
|
|
43910
|
-
const normalized = value.trimEnd();
|
|
43911
|
-
if (normalized.length > 0) return normalized;
|
|
43912
|
-
throw new Error("output is required");
|
|
43913
|
-
}
|
|
43914
|
-
function resolveTrailingStandaloneJsonActionCandidates(output) {
|
|
43915
|
-
const candidateOutput = output.trimEnd();
|
|
43916
|
-
if (!candidateOutput.endsWith("}")) return [];
|
|
43917
|
-
return resolveTrailingStandaloneJsonLineStartIndices(candidateOutput).map((startIndex) => {
|
|
43918
|
-
const jsonText = candidateOutput.slice(startIndex).trim();
|
|
43919
|
-
return {
|
|
43920
|
-
cleanedOutput: candidateOutput.slice(0, startIndex).trimEnd(),
|
|
43921
|
-
jsonText
|
|
43922
|
-
};
|
|
43923
|
-
}).filter((candidate) => candidate.jsonText.startsWith("{") && candidate.jsonText.endsWith("}"));
|
|
43924
|
-
}
|
|
43925
|
-
function resolveTrailingStandaloneJsonLineStartIndices(output) {
|
|
43926
|
-
const lineStartIndices = [];
|
|
43927
|
-
let lineStartIndex = 0;
|
|
43928
|
-
for (let index = 0; index <= output.length; index += 1) {
|
|
43929
|
-
if (!(index === output.length || output[index] === "\n")) continue;
|
|
43930
|
-
let candidateStartIndex = lineStartIndex;
|
|
43931
|
-
while (candidateStartIndex < index && (output[candidateStartIndex] === " " || output[candidateStartIndex] === " ")) candidateStartIndex += 1;
|
|
43932
|
-
if (output[candidateStartIndex] === "{") lineStartIndices.push(candidateStartIndex);
|
|
43933
|
-
lineStartIndex = index + 1;
|
|
43934
|
-
}
|
|
43935
|
-
return lineStartIndices.reverse();
|
|
43936
|
-
}
|
|
43937
|
-
function resolveInvalidBlockFallbackOutput(input) {
|
|
43938
|
-
const cleanedOutput = input.output.slice(0, input.matchedIndex).trimEnd();
|
|
43939
|
-
return cleanedOutput.length > 0 ? cleanedOutput : "";
|
|
43940
|
-
}
|
|
43941
|
-
function parseStructuredSpaceActionBlockJson(blockText) {
|
|
43942
|
-
try {
|
|
43943
|
-
return JSON.parse(blockText);
|
|
43944
|
-
} catch {
|
|
43945
|
-
const repairedBlockText = appendMissingJsonClosers(blockText);
|
|
43946
|
-
if (!repairedBlockText || repairedBlockText === blockText) return null;
|
|
43947
|
-
try {
|
|
43948
|
-
return JSON.parse(repairedBlockText);
|
|
43949
|
-
} catch {
|
|
43950
|
-
return null;
|
|
43951
|
-
}
|
|
43952
|
-
}
|
|
43953
|
-
}
|
|
43954
|
-
function isRecord$1(value) {
|
|
43955
|
-
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
43956
|
-
}
|
|
43957
|
-
function normalizePostMessageEgressActionInput(action) {
|
|
43958
|
-
const { message, messageEnvelope, replyTo, text, ...rest } = action;
|
|
43959
|
-
if (isRecord$1(messageEnvelope)) return {
|
|
43960
|
-
...rest,
|
|
43961
|
-
messageEnvelope: normalizeMessageEnvelope(messageEnvelope)
|
|
43962
|
-
};
|
|
43963
|
-
const rawText = resolveLegacyPostMessageText({
|
|
43964
|
-
message,
|
|
43965
|
-
text
|
|
43966
|
-
});
|
|
43967
|
-
if (typeof rawText !== "string") return rest;
|
|
43968
|
-
const rawReplyToSignalId = resolveLegacyReplyToSignalId(replyTo);
|
|
43969
|
-
return {
|
|
43970
|
-
...rest,
|
|
43971
|
-
messageEnvelope: normalizeMessageEnvelope({
|
|
43972
|
-
...rawReplyToSignalId ? { replyToSignalId: rawReplyToSignalId } : {},
|
|
43973
|
-
text: rawText
|
|
43974
|
-
})
|
|
43975
|
-
};
|
|
43976
|
-
}
|
|
43977
|
-
function resolveLegacyPostMessageText(input) {
|
|
43978
|
-
if (typeof input.text === "string") return input.text;
|
|
43979
|
-
if (typeof input.message === "string") return input.message;
|
|
43980
|
-
}
|
|
43981
|
-
function resolveLegacyReplyToSignalId(value) {
|
|
43982
|
-
if (!isRecord$1(value) || typeof value.signalId !== "string") return;
|
|
43983
|
-
return value.signalId;
|
|
43984
|
-
}
|
|
43985
|
-
function normalizePostStatusEgressActionInput(action) {
|
|
43986
|
-
const { note, ...rest } = action;
|
|
43987
|
-
if (typeof rest.text !== "string" && typeof note === "string") return {
|
|
43988
|
-
...rest,
|
|
43989
|
-
text: note.trim()
|
|
43990
|
-
};
|
|
43991
|
-
return rest;
|
|
43992
|
-
}
|
|
43993
|
-
function normalizeStaySilentEgressActionInput(action) {
|
|
43994
|
-
const { note, ...rest } = action;
|
|
43995
|
-
if (typeof rest.reason !== "string" && typeof note === "string") return {
|
|
43996
|
-
...rest,
|
|
43997
|
-
reason: note.trim()
|
|
43998
|
-
};
|
|
43999
|
-
return rest;
|
|
44000
|
-
}
|
|
44001
|
-
function parseSimpleStructuredSpaceActionBlock(blockText) {
|
|
44002
|
-
const [rawHeader, ...bodyLines] = trimSimpleStructuredActionOuterEmptyLines(blockText.split(STRUCTURED_ACTION_BLOCK_LINE_BREAK_RE));
|
|
44003
|
-
const parsedHeader = parseSimpleStructuredActionHeader(rawHeader);
|
|
44004
|
-
if (!parsedHeader) return null;
|
|
44005
|
-
switch (parsedHeader.actionType) {
|
|
44006
|
-
case "post_message": return buildSimplePostMessageAction({
|
|
44007
|
-
bodyLines,
|
|
44008
|
-
headerBody: parsedHeader.headerBody
|
|
44009
|
-
});
|
|
44010
|
-
case "stay_silent": return buildSimpleStaySilentAction({
|
|
44011
|
-
bodyLines,
|
|
44012
|
-
headerBody: parsedHeader.headerBody
|
|
44013
|
-
});
|
|
44014
|
-
case "post_status": return buildSimplePostStatusAction({
|
|
44015
|
-
bodyLines,
|
|
44016
|
-
headerArgs: parsedHeader.headerArgs
|
|
44017
|
-
});
|
|
44018
|
-
default: return null;
|
|
44019
|
-
}
|
|
44020
|
-
}
|
|
44021
|
-
function parseSimpleStructuredActionHeader(rawHeader) {
|
|
44022
|
-
const header = rawHeader?.trim();
|
|
44023
|
-
if (!header) return null;
|
|
44024
|
-
const [rawActionType, ...headerArgs] = header.split(STRUCTURED_ACTION_BLOCK_HEADER_PART_RE);
|
|
44025
|
-
const actionType = rawActionType?.trim();
|
|
44026
|
-
if (!actionType) return null;
|
|
44027
|
-
return {
|
|
44028
|
-
actionType,
|
|
44029
|
-
headerArgs,
|
|
44030
|
-
headerBody: headerArgs.join(" ").trim()
|
|
44031
|
-
};
|
|
44032
|
-
}
|
|
44033
|
-
function buildSimplePostMessageAction(input) {
|
|
44034
|
-
const text = joinSimpleStructuredActionTextParts([input.headerBody, joinSimpleStructuredActionText(input.headerBody ? input.bodyLines : trimSingleLeadingEmptyLine(input.bodyLines))]);
|
|
44035
|
-
return text ? {
|
|
44036
|
-
type: "post_message",
|
|
44037
|
-
text
|
|
44038
|
-
} : { type: "post_message" };
|
|
44039
|
-
}
|
|
44040
|
-
function buildSimpleStaySilentAction(input) {
|
|
44041
|
-
const reason = joinSimpleStructuredActionTextParts([input.headerBody, joinSimpleStructuredActionText(input.headerBody ? input.bodyLines : trimSingleLeadingEmptyLine(input.bodyLines))]);
|
|
44042
|
-
return reason ? {
|
|
44043
|
-
type: "stay_silent",
|
|
44044
|
-
reason
|
|
44045
|
-
} : { type: "stay_silent" };
|
|
44046
|
-
}
|
|
44047
|
-
function buildSimplePostStatusAction(input) {
|
|
44048
|
-
const statusFromHeader = input.headerArgs[0]?.trim();
|
|
44049
|
-
const headerNote = input.headerArgs.slice(1).join(" ").trim();
|
|
44050
|
-
const bodyLinesAfterSingleSpacer = trimSingleLeadingEmptyLine(input.bodyLines);
|
|
44051
|
-
const status = statusFromHeader || bodyLinesAfterSingleSpacer[0]?.trim();
|
|
44052
|
-
if (!status) return null;
|
|
44053
|
-
let textLines;
|
|
44054
|
-
if (statusFromHeader) textLines = headerNote ? [headerNote, ...input.bodyLines] : trimSingleLeadingEmptyLine(input.bodyLines);
|
|
44055
|
-
else textLines = trimSingleLeadingEmptyLine(bodyLinesAfterSingleSpacer.slice(1));
|
|
44056
|
-
const text = joinSimpleStructuredActionText(textLines);
|
|
44057
|
-
return text ? {
|
|
44058
|
-
type: "post_status",
|
|
44059
|
-
status,
|
|
44060
|
-
text
|
|
44061
|
-
} : {
|
|
44062
|
-
type: "post_status",
|
|
44063
|
-
status
|
|
44064
|
-
};
|
|
44065
|
-
}
|
|
44066
|
-
function trimSimpleStructuredActionOuterEmptyLines(lines) {
|
|
44067
|
-
const nextLines = [...lines];
|
|
44068
|
-
if (nextLines[0]?.trim() === "") nextLines.shift();
|
|
44069
|
-
if (nextLines.at(-1)?.trim() === "") nextLines.pop();
|
|
44070
|
-
return nextLines;
|
|
44071
|
-
}
|
|
44072
|
-
function trimSingleLeadingEmptyLine(lines) {
|
|
44073
|
-
return lines[0]?.trim() === "" ? lines.slice(1) : lines;
|
|
44074
|
-
}
|
|
44075
|
-
function joinSimpleStructuredActionText(lines) {
|
|
44076
|
-
const text = lines.join("\n");
|
|
44077
|
-
return text.trim().length > 0 ? text : null;
|
|
44078
|
-
}
|
|
44079
|
-
function joinSimpleStructuredActionTextParts(parts) {
|
|
44080
|
-
const definedParts = parts.filter((part) => typeof part === "string" && part.trim().length > 0);
|
|
44081
|
-
if (definedParts.length === 0) return null;
|
|
44082
|
-
return definedParts.join("\n");
|
|
44083
|
-
}
|
|
44084
|
-
function normalizeExtractedOpenMeldSpaceEgressAction(input) {
|
|
44085
|
-
const normalizedInput = normalizeOpenMeldSpaceEgressActionInput(input);
|
|
44086
|
-
const parsed = openMeldSpaceEgressActionSchema.safeParse(normalizedInput);
|
|
44087
|
-
if (!parsed.success) throw new Error(parsed.error.issues[0]?.message ?? "OpenMeld Space egress action is invalid");
|
|
44088
|
-
if (!(normalizedInput && typeof normalizedInput === "object")) return parsed.data;
|
|
44089
|
-
if (parsed.data.type === "post_status") {
|
|
44090
|
-
const preservedText = normalizedInput.text;
|
|
44091
|
-
if (typeof preservedText === "string" && preservedText.trim().length > 0) return {
|
|
44092
|
-
...parsed.data,
|
|
44093
|
-
text: preservedText
|
|
44094
|
-
};
|
|
44095
|
-
}
|
|
44096
|
-
if (parsed.data.type === "post_message" && "messageEnvelope" in normalizedInput && normalizedInput.messageEnvelope && typeof normalizedInput.messageEnvelope === "object") {
|
|
44097
|
-
const preservedText = normalizedInput.messageEnvelope.text;
|
|
44098
|
-
if (typeof preservedText === "string" && preservedText.trim().length > 0) return {
|
|
44099
|
-
...parsed.data,
|
|
44100
|
-
messageEnvelope: {
|
|
44101
|
-
...parsed.data.messageEnvelope,
|
|
44102
|
-
text: preservedText
|
|
44103
|
-
}
|
|
44104
|
-
};
|
|
44105
|
-
}
|
|
44106
|
-
return parsed.data;
|
|
44107
|
-
}
|
|
44108
|
-
function appendMissingJsonClosers(blockText) {
|
|
44109
|
-
const stack = [];
|
|
44110
|
-
let inString = false;
|
|
44111
|
-
let escaped = false;
|
|
44112
|
-
for (const character of blockText) {
|
|
44113
|
-
if (escaped) {
|
|
44114
|
-
escaped = false;
|
|
44115
|
-
continue;
|
|
44116
|
-
}
|
|
44117
|
-
if (character === "\\") {
|
|
44118
|
-
escaped = true;
|
|
44119
|
-
continue;
|
|
44120
|
-
}
|
|
44121
|
-
if (character === "\"") {
|
|
44122
|
-
inString = !inString;
|
|
44123
|
-
continue;
|
|
44124
|
-
}
|
|
44125
|
-
if (inString) continue;
|
|
44126
|
-
if (character === "{") {
|
|
44127
|
-
stack.push("}");
|
|
44128
|
-
continue;
|
|
44129
|
-
}
|
|
44130
|
-
if (character === "[") {
|
|
44131
|
-
stack.push("]");
|
|
44132
|
-
continue;
|
|
44133
|
-
}
|
|
44134
|
-
if ((character === "}" || character === "]") && stack.at(-1) === character) stack.pop();
|
|
44135
|
-
}
|
|
44136
|
-
if (inString || stack.length === 0) return null;
|
|
44137
|
-
return `${blockText}${stack.reverse().join("")}`;
|
|
44138
|
-
}
|
|
44139
43757
|
const SPACE_CONTRACT_ALLOWED_ACTION_ORDER = [
|
|
44140
43758
|
"post_message",
|
|
44141
43759
|
"post_status",
|
|
@@ -44160,41 +43778,23 @@ function areAllowedActionsEquivalent(left, right) {
|
|
|
44160
43778
|
return canonicalLeft.length === canonicalRight.length && canonicalLeft.every((action, index) => action === canonicalRight[index]);
|
|
44161
43779
|
}
|
|
44162
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.";
|
|
44163
|
-
const COLLABORATION_ACTION_REQUIREMENT = "Final outcome:
|
|
44164
|
-
const COLLABORATION_REPAIR_REQUIREMENT = "
|
|
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.";
|
|
44165
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.";
|
|
44166
43784
|
const RAW_CONTEXT_SHARING_ACTION_REQUIREMENT = "Raw reply is allowed. Use OpenMeld Space Action only when you need a controlled visible outcome.";
|
|
44167
|
-
const RAW_CONTEXT_SHARING_REPAIR_REQUIREMENT = "
|
|
44168
|
-
function
|
|
44169
|
-
const lines = [
|
|
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 = [];
|
|
44170
43788
|
for (const allowedAction of input.allowedActions) switch (allowedAction) {
|
|
44171
43789
|
case "post_message":
|
|
44172
|
-
lines.push("Use
|
|
44173
|
-
lines.push([
|
|
44174
|
-
"Canonical post_message block:",
|
|
44175
|
-
"```openmeld-space-action",
|
|
44176
|
-
"{\"type\":\"post_message\",\"messageEnvelope\":{\"text\":\"Hello.\",\"activationTargets\":[],\"referenceTargets\":[]}}",
|
|
44177
|
-
"```"
|
|
44178
|
-
].join("\n"));
|
|
43790
|
+
lines.push("Use the dispatch-scoped Space Action reply command for normal public replies, greetings, answers, and discussion.");
|
|
44179
43791
|
break;
|
|
44180
43792
|
case "post_status":
|
|
44181
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.");
|
|
44182
43794
|
lines.push(`Keep post_status text at 120 characters or fewer. Use post_message for answers, discussion, or anything longer.`);
|
|
44183
|
-
lines.push([
|
|
44184
|
-
"Canonical post_status block (prefer final-safe statuses: done | blocked | needs_input | handoff):",
|
|
44185
|
-
"```openmeld-space-action",
|
|
44186
|
-
"{\"type\":\"post_status\",\"status\":\"done\",\"text\":\"Status update.\"}",
|
|
44187
|
-
"```"
|
|
44188
|
-
].join("\n"));
|
|
44189
43795
|
break;
|
|
44190
43796
|
case "stay_silent":
|
|
44191
|
-
lines.push("Use
|
|
44192
|
-
lines.push([
|
|
44193
|
-
"Canonical stay_silent block:",
|
|
44194
|
-
"```openmeld-space-action",
|
|
44195
|
-
"{\"type\":\"stay_silent\",\"reason\":\"No public reply is needed.\"}",
|
|
44196
|
-
"```"
|
|
44197
|
-
].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.");
|
|
44198
43798
|
break;
|
|
44199
43799
|
default: break;
|
|
44200
43800
|
}
|
|
@@ -44204,8 +43804,8 @@ function resolveSpacePublicationRequirement(input) {
|
|
|
44204
43804
|
const publicationMode = input?.publicationMode ?? DEFAULT_SPACE_CONTRACT_FIELDS.publicationMode;
|
|
44205
43805
|
const allowedActions = canonicalizeAllowedActions(input?.allowedActions ?? DEFAULT_SPACE_CONTRACT_FIELDS.allowedActions);
|
|
44206
43806
|
if (publicationMode === "raw_context_sharing") return {
|
|
43807
|
+
actionGuidanceLines: buildActionGuidanceLines$1({ allowedActions }),
|
|
44207
43808
|
actionRequirementLine: RAW_CONTEXT_SHARING_ACTION_REQUIREMENT,
|
|
44208
|
-
actionSchemaGuidanceLines: buildActionSchemaGuidanceLines({ allowedActions }),
|
|
44209
43809
|
allowedActions,
|
|
44210
43810
|
allowsRawReplyWithoutAction: true,
|
|
44211
43811
|
howThisSpaceWorks: RAW_CONTEXT_SHARING_HOW_THIS_SPACE_WORKS,
|
|
@@ -44214,8 +43814,8 @@ function resolveSpacePublicationRequirement(input) {
|
|
|
44214
43814
|
requiresExplicitPublicAction: false
|
|
44215
43815
|
};
|
|
44216
43816
|
return {
|
|
43817
|
+
actionGuidanceLines: buildActionGuidanceLines$1({ allowedActions }),
|
|
44217
43818
|
actionRequirementLine: COLLABORATION_ACTION_REQUIREMENT,
|
|
44218
|
-
actionSchemaGuidanceLines: buildActionSchemaGuidanceLines({ allowedActions }),
|
|
44219
43819
|
allowedActions,
|
|
44220
43820
|
allowsRawReplyWithoutAction: false,
|
|
44221
43821
|
howThisSpaceWorks: COLLABORATION_HOW_THIS_SPACE_WORKS,
|
|
@@ -51421,23 +51021,6 @@ const CODEX_USER_AGENT_VERSION_RE = /\/([^\s]+)/u;
|
|
|
51421
51021
|
const CLI_SEMVER_RE = /\b(\d+\.\d+\.\d+(?:[-+][^\s]+)?)\b/u;
|
|
51422
51022
|
const SEMVER_CORE_RE = /^v?(\d+)\.(\d+)\.(\d+)/u;
|
|
51423
51023
|
const WHITESPACE_RE = /\s+/u;
|
|
51424
|
-
const EMAIL_RE = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/iu;
|
|
51425
|
-
const CLAUDE_UNAUTHENTICATED_OUTPUT_PATTERNS = [
|
|
51426
|
-
"invalid api key",
|
|
51427
|
-
"invalid token",
|
|
51428
|
-
"expired token",
|
|
51429
|
-
"missing api key",
|
|
51430
|
-
"missing credentials",
|
|
51431
|
-
"authentication_failed",
|
|
51432
|
-
"oauth_org_not_allowed",
|
|
51433
|
-
"failed to authenticate",
|
|
51434
|
-
"authentication failed",
|
|
51435
|
-
"oauth session expired",
|
|
51436
|
-
"not logged in",
|
|
51437
|
-
"not authenticated",
|
|
51438
|
-
"not signed in",
|
|
51439
|
-
"login required"
|
|
51440
|
-
];
|
|
51441
51024
|
const latestControllerVersionCache = /* @__PURE__ */ new Map();
|
|
51442
51025
|
const CONTROLLER_INTERFACE_SNAPSHOT_RESOLVERS = {
|
|
51443
51026
|
"claude-code": resolveClaudeCodeInterfaceSnapshot,
|
|
@@ -51897,18 +51480,31 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
|
|
|
51897
51480
|
launchContract: input.launchContract
|
|
51898
51481
|
}), runLaunchContractCommand({
|
|
51899
51482
|
allowNonZeroExit: true,
|
|
51900
|
-
args: [
|
|
51483
|
+
args: [
|
|
51484
|
+
"auth",
|
|
51485
|
+
"status",
|
|
51486
|
+
"--json"
|
|
51487
|
+
],
|
|
51901
51488
|
launchContract: input.launchContract
|
|
51902
51489
|
})]);
|
|
51903
51490
|
const auth = resolveClaudeAuthSnapshot(authProbe);
|
|
51904
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
|
+
}
|
|
51905
51501
|
return {
|
|
51906
|
-
probeCompleted: authProbe.ok,
|
|
51502
|
+
probeCompleted: authProbe.ok && auth.status !== "unknown",
|
|
51907
51503
|
snapshot: {
|
|
51908
51504
|
...input.baseSnapshot,
|
|
51909
51505
|
auth,
|
|
51910
|
-
message
|
|
51911
|
-
status
|
|
51506
|
+
message,
|
|
51507
|
+
status,
|
|
51912
51508
|
version,
|
|
51913
51509
|
versionAdvisory: await resolveControllerVersionAdvisory({
|
|
51914
51510
|
checkedAt: input.baseSnapshot.checkedAt,
|
|
@@ -51925,7 +51521,11 @@ async function resolveCursorInterfaceSnapshot(input) {
|
|
|
51925
51521
|
launchContract: input.launchContract
|
|
51926
51522
|
}), runLaunchContractCommand({
|
|
51927
51523
|
allowNonZeroExit: true,
|
|
51928
|
-
args: [
|
|
51524
|
+
args: [
|
|
51525
|
+
"status",
|
|
51526
|
+
"--format",
|
|
51527
|
+
"json"
|
|
51528
|
+
],
|
|
51929
51529
|
launchContract: input.launchContract
|
|
51930
51530
|
})]);
|
|
51931
51531
|
const auth = resolveCursorAuthSnapshot(authProbe);
|
|
@@ -52420,45 +52020,25 @@ function resolveCodexAuthSnapshot(response) {
|
|
|
52420
52020
|
function resolveClaudeAuthSnapshot(probe) {
|
|
52421
52021
|
if (!probe.ok) return { status: "unknown" };
|
|
52422
52022
|
const payload = parseJsonRecord(probe.stdout);
|
|
52423
|
-
if (payload) {
|
|
52424
|
-
|
|
52425
|
-
|
|
52426
|
-
|
|
52427
|
-
|
|
52428
|
-
|
|
52429
|
-
|
|
52430
|
-
|
|
52431
|
-
|
|
52432
|
-
};
|
|
52433
|
-
}
|
|
52434
|
-
const output = `${probe.stdout}\n${probe.stderr}`.trim();
|
|
52435
|
-
const lower = output.toLowerCase();
|
|
52436
|
-
if (CLAUDE_UNAUTHENTICATED_OUTPUT_PATTERNS.some((pattern) => lower.includes(pattern))) return { status: "unauthenticated" };
|
|
52437
|
-
if (probe.code === 0 && output.length > 0) {
|
|
52438
|
-
const email = resolveLikelyEmail(output);
|
|
52439
|
-
return {
|
|
52440
|
-
...email ? { email } : {},
|
|
52441
|
-
label: email ?? "Signed in",
|
|
52442
|
-
status: "authenticated",
|
|
52443
|
-
type: "claude"
|
|
52444
|
-
};
|
|
52445
|
-
}
|
|
52446
|
-
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
|
+
};
|
|
52447
52032
|
}
|
|
52448
52033
|
function resolveCursorAuthSnapshot(probe) {
|
|
52449
52034
|
if (!probe.ok) return { status: "unknown" };
|
|
52450
|
-
const
|
|
52451
|
-
|
|
52452
|
-
if (
|
|
52453
|
-
|
|
52454
|
-
|
|
52455
|
-
|
|
52456
|
-
|
|
52457
|
-
label: email ?? "Signed in",
|
|
52458
|
-
status: "authenticated",
|
|
52459
|
-
type: "cursor_login"
|
|
52460
|
-
};
|
|
52461
|
-
}
|
|
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
|
+
};
|
|
52462
52042
|
return { status: "unknown" };
|
|
52463
52043
|
}
|
|
52464
52044
|
function resolveOpenClawAuthProbe(probe) {
|
|
@@ -52545,9 +52125,6 @@ function normalizeOptionalText$15(value) {
|
|
|
52545
52125
|
const normalized = value.trim();
|
|
52546
52126
|
return normalized.length > 0 ? normalized : null;
|
|
52547
52127
|
}
|
|
52548
|
-
function resolveLikelyEmail(value) {
|
|
52549
|
-
return value.match(EMAIL_RE)?.[0] ?? null;
|
|
52550
|
-
}
|
|
52551
52128
|
function toErrorMessage$16(error) {
|
|
52552
52129
|
if (error instanceof Error) {
|
|
52553
52130
|
const message = error.message.trim();
|
|
@@ -57298,14 +56875,14 @@ function renderMandatoryCompletionSection(input) {
|
|
|
57298
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.",
|
|
57299
56876
|
buildMandatoryCompletionActionLine(input, publicationRequirement),
|
|
57300
56877
|
"- After the Space Action command succeeds, stop. OpenMeld reads that command as the public outcome.",
|
|
57301
|
-
|
|
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."
|
|
57302
56879
|
].join("\n");
|
|
57303
56880
|
}
|
|
57304
56881
|
function buildMandatoryCompletionActionLine(input, publicationRequirement) {
|
|
57305
56882
|
if (publicationRequirement.allowedActions.includes("post_message")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "reply \"your public message\"")}\` and wait for it to finish.`;
|
|
57306
56883
|
if (publicationRequirement.allowedActions.includes("post_status")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "status done \"short completion update\"")}\` and wait for it to finish.`;
|
|
57307
56884
|
if (publicationRequirement.allowedActions.includes("stay_silent")) return `- Normal completion: run \`${buildSpaceActionCommand(input, "silent --reason \"reason\"")}\` and wait for it to finish.`;
|
|
57308
|
-
return
|
|
56885
|
+
return "- No permitted OpenMeld Space action is available. Do not invent one in answer text.";
|
|
57309
56886
|
}
|
|
57310
56887
|
function buildServiceFreshnessWarningLines(input) {
|
|
57311
56888
|
return input.serviceFreshnessWarningLines?.filter(Boolean) ?? [];
|
|
@@ -57342,9 +56919,6 @@ function buildActionGuidanceLines(input) {
|
|
|
57342
56919
|
function buildSpaceActionCommand(input, action) {
|
|
57343
56920
|
return `${normalizeOptionalText$44(input.cliEntry) ?? "openmeld"} space action ${action}`;
|
|
57344
56921
|
}
|
|
57345
|
-
function buildPromptSpaceActionCommand(input) {
|
|
57346
|
-
return `${normalizeOptionalText$44(input.cliEntry) ?? "openmeld"} prompt space-action --raw`;
|
|
57347
|
-
}
|
|
57348
56922
|
function buildSendTargetReferenceLines(input) {
|
|
57349
56923
|
if (!(input.sendTargetReferenceLines && input.sendTargetReferenceLines.length > 0)) return [];
|
|
57350
56924
|
return ["- Send target reference:", ...input.sendTargetReferenceLines.map((line) => ` ${line}`)];
|
|
@@ -63374,8 +62948,8 @@ function renderDaemonStartNeedsAttention(input) {
|
|
|
63374
62948
|
//#endregion
|
|
63375
62949
|
//#region src/local-components/manifest.ts
|
|
63376
62950
|
const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-05-local-components-v1";
|
|
63377
|
-
const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-
|
|
63378
|
-
const OPENMELD_SERVICE_CONTRACT_VERSION =
|
|
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";
|
|
63379
62953
|
const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
|
|
63380
62954
|
const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
|
|
63381
62955
|
"version_outdated",
|
|
@@ -63773,8 +63347,8 @@ const RECOVERY_PROMPT = [
|
|
|
63773
63347
|
"OpenMeld execution recovery.",
|
|
63774
63348
|
"Continue this exact controller conversation.",
|
|
63775
63349
|
"Do not redo the task, call tools, edit files, or perform external actions.",
|
|
63776
|
-
"Return
|
|
63777
|
-
"
|
|
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."
|
|
63778
63352
|
].join(" ");
|
|
63779
63353
|
async function resumeExactControllerConversation(input) {
|
|
63780
63354
|
const identity = input.request.identity;
|
|
@@ -63834,7 +63408,7 @@ async function resumeExactControllerConversation(input) {
|
|
|
63834
63408
|
status: "outcome_unknown"
|
|
63835
63409
|
};
|
|
63836
63410
|
const output = result.output.trim();
|
|
63837
|
-
if (!output
|
|
63411
|
+
if (!output) return {
|
|
63838
63412
|
destination: input.request.destination,
|
|
63839
63413
|
identity,
|
|
63840
63414
|
message: "The exact conversation did not contain a completed result.",
|
|
@@ -65749,7 +65323,7 @@ function buildAgentReplyReconsiderationPrompt(input) {
|
|
|
65749
65323
|
"Keep the user's full request as the goal. Reconsider only the final Space action in light of these newer messages.",
|
|
65750
65324
|
"Replace the proposal when a distinct, useful contribution is still possible. Avoid duplicating work or a conclusion another Agent has already posted.",
|
|
65751
65325
|
"Choose stay_silent only when no distinct, useful, non-duplicative contribution remains.",
|
|
65752
|
-
"
|
|
65326
|
+
"Call exactly one dispatch-scoped OpenMeld Space Action CLI command for the final action. Answer text never becomes an action.",
|
|
65753
65327
|
`Previous proposed action: ${JSON.stringify(input.action)}`,
|
|
65754
65328
|
`Newer Space messages: ${JSON.stringify(updates)}`
|
|
65755
65329
|
].join("\n");
|
|
@@ -66422,7 +65996,6 @@ function buildResultDispatchJournalMetadata(payload) {
|
|
|
66422
65996
|
}
|
|
66423
65997
|
//#endregion
|
|
66424
65998
|
//#region src/local-service/dispatch/execute-dispatch-structured-action-repair.ts
|
|
66425
|
-
const STRUCTURED_SPACE_ACTION_BLOCK_HEADER_REGEX = /^\s*\r?\n?/u;
|
|
66426
65999
|
function resolveStructuredActionRequirementFailure$1(input) {
|
|
66427
66000
|
if (input.resolution.parseError) return {
|
|
66428
66001
|
failureReason: input.resolution.parseError,
|
|
@@ -66473,12 +66046,12 @@ function buildStructuredActionRepairPrompt$1(input) {
|
|
|
66473
66046
|
"This is a bounded repair of the public delivery action only. Do not redo the user's work.",
|
|
66474
66047
|
"Do not change the user's intent.",
|
|
66475
66048
|
...SPACE_ACTION_CONTEXT_GUIDANCE_LINES,
|
|
66476
|
-
"
|
|
66477
|
-
"
|
|
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.",
|
|
66478
66051
|
publicationRequirement.repairRequirementLine,
|
|
66479
66052
|
...SPACE_ACTION_TARGET_GUIDANCE_LINES,
|
|
66480
66053
|
...normalizeOptionalText$44(input.currentReplyToSignalId) ? [`post_message.messageEnvelope.replyToSignalId must match the current dispatch reply target: ${normalizeOptionalText$44(input.currentReplyToSignalId)}.`] : [],
|
|
66481
|
-
...publicationRequirement.
|
|
66054
|
+
...publicationRequirement.actionGuidanceLines,
|
|
66482
66055
|
...buildStructuredActionRepairSendTargetReferenceLines(input.sendTargetReferenceLines),
|
|
66483
66056
|
`If you need recent public room context, use \`${historyCommand}\`.`,
|
|
66484
66057
|
`If you need the OpenMeld action rules again, read the official guidance with \`${promptCommand}\` or \`${spaceGuideCommand}\`.`,
|
|
@@ -66493,7 +66066,7 @@ function buildStructuredActionRepairCompletionLines(input) {
|
|
|
66493
66066
|
return [
|
|
66494
66067
|
"Repair completion rule:",
|
|
66495
66068
|
buildStructuredActionRepairPrimaryCommandLine(input),
|
|
66496
|
-
"If the command cannot run,
|
|
66069
|
+
"If the command cannot run, stop. Do not print JSON or prose as a substitute for the tool call.",
|
|
66497
66070
|
"Do not finish with an explanation of what you will do."
|
|
66498
66071
|
];
|
|
66499
66072
|
}
|
|
@@ -66501,7 +66074,7 @@ function buildStructuredActionRepairPrimaryCommandLine(input) {
|
|
|
66501
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.`;
|
|
66502
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.`;
|
|
66503
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.`;
|
|
66504
|
-
return
|
|
66077
|
+
return "No permitted OpenMeld Space action is available. Do not invent one in answer text.";
|
|
66505
66078
|
}
|
|
66506
66079
|
function buildStructuredActionRepairSendTargetReferenceLines(sendTargetReferenceLines) {
|
|
66507
66080
|
if (!(sendTargetReferenceLines && sendTargetReferenceLines.length > 0)) return [];
|
|
@@ -66519,51 +66092,6 @@ function resolveStructuredActionRepairContinuation$1(input) {
|
|
|
66519
66092
|
agentControllerConversationOverride: input.runtimeResult.contextResolution?.agentControllerConversation ?? contextDelta?.agentControllerConversation ?? input.agentControllerConversationOverride ?? null
|
|
66520
66093
|
};
|
|
66521
66094
|
}
|
|
66522
|
-
function buildSyntheticStructuredSpaceActionRepairResult$1(input) {
|
|
66523
|
-
const payload = input.runtimeResult.resultPayload;
|
|
66524
|
-
if (payload.status !== "success" && payload.status !== "partial_success") return null;
|
|
66525
|
-
const repairedAction = attemptLocalStructuredSpaceActionRepair(payload.output);
|
|
66526
|
-
if (!repairedAction) return null;
|
|
66527
|
-
const candidate = resolveTrailingStructuredSpaceActionCandidate(payload.output);
|
|
66528
|
-
return {
|
|
66529
|
-
...input.runtimeResult,
|
|
66530
|
-
resultPayload: {
|
|
66531
|
-
...payload,
|
|
66532
|
-
output: resolveStructuredActionOutputFallback({
|
|
66533
|
-
action: repairedAction,
|
|
66534
|
-
cleanedOutput: candidate?.cleanedOutput ?? payload.output
|
|
66535
|
-
}),
|
|
66536
|
-
spaceAction: repairedAction
|
|
66537
|
-
}
|
|
66538
|
-
};
|
|
66539
|
-
}
|
|
66540
|
-
function attemptLocalStructuredSpaceActionRepair(output) {
|
|
66541
|
-
const candidate = resolveTrailingStructuredSpaceActionCandidate(output);
|
|
66542
|
-
if (!candidate) return;
|
|
66543
|
-
const parsedBlock = tryParseStructuredSpaceActionBlockInput(candidate.blockText);
|
|
66544
|
-
if (!(parsedBlock.actionInput && !parsedBlock.parseError)) return;
|
|
66545
|
-
const normalizedAction = normalizeOpenMeldSpaceEgressActionInput(hydrateOpenMeldSpaceEgressActionInputFromCleanedOutput({
|
|
66546
|
-
action: parsedBlock.actionInput,
|
|
66547
|
-
cleanedOutput: candidate.cleanedOutput
|
|
66548
|
-
}));
|
|
66549
|
-
const parsedAction = openMeldSpaceEgressActionSchema.safeParse(normalizedAction);
|
|
66550
|
-
if (!parsedAction.success) return;
|
|
66551
|
-
return parsedAction.data;
|
|
66552
|
-
}
|
|
66553
|
-
function resolveTrailingStructuredSpaceActionCandidate(output) {
|
|
66554
|
-
const normalizedOutput = typeof output === "string" ? output : "";
|
|
66555
|
-
const markerIndex = normalizedOutput.lastIndexOf("```openmeld-space-action");
|
|
66556
|
-
if (markerIndex < 0) return null;
|
|
66557
|
-
const afterMarker = normalizedOutput.slice(markerIndex + 24);
|
|
66558
|
-
const blockStartOffset = STRUCTURED_SPACE_ACTION_BLOCK_HEADER_REGEX.exec(afterMarker)?.[0].length ?? 0;
|
|
66559
|
-
let blockText = afterMarker.slice(blockStartOffset).trim();
|
|
66560
|
-
if (blockText.endsWith("```")) blockText = blockText.slice(0, -3).trimEnd();
|
|
66561
|
-
if (blockText.length === 0) return null;
|
|
66562
|
-
return {
|
|
66563
|
-
blockText,
|
|
66564
|
-
cleanedOutput: normalizedOutput.slice(0, markerIndex).trimEnd()
|
|
66565
|
-
};
|
|
66566
|
-
}
|
|
66567
66095
|
function buildInvalidStructuredActionOutputPreview(runtimeResult) {
|
|
66568
66096
|
const payload = runtimeResult.resultPayload;
|
|
66569
66097
|
if (payload.status !== "success" && payload.status !== "partial_success") return null;
|
|
@@ -66737,7 +66265,6 @@ const reconcileBootstrapInjectedContextAfterDispatch = reconcileBootstrapInjecte
|
|
|
66737
66265
|
const resolveBootstrapPlan = resolveBootstrapPlan$1;
|
|
66738
66266
|
const rollbackBootstrapExecutionStateAfterDispatchFailure = rollbackBootstrapExecutionStateAfterDispatchFailure$1;
|
|
66739
66267
|
const buildStructuredActionRepairPrompt = buildStructuredActionRepairPrompt$1;
|
|
66740
|
-
const buildSyntheticStructuredSpaceActionRepairResult = buildSyntheticStructuredSpaceActionRepairResult$1;
|
|
66741
66268
|
const coerceRuntimeResultToStructuredActionFailure = coerceRuntimeResultToStructuredActionFailure$1;
|
|
66742
66269
|
const resolveStructuredActionRepairContinuation = resolveStructuredActionRepairContinuation$1;
|
|
66743
66270
|
const resolveStructuredActionRequirementFailure = resolveStructuredActionRequirementFailure$1;
|
|
@@ -69162,10 +68689,7 @@ function normalizeResolvedPostMessageAction(input) {
|
|
|
69162
68689
|
const normalizedPostMessageAction = normalizeDispatchPostMessageAction({
|
|
69163
68690
|
action,
|
|
69164
68691
|
currentReplyToSignalId: input.parsedTask.replyToSnapshot?.signalId ?? null,
|
|
69165
|
-
inputKind:
|
|
69166
|
-
runtimeResult: input.runtimeResult,
|
|
69167
|
-
structuredSpaceActionResolution: input.structuredSpaceActionResolution
|
|
69168
|
-
}),
|
|
68692
|
+
inputKind: "direct_payload",
|
|
69169
68693
|
sendTargetReference: input.sendTargetReference
|
|
69170
68694
|
});
|
|
69171
68695
|
emitRunLine({
|
|
@@ -69193,10 +68717,7 @@ function normalizeResolvedPostMessageAction(input) {
|
|
|
69193
68717
|
activationTargetsCount: action.messageEnvelope.activationTargets.length,
|
|
69194
68718
|
dispatchId: input.parsedTask.dispatchId,
|
|
69195
68719
|
failureReason,
|
|
69196
|
-
inputKind:
|
|
69197
|
-
runtimeResult: input.runtimeResult,
|
|
69198
|
-
structuredSpaceActionResolution: input.structuredSpaceActionResolution
|
|
69199
|
-
}),
|
|
68720
|
+
inputKind: "direct_payload",
|
|
69200
68721
|
memberDirectoryLoaded: input.sendTargetReference.status === "loaded",
|
|
69201
68722
|
referenceTargetsCount: action.messageEnvelope.referenceTargets.length,
|
|
69202
68723
|
replyToSignalIdResolved: Boolean(action.messageEnvelope.replyToSignalId),
|
|
@@ -69284,55 +68805,14 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
69284
68805
|
taskId: input.parsedTask.taskId
|
|
69285
68806
|
}
|
|
69286
68807
|
});
|
|
69287
|
-
const localRepairEvaluation = resolveStructuredActionRepairEvaluation({
|
|
69288
|
-
runtimeResult: input.runtimeResult,
|
|
69289
|
-
useLocalSyntheticRepair: true
|
|
69290
|
-
});
|
|
69291
|
-
if (localRepairEvaluation.accepted && localRepairEvaluation.runtimeResult) {
|
|
69292
|
-
emitRunLine({
|
|
69293
|
-
presenter: input.presenter,
|
|
69294
|
-
code: "daemon.run.structured_action_repair_completed",
|
|
69295
|
-
text: `structured OpenMeld Space action repair completed for task ${input.parsedTask.taskId}`,
|
|
69296
|
-
payload: {
|
|
69297
|
-
dispatchId: input.parsedTask.dispatchId,
|
|
69298
|
-
repaired: true,
|
|
69299
|
-
repairMode: "local_synthetic",
|
|
69300
|
-
targetProfileId: input.parsedTask.targetProfileId,
|
|
69301
|
-
taskId: input.parsedTask.taskId
|
|
69302
|
-
}
|
|
69303
|
-
});
|
|
69304
|
-
return {
|
|
69305
|
-
finalFailureDiagnostics: null,
|
|
69306
|
-
runtimeResult: applyStructuredSpaceActionProvenanceToRuntimeResult({
|
|
69307
|
-
runtimeResult: localRepairEvaluation.runtimeResult,
|
|
69308
|
-
provenance: "local_repair"
|
|
69309
|
-
})
|
|
69310
|
-
};
|
|
69311
|
-
}
|
|
69312
|
-
const localFailureDiagnostics = resolveStructuredActionFailureDiagnostics({
|
|
69313
|
-
carrierKind: localRepairEvaluation.carrierKind,
|
|
69314
|
-
parseError: localRepairEvaluation.parseError ?? input.failureReason,
|
|
69315
|
-
publicFailureReason: input.failureReason,
|
|
69316
|
-
repairMode: "local_synthetic",
|
|
69317
|
-
runtimeResult: localRepairEvaluation.runtimeResult ?? input.runtimeResult
|
|
69318
|
-
});
|
|
69319
|
-
emitRunLine({
|
|
69320
|
-
presenter: input.presenter,
|
|
69321
|
-
code: "daemon.run.structured_action_repair_failed",
|
|
69322
|
-
text: `structured OpenMeld Space action repair failed for task ${input.parsedTask.taskId}`,
|
|
69323
|
-
payload: {
|
|
69324
|
-
dispatchId: input.parsedTask.dispatchId,
|
|
69325
|
-
...localFailureDiagnostics,
|
|
69326
|
-
failureReason: input.failureReason,
|
|
69327
|
-
repairedRuntimeStatus: localRepairEvaluation.repairedRuntimeStatus,
|
|
69328
|
-
repairedStructuredActionPresent: localRepairEvaluation.repairedStructuredActionPresent,
|
|
69329
|
-
repairMode: "local_synthetic",
|
|
69330
|
-
targetProfileId: input.parsedTask.targetProfileId,
|
|
69331
|
-
taskId: input.parsedTask.taskId
|
|
69332
|
-
}
|
|
69333
|
-
});
|
|
69334
68808
|
if (!input.runControllerRepair) return {
|
|
69335
|
-
finalFailureDiagnostics:
|
|
68809
|
+
finalFailureDiagnostics: resolveStructuredActionFailureDiagnostics({
|
|
68810
|
+
carrierKind: "none",
|
|
68811
|
+
parseError: input.failureReason,
|
|
68812
|
+
publicFailureReason: input.failureReason,
|
|
68813
|
+
repairMode: "controller_roundtrip",
|
|
68814
|
+
runtimeResult: input.runtimeResult
|
|
68815
|
+
}),
|
|
69336
68816
|
runtimeResult: null
|
|
69337
68817
|
};
|
|
69338
68818
|
let providerRepairRuntimeResult;
|
|
@@ -69388,10 +68868,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
69388
68868
|
presenter: input.presenter,
|
|
69389
68869
|
runtimeResult: providerRepairRuntimeResult
|
|
69390
68870
|
});
|
|
69391
|
-
const providerRepairEvaluation = resolveStructuredActionRepairEvaluation({
|
|
69392
|
-
runtimeResult: providerRepairRuntimeResult,
|
|
69393
|
-
useLocalSyntheticRepair: true
|
|
69394
|
-
});
|
|
68871
|
+
const providerRepairEvaluation = resolveStructuredActionRepairEvaluation({ runtimeResult: providerRepairRuntimeResult });
|
|
69395
68872
|
if (!(providerRepairEvaluation.accepted && providerRepairEvaluation.runtimeResult)) {
|
|
69396
68873
|
const providerFailureDiagnostics = resolveStructuredActionFailureDiagnostics({
|
|
69397
68874
|
carrierKind: providerRepairEvaluation.carrierKind,
|
|
@@ -69441,7 +68918,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
69441
68918
|
};
|
|
69442
68919
|
}
|
|
69443
68920
|
function resolveStructuredActionRepairEvaluation(input) {
|
|
69444
|
-
const runtimeResult = input.
|
|
68921
|
+
const runtimeResult = input.runtimeResult;
|
|
69445
68922
|
const repairedResolution = resolveStructuredSpaceActionFromRuntimePayload(runtimeResult);
|
|
69446
68923
|
const repairedAction = runtimeResult.resultPayload.spaceAction ?? repairedResolution.action;
|
|
69447
68924
|
const repairedRuntimeStatus = runtimeResult.resultPayload.status;
|
|
@@ -69496,15 +68973,11 @@ function resolveStructuredSpaceActionFromRuntimePayload(runtimeResult) {
|
|
|
69496
68973
|
cleanedOutput: void 0,
|
|
69497
68974
|
parseError: null
|
|
69498
68975
|
};
|
|
69499
|
-
const extraction = tryExtractTrailingStructuredSpaceActionBlock({ output: payload.output });
|
|
69500
68976
|
return {
|
|
69501
|
-
action:
|
|
69502
|
-
carrierKind:
|
|
69503
|
-
cleanedOutput:
|
|
69504
|
-
|
|
69505
|
-
cleanedOutput: extraction.cleanedOutput
|
|
69506
|
-
}),
|
|
69507
|
-
parseError: extraction.parseError
|
|
68977
|
+
action: payload.spaceAction,
|
|
68978
|
+
carrierKind: "none",
|
|
68979
|
+
cleanedOutput: void 0,
|
|
68980
|
+
parseError: null
|
|
69508
68981
|
};
|
|
69509
68982
|
}
|
|
69510
68983
|
function applyStructuredSpaceActionResolutionToRuntimePayload(input) {
|
|
@@ -69535,10 +69008,6 @@ function resolveStructuredSpaceActionProvenance(input) {
|
|
|
69535
69008
|
if (!input.resolvedSpaceAction) return;
|
|
69536
69009
|
return input.runtimeResult.resultPayload.spaceActionProvenance ?? "direct";
|
|
69537
69010
|
}
|
|
69538
|
-
function resolvePostMessageInputKind(input) {
|
|
69539
|
-
if (input.runtimeResult.resultPayload.spaceAction?.type === "post_message") return "direct_payload";
|
|
69540
|
-
return input.structuredSpaceActionResolution.carrierKind === "trailing_json" ? "trailing_json" : "fenced_block";
|
|
69541
|
-
}
|
|
69542
69011
|
function runDispatchRuntimeExecution(input) {
|
|
69543
69012
|
return runRuntimeTask({
|
|
69544
69013
|
...input.agentControllerConversationOverride ? { agentContextOverride: {
|
|
@@ -97085,8 +96554,6 @@ const LEAVE_CARD_MIN_CONTENT_WIDTH = 8;
|
|
|
97085
96554
|
const LEAVE_CARD_LEADING_BLANK_LINES = 2;
|
|
97086
96555
|
const MEMBERS_PANEL_REFRESH_DEBOUNCE_MS = 250;
|
|
97087
96556
|
const SPACE_META_REFRESH_DEBOUNCE_MS = 1e3;
|
|
97088
|
-
const SPACE_MEMBER_ADDED_NOTICE_REGEX = / added .+ to this space\./i;
|
|
97089
|
-
const SPACE_MEMBER_REMOVED_NOTICE_REGEX = / removed .+ from this space\./i;
|
|
97090
96557
|
function resolveOptionalReadableLocalSpaceConfig(result, operation) {
|
|
97091
96558
|
if (result.kind === "missing") return null;
|
|
97092
96559
|
if (isLocalSpaceStateCorruptResult(result)) throw toLocalSpaceStateIntegrityError({
|
|
@@ -99481,9 +98948,7 @@ function shouldRefreshMembersSnapshotForEvent(event) {
|
|
|
99481
98948
|
const meta = resolveSignalTextMetaFromEnvelope$1(event);
|
|
99482
98949
|
const purpose = String(meta?.purpose ?? "").trim();
|
|
99483
98950
|
if (purpose === "space_membership_join_notice" || purpose === "space_membership_remove_notice") return true;
|
|
99484
|
-
|
|
99485
|
-
if (!text) return false;
|
|
99486
|
-
return SPACE_MEMBER_ADDED_NOTICE_REGEX.test(text) || SPACE_MEMBER_REMOVED_NOTICE_REGEX.test(text);
|
|
98951
|
+
return false;
|
|
99487
98952
|
}
|
|
99488
98953
|
function shouldRefreshSpaceMetaForEvent(event) {
|
|
99489
98954
|
if (!isSignalEnvelope(event)) return false;
|
|
@@ -106932,4 +106397,4 @@ function isHumanInteractiveSpaceRuntime(runtime) {
|
|
|
106932
106397
|
//#endregion
|
|
106933
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 };
|
|
106934
106399
|
|
|
106935
|
-
//# sourceMappingURL=command-
|
|
106400
|
+
//# sourceMappingURL=command-DEiTGBQ3.js.map
|