chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:58:18 +08:00
commit 6d5d58c1a9
18293 changed files with 3502153 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
{
"name": "node-express",
"version": "1.4.10-next.0",
"private": true,
"scripts": {
"example-start": "node dist/index.js",
"example-dev": "nodemon ./src/index.ts"
},
"dependencies": {
"@copilotkit/runtime": "workspace:*",
"@copilotkit/shared": "workspace:*",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^4.19.2",
"openai": "^4.85.1"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^18.11.17",
"nodemon": "^3.1.3",
"ts-node": "^10.9.2",
"tsconfig": "workspace:*",
"typescript": "^5.2.3"
}
}
+63
View File
@@ -0,0 +1,63 @@
import express from "express";
import * as dotenv from "dotenv";
dotenv.config();
import {
CopilotRuntime,
OpenAIAdapter,
copilotRuntimeNodeExpressEndpoint,
} from "@copilotkit/runtime";
import OpenAI from "openai";
import { BuiltInAgent } from "@copilotkit/runtime/v2";
import cors from "cors";
const openai = new OpenAI();
const serviceAdapter = new OpenAIAdapter({ openai: openai as any });
const runtime = new CopilotRuntime({
agents: {
default: new BuiltInAgent({ model: "openai/gpt-4o-mini" }),
},
actions: [
{
name: "sayHello",
description: "say hello so someone by roasting their name",
parameters: [
{
name: "roast",
description: "A sentence or two roasting the name of the person",
type: "string",
required: true,
},
],
handler: ({ roast }: { roast: string }) => {
console.log(roast);
return "The person has been roasted.";
},
},
],
});
const copilotRuntime = copilotRuntimeNodeExpressEndpoint({
endpoint: "/",
runtime,
serviceAdapter,
});
const app = express();
app.use(
cors({
origin: "*",
methods: ["GET", "POST", "OPTIONS", "PUT", "DELETE", "PATCH"],
allowedHeaders: ["*"],
}),
);
// Uncomment this line to parse the request body
// app.use(express.json());
app.use("/copilotkit", copilotRuntime);
app.listen(4000, () => {
console.log("Listening at http://localhost:4000/copilotkit");
});
+20
View File
@@ -0,0 +1,20 @@
{
"extends": "../../../packages/tsconfig/base.json",
"compilerOptions": {
"strictNullChecks": true,
"outDir": "dist",
"moduleResolution": "node16",
"module": "Node16",
"baseUrl": "."
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"paths": {
"@/*": ["./src/*"],
"@copilotkit/react-core/*": ["../../packages/react-core/*"],
"@copilotkit/react-ui/*": ["../../packages/react-ui/*"],
"@copilotkit/react-textarea/*": ["../../packages/react-textarea/*"],
"@copilotkit/runtime/*": ["../../packages/runtime/*"],
"@copilotkit/runtime/v2/*": ["../../packages/runtime/src/v2/*"]
}
}