@granular-software/sdk 0.4.45 → 0.4.46

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.
@@ -1,10 +1,116 @@
1
- import { PermissionProfileFile } from '@granular-software/policy-engine';
2
-
3
1
  /**
4
2
  * @module @granular-software/sdk/types
5
3
  * Type definitions for the Granular SDK
6
4
  */
7
-
5
+ type PolicyOutcome = "allow" | "confirm" | "deny";
6
+ type PolicySource = "manifest" | "permissionProfile" | "builtin";
7
+ type PolicyPredicateSource = "input" | "object" | "stateMachine";
8
+ type PolicyOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists";
9
+ type ConditionIR = {
10
+ kind: "always";
11
+ } | {
12
+ kind: "all";
13
+ conditions: ConditionIR[];
14
+ } | {
15
+ kind: "any";
16
+ conditions: ConditionIR[];
17
+ } | {
18
+ kind: "not";
19
+ condition: ConditionIR;
20
+ } | {
21
+ kind: "predicate";
22
+ source: PolicyPredicateSource;
23
+ path: string[];
24
+ operator: PolicyOperator;
25
+ value?: string | number | boolean | null;
26
+ machine?: string;
27
+ };
28
+ type PolicyOrigin = {
29
+ kind: "manifest";
30
+ manifestId?: string;
31
+ effectKey: string;
32
+ } | {
33
+ kind: "permissionProfile";
34
+ profileName: string;
35
+ permissionProfileVersionId?: string;
36
+ source: PolicySource;
37
+ };
38
+ interface PolicyRuleIR {
39
+ id: string;
40
+ origin: PolicyOrigin;
41
+ outcome: PolicyOutcome;
42
+ reason?: string;
43
+ condition: ConditionIR;
44
+ summary: string;
45
+ }
46
+ interface MatchedPolicy {
47
+ id: string;
48
+ outcome: PolicyOutcome;
49
+ origin: PolicyOrigin;
50
+ reason?: string;
51
+ summary: string;
52
+ }
53
+ interface PolicyDecision {
54
+ outcome: PolicyOutcome;
55
+ matches: MatchedPolicy[];
56
+ }
57
+ interface PolicyEvaluationContext {
58
+ input?: Record<string, unknown> | null;
59
+ object?: Record<string, unknown> | null;
60
+ stateMachines?: Record<string, string | null | undefined> | null;
61
+ }
62
+ interface PermissionProfileFile {
63
+ schemaVersion?: number;
64
+ name: string;
65
+ label?: string;
66
+ description?: string;
67
+ extends?: string;
68
+ defaultsOwnerName?: string;
69
+ source?: PolicySource;
70
+ sourcePath?: string;
71
+ defaults?: {
72
+ actionPolicy?: PolicyOutcome;
73
+ };
74
+ policies?: PermissionPolicySpec[];
75
+ actions?: PermissionActionSpec[];
76
+ }
77
+ interface PermissionPolicySpec {
78
+ id?: string;
79
+ ownerProfileName?: string;
80
+ action?: string;
81
+ on?: string;
82
+ decision?: PolicyOutcome;
83
+ outcome?: PolicyOutcome;
84
+ reason?: string;
85
+ when?: unknown;
86
+ }
87
+ interface PermissionActionSpec {
88
+ id?: string;
89
+ ownerProfileName?: string;
90
+ action: string;
91
+ on?: string;
92
+ allow?: "always";
93
+ deny?: "always";
94
+ confirm?: "always";
95
+ reason?: string;
96
+ allowWhen?: ConditionalPolicySpec[];
97
+ confirmWhen?: ConditionalPolicySpec[];
98
+ denyWhen?: ConditionalPolicySpec[];
99
+ limits?: LimitPolicySpec[];
100
+ }
101
+ interface ConditionalPolicySpec {
102
+ id?: string;
103
+ reason?: string;
104
+ when: unknown;
105
+ }
106
+ interface LimitPolicySpec {
107
+ id?: string;
108
+ input: string | string[];
109
+ upTo?: number;
110
+ above?: number;
111
+ decision: PolicyOutcome;
112
+ reason?: string;
113
+ }
8
114
  /**
9
115
  * Configuration for the Granular client
10
116
  */
@@ -184,6 +290,7 @@ interface ConversationSessionInfo {
184
290
  summary?: string | null;
185
291
  summaryUpdatedAt?: string | null;
186
292
  subjectId?: string | null;
293
+ sessionScope?: string | null;
187
294
  jobCount?: number;
188
295
  toolCallCount?: number;
189
296
  }
@@ -1019,6 +1126,8 @@ interface WSClientOptions {
1019
1126
  token: string;
1020
1127
  tokenProvider?: AccessTokenProvider;
1021
1128
  WebSocketCtor?: any;
1129
+ maxReconnectAttempts?: number;
1130
+ reconnectDelayMs?: number;
1022
1131
  onUnexpectedClose?: (info: WSDisconnectInfo) => void;
1023
1132
  onReconnectError?: (info: WSReconnectErrorInfo) => void;
1024
1133
  }
@@ -1590,4 +1699,4 @@ declare function toGranularHttpBase(apiUrl: string): string;
1590
1699
  declare function buildOpenAISpendEventId(usage: Pick<OpenAIUsageSpendEvent, "requestId">, context?: GranularSpendContext): string | undefined;
1591
1700
  declare function recordOpenAIUsageSpend(options: RecordOpenAIUsageSpendOptions): Promise<RecordOpenAIUsageSpendResult>;
1592
1701
 
1593
- export { type PermissionProfileListResponse as $, type AccessTokenProvider as A, type QuotaPeriod as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type QuotaStatus as F, type GranularSpendContext as G, type SpendSummary as H, type InstanceToolHandler as I, type QuotaLineItemFilter as J, type GranularQuotaPolicy as K, type GranularQuotaProgress as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type QuotaScopeType as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type Sandbox as V, type CreateSandboxData as W, type SandboxListResponse as X, type PermissionRules as Y, type PermissionProfile as Z, type CreatePermissionProfileData as _, type EffectHandlerContext as a, type WSReconnectErrorInfo as a$, type Assignment as a0, type AssignmentListResponse as a1, type BuildPolicy as a2, type VersionTracking as a3, type VersionTag as a4, type EnvironmentData as a5, type CreateEnvironmentData as a6, type EnvironmentListResponse as a7, type Manifest as a8, type ManifestListResponse as a9, type JobFeedbackInput as aA, type JobFeedbackRecord as aB, type EnvironmentFeedbackRecord as aC, type JobSubmitResult as aD, type Job as aE, type ConversationMessageShowRefs as aF, type ConversationMessageInput as aG, type ConversationAppendResult as aH, type SessionConversationMessage as aI, type SessionTimelineEvent as aJ, type SessionFileSource as aK, type SessionFileKind as aL, type SessionFileStatus as aM, type SessionFileRecord as aN, type SessionFileUploadOptions as aO, type SessionJobRecord as aP, type SessionHeapFieldType as aQ, type SessionHeapFieldValue as aR, type SessionHeapVariable as aS, type RecordSearchResult as aT, type RecordSearchOptions as aU, type RecordMentionInput as aV, type SessionDocumentResult as aW, type SessionCollectionListOptions as aX, type SessionJobListOptions as aY, type SessionCollectionListResult as aZ, type WSDisconnectInfo as a_, type BuildStatus as aa, type Build as ab, type Version as ac, type BuildListResponse as ad, type SemanticVersionDiffEntry as ae, type SemanticVersionDiff as af, type ResolvedEffectPostCondition as ag, type ResolvedEffectDryRun as ah, type ResolvedEffectReverse as ai, type ResolvedEffectApprovalRequired as aj, type EffectInvocationMode as ak, type EffectInvocationMetadata as al, type EffectSchema as am, type EffectWithHandler as an, type PublishEffectsResult as ao, type EffectVersionSelector as ap, type ToolInfo as aq, type EffectInfo as ar, type ToolsChangedEvent as as, type EffectsChangedEvent as at, type EffectHandler as au, type InstanceEffectHandler as av, type JobStatus as aw, type JobFeedbackSentiment as ax, type JobFeedbackToolCall as ay, type JobFeedbackMetadata as az, type SessionHeapList as b, type WSClientOptions as b0, type RPCRequest as b1, type RPCResponse as b2, type SyncMessage as b3, type RPCRequestFromServer as b4, type ToolInvokeParams as b5, type ToolResultParams as b6, type ModelRef as b7, type RelationshipInfo as b8, type DefineRelationshipOptions as b9, type ManifestPostConditionSpec as bA, type ManifestDryRunSpec as bB, type ManifestReverseSpec as bC, type ManifestApprovalRequiredSpec as bD, type ManifestRelationshipDef as bE, type ManifestEffectSchema as bF, type ManifestEffectDeclaration as bG, type ManifestEventTypeDef as bH, type ManifestEventStreamDef as bI, type ManifestOperation as bJ, type ManifestImport as bK, type ManifestVolume as bL, type ManifestContent as bM, type GraphQLResult as bN, type APIError as bO, type DeleteResponse as bP, type StreamEvent as bQ, type StreamSubscription as bR, type StreamStats as bS, type RecordObjectOptions as ba, type RecordObjectResult as bb, type RecordObjectsChunkInfo as bc, type RecordObjectsOptions as bd, type RecordImportWriteMode as be, type RecordImportOptions as bf, type RecordImportStatus as bg, type RecordImportItemStatus as bh, type RecordImportStats as bi, type RecordImportItem as bj, type RecordImport as bk, type EnvironmentRecordImportSummary as bl, type EnvironmentSetupTriggerReason as bm, type RunEnvironmentImporterOptions as bn, type EnvironmentSetupLifecycleStatus as bo, type EnvironmentSetupSummary as bp, type EnvironmentImporterImportOptions as bq, type EnvironmentImporter as br, type ManifestPropertySpec as bs, type ManifestValidationOperator as bt, type ManifestEnumRuleSpec as bu, type ManifestFilterBySpec as bv, type ManifestValidationRuleSpec as bw, type ManifestStateMachineStateSpec as bx, type ManifestStateMachineTransitionSpec as by, type ManifestStateMachineSpec as bz, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type GranularOptions as q, recordOpenAIUsageSpend as r, type GranularAuth as s, toGranularHttpBase as t, type RecordUserOptions as u, type Subject as v, type OpenEnvironmentOptions as w, type CreateSessionOptions as x, type ConversationSessionInfo as y, type SpendLineItemType as z };
1702
+ export { type ConversationSessionInfo as $, type PolicyEvaluationContext as A, type PermissionProfileFile as B, type ConditionIR as C, type DomainState as D, type EndpointMode as E, type PermissionPolicySpec as F, type GranularSpendContext as G, type PermissionActionSpec as H, type InstanceToolHandler as I, type ConditionalPolicySpec as J, type AccessTokenProvider as K, type LimitPolicySpec as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type GranularOptions as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type GranularAuth as U, type User as V, type RecordUserOptions as W, type Subject as X, type OpenEnvironmentOptions as Y, type ConnectOptions as Z, type CreateSessionOptions as _, type EffectHandlerContext as a, type SessionFileStatus as a$, type SpendLineItemType as a0, type QuotaScopeType as a1, type QuotaPeriod as a2, type QuotaStatus as a3, type SpendSummary as a4, type QuotaLineItemFilter as a5, type GranularQuotaPolicy as a6, type GranularQuotaProgress as a7, type Sandbox as a8, type CreateSandboxData as a9, type EffectInvocationMetadata as aA, type EffectSchema as aB, type EffectWithHandler as aC, type PublishEffectsResult as aD, type EffectVersionSelector as aE, type ToolInfo as aF, type EffectInfo as aG, type ToolsChangedEvent as aH, type EffectsChangedEvent as aI, type EffectHandler as aJ, type InstanceEffectHandler as aK, type JobStatus as aL, type JobFeedbackSentiment as aM, type JobFeedbackToolCall as aN, type JobFeedbackMetadata as aO, type JobFeedbackInput as aP, type JobFeedbackRecord as aQ, type EnvironmentFeedbackRecord as aR, type JobSubmitResult as aS, type Job as aT, type ConversationMessageShowRefs as aU, type ConversationMessageInput as aV, type ConversationAppendResult as aW, type SessionConversationMessage as aX, type SessionTimelineEvent as aY, type SessionFileSource as aZ, type SessionFileKind as a_, type SandboxListResponse as aa, type PermissionRules as ab, type PermissionProfile as ac, type CreatePermissionProfileData as ad, type PermissionProfileListResponse as ae, type Assignment as af, type AssignmentListResponse as ag, type BuildPolicy as ah, type VersionTracking as ai, type VersionTag as aj, type EnvironmentData as ak, type CreateEnvironmentData as al, type EnvironmentListResponse as am, type Manifest as an, type ManifestListResponse as ao, type BuildStatus as ap, type Build as aq, type Version as ar, type BuildListResponse as as, type SemanticVersionDiffEntry as at, type SemanticVersionDiff as au, type ResolvedEffectPostCondition as av, type ResolvedEffectDryRun as aw, type ResolvedEffectReverse as ax, type ResolvedEffectApprovalRequired as ay, type EffectInvocationMode as az, type SessionHeapList as b, type ManifestContent as b$, type SessionFileRecord as b0, type SessionFileUploadOptions as b1, type SessionJobRecord as b2, type SessionHeapFieldType as b3, type SessionHeapFieldValue as b4, type SessionHeapVariable as b5, type RecordSearchResult as b6, type RecordSearchOptions as b7, type RecordMentionInput as b8, type SessionDocumentResult as b9, type EnvironmentRecordImportSummary as bA, type EnvironmentSetupTriggerReason as bB, type RunEnvironmentImporterOptions as bC, type EnvironmentSetupLifecycleStatus as bD, type EnvironmentSetupSummary as bE, type EnvironmentImporterImportOptions as bF, type EnvironmentImporter as bG, type ManifestPropertySpec as bH, type ManifestValidationOperator as bI, type ManifestEnumRuleSpec as bJ, type ManifestFilterBySpec as bK, type ManifestValidationRuleSpec as bL, type ManifestStateMachineStateSpec as bM, type ManifestStateMachineTransitionSpec as bN, type ManifestStateMachineSpec as bO, type ManifestPostConditionSpec as bP, type ManifestDryRunSpec as bQ, type ManifestReverseSpec as bR, type ManifestApprovalRequiredSpec as bS, type ManifestRelationshipDef as bT, type ManifestEffectSchema as bU, type ManifestEffectDeclaration as bV, type ManifestEventTypeDef as bW, type ManifestEventStreamDef as bX, type ManifestOperation as bY, type ManifestImport as bZ, type ManifestVolume as b_, type SessionCollectionListOptions as ba, type SessionJobListOptions as bb, type SessionCollectionListResult as bc, type WSDisconnectInfo as bd, type WSReconnectErrorInfo as be, type WSClientOptions as bf, type RPCRequest as bg, type RPCResponse as bh, type SyncMessage as bi, type RPCRequestFromServer as bj, type ToolInvokeParams as bk, type ToolResultParams as bl, type ModelRef as bm, type RelationshipInfo as bn, type DefineRelationshipOptions as bo, type RecordObjectOptions as bp, type RecordObjectResult as bq, type RecordObjectsChunkInfo as br, type RecordObjectsOptions as bs, type RecordImportWriteMode as bt, type RecordImportOptions as bu, type RecordImportStatus as bv, type RecordImportItemStatus as bw, type RecordImportStats as bx, type RecordImportItem as by, type RecordImport as bz, type SessionHeapSnapshot as c, type GraphQLResult as c0, type APIError as c1, type DeleteResponse as c2, type StreamEvent as c3, type StreamSubscription as c4, type StreamStats as c5, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type PolicyOutcome as q, recordOpenAIUsageSpend as r, type PolicySource as s, toGranularHttpBase as t, type PolicyPredicateSource as u, type PolicyOperator as v, type PolicyOrigin as w, type PolicyRuleIR as x, type MatchedPolicy as y, type PolicyDecision as z };
@@ -1,10 +1,116 @@
1
- import { PermissionProfileFile } from '@granular-software/policy-engine';
2
-
3
1
  /**
4
2
  * @module @granular-software/sdk/types
5
3
  * Type definitions for the Granular SDK
6
4
  */
7
-
5
+ type PolicyOutcome = "allow" | "confirm" | "deny";
6
+ type PolicySource = "manifest" | "permissionProfile" | "builtin";
7
+ type PolicyPredicateSource = "input" | "object" | "stateMachine";
8
+ type PolicyOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "not_contains" | "starts_with" | "ends_with" | "exists";
9
+ type ConditionIR = {
10
+ kind: "always";
11
+ } | {
12
+ kind: "all";
13
+ conditions: ConditionIR[];
14
+ } | {
15
+ kind: "any";
16
+ conditions: ConditionIR[];
17
+ } | {
18
+ kind: "not";
19
+ condition: ConditionIR;
20
+ } | {
21
+ kind: "predicate";
22
+ source: PolicyPredicateSource;
23
+ path: string[];
24
+ operator: PolicyOperator;
25
+ value?: string | number | boolean | null;
26
+ machine?: string;
27
+ };
28
+ type PolicyOrigin = {
29
+ kind: "manifest";
30
+ manifestId?: string;
31
+ effectKey: string;
32
+ } | {
33
+ kind: "permissionProfile";
34
+ profileName: string;
35
+ permissionProfileVersionId?: string;
36
+ source: PolicySource;
37
+ };
38
+ interface PolicyRuleIR {
39
+ id: string;
40
+ origin: PolicyOrigin;
41
+ outcome: PolicyOutcome;
42
+ reason?: string;
43
+ condition: ConditionIR;
44
+ summary: string;
45
+ }
46
+ interface MatchedPolicy {
47
+ id: string;
48
+ outcome: PolicyOutcome;
49
+ origin: PolicyOrigin;
50
+ reason?: string;
51
+ summary: string;
52
+ }
53
+ interface PolicyDecision {
54
+ outcome: PolicyOutcome;
55
+ matches: MatchedPolicy[];
56
+ }
57
+ interface PolicyEvaluationContext {
58
+ input?: Record<string, unknown> | null;
59
+ object?: Record<string, unknown> | null;
60
+ stateMachines?: Record<string, string | null | undefined> | null;
61
+ }
62
+ interface PermissionProfileFile {
63
+ schemaVersion?: number;
64
+ name: string;
65
+ label?: string;
66
+ description?: string;
67
+ extends?: string;
68
+ defaultsOwnerName?: string;
69
+ source?: PolicySource;
70
+ sourcePath?: string;
71
+ defaults?: {
72
+ actionPolicy?: PolicyOutcome;
73
+ };
74
+ policies?: PermissionPolicySpec[];
75
+ actions?: PermissionActionSpec[];
76
+ }
77
+ interface PermissionPolicySpec {
78
+ id?: string;
79
+ ownerProfileName?: string;
80
+ action?: string;
81
+ on?: string;
82
+ decision?: PolicyOutcome;
83
+ outcome?: PolicyOutcome;
84
+ reason?: string;
85
+ when?: unknown;
86
+ }
87
+ interface PermissionActionSpec {
88
+ id?: string;
89
+ ownerProfileName?: string;
90
+ action: string;
91
+ on?: string;
92
+ allow?: "always";
93
+ deny?: "always";
94
+ confirm?: "always";
95
+ reason?: string;
96
+ allowWhen?: ConditionalPolicySpec[];
97
+ confirmWhen?: ConditionalPolicySpec[];
98
+ denyWhen?: ConditionalPolicySpec[];
99
+ limits?: LimitPolicySpec[];
100
+ }
101
+ interface ConditionalPolicySpec {
102
+ id?: string;
103
+ reason?: string;
104
+ when: unknown;
105
+ }
106
+ interface LimitPolicySpec {
107
+ id?: string;
108
+ input: string | string[];
109
+ upTo?: number;
110
+ above?: number;
111
+ decision: PolicyOutcome;
112
+ reason?: string;
113
+ }
8
114
  /**
9
115
  * Configuration for the Granular client
10
116
  */
@@ -184,6 +290,7 @@ interface ConversationSessionInfo {
184
290
  summary?: string | null;
185
291
  summaryUpdatedAt?: string | null;
186
292
  subjectId?: string | null;
293
+ sessionScope?: string | null;
187
294
  jobCount?: number;
188
295
  toolCallCount?: number;
189
296
  }
@@ -1019,6 +1126,8 @@ interface WSClientOptions {
1019
1126
  token: string;
1020
1127
  tokenProvider?: AccessTokenProvider;
1021
1128
  WebSocketCtor?: any;
1129
+ maxReconnectAttempts?: number;
1130
+ reconnectDelayMs?: number;
1022
1131
  onUnexpectedClose?: (info: WSDisconnectInfo) => void;
1023
1132
  onReconnectError?: (info: WSReconnectErrorInfo) => void;
1024
1133
  }
@@ -1590,4 +1699,4 @@ declare function toGranularHttpBase(apiUrl: string): string;
1590
1699
  declare function buildOpenAISpendEventId(usage: Pick<OpenAIUsageSpendEvent, "requestId">, context?: GranularSpendContext): string | undefined;
1591
1700
  declare function recordOpenAIUsageSpend(options: RecordOpenAIUsageSpendOptions): Promise<RecordOpenAIUsageSpendResult>;
1592
1701
 
1593
- export { type PermissionProfileListResponse as $, type AccessTokenProvider as A, type QuotaPeriod as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type QuotaStatus as F, type GranularSpendContext as G, type SpendSummary as H, type InstanceToolHandler as I, type QuotaLineItemFilter as J, type GranularQuotaPolicy as K, type GranularQuotaProgress as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type QuotaScopeType as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type Sandbox as V, type CreateSandboxData as W, type SandboxListResponse as X, type PermissionRules as Y, type PermissionProfile as Z, type CreatePermissionProfileData as _, type EffectHandlerContext as a, type WSReconnectErrorInfo as a$, type Assignment as a0, type AssignmentListResponse as a1, type BuildPolicy as a2, type VersionTracking as a3, type VersionTag as a4, type EnvironmentData as a5, type CreateEnvironmentData as a6, type EnvironmentListResponse as a7, type Manifest as a8, type ManifestListResponse as a9, type JobFeedbackInput as aA, type JobFeedbackRecord as aB, type EnvironmentFeedbackRecord as aC, type JobSubmitResult as aD, type Job as aE, type ConversationMessageShowRefs as aF, type ConversationMessageInput as aG, type ConversationAppendResult as aH, type SessionConversationMessage as aI, type SessionTimelineEvent as aJ, type SessionFileSource as aK, type SessionFileKind as aL, type SessionFileStatus as aM, type SessionFileRecord as aN, type SessionFileUploadOptions as aO, type SessionJobRecord as aP, type SessionHeapFieldType as aQ, type SessionHeapFieldValue as aR, type SessionHeapVariable as aS, type RecordSearchResult as aT, type RecordSearchOptions as aU, type RecordMentionInput as aV, type SessionDocumentResult as aW, type SessionCollectionListOptions as aX, type SessionJobListOptions as aY, type SessionCollectionListResult as aZ, type WSDisconnectInfo as a_, type BuildStatus as aa, type Build as ab, type Version as ac, type BuildListResponse as ad, type SemanticVersionDiffEntry as ae, type SemanticVersionDiff as af, type ResolvedEffectPostCondition as ag, type ResolvedEffectDryRun as ah, type ResolvedEffectReverse as ai, type ResolvedEffectApprovalRequired as aj, type EffectInvocationMode as ak, type EffectInvocationMetadata as al, type EffectSchema as am, type EffectWithHandler as an, type PublishEffectsResult as ao, type EffectVersionSelector as ap, type ToolInfo as aq, type EffectInfo as ar, type ToolsChangedEvent as as, type EffectsChangedEvent as at, type EffectHandler as au, type InstanceEffectHandler as av, type JobStatus as aw, type JobFeedbackSentiment as ax, type JobFeedbackToolCall as ay, type JobFeedbackMetadata as az, type SessionHeapList as b, type WSClientOptions as b0, type RPCRequest as b1, type RPCResponse as b2, type SyncMessage as b3, type RPCRequestFromServer as b4, type ToolInvokeParams as b5, type ToolResultParams as b6, type ModelRef as b7, type RelationshipInfo as b8, type DefineRelationshipOptions as b9, type ManifestPostConditionSpec as bA, type ManifestDryRunSpec as bB, type ManifestReverseSpec as bC, type ManifestApprovalRequiredSpec as bD, type ManifestRelationshipDef as bE, type ManifestEffectSchema as bF, type ManifestEffectDeclaration as bG, type ManifestEventTypeDef as bH, type ManifestEventStreamDef as bI, type ManifestOperation as bJ, type ManifestImport as bK, type ManifestVolume as bL, type ManifestContent as bM, type GraphQLResult as bN, type APIError as bO, type DeleteResponse as bP, type StreamEvent as bQ, type StreamSubscription as bR, type StreamStats as bS, type RecordObjectOptions as ba, type RecordObjectResult as bb, type RecordObjectsChunkInfo as bc, type RecordObjectsOptions as bd, type RecordImportWriteMode as be, type RecordImportOptions as bf, type RecordImportStatus as bg, type RecordImportItemStatus as bh, type RecordImportStats as bi, type RecordImportItem as bj, type RecordImport as bk, type EnvironmentRecordImportSummary as bl, type EnvironmentSetupTriggerReason as bm, type RunEnvironmentImporterOptions as bn, type EnvironmentSetupLifecycleStatus as bo, type EnvironmentSetupSummary as bp, type EnvironmentImporterImportOptions as bq, type EnvironmentImporter as br, type ManifestPropertySpec as bs, type ManifestValidationOperator as bt, type ManifestEnumRuleSpec as bu, type ManifestFilterBySpec as bv, type ManifestValidationRuleSpec as bw, type ManifestStateMachineStateSpec as bx, type ManifestStateMachineTransitionSpec as by, type ManifestStateMachineSpec as bz, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type GranularOptions as q, recordOpenAIUsageSpend as r, type GranularAuth as s, toGranularHttpBase as t, type RecordUserOptions as u, type Subject as v, type OpenEnvironmentOptions as w, type CreateSessionOptions as x, type ConversationSessionInfo as y, type SpendLineItemType as z };
1702
+ export { type ConversationSessionInfo as $, type PolicyEvaluationContext as A, type PermissionProfileFile as B, type ConditionIR as C, type DomainState as D, type EndpointMode as E, type PermissionPolicySpec as F, type GranularSpendContext as G, type PermissionActionSpec as H, type InstanceToolHandler as I, type ConditionalPolicySpec as J, type AccessTokenProvider as K, type LimitPolicySpec as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type GranularOptions as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type GranularAuth as U, type User as V, type RecordUserOptions as W, type Subject as X, type OpenEnvironmentOptions as Y, type ConnectOptions as Z, type CreateSessionOptions as _, type EffectHandlerContext as a, type SessionFileStatus as a$, type SpendLineItemType as a0, type QuotaScopeType as a1, type QuotaPeriod as a2, type QuotaStatus as a3, type SpendSummary as a4, type QuotaLineItemFilter as a5, type GranularQuotaPolicy as a6, type GranularQuotaProgress as a7, type Sandbox as a8, type CreateSandboxData as a9, type EffectInvocationMetadata as aA, type EffectSchema as aB, type EffectWithHandler as aC, type PublishEffectsResult as aD, type EffectVersionSelector as aE, type ToolInfo as aF, type EffectInfo as aG, type ToolsChangedEvent as aH, type EffectsChangedEvent as aI, type EffectHandler as aJ, type InstanceEffectHandler as aK, type JobStatus as aL, type JobFeedbackSentiment as aM, type JobFeedbackToolCall as aN, type JobFeedbackMetadata as aO, type JobFeedbackInput as aP, type JobFeedbackRecord as aQ, type EnvironmentFeedbackRecord as aR, type JobSubmitResult as aS, type Job as aT, type ConversationMessageShowRefs as aU, type ConversationMessageInput as aV, type ConversationAppendResult as aW, type SessionConversationMessage as aX, type SessionTimelineEvent as aY, type SessionFileSource as aZ, type SessionFileKind as a_, type SandboxListResponse as aa, type PermissionRules as ab, type PermissionProfile as ac, type CreatePermissionProfileData as ad, type PermissionProfileListResponse as ae, type Assignment as af, type AssignmentListResponse as ag, type BuildPolicy as ah, type VersionTracking as ai, type VersionTag as aj, type EnvironmentData as ak, type CreateEnvironmentData as al, type EnvironmentListResponse as am, type Manifest as an, type ManifestListResponse as ao, type BuildStatus as ap, type Build as aq, type Version as ar, type BuildListResponse as as, type SemanticVersionDiffEntry as at, type SemanticVersionDiff as au, type ResolvedEffectPostCondition as av, type ResolvedEffectDryRun as aw, type ResolvedEffectReverse as ax, type ResolvedEffectApprovalRequired as ay, type EffectInvocationMode as az, type SessionHeapList as b, type ManifestContent as b$, type SessionFileRecord as b0, type SessionFileUploadOptions as b1, type SessionJobRecord as b2, type SessionHeapFieldType as b3, type SessionHeapFieldValue as b4, type SessionHeapVariable as b5, type RecordSearchResult as b6, type RecordSearchOptions as b7, type RecordMentionInput as b8, type SessionDocumentResult as b9, type EnvironmentRecordImportSummary as bA, type EnvironmentSetupTriggerReason as bB, type RunEnvironmentImporterOptions as bC, type EnvironmentSetupLifecycleStatus as bD, type EnvironmentSetupSummary as bE, type EnvironmentImporterImportOptions as bF, type EnvironmentImporter as bG, type ManifestPropertySpec as bH, type ManifestValidationOperator as bI, type ManifestEnumRuleSpec as bJ, type ManifestFilterBySpec as bK, type ManifestValidationRuleSpec as bL, type ManifestStateMachineStateSpec as bM, type ManifestStateMachineTransitionSpec as bN, type ManifestStateMachineSpec as bO, type ManifestPostConditionSpec as bP, type ManifestDryRunSpec as bQ, type ManifestReverseSpec as bR, type ManifestApprovalRequiredSpec as bS, type ManifestRelationshipDef as bT, type ManifestEffectSchema as bU, type ManifestEffectDeclaration as bV, type ManifestEventTypeDef as bW, type ManifestEventStreamDef as bX, type ManifestOperation as bY, type ManifestImport as bZ, type ManifestVolume as b_, type SessionCollectionListOptions as ba, type SessionJobListOptions as bb, type SessionCollectionListResult as bc, type WSDisconnectInfo as bd, type WSReconnectErrorInfo as be, type WSClientOptions as bf, type RPCRequest as bg, type RPCResponse as bh, type SyncMessage as bi, type RPCRequestFromServer as bj, type ToolInvokeParams as bk, type ToolResultParams as bl, type ModelRef as bm, type RelationshipInfo as bn, type DefineRelationshipOptions as bo, type RecordObjectOptions as bp, type RecordObjectResult as bq, type RecordObjectsChunkInfo as br, type RecordObjectsOptions as bs, type RecordImportWriteMode as bt, type RecordImportOptions as bu, type RecordImportStatus as bv, type RecordImportItemStatus as bw, type RecordImportStats as bx, type RecordImportItem as by, type RecordImport as bz, type SessionHeapSnapshot as c, type GraphQLResult as c0, type APIError as c1, type DeleteResponse as c2, type StreamEvent as c3, type StreamSubscription as c4, type StreamStats as c5, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type PolicyOutcome as q, recordOpenAIUsageSpend as r, type PolicySource as s, toGranularHttpBase as t, type PolicyPredicateSource as u, type PolicyOperator as v, type PolicyOrigin as w, type PolicyRuleIR as x, type MatchedPolicy as y, type PolicyDecision as z };
package/dist/spend.d.mts CHANGED
@@ -1,2 +1 @@
1
- export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-tAz2a16I.mjs';
2
- import '@granular-software/policy-engine';
1
+ export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-D2Vy3N1D.mjs';
package/dist/spend.d.ts CHANGED
@@ -1,2 +1 @@
1
- export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-tAz2a16I.js';
2
- import '@granular-software/policy-engine';
1
+ export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-D2Vy3N1D.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granular-software/sdk",
3
- "version": "0.4.45",
3
+ "version": "0.4.46",
4
4
  "description": "TypeScript SDK and CLI for Granular - define, build, and deploy AI sandboxes",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -64,7 +64,6 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@automerge/automerge": "^3.2.1",
67
- "@granular-software/policy-engine": "workspace:*",
68
67
  "chalk": "^5.4.1",
69
68
  "chokidar": "^4.0.3",
70
69
  "commander": "^13.1.0",
@@ -77,6 +76,7 @@
77
76
  "@granular-software/metamodel-effect-behaviors": "workspace:*",
78
77
  "@granular-software/metamodel-core": "workspace:*",
79
78
  "@granular-software/metamodel-preset-default": "workspace:*",
79
+ "@granular-software/policy-engine": "workspace:*",
80
80
  "@types/commander": "^2.12.5",
81
81
  "@types/node": "^25.2.3",
82
82
  "@types/ws": "^8.18.1",