@volcengine/s3d-cli 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,39 @@
1
+ {
2
+ "thirdPartySoftwareNotices": [
3
+ {
4
+ "component": "github.com/gofrs/flock",
5
+ "license": "BSD-3-Clause",
6
+ "url": "https://pkg.go.dev/github.com/gofrs/flock"
7
+ },
8
+ {
9
+ "component": "github.com/spf13/cobra",
10
+ "license": "Apache-2.0",
11
+ "url": "https://pkg.go.dev/github.com/spf13/cobra"
12
+ },
13
+ {
14
+ "component": "github.com/spf13/pflag",
15
+ "license": "BSD-3-Clause",
16
+ "url": "https://pkg.go.dev/github.com/spf13/pflag"
17
+ },
18
+ {
19
+ "component": "github.com/volcengine/ve-tos-golang-sdk/v2",
20
+ "license": "Apache-2.0",
21
+ "url": "https://pkg.go.dev/github.com/volcengine/ve-tos-golang-sdk/v2"
22
+ },
23
+ {
24
+ "component": "golang.org/x/sync",
25
+ "license": "BSD-3-Clause",
26
+ "url": "https://pkg.go.dev/golang.org/x/sync"
27
+ },
28
+ {
29
+ "component": "golang.org/x/sys",
30
+ "license": "BSD-3-Clause",
31
+ "url": "https://pkg.go.dev/golang.org/x/sys"
32
+ },
33
+ {
34
+ "component": "github.com/inconshreveable/mousetrap",
35
+ "license": "Apache-2.0",
36
+ "url": "https://pkg.go.dev/github.com/inconshreveable/mousetrap"
37
+ }
38
+ ]
39
+ }
package/bin/s3dcli.cjs ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ // Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ 'use strict';
17
+
18
+ const { createHash } = require('node:crypto');
19
+ const fs = require('node:fs');
20
+ const path = require('node:path');
21
+ const { spawnSync } = require('node:child_process');
22
+
23
+ function targetFor(platform, arch) {
24
+ const platforms = { darwin: 'darwin', linux: 'linux', win32: 'windows' };
25
+ const arches = { x64: 'amd64', arm64: 'arm64' };
26
+ if (!Object.hasOwn(platforms, platform) || !Object.hasOwn(arches, arch)) {
27
+ throw new Error(`Unsupported platform ${platform}/${arch}; supported: macOS, Linux, Windows on x64/arm64.`);
28
+ }
29
+ return `${platforms[platform]}-${arches[arch]}`;
30
+ }
31
+
32
+ function binaryFor(root, platform = process.platform, arch = process.arch) {
33
+ const target = targetFor(platform, arch);
34
+ const manifest = JSON.parse(fs.readFileSync(path.join(root, 'manifest.json'), 'utf8'));
35
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
36
+ if (manifest.schema !== 1 || manifest.version !== pkg.version) {
37
+ throw new Error('Package metadata mismatch; reinstall s3dcli.');
38
+ }
39
+ const entry = manifest.platforms && manifest.platforms[target];
40
+ if (!entry || !/^[a-f0-9]{64}$/.test(entry.sha256 || '')) {
41
+ throw new Error(`Missing checksum for ${target}; reinstall s3dcli.`);
42
+ }
43
+ const binary = path.join(root, 'native', `s3dcli-${target}${platform === 'win32' ? '.exe' : ''}`);
44
+ const actual = createHash('sha256').update(fs.readFileSync(binary)).digest('hex');
45
+ if (actual !== entry.sha256) throw new Error(`Binary checksum mismatch for ${target}; reinstall s3dcli.`);
46
+ return binary;
47
+ }
48
+
49
+ function main() {
50
+ try {
51
+ const binary = binaryFor(path.resolve(__dirname, '..'));
52
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit', windowsHide: false });
53
+ if (result.error) throw result.error;
54
+ if (result.signal) {
55
+ process.kill(process.pid, result.signal);
56
+ return;
57
+ }
58
+ process.exitCode = result.status === null ? 1 : result.status;
59
+ } catch (error) {
60
+ console.error(`s3dcli: ${error.message}`);
61
+ process.exitCode = 1;
62
+ }
63
+ }
64
+
65
+ if (require.main === module) main();
66
+ module.exports = { targetFor, binaryFor };
package/manifest.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "schema": 1,
3
+ "version": "0.1.0",
4
+ "platforms": {
5
+ "darwin-amd64": {
6
+ "sha256": "fbf8bbb366193f28922499c2b3a3b6b061ce9c9c51cc1417380481c9033ca5f1"
7
+ },
8
+ "darwin-arm64": {
9
+ "sha256": "1e0755e47fbace6e28b1b2f073870a389842d82ea77b49ef33c7d28d61f020a7"
10
+ },
11
+ "linux-amd64": {
12
+ "sha256": "b3e4894c3ce6bd93389bb2dae9f8b55933e4c140b7758904e8babcabe5ab896b"
13
+ },
14
+ "linux-arm64": {
15
+ "sha256": "4a97abe7e176f9cfe673a141659941246629fde688a2912d12212c6eb4cceff6"
16
+ },
17
+ "windows-amd64": {
18
+ "sha256": "1bd92a61cf4d1a511d2f3651eaee3c109ca4f751d894ef59b793c4f78b1b8251"
19
+ },
20
+ "windows-arm64": {
21
+ "sha256": "c220c3635eb6b85f9b0332b07b1011a6127f667092830f95ff2be41aadc42521"
22
+ }
23
+ }
24
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@volcengine/s3d-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Seed3D CLI: Volcengine SSO, TOS uploads, image and 3D generation",
5
+ "license": "Apache-2.0",
6
+ "bin": {
7
+ "s3dcli": "bin/s3dcli.cjs"
8
+ },
9
+ "engines": {
10
+ "node": ">=20"
11
+ },
12
+ "os": [
13
+ "darwin",
14
+ "linux",
15
+ "win32"
16
+ ],
17
+ "cpu": [
18
+ "x64",
19
+ "arm64"
20
+ ],
21
+ "publishConfig": {
22
+ "registry": "https://registry.npmjs.org/",
23
+ "access": "public"
24
+ },
25
+ "files": [
26
+ "bin/",
27
+ "native/",
28
+ "manifest.json",
29
+ "README.md",
30
+ "LICENSE",
31
+ "THIRD_PARTY_NOTICES.txt",
32
+ "Third-party software notice.json"
33
+ ]
34
+ }