@frontmcp/uipack 1.3.0 → 1.4.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.
Files changed (44) hide show
  1. package/adapters/index.js +1046 -698
  2. package/adapters/template-renderer.d.ts +14 -0
  3. package/adapters/template-renderer.d.ts.map +1 -1
  4. package/bridge-runtime/iife-generator.d.ts.map +1 -1
  5. package/bridge-runtime/index.js +149 -0
  6. package/component/index.d.ts +1 -0
  7. package/component/index.d.ts.map +1 -1
  8. package/component/index.js +468 -145
  9. package/component/loader.d.ts +21 -2
  10. package/component/loader.d.ts.map +1 -1
  11. package/component/renderer.d.ts +2 -2
  12. package/component/renderer.d.ts.map +1 -1
  13. package/component/transpiler.d.ts +16 -1
  14. package/component/transpiler.d.ts.map +1 -1
  15. package/component/types.d.ts +19 -0
  16. package/component/types.d.ts.map +1 -1
  17. package/component/ui-availability.d.ts +27 -0
  18. package/component/ui-availability.d.ts.map +1 -0
  19. package/esm/adapters/index.mjs +1046 -698
  20. package/esm/bridge-runtime/index.mjs +149 -0
  21. package/esm/component/index.mjs +468 -145
  22. package/esm/index.mjs +444 -109
  23. package/esm/package.json +2 -2
  24. package/esm/shell/index.mjs +420 -171
  25. package/index.d.ts +1 -1
  26. package/index.d.ts.map +1 -1
  27. package/index.js +445 -109
  28. package/package.json +2 -2
  29. package/shell/builder.d.ts.map +1 -1
  30. package/shell/data-injector.d.ts +27 -1
  31. package/shell/data-injector.d.ts.map +1 -1
  32. package/shell/index.d.ts +3 -2
  33. package/shell/index.d.ts.map +1 -1
  34. package/shell/index.js +423 -171
  35. package/shell/sizing-css.d.ts +27 -0
  36. package/shell/sizing-css.d.ts.map +1 -0
  37. package/shell/types.d.ts +102 -0
  38. package/shell/types.d.ts.map +1 -1
  39. package/types/index.d.ts +1 -1
  40. package/types/index.d.ts.map +1 -1
  41. package/types/ui-config.d.ts +105 -11
  42. package/types/ui-config.d.ts.map +1 -1
  43. package/types/ui-runtime.d.ts +23 -2
  44. package/types/ui-runtime.d.ts.map +1 -1
@@ -7,8 +7,7 @@
7
7
  * @packageDocumentation
8
8
  */
9
9
  import type { ImportResolver } from '../resolver/types';
10
- import type { UISource, ResolvedComponent } from './types';
11
- import { FRONTMCP_META_KEY } from './types';
10
+ import { FRONTMCP_META_KEY, type ResolvedComponent, type UISource } from './types';
12
11
  /**
13
12
  * Resolve a UISource to a loadable component.
14
13
  *
@@ -21,6 +20,26 @@ export declare function resolveUISource(source: UISource, options?: {
21
20
  resolver?: ImportResolver;
22
21
  input?: unknown;
23
22
  output?: unknown;
23
+ /**
24
+ * When true, FileSource `.tsx`/`.jsx` widgets are bundled with React
25
+ * inlined (no esm.sh import map). Required for hosts that block external
26
+ * script execution (Claude — see #454). Passes through to
27
+ * `bundleFileSource({ bundleReact })`.
28
+ */
29
+ inlineReact?: boolean;
30
+ /**
31
+ * When true, FileSource `.tsx`/`.jsx` widgets are TRANSFORM-ONLY: the source
32
+ * is transpiled with esbuild `transformSync` (single file, JSX → createElement)
33
+ * and ALL imports — including `react`/`react-dom` — stay external bare
34
+ * specifiers resolved by the import map. NO bundling, NO auto-injected mount
35
+ * (the caller supplies a {@link ShellMountDescriptor} on the render side).
36
+ *
37
+ * This is the generic primitive a non-widget caller (e.g. an auth page) uses
38
+ * to route a `.tsx` through `renderComponent`'s inline-module path without
39
+ * pulling in the widget bundle + `McpBridgeProvider` mount. Mutually
40
+ * exclusive with {@link inlineReact} (bundling). Default `false`.
41
+ */
42
+ transformOnly?: boolean;
24
43
  }): ResolvedComponent;
25
44
  /**
26
45
  * Generate a mount script for module-based components.
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/component/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AAGxE,OAAO,KAAK,EACV,QAAQ,EAKR,iBAAiB,EAElB,MAAM,SAAS,CAAC;AACjB,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AAiB,EAAE,CAAC"}
@@ -6,8 +6,8 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- import type { ShellConfig, ShellResult } from '../shell/types';
10
- import type { UIConfig } from './types';
9
+ import { type ShellConfig, type ShellResult } from '../shell/types';
10
+ import { type UIConfig } from './types';
11
11
  /**
12
12
  * Render a complete HTML shell for a UI component.
13
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/component/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAqB,MAAM,SAAS,CAAC;AAQ3D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,WAAW,CAyBvF"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/component/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,KAAK,WAAW,EAA6B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE/F,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAehE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,WAAW,CA6BvF"}
@@ -31,7 +31,22 @@ export declare function transpileReactSource(source: string, filename?: string):
31
31
  * @param componentName - Name of the component to mount (extracted from source)
32
32
  * @returns Bundled JavaScript source code
33
33
  */
34
- export declare function bundleFileSource(source: string, filename: string, resolveDir: string, componentName: string): {
34
+ /**
35
+ * Options for `bundleFileSource`.
36
+ */
37
+ export interface BundleFileSourceOptions {
38
+ /**
39
+ * When true, `react` / `react-dom` / `react-dom/client` and the JSX runtime
40
+ * subpaths are bundled into the output instead of being declared external.
41
+ *
42
+ * Used by `resourceMode: 'inline'` to produce a truly self-contained widget
43
+ * that runs in hosts that block external script execution (e.g. Claude
44
+ * Desktop / claude.ai — see issue #454). Default `false` keeps the original
45
+ * behavior where React is loaded from the CDN via an import map.
46
+ */
47
+ bundleReact?: boolean;
48
+ }
49
+ export declare function bundleFileSource(source: string, filename: string, resolveDir: string, componentName: string, options?: BundleFileSourceOptions): {
35
50
  code: string;
36
51
  };
37
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../src/component/transpiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CA4GlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUpE"}
1
+ {"version":3,"file":"transpiler.d.ts","sourceRoot":"","sources":["../../src/component/transpiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB9E;AAED;;;;;;;;;;;;GAYG;AACH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,uBAA4B,GACpC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CA6HlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUpE"}
@@ -46,6 +46,25 @@ export interface UIConfig<In = unknown, Out = unknown> {
46
46
  includeBridge?: boolean;
47
47
  /** Custom shell template (pre-resolved object or inline string). */
48
48
  customShell?: import('../shell/custom-shell-types').ResolvedShellTemplate | string;
49
+ /**
50
+ * When true, FileSource `.tsx`/`.jsx` widgets are bundled with React
51
+ * inlined (no esm.sh import map / no external `<script type="module">`).
52
+ * This is what `UITemplateConfig.resourceMode: 'inline'` is supposed to do
53
+ * end-to-end; setting it makes the widget self-contained and renders
54
+ * correctly in hosts that block external script execution (Claude
55
+ * Desktop / claude.ai — see issue #454).
56
+ */
57
+ inlineReact?: boolean;
58
+ /**
59
+ * When true, a FileSource `.tsx`/`.jsx` is TRANSFORM-ONLY: transpiled as a
60
+ * single file with ALL imports (incl. react/react-dom) left external for the
61
+ * import map, and NO auto-injected widget mount. Pair with a
62
+ * {@link import('../shell/types').ShellMountDescriptor} on the shell config to
63
+ * supply the mount tail. The generic primitive for routing a non-widget page
64
+ * (e.g. an auth page) through `renderComponent`'s inline-module path. Mutually
65
+ * exclusive with {@link inlineReact}. Default `false`.
66
+ */
67
+ transformOnly?: boolean;
49
68
  }
50
69
  /** Auto-detected or declared metadata on a component module */
51
70
  export interface ComponentMeta {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB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CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `@frontmcp/ui` availability check for FileSource bundling.
3
+ *
4
+ * `bundleFileSource` injects an auto-generated mount that imports from
5
+ * `@frontmcp/ui/react`. If `@frontmcp/ui` isn't installed in the consuming
6
+ * project, esbuild fails with a cryptic `Could not resolve` error. This
7
+ * preflight detects the missing package up-front so consumers see actionable
8
+ * guidance instead (issue #443).
9
+ *
10
+ * Implementation note: we deliberately probe the filesystem directly with
11
+ * `fs.existsSync(<dir>/node_modules/@frontmcp/ui/package.json)` rather than
12
+ * `require.resolve('@frontmcp/ui/...')`. The latter would surface as a
13
+ * module-specifier reference to the `@frontmcp/ui` workspace package and
14
+ * trip the Nx `@nx/enforce-module-boundaries` rule (uipack must not depend
15
+ * on ui), even though it's a runtime resolution check rather than a real
16
+ * import. Using a filesystem probe keeps the dependency graph one-way.
17
+ *
18
+ * Browser-safe: `require('fs')` is Node-only. In a browser build we return
19
+ * `false` rather than throwing — uipack is on track to be importable from
20
+ * browser bundles, and the bundling code-path that gates on this check
21
+ * shouldn't run in a browser anyway.
22
+ *
23
+ * Extracted to its own module so tests can mock it without touching the
24
+ * global Node module resolver.
25
+ */
26
+ export declare function isFrontmcpUiResolvable(...candidatePaths: string[]): boolean;
27
+ //# sourceMappingURL=ui-availability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-availability.d.ts","sourceRoot":"","sources":["../../src/component/ui-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CA2B3E"}