chore: add license header for web

This commit is contained in:
He Tao
2025-04-17 14:26:41 +08:00
parent fd7a803753
commit fd85115f6f
46 changed files with 3332 additions and 3834 deletions

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { env } from "~/env";
import { fetchStream } from "../sse";

View File

@@ -1,2 +1,5 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./chat";
export * from "./types";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import type { Option } from "../messages";
import type { StreamEvent } from "../sse";

View File

@@ -1,2 +1,5 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./types";
export * from "./merge-message";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import type {
ChatEvent,
InterruptEvent,

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export type MessageRole = "user" | "assistant" | "tool";
export interface Message {

View File

@@ -1 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./rehype-split-words-into-spans";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import type { Element, Root, ElementContent } from "hast";
import { visit } from "unist-util-visit";
import type { BuildVisitor } from "unist-util-visit";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export interface StreamEvent {
type: string;
data: object;

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type StreamEvent } from "./StreamEvent";
export async function* fetchStream<T extends StreamEvent>(

View File

@@ -1,2 +1,5 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./fetch-stream";
export * from "./StreamEvent";

View File

@@ -1 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./store";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { parse } from "best-effort-json-parser";
import { nanoid } from "nanoid";
import { create } from "zustand";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export function deepClone<T>(value: T): T {
return JSON.parse(JSON.stringify(value));
}

View File

@@ -1 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export * from "./time";

View File

@@ -1,3 +1,6 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}