@customize-agent/server 4.19.12 → 4.19.14

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.
Files changed (32) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/chunks/1001.js +2 -2
  5. package/.next/server/chunks/1153.js +39 -38
  6. package/.next/server/chunks/208.js +2 -2
  7. package/.next/server/chunks/5284.js +3 -3
  8. package/.next/server/chunks/6482.js +8 -8
  9. package/.next/server/pages/404.html +1 -1
  10. package/.next/server/pages/500.html +1 -1
  11. package/.next/server/pages/api/kb/files/preview-pdf-page.js.nft.json +1 -1
  12. package/.next/server/pages/asset-library.html +1 -1
  13. package/.next/server/pages/document-roles.html +1 -1
  14. package/.next/server/pages/documents.html +1 -1
  15. package/.next/server/pages/guide.html +1 -1
  16. package/.next/server/pages/index.html +1 -1
  17. package/.next/server/pages/knowledge/file-detail.html +1 -1
  18. package/.next/server/pages/knowledge/files.html +1 -1
  19. package/.next/server/pages/knowledge/manage.html +1 -1
  20. package/.next/server/pages/knowledge.html +1 -1
  21. package/.next/server/pages/models.html +1 -1
  22. package/.next/server/pages/overview.html +1 -1
  23. package/.next/server/pages/prompt.html +1 -1
  24. package/.next/server/pages/settings.html +1 -1
  25. package/.next/server/pages/system/logs.html +1 -1
  26. package/.next/server/pages/template-references.html +1 -1
  27. package/.next/server/pages-manifest.json +18 -18
  28. package/package.json +1 -1
  29. package/scripts/gen-explicit-exports.cjs +0 -84
  30. package/scripts/verify-explicit-exports.cjs +0 -37
  31. /package/.next/static/{9U3ORf_b_WffdDz1kaXi8 → tOFTuSPudY6nH4ngR50z0}/_buildManifest.js +0 -0
  32. /package/.next/static/{9U3ORf_b_WffdDz1kaXi8 → tOFTuSPudY6nH4ngR50z0}/_ssgManifest.js +0 -0
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * 一次性工具:把 document-workflow/index.ts 的 export * 展开为显式导出清单。
4
- * 规则与 export * 对齐:不转发 default;同名冲突保留先出现者(打印冲突供人工确认)。
5
- * 类型(interface/type)单独走 export type,兼容 isolatedModules。
6
- */
7
- const fs = require('fs');
8
- const path = require('path');
9
-
10
- const dir = '/Users/pan/Desktop/codeing/customize-agent/apps/server/src/services/document-workflow';
11
- const indexPath = path.join(dir, 'index.ts');
12
- const lines = fs.readFileSync(indexPath, 'utf-8').split('\n');
13
- const modules = lines
14
- .map(line => line.match(/^export \* from '(\.\/[^']+)';?/)?.[1])
15
- .filter(Boolean);
16
-
17
- /** 合并多行 export { ... } 块后逐条解析 */
18
- function extractExports(source) {
19
- const values = []; // { name, viaFrom? }
20
- const types = [];
21
- // 先把多行花括号块压成单行,便于逐条匹配
22
- const flat = source.replace(/export\s*\{[^}]*\}\s*(?:from\s*'[^']*')?;?/gs, m => m.replace(/\s+/g, ' '));
23
- const stmts = flat.split('\n');
24
- for (const stmt of stmts) {
25
- const trimmed = stmt.trim();
26
- let m = trimmed.match(/^export\s+(?:async\s+)?(?:function\*?|class|const|let|var|enum)\s+([A-Za-z0-9_$]+)/);
27
- if (m) { values.push({ name: m[1] }); continue; }
28
- m = trimmed.match(/^export\s+(?:abstract\s+class)\s+([A-Za-z0-9_$]+)/);
29
- if (m) { values.push({ name: m[1] }); continue; }
30
- m = trimmed.match(/^export\s+(interface|type)\s+([A-Za-z0-9_$]+)/);
31
- if (m) { types.push({ name: m[2] }); continue; }
32
- m = trimmed.match(/^export\s+(?:type\s+)?\{([^}]*)\}\s*(?:from\s*'([^']*)')?/);
33
- if (m) {
34
- const from = m[2];
35
- const wholeIsType = /^export\s+type/.test(trimmed);
36
- for (const part of m[1].split(',')) {
37
- const item = part.trim();
38
- if (!item) continue;
39
- const typeMatch = item.match(/^type\s+(.+)$/);
40
- const target = typeMatch ? typeMatch[1] : item;
41
- const name = target.split(/\s+as\s+/).pop().trim();
42
- (wholeIsType || typeMatch ? types : values).push({ name, viaFrom: from });
43
- }
44
- }
45
- }
46
- return { values, types };
47
- }
48
-
49
- const seen = new Map(); // name -> module
50
- const conflicts = [];
51
- const out = ['// 显式导出清单(替代 export *):依赖关系可见,同名冲突按 export * 语义保留先出现者。', '// 由 scripts/gen-explicit-exports.cjs 生成并经人工确认;新增导出需同步维护本清单。', ''];
52
-
53
- for (const mod of modules) {
54
- const file = path.join(dir, `${mod.slice(2)}.ts`);
55
- const source = fs.readFileSync(file, 'utf-8');
56
- const { values, types } = extractExports(source);
57
- const keptValues = [];
58
- const keptTypes = [];
59
- for (const entry of [...values.map(v => ({ ...v, kind: 'value' })), ...types.map(t => ({ ...t, kind: 'type' }))]) {
60
- if (seen.has(entry.name)) {
61
- conflicts.push(`${entry.name}: ${seen.get(entry.name)} (先) vs ${mod} (丢弃)`);
62
- continue;
63
- }
64
- seen.set(entry.name, mod);
65
- (entry.kind === 'type' ? keptTypes : keptValues).push(entry);
66
- }
67
- // viaFrom 的符号保持 re-export 形式(穿透到真实来源)
68
- const directValues = keptValues.filter(v => !v.viaFrom).map(v => v.name);
69
- const directTypes = keptTypes.filter(t => !t.viaFrom).map(t => t.name);
70
- const reExports = new Map(); // from -> names
71
- for (const entry of [...keptValues, ...keptTypes].filter(e => e.viaFrom)) {
72
- const list = reExports.get(entry.viaFrom) || [];
73
- list.push(entry.name);
74
- reExports.set(entry.viaFrom, list);
75
- }
76
- if (directValues.length) out.push(`export { ${directValues.join(', ')} } from '${mod}';`);
77
- if (directTypes.length) out.push(`export type { ${directTypes.join(', ')} } from '${mod}';`);
78
- for (const [from, names] of reExports) out.push(`export { ${names.join(', ')} } from '${from}'; // 经 ${mod} 透传`);
79
- out.push('');
80
- }
81
-
82
- console.log(out.join('\n'));
83
- console.error('=== 冲突(同名丢弃,与 export * 语义一致) ===');
84
- for (const c of conflicts) console.error(c);
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env node
2
- /** 校验:对比 git HEAD 版(export *)与当前版(显式清单)index.ts 的模块导出符号集合是否一致 */
3
- const ts = require('typescript');
4
- const fs = require('fs');
5
- const path = require('path');
6
- const { execSync } = require('child_process');
7
-
8
- const dir = '/Users/pan/Desktop/codeing/customize-agent/apps/server/src/services/document-workflow';
9
- const indexPath = path.join(dir, 'index.ts');
10
- const headContent = execSync('git show HEAD:apps/server/src/services/document-workflow/index.ts', { cwd: '/Users/pan/Desktop/codeing/customize-agent' }).toString();
11
- const headPath = path.join(dir, '.index.head.snapshot.ts');
12
- fs.writeFileSync(headPath, headContent);
13
-
14
- function exportsOf(file) {
15
- const program = ts.createProgram([file], {
16
- allowJs: true, skipLibCheck: true, noEmit: true, strict: false,
17
- module: ts.ModuleKind.ESNext, moduleResolution: ts.ModuleResolutionKind.Bundler, target: ts.ScriptTarget.ES2022,
18
- });
19
- const checker = program.getTypeChecker();
20
- const sf = program.getSourceFile(file);
21
- const sym = checker.getSymbolAtLocation(sf);
22
- if (!sym) return [];
23
- return checker.getExportsOfModule(sym).map(s => s.name).sort();
24
- }
25
-
26
- try {
27
- const before = exportsOf(headPath);
28
- const after = exportsOf(indexPath);
29
- const missing = before.filter(name => !after.includes(name));
30
- const added = after.filter(name => !before.includes(name));
31
- console.log(`HEAD(export *) 导出 ${before.length} 个符号;当前(显式) 导出 ${after.length} 个符号`);
32
- console.log(`缺失: ${missing.length}`, missing);
33
- console.log(`新增: ${added.length}`, added);
34
- process.exit(missing.length === 0 ? 0 : 1);
35
- } finally {
36
- fs.rmSync(headPath, { force: true });
37
- }