🌳
pt0/deployF/cliF/buildEpScopesSectionAI.mts
3export const buildEpScopesSection = ({actionNames, actionsH, callingScript}: {
4 actionNames: string[], actionsH: ActionsH, callingScript: string,
5}) => {
6 const scopeCmds: string[] = []
7 for (const actionName of actionNames) {
8 const fnc = actionsH[actionName]
9 if ((fnc?.cliDescript as Record<string, unknown>)?.cliSupportsEpScopes) {
10 scopeCmds.push(actionName)
11 }
12 }
14 if (scopeCmds.length === 0) return null
16 const appNameMatch = callingScript.match(/^([^/]+)\//)
17 const appName = appNameMatch ? appNameMatch[1] : 'app'
18 const examplePath = `${appName}/server/lib/exampleF.mjs`
20 return {scopeCmds, examplePath}