@lowdefy/build 5.2.0 → 5.3.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/dist/index.js CHANGED
@@ -20,6 +20,7 @@ import makeId from './utils/makeId.js';
20
20
  import tryBuildStep from './utils/tryBuildStep.js';
21
21
  import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
22
22
  import addKeys from './build/addKeys.js';
23
+ import buildAgents from './build/buildAgents.js';
23
24
  import buildApp from './build/buildApp.js';
24
25
  import buildAuth from './build/buildAuth/buildAuth.js';
25
26
  import buildConnections from './build/buildConnections.js';
@@ -35,10 +36,12 @@ import buildRefs from './build/buildRefs/buildRefs.js';
35
36
  import collectPageContent from './build/collectPageContent.js';
36
37
  import buildTypes from './build/buildTypes.js';
37
38
  import cleanBuildDirectory from './build/cleanBuildDirectory.js';
39
+ import copyAgentFileSystems from './build/copyAgentFileSystems.js';
38
40
  import copyPublicFolder from './build/copyPublicFolder.js';
39
41
  import testSchema from './build/testSchema.js';
40
42
  import updateServerPackageJson from './build/full/updateServerPackageJson.js';
41
43
  import validateConfig from './build/validateConfig.js';
44
+ import writeAgents from './build/writeAgents.js';
42
45
  import writeApp from './build/writeApp.js';
43
46
  import writeAuth from './build/writeAuth.js';
44
47
  import writeConfig from './build/writeConfig.js';
@@ -133,6 +136,10 @@ async function build(options) {
133
136
  components,
134
137
  context
135
138
  });
139
+ tryBuildStep(buildAgents, 'buildAgents', {
140
+ components,
141
+ context
142
+ });
136
143
  tryBuildStep(buildPages, 'buildPages', {
137
144
  components,
138
145
  context
@@ -186,6 +193,10 @@ async function build(options) {
186
193
  components,
187
194
  context
188
195
  });
196
+ await writeAgents({
197
+ components,
198
+ context
199
+ });
189
200
  await writeApi({
190
201
  components,
191
202
  context
@@ -242,6 +253,10 @@ async function build(options) {
242
253
  components,
243
254
  context
244
255
  });
256
+ await copyAgentFileSystems({
257
+ components,
258
+ context
259
+ });
245
260
  } catch (err) {
246
261
  if (err instanceof BuildError) {
247
262
  throw err;
@@ -67,6 +67,229 @@ export default {
67
67
  }
68
68
  }
69
69
  },
70
+ agent: {
71
+ type: 'object',
72
+ additionalProperties: false,
73
+ required: [
74
+ 'id',
75
+ 'type',
76
+ 'connectionId'
77
+ ],
78
+ properties: {
79
+ '~ignoreBuildChecks': {
80
+ oneOf: [
81
+ {
82
+ const: true
83
+ },
84
+ {
85
+ type: 'array',
86
+ items: {
87
+ type: 'string',
88
+ enum: [
89
+ 'state-refs',
90
+ 'payload-refs',
91
+ 'step-refs',
92
+ 'link-refs',
93
+ 'request-refs',
94
+ 'connection-refs',
95
+ 'types',
96
+ 'schema'
97
+ ]
98
+ }
99
+ }
100
+ ]
101
+ },
102
+ '~r': {},
103
+ '~l': {},
104
+ id: {
105
+ type: 'string',
106
+ errorMessage: {
107
+ type: 'Agent "id" should be a string.'
108
+ }
109
+ },
110
+ type: {
111
+ type: 'string',
112
+ errorMessage: {
113
+ type: 'Agent "type" should be a string.'
114
+ }
115
+ },
116
+ connectionId: {
117
+ type: 'string',
118
+ errorMessage: {
119
+ type: 'Agent "connectionId" should be a string.'
120
+ }
121
+ },
122
+ properties: {
123
+ type: 'object',
124
+ errorMessage: {
125
+ type: 'Agent "properties" should be an object.'
126
+ }
127
+ },
128
+ tools: {
129
+ type: 'array',
130
+ items: {
131
+ anyOf: [
132
+ {
133
+ type: 'string'
134
+ },
135
+ {
136
+ type: 'object',
137
+ required: [
138
+ 'endpointId'
139
+ ],
140
+ properties: {
141
+ endpointId: {
142
+ type: 'string'
143
+ },
144
+ confirm: {
145
+ const: true
146
+ }
147
+ },
148
+ additionalProperties: false
149
+ }
150
+ ]
151
+ },
152
+ errorMessage: {
153
+ type: 'Agent "tools" should be an array.'
154
+ }
155
+ },
156
+ mcp: {
157
+ type: 'array',
158
+ items: {
159
+ anyOf: [
160
+ {
161
+ type: 'string'
162
+ },
163
+ {
164
+ type: 'object',
165
+ properties: {
166
+ connectionId: {
167
+ type: 'string'
168
+ },
169
+ url: {
170
+ type: 'string'
171
+ },
172
+ transport: {
173
+ type: 'string',
174
+ enum: [
175
+ 'http',
176
+ 'sse',
177
+ 'stdio'
178
+ ],
179
+ default: 'http'
180
+ },
181
+ headers: {
182
+ type: 'object'
183
+ },
184
+ command: {
185
+ type: 'string'
186
+ },
187
+ args: {
188
+ type: 'array',
189
+ items: {
190
+ type: 'string'
191
+ }
192
+ },
193
+ env: {
194
+ type: 'object'
195
+ },
196
+ confirm: {
197
+ const: true
198
+ }
199
+ },
200
+ additionalProperties: false
201
+ }
202
+ ]
203
+ },
204
+ errorMessage: {
205
+ type: 'Agent "mcp" should be an array.'
206
+ }
207
+ },
208
+ hooks: {
209
+ type: 'object',
210
+ properties: {
211
+ onStart: {
212
+ type: 'array',
213
+ items: {
214
+ type: 'string'
215
+ }
216
+ },
217
+ onStepStart: {
218
+ type: 'array',
219
+ items: {
220
+ type: 'string'
221
+ }
222
+ },
223
+ onToolCallStart: {
224
+ type: 'array',
225
+ items: {
226
+ type: 'string'
227
+ }
228
+ },
229
+ onToolCallFinish: {
230
+ type: 'array',
231
+ items: {
232
+ type: 'string'
233
+ }
234
+ },
235
+ onStepFinish: {
236
+ type: 'array',
237
+ items: {
238
+ type: 'string'
239
+ }
240
+ },
241
+ onFinish: {
242
+ type: 'array',
243
+ items: {
244
+ type: 'string'
245
+ }
246
+ }
247
+ },
248
+ errorMessage: {
249
+ type: 'Agent "hooks" should be an object.'
250
+ }
251
+ },
252
+ agents: {
253
+ type: 'array',
254
+ items: {
255
+ anyOf: [
256
+ {
257
+ type: 'string'
258
+ },
259
+ {
260
+ type: 'object',
261
+ required: [
262
+ 'agentId'
263
+ ],
264
+ properties: {
265
+ agentId: {
266
+ type: 'string'
267
+ },
268
+ description: {
269
+ type: 'string'
270
+ },
271
+ inputSchema: {
272
+ type: 'object'
273
+ }
274
+ },
275
+ additionalProperties: false
276
+ }
277
+ ]
278
+ },
279
+ errorMessage: {
280
+ type: 'Agent "agents" should be an array.'
281
+ }
282
+ }
283
+ },
284
+ errorMessage: {
285
+ type: 'Agent should be an object.',
286
+ required: {
287
+ id: 'Agent should have required property "id".',
288
+ type: 'Agent should have required property "type".',
289
+ connectionId: 'Agent should have required property "connectionId".'
290
+ }
291
+ }
292
+ },
70
293
  app: {
71
294
  type: 'object',
72
295
  additionalProperties: false,
@@ -905,6 +1128,18 @@ export default {
905
1128
  type: 'Api endpoint "type" should be a string.'
906
1129
  }
907
1130
  },
1131
+ description: {
1132
+ type: 'string',
1133
+ errorMessage: {
1134
+ type: 'Api endpoint "description" should be a string.'
1135
+ }
1136
+ },
1137
+ payloadSchema: {
1138
+ type: 'object',
1139
+ errorMessage: {
1140
+ type: 'Api endpoint "payloadSchema" should be an object.'
1141
+ }
1142
+ },
908
1143
  routine: {
909
1144
  anyOf: [
910
1145
  {
@@ -1495,6 +1730,15 @@ export default {
1495
1730
  type: 'App "global" should be an object.'
1496
1731
  }
1497
1732
  },
1733
+ agents: {
1734
+ type: 'array',
1735
+ items: {
1736
+ $ref: '#/definitions/agent'
1737
+ },
1738
+ errorMessage: {
1739
+ type: 'App "agents" should be an array.'
1740
+ }
1741
+ },
1498
1742
  connections: {
1499
1743
  type: 'array',
1500
1744
  items: {
@@ -21,6 +21,7 @@ async function generateDefaultTypesMap() {
21
21
  const packageFile = JSON.parse(await readFile(path.resolve(process.cwd(), './package.json')));
22
22
  const defaultTypesMap = {
23
23
  actions: {},
24
+ agents: {},
24
25
  auth: {
25
26
  adapters: {},
26
27
  callbacks: {},
@@ -29,6 +29,7 @@ function testContext({ writeBuildArtifact, configDirectory, readConfigFile, logg
29
29
  },
30
30
  typeCounters: {
31
31
  actions: createCounter(),
32
+ agents: createCounter(),
32
33
  auth: {
33
34
  adapters: createCounter(),
34
35
  callbacks: createCounter(),
@@ -49,6 +50,7 @@ function testContext({ writeBuildArtifact, configDirectory, readConfigFile, logg
49
50
  refMap: {},
50
51
  keyMap: {},
51
52
  jsMap: {},
53
+ agentIds: new Set(),
52
54
  connectionIds: new Set()
53
55
  };
54
56
  context.logger = {
@@ -32,6 +32,13 @@ function createPluginTypesMap({ packageName, packageTypes, typePrefix = '', type
32
32
  typePrefix,
33
33
  version
34
34
  });
35
+ createTypeDefinitions({
36
+ typeNames: packageTypes.agents,
37
+ store: typesMap.agents,
38
+ packageName,
39
+ typePrefix,
40
+ version
41
+ });
35
42
  createTypeDefinitions({
36
43
  typeNames: type.isObject(packageTypes.auth) ? packageTypes.auth.adapters : [],
37
44
  store: typesMap.auth.adapters,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,16 +45,17 @@
45
45
  "dist/*"
46
46
  ],
47
47
  "dependencies": {
48
- "@lowdefy/ajv": "5.2.0",
49
- "@lowdefy/block-utils": "5.2.0",
50
- "@lowdefy/blocks-basic": "5.2.0",
51
- "@lowdefy/blocks-loaders": "5.2.0",
52
- "@lowdefy/errors": "5.2.0",
53
- "@lowdefy/helpers": "5.2.0",
54
- "@lowdefy/node-utils": "5.2.0",
55
- "@lowdefy/nunjucks": "5.2.0",
56
- "@lowdefy/operators": "5.2.0",
57
- "@lowdefy/operators-js": "5.2.0",
48
+ "@lowdefy/ai-utils": "5.3.0",
49
+ "@lowdefy/ajv": "5.3.0",
50
+ "@lowdefy/block-utils": "5.3.0",
51
+ "@lowdefy/blocks-basic": "5.3.0",
52
+ "@lowdefy/blocks-loaders": "5.3.0",
53
+ "@lowdefy/errors": "5.3.0",
54
+ "@lowdefy/helpers": "5.3.0",
55
+ "@lowdefy/node-utils": "5.3.0",
56
+ "@lowdefy/nunjucks": "5.3.0",
57
+ "@lowdefy/operators": "5.3.0",
58
+ "@lowdefy/operators-js": "5.3.0",
58
59
  "ajv": "8.12.0",
59
60
  "json5": "2.2.3",
60
61
  "picomatch": "4.0.1",
@@ -65,41 +66,47 @@
65
66
  },
66
67
  "devDependencies": {
67
68
  "@jest/globals": "28.1.3",
68
- "@lowdefy/actions-core": "5.2.0",
69
- "@lowdefy/actions-pdf-make": "5.2.0",
70
- "@lowdefy/blocks-aggrid": "5.2.0",
71
- "@lowdefy/blocks-antd": "5.2.0",
72
- "@lowdefy/blocks-diff": "5.2.0",
73
- "@lowdefy/blocks-echarts": "5.2.0",
74
- "@lowdefy/blocks-google-maps": "5.2.0",
75
- "@lowdefy/blocks-markdown": "5.2.0",
76
- "@lowdefy/blocks-qr": "5.2.0",
77
- "@lowdefy/blocks-tiptap": "5.2.0",
78
- "@lowdefy/connection-axios-http": "5.2.0",
79
- "@lowdefy/connection-elasticsearch": "5.2.0",
80
- "@lowdefy/connection-test": "5.2.0",
81
- "@lowdefy/connection-google-sheets": "5.2.0",
82
- "@lowdefy/connection-knex": "5.2.0",
83
- "@lowdefy/connection-mongodb": "5.2.0",
84
- "@lowdefy/connection-redis": "5.2.0",
85
- "@lowdefy/connection-sendgrid": "5.2.0",
86
- "@lowdefy/connection-stripe": "5.2.0",
87
- "@lowdefy/operators-change-case": "5.2.0",
88
- "@lowdefy/operators-diff": "5.2.0",
89
- "@lowdefy/operators-jsonata": "5.2.0",
90
- "@lowdefy/operators-dayjs": "5.2.0",
91
- "@lowdefy/operators-mql": "5.2.0",
92
- "@lowdefy/operators-nunjucks": "5.2.0",
93
- "@lowdefy/operators-uuid": "5.2.0",
94
- "@lowdefy/operators-yaml": "5.2.0",
95
- "@lowdefy/plugin-auth0": "5.2.0",
96
- "@lowdefy/plugin-aws": "5.2.0",
97
- "@lowdefy/plugin-csv": "5.2.0",
98
- "@lowdefy/plugin-next-auth": "5.2.0",
69
+ "@lowdefy/actions-core": "5.3.0",
70
+ "@lowdefy/actions-pdf-make": "5.3.0",
71
+ "@lowdefy/blocks-aggrid": "5.3.0",
72
+ "@lowdefy/blocks-antd": "5.3.0",
73
+ "@lowdefy/blocks-antd-x": "5.3.0",
74
+ "@lowdefy/blocks-diff": "5.3.0",
75
+ "@lowdefy/blocks-echarts": "5.3.0",
76
+ "@lowdefy/blocks-google-maps": "5.3.0",
77
+ "@lowdefy/blocks-markdown": "5.3.0",
78
+ "@lowdefy/blocks-qr": "5.3.0",
79
+ "@lowdefy/blocks-tiptap": "5.3.0",
80
+ "@lowdefy/connection-ai-gateway": "5.3.0",
81
+ "@lowdefy/connection-anthropic": "5.3.0",
82
+ "@lowdefy/connection-axios-http": "5.3.0",
83
+ "@lowdefy/connection-elasticsearch": "5.3.0",
84
+ "@lowdefy/connection-google": "5.3.0",
85
+ "@lowdefy/connection-google-sheets": "5.3.0",
86
+ "@lowdefy/connection-knex": "5.3.0",
87
+ "@lowdefy/connection-mcp": "5.3.0",
88
+ "@lowdefy/connection-mongodb": "5.3.0",
89
+ "@lowdefy/connection-openai": "5.3.0",
90
+ "@lowdefy/connection-redis": "5.3.0",
91
+ "@lowdefy/connection-sendgrid": "5.3.0",
92
+ "@lowdefy/connection-stripe": "5.3.0",
93
+ "@lowdefy/connection-test": "5.3.0",
94
+ "@lowdefy/logger": "5.3.0",
95
+ "@lowdefy/operators-change-case": "5.3.0",
96
+ "@lowdefy/operators-dayjs": "5.3.0",
97
+ "@lowdefy/operators-diff": "5.3.0",
98
+ "@lowdefy/operators-jsonata": "5.3.0",
99
+ "@lowdefy/operators-mql": "5.3.0",
100
+ "@lowdefy/operators-nunjucks": "5.3.0",
101
+ "@lowdefy/operators-uuid": "5.3.0",
102
+ "@lowdefy/operators-yaml": "5.3.0",
103
+ "@lowdefy/plugin-auth0": "5.3.0",
104
+ "@lowdefy/plugin-aws": "5.3.0",
105
+ "@lowdefy/plugin-csv": "5.3.0",
106
+ "@lowdefy/plugin-next-auth": "5.3.0",
99
107
  "@swc/cli": "0.8.0",
100
108
  "@swc/core": "1.15.18",
101
109
  "@swc/jest": "0.2.39",
102
- "@lowdefy/logger": "5.2.0",
103
110
  "jest": "28.1.3",
104
111
  "pino": "8.16.2"
105
112
  },