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
@@ -0,0 +1,16 @@
import { Field, InputType } from "type-graphql";
import { ActionInputAvailability } from "../types/enums";
@InputType()
export class ActionInput {
@Field(() => String)
name: string;
@Field(() => String)
description: string;
@Field(() => String)
jsonSchema: string;
@Field(() => ActionInputAvailability, { nullable: true })
available?: ActionInputAvailability;
}
@@ -0,0 +1,13 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class AgentSessionInput {
@Field(() => String)
agentName: string;
@Field(() => String, { nullable: true })
threadId?: string;
@Field(() => String, { nullable: true })
nodeName?: string;
}
@@ -0,0 +1,13 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class AgentStateInput {
@Field(() => String)
agentName: string;
@Field(() => String)
state: string;
@Field(() => String, { nullable: true })
config?: string;
}
@@ -0,0 +1,16 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class GuardrailsRuleInput {
@Field(() => [String], { nullable: true })
allowList?: string[] = [];
@Field(() => [String], { nullable: true })
denyList?: string[] = [];
}
@InputType()
export class GuardrailsInput {
@Field(() => GuardrailsRuleInput, { nullable: false })
inputValidationRules: GuardrailsRuleInput;
}
@@ -0,0 +1,8 @@
import { Field, InputType } from "type-graphql";
import { GuardrailsInput } from "./cloud-guardrails.input";
@InputType()
export class CloudInput {
@Field(() => GuardrailsInput, { nullable: true })
guardrails?: GuardrailsInput;
}
@@ -0,0 +1,10 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class ContextPropertyInput {
@Field(() => String)
value: string;
@Field(() => String)
description: string;
}
@@ -0,0 +1,10 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class CopilotContextInput {
@Field(() => String)
description: string;
@Field(() => String)
value: string;
}
@@ -0,0 +1,15 @@
import { Field, InputType, Int, createUnionType } from "type-graphql";
const PrimitiveUnion = createUnionType({
name: "Primitive",
types: () => [String, Number, Boolean] as const,
});
@InputType()
export class CustomPropertyInput {
@Field(() => String)
key: string;
@Field(() => PrimitiveUnion)
value: string;
}
@@ -0,0 +1,21 @@
import { Field, InputType } from "type-graphql";
/**
* The extensions input is used to pass additional information to the copilot runtime, specific to a
* service adapter or agent framework.
*/
@InputType()
export class OpenAIApiAssistantAPIInput {
@Field(() => String, { nullable: true })
runId?: string;
@Field(() => String, { nullable: true })
threadId?: string;
}
@InputType()
export class ExtensionsInput {
@Field(() => OpenAIApiAssistantAPIInput, { nullable: true })
openaiAssistantAPI?: OpenAIApiAssistantAPIInput;
}
@@ -0,0 +1,22 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class ForwardedParametersInput {
@Field(() => String, { nullable: true })
model?: string;
@Field(() => Number, { nullable: true })
maxTokens?: number;
@Field(() => [String], { nullable: true })
stop?: string[];
@Field(() => String, { nullable: true })
toolChoice?: String;
@Field(() => String, { nullable: true })
toolChoiceFunctionName?: string;
@Field(() => Number, { nullable: true })
temperature?: number;
}
@@ -0,0 +1,14 @@
import { Field, InputType } from "type-graphql";
import { ActionInput } from "./action.input";
@InputType()
export class FrontendInput {
@Field(() => String, { nullable: true })
toDeprecate_fullContext?: string;
@Field(() => [ActionInput])
actions: ActionInput[];
@Field(() => String, { nullable: true })
url?: string;
}
@@ -0,0 +1,59 @@
import { Field, InputType } from "type-graphql";
import { MessageInput } from "./message.input";
import { FrontendInput } from "./frontend.input";
import { CloudInput } from "./cloud.input";
import { CopilotRequestType } from "../types/enums";
import { ForwardedParametersInput } from "./forwarded-parameters.input";
import { AgentSessionInput } from "./agent-session.input";
import { AgentStateInput } from "./agent-state.input";
import { ExtensionsInput } from "./extensions.input";
import { MetaEventInput } from "./meta-event.input";
import { CopilotContextInput } from "./copilot-context.input";
@InputType()
export class GenerateCopilotResponseMetadataInput {
@Field(() => CopilotRequestType, { nullable: true })
requestType: CopilotRequestType;
}
@InputType()
export class GenerateCopilotResponseInput {
@Field(() => GenerateCopilotResponseMetadataInput, { nullable: false })
metadata: GenerateCopilotResponseMetadataInput;
@Field(() => String, { nullable: true })
threadId?: string;
@Field(() => String, { nullable: true })
runId?: string;
@Field(() => [MessageInput])
messages: MessageInput[];
@Field(() => FrontendInput)
frontend: FrontendInput;
@Field(() => CloudInput, { nullable: true })
cloud?: CloudInput;
@Field(() => ForwardedParametersInput, { nullable: true })
forwardedParameters?: ForwardedParametersInput;
@Field(() => AgentSessionInput, { nullable: true })
agentSession?: AgentSessionInput;
@Field(() => AgentStateInput, { nullable: true })
agentState?: AgentStateInput;
@Field(() => [AgentStateInput], { nullable: true })
agentStates?: AgentStateInput[];
@Field(() => ExtensionsInput, { nullable: true })
extensions?: ExtensionsInput;
@Field(() => [MetaEventInput], { nullable: true })
metaEvents?: MetaEventInput[];
@Field(() => [CopilotContextInput], { nullable: true })
context?: CopilotContextInput[];
}
@@ -0,0 +1,10 @@
import { Field, InputType } from "type-graphql";
@InputType()
export class LoadAgentStateInput {
@Field(() => String)
threadId: string;
@Field(() => String)
agentName: string;
}
@@ -0,0 +1,110 @@
import { Field, InputType } from "type-graphql";
import { MessageRole } from "../types/enums";
import { BaseMessageInput } from "../types/base";
@InputType()
export class TextMessageInput {
@Field(() => String)
content: string;
@Field(() => String, { nullable: true })
parentMessageId?: string;
@Field(() => MessageRole)
role: MessageRole;
}
@InputType()
export class ActionExecutionMessageInput {
@Field(() => String)
name: string;
@Field(() => String)
arguments: string;
@Field(() => String, { nullable: true })
parentMessageId?: string;
@Field(() => String, {
nullable: true,
deprecationReason: "This field will be removed in a future version",
})
scope?: String;
}
@InputType()
export class ResultMessageInput {
@Field(() => String)
actionExecutionId: string;
@Field(() => String)
actionName: string;
@Field(() => String, { nullable: true })
parentMessageId?: string;
@Field(() => String)
result: string;
}
@InputType()
export class AgentStateMessageInput {
@Field(() => String)
threadId: string;
@Field(() => String)
agentName: string;
@Field(() => MessageRole)
role: MessageRole;
@Field(() => String)
state: string;
@Field(() => Boolean)
running: boolean;
@Field(() => String)
nodeName: string;
@Field(() => String)
runId: string;
@Field(() => Boolean)
active: boolean;
}
@InputType()
export class ImageMessageInput {
@Field(() => String)
format: string;
@Field(() => String)
bytes: string;
@Field(() => String, { nullable: true })
parentMessageId?: string;
@Field(() => MessageRole)
role: MessageRole;
}
// GraphQL does not support union types in inputs, so we need to use
// optional fields for the different subtypes.
@InputType()
export class MessageInput extends BaseMessageInput {
@Field(() => TextMessageInput, { nullable: true })
textMessage?: TextMessageInput;
@Field(() => ActionExecutionMessageInput, { nullable: true })
actionExecutionMessage?: ActionExecutionMessageInput;
@Field(() => ResultMessageInput, { nullable: true })
resultMessage?: ResultMessageInput;
@Field(() => AgentStateMessageInput, { nullable: true })
agentStateMessage?: AgentStateMessageInput;
@Field(() => ImageMessageInput, { nullable: true })
imageMessage?: ImageMessageInput;
}
@@ -0,0 +1,18 @@
import { Field, InputType } from "type-graphql";
import { MetaEventName } from "../types/meta-events.type";
import { MessageInput } from "./message.input";
@InputType()
export class MetaEventInput {
@Field(() => MetaEventName)
name: MetaEventName;
@Field(() => String)
value?: string;
@Field(() => String, { nullable: true })
response?: string;
@Field(() => [MessageInput], { nullable: true })
messages?: MessageInput[];
}