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
+29
View File
@@ -0,0 +1,29 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "object",
parameters: [
{
name: "arg",
type: "object[]",
description: "The object argument to display.",
attributes: [
{
name: "x",
type: "string",
description: "The x attribute.",
},
{
name: "y",
type: "number",
description: "The y attribute.",
},
],
},
],
handler: async ({ arg }) => {
const x: string = arg[0].x;
const y: number = arg[0].y;
const z: boolean = arg[0].z;
},
});
+26
View File
@@ -0,0 +1,26 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "enum",
parameters: [
{
name: "arg",
type: "string",
description: "The enum to display.",
enum: ["one", "two", "three"],
},
],
handler: async ({ arg }) => {
switch (arg) {
case "one":
console.log("One");
break;
case "two":
console.log("Two");
break;
default:
const exhaustiveCheck: never = arg;
}
console.log("No args action");
},
});
+8
View File
@@ -0,0 +1,8 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "noargs",
handler: async (args) => {
console.log("No args action");
},
});
+29
View File
@@ -0,0 +1,29 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "object",
parameters: [
{
name: "arg",
type: "object",
description: "The object argument to display.",
attributes: [
{
name: "x",
type: "string",
description: "The x attribute.",
},
{
name: "y",
type: "number",
description: "The y attribute.",
},
],
},
],
handler: async ({ arg }) => {
const x: string = arg.x;
const y: number = arg.y;
const z: boolean = arg.z;
},
});
+17
View File
@@ -0,0 +1,17 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "optional",
parameters: [
{
name: "arg",
type: "string",
description: "The optional argument to display.",
required: false,
},
],
handler: async ({ arg }) => {
// TODO this should fail
let x: string = arg;
},
});
+28
View File
@@ -0,0 +1,28 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "array",
parameters: [
{
name: "arg",
type: "object[]",
description: "The object argument to display.",
attributes: [
{
name: "x",
type: "string",
description: "The x attribute.",
},
{
name: "y",
type: "number",
description: "The y attribute.",
},
],
},
],
handler: async ({ arg }) => {
const x: string = arg[0].x;
const y: number = arg[0].y;
},
});
+29
View File
@@ -0,0 +1,29 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "enum",
parameters: [
{
name: "arg",
type: "string",
description: "The enum to display.",
enum: ["one", "two", "three"],
},
],
handler: async ({ arg }) => {
switch (arg) {
case "one":
console.log("One");
break;
case "two":
console.log("Two");
break;
case "three":
console.log("Three");
break;
default:
const exhaustiveCheck: never = arg;
}
console.log("No args action");
},
});
+8
View File
@@ -0,0 +1,8 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "noargs",
handler: async () => {
console.log("No args action");
},
});
+28
View File
@@ -0,0 +1,28 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "object",
parameters: [
{
name: "arg",
type: "object",
description: "The object argument to display.",
attributes: [
{
name: "x",
type: "string",
description: "The x attribute.",
},
{
name: "y",
type: "number",
description: "The y attribute.",
},
],
},
],
handler: async ({ arg }) => {
const x: string = arg.x;
const y: number = arg.y;
},
});
+20
View File
@@ -0,0 +1,20 @@
import { useCopilotAction } from "@copilotkit/react-core";
useCopilotAction({
name: "optional",
parameters: [
{
name: "arg",
type: "string",
description: "The optional argument to display.",
required: false,
},
],
handler: async ({ arg }) => {
let x: string = "y";
if (arg !== undefined) {
x = arg;
}
},
});