chat-js 1.0.0-alpha.3 → 1.0.0-alpha.5

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/README.md CHANGED
@@ -30,9 +30,11 @@ The CLI installs only that item's adapter files and declared dependencies. `@cha
30
30
 
31
31
  Run `bun --filter chat-js test:gateways` from the repository root to verify independent installs of all built-ins and an external registry gateway.
32
32
 
33
+ After publication, run `bun --filter chat-js test:published` to create an app using the public npm CLI and registry, then check its types, lint, dependency versions, and native sandbox imports without local tarball overrides.
34
+
33
35
  ## Installation and migration
34
36
 
35
- The `1.0.0-alpha.3` release continues the ChatJS 1.0 alpha series under the `chat-js` package name. Apps are usable, but APIs and generated source may change substantially before 1.0. Use `npx chat-js@alpha` for the examples below. This CLI supports Base UI and Radix with registry `0.2.0-beta.4`.
37
+ The `1.0.0-alpha.5` release continues the ChatJS 1.0 alpha series under the `chat-js` package name. Apps are usable, but APIs and generated source may change substantially before 1.0. Use `npx chat-js@alpha` for the examples below. This CLI supports Base UI and Radix with registry `0.2.0-beta.6`.
36
38
 
37
39
  Pass native shadcn visual options after `--`:
38
40
 
@@ -73,7 +75,7 @@ Existing ChatJS applications need a source migration; upgrading the CLI does not
73
75
 
74
76
  Migrate callers together with primitives. Base UI menu actions use `onClick` and custom triggers use `render`; Radix uses `onSelect` and `asChild`. Passing Radix `onSelect` to a Base UI menu may compile without running the action. Use each library's native composition and ordinary links styled with `buttonVariants` for navigation. Preserve EVE message IDs, scroll anchoring, draft/IME behavior, approval dispatch before specialized renderers, and document revision actions. Verify these flows in your app before removing the old wrappers. Markdown still uses Streamdown; tool-specific renderers remain installed source.
75
77
 
76
- This CLI candidate pins new apps to `@chat-js/registry@0.2.0-beta.4`. Matching registry builds preserve the root Base namespace and add complete `/base/{name}.json` and `/radix/{name}.json` namespaces. Fresh Radix generation selects `/radix/`; item IDs and installation targets remain the same. Subsequent `add` and `sync` retain the configured namespace and check the host's native `base-*` or `radix-*` style before writing source or registrations.
78
+ This CLI candidate pins new apps to `@chat-js/registry@0.2.0-beta.6`. Matching registry builds preserve the root Base namespace and add complete `/base/{name}.json` and `/radix/{name}.json` namespaces. Fresh Radix generation selects `/radix/`; item IDs and installation targets remain the same. Subsequent `add` and `sync` retain the configured namespace and check the host's native `base-*` or `radix-*` style before writing source or registrations.
77
79
 
78
80
  UI-specific plugins and tools declare descriptor `contractVersion: 2` with matching `uiBase: "base"` or `uiBase: "radix"`. A mismatch stops installation; v2 descriptor versions do not prescribe npm major versions. Legacy v1 descriptors remain supported. Existing applications are not automatically migrated between libraries: changing `components.json` or a registry URL alone is insufficient. Keep the compatible registry namespace until migrating primitives and callers together. Publish the matching registry candidate under `beta` before publishing the CLI under `alpha`. The CLI’s `latest` tag also points to the explicitly approved `1.0.0-alpha.2` as an explicit default-install policy; the version remains an alpha until the stable 1.0 launch.
79
81
 
package/dist/index.js CHANGED
@@ -22765,7 +22765,7 @@ import { registrySchema } from "shadcn/schema";
22765
22765
  // ../registry/package.json
22766
22766
  var package_default = {
22767
22767
  name: "@chat-js/registry",
22768
- version: "0.2.0-beta.4",
22768
+ version: "0.2.0-beta.6",
22769
22769
  private: false,
22770
22770
  description: "ChatJS tool and gateway registry items",
22771
22771
  keywords: [
@@ -22811,13 +22811,13 @@ var package_default = {
22811
22811
  "demo:sync": "bun scripts/demo-sync.ts"
22812
22812
  },
22813
22813
  devDependencies: {
22814
- "@ai-sdk/anthropic": "4.0.49",
22815
- "@ai-sdk/gateway": "4.0.110",
22816
- "@ai-sdk/google": "4.0.64",
22817
- "@ai-sdk/mcp": "2.0.73",
22818
- "@ai-sdk/openai": "4.0.59",
22819
- "@ai-sdk/openai-compatible": "3.0.44",
22820
- "@ai-sdk/provider": "4.0.26",
22814
+ "@ai-sdk/anthropic": "4.0.104",
22815
+ "@ai-sdk/gateway": "4.0.145",
22816
+ "@ai-sdk/google": "4.0.120",
22817
+ "@ai-sdk/mcp": "2.0.99",
22818
+ "@ai-sdk/openai": "4.0.117",
22819
+ "@ai-sdk/openai-compatible": "3.0.92",
22820
+ "@ai-sdk/provider": "4.0.38",
22821
22821
  "@better-auth/electron": "1.6.2",
22822
22822
  "@chat-js/gateways": "workspace:*",
22823
22823
  "@chat-js/registry-validation": "workspace:*",
@@ -22837,14 +22837,14 @@ var package_default = {
22837
22837
  "@types/react-dom": "19.2.3",
22838
22838
  "@vercel/blob": "2.4.0",
22839
22839
  "@vercel/oidc": "3.2.0",
22840
- ai: "7.0.137",
22840
+ ai: "7.0.172",
22841
22841
  ajv: "8.18.0",
22842
22842
  "basic-ftp": "^5.0.5",
22843
22843
  "better-auth": "1.6.2",
22844
22844
  "browser-image-compression": "^2.0.2",
22845
22845
  "date-fns": "^4.1.0",
22846
22846
  "drizzle-orm": "^0.45.1",
22847
- eve: "npm:@chat-js/eve@1.0.0-rc.6-chatjs.1",
22847
+ eve: "npm:@chat-js/eve@1.1.1-chatjs.0",
22848
22848
  "files-sdk": "2.5.0",
22849
22849
  geist: "^1.7.2",
22850
22850
  "guarded-fetch": "^0.1.4",
@@ -42549,19 +42549,19 @@ var gatewayMetadata = {
42549
42549
  dependency: "@ai-sdk/gateway",
42550
42550
  exportName: "VercelGateway",
42551
42551
  supportsVideo: true,
42552
- version: "4.0.110"
42552
+ version: "4.0.145"
42553
42553
  },
42554
42554
  openai: {
42555
42555
  dependency: "@ai-sdk/openai",
42556
42556
  exportName: "OpenAIGateway",
42557
42557
  supportsVideo: false,
42558
- version: "4.0.59"
42558
+ version: "4.0.117"
42559
42559
  },
42560
42560
  "openai-compatible": {
42561
42561
  dependency: "@ai-sdk/openai-compatible",
42562
42562
  exportName: "OpenAICompatibleGateway",
42563
42563
  supportsVideo: false,
42564
- version: "3.0.44"
42564
+ version: "3.0.92"
42565
42565
  },
42566
42566
  openrouter: {
42567
42567
  dependency: "@openrouter/ai-sdk-provider",
@@ -42573,13 +42573,13 @@ var gatewayMetadata = {
42573
42573
  dependency: "@ai-sdk/openai-compatible",
42574
42574
  exportName: "LiteLLMGateway",
42575
42575
  supportsVideo: false,
42576
- version: "3.0.44"
42576
+ version: "3.0.92"
42577
42577
  }
42578
42578
  };
42579
42579
  // ../gateways/package.json
42580
42580
  var package_default2 = {
42581
42581
  name: "@chat-js/gateways",
42582
- version: "0.2.0",
42582
+ version: "0.2.2",
42583
42583
  description: "Gateway contracts and shared runtime utilities for ChatJS registry extensions",
42584
42584
  license: "Apache-2.0",
42585
42585
  repository: {
@@ -42654,21 +42654,21 @@ var package_default2 = {
42654
42654
  zod: "^4.3.6"
42655
42655
  },
42656
42656
  devDependencies: {
42657
- "@ai-sdk/anthropic": "4.0.49",
42658
- "@ai-sdk/gateway": "4.0.110",
42659
- "@ai-sdk/google": "4.0.64",
42660
- "@ai-sdk/openai": "4.0.59",
42661
- "@ai-sdk/openai-compatible": "3.0.44",
42662
- "@ai-sdk/provider": "4.0.26",
42657
+ "@ai-sdk/anthropic": "4.0.104",
42658
+ "@ai-sdk/gateway": "4.0.145",
42659
+ "@ai-sdk/google": "4.0.120",
42660
+ "@ai-sdk/openai": "4.0.117",
42661
+ "@ai-sdk/openai-compatible": "3.0.92",
42662
+ "@ai-sdk/provider": "4.0.38",
42663
42663
  "@openrouter/ai-sdk-provider": "3.0.0",
42664
42664
  "@types/node": "^22.8.6",
42665
- ai: "7.0.137",
42665
+ ai: "7.0.172",
42666
42666
  typescript: "6.0.2",
42667
42667
  vitest: "^4.0.0"
42668
42668
  },
42669
42669
  peerDependencies: {
42670
- "@ai-sdk/provider": "4.0.26",
42671
- ai: "7.0.137"
42670
+ "@ai-sdk/provider": "4.0.38",
42671
+ ai: "7.0.172"
42672
42672
  }
42673
42673
  };
42674
42674
 
@@ -43714,7 +43714,7 @@ var registryItems = [
43714
43714
  };
43715
43715
  });
43716
43716
 
43717
- // ../../node_modules/.bun/files-sdk@2.5.0+5c450b3d3f13a71e/node_modules/files-sdk/dist/chunk-yy18c57k.js
43717
+ // ../../node_modules/.bun/files-sdk@2.5.0+03b591c2e2d9211b/node_modules/files-sdk/dist/chunk-yy18c57k.js
43718
43718
  var AWS_S3_PEERS = [
43719
43719
  "@aws-sdk/client-s3",
43720
43720
  "@aws-sdk/s3-presigned-post",
@@ -46545,7 +46545,7 @@ var withRegistryTransport = async (operation) => {
46545
46545
  };
46546
46546
 
46547
46547
  // src/registry/shadcn.ts
46548
- var registryUrl = "https://unpkg.com/@chat-js/registry@0.2.0-beta.4/dist/r/{name}.json";
46548
+ var registryUrl = "https://unpkg.com/@chat-js/registry@0.2.0-beta.6/dist/r/{name}.json";
46549
46549
  var registryConfig = async (cwd) => {
46550
46550
  const config3 = await getRegistriesConfig(cwd);
46551
46551
  const source = await optionalFile(path14.join(cwd, "components.json"));
@@ -50800,7 +50800,7 @@ import path29 from "node:path";
50800
50800
  // package.json
50801
50801
  var package_default3 = {
50802
50802
  name: "chat-js",
50803
- version: "1.0.0-alpha.3",
50803
+ version: "1.0.0-alpha.5",
50804
50804
  private: false,
50805
50805
  description: "CLI for creating and extending ChatJS apps",
50806
50806
  keywords: [
@@ -50843,6 +50843,7 @@ var package_default3 = {
50843
50843
  prepublishOnly: "bun run build && node ./dist/index.js --help >/dev/null",
50844
50844
  "test:native-create": "bash scripts/test-native-create.sh",
50845
50845
  "test:scaffold": "bash scripts/test-scaffold.sh",
50846
+ "test:published": "bash scripts/test-published.sh",
50846
50847
  "test:gateways": "bun run template:sync && bun test --timeout 180000 ./test/gateway-selection.test.ts",
50847
50848
  "test:types": "tsc --noEmit",
50848
50849
  lint: "oxlint . && oxfmt --check .",
@@ -50850,7 +50851,7 @@ var package_default3 = {
50850
50851
  "test:native-agent": "bun test/native-agent-acceptance.ts"
50851
50852
  },
50852
50853
  dependencies: {
50853
- "@chat-js/gateways": "0.2.0",
50854
+ "@chat-js/gateways": "0.2.2",
50854
50855
  "@clack/prompts": "^1.0.1",
50855
50856
  commander: "^14.0.0",
50856
50857
  "files-sdk": "2.5.0",
@@ -50866,7 +50867,7 @@ var package_default3 = {
50866
50867
  "@types/bun": "latest",
50867
50868
  "@types/node": "22.13.10",
50868
50869
  "@vercel/sandbox": "3.3.0",
50869
- eve: "npm:@chat-js/eve@1.0.0-rc.6-chatjs.1",
50870
+ eve: "npm:@chat-js/eve@1.1.1-chatjs.0",
50870
50871
  next: "16.3.0",
50871
50872
  playwright: "^1.59.1",
50872
50873
  png2icons: "^2.0.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-js",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.5",
4
4
  "private": false,
5
5
  "description": "CLI for creating and extending ChatJS apps",
6
6
  "keywords": [
@@ -43,6 +43,7 @@
43
43
  "prepublishOnly": "bun run build && node ./dist/index.js --help >/dev/null",
44
44
  "test:native-create": "bash scripts/test-native-create.sh",
45
45
  "test:scaffold": "bash scripts/test-scaffold.sh",
46
+ "test:published": "bash scripts/test-published.sh",
46
47
  "test:gateways": "bun run template:sync && bun test --timeout 180000 ./test/gateway-selection.test.ts",
47
48
  "test:types": "tsc --noEmit",
48
49
  "lint": "oxlint . && oxfmt --check .",
@@ -50,7 +51,7 @@
50
51
  "test:native-agent": "bun test/native-agent-acceptance.ts"
51
52
  },
52
53
  "dependencies": {
53
- "@chat-js/gateways": "0.2.0",
54
+ "@chat-js/gateways": "0.2.2",
54
55
  "@clack/prompts": "^1.0.1",
55
56
  "commander": "^14.0.0",
56
57
  "files-sdk": "2.5.0",
@@ -66,7 +67,7 @@
66
67
  "@types/bun": "latest",
67
68
  "@types/node": "22.13.10",
68
69
  "@vercel/sandbox": "3.3.0",
69
- "eve": "npm:@chat-js/eve@1.0.0-rc.6-chatjs.1",
70
+ "eve": "npm:@chat-js/eve@1.1.1-chatjs.0",
70
71
  "next": "16.3.0",
71
72
  "playwright": "^1.59.1",
72
73
  "png2icons": "^2.0.1",
@@ -416,7 +416,7 @@ export class MCPClient {
416
416
  throw new Error("Client not connected");
417
417
  }
418
418
  try {
419
- return await client.experimental_listPrompts();
419
+ return await client.listPrompts();
420
420
  } catch (error) {
421
421
  await this.handlePotentialAuthError(error, client);
422
422
  throw error;
@@ -50,13 +50,25 @@ describe("native tool accounting assembly", () => {
50
50
  type: "text",
51
51
  value: "done",
52
52
  });
53
- expect(tool.label?.complete?.({ value: "done" }, receipt)).toBe("done");
54
- expect(tool.label?.delta?.({ value: "done" }, receipt)).toBe("done");
53
+ const label = tool.label === false ? undefined : tool.label;
54
+ expect(label?.complete?.({ value: "done" }, receipt)).toBe("done");
55
+ expect(label?.delta?.({ value: "done" }, receipt)).toBe("done");
55
56
  expect(
56
57
  typeof tool.endsTurn === "function" && (await tool.endsTurn(receipt))
57
58
  ).toBe(true);
58
59
  });
59
60
 
61
+ it("preserves a tool's disabled label", () => {
62
+ const tool = defineTool({
63
+ description: "Example without a label",
64
+ inputSchema: z.object({}),
65
+ execute: () => "done",
66
+ label: false,
67
+ });
68
+
69
+ expect(withToolAccounting(tool, "none").label).toBe(false);
70
+ });
71
+
60
72
  it("retains native failures and prevents execution after cancellation", async () => {
61
73
  const failure = new Error("upstream unavailable");
62
74
  const execute = vi.fn((): string => {
@@ -63,34 +63,35 @@ export const withToolAccounting = <Input, Output extends ToolOutput>(
63
63
  ? async (result) =>
64
64
  result.status === "success" && (await endsTurn(result.output))
65
65
  : endsTurn,
66
- label: label
67
- ? {
68
- start: (input) => label.start(input),
69
- ...(label.delta
70
- ? {
71
- delta: (
72
- input: Readonly<Input>,
73
- result: Readonly<ToolResult<Output>>
74
- ) =>
75
- result.status === "success"
76
- ? (label.delta?.(input, result.output) ??
77
- label.start(input))
78
- : label.start(input),
79
- }
80
- : {}),
81
- ...(label.complete
82
- ? {
83
- complete: (
84
- input: Readonly<Input>,
85
- result: Readonly<ToolResult<Output>>
86
- ) =>
87
- result.status === "success"
88
- ? (label.complete?.(input, result.output) ??
89
- label.start(input))
90
- : label.start(input),
91
- }
92
- : {}),
93
- }
94
- : undefined,
66
+ label:
67
+ label !== undefined && label !== false
68
+ ? {
69
+ start: (input) => label.start(input),
70
+ ...(label.delta
71
+ ? {
72
+ delta: (
73
+ input: Readonly<Input>,
74
+ result: Readonly<ToolResult<Output>>
75
+ ) =>
76
+ result.status === "success"
77
+ ? (label.delta?.(input, result.output) ??
78
+ label.start(input))
79
+ : label.start(input),
80
+ }
81
+ : {}),
82
+ ...(label.complete
83
+ ? {
84
+ complete: (
85
+ input: Readonly<Input>,
86
+ result: Readonly<ToolResult<Output>>
87
+ ) =>
88
+ result.status === "success"
89
+ ? (label.complete?.(input, result.output) ??
90
+ label.start(input))
91
+ : label.start(input),
92
+ }
93
+ : {}),
94
+ }
95
+ : label,
95
96
  });
96
97
  };
@@ -45,11 +45,11 @@
45
45
  "eve:check": "tsx scripts/eve-setup.ts --check"
46
46
  },
47
47
  "dependencies": {
48
- "@ai-sdk/devtools": "1.0.40",
49
- "@ai-sdk/gateway": "4.0.110",
50
- "@ai-sdk/mcp": "2.0.73",
51
- "@ai-sdk/provider": "4.0.26",
52
- "@ai-sdk/provider-utils": "5.0.58",
48
+ "@ai-sdk/devtools": "1.0.75",
49
+ "@ai-sdk/gateway": "4.0.145",
50
+ "@ai-sdk/mcp": "2.0.99",
51
+ "@ai-sdk/provider": "4.0.38",
52
+ "@ai-sdk/provider-utils": "5.0.81",
53
53
  "@base-ui/react": "^1.9.0",
54
54
  "@better-auth/core": "1.6.2",
55
55
  "@better-auth/electron": "1.6.2",
@@ -73,7 +73,7 @@
73
73
  "@vercel/connect": "2.9.2",
74
74
  "@vercel/oidc": "3.2.0",
75
75
  "@workflow/world-postgres": "file:vendor/workflow-world-postgres-5.1.1.tgz",
76
- "ai": "7.0.137",
76
+ "ai": "7.0.172",
77
77
  "ajv": "8.18.0",
78
78
  "better-auth": "1.6.2",
79
79
  "browser-image-compression": "^2.0.2",
@@ -84,7 +84,7 @@
84
84
  "date-fns": "^4.1.0",
85
85
  "dotenv": "^17.2.3",
86
86
  "drizzle-orm": "^0.45.1",
87
- "eve": "npm:@chat-js/eve@1.0.0-rc.6-chatjs.1",
87
+ "eve": "npm:@chat-js/eve@1.1.1-chatjs.0",
88
88
  "fast-deep-equal": "^3.1.3",
89
89
  "files-sdk": "2.5.0",
90
90
  "guarded-fetch": "^0.1.4",
@@ -141,6 +141,9 @@
141
141
  "vitest": "^4.0.0"
142
142
  },
143
143
  "overrides": {
144
+ "@vercel/connect": {
145
+ "eve": "$eve"
146
+ },
144
147
  "commander": "^14.0.0",
145
148
  "files-sdk": {
146
149
  "ai": "$ai"