@lark-base-open/base-database-cli 1.1.1 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/LICENSE +6 -0
- package/README.md +47 -27
- package/dist/ai-functions.d.ts +53 -0
- package/dist/ai-functions.d.ts.map +1 -0
- package/dist/ai-functions.js +436 -0
- package/dist/ai-functions.js.map +1 -0
- package/dist/archive.d.ts +21 -0
- package/dist/archive.d.ts.map +1 -1
- package/dist/archive.js +69 -10
- package/dist/archive.js.map +1 -1
- package/dist/auth.d.ts +5 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +26 -3
- package/dist/auth.js.map +1 -1
- package/dist/check.d.ts +74 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +283 -0
- package/dist/check.js.map +1 -0
- package/dist/dependency-policy.d.ts +10 -0
- package/dist/dependency-policy.d.ts.map +1 -0
- package/dist/dependency-policy.js +162 -0
- package/dist/dependency-policy.js.map +1 -0
- package/dist/deploy.d.ts +5 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +141 -176
- package/dist/deploy.js.map +1 -1
- package/dist/environment-variables.d.ts +52 -0
- package/dist/environment-variables.d.ts.map +1 -0
- package/dist/environment-variables.js +563 -0
- package/dist/environment-variables.js.map +1 -0
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/environment.js.map +1 -1
- package/dist/function-input-types.d.ts +10 -0
- package/dist/function-input-types.d.ts.map +1 -0
- package/dist/function-input-types.js +160 -0
- package/dist/function-input-types.js.map +1 -0
- package/dist/function-schema.d.ts.map +1 -1
- package/dist/function-schema.js +89 -36
- package/dist/function-schema.js.map +1 -1
- package/dist/init-field-retry.d.ts +17 -0
- package/dist/init-field-retry.d.ts.map +1 -0
- package/dist/init-field-retry.js +127 -0
- package/dist/init-field-retry.js.map +1 -0
- package/dist/init-journal.d.ts +98 -0
- package/dist/init-journal.d.ts.map +1 -0
- package/dist/init-journal.js +492 -0
- package/dist/init-journal.js.map +1 -0
- package/dist/init-schema.d.ts +8 -0
- package/dist/init-schema.d.ts.map +1 -0
- package/dist/init-schema.js +423 -0
- package/dist/init-schema.js.map +1 -0
- package/dist/init.d.ts +15 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +884 -261
- package/dist/init.js.map +1 -1
- package/dist/lark-cli-error.d.ts +47 -0
- package/dist/lark-cli-error.d.ts.map +1 -0
- package/dist/lark-cli-error.js +201 -0
- package/dist/lark-cli-error.js.map +1 -0
- package/dist/lark-cli.d.ts +1 -1
- package/dist/lark-cli.d.ts.map +1 -1
- package/dist/lark-cli.js +78 -18
- package/dist/lark-cli.js.map +1 -1
- package/dist/mutation-schema.d.ts +146 -0
- package/dist/mutation-schema.d.ts.map +1 -0
- package/dist/mutation-schema.js +153 -0
- package/dist/mutation-schema.js.map +1 -0
- package/dist/mutation.d.ts +10 -0
- package/dist/mutation.d.ts.map +1 -0
- package/dist/mutation.js +131 -0
- package/dist/mutation.js.map +1 -0
- package/dist/npm.d.ts +1 -0
- package/dist/npm.d.ts.map +1 -1
- package/dist/npm.js +2 -2
- package/dist/npm.js.map +1 -1
- package/dist/preview-receipt.d.ts.map +1 -1
- package/dist/preview-receipt.js +15 -5
- package/dist/preview-receipt.js.map +1 -1
- package/dist/process.d.ts +3 -1
- package/dist/process.d.ts.map +1 -1
- package/dist/process.js +16 -4
- package/dist/process.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +246 -42
- package/dist/program.js.map +1 -1
- package/dist/project-build.d.ts +25 -0
- package/dist/project-build.d.ts.map +1 -0
- package/dist/project-build.js +229 -0
- package/dist/project-build.js.map +1 -0
- package/dist/project-context.d.ts +344 -0
- package/dist/project-context.d.ts.map +1 -0
- package/dist/project-context.js +485 -0
- package/dist/project-context.js.map +1 -0
- package/dist/project-layout.d.ts +5 -0
- package/dist/project-layout.d.ts.map +1 -0
- package/dist/project-layout.js +24 -0
- package/dist/project-layout.js.map +1 -0
- package/dist/public-sql-error.d.ts +25 -0
- package/dist/public-sql-error.d.ts.map +1 -0
- package/dist/public-sql-error.js +65 -0
- package/dist/public-sql-error.js.map +1 -0
- package/dist/pull.d.ts +1 -0
- package/dist/pull.d.ts.map +1 -1
- package/dist/pull.js +67 -15
- package/dist/pull.js.map +1 -1
- package/dist/site-readme.d.ts +3 -0
- package/dist/site-readme.d.ts.map +1 -0
- package/dist/site-readme.js +83 -0
- package/dist/site-readme.js.map +1 -0
- package/dist/workspace-fingerprint.d.ts +21 -1
- package/dist/workspace-fingerprint.d.ts.map +1 -1
- package/dist/workspace-fingerprint.js +81 -2
- package/dist/workspace-fingerprint.js.map +1 -1
- package/package.json +2 -1
- package/skills/lark-base-database/SKILL.md +86 -52
- package/skills/lark-base-database/references/ai-function.md +479 -0
- package/skills/lark-base-database/references/base-capability-routing.md +7 -7
- package/skills/lark-base-database/references/base-sql-errors.generated.md +403 -0
- package/skills/lark-base-database/references/database-function-limitations.md +29 -0
- package/skills/lark-base-database/references/database-function.md +323 -0
- package/skills/lark-base-database/references/development.md +166 -33
- package/skills/lark-base-database/references/environment-variables.md +55 -0
- package/skills/lark-base-database/references/faas.md +46 -53
- package/skills/lark-base-database/references/file-transfer.md +25 -25
- package/skills/lark-base-database/references/frontend-design-guide.md +151 -65
- package/skills/lark-base-database/references/mutations.md +295 -0
- package/skills/lark-base-database/references/notifications.md +9 -9
- package/skills/lark-base-database/references/permission-design.md +24 -24
- package/skills/lark-base-database/references/release.md +57 -30
- package/skills/lark-base-database/references/style-guide.md +10 -67
- package/skills/lark-base-database/references/verification.md +19 -13
- package/skills/lark-base-database/references/workspace.md +57 -17
- package/templates/database-starter/README.md +34 -4
- package/templates/database-starter/database-functions/README.md +8 -0
- package/templates/database-starter/gitignore +7 -0
- package/templates/database-starter/mutations/README.md +19 -0
- package/templates/database-starter/page/README.md +25 -19
- package/templates/database-starter/page/package-lock.json +8 -16
- package/templates/database-starter/page/package.json +2 -3
- package/templates/database-starter/page/src/App.tsx +23 -3
- package/templates/database-starter/page/src/components/UserSelectorEditor/index.tsx +32 -4
- package/templates/database-starter/page/src/components/UserSelectorPanel/index.tsx +104 -34
- package/templates/database-starter/page/src/components/UserSelectorPanel/user-search.test.ts +55 -11
- package/templates/database-starter/page/src/components/UserSelectorPanel/user-search.ts +68 -25
- package/templates/database-starter/page/src/components/database-runtime-ready.tsx +1 -1
- package/templates/database-starter/page/src/components/database-user-menu/index.tsx +4 -7
- package/templates/database-starter/page/src/components/feedback/page-state.tsx +40 -5
- package/templates/database-starter/page/src/components/floating-button/assets/edit-active.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/assets/edit-default.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/assets/toast-close.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/assets/toast-info.svg +5 -0
- package/templates/database-starter/page/src/components/floating-button/assets/tooltip-caret.svg +3 -0
- package/templates/database-starter/page/src/components/floating-button/index.tsx +193 -113
- package/templates/database-starter/page/src/components/floating-button/utils/project-meta.test.ts +107 -37
- package/templates/database-starter/page/src/components/floating-button/utils/project-meta.ts +13 -50
- package/templates/database-starter/page/src/components/ui-language.test.tsx +101 -0
- package/templates/database-starter/page/src/examples/ai-function/ImageTaskOperation.tsx +202 -0
- package/templates/database-starter/page/src/examples/ai-function/README.md +14 -0
- package/templates/database-starter/page/src/examples/ai-function/TextStreamOperation.tsx +184 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-copy.ts +173 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-delta.test.ts +30 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-delta.ts +26 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-language.test.tsx +86 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-media-panel.test.ts +201 -0
- package/templates/database-starter/page/src/examples/ai-function/ai-media-panel.tsx +382 -0
- package/templates/database-starter/page/src/lib/attachment-image.tsx +144 -0
- package/templates/database-starter/page/src/lib/database-function-inputs.generated.ts +4 -0
- package/templates/database-starter/page/src/lib/database-runtime-attachment.test.ts +180 -76
- package/templates/database-starter/page/src/lib/database-runtime.test.ts +130 -10
- package/templates/database-starter/page/src/lib/database-runtime.ts +484 -51
- package/templates/database-starter/page/src/lib/date-time.ts +61 -0
- package/templates/database-starter/page/src/lib/ui-language.ts +86 -0
- package/templates/database-starter/page/src/main.tsx +1 -1
- package/templates/database-starter/page/tsconfig.json +2 -2
- package/templates/database-starter/page/vite.config.ts +1 -2
- package/templates/database-starter/prettierignore +1 -1
- package/templates/database-starter/server-functions/README.md +2 -2
- package/templates/database-starter/server-functions/package-lock.json +4 -4
- package/templates/database-starter/server-functions/package.json +1 -1
- package/dist/agent-guide.d.ts +0 -19
- package/dist/agent-guide.d.ts.map +0 -1
- package/dist/agent-guide.js +0 -31
- package/dist/agent-guide.js.map +0 -1
- package/dist/database-skill.d.ts +0 -24
- package/dist/database-skill.d.ts.map +0 -1
- package/dist/database-skill.js +0 -148
- package/dist/database-skill.js.map +0 -1
- package/skills/lark-base-database/references/base-sql-unsupported.md +0 -42
- package/skills/lark-base-database/references/database-capability-skill.md +0 -40
- package/skills/lark-base-database/references/sql-function.md +0 -289
- package/templates/database-capability/SKILL.md.tmpl +0 -58
- package/templates/database-starter/page/src/components/floating-button/chatbot-entry.test.ts +0 -23
- package/templates/database-starter/page/src/components/floating-button/chatbot-entry.tsx +0 -873
- package/templates/database-starter/page/src/components/floating-button/local-chat-panel.test.ts +0 -25
- package/templates/database-starter/page/src/components/floating-button/local-chat-panel.tsx +0 -197
- package/templates/database-starter/page/src/components/floating-button/utils/env.ts +0 -18
- package/templates/database-starter/sql/README.md +0 -8
package/templates/database-starter/page/src/components/floating-button/local-chat-panel.test.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { resolvePanelSessionKey } from './local-chat-panel'
|
|
3
|
-
|
|
4
|
-
describe('resolvePanelSessionKey', () => {
|
|
5
|
-
it('只由 chatbotId 决定会话身份', () => {
|
|
6
|
-
expect(resolvePanelSessionKey({ chatbotId: 'cb-1' })).toBe('cb-1')
|
|
7
|
-
expect(resolvePanelSessionKey({ chatbotId: 'cb-2' })).not.toBe(
|
|
8
|
-
resolvePanelSessionKey({ chatbotId: 'cb-1' }),
|
|
9
|
-
)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
// 回归:拖拽侧边栏时父组件每帧重渲染,展示属性(含每次新建的 onClose)
|
|
13
|
-
// 若进入挂载依赖,面板会逐帧 unmount + mount 并重复拉取 history/list。
|
|
14
|
-
it('展示属性变化不改变会话身份', () => {
|
|
15
|
-
const base = resolvePanelSessionKey({ chatbotId: 'cb-1' })
|
|
16
|
-
const withOtherDisplayProps = resolvePanelSessionKey({
|
|
17
|
-
chatbotId: 'cb-1',
|
|
18
|
-
chatbotName: '换了名字',
|
|
19
|
-
chatbotIconUrl: 'https://example.com/other.png',
|
|
20
|
-
baseId: 'base-token',
|
|
21
|
-
onClose: () => undefined,
|
|
22
|
-
} as { chatbotId: string })
|
|
23
|
-
expect(withOtherDisplayProps).toBe(base)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { getDatabaseContext } from '../../lib/database-runtime'
|
|
3
|
-
|
|
4
|
-
/** 面板 IIFE 产物暴露的全局挂载接口(base-site-chat-panel 包)。 */
|
|
5
|
-
interface ChatPanelMountProps {
|
|
6
|
-
projectId: string
|
|
7
|
-
chatbotId?: string
|
|
8
|
-
chatbotName?: string
|
|
9
|
-
chatbotCount?: number
|
|
10
|
-
/** chatbot 自己的图标地址,面板 header 与欢迎页使用。 */
|
|
11
|
-
chatbotIconUrl?: string
|
|
12
|
-
/** 绑定的 Base token,面板新建会话时通知服务端重置需要。 */
|
|
13
|
-
baseId?: string
|
|
14
|
-
/** 面板 header 的关闭按钮回调(Figma 95-195885 右上角功能区)。 */
|
|
15
|
-
onClose?: () => void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ChatPanelSdk {
|
|
19
|
-
mount: (container: Element, props: ChatPanelMountProps) => void
|
|
20
|
-
/** 就地更新展示属性,不重建会话。旧版本产物可能没有这个方法。 */
|
|
21
|
-
update?: (container: Element, props: ChatPanelMountProps) => void
|
|
22
|
-
unmount: (container: Element) => void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare global {
|
|
26
|
-
interface Window {
|
|
27
|
-
__SITE_CHATBOT_SDK__?: ChatPanelSdk
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** 面板产物(base-site-chat-panel)的 CDN 目录。
|
|
32
|
-
*
|
|
33
|
-
* 面板包按「构建产物发 CDN + 应用静态引用」分发:产物一份托管在 Eden CDN 的
|
|
34
|
-
* base-site 团队空间,所有应用共享,应用 Artifact 不再携带 ~4MB 产物。
|
|
35
|
-
* 更新产物时上传到新的版本目录并同步修改此常量。 */
|
|
36
|
-
const PANEL_CDN_BASE =
|
|
37
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/lapz-lzhi/ljhwZthlaukjlkulzlp/base-site-chat-panel/0.0.1-alpha.45'
|
|
38
|
-
|
|
39
|
-
let sdkPromise: Promise<ChatPanelSdk | null> | null = null
|
|
40
|
-
|
|
41
|
-
/** 惰性加载面板产物。
|
|
42
|
-
*
|
|
43
|
-
* 面板自带 React 18 与全部 chatbot-sdk 依赖(隔离 bundle),应用只提供容器 DOM;
|
|
44
|
-
* 产物统一从 CDN 加载,所有应用共享同一份,与应用自身的托管路径无关。
|
|
45
|
-
*/
|
|
46
|
-
function loadChatPanelSdk(): Promise<ChatPanelSdk | null> {
|
|
47
|
-
if (window.__SITE_CHATBOT_SDK__) {
|
|
48
|
-
return Promise.resolve(window.__SITE_CHATBOT_SDK__)
|
|
49
|
-
}
|
|
50
|
-
if (!sdkPromise) {
|
|
51
|
-
sdkPromise = new Promise((resolve) => {
|
|
52
|
-
const stylesheet = document.createElement('link')
|
|
53
|
-
stylesheet.rel = 'stylesheet'
|
|
54
|
-
stylesheet.href = `${PANEL_CDN_BASE}/panel.css`
|
|
55
|
-
document.head.append(stylesheet)
|
|
56
|
-
|
|
57
|
-
const script = document.createElement('script')
|
|
58
|
-
script.src = `${PANEL_CDN_BASE}/panel.js`
|
|
59
|
-
script.onload = () => resolve(window.__SITE_CHATBOT_SDK__ ?? null)
|
|
60
|
-
script.onerror = () => resolve(null)
|
|
61
|
-
document.head.append(script)
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
return sdkPromise
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface LocalChatPanelProps {
|
|
68
|
-
chatbotId: string
|
|
69
|
-
chatbotName: string
|
|
70
|
-
/** 应用一共绑定了几个 chatbot。面板据此决定名称右边要不要出切换三角。 */
|
|
71
|
-
chatbotCount?: number
|
|
72
|
-
/** 面板产物缺失或加载失败时的回落渲染(如旧版 agent 页 iframe)。 */
|
|
73
|
-
fallback?: React.ReactNode
|
|
74
|
-
/** chatbot 自己的图标地址(由 iconInfo 解析)。 */
|
|
75
|
-
chatbotIconUrl?: string
|
|
76
|
-
/** 绑定的 Base token(projectMeta.baseBindings[0].baseToken)。 */
|
|
77
|
-
baseId?: string
|
|
78
|
-
/** 关闭侧边栏。面板 header 的关闭按钮会调用它(Figma 95-195885)。 */
|
|
79
|
-
onClose?: () => void
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** 面板会话身份。只有它变化才需要卸载重挂面板。
|
|
83
|
-
*
|
|
84
|
-
* 名称、图标、baseId、onClose 属于展示属性,一律不参与 —— 把它们放进挂载
|
|
85
|
-
* effect 的依赖会让父组件每次重渲染都重建面板,会话历史随之重新拉取一遍。
|
|
86
|
-
* @param props 当前面板属性。
|
|
87
|
-
* @returns 用作挂载 effect 唯一依赖的会话身份字符串。
|
|
88
|
-
*/
|
|
89
|
-
export function resolvePanelSessionKey(props: { chatbotId: string }): string {
|
|
90
|
-
return props.chatbotId
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** 应用内本地化对话面板:加载隔离 bundle 并挂载到容器。
|
|
94
|
-
*
|
|
95
|
-
* 产物来源:ai-friendly-base-site/engineering/base-site-chat-panel 的 dist/panel.{js,css},
|
|
96
|
-
* 构建后上传到 Eden CDN 的 base-site 团队空间。加载失败时按 fallback 渲染。
|
|
97
|
-
*
|
|
98
|
-
* 会话请求与轮询由面板经 site.v1 Runtime 走父页面同源代发;应用被独立访问
|
|
99
|
-
* (无宿主)时面板自行回落 BFF 纯文本模式,本组件不感知传输细节。
|
|
100
|
-
*/
|
|
101
|
-
export function LocalChatPanel({
|
|
102
|
-
chatbotId,
|
|
103
|
-
chatbotName,
|
|
104
|
-
chatbotCount = 1,
|
|
105
|
-
chatbotIconUrl,
|
|
106
|
-
baseId,
|
|
107
|
-
fallback,
|
|
108
|
-
onClose,
|
|
109
|
-
}: LocalChatPanelProps) {
|
|
110
|
-
const containerRef = useRef<HTMLDivElement>(null)
|
|
111
|
-
const [loadFailed, setLoadFailed] = useState(false)
|
|
112
|
-
const sessionKey = resolvePanelSessionKey({ chatbotId })
|
|
113
|
-
|
|
114
|
-
// 面板挂载后靠 ref 读取最新展示属性。挂载 effect 只认 sessionKey,
|
|
115
|
-
// 展示属性的引用变化不会 unmount + mount 面板,会话历史也就不会重拉
|
|
116
|
-
// (典型触发:侧边栏拖拽时父组件每帧重渲染)。
|
|
117
|
-
const displayPropsRef = useRef({
|
|
118
|
-
chatbotName,
|
|
119
|
-
chatbotCount,
|
|
120
|
-
chatbotIconUrl,
|
|
121
|
-
baseId,
|
|
122
|
-
})
|
|
123
|
-
displayPropsRef.current = {
|
|
124
|
-
chatbotName,
|
|
125
|
-
chatbotCount,
|
|
126
|
-
chatbotIconUrl,
|
|
127
|
-
baseId,
|
|
128
|
-
}
|
|
129
|
-
const onCloseRef = useRef(onClose)
|
|
130
|
-
onCloseRef.current = onClose
|
|
131
|
-
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
const container = containerRef.current
|
|
134
|
-
if (!container) {
|
|
135
|
-
return undefined
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
let disposed = false
|
|
139
|
-
void loadChatPanelSdk().then((sdk) => {
|
|
140
|
-
if (disposed) {
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
if (!sdk) {
|
|
144
|
-
setLoadFailed(true)
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
sdk.mount(container, {
|
|
148
|
-
projectId: getDatabaseContext().token,
|
|
149
|
-
chatbotId: sessionKey,
|
|
150
|
-
...displayPropsRef.current,
|
|
151
|
-
onClose: () => onCloseRef.current?.(),
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
return () => {
|
|
156
|
-
disposed = true
|
|
157
|
-
window.__SITE_CHATBOT_SDK__?.unmount(container)
|
|
158
|
-
}
|
|
159
|
-
}, [sessionKey])
|
|
160
|
-
|
|
161
|
-
// 展示属性(名称、图标、baseId)晚到时就地更新,不重建会话。
|
|
162
|
-
useEffect(() => {
|
|
163
|
-
const container = containerRef.current
|
|
164
|
-
const sdk = window.__SITE_CHATBOT_SDK__
|
|
165
|
-
if (!container || !sdk?.update) {
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
sdk.update(container, {
|
|
169
|
-
projectId: getDatabaseContext().token,
|
|
170
|
-
chatbotId,
|
|
171
|
-
chatbotName,
|
|
172
|
-
chatbotCount,
|
|
173
|
-
chatbotIconUrl,
|
|
174
|
-
baseId,
|
|
175
|
-
onClose: () => onCloseRef.current?.(),
|
|
176
|
-
})
|
|
177
|
-
}, [chatbotId, chatbotName, chatbotCount, chatbotIconUrl, baseId])
|
|
178
|
-
|
|
179
|
-
if (loadFailed) {
|
|
180
|
-
return (
|
|
181
|
-
fallback ?? (
|
|
182
|
-
<div className="flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground">
|
|
183
|
-
对话面板加载失败,请刷新页面重试
|
|
184
|
-
</div>
|
|
185
|
-
)
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// 面板根节点 .site-chat-root 是 flex:1,挂载容器必须自己是有界高度的 flex column,
|
|
190
|
-
// 否则消息列表按内容自然高度撑开、输入框被顶出视口。
|
|
191
|
-
return (
|
|
192
|
-
<div
|
|
193
|
-
ref={containerRef}
|
|
194
|
-
className="flex min-h-0 flex-1 flex-col overflow-hidden"
|
|
195
|
-
/>
|
|
196
|
-
)
|
|
197
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface BaseDatabaseEndpointConfig {
|
|
2
|
-
chatbotOrigin: string
|
|
3
|
-
customIconUri: string
|
|
4
|
-
driveStreamOrigin: string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// 仅剩 Chatbot 第二层 iframe 与其图标资源仍依赖这些外部域名,
|
|
8
|
-
// 业务 HTTP 一律经父页面代理,不再配置 OpenAPI 直连域名。
|
|
9
|
-
const ONLINE_ENDPOINT_CONFIG: BaseDatabaseEndpointConfig = {
|
|
10
|
-
chatbotOrigin: 'https://feishu.cn',
|
|
11
|
-
customIconUri: 'https://sf1-scmcdn-cn.feishucdn.com/obj/lark-reaction-cn/',
|
|
12
|
-
driveStreamOrigin: 'https://internal-api-drive-stream.feishu.cn',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** 读取 Base Database 线上环境的外部服务域名配置。 */
|
|
16
|
-
export function getBaseDatabaseEndpointConfig(): BaseDatabaseEndpointConfig {
|
|
17
|
-
return ONLINE_ENDPOINT_CONFIG
|
|
18
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# SQL Functions
|
|
2
|
-
|
|
3
|
-
每个 SQL Function 放在 `sql/<functionId>/` 中:
|
|
4
|
-
|
|
5
|
-
- `main.sql`:使用 PostgreSQL 方言编写查询,参数按 `$1`、`$2` 顺序引用。
|
|
6
|
-
- `meta.json`:声明 `name`、`description` 和参数契约;没有参数时可省略 `meta` 或 `meta.params`。
|
|
7
|
-
|
|
8
|
-
SQL 是应用读取 Base 的一等路径;写入使用 `server-functions/functions/`。完整参数、返回结构、Catalog 和方言以 `lark-base-database` Skill 的 `sql-function.md` 为准。
|