chat-js 1.0.0-alpha.4 → 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 +2 -2
- package/dist/index.js +29 -29
- package/package.json +3 -3
- package/templates/chat-app/chatjs/plugins/mcp/oauth/mcp-client.ts +1 -1
- package/templates/chat-app/lib/eve/tool-accounting.test.ts +14 -2
- package/templates/chat-app/lib/eve/tool-accounting.ts +30 -29
- package/templates/chat-app/package.json +10 -7
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ After publication, run `bun --filter chat-js test:published` to create an app us
|
|
|
34
34
|
|
|
35
35
|
## Installation and migration
|
|
36
36
|
|
|
37
|
-
The `1.0.0-alpha.
|
|
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`.
|
|
38
38
|
|
|
39
39
|
Pass native shadcn visual options after `--`:
|
|
40
40
|
|
|
@@ -75,7 +75,7 @@ Existing ChatJS applications need a source migration; upgrading the CLI does not
|
|
|
75
75
|
|
|
76
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.
|
|
77
77
|
|
|
78
|
-
This CLI candidate pins new apps to `@chat-js/registry@0.2.0-beta.
|
|
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.
|
|
79
79
|
|
|
80
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.
|
|
81
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.
|
|
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.
|
|
22815
|
-
"@ai-sdk/gateway": "4.0.
|
|
22816
|
-
"@ai-sdk/google": "4.0.
|
|
22817
|
-
"@ai-sdk/mcp": "2.0.
|
|
22818
|
-
"@ai-sdk/openai": "4.0.
|
|
22819
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
22820
|
-
"@ai-sdk/provider": "4.0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
42658
|
-
"@ai-sdk/gateway": "4.0.
|
|
42659
|
-
"@ai-sdk/google": "4.0.
|
|
42660
|
-
"@ai-sdk/openai": "4.0.
|
|
42661
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
42662
|
-
"@ai-sdk/provider": "4.0.
|
|
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.
|
|
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.
|
|
42671
|
-
ai: "7.0.
|
|
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+
|
|
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.
|
|
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.
|
|
50803
|
+
version: "1.0.0-alpha.5",
|
|
50804
50804
|
private: false,
|
|
50805
50805
|
description: "CLI for creating and extending ChatJS apps",
|
|
50806
50806
|
keywords: [
|
|
@@ -50851,7 +50851,7 @@ var package_default3 = {
|
|
|
50851
50851
|
"test:native-agent": "bun test/native-agent-acceptance.ts"
|
|
50852
50852
|
},
|
|
50853
50853
|
dependencies: {
|
|
50854
|
-
"@chat-js/gateways": "0.2.
|
|
50854
|
+
"@chat-js/gateways": "0.2.2",
|
|
50855
50855
|
"@clack/prompts": "^1.0.1",
|
|
50856
50856
|
commander: "^14.0.0",
|
|
50857
50857
|
"files-sdk": "2.5.0",
|
|
@@ -50867,7 +50867,7 @@ var package_default3 = {
|
|
|
50867
50867
|
"@types/bun": "latest",
|
|
50868
50868
|
"@types/node": "22.13.10",
|
|
50869
50869
|
"@vercel/sandbox": "3.3.0",
|
|
50870
|
-
eve: "npm:@chat-js/eve@1.
|
|
50870
|
+
eve: "npm:@chat-js/eve@1.1.1-chatjs.0",
|
|
50871
50871
|
next: "16.3.0",
|
|
50872
50872
|
playwright: "^1.59.1",
|
|
50873
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
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI for creating and extending ChatJS apps",
|
|
6
6
|
"keywords": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test:native-agent": "bun test/native-agent-acceptance.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@chat-js/gateways": "0.2.
|
|
54
|
+
"@chat-js/gateways": "0.2.2",
|
|
55
55
|
"@clack/prompts": "^1.0.1",
|
|
56
56
|
"commander": "^14.0.0",
|
|
57
57
|
"files-sdk": "2.5.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@types/bun": "latest",
|
|
68
68
|
"@types/node": "22.13.10",
|
|
69
69
|
"@vercel/sandbox": "3.3.0",
|
|
70
|
-
"eve": "npm:@chat-js/eve@1.
|
|
70
|
+
"eve": "npm:@chat-js/eve@1.1.1-chatjs.0",
|
|
71
71
|
"next": "16.3.0",
|
|
72
72
|
"playwright": "^1.59.1",
|
|
73
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.
|
|
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
|
-
|
|
54
|
-
expect(
|
|
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:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
label.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
label.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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.
|
|
49
|
-
"@ai-sdk/gateway": "4.0.
|
|
50
|
-
"@ai-sdk/mcp": "2.0.
|
|
51
|
-
"@ai-sdk/provider": "4.0.
|
|
52
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
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.
|
|
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.
|
|
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"
|