@uniformdev/mesh-edgehancer-sdk 20.32.1-alpha.4 → 20.32.2-alpha.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.
package/dist/index.mjs CHANGED
@@ -1,86 +1,3 @@
1
- // ../../lib/ai-sdk/src/InvocationContexts.ts
2
- import { z } from "zod";
3
- var invocationContextsSchema = z.enum([
4
- "composition",
5
- "compositionPattern",
6
- "componentPattern",
7
- "entry",
8
- "entryPattern",
9
- "general"
10
- ]);
11
- var invocationContextInfoSchema = z.object({
12
- context: invocationContextsSchema,
13
- id: z.string(),
14
- displayName: z.string().optional(),
15
- icon: z.string().optional()
16
- });
17
- var invocationContextAnnotationSchema = z.object({
18
- type: z.literal("invocationContext"),
19
- value: invocationContextInfoSchema
20
- });
21
-
22
- // ../../lib/ai-sdk/src/toolDefinitions/editing/createPropertyEdit.ts
23
- import { z as z2 } from "zod";
24
- var createPropertyEdit = {
25
- displayName: "Create Property Edit",
26
- description: "Edits a property on a composition, entry, or pattern with AI. This is a callable tool NOT FOR AGENT USE - agents use applyPropertyEdit to broker client-side application of the edit.",
27
- inputSchema: z2.object({
28
- edit: z2.string().describe("Describe the edit to be made to the property"),
29
- currentValue: z2.unknown().describe("Current value of the property (if any exists)").optional(),
30
- projectGuidance: z2.string().describe("Guidance prompt for the project (if any exists)").optional(),
31
- componentGuidance: z2.string().describe("Guidance prompt for the parent component").optional(),
32
- audienceGuidance: z2.string().describe(
33
- "Guidance prompt for the target audience of a personalized variation. Omit for non-variation edits."
34
- ).optional(),
35
- propertyDefinition: z2.object({
36
- id: z2.string(),
37
- name: z2.string(),
38
- type: z2.string(),
39
- guidance: z2.string().describe("Guidance prompt from the property definition (if any exists)").optional(),
40
- typeConfig: z2.unknown().optional().describe("Type-specific configuration for the property")
41
- }),
42
- outputLocale: z2.string().optional().describe("The locale to use when writing the edited value"),
43
- documentContext: z2.string().describe("Content of the surrounding document the property is part of").optional()
44
- }),
45
- outputSchema: z2.object({
46
- newValue: z2.string().describe(
47
- "The new value of the property. When the action is clear or resetOverride, this should be empty."
48
- ),
49
- treatNewValueAsJson: z2.boolean().describe("Whether the newValue is a JSON string"),
50
- summary: z2.string().describe(
51
- "A completion message to the user that summarizes the action taken. This should be 1 sentence, in English."
52
- ).optional(),
53
- action: z2.enum(["setValue", "clearValue", "resetOverride"]).describe(
54
- "setValue = update the value, clearValue = remove the value/set to empty, resetOverride = remove a pattern override and inherit the pattern value. Only use resetOverride if the prompt asks for it."
55
- ),
56
- success: z2.boolean().describe("Whether the edit could be completed successfully")
57
- }),
58
- runsAt: "server",
59
- timeout: 100,
60
- callable: true
61
- };
62
-
63
- // src/afterAIEdit.ts
64
- import { z as z3 } from "zod";
65
- var afterAIEditResultSchema = z3.strictObject({
66
- newValue: z3.unknown(),
67
- success: z3.boolean(),
68
- summary: z3.string().optional()
69
- });
70
- var afterAIEditContextSchema = z3.strictObject({
71
- editRequest: createPropertyEdit.inputSchema,
72
- invocationContext: invocationContextsSchema,
73
- userId: z3.string(),
74
- currentLocale: z3.string().optional(),
75
- projectId: z3.string(),
76
- currentValue: z3.unknown().optional(),
77
- newValue: z3.unknown(),
78
- result: z3.object({
79
- success: z3.boolean(),
80
- summary: z3.string().optional()
81
- })
82
- });
83
-
84
1
  // src/batchUtils.ts
85
2
  function convertBatchResultsToEdgehancerResult({
86
3
  batch,
@@ -140,22 +57,6 @@ var COLLECTION_DEFAULT_LIMIT = 20;
140
57
  var COLLECTION_MAX_LIMIT = 50;
141
58
  var COLLECTION_DEFAULT_OFFSET = 0;
142
59
 
143
- // src/createAIEdit.ts
144
- import { z as z4 } from "zod";
145
- var createAIEditContextSchema = z4.strictObject({
146
- editRequest: createPropertyEdit.inputSchema,
147
- invocationContext: invocationContextsSchema,
148
- userId: z4.string(),
149
- currentLocale: z4.string().optional(),
150
- projectId: z4.string()
151
- });
152
- var createAIEditResultSchema = z4.strictObject({
153
- outputJsonSchema: z4.record(z4.string(), z4.any()).describe("JSON schema (draft-07) for the edited content result"),
154
- instructions: z4.string().describe(
155
- "Instructions for the AI editor LLM to follow (e.g. conventions/rules, allowed values, etc). Just describe your value type, do not give guiding instructions. There is no need to worry about clearing or resetting values, that is automatically handled."
156
- )
157
- });
158
-
159
60
  // src/fetchUtils.ts
160
61
  function getDataResourceAsRequest(data) {
161
62
  var _a;
@@ -195,78 +96,78 @@ function copyKeyValuePairs(source, target) {
195
96
  }
196
97
 
197
98
  // src/preRequest.ts
198
- import { z as z6 } from "zod";
99
+ import { z as z2 } from "zod";
199
100
 
200
101
  // src/shared.ts
201
102
  import { assert } from "tsafe";
202
- import { z as z5 } from "zod";
203
- var parameterDefinitionSchema = z5.object({
204
- key: z5.string(),
205
- value: z5.string(),
206
- omitIfEmpty: z5.boolean().optional()
103
+ import { z } from "zod";
104
+ var parameterDefinitionSchema = z.object({
105
+ key: z.string(),
106
+ value: z.string(),
107
+ omitIfEmpty: z.boolean().optional()
207
108
  });
208
- var resolvingIssueSchema = z5.union([
209
- z5.string(),
210
- z5.object({
211
- message: z5.string(),
212
- subType: z5.enum(["unpublishedData", "configuration"]).optional(),
213
- issueReference: z5.string().optional(),
214
- deepLink: z5.string().optional()
109
+ var resolvingIssueSchema = z.union([
110
+ z.string(),
111
+ z.object({
112
+ message: z.string(),
113
+ subType: z.enum(["unpublishedData", "configuration"]).optional(),
114
+ issueReference: z.string().optional(),
115
+ deepLink: z.string().optional()
215
116
  })
216
117
  ]);
217
- var variableDefinitionSchema = z5.object({
218
- displayName: z5.string().optional(),
219
- type: z5.string().optional(),
220
- default: z5.string(),
221
- helpText: z5.string().optional(),
222
- order: z5.number().optional(),
223
- source: z5.string().optional()
118
+ var variableDefinitionSchema = z.object({
119
+ displayName: z.string().optional(),
120
+ type: z.string().optional(),
121
+ default: z.string(),
122
+ helpText: z.string().optional(),
123
+ order: z.number().optional(),
124
+ source: z.string().optional()
224
125
  });
225
- var customEdgehancerDefinitionSchema = z5.object({
226
- preRequest: z5.string().optional(),
227
- request: z5.string().optional()
126
+ var customEdgehancerDefinitionSchema = z.object({
127
+ preRequest: z.string().optional(),
128
+ request: z.string().optional()
228
129
  });
229
- var dataSourceVariantSchema = z5.intersection(
230
- z5.object({
231
- headers: z5.array(parameterDefinitionSchema).optional(),
232
- parameters: z5.array(parameterDefinitionSchema).optional(),
233
- variables: z5.record(variableDefinitionSchema).optional()
130
+ var dataSourceVariantSchema = z.intersection(
131
+ z.object({
132
+ headers: z.array(parameterDefinitionSchema).optional(),
133
+ parameters: z.array(parameterDefinitionSchema).optional(),
134
+ variables: z.record(variableDefinitionSchema).optional()
234
135
  }),
235
- z5.object({ url: z5.string() })
136
+ z.object({ url: z.string() })
236
137
  );
237
- var mergedDataTypeSchema = z5.object({
238
- id: z5.string(),
239
- displayName: z5.string(),
240
- archetype: z5.string().optional(),
241
- allowedOnComponents: z5.array(z5.string()).optional(),
242
- badgeIconUrl: z5.string().optional(),
243
- connectorType: z5.string(),
244
- url: z5.string(),
245
- headers: z5.array(parameterDefinitionSchema).optional(),
246
- parameters: z5.array(parameterDefinitionSchema).optional(),
247
- body: z5.string().optional(),
248
- method: z5.enum(["GET", "POST", "HEAD"]),
249
- variables: z5.record(variableDefinitionSchema).optional(),
250
- custom: z5.record(z5.unknown()).optional(),
251
- customPublic: z5.record(z5.unknown()).optional(),
252
- ttl: z5.number().optional(),
253
- purgeKey: z5.string().optional(),
254
- localeMapping: z5.record(z5.string()).optional(),
138
+ var mergedDataTypeSchema = z.object({
139
+ id: z.string(),
140
+ displayName: z.string(),
141
+ archetype: z.string().optional(),
142
+ allowedOnComponents: z.array(z.string()).optional(),
143
+ badgeIconUrl: z.string().optional(),
144
+ connectorType: z.string(),
145
+ url: z.string(),
146
+ headers: z.array(parameterDefinitionSchema).optional(),
147
+ parameters: z.array(parameterDefinitionSchema).optional(),
148
+ body: z.string().optional(),
149
+ method: z.enum(["GET", "POST", "HEAD"]),
150
+ variables: z.record(variableDefinitionSchema).optional(),
151
+ custom: z.record(z.unknown()).optional(),
152
+ customPublic: z.record(z.unknown()).optional(),
153
+ ttl: z.number().optional(),
154
+ purgeKey: z.string().optional(),
155
+ localeMapping: z.record(z.string()).optional(),
255
156
  edgehancer: customEdgehancerDefinitionSchema.optional(),
256
- uiBadgeText: z5.string().max(12).optional(),
257
- variants: z5.object({
157
+ uiBadgeText: z.string().max(12).optional(),
158
+ variants: z.object({
258
159
  unpublished: dataSourceVariantSchema.optional()
259
160
  }).optional(),
260
- enableUnpublishedMode: z5.boolean().optional()
161
+ enableUnpublishedMode: z.boolean().optional()
261
162
  });
262
163
  assert();
263
- var dataResourceSchema = z5.union([
264
- z5.string(),
265
- z5.object({}).catchall(z5.unknown()),
266
- z5.number(),
267
- z5.boolean(),
268
- z5.array(z5.unknown()),
269
- z5.undefined()
164
+ var dataResourceSchema = z.union([
165
+ z.string(),
166
+ z.object({}).catchall(z.unknown()),
167
+ z.number(),
168
+ z.boolean(),
169
+ z.array(z.unknown()),
170
+ z.undefined()
270
171
  ]);
271
172
 
272
173
  // src/preRequest.ts
@@ -279,43 +180,39 @@ var edgehancerMergedDataTypeSchema = mergedDataTypeSchema.omit({
279
180
  purgeKey: true,
280
181
  variables: true
281
182
  });
282
- var preRequestEdgehancerDataResourceResultSchema = z6.strictObject({
283
- errors: z6.array(resolvingIssueSchema).optional(),
284
- warnings: z6.array(resolvingIssueSchema).optional(),
285
- infos: z6.array(resolvingIssueSchema).optional(),
183
+ var preRequestEdgehancerDataResourceResultSchema = z2.strictObject({
184
+ errors: z2.array(resolvingIssueSchema).optional(),
185
+ warnings: z2.array(resolvingIssueSchema).optional(),
186
+ infos: z2.array(resolvingIssueSchema).optional(),
286
187
  dataResource: edgehancerMergedDataTypeSchema
287
188
  });
288
- var preRequestEdgehancerResultSchema = z6.strictObject({
289
- dataResources: z6.array(preRequestEdgehancerDataResourceResultSchema)
189
+ var preRequestEdgehancerResultSchema = z2.strictObject({
190
+ dataResources: z2.array(preRequestEdgehancerDataResourceResultSchema)
290
191
  });
291
192
 
292
193
  // src/request.ts
293
- import { z as z7 } from "zod";
294
- var requestEdgehancerDataResourceResolutionResultSchema = z7.strictObject({
295
- errors: z7.array(resolvingIssueSchema).optional().describe(
194
+ import { z as z3 } from "zod";
195
+ var requestEdgehancerDataResourceResolutionResultSchema = z3.strictObject({
196
+ errors: z3.array(resolvingIssueSchema).optional().describe(
296
197
  "Errors that occurred while running your code to return with the API response, if any. Unhandled exceptions will be captured automatically."
297
198
  ),
298
- warnings: z7.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
299
- infos: z7.array(resolvingIssueSchema).optional().describe(
199
+ warnings: z3.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
200
+ infos: z3.array(resolvingIssueSchema).optional().describe(
300
201
  "Informational messages that occurred while running your code to return with the API response, if any."
301
202
  ),
302
- surrogateKeys: z7.array(z7.string()).optional().describe(
203
+ surrogateKeys: z3.array(z3.string()).optional().describe(
303
204
  "Extra surrogate keys for the data that was fetched. These act as auxiliary cache keys that can allow granular purging of cached data."
304
205
  ),
305
206
  result: dataResourceSchema.describe("The result of fetching the data resource")
306
207
  });
307
- var requestEdgehancerResultSchema = z7.strictObject({
308
- results: z7.array(requestEdgehancerDataResourceResolutionResultSchema)
208
+ var requestEdgehancerResultSchema = z3.strictObject({
209
+ results: z3.array(requestEdgehancerDataResourceResolutionResultSchema)
309
210
  });
310
211
  export {
311
212
  COLLECTION_DEFAULT_LIMIT,
312
213
  COLLECTION_DEFAULT_OFFSET,
313
214
  COLLECTION_MAX_LIMIT,
314
- afterAIEditContextSchema,
315
- afterAIEditResultSchema,
316
215
  convertBatchResultsToEdgehancerResult,
317
- createAIEditContextSchema,
318
- createAIEditResultSchema,
319
216
  dataResourceSchema,
320
217
  edgehancerMergedDataTypeSchema,
321
218
  getDataResourceAsRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-edgehancer-sdk",
3
- "version": "20.32.1-alpha.4+d57d1b5dfa",
3
+ "version": "20.32.2-alpha.2+63682964b1",
4
4
  "description": "Uniform Mesh Edgehancer SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -48,7 +48,7 @@
48
48
  "/dist"
49
49
  ],
50
50
  "dependencies": {
51
- "@uniformdev/canvas": "20.32.1-alpha.4+d57d1b5dfa",
51
+ "@uniformdev/canvas": "20.32.2-alpha.2+63682964b1",
52
52
  "tsafe": "1.6.6",
53
53
  "zod": "3.23.8"
54
54
  },
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "d57d1b5dfa94641fb683cbc7e2e9333516b4019f"
64
+ "gitHead": "63682964b1d48a8e78403f5c67365bb0db875568"
65
65
  }