utilitas 1999.1.87 → 1999.1.89

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/lib/callosum.mjs CHANGED
@@ -9,10 +9,12 @@ import cluster from 'cluster';
9
9
  import color from './color.mjs';
10
10
  import uoid from './uoid.mjs';
11
11
 
12
- const [MESSAGE, SECDFNTN, SIGTERM, GET, READY, SET, SHIFT, POP, DELKEY, CALL]
13
- = [
14
- 'message', 100, 'SIGTERM', 'GET', 'READY', 'SET', 'SHIFT', 'POP',
15
- 'DELKEY', 'CALL',
12
+ const [
13
+ MESSAGE, SECDFNTN, SIGINT, SIGTERM, GET, READY, SET, SHIFT, POP, DELKEY,
14
+ CALL,
15
+ ] = [
16
+ 'message', 100, 'SIGINT', 'SIGTERM', 'GET', 'READY', 'SET', 'SHIFT',
17
+ 'POP', 'DELKEY', 'CALL',
16
18
  ];
17
19
 
18
20
  const { isPrimary, isWorker, worker, workers } = cluster;
@@ -121,6 +123,7 @@ const init = async (options) => {
121
123
  || (code !== 0 && `exited with error code: ${code}`)
122
124
  || 'exited'}.`, worker);
123
125
  await runFunc(options?.onExit, [worker, code, signal]);
126
+ [SIGINT, SIGTERM].includes(signal) && process.exit(0);
124
127
  }); // https://nodejs.org/api/cluster.html
125
128
  cluster.on('online', async (worker) => {
126
129
  await runFunc(options?.onOnline, [worker]);
@@ -148,8 +151,7 @@ const init = async (options) => {
148
151
  }
149
152
  }, 3, 10, 0, eventName, { silent: true });
150
153
  } else {
151
- // https://www.knowledgehut.com/blog/web-development/node-js-process-exit
152
- process.on(SIGTERM, () => process.exit(12));
154
+ process.on(SIGTERM, () => process.exit(0));
153
155
  report(READY, await runFunc(options?.initWorker, [cluster.worker]));
154
156
  }
155
157
  };
package/lib/gen.mjs CHANGED
@@ -13,8 +13,8 @@ const [
13
13
  IMAGEN_MODEL, OPENAI_MODEL, VEO_MODEL,
14
14
  ] = [
15
15
  {}, 'OPENAI', 'GEMINI', 'BASE64', 'FILE', 'BUFFER',
16
- 'Error generating media.', 'imagen-3.0-generate-002', 'gpt-image-1',
17
- 'veo-2.0-generate-001',
16
+ 'Error generating media.', 'imagen-4.0-ultra-generate-001',
17
+ 'gpt-image-1', 'veo-3.0-generate-preview',
18
18
  ];
19
19
 
20
20
  const init = async (options) => {
@@ -109,7 +109,8 @@ const image = async (prompt, options) => {
109
109
  case GEMINI:
110
110
  var resp = await client.gen.models.generateImages({
111
111
  model: IMAGEN_MODEL, prompt, config: {
112
- numberOfImages: n, includeRaiReason: true,
112
+ numberOfImages: n, sampleImageSize: '2K',
113
+ includeRaiReason: true,
113
114
  // "1:1" (default), "3:4", "4:3", "9:16", and "16:9"
114
115
  aspectRatio: '16:9', personGeneration: 'allow_adult',
115
116
  ...options?.config || {},
@@ -153,7 +154,7 @@ const video = async (prompt, options) => {
153
154
  var resp = await client.gen.models.generateVideos({
154
155
  model: VEO_MODEL, prompt, config: {
155
156
  aspectRatio: '16:9', numberOfVideos: 1,
156
- personGeneration: 'allow_adult',
157
+ // personGeneration: 'allow_adult',
157
158
  enablePromptRewriting: true, addWatermark: false,
158
159
  includeRaiReason: true, ...options?.config || {},
159
160
  },
package/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.87",
4
+ "version": "1999.1.89",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.87",
4
+ "version": "1999.1.89",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",