@amodalai/amodal 0.3.49 → 0.3.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,3 +38,21 @@ export function findRepoRoot(startDir?: string): string {
38
38
  'Run `amodal init` to create a new project, or change to a directory containing an amodal.json file.',
39
39
  );
40
40
  }
41
+
42
+ /**
43
+ * Like `findRepoRoot`, but returns `{root, hasManifest}` instead of throwing
44
+ * when no `amodal.json` is found. Used by `amodal dev` so the create flow
45
+ * (Studio + admin agent) can run in an empty directory and scaffold the
46
+ * project. The caller is responsible for skipping anything that needs a
47
+ * loaded agent bundle (e.g. the runtime).
48
+ */
49
+ export function findRepoRootOrCwd(
50
+ startDir?: string,
51
+ ): {root: string; hasManifest: boolean} {
52
+ const cwd = resolve(startDir ?? process.cwd());
53
+ try {
54
+ return {root: findRepoRoot(cwd), hasManifest: true};
55
+ } catch {
56
+ return {root: cwd, hasManifest: false};
57
+ }
58
+ }