dsh-contextos-devops 0.0.0-stage → 1.48.31
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/LICENSE +21 -0
- package/README.md +207 -2
- package/assets/avatar.jpg +0 -0
- package/assets/client.css +3316 -0
- package/assets/icon-180.png +0 -0
- package/build/client.mjs +64 -0
- package/client.js +7622 -0
- package/cordis.patch.yml +3 -0
- package/icon.svg +15 -0
- package/index.js +345 -0
- package/lib/base/env.js +22 -0
- package/lib/base/field.js +25 -0
- package/lib/base/http.js +140 -0
- package/lib/base/platform.js +33 -0
- package/lib/base/registry.js +186 -0
- package/lib/base/state.js +66 -0
- package/lib/base/table.js +47 -0
- package/lib/base/texttable.js +26 -0
- package/lib/base/url.js +178 -0
- package/lib/core/README.md +17 -0
- package/lib/core/apps.js +675 -0
- package/lib/core/auth.js +110 -0
- package/lib/core/avatar.js +289 -0
- package/lib/core/backup.js +105 -0
- package/lib/core/codegen.js +401 -0
- package/lib/core/copilot.js +419 -0
- package/lib/core/data.js +157 -0
- package/lib/core/device.js +148 -0
- package/lib/core/files.js +152 -0
- package/lib/core/gobuild.js +63 -0
- package/lib/core/iam.js +122 -0
- package/lib/core/identity.js +22 -0
- package/lib/core/nodes.js +627 -0
- package/lib/core/ops.js +306 -0
- package/lib/core/project.js +393 -0
- package/lib/core/spaces.js +406 -0
- package/lib/core/terminal.js +137 -0
- package/lib/core/terminal2.js +141 -0
- package/lib/core/users.js +51 -0
- package/lib/core/vocab.js +158 -0
- package/lib/misc/async.js +15 -0
- package/lib/misc/shell.js +27 -0
- package/lib/misc/static.js +33 -0
- package/locale/en.json +10 -0
- package/locale/zh.json +10 -0
- package/package.json +91 -4
- package/src/client/README.md +37 -0
- package/src/client/parts/00-prelude.js +315 -0
- package/src/client/parts/05-bootstrap.js +61 -0
- package/src/client/parts/08-store.js +85 -0
- package/src/client/parts/10-ui.js +188 -0
- package/src/client/parts/12-debug.js +361 -0
- package/src/client/parts/15-layout.js +86 -0
- package/src/client/parts/20-devworkspace.js +789 -0
- package/src/client/parts/25-editor-ui.js +28 -0
- package/src/client/parts/30-modals.js +85 -0
- package/src/client/parts/32-cards.js +176 -0
- package/src/client/parts/34-forms.js +176 -0
- package/src/client/parts/36-data.js +267 -0
- package/src/client/parts/40-project.js +430 -0
- package/src/client/parts/45-map.js +109 -0
- package/src/client/parts/46-pm.js +158 -0
- package/src/client/parts/47-three.js +324 -0
- package/src/client/parts/49-msg.js +167 -0
- package/src/client/parts/50-chat.js +1422 -0
- package/src/client/parts/51-pmselection.js +31 -0
- package/src/client/parts/52-pmdata.js +29 -0
- package/src/client/parts/55-pm.js +146 -0
- package/src/client/parts/58-config.js +381 -0
- package/src/client/parts/59-monitor.js +262 -0
- package/src/client/parts/60-page.js +1518 -0
- package/src/client/styles/kit.css +20 -0
- package/src/client/styles/main.css +3294 -0
- package/src/client/styles/tokens.css +2 -0
- package/vendor/leaflet/leaflet.css +661 -0
- package/vendor/leaflet/leaflet.js +6 -0
- package/vendor/three/three.module.js +53044 -0
- package/vendor/xterm/addon-fit.js +2 -0
- package/vendor/xterm/xterm.css +218 -0
- package/vendor/xterm/xterm.js +2 -0
|
Binary file
|
package/build/client.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Phase-1 client build: keep the DSH ModuleLoader contract (one client.js),
|
|
3
|
+
// but assemble it from small, scope-preserving source fragments.
|
|
4
|
+
//
|
|
5
|
+
// Fragments share the lexical scope of the ModuleLoader factory. This lets the
|
|
6
|
+
// existing component graph be split without an all-at-once ESM rewrite.
|
|
7
|
+
import crypto from 'node:crypto';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
13
|
+
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
|
14
|
+
// 片段列表由目录推导:新增/删除 parts 文件后必须自动进入产物,
|
|
15
|
+
// 否则会出现「源码有、产物无」→ 运行时 ReferenceError,整个插件加载失败。
|
|
16
|
+
const partsDir = path.join(root, 'src/client/parts');
|
|
17
|
+
const parts = fs.readdirSync(partsDir)
|
|
18
|
+
.filter((f) => f.endsWith('.js'))
|
|
19
|
+
.sort((a, b) => a.localeCompare(b, 'en'));
|
|
20
|
+
if (!parts.length) throw new Error('no client parts found in src/client/parts');
|
|
21
|
+
|
|
22
|
+
const pkg = JSON.parse(read('package.json'));
|
|
23
|
+
|
|
24
|
+
function build() {
|
|
25
|
+
const tokensCss = read('src/client/styles/tokens.css').trimEnd();
|
|
26
|
+
const mainCss = read('src/client/styles/main.css').trimEnd();
|
|
27
|
+
const kitCss = read('src/client/styles/kit.css').trimEnd();
|
|
28
|
+
const prelude = read('src/client/parts/00-prelude.js').trimEnd();
|
|
29
|
+
|
|
30
|
+
const hashInputs = [pkg.version, ...parts.map((p) => read(`src/client/parts/${p}`)), tokensCss, mainCss, kitCss].join('\n---\n');
|
|
31
|
+
const srcHash = crypto.createHash('sha1').update(hashInputs).digest('hex').slice(0, 12);
|
|
32
|
+
let out = `// @generated by build/client.mjs — edit src/client/parts instead.\n`;
|
|
33
|
+
out += `// @dsh-contextos-devops ${pkg.version}\n`;
|
|
34
|
+
out += `// @build-hash ${srcHash}\n`;
|
|
35
|
+
out += `// @parts ${parts.map((f) => f + ':' + crypto.createHash('sha256').update(read(`src/client/parts/${f}`)).digest('hex').slice(0, 8)).join(',')}\n`;
|
|
36
|
+
out += prelude;
|
|
37
|
+
fs.mkdirSync(path.join(root, 'assets'), { recursive: true });
|
|
38
|
+
fs.writeFileSync(path.join(root, 'assets/client.css'), `${tokensCss}\n${mainCss}\n${kitCss}\n`);
|
|
39
|
+
out += `\n const CYBER_AVATAR = '/dsh-contextos-devops/assets/avatar.jpg?v=${pkg.version}';\n`;
|
|
40
|
+
for (const part of parts.slice(1)) out += `\n${read(`src/client/parts/${part}`).trimEnd()}\n`;
|
|
41
|
+
out += '\n';
|
|
42
|
+
|
|
43
|
+
out = out.replaceAll('__CLIENT_CSS_VERSION__', pkg.version);
|
|
44
|
+
out = out.replaceAll('__CLIENT_BUILD__', srcHash);
|
|
45
|
+
fs.writeFileSync(path.join(root, 'client.js'), out);
|
|
46
|
+
console.log(`[client] built client.js (${(Buffer.byteLength(out) / 1024).toFixed(1)} KB, ${parts.length} fragments)`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
build();
|
|
50
|
+
|
|
51
|
+
if (process.argv.includes('--watch')) {
|
|
52
|
+
console.log('[client] watching src/client ...');
|
|
53
|
+
let timer = null;
|
|
54
|
+
try {
|
|
55
|
+
fs.watch(path.join(root, 'src/client'), { recursive: true }, () => {
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
timer = setTimeout(() => {
|
|
58
|
+
try { build(); } catch (e) { console.error('[client] build failed:', e.message); }
|
|
59
|
+
}, 120);
|
|
60
|
+
});
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.error('[client] watch unavailable:', e.message);
|
|
63
|
+
}
|
|
64
|
+
}
|