import type { ReplyPayload } from "../auto-reply/types.js"; import type { InteractiveReply, InteractiveReplyButton } from "../interactive/payload.js"; import { formatHumanList } from "../shared/human-list.js"; import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
} from "../shared/string-coerce.js"; import { formatApprovalDisplayPath } from "./approval-display-paths.js"; import {
describeNativeExecApprovalClientSetup,
listNativeExecApprovalClientLabels,
supportsNativeExecApprovalClient,
} from "./exec-approval-surface.js"; import {
resolveExecApprovalAllowedDecisions,
type ExecApprovalDecision,
type ExecHost,
} from "./exec-approvals.js";
export type ExecApprovalReplyDecision = ExecApprovalDecision;
export type ExecApprovalUnavailableReason =
| "initiating-platform-disabled"
| "initiating-platform-unsupported"
| "no-approval-route";
function buildGenericNativeExecApprovalFallbackText(params?: { excludeChannel?: string }): string { const clients = resolveNativeExecApprovalClientList({
excludeChannel: params?.excludeChannel,
}); return clients
? `Approve it from the Web UI or terminal UI, or enable a native chat approval client such as ${clients}. If those accounts already know your owner ID via allowFrom or owner config, OpenClaw can often infer approvers automatically.`
: "Approve it from the Web UI or terminal UI.";
}
if (params.sentApproverDms) {
lines.push(getExecApprovalApproverDmNoticeText()); return {
text: lines.join("\n\n"),
};
}
if (params.reason === "initiating-platform-disabled") {
lines.push(
`Exec approval is required, but native chat exec approvals are not configured on ${params.channelLabel ?? "this platform"}.`,
); const channel = normalizeOptionalLowercaseString(params.channel); const setupText =
channel && params.channelLabel && supportsNativeExecApprovalClient(channel)
? describeNativeExecApprovalClientSetup({
channel,
channelLabel: params.channelLabel,
accountId: params.accountId,
})
: null; if (setupText) {
lines.push(setupText);
} else {
lines.push(buildGenericNativeExecApprovalFallbackText());
}
} elseif (params.reason === "initiating-platform-unsupported") {
lines.push(
`Exec approval is required, but ${params.channelLabel ?? "this platform"} does not support chat exec approvals.`,
);
lines.push(
buildGenericNativeExecApprovalFallbackText({
excludeChannel: params.channel,
}),
);
} else {
lines.push( "Exec approval is required, but no interactive approval client is currently available.",
);
lines.push(
`${buildGenericNativeExecApprovalFallbackText()} Then retry the command. You can usually leave execApprovals.approvers unset when owner config already identifies the approvers.`,
);
}
return {
text: lines.join("\n\n"),
};
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.