Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"eslint.nodePath": "config/eslint-config/node_modules/eslint",
"eslint.workingDirectories": [
{
"mode": "auto"
}
"cSpell.diagnosticLevel": "Warning",
"cSpell.words": [
"arktype",
"autoinstallers",
"Bytedance",
"cozeloop",
"doubao",
"kwargs",
"langchain",
"langgraph",
"langsmith",
"loggable",
"packagejson",
"prefault",
"preinstall",
"ptaas",
"remeda",
"traceparent",
"tracestate",
"vikingdb",
"websockets"
],
"prettier.prettierPath": "config/eslint-config/node_modules/prettier",
"editor.tabSize": 2,
Expand All @@ -18,9 +34,14 @@
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"editor.semanticHighlighting.enabled": false,
"eslint.probe": ["javascript", "typescript"],
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"eslint.nodePath": "config/eslint-config/node_modules/eslint",
"eslint.workingDirectories": [{ "mode": "auto" }],
"search.followSymlinks": false,
"search.useIgnoreFiles": true,
"search.exclude": {
"**/node_modules": true,
"**/pnpm-lock.yaml": true,
Expand Down Expand Up @@ -52,13 +73,9 @@
"**/pnpm-lock.yaml": "plaintext",
"**/*.yml": "yaml"
},
"search.useIgnoreFiles": true,
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"cSpell.diagnosticLevel": "Warning",
"eslint.probe": ["javascript", "typescript"],
"editor.semanticHighlighting.enabled": false,
"javascript.validate.enable": false,
"typescript.tsdk": "config/ts-config/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
Expand All @@ -78,7 +95,6 @@
},
"typescript.validate.enable": true,
"typescript.suggest.autoImports": true,
"emmet.triggerExpansionOnTab": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
Copyright (c) 2026 Bytedance Ltd. and/or its affiliates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 0 additions & 30 deletions cspell.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ci-tools/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
Copyright (c) 2026 Bytedance Ltd. and/or its affiliates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import {
safeJsonParse,
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
declare module 'process' {
global {
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { Command } from 'commander';

Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { Command, Option } from 'commander';

Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type, type Type } from 'arktype';
import { AppType, Domain } from '@larksuiteoapi/node-sdk';
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/send-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { Command } from 'commander';
import { Client } from '@larksuiteoapi/node-sdk';
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/sync-issue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { Command } from 'commander';
import { Client } from '@larksuiteoapi/node-sdk';
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/sync-pr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { Command } from 'commander';
import { Client } from '@larksuiteoapi/node-sdk';
Expand Down
2 changes: 1 addition & 1 deletion packages/ci-tools/src/lark/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export function safeJsonParse<T>(val: string): T | undefined {
if (!val) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
Copyright (c) 2026 Bytedance Ltd. and/or its affiliates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/base-http.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { join } from 'node:path';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/jwt-auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setupServer } from 'msw/node';
import { http, HttpResponse } from 'msw';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/loop-tracer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setupServer } from 'msw/node';
import { http } from 'msw';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/prompt-hub.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setupServer } from 'msw/node';
import { http, passthrough } from 'msw';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/ptaas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

import { join } from 'node:path';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/__mock__/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { readFile } from 'node:fs/promises';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/api/api-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setupBaseHttpMock } from '../__mock__/base-http';
import { simpleConsoleLogger } from '../../src/utils/logger';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/api/http.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import axios from 'axios';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/api/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import nodeFetch from 'node-fetch';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/auth/oauth-jwt.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setupJwtAuthMock } from '../__mock__/jwt-auth';
import { simpleConsoleLogger } from '../../src/utils/logger';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/auth/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { delay, randomStr } from '../../src/auth/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/error/common-error.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import {
PropertyUnprovidedError,
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/error/http-error.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { AxiosError, AxiosHeaders } from 'axios';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/converter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/guard.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/hub.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setTimeout } from 'node:timers/promises';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/ptaas.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

import { setupPTaaSMock } from '../__mock__/ptaas';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/trace.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { serializeTagValue } from '../../src/tracer/utils';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/prompt/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import {
cacheKeyToQuery,
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/tracer/propagation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
/* eslint-disable security/detect-object-injection -- skip */
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/tracer/tags.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { SpanStatusCode, type Span } from '@opentelemetry/api';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/tracer/traceable.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { setTimeout } from 'node:timers/promises';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/utils/common.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
/* eslint-disable @typescript-eslint/no-empty-function -- skip for test */
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/utils/env.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import {
ensureProperty,
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/__tests__/utils/logger.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { createLoopLogger, LoopLoggable } from '../../src/utils/logger';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type AxiosResponseHeaders } from 'axios';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/http.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import './polyfill-async-iterator';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export { getUserAgentHeaders } from './user-agent';
export { ApiClient, DEFAULT_API_BASE_URL } from './client';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- skip
// @ts-nocheck
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import type { AxiosInstance, AxiosRequestConfig } from 'axios';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/user-agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import os from 'node:os';

Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/api-client/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import nodeFetch, { type RequestInit } from 'node-fetch';
import { type AxiosStatic, type CreateAxiosDefaults } from 'axios';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type LoopApiClient } from './types';
import { ApiClient } from './api-client';
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
export { ApiClient, http } from './api-client';
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/prompt/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { type PullPromptReq, type PullPromptResp } from './types/prompt';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/prompt/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

export type LoopContentType =
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/src/api/prompt/types/execute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// Copyright (c) 2026 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT

import { type BaseApiResp } from '../../base';
Expand Down
Loading
Loading