@lowdefy/build 5.5.0 → 5.6.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.
@@ -112,7 +112,15 @@ import createTestLogger from './createTestLogger.js';
112
112
  package: '@lowdefy/blocks-basic'
113
113
  }
114
114
  },
115
+ agents: {
116
+ ClaudeAgent: {
117
+ package: '@lowdefy/connection-anthropic'
118
+ }
119
+ },
115
120
  connections: {
121
+ Anthropic: {
122
+ package: '@lowdefy/connection-anthropic'
123
+ },
116
124
  AxiosHttp: {
117
125
  package: '@lowdefy/connection-axios-http'
118
126
  },
@@ -12,19 +12,47 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import { BuildError, LowdefyInternalError } from '@lowdefy/errors';
15
+ */ import { BuildError, LowdefyInternalError, resolveErrorLocation } from '@lowdefy/errors';
16
16
  function logCollectedErrors(context) {
17
17
  if (context.errors.length === 0) return;
18
- context.errors.forEach((err)=>{
19
- if (err.isLowdefyError) {
20
- context.handleError(err);
21
- } else {
22
- const lowdefyErr = new LowdefyInternalError(err.message, {
23
- cause: err
18
+ let loggedCount = 0;
19
+ const seenSourceMessages = new Set();
20
+ for (const err of context.errors){
21
+ const lowdefyErr = err.isLowdefyError ? err : new LowdefyInternalError(err.message, {
22
+ cause: err
23
+ });
24
+ // handleError resolves the location and logs in one step, so the location
25
+ // has to be resolved here to decide whether the entry is worth logging at
26
+ // all. Resolution is pure, so handleError repeating it yields the same
27
+ // location. Resolution reads author-supplied data (keyMap entries, refMap
28
+ // paths), so a malformed entry can throw; the whole error report is worth
29
+ // more than one error's source line, so a failure leaves the error
30
+ // unlocated here and handleError logs it with its own guarded resolution.
31
+ let location = null;
32
+ try {
33
+ location = resolveErrorLocation(lowdefyErr, {
34
+ keyMap: context.keyMap,
35
+ refMap: context.refMap,
36
+ configDirectory: context.directories?.config
24
37
  });
25
- context.handleError(lowdefyErr);
38
+ } catch {
39
+ location = null;
26
40
  }
27
- });
28
- throw new BuildError(`Build failed with ${context.errors.length} error(s). See above for details.`);
41
+ // Two build steps can report the same config line: buildAuth reaches page,
42
+ // endpoint and agent ids before validateId does, and both gates give the
43
+ // same message. Two genuinely distinct errors never share both a resolved
44
+ // source line and a message, so that pair is safe to collapse. Without a
45
+ // resolved source line there is no such evidence - the message alone would
46
+ // collapse distinct internal errors and under-count the failures - so
47
+ // unlocated errors are always reported.
48
+ if (location?.source) {
49
+ const dedupKey = `${location.source}\n${lowdefyErr.message}`;
50
+ if (seenSourceMessages.has(dedupKey)) continue;
51
+ seenSourceMessages.add(dedupKey);
52
+ }
53
+ context.handleError(lowdefyErr);
54
+ loggedCount += 1;
55
+ }
56
+ throw new BuildError(`Build failed with ${loggedCount} error(s). See above for details.`);
29
57
  }
30
58
  export default logCollectedErrors;
@@ -13,6 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { ConfigError } from '@lowdefy/errors';
16
+ import { isReserved } from '@lowdefy/helpers';
16
17
  const validIdPattern = /^[A-Za-z0-9\-_/:]+$/;
17
18
  function validateId({ id, field, location, configKey }) {
18
19
  if (!validIdPattern.test(id)) {
@@ -20,5 +21,15 @@ function validateId({ id, field, location, configKey }) {
20
21
  configKey
21
22
  });
22
23
  }
24
+ // The pattern above admits every reserved name - underscores and letters are in its allowed set.
25
+ // A reserved id re-parents the plain-object registries that key on it - the engine's `requests`
26
+ // and `requestConfig` maps, and the connection/websocket/notification/endpoint maps - so reject
27
+ // it here where the config location is still in hand. Block ids do not reach this gate: they are
28
+ // dot-paths, so the pattern above excludes them and they carry their own per-segment check.
29
+ if (isReserved(id)) {
30
+ throw new ConfigError(`${field} "${id}"${location ? ` at ${location}` : ''} is a reserved name and cannot be used as an id.`, {
31
+ configKey
32
+ });
33
+ }
23
34
  }
24
35
  export default validateId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,17 +45,17 @@
45
45
  "dist/*"
46
46
  ],
47
47
  "dependencies": {
48
- "@lowdefy/ai-utils": "5.5.0",
49
- "@lowdefy/ajv": "5.5.0",
50
- "@lowdefy/block-utils": "5.5.0",
51
- "@lowdefy/blocks-basic": "5.5.0",
52
- "@lowdefy/blocks-loaders": "5.5.0",
53
- "@lowdefy/errors": "5.5.0",
54
- "@lowdefy/helpers": "5.5.0",
55
- "@lowdefy/node-utils": "5.5.0",
56
- "@lowdefy/nunjucks": "5.5.0",
57
- "@lowdefy/operators": "5.5.0",
58
- "@lowdefy/operators-js": "5.5.0",
48
+ "@lowdefy/ai-utils": "5.6.0",
49
+ "@lowdefy/ajv": "5.6.0",
50
+ "@lowdefy/block-utils": "5.6.0",
51
+ "@lowdefy/blocks-basic": "5.6.0",
52
+ "@lowdefy/blocks-loaders": "5.6.0",
53
+ "@lowdefy/errors": "5.6.0",
54
+ "@lowdefy/helpers": "5.6.0",
55
+ "@lowdefy/node-utils": "5.6.0",
56
+ "@lowdefy/nunjucks": "5.6.0",
57
+ "@lowdefy/operators": "5.6.0",
58
+ "@lowdefy/operators-js": "5.6.0",
59
59
  "ajv": "8.12.0",
60
60
  "json5": "2.2.3",
61
61
  "picomatch": "4.0.1",
@@ -66,44 +66,44 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@jest/globals": "28.1.3",
69
- "@lowdefy/actions-core": "5.5.0",
70
- "@lowdefy/actions-pdf-make": "5.5.0",
71
- "@lowdefy/blocks-aggrid": "5.5.0",
72
- "@lowdefy/blocks-antd": "5.5.0",
73
- "@lowdefy/blocks-antd-x": "5.5.0",
74
- "@lowdefy/blocks-diff": "5.5.0",
75
- "@lowdefy/blocks-echarts": "5.5.0",
76
- "@lowdefy/blocks-google-maps": "5.5.0",
77
- "@lowdefy/blocks-markdown": "5.5.0",
78
- "@lowdefy/blocks-qr": "5.5.0",
79
- "@lowdefy/blocks-tiptap": "5.5.0",
80
- "@lowdefy/connection-ai-gateway": "5.5.0",
81
- "@lowdefy/connection-anthropic": "5.5.0",
82
- "@lowdefy/connection-axios-http": "5.5.0",
83
- "@lowdefy/connection-elasticsearch": "5.5.0",
84
- "@lowdefy/connection-google": "5.5.0",
85
- "@lowdefy/connection-google-sheets": "5.5.0",
86
- "@lowdefy/connection-knex": "5.5.0",
87
- "@lowdefy/connection-mcp": "5.5.0",
88
- "@lowdefy/connection-mongodb": "5.5.0",
89
- "@lowdefy/connection-openai": "5.5.0",
90
- "@lowdefy/connection-redis": "5.5.0",
91
- "@lowdefy/connection-sendgrid": "5.5.0",
92
- "@lowdefy/connection-stripe": "5.5.0",
93
- "@lowdefy/connection-test": "5.5.0",
94
- "@lowdefy/logger": "5.5.0",
95
- "@lowdefy/operators-change-case": "5.5.0",
96
- "@lowdefy/operators-dayjs": "5.5.0",
97
- "@lowdefy/operators-diff": "5.5.0",
98
- "@lowdefy/operators-jsonata": "5.5.0",
99
- "@lowdefy/operators-mql": "5.5.0",
100
- "@lowdefy/operators-nunjucks": "5.5.0",
101
- "@lowdefy/operators-uuid": "5.5.0",
102
- "@lowdefy/operators-yaml": "5.5.0",
103
- "@lowdefy/plugin-auth0": "5.5.0",
104
- "@lowdefy/plugin-aws": "5.5.0",
105
- "@lowdefy/plugin-csv": "5.5.0",
106
- "@lowdefy/plugin-next-auth": "5.5.0",
69
+ "@lowdefy/actions-core": "5.6.0",
70
+ "@lowdefy/actions-pdf-make": "5.6.0",
71
+ "@lowdefy/blocks-aggrid": "5.6.0",
72
+ "@lowdefy/blocks-antd": "5.6.0",
73
+ "@lowdefy/blocks-antd-x": "5.6.0",
74
+ "@lowdefy/blocks-diff": "5.6.0",
75
+ "@lowdefy/blocks-echarts": "5.6.0",
76
+ "@lowdefy/blocks-google-maps": "5.6.0",
77
+ "@lowdefy/blocks-markdown": "5.6.0",
78
+ "@lowdefy/blocks-qr": "5.6.0",
79
+ "@lowdefy/blocks-tiptap": "5.6.0",
80
+ "@lowdefy/connection-ai-gateway": "5.6.0",
81
+ "@lowdefy/connection-anthropic": "5.6.0",
82
+ "@lowdefy/connection-axios-http": "5.6.0",
83
+ "@lowdefy/connection-elasticsearch": "5.6.0",
84
+ "@lowdefy/connection-google": "5.6.0",
85
+ "@lowdefy/connection-google-sheets": "5.6.0",
86
+ "@lowdefy/connection-knex": "5.6.0",
87
+ "@lowdefy/connection-mcp": "5.6.0",
88
+ "@lowdefy/connection-mongodb": "5.6.0",
89
+ "@lowdefy/connection-openai": "5.6.0",
90
+ "@lowdefy/connection-redis": "5.6.0",
91
+ "@lowdefy/connection-sendgrid": "5.6.0",
92
+ "@lowdefy/connection-stripe": "5.6.0",
93
+ "@lowdefy/connection-test": "5.6.0",
94
+ "@lowdefy/logger": "5.6.0",
95
+ "@lowdefy/operators-change-case": "5.6.0",
96
+ "@lowdefy/operators-dayjs": "5.6.0",
97
+ "@lowdefy/operators-diff": "5.6.0",
98
+ "@lowdefy/operators-jsonata": "5.6.0",
99
+ "@lowdefy/operators-mql": "5.6.0",
100
+ "@lowdefy/operators-nunjucks": "5.6.0",
101
+ "@lowdefy/operators-uuid": "5.6.0",
102
+ "@lowdefy/operators-yaml": "5.6.0",
103
+ "@lowdefy/plugin-auth0": "5.6.0",
104
+ "@lowdefy/plugin-aws": "5.6.0",
105
+ "@lowdefy/plugin-csv": "5.6.0",
106
+ "@lowdefy/plugin-next-auth": "5.6.0",
107
107
  "@swc/cli": "0.8.0",
108
108
  "@swc/core": "1.15.18",
109
109
  "@swc/jest": "0.2.39",