init project

This commit is contained in:
root
2026-07-31 13:12:54 -04:00
parent 0da92d5e02
commit f3863f760c
7215 changed files with 1860260 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* Picks which adapter a workflow tool call should act on.
* - If the caller passed an explicit `target`, honor it (error if that side wasn't detected).
* - If only one side was detected, use it regardless of `target`.
* - If both sides were detected and no `target` was given, default to backend
* (matches the common "start the API, then the frontend separately" flow)
* but callers that care about the frontend by default (e.g. dev server) can
* pass `defaultTarget: 'frontend'`.
*/
export function resolveTarget(detected, target, defaultTarget = 'backend') {
if (target === 'backend') {
if (!detected.backend) {
throw new Error('target "backend" was requested, but no backend (Laravel/CodeIgniter/Symfony/Django/Rails) project was detected.');
}
return { adapter: detected.backend, target: 'backend' };
}
if (target === 'frontend') {
if (!detected.frontend) {
throw new Error('target "frontend" was requested, but no frontend (React/Vue/Nuxt) project was detected.');
}
return { adapter: detected.frontend, target: 'frontend' };
}
if (detected.backend && detected.frontend) {
const adapter = defaultTarget === 'frontend' ? detected.frontend : detected.backend;
return { adapter, target: defaultTarget };
}
return { adapter: detected.primary, target: 'primary' };
}
//# sourceMappingURL=resolve.js.map