@nocobase/app-template-default 1.0.0-beta.77 → 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.
@@ -1,4 +1,4 @@
1
- import { useToaster } from '@nocobase/app-client';
1
+ import { copyText, useToaster } from '@nocobase/app-client';
2
2
  import { useTranslation } from '@nocobase/i18n/client';
3
3
  import { useCallback, useEffect, useState } from 'react';
4
4
 
@@ -23,11 +23,14 @@ export function useCopy(): CopyState {
23
23
  const copy = useCallback(
24
24
  async (text: string): Promise<void> => {
25
25
  try {
26
- await navigator.clipboard.writeText(text);
26
+ if (!(await copyText(text))) {
27
+ toaster.show({ type: 'error', title: t('home.prompt.copyFailed') });
28
+ return;
29
+ }
27
30
  setCopied(true);
28
31
  toaster.show({ type: 'success', title: t('home.prompt.copied') });
29
32
  } catch {
30
- // The Clipboard API is missing outside a secure context and rejects without permission.
33
+ // Copying can fail when neither browser mechanism is available.
31
34
  toaster.show({ type: 'error', title: t('home.prompt.copyFailed') });
32
35
  }
33
36
  },
@@ -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.77",
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.77"
12
+ "defaultTemplateVersion": "1.0.0-beta.79"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@ai-sdk/react": "4.0.131",
@@ -72,12 +72,12 @@
72
72
  "tar": "^7.5.22",
73
73
  "@xyflow/react": "^12.11.5",
74
74
  "elkjs": "^0.10.2",
75
- "@nocobase/app-client": "^4.0.0-beta.2",
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.46",
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
- "@nocobase/dev-config": "0.1.0-beta.24",
80
+ "@nocobase/dev-config": "0.1.0-beta.25",
81
81
  "@nocobase/drive": "^0.1.0-beta.7",
82
82
  "@nocobase/logging": "^0.1.0-beta.7",
83
83
  "@nocobase/session": "^0.1.0-beta.3"
@@ -139,20 +139,20 @@
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.19",
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.14",
144
145
  "@nocobase/app-plugin-authorization": "^1.0.0-beta.31",
145
- "@nocobase/app-plugin-authentication": "^2.0.0-beta.13",
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.1",
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.10",
151
- "@nocobase/app-plugin-mail": "^1.0.0-beta.16",
150
+ "@nocobase/app-plugin-knowledge": "^0.1.0-beta.12",
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",
154
154
  "@nocobase/app-plugin-notification-providers": "^1.0.0-beta.15",
155
- "@nocobase/app-plugin-scheduler": "^1.0.0-beta.19",
155
+ "@nocobase/app-plugin-scheduler": "^1.0.0-beta.20",
156
156
  "@nocobase/app-plugin-users": "^2.0.0-beta.9",
157
157
  "@nocobase/app-server": "^3.0.0-beta.3",
158
158
  "@nocobase/config": "^0.1.0-beta.3",
@@ -165,7 +165,7 @@
165
165
  "@nocobase/app-plugin-authz-restriction-rules": "^1.0.0-beta.14",
166
166
  "@nocobase/authorization": "^1.0.0-beta.15",
167
167
  "@nocobase/queue": "^0.1.0-beta.9",
168
- "@nocobase/jobs": "^0.1.0-beta.3",
168
+ "@nocobase/jobs": "^0.1.0-beta.4",
169
169
  "@nocobase/lifecycle": "^0.1.0-beta.3",
170
170
  "@nocobase/i18n": "^2.0.0-beta.1",
171
171
  "@nocobase/caching": "^0.1.0-beta.3",
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { defineKnowledgeConfig } from '@nocobase/app-plugin-knowledge/config';
2
+
3
+ export default defineKnowledgeConfig();
@@ -254,9 +254,20 @@ it.each(['/users', '/settings/users'])(
254
254
  },
255
255
  }),
256
256
  );
257
- expect(
258
- await screen.findByText('Alice updated', { exact: true }),
259
- ).toBeVisible();
257
+ // Refreshing remounts cells; permission loading can replace the name span with a link.
258
+ await waitFor(() => {
259
+ const table = screen.getByRole('table');
260
+ expect(table).toHaveAttribute('aria-busy', 'false');
261
+ const row = within(table).getByRole('row', {
262
+ name: /alice@example\.test/u,
263
+ });
264
+ const updated = within(row).getByRole('link', {
265
+ name: 'Alice updated',
266
+ exact: true,
267
+ });
268
+ expect(updated).toBeVisible();
269
+ expect(updated).toHaveAttribute('href', `${base}/alice/edit${search}`);
270
+ });
260
271
  expect(screen.getByTestId('location')).toHaveTextContent(
261
272
  `${base}${search}`,
262
273
  );
@@ -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
  });