import { t as assertMediaNotDataUrl } from "../sandbox-paths-DLLcwa89.js";
import { _ as readReactionParams, b as readStringParam, c as imageResultFromFile, d as parseAvailableTags, g as readPositiveIntegerParam, h as readNumberParam, i as createActionGate, l as jsonResult, m as readNonNegativeIntegerParam, t as ToolAuthorizationError, v as readStringArrayParam, y as readStringOrNumberParam } from "../common-DT_6Jmmb.js";
import { a as optionalPositiveIntegerSchema, i as optionalNonNegativeIntegerSchema, o as optionalStringEnum, r as optionalFiniteNumberSchema, s as stringEnum } from "../typebox-CwOc3iw_.js";
import { r as resolvePollMaxSelections } from "../polls-C-v11_tu.js";
import { o as withNormalizedTimestamp } from "../date-time-BdpeJWA0.js";
import { Type } from "typebox";
//#region src/channels/plugins/actions/shared.ts
function listTokenSourcedAccounts(accounts) {
	return accounts.filter((account) => account.tokenSource !== "none");
}
function createUnionActionGate(accounts, createGate) {
	const gates = accounts.map((account) => createGate(account));
	return (key, defaultValue = true) => gates.some((gate) => gate(key, defaultValue));
}
//#endregion
//#region src/channels/plugins/actions/reaction-message-id.ts
function resolveReactionMessageId(params) {
	return readStringOrNumberParam(params.args, "messageId") ?? params.toolContext?.currentMessageId;
}
//#endregion
//#region src/plugin-sdk/channel-actions.ts
/**
* @deprecated Use semantic `presentation` capabilities instead of exposing
* provider-native button schemas through the shared message tool.
*/
function createMessageToolButtonsSchema() {
	return Type.Optional(Type.Array(Type.Array(Type.Object({
		text: Type.String(),
		callback_data: Type.String(),
		style: Type.Optional(stringEnum([
			"danger",
			"success",
			"primary"
		]))
	})), { description: "Button rows for channels that support button-style actions." }));
}
/**
* @deprecated Use semantic `presentation` capabilities instead of exposing
* provider-native card schemas through the shared message tool.
*/
function createMessageToolCardSchema() {
	return Type.Optional(Type.Object({}, {
		additionalProperties: true,
		description: "Structured card payload for channels that support card-style messages."
	}));
}
//#endregion
export { ToolAuthorizationError, assertMediaNotDataUrl, createActionGate, createMessageToolButtonsSchema, createMessageToolCardSchema, createUnionActionGate, imageResultFromFile, jsonResult, listTokenSourcedAccounts, optionalFiniteNumberSchema, optionalNonNegativeIntegerSchema, optionalPositiveIntegerSchema, optionalStringEnum, parseAvailableTags, readNonNegativeIntegerParam, readNumberParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringOrNumberParam, readStringParam, resolvePollMaxSelections, resolveReactionMessageId, stringEnum, withNormalizedTimestamp };
