@agentmark-ai/api-types 0.5.0 → 0.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.
package/dist/types.d.ts CHANGED
@@ -301,7 +301,11 @@ export interface TracesParams extends PaginationParams {
301
301
  name?: string;
302
302
  tags?: string[];
303
303
  commitSha?: string;
304
- filters?: AnalyticsFilter[];
304
+ /**
305
+ * AND of leaves and one-level OR-groups (see {@link AnalyticsFilterNode}).
306
+ * Plain `AnalyticsFilter[]` callers keep working unchanged.
307
+ */
308
+ filters?: AnalyticsFilterNode[];
305
309
  sortBy?: string;
306
310
  sortOrder?: 'asc' | 'desc';
307
311
  /** Single-env scoping per FR-031/FR-051. Undefined = no env filter. */
@@ -764,6 +768,24 @@ export interface AnalyticsFilter {
764
768
  operator: string;
765
769
  value: string | string[];
766
770
  }
771
+ /**
772
+ * Disjunction of leaf predicates — matches rows satisfying ANY member.
773
+ * One level deep by design: a filter list is an AND of leaves and OR-groups
774
+ * (conjunctive normal form); members are always leaves, never nested groups.
775
+ */
776
+ export interface AnalyticsFilterOrGroup {
777
+ or: AnalyticsFilter[];
778
+ }
779
+ /**
780
+ * One element of a filter list: a leaf predicate or an OR-group.
781
+ * `AnalyticsFilter[]` stays assignable wherever `AnalyticsFilterNode[]` is
782
+ * accepted, so existing AND-only callers are unaffected.
783
+ */
784
+ export type AnalyticsFilterNode = AnalyticsFilter | AnalyticsFilterOrGroup;
785
+ /**
786
+ * Type guard for OR-group nodes in a filter list.
787
+ */
788
+ export declare function isAnalyticsFilterOrGroup(node: AnalyticsFilterNode): node is AnalyticsFilterOrGroup;
767
789
  /**
768
790
  * Supported filter fields for metrics queries.
769
791
  */
package/dist/types.js CHANGED
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.isFilterConfigV2 = isFilterConfigV2;
11
11
  exports.isViewConfigV3 = isViewConfigV3;
12
+ exports.isAnalyticsFilterOrGroup = isAnalyticsFilterOrGroup;
12
13
  /**
13
14
  * Type guard for v2 saved filter configs.
14
15
  */
@@ -21,3 +22,9 @@ function isFilterConfigV2(config) {
21
22
  function isViewConfigV3(config) {
22
23
  return 'version' in config && config.version === 3;
23
24
  }
25
+ /**
26
+ * Type guard for OR-group nodes in a filter list.
27
+ */
28
+ function isAnalyticsFilterOrGroup(node) {
29
+ return typeof node === 'object' && node !== null && Array.isArray(node.or);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentmark-ai/api-types",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Shared API contract types for AgentMark services",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "clean": "rm -rf dist"
16
16
  },
17
17
  "dependencies": {
18
- "@agentmark-ai/api-schemas": "0.4.0"
18
+ "@agentmark-ai/api-schemas": "0.5.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^5.5.3"