Skip to content

Commit f37f8bc

Browse files
authored
Implement threading with AG-UI and move sqlite-runner to a package (#24)
1 parent 43ea5e2 commit f37f8bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2915
-4811
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ storybook-static
4646
# Angular
4747
.angular/
4848
.playwright-mcp/
49+
50+
.pnpm-store

apps/angular/demo-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "node --env-file=.env --loader tsx src/index.ts"
99
},
1010
"dependencies": {
11-
"@ag-ui/client": "0.0.40-alpha.3",
11+
"@ag-ui/client": "0.0.40-alpha.6",
1212
"@ag-ui/langgraph": "^0.0.11",
1313
"@copilotkitnext/demo-agents": "workspace:^",
1414
"@copilotkitnext/runtime": "workspace:^",

apps/angular/demo-server/src/index.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import { serve } from "@hono/node-server";
22
import { Hono } from "hono";
33
import { cors } from "hono/cors";
4-
import { CopilotRuntime, createCopilotEndpoint, InMemoryAgentRunner } from "@copilotkitnext/runtime";
5-
import { OpenAIAgent, SlowToolCallStreamingAgent } from "@copilotkitnext/demo-agents";
4+
import {
5+
CopilotRuntime,
6+
createCopilotEndpoint,
7+
InMemoryAgentRunner,
8+
} from "@copilotkitnext/runtime";
9+
import {
10+
OpenAIAgent,
11+
SlowToolCallStreamingAgent,
12+
} from "@copilotkitnext/demo-agents";
613

714
const runtime = new CopilotRuntime({
815
agents: {
916
// @ts-ignore
10-
default: new OpenAIAgent(),
17+
default: new SlowToolCallStreamingAgent(),
1118
},
1219
runner: new InMemoryAgentRunner(),
1320
});
@@ -25,7 +32,7 @@ app.use(
2532
exposeHeaders: ["Content-Type"],
2633
credentials: true,
2734
maxAge: 86400,
28-
}),
35+
})
2936
);
3037

3138
// Create the CopilotKit endpoint
@@ -39,4 +46,6 @@ app.route("/", copilotApp);
3946

4047
const port = Number(process.env.PORT || 3001);
4148
serve({ fetch: app.fetch, port });
42-
console.log(`CopilotKit runtime listening at http://localhost:${port}/api/copilotkit`);
49+
console.log(
50+
`CopilotKit runtime listening at http://localhost:${port}/api/copilotkit`
51+
);

apps/angular/demo/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@copilotkitnext/angular": "workspace:*",
2323
"rxjs": "^7.8.1",
2424
"tslib": "^2.8.1",
25-
"zod": "^3.25.75",
2625
"zone.js": "^0.14.0"
2726
},
2827
"devDependencies": {

apps/angular/demo/src/app/app.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApplicationConfig, importProvidersFrom } from "@angular/core";
22
import { BrowserModule } from "@angular/platform-browser";
3-
import { provideCopilotKit, provideCopilotChatLabels } from "@copilotkitnext/angular";
3+
import {
4+
provideCopilotKit,
5+
provideCopilotChatLabels,
6+
} from "@copilotkitnext/angular";
47
import { WildcardToolRenderComponent } from "./components/wildcard-tool-render.component";
5-
import { helloWorldToolConfig } from "./tools/hello-world";
68

79
export const appConfig: ApplicationConfig = {
810
providers: [
@@ -15,12 +17,13 @@ export const appConfig: ApplicationConfig = {
1517
component: WildcardToolRenderComponent,
1618
} as any,
1719
],
18-
frontendTools: [helloWorldToolConfig],
20+
frontendTools: [],
1921
humanInTheLoop: [],
2022
}),
2123
provideCopilotChatLabels({
2224
chatInputPlaceholder: "Ask me anything...",
23-
chatDisclaimerText: "CopilotKit Angular Demo - AI responses may need verification.",
25+
chatDisclaimerText:
26+
"CopilotKit Angular Demo - AI responses may need verification.",
2427
}),
2528
],
2629
};

apps/angular/demo/src/app/tools/hello-world.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

apps/angular/storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"storybook:build": "ng run storybook-angular:build-storybook"
1010
},
1111
"dependencies": {
12-
"@ag-ui/client": "0.0.40-alpha.3",
12+
"@ag-ui/client": "0.0.40-alpha.6",
1313
"@angular/animations": "^18.2.0",
1414
"@angular/common": "^18.2.0",
1515
"@angular/compiler": "^18.2.0",

apps/react/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@ag-ui/client": "0.0.40-alpha.3",
12+
"@ag-ui/client": "0.0.40-alpha.6",
1313
"@copilotkitnext/agent": "workspace:*",
1414
"@copilotkitnext/core": "workspace:*",
1515
"@copilotkitnext/react": "workspace:*",

apps/react/demo/src/app/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"use client";
22

3-
import { HttpAgent } from "@ag-ui/client";
43
import {
54
CopilotChat,
65
CopilotKitProvider,
76
useFrontendTool,
87
defineToolCallRenderer,
98
useConfigureSuggestions,
10-
type ToolsMenuItem,
119
} from "@copilotkitnext/react";
10+
import type { ToolsMenuItem } from "@copilotkitnext/react";
1211
import { z } from "zod";
1312
import { useMemo } from "react";
1413

@@ -76,7 +75,7 @@ function Chat() {
7675
return `Hello ${name}`;
7776
},
7877
});
79-
const toolsMenu = useMemo<("-" | ToolsMenuItem)[]>(
78+
const toolsMenu = useMemo<(ToolsMenuItem | "-")[]>(
8079
() => [
8180
{
8281
label: "Say hi to CopilotKit",
@@ -108,5 +107,5 @@ function Chat() {
108107
[],
109108
);
110109

111-
return <CopilotChat inputProps={{ toolsMenu }} />;
110+
return <CopilotChat inputProps={{ toolsMenu }} threadId="xyz" />;
112111
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "CopilotKitNext",
33
"private": true,
44
"scripts": {
5-
"predev": "turbo run build --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent'",
5+
"predev": "turbo run build --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent' --filter='@copilotkitnext/sqlite-runner'",
66
"build": "turbo run build",
77
"clean": "turbo run clean",
8-
"dev": "turbo run dev --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent' --concurrency=15",
9-
"dev:packages": "turbo run dev --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent'",
8+
"dev": "turbo run dev --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/sqlite-runner' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent' --concurrency=15",
9+
"dev:packages": "turbo run dev --filter='@copilotkitnext/core' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/sqlite-runner' --filter='@copilotkitnext/react' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/agent'",
1010
"demo:angular": "turbo run dev --filter='@copilotkitnext/angular-demo-server' --filter='@copilotkitnext/angular-demo'",
1111
"storybook:angular": "pnpm -C apps/angular/storybook dev",
1212
"demo:react": "pnpm -C apps/react/demo dev",
@@ -22,9 +22,9 @@
2222
"storybook": "pnpm storybook:react",
2323
"storybook:all": "echo 'Run storybooks in separate terminals: pnpm storybook:react | pnpm storybook:angular'",
2424
"build-storybook": "turbo run build --filter=storybook --filter=storybook-angular",
25-
"bump:prerelease": "pnpm -r --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' exec pnpm version prerelease --preid=alpha",
26-
"bump:release": "pnpm -r --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' exec pnpm version patch",
27-
"publish:prerelease": "pnpm -r clean && pnpm install && turbo build && pnpm publish -r --no-git-checks --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --tag alpha",
25+
"bump:prerelease": "pnpm -r --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/sqlite-runner' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' exec pnpm version prerelease --preid=alpha",
26+
"bump:release": "pnpm -r --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/sqlite-runner' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' exec pnpm version patch",
27+
"publish:prerelease": "pnpm -r clean && pnpm install && turbo build && pnpm publish -r --no-git-checks --filter='@copilotkitnext/agent' --filter='@copilotkitnext/angular' --filter='@copilotkitnext/core' --filter='@copilotkitnext/react' --filter='@copilotkitnext/runtime' --filter='@copilotkitnext/sqlite-runner' --filter='@copilotkitnext/shared' --filter='@copilotkitnext/web-inspector' --tag alpha",
2828
"publish:release:dry": "pnpm -r --filter '@copilotkitnext/*' publish --access public --dry-run",
2929
"publish:release": "pnpm -r --filter '@copilotkitnext/*' publish --access public"
3030
},

0 commit comments

Comments
 (0)