@nocobase/app-template-default 1.0.0-beta.78 → 1.0.0-beta.79
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/config.example.yml
CHANGED
|
@@ -158,6 +158,34 @@ snowflake:
|
|
|
158
158
|
# scheduler:
|
|
159
159
|
# jobs: redis
|
|
160
160
|
|
|
161
|
+
# Knowledge owns one global index shared by all spaces; these are server-only instance definitions.
|
|
162
|
+
# Declaring instances does not enable indexing. Select an instance and Embedding model in Knowledge's
|
|
163
|
+
# global index dialog, then explicitly confirm the all-space rebuild and possible model charges.
|
|
164
|
+
# Agents supplies Embedding models only; its vector collections are not used.
|
|
165
|
+
# knowledge:
|
|
166
|
+
# # Optional: select an existing host jobs configuration by name; omitted follows jobs.default.
|
|
167
|
+
# # jobs: redis
|
|
168
|
+
# indexing:
|
|
169
|
+
# local:
|
|
170
|
+
# name: Local semantic index
|
|
171
|
+
# type: sqlite-vec
|
|
172
|
+
# # Relative to application storage; use one shared file on one host, not separate pod-local files.
|
|
173
|
+
# file: knowledge/vectors.sqlite
|
|
174
|
+
# shared:
|
|
175
|
+
# name: Shared PostgreSQL index
|
|
176
|
+
# type: pgvector
|
|
177
|
+
# # Supply real credentials privately. An administrator must install vector and create this schema.
|
|
178
|
+
# url: postgresql://kb_user:replace-with-the-password@127.0.0.1:5432/knowledge
|
|
179
|
+
# schema: knowledge_index
|
|
180
|
+
# # Deployment-owned generation table prefix (default: knowledge); not a page setting.
|
|
181
|
+
# table: knowledge
|
|
182
|
+
# # Optional TLS settings; ca/cert/key are PEM contents, not file paths.
|
|
183
|
+
# # ssl:
|
|
184
|
+
# # rejectUnauthorized: true
|
|
185
|
+
# # ca: replace-with-the-ca-pem
|
|
186
|
+
# # cert: replace-with-the-client-certificate-pem
|
|
187
|
+
# # key: replace-with-the-client-private-key-pem
|
|
188
|
+
|
|
161
189
|
# Mail is registered by default. Configure mailbox provider instances before connecting accounts.
|
|
162
190
|
# See .agents/skills/nocobase-app-plugin-mail/references/configuration-and-accounts.md.
|
|
163
191
|
mail:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/app-template-default",
|
|
3
3
|
"displayName": "Default Template",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.79",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"prettier": "@nocobase/dev-config/prettier",
|
|
7
7
|
"engines": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"nocobase": {
|
|
11
11
|
"templateKind": "app",
|
|
12
|
-
"defaultTemplateVersion": "1.0.0-beta.
|
|
12
|
+
"defaultTemplateVersion": "1.0.0-beta.79"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@ai-sdk/react": "4.0.131",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"elkjs": "^0.10.2",
|
|
75
75
|
"@nocobase/app-client": "^4.0.0-beta.3",
|
|
76
76
|
"@nocobase/app-plugin-template-print": "0.0.2-beta.2",
|
|
77
|
-
"@nocobase/app-skills": "0.1.0-beta.
|
|
77
|
+
"@nocobase/app-skills": "0.1.0-beta.49",
|
|
78
78
|
"@nocobase/app-testing": "0.1.0-beta.6",
|
|
79
79
|
"@nocobase/app-websocket": "^0.1.0-beta.1",
|
|
80
80
|
"@nocobase/dev-config": "0.1.0-beta.25",
|
|
@@ -139,15 +139,15 @@
|
|
|
139
139
|
"@oclif/core": "^4.14.0",
|
|
140
140
|
"better-auth": "1.7.5",
|
|
141
141
|
"hono": "^4.13.2",
|
|
142
|
-
"@nocobase/app-plugin-agents": "^1.0.0-beta.
|
|
142
|
+
"@nocobase/app-plugin-agents": "^1.0.0-beta.25",
|
|
143
143
|
"@nocobase/app-plugin-api-keys": "^1.0.0-beta.18",
|
|
144
|
-
"@nocobase/app-plugin-authentication": "^2.0.0-beta.
|
|
144
|
+
"@nocobase/app-plugin-authentication": "^2.0.0-beta.14",
|
|
145
145
|
"@nocobase/app-plugin-authorization": "^1.0.0-beta.31",
|
|
146
146
|
"@nocobase/app-plugin-database-explorer": "^1.0.0-beta.16",
|
|
147
147
|
"@nocobase/app-plugin-file": "^1.0.0-beta.26",
|
|
148
|
-
"@nocobase/app-plugin-foundation": "^0.1.0-beta.
|
|
148
|
+
"@nocobase/app-plugin-foundation": "^0.1.0-beta.6",
|
|
149
149
|
"@nocobase/app-plugin-i18n": "^1.0.0-beta.18",
|
|
150
|
-
"@nocobase/app-plugin-knowledge": "^0.1.0-beta.
|
|
150
|
+
"@nocobase/app-plugin-knowledge": "^0.1.0-beta.12",
|
|
151
151
|
"@nocobase/app-plugin-mail": "^1.0.0-beta.17",
|
|
152
152
|
"@nocobase/app-plugin-notification": "^2.0.0-beta.0",
|
|
153
153
|
"@nocobase/app-plugin-notification-in-app": "^2.0.0-beta.0",
|
package/server/config/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import api from './api.js';
|
|
|
22
22
|
import database from './database.js';
|
|
23
23
|
import snowflake from './snowflake.js';
|
|
24
24
|
import users from './users.js';
|
|
25
|
+
import knowledge from './knowledge.js';
|
|
25
26
|
|
|
26
27
|
const defaultConfigs: AppConfigFactory<{
|
|
27
28
|
auth: ReturnType<typeof auth>;
|
|
@@ -44,6 +45,7 @@ const defaultConfigs: AppConfigFactory<{
|
|
|
44
45
|
database: ReturnType<typeof database>;
|
|
45
46
|
snowflake: ReturnType<typeof snowflake>;
|
|
46
47
|
users: ReturnType<typeof users>;
|
|
48
|
+
knowledge: ReturnType<typeof knowledge>;
|
|
47
49
|
}> = defaultAppConfigs({
|
|
48
50
|
auth,
|
|
49
51
|
authorization,
|
|
@@ -65,6 +67,7 @@ const defaultConfigs: AppConfigFactory<{
|
|
|
65
67
|
database,
|
|
66
68
|
snowflake,
|
|
67
69
|
users,
|
|
70
|
+
knowledge,
|
|
68
71
|
});
|
|
69
72
|
|
|
70
73
|
export default defaultConfigs;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
4
4
|
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { AppConfig } from '@nocobase/app-server/config';
|
|
5
9
|
import { describe, expect, it } from 'vitest';
|
|
6
10
|
|
|
7
11
|
// `pnpm nocobase config init` writes config.yml from this file: it replaces the instruction on the first line with
|
|
@@ -27,4 +31,39 @@ describe('config.example.yml', () => {
|
|
|
27
31
|
].join('\n'),
|
|
28
32
|
);
|
|
29
33
|
});
|
|
34
|
+
it('keeps Knowledge opt-in and ships a parseable SQLite and PostgreSQL instance example', async () => {
|
|
35
|
+
const active = new AppConfig().loadFile(
|
|
36
|
+
fileURLToPath(new URL('../../config.example.yml', import.meta.url)),
|
|
37
|
+
);
|
|
38
|
+
await active.loadAll();
|
|
39
|
+
expect(active.get('knowledge')).toBeUndefined();
|
|
40
|
+
const example = (await read()).match(
|
|
41
|
+
/^# knowledge:\n(?:#(?: {2,}.*)?\n)*/m,
|
|
42
|
+
)?.[0];
|
|
43
|
+
expect(example).toBeDefined();
|
|
44
|
+
const directory = await mkdtemp(
|
|
45
|
+
path.join(os.tmpdir(), 'knowledge-config-example-'),
|
|
46
|
+
);
|
|
47
|
+
try {
|
|
48
|
+
const file = path.join(directory, 'config.yml');
|
|
49
|
+
await writeFile(file, example!.replace(/^# ?/gm, ''));
|
|
50
|
+
const config = new AppConfig().loadFile(file);
|
|
51
|
+
await config.loadAll();
|
|
52
|
+
expect(config.get('knowledge.indexing.local')).toEqual({
|
|
53
|
+
name: 'Local semantic index',
|
|
54
|
+
type: 'sqlite-vec',
|
|
55
|
+
file: 'knowledge/vectors.sqlite',
|
|
56
|
+
});
|
|
57
|
+
expect(config.get('knowledge.indexing.shared')).toEqual({
|
|
58
|
+
name: 'Shared PostgreSQL index',
|
|
59
|
+
type: 'pgvector',
|
|
60
|
+
url: 'postgresql://kb_user:replace-with-the-password@127.0.0.1:5432/knowledge',
|
|
61
|
+
schema: 'knowledge_index',
|
|
62
|
+
table: 'knowledge',
|
|
63
|
+
});
|
|
64
|
+
expect(config.get('knowledge.jobs')).toBeUndefined();
|
|
65
|
+
} finally {
|
|
66
|
+
await rm(directory, { recursive: true, force: true });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
30
69
|
});
|