@seekskyworld/ai-modeling 0.1.0 → 0.1.2

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 (108) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +24 -6
  3. package/README.zh-CN.md +24 -6
  4. package/dist/cli/artifacts/glb-jpeg.js +1 -1
  5. package/dist/cli/artifacts/glb-jpeg.js.map +1 -1
  6. package/dist/cli/artifacts/image-background-output.js +4 -2
  7. package/dist/cli/artifacts/image-background-output.js.map +1 -1
  8. package/dist/cli/artifacts/image-encoding.js +4 -2
  9. package/dist/cli/artifacts/image-encoding.js.map +1 -1
  10. package/dist/cli/artifacts/image-size-output.js +4 -2
  11. package/dist/cli/artifacts/image-size-output.js.map +1 -1
  12. package/dist/cli/artifacts/studio-fbx-texture.js +5 -2
  13. package/dist/cli/artifacts/studio-fbx-texture.js.map +1 -1
  14. package/dist/cli/auth/coordinator.js +3 -0
  15. package/dist/cli/auth/coordinator.js.map +1 -1
  16. package/dist/cli/auth/state.js +3 -0
  17. package/dist/cli/auth/state.js.map +1 -1
  18. package/dist/cli/auth/tools.js +2 -2
  19. package/dist/cli/auth/tools.js.map +1 -1
  20. package/dist/cli/auth/types.d.ts +4 -0
  21. package/dist/cli/auth/types.js.map +1 -1
  22. package/dist/cli/compat/frontend-convert-validation.js +1 -1
  23. package/dist/cli/compat/frontend-convert-validation.js.map +1 -1
  24. package/dist/cli/compat/frontend-static-convert-validation.js +1 -1
  25. package/dist/cli/compat/frontend-static-convert-validation.js.map +1 -1
  26. package/dist/cli/compat/lab-projected-segment-geometry.js +1 -1
  27. package/dist/cli/compat/lab-projected-segment-geometry.js.map +1 -1
  28. package/dist/cli/local/brush-model.js +1 -1
  29. package/dist/cli/local/brush-model.js.map +1 -1
  30. package/dist/cli/local/brush-paint.js +1 -1
  31. package/dist/cli/local/brush-paint.js.map +1 -1
  32. package/dist/cli/local/brush.js +1 -1
  33. package/dist/cli/local/brush.js.map +1 -1
  34. package/dist/cli/local/operations.js +1 -1
  35. package/dist/cli/local/operations.js.map +1 -1
  36. package/dist/cli/local/preview-render.js +1 -1
  37. package/dist/cli/local/preview-render.js.map +1 -1
  38. package/dist/cli/local/uv-raster.js +1 -1
  39. package/dist/cli/local/uv-raster.js.map +1 -1
  40. package/dist/cli/runtime/sharp.d.ts +5 -0
  41. package/dist/cli/runtime/sharp.js +21 -0
  42. package/dist/cli/runtime/sharp.js.map +1 -0
  43. package/dist/mcp/server.js +2 -2
  44. package/dist/mcp/server.js.map +1 -1
  45. package/docs/commands.md +5 -3
  46. package/docs/development.md +6 -4
  47. package/docs/usage.md +13 -9
  48. package/examples/README.md +2 -2
  49. package/examples/mcp-npx.json +1 -1
  50. package/npm-shrinkwrap.json +8 -4
  51. package/package.json +7 -3
  52. package/skills/ai-modeling/SKILL.md +1 -1
  53. package/skills/ai-modeling/references/pipelines.md +2 -2
  54. package/skills/ai-modeling/references/usage.md +6 -4
  55. package/node_modules/@napi-rs/keyring/LICENSE +0 -21
  56. package/node_modules/@napi-rs/keyring/README.md +0 -70
  57. package/node_modules/@napi-rs/keyring/index.d.ts +0 -232
  58. package/node_modules/@napi-rs/keyring/index.js +0 -706
  59. package/node_modules/@napi-rs/keyring/keytar.d.ts +0 -53
  60. package/node_modules/@napi-rs/keyring/keytar.js +0 -26
  61. package/node_modules/@napi-rs/keyring/package.json +0 -127
  62. package/node_modules/sharp/LICENSE +0 -191
  63. package/node_modules/sharp/README.md +0 -112
  64. package/node_modules/sharp/dist/channel.cjs +0 -177
  65. package/node_modules/sharp/dist/channel.mjs +0 -177
  66. package/node_modules/sharp/dist/colour.cjs +0 -199
  67. package/node_modules/sharp/dist/colour.mjs +0 -199
  68. package/node_modules/sharp/dist/composite.cjs +0 -213
  69. package/node_modules/sharp/dist/composite.mjs +0 -213
  70. package/node_modules/sharp/dist/constructor.cjs +0 -511
  71. package/node_modules/sharp/dist/constructor.mjs +0 -511
  72. package/node_modules/sharp/dist/index.cjs +0 -25
  73. package/node_modules/sharp/dist/index.d.cts +0 -1999
  74. package/node_modules/sharp/dist/index.d.mts +0 -2046
  75. package/node_modules/sharp/dist/index.mjs +0 -25
  76. package/node_modules/sharp/dist/input.cjs +0 -819
  77. package/node_modules/sharp/dist/input.mjs +0 -819
  78. package/node_modules/sharp/dist/is.cjs +0 -149
  79. package/node_modules/sharp/dist/is.mjs +0 -149
  80. package/node_modules/sharp/dist/libvips.cjs +0 -212
  81. package/node_modules/sharp/dist/libvips.mjs +0 -212
  82. package/node_modules/sharp/dist/operation.cjs +0 -1002
  83. package/node_modules/sharp/dist/operation.mjs +0 -1002
  84. package/node_modules/sharp/dist/output.cjs +0 -1786
  85. package/node_modules/sharp/dist/output.mjs +0 -1786
  86. package/node_modules/sharp/dist/resize.cjs +0 -617
  87. package/node_modules/sharp/dist/resize.mjs +0 -617
  88. package/node_modules/sharp/dist/sharp.cjs +0 -174
  89. package/node_modules/sharp/dist/sharp.mjs +0 -174
  90. package/node_modules/sharp/dist/utility.cjs +0 -301
  91. package/node_modules/sharp/dist/utility.mjs +0 -301
  92. package/node_modules/sharp/install/build.js +0 -38
  93. package/node_modules/sharp/lib/index.d.ts +0 -1999
  94. package/node_modules/sharp/package.json +0 -227
  95. package/node_modules/sharp/src/binding.gyp +0 -303
  96. package/node_modules/sharp/src/common.cc +0 -1186
  97. package/node_modules/sharp/src/common.h +0 -421
  98. package/node_modules/sharp/src/metadata.cc +0 -404
  99. package/node_modules/sharp/src/metadata.h +0 -95
  100. package/node_modules/sharp/src/operations.cc +0 -516
  101. package/node_modules/sharp/src/operations.h +0 -137
  102. package/node_modules/sharp/src/pipeline.cc +0 -1973
  103. package/node_modules/sharp/src/pipeline.h +0 -422
  104. package/node_modules/sharp/src/sharp.cc +0 -43
  105. package/node_modules/sharp/src/stats.cc +0 -186
  106. package/node_modules/sharp/src/stats.h +0 -62
  107. package/node_modules/sharp/src/utilities.cc +0 -289
  108. package/node_modules/sharp/src/utilities.h +0 -22
@@ -1,289 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- #include <cmath>
7
- #include <cstdio>
8
- #include <string>
9
-
10
- #include <napi.h>
11
- #include <vips/vips8>
12
- #include <vips/vector.h>
13
-
14
- #include "./common.h"
15
- #include "./operations.h"
16
- #include "./utilities.h"
17
-
18
- /*
19
- Get and set cache limits
20
- */
21
- Napi::Value cache(const Napi::CallbackInfo& info) {
22
- Napi::Env env = info.Env();
23
-
24
- // Set memory limit
25
- if (info[size_t(0)].IsNumber()) {
26
- vips_cache_set_max_mem(static_cast<size_t>(info[size_t(0)].As<Napi::Number>().Uint32Value()) * 1048576);
27
- }
28
- // Set file limit
29
- if (info[size_t(1)].IsNumber()) {
30
- vips_cache_set_max_files(info[size_t(1)].As<Napi::Number>().Uint32Value());
31
- }
32
- // Set items limit
33
- if (info[size_t(2)].IsNumber()) {
34
- vips_cache_set_max(info[size_t(2)].As<Napi::Number>().Uint32Value());
35
- }
36
-
37
- // Get memory stats
38
- Napi::Object memory = Napi::Object::New(env);
39
- memory.Set("current", round(vips_tracked_get_mem() / 1048576));
40
- memory.Set("high", round(vips_tracked_get_mem_highwater() / 1048576));
41
- memory.Set("max", round(vips_cache_get_max_mem() / 1048576));
42
- // Get file stats
43
- Napi::Object files = Napi::Object::New(env);
44
- files.Set("current", vips_tracked_get_files());
45
- files.Set("max", vips_cache_get_max_files());
46
-
47
- // Get item stats
48
- Napi::Object items = Napi::Object::New(env);
49
- items.Set("current", vips_cache_get_size());
50
- items.Set("max", vips_cache_get_max());
51
-
52
- Napi::Object cache = Napi::Object::New(env);
53
- cache.Set("memory", memory);
54
- cache.Set("files", files);
55
- cache.Set("items", items);
56
- return cache;
57
- }
58
-
59
- /*
60
- Get and set size of thread pool
61
- */
62
- Napi::Value concurrency(const Napi::CallbackInfo& info) {
63
- // Set concurrency
64
- if (info[size_t(0)].IsNumber()) {
65
- vips_concurrency_set(info[size_t(0)].As<Napi::Number>().Int32Value());
66
- }
67
- // Get concurrency
68
- return Napi::Number::New(info.Env(), vips_concurrency_get());
69
- }
70
-
71
- /*
72
- Get internal counters (queued tasks, processing tasks)
73
- */
74
- Napi::Value counters(const Napi::CallbackInfo& info) {
75
- Napi::Object counters = Napi::Object::New(info.Env());
76
- counters.Set("queue", static_cast<int>(sharp::counterQueue));
77
- counters.Set("process", static_cast<int>(sharp::counterProcess));
78
- return counters;
79
- }
80
-
81
- /*
82
- Get and set use of SIMD vector unit instructions
83
- */
84
- Napi::Value simd(const Napi::CallbackInfo& info) {
85
- // Set state
86
- if (info[size_t(0)].IsBoolean()) {
87
- vips_vector_set_enabled(info[size_t(0)].As<Napi::Boolean>().Value());
88
- }
89
- // Get state
90
- return Napi::Boolean::New(info.Env(), vips_vector_isenabled());
91
- }
92
-
93
- /*
94
- Get libvips version
95
- */
96
- Napi::Value libvipsVersion(const Napi::CallbackInfo& info) {
97
- Napi::Env env = info.Env();
98
- Napi::Object version = Napi::Object::New(env);
99
-
100
- char semver[9];
101
- std::snprintf(semver, sizeof(semver), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
102
- version.Set("semver", Napi::String::New(env, semver));
103
- #ifdef SHARP_USE_GLOBAL_LIBVIPS
104
- version.Set("isGlobal", Napi::Boolean::New(env, true));
105
- #else
106
- version.Set("isGlobal", Napi::Boolean::New(env, false));
107
- #endif
108
- #ifdef __EMSCRIPTEN__
109
- version.Set("isWasm", Napi::Boolean::New(env, true));
110
- #else
111
- version.Set("isWasm", Napi::Boolean::New(env, false));
112
- #endif
113
- return version;
114
- }
115
-
116
- /*
117
- Get available input/output file/buffer/stream formats
118
- */
119
- Napi::Value format(const Napi::CallbackInfo& info) {
120
- Napi::Env env = info.Env();
121
- Napi::Object format = Napi::Object::New(env);
122
- for (std::string const f : {
123
- "jpeg", "png", "webp", "tiff", "magick", "openslide", "dz",
124
- "ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl", "rad", "dcraw"
125
- }) {
126
- std::string id = f == "jp2k" ? "jp2" : f;
127
- // Input
128
- const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str());
129
- Napi::Boolean hasInputFile = Napi::Boolean::New(env, oc);
130
- Napi::Boolean hasInputBuffer =
131
- Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "load_buffer").c_str()));
132
- Napi::Object input = Napi::Object::New(env);
133
- input.Set("file", hasInputFile);
134
- input.Set("buffer", hasInputBuffer);
135
- input.Set("stream", hasInputBuffer);
136
- if (oc) {
137
- const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
138
- if (fc->suffs) {
139
- Napi::Array fileSuffix = Napi::Array::New(env);
140
- const char **suffix = fc->suffs;
141
- for (int i = 0; *suffix; i++, suffix++) {
142
- fileSuffix.Set(i, Napi::String::New(env, *suffix));
143
- }
144
- input.Set("fileSuffix", fileSuffix);
145
- }
146
- }
147
- // Output
148
- Napi::Boolean hasOutputFile =
149
- Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "save").c_str()));
150
- Napi::Boolean hasOutputBuffer =
151
- Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "save_buffer").c_str()));
152
- Napi::Object output = Napi::Object::New(env);
153
- output.Set("file", hasOutputFile);
154
- output.Set("buffer", hasOutputBuffer);
155
- output.Set("stream", hasOutputBuffer);
156
- // Other attributes
157
- Napi::Object container = Napi::Object::New(env);
158
- container.Set("id", id);
159
- container.Set("input", input);
160
- container.Set("output", output);
161
- // Add to set of formats
162
- format.Set(id, container);
163
- }
164
-
165
- // Raw, uncompressed data
166
- Napi::Boolean supported = Napi::Boolean::New(env, true);
167
- Napi::Boolean unsupported = Napi::Boolean::New(env, false);
168
- Napi::Object rawInput = Napi::Object::New(env);
169
- rawInput.Set("file", unsupported);
170
- rawInput.Set("buffer", supported);
171
- rawInput.Set("stream", supported);
172
- Napi::Object rawOutput = Napi::Object::New(env);
173
- rawOutput.Set("file", unsupported);
174
- rawOutput.Set("buffer", supported);
175
- rawOutput.Set("stream", supported);
176
- Napi::Object raw = Napi::Object::New(env);
177
- raw.Set("id", "raw");
178
- raw.Set("input", rawInput);
179
- raw.Set("output", rawOutput);
180
- format.Set("raw", raw);
181
-
182
- return format;
183
- }
184
-
185
- /*
186
- (Un)block libvips operations at runtime.
187
- */
188
- void block(const Napi::CallbackInfo& info) {
189
- Napi::Array ops = info[size_t(0)].As<Napi::Array>();
190
- bool const state = info[size_t(1)].As<Napi::Boolean>().Value();
191
- for (unsigned int i = 0; i < ops.Length(); i++) {
192
- vips_operation_block_set(ops.Get(i).As<Napi::String>().Utf8Value().c_str(), state);
193
- }
194
- }
195
-
196
- /*
197
- Synchronous, internal-only method used by some of the functional tests.
198
- Calculates the maximum colour distance using the DE2000 algorithm
199
- between two images of the same dimensions and number of channels.
200
- */
201
- Napi::Value _maxColourDistance(const Napi::CallbackInfo& info) {
202
- Napi::Env env = info.Env();
203
-
204
- // Open input files
205
- VImage image1;
206
- sharp::ImageType imageType1 = sharp::DetermineImageType(info[size_t(0)].As<Napi::String>().Utf8Value().data());
207
- if (imageType1 != sharp::ImageType::UNKNOWN) {
208
- try {
209
- image1 = VImage::new_from_file(info[size_t(0)].As<Napi::String>().Utf8Value().c_str());
210
- } catch (...) {
211
- throw Napi::Error::New(env, "Input file 1 has corrupt header");
212
- }
213
- } else {
214
- throw Napi::Error::New(env, "Input file 1 is of an unsupported image format");
215
- }
216
- VImage image2;
217
- sharp::ImageType imageType2 = sharp::DetermineImageType(info[size_t(1)].As<Napi::String>().Utf8Value().data());
218
- if (imageType2 != sharp::ImageType::UNKNOWN) {
219
- try {
220
- image2 = VImage::new_from_file(info[size_t(1)].As<Napi::String>().Utf8Value().c_str());
221
- } catch (...) {
222
- throw Napi::Error::New(env, "Input file 2 has corrupt header");
223
- }
224
- } else {
225
- throw Napi::Error::New(env, "Input file 2 is of an unsupported image format");
226
- }
227
- // Ensure same number of channels
228
- if (image1.bands() != image2.bands()) {
229
- throw Napi::Error::New(env, "mismatchedBands");
230
- }
231
- // Ensure same dimensions
232
- if (image1.width() != image2.width() || image1.height() != image2.height()) {
233
- throw Napi::Error::New(env, "mismatchedDimensions");
234
- }
235
-
236
- double maxColourDistance;
237
- try {
238
- // Premultiply and remove alpha
239
- if (image1.has_alpha()) {
240
- image1 = image1.premultiply().extract_band(1, VImage::option()->set("n", image1.bands() - 1));
241
- }
242
- if (image2.has_alpha()) {
243
- image2 = image2.premultiply().extract_band(1, VImage::option()->set("n", image2.bands() - 1));
244
- }
245
- // Calculate colour distance
246
- maxColourDistance = image1.dE00(image2).max();
247
- } catch (std::runtime_error const &err) {
248
- throw Napi::Error::New(env, err.what());
249
- }
250
-
251
- // Clean up libvips' per-request data and threads
252
- vips_error_clear();
253
- vips_thread_shutdown();
254
-
255
- return Napi::Number::New(env, maxColourDistance);
256
- }
257
-
258
- #if defined(__GNUC__)
259
- // mallctl will be resolved by the runtime linker when jemalloc is being used
260
- extern "C" {
261
- int mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) __attribute__((weak));
262
- }
263
- Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info) {
264
- Napi::Env env = info.Env();
265
- return Napi::Boolean::New(env, mallctl != nullptr);
266
- }
267
- #else
268
- Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info) {
269
- Napi::Env env = info.Env();
270
- return Napi::Boolean::New(env, false);
271
- }
272
- #endif
273
-
274
- #if defined(__GNUC__) && defined(__x86_64__)
275
- // Are SSE 4.2 intrinsics available at runtime?
276
- Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info) {
277
- Napi::Env env = info.Env();
278
- unsigned int eax, ebx, ecx, edx;
279
- __asm__ __volatile__("cpuid"
280
- : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
281
- : "a"(1));
282
- return Napi::Boolean::New(env, (ecx & 1U << 20) != 0);
283
- }
284
- #else
285
- Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info) {
286
- Napi::Env env = info.Env();
287
- return Napi::Boolean::New(env, false);
288
- }
289
- #endif
@@ -1,22 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- #ifndef SRC_UTILITIES_H_
7
- #define SRC_UTILITIES_H_
8
-
9
- #include <napi.h>
10
-
11
- Napi::Value cache(const Napi::CallbackInfo& info);
12
- Napi::Value concurrency(const Napi::CallbackInfo& info);
13
- Napi::Value counters(const Napi::CallbackInfo& info);
14
- Napi::Value simd(const Napi::CallbackInfo& info);
15
- Napi::Value libvipsVersion(const Napi::CallbackInfo& info);
16
- Napi::Value format(const Napi::CallbackInfo& info);
17
- void block(const Napi::CallbackInfo& info);
18
- Napi::Value _maxColourDistance(const Napi::CallbackInfo& info);
19
- Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info);
20
- Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info);
21
-
22
- #endif // SRC_UTILITIES_H_