@geminilight/mindos 0.6.73 → 0.6.75
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/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +30 -30
- package/_standalone/.next/build-manifest.json +3 -3
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/react-loadable-manifest.json +5 -5
- package/_standalone/.next/required-server-files.json +14 -1
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/channels/verify/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/connect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/embedding/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/raw/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/config/route.js +1 -1
- package/_standalone/.next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/status/route.js +1 -7
- package/_standalone/.next/server/app/api/im/status/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/test/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook/feishu/route.js +1 -7
- package/_standalone/.next/server/app/api/im/webhook/feishu/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook-status/route.js +1 -7
- package/_standalone/.next/server/app/api/im/webhook-status/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/clip/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/lint/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/lint/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/space-overview/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +2 -2
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +3 -3
- package/_standalone/.next/server/app/trash/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +3 -3
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app-paths-manifest.json +30 -30
- package/_standalone/.next/server/chunks/1076.js +1 -1
- package/_standalone/.next/server/chunks/{2449.js → 2424.js} +2 -2
- package/_standalone/.next/server/chunks/2792.js +1 -0
- package/_standalone/.next/server/chunks/2885.js +7 -0
- package/_standalone/.next/server/chunks/3800.js +1 -1
- package/_standalone/.next/server/chunks/5299.js +1 -1
- package/_standalone/.next/server/chunks/5464.js +1 -1
- package/_standalone/.next/server/chunks/6022.js +28 -28
- package/_standalone/.next/server/chunks/6539.js +1 -1
- package/_standalone/.next/server/chunks/8388.js +2 -2
- package/_standalone/.next/server/middleware-build-manifest.js +1 -1
- package/_standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/{5331.c89084fd7f67887d.js → 4342.ccc18d7a45f204a4.js} +5 -5
- package/_standalone/.next/static/chunks/{4094.09364c01df411380.js → 4496.f77a677ac2034e48.js} +1 -1
- package/_standalone/.next/static/chunks/{5358-15618fc9b20018ee.js → 5358-15ceeb8c1cd9889d.js} +6 -6
- package/_standalone/.next/static/chunks/{6902-edc5c487c696bd0b.js → 6902-53a31f849968ddf8.js} +1 -1
- package/_standalone/.next/static/chunks/9207-456dc6941d557f33.js +1 -0
- package/_standalone/.next/static/chunks/app/{layout-fcbde5bee626d21a.js → layout-09f08f52e3cbfc47.js} +66 -66
- package/_standalone/.next/static/chunks/app/setup/{page-e40f3c5704c3c857.js → page-64d7fa097ef3f367.js} +1 -1
- package/_standalone/.next/static/chunks/app/trash/page-8e0ea3ba71702757.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-04f43178679a8bfb.js +12 -0
- package/_standalone/.next/static/chunks/{webpack-dc486b68118d1328.js → webpack-ec9c6076012b75f3.js} +1 -1
- package/_standalone/.next/trace +72 -72
- package/_standalone/__tests__/agent/provider-presets.test.ts +32 -0
- package/_standalone/__tests__/api/im-config-feishu-conversation.test.ts +39 -0
- package/_standalone/__tests__/api/im-webhook-feishu.test.ts +21 -12
- package/_standalone/__tests__/api/pi-subagents.test.ts +81 -0
- package/_standalone/__tests__/ask/file-chip-variants.test.tsx +18 -0
- package/_standalone/__tests__/ask/message-list-agent-attribution.test.tsx +2 -0
- package/_standalone/__tests__/im/feishu-dispatcher.test.ts +151 -0
- package/_standalone/__tests__/im/feishu-webhook.test.ts +85 -57
- package/_standalone/__tests__/im/feishu-ws-client.test.ts +91 -0
- package/_standalone/__tests__/settings/custom-provider-form.test.ts +30 -0
- package/_standalone/components/ask/FileChip.tsx +1 -1
- package/_standalone/components/ask/MessageList.tsx +2 -2
- package/_standalone/components/settings/CustomProviderFields.tsx +1 -1
- package/_standalone/components/settings/CustomProvidersCard.tsx +3 -0
- package/_standalone/components/settings/useCustomProviderForm.ts +78 -24
- package/_standalone/components/shared/ProviderSelect.tsx +6 -5
- package/_standalone/next.config.ts +28 -4
- package/_standalone/package-lock.json +20 -2
- package/_standalone/package.json +3 -1
- package/_standalone/scripts/feishu-long-connection.ts +32 -0
- package/_standalone/server.js +1 -1
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/__tests__/agent/provider-presets.test.ts +32 -0
- package/app/__tests__/api/im-config-feishu-conversation.test.ts +39 -0
- package/app/__tests__/api/im-webhook-feishu.test.ts +21 -12
- package/app/__tests__/api/pi-subagents.test.ts +81 -0
- package/app/__tests__/ask/file-chip-variants.test.tsx +18 -0
- package/app/__tests__/ask/message-list-agent-attribution.test.tsx +2 -0
- package/app/__tests__/im/feishu-dispatcher.test.ts +151 -0
- package/app/__tests__/im/feishu-webhook.test.ts +85 -57
- package/app/__tests__/im/feishu-ws-client.test.ts +91 -0
- package/app/__tests__/settings/custom-provider-form.test.ts +30 -0
- package/app/app/api/ask/route.ts +2 -0
- package/app/app/api/im/config/route.ts +2 -0
- package/app/app/api/im/webhook/feishu/route.ts +4 -2
- package/app/components/ask/FileChip.tsx +1 -1
- package/app/components/ask/MessageList.tsx +2 -2
- package/app/components/settings/CustomProviderFields.tsx +1 -1
- package/app/components/settings/CustomProvidersCard.tsx +3 -0
- package/app/components/settings/useCustomProviderForm.ts +78 -24
- package/app/components/shared/ProviderSelect.tsx +6 -5
- package/app/lib/agent/providers.ts +44 -6
- package/app/lib/im/feishu-dispatcher.ts +111 -0
- package/app/lib/im/feishu-ws-client.ts +72 -0
- package/app/lib/im/types.ts +14 -0
- package/app/lib/im/webhook/feishu.ts +44 -55
- package/app/next.config.ts +28 -4
- package/app/package.json +3 -1
- package/app/scripts/feishu-long-connection.ts +32 -0
- package/bin/cli.js +3 -1
- package/bin/commands/feishu-ws.js +39 -0
- package/package.json +1 -1
- package/scripts/build-runtime-archive.sh +36 -2
- package/_standalone/.next/static/chunks/9207-3b19c55a3c974a09.js +0 -1
- package/_standalone/.next/static/chunks/app/trash/page-e623ff0ab35de002.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-49c4eff6ffdb5168.js +0 -12
- /package/_standalone/.next/static/{Dn8EHqUedSzanCfrM8WWS → dZDCx13MSM8QVQk2QNRs8}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{Dn8EHqUedSzanCfrM8WWS → dZDCx13MSM8QVQk2QNRs8}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import type { FeishuConfig } from '@/lib/im/types';
|
|
3
|
+
|
|
4
|
+
const { startMock, closeMock, wsClientCtor, registerMock } = vi.hoisted(() => {
|
|
5
|
+
const startMock = vi.fn().mockResolvedValue(undefined);
|
|
6
|
+
const closeMock = vi.fn();
|
|
7
|
+
const wsClientCtor = vi.fn();
|
|
8
|
+
const registerMock = vi.fn(function () { return this; });
|
|
9
|
+
return { startMock, closeMock, wsClientCtor, registerMock };
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
vi.mock('@larksuiteoapi/node-sdk', () => ({
|
|
13
|
+
LoggerLevel: { info: 'info' },
|
|
14
|
+
EventDispatcher: class MockEventDispatcher {
|
|
15
|
+
register(handles: unknown) {
|
|
16
|
+
registerMock(handles);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
WSClient: class MockWSClient {
|
|
21
|
+
constructor(params: unknown) {
|
|
22
|
+
wsClientCtor(params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async start(params: unknown) {
|
|
26
|
+
return await startMock(params);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
close(params?: unknown) {
|
|
30
|
+
closeMock(params);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
describe('Feishu WS client manager', () => {
|
|
36
|
+
beforeEach(async () => {
|
|
37
|
+
vi.clearAllMocks();
|
|
38
|
+
const mod = await import('@/lib/im/feishu-ws-client');
|
|
39
|
+
mod.__resetFeishuWSClientForTests();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('starts a WS client once for long connection', async () => {
|
|
43
|
+
const mod = await import('@/lib/im/feishu-ws-client');
|
|
44
|
+
const config: FeishuConfig = {
|
|
45
|
+
app_id: 'cli_xxx',
|
|
46
|
+
app_secret: 'secret',
|
|
47
|
+
conversation: { enabled: true, transport: 'long_connection' },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
await mod.startFeishuWSClient(config);
|
|
51
|
+
await mod.startFeishuWSClient(config);
|
|
52
|
+
|
|
53
|
+
expect(wsClientCtor).toHaveBeenCalledTimes(1);
|
|
54
|
+
expect(wsClientCtor).toHaveBeenCalledWith(expect.objectContaining({
|
|
55
|
+
appId: 'cli_xxx',
|
|
56
|
+
appSecret: 'secret',
|
|
57
|
+
autoReconnect: true,
|
|
58
|
+
}));
|
|
59
|
+
expect(startMock).toHaveBeenCalledTimes(1);
|
|
60
|
+
expect(registerMock).toHaveBeenCalledWith(expect.objectContaining({
|
|
61
|
+
'im.message.receive_v1': expect.any(Function),
|
|
62
|
+
}));
|
|
63
|
+
expect(mod.getFeishuWSClientStatus().running).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('stops the running WS client', async () => {
|
|
67
|
+
const mod = await import('@/lib/im/feishu-ws-client');
|
|
68
|
+
await mod.startFeishuWSClient({
|
|
69
|
+
app_id: 'cli_xxx',
|
|
70
|
+
app_secret: 'secret',
|
|
71
|
+
conversation: { enabled: true, transport: 'long_connection' },
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
mod.stopFeishuWSClient();
|
|
75
|
+
|
|
76
|
+
expect(closeMock).toHaveBeenCalled();
|
|
77
|
+
expect(mod.getFeishuWSClientStatus().running).toBe(false);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('reports configuration errors before trying to connect', async () => {
|
|
81
|
+
const mod = await import('@/lib/im/feishu-ws-client');
|
|
82
|
+
|
|
83
|
+
await expect(mod.startFeishuWSClient({
|
|
84
|
+
app_id: '',
|
|
85
|
+
app_secret: 'secret',
|
|
86
|
+
conversation: { enabled: true, transport: 'long_connection' },
|
|
87
|
+
})).rejects.toThrow('Feishu App ID and App Secret are required');
|
|
88
|
+
|
|
89
|
+
expect(wsClientCtor).not.toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { buildDefaultProviderName } from '@/components/settings/useCustomProviderForm';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
describe('buildDefaultProviderName', () => {
|
|
6
|
+
it('uses the protocol display name by default', () => {
|
|
7
|
+
expect(buildDefaultProviderName('openai', [], undefined, 'en')).toBe('OpenAI');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('appends numeric suffixes when the default name already exists', () => {
|
|
11
|
+
expect(buildDefaultProviderName('openai', ['OpenAI'], undefined, 'en')).toBe('OpenAI 2');
|
|
12
|
+
expect(buildDefaultProviderName('openai', ['OpenAI', 'OpenAI 2'], undefined, 'en')).toBe('OpenAI 3');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('ignores the currently edited provider name when computing duplicates', () => {
|
|
16
|
+
expect(buildDefaultProviderName('openai', ['OpenAI'], 'OpenAI', 'en')).toBe('OpenAI');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('uses localized protocol name in Chinese', () => {
|
|
20
|
+
expect(buildDefaultProviderName('minimax-cn', [], undefined, 'zh')).toBe('MiniMax (国内版)');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('uses LM Studio as the default generated name', () => {
|
|
24
|
+
expect(buildDefaultProviderName('lm-studio', [], undefined, 'en')).toBe('LM Studio');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('uses vLLM as the default generated name', () => {
|
|
28
|
+
expect(buildDefaultProviderName('vllm', [], undefined, 'en')).toBe('vLLM');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -29,7 +29,7 @@ const VARIANT_ICON = {
|
|
|
29
29
|
upload: { icon: Paperclip, cls: 'text-muted-foreground' },
|
|
30
30
|
image: { icon: ImageIcon, cls: 'text-muted-foreground' },
|
|
31
31
|
skill: { icon: Zap, cls: 'text-[var(--amber)]' },
|
|
32
|
-
agent: { icon: Bot, cls: 'text-
|
|
32
|
+
agent: { icon: Bot, cls: 'text-[var(--amber)]' },
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
35
|
const VARIANT_STYLE = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useRef, useEffect, memo, useState, useCallback } from 'react';
|
|
4
|
-
import { Sparkles, Loader2, AlertCircle, Wrench, WifiOff, Zap, Copy, Check, ArrowDown, FolderInput, Search, PenLine, Lightbulb, FileText, Paperclip } from 'lucide-react';
|
|
4
|
+
import { Sparkles, Loader2, AlertCircle, Wrench, WifiOff, Zap, Copy, Check, ArrowDown, FolderInput, Search, PenLine, Lightbulb, FileText, Paperclip, Bot } from 'lucide-react';
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
7
7
|
import type { Message, ImagePart } from '@/lib/types';
|
|
@@ -111,7 +111,7 @@ function AssistantAgentBadge({ agentName }: { agentName?: string }) {
|
|
|
111
111
|
if (!agentName) return null;
|
|
112
112
|
return (
|
|
113
113
|
<div className="mb-2 inline-flex items-center gap-1 rounded-full border border-[var(--amber)]/15 bg-[var(--amber)]/8 px-2 py-0.5 text-[10px] font-medium tracking-wide text-[var(--amber)]">
|
|
114
|
-
<
|
|
114
|
+
<Bot size={10} className="shrink-0" />
|
|
115
115
|
<span>{agentName}</span>
|
|
116
116
|
</div>
|
|
117
117
|
);
|
|
@@ -25,7 +25,7 @@ export default function CustomProviderFields({
|
|
|
25
25
|
|
|
26
26
|
const nameLabel = locale === 'zh' ? '名称' : 'Name';
|
|
27
27
|
const protocolLabel = locale === 'zh' ? '协议' : 'Protocol';
|
|
28
|
-
const namePlaceholder = locale === 'zh' ? '
|
|
28
|
+
const namePlaceholder = locale === 'zh' ? '可选,默认使用协议名称' : 'Optional, defaults to protocol name';
|
|
29
29
|
|
|
30
30
|
const nameHint = form.isDuplicateName
|
|
31
31
|
? (locale === 'zh' ? '名称已存在' : 'Name already exists')
|
|
@@ -119,6 +119,9 @@ export default function CustomProvidersCard({
|
|
|
119
119
|
onClose={() => setIsModalOpen(false)}
|
|
120
120
|
onSave={handleSaveProvider}
|
|
121
121
|
initialProvider={editingProvider ?? undefined}
|
|
122
|
+
existingNames={providers
|
|
123
|
+
.filter((p) => p.id !== editingId)
|
|
124
|
+
.map((p) => p.name)}
|
|
122
125
|
t={t}
|
|
123
126
|
/>
|
|
124
127
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useState, useCallback } from 'react';
|
|
4
|
-
import { type ProviderId } from '@/lib/agent/providers';
|
|
3
|
+
import { useState, useCallback, useMemo, useEffect } from 'react';
|
|
4
|
+
import { type ProviderId, PROVIDER_PRESETS } from '@/lib/agent/providers';
|
|
5
5
|
import { type Provider, generateProviderId } from '@/lib/custom-endpoints';
|
|
6
6
|
|
|
7
7
|
export type TestState = 'idle' | 'testing' | 'ok' | 'error';
|
|
@@ -32,6 +32,29 @@ export interface CustomProviderFormState {
|
|
|
32
32
|
handleSave: () => void;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export function buildDefaultProviderName(
|
|
36
|
+
protocol: ProviderId,
|
|
37
|
+
existingNames: string[] = [],
|
|
38
|
+
excludeName?: string,
|
|
39
|
+
locale?: string,
|
|
40
|
+
): string {
|
|
41
|
+
const preset = PROVIDER_PRESETS[protocol];
|
|
42
|
+
const baseName = locale === 'zh' ? preset.nameZh : preset.name;
|
|
43
|
+
const normalizedExisting = new Set(
|
|
44
|
+
existingNames
|
|
45
|
+
.filter((name) => name && name !== excludeName)
|
|
46
|
+
.map((name) => name.trim().toLowerCase()),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
if (!normalizedExisting.has(baseName.trim().toLowerCase())) return baseName;
|
|
50
|
+
|
|
51
|
+
let index = 2;
|
|
52
|
+
while (normalizedExisting.has(`${baseName} ${index}`.toLowerCase())) {
|
|
53
|
+
index++;
|
|
54
|
+
}
|
|
55
|
+
return `${baseName} ${index}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
35
58
|
/**
|
|
36
59
|
* Shared form state + test/save logic for provider forms.
|
|
37
60
|
* Used by both the inline form (AiTab) and the modal (ProviderModal).
|
|
@@ -47,27 +70,64 @@ export function useCustomProviderForm({
|
|
|
47
70
|
locale: string;
|
|
48
71
|
existingNames?: string[];
|
|
49
72
|
}): CustomProviderFormState {
|
|
50
|
-
const
|
|
51
|
-
|
|
73
|
+
const initialName = useMemo(
|
|
74
|
+
() => initial?.name ?? buildDefaultProviderName(initial?.protocol ?? 'openai', existingNames, initial?.name, locale),
|
|
75
|
+
[initial?.name, initial?.protocol, existingNames, locale],
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const [name, setNameState] = useState(initialName);
|
|
79
|
+
const [protocol, setProtocolState] = useState<ProviderId>(initial?.protocol ?? 'openai');
|
|
52
80
|
const [apiKey, setApiKey] = useState(initial?.apiKey ?? '');
|
|
53
81
|
const [model, setModel] = useState(initial?.model ?? '');
|
|
54
82
|
const [baseUrl, setBaseUrl] = useState(initial?.baseUrl ?? '');
|
|
55
83
|
const [testResult, setTestResult] = useState<TestResult>({ state: 'idle' });
|
|
84
|
+
const [nameTouched, setNameTouched] = useState(!!initial?.name);
|
|
85
|
+
|
|
86
|
+
const autoName = useMemo(
|
|
87
|
+
() => buildDefaultProviderName(protocol, existingNames, initial?.name, locale),
|
|
88
|
+
[protocol, existingNames, initial?.name, locale],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!nameTouched) {
|
|
93
|
+
setNameState(autoName);
|
|
94
|
+
}
|
|
95
|
+
}, [autoName, nameTouched]);
|
|
96
|
+
|
|
97
|
+
const setName = useCallback((value: string) => {
|
|
98
|
+
setNameTouched(true);
|
|
99
|
+
setNameState(value);
|
|
100
|
+
}, []);
|
|
101
|
+
|
|
102
|
+
const setProtocol = useCallback((value: ProviderId) => {
|
|
103
|
+
setProtocolState(value);
|
|
104
|
+
setTestResult({ state: 'idle' });
|
|
105
|
+
}, []);
|
|
56
106
|
|
|
57
107
|
// Check for duplicate name (exclude the provider being edited)
|
|
58
108
|
const trimmedName = name.trim();
|
|
59
|
-
const
|
|
60
|
-
|
|
109
|
+
const effectiveName = trimmedName || autoName;
|
|
110
|
+
const isDuplicateName = !!(effectiveName && existingNames?.some(
|
|
111
|
+
n => n !== initial?.name && n.toLowerCase() === effectiveName.toLowerCase(),
|
|
61
112
|
));
|
|
62
113
|
|
|
63
|
-
const canSave = !!(
|
|
114
|
+
const canSave = !!(baseUrl.trim() && model.trim() && !isDuplicateName);
|
|
115
|
+
|
|
116
|
+
const requiredFieldsMessage = locale === 'zh'
|
|
117
|
+
? '接口地址和模型为必填'
|
|
118
|
+
: 'Base URL and model are required';
|
|
119
|
+
|
|
120
|
+
const duplicateNameMessage = locale === 'zh'
|
|
121
|
+
? '名称已存在,请使用其他名称'
|
|
122
|
+
: 'Name already exists, please use a different name';
|
|
64
123
|
|
|
65
124
|
const handleTest = useCallback(async () => {
|
|
66
|
-
if (
|
|
67
|
-
setTestResult({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
125
|
+
if (isDuplicateName) {
|
|
126
|
+
setTestResult({ state: 'error', error: duplicateNameMessage });
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (!baseUrl.trim() || !model.trim()) {
|
|
130
|
+
setTestResult({ state: 'error', error: requiredFieldsMessage });
|
|
71
131
|
return;
|
|
72
132
|
}
|
|
73
133
|
setTestResult({ state: 'testing' });
|
|
@@ -90,32 +150,26 @@ export function useCustomProviderForm({
|
|
|
90
150
|
} catch {
|
|
91
151
|
setTestResult({ state: 'error', code: 'network_error', error: 'Network error' });
|
|
92
152
|
}
|
|
93
|
-
}, [
|
|
153
|
+
}, [isDuplicateName, duplicateNameMessage, baseUrl, model, initial?.id, apiKey, protocol, requiredFieldsMessage]);
|
|
94
154
|
|
|
95
155
|
const handleSave = useCallback(() => {
|
|
96
156
|
if (isDuplicateName) {
|
|
97
|
-
setTestResult({
|
|
98
|
-
state: 'error',
|
|
99
|
-
error: locale === 'zh' ? '名称已存在,请使用其他名称' : 'Name already exists, please use a different name',
|
|
100
|
-
});
|
|
157
|
+
setTestResult({ state: 'error', error: duplicateNameMessage });
|
|
101
158
|
return;
|
|
102
159
|
}
|
|
103
|
-
if (!
|
|
104
|
-
setTestResult({
|
|
105
|
-
state: 'error',
|
|
106
|
-
error: locale === 'zh' ? '名称、接口地址和模型为必填' : 'Name, base URL, and model are required',
|
|
107
|
-
});
|
|
160
|
+
if (!baseUrl.trim() || !model.trim()) {
|
|
161
|
+
setTestResult({ state: 'error', error: requiredFieldsMessage });
|
|
108
162
|
return;
|
|
109
163
|
}
|
|
110
164
|
onSave({
|
|
111
165
|
id: initial?.id || generateProviderId(),
|
|
112
|
-
name:
|
|
166
|
+
name: effectiveName,
|
|
113
167
|
protocol,
|
|
114
168
|
apiKey,
|
|
115
169
|
model: model.trim(),
|
|
116
170
|
baseUrl: baseUrl.trim(),
|
|
117
171
|
});
|
|
118
|
-
}, [
|
|
172
|
+
}, [isDuplicateName, duplicateNameMessage, baseUrl, model, requiredFieldsMessage, onSave, initial?.id, effectiveName, protocol, apiKey]);
|
|
119
173
|
|
|
120
174
|
return {
|
|
121
175
|
name, setName,
|
|
@@ -39,7 +39,8 @@ export default function ProviderSelect({
|
|
|
39
39
|
: [];
|
|
40
40
|
|
|
41
41
|
// Add panel shows ALL providers as protocol templates (can add multiple of the same type)
|
|
42
|
-
const { primary: primaryItems, more: moreItems } = groups;
|
|
42
|
+
const { primary: primaryItems, local: localItems, more: moreItems } = groups;
|
|
43
|
+
const secondaryItems = [...localItems, ...moreItems];
|
|
43
44
|
|
|
44
45
|
/* ── Compact tab button (for legacy builtin-only mode) ── */
|
|
45
46
|
const renderCompactTab = (id: ProviderId) => {
|
|
@@ -175,7 +176,7 @@ export default function ProviderSelect({
|
|
|
175
176
|
</div>
|
|
176
177
|
|
|
177
178
|
{/* More toggle */}
|
|
178
|
-
{
|
|
179
|
+
{secondaryItems.length > 0 && (
|
|
179
180
|
<>
|
|
180
181
|
<button
|
|
181
182
|
type="button"
|
|
@@ -186,13 +187,13 @@ export default function ProviderSelect({
|
|
|
186
187
|
{showMore
|
|
187
188
|
? (locale === 'zh' ? '收起' : 'Show less')
|
|
188
189
|
: (locale === 'zh'
|
|
189
|
-
? `更多 (${
|
|
190
|
-
: `More (${
|
|
190
|
+
? `更多 (${secondaryItems.length})`
|
|
191
|
+
: `More (${secondaryItems.length})`)}
|
|
191
192
|
</button>
|
|
192
193
|
|
|
193
194
|
{showMore && (
|
|
194
195
|
<div className={compact ? 'flex flex-wrap gap-2' : 'grid grid-cols-1 gap-2'}>
|
|
195
|
-
{
|
|
196
|
+
{secondaryItems.map(id => compact ? renderCompactTab(id) : renderCard(id))}
|
|
196
197
|
</div>
|
|
197
198
|
)}
|
|
198
199
|
</>
|
|
@@ -15,9 +15,24 @@ const nextConfig: NextConfig = {
|
|
|
15
15
|
// when the project is inside node_modules (global npm install).
|
|
16
16
|
...(inNodeModules ? ['@geminilight/mindos'] : []),
|
|
17
17
|
],
|
|
18
|
-
serverExternalPackages: [
|
|
18
|
+
serverExternalPackages: [
|
|
19
|
+
'chokidar', 'openai', 'discord.js',
|
|
20
|
+
'@mariozechner/pi-ai', '@mariozechner/pi-agent-core', '@mariozechner/pi-coding-agent', 'pi-mcp-adapter',
|
|
21
|
+
// Heavy packages excluded from bundle — dynamically imported at runtime.
|
|
22
|
+
'@huggingface/transformers', 'onnxruntime-web',
|
|
23
|
+
'sharp', '@img/sharp-linux-x64', '@img/sharp-darwin-arm64', '@img/sharp-win32-x64',
|
|
24
|
+
],
|
|
19
25
|
output: 'standalone',
|
|
20
26
|
outputFileTracingRoot: projectDir,
|
|
27
|
+
// Exclude heavy native packages from standalone trace to reduce runtime archive.
|
|
28
|
+
// @img/sharp-* (33MB) is optional for image processing.
|
|
29
|
+
outputFileTracingExcludes: {
|
|
30
|
+
'*': [
|
|
31
|
+
'./node_modules/onnxruntime-node/**',
|
|
32
|
+
'./node_modules/@img/**',
|
|
33
|
+
'./node_modules/sharp/**',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
21
36
|
outputFileTracingIncludes: {
|
|
22
37
|
// extract-pdf.cjs is spawned at runtime (not bundled) — ensure it's
|
|
23
38
|
// copied into .next/standalone/scripts/ so standalone builds work.
|
|
@@ -32,11 +47,20 @@ const nextConfig: NextConfig = {
|
|
|
32
47
|
},
|
|
33
48
|
},
|
|
34
49
|
webpack: (config) => {
|
|
50
|
+
config.resolve = config.resolve ?? {};
|
|
51
|
+
config.resolve.alias = config.resolve.alias ?? {};
|
|
52
|
+
const alias = config.resolve.alias as Record<string, string>;
|
|
53
|
+
|
|
35
54
|
if (inNodeModules) {
|
|
36
|
-
|
|
37
|
-
config.resolve.alias = config.resolve.alias ?? {};
|
|
38
|
-
(config.resolve.alias as Record<string, string>)['@'] = projectDir;
|
|
55
|
+
alias['@'] = projectDir;
|
|
39
56
|
}
|
|
57
|
+
|
|
58
|
+
// Replace onnxruntime-node (355MB native binary) with onnxruntime-web (WASM).
|
|
59
|
+
// @huggingface/transformers statically imports onnxruntime-node in its Node.js
|
|
60
|
+
// entry. This alias makes it resolve to the lightweight WASM version instead,
|
|
61
|
+
// reducing the runtime archive from ~250MB to ~35MB with no code changes needed.
|
|
62
|
+
alias['onnxruntime-node'] = 'onnxruntime-web';
|
|
63
|
+
|
|
40
64
|
return config;
|
|
41
65
|
},
|
|
42
66
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wiki-app",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.75",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "wiki-app",
|
|
9
|
-
"version": "0.6.
|
|
9
|
+
"version": "0.6.75",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "^0.18.2",
|
|
@@ -51,9 +51,11 @@
|
|
|
51
51
|
"marked": "^17.0.5",
|
|
52
52
|
"nanoid": "^5.1.0",
|
|
53
53
|
"next": "16.1.6",
|
|
54
|
+
"onnxruntime-web": "^1.25.0-dev.20260327-722743c0e2",
|
|
54
55
|
"papaparse": "^5.5.3",
|
|
55
56
|
"pdfjs-dist": "^4.10.38",
|
|
56
57
|
"pi-mcp-adapter": "^2.2.2",
|
|
58
|
+
"pi-subagents": "^0.12.5",
|
|
57
59
|
"picocolors": "^1.1.1",
|
|
58
60
|
"react": "19.2.3",
|
|
59
61
|
"react-dom": "19.2.3",
|
|
@@ -14773,6 +14775,22 @@
|
|
|
14773
14775
|
"integrity": "sha512-Ul3YyOTU++to8cgNkttakC0dWvpERr6RYoHO2W47DLbFvrwBDJUY31B1sImH6JZSYc4Kt4PyHtoPNu+vL2r2dA==",
|
|
14774
14776
|
"license": "MIT"
|
|
14775
14777
|
},
|
|
14778
|
+
"node_modules/pi-subagents": {
|
|
14779
|
+
"version": "0.12.5",
|
|
14780
|
+
"resolved": "https://registry.npmmirror.com/pi-subagents/-/pi-subagents-0.12.5.tgz",
|
|
14781
|
+
"integrity": "sha512-GFvcHo3GCRItPDdKaeOkgr+HY5Ikob3ucofJFa2u227SdbT8mONCp+NHyKTwDYkY0xGpl8pTGcrWvz45N8utUA==",
|
|
14782
|
+
"license": "MIT",
|
|
14783
|
+
"bin": {
|
|
14784
|
+
"pi-subagents": "install.mjs"
|
|
14785
|
+
},
|
|
14786
|
+
"peerDependencies": {
|
|
14787
|
+
"@mariozechner/pi-agent-core": "*",
|
|
14788
|
+
"@mariozechner/pi-ai": "*",
|
|
14789
|
+
"@mariozechner/pi-coding-agent": "*",
|
|
14790
|
+
"@mariozechner/pi-tui": "*",
|
|
14791
|
+
"@sinclair/typebox": "*"
|
|
14792
|
+
}
|
|
14793
|
+
},
|
|
14776
14794
|
"node_modules/picocolors": {
|
|
14777
14795
|
"version": "1.1.1",
|
|
14778
14796
|
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",
|
package/_standalone/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wiki-app",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.75",
|
|
4
4
|
"private": true,
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -60,9 +60,11 @@
|
|
|
60
60
|
"marked": "^17.0.5",
|
|
61
61
|
"nanoid": "^5.1.0",
|
|
62
62
|
"next": "16.1.6",
|
|
63
|
+
"onnxruntime-web": "^1.25.0-dev.20260327-722743c0e2",
|
|
63
64
|
"papaparse": "^5.5.3",
|
|
64
65
|
"pdfjs-dist": "^4.10.38",
|
|
65
66
|
"pi-mcp-adapter": "^2.2.2",
|
|
67
|
+
"pi-subagents": "^0.12.5",
|
|
66
68
|
"picocolors": "^1.1.1",
|
|
67
69
|
"react": "19.2.3",
|
|
68
70
|
"react-dom": "19.2.3",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getPlatformConfig } from '@/lib/im/config';
|
|
2
|
+
import { startFeishuWSClient, getFeishuWSClientStatus } from '@/lib/im/feishu-ws-client';
|
|
3
|
+
|
|
4
|
+
async function main() {
|
|
5
|
+
const config = getPlatformConfig('feishu');
|
|
6
|
+
if (!config) {
|
|
7
|
+
throw new Error('Feishu is not configured. Save App ID and App Secret first.');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
await startFeishuWSClient(config);
|
|
11
|
+
const status = getFeishuWSClientStatus();
|
|
12
|
+
|
|
13
|
+
console.log('[feishu/ws] status:', JSON.stringify(status, null, 2));
|
|
14
|
+
console.log('[feishu/ws] connected. Keep this process running to receive events.');
|
|
15
|
+
|
|
16
|
+
process.on('SIGINT', () => {
|
|
17
|
+
console.log('\n[feishu/ws] shutting down');
|
|
18
|
+
process.exit(0);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
process.on('SIGTERM', () => {
|
|
22
|
+
console.log('\n[feishu/ws] shutting down');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
await new Promise(() => {});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main().catch((error) => {
|
|
30
|
+
console.error('[feishu/ws] failed:', error instanceof Error ? error.message : String(error));
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
package/_standalone/server.js
CHANGED
|
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
9
9
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
10
10
|
|
|
11
11
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
12
|
-
const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/MindOS/MindOS/app","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"dynamicOnHover":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0},"reactDebugChannel":false,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":false,"lockDistDir":true,"isolatedDevBuild":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":false,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","transpilePackages":["github-slugger"],"serverExternalPackages":["chokidar","openai","discord.js","@mariozechner/pi-ai","@mariozechner/pi-agent-core","@mariozechner/pi-coding-agent","pi-mcp-adapter"],"outputFileTracingIncludes":{"/api/extract-pdf":["./scripts/extract-pdf.cjs"]},"turbopack":{"root":"/home/runner/work/MindOS/MindOS/app"},"distDirRoot":".next"}
|
|
12
|
+
const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/MindOS/MindOS/app","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"dynamicOnHover":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0},"reactDebugChannel":false,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":false,"lockDistDir":true,"isolatedDevBuild":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":false,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","transpilePackages":["github-slugger"],"serverExternalPackages":["chokidar","openai","discord.js","@mariozechner/pi-ai","@mariozechner/pi-agent-core","@mariozechner/pi-coding-agent","pi-mcp-adapter","@huggingface/transformers","onnxruntime-web","sharp","@img/sharp-linux-x64","@img/sharp-darwin-arm64","@img/sharp-win32-x64"],"outputFileTracingExcludes":{"*":["./node_modules/onnxruntime-node/**","./node_modules/@img/**","./node_modules/sharp/**"]},"outputFileTracingIncludes":{"/api/extract-pdf":["./scripts/extract-pdf.cjs"]},"turbopack":{"root":"/home/runner/work/MindOS/MindOS/app"},"distDirRoot":".next"}
|
|
13
13
|
|
|
14
14
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
15
15
|
|