@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.
- package/dist/agent-evals.d.mts +7 -3
- package/dist/agent-evals.d.ts +7 -3
- package/dist/agent-evals.js +423 -37
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +423 -37
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +1 -0
- package/dist/agent-harness.d.ts +1 -0
- package/dist/agent-harness.js +87 -11
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +87 -11
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +114 -18
- package/dist/{client-BZ8NuQ_e.d.ts → client-ButG6ePW.d.ts} +7 -1
- package/dist/{client-CBQFvuKf.d.mts → client-C1UqPDwe.d.mts} +7 -1
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +201 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -29
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-tAz2a16I.d.mts → spend-D2Vy3N1D.d.mts} +113 -4
- package/dist/{spend-tAz2a16I.d.ts → spend-D2Vy3N1D.d.ts} +113 -4
- package/dist/spend.d.mts +1 -2
- package/dist/spend.d.ts +1 -2
- package/package.json +2 -2
|
@@ -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
|
|
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
|
|
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-
|
|
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-
|
|
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.
|
|
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",
|