@assistant-ui/x-generative-compiler 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 AgentbaseAI Inc.
3
+ Copyright (c) 2026 AgentbaseAI Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/compile.d.ts CHANGED
@@ -1,39 +1,38 @@
1
- import { Target } from "./constants.js";
2
- //#region src/compile.d.ts
1
+ import { type Target } from "./constants.js";
3
2
  export type ToolType = "frontend" | "backend" | "human" | "provider";
4
3
  export interface CompileOptions {
5
- /** Which build target to emit. */
6
- target: Target;
7
- /** Source filename, used for error messages and source maps. */
8
- filename?: string;
9
- /** Emit a source map alongside the code. */
10
- sourceMaps?: boolean;
11
- /**
12
- * Whether the `server` target prepends `import "server-only"` when it keeps a
13
- * backend `execute`. Defaults to `true` (the Next.js/RSC convention, where the
14
- * guard fires via the `react-server` condition). Set `false` for bundlers
15
- * without a `react-server` layer (e.g. a Vite/TanStack Start `ssr` build),
16
- * where the split is already structural and importing `server-only` would
17
- * throw — see the Vite integration.
18
- */
19
- injectServerOnly?: boolean;
20
- /**
21
- * No backend of the app imports this module's server build (e.g. cloud-hosted
22
- * runs), so the client is the only place the model can learn the schemas
23
- * from. The `client` target then keeps frontend/human tool schemas
24
- * uploadable — no `unstable_backendDefault` marker is stamped — and local
25
- * `new JSONGenerativeUI({ ... })` instances are constructed with
26
- * `backendless: true` so their `present`/`prompt_user` schemas upload too.
27
- */
28
- backendless?: boolean;
4
+ /** Which build target to emit. */
5
+ target: Target;
6
+ /** Source filename, used for error messages and source maps. */
7
+ filename?: string;
8
+ /** Emit a source map alongside the code. */
9
+ sourceMaps?: boolean;
10
+ /**
11
+ * Whether the `server` target prepends `import "server-only"` when it keeps a
12
+ * backend `execute`. Defaults to `true` (the Next.js/RSC convention, where the
13
+ * guard fires via the `react-server` condition). Set `false` for bundlers
14
+ * without a `react-server` layer (e.g. a Vite/TanStack Start `ssr` build),
15
+ * where the split is already structural and importing `server-only` would
16
+ * throw — see the Vite integration.
17
+ */
18
+ injectServerOnly?: boolean;
19
+ /**
20
+ * No backend of the app imports this module's server build (e.g. cloud-hosted
21
+ * runs), so the client is the only place the model can learn the schemas
22
+ * from. The `client` target then keeps frontend/human tool schemas
23
+ * uploadable — no `unstable_backendDefault` marker is stamped — and local
24
+ * `new JSONGenerativeUI({ ... })` instances are constructed with
25
+ * `backendless: true` so their `present`/`prompt_user` schemas upload too.
26
+ */
27
+ backendless?: boolean;
29
28
  }
30
29
  export interface CompileResult {
31
- code: string;
32
- map?: object | null;
30
+ code: string;
31
+ map?: object | null;
33
32
  }
34
33
  /** Thrown when a `"use generative"` file violates an authoring constraint. */
35
34
  export declare class GenerativeCompileError extends Error {
36
- constructor(message: string, filename?: string);
35
+ constructor(message: string, filename?: string);
37
36
  }
38
37
  /** Whether a source string opts into generative compilation via the directive. */
39
38
  export declare function isGenerativeModule(code: string): boolean;
@@ -43,5 +42,4 @@ export declare const isGenerativeSource: (filename: string, source: string) => b
43
42
  * regions that target needs and pruning the imports the dropped regions used.
44
43
  */
45
44
  export declare function compileGenerative(code: string, options: CompileOptions): CompileResult;
46
- //#endregion
47
45
  //# sourceMappingURL=compile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","names":[],"sources":["../src/compile.ts"],"mappings":";;YA2BY;iBA2CK;;EAEf,QAAQ;;EAER;;EAEA;;;;;;;;;EASA;;;;;;;;;EASA;;iBAGe;EACf;EACA;;;qBAIW,+BAA+B;EAC9B,YAAA,iBAAiB;;;wBASf,mBAAmB;qBAgCtB,qBAAsB,kBAAkB;;;;;wBAkHrC,kBACd,cACA,SAAS,iBACR"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AASA,OAAO,EAAa,KAAK,MAAM,EAAE,uBAAoB;AAkBrD,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AA2CrE,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,8EAA8E;AAC9E,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAM/C;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CA8BxD;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,EAAE,QAAQ,MAAM,KAAG,OACN,CAAC;AA6GjE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,GACtB,aAAa,CAiHf"}
@@ -1,7 +1,5 @@
1
- //#region src/constants.d.ts
2
1
  /** The directive a module uses to opt into generative compilation. */
3
2
  export declare const DIRECTIVE = "use generative";
4
3
  /** Build target a generative module is compiled for. */
5
4
  export type Target = "client" | "server";
6
- //#endregion
7
5
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;qBACa;;YAGD"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAE1C,wDAAwD;AACxD,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { DIRECTIVE, Target } from "./constants.js";
2
- import { CompileOptions, CompileResult, GenerativeCompileError, ToolType, compileGenerative, isGenerativeModule, isGenerativeSource } from "./compile.js";
3
- export { type CompileOptions, type CompileResult, DIRECTIVE, GenerativeCompileError, type Target, type ToolType, compileGenerative, isGenerativeModule, isGenerativeSource };
1
+ export { compileGenerative, isGenerativeModule, isGenerativeSource, GenerativeCompileError, type ToolType, type CompileOptions, type CompileResult, } from "./compile.js";
2
+ export { DIRECTIVE, type Target } from "./constants.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,qBAAkB;AACnB,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,uBAAoB"}
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.18";
2
+ var version = "0.0.20";
3
3
  //#endregion
4
4
  export { version };
5
5
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@assistant-ui/x-generative-compiler",
3
3
  "private": false,
4
- "version": "0.0.18",
4
+ "version": "0.0.20",
5
5
  "description": "Internal: the framework-agnostic \"use generative\" compiler that splits a colocated tool (schema + server-only execute + client-only render) into per-target builds. Shared by @assistant-ui/next and @assistant-ui/vite.",
6
6
  "keywords": [
7
7
  "assistant-ui",
@@ -29,19 +29,19 @@
29
29
  ],
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@babel/generator": "^8.0.5",
33
- "@babel/parser": "^8.0.5",
34
- "@babel/traverse": "^8.0.5",
35
- "@babel/types": "^8.0.5",
32
+ "@babel/generator": "^7.29.7",
33
+ "@babel/parser": "^7.29.7",
34
+ "@babel/traverse": "^7.29.7",
35
+ "@babel/types": "^7.29.7",
36
36
  "semver": "^7.8.5"
37
37
  },
38
38
  "devDependencies": {
39
- "@assistant-ui/x-buildutils": "0.0.28",
39
+ "@assistant-ui/x-buildutils": "0.0.30",
40
40
  "@types/babel__generator": "^7.27.0",
41
41
  "@types/babel__traverse": "^7.28.0",
42
- "@types/node": "^26.5.1",
42
+ "@types/node": "^26.6.3",
43
43
  "@types/semver": "^7.8.0",
44
- "vitest": "^5.0.1"
44
+ "vitest": "^5.0.3"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public",