/** Object parameters for a tool bound to a current process project. @public */ export function projectParameters( properties: Record = {}, required: readonly string[] = Object.keys(properties), ): Record { return { type: "object", properties: { projectKey: { type: "string", description: "Current process project key" }, ...properties, }, required: ["projectKey", ...required], }; } /** @public */ export function objectArg( value: unknown, message = "Tool arguments must be an object", ): Record { if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(message); return value as Record; } /** Read required integration-tool arguments at the runtime boundary. @public */ export function stringArg(args: Record, name: string): string { const value = args[name]; if (typeof value !== "string" || !value.trim()) throw new Error(`'${name}' must be a non-empty string`); return value.trim(); } /** @public */ export function numberArg(args: Record, name: string): number { const value = args[name]; if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) throw new Error(`'${name}' must be a positive integer`); return value; }