@postalsys/email-ai-tools 1.8.19 → 1.9.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.
package/.eslintrc CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "rules": {
3
3
  "indent": 0,
4
+ "quotes": 0,
5
+ "linebreak-style": 0,
6
+ "semi": 0,
7
+ "comma-dangle": 0,
8
+ "comma-style": 0,
9
+ "arrow-body-style": 0,
10
+ "arrow-parens": 0,
4
11
  "no-await-in-loop": 0,
5
12
  "require-atomic-updates": 0
6
13
  },
@@ -6,32 +6,31 @@ on:
6
6
  permissions:
7
7
  contents: write
8
8
  pull-requests: write
9
+ issues: write
9
10
  id-token: write
10
11
 
11
12
  name: release
12
13
  jobs:
13
14
  release-please:
14
15
  runs-on: ubuntu-latest
16
+ outputs:
17
+ release_created: ${{ steps.release.outputs.release_created }}
15
18
  steps:
16
- - uses: google-github-actions/release-please-action@v3
19
+ - uses: googleapis/release-please-action@v4
17
20
  id: release
21
+
22
+ publish:
23
+ needs: release-please
24
+ if: ${{ needs.release-please.outputs.release_created }}
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: read
28
+ id-token: write
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-node@v4
18
32
  with:
19
- release-type: node
20
- package-name: ${{vars.NPM_MODULE_NAME}}
21
- pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
22
- # The logic below handles the npm publication:
23
- - uses: actions/checkout@v3
24
- # these if statements ensure that a publication only occurs when
25
- # a new release is created:
26
- if: ${{ steps.release.outputs.release_created }}
27
- - uses: actions/setup-node@v3
28
- with:
29
- node-version: 20
33
+ node-version: 24
30
34
  registry-url: 'https://registry.npmjs.org'
31
- if: ${{ steps.release.outputs.release_created }}
32
35
  - run: npm ci
33
- if: ${{ steps.release.outputs.release_created }}
34
36
  - run: npm publish --provenance --access public
35
- env:
36
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
37
- if: ${{ steps.release.outputs.release_created }}
package/.ncurc.js CHANGED
@@ -1,8 +1,9 @@
1
+ 'use strict';
2
+
1
3
  module.exports = {
2
4
  upgrade: true,
3
5
  reject: [
4
6
  // Block package upgrades that moved to ESM
5
- 'nanoid',
6
- 'eslint-config-prettier'
7
+ 'nanoid'
7
8
  ]
8
9
  };
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ package-lock.json
3
+ CHANGELOG.md
package/.prettierrc.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  module.exports = {
2
4
  printWidth: 160,
3
5
  tabWidth: 4,
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.9.0"
3
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.0](https://github.com/postalsys/email-ai-tools/compare/email-ai-tools-v1.8.19...email-ai-tools-v1.9.0) (2025-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **chat:** Added question sorting method ([6b5ce50](https://github.com/postalsys/email-ai-tools/commit/6b5ce506f7d43e03b1dd9f6ae0142c976a4eb88e))
9
+ * **embeddings:** Support for embeddings query ([5c40f15](https://github.com/postalsys/email-ai-tools/commit/5c40f1504f969cb39270edf28e06e2ea65681fc1))
10
+ * **list-models:** new method to list available models ([7ddb033](https://github.com/postalsys/email-ai-tools/commit/7ddb0334d1cc7b702533aec004b249ef5b1654b7))
11
+ * **models:** Support GTP-3 Instruct ([6a15fc4](https://github.com/postalsys/email-ai-tools/commit/6a15fc4fdda175485fc22b2bc5fa68a281ee65f5))
12
+ * **openai:** Allow to specify base API url ([04ebd3d](https://github.com/postalsys/email-ai-tools/commit/04ebd3d5adfd88ec7a681bbffed4fb302c982846))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * better model listing ([05fff58](https://github.com/postalsys/email-ai-tools/commit/05fff589726c39f3b82691d4383e8d9242fc172f))
18
+ * bumped deps ([89c148b](https://github.com/postalsys/email-ai-tools/commit/89c148ba37ee869bfc7c06350efefa7a50fbd630))
19
+ * bumped deps ([436db20](https://github.com/postalsys/email-ai-tools/commit/436db20f6c9800a20e10a90622b3a5c94dd611ad))
20
+ * bumped deps ([c253ed0](https://github.com/postalsys/email-ai-tools/commit/c253ed026313672adf9432412ab45d0e14870954))
21
+ * Bumped deps ([59e3b08](https://github.com/postalsys/email-ai-tools/commit/59e3b0844c0cdb8a40206c19ed86528e4d7269c5))
22
+ * Bumped deps ([95056e4](https://github.com/postalsys/email-ai-tools/commit/95056e471721571bc4ed19a7330745a1540d4632))
23
+ * Bumped deps ([008ae6c](https://github.com/postalsys/email-ai-tools/commit/008ae6c6fa95b4aff85fd8229d97837ea068e0bd))
24
+ * Bumped deps ([33b87cd](https://github.com/postalsys/email-ai-tools/commit/33b87cdd3f3f26e8ceade75ff99d12219c7c2eb6))
25
+ * **chat:** fixed response parsing for markdown responses ([34c4fdd](https://github.com/postalsys/email-ai-tools/commit/34c4fdda3ee7eca3a66d5f469cb4ee7a1f777083))
26
+ * **chat:** generate and return chat topic ([47755fb](https://github.com/postalsys/email-ai-tools/commit/47755fb0a8625df3bc43c2dc5b410d419e90bc03))
27
+ * **chat:** Include the name and email of the person asking the question in the prompt for context ([79bf33c](https://github.com/postalsys/email-ai-tools/commit/79bf33ca1ccd47e3680e912aebe8bcd243578507))
28
+ * **deloy:** Set up automatic publishing ([18e2dc0](https://github.com/postalsys/email-ai-tools/commit/18e2dc00a2c123995f2e67c81c132e4380021dd7))
29
+ * **deps:** bumped dependencies ([b53b9c8](https://github.com/postalsys/email-ai-tools/commit/b53b9c86f7fc963ccf261e27b6ece37b1424281a))
30
+ * **deps:** bumped deps ([234a0f3](https://github.com/postalsys/email-ai-tools/commit/234a0f36130500efa72afc194b4e73dc86eb4d24))
31
+ * **deps:** Bumped deps ([e2eef79](https://github.com/postalsys/email-ai-tools/commit/e2eef79c36da0a500bd11ab9ffe4bb86fd791b7d))
32
+ * **deps:** Bumped deps ([1097be6](https://github.com/postalsys/email-ai-tools/commit/1097be6a6241e2b9bfcece2e8bb07fe078889602))
33
+ * **deps:** Bumped deps ([7f41de8](https://github.com/postalsys/email-ai-tools/commit/7f41de8776311c89803fd02ee73423e572981f9e))
34
+ * **deps:** Bumped deps ([948331a](https://github.com/postalsys/email-ai-tools/commit/948331abdc924392d0a5654b1683e92131ad6154))
35
+ * **deps:** Bumped deps ([52bc6d5](https://github.com/postalsys/email-ai-tools/commit/52bc6d56aaa904a0f640086626a927766e316c14))
36
+ * **deps:** Bumped deps ([d1ba73e](https://github.com/postalsys/email-ai-tools/commit/d1ba73ee14c3d1cd680a64fba637ae658460dcf3))
37
+ * **deps:** Bumped email-text-tools ([05cd642](https://github.com/postalsys/email-ai-tools/commit/05cd642b31778f8bcddeccf2513d99524db5cc84))
38
+ * **deps:** bumped nodemailer ([375c5fd](https://github.com/postalsys/email-ai-tools/commit/375c5fd25162880b32205bee155cf694a91bad23))
39
+ * **Deps:** fixed deps ([b6a2dea](https://github.com/postalsys/email-ai-tools/commit/b6a2dea7305bbf064e2d0a24e6c31c87180629c3))
40
+ * **deps:** Updated undici ([64ec2e7](https://github.com/postalsys/email-ai-tools/commit/64ec2e7148be9d83a255a08f9ab50a934eeacf99))
41
+ * **embeddings:** Changed embeddings output structure ([368467c](https://github.com/postalsys/email-ai-tools/commit/368467cabcb21dab9d4819933f6d3027f3cd3f26))
42
+ * **embeddings:** remove quoted lines ([fb5dd92](https://github.com/postalsys/email-ai-tools/commit/fb5dd92b834249a0290113df4c42b2f01eb22e84))
43
+ * **logging:** Log API url if verbose ([2e2b9d9](https://github.com/postalsys/email-ai-tools/commit/2e2b9d9bc605b3261f420855d5ae2d0ca5878153))
44
+ * **package:** updated package-lock ([a892178](https://github.com/postalsys/email-ai-tools/commit/a89217801c7d05a281c031a9ac72593e29febc97))
45
+ * **questions:** Tuned sort ordering ([6f6b3f4](https://github.com/postalsys/email-ai-tools/commit/6f6b3f467e70cca1dab82410c07029ca98932d7d))
46
+ * Replaced punycode with punycode.js ([5c54d20](https://github.com/postalsys/email-ai-tools/commit/5c54d202c700230fac4ae87899d32bcafa56dfca))
47
+
3
48
  ## [1.8.19](https://github.com/postalsys/email-ai-tools/compare/v1.8.18...v1.8.19) (2025-10-09)
4
49
 
5
50
 
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ const { FlatCompat } = require('@eslint/eslintrc');
4
+ const js = require('@eslint/js');
5
+
6
+ const compat = new FlatCompat({
7
+ baseDirectory: __dirname,
8
+ recommendedConfig: js.configs.recommended
9
+ });
10
+
11
+ module.exports = [
12
+ {
13
+ ignores: ['node_modules/**', 'examples/**']
14
+ },
15
+ ...compat.extends('nodemailer', 'prettier'),
16
+ {
17
+ languageOptions: {
18
+ ecmaVersion: 2020,
19
+ sourceType: 'script',
20
+ globals: {
21
+ BigInt: 'readonly'
22
+ }
23
+ },
24
+ rules: {
25
+ // Disable all formatting rules (handled by Prettier)
26
+ indent: 0,
27
+ quotes: 0,
28
+ 'linebreak-style': 0,
29
+ semi: 0,
30
+ 'comma-dangle': 0,
31
+ 'comma-style': 0,
32
+ 'arrow-body-style': 0,
33
+ 'arrow-parens': 0,
34
+ // Keep these disabled
35
+ 'no-await-in-loop': 0,
36
+ 'require-atomic-updates': 0
37
+ }
38
+ }
39
+ ];
@@ -150,7 +150,6 @@ async function embeddingsQuery(apiToken, opts) {
150
150
  promptText = promptText.substr(0, MAX_ALLOWED_TEXT_LENGTH);
151
151
  }
152
152
 
153
- // eslint-disable-next-line no-constant-condition
154
153
  while (true) {
155
154
  prompt = `${SCHEMA_PROMPT}
156
155
 
@@ -156,7 +156,7 @@ class Embedder {
156
156
  subject = (value || '').toString().trim();
157
157
  try {
158
158
  subject = libmime.decodeWords(subject);
159
- } catch (err) {
159
+ } catch {
160
160
  // ignore?
161
161
  }
162
162
  if (subject) {
@@ -238,7 +238,7 @@ class Embedder {
238
238
  try {
239
239
  const parsedUrl = new URL(part.url);
240
240
  return `${parsedUrl.protocol}//${parsedUrl.host}`;
241
- } catch (err) {
241
+ } catch {
242
242
  return ' ';
243
243
  }
244
244
  }
@@ -246,7 +246,7 @@ class Embedder {
246
246
  })
247
247
  .join('');
248
248
  }
249
- } catch (err) {
249
+ } catch {
250
250
  // ignore?
251
251
  }
252
252
 
@@ -264,7 +264,7 @@ class Embedder {
264
264
  let addr = address.address || '';
265
265
  try {
266
266
  name = libmime.decodeWords(name);
267
- } catch (err) {
267
+ } catch {
268
268
  // ignore?
269
269
  }
270
270
 
@@ -184,7 +184,6 @@ async function generateSummary(message, apiToken, opts) {
184
184
  promptText = promptText.substr(0, MAX_ALLOWED_TEXT_LENGTH);
185
185
  }
186
186
 
187
- // eslint-disable-next-line no-constant-condition
188
187
  while (true) {
189
188
  content.text = promptText;
190
189
  prompt = `${userPrompt}
@@ -245,7 +245,7 @@ ${JSON.stringify(content)}`;
245
245
  try {
246
246
  values = JSON.parse(output);
247
247
  values.risk = Number(values.risk) || -1;
248
- } catch (err) {
248
+ } catch {
249
249
  let error = new Error('Failed to parse output from OpenAI API');
250
250
  error.textContent = output;
251
251
  throw error;
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@postalsys/email-ai-tools",
3
- "version": "1.8.19",
3
+ "version": "1.9.0",
4
4
  "description": "Email AI tools",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
8
+ "update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
9
+ "format": "prettier --write \"**/*.{js,json,md}\" --ignore-path .prettierignore",
10
+ "lint": "eslint ."
9
11
  },
10
12
  "repository": {
11
13
  "type": "git",
@@ -19,18 +21,22 @@
19
21
  },
20
22
  "homepage": "https://github.com/postalsys/email-ai-tools#readme",
21
23
  "devDependencies": {
24
+ "@eslint/eslintrc": "3.3.1",
25
+ "@eslint/js": "9.38.0",
26
+ "eslint": "9.38.0",
22
27
  "eslint-config-nodemailer": "1.2.0",
23
- "eslint-config-prettier": "9.1.0",
24
- "mailparser": "3.7.4"
28
+ "eslint-config-prettier": "10.1.8",
29
+ "mailparser": "3.7.5",
30
+ "prettier": "3.6.2"
25
31
  },
26
32
  "dependencies": {
27
- "@postalsys/email-text-tools": "2.2.0",
33
+ "@postalsys/email-text-tools": "2.3.3",
28
34
  "gpt3-tokenizer": "1.1.5",
29
35
  "libmime": "5.3.7",
30
36
  "linkify-it": "5.0.0",
31
- "nodemailer": "7.0.9",
37
+ "nodemailer": "7.0.10",
32
38
  "punycode.js": "2.3.1",
33
- "tlds": "1.260.0",
39
+ "tlds": "1.261.0",
34
40
  "undici": "7.16.0"
35
41
  }
36
42
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "release-type": "node",
5
+ "package-name": "@postalsys/email-ai-tools",
6
+ "pull-request-title-pattern": "chore${scope}: release ${version} [skip-ci]"
7
+ }
8
+ }
9
+ }