@animaapp/anima-sdk 0.24.0 → 0.26.0

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.
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare class Anima {
15
15
  protected get headers(): Record<string, string>;
16
16
  generateCode(params: GetCodeParams, handler?: GetCodeHandler, signal?: AbortSignal): Promise<AnimaSDKResult>;
17
17
  generateCodeFromWebsite(params: GetCodeFromWebsiteParams, handler?: GetCodeFromWebsiteHandler, signal?: AbortSignal): Promise<AnimaSDKResult>;
18
+ discoverSubpages(params: DiscoverSubpagesParams, signal?: AbortSignal): Promise<DiscoverSubpagesResult>;
18
19
  /**
19
20
  * Generates code from a text prompt using AI.
20
21
  *
@@ -125,7 +126,7 @@ export declare class CodegenError extends Error {
125
126
  detail?: unknown;
126
127
  constructor({ name, reason, status, detail, }: {
127
128
  name: string;
128
- reason: CommonApiError | GetCodeFromFigmaErrorReason | CodegenRouteErrorReason | SDKErrorReason | GetCodeFromWebsiteErrorReason | GetCodeFromPromptErrorReason;
129
+ reason: CommonApiError | GetCodeFromFigmaErrorReason | CodegenRouteErrorReason | SDKErrorReason | GetCodeFromWebsiteErrorReason | DiscoverSubpagesErrorReason | GetCodeFromPromptErrorReason;
129
130
  status?: number;
130
131
  detail?: unknown;
131
132
  });
@@ -280,6 +281,19 @@ export declare const createLink2CodeResponseEventStream: (anima: Anima, params:
280
281
  */
281
282
  export declare const createLink2CodeStream: (anima: Anima, params: GetLink2CodeParams) => ReadableStream<StreamL2CMessage>;
282
283
 
284
+ /**
285
+ * Errors from website subpage discovery.
286
+ */
287
+ export declare type DiscoverSubpagesErrorReason = "Subpage discovery requires a paid plan" | "Website subpage discovery timed out after 10 seconds" | "Failed to discover website subpages";
288
+
289
+ export declare type DiscoverSubpagesParams = {
290
+ url: string;
291
+ };
292
+
293
+ export declare type DiscoverSubpagesResult = {
294
+ subpages: WebsiteSubpage[];
295
+ };
296
+
283
297
  export declare class ExpiredFigmaToken extends Error {
284
298
  constructor();
285
299
  }
@@ -390,6 +404,23 @@ export declare type GetCodeFromPromptSettings = BaseSettings & {
390
404
  uiLibrary?: "shadcn" | "custom_design_system";
391
405
  dsId?: string;
392
406
  fastMode?: boolean;
407
+ /**
408
+ * Hard override for the p2c routing classifier.
409
+ *
410
+ * - `true` — Skip the LLM-driven classifier entirely and run the
411
+ * image-to-code sub-agent directly. **Bypasses the multi-screen
412
+ * safety check** — the caller is responsible for ensuring the
413
+ * attached image is a single screen, not a multi-screen prototype /
414
+ * moodboard. Saves ~1s + a vision LLM call per request.
415
+ * - `false` — Skip the classifier and force creative mode.
416
+ * - unset — The agent decides automatically: a vision LLM call
417
+ * classifies the intent and downgrades multi-screen inputs to
418
+ * creative mode as a safety net.
419
+ *
420
+ * Requires at least one attached image. With no image attached this
421
+ * field has no effect.
422
+ */
423
+ imageMode?: boolean;
393
424
  };
394
425
 
395
426
  /**
@@ -440,6 +471,7 @@ export declare type GetCodeFromWebsiteParams = {
440
471
  }>;
441
472
  dsId?: string;
442
473
  htmlOptimizations?: GetCodeFromWebsiteHTMLOptimizations;
474
+ subpages?: WebsiteSubpage[];
443
475
  experimental_useNewReactEngine?: boolean;
444
476
  };
445
477
 
@@ -860,4 +892,8 @@ declare type ValidateNodeForCodegenResult = {
860
892
 
861
893
  export declare const validateSettings: (obj: unknown) => CodegenSettings;
862
894
 
895
+ export declare type WebsiteSubpage = {
896
+ url: string;
897
+ };
898
+
863
899
  export { }