@narrative.io/data-collaboration-sdk-ts 2.101.1-beta.0 → 2.102.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.
Files changed (35) hide show
  1. package/build/agents/index.d.ts +63 -0
  2. package/build/agents/index.js +92 -0
  3. package/build/agents/types.d.ts +188 -0
  4. package/build/agents/types.js +22 -0
  5. package/build/apps/index.d.ts +0 -7
  6. package/build/apps/index.js +0 -9
  7. package/build/collaboration-policy/core/filter-builder.js +1 -7
  8. package/build/collaboration-policy/core/types.d.ts +10 -81
  9. package/build/collaboration-policy/index.d.ts +4 -5
  10. package/build/collaboration-policy/index.js +3 -4
  11. package/build/collaboration-policy/types/collaboration-policy.d.ts +20 -20
  12. package/build/collaboration-policy/useCollaborationPolicy.d.ts +4 -13
  13. package/build/collaboration-policy/useCollaborationPolicy.js +1 -23
  14. package/build/collaboration-policy/utils/path-helpers.d.ts +3 -7
  15. package/build/collaboration-policy/utils/path-helpers.js +22 -6
  16. package/build/datasets/index.d.ts +2 -11
  17. package/build/datasets/index.js +0 -12
  18. package/build/datasets/types.d.ts +0 -25
  19. package/build/index.d.ts +3 -1
  20. package/build/index.js +3 -0
  21. package/build/nql/types.d.ts +13 -13
  22. package/build/nql/types.js +20 -5
  23. package/package.json +9 -10
  24. package/build/collaboration-policy/core/jsonschema/json-schema-types.d.ts +0 -45
  25. package/build/collaboration-policy/core/jsonschema/json-schema-types.js +0 -1
  26. package/build/collaboration-policy/core/jsonschema/policy-branches.d.ts +0 -49
  27. package/build/collaboration-policy/core/jsonschema/policy-branches.js +0 -1
  28. package/build/collaboration-policy/core/jsonschema/policy-evaluator.d.ts +0 -22
  29. package/build/collaboration-policy/core/jsonschema/policy-evaluator.js +0 -250
  30. package/build/collaboration-policy/core/jsonschema/sql-builder.d.ts +0 -79
  31. package/build/collaboration-policy/core/jsonschema/sql-builder.js +0 -306
  32. package/build/collaboration-policy/core/jsonschema/sql-poc.d.ts +0 -79
  33. package/build/collaboration-policy/core/jsonschema/sql-poc.js +0 -305
  34. package/build/nql/SubstraitParser.d.ts +0 -771
  35. package/build/nql/SubstraitParser.js +0 -797
@@ -0,0 +1,63 @@
1
+ import { BaseApi } from "../base-api";
2
+ import type { ConversationId, ConversationResponse, CreateConversationRequest, CreateRunRequest, ListMessagesResponse, RunId, RunResponse } from "./types";
3
+ export * from "./types";
4
+ /**
5
+ * @module AgentsApi
6
+ * @description Agent Conversations: long-lived conversations with pinned system
7
+ * prompt + defaults, asynchronous runs that may pause for caller-declared
8
+ * tool outputs, and a versioned delta-cursor message stream.
9
+ *
10
+ * @see https://docs.narrative.io/reference/architecture/agent-conversations
11
+ *
12
+ * @extends BaseApi
13
+ */
14
+ export declare class AgentsApi extends BaseApi {
15
+ /**
16
+ * Create an agent conversation. `system_prompt` and `defaults.{tools,mcp_servers}`
17
+ * are pinned at creation; everything else in `defaults` is overridable per-run.
18
+ */
19
+ createAgentConversation(request: CreateConversationRequest): Promise<ConversationResponse>;
20
+ /**
21
+ * Read a conversation's metadata + current `version`. Always re-read this
22
+ * immediately before starting a run — `version` is the compare-and-swap
23
+ * token for `expected_version` and a stale value yields 409.
24
+ */
25
+ getAgentConversation(conversationId: ConversationId): Promise<ConversationResponse>;
26
+ /**
27
+ * Delta-read conversation messages with `sequence_no > since`. Use the
28
+ * returned `current_version` as the next call's `since` for gap-free reads.
29
+ */
30
+ listAgentConversationMessages(conversationId: ConversationId, options?: {
31
+ since?: number;
32
+ }): Promise<ListMessagesResponse>;
33
+ /**
34
+ * Start a new run on the conversation. Returns immediately with
35
+ * `status: "pending"` — poll {@link getAgentRun} until terminal.
36
+ *
37
+ * - Generate a fresh UUID for `client_op_id` per logical request (it's the
38
+ * idempotency key; reusing one is only safe as a retry).
39
+ * - Set `expected_version` to the value just read from
40
+ * {@link getAgentConversation} — mismatches return 409.
41
+ */
42
+ createAgentRun(conversationId: ConversationId, request: CreateRunRequest): Promise<RunResponse>;
43
+ /**
44
+ * Read a run's current state. Terminal states: `completed`,
45
+ * `requires_action`, `failed`. Stop polling on any of them.
46
+ */
47
+ getAgentRun(runId: RunId): Promise<RunResponse>;
48
+ /**
49
+ * Convenience: poll {@link getAgentRun} until terminal. Caller is responsible
50
+ * for selecting a reasonable backoff; defaults to 1.5s fixed interval with a
51
+ * 2-minute ceiling.
52
+ *
53
+ * Returns the terminal run. Throws on `failed` only if `throwOnFailed` is
54
+ * true; otherwise the caller inspects `run.status === "failed"`.
55
+ */
56
+ waitForAgentRun(runId: RunId, options?: {
57
+ intervalMs?: number;
58
+ timeoutMs?: number;
59
+ signal?: AbortSignal;
60
+ onTick?: (run: RunResponse) => void;
61
+ throwOnFailed?: boolean;
62
+ }): Promise<RunResponse>;
63
+ }
@@ -0,0 +1,92 @@
1
+ import { BaseApi } from "../base-api";
2
+ export * from "./types";
3
+ const conversationsResource = "agents/conversations";
4
+ const runsResource = "agents/runs";
5
+ /**
6
+ * @module AgentsApi
7
+ * @description Agent Conversations: long-lived conversations with pinned system
8
+ * prompt + defaults, asynchronous runs that may pause for caller-declared
9
+ * tool outputs, and a versioned delta-cursor message stream.
10
+ *
11
+ * @see https://docs.narrative.io/reference/architecture/agent-conversations
12
+ *
13
+ * @extends BaseApi
14
+ */
15
+ export class AgentsApi extends BaseApi {
16
+ // -------------------- Conversations --------------------
17
+ /**
18
+ * Create an agent conversation. `system_prompt` and `defaults.{tools,mcp_servers}`
19
+ * are pinned at creation; everything else in `defaults` is overridable per-run.
20
+ */
21
+ async createAgentConversation(request) {
22
+ return await this.post(conversationsResource, request);
23
+ }
24
+ /**
25
+ * Read a conversation's metadata + current `version`. Always re-read this
26
+ * immediately before starting a run — `version` is the compare-and-swap
27
+ * token for `expected_version` and a stale value yields 409.
28
+ */
29
+ async getAgentConversation(conversationId) {
30
+ return await this.get(`${conversationsResource}/${conversationId}`);
31
+ }
32
+ /**
33
+ * Delta-read conversation messages with `sequence_no > since`. Use the
34
+ * returned `current_version` as the next call's `since` for gap-free reads.
35
+ */
36
+ async listAgentConversationMessages(conversationId, options) {
37
+ return await this.get(`${conversationsResource}/${conversationId}/messages`, options?.since !== undefined ? { since: options.since } : undefined);
38
+ }
39
+ // -------------------- Runs --------------------
40
+ /**
41
+ * Start a new run on the conversation. Returns immediately with
42
+ * `status: "pending"` — poll {@link getAgentRun} until terminal.
43
+ *
44
+ * - Generate a fresh UUID for `client_op_id` per logical request (it's the
45
+ * idempotency key; reusing one is only safe as a retry).
46
+ * - Set `expected_version` to the value just read from
47
+ * {@link getAgentConversation} — mismatches return 409.
48
+ */
49
+ async createAgentRun(conversationId, request) {
50
+ return await this.post(`${conversationsResource}/${conversationId}/runs`, request);
51
+ }
52
+ /**
53
+ * Read a run's current state. Terminal states: `completed`,
54
+ * `requires_action`, `failed`. Stop polling on any of them.
55
+ */
56
+ async getAgentRun(runId) {
57
+ return await this.get(`${runsResource}/${runId}`);
58
+ }
59
+ /**
60
+ * Convenience: poll {@link getAgentRun} until terminal. Caller is responsible
61
+ * for selecting a reasonable backoff; defaults to 1.5s fixed interval with a
62
+ * 2-minute ceiling.
63
+ *
64
+ * Returns the terminal run. Throws on `failed` only if `throwOnFailed` is
65
+ * true; otherwise the caller inspects `run.status === "failed"`.
66
+ */
67
+ async waitForAgentRun(runId, options = {}) {
68
+ const interval = options.intervalMs ?? 1500;
69
+ const timeout = options.timeoutMs ?? 120_000;
70
+ const deadline = Date.now() + timeout;
71
+ // terminal predicate kept local to avoid an extra import in consumers
72
+ const terminal = (s) => s === "completed" || s === "requires_action" || s === "failed";
73
+ // eslint-disable-next-line no-constant-condition
74
+ while (true) {
75
+ if (options.signal?.aborted) {
76
+ throw new Error("waitForAgentRun aborted");
77
+ }
78
+ const run = await this.getAgentRun(runId);
79
+ options.onTick?.(run);
80
+ if (terminal(run.status)) {
81
+ if (options.throwOnFailed && run.status === "failed") {
82
+ throw Object.assign(new Error(run.error?.message ?? "Agent run failed"), { run });
83
+ }
84
+ return run;
85
+ }
86
+ if (Date.now() >= deadline) {
87
+ throw new Error(`waitForAgentRun timed out after ${timeout}ms`);
88
+ }
89
+ await new Promise((r) => setTimeout(r, interval));
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Agent Conversations API — types.
3
+ *
4
+ * Mirrors `/agents/conversations` and `/agents/runs` on the Narrative Data
5
+ * Collaboration Platform (RFC 7807 errors; OpenAI-Assistants-shaped semantics).
6
+ *
7
+ * Two tool dimensions:
8
+ * - `mcp_servers[]` — server-side, resolved by the platform via MCP. Model sees
9
+ * each tool as `{alias}-{name}`.
10
+ * - `tools[]` — caller-declared. Dash-free names. When called, the run pauses
11
+ * at `requires_action`; resume by posting a follow-up run with
12
+ * `payload.kind: "tool_outputs"`.
13
+ */
14
+ export type ConversationId = string;
15
+ export type RunId = string;
16
+ export type ClientOpId = string;
17
+ export type ConversationVersion = number;
18
+ export type ToolUseId = string;
19
+ export type AgentModel = "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini" | (string & {});
20
+ export type ExecutionCluster = "shared" | "dedicated";
21
+ /** Subset of JSON Schema Draft 2020-12 accepted by Bedrock structured output. */
22
+ export type JsonSchemaObject = Record<string, unknown>;
23
+ export interface McpServerConfig {
24
+ /** 1–8 char `[a-zA-Z][a-zA-Z0-9]{0,7}` — namespace prefix for the server's tools. */
25
+ alias: string;
26
+ url: string;
27
+ description?: string;
28
+ }
29
+ export interface ToolSpec {
30
+ /** Caller-declared tools must NOT contain a dash. MCP tools' bare name. */
31
+ name: string;
32
+ description: string;
33
+ input_schema: JsonSchemaObject;
34
+ /** Defaults to true. Leave true in production. */
35
+ strict?: boolean;
36
+ }
37
+ export interface ConversationDefaults {
38
+ model: AgentModel;
39
+ data_plane_id: string;
40
+ execution_cluster: ExecutionCluster;
41
+ compute_pool_id?: string;
42
+ max_iterations?: number;
43
+ max_tokens?: number;
44
+ temperature?: number;
45
+ output_format_schema?: JsonSchemaObject;
46
+ mcp_servers?: McpServerConfig[];
47
+ tools?: ToolSpec[];
48
+ }
49
+ export interface CreateConversationRequest {
50
+ name?: string;
51
+ system_prompt?: string;
52
+ defaults: ConversationDefaults;
53
+ }
54
+ export interface ConversationResponse {
55
+ id: ConversationId;
56
+ company_id: number;
57
+ user_id: number;
58
+ name: string | null;
59
+ system_prompt: string | null;
60
+ defaults: ConversationDefaults;
61
+ version: ConversationVersion;
62
+ created_at: string;
63
+ updated_at: string;
64
+ }
65
+ export type RunStatus = "pending" | "running" | "completed" | "requires_action" | "failed";
66
+ export interface UserMessagePayload {
67
+ kind: "user_message";
68
+ text: string;
69
+ }
70
+ export interface ToolOutput {
71
+ tool_use_id: ToolUseId;
72
+ /** Plain text. Serialize JSON results before sending. */
73
+ content: string;
74
+ is_error?: boolean;
75
+ }
76
+ export interface ToolOutputsPayload {
77
+ kind: "tool_outputs";
78
+ outputs: ToolOutput[];
79
+ }
80
+ export type RunPayload = UserMessagePayload | ToolOutputsPayload;
81
+ export type ToolChoice = {
82
+ kind: "auto";
83
+ } | {
84
+ kind: "any";
85
+ } | {
86
+ kind: "specific_tool";
87
+ name: string;
88
+ /** Set when pinning an MCP-resolved tool; omit for caller-declared. */
89
+ mcp_alias?: string | null;
90
+ };
91
+ /** Sparse override applied per-run; lists replace wholesale. */
92
+ export interface RunConfigOverride {
93
+ model?: AgentModel;
94
+ data_plane_id?: string;
95
+ execution_cluster?: ExecutionCluster;
96
+ compute_pool_id?: string;
97
+ max_iterations?: number;
98
+ max_tokens?: number;
99
+ temperature?: number;
100
+ output_format_schema?: JsonSchemaObject;
101
+ mcp_servers?: McpServerConfig[];
102
+ tools?: ToolSpec[];
103
+ }
104
+ export interface CreateRunRequest {
105
+ client_op_id: ClientOpId;
106
+ expected_version: ConversationVersion;
107
+ payload: RunPayload;
108
+ tool_choice?: ToolChoice;
109
+ config_override?: RunConfigOverride;
110
+ }
111
+ export interface PendingToolCall {
112
+ tool_use_id: ToolUseId;
113
+ /** Wire-form name. For caller-declared tools, dash-free. */
114
+ name: string;
115
+ arguments: Record<string, unknown>;
116
+ }
117
+ export interface AgentInferenceUsage {
118
+ prompt_tokens: number;
119
+ completion_tokens: number;
120
+ total_tokens: number;
121
+ }
122
+ export interface RunError {
123
+ /** Stable incident code, e.g. "AgentLoopMaxIterationsExceeded". */
124
+ type: string;
125
+ message: string;
126
+ title?: string;
127
+ docs_url?: string;
128
+ }
129
+ export interface RunResponse {
130
+ id: RunId;
131
+ conversation_id: ConversationId;
132
+ company_id: number;
133
+ user_id: number;
134
+ client_op_id: ClientOpId;
135
+ status: RunStatus;
136
+ tool_choice?: ToolChoice;
137
+ effective_config: ConversationDefaults;
138
+ iterations_used?: number | null;
139
+ usage?: AgentInferenceUsage | null;
140
+ submitted_inference_job_ids: string[];
141
+ pending_tool_calls: PendingToolCall[];
142
+ final_text?: string | null;
143
+ error?: RunError | null;
144
+ started_at: string;
145
+ completed_at?: string | null;
146
+ }
147
+ export type AgentMessageRole = "user" | "assistant" | "tool";
148
+ export interface TextContentBlock {
149
+ type: "text";
150
+ text: string;
151
+ }
152
+ export interface ToolUseContentBlock {
153
+ type: "tool_use";
154
+ tool_use_id: ToolUseId;
155
+ /** Fully-aliased wire name (`{alias}-{tool_name}` for MCP, bare for caller-declared). */
156
+ name: string;
157
+ arguments: Record<string, unknown>;
158
+ }
159
+ export interface ToolResultContentBlock {
160
+ type: "tool_result";
161
+ tool_use_id: ToolUseId;
162
+ content: ContentBlock[];
163
+ is_error: boolean;
164
+ }
165
+ export type ContentBlock = TextContentBlock | ToolUseContentBlock | ToolResultContentBlock;
166
+ export interface MessageDto {
167
+ id: string;
168
+ sequence_no: number;
169
+ role: AgentMessageRole;
170
+ content_blocks: ContentBlock[];
171
+ run_id: RunId;
172
+ created_at: string;
173
+ }
174
+ export interface ListMessagesResponse {
175
+ current_version: ConversationVersion;
176
+ messages: MessageDto[];
177
+ }
178
+ export interface AgentRfcError {
179
+ type?: string | null;
180
+ title: string;
181
+ status: number;
182
+ detail?: string;
183
+ instance?: string;
184
+ log_id: string;
185
+ debug?: Record<string, unknown> | null;
186
+ }
187
+ export declare const TERMINAL_RUN_STATUSES: ReadonlyArray<RunStatus>;
188
+ export declare function isTerminalRunStatus(status: RunStatus): boolean;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Agent Conversations API — types.
3
+ *
4
+ * Mirrors `/agents/conversations` and `/agents/runs` on the Narrative Data
5
+ * Collaboration Platform (RFC 7807 errors; OpenAI-Assistants-shaped semantics).
6
+ *
7
+ * Two tool dimensions:
8
+ * - `mcp_servers[]` — server-side, resolved by the platform via MCP. Model sees
9
+ * each tool as `{alias}-{name}`.
10
+ * - `tools[]` — caller-declared. Dash-free names. When called, the run pauses
11
+ * at `requires_action`; resume by posting a follow-up run with
12
+ * `payload.kind: "tool_outputs"`.
13
+ */
14
+ // Terminal states helper
15
+ export const TERMINAL_RUN_STATUSES = [
16
+ "completed",
17
+ "requires_action",
18
+ "failed",
19
+ ];
20
+ export function isTerminalRunStatus(status) {
21
+ return TERMINAL_RUN_STATUSES.includes(status);
22
+ }
@@ -1,5 +1,4 @@
1
1
  import { BaseApi } from "../base-api";
2
- import type { JsonSchemaConnectorPolicy } from "../collaboration-policy/core/jsonschema/json-schema-types";
3
2
  import type { ApiRecords } from "../types";
4
3
  import type { App, Installation } from "./types";
5
4
  /**
@@ -15,11 +14,5 @@ declare class AppsApi extends BaseApi {
15
14
  */
16
15
  getApps(appCategory?: string): Promise<ApiRecords<App>>;
17
16
  getInstalledApps(appCategory?: string): Promise<ApiRecords<Installation>>;
18
- /**
19
- * Get all interfaces for the current user's installed connectors.
20
- * @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
21
- * @returns {Promise<ApiRecords<JsonSchemaConnectorPolicy>>} - Promise resolving with the list of interfaces.
22
- */
23
- getInstalledInterfaces(tags?: string[]): Promise<ApiRecords<JsonSchemaConnectorPolicy>>;
24
17
  }
25
18
  export { type App, AppsApi, type Installation };
@@ -21,14 +21,5 @@ class AppsApi extends BaseApi {
21
21
  const url = `installations${appCategoryQuery}`;
22
22
  return await this.get(url);
23
23
  }
24
- /**
25
- * Get all interfaces for the current user's installed connectors.
26
- * @param {string[]} [tags] - Optional tags to filter interfaces (e.g. ["audience_delivery"]).
27
- * @returns {Promise<ApiRecords<JsonSchemaConnectorPolicy>>} - Promise resolving with the list of interfaces.
28
- */
29
- async getInstalledInterfaces(tags) {
30
- const queryString = this.constructQueryString(tags != null ? { tags } : undefined);
31
- return await this.get(`${resourceName}/installed/interfaces${queryString}`);
32
- }
33
24
  }
34
25
  export { AppsApi };
@@ -1,12 +1,6 @@
1
1
  import { normalizePathValue } from "../utils/path-helpers";
2
2
  import { resolveAttributeExpression } from "../utils/sql-helpers";
3
- function isAttributeReference(node) {
4
- return (!!node &&
5
- typeof node === "object" &&
6
- "type" in node &&
7
- node.type === "attribute" &&
8
- "attribute_name" in node);
9
- }
3
+ import { isAttributeReference } from "./filter-utils";
10
4
  export function filterToSql(filter, attributeByName, datasetName) {
11
5
  const op = filter.op.toLowerCase();
12
6
  switch (op) {
@@ -1,91 +1,20 @@
1
- /**
2
- * PathValue describes a path to a subfield, expressed as either dot notation
3
- * or a JSON Pointer. Used in filter attribute references to specify which
4
- * subfield of an attribute to operate on.
5
- */
6
- export type PathValue = {
7
- dot: string;
8
- } | {
9
- pointer: string;
10
- };
11
- /**
12
- * An attribute reference within a filter expression.
13
- */
14
- export interface FilterAttributeRef {
15
- type: "attribute";
16
- attribute_name: string;
17
- path?: PathValue;
18
- }
19
- /**
20
- * A filter expression: a literal value or an attribute reference.
21
- */
22
- export type FilterExpression = string | number | boolean | FilterAttributeRef;
23
- /**
24
- * PolicyFilter is a single filter entry in a policy definition.
25
- *
26
- * This is the canonical filter type used across the codebase (JSON-Schema
27
- * filters, SQL builder, etc.).
28
- */
29
- export type PolicyFilter = PolicyFilterAndOr | PolicyFilterNot | PolicyFilterIsNull | PolicyFilterIn | PolicyFilterCompare | PolicyFilterBetween;
30
- interface PolicyFilterBase {
31
- stage?: "generation";
32
- name?: string;
33
- required?: boolean;
34
- }
35
- interface PolicyFilterAndOr extends PolicyFilterBase {
36
- op: "and" | "or";
37
- args: FilterExpression[];
38
- }
39
- interface PolicyFilterNot extends PolicyFilterBase {
40
- op: "not";
41
- args: FilterExpression[];
42
- }
43
- interface PolicyFilterIsNull extends PolicyFilterBase {
44
- op: "is_null" | "is_not_null";
45
- left: FilterExpression;
46
- }
47
- interface PolicyFilterIn extends PolicyFilterBase {
48
- op: "in" | "not in";
49
- left: FilterExpression;
50
- right: FilterExpression[];
51
- }
52
- interface PolicyFilterCompare extends PolicyFilterBase {
53
- op: "=" | "<>" | ">" | ">=" | "<" | "<=" | "like" | "not like";
54
- left: FilterExpression;
55
- right: FilterExpression;
56
- }
57
- interface PolicyFilterBetween extends PolicyFilterBase {
58
- op: "between";
59
- operand: FilterExpression;
60
- lower: FilterExpression;
61
- upper: FilterExpression;
62
- }
63
- /**
64
- * Map from attribute name -> set of normalized paths that must be selected
65
- * for SQL generation.
66
- */
1
+ import type { CollaborationPolicyType } from "../types";
2
+ type PolicyDefinition = CollaborationPolicyType["policy"]["definition"];
3
+ export type StructureNode = PolicyDefinition["structure"];
4
+ export type ExtendedAttributeNode = Extract<StructureNode, {
5
+ field: unknown;
6
+ }>;
7
+ export type PolicyFilter = NonNullable<PolicyDefinition["filters"]>[number];
8
+ export type PathValue = NonNullable<ExtendedAttributeNode["field"]["additional_required_properties"]>[number];
67
9
  export type AttributePathIndex = Map<string, Set<string>>;
68
- /**
69
- * A logical group of SQL fragments combined by an operation.
70
- */
71
10
  export interface PolicySqlGroup {
72
11
  fragments: Array<string | PolicySqlGroup>;
73
12
  operation: "AND" | "OR";
74
13
  }
75
- /**
76
- * Core SQL fragments required to represent a set of collaboration policies.
77
- */
78
14
  export interface PolicySqlFragments {
79
15
  select: string[];
80
16
  where: Array<PolicySqlGroup | string>;
81
17
  }
82
- /**
83
- * Full result of applying collaboration policies to a dataset, including:
84
- * - which policies were applied
85
- * - which were skipped and why
86
- * - warnings
87
- * - the minimum refresh schedule across applied policies
88
- */
89
18
  export interface PolicyMatchResult extends PolicySqlFragments {
90
19
  appliedPolicies: string[];
91
20
  skippedPolicies: Array<{
@@ -94,7 +23,7 @@ export interface PolicyMatchResult extends PolicySqlFragments {
94
23
  details: string[];
95
24
  }>;
96
25
  warnings: string[];
97
- /** The minimum refresh schedule as an ISO 8601 duration string across all evaluated policies */
98
- refresh_schedule: string;
26
+ /** The minimum refresh schedule in milliseconds across all evaluated policies */
27
+ refresh_schedule: number;
99
28
  }
100
29
  export {};
@@ -1,5 +1,4 @@
1
- export type { JsonSchemaConnectorPolicy } from "./core/jsonschema/json-schema-types";
2
- export { evaluateJsonSchemaPolicies } from "./core/jsonschema/policy-evaluator";
3
- export { buildPolicySql, buildPolicySqlWithJsonSchema, buildPolicySqlWithValidation, categorizePolicies, type JsonSchemaPolicyMatchResult, } from "./core/jsonschema/sql-builder";
4
- export type { AttributePathIndex, FilterAttributeRef, FilterExpression, PathValue, PolicyFilter, PolicyMatchResult, PolicySqlFragments, PolicySqlGroup, } from "./core/types";
5
- export { default as useCollaborationPolicy } from "./useCollaborationPolicy";
1
+ export { buildPolicySql, buildPolicySqlWithValidation, categorizePolicies, } from "./core/sql-builder";
2
+ export type { AttributePathIndex, ExtendedAttributeNode, PathValue, PolicyFilter, PolicyMatchResult, PolicySqlFragments, PolicySqlGroup, StructureNode, } from "./core/types";
3
+ export type { CollaborationPolicyInput, CollaborationPolicyType, } from "./types";
4
+ export { buildCollaborationPolicyJsonSchema, CollaborationPolicy, } from "./types";
@@ -1,4 +1,3 @@
1
- export { evaluateJsonSchemaPolicies } from "./core/jsonschema/policy-evaluator";
2
- export { buildPolicySql, buildPolicySqlWithJsonSchema, buildPolicySqlWithValidation, categorizePolicies, } from "./core/jsonschema/sql-builder";
3
- // Hook-style entrypoint
4
- export { default as useCollaborationPolicy } from "./useCollaborationPolicy";
1
+ // Export the main functions
2
+ export { buildPolicySql, buildPolicySqlWithValidation, categorizePolicies, } from "./core/sql-builder";
3
+ export { buildCollaborationPolicyJsonSchema, CollaborationPolicy, } from "./types";