@fluid-app/fluid-cli-portal 0.1.52 → 0.1.54

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.
Files changed (35) hide show
  1. package/README.md +3 -0
  2. package/dist/{backend-dev-plugin-B9-S4Is-.mjs → backend-dev-plugin-CY3yxgJ1.mjs} +1 -1
  3. package/dist/{backend-dev-plugin-B9-S4Is-.mjs.map → backend-dev-plugin-CY3yxgJ1.mjs.map} +1 -1
  4. package/dist/build-manifest.d.mts +91 -0
  5. package/dist/build-manifest.d.mts.map +1 -0
  6. package/dist/build-manifest.mjs +180 -0
  7. package/dist/build-manifest.mjs.map +1 -0
  8. package/dist/index.d.mts +657 -741
  9. package/dist/index.d.mts.map +1 -1
  10. package/dist/index.mjs +1627 -1829
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/portal-dev-plugin-CHlxpXc5.mjs +232 -0
  13. package/dist/portal-dev-plugin-CHlxpXc5.mjs.map +1 -0
  14. package/dist/portal-widget-dev-plugin-B53Lf9Ke.mjs +144 -0
  15. package/dist/portal-widget-dev-plugin-B53Lf9Ke.mjs.map +1 -0
  16. package/dist/pull-CUR8tbW9.mjs +1633 -0
  17. package/dist/pull-CUR8tbW9.mjs.map +1 -0
  18. package/dist/sdk.gen-DuPhfdxN.mjs +469 -0
  19. package/dist/sdk.gen-DuPhfdxN.mjs.map +1 -0
  20. package/dist/src-CpH5SpDH.mjs +2157 -0
  21. package/dist/src-CpH5SpDH.mjs.map +1 -0
  22. package/dist/vite-plugin.d.mts +15 -56
  23. package/dist/vite-plugin.d.mts.map +1 -1
  24. package/dist/vite-plugin.mjs +6 -3
  25. package/package.json +12 -3
  26. package/templates/base/.gitignore.template +6 -0
  27. package/templates/base/.oxlintrc.json +1 -2
  28. package/templates/base/AGENTS.md +4 -0
  29. package/templates/base/skills/fluid-portal-authoring/SKILL.md +238 -10
  30. package/templates/starter/.env.example +4 -3
  31. package/templates/starter/README.md.template +14 -1
  32. package/dist/portal-dev-plugin-BHE8Z4yr.mjs +0 -289
  33. package/dist/portal-dev-plugin-BHE8Z4yr.mjs.map +0 -1
  34. package/dist/pull-XOsFaqz2.mjs +0 -1204
  35. package/dist/pull-XOsFaqz2.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Command } from "commander";
2
- import { CliError, FetchClient, FluidPlugin, Result } from "@fluid-app/fluid-cli";
2
+ import { CliError, FluidPlugin, Result } from "@fluid-app/fluid-cli";
3
+ import { Plugin } from "vite";
3
4
 
4
5
  //#region src/types.d.ts
5
6
  /**
@@ -339,6 +340,35 @@ interface GitAutoCommitOptions {
339
340
  * `node_modules/`, `dist/`, `.portal-sync/`, logs, `*.tsbuildinfo`), so
340
341
  * generated output and local secrets stay out of the commit.
341
342
  *
343
+ * That boundary is not enough on its own for tool-local state written
344
+ * INTO the project directory by whatever opened it — most importantly
345
+ * Mist Desktop's `.mist-desktop/` (private chats, attachments,
346
+ * screenshots) and the `.mist` clone marker. A `.gitignore`-only fix
347
+ * can't reach clones that already exist, so this applies belt AND
348
+ * suspenders, all anchored to the repository root (see
349
+ * {@link resolveRepoRoot}):
350
+ *
351
+ * 1. {@link excludeLocalStateFromGit} — idempotent `.git/info/exclude`
352
+ * write, so `git add` never picks the paths up in the first place.
353
+ * Heals pre-existing clones on their next push.
354
+ * 2. `git reset -- ':(top).mist' .mist` after staging — unstages the
355
+ * marker if step 1 silently failed. We deliberately do NOT pass a
356
+ * `:(exclude)` pathspec to `git add`: when the path is *also*
357
+ * listed in `.git/info/exclude`, git exits 1 with "paths are
358
+ * ignored by one of your .gitignore files", turning the normal
359
+ * (already-healed) case into a hard failure. Add-then-reset is a
360
+ * no-op when there's nothing staged.
361
+ * 3. `git rm --cached -r --ignore-unmatch .mist-desktop` — untracks
362
+ * chat history that an older, unhardened push already committed.
363
+ * Ignore rules alone cannot untrack an existing path. `--cached`
364
+ * keeps every file on disk; only the index entry goes away. This
365
+ * runs even under `ignoreRemovals`, where suppressing deletions
366
+ * protects remote-only *portal* files — private chats are never
367
+ * that, and leaving them tracked would keep republishing them.
368
+ *
369
+ * Steps 2 and 3 are best-effort and never fail the publish; the commit
370
+ * itself is what must succeed.
371
+ *
342
372
  * Uses the repo's configured identity, else a synthetic Fluid bot
343
373
  * identity so the commit isn't rejected. "nothing to commit" is treated
344
374
  * as a no-op, not an error.
@@ -352,35 +382,28 @@ declare function gitAutoCommit(cwd: string, message: string, options?: GitAutoCo
352
382
  declare function gitPush(cwd: string, remoteUrl: string, branch?: string): Promise<void>;
353
383
  //#endregion
354
384
  //#region src/api/git-credential.d.ts
355
- /**
356
- * Portal git-credential adapter (the "invisible git" seam).
357
- *
358
- * Mints a short-lived (~1h) remote URL with an embedded installation
359
- * token for the portal's provisioned GitHub repo. The URL is used
360
- * immediately for one git op and discarded — NEVER persisted or logged.
361
- *
362
- * The backend endpoint (GitSync phase 006, portal adapter) mirrors the
363
- * widget contract exactly:
364
- *
365
- * POST <endpoint> -> 201 { git_credential: { remote_url, expires_at }, status, meta }
366
- * errors: 409 not_provisioned/not_connected, 502 vendor_error, 422 else
367
- * { error: { message, details: { type } }, status, meta }
368
- *
369
- * The exact path is still being finalized as 006 lands, so it lives in
370
- * one constant here. Until the endpoint ships to prod a request 404s —
371
- * which we surface as `unavailable` so callers degrade gracefully
372
- * (warn + skip the git sync, proceed with the normal content push).
373
- */
374
- /** Minted credential — token embedded in `remote_url`. Treat as secret. */
375
385
  interface PortalGitCredential {
376
386
  readonly remote_url: string;
377
387
  readonly expires_at: string;
378
388
  }
379
389
  /**
380
390
  * Outcome of a credential request. `unavailable` means "no repo to sync"
381
- * (endpoint missing / not provisioned / not connected) — the caller
382
- * should warn and skip, never abort. `error` is an unexpected transport
383
- * failure the caller may log but still shouldn't hard-fail push on.
391
+ * (endpoint missing / not provisioned / not connected). Its `retryable`
392
+ * flag distinguishes backend states that resolve on their own from ones
393
+ * that never will.
394
+ *
395
+ * Both `not_provisioned` and `not_connected` are retryable. The first
396
+ * self-heals because the credential request itself triggers provisioning;
397
+ * the second is the state a brand-new definition sits in for its first
398
+ * few seconds, while the Sidekiq job that creates the GitHub repo runs.
399
+ * (An earlier revision read `not_connected` as a durable "this company's
400
+ * Git integration isn't connected" — that was a misdiagnosis, and it made
401
+ * every newly created portal give up before its repo was ready.)
402
+ *
403
+ * `repoStatus` carries the underlying GitSync repo status when the API
404
+ * reports one; `disconnected` is the one value a retry can never fix.
405
+ * `conflictType` carries the raw 409 conflict type so callers can tailor
406
+ * messaging. `error` is an unexpected transport or provider failure.
384
407
  */
385
408
  type GitCredentialOutcome = {
386
409
  readonly status: "ok";
@@ -388,6 +411,9 @@ type GitCredentialOutcome = {
388
411
  } | {
389
412
  readonly status: "unavailable";
390
413
  readonly reason: string;
414
+ readonly retryable: boolean;
415
+ readonly conflictType?: string;
416
+ readonly repoStatus?: string;
391
417
  } | {
392
418
  readonly status: "error";
393
419
  readonly reason: string;
@@ -406,6 +432,8 @@ interface CreatePortalGitCredentialOptions {
406
432
  readonly definitionId: number;
407
433
  /** Injectable for tests; defaults to global fetch. */
408
434
  readonly fetchImpl?: typeof fetch;
435
+ /** Deadline for one API request; defaults to 15 seconds. */
436
+ readonly requestTimeoutMs?: number;
409
437
  }
410
438
  /**
411
439
  * Request a git credential for the portal definition's provisioned repo.
@@ -458,23 +486,406 @@ declare function createPortalProject(appName: string, options: CreateOptions, co
458
486
  //#region src/commands/pull.d.ts
459
487
  declare const pullCommand: Command;
460
488
  //#endregion
461
- //#region src/commands/push.d.ts
462
- declare const pushCommand: Command;
489
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/auth.gen.d.ts
490
+ type AuthToken = string | undefined;
491
+ interface Auth {
492
+ /**
493
+ * Which part of the request do we use to send the auth?
494
+ *
495
+ * @default 'header'
496
+ */
497
+ in?: "header" | "query" | "cookie";
498
+ /**
499
+ * A unique identifier for the security scheme.
500
+ *
501
+ * Defined only when there are multiple security schemes whose `Auth`
502
+ * shape would otherwise be identical.
503
+ */
504
+ key?: string;
505
+ /**
506
+ * Header or query parameter name.
507
+ *
508
+ * @default 'Authorization'
509
+ */
510
+ name?: string;
511
+ scheme?: "basic" | "bearer";
512
+ type: "apiKey" | "http";
513
+ }
463
514
  //#endregion
464
- //#region src/commands/widget-create.d.ts
465
- declare const widgetCommand: Command;
515
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/pathSerializer.gen.d.ts
516
+ interface SerializerOptions<T> {
517
+ /**
518
+ * @default true
519
+ */
520
+ explode: boolean;
521
+ style: T;
522
+ }
523
+ type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
524
+ type ObjectStyle = "form" | "deepObject";
466
525
  //#endregion
467
- //#region src/commands/widget-publish.d.ts
468
- declare const topLevelWidgetCommand: Command;
526
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/bodySerializer.gen.d.ts
527
+ type QuerySerializer = (query: Record<string, unknown>) => string;
528
+ type BodySerializer = (body: unknown) => unknown;
529
+ type QuerySerializerOptionsObject = {
530
+ allowReserved?: boolean;
531
+ array?: Partial<SerializerOptions<ArrayStyle>>;
532
+ object?: Partial<SerializerOptions<ObjectStyle>>;
533
+ };
534
+ type QuerySerializerOptions = QuerySerializerOptionsObject & {
535
+ /**
536
+ * Per-parameter serialization overrides. When provided, these settings
537
+ * override the global array/object settings for specific parameter names.
538
+ */
539
+ parameters?: Record<string, QuerySerializerOptionsObject>;
540
+ };
469
541
  //#endregion
470
- //#region src/commands/deploy.d.ts
471
- declare const deployCommand: Command;
542
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/types.gen.d.ts
543
+ type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
544
+ type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
545
+ /**
546
+ * Returns the final request URL.
547
+ */
548
+ buildUrl: BuildUrlFn;
549
+ getConfig: () => Config;
550
+ request: RequestFn;
551
+ setConfig: (config: Config) => Config;
552
+ } & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
553
+ sse?: never;
554
+ } : {
555
+ sse: { [K in HttpMethod]: SseFn };
556
+ });
557
+ interface Config$1 {
558
+ /**
559
+ * Auth token or a function returning auth token. The resolved value will be
560
+ * added to the request payload as defined by its `security` array.
561
+ */
562
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
563
+ /**
564
+ * A function for serializing request body parameter. By default,
565
+ * {@link JSON.stringify()} will be used.
566
+ */
567
+ bodySerializer?: BodySerializer | null;
568
+ /**
569
+ * An object containing any HTTP headers that you want to pre-populate your
570
+ * `Headers` object with.
571
+ *
572
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
573
+ */
574
+ headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
575
+ /**
576
+ * The request method.
577
+ *
578
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
579
+ */
580
+ method?: Uppercase<HttpMethod>;
581
+ /**
582
+ * A function for serializing request query parameters. By default, arrays
583
+ * will be exploded in form style, objects will be exploded in deepObject
584
+ * style, and reserved characters are percent-encoded.
585
+ *
586
+ * This method will have no effect if the native `paramsSerializer()` Axios
587
+ * API function is used.
588
+ *
589
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
590
+ */
591
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
592
+ /**
593
+ * A function validating request data. This is useful if you want to ensure
594
+ * the request conforms to the desired shape, so it can be safely sent to
595
+ * the server.
596
+ */
597
+ requestValidator?: (data: unknown) => Promise<unknown>;
598
+ /**
599
+ * A function transforming response data before it's returned. This is useful
600
+ * for post-processing data, e.g., converting ISO strings into Date objects.
601
+ */
602
+ responseTransformer?: (data: unknown) => Promise<unknown>;
603
+ /**
604
+ * A function validating response data. This is useful if you want to ensure
605
+ * the response conforms to the desired shape, so it can be safely passed to
606
+ * the transformers and returned to the user.
607
+ */
608
+ responseValidator?: (data: unknown) => Promise<unknown>;
609
+ }
472
610
  //#endregion
473
- //#region src/commands/version.d.ts
474
- declare const versionCommand: Command;
611
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/serverSentEvents.gen.d.ts
612
+ type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> & Pick<Config$1, "method" | "responseTransformer" | "responseValidator"> & {
613
+ /**
614
+ * Fetch API implementation. You can use this option to provide a custom
615
+ * fetch instance.
616
+ *
617
+ * @default globalThis.fetch
618
+ */
619
+ fetch?: typeof fetch;
620
+ /**
621
+ * Implementing clients can call request interceptors inside this hook.
622
+ */
623
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
624
+ /**
625
+ * Callback invoked when a network or parsing error occurs during streaming.
626
+ *
627
+ * This option applies only if the endpoint returns a stream of events.
628
+ *
629
+ * @param error The error that occurred.
630
+ */
631
+ onSseError?: (error: unknown) => void;
632
+ /**
633
+ * Callback invoked when an event is streamed from the server.
634
+ *
635
+ * This option applies only if the endpoint returns a stream of events.
636
+ *
637
+ * @param event Event streamed from the server.
638
+ * @returns Nothing (void).
639
+ */
640
+ onSseEvent?: (event: StreamEvent<TData>) => void;
641
+ serializedBody?: RequestInit["body"];
642
+ /**
643
+ * Default retry delay in milliseconds.
644
+ *
645
+ * This option applies only if the endpoint returns a stream of events.
646
+ *
647
+ * @default 3000
648
+ */
649
+ sseDefaultRetryDelay?: number;
650
+ /**
651
+ * Maximum number of retry attempts before giving up.
652
+ */
653
+ sseMaxRetryAttempts?: number;
654
+ /**
655
+ * Maximum retry delay in milliseconds.
656
+ *
657
+ * Applies only when exponential backoff is used.
658
+ *
659
+ * This option applies only if the endpoint returns a stream of events.
660
+ *
661
+ * @default 30000
662
+ */
663
+ sseMaxRetryDelay?: number;
664
+ /**
665
+ * Optional sleep function for retry backoff.
666
+ *
667
+ * Defaults to using `setTimeout`.
668
+ */
669
+ sseSleepFn?: (ms: number) => Promise<void>;
670
+ url: string;
671
+ };
672
+ interface StreamEvent<TData = unknown> {
673
+ data: TData;
674
+ event?: string;
675
+ id?: string;
676
+ retry?: number;
677
+ }
678
+ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
679
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
680
+ };
475
681
  //#endregion
476
- //#region src/commands/doctor.d.ts
477
- declare const doctorCommand: Command;
682
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/client/utils.gen.d.ts
683
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res | undefined, request: Req | undefined, options: Options) => Err | Promise<Err>;
684
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
685
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
686
+ declare class Interceptors<Interceptor> {
687
+ fns: Array<Interceptor | null>;
688
+ clear(): void;
689
+ eject(id: number | Interceptor): void;
690
+ exists(id: number | Interceptor): boolean;
691
+ getInterceptorIndex(id: number | Interceptor): number;
692
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
693
+ use(fn: Interceptor): number;
694
+ }
695
+ interface Middleware<Req, Res, Err, Options> {
696
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
697
+ request: Interceptors<ReqInterceptor<Req, Options>>;
698
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
699
+ }
700
+ //#endregion
701
+ //#region ../../api-clients/hey-api-fetch-runtime/src/generated/client/types.gen.d.ts
702
+ type ResponseStyle = "data" | "fields";
703
+ interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, Config$1 {
704
+ /**
705
+ * Base URL for all requests made by this client.
706
+ */
707
+ baseUrl?: T["baseUrl"];
708
+ /**
709
+ * Fetch API implementation. You can use this option to provide a custom
710
+ * fetch instance.
711
+ *
712
+ * @default globalThis.fetch
713
+ */
714
+ fetch?: typeof fetch;
715
+ /**
716
+ * Please don't use the Fetch client for Next.js applications. The `next`
717
+ * options won't have any effect.
718
+ *
719
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
720
+ */
721
+ next?: never;
722
+ /**
723
+ * Return the response data parsed in a specified format. By default, `auto`
724
+ * will infer the appropriate method from the `Content-Type` response header.
725
+ * You can override this behavior with any of the {@link Body} methods.
726
+ * Select `stream` if you don't want to parse response data at all.
727
+ *
728
+ * @default 'auto'
729
+ */
730
+ parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
731
+ /**
732
+ * Should we return only data or multiple fields (data, error, response, etc.)?
733
+ *
734
+ * @default 'fields'
735
+ */
736
+ responseStyle?: ResponseStyle;
737
+ /**
738
+ * Throw an error instead of returning it in the response?
739
+ *
740
+ * @default false
741
+ */
742
+ throwOnError?: T["throwOnError"];
743
+ }
744
+ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
745
+ responseStyle: TResponseStyle;
746
+ throwOnError: ThrowOnError;
747
+ }>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
748
+ /**
749
+ * Any body that you want to add to your request.
750
+ *
751
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
752
+ */
753
+ body?: unknown;
754
+ path?: Record<string, unknown>;
755
+ query?: Record<string, unknown>;
756
+ /**
757
+ * Security mechanism(s) to use for the request.
758
+ */
759
+ security?: ReadonlyArray<Auth>;
760
+ url: Url;
761
+ }
762
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
763
+ headers: Headers;
764
+ serializedBody?: string;
765
+ }
766
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
767
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
768
+ request: Request;
769
+ response: Response;
770
+ }> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
771
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
772
+ error: undefined;
773
+ } | {
774
+ data: undefined;
775
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
776
+ }) & {
777
+ /** request may be undefined, because error may be from building the request object itself */request?: Request; /** response may be undefined, because error may be from building the request object itself or from a network error */
778
+ response?: Response;
779
+ }>;
780
+ interface ClientOptions {
781
+ baseUrl?: string;
782
+ responseStyle?: ResponseStyle;
783
+ throwOnError?: boolean;
784
+ }
785
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
786
+ type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData>>;
787
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
788
+ type BuildUrlFn = <TData extends {
789
+ body?: unknown;
790
+ path?: Record<string, unknown>;
791
+ query?: Record<string, unknown>;
792
+ url: string;
793
+ }>(options: TData & Options<TData>) => string;
794
+ type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
795
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
796
+ };
797
+ interface TDataShape {
798
+ body?: unknown;
799
+ headers?: unknown;
800
+ path?: unknown;
801
+ query?: unknown;
802
+ url: string;
803
+ }
804
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
805
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([TData] extends [never] ? unknown : Omit<TData, "url">);
806
+ //#endregion
807
+ //#region ../../api-clients/fluidos/src/hey-api-client.d.ts
808
+ type FluidOsHeyApiClient = Client;
809
+ //#endregion
810
+ //#region ../../api-clients/fluidos/src/hey-api/types.gen.d.ts
811
+ /**
812
+ * Any valid JSON value for provider, integration, theme, metadata, or other dynamic payloads whose keys are not fixed by the API contract.
813
+ */
814
+ type JsonValue = string | number | boolean | null | Array<JsonValue> | {
815
+ [key: string]: JsonValue;
816
+ };
817
+ /**
818
+ * FluidOS::NavigationItem
819
+ */
820
+ type FluidOsNavigationItem = {
821
+ id: number;
822
+ icon?: string | null;
823
+ label?: string | null;
824
+ parent_id?: number | null;
825
+ position?: number | null;
826
+ screen_id?: number | null;
827
+ slug?: string | null;
828
+ source?: "user" | "system" | "code";
829
+ children?: Array<FluidOsNavigationItem>;
830
+ };
831
+ /**
832
+ * FluidOS::Screen
833
+ */
834
+ type FluidOsScreen = {
835
+ id: number;
836
+ name?: string | null;
837
+ slug?: string | null;
838
+ definition_id: number;
839
+ component_tree?: FluidOsDynamicPayload;
840
+ };
841
+ /**
842
+ * FluidOS::Theme
843
+ */
844
+ type FluidOsTheme = {
845
+ id: number;
846
+ config?: FluidOsDynamicPayload;
847
+ active?: boolean | null;
848
+ name?: string | null;
849
+ definition_id: number;
850
+ };
851
+ /**
852
+ * FluidOS::Navigation
853
+ */
854
+ type FluidOsNavigationBasic = {
855
+ id: number;
856
+ name?: string | null;
857
+ definition_id: number;
858
+ platform: "web" | "mobile";
859
+ };
860
+ /**
861
+ * FluidOS::Navigation
862
+ */
863
+ type FluidOsNavigationWithItems = {
864
+ id: number;
865
+ name?: string | null;
866
+ definition_id: number;
867
+ platform: "web" | "mobile";
868
+ navigation_items?: Array<FluidOsNavigationItem>;
869
+ };
870
+ /**
871
+ * FluidOS::Profile
872
+ */
873
+ type FluidOsProfile = {
874
+ id: number;
875
+ name?: string | null;
876
+ default?: boolean | null;
877
+ permissions?: FluidOsDynamicPayload;
878
+ definition_id: number;
879
+ navigation?: FluidOsNavigationWithItems | null;
880
+ mobile_navigation?: FluidOsNavigationWithItems;
881
+ themes?: Array<FluidOsTheme>;
882
+ };
883
+ /**
884
+ * Dynamic Fluid OS JSON payload whose keys are defined by the app builder configuration.
885
+ */
886
+ type FluidOsDynamicPayload = {
887
+ [key: string]: JsonValue;
888
+ } | null;
478
889
  //#endregion
479
890
  //#region src/utils/mappings.d.ts
480
891
  /** Definition metadata stored at the top level of the mappings file. */
@@ -595,480 +1006,6 @@ declare function diffAgainstSnapshot(portalDir: string, snapshot: Snapshot): Pro
595
1006
  */
596
1007
  declare function buildSnapshot(portalDir: string, definitionName: string, definitionId: number): Promise<Snapshot>;
597
1008
  //#endregion
598
- //#region ../../api-clients/fluidos/src/generated/fluid-os-v0.d.ts
599
- interface components {
600
- schemas: {
601
- Meta: {
602
- request_id?: string; /** Format: date-time */
603
- timestamp?: string;
604
- };
605
- PaginatedMeta: {
606
- current_page: number;
607
- request_id: string; /** Format: date-time */
608
- timestamp: string;
609
- total_count: number;
610
- total_pages: number;
611
- };
612
- ErrorResponse: {
613
- error_message: string;
614
- errors: components["schemas"]["ErrorBag"];
615
- meta: components["schemas"]["Meta"];
616
- };
617
- UnauthorizedResponse: {
618
- message: string;
619
- }; /** @description Any valid JSON value for provider, integration, theme, metadata, or other dynamic payloads whose keys are not fixed by the API contract. */
620
- JsonValue: string | number | boolean | null | components["schemas"]["JsonValue"][] | {
621
- [key: string]: components["schemas"]["JsonValue"];
622
- }; /** @description A validation or API error value. */
623
- ErrorValue: string | string[] | components["schemas"]["JsonValue"]; /** @description Validation errors keyed by field, a list of errors, a single error message, or null when no structured error details are available. */
624
- ErrorBag: string | components["schemas"]["ErrorValue"][] | {
625
- [key: string]: components["schemas"]["ErrorValue"];
626
- } | null; /** @description An API error message represented as text or structured JSON. */
627
- ErrorMessage: string | components["schemas"]["ErrorBag"] | null; /** @description Common legacy error response envelope. Older endpoints may return one or more of these fields depending on the controller path. */
628
- StandardErrorResponse: {
629
- message?: string;
630
- error?: components["schemas"]["ErrorMessage"];
631
- error_message?: components["schemas"]["ErrorMessage"];
632
- errors?: components["schemas"]["ErrorBag"];
633
- meta?: components["schemas"]["Meta"];
634
- } & {
635
- [key: string]: components["schemas"]["JsonValue"];
636
- }; /** @description Common legacy unauthorized response envelope. */
637
- StandardUnauthorizedResponse: components["schemas"]["StandardErrorResponse"];
638
- FluidOSDefinitionListResponse: {
639
- definitions: components["schemas"]["FluidOSDefinitionBasic"][];
640
- meta: components["schemas"]["PaginatedMeta"];
641
- };
642
- FluidOSDefinitionRequest: {
643
- definition?: {
644
- name: string;
645
- active?: boolean;
646
- } | null;
647
- };
648
- FluidOSDefinitionUpdateRequest: {
649
- definition?: {
650
- name?: string;
651
- active?: boolean;
652
- } | null;
653
- };
654
- FluidOSNavigationItemCreateRequest: {
655
- navigation_item?: {
656
- icon?: string;
657
- label: string;
658
- position: number;
659
- parent_id?: number | null;
660
- screen_id?: number | null;
661
- slug?: string | null;
662
- source?: "user" | "system" | "code" | null;
663
- } | null;
664
- };
665
- FluidOSNavigationCreateRequest: {
666
- navigation?: {
667
- name: string;
668
- platform: string;
669
- } | null;
670
- };
671
- FluidOSProfileCreateRequest: {
672
- profile?: {
673
- name: string;
674
- default?: boolean;
675
- navigation_id?: number;
676
- mobile_navigation_id?: number;
677
- navigation_attributes?: {
678
- name: string;
679
- navigation_items_attributes?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>>[];
680
- };
681
- mobile_navigation_attributes?: {
682
- name: string;
683
- navigation_items_attributes?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>>[];
684
- };
685
- theme_ids?: number[];
686
- permissions?: components["schemas"]["FluidOSDynamicPayload"];
687
- } | null;
688
- };
689
- FluidOSScreenCreateRequest: {
690
- screen?: {
691
- name: string;
692
- slug: string;
693
- component_tree?: components["schemas"]["FluidOSDynamicPayload"] | null;
694
- } | null;
695
- };
696
- FluidOSThemeCreateRequest: {
697
- theme?: {
698
- config: components["schemas"]["FluidOSDynamicPayload"];
699
- name: string;
700
- active?: boolean;
701
- } | null;
702
- };
703
- FluidOSNavigationItemUpdateRequest: {
704
- navigation_item?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>> | null;
705
- };
706
- FluidOSNavigationUpdateRequest: {
707
- navigation?: {
708
- name?: string;
709
- platform?: "web" | "mobile";
710
- } | null;
711
- };
712
- FluidOSProfileUpdateRequest: {
713
- profile?: {
714
- name?: string;
715
- default?: boolean;
716
- navigation_id?: number;
717
- mobile_navigation_id?: number;
718
- theme_ids?: number[];
719
- permissions?: components["schemas"]["FluidOSDynamicPayload"];
720
- } | null;
721
- };
722
- FluidOSScreenUpdateRequest: {
723
- screen?: {
724
- name?: string;
725
- slug?: string;
726
- component_tree?: components["schemas"]["FluidOSDynamicPayload"] | null;
727
- } | null;
728
- };
729
- FluidOSThemeUpdateRequest: {
730
- theme?: {
731
- name?: string;
732
- active?: boolean;
733
- config?: components["schemas"]["FluidOSDynamicPayload"];
734
- } | null;
735
- };
736
- FluidOSVersionUpdateRequest: {
737
- version?: {
738
- active?: boolean;
739
- } | null;
740
- }; /** FluidOS::NavigationItem */
741
- FluidOSNavigationItem: {
742
- id: number;
743
- icon?: string | null;
744
- label?: string | null;
745
- parent_id?: number | null;
746
- position?: number | null;
747
- screen_id?: number | null;
748
- slug?: string | null; /** @enum {string} */
749
- source?: "user" | "system" | "code";
750
- children?: components["schemas"]["FluidOSNavigationItem"][];
751
- }; /** FluidOS::Screen */
752
- FluidOSScreenBasic: {
753
- id: number;
754
- name?: string | null;
755
- slug?: string | null;
756
- definition_id: number;
757
- }; /** FluidOS::Screen */
758
- FluidOSScreen: {
759
- id: number;
760
- name?: string | null;
761
- slug?: string | null;
762
- definition_id: number;
763
- component_tree?: components["schemas"]["FluidOSDynamicPayload"];
764
- }; /** FluidOS::Theme */
765
- FluidOSTheme: {
766
- id: number;
767
- config?: components["schemas"]["FluidOSDynamicPayload"];
768
- active?: boolean | null;
769
- name?: string | null;
770
- definition_id: number;
771
- }; /** FluidOS::Navigation */
772
- FluidOSNavigationBasic: {
773
- id: number;
774
- name?: string | null;
775
- definition_id: number; /** @enum {string} */
776
- platform: "web" | "mobile";
777
- }; /** FluidOS::Navigation */
778
- FluidOSNavigation: {
779
- id: number;
780
- name?: string | null;
781
- definition_id: number; /** @enum {string} */
782
- platform: "web" | "mobile";
783
- screens?: components["schemas"]["FluidOSScreen"][];
784
- }; /** FluidOS::Navigation */
785
- FluidOSNavigationWithItems: {
786
- id: number;
787
- name?: string | null;
788
- definition_id: number; /** @enum {string} */
789
- platform: "web" | "mobile";
790
- navigation_items?: components["schemas"]["FluidOSNavigationItem"][];
791
- }; /** FluidOS::Profile */
792
- FluidOSProfile: {
793
- id: number;
794
- name?: string | null;
795
- default?: boolean | null;
796
- permissions?: components["schemas"]["FluidOSDynamicPayload"];
797
- definition_id: number;
798
- navigation?: components["schemas"]["FluidOSNavigationWithItems"] | null;
799
- mobile_navigation?: components["schemas"]["FluidOSNavigationWithItems"];
800
- themes?: components["schemas"]["FluidOSTheme"][];
801
- }; /** FluidOS::Profile */
802
- FluidOSProfileWithScreens: {
803
- id: number;
804
- name?: string | null;
805
- default?: boolean | null;
806
- permissions?: components["schemas"]["FluidOSDynamicPayload"];
807
- definition_id: number;
808
- navigation?: components["schemas"]["FluidOSNavigationWithItems"] | null;
809
- mobile_navigation?: components["schemas"]["FluidOSNavigationWithItems"];
810
- themes?: components["schemas"]["FluidOSTheme"][];
811
- screens?: components["schemas"]["FluidOSScreen"][];
812
- }; /** FluidOS::Definition */
813
- FluidOSDefinitionBasic: {
814
- id: number;
815
- name?: string | null;
816
- active?: boolean | null;
817
- }; /** FluidOS::Definition */
818
- FluidOSDefinition: {
819
- id: number;
820
- name?: string | null;
821
- active?: boolean | null;
822
- profiles?: components["schemas"]["FluidOSProfile"][];
823
- screens?: components["schemas"]["FluidOSScreenBasic"][];
824
- navigations?: components["schemas"]["FluidOSNavigationBasic"][];
825
- themes?: components["schemas"]["FluidOSTheme"][];
826
- }; /** FluidOS::Version */
827
- FluidOSVersion: {
828
- id: number;
829
- active?: boolean | null;
830
- manifest?: components["schemas"]["FluidOSDynamicPayload"]; /** Format: date-time */
831
- published_at?: string | null;
832
- definition_id: number;
833
- }; /** @description Couples each widget package artifact path class with the only accepted contentType value. */
834
- FluidOSWidgetPackageVersionArtifactContentTypeConstraint: {
835
- /** @constant */path: "widget.js"; /** @constant */
836
- contentType: "application/javascript";
837
- } | {
838
- /** @constant */path: "manifest.json"; /** @constant */
839
- contentType: "application/json";
840
- } | {
841
- path: string; /** @constant */
842
- contentType: "text/css";
843
- } | {
844
- path: string; /** @constant */
845
- contentType: "application/json";
846
- }; /** @description Couples each widget package artifact path class with the only accepted contentType/content_type alias values when supplied. */
847
- FluidOSWidgetPackageVersionCompletionArtifactContentTypeConstraint: {
848
- /** @constant */path: "widget.js"; /** @constant */
849
- contentType?: "application/javascript"; /** @constant */
850
- content_type?: "application/javascript";
851
- } | {
852
- /** @constant */path: "manifest.json"; /** @constant */
853
- contentType?: "application/json"; /** @constant */
854
- content_type?: "application/json";
855
- } | {
856
- path: string; /** @constant */
857
- contentType?: "text/css"; /** @constant */
858
- content_type?: "text/css";
859
- } | {
860
- path: string; /** @constant */
861
- contentType?: "application/json"; /** @constant */
862
- content_type?: "application/json";
863
- }; /** @description Artifact metadata required before Fluid OS widget package upload URLs can be issued. Artifact paths must be unique within the request, and the artifact list must include widget.js and manifest.json before upload URLs are issued. Artifact paths are top-level package artifact filenames only; accepted names are widget.js, manifest.json, *.css, and *.js.map with no slash paths. Accepted content types are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css. Byte sizes are non-negative and checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
864
- FluidOSWidgetPackageVersionArtifactInput: {
865
- /** @description Top-level package artifact filename. Accepted names are widget.js, manifest.json, *.css, or *.js.map; slash paths are not accepted. */path: string; /** @description Expected SHA256 checksum for the artifact content. */
866
- sha256: string; /** @description Expected artifact size in bytes. Checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
867
- bytes: number;
868
- /**
869
- * @description MIME content type used when uploading the artifact. Accepted values are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css.
870
- * @enum {string}
871
- */
872
- contentType: "application/javascript" | "application/json" | "text/css";
873
- } & components["schemas"]["FluidOSWidgetPackageVersionArtifactContentTypeConstraint"]; /** @description Request payload for starting a company-owned Fluid OS widget package version publish flow. Artifact paths must be unique top-level package artifact filenames. The artifacts list must include widget.js and manifest.json so the API can issue upload URLs and later verify the completed upload. */
874
- FluidOSWidgetPackageVersionCreateRequest: {
875
- /** @description Non-empty, object-path-safe company-owned widget package key. Use URL-safe characters only; . and .. are not accepted. */package_key: string; /** @description Non-empty, object-path-safe widget package version identifier accepted in the URL and upload path. Dotted versions such as 1.0.0 are accepted; only exact . or .. path segments and characters outside [A-Za-z0-9._~-] are rejected. */
876
- version: string; /** @description Fluid OS builder version that produced this package. */
877
- builder_version: string; /** @description Fluid OS CLI version that published this package. */
878
- cli_version: string; /** @description Fluid OS runtime version targeted by this package. */
879
- runtime_version: string; /** @description SHA256 checksum of the serialized manifest JSON. */
880
- manifest_hash: string; /** @description Widget package manifest JSON. It must use the supported widget manifest structure, contain at least one extractable widget type, and every widget type in that structure must use the company-owned prefix `company.<package_key>.`. */
881
- manifest: {
882
- [key: string]: components["schemas"]["JsonValue"];
883
- }; /** @description Top-level package artifacts to upload. The list must include widget.js and manifest.json. */
884
- artifacts: components["schemas"]["FluidOSWidgetPackageVersionArtifactInput"][] & (unknown & unknown); /** @description Optional publisher metadata stored with the package version. */
885
- build_metadata?: {
886
- [key: string]: components["schemas"]["JsonValue"];
887
- };
888
- }; /** @description Upload instructions for a widget package artifact. */
889
- FluidOSWidgetPackageVersionUpload: {
890
- /** @description Top-level package artifact filename. */path: string; /** Format: uri */
891
- upload_url: string; /** Format: uri */
892
- public_url: string;
893
- }; /** @description Upload session details for a pending Fluid OS widget package version. */
894
- FluidOSWidgetPackageVersionCreateResponse: {
895
- version_id: number; /** Format: uri */
896
- artifact_base_url: string;
897
- uploads: components["schemas"]["FluidOSWidgetPackageVersionUpload"][];
898
- }; /** @description Optional artifact metadata supplied when completing a widget package upload. Artifact paths must be unique top-level package artifact filenames within the request; accepted names are widget.js, manifest.json, *.css, and *.js.map with no slash paths. Accepted content types are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css. Byte sizes are non-negative and checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. sha256/checksum, bytes/size, and contentType/content_type are accepted aliases and must match when both aliases are present; supplied artifact metadata is compared with the stored upload-session/package version artifact metadata during verification. If artifacts are supplied, they must include exactly the stored upload-session artifact paths. Manifest verification is separate and happens against uploaded artifact content. */
899
- FluidOSWidgetPackageVersionCompletionArtifactInput: {
900
- /** @description Top-level package artifact filename. Accepted names are widget.js, manifest.json, *.css, or *.js.map; slash paths are not accepted. */path: string; /** @description Expected SHA256 checksum for the artifact content. */
901
- sha256?: string; /** @description Alias for sha256. */
902
- checksum?: string; /** @description Expected artifact size in bytes. Checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
903
- bytes?: number; /** @description Alias for bytes; checked against the same configured per-artifact and bundle limits. */
904
- size?: number;
905
- /**
906
- * @description MIME content type for the artifact. Accepted values are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css.
907
- * @enum {string}
908
- */
909
- contentType?: "application/javascript" | "application/json" | "text/css";
910
- /**
911
- * @description Alias for contentType.
912
- * @enum {string}
913
- */
914
- content_type?: "application/javascript" | "application/json" | "text/css";
915
- } & components["schemas"]["FluidOSWidgetPackageVersionCompletionArtifactContentTypeConstraint"]; /** @description Request payload for verifying uploaded company-owned Fluid OS widget package artifacts. The version path parameter, optional package_key, and any supplied artifact metadata must match the stored upload-session/package version artifact metadata before the package version is approved. If artifacts are supplied, they must include exactly the stored upload-session artifact paths. Uploaded manifest.json is verified for matching packageId, matching version, and valid company-owned `company.<package_key>.` widget type prefixes. */
916
- FluidOSWidgetPackageVersionCompleteUploadRequest: {
917
- /** @description Optional non-empty, object-path-safe widget package key. When omitted, the company's widget package is used; . and .. are not accepted. */package_key?: string | null; /** @description Optional artifact metadata to compare with the stored upload session. When supplied, the list must include exactly the stored upload-session artifact paths; omissions and extras are rejected. */
918
- artifacts?: components["schemas"]["FluidOSWidgetPackageVersionCompletionArtifactInput"][];
919
- }; /** @description Approved Fluid OS widget package version details. */
920
- FluidOSWidgetPackageVersionCompleteUploadResponse: {
921
- status: string;
922
- packageId: string; /** @description Non-empty, object-path-safe widget package version identifier. Dotted versions such as 1.0.0 are accepted; only exact . or .. path segments and characters outside [A-Za-z0-9._~-] are rejected. */
923
- version: string; /** Format: uri */
924
- scriptUrl: string;
925
- cssUrls: string[]; /** Format: uri */
926
- manifestUrl: string;
927
- }; /** @description Flat verification failure response returned when uploaded artifacts do not match the package manifest or expected metadata. */
928
- FluidOSWidgetPackageVersionVerificationErrorResponse: {
929
- /** @enum {string} */status: "error";
930
- error_message: string;
931
- details: {
932
- [key: string]: components["schemas"]["JsonValue"];
933
- };
934
- }; /** @description Dynamic Fluid OS JSON payload whose keys are defined by the app builder configuration. */
935
- FluidOSDynamicPayload: {
936
- [key: string]: components["schemas"]["JsonValue"];
937
- } | null;
938
- FluidOSWidgetPackageCatalogEntry: {
939
- /**
940
- * @description Package ownership source for the shared widget loading path.
941
- * @enum {string}
942
- */
943
- source: "company" | "droplet";
944
- /**
945
- * @description Runtime package identifier prefixed by source.
946
- * @example company.portal-home
947
- * @example droplet.reviews
948
- */
949
- packageId: string; /** @description Approved package version currently active for this owner. */
950
- version: string; /** @description Public module script URL for the package runtime artifact. */
951
- scriptUrl: string | null; /** @description Public stylesheet URLs for the package runtime artifacts. */
952
- cssUrls: string[]; /** @description Public URL for the package manifest artifact. */
953
- manifestUrl: string | null; /** @description Approved package manifest JSON used by the runtime loader. */
954
- manifest: {
955
- [key: string]: components["schemas"]["JsonValue"];
956
- };
957
- };
958
- FluidOSWidgetPackageCatalogResponse: {
959
- packages: components["schemas"]["FluidOSWidgetPackageCatalogEntry"][];
960
- };
961
- FluidOSWidgetPackageDropletForbiddenResponse: {
962
- error: {
963
- message: string;
964
- details?: {
965
- [key: string]: components["schemas"]["JsonValue"];
966
- };
967
- }; /** @enum {integer} */
968
- status: 403;
969
- meta?: components["schemas"]["Meta"];
970
- };
971
- FluidOSWidgetPackageRoleForbiddenResponse: {
972
- message: string;
973
- };
974
- FluidOSWidgetPackagePermissionForbiddenResponse: {
975
- error: string;
976
- };
977
- FluidOSWidgetPackageForbiddenResponse: components["schemas"]["FluidOSWidgetPackageDropletForbiddenResponse"] | components["schemas"]["FluidOSWidgetPackageRoleForbiddenResponse"] | components["schemas"]["FluidOSWidgetPackagePermissionForbiddenResponse"];
978
- };
979
- responses: never;
980
- parameters: never;
981
- requestBodies: never;
982
- headers: never;
983
- pathItems: never;
984
- }
985
- //#endregion
986
- //#region src/utils/transform.d.ts
987
- type ApiScreen = components["schemas"]["FluidOSScreen"];
988
- type ApiTheme = components["schemas"]["FluidOSTheme"];
989
- type ApiNavigationBasic = components["schemas"]["FluidOSNavigationBasic"];
990
- type ApiNavigationItem = components["schemas"]["FluidOSNavigationItem"];
991
- type ApiProfile = components["schemas"]["FluidOSProfile"];
992
- interface LocalScreen {
993
- readonly name: string;
994
- readonly component_tree: Record<string, unknown>[];
995
- }
996
- interface LocalTheme {
997
- readonly name: string;
998
- readonly config: Record<string, unknown>;
999
- readonly active: boolean;
1000
- }
1001
- interface LocalNavigationItem {
1002
- readonly id: number;
1003
- readonly icon: string | null;
1004
- readonly label: string | null;
1005
- readonly screen: string | null;
1006
- readonly slug: string | null;
1007
- readonly source: string;
1008
- readonly position: number | null;
1009
- readonly parent_id: number | null;
1010
- readonly children: LocalNavigationItem[];
1011
- }
1012
- interface LocalNavigation {
1013
- readonly name: string;
1014
- readonly platform: string;
1015
- readonly navigation_items: LocalNavigationItem[];
1016
- }
1017
- interface LocalProfile {
1018
- readonly name: string;
1019
- readonly default: boolean;
1020
- readonly navigation: string | null;
1021
- readonly mobile_navigation: string | null;
1022
- readonly themes: string[];
1023
- readonly permissions: {
1024
- readonly ranks: number[];
1025
- readonly roles: string[];
1026
- readonly platform: string[];
1027
- readonly countries: number[];
1028
- };
1029
- }
1030
- /**
1031
- * Transform an API screen response into the local file format.
1032
- * Strips server-only fields and normalizes `component_tree` to always be an array.
1033
- */
1034
- declare function transformScreen(screen: ApiScreen): LocalScreen;
1035
- /**
1036
- * Derive a slug for a screen. Screens use the existing `slug` field from the API.
1037
- * Falls back to slugifying the name if no slug exists.
1038
- */
1039
- declare function deriveScreenSlug(screen: ApiScreen, existingSlugs: Set<string>): string;
1040
- /**
1041
- * Transform an API theme response into the local file format.
1042
- * Passes theme config through as-is (hex conversion is a separate ticket).
1043
- */
1044
- declare function transformTheme(theme: ApiTheme): LocalTheme;
1045
- /**
1046
- * Build an ID → slug lookup map by inverting a slug → id mapping.
1047
- */
1048
- declare function buildIdToSlugMap(mappings: Record<string, number>): Map<number, string>;
1049
- /**
1050
- * Transform API navigation items into local format.
1051
- * Converts `screen_id` to `screen` slug reference. Keeps `id` for sync.
1052
- */
1053
- declare function transformNavigationItems(items: ApiNavigationItem[], screenIdToSlug: Map<number, string>): LocalNavigationItem[];
1054
- /**
1055
- * Transform an API navigation with its items into the local file format.
1056
- */
1057
- declare function transformNavigation(nav: ApiNavigationBasic, items: ApiNavigationItem[], screenIdToSlug: Map<number, string>): LocalNavigation;
1058
- /** Typed alias for call-site clarity. */
1059
- declare const buildNavigationIdToSlugMap: (mappings: Record<string, number>) => Map<number, string>;
1060
- /** Typed alias for call-site clarity. */
1061
- declare const buildThemeIdToSlugMap: (mappings: Record<string, number>) => Map<number, string>;
1062
- /**
1063
- * Transform an API profile response into the local file format.
1064
- * Converts navigation_id, mobile_navigation_id, and theme_ids to slug references.
1065
- *
1066
- * TODO (REP-842): Country/rank IDs in profile permissions need to be translated
1067
- * to human-readable names via the main Fluid API. For now, the permission arrays
1068
- * are written as-is with integer IDs.
1069
- */
1070
- declare function transformProfile(profile: ApiProfile, navIdToSlug: Map<number, string>, themeIdToSlug: Map<number, string>): LocalProfile;
1071
- //#endregion
1072
1009
  //#region src/utils/push-validation.d.ts
1073
1010
  /** Categorize changed files by resource type. */
1074
1011
  interface CategorizedChanges {
@@ -1110,141 +1047,31 @@ declare function categorizeChanges(diff: SnapshotDiff): CategorizedChanges;
1110
1047
  * Validate that all cross-references between local portal files are valid.
1111
1048
  *
1112
1049
  * Checks:
1050
+ * - New and changed resources contain the required local-file fields
1051
+ * - Every widget node in a changed screen has a string "id" and "type"
1052
+ * - New and changed themes include the required config object
1113
1053
  * - Navigation items' "screen" slugs reference existing screen files or mappings
1114
1054
  * - Profile "navigation" and "mobile_navigation" slugs reference existing nav files or mappings
1115
1055
  * - Profile "themes" slugs reference existing theme files or mappings
1116
1056
  */
1117
1057
  declare function validateCrossReferences(portalDir: string, mappings: PortalMappings, changes: CategorizedChanges): Promise<ValidationError[]>;
1118
1058
  //#endregion
1119
- //#region ../../portal/core/src/remote-dom-widget-package.d.ts
1120
- declare const REMOTE_DOM_WIDGET_MANIFEST_VERSION: 1;
1121
- declare const REMOTE_DOM_WIDGET_RUNTIME: "remote-dom";
1122
- type JsonPrimitive = string | number | boolean | null;
1123
- type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
1124
- interface JsonObject {
1125
- readonly [key: string]: JsonValue;
1126
- }
1127
- interface RemoteDomWidgetCapabilityDeclaration {
1128
- readonly name: string;
1129
- readonly version: string;
1130
- }
1131
- interface RemoteDomWidgetDefinition {
1132
- readonly type: string;
1133
- readonly displayName: string;
1134
- readonly description: string;
1135
- readonly icon: string;
1136
- readonly category: string;
1137
- readonly propertySchema: JsonObject;
1138
- readonly defaultProps: JsonObject;
1139
- readonly container: "inline" | "block" | "card" | "fullscreen";
1140
- readonly resizable: boolean | "horizontal" | "vertical" | "both";
1141
- readonly minSdkVersion: string;
1142
- readonly capabilities: readonly RemoteDomWidgetCapabilityDeclaration[];
1143
- }
1144
- /**
1145
- * Canonical package contract shared by the CLI, catalog APIs, and portal hosts.
1146
- * Catalog producers resolve every artifact to its public URL before returning
1147
- * this descriptor; consumers do not translate legacy manifest shapes.
1148
- */
1149
- interface RemoteDomWidgetPackageDescriptor {
1150
- readonly manifestVersion: typeof REMOTE_DOM_WIDGET_MANIFEST_VERSION;
1151
- readonly runtime: typeof REMOTE_DOM_WIDGET_RUNTIME;
1152
- readonly packageId: string;
1153
- readonly source: "company" | "droplet";
1154
- readonly version: string;
1155
- readonly workerEntryUrl: string;
1156
- readonly cssUrls: readonly string[];
1157
- readonly assetUrls: readonly string[];
1158
- readonly widgets: readonly RemoteDomWidgetDefinition[];
1159
- }
1059
+ //#region src/commands/push.d.ts
1060
+ declare const pushCommand: Command;
1061
+ //#endregion
1062
+ //#region src/commands/widget-create.d.ts
1063
+ declare const widgetCommand: Command;
1064
+ //#endregion
1065
+ //#region src/commands/widget-publish.d.ts
1066
+ declare const topLevelWidgetCommand: Command;
1160
1067
  //#endregion
1161
- //#region src/utils/widget-package-validation.d.ts
1068
+ //#region src/commands/deploy.d.ts
1069
+ declare const deployCommand: Command;
1070
+ //#endregion
1071
+ //#region ../widget-tooling/src/internal/widget-package-validation.d.ts
1162
1072
  type WidgetPackageOwnerKind = "company" | "droplet";
1163
- interface WidgetCapabilityMetadata {
1164
- readonly name: string;
1165
- readonly version?: string;
1166
- }
1167
- interface SourceWidgetMetadata {
1168
- readonly name: string;
1169
- readonly displayName?: string;
1170
- readonly description?: string;
1171
- readonly icon?: string;
1172
- readonly category?: string;
1173
- readonly propertySchema?: JsonObject;
1174
- readonly defaultProps?: JsonObject;
1175
- readonly container?: unknown;
1176
- readonly minSdkVersion?: string;
1177
- readonly resizable?: unknown;
1178
- readonly capabilities?: readonly WidgetCapabilityMetadata[];
1179
- }
1180
- interface SourceWidgetPackageMetadata {
1181
- readonly manifestVersion?: number;
1182
- readonly scope?: string;
1183
- readonly packageStableId?: string;
1184
- readonly packageId: string;
1185
- readonly packageType?: string;
1186
- readonly version: string;
1187
- readonly widgets: readonly SourceWidgetMetadata[];
1188
- readonly cssUrls?: readonly string[];
1189
- }
1190
- interface WidgetDescriptorMetadata extends RemoteDomWidgetDefinition {
1191
- readonly name: string;
1192
- }
1193
- declare const WIDGET_PACKAGE_ARTIFACT_PATH: unique symbol;
1194
- /** A package-local artifact path written into the uploaded manifest. */
1195
- type WidgetPackageArtifactPath = string & {
1196
- readonly [WIDGET_PACKAGE_ARTIFACT_PATH]: true;
1197
- };
1198
- /**
1199
- * Upload-time manifest whose artifact references are package-local paths.
1200
- *
1201
- * This is deliberately distinct from RemoteDomWidgetPackageDescriptor, whose
1202
- * catalog-facing artifact fields must already be resolved to absolute URLs.
1203
- */
1204
- interface WidgetPackagePublishManifest {
1205
- readonly manifestVersion: 1;
1206
- readonly runtime: "remote-dom";
1207
- readonly packageId: string;
1208
- readonly source: WidgetPackageOwnerKind;
1209
- readonly version: string;
1210
- readonly workerEntryUrl: WidgetPackageArtifactPath;
1211
- readonly cssUrls: readonly WidgetPackageArtifactPath[];
1212
- readonly assetUrls: readonly WidgetPackageArtifactPath[];
1213
- readonly widgets: readonly RemoteDomWidgetDefinition[];
1214
- }
1215
- interface ValidatedWidgetPackageBuild {
1216
- readonly sourcePackage: SourceWidgetPackageMetadata;
1217
- readonly packageKey: string;
1218
- readonly packageId: string;
1219
- readonly owner: WidgetPackageOwnerKind;
1220
- readonly version: string;
1221
- readonly widgets: readonly WidgetDescriptorMetadata[];
1222
- }
1223
- type WidgetPackageValidationErrorCode = "NO_SOURCE_PACKAGE" | "MULTIPLE_SOURCE_PACKAGES" | "INVALID_SOURCE_PACKAGE" | "INVALID_WIDGET_METADATA" | "UNSUPPORTED_OWNER" | "INVALID_PACKAGE_KEY" | "INVALID_VERSION" | "NO_WIDGETS" | "INVALID_WIDGET_NAME" | "INVALID_WIDGET_TYPE" | "DUPLICATE_WIDGET";
1224
- interface WidgetPackageValidationError {
1225
- readonly code: WidgetPackageValidationErrorCode;
1226
- readonly message: string;
1227
- readonly path?: string;
1228
- }
1229
- interface WidgetPackageValidationResult {
1230
- readonly success: boolean;
1231
- readonly value?: ValidatedWidgetPackageBuild;
1232
- readonly errors: readonly WidgetPackageValidationError[];
1233
- }
1234
- interface ValidateSourceWidgetPackageOptions {
1235
- readonly owner?: WidgetPackageOwnerKind;
1236
- }
1237
- declare function validateSingleSourceWidgetPackage(sourcePackages: readonly unknown[], options?: ValidateSourceWidgetPackageOptions): WidgetPackageValidationResult;
1238
- declare function buildWidgetPackagePublishManifest(validated: ValidatedWidgetPackageBuild, options?: {
1239
- readonly cssUrls?: readonly string[];
1240
- }): WidgetPackagePublishManifest;
1241
1073
  //#endregion
1242
- //#region src/utils/widget-package-builder.d.ts
1243
- interface BuildSharedWidgetPackageOptions {
1244
- readonly projectDir: string;
1245
- readonly publishDir?: string;
1246
- readonly owner?: WidgetPackageOwnerKind;
1247
- }
1074
+ //#region ../widget-tooling/src/internal/widget-package-builder.d.ts
1248
1075
  interface SharedWidgetPackageBuildResult {
1249
1076
  readonly publishDir: string;
1250
1077
  readonly packageId: string;
@@ -1253,63 +1080,16 @@ interface SharedWidgetPackageBuildResult {
1253
1080
  readonly publishManifestPath: string;
1254
1081
  readonly widgetScriptPath: string;
1255
1082
  }
1256
- interface SharedWidgetPackageBuildError {
1257
- readonly code: "CONFIG_LOAD_FAILED" | "VALIDATION_FAILED" | "INVALID_PUBLISH_DIR" | "WRITE_FAILED";
1258
- readonly message: string;
1259
- readonly details?: string;
1260
- }
1261
- declare function buildSharedWidgetPackage(options: BuildSharedWidgetPackageOptions): Promise<Result<SharedWidgetPackageBuildResult, SharedWidgetPackageBuildError>>;
1262
- declare function createWidgetPackageEntrySource(options: {
1263
- readonly configImportPath: string;
1264
- readonly cssImportPath?: string;
1265
- readonly validated: ValidatedWidgetPackageBuild;
1266
- }): string;
1267
1083
  //#endregion
1268
- //#region src/utils/widget-package-config.d.ts
1269
- interface WidgetSourceConfig {
1270
- readonly path: string;
1271
- readonly relativePath: string;
1272
- }
1273
- interface WidgetSourceConfigLoadError {
1274
- readonly code: "CONFIG_LOAD_FAILED" | "INVALID_FORMAT";
1275
- readonly message: string;
1276
- readonly details?: string;
1277
- }
1278
- declare function resolvePortalWidgetSourceConfig(projectDir: string): Promise<WidgetSourceConfig | undefined>;
1279
- declare function loadSourceWidgetPackages(projectDir: string): Promise<Result<unknown[], WidgetSourceConfigLoadError>>;
1280
- //#endregion
1281
- //#region src/utils/widget-package-artifacts.d.ts
1282
- declare const WIDGET_PACKAGE_BUILDER_VERSION = "1";
1084
+ //#region ../widget-tooling/src/internal/widget-package-artifacts.d.ts
1283
1085
  interface ArtifactMetadata {
1284
1086
  readonly path: string;
1285
1087
  readonly sha256: string;
1286
1088
  readonly bytes: number;
1287
1089
  readonly contentType: string;
1288
1090
  }
1289
- interface PublishManifestMetadata {
1290
- readonly packageId: string;
1291
- readonly version: string;
1292
- readonly builderVersion: string;
1293
- readonly cliVersion: string;
1294
- readonly runtimeVersion: string;
1295
- readonly manifestHash: string;
1296
- readonly artifacts: readonly ArtifactMetadata[];
1297
- }
1298
- declare function computeArtifactMetadata(filePath: string, baseDir: string): Promise<ArtifactMetadata>;
1299
- declare function collectWidgetPackageArtifacts(publishDir: string): Promise<ArtifactMetadata[]>;
1300
- declare function createPublishManifestMetadata(options: {
1301
- readonly packageId: string;
1302
- readonly version: string;
1303
- readonly cliVersion: string;
1304
- readonly runtimeVersion: string;
1305
- readonly manifestContent: string | Buffer;
1306
- readonly artifacts: readonly ArtifactMetadata[];
1307
- readonly builderVersion?: string;
1308
- }): PublishManifestMetadata;
1309
- declare function getArtifactContentType(filePath: string): string;
1310
- declare function sha256(content: string | Buffer): string;
1311
1091
  //#endregion
1312
- //#region src/utils/widget-package-upload.d.ts
1092
+ //#region ../widget-tooling/src/internal/widget-package-upload.d.ts
1313
1093
  type WidgetPackageUploadOwner = {
1314
1094
  readonly kind: "droplet";
1315
1095
  readonly uuid: string;
@@ -1344,10 +1124,6 @@ interface WidgetPackageUploadSessionPayload {
1344
1124
  readonly manifest: Record<string, unknown>;
1345
1125
  readonly artifacts: readonly WidgetPackageArtifactPayload[];
1346
1126
  }
1347
- interface WidgetPackageCompleteUploadPayload {
1348
- readonly package_key: string;
1349
- readonly artifacts: readonly WidgetPackageArtifactPayload[];
1350
- }
1351
1127
  interface WidgetPackageSignedUpload {
1352
1128
  readonly path: string;
1353
1129
  readonly url: string;
@@ -1377,75 +1153,215 @@ interface WidgetPackagePublishResult {
1377
1153
  readonly uploadedArtifacts?: readonly WidgetPackageArtifactUploadResult[];
1378
1154
  readonly complete?: WidgetPackageCompleteResult;
1379
1155
  }
1380
- interface BasePublishWidgetPackageVersionOptions {
1381
- readonly owner: WidgetPackageUploadOwner;
1156
+ //#endregion
1157
+ //#region ../widget-tooling/src/workflows.d.ts
1158
+ type WidgetPackageOwner = WidgetPackageUploadOwner;
1159
+ type WidgetPackageBuildResult = SharedWidgetPackageBuildResult;
1160
+ interface PublishedWidgetPackage {
1161
+ readonly build: WidgetPackageBuildResult;
1382
1162
  readonly request: WidgetPackagePublishRequest;
1383
- readonly fetchImpl?: WidgetPackageUploadFetch;
1163
+ readonly publish: WidgetPackagePublishResult;
1384
1164
  }
1385
- interface DryRunPublishWidgetPackageVersionOptions extends BasePublishWidgetPackageVersionOptions {
1386
- readonly client?: FetchClient;
1387
- readonly dryRun: true;
1165
+ //#endregion
1166
+ //#region ../widget-tooling/src/company-widget-package.d.ts
1167
+ interface CompanyWidgetPackage {
1168
+ /** Bare key, comparable to `packageStableId` (no `company.` prefix). */
1169
+ readonly key: string;
1170
+ readonly version: string;
1171
+ /**
1172
+ * Fully-qualified widget types this package publishes — `company.<key>.<Name>`,
1173
+ * the same strings screen JSON stores. Empty when the response carried no
1174
+ * usable manifest, which is a "cannot tell", not "publishes nothing".
1175
+ */
1176
+ readonly widgetTypes: readonly string[];
1388
1177
  }
1389
- interface PublishWidgetPackageVersionUploadOptions extends BasePublishWidgetPackageVersionOptions {
1390
- readonly client: FetchClient;
1391
- readonly dryRun?: boolean;
1178
+ /**
1179
+ * The company's widget package, or `null` when it has never published.
1180
+ *
1181
+ * A company is expected to have exactly one. This returns the first, and exists
1182
+ * for callers that only need "what is this company's key" — a preflight must use
1183
+ * {@link readCompanyWidgetPackages} and reconcile against the configured key
1184
+ * instead, or a second package would make it report a confident, wrong answer.
1185
+ */
1186
+ declare function readCompanyWidgetPackage(client: FluidOsHeyApiClient): Promise<CompanyWidgetPackage | null>;
1187
+ /**
1188
+ * The message shown when the project's key disagrees with the company's.
1189
+ *
1190
+ * Names the actual key and the exact edit, because the failure it replaces gave
1191
+ * neither — and because the fix is one line the author can apply immediately.
1192
+ */
1193
+ declare function formatPackageKeyMismatch(options: {
1194
+ readonly configuredKey: string;
1195
+ readonly companyKey: string;
1196
+ readonly companyVersion: string;
1197
+ }): string;
1198
+ /** What the project's own `src/widgets.config.ts` declares. */
1199
+ interface ConfiguredWidgetPackage {
1200
+ readonly packageId: string;
1201
+ readonly version: string;
1392
1202
  }
1393
- type PublishWidgetPackageVersionOptions = DryRunPublishWidgetPackageVersionOptions | PublishWidgetPackageVersionUploadOptions;
1394
- type WidgetPackageUploadFetch = (input: string | URL, init: RequestInit) => Promise<Response>;
1395
- declare class WidgetPackageUploadError extends Error {
1396
- readonly code: string;
1397
- constructor(code: string, message: string);
1203
+ interface CompanyPackagePreflight {
1204
+ /** Set when the deploy must not proceed; the text explains the one-line fix. */
1205
+ readonly mismatch?: string;
1206
+ /** Set when the configured version would collide; publish as this instead. */
1207
+ readonly versionOverride?: string;
1208
+ /** The version that would have collided, for reporting the substitution. */
1209
+ readonly configuredVersion?: string;
1398
1210
  }
1399
- declare function buildWidgetPackageUploadSessionPayload(request: WidgetPackageSessionRequest): WidgetPackageUploadSessionPayload;
1400
- declare function buildWidgetPackageCompleteUploadPayload(packageKey: string, artifacts: readonly WidgetPackageArtifactMetadata[]): WidgetPackageCompleteUploadPayload;
1401
- declare function getWidgetPackageUploadSessionRoute(owner: WidgetPackageUploadOwner): string;
1402
- declare function getWidgetPackageCompleteUploadRoute(owner: WidgetPackageUploadOwner, version: string): string;
1403
- declare function requestWidgetPackageUploadSession(client: FetchClient, owner: WidgetPackageUploadOwner, request: WidgetPackageSessionRequest): Promise<WidgetPackageUploadSession>;
1404
- declare function uploadWidgetPackageArtifacts(session: WidgetPackageUploadSession, artifacts: readonly WidgetPackageUploadArtifact[], fetchImpl?: WidgetPackageUploadFetch): Promise<WidgetPackageArtifactUploadResult[]>;
1405
- declare function completeWidgetPackageUpload(client: FetchClient, owner: WidgetPackageUploadOwner, version: string, packageKey: string, artifacts: readonly WidgetPackageArtifactMetadata[]): Promise<WidgetPackageCompleteResult>;
1406
- declare function publishWidgetPackageVersion(options: PublishWidgetPackageVersionOptions): Promise<WidgetPackagePublishResult>;
1407
- declare function normalizeWidgetPackageUploadSession(response: unknown, requestedVersion: string, requestedArtifacts: readonly WidgetPackageArtifactMetadata[]): WidgetPackageUploadSession;
1408
- declare function normalizeWidgetPackageCompleteResponse(response: unknown, requestedVersion: string): WidgetPackageCompleteResult;
1211
+ /**
1212
+ * One round trip against the company's widget package, answering both questions
1213
+ * a publish has to settle before it builds anything: is this the right package,
1214
+ * and is this version free?
1215
+ *
1216
+ * Shared so `fluid portal deploy` and any host that drives it reach the same
1217
+ * verdict for the same reason.
1218
+ *
1219
+ * Proceeds on every uncertainty — the company has never published (its first
1220
+ * publish defines both key and version), the lookup failed, or the local config
1221
+ * could not be read. A preflight exists to replace a confusing failure with a
1222
+ * clear one, not to invent new reasons to stop; when it cannot tell, the server
1223
+ * still decides.
1224
+ */
1225
+ declare function preflightCompanyPackage(options: {
1226
+ readonly projectDir: string;
1227
+ readonly client: FluidOsHeyApiClient; /** Injected so callers bundle their own loader; avoids a cycle back into the build path. */
1228
+ readonly readConfiguredPackage: (projectDir: string) => Promise<ConfiguredWidgetPackage | null>;
1229
+ }): Promise<CompanyPackagePreflight>;
1230
+ /**
1231
+ * Returns the version to publish as, or `null` to publish the configured one.
1232
+ *
1233
+ * A company has ONE widget package and several projects publish into it, so the
1234
+ * version belongs to that shared package rather than to any project's source
1235
+ * file. Nothing tells a project what the others have already released, so two
1236
+ * of them declaring `0.5.0` is inevitable — and republishing a version that
1237
+ * exists is refused with `422 Package version already exists`, whose only fix
1238
+ * is editing a SemVer string in a TypeScript file. For an author who never
1239
+ * opens a terminal that is the end of the road, and it happens on EVERY publish
1240
+ * after the first, not in some corner case.
1241
+ *
1242
+ * So a configured version at or below what is published becomes the next patch
1243
+ * after the published one. A configured version ABOVE it is honoured exactly —
1244
+ * that is a deliberate minor or major bump and the whole reason to keep the
1245
+ * field.
1246
+ *
1247
+ * Returns `null` on any version this cannot reason about — a prerelease, build
1248
+ * metadata, anything not a plain numeric triple. Guessing a successor for those
1249
+ * would be worse than letting the server answer.
1250
+ */
1251
+ declare function resolvePublishVersion(options: {
1252
+ readonly configuredVersion: string;
1253
+ readonly publishedVersion: string;
1254
+ }): string | null;
1409
1255
  //#endregion
1410
1256
  //#region src/commands/widget-package-publish.d.ts
1411
1257
  interface PublishWidgetRuntimeArtifactsOptions {
1412
1258
  readonly projectDir: string;
1413
1259
  readonly outDir: string;
1414
1260
  readonly buildOwner: WidgetPackageOwnerKind;
1415
- readonly uploadOwner: WidgetPackageUploadOwner;
1261
+ readonly uploadOwner: WidgetPackageOwner;
1416
1262
  readonly dryRun?: boolean;
1417
- readonly client?: FetchClient;
1263
+ readonly client?: FluidOsHeyApiClient;
1264
+ /** Publish as this version rather than the config's. */
1265
+ readonly version?: string;
1418
1266
  }
1419
- interface PublishWidgetRuntimeArtifactsResult {
1420
- readonly build: SharedWidgetPackageBuildResult;
1421
- readonly request: WidgetPackagePublishRequest;
1422
- readonly publish: WidgetPackagePublishResult;
1267
+ type PublishWidgetRuntimeArtifactsResult = PublishedWidgetPackage;
1268
+ declare function publishWidgetRuntimeArtifacts(options: PublishWidgetRuntimeArtifactsOptions): Promise<PublishWidgetRuntimeArtifactsResult>;
1269
+ //#endregion
1270
+ //#region src/commands/version.d.ts
1271
+ declare const versionCommand: Command;
1272
+ //#endregion
1273
+ //#region src/commands/doctor.d.ts
1274
+ declare const doctorCommand: Command;
1275
+ //#endregion
1276
+ //#region src/utils/transform.d.ts
1277
+ type ApiScreen = FluidOsScreen;
1278
+ type ApiTheme = FluidOsTheme;
1279
+ type ApiNavigationBasic = FluidOsNavigationBasic;
1280
+ type ApiNavigationItem = FluidOsNavigationItem;
1281
+ type ApiProfile = FluidOsProfile;
1282
+ interface LocalScreen {
1283
+ readonly name: string;
1284
+ readonly component_tree: Record<string, unknown>[];
1423
1285
  }
1424
- interface PublishWidgetRuntimeArtifactsDependencies {
1425
- readonly buildSharedWidgetPackage?: typeof buildSharedWidgetPackage;
1426
- readonly publishWidgetPackageVersion?: typeof publishWidgetPackageVersion;
1286
+ interface LocalTheme {
1287
+ readonly name: string;
1288
+ readonly config: Record<string, unknown>;
1289
+ readonly active: boolean;
1427
1290
  }
1428
- declare function publishWidgetRuntimeArtifacts(options: PublishWidgetRuntimeArtifactsOptions, dependencies?: PublishWidgetRuntimeArtifactsDependencies): Promise<PublishWidgetRuntimeArtifactsResult>;
1429
- declare function createWidgetPackagePublishRequest(options: {
1430
- readonly publishDir: string;
1431
- readonly manifestPath: string;
1432
- readonly publishManifestPath: string;
1433
- readonly owner: WidgetPackageOwnerKind;
1434
- }): Promise<WidgetPackagePublishRequest>;
1435
- declare function createAuthenticatedWidgetPackageClient(): FetchClient;
1436
- declare function printWidgetPublishSummary(options: {
1437
- readonly title: string;
1438
- readonly ownerLabel: string;
1439
- readonly environment?: string;
1440
- readonly outDir: string;
1441
- readonly result: PublishWidgetRuntimeArtifactsResult;
1442
- }): void;
1443
- declare function printRuntimeOnlyNotice(): void;
1444
- declare function printDryRunSessionPayload(result: PublishWidgetRuntimeArtifactsResult): void;
1445
- declare function validateWidgetPublishOutDir(projectDir: string, outDir: string): string;
1291
+ interface LocalNavigationItem {
1292
+ /** Server-owned sync identity. New draft items omit it until push. */
1293
+ readonly id?: number;
1294
+ readonly icon: string | null;
1295
+ readonly label: string | null;
1296
+ readonly screen: string | null;
1297
+ readonly slug: string | null;
1298
+ readonly source: string;
1299
+ readonly position: number | null;
1300
+ readonly parent_id: number | null;
1301
+ readonly children: LocalNavigationItem[];
1302
+ }
1303
+ interface LocalNavigation {
1304
+ readonly name: string;
1305
+ readonly platform: string;
1306
+ readonly navigation_items: LocalNavigationItem[];
1307
+ }
1308
+ interface LocalProfile {
1309
+ readonly name: string;
1310
+ readonly default: boolean;
1311
+ readonly navigation: string | null;
1312
+ readonly mobile_navigation: string | null;
1313
+ readonly themes: string[];
1314
+ readonly permissions: {
1315
+ readonly ranks: number[];
1316
+ readonly roles: string[];
1317
+ readonly platform: string[];
1318
+ readonly countries: number[];
1319
+ };
1320
+ }
1321
+ /**
1322
+ * Transform an API screen response into the local file format.
1323
+ * Strips server-only fields and normalizes `component_tree` to always be an array.
1324
+ */
1325
+ declare function transformScreen(screen: ApiScreen): LocalScreen;
1326
+ /**
1327
+ * Derive a slug for a screen. Screens use the existing `slug` field from the API.
1328
+ * Falls back to slugifying the name if no slug exists.
1329
+ */
1330
+ declare function deriveScreenSlug(screen: ApiScreen, existingSlugs: Set<string>): string;
1331
+ /**
1332
+ * Transform an API theme response into the local file format.
1333
+ * Passes theme config through as-is (hex conversion is a separate ticket).
1334
+ */
1335
+ declare function transformTheme(theme: ApiTheme): LocalTheme;
1336
+ /**
1337
+ * Build an ID → slug lookup map by inverting a slug → id mapping.
1338
+ */
1339
+ declare function buildIdToSlugMap(mappings: Record<string, number>): Map<number, string>;
1340
+ /**
1341
+ * Transform API navigation items into local format.
1342
+ * Converts `screen_id` to `screen` slug reference. Keeps `id` for sync.
1343
+ */
1344
+ declare function transformNavigationItems(items: ApiNavigationItem[], screenIdToSlug: Map<number, string>): LocalNavigationItem[];
1345
+ /**
1346
+ * Transform an API navigation with its items into the local file format.
1347
+ */
1348
+ declare function transformNavigation(nav: ApiNavigationBasic, items: ApiNavigationItem[], screenIdToSlug: Map<number, string>): LocalNavigation;
1349
+ /** Typed alias for call-site clarity. */
1350
+ declare const buildNavigationIdToSlugMap: (mappings: Record<string, number>) => Map<number, string>;
1351
+ /** Typed alias for call-site clarity. */
1352
+ declare const buildThemeIdToSlugMap: (mappings: Record<string, number>) => Map<number, string>;
1353
+ /**
1354
+ * Transform an API profile response into the local file format.
1355
+ * Converts navigation_id, mobile_navigation_id, and theme_ids to slug references.
1356
+ *
1357
+ * TODO (REP-842): Country/rank IDs in profile permissions need to be translated
1358
+ * to human-readable names via the main Fluid API. For now, the permission arrays
1359
+ * are written as-is with integer IDs.
1360
+ */
1361
+ declare function transformProfile(profile: ApiProfile, navIdToSlug: Map<number, string>, themeIdToSlug: Map<number, string>): LocalProfile;
1446
1362
  //#endregion
1447
1363
  //#region src/index.d.ts
1448
1364
  declare const plugin: FluidPlugin;
1449
1365
  //#endregion
1450
- export { type ArtifactMetadata, type BuildOptions, type BuildSharedWidgetPackageOptions, CANONICAL_PROJECT_NAME, type CategorizedChanges, type CreateOptions, type CreatePortalGitCredentialOptions, type CreatePortalProjectDependencies, type DefinitionMapping, type DevOptions, FILE_SYSTEM_ERRORS, type FileHash, type FileHashMap, type FileSystemError, type FileSystemErrorCode, type GitCredentialOutcome, GitError, type LocalNavigation, type LocalNavigationItem, type LocalProfile, type LocalScreen, type LocalTheme, type MappedResourceType, type PortalDeployOptions, type PortalGitCredential, type PortalGitSyncOptions, type PortalGitSyncResult, type PortalMappings, type ProjectConfig, type PublishManifestMetadata, type PublishWidgetPackageVersionOptions, type PublishWidgetRuntimeArtifactsDependencies, type PublishWidgetRuntimeArtifactsOptions, type PublishWidgetRuntimeArtifactsResult, type RemoteDomWidgetPackageDescriptor, type ScaffoldFromGitHubOptions, type SelectedPageTemplate, type SharedWidgetPackageBuildError, type SharedWidgetPackageBuildResult, type Snapshot, type SnapshotDiff, type SourceWidgetMetadata, type SourceWidgetPackageMetadata, TEMPLATES, TEMPLATE_REPO_URL, type TemplateName, type TemplatePaths, type TemplateVariables, type ValidateSourceWidgetPackageOptions, type ValidatedWidgetPackageBuild, type ValidationError, WIDGET_PACKAGE_BUILDER_VERSION, type WidgetCreateOptions, type WidgetDescriptorMetadata, type WidgetPackageArtifactMetadata, type WidgetPackageArtifactPath, type WidgetPackageArtifactPayload, type WidgetPackageArtifactUploadResult, type WidgetPackageCompleteResult, type WidgetPackageCompleteUploadPayload, type WidgetPackageOwnerKind, type WidgetPackagePublishManifest, type WidgetPackagePublishRequest, type WidgetPackagePublishResult, type WidgetPackageSessionRequest, type WidgetPackageSignedUpload, type WidgetPackageUploadArtifact, WidgetPackageUploadError, type WidgetPackageUploadFetch, type WidgetPackageUploadOwner, type WidgetPackageUploadSession, type WidgetPackageUploadSessionPayload, type WidgetPackageValidationError, type WidgetPackageValidationErrorCode, type WidgetPackageValidationResult, type WidgetPublishOptions, type WidgetSourceConfig, type WidgetSourceConfigLoadError, buildIdToSlugMap, buildNavigationIdToSlugMap, buildSharedWidgetPackage, buildSnapshot, buildThemeIdToSlugMap, buildWidgetPackageCompleteUploadPayload, buildWidgetPackagePublishManifest, buildWidgetPackageUploadSessionPayload, categorizeChanges, cloneCommand, collectWidgetPackageArtifacts, completeWidgetPackageUpload, computeArtifactMetadata, computeFileHash, copyTemplate, copyTemplateSafe, createAuthenticatedWidgetPackageClient, createCommand, createDirectory, createDirectorySafe, createPortalGitCredential, createPortalProject, createPublishManifestMetadata, createWidgetPackageEntrySource, createWidgetPackagePublishRequest, plugin as default, deployCommand, deriveScreenSlug, deriveSlug, diffAgainstSnapshot, directoryExists, doctorCommand, ensureGitAvailable, fileExists, getArtifactContentType, getInstallCommand, getOriginUrl, getRunCommand, getSdkVersion, getSdkVersionSafe, getTemplatePaths, getWidgetPackageCompleteUploadRoute, getWidgetPackageUploadSessionRoute, gitAheadBehindVsFetchHead, gitAutoCommit, gitClone, gitFetch, gitInit, gitMergeFastForward, gitMissingError, gitPush, hasUncommittedChanges, installDependencies, isGitAvailable, isGitRepo, loadSourceWidgetPackages, normalizeWidgetPackageCompleteResponse, normalizeWidgetPackageUploadSession, pathExists, portalGitCredentialPath, printDryRunSessionPayload, printRuntimeOnlyNotice, printWidgetPublishSummary, promptProjectConfig, publishWidgetPackageVersion, publishWidgetRuntimeArtifacts, pullCommand, pushCommand, readFileSafe, readMappings, readSnapshot, removeMapping, requestWidgetPackageUploadSession, resolveIdToSlug, resolvePortalWidgetSourceConfig, resolveSlugToId, rewriteProjectName, runPackageManager, runPortalGitSync, scaffoldFromGitHub, sha256, slugFromPath, topLevelWidgetCommand, transformNavigation, transformNavigationItems, transformProfile, transformScreen, transformTheme, updateMapping, uploadWidgetPackageArtifacts, validateCrossReferences, validateSingleSourceWidgetPackage, validateWidgetPublishOutDir, versionCommand, widgetCommand, writeFileSafe, writeFluidrcProfile, writeMappings, writeSnapshot };
1366
+ export { type BuildOptions, CANONICAL_PROJECT_NAME, type CategorizedChanges, type CompanyPackagePreflight, type CompanyWidgetPackage, type ConfiguredWidgetPackage, type CreateOptions, type CreatePortalGitCredentialOptions, type CreatePortalProjectDependencies, type DefinitionMapping, type DevOptions, FILE_SYSTEM_ERRORS, type FileHash, type FileHashMap, type FileSystemError, type FileSystemErrorCode, type GitCredentialOutcome, GitError, type LocalNavigation, type LocalNavigationItem, type LocalProfile, type LocalScreen, type LocalTheme, type MappedResourceType, type PortalDeployOptions, type PortalGitCredential, type PortalGitSyncOptions, type PortalGitSyncResult, type PortalMappings, type ProjectConfig, type PublishWidgetRuntimeArtifactsOptions, type ScaffoldFromGitHubOptions, type SelectedPageTemplate, type Snapshot, type SnapshotDiff, TEMPLATES, TEMPLATE_REPO_URL, type TemplateName, type TemplatePaths, type TemplateVariables, type ValidationError, type WidgetCreateOptions, type WidgetPublishOptions, buildIdToSlugMap, buildNavigationIdToSlugMap, buildSnapshot, buildThemeIdToSlugMap, categorizeChanges, cloneCommand, computeFileHash, copyTemplate, copyTemplateSafe, createCommand, createDirectory, createDirectorySafe, createPortalGitCredential, createPortalProject, plugin as default, deployCommand, deriveScreenSlug, deriveSlug, diffAgainstSnapshot, directoryExists, doctorCommand, ensureGitAvailable, fileExists, formatPackageKeyMismatch, getInstallCommand, getOriginUrl, getRunCommand, getSdkVersion, getSdkVersionSafe, getTemplatePaths, gitAheadBehindVsFetchHead, gitAutoCommit, gitClone, gitFetch, gitInit, gitMergeFastForward, gitMissingError, gitPush, hasUncommittedChanges, installDependencies, isGitAvailable, isGitRepo, pathExists, portalGitCredentialPath, preflightCompanyPackage, promptProjectConfig, publishWidgetRuntimeArtifacts, pullCommand, pushCommand, readCompanyWidgetPackage, readFileSafe, readMappings, readSnapshot, removeMapping, resolveIdToSlug, resolvePublishVersion, resolveSlugToId, rewriteProjectName, runPackageManager, runPortalGitSync, scaffoldFromGitHub, slugFromPath, topLevelWidgetCommand, transformNavigation, transformNavigationItems, transformProfile, transformScreen, transformTheme, updateMapping, validateCrossReferences, versionCommand, widgetCommand, writeFileSafe, writeFluidrcProfile, writeMappings, writeSnapshot };
1451
1367
  //# sourceMappingURL=index.d.mts.map