@uniformdev/mesh-edgehancer-sdk 20.50.2-alpha.146 → 20.50.2-alpha.167

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.d.mts CHANGED
@@ -139,20 +139,12 @@ declare const afterAIDataResourceEditResultSchema: z.ZodObject<{
139
139
  summary: z.ZodOptional<z.ZodString>;
140
140
  }, z.core.$strict>;
141
141
  declare const afterAIDataResourceEditContextSchema: z.ZodObject<{
142
- /**
143
- * The the data type of the data resource being edited (merged with its data source)
144
- * NOTE: this can contain secrets, API keys, etc. Do not directly expose it to the AI agent!
145
- * NOTE: this does not include the current value's variables, if any
146
- */
147
142
  mergedDataType: z.ZodCustom<MergedDataType, MergedDataType>;
148
- /** Which data source variant is currently active (undefined = published data) */
149
143
  dataSourceVariant: z.ZodOptional<z.ZodCustom<"unpublished", "unpublished">>;
150
- /** The edit request details */
151
144
  editRequest: z.ZodObject<{
152
145
  edit: z.ZodString;
153
146
  currentValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
154
147
  }, z.core.$strip>;
155
- /** AI invocation context */
156
148
  invocationContext: z.ZodEnum<{
157
149
  composition: "composition";
158
150
  compositionPattern: "compositionPattern";
@@ -161,13 +153,9 @@ declare const afterAIDataResourceEditContextSchema: z.ZodObject<{
161
153
  entryPattern: "entryPattern";
162
154
  general: "general";
163
155
  }>;
164
- /** User ID making the edit */
165
156
  userId: z.ZodString;
166
- /** Project ID */
167
157
  projectId: z.ZodString;
168
- /** The new value generated by AI */
169
158
  newValue: z.ZodRecord<z.ZodString, z.ZodString>;
170
- /** The result from the AI editing process */
171
159
  result: z.ZodObject<{
172
160
  success: z.ZodBoolean;
173
161
  summary: z.ZodOptional<z.ZodString>;
@@ -248,6 +236,45 @@ type AfterAIEditResult = z.infer<typeof afterAIEditResultSchema>;
248
236
  */
249
237
  type AfterAIEditHookFn = (context: AfterAIEditContext) => Promise<AfterAIEditResult>;
250
238
 
239
+ /**
240
+ * A normalized record of one bound parameter value that consumed a data
241
+ * resource somewhere in the composition tree. Custom edgehancer authors can
242
+ * use this to derive minimal upstream queries (e.g. GraphQL field selection,
243
+ * downstream `select.*` forwarding) instead of always fetching the full
244
+ * resource shape.
245
+ */
246
+ type CollectedBinding = {
247
+ /**
248
+ * Data resource name referenced by the binding (post-alias-deref,
249
+ * post-loop-synthesis when surfaced from canvas-sdk's scope walker — the
250
+ * raw parsed name when produced by `collectComponentBindings`). Used as
251
+ * the key into per-DR binding buckets.
252
+ */
253
+ dataResource: string;
254
+ /**
255
+ * The full effective pointer for this binding, e.g. `/items/fields/title`,
256
+ * _including_ the leading `/<dataResource>` segment. Per-integration
257
+ * translators (UC's `deriveUniformContentProjection`, custom edgehancer
258
+ * authors) scan this for `/fields/<name>` and `/parameters/<name>` segments
259
+ * to derive a minimal upstream query.
260
+ */
261
+ pointer: string;
262
+ /**
263
+ * The JSON pointer expression _inside_ the data resource, with the leading
264
+ * `/<dataResource>` segment removed. May be undefined if the binding
265
+ * references the whole resource.
266
+ */
267
+ dataExpression: string | undefined;
268
+ /** Parameter id (property name) where the binding was found. */
269
+ parameterId: string;
270
+ /**
271
+ * Locale the binding's locale-scoped value was found under, if any. The
272
+ * empty string is normalized to undefined.
273
+ */
274
+ locale: string | undefined;
275
+ /** Condition index, or -1 for the default (non-conditional) value. */
276
+ conditionIndex: number;
277
+ };
251
278
  type RequestEdgehancerDataResourceContext = {
252
279
  /**
253
280
  * The data resource to fetch.
@@ -399,20 +426,12 @@ declare const COLLECTION_MAX_LIMIT = 50;
399
426
  declare const COLLECTION_DEFAULT_OFFSET = 0;
400
427
 
401
428
  declare const createAIDataResourceEditContextSchema: z.ZodObject<{
402
- /**
403
- * The the data type of the data resource being edited (merged with its data source)
404
- * NOTE: this can contain secrets, API keys, etc. Do not directly expose it to the AI agent!
405
- * NOTE: this does not include the current value's variables, if any
406
- */
407
429
  mergedDataType: z.ZodCustom<MergedDataType, MergedDataType>;
408
- /** Which data source variant is currently active (undefined = published data) */
409
430
  dataSourceVariant: z.ZodOptional<z.ZodCustom<"unpublished", "unpublished">>;
410
- /** The edit request details */
411
431
  editRequest: z.ZodObject<{
412
432
  edit: z.ZodString;
413
433
  currentValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
414
434
  }, z.core.$strip>;
415
- /** AI invocation context */
416
435
  invocationContext: z.ZodEnum<{
417
436
  composition: "composition";
418
437
  compositionPattern: "compositionPattern";
@@ -421,9 +440,7 @@ declare const createAIDataResourceEditContextSchema: z.ZodObject<{
421
440
  entryPattern: "entryPattern";
422
441
  general: "general";
423
442
  }>;
424
- /** User ID making the edit */
425
443
  userId: z.ZodString;
426
- /** Project ID */
427
444
  projectId: z.ZodString;
428
445
  }, z.core.$strict>;
429
446
  type CreateAIDataResourceEditContext = z.infer<typeof createAIDataResourceEditContextSchema>;
@@ -551,6 +568,14 @@ type PreRequestEdgehancerDataResourceContext = {
551
568
  * The data resource definition that will be requested.
552
569
  */
553
570
  dataResource: EdgehancerMergedDataType;
571
+ /**
572
+ * The set of bindings in the originating composition/entry that consume this
573
+ * data resource. This can be used to derive a data projection to the target API.
574
+ *
575
+ * Undefined for editor / authoring fetches so the editor can read every
576
+ * field to create new bindings. Never an empty array — unused data resources are automatically skipped from being fetched.
577
+ */
578
+ bindings?: readonly CollectedBinding[];
554
579
  };
555
580
  type PreRequestEdgehancerContext = {
556
581
  fetchContext: DataResourceFetchContext;
@@ -761,4 +786,4 @@ declare function getDataResourceQueryString({ parameters, url }: EdgehancerMerge
761
786
  /** Gets the HTTP headers for a data resource */
762
787
  declare function getDataResourceHeaders({ headers }: EdgehancerMergedDataType): Headers;
763
788
 
764
- export { type AfterAIDataResourceEditContext, type AfterAIDataResourceEditHookFn, type AfterAIDataResourceEditResult, type AfterAIEditContext, type AfterAIEditHookFn, type AfterAIEditResult, COLLECTION_DEFAULT_LIMIT, COLLECTION_DEFAULT_OFFSET, COLLECTION_MAX_LIMIT, type ConvertBatchResultsToEdgehancerResultOptions, type CreateAIDataResourceEditContext, type CreateAIDataResourceEditHookFn, type CreateAIDataResourceEditResult, type CreateAIEditContext, type CreateAIEditHookFn, type CreateAIEditResult, type CustomEdgehancerDefinition, type DataResource, type DataResourceFetchContext, type EdgehancerDataIssue, type EdgehancerMergedDataType, type MergedDataType, type PreRequestEdgehancerContext, type PreRequestEdgehancerDataResourceContext, type PreRequestEdgehancerDataResourceResult, type PreRequestEdgehancerResult, type PreRequestHookFn, type RequestEdgehancerContext, type RequestEdgehancerDataResourceContext, type RequestEdgehancerDataResourceResolutionResult, type RequestEdgehancerResult, type RequestHookFn, type ResolveBatchIdsResult, afterAIDataResourceEditContextSchema, afterAIDataResourceEditResultSchema, afterAIEditContextSchema, afterAIEditResultSchema, convertBatchResultsToEdgehancerResult, createAIDataResourceEditContextSchema, createAIDataResourceEditResultSchema, createAIEditContextSchema, createAIEditResultSchema, dataResourceSchema, edgehancerMergedDataTypeSchema, getDataResourceAsRequest, getDataResourceHeaders, getDataResourceQueryString, getDataResourceUrl, mergedDataTypeSchema, preRequestEdgehancerDataResourceResultSchema, preRequestEdgehancerResultSchema, requestEdgehancerDataResourceResolutionResultSchema, requestEdgehancerResultSchema, resolveBatchFetchIds, resolvingIssueSchema };
789
+ export { type AfterAIDataResourceEditContext, type AfterAIDataResourceEditHookFn, type AfterAIDataResourceEditResult, type AfterAIEditContext, type AfterAIEditHookFn, type AfterAIEditResult, COLLECTION_DEFAULT_LIMIT, COLLECTION_DEFAULT_OFFSET, COLLECTION_MAX_LIMIT, type CollectedBinding, type ConvertBatchResultsToEdgehancerResultOptions, type CreateAIDataResourceEditContext, type CreateAIDataResourceEditHookFn, type CreateAIDataResourceEditResult, type CreateAIEditContext, type CreateAIEditHookFn, type CreateAIEditResult, type CustomEdgehancerDefinition, type DataResource, type DataResourceFetchContext, type EdgehancerDataIssue, type EdgehancerMergedDataType, type MergedDataType, type PreRequestEdgehancerContext, type PreRequestEdgehancerDataResourceContext, type PreRequestEdgehancerDataResourceResult, type PreRequestEdgehancerResult, type PreRequestHookFn, type RequestEdgehancerContext, type RequestEdgehancerDataResourceContext, type RequestEdgehancerDataResourceResolutionResult, type RequestEdgehancerResult, type RequestHookFn, type ResolveBatchIdsResult, afterAIDataResourceEditContextSchema, afterAIDataResourceEditResultSchema, afterAIEditContextSchema, afterAIEditResultSchema, convertBatchResultsToEdgehancerResult, createAIDataResourceEditContextSchema, createAIDataResourceEditResultSchema, createAIEditContextSchema, createAIEditResultSchema, dataResourceSchema, edgehancerMergedDataTypeSchema, getDataResourceAsRequest, getDataResourceHeaders, getDataResourceQueryString, getDataResourceUrl, mergedDataTypeSchema, preRequestEdgehancerDataResourceResultSchema, preRequestEdgehancerResultSchema, requestEdgehancerDataResourceResolutionResultSchema, requestEdgehancerResultSchema, resolveBatchFetchIds, resolvingIssueSchema };
package/dist/index.d.ts CHANGED
@@ -139,20 +139,12 @@ declare const afterAIDataResourceEditResultSchema: z.ZodObject<{
139
139
  summary: z.ZodOptional<z.ZodString>;
140
140
  }, z.core.$strict>;
141
141
  declare const afterAIDataResourceEditContextSchema: z.ZodObject<{
142
- /**
143
- * The the data type of the data resource being edited (merged with its data source)
144
- * NOTE: this can contain secrets, API keys, etc. Do not directly expose it to the AI agent!
145
- * NOTE: this does not include the current value's variables, if any
146
- */
147
142
  mergedDataType: z.ZodCustom<MergedDataType, MergedDataType>;
148
- /** Which data source variant is currently active (undefined = published data) */
149
143
  dataSourceVariant: z.ZodOptional<z.ZodCustom<"unpublished", "unpublished">>;
150
- /** The edit request details */
151
144
  editRequest: z.ZodObject<{
152
145
  edit: z.ZodString;
153
146
  currentValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
154
147
  }, z.core.$strip>;
155
- /** AI invocation context */
156
148
  invocationContext: z.ZodEnum<{
157
149
  composition: "composition";
158
150
  compositionPattern: "compositionPattern";
@@ -161,13 +153,9 @@ declare const afterAIDataResourceEditContextSchema: z.ZodObject<{
161
153
  entryPattern: "entryPattern";
162
154
  general: "general";
163
155
  }>;
164
- /** User ID making the edit */
165
156
  userId: z.ZodString;
166
- /** Project ID */
167
157
  projectId: z.ZodString;
168
- /** The new value generated by AI */
169
158
  newValue: z.ZodRecord<z.ZodString, z.ZodString>;
170
- /** The result from the AI editing process */
171
159
  result: z.ZodObject<{
172
160
  success: z.ZodBoolean;
173
161
  summary: z.ZodOptional<z.ZodString>;
@@ -248,6 +236,45 @@ type AfterAIEditResult = z.infer<typeof afterAIEditResultSchema>;
248
236
  */
249
237
  type AfterAIEditHookFn = (context: AfterAIEditContext) => Promise<AfterAIEditResult>;
250
238
 
239
+ /**
240
+ * A normalized record of one bound parameter value that consumed a data
241
+ * resource somewhere in the composition tree. Custom edgehancer authors can
242
+ * use this to derive minimal upstream queries (e.g. GraphQL field selection,
243
+ * downstream `select.*` forwarding) instead of always fetching the full
244
+ * resource shape.
245
+ */
246
+ type CollectedBinding = {
247
+ /**
248
+ * Data resource name referenced by the binding (post-alias-deref,
249
+ * post-loop-synthesis when surfaced from canvas-sdk's scope walker — the
250
+ * raw parsed name when produced by `collectComponentBindings`). Used as
251
+ * the key into per-DR binding buckets.
252
+ */
253
+ dataResource: string;
254
+ /**
255
+ * The full effective pointer for this binding, e.g. `/items/fields/title`,
256
+ * _including_ the leading `/<dataResource>` segment. Per-integration
257
+ * translators (UC's `deriveUniformContentProjection`, custom edgehancer
258
+ * authors) scan this for `/fields/<name>` and `/parameters/<name>` segments
259
+ * to derive a minimal upstream query.
260
+ */
261
+ pointer: string;
262
+ /**
263
+ * The JSON pointer expression _inside_ the data resource, with the leading
264
+ * `/<dataResource>` segment removed. May be undefined if the binding
265
+ * references the whole resource.
266
+ */
267
+ dataExpression: string | undefined;
268
+ /** Parameter id (property name) where the binding was found. */
269
+ parameterId: string;
270
+ /**
271
+ * Locale the binding's locale-scoped value was found under, if any. The
272
+ * empty string is normalized to undefined.
273
+ */
274
+ locale: string | undefined;
275
+ /** Condition index, or -1 for the default (non-conditional) value. */
276
+ conditionIndex: number;
277
+ };
251
278
  type RequestEdgehancerDataResourceContext = {
252
279
  /**
253
280
  * The data resource to fetch.
@@ -399,20 +426,12 @@ declare const COLLECTION_MAX_LIMIT = 50;
399
426
  declare const COLLECTION_DEFAULT_OFFSET = 0;
400
427
 
401
428
  declare const createAIDataResourceEditContextSchema: z.ZodObject<{
402
- /**
403
- * The the data type of the data resource being edited (merged with its data source)
404
- * NOTE: this can contain secrets, API keys, etc. Do not directly expose it to the AI agent!
405
- * NOTE: this does not include the current value's variables, if any
406
- */
407
429
  mergedDataType: z.ZodCustom<MergedDataType, MergedDataType>;
408
- /** Which data source variant is currently active (undefined = published data) */
409
430
  dataSourceVariant: z.ZodOptional<z.ZodCustom<"unpublished", "unpublished">>;
410
- /** The edit request details */
411
431
  editRequest: z.ZodObject<{
412
432
  edit: z.ZodString;
413
433
  currentValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
414
434
  }, z.core.$strip>;
415
- /** AI invocation context */
416
435
  invocationContext: z.ZodEnum<{
417
436
  composition: "composition";
418
437
  compositionPattern: "compositionPattern";
@@ -421,9 +440,7 @@ declare const createAIDataResourceEditContextSchema: z.ZodObject<{
421
440
  entryPattern: "entryPattern";
422
441
  general: "general";
423
442
  }>;
424
- /** User ID making the edit */
425
443
  userId: z.ZodString;
426
- /** Project ID */
427
444
  projectId: z.ZodString;
428
445
  }, z.core.$strict>;
429
446
  type CreateAIDataResourceEditContext = z.infer<typeof createAIDataResourceEditContextSchema>;
@@ -551,6 +568,14 @@ type PreRequestEdgehancerDataResourceContext = {
551
568
  * The data resource definition that will be requested.
552
569
  */
553
570
  dataResource: EdgehancerMergedDataType;
571
+ /**
572
+ * The set of bindings in the originating composition/entry that consume this
573
+ * data resource. This can be used to derive a data projection to the target API.
574
+ *
575
+ * Undefined for editor / authoring fetches so the editor can read every
576
+ * field to create new bindings. Never an empty array — unused data resources are automatically skipped from being fetched.
577
+ */
578
+ bindings?: readonly CollectedBinding[];
554
579
  };
555
580
  type PreRequestEdgehancerContext = {
556
581
  fetchContext: DataResourceFetchContext;
@@ -761,4 +786,4 @@ declare function getDataResourceQueryString({ parameters, url }: EdgehancerMerge
761
786
  /** Gets the HTTP headers for a data resource */
762
787
  declare function getDataResourceHeaders({ headers }: EdgehancerMergedDataType): Headers;
763
788
 
764
- export { type AfterAIDataResourceEditContext, type AfterAIDataResourceEditHookFn, type AfterAIDataResourceEditResult, type AfterAIEditContext, type AfterAIEditHookFn, type AfterAIEditResult, COLLECTION_DEFAULT_LIMIT, COLLECTION_DEFAULT_OFFSET, COLLECTION_MAX_LIMIT, type ConvertBatchResultsToEdgehancerResultOptions, type CreateAIDataResourceEditContext, type CreateAIDataResourceEditHookFn, type CreateAIDataResourceEditResult, type CreateAIEditContext, type CreateAIEditHookFn, type CreateAIEditResult, type CustomEdgehancerDefinition, type DataResource, type DataResourceFetchContext, type EdgehancerDataIssue, type EdgehancerMergedDataType, type MergedDataType, type PreRequestEdgehancerContext, type PreRequestEdgehancerDataResourceContext, type PreRequestEdgehancerDataResourceResult, type PreRequestEdgehancerResult, type PreRequestHookFn, type RequestEdgehancerContext, type RequestEdgehancerDataResourceContext, type RequestEdgehancerDataResourceResolutionResult, type RequestEdgehancerResult, type RequestHookFn, type ResolveBatchIdsResult, afterAIDataResourceEditContextSchema, afterAIDataResourceEditResultSchema, afterAIEditContextSchema, afterAIEditResultSchema, convertBatchResultsToEdgehancerResult, createAIDataResourceEditContextSchema, createAIDataResourceEditResultSchema, createAIEditContextSchema, createAIEditResultSchema, dataResourceSchema, edgehancerMergedDataTypeSchema, getDataResourceAsRequest, getDataResourceHeaders, getDataResourceQueryString, getDataResourceUrl, mergedDataTypeSchema, preRequestEdgehancerDataResourceResultSchema, preRequestEdgehancerResultSchema, requestEdgehancerDataResourceResolutionResultSchema, requestEdgehancerResultSchema, resolveBatchFetchIds, resolvingIssueSchema };
789
+ export { type AfterAIDataResourceEditContext, type AfterAIDataResourceEditHookFn, type AfterAIDataResourceEditResult, type AfterAIEditContext, type AfterAIEditHookFn, type AfterAIEditResult, COLLECTION_DEFAULT_LIMIT, COLLECTION_DEFAULT_OFFSET, COLLECTION_MAX_LIMIT, type CollectedBinding, type ConvertBatchResultsToEdgehancerResultOptions, type CreateAIDataResourceEditContext, type CreateAIDataResourceEditHookFn, type CreateAIDataResourceEditResult, type CreateAIEditContext, type CreateAIEditHookFn, type CreateAIEditResult, type CustomEdgehancerDefinition, type DataResource, type DataResourceFetchContext, type EdgehancerDataIssue, type EdgehancerMergedDataType, type MergedDataType, type PreRequestEdgehancerContext, type PreRequestEdgehancerDataResourceContext, type PreRequestEdgehancerDataResourceResult, type PreRequestEdgehancerResult, type PreRequestHookFn, type RequestEdgehancerContext, type RequestEdgehancerDataResourceContext, type RequestEdgehancerDataResourceResolutionResult, type RequestEdgehancerResult, type RequestHookFn, type ResolveBatchIdsResult, afterAIDataResourceEditContextSchema, afterAIDataResourceEditResultSchema, afterAIEditContextSchema, afterAIEditResultSchema, convertBatchResultsToEdgehancerResult, createAIDataResourceEditContextSchema, createAIDataResourceEditResultSchema, createAIEditContextSchema, createAIEditResultSchema, dataResourceSchema, edgehancerMergedDataTypeSchema, getDataResourceAsRequest, getDataResourceHeaders, getDataResourceQueryString, getDataResourceUrl, mergedDataTypeSchema, preRequestEdgehancerDataResourceResultSchema, preRequestEdgehancerResultSchema, requestEdgehancerDataResourceResolutionResultSchema, requestEdgehancerResultSchema, resolveBatchFetchIds, resolvingIssueSchema };
package/dist/index.js CHANGED
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  COLLECTION_DEFAULT_LIMIT: () => COLLECTION_DEFAULT_LIMIT,
34
34
  COLLECTION_DEFAULT_OFFSET: () => COLLECTION_DEFAULT_OFFSET,
35
35
  COLLECTION_MAX_LIMIT: () => COLLECTION_MAX_LIMIT,
@@ -56,7 +56,7 @@ __export(src_exports, {
56
56
  resolveBatchFetchIds: () => resolveBatchFetchIds,
57
57
  resolvingIssueSchema: () => resolvingIssueSchema
58
58
  });
59
- module.exports = __toCommonJS(src_exports);
59
+ module.exports = __toCommonJS(index_exports);
60
60
 
61
61
  // ../../lib/ai-sdk/src/InvocationContexts.ts
62
62
  var z = __toESM(require("zod"), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-edgehancer-sdk",
3
- "version": "20.50.2-alpha.146+88f341e03e",
3
+ "version": "20.50.2-alpha.167+74e60d5bb7",
4
4
  "description": "Uniform Mesh Edgehancer SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -47,12 +47,12 @@
47
47
  "/dist"
48
48
  ],
49
49
  "dependencies": {
50
- "@uniformdev/canvas": "20.50.2-alpha.146+88f341e03e",
51
- "tsafe": "1.6.6",
52
- "zod": "4.3.6"
50
+ "@uniformdev/canvas": "20.50.2-alpha.167+74e60d5bb7",
51
+ "tsafe": "1.8.12",
52
+ "zod": "^4.4.3"
53
53
  },
54
54
  "devDependencies": {
55
- "next": "16.2.3"
55
+ "next": "16.2.9"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "next": ">13"
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "88f341e03ec871c6af2cd47b9ce257ff4a394816"
63
+ "gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
64
64
  }